widgets, fontawesome add

This commit is contained in:
stasbilay02 committed 2025-01-20 16:57:48 +03:00
1 parent 32fbc234ef
commit 22f7ecff6a
25 files changed
+2792 -64

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
/.phpunit.cache
/node_modules
/public/build
/app/build
/public/hot
/public/storage
/storage/*.key
+35
View File
@@ -0,0 +1,35 @@
<?php
namespace App\Widgets;
use Arrilot\Widgets\AbstractWidget;
use itguild\forms\debug\Debug;
class ActionButtonWidget extends AbstractWidget
{
/**
* The configuration array.
*
* @var array
*/
protected $config = [];
/**
* Treat this method as a controller action.
* Return view() or other content to display.
*/
public function run(): \Illuminate\Contracts\View\View|\Illuminate\Contracts\View\Factory|\Illuminate\Foundation\Application
{
$label = $this->config['label'];
$btn_type = $this->config['btn_type'];
$url = $this->config['url'];
$title = $this->config['title'] ?? '';
return view('widgets.action_button_widget', [
'label' => $label,
'btn_type' => $btn_type,
'url' => $url,
'title' => $title
]);
}
}
+33
View File
@@ -0,0 +1,33 @@
<?php
namespace App\Widgets;
use Arrilot\Widgets\AbstractWidget;
class IconBtnCreateWidget extends AbstractWidget
{
/**
* The configuration array.
*
* @var array
*/
protected $config = [];
/**
* Treat this method as a controller action.
* Return view() or other content to display.
*/
public function run(): void
{
$url = $this->config['url'];
$btn = new ActionButtonWidget([
// 'label' => "<i class='fa-regular fa-square-plus'></i>",
'label' => "Создать",
'url' => $url,
'btn_type' => "success",
'title' => "Создать"
]);
$btn->run();
}
}
+1
View File
@@ -7,6 +7,7 @@
"license": "MIT",
"require": {
"php": "^8.2",
"arrilot/laravel-widgets": "^3.14",
"itguild/eloquent-table": "^0.4.1",
"itguild/forms": "^0.1.1",
"itguild/tables": "^1.0",
Generated
+70 -2
View File
@@ -4,8 +4,76 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "1b652e2f5c2b778dd44a54aa287f214d",
"content-hash": "d893f1de2b5bcd2628b67c5c6798a7e4",
"packages": [
{
"name": "arrilot/laravel-widgets",
"version": "3.14.0",
"source": {
"type": "git",
"url": "https://github.com/arrilot/laravel-widgets.git",
"reference": "99419f5b6190825733c731bd3b44f49fdc56a6ad"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/arrilot/laravel-widgets/zipball/99419f5b6190825733c731bd3b44f49fdc56a6ad",
"reference": "99419f5b6190825733c731bd3b44f49fdc56a6ad",
"shasum": ""
},
"require": {
"illuminate/cache": ">=9",
"illuminate/console": ">=9",
"illuminate/container": ">=9",
"illuminate/contracts": ">=9",
"illuminate/routing": ">=9",
"illuminate/support": ">=9",
"illuminate/view": ">=9",
"php": ">=7.4"
},
"require-dev": {
"nunomaduro/larastan": "^2.6",
"phpunit/phpunit": "~8.0"
},
"type": "library",
"extra": {
"laravel": {
"aliases": {
"Widget": "Arrilot\\Widgets\\Facade",
"AsyncWidget": "Arrilot\\Widgets\\AsyncFacade"
},
"providers": [
"Arrilot\\Widgets\\ServiceProvider"
]
}
},
"autoload": {
"psr-4": {
"Arrilot\\Widgets\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Nekrasov Ilya",
"email": "nekrasov.ilya90@gmail.com"
}
],
"description": "A powerful alternative to view composers. Asynchronous widgets, reloadable widgets, console generator, caching - everything you can think of.",
"homepage": "https://github.com/arrilot/laravel-widgets",
"keywords": [
"ajax",
"laravel",
"widgets"
],
"support": {
"issues": "https://github.com/arrilot/laravel-widgets/issues",
"source": "https://github.com/arrilot/laravel-widgets/tree/3.14.0"
},
"time": "2023-11-19T18:27:27+00:00"
},
{
"name": "brick/math",
"version": "0.12.1",
@@ -8470,5 +8538,5 @@
"php": "^8.2"
},
"platform-dev": [],
"plugin-api-version": "2.3.0"
"plugin-api-version": "2.6.0"
}
+2470 -1
View File
File diff suppressed because it is too large. Load diff
+5
View File
@@ -16,5 +16,10 @@
"sass": "^1.56.1",
"tailwindcss": "^3.4.13",
"vite": "^6.0"
},
"dependencies": {
"@fortawesome/fontawesome-free": "^6.7.2",
"font-awesome": "^4.7.0",
"npm": "^11.0.0"
}
}
+10
View File
@@ -0,0 +1,10 @@
var P="top",B="bottom",j="right",M="left",Pe="auto",Ut=[P,B,j,M],wt="start",Mt="end",ir="clippingParents",$n="viewport",$t="popper",or="reference",bn=Ut.reduce(function(e,t){return e.concat([t+"-"+wt,t+"-"+Mt])},[]),In=[].concat(Ut,[Pe]).reduce(function(e,t){return e.concat([t,t+"-"+wt,t+"-"+Mt])},[]),ar="beforeRead",cr="read",lr="afterRead",ur="beforeMain",fr="main",dr="afterMain",hr="beforeWrite",pr="write",mr="afterWrite",_r=[ar,cr,lr,ur,fr,dr,hr,pr,mr];function et(e){return e?(e.nodeName||"").toLowerCase():null}function U(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Ot(e){var t=U(e).Element;return e instanceof t||e instanceof Element}function W(e){var t=U(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function xn(e){if(typeof ShadowRoot>"u")return!1;var t=U(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function Pi(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var s=t.styles[n]||{},r=t.attributes[n]||{},i=t.elements[n];!W(i)||!et(i)||(Object.assign(i.style,s),Object.keys(r).forEach(function(o){var a=r[o];a===!1?i.removeAttribute(o):i.setAttribute(o,a===!0?"":a)}))})}function Mi(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(s){var r=t.elements[s],i=t.attributes[s]||{},o=Object.keys(t.styles.hasOwnProperty(s)?t.styles[s]:n[s]),a=o.reduce(function(l,u){return l[u]="",l},{});!W(r)||!et(r)||(Object.assign(r.style,a),Object.keys(i).forEach(function(l){r.removeAttribute(l)}))})}}const Pn={name:"applyStyles",enabled:!0,phase:"write",fn:Pi,effect:Mi,requires:["computeStyles"]};function Z(e){return e.split("-")[0]}var At=Math.max,De=Math.min,kt=Math.round;function yn(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function gr(){return!/^((?!chrome|android).)*safari/i.test(yn())}function Ft(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var s=e.getBoundingClientRect(),r=1,i=1;t&&W(e)&&(r=e.offsetWidth>0&&kt(s.width)/e.offsetWidth||1,i=e.offsetHeight>0&&kt(s.height)/e.offsetHeight||1);var o=Ot(e)?U(e):window,a=o.visualViewport,l=!gr()&&n,u=(s.left+(l&&a?a.offsetLeft:0))/r,c=(s.top+(l&&a?a.offsetTop:0))/i,h=s.width/r,g=s.height/i;return{width:h,height:g,top:c,right:u+h,bottom:c+g,left:u,x:u,y:c}}function Mn(e){var t=Ft(e),n=e.offsetWidth,s=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-s)<=1&&(s=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:s}}function Er(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&xn(n)){var s=t;do{if(s&&e.isSameNode(s))return!0;s=s.parentNode||s.host}while(s)}return!1}function rt(e){return U(e).getComputedStyle(e)}function ki(e){return["table","td","th"].indexOf(et(e))>=0}function ft(e){return((Ot(e)?e.ownerDocument:e.document)||window.document).documentElement}function Me(e){return et(e)==="html"?e:e.assignedSlot||e.parentNode||(xn(e)?e.host:null)||ft(e)}function ls(e){return!W(e)||rt(e).position==="fixed"?null:e.offsetParent}function Fi(e){var t=/firefox/i.test(yn()),n=/Trident/i.test(yn());if(n&&W(e)){var s=rt(e);if(s.position==="fixed")return null}var r=Me(e);for(xn(r)&&(r=r.host);W(r)&&["html","body"].indexOf(et(r))<0;){var i=rt(r);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||t&&i.willChange==="filter"||t&&i.filter&&i.filter!=="none")return r;r=r.parentNode}return null}function re(e){for(var t=U(e),n=ls(e);n&&ki(n)&&rt(n).position==="static";)n=ls(n);return n&&(et(n)==="html"||et(n)==="body"&&rt(n).position==="static")?t:n||Fi(e)||t}function kn(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function te(e,t,n){return At(e,De(t,n))}function Vi(e,t,n){var s=te(e,t,n);return s>n?n:s}function br(){return{top:0,right:0,bottom:0,left:0}}function yr(e){return Object.assign({},br(),e)}function vr(e,t){return t.reduce(function(n,s){return n[s]=e,n},{})}var Hi=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,yr(typeof t!="number"?t:vr(t,Ut))};function Bi(e){var t,n=e.state,s=e.name,r=e.options,i=n.elements.arrow,o=n.modifiersData.popperOffsets,a=Z(n.placement),l=kn(a),u=[M,j].indexOf(a)>=0,c=u?"height":"width";if(!(!i||!o)){var h=Hi(r.padding,n),g=Mn(i),E=l==="y"?P:M,m=l==="y"?B:j,_=n.rects.reference[c]+n.rects.reference[l]-o[l]-n.rects.popper[c],p=o[l]-n.rects.reference[l],y=re(i),w=y?l==="y"?y.clientHeight||0:y.clientWidth||0:0,O=_/2-p/2,v=h[E],A=w-g[c]-h[m],S=w/2-g[c]/2+O,C=te(v,S,A),N=l;n.modifiersData[s]=(t={},t[N]=C,t.centerOffset=C-S,t)}}function ji(e){var t=e.state,n=e.options,s=n.element,rLine truncated
* Bootstrap v5.3.3 (https://getbootstrap.com/)
* Copyright 2011-2024 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/const at=new Map,Ze={set(e,t,n){at.has(e)||at.set(e,new Map);const s=at.get(e);if(!s.has(t)&&s.size!==0){console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(s.keys())[0]}.`);return}s.set(t,n)},get(e,t){return at.has(e)&&at.get(e).get(t)||null},remove(e,t){if(!at.has(e))return;const n=at.get(e);n.delete(t),n.size===0&&at.delete(e)}},Ao=1e6,To=1e3,An="transitionend",Lr=e=>(e&&window.CSS&&window.CSS.escape&&(e=e.replace(/#([^\s"#']+)/g,(t,n)=>`#${CSS.escape(n)}`)),e),wo=e=>e==null?`${e}`:Object.prototype.toString.call(e).match(/\s([a-z]+)/i)[1].toLowerCase(),Oo=e=>{do e+=Math.floor(Math.random()*Ao);while(document.getElementById(e));return e},So=e=>{if(!e)return 0;let{transitionDuration:t,transitionDelay:n}=window.getComputedStyle(e);const s=Number.parseFloat(t),r=Number.parseFloat(n);return!s&&!r?0:(t=t.split(",")[0],n=n.split(",")[0],(Number.parseFloat(t)+Number.parseFloat(n))*To)},Rr=e=>{e.dispatchEvent(new Event(An))},nt=e=>!e||typeof e!="object"?!1:(typeof e.jquery<"u"&&(e=e[0]),typeof e.nodeType<"u"),ct=e=>nt(e)?e.jquery?e[0]:e:typeof e=="string"&&e.length>0?document.querySelector(Lr(e)):null,Wt=e=>{if(!nt(e)||e.getClientRects().length===0)return!1;const t=getComputedStyle(e).getPropertyValue("visibility")==="visible",n=e.closest("details:not([open])");if(!n)return t;if(n!==e){const s=e.closest("summary");if(s&&s.parentNode!==n||s===null)return!1}return t},lt=e=>!e||e.nodeType!==Node.ELEMENT_NODE||e.classList.contains("disabled")?!0:typeof e.disabled<"u"?e.disabled:e.hasAttribute("disabled")&&e.getAttribute("disabled")!=="false",$r=e=>{if(!document.documentElement.attachShadow)return null;if(typeof e.getRootNode=="function"){const t=e.getRootNode();return t instanceof ShadowRoot?t:null}return e instanceof ShadowRoot?e:e.parentNode?$r(e.parentNode):null},Le=()=>{},ie=e=>{e.offsetHeight},Ir=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,tn=[],Co=e=>{document.readyState==="loading"?(tn.length||document.addEventListener("DOMContentLoaded",()=>{for(const t of tn)t()}),tn.push(e)):e()},K=()=>document.documentElement.dir==="rtl",z=e=>{Co(()=>{const t=Ir();if(t){const n=e.NAME,s=t.fn[n];t.fn[n]=e.jQueryInterface,t.fn[n].Constructor=e,t.fn[n].noConflict=()=>(t.fn[n]=s,e.jQueryInterface)}})},k=(e,t=[],n=e)=>typeof e=="function"?e(...t):n,xr=(e,t,n=!0)=>{if(!n){k(e);return}const r=So(t)+5;let i=!1;const o=({target:a})=>{a===t&&(i=!0,t.removeEventListener(An,o),k(e))};t.addEventListener(An,o),setTimeout(()=>{i||Rr(t)},r)},Kn=(e,t,n,s)=>{const r=e.length;let i=e.indexOf(t);return i===-1?!n&&s?e[r-1]:e[0]:(i+=n?1:-1,s&&(i=(i+r)%r),e[Math.max(0,Math.min(i,r-1))])},No=/[^.]*(?=\..*)\.|.*/,Do=/\..*/,Lo=/::\d+$/,en={};let gs=1;const Pr={mouseenter:"mouseover",mouseleave:"mouseout"},Ro=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function Mr(e,t){return t&&`${t}::${gs++}`||e.uidEvent||gs++}function kr(e){const t=Mr(e);return e.uidEvent=t,en[t]=en[t]||{},en[t]}function $o(e,t){return function n(s){return qn(s,{delegateTarget:e}),n.oneOff&&d.off(e,s.type,t),t.apply(e,[s])}}function Io(e,t,n){return function s(r){const i=e.querySelectorAll(t);for(let{target:o}=r;o&&o!==this;o=o.parentNode)for(const a of i)if(a===o)return qn(r,{delegateTarget:o}),s.oneOff&&d.off(e,r.type,t,n),n.apply(o,[r])}}function Fr(e,t,n=null){return Object.values(e).find(s=>s.callable===t&&s.delegationSelector===n)}function Vr(e,t,n){const s=typeof t=="string",r=s?n:t||n;let i=Hr(e);return Ro.has(i)||(i=e),[s,r,i]}function Es(e,t,n,s,r){if(typeof t!="string"||!e)return;let[i,o,a]=Vr(t,n,s);t in Pr&&(o=(m=>function(_){if(!_.relatedTarget||_.relatedTarget!==_.delegateTarget&&!_.delegateTarget.contains(_.relatedTarget))return m.call(this,_)})(o));const l=kr(e),u=l[a]||(l[a]={}),c=Fr(u,o,i?n:null);if(c){c.oneOff=c.oneOff&&r;return}const h=Mr(o,t.replace(No,"")),g=i?Io(e,n,o):$o(e,o);g.delegationSelector=i?n:null,g.callable=o,g.oneOff=r,g.uidEvent=h,u[h]=g,e.addEventListener(a,g,i)}function Tn(e,t,n,s,r){const i=Fr(t[n],s,r);i&&(e.removeEventListener(n,i,!!r),delete t[n][i.uidEvent])}function xo(e,t,n,s){const r=t[n]||{};for(const[i,o]of Object.entries(r))i.includes(s)&&Tn(e,t,n,o.callable,o.delegationSelector)}function Hr(e){return e=e.replace(Do,""),Pr[e]||e}const d={on(e,t,n,s){Es(e,t,n,s,!1)},one(e,t,n,s){Es(e,t,n,s,!0)},off(e,t,n,s){if(typeof t!="string"||!e)return;const[r,i,o]=Vr(t,n,s),a=o!==t,l=kr(e),u=l[o]||{},c=t.startsWith(".");if(typeof i<"u"){if(!Object.Line truncated
`).forEach(function(o){r=o.indexOf(":"),n=o.substring(0,r).trim().toLowerCase(),s=o.substring(r+1).trim(),!(!n||t[n]&&Ff[n])&&(n==="set-cookie"?t[n]?t[n].push(s):t[n]=[s]:t[n]=t[n]?t[n]+", "+s:s)}),t},Xs=Symbol("internals");function Zt(e){return e&&String(e).trim().toLowerCase()}function Ce(e){return e===!1||e==null?e:f.isArray(e)?e.map(Ce):String(e)}function Hf(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let s;for(;s=n.exec(e);)t[s[1]]=s[2];return t}const Bf=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function _n(e,t,n,s,r){if(f.isFunction(s))return s.call(this,t,n);if(r&&(t=n),!!f.isString(t)){if(f.isString(s))return t.indexOf(s)!==-1;if(f.isRegExp(s))return s.test(t)}}function jf(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,s)=>n.toUpperCase()+s)}function Uf(e,t){const n=f.toCamelCase(" "+t);["get","set","has"].forEach(s=>{Object.defineProperty(e,s+n,{value:function(r,i,o){return this[s].call(this,t,r,i,o)},configurable:!0})})}class F{constructor(t){t&&this.set(t)}set(t,n,s){const r=this;function i(a,l,u){const c=Zt(l);if(!c)throw new Error("header name must be a non-empty string");const h=f.findKey(r,c);(!h||r[h]===void 0||u===!0||u===void 0&&r[h]!==!1)&&(r[h||l]=Ce(a))}const o=(a,l)=>f.forEach(a,(u,c)=>i(u,c,l));if(f.isPlainObject(t)||t instanceof this.constructor)o(t,n);else if(f.isString(t)&&(t=t.trim())&&!Bf(t))o(Vf(t),n);else if(f.isHeaders(t))for(const[a,l]of t.entries())i(l,a,s);else t!=null&&i(n,t,s);return this}get(t,n){if(t=Zt(t),t){const s=f.findKey(this,t);if(s){const r=this[s];if(!n)return r;if(n===!0)return Hf(r);if(f.isFunction(n))return n.call(this,r,s);if(f.isRegExp(n))return n.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Zt(t),t){const s=f.findKey(this,t);return!!(s&&this[s]!==void 0&&(!n||_n(this,this[s],s,n)))}return!1}delete(t,n){const s=this;let r=!1;function i(o){if(o=Zt(o),o){const a=f.findKey(s,o);a&&(!n||_n(s,s[a],a,n))&&(delete s[a],r=!0)}}return f.isArray(t)?t.forEach(i):i(t),r}clear(t){const n=Object.keys(this);let s=n.length,r=!1;for(;s--;){const i=n[s];(!t||_n(this,this[i],i,t,!0))&&(delete this[i],r=!0)}return r}normalize(t){const n=this,s={};return f.forEach(this,(r,i)=>{const o=f.findKey(s,i);if(o){n[o]=Ce(r),delete n[i];return}const a=t?jf(i):String(i).trim();a!==i&&delete n[i],n[a]=Ce(r),s[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return f.forEach(this,(s,r)=>{s!=null&&s!==!1&&(n[r]=t&&f.isArray(s)?s.join(", "):s)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const s=new this(t);return n.forEach(r=>s.set(r)),s}static accessor(t){const s=(this[Xs]=this[Xs]={accessors:{}}).accessors,r=this.prototype;function i(o){const a=Zt(o);s[a]||(Uf(r,o),s[a]=!0)}return f.isArray(t)?t.forEach(i):i(t),this}}F.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);f.reduceDescriptors(F.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(s){this[n]=s}}});f.freezeMethods(F);function gn(e,t){const n=this||ue,s=t||n,r=F.from(s.headers);let i=s.data;return f.forEach(e,function(a){i=a.call(n,i,r.normalize(),t?t.status:void 0)}),r.normalize(),i}function yi(e){return!!(e&&e.__CANCEL__)}function Yt(e,t,n){T.call(this,e??"canceled",T.ERR_CANCELED,t,n),this.name="CanceledError"}f.inherits(Yt,T,{__CANCEL__:!0});function vi(e,t,n){const s=n.config.validateStatus;!n.status||!s||s(n.status)?e(n):t(new T("Request failed with status code "+n.status,[T.ERR_BAD_REQUEST,T.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Wf(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Kf(e,t){e=e||10;const n=new Array(e),s=new Array(e);let r=0,i=0,o;return t=t!==void 0?t:1e3,function(l){const u=Date.now(),c=s[i];o||(o=u),n[r]=l,s[r]=u;let h=i,g=0;for(;h!==r;)g+=n[h++],h=h%e;if(r=(r+1)%e,r===i&&(i=(i+1)%e),u-o<t)return;const E=c&&u-c;return E?Math.round(g*1e3/E):void 0}}function qf(e,t){let n=0,s=1e3/t,r,i;const o=(u,c=Date.now())=>{n=c,r=null,i&&(clearTimeout(i),i=null),e.apply(null,u)};return[(...u)=>{const c=Date.now(),h=c-n;h>=s?o(u,c):(r=u,i||(i=setTimeout(()=>{i=null,o(r)},s-h)))},()=>r&&o(r)]}const Ie=(e,t,n=3)=>{let s=0;const r=Kf(50,250);return qf(i=>{const o=i.loaded,a=i.lengthComputable?i.total:void 0,l=o-s,u=r(l),c=o<=a;s=o;const h={loaded:o,total:a,progress:a?o/a:void 0,bytes:l,rate:u||void 0,estimated:u&&a&&c?(a-o)/u:void 0,event:i,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(h)},n)},Js=(e,t)=>{const n=e!=null;return[s=>t[0]({lengthComputable:n,total:e,loaded:s}),t[1]]},Qs=e=>(...t)=>f.asap(()=>e(...t)),zf=I.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,I.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(I.origin),I.navigator&&/(msie|trident)/i.test(I.navigator.userAgent)):()=>!0,Yf=I.hasStandardBrowserEnv?{write(e,t,n,s,r,i){const o=[e+"="+encodeURIComponent(t)];f.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),f.isString(s)&&o.push("path="+s),f.isString(r)&&o.push("domain="+r),i===!0&&o.push("secure"),document.cookie=o.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Gf(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Xf(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Ai(e,t){return e&&!Gf(t)?Xf(e,t):t}const Zs=e=>e instanceof F?{...e}:e;function St(e,t){t=t||{};const n={};function s(u,c,h,g){return f.isPlainObject(u)&&f.isPlainObject(c)?f.merge.call({caseless:g},u,c):f.isPlainObject(c)?f.merge({},c):f.isArray(c)?c.slice():c}function r(u,c,h,g){if(f.isUndefined(c)){if(!f.isUndefined(u))return s(void 0,u,h,g)}else return s(u,c,h,g)}function i(u,c){if(!f.isUndefined(c))return s(void 0,c)}function o(u,c){if(f.isUndefined(c)){if(!f.isUndefined(u))return s(void 0,u)}else return s(void 0,c)}function a(u,c,h){if(h in t)return s(u,c);if(h in e)return s(void 0,u)}const l={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(u,c,h)=>r(Zs(u),Zs(c),h,!0)};return f.forEach(Object.keys(Object.assign({},e,t)),function(c){const h=l[c]||r,g=h(e[c],t[c],c);f.isUndefined(g)&&h!==a||(n[c]=g)}),n}const Ti=e=>{const t=St({},e);let{data:n,withXSRFToken:s,xsrfHeaderName:r,xsrfCookieName:i,headers:o,auth:a}=t;t.headers=o=F.from(o),t.url=gi(Ai(t.baseURL,t.url),e.params,e.paramsSerializer),a&&o.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let l;if(f.isFormData(n)){if(I.hasStandardBrowserEnv||I.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((l=o.getContentType())!==!1){const[u,...c]=l?l.split(";").map(h=>h.trim()).filter(Boolean):[];o.setContentType([u||"multipart/form-data",...c].join("; "))}}if(I.hasStandardBrowserEnv&&(s&&f.isFunction(s)&&(s=s(t)),s||s!==!1&&zf(t.url))){const u=r&&i&&Yf.read(i);u&&o.set(r,u)}return t},Jf=typeof XMLHttpRequest<"u",Qf=Jf&&function(e Line truncated
`+i.map(nr).join(`
`):" "+nr(i[0]):"as no adapter specified";throw new T("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return s},adapters:Ln};function En(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Yt(null,e)}function sr(e){return En(e),e.headers=F.from(e.headers),e.data=gn.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Si.getAdapter(e.adapter||ue.adapter)(e).then(function(s){return En(e),s.data=gn.call(e,e.transformResponse,s),s.headers=F.from(s.headers),s},function(s){return yi(s)||(En(e),s&&s.response&&(s.response.data=gn.call(e,e.transformResponse,s.response),s.response.headers=F.from(s.response.headers))),Promise.reject(s)})}const Ci="1.7.9",Ye={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Ye[e]=function(s){return typeof s===e||"a"+(t<1?"n ":" ")+e}});const rr={};Ye.transitional=function(t,n,s){function r(i,o){return"[Axios v"+Ci+"] Transitional option '"+i+"'"+o+(s?". "+s:"")}return(i,o,a)=>{if(t===!1)throw new T(r(o," has been removed"+(n?" in "+n:"")),T.ERR_DEPRECATED);return n&&!rr[o]&&(rr[o]=!0,console.warn(r(o," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,o,a):!0}};Ye.spelling=function(t){return(n,s)=>(console.warn(`${s} is likely a misspelling of ${t}`),!0)};function ld(e,t,n){if(typeof e!="object")throw new T("options must be an object",T.ERR_BAD_OPTION_VALUE);const s=Object.keys(e);let r=s.length;for(;r-- >0;){const i=s[r],o=t[i];if(o){const a=e[i],l=a===void 0||o(a,i,e);if(l!==!0)throw new T("option "+i+" must be "+l,T.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new T("Unknown option "+i,T.ERR_BAD_OPTION)}}const Ne={assertOptions:ld,validators:Ye},Q=Ne.validators;class Tt{constructor(t){this.defaults=t,this.interceptors={request:new Gs,response:new Gs}}async request(t,n){try{return await this._request(t,n)}catch(s){if(s instanceof Error){let r={};Error.captureStackTrace?Error.captureStackTrace(r):r=new Error;const i=r.stack?r.stack.replace(/^.+\n/,""):"";try{s.stack?i&&!String(s.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(s.stack+=`
`+i):s.stack=i}catch{}}throw s}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=St(this.defaults,n);const{transitional:s,paramsSerializer:r,headers:i}=n;s!==void 0&&Ne.assertOptions(s,{silentJSONParsing:Q.transitional(Q.boolean),forcedJSONParsing:Q.transitional(Q.boolean),clarifyTimeoutError:Q.transitional(Q.boolean)},!1),r!=null&&(f.isFunction(r)?n.paramsSerializer={serialize:r}:Ne.assertOptions(r,{encode:Q.function,serialize:Q.function},!0)),Ne.assertOptions(n,{baseUrl:Q.spelling("baseURL"),withXsrfToken:Q.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=i&&f.merge(i.common,i[n.method]);i&&f.forEach(["delete","get","head","post","put","patch","common"],m=>{delete i[m]}),n.headers=F.concat(o,i);const a=[];let l=!0;this.interceptors.request.forEach(function(_){typeof _.runWhen=="function"&&_.runWhen(n)===!1||(l=l&&_.synchronous,a.unshift(_.fulfilled,_.rejected))});const u=[];this.interceptors.response.forEach(function(_){u.push(_.fulfilled,_.rejected)});let c,h=0,g;if(!l){const m=[sr.bind(this),void 0];for(m.unshift.apply(m,a),m.push.apply(m,u),g=m.length,c=Promise.resolve(n);h<g;)c=c.then(m[h++],m[h++]);return c}g=a.length;let E=n;for(h=0;h<g;){const m=a[h++],_=a[h++];try{E=m(E)}catch(p){_.call(this,p);break}}try{c=sr.call(this,E)}catch(m){return Promise.reject(m)}for(h=0,g=u.length;h<g;)c=c.then(u[h++],u[h++]);return c}getUri(t){t=St(this.defaults,t);const n=Ai(t.baseURL,t.url);return gi(n,t.params,t.paramsSerializer)}}f.forEach(["delete","get","head","options"],function(t){Tt.prototype[t]=function(n,s){return this.request(St(s||{},{method:t,url:n,data:(s||{}).data}))}});f.forEach(["post","put","patch"],function(t){function n(s){return function(i,o,a){return this.request(St(a||{},{method:t,headers:s?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}Tt.prototype[t]=n(),Tt.prototype[t+"Form"]=n(!0)});class Zn{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const s=this;this.promise.then(r=>{if(!s._listeners)return;let i=s._listeners.length;for(;i-- >0;)s._listeners[i](r);s._listeners=null}),this.promise.then=r=>{let i;const o=new Promise(a=>{s.subscribe(a),i=a}).then(r);return o.cancel=function(){s.unsubscribe(i)},o},t(function(i,o,a){s.reason||(s.reason=new Yt(i,o,a),n(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=s=>{t.abort(s)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Zn(function(r){t=r}),cancel:t}}}function ud(e){return function(n){return e.apply(null,n)}}function fd(e){return f.isObject(e)&&e.isAxiosError===!0}const Rn={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Rn).forEach(([e,t])=>{Rn[t]=e});function Ni(e){const t=new Tt(e),n=ii(Tt.prototype.request,t);return f.extend(n,Tt.prototype,t,{allOwnKeys:!0}),f.extend(n,t,null,{allOwnKeys:!0}),n.create=function(r){return Ni(St(e,r))},n}const L=Ni(ue);L.Axios=Tt;L.CanceledError=Yt;L.CancelToken=Zn;L.isCancel=yi;L.VERSION=Ci;L.toFormData=qe;L.AxiosError=T;L.Cancel=L.CanceledError;L.all=function(t){return Promise.all(t)};L.spread=ud;L.isAxiosError=fd;L.mergeConfig=St;L.AxiosHeaders=F;L.formToJSON=e=>bi(f.isHTMLForm(e)?new FormData(e):e);L.getAdapter=Si.getAdapter;L.HttpStatusCode=Rn;L.default=L;window.axios=L;window.axios.defaults.headers.common["X-Requested-With"]="XMLHttpRequest";
+9
View File
@@ -0,0 +1,9 @@
@charset "UTF-8";@import"https://fonts.bunny.net/css?family=Nunito";/*!
* Bootstrap v5.3.3 (https://getbootstrap.com/)
* Copyright 2011-2024 The Bootstrap Authors
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*//*!
* Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com
* License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
* Copyright 2024 Fonticons, Inc.
*/.fa{font-family:var(--fa-style-family, "Font Awesome 6 Free");font-weight:var(--fa-style, 900)}.fas,.far,.fab,.fa-solid,.fa-regular,.fa-brands,.fa{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:var(--fa-display, inline-block);font-style:normal;font-variant:normal;line-height:1;text-rendering:auto}.fas:before,.far:before,.fab:before,.fa-solid:before,.fa-regular:before,.fa-brands:before,.fa:before{content:var(--fa)}.fa-classic,.fas,.fa-solid,.far,.fa-regular{font-family:"Font Awesome 6 Free"}.fa-brands,.fab{font-family:"Font Awesome 6 Brands"}.fa-1x{font-size:1em}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-6x{font-size:6em}.fa-7x{font-size:7em}.fa-8x{font-size:8em}.fa-9x{font-size:9em}.fa-10x{font-size:10em}.fa-2xs{font-size:.625em;line-height:.1em;vertical-align:.225em}.fa-xs{font-size:.75em;line-height:.08333em;vertical-align:.125em}.fa-sm{font-size:.875em;line-height:.07143em;vertical-align:.05357em}.fa-lg{font-size:1.25em;line-height:.05em;vertical-align:-.075em}.fa-xl{font-size:1.5em;line-height:.04167em;vertical-align:-.125em}.fa-2xl{font-size:2em;line-height:.03125em;vertical-align:-.1875em}.fa-fw{text-align:center;width:1.25em}.fa-ul{list-style-type:none;margin-left:var(--fa-li-margin, 2.5em);padding-left:0}.fa-ul>li{position:relative}.fa-li{left:calc(-1 * var(--fa-li-width, 2em));position:absolute;text-align:center;width:var(--fa-li-width, 2em);line-height:inherit}.fa-border{border-color:var(--fa-border-color, #eee);border-radius:var(--fa-border-radius, .1em);border-style:var(--fa-border-style, solid);border-width:var(--fa-border-width, .08em);padding:var(--fa-border-padding, .2em .25em .15em)}.fa-pull-left{float:left;margin-right:var(--fa-pull-margin, .3em)}.fa-pull-right{float:right;margin-left:var(--fa-pull-margin, .3em)}.fa-beat{animation-name:fa-beat;animation-delay:var(--fa-animation-delay, 0s);animation-direction:var(--fa-animation-direction, normal);animation-duration:var(--fa-animation-duration, 1s);animation-iteration-count:var(--fa-animation-iteration-count, infinite);animation-timing-function:var(--fa-animation-timing, ease-in-out)}.fa-bounce{animation-name:fa-bounce;animation-delay:var(--fa-animation-delay, 0s);animation-direction:var(--fa-animation-direction, normal);animation-duration:var(--fa-animation-duration, 1s);animation-iteration-count:var(--fa-animation-iteration-count, infinite);animation-timing-function:var(--fa-animation-timing, cubic-bezier(.28, .84, .42, 1))}.fa-fade{animation-name:fa-fade;animation-delay:var(--fa-animation-delay, 0s);animation-direction:var(--fa-animation-direction, normal);animation-duration:var(--fa-animation-duration, 1s);animation-iteration-count:var(--fa-animation-iteration-count, infinite);animation-timing-function:var(--fa-animation-timing, cubic-bezier(.4, 0, .6, 1))}.fa-beat-fade{animation-name:fa-beat-fade;animation-delay:var(--fa-animation-delay, 0s);animation-direction:var(--fa-animation-direction, normal);animation-duration:var(--fa-animation-duration, 1s);animation-iteration-count:var(--fa-animation-iteration-count, infinite);animation-timing-function:var(--fa-animation-timing, cubic-bezier(.4, 0, .6, 1))}.fa-flip{animation-name:fa-flip;animation-delay:var(--fa-animation-delay, 0s);animation-direction:var(--fa-animation-direction, normal);animation-duration:var(--fa-animation-duration, 1s);animation-iteration-count:var(--fa-animation-iteration-count, infinite);animation-timing-function:var(--fa-animation-timing, ease-in-out)}.fa-shake{animation-name:fa-shake;animation-delay:var(--fa-animation-delay, 0s);animation-direction:var(--fa-animation-direction, normal);animation-duration:var(--fa-animation-duration, 1s);animation-iteration-count:var(--fa-animation-iteration-count, infinite);animation-timing-function:var(--fa-animation-timing, linear)}.fa-spin{animation-name:fa-spin;animation-delay:var(--fa-animation-delay, 0s);animation-direction:var(--fa-animation-direction, normal);animation-duration:var(--fa-animation-duration, 2s);animation-iteration-count:var(--fa-animation-iteration-count, infinite);animation-timing-function:var(--fa-animation-timing, linear)}.fa-spin-reverse{--fa-animation-direction: reverse}.fa-pulse,.fa-spin-pulse{animation-name:fa-spin;animation-direction:var(--fa-animation-direction, normal);animation-duration:var(--fa-animation-duration, 1s);animation-iteration-count:var(--fa-animation-iteration-count, infinite);animation-timing-function:var(--fa-animation-timing, steps(8))}@media (prefers-reduced-motion: reduce){.fa-beat,.fa-bounce,.fa-fade,.fa-beat-fade,.fa-flip,.fa-pulse,.fa-shake,.fa-spin,.fa-spin-pulse{animation-delay:-1ms;animation-duration:1ms;animation-iteration-count:1;transition-delay:0s;transition-duration:0s}}@keyframes fa-beat{0%,90%{transform:scale(1)}45%{transform:scale(var(--fa-beat-scale, 1.25))}}@keyframes fa-bounce{0%{transform:scale(1) translateY(0)}10%{transform:scale(var(--fa-bounce-start-scale-x, 1.1),var(--fa-bounce-startLine truncated
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+45
View File
@@ -0,0 +1,45 @@
{
"node_modules/@fortawesome/fontawesome-free/webfonts/fa-brands-400.ttf": {
"file": "assets/fa-brands-400-D1LuMI3I.ttf",
"src": "node_modules/@fortawesome/fontawesome-free/webfonts/fa-brands-400.ttf"
},
"node_modules/@fortawesome/fontawesome-free/webfonts/fa-brands-400.woff2": {
"file": "assets/fa-brands-400-D_cYUPeE.woff2",
"src": "node_modules/@fortawesome/fontawesome-free/webfonts/fa-brands-400.woff2"
},
"node_modules/@fortawesome/fontawesome-free/webfonts/fa-regular-400.ttf": {
"file": "assets/fa-regular-400-DZaxPHgR.ttf",
"src": "node_modules/@fortawesome/fontawesome-free/webfonts/fa-regular-400.ttf"
},
"node_modules/@fortawesome/fontawesome-free/webfonts/fa-regular-400.woff2": {
"file": "assets/fa-regular-400-BjRzuEpd.woff2",
"src": "node_modules/@fortawesome/fontawesome-free/webfonts/fa-regular-400.woff2"
},
"node_modules/@fortawesome/fontawesome-free/webfonts/fa-solid-900.ttf": {
"file": "assets/fa-solid-900-D0aA9rwL.ttf",
"src": "node_modules/@fortawesome/fontawesome-free/webfonts/fa-solid-900.ttf"
},
"node_modules/@fortawesome/fontawesome-free/webfonts/fa-solid-900.woff2": {
"file": "assets/fa-solid-900-CTAAxXor.woff2",
"src": "node_modules/@fortawesome/fontawesome-free/webfonts/fa-solid-900.woff2"
},
"node_modules/@fortawesome/fontawesome-free/webfonts/fa-v4compatibility.ttf": {
"file": "assets/fa-v4compatibility-CCth-dXg.ttf",
"src": "node_modules/@fortawesome/fontawesome-free/webfonts/fa-v4compatibility.ttf"
},
"node_modules/@fortawesome/fontawesome-free/webfonts/fa-v4compatibility.woff2": {
"file": "assets/fa-v4compatibility-C9RhG_FT.woff2",
"src": "node_modules/@fortawesome/fontawesome-free/webfonts/fa-v4compatibility.woff2"
},
"resources/js/app.js": {
"file": "assets/app-BTTmoT1y.js",
"name": "app",
"src": "resources/js/app.js",
"isEntry": true
},
"resources/sass/app.scss": {
"file": "assets/app-VAjrHIxo.css",
"src": "resources/sass/app.scss",
"isEntry": true
}
}
+4
View File
@@ -6,3 +6,7 @@
// Bootstrap
@import 'bootstrap/scss/bootstrap';
// Fontawesome
@import '@fortawesome/fontawesome-free/css/all.css';
+1 -1
View File
@@ -1,7 +1,7 @@
<html>
<head>
<title>{{ $title ?? 'Todo Manager' }}</title>
<link rel="stylesheet" href="/build/assets/app-BaVMVknW.css">
<link rel="stylesheet" href="/build/assets/app-VAjrHIxo.css">
</head>
<body>
<h1>Todos</h1>
+67 -57
View File
@@ -6,67 +6,77 @@
use App\Models\User;
//if ($errors->any())
$form = new \itguild\forms\ActiveForm();
$form->beginForm(isset($model) ? "/admin/user/edit/" . $model->id : "/admin/user/store", enctype: 'multipart/form-data');
$form->field(class: \itguild\forms\inputs\TextInput::class, name: "username", params: [
'class' => "form-control",
'placeholder' => 'Логин',
'value' => $model->username ?? ''
])
->setLabel("Логин")
->render();
$form->field(class: \itguild\forms\inputs\TextInput::class, name: "password", params: [
'class' => "form-control",
'type' => "password",
])
->setLabel("Пароль")
->render();
$form->field(class: \itguild\forms\inputs\TextInput::class, name: "email", params: [
'class' => "form-control",
'type' => "email",
'placeholder' => 'test@mail.ru',
'value' => $model->email ?? ''
])
->setLabel("Email")
->render();
if (!empty($model->user_photo)){
echo "<div><img src='$model->user_photo' width='200px'></div>";
}
$form->field(class: \itguild\forms\inputs\File::class, name: "user_photo", params: [
'class' => "form-control",
'value' => $model->user_photo ?? ''
])
->setLabel("Фото профиля")
->render();
?>
<div class="row">
<div class="col-sm-2"><?php
$form->field(\itguild\forms\inputs\Button::class, name: "btn-submit", params: [
'class' => "btn btn-primary ",
'value' => 'Отправить',
'typeInput' => 'submit'
<x-main>
<x-slot:title>
Custom Title
</x-slot>
@php
$form = new \itguild\forms\ActiveForm();
$form->beginForm(isset($model) ? "/admin/user/edit/" . $model->id : "/admin/user/store", enctype: 'multipart/form-data');
$form->field(class: \itguild\forms\inputs\TextInput::class, name: "username", params: [
'class' => "form-control",
'placeholder' => 'Логин',
'value' => $model->username ?? ''
])
->setLabel("Логин")
->render();
?>
</div>
<div class="col-sm-2">
<?php
$form->field(\itguild\forms\inputs\Button::class, name: "btn-reset", params: [
'class' => "btn btn-warning",
'value' => 'Сбросить',
'typeInput' => 'reset'
$form->field(class: \itguild\forms\inputs\TextInput::class, name: "password", params: [
'class' => "form-control",
'type' => "password",
])
->setLabel("Пароль")
->render();
?>
$form->field(class: \itguild\forms\inputs\TextInput::class, name: "email", params: [
'class' => "form-control",
'type' => "email",
'placeholder' => 'test@mail.ru',
'value' => $model->email ?? ''
])
->setLabel("Email")
->render();
if (!empty($model->user_photo)){
echo "<div><img src='$model->user_photo' width='200px'></div>";
}
$form->field(class: \itguild\forms\inputs\File::class, name: "user_photo", params: [
'class' => "form-control",
'value' => $model->user_photo ?? ''
])
->setLabel("Фото профиля")
->render();
@endphp
<div class="row">
<div class="col-sm-2">
@php
$form->field(\itguild\forms\inputs\Button::class, name: "btn-submit", params: [
'class' => "btn btn-primary ",
'value' => 'Отправить',
'typeInput' => 'submit'
])
->render();
@endphp
</div>
<div class="col-sm-2">
@php
$form->field(\itguild\forms\inputs\Button::class, name: "btn-reset", params: [
'class' => "btn btn-warning",
'value' => 'Сбросить',
'typeInput' => 'reset'
])
->render();
@endphp
@csrf
@php
$form->endForm();
@endphp
</div>
</div>
</div>
@csrf
<?php
$form->endForm();
</x-main>
+15 -1
View File
@@ -35,8 +35,22 @@
return (new DateTimeImmutable($data))->format("d-m-Y");
}
]);
//$table->beforePrint(function () {
// return IconBtnCreateWidget::create(['url' => '/admin/user/create'])->run();
//});
$table->beforePrint(function () {
return "<a title='Создать' class='btn btn-success' href='/admin/user/create' style='margin: 3px' ><i class='fa-regular fa-square-plus'></i></a>";
});
$table->addAction(function($row) {
return "<a title='Просмотреть' class='btn btn-primary' href='/admin/user/view/" . $row['id'] . "' style='margin: 3px' ><i class='<i class='fa-regular fa-eye'></i></a>";
});
$table->addAction(function($row) {
return "<a title='Редактировать' class='btn btn-success' href='/admin/user/update/" . $row['id'] . "' style='margin: 3px' ><i class='fa-solid fa-pen'></i></a>";
});
$table->addAction(function($row) {
return "<a title='Удалить' class='btn btn-danger' href='/admin/user/delete/" . $row['id'] . "' style='margin: 3px' ><i class='fa-regular fa-trash-can'></i></a>";
});
$table->create();
//$table->render();
?>
<x-main>
+12 -1
View File
@@ -31,4 +31,15 @@
}
]);
$table->create();
$table->render();
?>
<x-main>
<x-slot:title>
Custom Title
</x-slot>
@php
$table->render();
@endphp
</x-main>
@@ -0,0 +1,13 @@
<x-main>
<x-slot:title>
Custom Title
</x-slot>
<a title="{{ $title }}" class='btn btn-{{ $btn_type }}' href='{{ $url }}' style='margin: 3px' >{{ $label }}</a>
</x-main>
@@ -0,0 +1 @@
<a title="{{ $title }}" class='btn btn-{{ $btn_type }}' href='{{ $url }}' style='margin: 3px' >{{ $label }}</a>