adminizer 4.5.0-build.191 → 4.5.0-build.192

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/assets/DiffViewer-DL5uCv8d.js +1 -0
  2. package/assets/add-CoJs41f3.js +1 -0
  3. package/assets/add-form-Nn7zuSFW.js +1 -0
  4. package/assets/add-group-BwIvHgW7.js +1 -0
  5. package/assets/add-group-form-DUhDxVwB.js +1 -0
  6. package/assets/add-user-form-Ct4i6Dse.js +1 -0
  7. package/assets/add-user-x9lVhP7v.js +1 -0
  8. package/assets/app-7JBp0Pby.css +72 -0
  9. package/assets/app-layout-DBlkqXBF.js +1 -0
  10. package/assets/app-shell-CwiL9UZ5.js +1 -0
  11. package/assets/app-sidebar-IrVF2Bpi.js +1 -0
  12. package/assets/app-sidebar-header-qHEOMq5D.js +1 -0
  13. package/assets/app.js +1646 -1638
  14. package/assets/breadcrumbs-D5PCyRGn.js +1 -0
  15. package/assets/{catalog-DLLmAGIB.js → catalog-Cp7rX4NA.js} +2 -2
  16. package/assets/dashboard-BB9tozjF.js +3 -0
  17. package/assets/date-picker-RBWWCucj.js +1 -0
  18. package/assets/del-modal-yU9LPEgz.js +1 -0
  19. package/assets/dynamic-controls-k61T9W2P.js +1 -0
  20. package/assets/field-renderer-DV8OITPR.css +4 -0
  21. package/assets/{field-renderer-BdZEj8Gx.js → field-renderer-Ddc4u-gC.js} +3 -3
  22. package/assets/form-BMgynZ7t.js +1 -0
  23. package/assets/form-G2lvZbid.js +1 -0
  24. package/assets/{geo-json-B8a6BmuD.js → geo-json-BNEPKsSU.js} +2 -2
  25. package/assets/handsontable-PxYdjN8c.js +298 -0
  26. package/assets/history-CpB7eOZV.js +1 -0
  27. package/assets/home-E3Iir90Q.js +2 -0
  28. package/assets/icon-FyVrxiPs.js +1 -0
  29. package/assets/init-user-DhzPzTRM.js +1 -0
  30. package/assets/input-error-cgnQ235Q.js +1 -0
  31. package/assets/jsoneditor-De1FvcYu.js +3882 -0
  32. package/assets/list-Z91tr2VH.js +1 -0
  33. package/assets/{list-table-CeYNrY78.js → list-table-CGb5XQ3v.js} +3 -3
  34. package/assets/login-CyEIe-hN.js +1 -0
  35. package/assets/manifest.json +233 -277
  36. package/assets/material-icon-DZVU9Gse.js +1 -0
  37. package/assets/{media-manager-Bwo074w9.js → media-manager-CDI0y7wm.js} +2 -2
  38. package/assets/module-DC-BVptm.js +1 -0
  39. package/assets/monaco-BhBYtg3d.js +11 -0
  40. package/assets/nav-footer-B9n8Pd8V.js +1 -0
  41. package/assets/nav-main-G6VwCche.js +1 -0
  42. package/assets/nav-user-BfROibnw.js +1 -0
  43. package/assets/notification-Dix_eeOm.js +27 -0
  44. package/assets/pagination-render-CqNIIF8P.js +1 -0
  45. package/assets/register-Bt0RP4PE.js +1 -0
  46. package/assets/tabs-BhUuWdzc.js +1 -0
  47. package/assets/theme-switcher-BURZ8Tza.js +1 -0
  48. package/assets/toast-editor-BGjjCkQG.js +845 -0
  49. package/assets/user-info-gFSwypEN.js +1 -0
  50. package/assets/user-menu-content-CjsydEH4.js +1 -0
  51. package/assets/vendor-l0sNRNKZ.js +1 -0
  52. package/assets/welcome-bgzg6DxL.js +1 -0
  53. package/interfaces/global.d.ts +1 -0
  54. package/lib/media-manager/Thumb.d.ts +1 -1
  55. package/package.json +1 -1
  56. package/assets/DiffViewer-LNI2p-UR.js +0 -1
  57. package/assets/add-DJKiGndL.js +0 -1
  58. package/assets/add-form-BWKE2eyN.js +0 -1
  59. package/assets/add-group-CtE4F3ps.js +0 -1
  60. package/assets/add-group-form-DnX_gvwI.js +0 -1
  61. package/assets/add-user-DTKXGl59.js +0 -1
  62. package/assets/add-user-form-DWtbi94E.js +0 -1
  63. package/assets/app-BBFtNAB8.css +0 -72
  64. package/assets/app-layout-DWLeMQzn.js +0 -1
  65. package/assets/app-shell-Csu5DYbu.js +0 -1
  66. package/assets/app-sidebar-B8GhiO5O.js +0 -1
  67. package/assets/app-sidebar-header-CpOKBzR8.js +0 -1
  68. package/assets/breadcrumbs-DubvjwQ1.js +0 -1
  69. package/assets/dashboard-DfeV1yZB.js +0 -3
  70. package/assets/date-picker-BMuULw0_.js +0 -1
  71. package/assets/del-modal-B6rGXzda.js +0 -1
  72. package/assets/dynamic-controls-BOYmRX_z.js +0 -1
  73. package/assets/field-renderer-CRNLShJD.css +0 -4
  74. package/assets/form-C9zYkFrY.js +0 -1
  75. package/assets/form-Cf6vMB_U.js +0 -1
  76. package/assets/handsontable-PVakPtJV.js +0 -281
  77. package/assets/history-DuJHP-Ym.js +0 -1
  78. package/assets/home-C0gUoUog.js +0 -2
  79. package/assets/icon-DWzxQFqX.js +0 -1
  80. package/assets/init-user-CSKuvzzu.js +0 -1
  81. package/assets/input-error-CfNybm8g.js +0 -1
  82. package/assets/jsoneditor-D95dIAP2.js +0 -3878
  83. package/assets/list-BJf9XNuD.js +0 -1
  84. package/assets/login-B0oA0qi9.js +0 -1
  85. package/assets/material-icon-DVdfE9hW.js +0 -1
  86. package/assets/module-TnH7MV0n.js +0 -1
  87. package/assets/monaco-ICtx6xoc.js +0 -11
  88. package/assets/nav-footer-DL2WhOYS.js +0 -1
  89. package/assets/nav-main-CrzWQ7b2.js +0 -1
  90. package/assets/nav-user-CJJld5cC.js +0 -1
  91. package/assets/notification-DfWwB8Bw.js +0 -27
  92. package/assets/pagination-render-CdkSnJ_L.js +0 -1
  93. package/assets/register-Q9iDyC2Z.js +0 -1
  94. package/assets/tabs-CGNIkDi3.js +0 -1
  95. package/assets/theme-switcher-BSceVLz4.js +0 -1
  96. package/assets/toast-editor-sPvKkKTW.js +0 -845
  97. package/assets/user-info-Bv0VwM79.js +0 -1
  98. package/assets/user-menu-content-qecg_7oc.js +0 -1
  99. package/assets/vendor-wzZzN_Jv.js +0 -17
  100. package/assets/welcome-C4oIeUdV.js +0 -1
