@opennsw/jsonforms-renderers 0.0.1 → 0.0.2
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/dist/index.d.ts +4 -0
- package/dist/renderers.cjs.js +5 -5
- package/dist/renderers.es.js +314 -226
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -8,6 +8,10 @@ import { RankedTester } from '@jsonforms/core';
|
|
|
8
8
|
import { TesterContext } from '@jsonforms/core';
|
|
9
9
|
import { UISchemaElement } from '@jsonforms/core';
|
|
10
10
|
|
|
11
|
+
export declare const ArrayControl: ComponentType<OwnPropsOfControl>;
|
|
12
|
+
|
|
13
|
+
export declare const ArrayControlTester: (uischema: UISchemaElement, schema: JsonSchema, context: TesterContext) => number;
|
|
14
|
+
|
|
11
15
|
export declare const BooleanControl: ({ data, handleChange, path, label, required, errors, schema, enabled }: ControlProps) => JSX.Element;
|
|
12
16
|
|
|
13
17
|
export declare const BooleanControlTester: RankedTester;
|
package/dist/renderers.cjs.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),s=require("@jsonforms/core"),T=require("@jsonforms/react"),r=require("@radix-ui/themes"),z=require("react"),v=require("@radix-ui/react-icons"),B=({data:l,handleChange:u,path:t,label:p,required:h,errors:o,uischema:c,schema:i,enabled:x})=>{var g;const a=o.length===0;return e.jsx(r.Box,{mb:"4",children:e.jsxs(r.Flex,{direction:"column",gap:"1",children:[e.jsxs(r.Text,{as:"label",size:"2",weight:"bold",htmlFor:t,children:[p," ",h&&e.jsx(r.Text,{color:"red",children:"*"})]}),e.jsx(r.TextField.Root,{value:l||"",onChange:j=>u(t,j.target.value),disabled:!x,placeholder:(g=c.options)==null?void 0:g.placeholder,color:a?void 0:"red",id:t}),!a&&o!=="is a required property"&&e.jsx(r.Text,{color:"red",size:"1",children:o}),i.description&&e.jsx(r.Text,{size:"1",color:"gray",children:i.description})]})})},D=s.rankWith(1,s.isStringControl),le=T.withJsonFormsControlProps(B),I=({data:l,handleChange:u,path:t,label:p,required:h,errors:o,uischema:c,schema:i,enabled:x})=>{var j;const a=o.length===0,g=m=>{if(m===""){u(t,void 0);return}const d=Number(m);isNaN(d)||u(t,d)};return e.jsx(r.Box,{mb:"4",children:e.jsxs(r.Flex,{direction:"column",gap:"1",children:[e.jsxs(r.Text,{as:"label",size:"2",weight:"bold",htmlFor:t,children:[p," ",h&&e.jsx(r.Text,{color:"red",children:"*"})]}),e.jsx(r.TextField.Root,{type:"number",value:l??"",onChange:m=>g(m.target.value),disabled:!x,placeholder:(j=c.options)==null?void 0:j.placeholder,color:a?void 0:"red",id:t}),!a&&o!=="is a required property"&&e.jsx(r.Text,{color:"red",size:"1",children:o}),i.description&&e.jsx(r.Text,{size:"1",color:"gray",children:i.description})]})})},N=s.rankWith(2,s.or(s.isNumberControl,s.isIntegerControl)),ie=T.withJsonFormsControlProps(I),S=({data:l,handleChange:u,path:t,label:p,required:h,errors:o,schema:c,enabled:i})=>{const x=o.length===0;return e.jsxs(r.Box,{mb:"4",children:[e.jsxs(r.Flex,{gap:"2",align:"center",children:[e.jsx(r.Checkbox,{checked:!!l,onCheckedChange:a=>u(t,a===!0),disabled:!i,id:t}),e.jsxs(r.Text,{as:"label",size:"2",htmlFor:t,children:[p," ",h&&"*"]})]}),!x&&e.jsx(r.Text,{color:"red",size:"1",className:"block mt-1",children:o}),c.description&&e.jsx(r.Text,{size:"1",color:"gray",className:"block mt-1",children:c.description})]})},A=s.rankWith(2,s.isBooleanControl),ae=T.withJsonFormsControlProps(S),W=({data:l,handleChange:u,path:t,label:p,required:h,errors:o,schema:c,uischema:i,enabled:x})=>{var m;const a=o.length===0;let g=[];c.enum?g=c.enum.map(d=>({value:String(d),label:String(d)})):c.oneOf&&(g=c.oneOf.map(d=>({value:String(d.const),label:d.title||String(d.const)})));const j=l!==void 0?String(l):"";return e.jsx(r.Box,{mb:"4",children:e.jsxs(r.Flex,{direction:"column",gap:"1",children:[e.jsxs(r.Text,{as:"label",size:"2",weight:"bold",htmlFor:t,children:[p," ",h&&e.jsx(r.Text,{color:"red",children:"*"})]}),e.jsxs(r.Select.Root,{value:j,onValueChange:d=>u(t,d),disabled:!x,children:[e.jsx(r.Select.Trigger,{placeholder:((m=i.options)==null?void 0:m.placeholder)||"Select an option",color:a?void 0:"red",id:t}),e.jsx(r.Select.Content,{children:g.map(d=>e.jsx(r.Select.Item,{value:d.value,children:d.label},d.value))})]}),!a&&o!=="is a required property"&&e.jsx(r.Text,{color:"red",size:"1",children:o}),c.description&&e.jsx(r.Text,{size:"1",color:"gray",children:c.description})]})})},P=s.rankWith(2,s.or(s.isEnumControl,s.isOneOfControl)),ce=T.withJsonFormsControlProps(W),V=({data:l,handleChange:u,path:t,label:p,required:h,errors:o,schema:c,enabled:i})=>{const x=o.length===0;return e.jsx(r.Box,{mb:"4",children:e.jsxs(r.Flex,{direction:"column",gap:"1",children:[e.jsxs(r.Text,{as:"label",size:"2",weight:"bold",htmlFor:t,children:[p," ",h&&e.jsx(r.Text,{color:"red",children:"*"})]}),e.jsx(r.TextField.Root,{type:"date",value:l||"",onChange:a=>u(t,a.target.value),disabled:!i,color:x?void 0:"red",id:t}),!x&&o!=="is a required property"&&e.jsx(r.Text,{color:"red",size:"1",children:o}),c.description&&e.jsx(r.Text,{size:"1",color:"gray",children:c.description})]})})},J=s.rankWith(2,s.isDateControl),de=T.withJsonFormsControlProps(V),q=({uischema:l,schema:u,path:t,renderers:p,cells:h,enabled:o})=>{const i=l.elements;return e.jsx(r.Flex,{direction:"column",gap:"4",children:i.map((x,a)=>e.jsx(T.JsonFormsDispatch,{uischema:x,schema:u,path:t,renderers:p,cells:h,enabled:o},`${t}-${a}`))})},E=s.rankWith(1,s.uiTypeIs("VerticalLayout")),H=({uischema:l,schema:u,path:t,renderers:p,cells:h,enabled:o})=>{const i=l.elements;return e.jsx(r.Flex,{direction:"row",gap:"4",children:i.map((x,a)=>e.jsx(r.Box,{style:{flex:1},children:e.jsx(T.JsonFormsDispatch,{uischema:x,schema:u,path:t,renderers:p,cells:h,enabled:o})},`${t}-${a}`))})},O=s.rankWith(1,s.uiTypeIs("HorizontalLayout")),M=({uischema:l,schema:u,path:t,renderers:p,cells:h,enabled:o})=>{const c=l,i=c.elements;return e.jsxs(r.Card,{mb:"4",children:[c.label&&e.jsx(r.Heading,{size:"4",mb:"4",children:c.label}),e.jsx(r.Flex,{direction:"column",gap:"4",children:i.map((x,a)=>e.jsx(T.JsonFormsDispatch,{uischema:x,schema:u,path:t,renderers:p,cells:h,enabled:o},`${t}-${a}`))})]})},G=s.rankWith(1,s.uiTypeIs("Group")),U=({uischema:l,schema:u,path:t,renderers:p,cells:h,enabled:o})=>{var j;const i=l.elements.filter(m=>m.type==="Category"),[x,a]=z.useState(((j=i[0])==null?void 0:j.label)||"");if(!i.length)return null;const g=i.find(m=>m.label===x)?x:i[0].label;return e.jsxs(r.Tabs.Root,{value:g,onValueChange:a,children:[e.jsx(r.Tabs.List,{children:i.map((m,d)=>e.jsx(r.Tabs.Trigger,{value:m.label,children:m.label},`${t}-${d}`))}),e.jsx(r.Box,{pt:"3",children:i.map((m,d)=>e.jsx(r.Tabs.Content,{value:m.label,children:e.jsx(r.Flex,{direction:"column",gap:"4",children:m.elements.map((F,f)=>e.jsx(T.JsonFormsDispatch,{uischema:F,schema:u,path:t,renderers:p,cells:h,enabled:o},`${t}-${d}-${f}`))})},`${t}-${d}`))})]})},K=s.rankWith(1,s.uiTypeIs("Categorization")),ue=({data:l,handleChange:u,path:t,label:p,required:h,uischema:o,enabled:c})=>{const[i,x]=z.useState(!1),[a,g]=z.useState(null),[j,m]=z.useState(null),d=z.useRef(null),F=(o==null?void 0:o.options)||{},f=F.maxSize||5*1024*1024,y=F.accept||"image/*,application/pdf",b=c!==!1,k=()=>j||(l?"Uploaded File":null),w=n=>{if(n.size>f){const C=(f/1048576).toFixed(0);g(`File size exceeds ${C}MB limit.`);return}const se=y.split(",").map(C=>C.trim()).some(C=>C.endsWith("/*")?n.type.startsWith(C.slice(0,-1)):C.startsWith(".")?n.name.toLowerCase().endsWith(C.toLowerCase()):n.type===C);if(y!=="*"&&!se&&!y.includes("*/*")){g(`Invalid file type. Accepted types: ${y}`);return}const L=new FileReader;L.onload=()=>{const C=L.result;u(t,C),m(n.name),g(null)},L.onerror=()=>{g("Failed to read file")},L.readAsDataURL(n)},R=n=>{n.preventDefault(),n.stopPropagation(),!(!b||l)&&(n.type==="dragenter"||n.type==="dragover"?x(!0):n.type==="dragleave"&&x(!1))},re=n=>{n.preventDefault(),n.stopPropagation(),x(!1),!(!b||l)&&n.dataTransfer.files&&n.dataTransfer.files[0]&&w(n.dataTransfer.files[0])},te=n=>{n.target.files&&n.target.files[0]&&w(n.target.files[0])},oe=()=>{b&&(u(t,null),m(null),g(null),d.current&&(d.current.value=""))},ne=n=>{var $;b&&(n.key==="Enter"||n.key===" ")&&(n.preventDefault(),($=d.current)==null||$.click())};return e.jsxs(r.Box,{mb:"4",children:[e.jsxs(r.Text,{as:"label",size:"2",weight:"bold",mb:"1",className:"block",children:[p," ",h&&"*"]}),l?e.jsx(r.Card,{size:"2",variant:"surface",className:"relative group",children:e.jsxs(r.Flex,{align:"center",gap:"3",children:[e.jsx(r.Box,{className:"bg-blue-100 p-2 rounded text-blue-600",children:e.jsx(v.FileTextIcon,{width:"20",height:"20"})}),e.jsxs(r.Box,{style:{flex:1,overflow:"hidden"},children:[e.jsx(r.Text,{size:"2",weight:"bold",className:"block truncate",children:k()}),b?e.jsx(r.Text,{size:"1",color:"gray",children:"Ready to submit"}):e.jsx("a",{href:l,download:j||"document",className:"text-xs text-blue-600 hover:underline cursor-pointer",onClick:n=>n.stopPropagation(),children:"Download"})]}),e.jsxs(r.Flex,{align:"center",gap:"2",children:[e.jsx(v.CheckCircledIcon,{className:"text-green-600 w-5 h-5"}),b&&e.jsx(r.IconButton,{variant:"ghost",color:"gray",onClick:oe,className:"hover:text-red-600 transition-colors",children:e.jsx(v.Cross2Icon,{})})]})]})}):e.jsxs("div",{className:`
|
|
2
2
|
border-2 border-dashed rounded-lg p-6 text-center transition-all duration-200 ease-in-out
|
|
3
|
-
${
|
|
4
|
-
${
|
|
5
|
-
${
|
|
6
|
-
`,onDragEnter:
|
|
3
|
+
${i?"border-blue-500 bg-blue-50":"border-gray-300 hover:border-blue-400 hover:bg-gray-50"}
|
|
4
|
+
${a?"border-red-300 bg-red-50":""}
|
|
5
|
+
${b?"cursor-pointer":"opacity-60 cursor-not-allowed pointer-events-none"}
|
|
6
|
+
`,onDragEnter:R,onDragLeave:R,onDragOver:R,onDrop:re,onClick:()=>{var n;return b&&((n=d.current)==null?void 0:n.click())},onKeyDown:ne,role:"button",tabIndex:b?0:-1,children:[e.jsx("input",{ref:d,type:"file",className:"hidden",accept:y,onChange:te,disabled:!b}),e.jsx(r.Flex,{direction:"column",align:"center",gap:"2",children:a?e.jsxs(e.Fragment,{children:[e.jsx(v.ExclamationTriangleIcon,{className:"w-8 h-8 text-red-500"}),e.jsx(r.Text,{size:"2",color:"red",weight:"medium",children:a}),e.jsx(r.Text,{size:"1",color:"gray",children:"Click to try again"})]}):e.jsxs(e.Fragment,{children:[e.jsx(v.UploadIcon,{className:"w-8 h-8 text-gray-400"}),e.jsx(r.Text,{size:"2",weight:"medium",children:"Click to upload or drag and drop"}),e.jsxs(r.Text,{size:"1",color:"gray",children:["Max ",Math.round(f/(1024*1024)),"MB"]})]})})]})]})},_=T.withJsonFormsControlProps(ue),Q=s.rankWith(3,s.formatIs("data-url")),xe=({data:l,path:u,schema:t,uischema:p,enabled:h,visible:o,addItem:c,removeItems:i,rootSchema:x})=>{const a=t.items;if(o===!1||!a||typeof a!="object"||Array.isArray(a))return null;const g=a,j=Array.isArray(l)?l:[],m=t.title||"Array Items",d=()=>{const f=s.createDefaultValue(g,x);c&&c(u,f)},F=f=>{if(i){const y=i(u,[f]);y&&y()}};return e.jsx(r.Box,{mb:"6",children:e.jsxs(r.Flex,{direction:"column",gap:"4",children:[e.jsx(r.Text,{as:"div",size:"4",weight:"bold",children:m}),j.length===0&&e.jsx(r.Box,{py:"4",px:"4",style:{backgroundColor:"var(--gray-3)",borderRadius:"var(--radius-3)"},children:e.jsx(r.Text,{size:"2",color:"gray",children:"No items have been added yet."})}),j.map((f,y)=>{var k;const b=`${u}.${y}`;return e.jsx(r.Card,{size:"3",variant:"surface",children:e.jsxs(r.Flex,{direction:"column",gap:"4",children:[e.jsxs(r.Flex,{justify:"between",align:"center",children:[e.jsxs(r.Text,{size:"3",weight:"bold",children:["Item ",y+1]}),h&&e.jsxs(r.Button,{color:"red",variant:"soft",onClick:()=>F(y),title:"Remove item",children:[e.jsx(v.TrashIcon,{}),"Remove"]})]}),e.jsx(r.Box,{children:e.jsx(T.JsonFormsDispatch,{schema:g,uischema:((k=p.options)==null?void 0:k.detail)||{type:"VerticalLayout",elements:Object.keys(g.properties||{}).map(w=>({type:"Control",scope:`#/properties/${w}`}))},path:b,enabled:h,renderers:void 0,cells:void 0})})]})},b)}),h&&e.jsx(r.Box,{mt:"2",children:e.jsxs(r.Button,{variant:"surface",onClick:d,children:[e.jsx(v.PlusIcon,{}),"Add Item"]})})]})})},X=T.withJsonFormsArrayControlProps(xe),Y=s.rankWith(2,s.and(s.uiTypeIs("Control"),s.schemaTypeIs("array"))),Z=({uischema:l,visible:u})=>{const t=l;return u===!1?null:e.jsx(r.Box,{mb:"4",children:e.jsx(r.Heading,{size:"4",children:t.text})})},ee=s.rankWith(1,s.uiTypeIs("Label")),he=[{tester:D,renderer:le},{tester:N,renderer:ie},{tester:A,renderer:ae},{tester:P,renderer:ce},{tester:J,renderer:de},{tester:E,renderer:q},{tester:O,renderer:H},{tester:G,renderer:M},{tester:K,renderer:U},{tester:Q,renderer:_},{tester:Y,renderer:X},{tester:ee,renderer:Z}];exports.ArrayControl=X;exports.ArrayControlTester=Y;exports.BooleanControl=S;exports.BooleanControlTester=A;exports.CategorizationLayoutRenderer=U;exports.CategorizationLayoutTester=K;exports.DateControl=V;exports.DateControlTester=J;exports.FileControl=_;exports.FileControlTester=Q;exports.GroupLayoutRenderer=M;exports.GroupLayoutTester=G;exports.HorizontalLayoutRenderer=H;exports.HorizontalLayoutTester=O;exports.LabelRenderer=Z;exports.LabelTester=ee;exports.NumberControl=I;exports.NumberControlTester=N;exports.SelectControl=W;exports.SelectControlTester=P;exports.TextControl=B;exports.TextControlTester=D;exports.VerticalLayoutRenderer=q;exports.VerticalLayoutTester=E;exports.radixRenderers=he;
|
package/dist/renderers.es.js
CHANGED
|
@@ -1,328 +1,328 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { rankWith as
|
|
3
|
-
import { withJsonFormsControlProps as
|
|
4
|
-
import { Box as
|
|
5
|
-
import { useState as
|
|
6
|
-
import { FileTextIcon as
|
|
7
|
-
const
|
|
1
|
+
import { jsx as e, jsxs as c, Fragment as O } from "react/jsx-runtime";
|
|
2
|
+
import { rankWith as T, isStringControl as K, or as j, isNumberControl as U, isIntegerControl as _, isBooleanControl as Q, isEnumControl as X, isOneOfControl as Y, isDateControl as Z, uiTypeIs as F, formatIs as ee, createDefaultValue as re, and as te, schemaTypeIs as oe } from "@jsonforms/core";
|
|
3
|
+
import { withJsonFormsControlProps as N, JsonFormsDispatch as k, withJsonFormsArrayControlProps as ne } from "@jsonforms/react";
|
|
4
|
+
import { Box as f, Flex as C, Text as s, TextField as P, Checkbox as le, Select as L, Tabs as A, Card as E, Heading as M, IconButton as ie, Button as W } from "@radix-ui/themes";
|
|
5
|
+
import { useState as S, useRef as ce } from "react";
|
|
6
|
+
import { FileTextIcon as se, CheckCircledIcon as ae, Cross2Icon as de, ExclamationTriangleIcon as ue, UploadIcon as he, TrashIcon as me, PlusIcon as pe } from "@radix-ui/react-icons";
|
|
7
|
+
const ge = ({ data: n, handleChange: u, path: r, label: g, required: m, errors: t, uischema: a, schema: l, enabled: h }) => {
|
|
8
8
|
var b;
|
|
9
|
-
const
|
|
10
|
-
return /* @__PURE__ */ e(
|
|
11
|
-
/* @__PURE__ */
|
|
12
|
-
|
|
9
|
+
const i = t.length === 0;
|
|
10
|
+
return /* @__PURE__ */ e(f, { mb: "4", children: /* @__PURE__ */ c(C, { direction: "column", gap: "1", children: [
|
|
11
|
+
/* @__PURE__ */ c(s, { as: "label", size: "2", weight: "bold", htmlFor: r, children: [
|
|
12
|
+
g,
|
|
13
13
|
" ",
|
|
14
|
-
m && /* @__PURE__ */ e(
|
|
14
|
+
m && /* @__PURE__ */ e(s, { color: "red", children: "*" })
|
|
15
15
|
] }),
|
|
16
16
|
/* @__PURE__ */ e(
|
|
17
|
-
|
|
17
|
+
P.Root,
|
|
18
18
|
{
|
|
19
19
|
value: n || "",
|
|
20
|
-
onChange: (
|
|
21
|
-
disabled: !
|
|
22
|
-
placeholder: (b =
|
|
23
|
-
color:
|
|
20
|
+
onChange: (y) => u(r, y.target.value),
|
|
21
|
+
disabled: !h,
|
|
22
|
+
placeholder: (b = a.options) == null ? void 0 : b.placeholder,
|
|
23
|
+
color: i ? void 0 : "red",
|
|
24
24
|
id: r
|
|
25
25
|
}
|
|
26
26
|
),
|
|
27
|
-
!
|
|
28
|
-
l.description && /* @__PURE__ */ e(
|
|
27
|
+
!i && t !== "is a required property" && /* @__PURE__ */ e(s, { color: "red", size: "1", children: t }),
|
|
28
|
+
l.description && /* @__PURE__ */ e(s, { size: "1", color: "gray", children: l.description })
|
|
29
29
|
] }) });
|
|
30
|
-
},
|
|
30
|
+
}, be = T(
|
|
31
31
|
1,
|
|
32
|
-
|
|
33
|
-
),
|
|
34
|
-
var
|
|
35
|
-
const
|
|
36
|
-
if (
|
|
37
|
-
|
|
32
|
+
K
|
|
33
|
+
), ye = N(ge), fe = ({ data: n, handleChange: u, path: r, label: g, required: m, errors: t, uischema: a, schema: l, enabled: h }) => {
|
|
34
|
+
var y;
|
|
35
|
+
const i = t.length === 0, b = (p) => {
|
|
36
|
+
if (p === "") {
|
|
37
|
+
u(r, void 0);
|
|
38
38
|
return;
|
|
39
39
|
}
|
|
40
|
-
const
|
|
41
|
-
isNaN(
|
|
40
|
+
const d = Number(p);
|
|
41
|
+
isNaN(d) || u(r, d);
|
|
42
42
|
};
|
|
43
|
-
return /* @__PURE__ */ e(
|
|
44
|
-
/* @__PURE__ */
|
|
45
|
-
|
|
43
|
+
return /* @__PURE__ */ e(f, { mb: "4", children: /* @__PURE__ */ c(C, { direction: "column", gap: "1", children: [
|
|
44
|
+
/* @__PURE__ */ c(s, { as: "label", size: "2", weight: "bold", htmlFor: r, children: [
|
|
45
|
+
g,
|
|
46
46
|
" ",
|
|
47
|
-
m && /* @__PURE__ */ e(
|
|
47
|
+
m && /* @__PURE__ */ e(s, { color: "red", children: "*" })
|
|
48
48
|
] }),
|
|
49
49
|
/* @__PURE__ */ e(
|
|
50
|
-
|
|
50
|
+
P.Root,
|
|
51
51
|
{
|
|
52
52
|
type: "number",
|
|
53
53
|
value: n ?? "",
|
|
54
|
-
onChange: (
|
|
55
|
-
disabled: !
|
|
56
|
-
placeholder: (
|
|
57
|
-
color:
|
|
54
|
+
onChange: (p) => b(p.target.value),
|
|
55
|
+
disabled: !h,
|
|
56
|
+
placeholder: (y = a.options) == null ? void 0 : y.placeholder,
|
|
57
|
+
color: i ? void 0 : "red",
|
|
58
58
|
id: r
|
|
59
59
|
}
|
|
60
60
|
),
|
|
61
|
-
!
|
|
62
|
-
l.description && /* @__PURE__ */ e(
|
|
61
|
+
!i && t !== "is a required property" && /* @__PURE__ */ e(s, { color: "red", size: "1", children: t }),
|
|
62
|
+
l.description && /* @__PURE__ */ e(s, { size: "1", color: "gray", children: l.description })
|
|
63
63
|
] }) });
|
|
64
|
-
},
|
|
64
|
+
}, Ce = T(
|
|
65
65
|
2,
|
|
66
|
-
|
|
67
|
-
),
|
|
68
|
-
const
|
|
69
|
-
return /* @__PURE__ */
|
|
70
|
-
/* @__PURE__ */
|
|
66
|
+
j(U, _)
|
|
67
|
+
), ve = N(fe), ze = ({ data: n, handleChange: u, path: r, label: g, required: m, errors: t, schema: a, enabled: l }) => {
|
|
68
|
+
const h = t.length === 0;
|
|
69
|
+
return /* @__PURE__ */ c(f, { mb: "4", children: [
|
|
70
|
+
/* @__PURE__ */ c(C, { gap: "2", align: "center", children: [
|
|
71
71
|
/* @__PURE__ */ e(
|
|
72
|
-
|
|
72
|
+
le,
|
|
73
73
|
{
|
|
74
74
|
checked: !!n,
|
|
75
|
-
onCheckedChange: (
|
|
75
|
+
onCheckedChange: (i) => u(r, i === !0),
|
|
76
76
|
disabled: !l,
|
|
77
77
|
id: r
|
|
78
78
|
}
|
|
79
79
|
),
|
|
80
|
-
/* @__PURE__ */
|
|
81
|
-
|
|
80
|
+
/* @__PURE__ */ c(s, { as: "label", size: "2", htmlFor: r, children: [
|
|
81
|
+
g,
|
|
82
82
|
" ",
|
|
83
83
|
m && "*"
|
|
84
84
|
] })
|
|
85
85
|
] }),
|
|
86
|
-
!
|
|
87
|
-
|
|
86
|
+
!h && /* @__PURE__ */ e(s, { color: "red", size: "1", className: "block mt-1", children: t }),
|
|
87
|
+
a.description && /* @__PURE__ */ e(s, { size: "1", color: "gray", className: "block mt-1", children: a.description })
|
|
88
88
|
] });
|
|
89
|
-
},
|
|
89
|
+
}, Te = T(
|
|
90
90
|
2,
|
|
91
91
|
Q
|
|
92
|
-
),
|
|
93
|
-
var
|
|
94
|
-
const
|
|
92
|
+
), xe = N(ze), we = ({ data: n, handleChange: u, path: r, label: g, required: m, errors: t, schema: a, uischema: l, enabled: h }) => {
|
|
93
|
+
var p;
|
|
94
|
+
const i = t.length === 0;
|
|
95
95
|
let b = [];
|
|
96
|
-
|
|
97
|
-
value: String(
|
|
98
|
-
label:
|
|
96
|
+
a.enum ? b = a.enum.map((d) => ({ value: String(d), label: String(d) })) : a.oneOf && (b = a.oneOf.map((d) => ({
|
|
97
|
+
value: String(d.const),
|
|
98
|
+
label: d.title || String(d.const)
|
|
99
99
|
})));
|
|
100
|
-
const
|
|
101
|
-
return /* @__PURE__ */ e(
|
|
102
|
-
/* @__PURE__ */
|
|
103
|
-
|
|
100
|
+
const y = n !== void 0 ? String(n) : "";
|
|
101
|
+
return /* @__PURE__ */ e(f, { mb: "4", children: /* @__PURE__ */ c(C, { direction: "column", gap: "1", children: [
|
|
102
|
+
/* @__PURE__ */ c(s, { as: "label", size: "2", weight: "bold", htmlFor: r, children: [
|
|
103
|
+
g,
|
|
104
104
|
" ",
|
|
105
|
-
m && /* @__PURE__ */ e(
|
|
105
|
+
m && /* @__PURE__ */ e(s, { color: "red", children: "*" })
|
|
106
106
|
] }),
|
|
107
|
-
/* @__PURE__ */
|
|
108
|
-
|
|
107
|
+
/* @__PURE__ */ c(
|
|
108
|
+
L.Root,
|
|
109
109
|
{
|
|
110
|
-
value:
|
|
111
|
-
onValueChange: (
|
|
112
|
-
disabled: !
|
|
110
|
+
value: y,
|
|
111
|
+
onValueChange: (d) => u(r, d),
|
|
112
|
+
disabled: !h,
|
|
113
113
|
children: [
|
|
114
114
|
/* @__PURE__ */ e(
|
|
115
|
-
|
|
115
|
+
L.Trigger,
|
|
116
116
|
{
|
|
117
|
-
placeholder: ((
|
|
118
|
-
color:
|
|
117
|
+
placeholder: ((p = l.options) == null ? void 0 : p.placeholder) || "Select an option",
|
|
118
|
+
color: i ? void 0 : "red",
|
|
119
119
|
id: r
|
|
120
120
|
}
|
|
121
121
|
),
|
|
122
|
-
/* @__PURE__ */ e(
|
|
122
|
+
/* @__PURE__ */ e(L.Content, { children: b.map((d) => /* @__PURE__ */ e(L.Item, { value: d.value, children: d.label }, d.value)) })
|
|
123
123
|
]
|
|
124
124
|
}
|
|
125
125
|
),
|
|
126
|
-
!
|
|
127
|
-
|
|
126
|
+
!i && t !== "is a required property" && /* @__PURE__ */ e(s, { color: "red", size: "1", children: t }),
|
|
127
|
+
a.description && /* @__PURE__ */ e(s, { size: "1", color: "gray", children: a.description })
|
|
128
128
|
] }) });
|
|
129
|
-
},
|
|
129
|
+
}, $e = T(
|
|
130
130
|
2,
|
|
131
|
-
|
|
132
|
-
),
|
|
133
|
-
const
|
|
134
|
-
return /* @__PURE__ */ e(
|
|
135
|
-
/* @__PURE__ */
|
|
136
|
-
|
|
131
|
+
j(X, Y)
|
|
132
|
+
), Fe = N(we), Ne = ({ data: n, handleChange: u, path: r, label: g, required: m, errors: t, schema: a, enabled: l }) => {
|
|
133
|
+
const h = t.length === 0;
|
|
134
|
+
return /* @__PURE__ */ e(f, { mb: "4", children: /* @__PURE__ */ c(C, { direction: "column", gap: "1", children: [
|
|
135
|
+
/* @__PURE__ */ c(s, { as: "label", size: "2", weight: "bold", htmlFor: r, children: [
|
|
136
|
+
g,
|
|
137
137
|
" ",
|
|
138
|
-
m && /* @__PURE__ */ e(
|
|
138
|
+
m && /* @__PURE__ */ e(s, { color: "red", children: "*" })
|
|
139
139
|
] }),
|
|
140
140
|
/* @__PURE__ */ e(
|
|
141
|
-
|
|
141
|
+
P.Root,
|
|
142
142
|
{
|
|
143
143
|
type: "date",
|
|
144
144
|
value: n || "",
|
|
145
|
-
onChange: (
|
|
145
|
+
onChange: (i) => u(r, i.target.value),
|
|
146
146
|
disabled: !l,
|
|
147
|
-
color:
|
|
147
|
+
color: h ? void 0 : "red",
|
|
148
148
|
id: r
|
|
149
149
|
}
|
|
150
150
|
),
|
|
151
|
-
!
|
|
152
|
-
|
|
151
|
+
!h && t !== "is a required property" && /* @__PURE__ */ e(s, { color: "red", size: "1", children: t }),
|
|
152
|
+
a.description && /* @__PURE__ */ e(s, { size: "1", color: "gray", children: a.description })
|
|
153
153
|
] }) });
|
|
154
|
-
},
|
|
154
|
+
}, ke = T(
|
|
155
155
|
2,
|
|
156
156
|
Z
|
|
157
|
-
),
|
|
157
|
+
), De = N(Ne), Ie = ({ uischema: n, schema: u, path: r, renderers: g, cells: m, enabled: t }) => {
|
|
158
158
|
const l = n.elements;
|
|
159
|
-
return /* @__PURE__ */ e(C, { direction: "column", gap: "4", children: l.map((
|
|
160
|
-
|
|
159
|
+
return /* @__PURE__ */ e(C, { direction: "column", gap: "4", children: l.map((h, i) => /* @__PURE__ */ e(
|
|
160
|
+
k,
|
|
161
161
|
{
|
|
162
|
-
uischema:
|
|
163
|
-
schema:
|
|
162
|
+
uischema: h,
|
|
163
|
+
schema: u,
|
|
164
164
|
path: r,
|
|
165
|
-
renderers:
|
|
165
|
+
renderers: g,
|
|
166
166
|
cells: m,
|
|
167
|
-
enabled:
|
|
167
|
+
enabled: t
|
|
168
168
|
},
|
|
169
|
-
`${r}-${
|
|
169
|
+
`${r}-${i}`
|
|
170
170
|
)) });
|
|
171
|
-
},
|
|
171
|
+
}, Re = T(1, F("VerticalLayout")), Le = ({ uischema: n, schema: u, path: r, renderers: g, cells: m, enabled: t }) => {
|
|
172
172
|
const l = n.elements;
|
|
173
|
-
return /* @__PURE__ */ e(C, { direction: "row", gap: "4", children: l.map((
|
|
174
|
-
|
|
173
|
+
return /* @__PURE__ */ e(C, { direction: "row", gap: "4", children: l.map((h, i) => /* @__PURE__ */ e(f, { style: { flex: 1 }, children: /* @__PURE__ */ e(
|
|
174
|
+
k,
|
|
175
175
|
{
|
|
176
|
-
uischema:
|
|
177
|
-
schema:
|
|
176
|
+
uischema: h,
|
|
177
|
+
schema: u,
|
|
178
178
|
path: r,
|
|
179
|
-
renderers:
|
|
179
|
+
renderers: g,
|
|
180
180
|
cells: m,
|
|
181
|
-
enabled:
|
|
181
|
+
enabled: t
|
|
182
182
|
}
|
|
183
|
-
) }, `${r}-${
|
|
184
|
-
},
|
|
185
|
-
const
|
|
186
|
-
return /* @__PURE__ */
|
|
187
|
-
|
|
188
|
-
/* @__PURE__ */ e(C, { direction: "column", gap: "4", children: l.map((
|
|
189
|
-
|
|
183
|
+
) }, `${r}-${i}`)) });
|
|
184
|
+
}, Ae = T(1, F("HorizontalLayout")), Se = ({ uischema: n, schema: u, path: r, renderers: g, cells: m, enabled: t }) => {
|
|
185
|
+
const a = n, l = a.elements;
|
|
186
|
+
return /* @__PURE__ */ c(E, { mb: "4", children: [
|
|
187
|
+
a.label && /* @__PURE__ */ e(M, { size: "4", mb: "4", children: a.label }),
|
|
188
|
+
/* @__PURE__ */ e(C, { direction: "column", gap: "4", children: l.map((h, i) => /* @__PURE__ */ e(
|
|
189
|
+
k,
|
|
190
190
|
{
|
|
191
|
-
uischema:
|
|
192
|
-
schema:
|
|
191
|
+
uischema: h,
|
|
192
|
+
schema: u,
|
|
193
193
|
path: r,
|
|
194
|
-
renderers:
|
|
194
|
+
renderers: g,
|
|
195
195
|
cells: m,
|
|
196
|
-
enabled:
|
|
196
|
+
enabled: t
|
|
197
197
|
},
|
|
198
|
-
`${r}-${
|
|
198
|
+
`${r}-${i}`
|
|
199
199
|
)) })
|
|
200
200
|
] });
|
|
201
|
-
},
|
|
202
|
-
var
|
|
203
|
-
const l = n.elements.filter((
|
|
201
|
+
}, Ve = T(1, F("Group")), Be = ({ uischema: n, schema: u, path: r, renderers: g, cells: m, enabled: t }) => {
|
|
202
|
+
var y;
|
|
203
|
+
const l = n.elements.filter((p) => p.type === "Category"), [h, i] = S(((y = l[0]) == null ? void 0 : y.label) || "");
|
|
204
204
|
if (!l.length) return null;
|
|
205
|
-
const b = l.find((
|
|
206
|
-
return /* @__PURE__ */
|
|
207
|
-
/* @__PURE__ */ e(
|
|
208
|
-
/* @__PURE__ */ e(
|
|
209
|
-
|
|
205
|
+
const b = l.find((p) => p.label === h) ? h : l[0].label;
|
|
206
|
+
return /* @__PURE__ */ c(A.Root, { value: b, onValueChange: i, children: [
|
|
207
|
+
/* @__PURE__ */ e(A.List, { children: l.map((p, d) => /* @__PURE__ */ e(A.Trigger, { value: p.label, children: p.label }, `${r}-${d}`)) }),
|
|
208
|
+
/* @__PURE__ */ e(f, { pt: "3", children: l.map((p, d) => /* @__PURE__ */ e(A.Content, { value: p.label, children: /* @__PURE__ */ e(C, { direction: "column", gap: "4", children: p.elements.map(($, w) => /* @__PURE__ */ e(
|
|
209
|
+
k,
|
|
210
210
|
{
|
|
211
211
|
uischema: $,
|
|
212
|
-
schema:
|
|
212
|
+
schema: u,
|
|
213
213
|
path: r,
|
|
214
|
-
renderers:
|
|
214
|
+
renderers: g,
|
|
215
215
|
cells: m,
|
|
216
|
-
enabled:
|
|
216
|
+
enabled: t
|
|
217
217
|
},
|
|
218
|
-
`${r}-${
|
|
219
|
-
)) }) }, `${r}-${
|
|
218
|
+
`${r}-${d}-${w}`
|
|
219
|
+
)) }) }, `${r}-${d}`)) })
|
|
220
220
|
] });
|
|
221
|
-
},
|
|
222
|
-
const [l,
|
|
223
|
-
if (
|
|
224
|
-
const
|
|
225
|
-
b(`File size exceeds ${
|
|
221
|
+
}, Pe = T(1, F("Categorization")), Ee = ({ data: n, handleChange: u, path: r, label: g, required: m, uischema: t, enabled: a }) => {
|
|
222
|
+
const [l, h] = S(!1), [i, b] = S(null), [y, p] = S(null), d = ce(null), $ = (t == null ? void 0 : t.options) || {}, w = $.maxSize || 5 * 1024 * 1024, z = $.accept || "image/*,application/pdf", v = a !== !1, D = () => y || (n ? "Uploaded File" : null), I = (o) => {
|
|
223
|
+
if (o.size > w) {
|
|
224
|
+
const x = (w / 1048576).toFixed(0);
|
|
225
|
+
b(`File size exceeds ${x}MB limit.`);
|
|
226
226
|
return;
|
|
227
227
|
}
|
|
228
|
-
const
|
|
229
|
-
if (
|
|
230
|
-
b(`Invalid file type. Accepted types: ${
|
|
228
|
+
const J = z.split(",").map((x) => x.trim()).some((x) => x.endsWith("/*") ? o.type.startsWith(x.slice(0, -1)) : x.startsWith(".") ? o.name.toLowerCase().endsWith(x.toLowerCase()) : o.type === x);
|
|
229
|
+
if (z !== "*" && !J && !z.includes("*/*")) {
|
|
230
|
+
b(`Invalid file type. Accepted types: ${z}`);
|
|
231
231
|
return;
|
|
232
232
|
}
|
|
233
|
-
const
|
|
234
|
-
|
|
235
|
-
const
|
|
236
|
-
|
|
237
|
-
},
|
|
233
|
+
const R = new FileReader();
|
|
234
|
+
R.onload = () => {
|
|
235
|
+
const x = R.result;
|
|
236
|
+
u(r, x), p(o.name), b(null);
|
|
237
|
+
}, R.onerror = () => {
|
|
238
238
|
b("Failed to read file");
|
|
239
|
-
},
|
|
240
|
-
},
|
|
241
|
-
|
|
242
|
-
}, q = (
|
|
243
|
-
|
|
244
|
-
}, H = (
|
|
245
|
-
|
|
239
|
+
}, R.readAsDataURL(o);
|
|
240
|
+
}, V = (o) => {
|
|
241
|
+
o.preventDefault(), o.stopPropagation(), !(!v || n) && (o.type === "dragenter" || o.type === "dragover" ? h(!0) : o.type === "dragleave" && h(!1));
|
|
242
|
+
}, q = (o) => {
|
|
243
|
+
o.preventDefault(), o.stopPropagation(), h(!1), !(!v || n) && o.dataTransfer.files && o.dataTransfer.files[0] && I(o.dataTransfer.files[0]);
|
|
244
|
+
}, H = (o) => {
|
|
245
|
+
o.target.files && o.target.files[0] && I(o.target.files[0]);
|
|
246
246
|
}, G = () => {
|
|
247
|
-
|
|
247
|
+
v && (u(r, null), p(null), b(null), d.current && (d.current.value = ""));
|
|
248
248
|
};
|
|
249
|
-
return /* @__PURE__ */
|
|
250
|
-
/* @__PURE__ */
|
|
251
|
-
|
|
249
|
+
return /* @__PURE__ */ c(f, { mb: "4", children: [
|
|
250
|
+
/* @__PURE__ */ c(s, { as: "label", size: "2", weight: "bold", mb: "1", className: "block", children: [
|
|
251
|
+
g,
|
|
252
252
|
" ",
|
|
253
253
|
m && "*"
|
|
254
254
|
] }),
|
|
255
|
-
n ? /* @__PURE__ */ e(
|
|
256
|
-
/* @__PURE__ */ e(
|
|
257
|
-
/* @__PURE__ */
|
|
258
|
-
/* @__PURE__ */ e(
|
|
259
|
-
|
|
255
|
+
n ? /* @__PURE__ */ e(E, { size: "2", variant: "surface", className: "relative group", children: /* @__PURE__ */ c(C, { align: "center", gap: "3", children: [
|
|
256
|
+
/* @__PURE__ */ e(f, { className: "bg-blue-100 p-2 rounded text-blue-600", children: /* @__PURE__ */ e(se, { width: "20", height: "20" }) }),
|
|
257
|
+
/* @__PURE__ */ c(f, { style: { flex: 1, overflow: "hidden" }, children: [
|
|
258
|
+
/* @__PURE__ */ e(s, { size: "2", weight: "bold", className: "block truncate", children: D() }),
|
|
259
|
+
v ? /* @__PURE__ */ e(s, { size: "1", color: "gray", children: "Ready to submit" }) : /* @__PURE__ */ e(
|
|
260
260
|
"a",
|
|
261
261
|
{
|
|
262
262
|
href: n,
|
|
263
|
-
download:
|
|
263
|
+
download: y || "document",
|
|
264
264
|
className: "text-xs text-blue-600 hover:underline cursor-pointer",
|
|
265
|
-
onClick: (
|
|
265
|
+
onClick: (o) => o.stopPropagation(),
|
|
266
266
|
children: "Download"
|
|
267
267
|
}
|
|
268
268
|
)
|
|
269
269
|
] }),
|
|
270
|
-
/* @__PURE__ */
|
|
271
|
-
/* @__PURE__ */ e(
|
|
272
|
-
|
|
273
|
-
|
|
270
|
+
/* @__PURE__ */ c(C, { align: "center", gap: "2", children: [
|
|
271
|
+
/* @__PURE__ */ e(ae, { className: "text-green-600 w-5 h-5" }),
|
|
272
|
+
v && /* @__PURE__ */ e(
|
|
273
|
+
ie,
|
|
274
274
|
{
|
|
275
275
|
variant: "ghost",
|
|
276
276
|
color: "gray",
|
|
277
277
|
onClick: G,
|
|
278
278
|
className: "hover:text-red-600 transition-colors",
|
|
279
|
-
children: /* @__PURE__ */ e(
|
|
279
|
+
children: /* @__PURE__ */ e(de, {})
|
|
280
280
|
}
|
|
281
281
|
)
|
|
282
282
|
] })
|
|
283
|
-
] }) }) : /* @__PURE__ */
|
|
283
|
+
] }) }) : /* @__PURE__ */ c(
|
|
284
284
|
"div",
|
|
285
285
|
{
|
|
286
286
|
className: `
|
|
287
287
|
border-2 border-dashed rounded-lg p-6 text-center transition-all duration-200 ease-in-out
|
|
288
288
|
${l ? "border-blue-500 bg-blue-50" : "border-gray-300 hover:border-blue-400 hover:bg-gray-50"}
|
|
289
|
-
${
|
|
290
|
-
${
|
|
289
|
+
${i ? "border-red-300 bg-red-50" : ""}
|
|
290
|
+
${v ? "cursor-pointer" : "opacity-60 cursor-not-allowed pointer-events-none"}
|
|
291
291
|
`,
|
|
292
|
-
onDragEnter:
|
|
293
|
-
onDragLeave:
|
|
294
|
-
onDragOver:
|
|
292
|
+
onDragEnter: V,
|
|
293
|
+
onDragLeave: V,
|
|
294
|
+
onDragOver: V,
|
|
295
295
|
onDrop: q,
|
|
296
296
|
onClick: () => {
|
|
297
|
-
var
|
|
298
|
-
return
|
|
297
|
+
var o;
|
|
298
|
+
return v && ((o = d.current) == null ? void 0 : o.click());
|
|
299
299
|
},
|
|
300
|
-
onKeyDown: (
|
|
301
|
-
var
|
|
302
|
-
|
|
300
|
+
onKeyDown: (o) => {
|
|
301
|
+
var B;
|
|
302
|
+
v && (o.key === "Enter" || o.key === " ") && (o.preventDefault(), (B = d.current) == null || B.click());
|
|
303
303
|
},
|
|
304
304
|
role: "button",
|
|
305
|
-
tabIndex:
|
|
305
|
+
tabIndex: v ? 0 : -1,
|
|
306
306
|
children: [
|
|
307
307
|
/* @__PURE__ */ e(
|
|
308
308
|
"input",
|
|
309
309
|
{
|
|
310
|
-
ref:
|
|
310
|
+
ref: d,
|
|
311
311
|
type: "file",
|
|
312
312
|
className: "hidden",
|
|
313
|
-
accept:
|
|
313
|
+
accept: z,
|
|
314
314
|
onChange: H,
|
|
315
|
-
disabled: !
|
|
315
|
+
disabled: !v
|
|
316
316
|
}
|
|
317
317
|
),
|
|
318
|
-
/* @__PURE__ */ e(C, { direction: "column", align: "center", gap: "2", children:
|
|
319
|
-
/* @__PURE__ */ e(
|
|
320
|
-
/* @__PURE__ */ e(
|
|
321
|
-
/* @__PURE__ */ e(
|
|
322
|
-
] }) : /* @__PURE__ */
|
|
323
|
-
/* @__PURE__ */ e(
|
|
324
|
-
/* @__PURE__ */ e(
|
|
325
|
-
/* @__PURE__ */
|
|
318
|
+
/* @__PURE__ */ e(C, { direction: "column", align: "center", gap: "2", children: i ? /* @__PURE__ */ c(O, { children: [
|
|
319
|
+
/* @__PURE__ */ e(ue, { className: "w-8 h-8 text-red-500" }),
|
|
320
|
+
/* @__PURE__ */ e(s, { size: "2", color: "red", weight: "medium", children: i }),
|
|
321
|
+
/* @__PURE__ */ e(s, { size: "1", color: "gray", children: "Click to try again" })
|
|
322
|
+
] }) : /* @__PURE__ */ c(O, { children: [
|
|
323
|
+
/* @__PURE__ */ e(he, { className: "w-8 h-8 text-gray-400" }),
|
|
324
|
+
/* @__PURE__ */ e(s, { size: "2", weight: "medium", children: "Click to upload or drag and drop" }),
|
|
325
|
+
/* @__PURE__ */ c(s, { size: "1", color: "gray", children: [
|
|
326
326
|
"Max ",
|
|
327
327
|
Math.round(w / (1024 * 1024)),
|
|
328
328
|
"MB"
|
|
@@ -332,48 +332,136 @@ const se = ({ data: n, handleChange: d, path: r, label: p, required: m, errors:
|
|
|
332
332
|
}
|
|
333
333
|
)
|
|
334
334
|
] });
|
|
335
|
-
},
|
|
335
|
+
}, Oe = N(Ee), We = T(
|
|
336
336
|
3,
|
|
337
337
|
// Rank
|
|
338
|
-
|
|
339
|
-
),
|
|
338
|
+
ee("data-url")
|
|
339
|
+
), je = ({
|
|
340
|
+
data: n,
|
|
341
|
+
path: u,
|
|
342
|
+
schema: r,
|
|
343
|
+
uischema: g,
|
|
344
|
+
enabled: m,
|
|
345
|
+
visible: t,
|
|
346
|
+
addItem: a,
|
|
347
|
+
removeItems: l,
|
|
348
|
+
rootSchema: h
|
|
349
|
+
}) => {
|
|
350
|
+
const i = r.items;
|
|
351
|
+
if (t === !1 || !i || typeof i != "object" || Array.isArray(i))
|
|
352
|
+
return null;
|
|
353
|
+
const b = i, y = Array.isArray(n) ? n : [], p = r.title || "Array Items", d = () => {
|
|
354
|
+
const w = re(b, h);
|
|
355
|
+
a && a(u, w);
|
|
356
|
+
}, $ = (w) => {
|
|
357
|
+
if (l) {
|
|
358
|
+
const z = l(u, [w]);
|
|
359
|
+
z && z();
|
|
360
|
+
}
|
|
361
|
+
};
|
|
362
|
+
return /* @__PURE__ */ e(f, { mb: "6", children: /* @__PURE__ */ c(C, { direction: "column", gap: "4", children: [
|
|
363
|
+
/* @__PURE__ */ e(s, { as: "div", size: "4", weight: "bold", children: p }),
|
|
364
|
+
y.length === 0 && /* @__PURE__ */ e(f, { py: "4", px: "4", style: { backgroundColor: "var(--gray-3)", borderRadius: "var(--radius-3)" }, children: /* @__PURE__ */ e(s, { size: "2", color: "gray", children: "No items have been added yet." }) }),
|
|
365
|
+
y.map((w, z) => {
|
|
366
|
+
var D;
|
|
367
|
+
const v = `${u}.${z}`;
|
|
368
|
+
return /* @__PURE__ */ e(E, { size: "3", variant: "surface", children: /* @__PURE__ */ c(C, { direction: "column", gap: "4", children: [
|
|
369
|
+
/* @__PURE__ */ c(C, { justify: "between", align: "center", children: [
|
|
370
|
+
/* @__PURE__ */ c(s, { size: "3", weight: "bold", children: [
|
|
371
|
+
"Item ",
|
|
372
|
+
z + 1
|
|
373
|
+
] }),
|
|
374
|
+
m && /* @__PURE__ */ c(
|
|
375
|
+
W,
|
|
376
|
+
{
|
|
377
|
+
color: "red",
|
|
378
|
+
variant: "soft",
|
|
379
|
+
onClick: () => $(z),
|
|
380
|
+
title: "Remove item",
|
|
381
|
+
children: [
|
|
382
|
+
/* @__PURE__ */ e(me, {}),
|
|
383
|
+
"Remove"
|
|
384
|
+
]
|
|
385
|
+
}
|
|
386
|
+
)
|
|
387
|
+
] }),
|
|
388
|
+
/* @__PURE__ */ e(f, { children: /* @__PURE__ */ e(
|
|
389
|
+
k,
|
|
390
|
+
{
|
|
391
|
+
schema: b,
|
|
392
|
+
uischema: ((D = g.options) == null ? void 0 : D.detail) || {
|
|
393
|
+
type: "VerticalLayout",
|
|
394
|
+
elements: Object.keys(
|
|
395
|
+
b.properties || {}
|
|
396
|
+
).map((I) => ({
|
|
397
|
+
type: "Control",
|
|
398
|
+
scope: `#/properties/${I}`
|
|
399
|
+
}))
|
|
400
|
+
},
|
|
401
|
+
path: v,
|
|
402
|
+
enabled: m,
|
|
403
|
+
renderers: void 0,
|
|
404
|
+
cells: void 0
|
|
405
|
+
}
|
|
406
|
+
) })
|
|
407
|
+
] }) }, v);
|
|
408
|
+
}),
|
|
409
|
+
m && /* @__PURE__ */ e(f, { mt: "2", children: /* @__PURE__ */ c(
|
|
410
|
+
W,
|
|
411
|
+
{
|
|
412
|
+
variant: "surface",
|
|
413
|
+
onClick: d,
|
|
414
|
+
children: [
|
|
415
|
+
/* @__PURE__ */ e(pe, {}),
|
|
416
|
+
"Add Item"
|
|
417
|
+
]
|
|
418
|
+
}
|
|
419
|
+
) })
|
|
420
|
+
] }) });
|
|
421
|
+
}, Me = ne(je), qe = T(
|
|
422
|
+
2,
|
|
423
|
+
te(F("Control"), oe("array"))
|
|
424
|
+
), He = ({ uischema: n, visible: u }) => {
|
|
340
425
|
const r = n;
|
|
341
|
-
return
|
|
342
|
-
},
|
|
343
|
-
{ tester:
|
|
344
|
-
{ tester:
|
|
345
|
-
{ tester:
|
|
346
|
-
{ tester:
|
|
347
|
-
{ tester:
|
|
348
|
-
{ tester:
|
|
349
|
-
{ tester:
|
|
350
|
-
{ tester:
|
|
351
|
-
{ tester:
|
|
352
|
-
{ tester:
|
|
353
|
-
{ tester:
|
|
426
|
+
return u === !1 ? null : /* @__PURE__ */ e(f, { mb: "4", children: /* @__PURE__ */ e(M, { size: "4", children: r.text }) });
|
|
427
|
+
}, Ge = T(1, F("Label")), Ze = [
|
|
428
|
+
{ tester: be, renderer: ye },
|
|
429
|
+
{ tester: Ce, renderer: ve },
|
|
430
|
+
{ tester: Te, renderer: xe },
|
|
431
|
+
{ tester: $e, renderer: Fe },
|
|
432
|
+
{ tester: ke, renderer: De },
|
|
433
|
+
{ tester: Re, renderer: Ie },
|
|
434
|
+
{ tester: Ae, renderer: Le },
|
|
435
|
+
{ tester: Ve, renderer: Se },
|
|
436
|
+
{ tester: Pe, renderer: Be },
|
|
437
|
+
{ tester: We, renderer: Oe },
|
|
438
|
+
{ tester: qe, renderer: Me },
|
|
439
|
+
{ tester: Ge, renderer: He }
|
|
354
440
|
];
|
|
355
441
|
export {
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
fe as
|
|
373
|
-
Ce as
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
442
|
+
Me as ArrayControl,
|
|
443
|
+
qe as ArrayControlTester,
|
|
444
|
+
ze as BooleanControl,
|
|
445
|
+
Te as BooleanControlTester,
|
|
446
|
+
Be as CategorizationLayoutRenderer,
|
|
447
|
+
Pe as CategorizationLayoutTester,
|
|
448
|
+
Ne as DateControl,
|
|
449
|
+
ke as DateControlTester,
|
|
450
|
+
Oe as FileControl,
|
|
451
|
+
We as FileControlTester,
|
|
452
|
+
Se as GroupLayoutRenderer,
|
|
453
|
+
Ve as GroupLayoutTester,
|
|
454
|
+
Le as HorizontalLayoutRenderer,
|
|
455
|
+
Ae as HorizontalLayoutTester,
|
|
456
|
+
He as LabelRenderer,
|
|
457
|
+
Ge as LabelTester,
|
|
458
|
+
fe as NumberControl,
|
|
459
|
+
Ce as NumberControlTester,
|
|
460
|
+
we as SelectControl,
|
|
461
|
+
$e as SelectControlTester,
|
|
462
|
+
ge as TextControl,
|
|
463
|
+
be as TextControlTester,
|
|
464
|
+
Ie as VerticalLayoutRenderer,
|
|
465
|
+
Re as VerticalLayoutTester,
|
|
466
|
+
Ze as radixRenderers
|
|
379
467
|
};
|