adminizer 4.3.0-build.121 → 4.3.0-build.123
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.
- package/assets/{add-184PjeSO.js → add-CgwJJ1m0.js} +1 -1
- package/assets/add-form-BesO02mm.js +1 -0
- package/assets/app.js +2 -2
- package/assets/{catalog-CJ5JpPUx.js → catalog-Cot2u3nh.js} +5 -5
- package/assets/{form-CTDP9qtV.js → form-BVZylEYd.js} +1 -1
- package/assets/form-OQw8-LoC.js +1 -0
- package/assets/{home-CsjT3Uxk.js → home-cU6dBgyC.js} +2 -2
- package/assets/manifest.json +6 -6
- package/controllers/catalog/FrontendCatalogAdapter.d.ts +2 -2
- package/controllers/catalog/FrontentCatalogAdapter.d.ts +2 -2
- package/lib/catalog/AbstractCatalog.d.ts +4 -4
- package/lib/catalog/Navigation.js +2 -2
- package/package.json +1 -1
- package/assets/add-form-By91jsv1.js +0 -1
- package/assets/form--0esJdCP.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as r}from"./app.js";import{A as o}from"./app-layout-BmMzULcJ.js";import t from"./form
|
|
1
|
+
import{j as r}from"./app.js";import{A as o}from"./app-layout-BmMzULcJ.js";import t from"./form-OQw8-LoC.js";import"./jsoneditor-D95dIAP2.js";import"./vendor-wzZzN_Jv.js";import"./monaco-ICtx6xoc.js";import"./handsontable-PVakPtJV.js";import"./app-shell-C8Cnr5Hy.js";import"./app-sidebar-HwvXNZzk.js";import"./nav-main-BqKm87JZ.js";import"./material-icon-DwkE6wKL.js";import"./app-sidebar-header-RRnKZeeU.js";import"./breadcrumbs-DSMzNYiS.js";import"./nav-user-DuCZNsZX.js";import"./user-info-BGQvqBmO.js";import"./user-menu-content-BDm88xaM.js";import"./theme-switcher-cgyA7_cO.js";import"./icon-DpkedrXG.js";import"./add-form-BesO02mm.js";import"./field-renderer-CiCkOwxl.js";import"./dynamic-controls-BOYmRX_z.js";import"./input-error-CmXZF6xy.js";const m=[];function g(){return r.jsx(o,{breadcrumbs:m,children:r.jsx(t,{})})}export{g as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{u as y,X as v,bx as m,j as e,B as p,by as l,L as d,bz as c}from"./app.js";import{r as x}from"./monaco-ICtx6xoc.js";import{LabelRenderer as g,LazyField as F}from"./add-form-BesO02mm.js";import h from"./input-error-CmXZF6xy.js";import{F as N}from"./field-renderer-CiCkOwxl.js";import"./jsoneditor-D95dIAP2.js";import"./vendor-wzZzN_Jv.js";import"./handsontable-PVakPtJV.js";import"./icon-DpkedrXG.js";import"./dynamic-controls-BOYmRX_z.js";const A=()=>{const t=y(),{fields:a}=t.props,{data:o,setData:n,post:u,processing:r}=v({...Object.fromEntries((a||[]).map(s=>[s.name,s.value??void 0]))});x.useEffect(()=>(m(),()=>{m()}),[]);const i=x.useCallback((s,b)=>{n(s,b)},[n]);if(!Array.isArray(a))return console.error("Fields is not an array in Form component:",a),e.jsx("div",{className:"p-4 text-red-500",children:"Error: Fields data is invalid"});if(a.length===0)return console.warn("Fields array is empty in Form component"),e.jsx("div",{className:"p-4 text-gray-500",children:"No fields to display"});const j=s=>{s.preventDefault(),u(t.props.postLink,{preserveState:!1})};return e.jsxs("div",{className:"p-4 w-full",children:[e.jsx("div",{className:"w-full sticky z-[1001] py-4 pb-8 top-0 h-fit bg-background flex gap-4 lg:hidden",children:e.jsxs(p,{variant:"green",type:"submit",className:"w-fit",form:"addUserForm",disabled:r||l(),children:[r&&e.jsx(d,{className:"h-4 w-4 animate-spin"}),t.props.btnSave.title]})}),e.jsx("form",{className:`mt-8 ${r?"invisible":""}`,id:"addUserForm",onSubmit:j,children:e.jsxs("div",{className:"grid lg:grid-cols-[1fr_150px] gap-4 max-w-[1144px] pb-8",children:[e.jsx("div",{className:"flex flex-col gap-10",children:a.map(s=>e.jsx("div",{className:"grid gap-4 w-full",children:s.type==="markdown"||s.type==="table"||s.type==="jsonEditor"||s.type==="codeEditor"||s.type==="geoJson"?e.jsxs(e.Fragment,{children:[e.jsx(g,{field:s}),e.jsx(h,{message:c(`${s.type}-${s.name}`)}),e.jsx(F,{field:s,value:o[s.name],onChange:i,processing:r})]}):e.jsxs(e.Fragment,{children:[e.jsx(g,{field:s}),e.jsx(h,{message:c(`${s.type}-${s.name}`)}),e.jsx(N,{field:s,value:o[s.name],onChange:i,processing:r})]})},s.name))}),e.jsx("div",{className:"p-4 rounded-md h-fit sticky top-[84px] shadow hidden lg:block",children:e.jsxs(p,{variant:"green",type:"submit",className:"w-fit",disabled:r||l(),children:[r&&e.jsx(d,{className:"h-4 w-4 animate-spin"}),t.props.btnSave.title]})})]})})]})};export{A as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./app.js","./jsoneditor-D95dIAP2.js","./vendor-wzZzN_Jv.js","./monaco-ICtx6xoc.js","./handsontable-PVakPtJV.js","./app-AZGOzyLJ.css","./add-form-
|
|
2
|
-
import{_ as t}from"./jsoneditor-D95dIAP2.js";import{u as x,j as o,V as v,W as P}from"./app.js";import{r as l}from"./monaco-ICtx6xoc.js";import"./vendor-wzZzN_Jv.js";import"./handsontable-PVakPtJV.js";const L=(i,n,_)=>{const r=i[n];return r?typeof r=="function"?r():Promise.resolve(r):new Promise((p,m)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(m.bind(null,new Error("Unknown variable dynamic import: "+n+(n.split("/").length!==_?". Note that variables only represent file names one level deep.":""))))})};function T(){const i=x(),[n,_]=l.useState(null),[r,p]=l.useState(null),m=i.props.controls,c=async()=>{const{component:s,props:a}=m[0],E=(await L(Object.assign({"../components/VanillaJSONEditor.tsx":()=>t(()=>import("./app.js").then(e=>e.bO),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url),"../components/add-form.tsx":()=>t(()=>import("./add-form-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./app.js","./jsoneditor-D95dIAP2.js","./vendor-wzZzN_Jv.js","./monaco-ICtx6xoc.js","./handsontable-PVakPtJV.js","./app-AZGOzyLJ.css","./add-form-BesO02mm.js","./icon-DpkedrXG.js","./field-renderer-CiCkOwxl.js","./dynamic-controls-BOYmRX_z.js","./field-renderer-CRNLShJD.css","./input-error-CmXZF6xy.js","./add-group-form-DMz0_Oo9.js","./add-user-form-izlXhv2-.js","./material-icon-DwkE6wKL.js","./app-shell-C8Cnr5Hy.js","./app-sidebar-header-RRnKZeeU.js","./breadcrumbs-DSMzNYiS.js","./nav-user-DuCZNsZX.js","./user-info-BGQvqBmO.js","./user-menu-content-BDm88xaM.js","./theme-switcher-cgyA7_cO.js","./app-sidebar-HwvXNZzk.js","./nav-main-BqKm87JZ.js","./date-picker-kW3wZQr_.js","./form-OQw8-LoC.js","./geo-json-YeWQOYnT.js","./list-table-BPpHDVPf.js","./del-modal-DyIWFflP.js","./pagination-render-io0M2m2O.js","./nav-footer-B85HLj-j.js","./toast-editor-DwRk6WqT.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as t}from"./jsoneditor-D95dIAP2.js";import{u as x,j as o,V as v,W as P}from"./app.js";import{r as l}from"./monaco-ICtx6xoc.js";import"./vendor-wzZzN_Jv.js";import"./handsontable-PVakPtJV.js";const L=(i,n,_)=>{const r=i[n];return r?typeof r=="function"?r():Promise.resolve(r):new Promise((p,m)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(m.bind(null,new Error("Unknown variable dynamic import: "+n+(n.split("/").length!==_?". Note that variables only represent file names one level deep.":""))))})};function T(){const i=x(),[n,_]=l.useState(null),[r,p]=l.useState(null),m=i.props.controls,c=async()=>{const{component:s,props:a}=m[0],E=(await L(Object.assign({"../components/VanillaJSONEditor.tsx":()=>t(()=>import("./app.js").then(e=>e.bO),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url),"../components/add-form.tsx":()=>t(()=>import("./add-form-BesO02mm.js"),__vite__mapDeps([6,0,1,2,3,4,5,7,8,9,10,11]),import.meta.url),"../components/add-group-form.tsx":()=>t(()=>import("./add-group-form-DMz0_Oo9.js"),__vite__mapDeps([12,0,1,2,3,4,5,7]),import.meta.url),"../components/add-user-form.tsx":()=>t(()=>import("./add-user-form-izlXhv2-.js"),__vite__mapDeps([13,0,1,2,3,4,5,7,11,14]),import.meta.url),"../components/app-shell.tsx":()=>t(()=>import("./app-shell-C8Cnr5Hy.js"),__vite__mapDeps([15,0,1,2,3,4,5]),import.meta.url),"../components/app-sidebar-header.tsx":()=>t(()=>import("./app-sidebar-header-RRnKZeeU.js").then(e=>e.a),__vite__mapDeps([16,0,1,2,3,4,5,17,18,19,20,21,7,14]),import.meta.url),"../components/app-sidebar.tsx":()=>t(()=>import("./app-sidebar-HwvXNZzk.js"),__vite__mapDeps([22,0,1,2,3,4,5,23,14]),import.meta.url),"../components/breadcrumbs.tsx":()=>t(()=>import("./breadcrumbs-DSMzNYiS.js"),__vite__mapDeps([17,0,1,2,3,4,5]),import.meta.url),"../components/date-picker.tsx":()=>t(()=>import("./date-picker-kW3wZQr_.js"),__vite__mapDeps([24,0,1,2,3,4,5]),import.meta.url),"../components/dynamic-controls.tsx":()=>t(()=>import("./dynamic-controls-BOYmRX_z.js"),__vite__mapDeps([9,0,1,2,3,4,5]),import.meta.url),"../components/field-renderer.tsx":()=>t(()=>import("./field-renderer-CiCkOwxl.js").then(e=>e.f),__vite__mapDeps([8,1,2,0,3,4,5,9,10]),import.meta.url),"../components/form.tsx":()=>t(()=>import("./form-OQw8-LoC.js"),__vite__mapDeps([25,0,1,2,3,4,5,6,7,8,9,10,11]),import.meta.url),"../components/geo-json.tsx":()=>t(()=>import("./geo-json-YeWQOYnT.js"),__vite__mapDeps([26,0,1,2,3,4,5]),import.meta.url),"../components/handsontable.tsx":()=>t(()=>import("./app.js").then(e=>e.bP),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url),"../components/icon.tsx":()=>t(()=>import("./icon-DpkedrXG.js"),__vite__mapDeps([7,0,1,2,3,4,5]),import.meta.url),"../components/input-error.tsx":()=>t(()=>import("./input-error-CmXZF6xy.js"),__vite__mapDeps([11,0,1,2,3,4,5]),import.meta.url),"../components/list-table.tsx":()=>t(()=>import("./list-table-BPpHDVPf.js"),__vite__mapDeps([27,0,1,2,3,4,5,7,14,28,29]),import.meta.url),"../components/material-icon.tsx":()=>t(()=>import("./material-icon-DwkE6wKL.js"),__vite__mapDeps([14,0,1,2,3,4,5]),import.meta.url),"../components/monaco-editor.tsx":()=>t(()=>import("./app.js").then(e=>e.bQ),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url),"../components/multi-select.tsx":()=>t(()=>import("./app.js").then(e=>e.bR),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url),"../components/nav-footer.tsx":()=>t(()=>import("./nav-footer-B85HLj-j.js"),__vite__mapDeps([30,0,1,2,3,4,5,7]),import.meta.url),"../components/nav-main.tsx":()=>t(()=>import("./nav-main-BqKm87JZ.js"),__vite__mapDeps([23,0,1,2,3,4,5,14]),import.meta.url),"../components/nav-user.tsx":()=>t(()=>import("./nav-user-DuCZNsZX.js"),__vite__mapDeps([18,0,1,2,3,4,5,19,20]),import.meta.url),"../components/pagination-render.tsx":()=>t(()=>import("./pagination-render-io0M2m2O.js"),__vite__mapDeps([29,0,1,2,3,4,5]),import.meta.url),"../components/theme-switcher.tsx":()=>t(()=>import("./theme-switcher-cgyA7_cO.js"),__vite__mapDeps([21,0,1,2,3,4,5,7]),import.meta.url),"../components/toast-editor.tsx":()=>t(()=>import("./toast-editor-DwRk6WqT.js"),__vite__mapDeps([31,0,1,2,3,4,5]),import.meta.url),"../components/user-info.tsx":()=>t(()=>import("./user-info-BGQvqBmO.js"),__vite__mapDeps([19,0,1,2,3,4,5]),import.meta.url),"../components/user-menu-content.tsx":()=>t(()=>import("./user-menu-content-BDm88xaM.js"),__vite__mapDeps([20,0,1,2,3,4,5,19]),import.meta.url)}),`../components/${s}.tsx`,3)).default;_(o.jsx(E,{...a}))},d=async()=>{const{component:s}=m[1],u=(await import(s)).default;p(o.jsx(u,{message:"Hello from Component B"}))};return o.jsxs(o.Fragment,{children:[o.jsx(v,{title:"Home"}),o.jsx("div",{children:o.jsx(P,{href:"/page",children:"Page"})}),o.jsx("div",{children:o.jsx("h1",{children:"Is Home"})}),o.jsxs("div",{children:[o.jsx("button",{onClick:c,children:"Загрузить компонент"}),o.jsx("p",{}),n||o.jsx("p",{children:"Нажмите кнопку, чтобы загрузить компонент"})]}),o.jsx("p",{}),o.jsxs("div",{children:[o.jsx("button",{onClick:d,children:"Загрузить компонент"}),o.jsx("p",{}),r||o.jsx("p",{children:"Нажмите кнопку, чтобы загрузить компонент"})]})]})}export{T as default};
|
package/assets/manifest.json
CHANGED
|
@@ -187,7 +187,7 @@
|
|
|
187
187
|
]
|
|
188
188
|
},
|
|
189
189
|
"src/assets/js/components/add-form.tsx": {
|
|
190
|
-
"file": "add-form-
|
|
190
|
+
"file": "add-form-BesO02mm.js",
|
|
191
191
|
"name": "add-form",
|
|
192
192
|
"src": "src/assets/js/components/add-form.tsx",
|
|
193
193
|
"isDynamicEntry": true,
|
|
@@ -301,7 +301,7 @@
|
|
|
301
301
|
]
|
|
302
302
|
},
|
|
303
303
|
"src/assets/js/components/form.tsx": {
|
|
304
|
-
"file": "form
|
|
304
|
+
"file": "form-OQw8-LoC.js",
|
|
305
305
|
"name": "form",
|
|
306
306
|
"src": "src/assets/js/components/form.tsx",
|
|
307
307
|
"isDynamicEntry": true,
|
|
@@ -570,7 +570,7 @@
|
|
|
570
570
|
]
|
|
571
571
|
},
|
|
572
572
|
"src/assets/js/pages/add.tsx": {
|
|
573
|
-
"file": "add-
|
|
573
|
+
"file": "add-CgwJJ1m0.js",
|
|
574
574
|
"name": "add",
|
|
575
575
|
"src": "src/assets/js/pages/add.tsx",
|
|
576
576
|
"isDynamicEntry": true,
|
|
@@ -599,7 +599,7 @@
|
|
|
599
599
|
]
|
|
600
600
|
},
|
|
601
601
|
"src/assets/js/pages/catalog.tsx": {
|
|
602
|
-
"file": "catalog-
|
|
602
|
+
"file": "catalog-Cot2u3nh.js",
|
|
603
603
|
"name": "catalog",
|
|
604
604
|
"src": "src/assets/js/pages/catalog.tsx",
|
|
605
605
|
"isDynamicEntry": true,
|
|
@@ -660,7 +660,7 @@
|
|
|
660
660
|
]
|
|
661
661
|
},
|
|
662
662
|
"src/assets/js/pages/form.tsx": {
|
|
663
|
-
"file": "form-
|
|
663
|
+
"file": "form-BVZylEYd.js",
|
|
664
664
|
"name": "form",
|
|
665
665
|
"src": "src/assets/js/pages/form.tsx",
|
|
666
666
|
"isDynamicEntry": true,
|
|
@@ -690,7 +690,7 @@
|
|
|
690
690
|
]
|
|
691
691
|
},
|
|
692
692
|
"src/assets/js/pages/home.tsx": {
|
|
693
|
-
"file": "home-
|
|
693
|
+
"file": "home-cU6dBgyC.js",
|
|
694
694
|
"name": "home",
|
|
695
695
|
"src": "src/assets/js/pages/home.tsx",
|
|
696
696
|
"isDynamicEntry": true,
|
|
@@ -33,11 +33,11 @@ export declare class FrontendCatalog {
|
|
|
33
33
|
setId(id: string): void;
|
|
34
34
|
getItemType(type: string): import("../../lib/catalog/AbstractCatalog").BaseItem<Item>;
|
|
35
35
|
getAddTemplate(item: any, req: ReqType): Promise<{
|
|
36
|
-
type: "component" | "navigation.group" | "navigation.link" | "model";
|
|
36
|
+
type: "component" | "navigation.group" | "navigation.link" | "model" | "model.link";
|
|
37
37
|
data: any;
|
|
38
38
|
}>;
|
|
39
39
|
getEditTemplate(item: any, id: string | number, req: ReqType, modelId: string | number): Promise<{
|
|
40
|
-
type: "component" | "navigation.group" | "navigation.link" | "model";
|
|
40
|
+
type: "component" | "navigation.group" | "navigation.link" | "model" | "model.link";
|
|
41
41
|
data: any;
|
|
42
42
|
}>;
|
|
43
43
|
getitemTypes(): {
|
|
@@ -33,11 +33,11 @@ export declare class FrontendCatalog {
|
|
|
33
33
|
setId(id: string): void;
|
|
34
34
|
getItemType(type: string): import("../../lib/catalog/AbstractCatalog").BaseItem<Item>;
|
|
35
35
|
getAddTemplate(item: any, req: ReqType): Promise<{
|
|
36
|
-
type: "component" | "navigation.group" | "navigation.link" | "model";
|
|
36
|
+
type: "component" | "navigation.group" | "navigation.link" | "model" | "model.link";
|
|
37
37
|
data: any;
|
|
38
38
|
}>;
|
|
39
39
|
getEditTemplate(item: any, id: string | number, req: ReqType, modelId: string | number): Promise<{
|
|
40
|
-
type: "component" | "navigation.group" | "navigation.link" | "model";
|
|
40
|
+
type: "component" | "navigation.group" | "navigation.link" | "model" | "model.link";
|
|
41
41
|
data: any;
|
|
42
42
|
}>;
|
|
43
43
|
getitemTypes(): {
|
|
@@ -92,7 +92,7 @@ export declare abstract class BaseItem<T extends Item> {
|
|
|
92
92
|
* @param req
|
|
93
93
|
*/
|
|
94
94
|
abstract getAddTemplate(req: ReqType): Promise<{
|
|
95
|
-
type: 'component' | 'navigation.group' | 'navigation.link' | 'model';
|
|
95
|
+
type: 'component' | 'navigation.group' | 'navigation.link' | 'model' | 'model.link';
|
|
96
96
|
data: any;
|
|
97
97
|
}>;
|
|
98
98
|
/**
|
|
@@ -103,7 +103,7 @@ export declare abstract class BaseItem<T extends Item> {
|
|
|
103
103
|
* @param modelId
|
|
104
104
|
*/
|
|
105
105
|
abstract getEditTemplate(id: string | number, catalogId: string, req: ReqType, modelId?: string | number): Promise<{
|
|
106
|
-
type: 'component' | 'navigation.group' | 'navigation.link' | 'model';
|
|
106
|
+
type: 'component' | 'navigation.group' | 'navigation.link' | 'model' | 'model.link';
|
|
107
107
|
data: any;
|
|
108
108
|
}>;
|
|
109
109
|
_getChilds(parentId: string | number, catalogId: string, req?: ReqType): Promise<Item[]>;
|
|
@@ -232,7 +232,7 @@ export declare abstract class AbstractCatalog {
|
|
|
232
232
|
* @param modelId
|
|
233
233
|
*/
|
|
234
234
|
getEditTemplate(item: Item, id: string | number, req: ReqType, modelId?: string | number): Promise<{
|
|
235
|
-
type: "component" | "navigation.group" | "navigation.link" | "model";
|
|
235
|
+
type: "component" | "navigation.group" | "navigation.link" | "model" | "model.link";
|
|
236
236
|
data: any;
|
|
237
237
|
}>;
|
|
238
238
|
/**
|
|
@@ -241,7 +241,7 @@ export declare abstract class AbstractCatalog {
|
|
|
241
241
|
* @param req
|
|
242
242
|
*/
|
|
243
243
|
getAddTemplate(item: Item, req: ReqType): Promise<{
|
|
244
|
-
type: "component" | "navigation.group" | "navigation.link" | "model";
|
|
244
|
+
type: "component" | "navigation.group" | "navigation.link" | "model" | "model.link";
|
|
245
245
|
data: any;
|
|
246
246
|
}>;
|
|
247
247
|
addActionHandler(actionHandler: ActionHandler): void;
|
|
@@ -274,7 +274,7 @@ class NavigationItem extends AbstractItem {
|
|
|
274
274
|
* // TODO: need passing custom React module
|
|
275
275
|
*/
|
|
276
276
|
async getAddTemplate(req) {
|
|
277
|
-
let type = 'model';
|
|
277
|
+
let type = 'model.link';
|
|
278
278
|
// Direct call by model adapter
|
|
279
279
|
let itemsDB = await this.adminizer.modelHandler.model.get(this.model)["_find"]({});
|
|
280
280
|
let items = itemsDB.map((item) => {
|
|
@@ -304,7 +304,7 @@ class NavigationItem extends AbstractItem {
|
|
|
304
304
|
}
|
|
305
305
|
async getEditTemplate(id, catalogId, req, modelId) {
|
|
306
306
|
return Promise.resolve({
|
|
307
|
-
type: 'model',
|
|
307
|
+
type: 'model.link',
|
|
308
308
|
data: {
|
|
309
309
|
item: await this.find(id, catalogId)
|
|
310
310
|
}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{X as J,bx as $,j as s,B as S,W as K,aE as X,by as T,L as B,bz as L,g as z,b as E,m as q,K as G,M as H,N as Q,aF as W,O as Y,h as Z}from"./app.js";import{r as d}from"./monaco-ICtx6xoc.js";import{Icon as M}from"./icon-DpkedrXG.js";import{F as U}from"./field-renderer-CiCkOwxl.js";import O from"./input-error-CmXZF6xy.js";import"./jsoneditor-D95dIAP2.js";import"./vendor-wzZzN_Jv.js";import"./handsontable-PVakPtJV.js";import"./dynamic-controls-BOYmRX_z.js";var R=new Map,C=new WeakMap,V=0,ee=void 0;function se(e){return e?(C.has(e)||(V+=1,C.set(e,V.toString())),C.get(e)):"0"}function re(e){return Object.keys(e).sort().filter(t=>e[t]!==void 0).map(t=>`${t}_${t==="root"?se(e.root):e[t]}`).toString()}function te(e){const t=re(e);let a=R.get(t);if(!a){const o=new Map;let u;const i=new IntersectionObserver(c=>{c.forEach(n=>{var l;const g=n.isIntersecting&&u.some(p=>n.intersectionRatio>=p);e.trackVisibility&&typeof n.isVisible>"u"&&(n.isVisible=g),(l=o.get(n.target))==null||l.forEach(p=>{p(g,n)})})},e);u=i.thresholds||(Array.isArray(e.threshold)?e.threshold:[e.threshold||0]),a={id:t,observer:i,elements:o},R.set(t,a)}return a}function ne(e,t,a={},o=ee){if(typeof window.IntersectionObserver>"u"&&o!==void 0){const l=e.getBoundingClientRect();return t(o,{isIntersecting:o,target:e,intersectionRatio:typeof a.threshold=="number"?a.threshold:0,time:0,boundingClientRect:l,intersectionRect:l,rootBounds:l}),()=>{}}const{id:u,observer:i,elements:c}=te(a),n=c.get(e)||[];return c.has(e)||c.set(e,n),n.push(t),i.observe(e),function(){n.splice(n.indexOf(t),1),n.length===0&&(c.delete(e),i.unobserve(e)),c.size===0&&(i.disconnect(),R.delete(u))}}function ae({threshold:e,delay:t,trackVisibility:a,rootMargin:o,root:u,triggerOnce:i,skip:c,initialInView:n,fallbackInView:l,onChange:g}={}){var p;const[f,N]=d.useState(null),b=d.useRef(g),[y,m]=d.useState({inView:!!n,entry:void 0});b.current=g,d.useEffect(()=>{if(c||!f)return;let v;return v=ne(f,(k,w)=>{m({inView:k,entry:w}),b.current&&b.current(k,w),w.isIntersecting&&i&&v&&(v(),v=void 0)},{root:u,rootMargin:o,threshold:e,trackVisibility:a,delay:t},l),()=>{v&&v()}},[Array.isArray(e)?e.toString():e,f,u,o,i,c,a,l,t]);const F=(p=y.entry)==null?void 0:p.target,h=d.useRef(void 0);!f&&F&&!i&&!c&&h.current!==F&&(h.current=F,m({inView:!!n,entry:void 0}));const x=[N,y.inView,y.entry];return x.ref=x[0],x.inView=x[1],x.entry=x[2],x}const _=d.memo(({field:e})=>s.jsxs("div",{className:"flex gap-3",children:[s.jsx(E,{htmlFor:`${e.type}-${e.name}`,children:e.label}),e.tooltip&&s.jsx(G,{children:s.jsxs(H,{children:[s.jsx(Q,{onClick:t=>t.preventDefault(),children:s.jsx(M,{iconNode:W,className:"text-primary w-5 h-5 cursor-pointer"})}),s.jsx(Y,{align:"center",side:"top",className:"z-[1002]",children:s.jsx("p",{children:e.tooltip})})]})})]})),oe=d.memo(({field:e,value:t,onChange:a,processing:o,notFound:u,search:i})=>{const[c,n]=ae({triggerOnce:!0,rootMargin:"100px 0px"});return s.jsx("div",{ref:c,className:"grid gap-4 w-full",children:n?s.jsx(U,{field:e,value:t,onChange:a,notFound:u,search:i,processing:o}):s.jsx(q,{className:"w-full h-[250px] rounded-sm"})})}),ve=({page:e,catalog:t,callback:a,openNewWindow:o,openNewWindowLabel:u,isNavigation:i,DnavVisible:c,visibleLable:n})=>{const{fields:l,btnBack:g,view:p,notFound:f}=e.props,{data:N,setData:b,post:y,processing:m,transform:F}=J({...Object.fromEntries(l.map(r=>[r.name,r.value??void 0])),jsonPopupCatalog:t}),[h,x]=d.useState(!1),[v,k]=d.useState(o??!1),[w,A]=d.useState(c??!1);d.useEffect(()=>(k(o??!1),$(),b({...Object.fromEntries(l.map(r=>[r.name,r.value??void 0])),jsonPopupCatalog:t}),()=>$()),[l,t,o]);const I=d.useCallback((r,j)=>{b(r,j)},[]),P=async r=>{if(r.preventDefault(),t){x(!0);const j=await Z.post(e.props.postLink,N);j.status===200&&a&&(i?a(j.data.record,v,w):a(j.data.record))}else{const j=localStorage.getItem("backUrl");F(D=>({...D,redirectUrl:j??""})),y(e.props.postLink,{onSuccess:()=>{localStorage.setItem("backUrl","")}})}};return s.jsxs("div",{className:"p-4 w-full",children:[!t&&s.jsxs("div",{className:"w-full sticky z-[1001] py-4 pb-8 top-0 h-fit bg-background flex gap-4",children:[s.jsx(S,{className:"w-fit",asChild:!0,children:s.jsxs(K,{href:g.link,preserveScroll:!0,children:[s.jsx(M,{iconNode:X}),g.title]})}),s.jsxs(S,{variant:"green",type:"submit",className:"w-fit lg:hidden",form:"addUserForm",disabled:h||m||e.props.view||T(),children:[h||m&&s.jsx(B,{className:"h-4 w-4 animate-spin"}),e.props.btnSave.title]})]}),s.jsx("form",{id:"addUserForm",onSubmit:P,className:p?"cursor-not-allowed":"",children:s.jsxs("div",{className:`grid lg:grid-cols-[1fr_150px] gap-4 max-w-[1144px] pb-8 ${t?"lg:grid-cols-[1fr_200px]":"lg:grid-cols-[1fr_150px]"}`,children:[s.jsx("div",{className:"flex flex-col gap-10",children:l.map(r=>s.jsx("div",{className:`grid gap-4 w-full ${p?"pointer-events-none":""}`,children:r.type==="markdown"||r.type==="table"||r.type==="jsonEditor"||r.type==="codeEditor"||r.type==="geoJson"?s.jsxs(s.Fragment,{children:[s.jsx(_,{field:r}),s.jsx(O,{message:L(`${r.type}-${r.name}`)}),s.jsx(oe,{field:r,value:N[r.name],onChange:I,processing:h||m||p,notFound:f,search:e.props.search})]}):s.jsxs(s.Fragment,{children:[s.jsx(_,{field:r}),s.jsx(O,{message:L(`${r.type}-${r.name}`)}),s.jsx(U,{field:r,value:N[r.name],onChange:I,processing:h||m||p,notFound:f,search:e.props.search})]})},r.name))}),s.jsxs("div",{className:`p-4 rounded-md h-fit sticky shadow ${t?"top-0 grid gap-4":"top-[84px] hidden lg:block"}`,children:[i&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex gap-4 items-center",children:[s.jsx(z,{id:"targetBlank",checked:v,onCheckedChange:r=>k(!!r),className:"cursor-pointer size-5"}),s.jsx(E,{htmlFor:"targetBlank",children:u})]}),s.jsxs("div",{className:"flex gap-4 items-center",children:[s.jsx(z,{id:"visible",checked:w,onCheckedChange:r=>A(!!r),className:"cursor-pointer size-5"}),s.jsx(E,{htmlFor:"visible",children:n})]})]}),s.jsxs(S,{variant:"green",type:"submit",className:"w-fit",disabled:h||m||e.props.view||T(),children:[(h||m)&&s.jsx(B,{className:"h-4 w-4 animate-spin"}),e.props.btnSave.title]})]})]})})]})};export{_ as LabelRenderer,oe as LazyField,ve as default};
|
package/assets/form--0esJdCP.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{u as v,X as y,bx as m,j as e,B as p,by as i,L as l,bz as c}from"./app.js";import{r as d}from"./monaco-ICtx6xoc.js";import{LabelRenderer as x,LazyField as F}from"./add-form-By91jsv1.js";import g from"./input-error-CmXZF6xy.js";import{F as N}from"./field-renderer-CiCkOwxl.js";import"./jsoneditor-D95dIAP2.js";import"./vendor-wzZzN_Jv.js";import"./handsontable-PVakPtJV.js";import"./icon-DpkedrXG.js";import"./dynamic-controls-BOYmRX_z.js";const B=()=>{const r=v(),{fields:t}=r.props,{data:o,setData:u,post:h,processing:a}=y(Object.fromEntries(t.map(s=>[s.name,s.value??void 0])));d.useEffect(()=>(m(),()=>{m()}),[]);const n=d.useCallback((s,b)=>{u(s,b)},[]),j=s=>{s.preventDefault(),h(r.props.postLink,{preserveState:!1})};return e.jsxs("div",{className:"p-4 w-full",children:[e.jsx("div",{className:"w-full sticky z-[1001] py-4 pb-8 top-0 h-fit bg-background flex gap-4 lg:hidden",children:e.jsxs(p,{variant:"green",type:"submit",className:"w-fit",form:"addUserForm",disabled:a||i(),children:[a&&e.jsx(l,{className:"h-4 w-4 animate-spin"}),r.props.btnSave.title]})}),e.jsx("form",{className:`mt-8 ${a?"invisible":""}`,id:"addUserForm",onSubmit:j,children:e.jsxs("div",{className:"grid lg:grid-cols-[1fr_150px] gap-4 max-w-[1144px] pb-8",children:[e.jsx("div",{className:"flex flex-col gap-10",children:t.map(s=>e.jsx("div",{className:"grid gap-4 w-full",children:s.type==="markdown"||s.type==="table"||s.type==="jsonEditor"||s.type==="codeEditor"||s.type==="geoJson"?e.jsxs(e.Fragment,{children:[e.jsx(x,{field:s}),e.jsx(g,{message:c(`${s.type}-${s.name}`)}),e.jsx(F,{field:s,value:o[s.name],onChange:n,processing:a})]}):e.jsxs(e.Fragment,{children:[e.jsx(x,{field:s}),e.jsx(g,{message:c(`${s.type}-${s.name}`)}),e.jsx(N,{field:s,value:o[s.name],onChange:n,processing:a})]})},s.name))}),e.jsx("div",{className:"p-4 rounded-md h-fit sticky top-[84px] shadow hidden lg:block",children:e.jsxs(p,{variant:"green",type:"submit",className:"w-fit",disabled:a||i(),children:[a&&e.jsx(l,{className:"h-4 w-4 animate-spin"}),r.props.btnSave.title]})})]})})]})};export{B as default};
|