@nocobase/client 1.5.23 → 1.5.24
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/es/index.mjs +4 -4
- package/lib/index.js +1 -1
- package/package.json +5 -5
package/es/index.mjs
CHANGED
|
@@ -35230,7 +35230,7 @@ function addAppVersion(e, t) {
|
|
|
35230
35230
|
addAppVersion((o = e.properties) == null ? void 0 : o[n], t);
|
|
35231
35231
|
}), e;
|
|
35232
35232
|
}
|
|
35233
|
-
const name = "@nocobase/client", version = "1.5.
|
|
35233
|
+
const name = "@nocobase/client", version = "1.5.24", license = "AGPL-3.0", main = "lib/index.js", module = "es/index.mjs", types = "es/index.d.ts", dependencies = {
|
|
35234
35234
|
"@ahooksjs/use-url-state": "3.5.1",
|
|
35235
35235
|
"@ant-design/cssinjs": "^1.11.1",
|
|
35236
35236
|
"@ant-design/icons": "^5.1.4",
|
|
@@ -35252,9 +35252,9 @@ const name = "@nocobase/client", version = "1.5.23", license = "AGPL-3.0", main
|
|
|
35252
35252
|
"@formily/reactive-react": "^2.2.27",
|
|
35253
35253
|
"@formily/shared": "^2.2.27",
|
|
35254
35254
|
"@formily/validator": "^2.2.27",
|
|
35255
|
-
"@nocobase/evaluators": "1.5.
|
|
35256
|
-
"@nocobase/sdk": "1.5.
|
|
35257
|
-
"@nocobase/utils": "1.5.
|
|
35255
|
+
"@nocobase/evaluators": "1.5.24",
|
|
35256
|
+
"@nocobase/sdk": "1.5.24",
|
|
35257
|
+
"@nocobase/utils": "1.5.24",
|
|
35258
35258
|
ahooks: "^3.7.2",
|
|
35259
35259
|
antd: "5.12.8",
|
|
35260
35260
|
"antd-style": "3.7.1",
|
package/lib/index.js
CHANGED
|
@@ -595,7 +595,7 @@ https://requirejs.org/docs/errors.html#`+e);return i.requireType=e,i.requireModu
|
|
|
595
595
|
}
|
|
596
596
|
}
|
|
597
597
|
}
|
|
598
|
-
`,TableColumnActionBar=(0,import_react.observer)(e=>{const t=useDesigner();return(0,import_jsx_runtime.jsxs)(SortableItem,{className:designerCss$3,children:[(0,import_jsx_runtime.jsx)(t,{}),e.children]})},{displayName:"TableColumnActionBar"}),useColumnSchema=()=>{const{getField:e}=useCollection_deprecated(),t=useCompile(),o=(0,import_react.useFieldSchema)(),r=o.reduceProperties((n,a)=>a["x-component"]==="CollectionField"?a:n,null);if(!r)return{};const i=e(r.name);return{columnSchema:o,fieldSchema:r,collectionField:i,uiSchema:t(i==null?void 0:i.uiSchema)}},TableColumnDecorator=e=>{const t=useDesigner(),o=(0,import_react.useField)(),{fieldSchema:r,uiSchema:i,collectionField:n}=useColumnSchema(),a=useCompile();return(0,import_react2.useEffect)(()=>{o.title||r&&i!=null&&i.title&&(o.title=i==null?void 0:i.title)},[i==null?void 0:i.title]),(0,import_jsx_runtime.jsxs)(SortableItem,{className:designerCss$3,children:[(0,import_jsx_runtime.jsx)(t,{fieldSchema:r,uiSchema:i,collectionField:n}),o.title||a(i==null?void 0:i.title)]})},previewComponentFieldSettings=new SchemaSettings({name:"fieldSettings:component:Preview",items:[{name:"size",type:"select",useVisible(){var e;const{fieldSchema:t}=useColumnSchema();return((e=t==null?void 0:t.parent)==null?void 0:e["x-component"])!=="TableV2.Column"},useComponentProps(){var e;const{t}=(0,import_react_i18next.useTranslation)(),o=(0,import_react.useField)(),r=(0,import_react.useFieldSchema)(),{dn:i}=useDesignable();return{title:t("Size"),options:[{label:t("Large"),value:"large"},{label:t("Default"),value:"default"},{label:t("Small"),value:"small"}],value:((e=o==null?void 0:o.componentProps)==null?void 0:e.size)||"default",onChange(n){const a={"x-uid":r["x-uid"]};r["x-component-props"]=r["x-component-props"]||{},r["x-component-props"].size=n,a["x-component-props"]=r["x-component-props"],o.componentProps=o.componentProps||{},o.componentProps.size=n,i.emit("patch",{schema:a}),i.refresh()}}}}]}),uploadAttachmentComponentFieldSettings=new SchemaSettings({name:"fieldSettings:component:Upload.Attachment",items:[{name:"size",type:"select",useVisible(){var e;const{fieldSchema:t}=useColumnSchema$1(),o=((e=t==null?void 0:t.parent)==null?void 0:e["x-component"])==="TableV2.Column";return useIsFieldReadPretty()&&!o},useComponentProps(){var e;const{t}=(0,import_react_i18next.useTranslation)(),o=(0,import_react.useField)(),r=(0,import_react.useFieldSchema)(),{dn:i}=useDesignable();return{title:t("Size"),options:[{label:t("Large"),value:"large"},{label:t("Default"),value:"default"},{label:t("Small"),value:"small"}],value:((e=o==null?void 0:o.componentProps)==null?void 0:e.size)||"default",onChange(n){const a={"x-uid":r["x-uid"]};r["x-component-props"]=r["x-component-props"]||{},r["x-component-props"].size=n,a["x-component-props"]=r["x-component-props"],o.componentProps=o.componentProps||{},o.componentProps.size=n,i.emit("patch",{schema:a}),i.refresh()}}}}]}),inputJSONSettings=new SchemaSettings({name:"fieldSettings:component:Input.JSON",items:[ellipsisSettingsItem]}),createSettingsItem=e=>({name:e.name,type:"select",useComponentProps(){var t;const{t:o}=(0,import_react_i18next.useTranslation)(),r=(0,import_react.useField)(),i=(0,import_react.useFieldSchema)(),{fieldSchema:n}=useColumnSchema$1(),a=n||i,{dn:l}=useDesignable();return{title:o(e.title),options:e.options(o),value:((t=a["x-component-props"])==null?void 0:t[e.name])||e.defaultValue,onChange(c){const u={"x-uid":a["x-uid"]};a["x-component-props"]=a["x-component-props"]||{},a["x-component-props"][e.name]=c,u["x-component-props"]=a["x-component-props"],r.componentProps=r.componentProps||{},r.componentProps[e.name]=c,l.emit("patch",{schema:u})}}}}),getSizeOptions=e=>[{value:"small",label:e("Small")},{value:"middle",label:e("Middle")},{value:"large",label:e("Large")},{value:"oversized",label:e("Oversized")},{value:"auto",label:e("Auto")}],getObjectFitOptions=e=>[{value:"cover",label:e("Cover")},{value:"fill",label:e("Fill")},{value:"contain",label:e("Contain")},{value:"scale-down",label:e("Scale Down")},{value:"none",label:e("None")}],size=createSettingsItem({name:"size",title:"Size",options:getSizeOptions,defaultValue:"small"}),objectFit=createSettingsItem({name:"objectFit",title:"Object Fit",options:getObjectFitOptions,defaultValue:"cover"}),inputPreviewComponentFieldSettings=new SchemaSettings({name:"fieldSettings:component:Input.Preview",items:[size,objectFit]}),inputTextAreaSettings=new SchemaSettings({name:"fieldSettings:component:Input.TextArea",items:[ellipsisSettingsItem]}),inputURLSettings=new SchemaSettings({name:"fieldSettings:component:Input.URL",items:[ellipsisSettingsItem]}),markdownSettings=new SchemaSettings({name:"fieldSettings:component:Markdown",items:[ellipsisSettingsItem]}),markdownVditorSettings=new SchemaSettings({name:"fieldSettings:component:MarkdownVditor",items:[ellipsisSettingsItem]}),richTextSettings=new SchemaSettings({name:"fieldSettings:component:RichText",items:[ellipsisSettingsItem]}),inputNumberComponentFieldSettings=new SchemaSettings({name:"fieldSettings:component:InputNumber",items:[{name:"displayFormat",Component:SchemaSettingsNumberFormat,useComponentProps(){const e=(0,import_react.useFieldSchema)(),{fieldSchema:t}=useColumnSchema$1();return{fieldSchema:t||e}},useVisible(){return useIsFieldReadPretty()}},enableLinkSettingsItem,openModeSettingsItem]}),filterFormItemSettings=new SchemaSettings({name:"FilterFormItemSettings",items:[{name:"editFieldTitle",Component:EditTitle},{name:"editDescription",Component:EditDescription},{name:"editTooltip",Component:EditTooltip},{name:"validationRules",Component:EditValidationRules},{name:"setDataScope",Component:SchemaSettingsDataScope,useVisible(){const e=useIsSelectFieldMode(),t=useIsFormReadPretty();return e&&!t},useComponentProps(){var e,t,o;const{getCollectionJoinField:r,getAllCollectionsInheritChain:i}=useCollectionManager_deprecated(),{getField:n}=useCollection_deprecated(),{form:a}=useFormBlockContext(),l=useRecord(),c=(0,import_react.useField)(),u=(0,import_react.useFieldSchema)(),d=n(u.name)||r(u["x-collection-field"]),m=useVariables$1(),p=useLocalVariables$1(),{dn:g}=useDesignable();return{collectionName:d==null?void 0:d.target,defaultFilter:((o=(t=(e=u==null?void 0:u["x-component-props"])==null?void 0:e.service)==null?void 0:t.params)==null?void 0:o.filter)||{},form:a,dynamicComponent:h=>(0,import_jsx_runtime.jsx)(VariableInput,P(x({},h),{form:a,collectionField:h.collectionField,record:l,shouldChange:getShouldChange({collectionField:h.collectionField,variables:m,localVariables:p,getAllCollectionsInheritChain:i})})),onSubmit:({filter:h})=>{h=removeNullCondition(h),import_lodash.default.set(c.componentProps,"service.params.filter",h),u["x-component-props"]=c.componentProps,g.emit("patch",{schema:{"x-uid":u["x-uid"],"x-component-props":c.componentProps}})}}}},{name:"fieldMode",Component:EditComponent},{name:"operator",Component:EditOperator},{name:"titleField",Component:EditTitleField},{name:"divider",type:"divider",useVisible(){const{getCollectionJoinField:e}=useCollectionManager_deprecated(),{getField:t}=useCollection_deprecated(),o=(0,import_react.useFieldSchema)();return!!(t(o.name)||e(o["x-collection-field"]))}},{name:"remove",type:"remove",useComponentProps(){const{t:e}=(0,import_react_i18next.useTranslation)();return{removeParentsIfNoChildren:!0,confirm:{title:e("Delete field")},breakRemoveOn:{"x-component":"Grid"}}}}]}),fieldComponent$4={name:"fieldComponent",type:"select",useComponentProps(){const{t:e}=(0,import_react_i18next.useTranslation)(),t=(0,import_react.useField)(),o=(0,import_react.useFieldSchema)(),r=useFieldModeOptions(),i=useIsAddNewForm(),n=useFieldComponentName(),{dn:a}=useDesignable();return{title:e("Field component"),options:r,value:n,onChange(l){const c={"x-uid":o["x-uid"]};o["x-component-props"]=o["x-component-props"]||{},o["x-component-props"].mode=l,c["x-component-props"]=o["x-component-props"],t.componentProps=t.componentProps||{},t.componentProps.mode=l,isSubMode(o)&&i&&(c.default=null,o.default=null,t.setInitialValue(null),t.setValue(null)),a.emit("patch",{schema:c}),a.refresh()}}}},allowSelectExistingRecord={name:"allowSelectExistingRecord",type:"switch",useVisible(){return!useIsFieldReadPretty()},useComponentProps(){var e;const{t}=(0,import_react_i18next.useTranslation)(),o=(0,import_react.useField)(),r=(0,import_react.useFieldSchema)(),{dn:i,refresh:n}=useDesignable();return{title:t("Allow selection of existing records"),checked:(e=r["x-component-props"])==null?void 0:e.allowSelectExistingRecord,onChange(a){const l={"x-uid":r["x-uid"]};o.componentProps.allowSelectExistingRecord=a,r["x-component-props"]=r["x-component-props"]||{},r["x-component-props"].allowSelectExistingRecord=a,l["x-component-props"]=r["x-component-props"],i.emit("patch",{schema:l}),n()}}}},allowDisassociation={name:"allowDisassociation",type:"switch",useVisible(){return!useIsFieldReadPretty()},useComponentProps(){var e;const{t}=(0,import_react_i18next.useTranslation)(),o=(0,import_react.useField)(),r=(0,import_react.useFieldSchema)(),{dn:i,refresh:n}=useDesignable();return{title:t("Allow disassociation"),checked:((e=r["x-component-props"])==null?void 0:e.allowDisassociation)!==!1,onChange(a){const l={"x-uid":r["x-uid"]};o.componentProps.allowDisassociation=a,r["x-component-props"]=r["x-component-props"]||{},r["x-component-props"].allowDisassociation=a,l["x-component-props"]=r["x-component-props"],i.emit("patch",{schema:l}),n()}}}},setDefaultSortingRules={name:"SetDefaultSortingRules",type:"modal",useComponentProps(){const{getCollectionJoinField:e}=useCollectionManager_deprecated(),t=(0,import_react.useField)(),o=(0,import_react.useFieldSchema)(),r=o["x-collection-field"],{target:i}=e(r)||{},n=useSortFields(i),{t:a}=(0,import_react_i18next.useTranslation)(),{dn:l}=useDesignable(),c=t.componentProps.sortArr||[],u=c==null?void 0:c.map(d=>d!=null&&d.startsWith("-")?{field:d.substring(1),direction:"desc"}:{field:d,direction:"asc"});return{title:a("Set default sorting rules"),components:{ArrayItems:import_antd_v5.ArrayItems},schema:{type:"object",title:a("Set default sorting rules"),properties:{sort:{type:"array",default:u,"x-component":"ArrayItems","x-decorator":"FormItem",items:{type:"object",properties:{space:{type:"void","x-component":"Space",properties:{sort:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.SortHandle"},field:{type:"string",enum:n,required:!0,"x-decorator":"FormItem","x-component":"Select","x-component-props":{style:{width:260}}},direction:{type:"string","x-decorator":"FormItem","x-component":"Radio.Group","x-component-props":{optionType:"button"},enum:[{label:a("ASC"),value:"asc"},{label:a("DESC"),value:"desc"}]},remove:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.Remove"}}}}},properties:{add:{type:"void",title:a("Add sort field"),"x-component":"ArrayItems.Addition"}}}}},onSubmit:({sort:d})=>{const m=d.map(p=>p.direction==="desc"?`-${p.field}`:p.field);t.componentProps.sortArr=m,o["x-component-props"].sortArr=m,l.emit("patch",{schema:{"x-uid":o["x-uid"],"x-component-props":o["x-component-props"]}})}}},useVisible(){const{getCollectionJoinField:e}=useCollectionManager_deprecated(),t=(0,import_react.useFieldSchema)()["x-collection-field"],{interface:o}=e(t)||{};return useIsFieldReadPretty()&&["m2m","o2m"].includes(o)}},allowAddNewData={name:"allowAddNewData",type:"switch",useVisible(){const e=useIsFieldReadPretty(),t=useIsAssociationField();return!e&&t},useComponentProps(){var e;const{t}=(0,import_react_i18next.useTranslation)(),o=(0,import_react.useField)(),r=(0,import_react.useFieldSchema)(),{dn:i,refresh:n}=useDesignable();return{title:t("Allow add new"),checked:((e=r["x-component-props"])==null?void 0:e.allowAddnew)!==!1,onChange(a){const l={"x-uid":r["x-uid"]};o.componentProps.allowAddnew=a,r["x-component-props"]=r["x-component-props"]||{},r["x-component-props"].allowAddnew=a,l["x-component-props"]=r["x-component-props"],i.emit("patch",{schema:l}),n()}}}},LinkageRulesComponent=withDynamicSchemaProps(e=>(0,import_jsx_runtime.jsx)(FlagProvider,{isInSubForm:!0,children:(0,import_jsx_runtime.jsx)(FormLinkageRules,x({},e))}),{displayName:"LinkageRulesComponent"}),linkageRules={name:"linkageRules",Component:SchemaSettingsLinkageRules,useComponentProps(){const e=(0,import_react.useField)(),t=(0,import_react.useFieldSchema)(),o=useCollectionManager().getCollectionField(t["x-collection-field"]),{rerenderDataBlock:r}=useRerenderDataBlock();return{collectionName:o==null?void 0:o.target,Component:LinkageRulesComponent,readPretty:e.readPretty,afterSubmit:r}}},recordPerPage={name:"recordsPerPage",type:"select",useComponentProps(){var e;const{t}=(0,import_react_i18next.useTranslation)(),o=(0,import_react.useFieldSchema)(),r=(0,import_react.useField)(),{dn:i}=useDesignable(),n=[10,20,50,100];return{title:t("Records per page"),value:((e=r.componentProps)==null?void 0:e.pageSize)||10,options:n.map(a=>({value:a})),onChange:a=>{const l={"x-uid":o["x-uid"]};r.componentProps=r.componentProps||{},r.componentProps.pageSize=a,o["x-component-props"]=o["x-component-props"]||{},o["x-component-props"].pageSize=a,l["x-component-props"]=o["x-component-props"],i.emit("patch",{schema:l})}}}},subTablePopoverComponentFieldSettings=new SchemaSettings({name:"fieldSettings:component:SubTable",items:[fieldComponent$4,allowAddNewData,allowSelectExistingRecord,allowDisassociation,setDefaultSortingRules,linkageRules,recordPerPage]}),allowMultiple$2={name:"allowMultiple",type:"switch",useVisible(){const e=useIsFieldReadPretty(),t=useCollectionField();return!e&&["hasMany","belongsToMany"].includes(t==null?void 0:t.type)},useComponentProps(){var e;const{t}=(0,import_react_i18next.useTranslation)(),o=(0,import_react.useField)(),r=(0,import_react.useFieldSchema)(),{dn:i,refresh:n}=useDesignable();return{title:t("Allow multiple"),checked:((e=r["x-component-props"])==null?void 0:e.multiple)===void 0?!0:r["x-component-props"].multiple,onChange(a){const l={"x-uid":r["x-uid"]};r["x-component-props"]=r["x-component-props"]||{},o.componentProps=o.componentProps||{},r["x-component-props"].multiple=a,o.componentProps.multiple=a,l["x-component-props"]=r["x-component-props"],i.emit("patch",{schema:l}),n()}}}},fieldComponent$3={name:"fieldComponent",type:"select",useComponentProps(){const{t:e}=(0,import_react_i18next.useTranslation)(),t=(0,import_react.useField)(),o=(0,import_react.useFieldSchema)(),r=useFieldModeOptions(),i=useIsAddNewForm(),n=useFieldComponentName(),{dn:a}=useDesignable();return{title:e("Field component"),options:r,value:n,onChange(l){const c={"x-uid":o["x-uid"]};o["x-component-props"]=o["x-component-props"]||{},o["x-component-props"].mode=l,c["x-component-props"]=o["x-component-props"],t.componentProps=t.componentProps||{},t.componentProps.mode=l,isSubMode(o)&&i&&(c.default=null,o.default=null,t.setInitialValue(null),t.setValue(null)),a.emit("patch",{schema:c}),a.refresh()}}}},subformComponentFieldSettings=new SchemaSettings({name:"fieldSettings:component:Nester",items:[fieldComponent$3,allowMultiple$2,{name:"allowDissociate",type:"switch",useVisible(){const{type:e}=useFormBlockType();return!useIsFormReadPretty()&&e==="update"},useComponentProps(){var e;const{t}=(0,import_react_i18next.useTranslation)(),o=(0,import_react.useField)(),r=(0,import_react.useFieldSchema)(),{dn:i,refresh:n}=useDesignable();return{title:t("Allow dissociate"),checked:((e=r["x-component-props"])==null?void 0:e.allowDissociate)!==!1,onChange(a){const l={"x-uid":r["x-uid"]};r["x-component-props"]=r["x-component-props"]||{},o.componentProps=o.componentProps||{},r["x-component-props"].allowDissociate=a,o.componentProps.allowDissociate=a,l["x-component-props"]=r["x-component-props"],i.emit("patch",{schema:l}),n()}}}},setDefaultSortingRules,linkageRules,{name:"setBlockLayout",Component:SchemaSettingsLayoutItem}]}),allowMultiple$1={name:"allowMultiple",type:"switch",useVisible(){const e=useIsFieldReadPretty(),t=useCollectionField();return!e&&["hasMany","belongsToMany","belongsToArray"].includes(t==null?void 0:t.type)},useComponentProps(){var e;const{t}=(0,import_react_i18next.useTranslation)(),o=(0,import_react.useField)(),r=(0,import_react.useFieldSchema)(),{dn:i,refresh:n}=useDesignable();return{title:t("Allow multiple"),checked:((e=r["x-component-props"])==null?void 0:e.multiple)===void 0?!0:r["x-component-props"].multiple,onChange(a){const l={"x-uid":r["x-uid"]};r["x-component-props"]=r["x-component-props"]||{},o.componentProps=o.componentProps||{},r["x-component-props"].multiple=a,o.componentProps.multiple=a,l["x-component-props"]=r["x-component-props"],i.emit("patch",{schema:l}),n()}}}},fieldComponent$2={name:"fieldComponent",type:"select",useComponentProps(){const{t:e}=(0,import_react_i18next.useTranslation)(),t=(0,import_react.useField)(),o=useIsAddNewForm(),r=useFieldComponentName(),{fieldSchema:i,collectionField:n}=useColumnSchema$1(),a=(0,import_react.useFieldSchema)(),l=i||a,c=useFieldModeOptions({fieldSchema:i,collectionField:n}),{dn:u}=useDesignable();return{title:e("Field component"),options:c,value:r,onChange(d){var m,p;const g={"x-uid":l["x-uid"]};l["x-component-props"]=l["x-component-props"]||{},l["x-component-props"].mode=d,g["x-component-props"]=l["x-component-props"],t.componentProps=t.componentProps||{},t.componentProps.mode=d,isSubMode(l)&&o&&(g.default=null,l.default=null,(m=t==null?void 0:t.setInitialValue)==null||m.call(t,null),(p=t==null?void 0:t.setValue)==null||p.call(t,null)),u.emit("patch",{schema:g}),u.refresh()}}}},recordPickerComponentFieldSettings=new SchemaSettings({name:"fieldSettings:component:Picker",items:[fieldComponent$2,{name:"popupSize",type:"select",useVisible(){return!useIsFieldReadPretty()},useComponentProps(){var e,t,o;const{t:r}=(0,import_react_i18next.useTranslation)(),i=(0,import_react.useField)(),{fieldSchema:n}=useColumnSchema$1(),a=(0,import_react.useFieldSchema)(),l=n||a,{dn:c}=useDesignable();return{title:r("Popup size"),options:[{label:r("Small"),value:"small"},{label:r("Middle"),value:"middle"},{label:r("Large"),value:"large"}],value:(o=(e=l==null?void 0:l["x-component-props"])==null?void 0:e.openSize)!=null?o:((t=l==null?void 0:l["x-component-props"])==null?void 0:t.openMode)=="modal"?"large":"middle",onChange:u=>{i.componentProps.openSize=u,l["x-component-props"]=P(x({},l["x-component-props"]),{openSize:u}),c.emit("patch",{schema:{"x-uid":l["x-uid"],"x-component-props":l["x-component-props"]}}),c.refresh()}}}},allowAddNew,allowMultiple$1,titleField$1]}),allowMultiple={name:"allowMultiple",type:"switch",useVisible(){const e=useIsFieldReadPretty(),t=useCollectionField();return!e&&["hasMany","belongsToMany"].includes(t==null?void 0:t.type)},useComponentProps(){var e;const{t}=(0,import_react_i18next.useTranslation)(),o=(0,import_react.useField)(),r=(0,import_react.useFieldSchema)(),{dn:i,refresh:n}=useDesignable();return{title:t("Allow multiple"),checked:((e=r["x-component-props"])==null?void 0:e.multiple)===void 0?!0:r["x-component-props"].multiple,onChange(a){const l={"x-uid":r["x-uid"]};r["x-component-props"]=r["x-component-props"]||{},o.componentProps=o.componentProps||{},r["x-component-props"].multiple=a,o.componentProps.multiple=a,l["x-component-props"]=r["x-component-props"],i.emit("patch",{schema:l}),n()}}}},fieldComponent$1={name:"fieldComponent",type:"select",useComponentProps(){const{t:e}=(0,import_react_i18next.useTranslation)(),t=(0,import_react.useField)(),{fieldSchema:o,collectionField:r}=useColumnSchema$1(),i=(0,import_react.useFieldSchema)(),n=o||i,a=useFieldModeOptions({fieldSchema:o,collectionField:r}),{dn:l}=useDesignable(),c=useIsAddNewForm(),u=useFieldComponentName();return{title:e("Field component"),options:a,value:u,onChange(d){const m={"x-uid":n["x-uid"]};n["x-component-props"]=n["x-component-props"]||{},n["x-component-props"].mode=d,m["x-component-props"]=n["x-component-props"],t.componentProps=t.componentProps||{},t.componentProps.mode=d,isSubMode(n)&&c&&(m.default=null,n.default=null,t.setInitialValue(null),t.setValue(null)),l.emit("patch",{schema:m}),l.refresh()}}}},subformPopoverComponentFieldSettings=new SchemaSettings({name:"fieldSettings:component:PopoverNester",items:[fieldComponent$1,allowMultiple,titleField$1,linkageRules,{name:"setBlockLayout",Component:SchemaSettingsLayoutItem}]}),enableLink={name:"enableLink",type:"switch",useComponentProps(){var e;const{t}=(0,import_react_i18next.useTranslation)(),o=(0,import_react.useField)(),{fieldSchema:r}=useColumnSchema$1(),i=(0,import_react.useFieldSchema)(),n=r||i,{dn:a}=useDesignable();return{title:t("Enable link"),checked:((e=n["x-component-props"])==null?void 0:e.enableLink)!==!1,onChange(l){n["x-component-props"]=P(x({},n==null?void 0:n["x-component-props"]),{enableLink:l}),o.componentProps.enableLink=l,a.emit("patch",{schema:{"x-uid":n["x-uid"],"x-component-props":x({},n==null?void 0:n["x-component-props"])}})}}}},titleField={name:"titleField",type:"select",useComponentProps(){var e,t;const{t:o}=(0,import_react_i18next.useTranslation)(),r=(0,import_react.useField)(),{fieldSchema:i,collectionField:n}=useColumnSchema$1(),a=(0,import_react.useFieldSchema)(),l=i||a,c=useTitleFieldOptions(),u=useCollectionField(),d=n||u,{dn:m}=useDesignable();return{title:o("Title field"),options:c,value:(t=(e=l==null?void 0:l["x-component-props"])==null?void 0:e.fieldNames)==null?void 0:t.label,onChange(p){var g,h;const f={"x-uid":l["x-uid"]},_=P(x(x({},(h=(g=d==null?void 0:d.uiSchema)==null?void 0:g["x-component-props"])==null?void 0:h.fieldNames),r.componentProps.fieldNames),{label:p});l["x-component-props"]=l["x-component-props"]||{},l["x-component-props"].fieldNames=_,f["x-component-props"]=l["x-component-props"],r.componentProps.fieldNames=l["x-component-props"].fieldNames,m.emit("patch",{schema:f}),m.refresh()}}}},fieldComponent={name:"fieldComponent",type:"select",useComponentProps(){const{t:e}=(0,import_react_i18next.useTranslation)(),t=(0,import_react.useField)(),o=useIsAddNewForm(),{fieldSchema:r,collectionField:i}=useColumnSchema$1(),n=useFieldModeOptions({fieldSchema:r,collectionField:i}),a=(0,import_react.useFieldSchema)(),l=r||a,c=useFieldComponentName(),{dn:u}=useDesignable();return{title:e("Field component"),options:n,value:c,onChange(d){const m={"x-uid":l["x-uid"]};l["x-component-props"]=l["x-component-props"]||{},l["x-component-props"].mode=d,m["x-component-props"]=l["x-component-props"],t.componentProps=t.componentProps||{},t.componentProps.mode=d,isSubMode(l)&&o&&(m.default=null,l.default=null,t.setInitialValue(null),t.setValue(null)),u.emit("patch",{schema:m}),u.refresh()}}}},tagComponentFieldSettings=new SchemaSettings({name:"fieldSettings:component:Tag",items:[fieldComponent,{name:"tagColorField",type:"select",useComponentProps(){var e,t;const{t:o}=(0,import_react_i18next.useTranslation)(),r=(0,import_react.useField)(),i=(0,import_react.useFieldSchema)(),n=useCollectionField(),{fieldSchema:a,collectionField:l}=useColumnSchema$1(),c=a||i,u=l||n,{dn:d}=useDesignable(),m=useColorFields((e=u==null?void 0:u.target)!=null?e:u==null?void 0:u.targetCollection);return{title:o("Tag color field"),options:m,value:(t=c==null?void 0:c["x-component-props"])==null?void 0:t.tagColorField,onChange(p){const g={"x-uid":c["x-uid"]};c["x-component-props"]=c["x-component-props"]||{},c["x-component-props"].tagColorField=p,g["x-component-props"]=c["x-component-props"],r.componentProps.tagColorField=p,d.emit("patch",{schema:g}),d.refresh()}}}},titleField,enableLink,ellipsisSettingsItem]}),unixTimestampComponentFieldSettings=new SchemaSettings({name:"fieldSettings:component:UnixTimestamp",items:[{name:"dateDisplayFormat",Component:SchemaSettingsDateFormat,useComponentProps(){const e=(0,import_react.useFieldSchema)(),{fieldSchema:t}=useColumnSchema$1();return{fieldSchema:t||e}}},enableLinkSettingsItem,openModeSettingsItem]});function GroupTitleEditor(e){const t=(0,import_react.useField)(),o=(0,import_react.useFieldSchema)(),{dn:r}=useDesignable(),{t:i}=(0,import_react_i18next.useTranslation)();return(0,import_jsx_runtime.jsx)(SchemaSettingsModalItem,{title:i("Edit group title"),schema:{type:"object",title:i("Edit group title"),properties:{children:{"x-decorator":"FormItem","x-component":"Input",title:i("Group title"),default:t.componentProps.children,"x-component-props":{}}}},onSubmit:({children:n})=>{t.componentProps.children=n,o["x-component-props"]=o["x-component-props"]||{},o["x-component-props"].children=n,r.emit("patch",{schema:{"x-uid":o["x-uid"],"x-component-props":x({},o["x-component-props"])}}),r.refresh()}})}const dividerSettings=new SchemaSettings({name:"blockSettings:divider",items:[{name:"editTitle",type:"item",Component:GroupTitleEditor},{name:"orientation",type:"select",useComponentProps(){var e;const t=(0,import_react.useField)(),o=(0,import_react.useFieldSchema)(),{t:r}=(0,import_react_i18next.useTranslation)(),{dn:i}=useDesignable();return{title:r("Title position"),value:((e=t.componentProps)==null?void 0:e.orientation)||"left",options:[{label:r("Left"),value:"left"},{label:r("Center"),value:"center"},{label:r("Right"),value:"right"}],onChange:n=>{t.componentProps=t.componentProps||{},t.componentProps.orientation=n,o["x-component-props"]=o["x-component-props"]||{},o["x-component-props"].orientation=n,i.emit("patch",{schema:{"x-uid":o["x-uid"],"x-component-props":o["x-component-props"]}})}}}},{name:"dashed",type:"switch",useComponentProps:()=>{const e=(0,import_react.useField)(),t=(0,import_react.useFieldSchema)(),{t:o}=(0,import_react_i18next.useTranslation)(),{dn:r}=useDesignable();return{title:o("Dashed"),defaultChecked:!0,checked:e.componentProps.dashed,onChange:i=>{e.componentProps.dashed=i,t["x-component-props"].dashed=i,i===!1&&(t["x-component-props"].dashed=!1),r.emit("patch",{schema:t}),r.refresh()}}}},{name:"color",type:"item",useComponentProps:()=>{const{t:e}=(0,import_react_i18next.useTranslation)(),{dn:t}=useDesignable(),o=(0,import_react.useField)(),r=(0,import_react.useFieldSchema)();return{title:(0,import_jsx_runtime.jsxs)("div",{style:{alignItems:"center",display:"flex",justifyContent:"space-between"},children:[e("Color"),(0,import_jsx_runtime.jsx)("div",{style:{float:"right"},children:(0,import_jsx_runtime.jsx)(ColorPicker,{defaultValue:o.componentProps.color||"rgba(0, 0, 0, 0.88)",onChange:i=>{o.componentProps=o.componentProps||{},o.componentProps.color=i,r["x-component-props"]=r["x-component-props"]||{},r["x-component-props"].color=i,t.emit("patch",{schema:r}),t.refresh()}})})]})}}},{name:"borderColor",type:"item",useComponentProps:()=>{const{t:e}=(0,import_react_i18next.useTranslation)(),{dn:t}=useDesignable(),o=(0,import_react.useField)(),r=(0,import_react.useFieldSchema)();return{title:(0,import_jsx_runtime.jsxs)("div",{style:{alignItems:"center",display:"flex",justifyContent:"space-between"},children:[e("Divider line color"),(0,import_jsx_runtime.jsx)("div",{style:{float:"right"},children:(0,import_jsx_runtime.jsx)(ColorPicker,{defaultValue:o.componentProps.borderColor||"rgba(5, 5, 5, 0.06)",onChange:i=>{o.componentProps=o.componentProps||{},o.componentProps.borderColor=i,r["x-component-props"]=r["x-component-props"]||{},r["x-component-props"].borderColor=i,t.emit("patch",{schema:r}),t.refresh()}})})]})}}},{name:"delete",type:"remove",useComponentProps(){return{removeParentsIfNoChildren:!0,breakRemoveOn:{"x-component":"Grid"}}}}]});class SchemaSettingsPlugin extends Plugin{load(){return q(this,null,function*(){this.schemaSettingsManager.add(tableBlockSettings),this.schemaSettingsManager.add(createFormBlockSettings),this.schemaSettingsManager.add(editFormBlockSettings),this.schemaSettingsManager.add(filterFormBlockSettings),this.schemaSettingsManager.add(filterFormItemFieldSettings),this.schemaSettingsManager.add(multiDataDetailsBlockSettings),this.schemaSettingsManager.add(detailsWithPaginationSettings),this.schemaSettingsManager.add(singleDataDetailsBlockSettings),this.schemaSettingsManager.add(detailsBlockSettings),this.schemaSettingsManager.add(tableSelectorBlockSettings),this.schemaSettingsManager.add(listBlockSettings),this.schemaSettingsManager.add(gridCardBlockSettings),this.schemaSettingsManager.add(filterCollapseBlockSettings),this.schemaSettingsManager.add(markdownBlockSettings),this.schemaSettingsManager.add(addNewActionSettings),this.schemaSettingsManager.add(filterActionSettings),this.schemaSettingsManager.add(refreshActionSettings),this.schemaSettingsManager.add(viewActionSettings),this.schemaSettingsManager.add(editActionSettings),this.schemaSettingsManager.add(deleteActionSettings),this.schemaSettingsManager.add(disassociateActionSettings),this.schemaSettingsManager.add(associateActionSettings),this.schemaSettingsManager.add(bulkDeleteActionSettings),this.schemaSettingsManager.add(customizeAddRecordActionSettings),this.schemaSettingsManager.add(customizePopupActionSettings),this.schemaSettingsManager.add(customizeLinkActionSettings),this.schemaSettingsManager.add(customizeUpdateRecordActionSettings),this.schemaSettingsManager.add(createSubmitActionSettings),this.schemaSettingsManager.add(updateSubmitActionSettings),this.schemaSettingsManager.add(submitActionSettings),this.schemaSettingsManager.add(customizeSaveRecordActionSettings),this.schemaSettingsManager.add(addChildActionSettings),this.schemaSettingsManager.add(expendableActionSettings),this.schemaSettingsManager.add(fieldSettingsFormItem),this.schemaSettingsManager.add(tableColumnSettings),this.schemaSettingsManager.add(filterCollapseItemFieldSettings),this.schemaSettingsManager.add(selectComponentFieldSettings),this.schemaSettingsManager.add(filterSelectComponentFieldSettings),this.schemaSettingsManager.add(recordPickerComponentFieldSettings),this.schemaSettingsManager.add(subformComponentFieldSettings),this.schemaSettingsManager.add(subformPopoverComponentFieldSettings),this.schemaSettingsManager.add(subTablePopoverComponentFieldSettings),this.schemaSettingsManager.add(datePickerComponentFieldSettings),this.schemaSettingsManager.add(rangePickerPickerComponentFieldSettings),this.schemaSettingsManager.add(unixTimestampComponentFieldSettings),this.schemaSettingsManager.add(inputNumberComponentFieldSettings),this.schemaSettingsManager.add(inputComponentSettings),this.schemaSettingsManager.add(inputURLSettings),this.schemaSettingsManager.add(inputTextAreaSettings),this.schemaSettingsManager.add(inputJSONSettings),this.schemaSettingsManager.add(markdownSettings),this.schemaSettingsManager.add(markdownVditorSettings),this.schemaSettingsManager.add(richTextSettings),this.schemaSettingsManager.add(fileManagerComponentFieldSettings),this.schemaSettingsManager.add(tagComponentFieldSettings),this.schemaSettingsManager.add(cascadeSelectComponentFieldSettings),this.schemaSettingsManager.add(inputPreviewComponentFieldSettings),this.schemaSettingsManager.add(uploadAttachmentComponentFieldSettings),this.schemaSettingsManager.add(previewComponentFieldSettings),this.schemaSettingsManager.add(dividerSettings)})}}const useBuiltInVariables=()=>{const{currentUserCtx:e}=useCurrentUserVariable(),{currentRoleCtx:t}=useCurrentRoleVariable(),{apiTokenCtx:o}=useAPITokenVariable(),{datetimeCtx:r}=useDatetimeVariable(),{urlSearchParamsCtx:i,name:n,defaultValue:a}=useURLSearchParamsVariable();return{builtinVariables:(0,import_react2.useMemo)(()=>[{name:"$user",ctx:e,collectionName:"users",dataSource:DEFAULT_DATA_SOURCE_KEY},{name:"$nRole",ctx:t,collectionName:"roles"},{name:"$nToken",ctx:o},{name:"currentUser",ctx:e,collectionName:"users",dataSource:DEFAULT_DATA_SOURCE_KEY},{name:"$nDate",ctx:r},{name:"$date",ctx:r},{name:"$system",ctx:{now:()=>(0,import_client.dayjs)().toISOString()}},{name:"currentTime",ctx:()=>(0,import_client.dayjs)().toISOString()},{name:n,ctx:i,defaultValue:a}],[t,e,r,a,i,n])}},cache=new Map,cacheLazyLoadedValues=(e,t,o)=>{const r=cache.get(e);r?r[t]=o:cache.set(e,{[t]:o})},getCachedLazyLoadedValues=(e,t)=>{const o=cache.get(e);return o==null?void 0:o[t]},filterEmptyValues=e=>Array.isArray(e)?e.filter(t=>t===0||t===!1||t):e,TYPE_TO_ACTION={hasMany:"list?pageSize=9999",belongsTo:"get",hasOne:"get",belongsToMany:"list?pageSize=9999",belongsToArray:"get"},getAction=e=>TYPE_TO_ACTION[e],requested={},hasRequested=e=>!!requested[e],getRequested=e=>requested[e],stashRequested=(e,t)=>{requested[e]=t},clearRequested=e=>{delete requested[e]},uniq=e=>!Array.isArray(e)||!import_lodash.default.isObject(e[0])?e:import_lodash.default.uniqBy(e,t=>"id"in t?t.id:JSON.stringify(t)),VariablesContext=(0,import_react2.createContext)(null);VariablesContext.displayName="VariablesContext";const variablesStore={},getFieldPath=(e,t)=>{let o,r;return{fieldPath:e.split(".").map(i=>t[i]?(o=t[i].dataSource,r=t[i],t[i].collectionName):i).join("."),dataSource:o,variableOption:r}},VariablesProvider=({children:e,filterVariables:t})=>{const o=(0,import_react2.useRef)({}),r=useAPIClient(),{getCollectionJoinField:i,getCollection:n}=useCollectionManager_deprecated(),a=useCompile(),{builtinVariables:l}=useBuiltInVariables(),c=(0,import_react2.useCallback)(_=>{import_lodash.default.isFunction(_)?o.current=_(o.current):o.current=_},[]),u=(0,import_react2.useCallback)((_,v,C)=>q(void 0,null,function*(){var S,b;const y=_.split("."),F=y[0],j=mergeVariableToCollectionNameWithLocalVariables(variablesStore,v);let k=mergeCtxWithLocalVariables(o.current,v);const{fieldPath:R,dataSource:z,variableOption:N}=getFieldPath(F,j);let L=R;const{fieldPath:D}=getFieldPath(_,j),T=y.length===1?N==null?void 0:N.collectionName:(S=i(D,z))==null?void 0:S.target;if(!(F in k))throw new Error(`VariablesProvider: ${F} is not found`);for(let w=0;w<y.length;w++){if(k==null)return{value:k===void 0?N==null?void 0:N.defaultValue:k,dataSource:z,collectionName:T};const A=y[w],B=y.slice(0,w+1).join("."),{fieldPath:M}=getFieldPath(B,j),O=i(M,z),E=(b=n(L,z))==null?void 0:b.getPrimaryKey();if(Array.isArray(k)){const U=k.map(V=>{if(!(C!=null&&C.doNotRequest)&&shouldToRequest(V==null?void 0:V[A],V,B)&&(V==null?void 0:V[E])!=null&&O!=null&&O.target){const G=`/${L}/${V[O.sourceKey||E]}/${A}:${getAction(O.type)}`;if(hasRequested(G))return getRequested(G);const H=r.request({headers:getDataSourceHeaders(z),url:G,params:{appends:C==null?void 0:C.appends}}).then(Y=>{clearRequested(G);const K=Y.data.data;return cacheLazyLoadedValues(V,B,K),K});return stashRequested(G,H),H}return getCachedLazyLoadedValues(V,B)||(V==null?void 0:V[A])});k=removeThroughCollectionFields(import_lodash.default.flatten(yield Promise.all(U)),O)}else if(!(C!=null&&C.doNotRequest)&&shouldToRequest(k[A],k,B)&&k[E]!=null&&O!=null&&O.target){const U=`/${L}/${k[O.sourceKey||E]}/${A}:${getAction(O.type)}`;let V=null;if(hasRequested(U))V=yield getRequested(U);else{const H=r.request({headers:getDataSourceHeaders(z),url:U,params:{appends:C==null?void 0:C.appends}});stashRequested(U,H),V=yield H,clearRequested(U)}const G=V.data.data;getCachedLazyLoadedValues(k,B)||cacheLazyLoadedValues(k,B,G),k=removeThroughCollectionFields(G,O)}else k=removeThroughCollectionFields(getCachedLazyLoadedValues(k,B)||(0,import_client.getValuesByPath)(k,A),O);O!=null&&O.target&&(L=O.target)}const $=a(import_lodash.default.isFunction(k)?k({fieldOperator:C==null?void 0:C.fieldOperator,isParsingVariable:!0}):k);return{value:$===void 0?N.defaultValue:$,dataSource:z,collectionName:T}}),[i]),d=(0,import_react2.useCallback)(_=>{if(!isVariable(`{{${_.name}}}`))throw new Error(`VariablesProvider: ${_.name} is not a valid name`);c(v=>P(x({},v),{[_.name]:_.ctx})),variablesStore[_.name]=P(x({},_),{defaultValue:import_lodash.default.has(_,"defaultValue")?_.defaultValue:null})},[c]),m=(0,import_react2.useCallback)(_=>o.current[_]?x({},variablesStore[_]):null,[]),p=(0,import_react2.useCallback)(_=>{c(v=>{const C=x({},v);return delete C[_],C}),delete variablesStore[_]},[c]),g=(0,import_react2.useCallback)((_,v,C)=>q(void 0,null,function*(){if(!isVariable(_))return _;v&&(v=import_lodash.default.isArray(v)?v:[v]);const S=getPath(_),b=yield u(S,v,C);return P(x({},b),{value:uniq(filterEmptyValues(b.value))})}),[u]),h=(0,import_react2.useCallback)((_,v)=>q(void 0,null,function*(){var C;if(!isVariable(_))throw new Error(`VariablesProvider: ${_} is not a variable string`);v&&(v=import_lodash.default.isArray(v)?v:[v]);const S=mergeVariableToCollectionNameWithLocalVariables(variablesStore,v),b=getPath(_),{fieldPath:y,dataSource:F}=getFieldPath(b,S);let j=i(y,F);return!j&&!b.includes(".")&&(j={target:(C=S[b])==null?void 0:C.collectionName}),j}),[i]);(0,import_react2.useEffect)(()=>{l.forEach(_=>{d(P(x({},_),{defaultValue:import_lodash.default.has(_,"defaultValue")?_.defaultValue:null}))})},[l,d]);const f=(0,import_react2.useMemo)(()=>({ctxRef:o,setCtx:c,parseVariable:g,registerVariable:d,getVariable:m,getCollectionField:h,removeVariable:p,filterVariables:t}),[h,m,g,d,p,c]);return(0,import_jsx_runtime.jsx)(VariablesContext.Provider,{value:f,children:e})};VariablesProvider.displayName="VariablesProvider";const VariablesProvider$1=VariablesProvider;function shouldToRequest(e,t,o){let r=!1;return getCachedLazyLoadedValues(t,o)?!1:((0,import_reactive.untracked)(()=>{if(JSON.stringify(e)==="[{}]"||JSON.stringify(e)==="{}"){r=!0;return}r=import_lodash.default.isEmpty(e)}),r)}function mergeCtxWithLocalVariables(e,t){return e=x({},e),t==null||t.forEach(o=>{e[o.name]=o.ctx}),e}function mergeVariableToCollectionNameWithLocalVariables(e,t){return e=x({},e),t==null||t.forEach(o=>{e[o.name]=P(x({},o),{defaultValue:import_lodash.default.has(o,"defaultValue")?o.defaultValue:null})}),e}function removeThroughCollectionFields(e,t){return!(t!=null&&t.through)||!e?e:Array.isArray(e)?e.map(o=>import_lodash.default.omit(o,t.through)):import_lodash.default.omit(e,t.through)}const mergeChildren=(e,t)=>{if(!(!e&&!t)&&!(0,import_shared.isFn)(e))return(0,import_jsx_runtime.jsxs)(import_react2.Fragment,{children:[e,t]})},isValidComponent=e=>e&&(typeof e=="object"||typeof e=="function"),renderChildren=(e,t,o)=>(0,import_shared.isFn)(e)?e(t,o):e,NocoBaseReactiveInternal=e=>{var t;const o=(0,import_react2.useContext)(import_react.SchemaComponentsContext),r=e.field,i=mergeChildren(renderChildren(e.children,r,r.form),(t=r.content)!=null?t:r.componentProps.children);if(r.display!=="visible")return null;const n=a=>{var l;return isValidComponent(a)?a:(l=import_shared.FormPath.getIn(o,a))!=null?l:a};return(a=>r.decoratorType?import_react2.default.createElement(n(r.decoratorType),r.decoratorProps,a):(0,import_jsx_runtime.jsx)(import_react2.Fragment,{children:a}))(r.componentType?import_react2.default.createElement(n(r.componentType),P(x({},r.componentProps),{value:r.value}),i):i)};NocoBaseReactiveInternal.displayName="NocoBaseReactiveInternal";const NocoBaseReactiveField=NocoBaseReactiveInternal;NocoBaseReactiveField.displayName="NocoBaseReactiveField";function createNocoBaseField(e){return new NocoBaseField$1(e)}let NocoBaseField$1=class{constructor(e){I(this,"props"),I(this,"initialized"),I(this,"loading"),I(this,"validating"),I(this,"submitting"),I(this,"selfModified"),I(this,"active"),I(this,"visited"),I(this,"mounted"),I(this,"unmounted"),I(this,"inputValues"),I(this,"inputValue"),I(this,"feedbacks"),I(this,"title"),I(this,"description"),I(this,"display"),I(this,"pattern"),I(this,"editable"),I(this,"disabled"),I(this,"readOnly"),I(this,"readPretty"),I(this,"visible"),I(this,"hidden"),I(this,"dataSource"),I(this,"validator"),I(this,"required"),I(this,"content"),I(this,"initialValue"),I(this,"value"),I(this,"data"),I(this,"decorator"),I(this,"component"),I(this,"decoratorProps"),I(this,"componentProps"),I(this,"decoratorType"),I(this,"componentType"),I(this,"path"),I(this,"form"),I(this,"address"),this.props=e,this.initialize()}initialize(){var e,t,o,r,i,n,a,l,c,u,d,m,p,g,h,f,_,v,C,S;const b=this.props.compile;this.pattern="readPretty",this.readPretty=!0,this.initialized=!0,this.loading=!1,this.validating=!1,this.submitting=!1,this.selfModified=!1,this.active=!1,this.visited=!0,this.mounted=!0,this.unmounted=!1,this.inputValues=[],this.inputValue=null,this.feedbacks=[],this.title=b(this.props.title||((e=this.props.schema)==null?void 0:e.title)),this.description=b(this.props.description||((t=this.props.schema)==null?void 0:t.description)),this.display="visible",this.editable=this.props.editable||((o=this.props.schema)==null?void 0:o["x-editable"]),this.disabled=this.props.disabled||((r=this.props.schema)==null?void 0:r["x-disabled"]),this.readOnly=this.props.readOnly||((i=this.props.schema)==null?void 0:i["x-read-only"]),this.visible=this.props.visible||((n=this.props.schema)==null?void 0:n["x-visible"]),this.hidden=this.props.hidden||((a=this.props.schema)==null?void 0:a["x-hidden"]),this.dataSource=b(this.props.dataSource||((l=this.props.schema)==null?void 0:l.enum)),this.validator=this.props.validator,this.required=this.props.required||!!((c=this.props.schema)!=null&&c.required),this.content=b(this.props.content||((u=this.props.schema)==null?void 0:u["x-content"])),this.initialValue=b(this.props.initialValue||((d=this.props.schema)==null?void 0:d.default)),this.value=b(this.props.value),this.data=this.props.data||((m=this.props.schema)==null?void 0:m["x-data"]),this.decorator=this.props.decorator?(0,import_shared.toArr)(this.props.decorator):[(p=this.props.schema)==null?void 0:p["x-decorator"],(g=this.props.schema)==null?void 0:g["x-decorator-props"]],this.component=this.props.component?(0,import_shared.toArr)(this.props.component):[(h=this.props.schema)==null?void 0:h["x-component"],(f=this.props.schema)==null?void 0:f["x-component-props"]],this.decoratorProps=((_=this.props.schema)==null?void 0:_["x-decorator-props"])||{},this.componentProps=((v=this.props.schema)==null?void 0:v["x-component-props"])||{},this.decoratorType=(C=this.props.schema)==null?void 0:C["x-decorator"],this.componentType=(S=this.props.schema)==null?void 0:S["x-component"],this.path={},this.form={},this.address={concat:import_lodash.default.noop}}};const NocoBaseField=e=>{const t=useCompile(),o=(0,import_react.useFieldSchema)(),r=(0,import_react2.useMemo)(()=>createNocoBaseField(P(x({},e),{compile:t})),[]);return Object.assign(r.componentProps,o["x-component-props"]),r.value=e.value,(0,import_jsx_runtime.jsx)(import_react.FieldContext.Provider,{value:r,children:(0,import_jsx_runtime.jsx)(NocoBaseReactiveField,{field:r,children:e.children})})},CollectionFieldUISchemaContext=import_react2.default.createContext({}),RefreshFieldSchemaContext=import_react2.default.createContext(import_lodash.default.noop),RefreshFieldSchemaProvider=({children:e,refresh:t})=>{const o=useRefreshFieldSchema(),r=(0,import_react2.useCallback)(i=>{t(),i!=null&&i.refreshParentSchema&&(o==null||o())},[o,t]);return(0,import_jsx_runtime.jsx)(RefreshFieldSchemaContext.Provider,{value:r,children:e})},RefreshComponentContext=import_react2.default.createContext(import_lodash.default.noop),RefreshComponentProvider=({children:e,refresh:t})=>(0,import_jsx_runtime.jsx)(RefreshComponentContext.Provider,{value:t,children:e}),useRefreshComponent=()=>import_react2.default.useContext(RefreshComponentContext),useRefreshFieldSchema=()=>import_react2.default.useContext(RefreshFieldSchemaContext),useCollectionFieldUISchema=()=>import_react2.default.useContext(CollectionFieldUISchemaContext)||{},CollectionFieldUISchemaProvider=e=>{const{children:t,fieldSchema:o}=e,r=useCollection(),i=useCollectionManager(),n=o==null?void 0:o.name,a=(0,import_react2.useMemo)(()=>{var l;if(!r)return null;const c=(l=o==null?void 0:o["x-component-props"])==null?void 0:l.field;return i.getCollectionField(o==null?void 0:o["x-collection-field"])||c||r.getField((c==null?void 0:c.name)||n)},[r,i,o,n]);return(0,import_jsx_runtime.jsx)(CollectionFieldUISchemaContext.Provider,{value:a,children:t})},toFieldProps=import_lodash.default.memoize((e,t)=>e.toFieldProps({scope:t})),useFieldProps$1=e=>{const t=(0,import_react.useExpressionScope)();return toFieldProps(e,t)},useBasePath=e=>{var t;const o=(0,import_react.useField)();return e.onlyRenderProperties?e.basePath||((t=o==null?void 0:o.address)==null?void 0:t.concat(e.name)):e.basePath||(o==null?void 0:o.address)},createMergedSchemaInstance=(e,t,o)=>{const r=e.toJSON();if(o){if(!r.properties)return e;const i=Object.keys(r.properties)[0],n=Object.values(r.properties)[0];return r.properties[i]=(0,import_shared.merge)(import_lodash.default.omit(t,"type","x-read-pretty"),n),new import_react.Schema(r)}return new import_react.Schema((0,import_shared.merge)(import_lodash.default.omit(t,"type","x-read-pretty"),r))},propertiesToReactElement=({schema:e,field:t,basePath:o,mapProperties:r,filterProperties:i,propsRecursion:n,values:a,isUseFormilyField:l})=>{const c=import_react.Schema.getOrderProperties(e);return c.length?(0,import_jsx_runtime.jsx)(import_react2.Fragment,{children:c.map(({schema:u,key:d},m)=>{const p=(t==null?void 0:t.address)||o;let g=u;if((0,import_shared.isFn)(r)){const f=r(u,d);f&&(g=f)}if((0,import_shared.isFn)(i)&&i(g,d)===!1)return null;const h=(0,import_shared.isBool)(n)&&n?(0,import_jsx_runtime.jsx)(NocoBaseRecursionField,{propsRecursion:!0,filterProperties:i,mapProperties:r,schema:g,name:d,basePath:p,values:import_lodash.default.get(a,d),isUseFormilyField:l}):(0,import_jsx_runtime.jsx)(NocoBaseRecursionField,{schema:g,name:d,basePath:p,values:import_lodash.default.get(a,d),isUseFormilyField:l});return g["x-component"]==="CollectionField"?(0,import_jsx_runtime.jsx)(IsInNocoBaseRecursionFieldContext.Provider,{value:!0,children:(0,import_jsx_runtime.jsx)(CollectionFieldUISchemaProvider,{fieldSchema:g,children:h})},`${m}-${d}`):(0,import_jsx_runtime.jsx)(IsInNocoBaseRecursionFieldContext.Provider,{value:!1,children:(0,import_jsx_runtime.jsx)(CollectionFieldUISchemaContext.Provider,{value:EMPTY_OBJECT,children:h})},`${m}-${d}`)})}):null},IsInNocoBaseRecursionFieldContext=import_react2.default.createContext(!1),useIsInNocoBaseRecursionFieldContext=()=>import_react2.default.useContext(IsInNocoBaseRecursionFieldContext),NocoBaseRecursionField=import_react2.default.memo(e=>{const{schema:t,name:o,onlyRenderProperties:r,onlyRenderSelf:i,mapProperties:n,filterProperties:a,propsRecursion:l,values:c,isUseFormilyField:u=!0,uiSchema:d}=e,m=useBasePath(e),p=(0,import_react2.useRef)(null),g=(0,import_react2.useMemo)(()=>(p.current=null,new import_react.Schema(t)),[t]),{uiSchema:h,defaultValue:f}=useCollectionFieldUISchema(),_=(0,import_ahooks.useUpdate)(),{onChange:v}=(0,import_react2.useContext)(SchemaComponentOnChangeContext),C=p.current||g,S=(0,import_react2.useCallback)(()=>{const k=C.parent;p.current=new import_react.Schema(C.toJSON(),k),k!=null&&k.properties&&Object.keys(k.properties).forEach(R=>{R===C.name&&(k.properties[R]=p.current)}),_(),v==null||v()},[C,v,_]),b=(0,import_react2.useMemo)(()=>d?createMergedSchemaInstance(C,d,r):h?(h.default=f,createMergedSchemaInstance(C,h,r)):C,[h,f,C,r,d]),y=useFieldProps$1(b),F=k=>{if(!i)return propertiesToReactElement({schema:C,field:k,basePath:m,mapProperties:n,filterProperties:a,propsRecursion:l,values:c,isUseFormilyField:u})},j=()=>(0,import_shared.isValid)(o)?b.type==="object"?r?F():(0,import_jsx_runtime.jsx)(import_react.ObjectField,P(x({},y),{name:o,basePath:m,children:F})):b.type==="array"?(0,import_jsx_runtime.jsx)(import_react.ArrayField,P(x({},y),{name:o,basePath:m})):b.type==="void"?r?F():(0,import_jsx_runtime.jsx)(import_react.VoidField,P(x({},y),{name:o,basePath:m,children:F})):u?(0,import_jsx_runtime.jsx)(import_react.Field,P(x({},y),{name:o,basePath:m})):(0,import_jsx_runtime.jsx)(NocoBaseField,{name:o,value:c,initialValue:c,basePath:m,schema:b}):F();return C?(0,import_jsx_runtime.jsx)(import_react.SchemaContext.Provider,{value:C,children:(0,import_jsx_runtime.jsx)(RefreshFieldSchemaProvider,{refresh:S,children:j()})}):(0,import_jsx_runtime.jsx)(import_react2.Fragment,{})});NocoBaseRecursionField.displayName="NocoBaseRecursionField";const LAZY_COMPONENT_KEY=Symbol("LAZY_COMPONENT_KEY");function lazy(e,...t){if(t.length===0){const o=(0,import_react2.lazy)(()=>e().then(i=>{const n=i.default;return r[LAZY_COMPONENT_KEY]=n,{default:n}})),r=i=>(0,import_jsx_runtime.jsx)(import_react2.default.Suspense,{fallback:(0,import_jsx_runtime.jsx)(import_antd.Spin,{}),children:(0,import_jsx_runtime.jsx)(o,x({},i))});return r}return t.reduce((o,r)=>{const i=(0,import_react2.lazy)(()=>e().then(n=>{const a=(0,import_lodash.get)(n,r);return o[r][LAZY_COMPONENT_KEY]=a,{default:a}}));return o[r]=n=>(0,import_jsx_runtime.jsx)(import_react2.default.Suspense,{fallback:(0,import_jsx_runtime.jsx)(import_antd.Spin,{}),children:(0,import_jsx_runtime.jsx)(i,x({},n))}),o},{})}function useLazy(e,t){const o=typeof t=="function"?t:i=>i[t],r=(0,import_react_imported_component.loadableResource)(e);if(!r.payload)throw new Promise((i,n)=>{r.loadIfNeeded(),r.resolution.then(i).catch(n)});return o(r.payload)}function addAppVersion(e,t){if(e)return e["x-app-version"]||(e["x-app-version"]=t),Object.keys(e.properties||{}).forEach(o=>{var r;addAppVersion((r=e.properties)==null?void 0:r[o],t)}),e}const name="@nocobase/client",version="1.5.23",license="AGPL-3.0",main="lib/index.js",module$1="es/index.mjs",types="es/index.d.ts",dependencies={"@ahooksjs/use-url-state":"3.5.1","@ant-design/cssinjs":"^1.11.1","@ant-design/icons":"^5.1.4","@ant-design/pro-layout":"^7.16.11","@antv/g2plot":"^2.4.18","@budibase/handlebars-helpers":"^0.14.0","@ctrl/tinycolor":"^3.6.0","@dnd-kit/core":"^5.0.1","@dnd-kit/modifiers":"^6.0.0","@dnd-kit/sortable":"^6.0.0","@emotion/css":"^11.7.1","@formily/antd-v5":"1.1.9","@formily/core":"^2.2.27","@formily/grid":"^2.2.27","@formily/json-schema":"^2.2.27","@formily/path":"^2.2.27","@formily/react":"^2.2.27","@formily/reactive":"^2.2.27","@formily/reactive-react":"^2.2.27","@formily/shared":"^2.2.27","@formily/validator":"^2.2.27","@nocobase/evaluators":"1.5.23","@nocobase/sdk":"1.5.23","@nocobase/utils":"1.5.23",ahooks:"^3.7.2",antd:"5.12.8","antd-style":"3.7.1",axios:"^1.7.0","bignumber.js":"^9.1.2",classnames:"^2.3.1",cronstrue:"^2.11.0","file-saver":"^2.0.5",filesize:"9.0.11",flat:"^5.0.2",i18next:"^22.4.9","i18next-http-backend":"^2.1.1",json5:"^2.2.3",lodash:"4.17.21","lru-cache":"6.0.0","markdown-it":"14.1.0","markdown-it-highlightjs":"3.3.1",mathjs:"^10.6.0",mermaid:"9.4.3",mime:"^4.0.4","mime-match":"^1.0.2","react-beautiful-dnd":"^13.1.0","react-drag-listview":"^0.1.9","react-error-boundary":"^4.0.10","react-helmet":"^6.1.0","react-hotkeys-hook":"^3.4.7","react-i18next":"^11.15.1","react-iframe":"~1.8.5","react-image-lightbox":"^5.1.4","react-intersection-observer":"9.14.0","react-js-cron":"^3.1.0","react-quill":"^2.0.0","react-router-dom":"^6.11.2","react-to-print":"^2.14.7","sanitize-html":"2.13.0","use-deep-compare-effect":"^1.8.1"},peerDependencies={react:">=18.0.0","react-dom":">=18.0.0","react-is":">=18.0.0"},devDependencies={"@testing-library/react":"^14.0.0","@types/markdown-it":"14.1.1","@types/markdown-it-highlightjs":"3.3.1","@types/react-big-calendar":"^1.6.4","axios-mock-adapter":"^1.20.0",dumi:"2.2.14","dumi-theme-nocobase":"^0.2.28"},clientPkg={name,version,license,main,module:module$1,types,dependencies,peerDependencies,devDependencies};function createDesignable(e){return new Designable(e)}const generateUid=e=>{e&&(e["x-uid"]||(e["x-uid"]=(0,import_shared.uid)()),Object.keys(e.properties||{}).forEach(t=>{generateUid(e.properties[t])}))},defaultWrap=e=>e,matchSchema=(e,t)=>{if(!(!e||!t)){for(const o in t)if(Object.prototype.hasOwnProperty.call(t,o)&&t[o]!==(e==null?void 0:e[o]))return!1;return!0}},splitWrapSchema=(e,t)=>{if(e["x-uid"]&&e["x-uid"]===t["x-uid"])return[null,e.toJSON()];const o=e.toJSON(),r=P(x({},o),{properties:{}});let i=null;const n=(a,l)=>{Object.keys(a||{}).forEach(c=>{const u=a[c];if(u["x-uid"]===t["x-uid"]){i=a[c];return}else l.properties[c]=P(x({},u),{properties:{}}),n(u==null?void 0:u.properties,l.properties[c])})};return n(o.properties,r),[r,i]},translate=e=>e;class Designable{constructor(t){I(this,"current"),I(this,"options"),I(this,"appVersion"),I(this,"events",{}),this.options=t,this.current=t.current,this.appVersion=t.appVersion}get model(){return this.options.model}get query(){return this.options.query}loadAPIClientEvents(){const{api:t,t:o=translate}=this.options;if(!t)return;const r=i=>{if(!i)return[];const n=Object.values(i.properties).length,a=[];return i.mapProperties(l=>{l["x-component-props"]=l["x-component-props"]||{},l["x-component-props"].width=100/n,l["x-uid"]&&a.push({"x-uid":l["x-uid"],"x-component-props":l["x-component-props"]})}),i["x-uid"]&&a.length?a:[]};this.on("insertAdjacent",i=>q(this,[i],function*({onSuccess:n,current:a,position:l,schema:c,wrap:u,wrapped:d,removed:m}){var p;let g=[];if((d==null?void 0:d["x-component"])==="Grid.Col"&&(g=g.concat(r(d.parent))),(m==null?void 0:m["x-component"])==="Grid.Col"&&(g=g.concat(r(m.parent))),this.refresh(),!a["x-uid"])return;const h=yield t.request({url:`/uiSchemas:insertAdjacent/${a["x-uid"]}?position=${l}`,method:"post",data:{schema:addAppVersion(c,this.appVersion),wrap:u}});g.length&&(yield t.request({url:"/uiSchemas:batchPatch",method:"post",data:g})),m!=null&&m["x-uid"]&&(yield t.request({url:`/uiSchemas:remove/${m["x-uid"]}`,method:"post"})),n==null||n((p=h==null?void 0:h.data)==null?void 0:p.data),import_antd.message.success(o("Saved successfully"),.2)})),this.on("patch",i=>q(this,[i],function*({schema:n}){this.refresh(),n!=null&&n["x-uid"]&&(yield t.request({url:"/uiSchemas:patch",method:"post",data:x({},n)}),import_antd.message.success(o("Saved successfully"),.2))})),this.on("initializeActionContext",i=>q(this,[i],function*({schema:n}){n!=null&&n["x-uid"]&&(yield t.request({url:"/uiSchemas:initializeActionContext",method:"post",data:x({},n)}))})),this.on("batchPatch",i=>q(this,[i],function*({schemas:n}){this.refresh(),yield t.request({url:"/uiSchemas:batchPatch",method:"post",data:n}),import_antd.message.success(o("Saved successfully"),.2)})),this.on("remove",i=>q(this,[i],function*({removed:n}){let a=[];(n==null?void 0:n["x-component"])==="Grid.Col"&&(a=r(n.parent)),this.refresh(),n!=null&&n["x-uid"]&&(yield t.request({url:`/uiSchemas:remove/${n["x-uid"]}`,method:"post"}),a.length&&(yield t.request({url:"/uiSchemas:batchPatch",method:"post",data:a})),import_antd.message.success(o("Saved successfully"),.2))}))}prepareProperty(t){t.type||(t.type="void"),t.name||(t.name=(0,import_shared.uid)()),this.current["x-uid"]&&generateUid(t)}on(t,o){this.events[t]||(this.events[t]=[]),this.events[t].push(o)}emit(t,...o){return q(this,null,function*(){if(!this.events[t])return;const[r,...i]=o;return Promise.all(this.events[t].map(n=>n.bind(this)(x({current:this.current},r),...i)))})}parentsIn(t){if(!t||!import_react.Schema.isSchemaInstance(t))return!1;let o=this.current;for(;o!=null&&o.parent;){if(o.parent===t)return!0;o=o.parent}return!1}refresh(t){const{refresh:o}=this.options;return o==null?void 0:o(t)}deepMerge(t){const o={title:"title",description:"description",default:"initialValue",readOnly:"readOnly",writeOnly:"editable",enum:"dataSource","x-pattern":"pattern","x-display":"display","x-validator":"validator","x-decorator":"decorator","x-component":"component","x-reactions":"reactions","x-content":"content","x-visible":"visible","x-hidden":"hidden","x-disabled":"disabled","x-editable":"editable","x-read-only":"readOnly"},r={"x-decorator-props":"decoratorProps","x-component-props":"componentProps","x-data":"data"};Object.keys(t).forEach(i=>{o[i]?(this.current[i]=t[i],this.updateModel(o[i],t[i])):r[i]?Object.keys(t[i]).forEach(n=>{(0,import_set.default)(this.current,[i,n],t[i][n]),this.updateModel([r[i],n],t[i][n])}):this.current[i]=t[i]}),this.emit("patch",{schema:t})}getSchemaAttribute(t,o){return(0,import_get.default)(this.current,t,o)}shallowMerge(t){const o={title:"title",description:"description",default:"initialValue",readOnly:"readOnly",writeOnly:"editable",enum:"dataSource","x-pattern":"pattern","x-display":"display","x-validator":"validator","x-decorator":"decorator","x-component":"component","x-reactions":"reactions","x-content":"content","x-visible":"visible","x-hidden":"hidden","x-disabled":"disabled","x-editable":"editable","x-read-only":"readOnly","x-decorator-props":"decoratorProps","x-component-props":"componentProps","x-data":"data"};Object.keys(t).forEach(r=>{this.current[r]=t[r],o[r]&&this.updateModel(o[r],t[r])}),this.emit("patch",{schema:t})}updateModel(t,o){const r=i=>{(0,import_set.default)(i,t,o)};this.model&&r(this.model),this.query&&this.query.take(r)}insertAdjacent(t,o,r={}){switch(t){case"beforeBegin":return this.insertBeforeBegin(o,r);case"afterBegin":return this.insertAfterBegin(o,r);case"beforeEnd":return this.insertBeforeEnd(o,r);case"afterEnd":return this.insertAfterEnd(o,r)}}recursiveRemoveIfNoChildren(t,o){if(!t)return;let r=t,i;const n=o==null?void 0:o.breakRemoveOn;for(;r;){if(typeof n=="function"){if(n(r))break}else if(matchSchema(r,n))break;if(Object.keys(r.properties||{}).length>0)break;r.parent&&(i=r.parent.removeProperty(r.name)),r=r.parent}return i}remove(t,o={}){const{breakRemoveOn:r,removeParentsIfNoChildren:i}=o,n=t||this.current;let a=n.parent.removeProperty(n.name);if(i){const l=this.recursiveRemoveIfNoChildren(n.parent,{breakRemoveOn:r});l&&(a=l)}return this.emit("remove",{removed:a})}removeWithoutEmit(t,o={}){const{breakRemoveOn:r,removeParentsIfNoChildren:i}=o,n=t||this.current;let a=n.parent.removeProperty(n.name);if(i){const l=this.recursiveRemoveIfNoChildren(n.parent,{breakRemoveOn:r});l&&(a=l)}return a}insertBeforeBeginOrAfterEnd(t,o={}){if(!import_react.Schema.isSchemaInstance(this.current)||!import_react.Schema.isSchemaInstance(t)||this.current.parent!==t.parent)return;let r=0,i=0;return this.current.parent.mapProperties((n,a,l)=>{this.current.name===a&&(i=l),t.name===a&&(r=l)}),r>i?this.insertBeforeBegin(t,o):this.insertAfterEnd(t,o)}insertBeforeBegin(t,o={}){if(!import_react.Schema.isSchemaInstance(this.current))return;const r={onSuccess:o.onSuccess},{wrap:i=defaultWrap,breakRemoveOn:n,removeParentsIfNoChildren:a}=o;if(import_react.Schema.isSchemaInstance(t)){if(this.parentsIn(t)){this.emit("error",{code:"parent_is_not_allowed",schema:t});return}t.parent.removeProperty(t.name),a&&(r.removed=this.recursiveRemoveIfNoChildren(t.parent,{breakRemoveOn:n}))}else t&&(t=(0,import_cloneDeep.default)(t));const l={};let c=!1,u=0,d=0;this.current.parent.mapProperties((f,_)=>{_===this.current.name&&(d=u,c=!0,++u),f["x-index"]=u,++u,c&&(l[_]=f,this.current.parent.removeProperty(_))}),this.prepareProperty(t);const m=i(t),p=this.current.parent.addProperty(m.name||(0,import_shared.uid)(),m);p["x-index"]=d,p.parent=this.current.parent,this.current.parent.setProperties(l);const[g,h]=splitWrapSchema(p,t);this.emit("insertAdjacent",x({position:"beforeBegin",schema:h,wrapped:m,wrap:g},r))}insertAfterBegin(t,o={}){if(!import_react.Schema.isSchemaInstance(this.current))return;const r={onSuccess:o.onSuccess},{wrap:i=defaultWrap,breakRemoveOn:n,removeParentsIfNoChildren:a}=o;if(import_react.Schema.isSchemaInstance(t)){if(this.parentsIn(t)){this.emit("error",{code:"parent_is_not_allowed",schema:t});return}t.parent.removeProperty(t.name),a&&(r.removed=this.recursiveRemoveIfNoChildren(t.parent,{breakRemoveOn:n}))}else t&&(t=(0,import_cloneDeep.default)(t));const l={};let c=1;this.current.mapProperties((g,h)=>{g["x-index"]=c,++c,l[h]=g}),this.current.properties={},this.prepareProperty(t);const u=i(t),d=this.current.addProperty(u.name||(0,import_shared.uid)(),u);d["x-index"]=0,d.parent=this.current,this.current.setProperties(l);const[m,p]=splitWrapSchema(d,t);this.emit("insertAdjacent",x({position:"afterBegin",schema:p,wrap:m,wrapped:u},r))}insertBeforeEnd(t,o={}){if(!import_react.Schema.isSchemaInstance(this.current))return;delete t["x-index"];const r={onSuccess:o.onSuccess},{wrap:i=defaultWrap,breakRemoveOn:n,removeParentsIfNoChildren:a}=o;if(import_react.Schema.isSchemaInstance(t)){if(this.parentsIn(t)){this.emit("error",{code:"parent_is_not_allowed",schema:t});return}t.parent.removeProperty(t.name),a&&(r.removed=this.recursiveRemoveIfNoChildren(t.parent,{breakRemoveOn:n}))}else t&&(t=(0,import_cloneDeep.default)(t));this.prepareProperty(t);const l=i(t),c=this.current.addProperty(l.name||(0,import_shared.uid)(),l);c.parent=this.current;const[u,d]=splitWrapSchema(c,t);return this.emit("insertAdjacent",x({position:"beforeEnd",schema:d,wrap:u,wrapped:l},r))}insertAfterEnd(t,o={}){if(!import_react.Schema.isSchemaInstance(this.current))return;const r={onSuccess:o==null?void 0:o.onSuccess},{wrap:i=defaultWrap,breakRemoveOn:n,removeParentsIfNoChildren:a}=o;let l=0,c=0,u=!1;const d={};if(this.current.parent.mapProperties((f,_)=>{f["x-index"]=l,_===this.current.name&&(++l,c=l,u=!0),++l,u&&_!==this.current.name&&(d[_]=f,this.current.parent.removeProperty(_))}),import_react.Schema.isSchemaInstance(t)){if(this.parentsIn(t)){this.emit("error",{code:"parent_is_not_allowed",schema:t});return}t.parent.removeProperty(t.name),a&&(r.removed=this.recursiveRemoveIfNoChildren(t.parent,{breakRemoveOn:n})),t.parent=null}else t&&(t=(0,import_cloneDeep.default)(t));this.prepareProperty(t);const m=i(t),p=this.current.parent.addProperty(m.name||(0,import_shared.uid)(),m);p.parent=this.current.parent,p["x-index"]=c,this.current.parent.setProperties(d);const[g,h]=splitWrapSchema(p,t);this.emit("insertAdjacent",x({position:"afterEnd",schema:h,wrap:g,wrapped:m},r))}}function useFindComponent(){const e=(0,import_react2.useContext)(import_react.SchemaOptionsContext),t=(0,import_react2.useMemo)(()=>(e==null?void 0:e.components)||{},[e]);return o=>{if(!o)return null;if(typeof o!="string")return o;const r=(0,import_get.default)(t,o);return r||console.error(`[nocobase]: Component "${o}" not found`),r}}function useDesignable(){const{designable:e,setDesignable:t,refresh:o,reset:r}=(0,import_react2.useContext)(SchemaComponentContext),i=(0,import_react2.useContext)(import_react.SchemaOptionsContext),n=(0,import_react2.useMemo)(()=>(i==null?void 0:i.components)||{},[i]),a=(0,import_react2.useMemo)(()=>()=>(0,import_jsx_runtime.jsx)(import_jsx_runtime.Fragment,{}),[]),l=(0,import_ahooks.useUpdate)(),c=useRefreshFieldSchema(),u=useRefreshComponent(),d=(0,import_react2.useCallback)(_=>{o==null||o(),l(),c==null||c(_),u==null||u()},[o,l,c,u]),m=(0,import_react.useField)(),p=(0,import_react.useFieldSchema)(),g=useAPIClient(),{t:h}=(0,import_react_i18next.useTranslation)(),f=(0,import_react2.useMemo)(()=>createDesignable({t:h,api:g,refresh:d,current:p,model:m,appVersion:clientPkg.version}),[h,g,d,p,m]);return(0,import_react2.useEffect)(()=>{f.loadAPIClientEvents()},[f]),{dn:f,designable:e,reset:r,refresh:d,setDesignable:t,DesignableBar:a,findComponent:(0,import_react2.useCallback)(_=>{var v;if(!_)return null;if(typeof _!="string")return _;const C=(0,import_get.default)(n,_);return(v=C[LAZY_COMPONENT_KEY])!=null?v:C},[import_get.default]),on:f.on.bind(f),patch:(0,import_react2.useCallback)((_,v)=>{const C=S=>{Object.keys(S).forEach(b=>{const y=S[b];b==="title"&&(m.title=y,p.title=y),b==="x-decorator-props"&&(m.decoratorProps||(m.decoratorProps={}),p["x-decorator-props"]||(p["x-decorator-props"]={}),Object.keys(y).forEach(F=>{m.decoratorProps[F]=y[F],p["x-decorator-props"][F]=y[F]})),b==="x-component-props"&&(m.componentProps||(m.componentProps={}),p["x-component-props"]||(p["x-component-props"]={}),Object.keys(y).forEach(F=>{m.componentProps[F]=y[F],p["x-component-props"][F]=y[F]}))})};if(typeof _=="string"){const S={};return(0,import_set.default)(S,_,v),C(S)}C(_),d()},[f]),shallowMerge:(0,import_react2.useCallback)(_=>{f.shallowMerge(_)},[f]),deepMerge:(0,import_react2.useCallback)(_=>{f.deepMerge(_)},[f]),remove:(0,import_react2.useCallback)((_,v)=>{f.remove(_,v)},[f]),insertAdjacent:(0,import_react2.useCallback)((_,v,C)=>{f.insertAdjacent(_,v,C)},[f]),insertBeforeBegin:(0,import_react2.useCallback)(_=>{f.insertBeforeBegin(_)},[f]),insertAfterBegin:(0,import_react2.useCallback)(_=>{f.insertAfterBegin(_)},[f]),insertBeforeEnd:(0,import_react2.useCallback)(_=>{f.insertBeforeEnd(_)},[f]),insertAfterEnd:(0,import_react2.useCallback)(_=>{f.insertAfterEnd(_)},[f])}}const DefaultSchemaToolbar=()=>null;DefaultSchemaToolbar.isNullComponent=!0;const useDesigner=()=>{const{designable:e}=useDesignable(),t=(0,import_react.useFieldSchema)(),o=(0,import_react2.useMemo)(()=>t["x-designer"]||t["x-toolbar"]?t["x-designer"]||t["x-toolbar"]:t["x-settings"]?SchemaToolbar:DefaultSchemaToolbar,[t]),r=useComponent(o);return e&&r||DefaultSchemaToolbar},useFieldProps=e=>{const t=(0,import_react2.useContext)(import_react.SchemaOptionsContext),o=(0,import_react2.useContext)(import_react.SchemaExpressionScopeContext),r=(0,import_react2.useRef)();return r.current=o,e.toFieldProps(P(x({},t),{get scope(){return x(x({},t.scope),r.current)}}))};function useSchemaComponentContext(){return(0,import_react2.useContext)(SchemaComponentContext)}const useFieldComponentOptions=()=>{var e;const{getCollectionJoinField:t,getCollection:o}=useCollectionManager_deprecated(),r=(0,import_react.useFieldSchema)(),{getField:i}=useCollection_deprecated(),n=i(r.name)||t(r["x-collection-field"]),{t:a}=(0,import_react_i18next.useTranslation)(),{label:l}=((e=r["x-component-props"])==null?void 0:e.fieldNames)||{};return(0,import_react2.useMemo)(()=>{if(!n||!(n!=null&&n.interface)||!["o2o","oho","obo","o2m","linkTo","m2o","m2m"].includes(n.interface))return;const c=o(n.target);if((c==null?void 0:c.template)==="file")return[{label:a("Record picker"),value:"CollectionField"},{label:a("Select"),value:"AssociationSelect"}];switch(n.interface){case"o2m":return[{label:a("Record picker"),value:"CollectionField"},{label:a("Subtable"),value:"TableField"},{label:a("Select"),value:"AssociationSelect"}];case"m2o":case"m2m":case"linkTo":return[{label:a("Record picker"),value:"CollectionField"},{label:a("Select"),value:"AssociationSelect"}];default:return[{label:a("Record picker"),value:"CollectionField"},{label:a("Subform"),value:"FormField"},{label:a("Select"),value:"AssociationSelect"}]}},[a,n==null?void 0:n.interface,l])},useFieldTitle=()=>{var e;const t=(0,import_react.useField)(),o=(0,import_react.useFieldSchema)(),r=useCollection(),i=useCollectionManager(),n=(r==null?void 0:r.getField(o.name))||(i==null?void 0:i.getCollectionField(o["x-collection-field"])),a=useCompile();(0,import_react2.useEffect)(()=>{var l;t!=null&&t.title||(t.title=a((l=n==null?void 0:n.uiSchema)==null?void 0:l.title))},[(e=n==null?void 0:n.uiSchema)==null?void 0:e.title])},getPageHeaderHeight=(e,t,o,r,i)=>i.includes("/popups/")?2*r.paddingContentVertical+22+r.paddingPageVertical:e?r.paddingContentHorizontalLG:o?t?r.controlPaddingHorizontal+3*r.controlPaddingHorizontalSM+22+r.paddingContentHorizontalLG:r.paddingContentHorizontalLG+12:t?r.paddingSM+r.controlHeight+r.marginXS+2*r.controlPaddingHorizontalSM+22+r.paddingContentHorizontalLG:r.controlHeight+r.marginXS+(r.paddingXXS+2)*2+r.paddingContentHorizontalLG,usePageFullScreenHeight=e=>{const{token:t}=import_antd.theme.useToken(),{designable:o}=useDesignable(),{heightProps:r}=useBlockHeightProps(),i=(0,import_react_router_dom.useLocation)(),{disablePageHeader:n,enablePageTabs:a,hidePageTitle:l}=e||r||{},c=t.sizeXXL-2,u=o?t.controlHeight+2*t.paddingContentHorizontalLG:1*t.paddingContentHorizontalLG,d=getPageHeaderHeight(n,a,l,t,i.pathname);return c+d+u},useDrawerFullScreenHeight=()=>{const{token:e}=import_antd.theme.useToken(),{designable:t}=useDesignable(),o=e.paddingContentVerticalLG+e.margin+2*e.paddingContentVertical+24,r=t?e.controlHeight+2*e.paddingContentHorizontalLG:1*e.paddingContentHorizontalLG;return o+r},useFullScreenHeight=e=>{const t=(0,import_react.useFieldSchema)(),o=hasActionContainerInParentChain(t),r=usePageFullScreenHeight(e),i=useDrawerFullScreenHeight();return o?i:r},InternalWorkflowCollection=["users_jobs","approvals","approvalRecords"],useTableHeight=()=>{var e;const{token:t}=import_antd.theme.useToken(),{heightProps:o}=useBlockHeightProps(),{heightProps:r}=useTableBlockContext(),{designable:i}=useDesignable(),n=(0,import_react.useFieldSchema)(),a=r||o,l=useFullScreenHeight(a),{name:c}=useCollection(),{heightMode:u,height:d,title:m}=a;if(!(a!=null&&a.heightMode)||u===HeightMode.DEFAULT)return;const p=Object.keys(((e=n.parent.properties.actions)==null?void 0:e.properties)||{}).length>0,g=t.controlHeight+t.padding+t.marginLG,h=p||i?t.controlHeight+2*t.marginLG:t.marginLG,f=(i&&!InternalWorkflowCollection.includes(c)?t.controlHeight:22)+2*t.padding+1,_=m?t.fontSizeLG*t.lineHeightLG+t.padding*2-1:0;return u===HeightMode.FULL_HEIGHT?window.innerHeight-l-_-f-h-g:d-_-h-f-g},useDataBlockHeight=e=>{const{heightProps:t}=useBlockHeightProps(),o=useFullScreenHeight(),{token:r}=import_antd.theme.useToken(),{heightMode:i,height:n,title:a}=t||{},l=a?r.fontSizeLG*r.lineHeightLG+r.padding*2-1:0;if(!(!(t!=null&&t.heightMode)||i===HeightMode.DEFAULT)){if(i===HeightMode.FULL_HEIGHT){let c=window.innerHeight-o;return e!=null&&e.removeBlockHeaderHeight&&(c=c-l),e!=null&&e.innerExtraHeight&&(c=c-e.innerExtraHeight),c}return n}},useBlockHeight=()=>{const e=(0,import_react.useFieldSchema)(),t=(0,import_react2.useMemo)(()=>getPageSchema(e),[]),{disablePageHeader:o,enablePageTabs:r,hidePageTitle:i}=(t==null?void 0:t["x-component-props"])||{},n=P(x({},e==null?void 0:e["x-component-props"]),{disablePageHeader:o,enablePageTabs:r,hidePageTitle:i}),a=useFullScreenHeight(n),{heightMode:l,height:c}=n||{};if(!(!(n!=null&&n.heightMode)||l===HeightMode.DEFAULT))return l===HeightMode.FULL_HEIGHT?window.innerHeight-a:c},useTableSize=()=>{const[e,t]=(0,import_react2.useState)(),o=(0,import_react2.useRef)(null),r=useTableHeight(),i=(0,import_react2.useCallback)((0,import_lodash.debounce)(()=>{var a;if(!o.current)return;const l=o.current.getBoundingClientRect();(a=o.current.querySelector(".ant-table"))!=null&&a.getBoundingClientRect()&&t(l.width)},100),[r]),n=(0,import_react2.useCallback)(a=>{o.current=a&&a.children?a.children[0]:null,i()},[i]);return(0,import_ahooks.useEventListener)("resize",i),{height:r,width:e,tableSizeRefCallback:n}},hasActionContainerInParentChain=e=>{var t;return e?e["x-component"]==="Action.Container"?((t=e==null?void 0:e.parent["x-component-props"])==null?void 0:t.openMode)!=="page":hasActionContainerInParentChain(e.parent):null},useFieldModeOptions=e=>{var t;const{t:o}=(0,import_react_i18next.useTranslation)(),{getCollectionJoinField:r,getCollection:i}=useCollectionManager_deprecated(),n=(0,import_react.useFieldSchema)(),a=(e==null?void 0:e.fieldSchema)||n,l=(0,import_react.useField)(),c=(0,import_react.useForm)(),u=(a==null?void 0:a["x-read-pretty"])||l.readPretty||c.readPretty,d=e==null?void 0:e.fieldSchema,{getField:m}=useCollection_deprecated(),p=(e==null?void 0:e.collectionField)||m(a.name)||r(a["x-collection-field"]),{label:g}=((t=a["x-component-props"])==null?void 0:t.fieldNames)||{};return((0,import_react2.useMemo)(()=>{if(!p||!(p!=null&&p.interface)||!["o2o","oho","obo","o2m","linkTo","m2o","m2m","updatedBy","createdBy","mbm","attachmentURL"].includes(p.interface))return;const h=i(p.target);if((h==null?void 0:h.template)==="file")return u?[{label:o("Title"),value:"Select"},{label:o("File manager"),value:"FileManager"},{label:o("Tag"),value:"Tag"}]:[{label:o("Select"),value:"Select"},{label:o("Record picker"),value:"Picker"},{label:o("File manager"),value:"FileManager"}];if((h==null?void 0:h.template)==="tree"&&["m2m","o2m","m2o"].includes(p.interface))return u?[{label:o("Title"),value:"Select"},{label:o("Tag"),value:"Tag"},!d&&{label:o("Sub-details"),value:"Nester"},!d&&{label:o("Sub-table"),value:"SubTable"}]:[{label:o("Select"),value:"Select"},{label:o("Record picker"),value:"Picker"},!d&&["m2m","o2m"].includes(p.interface)&&{label:o("Sub-table"),value:"SubTable"},!d&&{label:o("Cascade Select"),value:"CascadeSelect"},!d&&{label:o("Sub-form"),value:"Nester"},{label:o("Sub-form(Popover)"),value:"PopoverNester"}];switch(p.interface){case"o2m":return u?[{label:o("Title"),value:"Select"},{label:o("Tag"),value:"Tag"},!d&&{label:o("Sub-table"),value:"SubTable"},!d&&{label:o("Sub-details"),value:"Nester"}]:[{label:o("Select"),value:"Select"},{label:o("Record picker"),value:"Picker"},!d&&{label:o("Sub-form"),value:"Nester"},{label:o("Sub-form(Popover)"),value:"PopoverNester"},!d&&{label:o("Sub-table"),value:"SubTable"}];case"m2m":case"mbm":return u?[{label:o("Title"),value:"Select"},{label:o("Tag"),value:"Tag"},!d&&{label:o("Sub-details"),value:"Nester"},!d&&{label:o("Sub-table"),value:"SubTable"}]:[{label:o("Select"),value:"Select"},{label:o("Record picker"),value:"Picker"},!d&&{label:o("Sub-table"),value:"SubTable"},!d&&{label:o("Sub-form"),value:"Nester"},{label:o("Sub-form(Popover)"),value:"PopoverNester"}];case"m2o":case"linkTo":return u?[{label:o("Title"),value:"Select"},{label:o("Tag"),value:"Tag"},!d&&{label:o("Sub-details"),value:"Nester"}]:[{label:o("Select"),value:"Select"},{label:o("Record picker"),value:"Picker"},!d&&{label:o("Sub-form"),value:"Nester"},{label:o("Sub-form(Popover)"),value:"PopoverNester"}];default:return u?[{label:o("Title"),value:"Select"},{label:o("Tag"),value:"Tag"},!d&&{label:o("Sub-details"),value:"Nester"}]:[{label:o("Select"),value:"Select"},{label:o("Record picker"),value:"Picker"},!d&&{label:o("Sub-form"),value:"Nester"},{label:o("Sub-form(Popover)"),value:"PopoverNester"}]}},[o,p==null?void 0:p.interface,g])||[]).filter(Boolean)},useDragEnd=e=>{const{refresh:t}=useDesignable(),o=useAPIClient(),{t:r}=(0,import_react_i18next.useTranslation)();return(0,import_react2.useCallback)(i=>{var n,a,l,c,u,d,m,p,g,h,f,_,v,C,S;const{active:b,over:y}=i,F=(a=(n=b==null?void 0:b.data)==null?void 0:n.current)==null?void 0:a.schema,j=(c=(l=y==null?void 0:y.data)==null?void 0:l.current)==null?void 0:c.schema,k=(d=(u=y==null?void 0:y.data)==null?void 0:u.current)==null?void 0:d.insertAdjacent,R=(p=(m=y==null?void 0:y.data)==null?void 0:m.current)==null?void 0:p.breakRemoveOn,z=(h=(g=y==null?void 0:y.data)==null?void 0:g.current)==null?void 0:h.wrapSchema,N=(_=(f=y==null?void 0:y.data)==null?void 0:f.current)==null?void 0:_.onSuccess,L=(S=(C=(v=y==null?void 0:y.data)==null?void 0:v.current)==null?void 0:C.removeParentsIfNoChildren)!=null?S:!0;if(!F||!j){e==null||e(i);return}if(F===j){e==null||e(i);return}if(F.parent===j&&k==="beforeEnd"){e==null||e(i);return}const D=createDesignable({t:r,api:o,refresh:({refreshParentSchema:T=!0}={})=>t({refreshParentSchema:T}),current:j});if(D.loadAPIClientEvents(),F.parent===j.parent){D.insertBeforeBeginOrAfterEnd(F),e==null||e(i);return}if(k){D.insertAdjacent(k,F,{wrap:z,breakRemoveOn:R,removeParentsIfNoChildren:L,onSuccess:N}),e==null||e(i);return}},[o,e,t,r])},InternalDndContext=import_react2.default.memo(e=>{const{t}=(0,import_react_i18next.useTranslation)(),[o,r]=(0,import_react2.useState)(!0),i=(0,import_react2.useCallback)(a=>{var l,c,u;const{active:d}=a,m=(c=(l=d==null?void 0:d.data)==null?void 0:l.current)==null?void 0:c.schema;r(!!m),e!=null&&e.onDragStart&&((u=e==null?void 0:e.onDragStart)==null||u.call(e,a))},[e==null?void 0:e.onDragStart]),n=useDragEnd(e==null?void 0:e.onDragEnd);return(0,import_jsx_runtime.jsxs)(import_core.DndContext,P(x({collisionDetection:import_core.rectIntersection},e),{onDragStart:i,onDragEnd:n,children:[(0,import_jsx_runtime.jsx)(import_core.DragOverlay,{dropAnimation:{duration:10,easing:"cubic-bezier(0.18, 0.67, 0.6, 1.22)"},children:o&&(0,import_jsx_runtime.jsx)("span",{style:{whiteSpace:"nowrap"},children:t("Dragging")})}),e.children]}))});InternalDndContext.displayName="InternalDndContext";const DndContext=e=>(0,import_jsx_runtime.jsx)(InternalDndContext,x({},e)),DraggableContext=(0,import_react2.createContext)(null);DraggableContext.displayName="DraggableContext";const SortableContext=(0,import_react2.createContext)(null);SortableContext.displayName="SortableContext";const SortableProvider=e=>{const{id:t,data:o,children:r}=e,i=(0,import_core.useDraggable)({id:t,data:o}),n=(0,import_core.useDroppable)({id:t,data:o}),a=(0,import_react2.useMemo)(()=>({draggable:i,droppable:n}),[i,n]);return(0,import_jsx_runtime.jsx)(SortableContext.Provider,{value:a,children:r})},getComputedColor=e=>new import_tinycolor.TinyColor(e).setAlpha(.15).toHex8String(),Sortable=e=>{var t,o;const r=e,{component:i,overStyle:n,style:a,children:l,openMode:c}=r,u=W(r,["component","overStyle","style","children","openMode"]),{token:d}=useToken(),{draggable:m,droppable:p}=(0,import_react2.useContext)(SortableContext),{isOver:g,setNodeRef:h}=p,f=x({},a);return g&&((t=m==null?void 0:m.active)==null?void 0:t.id)!==((o=p==null?void 0:p.over)==null?void 0:o.id)&&(f[i==="a"?"color":"background"]=getComputedColor(d.colorSettings),Object.assign(f,n)),import_react2.default.createElement(i||"div",P(x({role:"none"},u),{className:(0,import_css.cx)("nb-sortable-designer",e.className),ref:h,style:f}),l)},useSortableItemProps=e=>{const t=useSortableItemId(e),o=(0,import_react.useFieldSchema)();return e.schema?P(x({},e),{id:t}):P(x({},e),{id:t,schema:o})},useSortableItemId=e=>{var t;const o=(0,import_react.useField)();return e.id?e.id:(t=o.address)==null?void 0:t.toString()},InternalSortableItem=(0,import_react.observer)(e=>{const t=useSortableItemProps(e),{schema:o,id:r,eid:i,removeParentsIfNoChildren:n}=t,a=W(t,["schema","id","eid","removeParentsIfNoChildren"]),l=(0,import_react2.useMemo)(()=>({insertAdjacent:"afterEnd",schema:o,removeParentsIfNoChildren:n??!0}),[o,n]);return(0,import_jsx_runtime.jsx)(SortableProvider,{id:r,data:l,children:(0,import_jsx_runtime.jsx)(Sortable,P(x({id:i},a),{children:e.children}))})},{displayName:"InternalSortableItem"}),SortableItem=import_react2.default.memo(e=>{const t=e,{component:o}=t,r=W(t,["component"]),{designable:i}=useDesignable();return i?(0,import_jsx_runtime.jsx)(InternalSortableItem,x({},e)):import_react2.default.createElement(o||"div",import_lodash.default.omit(r,["children","schema","overStyle","openMode","id","eid","removeParentsIfNoChildren"]),e.children)});SortableItem.displayName="SortableItem";const DragHandler=e=>{const{draggable:t}=(0,import_react2.useContext)(SortableContext)||{};if(!t)return null;const{attributes:o,listeners:r,setNodeRef:i}=t;return(0,import_jsx_runtime.jsx)("div",{style:{display:"inline-block",width:14,height:14,lineHeight:"14px",textAlign:"left"},children:(0,import_jsx_runtime.jsx)("div",P(x(x({ref:i,style:{position:"relative",zIndex:1,lineHeight:0,fontSize:0,display:"inline-block"}},r),o),{role:"none",children:(0,import_jsx_runtime.jsx)("span",{style:{cursor:"move",fontSize:14},children:e.children})}))})},ShowFormData=(0,import_react.observer)(({children:e})=>{const t=(0,import_react.useForm)();return(0,import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment,{children:[(0,import_jsx_runtime.jsx)("pre",{style:{marginBottom:20},"data-testid":"form-data",children:JSON.stringify(t.values,null,2)}),e]})}),common=Object.freeze(Object.defineProperty({__proto__:null,DndContext,DragHandler,DraggableContext,ShowFormData,Sortable,SortableContext,SortableItem,SortableProvider,getRenderContent},Symbol.toStringTag,{value:"Module"})),requestChartData=e=>function(){return q(this,null,function*(){var t;try{const o=yield this.api.request(e);return(t=o==null?void 0:o.data)==null?void 0:t.data}catch{return[]}})},FormComponent$1=e=>{const t=e,{form:o,children:r}=t,i=W(t,["form","children"]),n=(0,import_react.useField)(),a=(0,import_react.useFieldSchema)(),l=useAttach(o.createVoidField(P(x({},n.props),{basePath:""})));return(0,import_jsx_runtime.jsx)(import_react.FieldContext.Provider,{value:void 0,children:(0,import_jsx_runtime.jsx)(import_react.FormContext.Provider,{value:o,children:(0,import_jsx_runtime.jsx)(import_antd_v5.FormLayout,P(x({layout:"vertical"},i),{children:(0,import_jsx_runtime.jsx)(NocoBaseRecursionField,{basePath:l.address,schema:a,onlyRenderProperties:!0})}))})})},Def$1=e=>e.children,FormDecorator$1=e=>{const t=e,{form:o,children:r,disabled:i}=t,n=W(t,["form","children","disabled"]),a=(0,import_react.useField)(),l=(0,import_react.useFieldSchema)(),c=useAttach(o.createVoidField(P(x({},a.props),{basePath:""}))),u=useComponent(l["x-component"],Def$1);return(0,import_react2.useEffect)(()=>{o.disabled=i||a.disabled},[i,a.disabled]),(0,import_jsx_runtime.jsx)(import_antd.ConfigProvider,{componentDisabled:i,children:(0,import_jsx_runtime.jsx)(import_react.FieldContext.Provider,{value:void 0,children:(0,import_jsx_runtime.jsx)(import_react.FormContext.Provider,{value:o,children:(0,import_jsx_runtime.jsx)(import_antd_v5.FormLayout,P(x({layout:"vertical"},n),{children:(0,import_jsx_runtime.jsx)(import_react.FieldContext.Provider,{value:c,children:(0,import_jsx_runtime.jsx)(u,P(x({},a.componentProps),{children:(0,import_jsx_runtime.jsx)(NocoBaseRecursionField,{basePath:c.address,schema:l,onlyRenderProperties:!0})}))})}))})})})},getRequestParams=e=>{const{request:t,initialValue:o}=e;return t||(()=>Promise.resolve({data:o}))},useDefaultValues=(e={},t={})=>useRequest(getRequestParams(t),e),FormBlockContext=(0,import_react2.createContext)(null);FormBlockContext.displayName="FormBlockContext";const Form$1=(0,import_react.observer)(e=>{const t=e,{request:o,effects:r,initialValue:i,useValues:n=useDefaultValues}=t,a=W(t,["request","effects","initialValue","useValues"]),l=(0,import_react.useFieldSchema)(),c=(0,import_react.useField)(),u=(0,import_react2.useMemo)(()=>(0,import_core2.createForm)({effects:r}),[]),d=n({uid:l["x-uid"],onSuccess(p){return q(this,null,function*(){yield u.reset(),u.setValues(p==null?void 0:p.data),u.setInitialValues(p==null?void 0:p.data)})}},e),m=(0,import_react2.useContext)(FormBlockContext);return(0,import_jsx_runtime.jsx)(FormBlockContext.Provider,{value:{parent:m,form:u,result:d,field:c,fieldSchema:l},children:(0,import_jsx_runtime.jsx)(import_antd.Spin,{spinning:(d==null?void 0:d.loading)||!1,children:l["x-decorator"]==="Form"?(0,import_jsx_runtime.jsx)(FormDecorator$1,x({form:u},a)):(0,import_jsx_runtime.jsx)(FormComponent$1,x({form:u},a))})})},{displayName:"Form"});Form$1.Designer=function e(){const{name:t,title:o}=useCollection_deprecated(),r=useSchemaTemplate(),{componentNamePrefix:i}=useBlockTemplateContext();return(0,import_jsx_runtime.jsxs)(GeneralSchemaDesigner,{template:r,title:o||t,children:[(0,import_jsx_runtime.jsx)(SchemaSettingsTemplate,{componentName:`${i}Form`,collectionName:t}),(0,import_jsx_runtime.jsx)(SchemaSettingsDivider,{}),(0,import_jsx_runtime.jsx)(SchemaSettingsRemove,{removeParentsIfNoChildren:!0,breakRemoveOn:{"x-component":"Grid"}})]})};const formV1Settings=new SchemaSettings({name:"FormV1Settings",items:[{name:"template",Component:SchemaSettingsTemplate,useComponentProps(){const{name:e}=useCollection_deprecated(),{componentNamePrefix:t}=useBlockTemplateContext();return{componentName:`${t}Form`,collectionName:e}}},{name:"divider",type:"divider"},{name:"remove",type:"remove",componentProps:{removeParentsIfNoChildren:!0,breakRemoveOn:{"x-component":"Grid"}}}]}),FormDesigner=()=>{const{name:e,title:t}=useCollection_deprecated(),o=useSchemaTemplate();return(0,import_jsx_runtime.jsx)(GeneralSchemaDesigner,{schemaSettings:"FormSettings",template:o,title:t||e})},ReadPrettyFormDesigner=()=>{const{name:e,title:t}=useCollection_deprecated(),o=useSchemaTemplate();return(0,import_jsx_runtime.jsx)(GeneralSchemaDesigner,{schemaSettings:"ReadPrettyFormSettings",template:o,title:t||e})},DetailsDesigner=()=>{const{name:e,title:t}=useCollection_deprecated(),o=useSchemaTemplate();return(0,import_jsx_runtime.jsx)(GeneralSchemaDesigner,{schemaSettings:"FormDetailsSettings",template:o,title:t||e})},FilterDesigner=()=>{const{name:e,title:t}=useCollection_deprecated(),o=useSchemaTemplate();return(0,import_jsx_runtime.jsx)(GeneralSchemaDesigner,{schemaSettings:"blockSettings:filterForm",template:o,title:t||e})},defaultFieldNames$1={label:"label",value:"value",color:"color",options:"children"};function flatData$1(e,t){const o=[];if(!Array.isArray(e))return o;for(let r=0;r<e.length;r++){const i=e[r][t.options];Array.isArray(i)&&o.push(...flatData$1(i,t)),o.push(x({},e[r]))}return o}function findOptions(e,t,o){if(!e)return[];const r=[];for(const i of o){const n=e.find(a=>a[t.value]==i)||{value:i,label:i&&i.toString()};r.push(n)}return r}function getCurrentOptions(e,t,o){const r=flatData$1(t,o),i=(0,import_lodash.castArray)(e).map(n=>(0,import_client.isPlainObject)(n)?n[o.value]:n);return findOptions(r,o,i)}const ReadPrettyInternal=(0,import_react.observer)(e=>{const[t,o]=(0,import_react2.useState)(!0),[r,i]=(0,import_react2.useState)([]),n=(0,import_react.useField)(),a=useCollectionField();return(0,import_react2.useEffect)(()=>{var l;const c=x(x({},defaultFieldNames$1),e.fieldNames),u=n.dataSource||e.options||(a==null?void 0:a.uiSchema.enum)||[],d=getCurrentOptions(n.value,u,c);if(!(0,import_shared.isValid)(e.value)&&!d.length||(0,import_core2.isArrayField)(n)&&((l=n==null?void 0:n.value)==null?void 0:l.length)===0)return;const m=n.value!==null&&d.map((p,g)=>(0,import_jsx_runtime.jsx)(import_antd.Tag,{color:p[c.color],icon:p.icon,children:p[c.label]},g));i(m),o(!1)},[a==null?void 0:a.uiSchema.enum,n,n.dataSource,n.value,e.fieldNames,e.options,e.value]),t?null:(0,import_jsx_runtime.jsx)(EllipsisWithTooltip,{ellipsis:e.ellipsis,children:r})},{displayName:"SelectReadPretty"}),ReadPretty$b=withPopupWrapper(ReadPrettyInternal),isEmptyObject=e=>!(0,import_shared.isValid)(e)||typeof e=="object"&&Object.keys(e).length===0,ObjectSelect=e=>{const t=e,{value:o,options:r,onChange:i,fieldNames:n,mode:a,loading:l,rawOptions:c,defaultValue:u}=t,d=W(t,["value","options","onChange","fieldNames","mode","loading","rawOptions","defaultValue"]),m=p=>{var g;if(isEmptyObject(p))return;const h=(0,import_shared.toArr)(p).filter(_=>_).map(_=>(0,import_client.isPlainObject)(_)?_[n.value]:_),f=(g=getCurrentOptions(h,r,n))==null?void 0:g.map(_=>({label:_[n.label],value:_[n.value]}));return["tags","multiple"].includes(a)||e.multiple?f:f.shift()};return(0,import_jsx_runtime.jsx)(import_antd.Select,x({role:"button","data-testid":`select-object-${a||"single"}`,value:m(o),defaultValue:m(u),allowClear:{clearIcon:(0,import_jsx_runtime.jsx)(import_icons.CloseCircleFilled,{role:"button","aria-label":"icon-close-select"})},labelInValue:!0,notFoundContent:l?(0,import_jsx_runtime.jsx)(import_antd.Spin,{}):(0,import_jsx_runtime.jsx)(import_antd.Empty,{image:import_antd.Empty.PRESENTED_IMAGE_SIMPLE}),options:r,fieldNames:n,showSearch:!0,popupMatchSelectWidth:!1,filterOption:(p,g)=>{var h;return((h=g==null?void 0:g[n.label||"label"])!=null?h:"").includes(p)},filterSort:(p,g)=>{var h,f;return((h=p==null?void 0:p[n.label||"label"])!=null?h:"").toLowerCase().localeCompare(((f=g==null?void 0:g[n.label||"label"])!=null?f:"").toLowerCase())},onChange:p=>{const g=getCurrentOptions((0,import_shared.toArr)(p).map(h=>h.value),c||r,n);["tags","multiple"].includes(a)||e.multiple?i==null||i(g):i==null||i(g.shift()||null)},mode:a,tagRender:p=>(0,import_jsx_runtime.jsx)(import_antd.Tag,P(x({role:"button","aria-label":p.label,closeIcon:(0,import_jsx_runtime.jsx)(import_icons.CloseOutlined,{role:"button","aria-label":"icon-close-tag"})},p),{children:p.label})),maxTagCount:"responsive"},d))},filterOption=(e,t)=>{var o;return((o=t==null?void 0:t.label)!=null?o:"").toLowerCase().includes((e||"").toLowerCase())},InternalSelect=(0,import_react.connect)(e=>{const t=e,{objectValue:o,loading:r,value:i,rawOptions:n,defaultValue:a}=t,l=W(t,["objectValue","loading","value","rawOptions","defaultValue"]),c=useCompile();let u=e.multiple?"multiple":e.mode;if(u&&!["multiple","tags"].includes(u)&&(u=void 0),o)return(0,import_jsx_runtime.jsx)(ObjectSelect,P(x({rawOptions:n},l),{defaultValue:a,value:i,mode:u,loading:r}));const d=m=>["tags","multiple"].includes(e.mode)||e.multiple?m?(0,import_shared.toArr)(m):void 0:m;return(0,import_jsx_runtime.jsx)(import_antd.Select,P(x({role:"button","data-testid":`select-${u||"single"}`,showSearch:!0,filterOption,allowClear:{clearIcon:(0,import_jsx_runtime.jsx)(import_icons.CloseCircleFilled,{role:"button","aria-label":"icon-close-select"})},popupMatchSelectWidth:!1,notFoundContent:r?(0,import_jsx_runtime.jsx)(import_antd.Spin,{}):(0,import_jsx_runtime.jsx)(import_antd.Empty,{image:import_antd.Empty.PRESENTED_IMAGE_SIMPLE}),value:d(i),defaultValue:d(a),tagRender:m=>(0,import_jsx_runtime.jsx)(import_antd.Tag,P(x({role:"button","aria-label":m.label,closeIcon:(0,import_jsx_runtime.jsx)(import_icons.CloseOutlined,{role:"button","aria-label":"icon-close-tag"})},m),{children:m.label}))},c(l)),{onChange:m=>{var p;(p=e.onChange)==null||p.call(e,m===void 0?null:m)},mode:u,maxTagCount:"responsive"}))},(0,import_react.mapProps)({dataSource:"options"},(e,t)=>P(x({},e),{fieldNames:x(x({},defaultFieldNames$1),e.fieldNames),suffixIcon:t!=null&&t.loading||t!=null&&t.validating?(0,import_jsx_runtime.jsx)(import_icons.LoadingOutlined,{}):e.suffixIcon})),(0,import_react.mapReadPretty)(ReadPretty$b)),Select=InternalSelect;Select.ReadPretty=ReadPretty$b;const getValues=(e,t)=>(0,import_lodash.castArray)(e).filter(o=>o!=null).map(o=>typeof o=="object"?o[t.value]:o),ReadPretty$a=(0,import_react.observer)(e=>{const t=x(x({},defaultFieldNames$1),e.fieldNames),o=(0,import_react.useField)(),r=(0,import_react.useFieldSchema)(),i=useRecord(),{snapshot:n}=useActionContext(),{data:a}=useRequest(n?()=>q(void 0,null,function*(){return{data:i[r.name]}}):P(x({action:"list"},e.service),{params:{paginate:!1,filter:{[t.value]:{$in:getValues(o.value,t)}}}}),{refreshDeps:[e.service,o.value]});return(0,import_jsx_runtime.jsx)(Select.ReadPretty,P(x({},e),{options:a==null?void 0:a.data}))},{displayName:"ReadPretty"}),EMPTY$1="N/A",InternalRemoteSelect=withDynamicSchemaProps((0,import_react.connect)(e=>{var t,o;const r=e,{fieldNames:i={},service:n={},wait:a=300,value:l,defaultValue:c,objectValue:u,manual:d=!0,mapOptions:m,targetField:p,CustomDropdownRender:g,optionFilter:h,dataSource:f,toOptionsItem:_=K=>K,popupMatchSelectWidth:v=!1}=r,C=W(r,["fieldNames","service","wait","value","defaultValue","objectValue","manual","mapOptions","targetField","CustomDropdownRender","optionFilter","dataSource","toOptionsItem","popupMatchSelectWidth"]),S=useDataSourceKey(),b=useDataSourceHeaders(f||S),[y,F]=(0,import_react2.useState)(!1),j=(0,import_react2.useRef)(!1),k=(0,import_react.useFieldSchema)(),R=((t=k["x-component-props"])==null?void 0:t.addMode)==="quickAdd",{getField:z}=useCollection_deprecated(),N=(0,import_react2.useRef)(null),{getCollectionJoinField:L,getInterface:D}=useCollectionManager_deprecated(),T=k["x-collection-field"]||k.name,$=z(T)||L(T),w=p||($==null?void 0:$.target)&&(i==null?void 0:i.label)&&L(`${$.target}.${i.label}`),A=(0,import_react2.useMemo)(()=>{var K;if(w!=null&&w.interface){const J=D(w.interface),X=((K=J==null?void 0:J.filterable)==null?void 0:K.operators[0].value)||"$includes";return w.type==="string"?"$includes":X}return"$includes"},[w]),B=useCompile(),M=(0,import_react2.useCallback)(K=>{try{return K.filter(J=>["number","string"].includes(typeof J[i.value])||!J[i.value]).map(J=>{var X;let Q=B(J[i.label]);if((X=w==null?void 0:w.uiSchema)!=null&&X.enum)if(Array.isArray(Q))Q=Q.map((te,ee)=>{const ne=w.uiSchema.enum.find(ae=>ae.value===te);return ne?(0,import_jsx_runtime.jsx)(import_antd.Tag,{role:"button",color:ne.color,style:{marginRight:3},children:(ne==null?void 0:ne.label)||te},ee):(0,import_jsx_runtime.jsx)(import_antd.Tag,{role:"button",children:te},te)}).reverse();else{const te=w.uiSchema.enum.find(ee=>ee.value===Q);te&&(Q=(0,import_jsx_runtime.jsx)(import_antd.Tag,{role:"button",color:te.color,children:te.label}))}return(w==null?void 0:w.type)==="date"&&(Q=(0,import_dayjs.default)(Q).format("YYYY-MM-DD")),m?m({[i.label]:Q||EMPTY$1,[i.value]:J[i.value]}):P(x({},J),{[i.label]:Q||EMPTY$1,[i.value]:J[i.value]})}).filter(Boolean)}catch(J){return console.error(J),K}},[w==null?void 0:w.uiSchema,i]),{data:O,run:E,loading:U}=useRequest(P(x({action:"list"},n),{headers:b,params:P(x({pageSize:200},n==null?void 0:n.params),{filter:(o=n==null?void 0:n.params)==null?void 0:o.filter})}),x({manual:d,debounceWait:a},n.defaultParams?{defaultParams:[n.defaultParams]}:{})),V=(0,import_react2.useMemo)(()=>JSON.stringify({service:n,fieldNames:i}),[n,i]),G=(0,import_react2.useCallback)(()=>N.current&&g?(0,import_jsx_runtime.jsx)(g,{search:N.current,callBack:()=>{N.current=null,F(!1)}}):null,[N.current]);(0,import_react2.useEffect)(()=>{j.current&&E()},[V]);const H=K=>q(void 0,null,function*(){var J;E({filter:mergeFilter([K?{[i.label]:{[A]:K}}:{},(J=n==null?void 0:n.params)==null?void 0:J.filter])}),N.current=K}),Y=(0,import_react2.useMemo)(()=>{var K;const J=l||c;if(!((K=O==null?void 0:O.data)!=null&&K.length))return J!=null?Array.isArray(J)?J:[J]:[];const X=J!=null&&(Array.isArray(J)?J.map(te=>P(x({},te),{[i.value]:te[i.value]||te})):[P(x({},J),{[i.value]:J[i.value]||J})])||[],Q=typeof h=="function"?O.data.filter(h):O.data;return(0,import_lodash.uniqBy)(Q.concat(X??[]),i.value)},[l,c,O==null?void 0:O.data,i.value,h]);return(0,import_jsx_runtime.jsx)(Select,P(x({open:y,popupMatchSelectWidth:v,autoClearSearchValue:!0,filterOption:!1,filterSort:null,fieldNames:i,onSearch:H,onDropdownVisibleChange:K=>{F(K),N.current=null,K&&E(),j.current=!0},objectValue:u,value:l,defaultValue:c},C),{loading:O?U:!0,options:_(M(Y)),rawOptions:Y,dropdownRender:K=>{const J=Y.some(X=>X[i.label]===N.current);return(0,import_jsx_runtime.jsx)(import_jsx_runtime.Fragment,{children:R?(0,import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment,{children:[!((O==null?void 0:O.data.length)===0&&N!=null&&N.current)&&K,(O==null?void 0:O.data.length)>0&&(N==null?void 0:N.current)&&!J&&(0,import_jsx_runtime.jsx)(import_antd.Divider,{style:{margin:0}}),!J&&(0,import_jsx_runtime.jsx)(G,{})]}):K})}}))},(0,import_react.mapProps)({dataSource:"options"},(e,t)=>{var o;const r=(0,import_react.useFieldSchema)();return P(x({},e),{fieldNames:x(x(x(x({},defaultFieldNames$1),e.fieldNames),t.componentProps.fieldNames),(o=r["x-component-props"])==null?void 0:o.fieldNames),suffixIcon:t!=null&&t.loading||t!=null&&t.validating?(0,import_jsx_runtime.jsx)(import_icons.LoadingOutlined,{}):e.suffixIcon})}),(0,import_react.mapReadPretty)(ReadPretty$a))),RemoteSelect=InternalRemoteSelect;RemoteSelect.ReadPretty=ReadPretty$a;const useFormDataTemplates=()=>{const e=(0,import_react.useFieldSchema)(),{t}=(0,import_react_i18next.useTranslation)(),{duplicateData:o}=useFormBlockContext(),{getCollectionJoinField:r}=useCollectionManager_deprecated();if(o)return o;const{items:i=[],display:n=!0}=findDataTemplates(e);i.forEach(c=>{var u;try{c.fields=(u=c.fields)==null?void 0:u.map(d=>r(`${c.collection}.${d}`)?d:"").filter(Boolean)}catch(d){(0,import_client.error)(d),c.fields=[]}});const a=[{key:"none",title:t("None")}].concat(i.map((c,u)=>P(x({key:u},c),{isLeaf:c.dataId!==null&&c.dataId!==void 0,titleCollectionField:(c==null?void 0:c.titleField)&&r(`${c.collection}.${c.titleField}`)}))),l=i.find(c=>c.default);return{templates:a,display:n,defaultTemplate:l,enabled:i.length>0&&i.every(c=>c.dataId||c.dataScope)}},Templates=import_react2.default.memo(({style:e={},form:t})=>{const{token:o}=useToken(),{templates:r,display:i,enabled:n,defaultTemplate:a}=useFormDataTemplates(),{getCollectionJoinField:l}=useCollectionManager_deprecated(),c=compatibleDataId(r),[u,d]=(0,import_react2.useState)((a==null?void 0:a.key)||"none"),[m,p]=(0,import_react2.useState)(null),g=useAPIClient(),{t:h}=(0,import_react_i18next.useTranslation)(),f=useDataSourceKey(),_=useDataSourceHeaders(f);(0,import_react2.useEffect)(()=>{n&&a&&t&&(t.__template=!0,a.key==="duplicate"&&b(a.dataId,a,_))},[]),(0,import_react2.useEffect)(()=>{c!=null&&c.some(F=>F.key===u)||S("none")},[c]);const v=(0,import_react2.useMemo)(()=>x({display:"flex",alignItems:"center",backgroundColor:o.colorFillAlter,padding:o.padding},e),[e,o.colorFillAlter]),C=(0,import_react2.useMemo)(()=>({fontSize:o.fontSize,fontWeight:"bold",whiteSpace:"nowrap",marginRight:o.marginXS}),[o.fontSize,o.marginXS]),S=(0,import_react2.useCallback)(F=>q(void 0,null,function*(){d(F),p(null),t==null||t.reset()}),[]),b=(0,import_react2.useCallback)((F,j,k)=>q(void 0,null,function*(){const R=P(x({},j),{dataId:F});p(j),fetchTemplateData(g,R,k).then(z=>(t&&z&&(t.reset(),t.__template=!0,(0,import_client.forEach)(z,(N,L)=>{var D;N&&(t.values[L]=N,(D=t==null?void 0:t.setInitialValuesIn)==null||D.call(t,L,N))})),z)).catch(z=>{console.error(z)})}),[]);if(!n||!i)return null;const y=c==null?void 0:c.find(F=>F.key===u);return(0,import_jsx_runtime.jsx)("div",{style:v,children:(0,import_jsx_runtime.jsxs)(import_antd.Space,{wrap:!0,children:[(0,import_jsx_runtime.jsxs)("label",{style:C,children:[h("Data template"),": "]}),(0,import_jsx_runtime.jsx)(import_antd.Select,{role:"button","data-testid":"select-form-data-template",popupMatchSelectWidth:!1,options:c,fieldNames:{label:"title",value:"key"},value:u,onChange:S}),u!=="none"&&y&&(0,import_jsx_runtime.jsx)(RemoteSelect,{style:{width:220},fieldNames:{label:y==null?void 0:y.titleField,value:"id"},target:y==null?void 0:y.collection,value:m,objectValue:!0,service:{resource:y==null?void 0:y.collection,params:{filter:y==null?void 0:y.dataScope}},onChange:F=>b(F==null?void 0:F.id,x(x({},F),y),_),targetField:l(`${y==null?void 0:y.collection}.${y.titleField}`)})]})})});Templates.displayName="NocoBaseFormDataTemplates";function findDataTemplates(e){const t=findFormBlock(e);return t?import_lodash.default.cloneDeep(t["x-data-templates"])||{}:{}}function fetchTemplateData(e,t,o){return q(this,null,function*(){if(!(t.fields.length===0||!t.dataId))return e.resource(t.collection,void 0,o).get({filterByTk:t.dataId,fields:t.fields,isTemplate:!0}).then(r=>{var i;return(i=r.data)==null?void 0:i.data})})}const useFormBlockHeight=()=>{var e,t,o;const r=useDataBlockHeight(),i=(0,import_react.useFieldSchema)(),{token:n}=import_antd.theme.useToken(),{designable:a}=useDesignable(),{heightProps:l}=useBlockHeightProps()||{},{title:c}=l||{},{display:u,enabled:d}=useFormDataTemplates(),m=i.reduceProperties((y,F)=>F["x-component"]==="ActionBar"?F:y),p=Object.keys((m==null?void 0:m.properties)||{}).length>0,g=(o=(t=(e=i==null?void 0:i.parent)==null?void 0:e["x-decorator"])==null?void 0:t.includes)==null?void 0:o.call(t,"FormBlockProvider"),h=p||a?n.controlHeight+(g?1:2)*n.marginLG:n.marginLG,f=c?n.fontSizeLG*n.lineHeightLG+n.padding*2-1:0,_=useDataBlockRequestData(),{count:v,pageSize:C}=(_==null?void 0:_.meta)||{},S=v>C?n.controlHeightSM+1*n.paddingLG:0,b=u&&d?n.controlHeight+2*n.padding+n.margin:0;return r-h-n.paddingLG-f-S-b},FormComponent=e=>{const t=e,{form:o,children:r}=t,i=W(t,["form","children"]),n=(0,import_react.useField)(),a=(0,import_react.useFieldSchema)(),l=getCardItemSchema==null?void 0:getCardItemSchema(a),c=useAttach(o.createVoidField(P(x({},n.props),{basePath:""}))),u=useFormBlockHeight(),{token:d}=import_antd.theme.useToken(),{layout:m="vertical",labelAlign:p="left",labelWidth:g=120,labelWrap:h=!0}=(l==null?void 0:l["x-component-props"])||{};return(0,import_jsx_runtime.jsx)(import_react.FieldContext.Provider,{value:void 0,children:(0,import_jsx_runtime.jsx)(import_react.FormContext.Provider,{value:o,children:(0,import_jsx_runtime.jsx)(import_antd_v5.FormLayout,P(x({layout:m},i),{labelAlign:p,labelWidth:m==="horizontal"?g:null,labelWrap:h,children:(0,import_jsx_runtime.jsx)("div",{className:import_css.css`
|
|
598
|
+
`,TableColumnActionBar=(0,import_react.observer)(e=>{const t=useDesigner();return(0,import_jsx_runtime.jsxs)(SortableItem,{className:designerCss$3,children:[(0,import_jsx_runtime.jsx)(t,{}),e.children]})},{displayName:"TableColumnActionBar"}),useColumnSchema=()=>{const{getField:e}=useCollection_deprecated(),t=useCompile(),o=(0,import_react.useFieldSchema)(),r=o.reduceProperties((n,a)=>a["x-component"]==="CollectionField"?a:n,null);if(!r)return{};const i=e(r.name);return{columnSchema:o,fieldSchema:r,collectionField:i,uiSchema:t(i==null?void 0:i.uiSchema)}},TableColumnDecorator=e=>{const t=useDesigner(),o=(0,import_react.useField)(),{fieldSchema:r,uiSchema:i,collectionField:n}=useColumnSchema(),a=useCompile();return(0,import_react2.useEffect)(()=>{o.title||r&&i!=null&&i.title&&(o.title=i==null?void 0:i.title)},[i==null?void 0:i.title]),(0,import_jsx_runtime.jsxs)(SortableItem,{className:designerCss$3,children:[(0,import_jsx_runtime.jsx)(t,{fieldSchema:r,uiSchema:i,collectionField:n}),o.title||a(i==null?void 0:i.title)]})},previewComponentFieldSettings=new SchemaSettings({name:"fieldSettings:component:Preview",items:[{name:"size",type:"select",useVisible(){var e;const{fieldSchema:t}=useColumnSchema();return((e=t==null?void 0:t.parent)==null?void 0:e["x-component"])!=="TableV2.Column"},useComponentProps(){var e;const{t}=(0,import_react_i18next.useTranslation)(),o=(0,import_react.useField)(),r=(0,import_react.useFieldSchema)(),{dn:i}=useDesignable();return{title:t("Size"),options:[{label:t("Large"),value:"large"},{label:t("Default"),value:"default"},{label:t("Small"),value:"small"}],value:((e=o==null?void 0:o.componentProps)==null?void 0:e.size)||"default",onChange(n){const a={"x-uid":r["x-uid"]};r["x-component-props"]=r["x-component-props"]||{},r["x-component-props"].size=n,a["x-component-props"]=r["x-component-props"],o.componentProps=o.componentProps||{},o.componentProps.size=n,i.emit("patch",{schema:a}),i.refresh()}}}}]}),uploadAttachmentComponentFieldSettings=new SchemaSettings({name:"fieldSettings:component:Upload.Attachment",items:[{name:"size",type:"select",useVisible(){var e;const{fieldSchema:t}=useColumnSchema$1(),o=((e=t==null?void 0:t.parent)==null?void 0:e["x-component"])==="TableV2.Column";return useIsFieldReadPretty()&&!o},useComponentProps(){var e;const{t}=(0,import_react_i18next.useTranslation)(),o=(0,import_react.useField)(),r=(0,import_react.useFieldSchema)(),{dn:i}=useDesignable();return{title:t("Size"),options:[{label:t("Large"),value:"large"},{label:t("Default"),value:"default"},{label:t("Small"),value:"small"}],value:((e=o==null?void 0:o.componentProps)==null?void 0:e.size)||"default",onChange(n){const a={"x-uid":r["x-uid"]};r["x-component-props"]=r["x-component-props"]||{},r["x-component-props"].size=n,a["x-component-props"]=r["x-component-props"],o.componentProps=o.componentProps||{},o.componentProps.size=n,i.emit("patch",{schema:a}),i.refresh()}}}}]}),inputJSONSettings=new SchemaSettings({name:"fieldSettings:component:Input.JSON",items:[ellipsisSettingsItem]}),createSettingsItem=e=>({name:e.name,type:"select",useComponentProps(){var t;const{t:o}=(0,import_react_i18next.useTranslation)(),r=(0,import_react.useField)(),i=(0,import_react.useFieldSchema)(),{fieldSchema:n}=useColumnSchema$1(),a=n||i,{dn:l}=useDesignable();return{title:o(e.title),options:e.options(o),value:((t=a["x-component-props"])==null?void 0:t[e.name])||e.defaultValue,onChange(c){const u={"x-uid":a["x-uid"]};a["x-component-props"]=a["x-component-props"]||{},a["x-component-props"][e.name]=c,u["x-component-props"]=a["x-component-props"],r.componentProps=r.componentProps||{},r.componentProps[e.name]=c,l.emit("patch",{schema:u})}}}}),getSizeOptions=e=>[{value:"small",label:e("Small")},{value:"middle",label:e("Middle")},{value:"large",label:e("Large")},{value:"oversized",label:e("Oversized")},{value:"auto",label:e("Auto")}],getObjectFitOptions=e=>[{value:"cover",label:e("Cover")},{value:"fill",label:e("Fill")},{value:"contain",label:e("Contain")},{value:"scale-down",label:e("Scale Down")},{value:"none",label:e("None")}],size=createSettingsItem({name:"size",title:"Size",options:getSizeOptions,defaultValue:"small"}),objectFit=createSettingsItem({name:"objectFit",title:"Object Fit",options:getObjectFitOptions,defaultValue:"cover"}),inputPreviewComponentFieldSettings=new SchemaSettings({name:"fieldSettings:component:Input.Preview",items:[size,objectFit]}),inputTextAreaSettings=new SchemaSettings({name:"fieldSettings:component:Input.TextArea",items:[ellipsisSettingsItem]}),inputURLSettings=new SchemaSettings({name:"fieldSettings:component:Input.URL",items:[ellipsisSettingsItem]}),markdownSettings=new SchemaSettings({name:"fieldSettings:component:Markdown",items:[ellipsisSettingsItem]}),markdownVditorSettings=new SchemaSettings({name:"fieldSettings:component:MarkdownVditor",items:[ellipsisSettingsItem]}),richTextSettings=new SchemaSettings({name:"fieldSettings:component:RichText",items:[ellipsisSettingsItem]}),inputNumberComponentFieldSettings=new SchemaSettings({name:"fieldSettings:component:InputNumber",items:[{name:"displayFormat",Component:SchemaSettingsNumberFormat,useComponentProps(){const e=(0,import_react.useFieldSchema)(),{fieldSchema:t}=useColumnSchema$1();return{fieldSchema:t||e}},useVisible(){return useIsFieldReadPretty()}},enableLinkSettingsItem,openModeSettingsItem]}),filterFormItemSettings=new SchemaSettings({name:"FilterFormItemSettings",items:[{name:"editFieldTitle",Component:EditTitle},{name:"editDescription",Component:EditDescription},{name:"editTooltip",Component:EditTooltip},{name:"validationRules",Component:EditValidationRules},{name:"setDataScope",Component:SchemaSettingsDataScope,useVisible(){const e=useIsSelectFieldMode(),t=useIsFormReadPretty();return e&&!t},useComponentProps(){var e,t,o;const{getCollectionJoinField:r,getAllCollectionsInheritChain:i}=useCollectionManager_deprecated(),{getField:n}=useCollection_deprecated(),{form:a}=useFormBlockContext(),l=useRecord(),c=(0,import_react.useField)(),u=(0,import_react.useFieldSchema)(),d=n(u.name)||r(u["x-collection-field"]),m=useVariables$1(),p=useLocalVariables$1(),{dn:g}=useDesignable();return{collectionName:d==null?void 0:d.target,defaultFilter:((o=(t=(e=u==null?void 0:u["x-component-props"])==null?void 0:e.service)==null?void 0:t.params)==null?void 0:o.filter)||{},form:a,dynamicComponent:h=>(0,import_jsx_runtime.jsx)(VariableInput,P(x({},h),{form:a,collectionField:h.collectionField,record:l,shouldChange:getShouldChange({collectionField:h.collectionField,variables:m,localVariables:p,getAllCollectionsInheritChain:i})})),onSubmit:({filter:h})=>{h=removeNullCondition(h),import_lodash.default.set(c.componentProps,"service.params.filter",h),u["x-component-props"]=c.componentProps,g.emit("patch",{schema:{"x-uid":u["x-uid"],"x-component-props":c.componentProps}})}}}},{name:"fieldMode",Component:EditComponent},{name:"operator",Component:EditOperator},{name:"titleField",Component:EditTitleField},{name:"divider",type:"divider",useVisible(){const{getCollectionJoinField:e}=useCollectionManager_deprecated(),{getField:t}=useCollection_deprecated(),o=(0,import_react.useFieldSchema)();return!!(t(o.name)||e(o["x-collection-field"]))}},{name:"remove",type:"remove",useComponentProps(){const{t:e}=(0,import_react_i18next.useTranslation)();return{removeParentsIfNoChildren:!0,confirm:{title:e("Delete field")},breakRemoveOn:{"x-component":"Grid"}}}}]}),fieldComponent$4={name:"fieldComponent",type:"select",useComponentProps(){const{t:e}=(0,import_react_i18next.useTranslation)(),t=(0,import_react.useField)(),o=(0,import_react.useFieldSchema)(),r=useFieldModeOptions(),i=useIsAddNewForm(),n=useFieldComponentName(),{dn:a}=useDesignable();return{title:e("Field component"),options:r,value:n,onChange(l){const c={"x-uid":o["x-uid"]};o["x-component-props"]=o["x-component-props"]||{},o["x-component-props"].mode=l,c["x-component-props"]=o["x-component-props"],t.componentProps=t.componentProps||{},t.componentProps.mode=l,isSubMode(o)&&i&&(c.default=null,o.default=null,t.setInitialValue(null),t.setValue(null)),a.emit("patch",{schema:c}),a.refresh()}}}},allowSelectExistingRecord={name:"allowSelectExistingRecord",type:"switch",useVisible(){return!useIsFieldReadPretty()},useComponentProps(){var e;const{t}=(0,import_react_i18next.useTranslation)(),o=(0,import_react.useField)(),r=(0,import_react.useFieldSchema)(),{dn:i,refresh:n}=useDesignable();return{title:t("Allow selection of existing records"),checked:(e=r["x-component-props"])==null?void 0:e.allowSelectExistingRecord,onChange(a){const l={"x-uid":r["x-uid"]};o.componentProps.allowSelectExistingRecord=a,r["x-component-props"]=r["x-component-props"]||{},r["x-component-props"].allowSelectExistingRecord=a,l["x-component-props"]=r["x-component-props"],i.emit("patch",{schema:l}),n()}}}},allowDisassociation={name:"allowDisassociation",type:"switch",useVisible(){return!useIsFieldReadPretty()},useComponentProps(){var e;const{t}=(0,import_react_i18next.useTranslation)(),o=(0,import_react.useField)(),r=(0,import_react.useFieldSchema)(),{dn:i,refresh:n}=useDesignable();return{title:t("Allow disassociation"),checked:((e=r["x-component-props"])==null?void 0:e.allowDisassociation)!==!1,onChange(a){const l={"x-uid":r["x-uid"]};o.componentProps.allowDisassociation=a,r["x-component-props"]=r["x-component-props"]||{},r["x-component-props"].allowDisassociation=a,l["x-component-props"]=r["x-component-props"],i.emit("patch",{schema:l}),n()}}}},setDefaultSortingRules={name:"SetDefaultSortingRules",type:"modal",useComponentProps(){const{getCollectionJoinField:e}=useCollectionManager_deprecated(),t=(0,import_react.useField)(),o=(0,import_react.useFieldSchema)(),r=o["x-collection-field"],{target:i}=e(r)||{},n=useSortFields(i),{t:a}=(0,import_react_i18next.useTranslation)(),{dn:l}=useDesignable(),c=t.componentProps.sortArr||[],u=c==null?void 0:c.map(d=>d!=null&&d.startsWith("-")?{field:d.substring(1),direction:"desc"}:{field:d,direction:"asc"});return{title:a("Set default sorting rules"),components:{ArrayItems:import_antd_v5.ArrayItems},schema:{type:"object",title:a("Set default sorting rules"),properties:{sort:{type:"array",default:u,"x-component":"ArrayItems","x-decorator":"FormItem",items:{type:"object",properties:{space:{type:"void","x-component":"Space",properties:{sort:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.SortHandle"},field:{type:"string",enum:n,required:!0,"x-decorator":"FormItem","x-component":"Select","x-component-props":{style:{width:260}}},direction:{type:"string","x-decorator":"FormItem","x-component":"Radio.Group","x-component-props":{optionType:"button"},enum:[{label:a("ASC"),value:"asc"},{label:a("DESC"),value:"desc"}]},remove:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.Remove"}}}}},properties:{add:{type:"void",title:a("Add sort field"),"x-component":"ArrayItems.Addition"}}}}},onSubmit:({sort:d})=>{const m=d.map(p=>p.direction==="desc"?`-${p.field}`:p.field);t.componentProps.sortArr=m,o["x-component-props"].sortArr=m,l.emit("patch",{schema:{"x-uid":o["x-uid"],"x-component-props":o["x-component-props"]}})}}},useVisible(){const{getCollectionJoinField:e}=useCollectionManager_deprecated(),t=(0,import_react.useFieldSchema)()["x-collection-field"],{interface:o}=e(t)||{};return useIsFieldReadPretty()&&["m2m","o2m"].includes(o)}},allowAddNewData={name:"allowAddNewData",type:"switch",useVisible(){const e=useIsFieldReadPretty(),t=useIsAssociationField();return!e&&t},useComponentProps(){var e;const{t}=(0,import_react_i18next.useTranslation)(),o=(0,import_react.useField)(),r=(0,import_react.useFieldSchema)(),{dn:i,refresh:n}=useDesignable();return{title:t("Allow add new"),checked:((e=r["x-component-props"])==null?void 0:e.allowAddnew)!==!1,onChange(a){const l={"x-uid":r["x-uid"]};o.componentProps.allowAddnew=a,r["x-component-props"]=r["x-component-props"]||{},r["x-component-props"].allowAddnew=a,l["x-component-props"]=r["x-component-props"],i.emit("patch",{schema:l}),n()}}}},LinkageRulesComponent=withDynamicSchemaProps(e=>(0,import_jsx_runtime.jsx)(FlagProvider,{isInSubForm:!0,children:(0,import_jsx_runtime.jsx)(FormLinkageRules,x({},e))}),{displayName:"LinkageRulesComponent"}),linkageRules={name:"linkageRules",Component:SchemaSettingsLinkageRules,useComponentProps(){const e=(0,import_react.useField)(),t=(0,import_react.useFieldSchema)(),o=useCollectionManager().getCollectionField(t["x-collection-field"]),{rerenderDataBlock:r}=useRerenderDataBlock();return{collectionName:o==null?void 0:o.target,Component:LinkageRulesComponent,readPretty:e.readPretty,afterSubmit:r}}},recordPerPage={name:"recordsPerPage",type:"select",useComponentProps(){var e;const{t}=(0,import_react_i18next.useTranslation)(),o=(0,import_react.useFieldSchema)(),r=(0,import_react.useField)(),{dn:i}=useDesignable(),n=[10,20,50,100];return{title:t("Records per page"),value:((e=r.componentProps)==null?void 0:e.pageSize)||10,options:n.map(a=>({value:a})),onChange:a=>{const l={"x-uid":o["x-uid"]};r.componentProps=r.componentProps||{},r.componentProps.pageSize=a,o["x-component-props"]=o["x-component-props"]||{},o["x-component-props"].pageSize=a,l["x-component-props"]=o["x-component-props"],i.emit("patch",{schema:l})}}}},subTablePopoverComponentFieldSettings=new SchemaSettings({name:"fieldSettings:component:SubTable",items:[fieldComponent$4,allowAddNewData,allowSelectExistingRecord,allowDisassociation,setDefaultSortingRules,linkageRules,recordPerPage]}),allowMultiple$2={name:"allowMultiple",type:"switch",useVisible(){const e=useIsFieldReadPretty(),t=useCollectionField();return!e&&["hasMany","belongsToMany"].includes(t==null?void 0:t.type)},useComponentProps(){var e;const{t}=(0,import_react_i18next.useTranslation)(),o=(0,import_react.useField)(),r=(0,import_react.useFieldSchema)(),{dn:i,refresh:n}=useDesignable();return{title:t("Allow multiple"),checked:((e=r["x-component-props"])==null?void 0:e.multiple)===void 0?!0:r["x-component-props"].multiple,onChange(a){const l={"x-uid":r["x-uid"]};r["x-component-props"]=r["x-component-props"]||{},o.componentProps=o.componentProps||{},r["x-component-props"].multiple=a,o.componentProps.multiple=a,l["x-component-props"]=r["x-component-props"],i.emit("patch",{schema:l}),n()}}}},fieldComponent$3={name:"fieldComponent",type:"select",useComponentProps(){const{t:e}=(0,import_react_i18next.useTranslation)(),t=(0,import_react.useField)(),o=(0,import_react.useFieldSchema)(),r=useFieldModeOptions(),i=useIsAddNewForm(),n=useFieldComponentName(),{dn:a}=useDesignable();return{title:e("Field component"),options:r,value:n,onChange(l){const c={"x-uid":o["x-uid"]};o["x-component-props"]=o["x-component-props"]||{},o["x-component-props"].mode=l,c["x-component-props"]=o["x-component-props"],t.componentProps=t.componentProps||{},t.componentProps.mode=l,isSubMode(o)&&i&&(c.default=null,o.default=null,t.setInitialValue(null),t.setValue(null)),a.emit("patch",{schema:c}),a.refresh()}}}},subformComponentFieldSettings=new SchemaSettings({name:"fieldSettings:component:Nester",items:[fieldComponent$3,allowMultiple$2,{name:"allowDissociate",type:"switch",useVisible(){const{type:e}=useFormBlockType();return!useIsFormReadPretty()&&e==="update"},useComponentProps(){var e;const{t}=(0,import_react_i18next.useTranslation)(),o=(0,import_react.useField)(),r=(0,import_react.useFieldSchema)(),{dn:i,refresh:n}=useDesignable();return{title:t("Allow dissociate"),checked:((e=r["x-component-props"])==null?void 0:e.allowDissociate)!==!1,onChange(a){const l={"x-uid":r["x-uid"]};r["x-component-props"]=r["x-component-props"]||{},o.componentProps=o.componentProps||{},r["x-component-props"].allowDissociate=a,o.componentProps.allowDissociate=a,l["x-component-props"]=r["x-component-props"],i.emit("patch",{schema:l}),n()}}}},setDefaultSortingRules,linkageRules,{name:"setBlockLayout",Component:SchemaSettingsLayoutItem}]}),allowMultiple$1={name:"allowMultiple",type:"switch",useVisible(){const e=useIsFieldReadPretty(),t=useCollectionField();return!e&&["hasMany","belongsToMany","belongsToArray"].includes(t==null?void 0:t.type)},useComponentProps(){var e;const{t}=(0,import_react_i18next.useTranslation)(),o=(0,import_react.useField)(),r=(0,import_react.useFieldSchema)(),{dn:i,refresh:n}=useDesignable();return{title:t("Allow multiple"),checked:((e=r["x-component-props"])==null?void 0:e.multiple)===void 0?!0:r["x-component-props"].multiple,onChange(a){const l={"x-uid":r["x-uid"]};r["x-component-props"]=r["x-component-props"]||{},o.componentProps=o.componentProps||{},r["x-component-props"].multiple=a,o.componentProps.multiple=a,l["x-component-props"]=r["x-component-props"],i.emit("patch",{schema:l}),n()}}}},fieldComponent$2={name:"fieldComponent",type:"select",useComponentProps(){const{t:e}=(0,import_react_i18next.useTranslation)(),t=(0,import_react.useField)(),o=useIsAddNewForm(),r=useFieldComponentName(),{fieldSchema:i,collectionField:n}=useColumnSchema$1(),a=(0,import_react.useFieldSchema)(),l=i||a,c=useFieldModeOptions({fieldSchema:i,collectionField:n}),{dn:u}=useDesignable();return{title:e("Field component"),options:c,value:r,onChange(d){var m,p;const g={"x-uid":l["x-uid"]};l["x-component-props"]=l["x-component-props"]||{},l["x-component-props"].mode=d,g["x-component-props"]=l["x-component-props"],t.componentProps=t.componentProps||{},t.componentProps.mode=d,isSubMode(l)&&o&&(g.default=null,l.default=null,(m=t==null?void 0:t.setInitialValue)==null||m.call(t,null),(p=t==null?void 0:t.setValue)==null||p.call(t,null)),u.emit("patch",{schema:g}),u.refresh()}}}},recordPickerComponentFieldSettings=new SchemaSettings({name:"fieldSettings:component:Picker",items:[fieldComponent$2,{name:"popupSize",type:"select",useVisible(){return!useIsFieldReadPretty()},useComponentProps(){var e,t,o;const{t:r}=(0,import_react_i18next.useTranslation)(),i=(0,import_react.useField)(),{fieldSchema:n}=useColumnSchema$1(),a=(0,import_react.useFieldSchema)(),l=n||a,{dn:c}=useDesignable();return{title:r("Popup size"),options:[{label:r("Small"),value:"small"},{label:r("Middle"),value:"middle"},{label:r("Large"),value:"large"}],value:(o=(e=l==null?void 0:l["x-component-props"])==null?void 0:e.openSize)!=null?o:((t=l==null?void 0:l["x-component-props"])==null?void 0:t.openMode)=="modal"?"large":"middle",onChange:u=>{i.componentProps.openSize=u,l["x-component-props"]=P(x({},l["x-component-props"]),{openSize:u}),c.emit("patch",{schema:{"x-uid":l["x-uid"],"x-component-props":l["x-component-props"]}}),c.refresh()}}}},allowAddNew,allowMultiple$1,titleField$1]}),allowMultiple={name:"allowMultiple",type:"switch",useVisible(){const e=useIsFieldReadPretty(),t=useCollectionField();return!e&&["hasMany","belongsToMany"].includes(t==null?void 0:t.type)},useComponentProps(){var e;const{t}=(0,import_react_i18next.useTranslation)(),o=(0,import_react.useField)(),r=(0,import_react.useFieldSchema)(),{dn:i,refresh:n}=useDesignable();return{title:t("Allow multiple"),checked:((e=r["x-component-props"])==null?void 0:e.multiple)===void 0?!0:r["x-component-props"].multiple,onChange(a){const l={"x-uid":r["x-uid"]};r["x-component-props"]=r["x-component-props"]||{},o.componentProps=o.componentProps||{},r["x-component-props"].multiple=a,o.componentProps.multiple=a,l["x-component-props"]=r["x-component-props"],i.emit("patch",{schema:l}),n()}}}},fieldComponent$1={name:"fieldComponent",type:"select",useComponentProps(){const{t:e}=(0,import_react_i18next.useTranslation)(),t=(0,import_react.useField)(),{fieldSchema:o,collectionField:r}=useColumnSchema$1(),i=(0,import_react.useFieldSchema)(),n=o||i,a=useFieldModeOptions({fieldSchema:o,collectionField:r}),{dn:l}=useDesignable(),c=useIsAddNewForm(),u=useFieldComponentName();return{title:e("Field component"),options:a,value:u,onChange(d){const m={"x-uid":n["x-uid"]};n["x-component-props"]=n["x-component-props"]||{},n["x-component-props"].mode=d,m["x-component-props"]=n["x-component-props"],t.componentProps=t.componentProps||{},t.componentProps.mode=d,isSubMode(n)&&c&&(m.default=null,n.default=null,t.setInitialValue(null),t.setValue(null)),l.emit("patch",{schema:m}),l.refresh()}}}},subformPopoverComponentFieldSettings=new SchemaSettings({name:"fieldSettings:component:PopoverNester",items:[fieldComponent$1,allowMultiple,titleField$1,linkageRules,{name:"setBlockLayout",Component:SchemaSettingsLayoutItem}]}),enableLink={name:"enableLink",type:"switch",useComponentProps(){var e;const{t}=(0,import_react_i18next.useTranslation)(),o=(0,import_react.useField)(),{fieldSchema:r}=useColumnSchema$1(),i=(0,import_react.useFieldSchema)(),n=r||i,{dn:a}=useDesignable();return{title:t("Enable link"),checked:((e=n["x-component-props"])==null?void 0:e.enableLink)!==!1,onChange(l){n["x-component-props"]=P(x({},n==null?void 0:n["x-component-props"]),{enableLink:l}),o.componentProps.enableLink=l,a.emit("patch",{schema:{"x-uid":n["x-uid"],"x-component-props":x({},n==null?void 0:n["x-component-props"])}})}}}},titleField={name:"titleField",type:"select",useComponentProps(){var e,t;const{t:o}=(0,import_react_i18next.useTranslation)(),r=(0,import_react.useField)(),{fieldSchema:i,collectionField:n}=useColumnSchema$1(),a=(0,import_react.useFieldSchema)(),l=i||a,c=useTitleFieldOptions(),u=useCollectionField(),d=n||u,{dn:m}=useDesignable();return{title:o("Title field"),options:c,value:(t=(e=l==null?void 0:l["x-component-props"])==null?void 0:e.fieldNames)==null?void 0:t.label,onChange(p){var g,h;const f={"x-uid":l["x-uid"]},_=P(x(x({},(h=(g=d==null?void 0:d.uiSchema)==null?void 0:g["x-component-props"])==null?void 0:h.fieldNames),r.componentProps.fieldNames),{label:p});l["x-component-props"]=l["x-component-props"]||{},l["x-component-props"].fieldNames=_,f["x-component-props"]=l["x-component-props"],r.componentProps.fieldNames=l["x-component-props"].fieldNames,m.emit("patch",{schema:f}),m.refresh()}}}},fieldComponent={name:"fieldComponent",type:"select",useComponentProps(){const{t:e}=(0,import_react_i18next.useTranslation)(),t=(0,import_react.useField)(),o=useIsAddNewForm(),{fieldSchema:r,collectionField:i}=useColumnSchema$1(),n=useFieldModeOptions({fieldSchema:r,collectionField:i}),a=(0,import_react.useFieldSchema)(),l=r||a,c=useFieldComponentName(),{dn:u}=useDesignable();return{title:e("Field component"),options:n,value:c,onChange(d){const m={"x-uid":l["x-uid"]};l["x-component-props"]=l["x-component-props"]||{},l["x-component-props"].mode=d,m["x-component-props"]=l["x-component-props"],t.componentProps=t.componentProps||{},t.componentProps.mode=d,isSubMode(l)&&o&&(m.default=null,l.default=null,t.setInitialValue(null),t.setValue(null)),u.emit("patch",{schema:m}),u.refresh()}}}},tagComponentFieldSettings=new SchemaSettings({name:"fieldSettings:component:Tag",items:[fieldComponent,{name:"tagColorField",type:"select",useComponentProps(){var e,t;const{t:o}=(0,import_react_i18next.useTranslation)(),r=(0,import_react.useField)(),i=(0,import_react.useFieldSchema)(),n=useCollectionField(),{fieldSchema:a,collectionField:l}=useColumnSchema$1(),c=a||i,u=l||n,{dn:d}=useDesignable(),m=useColorFields((e=u==null?void 0:u.target)!=null?e:u==null?void 0:u.targetCollection);return{title:o("Tag color field"),options:m,value:(t=c==null?void 0:c["x-component-props"])==null?void 0:t.tagColorField,onChange(p){const g={"x-uid":c["x-uid"]};c["x-component-props"]=c["x-component-props"]||{},c["x-component-props"].tagColorField=p,g["x-component-props"]=c["x-component-props"],r.componentProps.tagColorField=p,d.emit("patch",{schema:g}),d.refresh()}}}},titleField,enableLink,ellipsisSettingsItem]}),unixTimestampComponentFieldSettings=new SchemaSettings({name:"fieldSettings:component:UnixTimestamp",items:[{name:"dateDisplayFormat",Component:SchemaSettingsDateFormat,useComponentProps(){const e=(0,import_react.useFieldSchema)(),{fieldSchema:t}=useColumnSchema$1();return{fieldSchema:t||e}}},enableLinkSettingsItem,openModeSettingsItem]});function GroupTitleEditor(e){const t=(0,import_react.useField)(),o=(0,import_react.useFieldSchema)(),{dn:r}=useDesignable(),{t:i}=(0,import_react_i18next.useTranslation)();return(0,import_jsx_runtime.jsx)(SchemaSettingsModalItem,{title:i("Edit group title"),schema:{type:"object",title:i("Edit group title"),properties:{children:{"x-decorator":"FormItem","x-component":"Input",title:i("Group title"),default:t.componentProps.children,"x-component-props":{}}}},onSubmit:({children:n})=>{t.componentProps.children=n,o["x-component-props"]=o["x-component-props"]||{},o["x-component-props"].children=n,r.emit("patch",{schema:{"x-uid":o["x-uid"],"x-component-props":x({},o["x-component-props"])}}),r.refresh()}})}const dividerSettings=new SchemaSettings({name:"blockSettings:divider",items:[{name:"editTitle",type:"item",Component:GroupTitleEditor},{name:"orientation",type:"select",useComponentProps(){var e;const t=(0,import_react.useField)(),o=(0,import_react.useFieldSchema)(),{t:r}=(0,import_react_i18next.useTranslation)(),{dn:i}=useDesignable();return{title:r("Title position"),value:((e=t.componentProps)==null?void 0:e.orientation)||"left",options:[{label:r("Left"),value:"left"},{label:r("Center"),value:"center"},{label:r("Right"),value:"right"}],onChange:n=>{t.componentProps=t.componentProps||{},t.componentProps.orientation=n,o["x-component-props"]=o["x-component-props"]||{},o["x-component-props"].orientation=n,i.emit("patch",{schema:{"x-uid":o["x-uid"],"x-component-props":o["x-component-props"]}})}}}},{name:"dashed",type:"switch",useComponentProps:()=>{const e=(0,import_react.useField)(),t=(0,import_react.useFieldSchema)(),{t:o}=(0,import_react_i18next.useTranslation)(),{dn:r}=useDesignable();return{title:o("Dashed"),defaultChecked:!0,checked:e.componentProps.dashed,onChange:i=>{e.componentProps.dashed=i,t["x-component-props"].dashed=i,i===!1&&(t["x-component-props"].dashed=!1),r.emit("patch",{schema:t}),r.refresh()}}}},{name:"color",type:"item",useComponentProps:()=>{const{t:e}=(0,import_react_i18next.useTranslation)(),{dn:t}=useDesignable(),o=(0,import_react.useField)(),r=(0,import_react.useFieldSchema)();return{title:(0,import_jsx_runtime.jsxs)("div",{style:{alignItems:"center",display:"flex",justifyContent:"space-between"},children:[e("Color"),(0,import_jsx_runtime.jsx)("div",{style:{float:"right"},children:(0,import_jsx_runtime.jsx)(ColorPicker,{defaultValue:o.componentProps.color||"rgba(0, 0, 0, 0.88)",onChange:i=>{o.componentProps=o.componentProps||{},o.componentProps.color=i,r["x-component-props"]=r["x-component-props"]||{},r["x-component-props"].color=i,t.emit("patch",{schema:r}),t.refresh()}})})]})}}},{name:"borderColor",type:"item",useComponentProps:()=>{const{t:e}=(0,import_react_i18next.useTranslation)(),{dn:t}=useDesignable(),o=(0,import_react.useField)(),r=(0,import_react.useFieldSchema)();return{title:(0,import_jsx_runtime.jsxs)("div",{style:{alignItems:"center",display:"flex",justifyContent:"space-between"},children:[e("Divider line color"),(0,import_jsx_runtime.jsx)("div",{style:{float:"right"},children:(0,import_jsx_runtime.jsx)(ColorPicker,{defaultValue:o.componentProps.borderColor||"rgba(5, 5, 5, 0.06)",onChange:i=>{o.componentProps=o.componentProps||{},o.componentProps.borderColor=i,r["x-component-props"]=r["x-component-props"]||{},r["x-component-props"].borderColor=i,t.emit("patch",{schema:r}),t.refresh()}})})]})}}},{name:"delete",type:"remove",useComponentProps(){return{removeParentsIfNoChildren:!0,breakRemoveOn:{"x-component":"Grid"}}}}]});class SchemaSettingsPlugin extends Plugin{load(){return q(this,null,function*(){this.schemaSettingsManager.add(tableBlockSettings),this.schemaSettingsManager.add(createFormBlockSettings),this.schemaSettingsManager.add(editFormBlockSettings),this.schemaSettingsManager.add(filterFormBlockSettings),this.schemaSettingsManager.add(filterFormItemFieldSettings),this.schemaSettingsManager.add(multiDataDetailsBlockSettings),this.schemaSettingsManager.add(detailsWithPaginationSettings),this.schemaSettingsManager.add(singleDataDetailsBlockSettings),this.schemaSettingsManager.add(detailsBlockSettings),this.schemaSettingsManager.add(tableSelectorBlockSettings),this.schemaSettingsManager.add(listBlockSettings),this.schemaSettingsManager.add(gridCardBlockSettings),this.schemaSettingsManager.add(filterCollapseBlockSettings),this.schemaSettingsManager.add(markdownBlockSettings),this.schemaSettingsManager.add(addNewActionSettings),this.schemaSettingsManager.add(filterActionSettings),this.schemaSettingsManager.add(refreshActionSettings),this.schemaSettingsManager.add(viewActionSettings),this.schemaSettingsManager.add(editActionSettings),this.schemaSettingsManager.add(deleteActionSettings),this.schemaSettingsManager.add(disassociateActionSettings),this.schemaSettingsManager.add(associateActionSettings),this.schemaSettingsManager.add(bulkDeleteActionSettings),this.schemaSettingsManager.add(customizeAddRecordActionSettings),this.schemaSettingsManager.add(customizePopupActionSettings),this.schemaSettingsManager.add(customizeLinkActionSettings),this.schemaSettingsManager.add(customizeUpdateRecordActionSettings),this.schemaSettingsManager.add(createSubmitActionSettings),this.schemaSettingsManager.add(updateSubmitActionSettings),this.schemaSettingsManager.add(submitActionSettings),this.schemaSettingsManager.add(customizeSaveRecordActionSettings),this.schemaSettingsManager.add(addChildActionSettings),this.schemaSettingsManager.add(expendableActionSettings),this.schemaSettingsManager.add(fieldSettingsFormItem),this.schemaSettingsManager.add(tableColumnSettings),this.schemaSettingsManager.add(filterCollapseItemFieldSettings),this.schemaSettingsManager.add(selectComponentFieldSettings),this.schemaSettingsManager.add(filterSelectComponentFieldSettings),this.schemaSettingsManager.add(recordPickerComponentFieldSettings),this.schemaSettingsManager.add(subformComponentFieldSettings),this.schemaSettingsManager.add(subformPopoverComponentFieldSettings),this.schemaSettingsManager.add(subTablePopoverComponentFieldSettings),this.schemaSettingsManager.add(datePickerComponentFieldSettings),this.schemaSettingsManager.add(rangePickerPickerComponentFieldSettings),this.schemaSettingsManager.add(unixTimestampComponentFieldSettings),this.schemaSettingsManager.add(inputNumberComponentFieldSettings),this.schemaSettingsManager.add(inputComponentSettings),this.schemaSettingsManager.add(inputURLSettings),this.schemaSettingsManager.add(inputTextAreaSettings),this.schemaSettingsManager.add(inputJSONSettings),this.schemaSettingsManager.add(markdownSettings),this.schemaSettingsManager.add(markdownVditorSettings),this.schemaSettingsManager.add(richTextSettings),this.schemaSettingsManager.add(fileManagerComponentFieldSettings),this.schemaSettingsManager.add(tagComponentFieldSettings),this.schemaSettingsManager.add(cascadeSelectComponentFieldSettings),this.schemaSettingsManager.add(inputPreviewComponentFieldSettings),this.schemaSettingsManager.add(uploadAttachmentComponentFieldSettings),this.schemaSettingsManager.add(previewComponentFieldSettings),this.schemaSettingsManager.add(dividerSettings)})}}const useBuiltInVariables=()=>{const{currentUserCtx:e}=useCurrentUserVariable(),{currentRoleCtx:t}=useCurrentRoleVariable(),{apiTokenCtx:o}=useAPITokenVariable(),{datetimeCtx:r}=useDatetimeVariable(),{urlSearchParamsCtx:i,name:n,defaultValue:a}=useURLSearchParamsVariable();return{builtinVariables:(0,import_react2.useMemo)(()=>[{name:"$user",ctx:e,collectionName:"users",dataSource:DEFAULT_DATA_SOURCE_KEY},{name:"$nRole",ctx:t,collectionName:"roles"},{name:"$nToken",ctx:o},{name:"currentUser",ctx:e,collectionName:"users",dataSource:DEFAULT_DATA_SOURCE_KEY},{name:"$nDate",ctx:r},{name:"$date",ctx:r},{name:"$system",ctx:{now:()=>(0,import_client.dayjs)().toISOString()}},{name:"currentTime",ctx:()=>(0,import_client.dayjs)().toISOString()},{name:n,ctx:i,defaultValue:a}],[t,e,r,a,i,n])}},cache=new Map,cacheLazyLoadedValues=(e,t,o)=>{const r=cache.get(e);r?r[t]=o:cache.set(e,{[t]:o})},getCachedLazyLoadedValues=(e,t)=>{const o=cache.get(e);return o==null?void 0:o[t]},filterEmptyValues=e=>Array.isArray(e)?e.filter(t=>t===0||t===!1||t):e,TYPE_TO_ACTION={hasMany:"list?pageSize=9999",belongsTo:"get",hasOne:"get",belongsToMany:"list?pageSize=9999",belongsToArray:"get"},getAction=e=>TYPE_TO_ACTION[e],requested={},hasRequested=e=>!!requested[e],getRequested=e=>requested[e],stashRequested=(e,t)=>{requested[e]=t},clearRequested=e=>{delete requested[e]},uniq=e=>!Array.isArray(e)||!import_lodash.default.isObject(e[0])?e:import_lodash.default.uniqBy(e,t=>"id"in t?t.id:JSON.stringify(t)),VariablesContext=(0,import_react2.createContext)(null);VariablesContext.displayName="VariablesContext";const variablesStore={},getFieldPath=(e,t)=>{let o,r;return{fieldPath:e.split(".").map(i=>t[i]?(o=t[i].dataSource,r=t[i],t[i].collectionName):i).join("."),dataSource:o,variableOption:r}},VariablesProvider=({children:e,filterVariables:t})=>{const o=(0,import_react2.useRef)({}),r=useAPIClient(),{getCollectionJoinField:i,getCollection:n}=useCollectionManager_deprecated(),a=useCompile(),{builtinVariables:l}=useBuiltInVariables(),c=(0,import_react2.useCallback)(_=>{import_lodash.default.isFunction(_)?o.current=_(o.current):o.current=_},[]),u=(0,import_react2.useCallback)((_,v,C)=>q(void 0,null,function*(){var S,b;const y=_.split("."),F=y[0],j=mergeVariableToCollectionNameWithLocalVariables(variablesStore,v);let k=mergeCtxWithLocalVariables(o.current,v);const{fieldPath:R,dataSource:z,variableOption:N}=getFieldPath(F,j);let L=R;const{fieldPath:D}=getFieldPath(_,j),T=y.length===1?N==null?void 0:N.collectionName:(S=i(D,z))==null?void 0:S.target;if(!(F in k))throw new Error(`VariablesProvider: ${F} is not found`);for(let w=0;w<y.length;w++){if(k==null)return{value:k===void 0?N==null?void 0:N.defaultValue:k,dataSource:z,collectionName:T};const A=y[w],B=y.slice(0,w+1).join("."),{fieldPath:M}=getFieldPath(B,j),O=i(M,z),E=(b=n(L,z))==null?void 0:b.getPrimaryKey();if(Array.isArray(k)){const U=k.map(V=>{if(!(C!=null&&C.doNotRequest)&&shouldToRequest(V==null?void 0:V[A],V,B)&&(V==null?void 0:V[E])!=null&&O!=null&&O.target){const G=`/${L}/${V[O.sourceKey||E]}/${A}:${getAction(O.type)}`;if(hasRequested(G))return getRequested(G);const H=r.request({headers:getDataSourceHeaders(z),url:G,params:{appends:C==null?void 0:C.appends}}).then(Y=>{clearRequested(G);const K=Y.data.data;return cacheLazyLoadedValues(V,B,K),K});return stashRequested(G,H),H}return getCachedLazyLoadedValues(V,B)||(V==null?void 0:V[A])});k=removeThroughCollectionFields(import_lodash.default.flatten(yield Promise.all(U)),O)}else if(!(C!=null&&C.doNotRequest)&&shouldToRequest(k[A],k,B)&&k[E]!=null&&O!=null&&O.target){const U=`/${L}/${k[O.sourceKey||E]}/${A}:${getAction(O.type)}`;let V=null;if(hasRequested(U))V=yield getRequested(U);else{const H=r.request({headers:getDataSourceHeaders(z),url:U,params:{appends:C==null?void 0:C.appends}});stashRequested(U,H),V=yield H,clearRequested(U)}const G=V.data.data;getCachedLazyLoadedValues(k,B)||cacheLazyLoadedValues(k,B,G),k=removeThroughCollectionFields(G,O)}else k=removeThroughCollectionFields(getCachedLazyLoadedValues(k,B)||(0,import_client.getValuesByPath)(k,A),O);O!=null&&O.target&&(L=O.target)}const $=a(import_lodash.default.isFunction(k)?k({fieldOperator:C==null?void 0:C.fieldOperator,isParsingVariable:!0}):k);return{value:$===void 0?N.defaultValue:$,dataSource:z,collectionName:T}}),[i]),d=(0,import_react2.useCallback)(_=>{if(!isVariable(`{{${_.name}}}`))throw new Error(`VariablesProvider: ${_.name} is not a valid name`);c(v=>P(x({},v),{[_.name]:_.ctx})),variablesStore[_.name]=P(x({},_),{defaultValue:import_lodash.default.has(_,"defaultValue")?_.defaultValue:null})},[c]),m=(0,import_react2.useCallback)(_=>o.current[_]?x({},variablesStore[_]):null,[]),p=(0,import_react2.useCallback)(_=>{c(v=>{const C=x({},v);return delete C[_],C}),delete variablesStore[_]},[c]),g=(0,import_react2.useCallback)((_,v,C)=>q(void 0,null,function*(){if(!isVariable(_))return _;v&&(v=import_lodash.default.isArray(v)?v:[v]);const S=getPath(_),b=yield u(S,v,C);return P(x({},b),{value:uniq(filterEmptyValues(b.value))})}),[u]),h=(0,import_react2.useCallback)((_,v)=>q(void 0,null,function*(){var C;if(!isVariable(_))throw new Error(`VariablesProvider: ${_} is not a variable string`);v&&(v=import_lodash.default.isArray(v)?v:[v]);const S=mergeVariableToCollectionNameWithLocalVariables(variablesStore,v),b=getPath(_),{fieldPath:y,dataSource:F}=getFieldPath(b,S);let j=i(y,F);return!j&&!b.includes(".")&&(j={target:(C=S[b])==null?void 0:C.collectionName}),j}),[i]);(0,import_react2.useEffect)(()=>{l.forEach(_=>{d(P(x({},_),{defaultValue:import_lodash.default.has(_,"defaultValue")?_.defaultValue:null}))})},[l,d]);const f=(0,import_react2.useMemo)(()=>({ctxRef:o,setCtx:c,parseVariable:g,registerVariable:d,getVariable:m,getCollectionField:h,removeVariable:p,filterVariables:t}),[h,m,g,d,p,c]);return(0,import_jsx_runtime.jsx)(VariablesContext.Provider,{value:f,children:e})};VariablesProvider.displayName="VariablesProvider";const VariablesProvider$1=VariablesProvider;function shouldToRequest(e,t,o){let r=!1;return getCachedLazyLoadedValues(t,o)?!1:((0,import_reactive.untracked)(()=>{if(JSON.stringify(e)==="[{}]"||JSON.stringify(e)==="{}"){r=!0;return}r=import_lodash.default.isEmpty(e)}),r)}function mergeCtxWithLocalVariables(e,t){return e=x({},e),t==null||t.forEach(o=>{e[o.name]=o.ctx}),e}function mergeVariableToCollectionNameWithLocalVariables(e,t){return e=x({},e),t==null||t.forEach(o=>{e[o.name]=P(x({},o),{defaultValue:import_lodash.default.has(o,"defaultValue")?o.defaultValue:null})}),e}function removeThroughCollectionFields(e,t){return!(t!=null&&t.through)||!e?e:Array.isArray(e)?e.map(o=>import_lodash.default.omit(o,t.through)):import_lodash.default.omit(e,t.through)}const mergeChildren=(e,t)=>{if(!(!e&&!t)&&!(0,import_shared.isFn)(e))return(0,import_jsx_runtime.jsxs)(import_react2.Fragment,{children:[e,t]})},isValidComponent=e=>e&&(typeof e=="object"||typeof e=="function"),renderChildren=(e,t,o)=>(0,import_shared.isFn)(e)?e(t,o):e,NocoBaseReactiveInternal=e=>{var t;const o=(0,import_react2.useContext)(import_react.SchemaComponentsContext),r=e.field,i=mergeChildren(renderChildren(e.children,r,r.form),(t=r.content)!=null?t:r.componentProps.children);if(r.display!=="visible")return null;const n=a=>{var l;return isValidComponent(a)?a:(l=import_shared.FormPath.getIn(o,a))!=null?l:a};return(a=>r.decoratorType?import_react2.default.createElement(n(r.decoratorType),r.decoratorProps,a):(0,import_jsx_runtime.jsx)(import_react2.Fragment,{children:a}))(r.componentType?import_react2.default.createElement(n(r.componentType),P(x({},r.componentProps),{value:r.value}),i):i)};NocoBaseReactiveInternal.displayName="NocoBaseReactiveInternal";const NocoBaseReactiveField=NocoBaseReactiveInternal;NocoBaseReactiveField.displayName="NocoBaseReactiveField";function createNocoBaseField(e){return new NocoBaseField$1(e)}let NocoBaseField$1=class{constructor(e){I(this,"props"),I(this,"initialized"),I(this,"loading"),I(this,"validating"),I(this,"submitting"),I(this,"selfModified"),I(this,"active"),I(this,"visited"),I(this,"mounted"),I(this,"unmounted"),I(this,"inputValues"),I(this,"inputValue"),I(this,"feedbacks"),I(this,"title"),I(this,"description"),I(this,"display"),I(this,"pattern"),I(this,"editable"),I(this,"disabled"),I(this,"readOnly"),I(this,"readPretty"),I(this,"visible"),I(this,"hidden"),I(this,"dataSource"),I(this,"validator"),I(this,"required"),I(this,"content"),I(this,"initialValue"),I(this,"value"),I(this,"data"),I(this,"decorator"),I(this,"component"),I(this,"decoratorProps"),I(this,"componentProps"),I(this,"decoratorType"),I(this,"componentType"),I(this,"path"),I(this,"form"),I(this,"address"),this.props=e,this.initialize()}initialize(){var e,t,o,r,i,n,a,l,c,u,d,m,p,g,h,f,_,v,C,S;const b=this.props.compile;this.pattern="readPretty",this.readPretty=!0,this.initialized=!0,this.loading=!1,this.validating=!1,this.submitting=!1,this.selfModified=!1,this.active=!1,this.visited=!0,this.mounted=!0,this.unmounted=!1,this.inputValues=[],this.inputValue=null,this.feedbacks=[],this.title=b(this.props.title||((e=this.props.schema)==null?void 0:e.title)),this.description=b(this.props.description||((t=this.props.schema)==null?void 0:t.description)),this.display="visible",this.editable=this.props.editable||((o=this.props.schema)==null?void 0:o["x-editable"]),this.disabled=this.props.disabled||((r=this.props.schema)==null?void 0:r["x-disabled"]),this.readOnly=this.props.readOnly||((i=this.props.schema)==null?void 0:i["x-read-only"]),this.visible=this.props.visible||((n=this.props.schema)==null?void 0:n["x-visible"]),this.hidden=this.props.hidden||((a=this.props.schema)==null?void 0:a["x-hidden"]),this.dataSource=b(this.props.dataSource||((l=this.props.schema)==null?void 0:l.enum)),this.validator=this.props.validator,this.required=this.props.required||!!((c=this.props.schema)!=null&&c.required),this.content=b(this.props.content||((u=this.props.schema)==null?void 0:u["x-content"])),this.initialValue=b(this.props.initialValue||((d=this.props.schema)==null?void 0:d.default)),this.value=b(this.props.value),this.data=this.props.data||((m=this.props.schema)==null?void 0:m["x-data"]),this.decorator=this.props.decorator?(0,import_shared.toArr)(this.props.decorator):[(p=this.props.schema)==null?void 0:p["x-decorator"],(g=this.props.schema)==null?void 0:g["x-decorator-props"]],this.component=this.props.component?(0,import_shared.toArr)(this.props.component):[(h=this.props.schema)==null?void 0:h["x-component"],(f=this.props.schema)==null?void 0:f["x-component-props"]],this.decoratorProps=((_=this.props.schema)==null?void 0:_["x-decorator-props"])||{},this.componentProps=((v=this.props.schema)==null?void 0:v["x-component-props"])||{},this.decoratorType=(C=this.props.schema)==null?void 0:C["x-decorator"],this.componentType=(S=this.props.schema)==null?void 0:S["x-component"],this.path={},this.form={},this.address={concat:import_lodash.default.noop}}};const NocoBaseField=e=>{const t=useCompile(),o=(0,import_react.useFieldSchema)(),r=(0,import_react2.useMemo)(()=>createNocoBaseField(P(x({},e),{compile:t})),[]);return Object.assign(r.componentProps,o["x-component-props"]),r.value=e.value,(0,import_jsx_runtime.jsx)(import_react.FieldContext.Provider,{value:r,children:(0,import_jsx_runtime.jsx)(NocoBaseReactiveField,{field:r,children:e.children})})},CollectionFieldUISchemaContext=import_react2.default.createContext({}),RefreshFieldSchemaContext=import_react2.default.createContext(import_lodash.default.noop),RefreshFieldSchemaProvider=({children:e,refresh:t})=>{const o=useRefreshFieldSchema(),r=(0,import_react2.useCallback)(i=>{t(),i!=null&&i.refreshParentSchema&&(o==null||o())},[o,t]);return(0,import_jsx_runtime.jsx)(RefreshFieldSchemaContext.Provider,{value:r,children:e})},RefreshComponentContext=import_react2.default.createContext(import_lodash.default.noop),RefreshComponentProvider=({children:e,refresh:t})=>(0,import_jsx_runtime.jsx)(RefreshComponentContext.Provider,{value:t,children:e}),useRefreshComponent=()=>import_react2.default.useContext(RefreshComponentContext),useRefreshFieldSchema=()=>import_react2.default.useContext(RefreshFieldSchemaContext),useCollectionFieldUISchema=()=>import_react2.default.useContext(CollectionFieldUISchemaContext)||{},CollectionFieldUISchemaProvider=e=>{const{children:t,fieldSchema:o}=e,r=useCollection(),i=useCollectionManager(),n=o==null?void 0:o.name,a=(0,import_react2.useMemo)(()=>{var l;if(!r)return null;const c=(l=o==null?void 0:o["x-component-props"])==null?void 0:l.field;return i.getCollectionField(o==null?void 0:o["x-collection-field"])||c||r.getField((c==null?void 0:c.name)||n)},[r,i,o,n]);return(0,import_jsx_runtime.jsx)(CollectionFieldUISchemaContext.Provider,{value:a,children:t})},toFieldProps=import_lodash.default.memoize((e,t)=>e.toFieldProps({scope:t})),useFieldProps$1=e=>{const t=(0,import_react.useExpressionScope)();return toFieldProps(e,t)},useBasePath=e=>{var t;const o=(0,import_react.useField)();return e.onlyRenderProperties?e.basePath||((t=o==null?void 0:o.address)==null?void 0:t.concat(e.name)):e.basePath||(o==null?void 0:o.address)},createMergedSchemaInstance=(e,t,o)=>{const r=e.toJSON();if(o){if(!r.properties)return e;const i=Object.keys(r.properties)[0],n=Object.values(r.properties)[0];return r.properties[i]=(0,import_shared.merge)(import_lodash.default.omit(t,"type","x-read-pretty"),n),new import_react.Schema(r)}return new import_react.Schema((0,import_shared.merge)(import_lodash.default.omit(t,"type","x-read-pretty"),r))},propertiesToReactElement=({schema:e,field:t,basePath:o,mapProperties:r,filterProperties:i,propsRecursion:n,values:a,isUseFormilyField:l})=>{const c=import_react.Schema.getOrderProperties(e);return c.length?(0,import_jsx_runtime.jsx)(import_react2.Fragment,{children:c.map(({schema:u,key:d},m)=>{const p=(t==null?void 0:t.address)||o;let g=u;if((0,import_shared.isFn)(r)){const f=r(u,d);f&&(g=f)}if((0,import_shared.isFn)(i)&&i(g,d)===!1)return null;const h=(0,import_shared.isBool)(n)&&n?(0,import_jsx_runtime.jsx)(NocoBaseRecursionField,{propsRecursion:!0,filterProperties:i,mapProperties:r,schema:g,name:d,basePath:p,values:import_lodash.default.get(a,d),isUseFormilyField:l}):(0,import_jsx_runtime.jsx)(NocoBaseRecursionField,{schema:g,name:d,basePath:p,values:import_lodash.default.get(a,d),isUseFormilyField:l});return g["x-component"]==="CollectionField"?(0,import_jsx_runtime.jsx)(IsInNocoBaseRecursionFieldContext.Provider,{value:!0,children:(0,import_jsx_runtime.jsx)(CollectionFieldUISchemaProvider,{fieldSchema:g,children:h})},`${m}-${d}`):(0,import_jsx_runtime.jsx)(IsInNocoBaseRecursionFieldContext.Provider,{value:!1,children:(0,import_jsx_runtime.jsx)(CollectionFieldUISchemaContext.Provider,{value:EMPTY_OBJECT,children:h})},`${m}-${d}`)})}):null},IsInNocoBaseRecursionFieldContext=import_react2.default.createContext(!1),useIsInNocoBaseRecursionFieldContext=()=>import_react2.default.useContext(IsInNocoBaseRecursionFieldContext),NocoBaseRecursionField=import_react2.default.memo(e=>{const{schema:t,name:o,onlyRenderProperties:r,onlyRenderSelf:i,mapProperties:n,filterProperties:a,propsRecursion:l,values:c,isUseFormilyField:u=!0,uiSchema:d}=e,m=useBasePath(e),p=(0,import_react2.useRef)(null),g=(0,import_react2.useMemo)(()=>(p.current=null,new import_react.Schema(t)),[t]),{uiSchema:h,defaultValue:f}=useCollectionFieldUISchema(),_=(0,import_ahooks.useUpdate)(),{onChange:v}=(0,import_react2.useContext)(SchemaComponentOnChangeContext),C=p.current||g,S=(0,import_react2.useCallback)(()=>{const k=C.parent;p.current=new import_react.Schema(C.toJSON(),k),k!=null&&k.properties&&Object.keys(k.properties).forEach(R=>{R===C.name&&(k.properties[R]=p.current)}),_(),v==null||v()},[C,v,_]),b=(0,import_react2.useMemo)(()=>d?createMergedSchemaInstance(C,d,r):h?(h.default=f,createMergedSchemaInstance(C,h,r)):C,[h,f,C,r,d]),y=useFieldProps$1(b),F=k=>{if(!i)return propertiesToReactElement({schema:C,field:k,basePath:m,mapProperties:n,filterProperties:a,propsRecursion:l,values:c,isUseFormilyField:u})},j=()=>(0,import_shared.isValid)(o)?b.type==="object"?r?F():(0,import_jsx_runtime.jsx)(import_react.ObjectField,P(x({},y),{name:o,basePath:m,children:F})):b.type==="array"?(0,import_jsx_runtime.jsx)(import_react.ArrayField,P(x({},y),{name:o,basePath:m})):b.type==="void"?r?F():(0,import_jsx_runtime.jsx)(import_react.VoidField,P(x({},y),{name:o,basePath:m,children:F})):u?(0,import_jsx_runtime.jsx)(import_react.Field,P(x({},y),{name:o,basePath:m})):(0,import_jsx_runtime.jsx)(NocoBaseField,{name:o,value:c,initialValue:c,basePath:m,schema:b}):F();return C?(0,import_jsx_runtime.jsx)(import_react.SchemaContext.Provider,{value:C,children:(0,import_jsx_runtime.jsx)(RefreshFieldSchemaProvider,{refresh:S,children:j()})}):(0,import_jsx_runtime.jsx)(import_react2.Fragment,{})});NocoBaseRecursionField.displayName="NocoBaseRecursionField";const LAZY_COMPONENT_KEY=Symbol("LAZY_COMPONENT_KEY");function lazy(e,...t){if(t.length===0){const o=(0,import_react2.lazy)(()=>e().then(i=>{const n=i.default;return r[LAZY_COMPONENT_KEY]=n,{default:n}})),r=i=>(0,import_jsx_runtime.jsx)(import_react2.default.Suspense,{fallback:(0,import_jsx_runtime.jsx)(import_antd.Spin,{}),children:(0,import_jsx_runtime.jsx)(o,x({},i))});return r}return t.reduce((o,r)=>{const i=(0,import_react2.lazy)(()=>e().then(n=>{const a=(0,import_lodash.get)(n,r);return o[r][LAZY_COMPONENT_KEY]=a,{default:a}}));return o[r]=n=>(0,import_jsx_runtime.jsx)(import_react2.default.Suspense,{fallback:(0,import_jsx_runtime.jsx)(import_antd.Spin,{}),children:(0,import_jsx_runtime.jsx)(i,x({},n))}),o},{})}function useLazy(e,t){const o=typeof t=="function"?t:i=>i[t],r=(0,import_react_imported_component.loadableResource)(e);if(!r.payload)throw new Promise((i,n)=>{r.loadIfNeeded(),r.resolution.then(i).catch(n)});return o(r.payload)}function addAppVersion(e,t){if(e)return e["x-app-version"]||(e["x-app-version"]=t),Object.keys(e.properties||{}).forEach(o=>{var r;addAppVersion((r=e.properties)==null?void 0:r[o],t)}),e}const name="@nocobase/client",version="1.5.24",license="AGPL-3.0",main="lib/index.js",module$1="es/index.mjs",types="es/index.d.ts",dependencies={"@ahooksjs/use-url-state":"3.5.1","@ant-design/cssinjs":"^1.11.1","@ant-design/icons":"^5.1.4","@ant-design/pro-layout":"^7.16.11","@antv/g2plot":"^2.4.18","@budibase/handlebars-helpers":"^0.14.0","@ctrl/tinycolor":"^3.6.0","@dnd-kit/core":"^5.0.1","@dnd-kit/modifiers":"^6.0.0","@dnd-kit/sortable":"^6.0.0","@emotion/css":"^11.7.1","@formily/antd-v5":"1.1.9","@formily/core":"^2.2.27","@formily/grid":"^2.2.27","@formily/json-schema":"^2.2.27","@formily/path":"^2.2.27","@formily/react":"^2.2.27","@formily/reactive":"^2.2.27","@formily/reactive-react":"^2.2.27","@formily/shared":"^2.2.27","@formily/validator":"^2.2.27","@nocobase/evaluators":"1.5.24","@nocobase/sdk":"1.5.24","@nocobase/utils":"1.5.24",ahooks:"^3.7.2",antd:"5.12.8","antd-style":"3.7.1",axios:"^1.7.0","bignumber.js":"^9.1.2",classnames:"^2.3.1",cronstrue:"^2.11.0","file-saver":"^2.0.5",filesize:"9.0.11",flat:"^5.0.2",i18next:"^22.4.9","i18next-http-backend":"^2.1.1",json5:"^2.2.3",lodash:"4.17.21","lru-cache":"6.0.0","markdown-it":"14.1.0","markdown-it-highlightjs":"3.3.1",mathjs:"^10.6.0",mermaid:"9.4.3",mime:"^4.0.4","mime-match":"^1.0.2","react-beautiful-dnd":"^13.1.0","react-drag-listview":"^0.1.9","react-error-boundary":"^4.0.10","react-helmet":"^6.1.0","react-hotkeys-hook":"^3.4.7","react-i18next":"^11.15.1","react-iframe":"~1.8.5","react-image-lightbox":"^5.1.4","react-intersection-observer":"9.14.0","react-js-cron":"^3.1.0","react-quill":"^2.0.0","react-router-dom":"^6.11.2","react-to-print":"^2.14.7","sanitize-html":"2.13.0","use-deep-compare-effect":"^1.8.1"},peerDependencies={react:">=18.0.0","react-dom":">=18.0.0","react-is":">=18.0.0"},devDependencies={"@testing-library/react":"^14.0.0","@types/markdown-it":"14.1.1","@types/markdown-it-highlightjs":"3.3.1","@types/react-big-calendar":"^1.6.4","axios-mock-adapter":"^1.20.0",dumi:"2.2.14","dumi-theme-nocobase":"^0.2.28"},clientPkg={name,version,license,main,module:module$1,types,dependencies,peerDependencies,devDependencies};function createDesignable(e){return new Designable(e)}const generateUid=e=>{e&&(e["x-uid"]||(e["x-uid"]=(0,import_shared.uid)()),Object.keys(e.properties||{}).forEach(t=>{generateUid(e.properties[t])}))},defaultWrap=e=>e,matchSchema=(e,t)=>{if(!(!e||!t)){for(const o in t)if(Object.prototype.hasOwnProperty.call(t,o)&&t[o]!==(e==null?void 0:e[o]))return!1;return!0}},splitWrapSchema=(e,t)=>{if(e["x-uid"]&&e["x-uid"]===t["x-uid"])return[null,e.toJSON()];const o=e.toJSON(),r=P(x({},o),{properties:{}});let i=null;const n=(a,l)=>{Object.keys(a||{}).forEach(c=>{const u=a[c];if(u["x-uid"]===t["x-uid"]){i=a[c];return}else l.properties[c]=P(x({},u),{properties:{}}),n(u==null?void 0:u.properties,l.properties[c])})};return n(o.properties,r),[r,i]},translate=e=>e;class Designable{constructor(t){I(this,"current"),I(this,"options"),I(this,"appVersion"),I(this,"events",{}),this.options=t,this.current=t.current,this.appVersion=t.appVersion}get model(){return this.options.model}get query(){return this.options.query}loadAPIClientEvents(){const{api:t,t:o=translate}=this.options;if(!t)return;const r=i=>{if(!i)return[];const n=Object.values(i.properties).length,a=[];return i.mapProperties(l=>{l["x-component-props"]=l["x-component-props"]||{},l["x-component-props"].width=100/n,l["x-uid"]&&a.push({"x-uid":l["x-uid"],"x-component-props":l["x-component-props"]})}),i["x-uid"]&&a.length?a:[]};this.on("insertAdjacent",i=>q(this,[i],function*({onSuccess:n,current:a,position:l,schema:c,wrap:u,wrapped:d,removed:m}){var p;let g=[];if((d==null?void 0:d["x-component"])==="Grid.Col"&&(g=g.concat(r(d.parent))),(m==null?void 0:m["x-component"])==="Grid.Col"&&(g=g.concat(r(m.parent))),this.refresh(),!a["x-uid"])return;const h=yield t.request({url:`/uiSchemas:insertAdjacent/${a["x-uid"]}?position=${l}`,method:"post",data:{schema:addAppVersion(c,this.appVersion),wrap:u}});g.length&&(yield t.request({url:"/uiSchemas:batchPatch",method:"post",data:g})),m!=null&&m["x-uid"]&&(yield t.request({url:`/uiSchemas:remove/${m["x-uid"]}`,method:"post"})),n==null||n((p=h==null?void 0:h.data)==null?void 0:p.data),import_antd.message.success(o("Saved successfully"),.2)})),this.on("patch",i=>q(this,[i],function*({schema:n}){this.refresh(),n!=null&&n["x-uid"]&&(yield t.request({url:"/uiSchemas:patch",method:"post",data:x({},n)}),import_antd.message.success(o("Saved successfully"),.2))})),this.on("initializeActionContext",i=>q(this,[i],function*({schema:n}){n!=null&&n["x-uid"]&&(yield t.request({url:"/uiSchemas:initializeActionContext",method:"post",data:x({},n)}))})),this.on("batchPatch",i=>q(this,[i],function*({schemas:n}){this.refresh(),yield t.request({url:"/uiSchemas:batchPatch",method:"post",data:n}),import_antd.message.success(o("Saved successfully"),.2)})),this.on("remove",i=>q(this,[i],function*({removed:n}){let a=[];(n==null?void 0:n["x-component"])==="Grid.Col"&&(a=r(n.parent)),this.refresh(),n!=null&&n["x-uid"]&&(yield t.request({url:`/uiSchemas:remove/${n["x-uid"]}`,method:"post"}),a.length&&(yield t.request({url:"/uiSchemas:batchPatch",method:"post",data:a})),import_antd.message.success(o("Saved successfully"),.2))}))}prepareProperty(t){t.type||(t.type="void"),t.name||(t.name=(0,import_shared.uid)()),this.current["x-uid"]&&generateUid(t)}on(t,o){this.events[t]||(this.events[t]=[]),this.events[t].push(o)}emit(t,...o){return q(this,null,function*(){if(!this.events[t])return;const[r,...i]=o;return Promise.all(this.events[t].map(n=>n.bind(this)(x({current:this.current},r),...i)))})}parentsIn(t){if(!t||!import_react.Schema.isSchemaInstance(t))return!1;let o=this.current;for(;o!=null&&o.parent;){if(o.parent===t)return!0;o=o.parent}return!1}refresh(t){const{refresh:o}=this.options;return o==null?void 0:o(t)}deepMerge(t){const o={title:"title",description:"description",default:"initialValue",readOnly:"readOnly",writeOnly:"editable",enum:"dataSource","x-pattern":"pattern","x-display":"display","x-validator":"validator","x-decorator":"decorator","x-component":"component","x-reactions":"reactions","x-content":"content","x-visible":"visible","x-hidden":"hidden","x-disabled":"disabled","x-editable":"editable","x-read-only":"readOnly"},r={"x-decorator-props":"decoratorProps","x-component-props":"componentProps","x-data":"data"};Object.keys(t).forEach(i=>{o[i]?(this.current[i]=t[i],this.updateModel(o[i],t[i])):r[i]?Object.keys(t[i]).forEach(n=>{(0,import_set.default)(this.current,[i,n],t[i][n]),this.updateModel([r[i],n],t[i][n])}):this.current[i]=t[i]}),this.emit("patch",{schema:t})}getSchemaAttribute(t,o){return(0,import_get.default)(this.current,t,o)}shallowMerge(t){const o={title:"title",description:"description",default:"initialValue",readOnly:"readOnly",writeOnly:"editable",enum:"dataSource","x-pattern":"pattern","x-display":"display","x-validator":"validator","x-decorator":"decorator","x-component":"component","x-reactions":"reactions","x-content":"content","x-visible":"visible","x-hidden":"hidden","x-disabled":"disabled","x-editable":"editable","x-read-only":"readOnly","x-decorator-props":"decoratorProps","x-component-props":"componentProps","x-data":"data"};Object.keys(t).forEach(r=>{this.current[r]=t[r],o[r]&&this.updateModel(o[r],t[r])}),this.emit("patch",{schema:t})}updateModel(t,o){const r=i=>{(0,import_set.default)(i,t,o)};this.model&&r(this.model),this.query&&this.query.take(r)}insertAdjacent(t,o,r={}){switch(t){case"beforeBegin":return this.insertBeforeBegin(o,r);case"afterBegin":return this.insertAfterBegin(o,r);case"beforeEnd":return this.insertBeforeEnd(o,r);case"afterEnd":return this.insertAfterEnd(o,r)}}recursiveRemoveIfNoChildren(t,o){if(!t)return;let r=t,i;const n=o==null?void 0:o.breakRemoveOn;for(;r;){if(typeof n=="function"){if(n(r))break}else if(matchSchema(r,n))break;if(Object.keys(r.properties||{}).length>0)break;r.parent&&(i=r.parent.removeProperty(r.name)),r=r.parent}return i}remove(t,o={}){const{breakRemoveOn:r,removeParentsIfNoChildren:i}=o,n=t||this.current;let a=n.parent.removeProperty(n.name);if(i){const l=this.recursiveRemoveIfNoChildren(n.parent,{breakRemoveOn:r});l&&(a=l)}return this.emit("remove",{removed:a})}removeWithoutEmit(t,o={}){const{breakRemoveOn:r,removeParentsIfNoChildren:i}=o,n=t||this.current;let a=n.parent.removeProperty(n.name);if(i){const l=this.recursiveRemoveIfNoChildren(n.parent,{breakRemoveOn:r});l&&(a=l)}return a}insertBeforeBeginOrAfterEnd(t,o={}){if(!import_react.Schema.isSchemaInstance(this.current)||!import_react.Schema.isSchemaInstance(t)||this.current.parent!==t.parent)return;let r=0,i=0;return this.current.parent.mapProperties((n,a,l)=>{this.current.name===a&&(i=l),t.name===a&&(r=l)}),r>i?this.insertBeforeBegin(t,o):this.insertAfterEnd(t,o)}insertBeforeBegin(t,o={}){if(!import_react.Schema.isSchemaInstance(this.current))return;const r={onSuccess:o.onSuccess},{wrap:i=defaultWrap,breakRemoveOn:n,removeParentsIfNoChildren:a}=o;if(import_react.Schema.isSchemaInstance(t)){if(this.parentsIn(t)){this.emit("error",{code:"parent_is_not_allowed",schema:t});return}t.parent.removeProperty(t.name),a&&(r.removed=this.recursiveRemoveIfNoChildren(t.parent,{breakRemoveOn:n}))}else t&&(t=(0,import_cloneDeep.default)(t));const l={};let c=!1,u=0,d=0;this.current.parent.mapProperties((f,_)=>{_===this.current.name&&(d=u,c=!0,++u),f["x-index"]=u,++u,c&&(l[_]=f,this.current.parent.removeProperty(_))}),this.prepareProperty(t);const m=i(t),p=this.current.parent.addProperty(m.name||(0,import_shared.uid)(),m);p["x-index"]=d,p.parent=this.current.parent,this.current.parent.setProperties(l);const[g,h]=splitWrapSchema(p,t);this.emit("insertAdjacent",x({position:"beforeBegin",schema:h,wrapped:m,wrap:g},r))}insertAfterBegin(t,o={}){if(!import_react.Schema.isSchemaInstance(this.current))return;const r={onSuccess:o.onSuccess},{wrap:i=defaultWrap,breakRemoveOn:n,removeParentsIfNoChildren:a}=o;if(import_react.Schema.isSchemaInstance(t)){if(this.parentsIn(t)){this.emit("error",{code:"parent_is_not_allowed",schema:t});return}t.parent.removeProperty(t.name),a&&(r.removed=this.recursiveRemoveIfNoChildren(t.parent,{breakRemoveOn:n}))}else t&&(t=(0,import_cloneDeep.default)(t));const l={};let c=1;this.current.mapProperties((g,h)=>{g["x-index"]=c,++c,l[h]=g}),this.current.properties={},this.prepareProperty(t);const u=i(t),d=this.current.addProperty(u.name||(0,import_shared.uid)(),u);d["x-index"]=0,d.parent=this.current,this.current.setProperties(l);const[m,p]=splitWrapSchema(d,t);this.emit("insertAdjacent",x({position:"afterBegin",schema:p,wrap:m,wrapped:u},r))}insertBeforeEnd(t,o={}){if(!import_react.Schema.isSchemaInstance(this.current))return;delete t["x-index"];const r={onSuccess:o.onSuccess},{wrap:i=defaultWrap,breakRemoveOn:n,removeParentsIfNoChildren:a}=o;if(import_react.Schema.isSchemaInstance(t)){if(this.parentsIn(t)){this.emit("error",{code:"parent_is_not_allowed",schema:t});return}t.parent.removeProperty(t.name),a&&(r.removed=this.recursiveRemoveIfNoChildren(t.parent,{breakRemoveOn:n}))}else t&&(t=(0,import_cloneDeep.default)(t));this.prepareProperty(t);const l=i(t),c=this.current.addProperty(l.name||(0,import_shared.uid)(),l);c.parent=this.current;const[u,d]=splitWrapSchema(c,t);return this.emit("insertAdjacent",x({position:"beforeEnd",schema:d,wrap:u,wrapped:l},r))}insertAfterEnd(t,o={}){if(!import_react.Schema.isSchemaInstance(this.current))return;const r={onSuccess:o==null?void 0:o.onSuccess},{wrap:i=defaultWrap,breakRemoveOn:n,removeParentsIfNoChildren:a}=o;let l=0,c=0,u=!1;const d={};if(this.current.parent.mapProperties((f,_)=>{f["x-index"]=l,_===this.current.name&&(++l,c=l,u=!0),++l,u&&_!==this.current.name&&(d[_]=f,this.current.parent.removeProperty(_))}),import_react.Schema.isSchemaInstance(t)){if(this.parentsIn(t)){this.emit("error",{code:"parent_is_not_allowed",schema:t});return}t.parent.removeProperty(t.name),a&&(r.removed=this.recursiveRemoveIfNoChildren(t.parent,{breakRemoveOn:n})),t.parent=null}else t&&(t=(0,import_cloneDeep.default)(t));this.prepareProperty(t);const m=i(t),p=this.current.parent.addProperty(m.name||(0,import_shared.uid)(),m);p.parent=this.current.parent,p["x-index"]=c,this.current.parent.setProperties(d);const[g,h]=splitWrapSchema(p,t);this.emit("insertAdjacent",x({position:"afterEnd",schema:h,wrap:g,wrapped:m},r))}}function useFindComponent(){const e=(0,import_react2.useContext)(import_react.SchemaOptionsContext),t=(0,import_react2.useMemo)(()=>(e==null?void 0:e.components)||{},[e]);return o=>{if(!o)return null;if(typeof o!="string")return o;const r=(0,import_get.default)(t,o);return r||console.error(`[nocobase]: Component "${o}" not found`),r}}function useDesignable(){const{designable:e,setDesignable:t,refresh:o,reset:r}=(0,import_react2.useContext)(SchemaComponentContext),i=(0,import_react2.useContext)(import_react.SchemaOptionsContext),n=(0,import_react2.useMemo)(()=>(i==null?void 0:i.components)||{},[i]),a=(0,import_react2.useMemo)(()=>()=>(0,import_jsx_runtime.jsx)(import_jsx_runtime.Fragment,{}),[]),l=(0,import_ahooks.useUpdate)(),c=useRefreshFieldSchema(),u=useRefreshComponent(),d=(0,import_react2.useCallback)(_=>{o==null||o(),l(),c==null||c(_),u==null||u()},[o,l,c,u]),m=(0,import_react.useField)(),p=(0,import_react.useFieldSchema)(),g=useAPIClient(),{t:h}=(0,import_react_i18next.useTranslation)(),f=(0,import_react2.useMemo)(()=>createDesignable({t:h,api:g,refresh:d,current:p,model:m,appVersion:clientPkg.version}),[h,g,d,p,m]);return(0,import_react2.useEffect)(()=>{f.loadAPIClientEvents()},[f]),{dn:f,designable:e,reset:r,refresh:d,setDesignable:t,DesignableBar:a,findComponent:(0,import_react2.useCallback)(_=>{var v;if(!_)return null;if(typeof _!="string")return _;const C=(0,import_get.default)(n,_);return(v=C[LAZY_COMPONENT_KEY])!=null?v:C},[import_get.default]),on:f.on.bind(f),patch:(0,import_react2.useCallback)((_,v)=>{const C=S=>{Object.keys(S).forEach(b=>{const y=S[b];b==="title"&&(m.title=y,p.title=y),b==="x-decorator-props"&&(m.decoratorProps||(m.decoratorProps={}),p["x-decorator-props"]||(p["x-decorator-props"]={}),Object.keys(y).forEach(F=>{m.decoratorProps[F]=y[F],p["x-decorator-props"][F]=y[F]})),b==="x-component-props"&&(m.componentProps||(m.componentProps={}),p["x-component-props"]||(p["x-component-props"]={}),Object.keys(y).forEach(F=>{m.componentProps[F]=y[F],p["x-component-props"][F]=y[F]}))})};if(typeof _=="string"){const S={};return(0,import_set.default)(S,_,v),C(S)}C(_),d()},[f]),shallowMerge:(0,import_react2.useCallback)(_=>{f.shallowMerge(_)},[f]),deepMerge:(0,import_react2.useCallback)(_=>{f.deepMerge(_)},[f]),remove:(0,import_react2.useCallback)((_,v)=>{f.remove(_,v)},[f]),insertAdjacent:(0,import_react2.useCallback)((_,v,C)=>{f.insertAdjacent(_,v,C)},[f]),insertBeforeBegin:(0,import_react2.useCallback)(_=>{f.insertBeforeBegin(_)},[f]),insertAfterBegin:(0,import_react2.useCallback)(_=>{f.insertAfterBegin(_)},[f]),insertBeforeEnd:(0,import_react2.useCallback)(_=>{f.insertBeforeEnd(_)},[f]),insertAfterEnd:(0,import_react2.useCallback)(_=>{f.insertAfterEnd(_)},[f])}}const DefaultSchemaToolbar=()=>null;DefaultSchemaToolbar.isNullComponent=!0;const useDesigner=()=>{const{designable:e}=useDesignable(),t=(0,import_react.useFieldSchema)(),o=(0,import_react2.useMemo)(()=>t["x-designer"]||t["x-toolbar"]?t["x-designer"]||t["x-toolbar"]:t["x-settings"]?SchemaToolbar:DefaultSchemaToolbar,[t]),r=useComponent(o);return e&&r||DefaultSchemaToolbar},useFieldProps=e=>{const t=(0,import_react2.useContext)(import_react.SchemaOptionsContext),o=(0,import_react2.useContext)(import_react.SchemaExpressionScopeContext),r=(0,import_react2.useRef)();return r.current=o,e.toFieldProps(P(x({},t),{get scope(){return x(x({},t.scope),r.current)}}))};function useSchemaComponentContext(){return(0,import_react2.useContext)(SchemaComponentContext)}const useFieldComponentOptions=()=>{var e;const{getCollectionJoinField:t,getCollection:o}=useCollectionManager_deprecated(),r=(0,import_react.useFieldSchema)(),{getField:i}=useCollection_deprecated(),n=i(r.name)||t(r["x-collection-field"]),{t:a}=(0,import_react_i18next.useTranslation)(),{label:l}=((e=r["x-component-props"])==null?void 0:e.fieldNames)||{};return(0,import_react2.useMemo)(()=>{if(!n||!(n!=null&&n.interface)||!["o2o","oho","obo","o2m","linkTo","m2o","m2m"].includes(n.interface))return;const c=o(n.target);if((c==null?void 0:c.template)==="file")return[{label:a("Record picker"),value:"CollectionField"},{label:a("Select"),value:"AssociationSelect"}];switch(n.interface){case"o2m":return[{label:a("Record picker"),value:"CollectionField"},{label:a("Subtable"),value:"TableField"},{label:a("Select"),value:"AssociationSelect"}];case"m2o":case"m2m":case"linkTo":return[{label:a("Record picker"),value:"CollectionField"},{label:a("Select"),value:"AssociationSelect"}];default:return[{label:a("Record picker"),value:"CollectionField"},{label:a("Subform"),value:"FormField"},{label:a("Select"),value:"AssociationSelect"}]}},[a,n==null?void 0:n.interface,l])},useFieldTitle=()=>{var e;const t=(0,import_react.useField)(),o=(0,import_react.useFieldSchema)(),r=useCollection(),i=useCollectionManager(),n=(r==null?void 0:r.getField(o.name))||(i==null?void 0:i.getCollectionField(o["x-collection-field"])),a=useCompile();(0,import_react2.useEffect)(()=>{var l;t!=null&&t.title||(t.title=a((l=n==null?void 0:n.uiSchema)==null?void 0:l.title))},[(e=n==null?void 0:n.uiSchema)==null?void 0:e.title])},getPageHeaderHeight=(e,t,o,r,i)=>i.includes("/popups/")?2*r.paddingContentVertical+22+r.paddingPageVertical:e?r.paddingContentHorizontalLG:o?t?r.controlPaddingHorizontal+3*r.controlPaddingHorizontalSM+22+r.paddingContentHorizontalLG:r.paddingContentHorizontalLG+12:t?r.paddingSM+r.controlHeight+r.marginXS+2*r.controlPaddingHorizontalSM+22+r.paddingContentHorizontalLG:r.controlHeight+r.marginXS+(r.paddingXXS+2)*2+r.paddingContentHorizontalLG,usePageFullScreenHeight=e=>{const{token:t}=import_antd.theme.useToken(),{designable:o}=useDesignable(),{heightProps:r}=useBlockHeightProps(),i=(0,import_react_router_dom.useLocation)(),{disablePageHeader:n,enablePageTabs:a,hidePageTitle:l}=e||r||{},c=t.sizeXXL-2,u=o?t.controlHeight+2*t.paddingContentHorizontalLG:1*t.paddingContentHorizontalLG,d=getPageHeaderHeight(n,a,l,t,i.pathname);return c+d+u},useDrawerFullScreenHeight=()=>{const{token:e}=import_antd.theme.useToken(),{designable:t}=useDesignable(),o=e.paddingContentVerticalLG+e.margin+2*e.paddingContentVertical+24,r=t?e.controlHeight+2*e.paddingContentHorizontalLG:1*e.paddingContentHorizontalLG;return o+r},useFullScreenHeight=e=>{const t=(0,import_react.useFieldSchema)(),o=hasActionContainerInParentChain(t),r=usePageFullScreenHeight(e),i=useDrawerFullScreenHeight();return o?i:r},InternalWorkflowCollection=["users_jobs","approvals","approvalRecords"],useTableHeight=()=>{var e;const{token:t}=import_antd.theme.useToken(),{heightProps:o}=useBlockHeightProps(),{heightProps:r}=useTableBlockContext(),{designable:i}=useDesignable(),n=(0,import_react.useFieldSchema)(),a=r||o,l=useFullScreenHeight(a),{name:c}=useCollection(),{heightMode:u,height:d,title:m}=a;if(!(a!=null&&a.heightMode)||u===HeightMode.DEFAULT)return;const p=Object.keys(((e=n.parent.properties.actions)==null?void 0:e.properties)||{}).length>0,g=t.controlHeight+t.padding+t.marginLG,h=p||i?t.controlHeight+2*t.marginLG:t.marginLG,f=(i&&!InternalWorkflowCollection.includes(c)?t.controlHeight:22)+2*t.padding+1,_=m?t.fontSizeLG*t.lineHeightLG+t.padding*2-1:0;return u===HeightMode.FULL_HEIGHT?window.innerHeight-l-_-f-h-g:d-_-h-f-g},useDataBlockHeight=e=>{const{heightProps:t}=useBlockHeightProps(),o=useFullScreenHeight(),{token:r}=import_antd.theme.useToken(),{heightMode:i,height:n,title:a}=t||{},l=a?r.fontSizeLG*r.lineHeightLG+r.padding*2-1:0;if(!(!(t!=null&&t.heightMode)||i===HeightMode.DEFAULT)){if(i===HeightMode.FULL_HEIGHT){let c=window.innerHeight-o;return e!=null&&e.removeBlockHeaderHeight&&(c=c-l),e!=null&&e.innerExtraHeight&&(c=c-e.innerExtraHeight),c}return n}},useBlockHeight=()=>{const e=(0,import_react.useFieldSchema)(),t=(0,import_react2.useMemo)(()=>getPageSchema(e),[]),{disablePageHeader:o,enablePageTabs:r,hidePageTitle:i}=(t==null?void 0:t["x-component-props"])||{},n=P(x({},e==null?void 0:e["x-component-props"]),{disablePageHeader:o,enablePageTabs:r,hidePageTitle:i}),a=useFullScreenHeight(n),{heightMode:l,height:c}=n||{};if(!(!(n!=null&&n.heightMode)||l===HeightMode.DEFAULT))return l===HeightMode.FULL_HEIGHT?window.innerHeight-a:c},useTableSize=()=>{const[e,t]=(0,import_react2.useState)(),o=(0,import_react2.useRef)(null),r=useTableHeight(),i=(0,import_react2.useCallback)((0,import_lodash.debounce)(()=>{var a;if(!o.current)return;const l=o.current.getBoundingClientRect();(a=o.current.querySelector(".ant-table"))!=null&&a.getBoundingClientRect()&&t(l.width)},100),[r]),n=(0,import_react2.useCallback)(a=>{o.current=a&&a.children?a.children[0]:null,i()},[i]);return(0,import_ahooks.useEventListener)("resize",i),{height:r,width:e,tableSizeRefCallback:n}},hasActionContainerInParentChain=e=>{var t;return e?e["x-component"]==="Action.Container"?((t=e==null?void 0:e.parent["x-component-props"])==null?void 0:t.openMode)!=="page":hasActionContainerInParentChain(e.parent):null},useFieldModeOptions=e=>{var t;const{t:o}=(0,import_react_i18next.useTranslation)(),{getCollectionJoinField:r,getCollection:i}=useCollectionManager_deprecated(),n=(0,import_react.useFieldSchema)(),a=(e==null?void 0:e.fieldSchema)||n,l=(0,import_react.useField)(),c=(0,import_react.useForm)(),u=(a==null?void 0:a["x-read-pretty"])||l.readPretty||c.readPretty,d=e==null?void 0:e.fieldSchema,{getField:m}=useCollection_deprecated(),p=(e==null?void 0:e.collectionField)||m(a.name)||r(a["x-collection-field"]),{label:g}=((t=a["x-component-props"])==null?void 0:t.fieldNames)||{};return((0,import_react2.useMemo)(()=>{if(!p||!(p!=null&&p.interface)||!["o2o","oho","obo","o2m","linkTo","m2o","m2m","updatedBy","createdBy","mbm","attachmentURL"].includes(p.interface))return;const h=i(p.target);if((h==null?void 0:h.template)==="file")return u?[{label:o("Title"),value:"Select"},{label:o("File manager"),value:"FileManager"},{label:o("Tag"),value:"Tag"}]:[{label:o("Select"),value:"Select"},{label:o("Record picker"),value:"Picker"},{label:o("File manager"),value:"FileManager"}];if((h==null?void 0:h.template)==="tree"&&["m2m","o2m","m2o"].includes(p.interface))return u?[{label:o("Title"),value:"Select"},{label:o("Tag"),value:"Tag"},!d&&{label:o("Sub-details"),value:"Nester"},!d&&{label:o("Sub-table"),value:"SubTable"}]:[{label:o("Select"),value:"Select"},{label:o("Record picker"),value:"Picker"},!d&&["m2m","o2m"].includes(p.interface)&&{label:o("Sub-table"),value:"SubTable"},!d&&{label:o("Cascade Select"),value:"CascadeSelect"},!d&&{label:o("Sub-form"),value:"Nester"},{label:o("Sub-form(Popover)"),value:"PopoverNester"}];switch(p.interface){case"o2m":return u?[{label:o("Title"),value:"Select"},{label:o("Tag"),value:"Tag"},!d&&{label:o("Sub-table"),value:"SubTable"},!d&&{label:o("Sub-details"),value:"Nester"}]:[{label:o("Select"),value:"Select"},{label:o("Record picker"),value:"Picker"},!d&&{label:o("Sub-form"),value:"Nester"},{label:o("Sub-form(Popover)"),value:"PopoverNester"},!d&&{label:o("Sub-table"),value:"SubTable"}];case"m2m":case"mbm":return u?[{label:o("Title"),value:"Select"},{label:o("Tag"),value:"Tag"},!d&&{label:o("Sub-details"),value:"Nester"},!d&&{label:o("Sub-table"),value:"SubTable"}]:[{label:o("Select"),value:"Select"},{label:o("Record picker"),value:"Picker"},!d&&{label:o("Sub-table"),value:"SubTable"},!d&&{label:o("Sub-form"),value:"Nester"},{label:o("Sub-form(Popover)"),value:"PopoverNester"}];case"m2o":case"linkTo":return u?[{label:o("Title"),value:"Select"},{label:o("Tag"),value:"Tag"},!d&&{label:o("Sub-details"),value:"Nester"}]:[{label:o("Select"),value:"Select"},{label:o("Record picker"),value:"Picker"},!d&&{label:o("Sub-form"),value:"Nester"},{label:o("Sub-form(Popover)"),value:"PopoverNester"}];default:return u?[{label:o("Title"),value:"Select"},{label:o("Tag"),value:"Tag"},!d&&{label:o("Sub-details"),value:"Nester"}]:[{label:o("Select"),value:"Select"},{label:o("Record picker"),value:"Picker"},!d&&{label:o("Sub-form"),value:"Nester"},{label:o("Sub-form(Popover)"),value:"PopoverNester"}]}},[o,p==null?void 0:p.interface,g])||[]).filter(Boolean)},useDragEnd=e=>{const{refresh:t}=useDesignable(),o=useAPIClient(),{t:r}=(0,import_react_i18next.useTranslation)();return(0,import_react2.useCallback)(i=>{var n,a,l,c,u,d,m,p,g,h,f,_,v,C,S;const{active:b,over:y}=i,F=(a=(n=b==null?void 0:b.data)==null?void 0:n.current)==null?void 0:a.schema,j=(c=(l=y==null?void 0:y.data)==null?void 0:l.current)==null?void 0:c.schema,k=(d=(u=y==null?void 0:y.data)==null?void 0:u.current)==null?void 0:d.insertAdjacent,R=(p=(m=y==null?void 0:y.data)==null?void 0:m.current)==null?void 0:p.breakRemoveOn,z=(h=(g=y==null?void 0:y.data)==null?void 0:g.current)==null?void 0:h.wrapSchema,N=(_=(f=y==null?void 0:y.data)==null?void 0:f.current)==null?void 0:_.onSuccess,L=(S=(C=(v=y==null?void 0:y.data)==null?void 0:v.current)==null?void 0:C.removeParentsIfNoChildren)!=null?S:!0;if(!F||!j){e==null||e(i);return}if(F===j){e==null||e(i);return}if(F.parent===j&&k==="beforeEnd"){e==null||e(i);return}const D=createDesignable({t:r,api:o,refresh:({refreshParentSchema:T=!0}={})=>t({refreshParentSchema:T}),current:j});if(D.loadAPIClientEvents(),F.parent===j.parent){D.insertBeforeBeginOrAfterEnd(F),e==null||e(i);return}if(k){D.insertAdjacent(k,F,{wrap:z,breakRemoveOn:R,removeParentsIfNoChildren:L,onSuccess:N}),e==null||e(i);return}},[o,e,t,r])},InternalDndContext=import_react2.default.memo(e=>{const{t}=(0,import_react_i18next.useTranslation)(),[o,r]=(0,import_react2.useState)(!0),i=(0,import_react2.useCallback)(a=>{var l,c,u;const{active:d}=a,m=(c=(l=d==null?void 0:d.data)==null?void 0:l.current)==null?void 0:c.schema;r(!!m),e!=null&&e.onDragStart&&((u=e==null?void 0:e.onDragStart)==null||u.call(e,a))},[e==null?void 0:e.onDragStart]),n=useDragEnd(e==null?void 0:e.onDragEnd);return(0,import_jsx_runtime.jsxs)(import_core.DndContext,P(x({collisionDetection:import_core.rectIntersection},e),{onDragStart:i,onDragEnd:n,children:[(0,import_jsx_runtime.jsx)(import_core.DragOverlay,{dropAnimation:{duration:10,easing:"cubic-bezier(0.18, 0.67, 0.6, 1.22)"},children:o&&(0,import_jsx_runtime.jsx)("span",{style:{whiteSpace:"nowrap"},children:t("Dragging")})}),e.children]}))});InternalDndContext.displayName="InternalDndContext";const DndContext=e=>(0,import_jsx_runtime.jsx)(InternalDndContext,x({},e)),DraggableContext=(0,import_react2.createContext)(null);DraggableContext.displayName="DraggableContext";const SortableContext=(0,import_react2.createContext)(null);SortableContext.displayName="SortableContext";const SortableProvider=e=>{const{id:t,data:o,children:r}=e,i=(0,import_core.useDraggable)({id:t,data:o}),n=(0,import_core.useDroppable)({id:t,data:o}),a=(0,import_react2.useMemo)(()=>({draggable:i,droppable:n}),[i,n]);return(0,import_jsx_runtime.jsx)(SortableContext.Provider,{value:a,children:r})},getComputedColor=e=>new import_tinycolor.TinyColor(e).setAlpha(.15).toHex8String(),Sortable=e=>{var t,o;const r=e,{component:i,overStyle:n,style:a,children:l,openMode:c}=r,u=W(r,["component","overStyle","style","children","openMode"]),{token:d}=useToken(),{draggable:m,droppable:p}=(0,import_react2.useContext)(SortableContext),{isOver:g,setNodeRef:h}=p,f=x({},a);return g&&((t=m==null?void 0:m.active)==null?void 0:t.id)!==((o=p==null?void 0:p.over)==null?void 0:o.id)&&(f[i==="a"?"color":"background"]=getComputedColor(d.colorSettings),Object.assign(f,n)),import_react2.default.createElement(i||"div",P(x({role:"none"},u),{className:(0,import_css.cx)("nb-sortable-designer",e.className),ref:h,style:f}),l)},useSortableItemProps=e=>{const t=useSortableItemId(e),o=(0,import_react.useFieldSchema)();return e.schema?P(x({},e),{id:t}):P(x({},e),{id:t,schema:o})},useSortableItemId=e=>{var t;const o=(0,import_react.useField)();return e.id?e.id:(t=o.address)==null?void 0:t.toString()},InternalSortableItem=(0,import_react.observer)(e=>{const t=useSortableItemProps(e),{schema:o,id:r,eid:i,removeParentsIfNoChildren:n}=t,a=W(t,["schema","id","eid","removeParentsIfNoChildren"]),l=(0,import_react2.useMemo)(()=>({insertAdjacent:"afterEnd",schema:o,removeParentsIfNoChildren:n??!0}),[o,n]);return(0,import_jsx_runtime.jsx)(SortableProvider,{id:r,data:l,children:(0,import_jsx_runtime.jsx)(Sortable,P(x({id:i},a),{children:e.children}))})},{displayName:"InternalSortableItem"}),SortableItem=import_react2.default.memo(e=>{const t=e,{component:o}=t,r=W(t,["component"]),{designable:i}=useDesignable();return i?(0,import_jsx_runtime.jsx)(InternalSortableItem,x({},e)):import_react2.default.createElement(o||"div",import_lodash.default.omit(r,["children","schema","overStyle","openMode","id","eid","removeParentsIfNoChildren"]),e.children)});SortableItem.displayName="SortableItem";const DragHandler=e=>{const{draggable:t}=(0,import_react2.useContext)(SortableContext)||{};if(!t)return null;const{attributes:o,listeners:r,setNodeRef:i}=t;return(0,import_jsx_runtime.jsx)("div",{style:{display:"inline-block",width:14,height:14,lineHeight:"14px",textAlign:"left"},children:(0,import_jsx_runtime.jsx)("div",P(x(x({ref:i,style:{position:"relative",zIndex:1,lineHeight:0,fontSize:0,display:"inline-block"}},r),o),{role:"none",children:(0,import_jsx_runtime.jsx)("span",{style:{cursor:"move",fontSize:14},children:e.children})}))})},ShowFormData=(0,import_react.observer)(({children:e})=>{const t=(0,import_react.useForm)();return(0,import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment,{children:[(0,import_jsx_runtime.jsx)("pre",{style:{marginBottom:20},"data-testid":"form-data",children:JSON.stringify(t.values,null,2)}),e]})}),common=Object.freeze(Object.defineProperty({__proto__:null,DndContext,DragHandler,DraggableContext,ShowFormData,Sortable,SortableContext,SortableItem,SortableProvider,getRenderContent},Symbol.toStringTag,{value:"Module"})),requestChartData=e=>function(){return q(this,null,function*(){var t;try{const o=yield this.api.request(e);return(t=o==null?void 0:o.data)==null?void 0:t.data}catch{return[]}})},FormComponent$1=e=>{const t=e,{form:o,children:r}=t,i=W(t,["form","children"]),n=(0,import_react.useField)(),a=(0,import_react.useFieldSchema)(),l=useAttach(o.createVoidField(P(x({},n.props),{basePath:""})));return(0,import_jsx_runtime.jsx)(import_react.FieldContext.Provider,{value:void 0,children:(0,import_jsx_runtime.jsx)(import_react.FormContext.Provider,{value:o,children:(0,import_jsx_runtime.jsx)(import_antd_v5.FormLayout,P(x({layout:"vertical"},i),{children:(0,import_jsx_runtime.jsx)(NocoBaseRecursionField,{basePath:l.address,schema:a,onlyRenderProperties:!0})}))})})},Def$1=e=>e.children,FormDecorator$1=e=>{const t=e,{form:o,children:r,disabled:i}=t,n=W(t,["form","children","disabled"]),a=(0,import_react.useField)(),l=(0,import_react.useFieldSchema)(),c=useAttach(o.createVoidField(P(x({},a.props),{basePath:""}))),u=useComponent(l["x-component"],Def$1);return(0,import_react2.useEffect)(()=>{o.disabled=i||a.disabled},[i,a.disabled]),(0,import_jsx_runtime.jsx)(import_antd.ConfigProvider,{componentDisabled:i,children:(0,import_jsx_runtime.jsx)(import_react.FieldContext.Provider,{value:void 0,children:(0,import_jsx_runtime.jsx)(import_react.FormContext.Provider,{value:o,children:(0,import_jsx_runtime.jsx)(import_antd_v5.FormLayout,P(x({layout:"vertical"},n),{children:(0,import_jsx_runtime.jsx)(import_react.FieldContext.Provider,{value:c,children:(0,import_jsx_runtime.jsx)(u,P(x({},a.componentProps),{children:(0,import_jsx_runtime.jsx)(NocoBaseRecursionField,{basePath:c.address,schema:l,onlyRenderProperties:!0})}))})}))})})})},getRequestParams=e=>{const{request:t,initialValue:o}=e;return t||(()=>Promise.resolve({data:o}))},useDefaultValues=(e={},t={})=>useRequest(getRequestParams(t),e),FormBlockContext=(0,import_react2.createContext)(null);FormBlockContext.displayName="FormBlockContext";const Form$1=(0,import_react.observer)(e=>{const t=e,{request:o,effects:r,initialValue:i,useValues:n=useDefaultValues}=t,a=W(t,["request","effects","initialValue","useValues"]),l=(0,import_react.useFieldSchema)(),c=(0,import_react.useField)(),u=(0,import_react2.useMemo)(()=>(0,import_core2.createForm)({effects:r}),[]),d=n({uid:l["x-uid"],onSuccess(p){return q(this,null,function*(){yield u.reset(),u.setValues(p==null?void 0:p.data),u.setInitialValues(p==null?void 0:p.data)})}},e),m=(0,import_react2.useContext)(FormBlockContext);return(0,import_jsx_runtime.jsx)(FormBlockContext.Provider,{value:{parent:m,form:u,result:d,field:c,fieldSchema:l},children:(0,import_jsx_runtime.jsx)(import_antd.Spin,{spinning:(d==null?void 0:d.loading)||!1,children:l["x-decorator"]==="Form"?(0,import_jsx_runtime.jsx)(FormDecorator$1,x({form:u},a)):(0,import_jsx_runtime.jsx)(FormComponent$1,x({form:u},a))})})},{displayName:"Form"});Form$1.Designer=function e(){const{name:t,title:o}=useCollection_deprecated(),r=useSchemaTemplate(),{componentNamePrefix:i}=useBlockTemplateContext();return(0,import_jsx_runtime.jsxs)(GeneralSchemaDesigner,{template:r,title:o||t,children:[(0,import_jsx_runtime.jsx)(SchemaSettingsTemplate,{componentName:`${i}Form`,collectionName:t}),(0,import_jsx_runtime.jsx)(SchemaSettingsDivider,{}),(0,import_jsx_runtime.jsx)(SchemaSettingsRemove,{removeParentsIfNoChildren:!0,breakRemoveOn:{"x-component":"Grid"}})]})};const formV1Settings=new SchemaSettings({name:"FormV1Settings",items:[{name:"template",Component:SchemaSettingsTemplate,useComponentProps(){const{name:e}=useCollection_deprecated(),{componentNamePrefix:t}=useBlockTemplateContext();return{componentName:`${t}Form`,collectionName:e}}},{name:"divider",type:"divider"},{name:"remove",type:"remove",componentProps:{removeParentsIfNoChildren:!0,breakRemoveOn:{"x-component":"Grid"}}}]}),FormDesigner=()=>{const{name:e,title:t}=useCollection_deprecated(),o=useSchemaTemplate();return(0,import_jsx_runtime.jsx)(GeneralSchemaDesigner,{schemaSettings:"FormSettings",template:o,title:t||e})},ReadPrettyFormDesigner=()=>{const{name:e,title:t}=useCollection_deprecated(),o=useSchemaTemplate();return(0,import_jsx_runtime.jsx)(GeneralSchemaDesigner,{schemaSettings:"ReadPrettyFormSettings",template:o,title:t||e})},DetailsDesigner=()=>{const{name:e,title:t}=useCollection_deprecated(),o=useSchemaTemplate();return(0,import_jsx_runtime.jsx)(GeneralSchemaDesigner,{schemaSettings:"FormDetailsSettings",template:o,title:t||e})},FilterDesigner=()=>{const{name:e,title:t}=useCollection_deprecated(),o=useSchemaTemplate();return(0,import_jsx_runtime.jsx)(GeneralSchemaDesigner,{schemaSettings:"blockSettings:filterForm",template:o,title:t||e})},defaultFieldNames$1={label:"label",value:"value",color:"color",options:"children"};function flatData$1(e,t){const o=[];if(!Array.isArray(e))return o;for(let r=0;r<e.length;r++){const i=e[r][t.options];Array.isArray(i)&&o.push(...flatData$1(i,t)),o.push(x({},e[r]))}return o}function findOptions(e,t,o){if(!e)return[];const r=[];for(const i of o){const n=e.find(a=>a[t.value]==i)||{value:i,label:i&&i.toString()};r.push(n)}return r}function getCurrentOptions(e,t,o){const r=flatData$1(t,o),i=(0,import_lodash.castArray)(e).map(n=>(0,import_client.isPlainObject)(n)?n[o.value]:n);return findOptions(r,o,i)}const ReadPrettyInternal=(0,import_react.observer)(e=>{const[t,o]=(0,import_react2.useState)(!0),[r,i]=(0,import_react2.useState)([]),n=(0,import_react.useField)(),a=useCollectionField();return(0,import_react2.useEffect)(()=>{var l;const c=x(x({},defaultFieldNames$1),e.fieldNames),u=n.dataSource||e.options||(a==null?void 0:a.uiSchema.enum)||[],d=getCurrentOptions(n.value,u,c);if(!(0,import_shared.isValid)(e.value)&&!d.length||(0,import_core2.isArrayField)(n)&&((l=n==null?void 0:n.value)==null?void 0:l.length)===0)return;const m=n.value!==null&&d.map((p,g)=>(0,import_jsx_runtime.jsx)(import_antd.Tag,{color:p[c.color],icon:p.icon,children:p[c.label]},g));i(m),o(!1)},[a==null?void 0:a.uiSchema.enum,n,n.dataSource,n.value,e.fieldNames,e.options,e.value]),t?null:(0,import_jsx_runtime.jsx)(EllipsisWithTooltip,{ellipsis:e.ellipsis,children:r})},{displayName:"SelectReadPretty"}),ReadPretty$b=withPopupWrapper(ReadPrettyInternal),isEmptyObject=e=>!(0,import_shared.isValid)(e)||typeof e=="object"&&Object.keys(e).length===0,ObjectSelect=e=>{const t=e,{value:o,options:r,onChange:i,fieldNames:n,mode:a,loading:l,rawOptions:c,defaultValue:u}=t,d=W(t,["value","options","onChange","fieldNames","mode","loading","rawOptions","defaultValue"]),m=p=>{var g;if(isEmptyObject(p))return;const h=(0,import_shared.toArr)(p).filter(_=>_).map(_=>(0,import_client.isPlainObject)(_)?_[n.value]:_),f=(g=getCurrentOptions(h,r,n))==null?void 0:g.map(_=>({label:_[n.label],value:_[n.value]}));return["tags","multiple"].includes(a)||e.multiple?f:f.shift()};return(0,import_jsx_runtime.jsx)(import_antd.Select,x({role:"button","data-testid":`select-object-${a||"single"}`,value:m(o),defaultValue:m(u),allowClear:{clearIcon:(0,import_jsx_runtime.jsx)(import_icons.CloseCircleFilled,{role:"button","aria-label":"icon-close-select"})},labelInValue:!0,notFoundContent:l?(0,import_jsx_runtime.jsx)(import_antd.Spin,{}):(0,import_jsx_runtime.jsx)(import_antd.Empty,{image:import_antd.Empty.PRESENTED_IMAGE_SIMPLE}),options:r,fieldNames:n,showSearch:!0,popupMatchSelectWidth:!1,filterOption:(p,g)=>{var h;return((h=g==null?void 0:g[n.label||"label"])!=null?h:"").includes(p)},filterSort:(p,g)=>{var h,f;return((h=p==null?void 0:p[n.label||"label"])!=null?h:"").toLowerCase().localeCompare(((f=g==null?void 0:g[n.label||"label"])!=null?f:"").toLowerCase())},onChange:p=>{const g=getCurrentOptions((0,import_shared.toArr)(p).map(h=>h.value),c||r,n);["tags","multiple"].includes(a)||e.multiple?i==null||i(g):i==null||i(g.shift()||null)},mode:a,tagRender:p=>(0,import_jsx_runtime.jsx)(import_antd.Tag,P(x({role:"button","aria-label":p.label,closeIcon:(0,import_jsx_runtime.jsx)(import_icons.CloseOutlined,{role:"button","aria-label":"icon-close-tag"})},p),{children:p.label})),maxTagCount:"responsive"},d))},filterOption=(e,t)=>{var o;return((o=t==null?void 0:t.label)!=null?o:"").toLowerCase().includes((e||"").toLowerCase())},InternalSelect=(0,import_react.connect)(e=>{const t=e,{objectValue:o,loading:r,value:i,rawOptions:n,defaultValue:a}=t,l=W(t,["objectValue","loading","value","rawOptions","defaultValue"]),c=useCompile();let u=e.multiple?"multiple":e.mode;if(u&&!["multiple","tags"].includes(u)&&(u=void 0),o)return(0,import_jsx_runtime.jsx)(ObjectSelect,P(x({rawOptions:n},l),{defaultValue:a,value:i,mode:u,loading:r}));const d=m=>["tags","multiple"].includes(e.mode)||e.multiple?m?(0,import_shared.toArr)(m):void 0:m;return(0,import_jsx_runtime.jsx)(import_antd.Select,P(x({role:"button","data-testid":`select-${u||"single"}`,showSearch:!0,filterOption,allowClear:{clearIcon:(0,import_jsx_runtime.jsx)(import_icons.CloseCircleFilled,{role:"button","aria-label":"icon-close-select"})},popupMatchSelectWidth:!1,notFoundContent:r?(0,import_jsx_runtime.jsx)(import_antd.Spin,{}):(0,import_jsx_runtime.jsx)(import_antd.Empty,{image:import_antd.Empty.PRESENTED_IMAGE_SIMPLE}),value:d(i),defaultValue:d(a),tagRender:m=>(0,import_jsx_runtime.jsx)(import_antd.Tag,P(x({role:"button","aria-label":m.label,closeIcon:(0,import_jsx_runtime.jsx)(import_icons.CloseOutlined,{role:"button","aria-label":"icon-close-tag"})},m),{children:m.label}))},c(l)),{onChange:m=>{var p;(p=e.onChange)==null||p.call(e,m===void 0?null:m)},mode:u,maxTagCount:"responsive"}))},(0,import_react.mapProps)({dataSource:"options"},(e,t)=>P(x({},e),{fieldNames:x(x({},defaultFieldNames$1),e.fieldNames),suffixIcon:t!=null&&t.loading||t!=null&&t.validating?(0,import_jsx_runtime.jsx)(import_icons.LoadingOutlined,{}):e.suffixIcon})),(0,import_react.mapReadPretty)(ReadPretty$b)),Select=InternalSelect;Select.ReadPretty=ReadPretty$b;const getValues=(e,t)=>(0,import_lodash.castArray)(e).filter(o=>o!=null).map(o=>typeof o=="object"?o[t.value]:o),ReadPretty$a=(0,import_react.observer)(e=>{const t=x(x({},defaultFieldNames$1),e.fieldNames),o=(0,import_react.useField)(),r=(0,import_react.useFieldSchema)(),i=useRecord(),{snapshot:n}=useActionContext(),{data:a}=useRequest(n?()=>q(void 0,null,function*(){return{data:i[r.name]}}):P(x({action:"list"},e.service),{params:{paginate:!1,filter:{[t.value]:{$in:getValues(o.value,t)}}}}),{refreshDeps:[e.service,o.value]});return(0,import_jsx_runtime.jsx)(Select.ReadPretty,P(x({},e),{options:a==null?void 0:a.data}))},{displayName:"ReadPretty"}),EMPTY$1="N/A",InternalRemoteSelect=withDynamicSchemaProps((0,import_react.connect)(e=>{var t,o;const r=e,{fieldNames:i={},service:n={},wait:a=300,value:l,defaultValue:c,objectValue:u,manual:d=!0,mapOptions:m,targetField:p,CustomDropdownRender:g,optionFilter:h,dataSource:f,toOptionsItem:_=K=>K,popupMatchSelectWidth:v=!1}=r,C=W(r,["fieldNames","service","wait","value","defaultValue","objectValue","manual","mapOptions","targetField","CustomDropdownRender","optionFilter","dataSource","toOptionsItem","popupMatchSelectWidth"]),S=useDataSourceKey(),b=useDataSourceHeaders(f||S),[y,F]=(0,import_react2.useState)(!1),j=(0,import_react2.useRef)(!1),k=(0,import_react.useFieldSchema)(),R=((t=k["x-component-props"])==null?void 0:t.addMode)==="quickAdd",{getField:z}=useCollection_deprecated(),N=(0,import_react2.useRef)(null),{getCollectionJoinField:L,getInterface:D}=useCollectionManager_deprecated(),T=k["x-collection-field"]||k.name,$=z(T)||L(T),w=p||($==null?void 0:$.target)&&(i==null?void 0:i.label)&&L(`${$.target}.${i.label}`),A=(0,import_react2.useMemo)(()=>{var K;if(w!=null&&w.interface){const J=D(w.interface),X=((K=J==null?void 0:J.filterable)==null?void 0:K.operators[0].value)||"$includes";return w.type==="string"?"$includes":X}return"$includes"},[w]),B=useCompile(),M=(0,import_react2.useCallback)(K=>{try{return K.filter(J=>["number","string"].includes(typeof J[i.value])||!J[i.value]).map(J=>{var X;let Q=B(J[i.label]);if((X=w==null?void 0:w.uiSchema)!=null&&X.enum)if(Array.isArray(Q))Q=Q.map((te,ee)=>{const ne=w.uiSchema.enum.find(ae=>ae.value===te);return ne?(0,import_jsx_runtime.jsx)(import_antd.Tag,{role:"button",color:ne.color,style:{marginRight:3},children:(ne==null?void 0:ne.label)||te},ee):(0,import_jsx_runtime.jsx)(import_antd.Tag,{role:"button",children:te},te)}).reverse();else{const te=w.uiSchema.enum.find(ee=>ee.value===Q);te&&(Q=(0,import_jsx_runtime.jsx)(import_antd.Tag,{role:"button",color:te.color,children:te.label}))}return(w==null?void 0:w.type)==="date"&&(Q=(0,import_dayjs.default)(Q).format("YYYY-MM-DD")),m?m({[i.label]:Q||EMPTY$1,[i.value]:J[i.value]}):P(x({},J),{[i.label]:Q||EMPTY$1,[i.value]:J[i.value]})}).filter(Boolean)}catch(J){return console.error(J),K}},[w==null?void 0:w.uiSchema,i]),{data:O,run:E,loading:U}=useRequest(P(x({action:"list"},n),{headers:b,params:P(x({pageSize:200},n==null?void 0:n.params),{filter:(o=n==null?void 0:n.params)==null?void 0:o.filter})}),x({manual:d,debounceWait:a},n.defaultParams?{defaultParams:[n.defaultParams]}:{})),V=(0,import_react2.useMemo)(()=>JSON.stringify({service:n,fieldNames:i}),[n,i]),G=(0,import_react2.useCallback)(()=>N.current&&g?(0,import_jsx_runtime.jsx)(g,{search:N.current,callBack:()=>{N.current=null,F(!1)}}):null,[N.current]);(0,import_react2.useEffect)(()=>{j.current&&E()},[V]);const H=K=>q(void 0,null,function*(){var J;E({filter:mergeFilter([K?{[i.label]:{[A]:K}}:{},(J=n==null?void 0:n.params)==null?void 0:J.filter])}),N.current=K}),Y=(0,import_react2.useMemo)(()=>{var K;const J=l||c;if(!((K=O==null?void 0:O.data)!=null&&K.length))return J!=null?Array.isArray(J)?J:[J]:[];const X=J!=null&&(Array.isArray(J)?J.map(te=>P(x({},te),{[i.value]:te[i.value]||te})):[P(x({},J),{[i.value]:J[i.value]||J})])||[],Q=typeof h=="function"?O.data.filter(h):O.data;return(0,import_lodash.uniqBy)(Q.concat(X??[]),i.value)},[l,c,O==null?void 0:O.data,i.value,h]);return(0,import_jsx_runtime.jsx)(Select,P(x({open:y,popupMatchSelectWidth:v,autoClearSearchValue:!0,filterOption:!1,filterSort:null,fieldNames:i,onSearch:H,onDropdownVisibleChange:K=>{F(K),N.current=null,K&&E(),j.current=!0},objectValue:u,value:l,defaultValue:c},C),{loading:O?U:!0,options:_(M(Y)),rawOptions:Y,dropdownRender:K=>{const J=Y.some(X=>X[i.label]===N.current);return(0,import_jsx_runtime.jsx)(import_jsx_runtime.Fragment,{children:R?(0,import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment,{children:[!((O==null?void 0:O.data.length)===0&&N!=null&&N.current)&&K,(O==null?void 0:O.data.length)>0&&(N==null?void 0:N.current)&&!J&&(0,import_jsx_runtime.jsx)(import_antd.Divider,{style:{margin:0}}),!J&&(0,import_jsx_runtime.jsx)(G,{})]}):K})}}))},(0,import_react.mapProps)({dataSource:"options"},(e,t)=>{var o;const r=(0,import_react.useFieldSchema)();return P(x({},e),{fieldNames:x(x(x(x({},defaultFieldNames$1),e.fieldNames),t.componentProps.fieldNames),(o=r["x-component-props"])==null?void 0:o.fieldNames),suffixIcon:t!=null&&t.loading||t!=null&&t.validating?(0,import_jsx_runtime.jsx)(import_icons.LoadingOutlined,{}):e.suffixIcon})}),(0,import_react.mapReadPretty)(ReadPretty$a))),RemoteSelect=InternalRemoteSelect;RemoteSelect.ReadPretty=ReadPretty$a;const useFormDataTemplates=()=>{const e=(0,import_react.useFieldSchema)(),{t}=(0,import_react_i18next.useTranslation)(),{duplicateData:o}=useFormBlockContext(),{getCollectionJoinField:r}=useCollectionManager_deprecated();if(o)return o;const{items:i=[],display:n=!0}=findDataTemplates(e);i.forEach(c=>{var u;try{c.fields=(u=c.fields)==null?void 0:u.map(d=>r(`${c.collection}.${d}`)?d:"").filter(Boolean)}catch(d){(0,import_client.error)(d),c.fields=[]}});const a=[{key:"none",title:t("None")}].concat(i.map((c,u)=>P(x({key:u},c),{isLeaf:c.dataId!==null&&c.dataId!==void 0,titleCollectionField:(c==null?void 0:c.titleField)&&r(`${c.collection}.${c.titleField}`)}))),l=i.find(c=>c.default);return{templates:a,display:n,defaultTemplate:l,enabled:i.length>0&&i.every(c=>c.dataId||c.dataScope)}},Templates=import_react2.default.memo(({style:e={},form:t})=>{const{token:o}=useToken(),{templates:r,display:i,enabled:n,defaultTemplate:a}=useFormDataTemplates(),{getCollectionJoinField:l}=useCollectionManager_deprecated(),c=compatibleDataId(r),[u,d]=(0,import_react2.useState)((a==null?void 0:a.key)||"none"),[m,p]=(0,import_react2.useState)(null),g=useAPIClient(),{t:h}=(0,import_react_i18next.useTranslation)(),f=useDataSourceKey(),_=useDataSourceHeaders(f);(0,import_react2.useEffect)(()=>{n&&a&&t&&(t.__template=!0,a.key==="duplicate"&&b(a.dataId,a,_))},[]),(0,import_react2.useEffect)(()=>{c!=null&&c.some(F=>F.key===u)||S("none")},[c]);const v=(0,import_react2.useMemo)(()=>x({display:"flex",alignItems:"center",backgroundColor:o.colorFillAlter,padding:o.padding},e),[e,o.colorFillAlter]),C=(0,import_react2.useMemo)(()=>({fontSize:o.fontSize,fontWeight:"bold",whiteSpace:"nowrap",marginRight:o.marginXS}),[o.fontSize,o.marginXS]),S=(0,import_react2.useCallback)(F=>q(void 0,null,function*(){d(F),p(null),t==null||t.reset()}),[]),b=(0,import_react2.useCallback)((F,j,k)=>q(void 0,null,function*(){const R=P(x({},j),{dataId:F});p(j),fetchTemplateData(g,R,k).then(z=>(t&&z&&(t.reset(),t.__template=!0,(0,import_client.forEach)(z,(N,L)=>{var D;N&&(t.values[L]=N,(D=t==null?void 0:t.setInitialValuesIn)==null||D.call(t,L,N))})),z)).catch(z=>{console.error(z)})}),[]);if(!n||!i)return null;const y=c==null?void 0:c.find(F=>F.key===u);return(0,import_jsx_runtime.jsx)("div",{style:v,children:(0,import_jsx_runtime.jsxs)(import_antd.Space,{wrap:!0,children:[(0,import_jsx_runtime.jsxs)("label",{style:C,children:[h("Data template"),": "]}),(0,import_jsx_runtime.jsx)(import_antd.Select,{role:"button","data-testid":"select-form-data-template",popupMatchSelectWidth:!1,options:c,fieldNames:{label:"title",value:"key"},value:u,onChange:S}),u!=="none"&&y&&(0,import_jsx_runtime.jsx)(RemoteSelect,{style:{width:220},fieldNames:{label:y==null?void 0:y.titleField,value:"id"},target:y==null?void 0:y.collection,value:m,objectValue:!0,service:{resource:y==null?void 0:y.collection,params:{filter:y==null?void 0:y.dataScope}},onChange:F=>b(F==null?void 0:F.id,x(x({},F),y),_),targetField:l(`${y==null?void 0:y.collection}.${y.titleField}`)})]})})});Templates.displayName="NocoBaseFormDataTemplates";function findDataTemplates(e){const t=findFormBlock(e);return t?import_lodash.default.cloneDeep(t["x-data-templates"])||{}:{}}function fetchTemplateData(e,t,o){return q(this,null,function*(){if(!(t.fields.length===0||!t.dataId))return e.resource(t.collection,void 0,o).get({filterByTk:t.dataId,fields:t.fields,isTemplate:!0}).then(r=>{var i;return(i=r.data)==null?void 0:i.data})})}const useFormBlockHeight=()=>{var e,t,o;const r=useDataBlockHeight(),i=(0,import_react.useFieldSchema)(),{token:n}=import_antd.theme.useToken(),{designable:a}=useDesignable(),{heightProps:l}=useBlockHeightProps()||{},{title:c}=l||{},{display:u,enabled:d}=useFormDataTemplates(),m=i.reduceProperties((y,F)=>F["x-component"]==="ActionBar"?F:y),p=Object.keys((m==null?void 0:m.properties)||{}).length>0,g=(o=(t=(e=i==null?void 0:i.parent)==null?void 0:e["x-decorator"])==null?void 0:t.includes)==null?void 0:o.call(t,"FormBlockProvider"),h=p||a?n.controlHeight+(g?1:2)*n.marginLG:n.marginLG,f=c?n.fontSizeLG*n.lineHeightLG+n.padding*2-1:0,_=useDataBlockRequestData(),{count:v,pageSize:C}=(_==null?void 0:_.meta)||{},S=v>C?n.controlHeightSM+1*n.paddingLG:0,b=u&&d?n.controlHeight+2*n.padding+n.margin:0;return r-h-n.paddingLG-f-S-b},FormComponent=e=>{const t=e,{form:o,children:r}=t,i=W(t,["form","children"]),n=(0,import_react.useField)(),a=(0,import_react.useFieldSchema)(),l=getCardItemSchema==null?void 0:getCardItemSchema(a),c=useAttach(o.createVoidField(P(x({},n.props),{basePath:""}))),u=useFormBlockHeight(),{token:d}=import_antd.theme.useToken(),{layout:m="vertical",labelAlign:p="left",labelWidth:g=120,labelWrap:h=!0}=(l==null?void 0:l["x-component-props"])||{};return(0,import_jsx_runtime.jsx)(import_react.FieldContext.Provider,{value:void 0,children:(0,import_jsx_runtime.jsx)(import_react.FormContext.Provider,{value:o,children:(0,import_jsx_runtime.jsx)(import_antd_v5.FormLayout,P(x({layout:m},i),{labelAlign:p,labelWidth:m==="horizontal"?g:null,labelWrap:h,children:(0,import_jsx_runtime.jsx)("div",{className:import_css.css`
|
|
599
599
|
.nb-grid-container {
|
|
600
600
|
height: ${u?u+"px":"100%"};
|
|
601
601
|
overflow-y: auto;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/client",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.24",
|
|
4
4
|
"license": "AGPL-3.0",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.mjs",
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
"@formily/reactive-react": "^2.2.27",
|
|
28
28
|
"@formily/shared": "^2.2.27",
|
|
29
29
|
"@formily/validator": "^2.2.27",
|
|
30
|
-
"@nocobase/evaluators": "1.5.
|
|
31
|
-
"@nocobase/sdk": "1.5.
|
|
32
|
-
"@nocobase/utils": "1.5.
|
|
30
|
+
"@nocobase/evaluators": "1.5.24",
|
|
31
|
+
"@nocobase/sdk": "1.5.24",
|
|
32
|
+
"@nocobase/utils": "1.5.24",
|
|
33
33
|
"ahooks": "^3.7.2",
|
|
34
34
|
"antd": "5.12.8",
|
|
35
35
|
"antd-style": "3.7.1",
|
|
@@ -81,5 +81,5 @@
|
|
|
81
81
|
"dumi": "2.2.14",
|
|
82
82
|
"dumi-theme-nocobase": "^0.2.28"
|
|
83
83
|
},
|
|
84
|
-
"gitHead": "
|
|
84
|
+
"gitHead": "8187daacdcc7b6db09a95015f23354bcf350a9d2"
|
|
85
85
|
}
|