@@ -0,0 +1 @@
1
+ import{j as e,E as f,az as t,bK as n,P as b,bL as g,aF as v}from"./app.js";import{e as p}from"./handsontable-PxYdjN8c.js";const N=({changes:s,title:a="Changes",className:i=""})=>{if(!s||s.length===0)return e.jsx("div",{className:t("bg-muted border border-border rounded-lg p-4",i),children:e.jsxs("div",{className:"flex items-center text-muted-foreground",children:[e.jsx(f,{className:"w-5 h-5 mr-2"}),e.jsx("span",{children:"Changes not found"})]})});const o=r=>r===null?"null":r===void 0?"—":typeof r=="boolean"?r?"Да":"Нет":typeof r=="object"?JSON.stringify(r):String(r),m=r=>r.oldValue===void 0?"added":r.newValue===void 0?"removed":"modified";return e.jsxs("div",{className:t("bg-card border border-border rounded-lg shadow-sm",i),children:[e.jsx("div",{className:"px-4 py-3 border-b border-border bg-muted",children:e.jsxs("h3",{className:"text-lg font-semibold text-card-foreground flex items-center",children:[e.jsx(n,{className:"w-5 h-5 mr-2"}),a," (",s.length,")"]})}),e.jsx("div",{className:"divide-y divide-border",children:s.map((r,l)=>{const d=m(r),c=d==="added"?b:d==="removed"?g:n,x=t("text-xs px-2 py-1 rounded-full bg-opacity-10",d==="added"&&"text-green-600 bg-green-100",d==="removed"&&"text-destructive bg-destructive/20",d==="modified"&&"text-primary bg-primary/20"),u=d==="added"?"text-green-600":d==="removed"?"text-destructive":"text-primary";return e.jsxs("div",{className:"p-4 hover:bg-muted/50 transition-colors",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsxs("div",{className:"flex items-center",children:[p.createElement(c,{className:t("w-4 h-4 mr-2",u)}),e.jsx("span",{className:"font-medium text-card-foreground",children:r.field})]}),e.jsx("span",{className:x,children:d==="added"?"Added":d==="removed"?"Removed":"Updated"})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3 text-sm",children:[d!=="added"&&e.jsxs("div",{className:"p-2 bg-destructive/10 border border-destructive/20 rounded",children:[e.jsx("div",{className:"text-xs text-destructive font-medium mb-1",children:"Old:"}),e.jsx("div",{className:"text-destructive-foreground font-mono break-words",children:o(r.oldValue)})]}),d!=="removed"&&e.jsxs("div",{className:"p-2 bg-green-50 border border-green-100 rounded",children:[e.jsx("div",{className:"text-xs text-green-600 font-medium mb-1",children:"New:"}),e.jsx("div",{className:"text-green-800 font-mono break-words",children:o(r.newValue)})]})]}),d==="modified"&&e.jsxs("div",{className:"mt-2 flex items-center text-xs text-muted-foreground",children:[e.jsx(v,{className:"w-3 h-3 mr-1"}),"changed type: ",r.type]})]},l)})})]})};export{N as D};
@@ -0,0 +1 @@
1
+ import{u as t,j as o}from"./app.js";import{A as m}from"./app-layout-DBlkqXBF.js";import p from"./add-form-Nn7zuSFW.js";import"./jsoneditor-De1FvcYu.js";import"./handsontable-PxYdjN8c.js";import"./monaco-BhBYtg3d.js";import"./app-shell-CwiL9UZ5.js";import"./app-sidebar-IrVF2Bpi.js";import"./nav-main-G6VwCche.js";import"./material-icon-DZVU9Gse.js";import"./app-sidebar-header-qHEOMq5D.js";import"./breadcrumbs-D5PCyRGn.js";import"./nav-user-BfROibnw.js";import"./user-info-gFSwypEN.js";import"./user-menu-content-CjsydEH4.js";import"./theme-switcher-BURZ8Tza.js";import"./icon-FyVrxiPs.js";import"./field-renderer-Ddc4u-gC.js";import"./dynamic-controls-k61T9W2P.js";import"./input-error-cgnQ235Q.js";import"./DiffViewer-DL5uCv8d.js";const i=[];function k(){const r=t();return o.jsx(m,{breadcrumbs:i,children:o.jsx(p,{page:r,catalog:!1})})}export{k as default};
@@ -0,0 +1 @@
1
+ import{u as se,j as e,a4 as te,a5 as re,a6 as E,a7 as D,a8 as ae,a9 as k,L,B as C,aa as ne,ab as ie,ac as oe,ad as le,ae as ce,h as H,D as de,i as ue,k as me,l as pe,ai as he,bF as U,ah as xe,aR as fe,bG as _,bH as K,g as q,b as $,K as ge,M as je,N as ve,aS as ye,O as be,m as we}from"./app.js";import{r as c}from"./handsontable-PxYdjN8c.js";import{Icon as Q}from"./icon-FyVrxiPs.js";import{F as X}from"./field-renderer-Ddc4u-gC.js";import G from"./input-error-cgnQ235Q.js";import{D as Ne}from"./DiffViewer-DL5uCv8d.js";import"./jsoneditor-De1FvcYu.js";import"./monaco-BhBYtg3d.js";import"./dynamic-controls-k61T9W2P.js";var z=new Map,T=new WeakMap,J=0,Se=void 0;function ke(s){return s?(T.has(s)||(J+=1,T.set(s,J.toString())),T.get(s)):"0"}function Ce(s){return Object.keys(s).sort().filter(r=>s[r]!==void 0).map(r=>`${r}_${r==="root"?ke(s.root):s[r]}`).toString()}function De(s){const r=Ce(s);let n=z.get(r);if(!n){const l=new Map;let x;const u=new IntersectionObserver(d=>{d.forEach(i=>{var p;const b=i.isIntersecting&&x.some(m=>i.intersectionRatio>=m);s.trackVisibility&&typeof i.isVisible>"u"&&(i.isVisible=b),(p=l.get(i.target))==null||p.forEach(m=>{m(b,i)})})},s);x=u.thresholds||(Array.isArray(s.threshold)?s.threshold:[s.threshold||0]),n={id:r,observer:u,elements:l},z.set(r,n)}return n}function Fe(s,r,n={},l=Se){if(typeof window.IntersectionObserver>"u"&&l!==void 0){const p=s.getBoundingClientRect();return r(l,{isIntersecting:l,target:s,intersectionRatio:typeof n.threshold=="number"?n.threshold:0,time:0,boundingClientRect:p,intersectionRect:p,rootBounds:p}),()=>{}}const{id:x,observer:u,elements:d}=De(n),i=d.get(s)||[];return d.has(s)||d.set(s,i),i.push(r),u.observe(s),function(){i.splice(i.indexOf(r),1),i.length===0&&(d.delete(s),u.unobserve(s)),d.size===0&&(u.disconnect(),z.delete(x))}}function Ie({threshold:s,delay:r,trackVisibility:n,rootMargin:l,root:x,triggerOnce:u,skip:d,initialInView:i,fallbackInView:p,onChange:b}={}){var m;const[v,N]=c.useState(null),f=c.useRef(b),[S,h]=c.useState({inView:!!i,entry:void 0});f.current=b,c.useEffect(()=>{if(d||!v)return;let g;return g=Fe(v,(F,y)=>{h({inView:F,entry:y}),f.current&&f.current(F,y),y.isIntersecting&&u&&g&&(g(),g=void 0)},{root:x,rootMargin:l,threshold:s,trackVisibility:n,delay:r},p),()=>{g&&g()}},[Array.isArray(s)?s.toString():s,v,x,l,u,d,n,p,r]);const a=(m=S.entry)==null?void 0:m.target,o=c.useRef(void 0);!v&&a&&!u&&!d&&o.current!==a&&(o.current=a,h({inView:!!i,entry:void 0}));const w=[N,S.inView,S.entry];return w.ref=w[0],w.inView=w[1],w.entry=w[2],w}const Ee=({modelName:s,modelId:r,handleWatchHistory:n})=>{const[l,x]=c.useState([]),[u,d]=c.useState(!1),[i,p]=c.useState(null),[b,m]=c.useState(!0),v=se(),N="currentHistoryView",f=v.props.historyTableMessages;c.useEffect(()=>{(async()=>{m(!0);try{const o=await H.post(`${window.routePrefix}/history/get-model-history`,{modelName:s,modelId:r});o.data.data&&x(o.data.data)}catch(o){console.log(o)}finally{m(!1)}})()},[s,r]);const S=async a=>{try{const o=await H.post(`${window.routePrefix}/history/get-model-fields`,{historyId:a});o.data.data&&(localStorage.setItem(N,a.toString()),n(o.data.data))}catch(o){console.log(o)}},h=a=>{const o=localStorage.getItem(N);return o?o===a.id.toString():a.isCurrent};return e.jsx("div",{className:"relative h-full",children:e.jsxs("div",{className:"h-full overflow-y-auto mt-5 pr-5",children:[e.jsxs(te,{wrapperHeight:"max-h-full",children:[e.jsx(re,{className:"sticky top-0 bg-background shadow",children:e.jsxs(E,{children:[e.jsx(D,{className:"p-2 text-left",children:f.Date}),e.jsx(D,{className:"p-2 text-left",children:f.Event}),e.jsx(D,{className:"p-2 text-left",children:f.User}),e.jsx(D,{className:"p-2 text-left",children:"Diff"}),e.jsx(D,{className:"p-2 text-left"})]})}),e.jsx(ae,{children:b?e.jsx(E,{children:e.jsx(k,{colSpan:5,className:"p-10 text-center",children:e.jsx(L,{className:"mx-auto size-8 animate-spin"})})}):l.length>0?l.map(a=>e.jsxs(E,{children:[e.jsx(k,{className:"p-2 self-start pt-2.5",children:new Date(a.createdAt).toLocaleString()}),e.jsx(k,{className:"p-2 self-start pt-2.5 capitalize",children:a.action}),e.jsx(k,{className:"p-2 self-start pt-2.5 max-w-[250px] whitespace-break-spaces",children:e.jsx("div",{className:"max-w-[500px] whitespace-break-spaces font-medium text-chart-3",children:a.user.login})}),e.jsx(k,{className:"p-2 align-middle",children:e.jsx(C,{variant:"green",size:"sm",onClick:()=>{p(a.diff),d(!0)},children:e.jsx(ne,{})})}),e.jsx(k,{className:"p-2 align-middle text-center",children:h(a)?e.jsx("span",{className:"font-medium",children:f.Current}):e.jsx(C,{variant:"outline",size:"sm",onClick:()=>S(a.id),children:f.Watch})})]},a.id)):e.jsx(E,{children:e.jsx(k,{colSpan:5,className:"p-4 text-center font-medium text-muted-foreground",children:f["There is no history"]})})})]}),e.jsx(ie,{open:u,onOpenChange:a=>{d(a),a||setTimeout(()=>{document.body.removeAttribute("style")},300)},children:e.jsxs(oe,{className:"z-[1022] sm:max-w-[60vw]",children:[e.jsx(le,{children:e.jsx(ce,{children:"Diff"})}),e.jsx(Ne,{changes:i,className:"max-h-[80vh] overflow-auto sm:max-w-[60vw] w-full"})]})})]})})},Te=({dialogRef:s,modelId:r,modelName:n,callback:l})=>e.jsxs(de,{ref:s,children:[e.jsx(ue,{}),e.jsx(me,{children:e.jsx(pe,{children:e.jsx(Ee,{modelId:r,modelName:n,handleWatchHistory:l})})})]}),W=c.memo(({field:s})=>!s||typeof s!="object"||!s.label?(console.error("Invalid field for LabelRenderer:",s),null):e.jsxs("div",{className:"flex gap-3",children:[e.jsx($,{htmlFor:`${s.type}-${s.name}`,children:s.label}),s.tooltip&&e.jsx(ge,{children:e.jsxs(je,{children:[e.jsx(ve,{onClick:r=>r.preventDefault(),children:e.jsx(Q,{iconNode:ye,className:"text-primary w-5 h-5 cursor-pointer"})}),e.jsx(be,{align:"center",side:"top",className:"z-1002",children:e.jsx("p",{children:s.tooltip})})]})})]})),Re=c.memo(({field:s,value:r,onChange:n,processing:l,notFound:x,search:u})=>{if(!s||typeof s!="object"||!s.name||!s.type)return console.error("Invalid field for LazyField:",s),e.jsx("div",{className:"text-red-500",children:"Error: Invalid field data"});const[d,i]=Ie({triggerOnce:!0,rootMargin:"100px 0px"});return e.jsx("div",{ref:d,className:"grid gap-4 w-full",children:i?e.jsx(X,{field:s,value:r,onChange:n,notFound:x,search:u,processing:l}):e.jsx(we,{className:"w-full h-[250px] rounded-sm"})})}),Me=({page:s,catalog:r,callback:n,openNewWindow:l,openNewWindowLabel:x,isNavigation:u,DnavVisible:d,visibleLable:i})=>{var M;const{btnBack:p,btnHistory:b,view:m,edit:v,history:N,notFound:f,model:S,fields:h}=s.props,{data:a,setData:o,post:w,processing:g,transform:F}=he({...Object.fromEntries((h||[]).map(t=>[t.name,t.value??void 0])),jsonPopupCatalog:r}),[y,Y]=c.useState(!1),[B,O]=c.useState(l??!1),[V,Z]=c.useState(d??!1),R=c.useRef(null);c.useEffect(()=>{localStorage.removeItem("currentHistoryView")},[]),c.useEffect(()=>(O(l??!1),U(),o({...Object.fromEntries((h||[]).map(t=>[t.name,(t.type==="mediamanager"||t.type==="single-file")&&(t.value===null||t.value===void 0)?[]:t.value])),jsonPopupCatalog:r}),()=>U()),[h,r,l,o]);const A=c.useCallback((t,j)=>{o(t,j)},[o]);if(!Array.isArray(h))return console.error("Fields is not an array:",h),e.jsx("div",{className:"p-4 text-red-500",children:"Error: Fields data is invalid"});if(h.length===0)return console.warn("Fields array is empty"),e.jsx("div",{className:"p-4 text-gray-500",children:"No fields to display"});const P=h.filter(t=>!t||typeof t!="object"||!t.name||!t.type||!t.label);if(P.length>0)return console.error("Invalid fields found:",P),e.jsx("div",{className:"p-4 text-red-500",children:"Error: Some fields are missing required properties (name, type, label)"});const ee=async t=>{if(t.preventDefault(),r){Y(!0);const j=await H.post(s.props.postLink,a);j.status===200&&n&&(u?n(j.data.record,B,V):n(j.data.record))}else{const j=localStorage.getItem("backUrl");F(I=>({...I,redirectUrl:j??""})),w(s.props.postLink,{onSuccess:()=>{localStorage.setItem("backUrl","")}})}};return e.jsxs("div",{className:"p-4 w-full",children:[!r&&e.jsxs("div",{className:"w-full sticky z-[1001] py-4 pb-8 top-0 h-fit bg-background flex gap-4",children:[e.jsx(C,{className:"w-fit",asChild:!0,children:e.jsxs(xe,{href:p.link,preserveScroll:!0,children:[e.jsx(Q,{iconNode:fe}),p.title]})}),e.jsxs(C,{variant:"green",type:"submit",className:"w-fit lg:hidden",form:"addUserForm",disabled:y||g||s.props.view||_(),children:[y||g&&e.jsx(L,{className:"h-4 w-4 animate-spin"}),s.props.btnSave.title]})]}),e.jsx("form",{id:"addUserForm",onSubmit:ee,className:m?"cursor-not-allowed":"",children:e.jsxs("div",{className:"grid gap-4 max-w-286 pb-8 lg:grid-cols-[1fr_220px]",children:[e.jsx("div",{className:"flex flex-col gap-10",children:h.map(t=>e.jsx("div",{className:`grid gap-4 w-full ${m?"pointer-events-none":""}`,children:t.type==="markdown"||t.type==="table"||t.type==="jsonEditor"||t.type==="codeEditor"||t.type==="geoJson"?e.jsxs(e.Fragment,{children:[e.jsx(W,{field:t}),e.jsx(G,{message:K(`${t.type}-${t.name}`)}),e.jsx(Re,{field:t,value:a[t.name],onChange:A,processing:y||g||m,notFound:f,search:s.props.search})]}):e.jsxs(e.Fragment,{children:[e.jsx(W,{field:t}),e.jsx(G,{message:K(`${t.type}-${t.name}`)}),e.jsx(X,{field:t,value:a[t.name],onChange:A,processing:y||g||m,notFound:f,search:s.props.search})]})},t.name))}),e.jsxs("div",{className:`p-4 rounded-md h-fit sticky shadow ${r?"top-0 grid gap-4":"top-[84px] hidden lg:block"}`,children:[u&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex gap-4 items-center",children:[e.jsx(q,{id:"targetBlank",checked:B,onCheckedChange:t=>O(!!t),className:"cursor-pointer size-5"}),e.jsx($,{htmlFor:"targetBlank",children:x})]}),e.jsxs("div",{className:"flex gap-4 items-center",children:[e.jsx(q,{id:"visible",checked:V,onCheckedChange:t=>Z(!!t),className:"cursor-pointer size-5"}),e.jsx($,{htmlFor:"visible",children:i})]})]}),e.jsxs("div",{className:`flex gap-2 ${N&&(v||m)?"justify-center":"justify-start"}`,children:[e.jsxs(C,{variant:"green",type:"submit",className:"w-fit",disabled:y||g||s.props.view||_(),children:[(y||g)&&e.jsx(L,{className:"h-4 w-4 animate-spin"}),s.props.btnSave.title]}),N&&(v||m)&&e.jsx(C,{variant:"outline",className:"w-fit",onClick:t=>{var j;t.preventDefault(),(j=R.current)==null||j.open()},children:b.title})]})]})]})}),N&&(v||m)&&e.jsx(Te,{dialogRef:R,modelName:S,modelId:(M=h.find(t=>t.name==="id"))==null?void 0:M.value,callback:t=>{var j;for(const I of Object.keys(t))o(I,t[I]);(j=R.current)==null||j.close()}})]})};export{W as LabelRenderer,Re as LazyField,Me as default};
@@ -0,0 +1 @@
1
+ import{j as r}from"./app.js";import{A as o}from"./app-layout-DBlkqXBF.js";import t from"./add-group-form-DUhDxVwB.js";import"./jsoneditor-De1FvcYu.js";import"./handsontable-PxYdjN8c.js";import"./monaco-BhBYtg3d.js";import"./app-shell-CwiL9UZ5.js";import"./app-sidebar-IrVF2Bpi.js";import"./nav-main-G6VwCche.js";import"./material-icon-DZVU9Gse.js";import"./app-sidebar-header-qHEOMq5D.js";import"./breadcrumbs-D5PCyRGn.js";import"./nav-user-BfROibnw.js";import"./user-info-gFSwypEN.js";import"./user-menu-content-CjsydEH4.js";import"./theme-switcher-BURZ8Tza.js";import"./icon-FyVrxiPs.js";const m=[];function y(){return r.jsx(o,{breadcrumbs:m,children:r.jsx(t,{})})}export{y as default};
@@ -0,0 +1 @@
1
+ import{u as D,ai as O,j as e,B as T,ah as M,aR as S,L as q,b as x,I as y,g as z,K as P,M as R,N as U,aS as A,O as G}from"./app.js";import{Icon as I}from"./icon-FyVrxiPs.js";import{r as h}from"./handsontable-PxYdjN8c.js";import"./jsoneditor-De1FvcYu.js";import"./monaco-BhBYtg3d.js";const E=h.memo(({field:s,disabled:d,value:c,onCheckedChange:i,tooltip:t})=>{const m=h.useCallback(l=>{i(s.name,l)},[s.name,i]);return e.jsxs("div",{className:"flex gap-3 items-center",children:[e.jsx(z,{id:s.name,className:"cursor-pointer size-5",disabled:d,checked:c,onCheckedChange:m}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx(x,{className:"cursor-pointer",htmlFor:s.name,children:s.label}),t&&e.jsx(P,{children:e.jsxs(R,{children:[e.jsx(U,{onClick:l=>l.preventDefault(),children:e.jsx(I,{iconNode:A,className:"text-primary w-5 h-5 cursor-pointer"})}),e.jsx(G,{align:"center",side:"top",children:e.jsx("p",{children:s.tooltip})})]})})]})]})});function Q(){var u,g,j,b,v,f,N,k,C,w,F;const s=D(),{fields:d,groupedTokens:c,users:i}=s.props,{data:t,setData:m,clearErrors:l,post:L,processing:o}=O({...Object.fromEntries(d.map(a=>[a.name,a.value])),...Object.fromEntries(i.map(a=>[a.name,a.value])),...Object.fromEntries(c.flatMap(a=>a.fields.map(n=>[n.name,n.value])))}),r=a=>s.props.fields.find(n=>n.name===a),p=h.useCallback((a,n)=>{l(),m(a,n)},[]),B=a=>{a.preventDefault(),L(s.props.postLink)};return e.jsxs("div",{className:"flex h-full flex-1 flex-col gap-4 rounded-xl p-4",children:[e.jsxs("div",{className:"w-full sticky z-[1001] py-4 pb-8 top-0 h-fit bg-background flex gap-4",children:[e.jsx(T,{className:"mb-3 w-fit",asChild:!0,children:e.jsxs(M,{href:s.props.btnBack.link,children:[e.jsx(I,{iconNode:S}),s.props.btnBack.title]})}),e.jsxs(T,{variant:"green",type:"submit",className:"w-fit",form:"addUserForm",disabled:o||s.props.view,children:[o&&e.jsx(q,{className:"h-4 w-4 animate-spin"}),s.props.btnSave.title]})]}),e.jsx("form",{id:"addUserForm",onSubmit:B,className:`${s.props.view?"cursor-not-allowed":""}`,children:e.jsxs("div",{className:"flex flex-col gap-6 max-w-[1144px]",children:[e.jsx("h2",{className:"font-bold text-xl",children:s.props.head}),e.jsxs("div",{className:"grid gap-4",children:[e.jsx(x,{htmlFor:(u=r("name"))==null?void 0:u.name,children:(g=r("name"))==null?void 0:g.label}),e.jsx(y,{id:(j=r("name"))==null?void 0:j.name,type:"text",required:!0,tabIndex:1,autoComplete:(b=r("name"))==null?void 0:b.name,value:t.name,onChange:a=>p("name",a.target.value),disabled:o||s.props.view,placeholder:(v=r("name"))==null?void 0:v.label})]}),e.jsxs("div",{className:"grid gap-4",children:[e.jsx(x,{htmlFor:(f=r("description"))==null?void 0:f.name,children:(N=r("description"))==null?void 0:N.label}),e.jsx(y,{id:(k=r("description"))==null?void 0:k.name,type:"text",required:!0,tabIndex:1,autoComplete:(C=r("description"))==null?void 0:C.name,value:t.description,onChange:a=>p("description",a.target.value),disabled:o||s.props.view,placeholder:(w=r("description"))==null?void 0:w.label})]}),s.props.users.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("h2",{className:"font-bold text-xl",children:s.props.userHead}),s.props.users.map(a=>e.jsx(E,{field:a,disabled:o||s.props.view,value:t[a.name],onCheckedChange:p},a.name))]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 xl:grid-cols-4 gap-4",children:((F=s.props.groupedTokens)==null?void 0:F.length)>0&&s.props.groupedTokens.map(a=>e.jsxs("div",{className:"grid gap-4 content-start justify-between",children:[e.jsx("h2",{className:"font-bold text-xl mt-3",children:a.header}),a.fields.map(n=>e.jsx(E,{field:n,disabled:o||s.props.view,value:t[n.name],onCheckedChange:p,tooltip:!0},n.name))]},a.header))})]})})]})}export{Q as default};
@@ -0,0 +1 @@
1
+ import{u as he,ai as ue,j as e,B as c,ah as Q,aR as ge,L as je,b as o,I as n,S as W,c as X,d as Y,e as Z,f as ee,g as m,K as fe,M as ve,N as be,aS as we,O as Ne,h as Ce}from"./app.js";import{Icon as se}from"./icon-FyVrxiPs.js";import{r as ae}from"./handsontable-PxYdjN8c.js";import Pe from"./input-error-cgnQ235Q.js";import ke from"./material-icon-DZVU9Gse.js";import"./jsoneditor-De1FvcYu.js";import"./monaco-BhBYtg3d.js";function Te(){var p,x,h,u,g,j,f,v,b,w,N,C,P,k,F,z,y,I,U,S,E,T,A,L,q,V,B,D,M,O,R,H,K,_,$,G,J;const l=he(),[le,re]=ae.useState(),{fields:ie,groups:de,auth:oe}=l.props,{data:r,setData:te,errors:ne,setError:ce,clearErrors:me,post:pe,processing:i}=ue({...Object.fromEntries(ie.map(s=>[s.name,s.value])),...Object.fromEntries(de.map(s=>[s.name,s.value]))});ae.useEffect(()=>{(async()=>{const t=await Ce.get(`${window.routePrefix}/get-timezones`);re(t.data.timezones)})()},[]);const a=s=>l.props.fields.find(t=>t.name===s),xe=s=>{if(s.preventDefault(),r.userPassword!==r.repeatUserPassword){ce("repeatUserPassword",l.props.passwordError);return}pe(l.props.postLink)},d=(s,t)=>{me(),te(s,t)};return e.jsxs("div",{className:"flex h-full flex-1 flex-col gap-4 rounded-xl p-4",children:[e.jsxs("div",{className:"w-full sticky z-[1001] py-4 pb-8 top-0 h-fit bg-background flex gap-4",children:[e.jsx(c,{className:"mb-3 w-fit",asChild:!0,children:e.jsxs(Q,{href:l.props.btnBack.link,children:[e.jsx(se,{iconNode:ge}),l.props.btnBack.title]})}),e.jsxs(c,{variant:"green",type:"submit",className:"w-fit",form:"addUserForm",disabled:i||l.props.view,children:[i&&e.jsx(je,{className:"h-4 w-4 animate-spin"}),l.props.btnSave.title]})]}),e.jsx("form",{id:"addUserForm",onSubmit:xe,className:l.props.view?"cursor-not-allowed":"",children:e.jsxs("div",{className:"flex flex-col gap-10 max-w-[1144px]",children:[e.jsx("h2",{className:"font-bold text-xl",children:l.props.head}),e.jsxs("div",{className:"flex-col xl:flex-row flex gap-16",children:[e.jsxs("div",{className:"basis-1/2 flex flex-col gap-6",children:[e.jsxs("div",{className:"grid gap-4",children:[e.jsx(o,{htmlFor:(p=a("login"))==null?void 0:p.name,children:(x=a("login"))==null?void 0:x.label}),e.jsx(n,{id:(h=a("login"))==null?void 0:h.name,type:"text",required:!0,tabIndex:1,autoComplete:"username",value:r.login,onChange:s=>d("login",s.target.value),disabled:i||l.props.view,placeholder:(u=a("login"))==null?void 0:u.label})]}),e.jsxs("div",{className:"grid gap-4",children:[e.jsx(o,{htmlFor:(g=a("fullName"))==null?void 0:g.name,children:(j=a("fullName"))==null?void 0:j.label}),e.jsx(n,{id:(f=a("fullName"))==null?void 0:f.name,type:"text",required:!0,tabIndex:1,autoComplete:"additional-name",value:r.fullName,onChange:s=>d("fullName",s.target.value),disabled:i||l.props.view,placeholder:(v=a("fullName"))==null?void 0:v.label})]}),e.jsxs("div",{className:"grid gap-4",children:[e.jsx(o,{htmlFor:(b=a("email"))==null?void 0:b.name,children:(w=a("email"))==null?void 0:w.label}),e.jsx(n,{id:(N=a("email"))==null?void 0:N.name,type:"email",required:!0,tabIndex:1,autoComplete:"email",value:r.email,onChange:s=>d("email",s.target.value),disabled:i||l.props.view,placeholder:(C=a("email"))==null?void 0:C.label})]})]}),e.jsxs("div",{className:"basis-1/2 flex flex-col gap-6",children:[e.jsxs("div",{className:"grid gap-4",children:[e.jsx(o,{htmlFor:(P=a("timezone"))==null?void 0:P.name,children:(k=a("timezone"))==null?void 0:k.label}),e.jsxs(W,{onValueChange:s=>d("timezone",s),defaultValue:r.timezone,disabled:i||l.props.view,children:[e.jsx(X,{className:"w-full cursor-pointer",children:e.jsx(Y,{placeholder:(F=a("timezone"))==null?void 0:F.name})}),e.jsx(Z,{children:(le??[]).map(s=>e.jsx(ee,{value:s.value,children:s.label},s.value))})]})]}),e.jsxs("div",{className:"flex flex-col md:flex-row justify-start gap-4 xl:justify-between items-start md:items-center",children:[a("date")&&e.jsxs("div",{className:"grid gap-4",children:[e.jsx(o,{htmlFor:(z=a("date"))==null?void 0:z.name,children:(y=a("date"))==null?void 0:y.label}),e.jsx(n,{id:(I=a("date"))==null?void 0:I.name,type:"date",className:"max-w-fit",tabIndex:1,value:r.date,onChange:s=>d("date",s.target.value),disabled:i})]}),e.jsxs("div",{className:"flex gap-6",children:[a("isAdmin")&&e.jsxs("div",{className:"grid gap-4",children:[e.jsx(o,{className:"cursor-pointer",htmlFor:(U=a("isAdmin"))==null?void 0:U.name,children:(S=a("isAdmin"))==null?void 0:S.label}),e.jsx(m,{id:(E=a("isAdmin"))==null?void 0:E.name,className:"cursor-pointer size-5",disabled:i||l.props.view,checked:r.isAdmin,onCheckedChange:s=>d("isAdmin",s)})]}),a("isConfirmed")&&e.jsxs("div",{className:"grid gap-4",children:[e.jsx(o,{className:"cursor-pointer",htmlFor:(T=a("isConfirmed"))==null?void 0:T.name,children:(A=a("isConfirmed"))==null?void 0:A.label}),e.jsx(m,{id:(L=a("isConfirmed"))==null?void 0:L.name,className:"cursor-pointer size-5",disabled:i||l.props.view,checked:r.isConfirmed,onCheckedChange:s=>d("isConfirmed",s)})]})]})]}),a("locale")&&e.jsxs("div",{className:"grid gap-4",children:[e.jsx(o,{htmlFor:(q=a("locale"))==null?void 0:q.name,children:(V=a("locale"))==null?void 0:V.label}),e.jsxs(W,{onValueChange:s=>d("locale",s),defaultValue:r.locale,disabled:i||l.props.view,children:[e.jsx(X,{className:"w-full cursor-pointer",children:e.jsx(Y,{placeholder:(B=a("locale"))==null?void 0:B.name})}),e.jsx(Z,{children:(l.props.locales??[]).map(s=>e.jsx(ee,{value:s.value,children:s.label},s.value))})]})]})]})]}),oe.user.isAdministrator&&e.jsx(c,{className:"w-fit",asChild:!0,variant:"outline",children:e.jsxs(Q,{href:l.props.userPretend.postLink,method:"post",data:{login:r.login,pretend:!0},children:[e.jsx(ke,{name:"masks",className:"!text-[18px]"}),l.props.userPretend.label]})}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx("label",{className:"font-bold text-xl",children:(D=a("userPassword"))==null?void 0:D.label}),e.jsx(fe,{children:e.jsxs(ve,{children:[e.jsx(be,{onClick:s=>s.preventDefault(),children:e.jsx(se,{iconNode:we,className:"text-primary w-5 h-5 cursor-pointer"})}),e.jsx(Ne,{align:"center",side:"top",children:e.jsx("p",{children:(M=a("userPassword"))==null?void 0:M.tooltip})})]})})]}),e.jsxs("div",{className:"grid grid-col-1 lg:grid-cols-2 grid-rows-2 gap-x-16 gap-y-6",children:[e.jsxs("div",{className:"grid gap-4 col-span-1",children:[e.jsx(o,{htmlFor:(O=a("userPassword"))==null?void 0:O.name,children:(R=a("userPassword"))==null?void 0:R.label}),e.jsx(n,{id:(H=a("userPassword"))==null?void 0:H.name,type:"password",required:!l.props.edit,tabIndex:1,autoComplete:"new-password",value:r.password,onChange:s=>d("userPassword",s.target.value),disabled:i||l.props.view,placeholder:(K=a("userPassword"))==null?void 0:K.label})]}),e.jsxs("div",{className:"grid gap-4 col-span-1 col-start-1",children:[e.jsx(o,{htmlFor:(_=a("repeatUserPassword"))==null?void 0:_.name,children:($=a("repeatUserPassword"))==null?void 0:$.label}),e.jsx(n,{id:(G=a("repeatUserPassword"))==null?void 0:G.name,type:"password",required:!l.props.edit,tabIndex:1,autoComplete:"new-password",value:r.repeatUserPassword,onChange:s=>d("repeatUserPassword",s.target.value),disabled:i||l.props.view,placeholder:(J=a("repeatUserPassword"))==null?void 0:J.label}),e.jsx(Pe,{message:ne.repeatUserPassword})]})]}),l.props.groups.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("h2",{className:"font-bold text-xl",children:l.props.groupHead}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-5 xl:grid-cols-6 gap-4",children:l.props.groups.map(s=>e.jsxs("div",{className:"grid gap-4",children:[e.jsx(o,{className:"cursor-pointer",htmlFor:s.name,children:s.label}),e.jsx(m,{id:s.name,disabled:i||l.props.view,className:"cursor-pointer size-5",checked:r[s.name],onCheckedChange:t=>d(s.name,t)})]},s.name))})]})]})})]})}export{Te as default};
@@ -0,0 +1 @@
1
+ import{j as r}from"./app.js";import{A as o}from"./app-layout-DBlkqXBF.js";import t from"./add-user-form-Ct4i6Dse.js";import"./jsoneditor-De1FvcYu.js";import"./handsontable-PxYdjN8c.js";import"./monaco-BhBYtg3d.js";import"./app-shell-CwiL9UZ5.js";import"./app-sidebar-IrVF2Bpi.js";import"./nav-main-G6VwCche.js";import"./material-icon-DZVU9Gse.js";import"./app-sidebar-header-qHEOMq5D.js";import"./breadcrumbs-D5PCyRGn.js";import"./nav-user-BfROibnw.js";import"./user-info-gFSwypEN.js";import"./user-menu-content-CjsydEH4.js";import"./theme-switcher-BURZ8Tza.js";import"./icon-FyVrxiPs.js";import"./input-error-cgnQ235Q.js";const m=[];function E(){return r.jsx(o,{breadcrumbs:m,children:r.jsx(t,{})})}export{E as default};