@nocobase/client 0.9.2-alpha.4 → 0.9.4-alpha.1
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/acl/ACLProvider.js +2 -2
- package/es/acl/Configuration/RoleConfigure.js +15 -8
- package/es/api-client/APIClient.d.ts +2 -0
- package/es/api-client/APIClient.js +11 -0
- package/es/block-provider/BlockProvider.js +58 -17
- package/es/block-provider/DetailsBlockProvider.js +13 -1
- package/es/block-provider/FormBlockProvider.js +30 -13
- package/es/block-provider/hooks/index.d.ts +10 -0
- package/es/block-provider/hooks/index.js +521 -283
- package/es/collection-manager/CollectionField.js +3 -3
- package/es/collection-manager/CollectionFieldProvider.js +2 -1
- package/es/collection-manager/Configuration/AddFieldAction.js +3 -3
- package/es/collection-manager/Configuration/CollectionFields.d.ts +1 -1
- package/es/collection-manager/Configuration/CollectionFields.js +2 -5
- package/es/collection-manager/Configuration/ConfigurationTabs.js +7 -6
- package/es/collection-manager/Configuration/EditFieldAction.js +0 -1
- package/es/collection-manager/Configuration/OverridingCollectionField.js +0 -1
- package/es/collection-manager/action-hooks.d.ts +1 -1
- package/es/collection-manager/action-hooks.js +18 -7
- package/es/collection-manager/hooks/useCollection.d.ts +1 -1
- package/es/collection-manager/hooks/useCollectionDataSource.js +4 -4
- package/es/collection-manager/interfaces/createdBy.js +1 -1
- package/es/collection-manager/interfaces/linkTo.js +3 -39
- package/es/collection-manager/interfaces/m2m.js +4 -38
- package/es/collection-manager/interfaces/m2o.js +4 -38
- package/es/collection-manager/interfaces/o2m.js +4 -68
- package/es/collection-manager/interfaces/o2o.js +25 -119
- package/es/collection-manager/interfaces/updatedBy.js +1 -1
- package/es/collection-manager/templates/expression.js +1 -1
- package/es/collection-manager/templates/tree.js +2 -2
- package/es/filter-provider/FilterProvider.js +3 -1
- package/es/filter-provider/utils.js +1 -1
- package/es/index.d.ts +1 -0
- package/es/index.js +1 -0
- package/es/locale/en_US.d.ts +19 -1
- package/es/locale/en_US.js +22 -4
- package/es/locale/es_ES.d.ts +692 -0
- package/es/locale/es_ES.js +691 -0
- package/es/locale/ja_JP.d.ts +8 -1
- package/es/locale/ja_JP.js +9 -2
- package/es/locale/pt_BR.d.ts +5 -1
- package/es/locale/pt_BR.js +6 -2
- package/es/locale/ru_RU.d.ts +5 -1
- package/es/locale/ru_RU.js +6 -2
- package/es/locale/tr_TR.d.ts +5 -1
- package/es/locale/tr_TR.js +6 -2
- package/es/locale/zh_CN.d.ts +27 -1
- package/es/locale/zh_CN.js +28 -2
- package/es/record-provider/index.d.ts +4 -0
- package/es/record-provider/index.js +3 -0
- package/es/schema-component/antd/action/Action.Designer.js +10 -8
- package/es/schema-component/antd/action/Action.Drawer.js +4 -1
- package/es/schema-component/antd/action/ActionBar.js +25 -18
- package/es/schema-component/antd/association-field/AssociationFieldProvider.d.ts +2 -0
- package/es/schema-component/antd/association-field/AssociationFieldProvider.js +30 -0
- package/es/schema-component/antd/association-field/AssociationSelect.d.ts +14 -0
- package/es/schema-component/antd/association-field/AssociationSelect.js +63 -0
- package/es/schema-component/antd/association-field/Editable.d.ts +2 -0
- package/es/schema-component/antd/association-field/Editable.js +112 -0
- package/es/schema-component/antd/association-field/FileManager.d.ts +4 -0
- package/es/schema-component/antd/association-field/FileManager.js +243 -0
- package/es/schema-component/antd/association-field/InternalNester.d.ts +1 -0
- package/es/schema-component/antd/association-field/InternalNester.js +29 -0
- package/es/schema-component/antd/association-field/InternalPicker.d.ts +2 -0
- package/es/schema-component/antd/association-field/InternalPicker.js +236 -0
- package/es/schema-component/antd/association-field/InternalSubTable.d.ts +1 -0
- package/es/schema-component/antd/association-field/InternalSubTable.js +28 -0
- package/es/schema-component/antd/association-field/InternalViewer.d.ts +2 -0
- package/es/schema-component/antd/association-field/InternalViewer.js +112 -0
- package/es/schema-component/antd/association-field/Nester.d.ts +1 -0
- package/es/schema-component/antd/association-field/Nester.js +71 -0
- package/es/schema-component/antd/association-field/ReadPretty.d.ts +2 -0
- package/es/schema-component/antd/association-field/ReadPretty.js +22 -0
- package/es/schema-component/antd/association-field/SubTable.d.ts +1 -0
- package/es/schema-component/antd/association-field/SubTable.js +25 -0
- package/es/schema-component/antd/association-field/components/CreateRecordAction.d.ts +2 -0
- package/es/schema-component/antd/association-field/components/CreateRecordAction.js +61 -0
- package/es/schema-component/antd/association-field/context.d.ts +8 -0
- package/es/schema-component/antd/association-field/context.js +2 -0
- package/es/schema-component/antd/association-field/hooks.d.ts +9 -0
- package/es/schema-component/antd/association-field/hooks.js +96 -0
- package/es/schema-component/antd/association-field/index.d.ts +1 -0
- package/es/schema-component/antd/association-field/index.js +14 -0
- package/es/schema-component/antd/association-field/schema.d.ts +142 -0
- package/es/schema-component/antd/association-field/schema.js +141 -0
- package/es/schema-component/antd/association-field/util.d.ts +8 -0
- package/es/schema-component/antd/association-field/util.js +84 -0
- package/es/schema-component/antd/association-filter/AssociationFilter.Item.js +3 -3
- package/es/schema-component/antd/association-select/AssociationSelect.js +49 -231
- package/es/schema-component/antd/association-select/useServiceOptions.js +2 -2
- package/es/schema-component/antd/collection-select/CollectionSelect.js +5 -0
- package/es/schema-component/antd/expand-action/Expand.Action.Design.d.ts +1 -0
- package/es/schema-component/antd/expand-action/Expand.Action.Design.js +112 -0
- package/es/schema-component/antd/expand-action/Expand.Action.d.ts +1 -0
- package/es/schema-component/antd/expand-action/Expand.Action.js +40 -0
- package/es/schema-component/antd/expand-action/index.d.ts +1 -0
- package/es/schema-component/antd/expand-action/index.js +5 -0
- package/es/schema-component/antd/filter/Filter.Action.Designer.js +10 -12
- package/es/schema-component/antd/filter/FilterItem.js +1 -1
- package/es/schema-component/antd/filter/useOperators.d.ts +1 -1
- package/es/schema-component/antd/form/Form.js +4 -4
- package/es/schema-component/antd/form-item/FormItem.d.ts +2 -1
- package/es/schema-component/antd/form-item/FormItem.js +263 -168
- package/es/schema-component/antd/form-item/SchemaSettingOptions.js +39 -61
- package/es/schema-component/antd/form-v2/Form.Designer.js +1 -0
- package/es/schema-component/antd/form-v2/Templates.d.ts +20 -0
- package/es/schema-component/antd/form-v2/Templates.js +40 -12
- package/es/schema-component/antd/form-v2/utils.js +3 -1
- package/es/schema-component/antd/gantt/components/other/tooltip.js +1 -1
- package/es/schema-component/antd/grid/Grid.js +34 -24
- package/es/schema-component/antd/grid-card/GridCard.Decorator.d.ts +5 -0
- package/es/schema-component/antd/grid-card/GridCard.Decorator.js +65 -0
- package/es/schema-component/antd/grid-card/GridCard.Designer.d.ts +1 -0
- package/es/schema-component/antd/grid-card/GridCard.Designer.js +243 -0
- package/es/schema-component/antd/grid-card/GridCard.Item.d.ts +1 -0
- package/es/schema-component/antd/grid-card/GridCard.Item.js +18 -0
- package/es/schema-component/antd/grid-card/GridCard.d.ts +8 -0
- package/es/schema-component/antd/grid-card/GridCard.js +103 -0
- package/es/schema-component/antd/grid-card/hooks.d.ts +4 -0
- package/es/schema-component/antd/grid-card/hooks.js +9 -0
- package/es/schema-component/antd/grid-card/index.d.ts +1 -0
- package/es/schema-component/antd/grid-card/index.js +1 -0
- package/es/schema-component/antd/grid-card/options.d.ts +20 -0
- package/es/schema-component/antd/grid-card/options.js +20 -0
- package/es/schema-component/antd/index.d.ts +5 -1
- package/es/schema-component/antd/index.js +5 -1
- package/es/schema-component/antd/list/List.Decorator.d.ts +5 -0
- package/es/schema-component/antd/list/List.Decorator.js +59 -0
- package/es/schema-component/antd/list/List.Designer.d.ts +1 -0
- package/es/schema-component/antd/list/List.Designer.js +205 -0
- package/es/schema-component/antd/list/List.Item.d.ts +1 -0
- package/es/schema-component/antd/list/List.Item.js +15 -0
- package/es/schema-component/antd/list/List.d.ts +8 -0
- package/es/schema-component/antd/list/List.js +83 -0
- package/es/schema-component/antd/list/hooks.d.ts +4 -0
- package/es/schema-component/antd/list/hooks.js +9 -0
- package/es/schema-component/antd/list/index.d.ts +1 -0
- package/es/schema-component/antd/list/index.js +1 -0
- package/es/schema-component/antd/menu/Menu.js +6 -3
- package/es/schema-component/antd/record-picker/InputRecordPicker.d.ts +1 -0
- package/es/schema-component/antd/record-picker/InputRecordPicker.js +32 -12
- package/es/schema-component/antd/remote-select/RemoteSelect.js +23 -23
- package/es/schema-component/antd/select/Select.js +2 -0
- package/es/schema-component/antd/table/Table.Void.Designer.js +1 -0
- package/es/schema-component/antd/table-v2/Table.Column.Designer.js +18 -9
- package/es/schema-component/antd/table-v2/Table.Index.d.ts +1 -0
- package/es/schema-component/antd/table-v2/Table.Index.js +6 -0
- package/es/schema-component/antd/table-v2/Table.js +9 -5
- package/es/schema-component/antd/table-v2/TableBlockDesigner.js +2 -1
- package/es/schema-component/antd/table-v2/TableSelectorDesigner.js +1 -0
- package/es/schema-component/antd/table-v2/hooks/useUserVariable.d.ts +22 -0
- package/es/schema-component/antd/table-v2/hooks/useUserVariable.js +65 -0
- package/es/schema-component/antd/table-v2/index.js +3 -1
- package/es/schema-component/antd/table-v2/utils.js +1 -1
- package/es/schema-component/antd/variable/Input.js +11 -8
- package/es/schema-component/antd/variable/TextArea.js +2 -5
- package/es/schema-component/common/dnd-context/index.js +3 -2
- package/es/schema-component/common/sortable-item/SortableItem.js +4 -1
- package/es/schema-component/common/utils/uitls.js +1 -1
- package/es/schema-component/core/SchemaComponentProvider.js +2 -2
- package/es/schema-component/hooks/index.d.ts +1 -0
- package/es/schema-component/hooks/index.js +2 -1
- package/es/schema-component/hooks/useFieldModeOptions.d.ts +4 -0
- package/es/schema-component/hooks/useFieldModeOptions.js +105 -0
- package/es/schema-initializer/SchemaInitializerProvider.d.ts +1 -0
- package/es/schema-initializer/SchemaInitializerProvider.js +23 -10
- package/es/schema-initializer/buttons/BlockInitializers.js +10 -0
- package/es/schema-initializer/buttons/CustomFormItemInitializers.js +4 -2
- package/es/schema-initializer/buttons/FormActionInitializers.d.ts +0 -116
- package/es/schema-initializer/buttons/FormActionInitializers.js +106 -100
- package/es/schema-initializer/buttons/GanttActionInitializers.d.ts +0 -19
- package/es/schema-initializer/buttons/GridCardActionInitializers.d.ts +195 -0
- package/es/schema-initializer/buttons/GridCardActionInitializers.js +278 -0
- package/es/schema-initializer/buttons/ListActionInitializers.d.ts +195 -0
- package/es/schema-initializer/buttons/ListActionInitializers.js +278 -0
- package/es/schema-initializer/buttons/TableActionColumnInitializers.js +1 -1
- package/es/schema-initializer/buttons/TableActionInitializers.d.ts +0 -20
- package/es/schema-initializer/buttons/TableActionInitializers.js +29 -35
- package/es/schema-initializer/buttons/TableColumnInitializers.js +4 -1
- package/es/schema-initializer/buttons/index.d.ts +3 -0
- package/es/schema-initializer/buttons/index.js +3 -0
- package/es/schema-initializer/components/BulkEditField.js +7 -5
- package/es/schema-initializer/components/CreateRecordAction.d.ts +2 -1
- package/es/schema-initializer/components/CreateRecordAction.js +55 -33
- package/es/schema-initializer/components/DeletedField.d.ts +1 -0
- package/es/schema-initializer/components/DeletedField.js +11 -0
- package/es/schema-initializer/components/assigned-field/AssignedField.js +35 -23
- package/es/schema-initializer/items/ExpandActionInitializer.d.ts +0 -1
- package/es/schema-initializer/items/ExpandActionInitializer.js +9 -34
- package/es/schema-initializer/items/GridCardBlockInitializer.d.ts +1 -0
- package/es/schema-initializer/items/GridCardBlockInitializer.js +47 -0
- package/es/schema-initializer/items/ListBlockInitializer.d.ts +1 -0
- package/es/schema-initializer/items/ListBlockInitializer.js +47 -0
- package/es/schema-initializer/items/SelectActionInitializer.d.ts +1 -0
- package/es/schema-initializer/items/SelectActionInitializer.js +65 -0
- package/es/schema-initializer/items/index.d.ts +3 -0
- package/es/schema-initializer/items/index.js +3 -0
- package/es/schema-initializer/utils.d.ts +112 -0
- package/es/schema-initializer/utils.js +224 -38
- package/es/schema-items/GeneralSchemaItems.d.ts +4 -0
- package/es/schema-items/GeneralSchemaItems.js +148 -0
- package/es/schema-items/index.d.ts +1 -0
- package/es/schema-items/index.js +2 -1
- package/es/schema-settings/DataTemplates/FormDataTemplates.d.ts +1 -0
- package/es/schema-settings/DataTemplates/FormDataTemplates.js +117 -42
- package/es/schema-settings/DataTemplates/components/Designer.d.ts +7 -0
- package/es/schema-settings/DataTemplates/components/Designer.js +179 -0
- package/es/schema-settings/DataTemplates/hooks/useCollectionState.d.ts +6 -1
- package/es/schema-settings/DataTemplates/hooks/useCollectionState.js +204 -96
- package/es/schema-settings/GeneralSchemaDesigner.js +19 -15
- package/es/schema-settings/LinkageRules/FilterDynamicComponent.js +1 -1
- package/es/schema-settings/LinkageRules/Variables.d.ts +1 -1
- package/es/schema-settings/LinkageRules/Variables.js +7 -4
- package/es/schema-settings/SchemaSettings.d.ts +1 -1
- package/es/schema-settings/SchemaSettings.js +53 -29
- package/es/schema-settings/VariableInput/hooks/useUserVariable.js +1 -1
- package/es/schema-settings/hooks/useIsShowMultipleSwitch.d.ts +4 -0
- package/es/schema-settings/hooks/useIsShowMultipleSwitch.js +18 -0
- package/es/schema-templates/BlockTemplateDetails.js +1 -1
- package/es/user/CurrentUser.js +118 -10
- package/lib/acl/ACLProvider.js +2 -2
- package/lib/acl/Configuration/RoleConfigure.js +15 -8
- package/lib/api-client/APIClient.d.ts +2 -0
- package/lib/api-client/APIClient.js +11 -0
- package/lib/block-provider/BlockProvider.js +57 -16
- package/lib/block-provider/DetailsBlockProvider.js +13 -1
- package/lib/block-provider/FormBlockProvider.js +31 -15
- package/lib/block-provider/hooks/index.d.ts +10 -0
- package/lib/block-provider/hooks/index.js +531 -290
- package/lib/collection-manager/CollectionField.js +3 -3
- package/lib/collection-manager/CollectionFieldProvider.js +2 -1
- package/lib/collection-manager/Configuration/AddFieldAction.js +2 -2
- package/lib/collection-manager/Configuration/CollectionFields.d.ts +1 -1
- package/lib/collection-manager/Configuration/CollectionFields.js +2 -5
- package/lib/collection-manager/Configuration/ConfigurationTabs.js +7 -6
- package/lib/collection-manager/Configuration/EditFieldAction.js +0 -1
- package/lib/collection-manager/Configuration/OverridingCollectionField.js +0 -1
- package/lib/collection-manager/action-hooks.d.ts +1 -1
- package/lib/collection-manager/action-hooks.js +18 -7
- package/lib/collection-manager/hooks/useCollection.d.ts +1 -1
- package/lib/collection-manager/hooks/useCollectionDataSource.js +4 -4
- package/lib/collection-manager/interfaces/createdBy.js +1 -1
- package/lib/collection-manager/interfaces/linkTo.js +2 -38
- package/lib/collection-manager/interfaces/m2m.js +3 -37
- package/lib/collection-manager/interfaces/m2o.js +3 -37
- package/lib/collection-manager/interfaces/o2m.js +6 -70
- package/lib/collection-manager/interfaces/o2o.js +30 -124
- package/lib/collection-manager/interfaces/updatedBy.js +1 -1
- package/lib/collection-manager/templates/expression.js +1 -1
- package/lib/collection-manager/templates/tree.js +2 -2
- package/lib/filter-provider/FilterProvider.js +3 -1
- package/lib/filter-provider/utils.js +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +11 -0
- package/lib/locale/en_US.d.ts +19 -1
- package/lib/locale/en_US.js +22 -4
- package/lib/locale/es_ES.d.ts +692 -0
- package/lib/locale/es_ES.js +698 -0
- package/lib/locale/ja_JP.d.ts +8 -1
- package/lib/locale/ja_JP.js +9 -2
- package/lib/locale/pt_BR.d.ts +5 -1
- package/lib/locale/pt_BR.js +6 -2
- package/lib/locale/ru_RU.d.ts +5 -1
- package/lib/locale/ru_RU.js +6 -2
- package/lib/locale/tr_TR.d.ts +5 -1
- package/lib/locale/tr_TR.js +6 -2
- package/lib/locale/zh_CN.d.ts +27 -1
- package/lib/locale/zh_CN.js +28 -2
- package/lib/record-provider/index.d.ts +4 -0
- package/lib/record-provider/index.js +5 -1
- package/lib/schema-component/antd/action/Action.Designer.js +10 -8
- package/lib/schema-component/antd/action/Action.Drawer.js +4 -1
- package/lib/schema-component/antd/action/ActionBar.js +23 -16
- package/lib/schema-component/antd/association-field/AssociationFieldProvider.d.ts +2 -0
- package/lib/schema-component/antd/association-field/AssociationFieldProvider.js +40 -0
- package/lib/schema-component/antd/association-field/AssociationSelect.d.ts +14 -0
- package/lib/schema-component/antd/association-field/AssociationSelect.js +72 -0
- package/lib/schema-component/antd/association-field/Editable.d.ts +2 -0
- package/lib/schema-component/antd/association-field/Editable.js +121 -0
- package/lib/schema-component/antd/association-field/FileManager.d.ts +4 -0
- package/lib/schema-component/antd/association-field/FileManager.js +253 -0
- package/lib/schema-component/antd/association-field/InternalNester.d.ts +1 -0
- package/lib/schema-component/antd/association-field/InternalNester.js +39 -0
- package/lib/schema-component/antd/association-field/InternalPicker.d.ts +2 -0
- package/lib/schema-component/antd/association-field/InternalPicker.js +246 -0
- package/lib/schema-component/antd/association-field/InternalSubTable.d.ts +1 -0
- package/lib/schema-component/antd/association-field/InternalSubTable.js +39 -0
- package/lib/schema-component/antd/association-field/InternalViewer.d.ts +2 -0
- package/lib/schema-component/antd/association-field/InternalViewer.js +123 -0
- package/lib/schema-component/antd/association-field/Nester.d.ts +1 -0
- package/lib/schema-component/antd/association-field/Nester.js +80 -0
- package/lib/schema-component/antd/association-field/ReadPretty.d.ts +2 -0
- package/lib/schema-component/antd/association-field/ReadPretty.js +30 -0
- package/lib/schema-component/antd/association-field/SubTable.d.ts +1 -0
- package/lib/schema-component/antd/association-field/SubTable.js +33 -0
- package/lib/schema-component/antd/association-field/components/CreateRecordAction.d.ts +2 -0
- package/lib/schema-component/antd/association-field/components/CreateRecordAction.js +71 -0
- package/lib/schema-component/antd/association-field/context.d.ts +8 -0
- package/lib/schema-component/antd/association-field/context.js +9 -0
- package/lib/schema-component/antd/association-field/hooks.d.ts +9 -0
- package/lib/schema-component/antd/association-field/hooks.js +107 -0
- package/lib/schema-component/antd/association-field/index.d.ts +1 -0
- package/lib/schema-component/antd/association-field/index.js +21 -0
- package/lib/schema-component/antd/association-field/schema.d.ts +142 -0
- package/lib/schema-component/antd/association-field/schema.js +148 -0
- package/lib/schema-component/antd/association-field/util.d.ts +8 -0
- package/lib/schema-component/antd/association-field/util.js +98 -0
- package/lib/schema-component/antd/association-filter/AssociationFilter.Item.js +3 -3
- package/lib/schema-component/antd/association-select/AssociationSelect.js +49 -231
- package/lib/schema-component/antd/association-select/useServiceOptions.js +2 -2
- package/lib/schema-component/antd/collection-select/CollectionSelect.js +5 -0
- package/lib/schema-component/antd/expand-action/Expand.Action.Design.d.ts +1 -0
- package/lib/schema-component/antd/expand-action/Expand.Action.Design.js +120 -0
- package/lib/schema-component/antd/expand-action/Expand.Action.d.ts +1 -0
- package/lib/schema-component/antd/expand-action/Expand.Action.js +48 -0
- package/lib/schema-component/antd/expand-action/index.d.ts +1 -0
- package/lib/schema-component/antd/expand-action/index.js +12 -0
- package/lib/schema-component/antd/filter/Filter.Action.Designer.js +10 -12
- package/lib/schema-component/antd/filter/FilterItem.js +1 -1
- package/lib/schema-component/antd/filter/useOperators.d.ts +1 -1
- package/lib/schema-component/antd/form/Form.js +4 -4
- package/lib/schema-component/antd/form-item/FormItem.d.ts +2 -1
- package/lib/schema-component/antd/form-item/FormItem.js +258 -162
- package/lib/schema-component/antd/form-item/SchemaSettingOptions.js +37 -59
- package/lib/schema-component/antd/form-v2/Form.Designer.js +1 -0
- package/lib/schema-component/antd/form-v2/Templates.d.ts +20 -0
- package/lib/schema-component/antd/form-v2/Templates.js +39 -11
- package/lib/schema-component/antd/form-v2/utils.js +3 -1
- package/lib/schema-component/antd/gantt/components/other/tooltip.js +1 -1
- package/lib/schema-component/antd/grid/Grid.js +33 -23
- package/lib/schema-component/antd/grid-card/GridCard.Decorator.d.ts +5 -0
- package/lib/schema-component/antd/grid-card/GridCard.Decorator.js +77 -0
- package/lib/schema-component/antd/grid-card/GridCard.Designer.d.ts +1 -0
- package/lib/schema-component/antd/grid-card/GridCard.Designer.js +253 -0
- package/lib/schema-component/antd/grid-card/GridCard.Item.d.ts +1 -0
- package/lib/schema-component/antd/grid-card/GridCard.Item.js +26 -0
- package/lib/schema-component/antd/grid-card/GridCard.d.ts +8 -0
- package/lib/schema-component/antd/grid-card/GridCard.js +112 -0
- package/lib/schema-component/antd/grid-card/hooks.d.ts +4 -0
- package/lib/schema-component/antd/grid-card/hooks.js +16 -0
- package/lib/schema-component/antd/grid-card/index.d.ts +1 -0
- package/lib/schema-component/antd/grid-card/index.js +16 -0
- package/lib/schema-component/antd/grid-card/options.d.ts +20 -0
- package/lib/schema-component/antd/grid-card/options.js +31 -0
- package/lib/schema-component/antd/index.d.ts +5 -1
- package/lib/schema-component/antd/index.js +55 -11
- package/lib/schema-component/antd/list/List.Decorator.d.ts +5 -0
- package/lib/schema-component/antd/list/List.Decorator.js +71 -0
- package/lib/schema-component/antd/list/List.Designer.d.ts +1 -0
- package/lib/schema-component/antd/list/List.Designer.js +213 -0
- package/lib/schema-component/antd/list/List.Item.d.ts +1 -0
- package/lib/schema-component/antd/list/List.Item.js +23 -0
- package/lib/schema-component/antd/list/List.d.ts +8 -0
- package/lib/schema-component/antd/list/List.js +92 -0
- package/lib/schema-component/antd/list/hooks.d.ts +4 -0
- package/lib/schema-component/antd/list/hooks.js +16 -0
- package/lib/schema-component/antd/list/index.d.ts +1 -0
- package/lib/schema-component/antd/list/index.js +16 -0
- package/lib/schema-component/antd/menu/Menu.js +6 -3
- package/lib/schema-component/antd/record-picker/InputRecordPicker.d.ts +1 -0
- package/lib/schema-component/antd/record-picker/InputRecordPicker.js +34 -13
- package/lib/schema-component/antd/remote-select/RemoteSelect.js +22 -22
- package/lib/schema-component/antd/select/Select.js +2 -0
- package/lib/schema-component/antd/table/Table.Void.Designer.js +1 -0
- package/lib/schema-component/antd/table-v2/Table.Column.Designer.js +18 -9
- package/lib/schema-component/antd/table-v2/Table.Index.d.ts +1 -0
- package/lib/schema-component/antd/table-v2/Table.Index.js +14 -0
- package/lib/schema-component/antd/table-v2/Table.js +9 -5
- package/lib/schema-component/antd/table-v2/TableBlockDesigner.js +2 -1
- package/lib/schema-component/antd/table-v2/TableSelectorDesigner.js +1 -0
- package/lib/schema-component/antd/table-v2/hooks/useUserVariable.d.ts +22 -0
- package/lib/schema-component/antd/table-v2/hooks/useUserVariable.js +73 -0
- package/lib/schema-component/antd/table-v2/index.js +3 -1
- package/lib/schema-component/antd/table-v2/utils.js +1 -1
- package/lib/schema-component/antd/variable/Input.js +11 -8
- package/lib/schema-component/antd/variable/TextArea.js +2 -5
- package/lib/schema-component/common/dnd-context/index.js +3 -2
- package/lib/schema-component/common/sortable-item/SortableItem.js +4 -1
- package/lib/schema-component/common/utils/uitls.js +1 -1
- package/lib/schema-component/core/SchemaComponentProvider.js +2 -2
- package/lib/schema-component/hooks/index.d.ts +1 -0
- package/lib/schema-component/hooks/index.js +11 -0
- package/lib/schema-component/hooks/useFieldModeOptions.d.ts +4 -0
- package/lib/schema-component/hooks/useFieldModeOptions.js +112 -0
- package/lib/schema-initializer/SchemaInitializerProvider.d.ts +1 -0
- package/lib/schema-initializer/SchemaInitializerProvider.js +22 -9
- package/lib/schema-initializer/buttons/BlockInitializers.js +10 -0
- package/lib/schema-initializer/buttons/CustomFormItemInitializers.js +4 -2
- package/lib/schema-initializer/buttons/FormActionInitializers.d.ts +0 -116
- package/lib/schema-initializer/buttons/FormActionInitializers.js +106 -100
- package/lib/schema-initializer/buttons/GanttActionInitializers.d.ts +0 -19
- package/lib/schema-initializer/buttons/GridCardActionInitializers.d.ts +195 -0
- package/lib/schema-initializer/buttons/GridCardActionInitializers.js +285 -0
- package/lib/schema-initializer/buttons/ListActionInitializers.d.ts +195 -0
- package/lib/schema-initializer/buttons/ListActionInitializers.js +285 -0
- package/lib/schema-initializer/buttons/TableActionColumnInitializers.js +1 -1
- package/lib/schema-initializer/buttons/TableActionInitializers.d.ts +0 -20
- package/lib/schema-initializer/buttons/TableActionInitializers.js +29 -35
- package/lib/schema-initializer/buttons/TableColumnInitializers.js +4 -1
- package/lib/schema-initializer/buttons/index.d.ts +3 -0
- package/lib/schema-initializer/buttons/index.js +22 -0
- package/lib/schema-initializer/components/BulkEditField.js +7 -5
- package/lib/schema-initializer/components/CreateRecordAction.d.ts +2 -1
- package/lib/schema-initializer/components/CreateRecordAction.js +58 -35
- package/lib/schema-initializer/components/DeletedField.d.ts +1 -0
- package/lib/schema-initializer/components/DeletedField.js +19 -0
- package/lib/schema-initializer/components/assigned-field/AssignedField.js +34 -22
- package/lib/schema-initializer/items/ExpandActionInitializer.d.ts +0 -1
- package/lib/schema-initializer/items/ExpandActionInitializer.js +11 -37
- package/lib/schema-initializer/items/GridCardBlockInitializer.d.ts +1 -0
- package/lib/schema-initializer/items/GridCardBlockInitializer.js +55 -0
- package/lib/schema-initializer/items/ListBlockInitializer.d.ts +1 -0
- package/lib/schema-initializer/items/ListBlockInitializer.js +55 -0
- package/lib/schema-initializer/items/SelectActionInitializer.d.ts +1 -0
- package/lib/schema-initializer/items/SelectActionInitializer.js +73 -0
- package/lib/schema-initializer/items/index.d.ts +3 -0
- package/lib/schema-initializer/items/index.js +33 -0
- package/lib/schema-initializer/utils.d.ts +112 -0
- package/lib/schema-initializer/utils.js +227 -39
- package/lib/schema-items/GeneralSchemaItems.d.ts +4 -0
- package/lib/schema-items/GeneralSchemaItems.js +156 -0
- package/lib/schema-items/index.d.ts +1 -0
- package/lib/schema-items/index.js +11 -0
- package/lib/schema-settings/DataTemplates/FormDataTemplates.d.ts +1 -0
- package/lib/schema-settings/DataTemplates/FormDataTemplates.js +119 -41
- package/lib/schema-settings/DataTemplates/components/Designer.d.ts +7 -0
- package/lib/schema-settings/DataTemplates/components/Designer.js +188 -0
- package/lib/schema-settings/DataTemplates/hooks/useCollectionState.d.ts +6 -1
- package/lib/schema-settings/DataTemplates/hooks/useCollectionState.js +204 -95
- package/lib/schema-settings/GeneralSchemaDesigner.js +21 -15
- package/lib/schema-settings/LinkageRules/FilterDynamicComponent.js +1 -1
- package/lib/schema-settings/LinkageRules/Variables.d.ts +1 -1
- package/lib/schema-settings/LinkageRules/Variables.js +7 -4
- package/lib/schema-settings/SchemaSettings.d.ts +1 -1
- package/lib/schema-settings/SchemaSettings.js +53 -29
- package/lib/schema-settings/VariableInput/hooks/useUserVariable.js +1 -1
- package/lib/schema-settings/hooks/useIsShowMultipleSwitch.d.ts +4 -0
- package/lib/schema-settings/hooks/useIsShowMultipleSwitch.js +24 -0
- package/lib/user/CurrentUser.js +116 -8
- package/package.json +5 -6
- package/tsconfig.json +8 -0
|
@@ -15,6 +15,7 @@ var _collectionManager = require("../../../collection-manager");
|
|
|
15
15
|
var _schemaSettings = require("../../../schema-settings");
|
|
16
16
|
var _hooks = require("../../hooks");
|
|
17
17
|
var _useOperators = require("../filter/useOperators");
|
|
18
|
+
var _FormItem = require("./FormItem");
|
|
18
19
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
20
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
20
21
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
@@ -377,11 +378,11 @@ var EditDefaultValue = function EditDefaultValue() {
|
|
|
377
378
|
type: 'object',
|
|
378
379
|
title: t('Set default value'),
|
|
379
380
|
properties: {
|
|
380
|
-
default: _objectSpread(_objectSpread({}, collectionField.uiSchema), {}, {
|
|
381
|
+
default: _objectSpread(_objectSpread({}, collectionField === null || collectionField === void 0 ? void 0 : collectionField.uiSchema), {}, {
|
|
381
382
|
name: 'default',
|
|
382
383
|
title: t('Default value'),
|
|
383
384
|
'x-decorator': 'FormItem',
|
|
384
|
-
default: fieldSchema.default || collectionField.defaultValue
|
|
385
|
+
default: fieldSchema.default || (collectionField === null || collectionField === void 0 ? void 0 : collectionField.defaultValue)
|
|
385
386
|
})
|
|
386
387
|
}
|
|
387
388
|
},
|
|
@@ -401,64 +402,39 @@ var EditDefaultValue = function EditDefaultValue() {
|
|
|
401
402
|
};
|
|
402
403
|
exports.EditDefaultValue = EditDefaultValue;
|
|
403
404
|
var EditComponent = function EditComponent() {
|
|
405
|
+
var _field$componentProps;
|
|
404
406
|
var _useCollectionManager4 = (0, _collectionManager.useCollectionManager)(),
|
|
405
|
-
getInterface = _useCollectionManager4.getInterface,
|
|
406
407
|
getCollectionJoinField = _useCollectionManager4.getCollectionJoinField,
|
|
407
408
|
getCollection = _useCollectionManager4.getCollection;
|
|
408
409
|
var _useCollection4 = (0, _collectionManager.useCollection)(),
|
|
409
|
-
getField = _useCollection4.getField
|
|
410
|
-
template = _useCollection4.template;
|
|
411
|
-
var tk = (0, _blockProvider.useFilterByTk)();
|
|
412
|
-
var _useFormBlockContext3 = (0, _blockProvider.useFormBlockContext)(),
|
|
413
|
-
form = _useFormBlockContext3.form;
|
|
410
|
+
getField = _useCollection4.getField;
|
|
414
411
|
var field = (0, _react.useField)();
|
|
415
412
|
var fieldSchema = (0, _react.useFieldSchema)();
|
|
416
413
|
var _useTranslation7 = (0, _reactI18next.useTranslation)(),
|
|
417
414
|
t = _useTranslation7.t;
|
|
418
415
|
var _useDesignable7 = (0, _hooks.useDesignable)(),
|
|
419
|
-
dn = _useDesignable7.dn
|
|
420
|
-
insertAdjacent = _useDesignable7.insertAdjacent;
|
|
416
|
+
dn = _useDesignable7.dn;
|
|
421
417
|
var collectionField = getField(fieldSchema['name']) || getCollectionJoinField(fieldSchema['x-collection-field']);
|
|
422
|
-
var
|
|
423
|
-
var
|
|
424
|
-
var
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
'x-validator': fieldSchema['x-validator'],
|
|
441
|
-
'x-collection-field': fieldSchema['x-collection-field'],
|
|
442
|
-
'x-decorator-props': fieldSchema['x-decorator-props'],
|
|
443
|
-
'x-component-props': _objectSpread(_objectSpread({}, collectionField === null || collectionField === void 0 ? void 0 : (_collectionField$uiSc4 = collectionField.uiSchema) === null || _collectionField$uiSc4 === void 0 ? void 0 : _collectionField$uiSc4['x-component-props']), fieldSchema['x-component-props'])
|
|
444
|
-
};
|
|
445
|
-
interfaceConfig === null || interfaceConfig === void 0 ? void 0 : (_interfaceConfig$sche = interfaceConfig.schemaInitialize) === null || _interfaceConfig$sche === void 0 ? void 0 : _interfaceConfig$sche.call(interfaceConfig, schema, {
|
|
446
|
-
field: collectionField,
|
|
447
|
-
block: 'Form',
|
|
448
|
-
readPretty: field.readPretty,
|
|
449
|
-
action: tk ? 'get' : null,
|
|
450
|
-
targetCollection: getCollection(collectionField.target)
|
|
451
|
-
});
|
|
452
|
-
insertAdjacent('beforeBegin', divWrap(schema), {
|
|
453
|
-
onSuccess: function onSuccess() {
|
|
454
|
-
dn.remove(null, {
|
|
455
|
-
removeParentsIfNoChildren: true,
|
|
456
|
-
breakRemoveOn: {
|
|
457
|
-
'x-component': 'Grid'
|
|
458
|
-
}
|
|
459
|
-
});
|
|
460
|
-
}
|
|
418
|
+
var fieldModeOptions = (0, _hooks.useFieldModeOptions)();
|
|
419
|
+
var isAssociationField = ['belongsTo', 'hasOne', 'hasMany', 'belongsToMany'].includes(collectionField === null || collectionField === void 0 ? void 0 : collectionField.type);
|
|
420
|
+
var targetCollection = getCollection(collectionField === null || collectionField === void 0 ? void 0 : collectionField.target);
|
|
421
|
+
var isFileField = (0, _FormItem.isFileCollection)(targetCollection);
|
|
422
|
+
return isAssociationField && fieldModeOptions ? /*#__PURE__*/_react2.default.createElement(_schemaSettings.SchemaSettings.SelectItem, {
|
|
423
|
+
key: "field-mode",
|
|
424
|
+
title: t('Field mode'),
|
|
425
|
+
options: fieldModeOptions,
|
|
426
|
+
value: (field === null || field === void 0 ? void 0 : (_field$componentProps = field.componentProps) === null || _field$componentProps === void 0 ? void 0 : _field$componentProps['mode']) || (isFileField ? 'FileManager' : 'Select'),
|
|
427
|
+
onChange: function onChange(mode) {
|
|
428
|
+
var schema = _defineProperty({}, 'x-uid', fieldSchema['x-uid']);
|
|
429
|
+
fieldSchema['x-component-props'] = fieldSchema['x-component-props'] || {};
|
|
430
|
+
fieldSchema['x-component-props']['mode'] = mode;
|
|
431
|
+
schema['x-component-props'] = fieldSchema['x-component-props'];
|
|
432
|
+
field.componentProps = field.componentProps || {};
|
|
433
|
+
field.componentProps.mode = mode;
|
|
434
|
+
dn.emit('patch', {
|
|
435
|
+
schema: schema
|
|
461
436
|
});
|
|
437
|
+
dn.refresh();
|
|
462
438
|
}
|
|
463
439
|
}) : null;
|
|
464
440
|
};
|
|
@@ -468,8 +444,8 @@ var EditPattern = function EditPattern() {
|
|
|
468
444
|
getCollectionJoinField = _useCollectionManager5.getCollectionJoinField;
|
|
469
445
|
var _useCollection5 = (0, _collectionManager.useCollection)(),
|
|
470
446
|
getField = _useCollection5.getField;
|
|
471
|
-
var
|
|
472
|
-
form =
|
|
447
|
+
var _useFormBlockContext3 = (0, _blockProvider.useFormBlockContext)(),
|
|
448
|
+
form = _useFormBlockContext3.form;
|
|
473
449
|
var field = (0, _react.useField)();
|
|
474
450
|
var fieldSchema = (0, _react.useFieldSchema)();
|
|
475
451
|
var _useTranslation8 = (0, _reactI18next.useTranslation)(),
|
|
@@ -562,7 +538,8 @@ var EditOperator = function EditOperator() {
|
|
|
562
538
|
dn = _useDesignable9.dn;
|
|
563
539
|
var operatorList = (0, _useOperators.useOperatorList)();
|
|
564
540
|
var _findFilterOperators2 = findFilterOperators(fieldSchema),
|
|
565
|
-
|
|
541
|
+
_findFilterOperators3 = _findFilterOperators2.operators,
|
|
542
|
+
storedOperators = _findFilterOperators3 === void 0 ? {} : _findFilterOperators3,
|
|
566
543
|
uid = _findFilterOperators2.uid;
|
|
567
544
|
if (operatorList.length && !storedOperators[fieldSchema.name]) {
|
|
568
545
|
storedOperators[fieldSchema.name] = operatorList[0].value;
|
|
@@ -573,9 +550,9 @@ var EditOperator = function EditOperator() {
|
|
|
573
550
|
value: storedOperators[fieldSchema.name],
|
|
574
551
|
options: compile(operatorList),
|
|
575
552
|
onChange: function onChange(v) {
|
|
576
|
-
var
|
|
553
|
+
var _schema6;
|
|
577
554
|
storedOperators[fieldSchema.name] = v;
|
|
578
|
-
var schema = (
|
|
555
|
+
var schema = (_schema6 = {}, _defineProperty(_schema6, 'x-uid', uid), _defineProperty(_schema6, 'x-filter-operators', storedOperators), _schema6);
|
|
579
556
|
dn.emit('patch', {
|
|
580
557
|
schema: schema
|
|
581
558
|
});
|
|
@@ -585,7 +562,7 @@ var EditOperator = function EditOperator() {
|
|
|
585
562
|
};
|
|
586
563
|
exports.EditOperator = EditOperator;
|
|
587
564
|
var EditTitleField = function EditTitleField() {
|
|
588
|
-
var _getCollectionFields, _field$
|
|
565
|
+
var _getCollectionFields, _field$componentProps2, _field$componentProps3;
|
|
589
566
|
var _useCollectionManager6 = (0, _collectionManager.useCollectionManager)(),
|
|
590
567
|
getCollectionFields = _useCollectionManager6.getCollectionFields,
|
|
591
568
|
getCollectionJoinField = _useCollectionManager6.getCollectionJoinField;
|
|
@@ -599,7 +576,7 @@ var EditTitleField = function EditTitleField() {
|
|
|
599
576
|
dn = _useDesignable10.dn;
|
|
600
577
|
var compile = (0, _hooks.useCompile)();
|
|
601
578
|
var collectionField = getField(fieldSchema['name']) || getCollectionJoinField(fieldSchema['x-collection-field']);
|
|
602
|
-
var targetFields = (collectionField === null || collectionField === void 0 ? void 0 : collectionField.target) ? getCollectionFields(collectionField.target) : (_getCollectionFields = getCollectionFields(collectionField === null || collectionField === void 0 ? void 0 : collectionField.targetCollection)) !== null && _getCollectionFields !== void 0 ? _getCollectionFields : [];
|
|
579
|
+
var targetFields = (collectionField === null || collectionField === void 0 ? void 0 : collectionField.target) ? getCollectionFields(collectionField === null || collectionField === void 0 ? void 0 : collectionField.target) : (_getCollectionFields = getCollectionFields(collectionField === null || collectionField === void 0 ? void 0 : collectionField.targetCollection)) !== null && _getCollectionFields !== void 0 ? _getCollectionFields : [];
|
|
603
580
|
var options = targetFields.filter(function (field) {
|
|
604
581
|
return !(field === null || field === void 0 ? void 0 : field.target) && field.type !== 'boolean';
|
|
605
582
|
}).map(function (field) {
|
|
@@ -613,16 +590,17 @@ var EditTitleField = function EditTitleField() {
|
|
|
613
590
|
key: "title-field",
|
|
614
591
|
title: t('Title field'),
|
|
615
592
|
options: options,
|
|
616
|
-
value: field === null || field === void 0 ? void 0 : (_field$
|
|
593
|
+
value: field === null || field === void 0 ? void 0 : (_field$componentProps2 = field.componentProps) === null || _field$componentProps2 === void 0 ? void 0 : (_field$componentProps3 = _field$componentProps2.fieldNames) === null || _field$componentProps3 === void 0 ? void 0 : _field$componentProps3.label,
|
|
617
594
|
onChange: function onChange(label) {
|
|
618
|
-
var _collectionField$
|
|
595
|
+
var _collectionField$uiSc4, _collectionField$uiSc5;
|
|
619
596
|
var schema = _defineProperty({}, 'x-uid', fieldSchema['x-uid']);
|
|
620
|
-
var fieldNames = _objectSpread(_objectSpread(_objectSpread({}, collectionField === null || collectionField === void 0 ? void 0 : (_collectionField$
|
|
597
|
+
var fieldNames = _objectSpread(_objectSpread(_objectSpread({}, collectionField === null || collectionField === void 0 ? void 0 : (_collectionField$uiSc4 = collectionField.uiSchema) === null || _collectionField$uiSc4 === void 0 ? void 0 : (_collectionField$uiSc5 = _collectionField$uiSc4['x-component-props']) === null || _collectionField$uiSc5 === void 0 ? void 0 : _collectionField$uiSc5['fieldNames']), field.componentProps.fieldNames), {}, {
|
|
621
598
|
label: label
|
|
622
599
|
});
|
|
623
600
|
fieldSchema['x-component-props'] = fieldSchema['x-component-props'] || {};
|
|
624
601
|
fieldSchema['x-component-props']['fieldNames'] = fieldNames;
|
|
625
602
|
schema['x-component-props'] = fieldSchema['x-component-props'];
|
|
603
|
+
field.componentProps.fieldNames = fieldSchema['x-component-props'].fieldNames;
|
|
626
604
|
dn.emit('patch', {
|
|
627
605
|
schema: schema
|
|
628
606
|
});
|
|
@@ -1,3 +1,23 @@
|
|
|
1
|
+
export interface ITemplate {
|
|
2
|
+
config?: {
|
|
3
|
+
[key: string]: {
|
|
4
|
+
/** 设置的数据范围 */
|
|
5
|
+
filter?: any;
|
|
6
|
+
/** 设置的标题字段 */
|
|
7
|
+
titleField?: string;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
items: {
|
|
11
|
+
key: string;
|
|
12
|
+
title: string;
|
|
13
|
+
collection: string;
|
|
14
|
+
dataId: number;
|
|
15
|
+
fields: string[];
|
|
16
|
+
default?: boolean;
|
|
17
|
+
}[];
|
|
18
|
+
/** 是否在 Form 区块显示模板选择器 */
|
|
19
|
+
display: boolean;
|
|
20
|
+
}
|
|
1
21
|
export declare const Templates: ({ style, form }: {
|
|
2
22
|
style?: {};
|
|
3
23
|
form: any;
|
|
@@ -40,6 +40,24 @@ var useDataTemplates = function useDataTemplates() {
|
|
|
40
40
|
items = _findDataTemplates$it === void 0 ? [] : _findDataTemplates$it,
|
|
41
41
|
_findDataTemplates$di = _findDataTemplates.display,
|
|
42
42
|
display = _findDataTemplates$di === void 0 ? true : _findDataTemplates$di;
|
|
43
|
+
var _useCollectionManager = (0, _collectionManager.useCollectionManager)(),
|
|
44
|
+
getCollectionJoinField = _useCollectionManager.getCollectionJoinField;
|
|
45
|
+
// 过滤掉已经被删除的字段
|
|
46
|
+
items.forEach(function (item) {
|
|
47
|
+
try {
|
|
48
|
+
var _item$fields;
|
|
49
|
+
item.fields = (_item$fields = item.fields) === null || _item$fields === void 0 ? void 0 : _item$fields.map(function (field) {
|
|
50
|
+
var joinField = getCollectionJoinField("".concat(item.collection, ".").concat(field));
|
|
51
|
+
if (joinField) {
|
|
52
|
+
return field;
|
|
53
|
+
}
|
|
54
|
+
return '';
|
|
55
|
+
}).filter(Boolean);
|
|
56
|
+
} catch (err) {
|
|
57
|
+
(0, _client.error)(err);
|
|
58
|
+
item.fields = [];
|
|
59
|
+
}
|
|
60
|
+
});
|
|
43
61
|
var templates = [{
|
|
44
62
|
key: 'none',
|
|
45
63
|
title: t('None')
|
|
@@ -55,7 +73,9 @@ var useDataTemplates = function useDataTemplates() {
|
|
|
55
73
|
templates: templates,
|
|
56
74
|
display: display,
|
|
57
75
|
defaultTemplate: defaultTemplate,
|
|
58
|
-
enabled: items.length > 0
|
|
76
|
+
enabled: items.length > 0 && items.every(function (item) {
|
|
77
|
+
return item.dataId !== undefined;
|
|
78
|
+
})
|
|
59
79
|
};
|
|
60
80
|
};
|
|
61
81
|
var Templates = function Templates(_ref) {
|
|
@@ -67,8 +87,6 @@ var Templates = function Templates(_ref) {
|
|
|
67
87
|
display = _useDataTemplates.display,
|
|
68
88
|
enabled = _useDataTemplates.enabled,
|
|
69
89
|
defaultTemplate = _useDataTemplates.defaultTemplate;
|
|
70
|
-
var _useCollectionManager = (0, _collectionManager.useCollectionManager)(),
|
|
71
|
-
getCollectionField = _useCollectionManager.getCollectionField;
|
|
72
90
|
var _React$useState = _react2.default.useState((defaultTemplate === null || defaultTemplate === void 0 ? void 0 : defaultTemplate.key) || 'none'),
|
|
73
91
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
74
92
|
value = _React$useState2[0],
|
|
@@ -77,15 +95,16 @@ var Templates = function Templates(_ref) {
|
|
|
77
95
|
var _useTranslation2 = (0, _reactI18next.useTranslation)(),
|
|
78
96
|
t = _useTranslation2.t;
|
|
79
97
|
(0, _react2.useEffect)(function () {
|
|
80
|
-
if (defaultTemplate) {
|
|
81
|
-
fetchTemplateData(api, defaultTemplate).then(function (data) {
|
|
82
|
-
if (form) {
|
|
98
|
+
if (enabled && defaultTemplate) {
|
|
99
|
+
fetchTemplateData(api, defaultTemplate, t).then(function (data) {
|
|
100
|
+
if (form && data) {
|
|
83
101
|
(0, _client.forEach)(data, function (value, key) {
|
|
84
102
|
if (value) {
|
|
85
103
|
form.values[key] = value;
|
|
86
104
|
}
|
|
87
105
|
});
|
|
88
106
|
}
|
|
107
|
+
return data;
|
|
89
108
|
}).catch(function (err) {
|
|
90
109
|
console.error(err);
|
|
91
110
|
});
|
|
@@ -98,14 +117,17 @@ var Templates = function Templates(_ref) {
|
|
|
98
117
|
case 0:
|
|
99
118
|
setValue(value);
|
|
100
119
|
if (option.key !== 'none') {
|
|
101
|
-
fetchTemplateData(api, option).then(function (data) {
|
|
102
|
-
if (form) {
|
|
120
|
+
fetchTemplateData(api, option, t).then(function (data) {
|
|
121
|
+
if (form && data) {
|
|
103
122
|
(0, _client.forEach)(data, function (value, key) {
|
|
104
123
|
if (value) {
|
|
105
124
|
form.values[key] = value;
|
|
106
125
|
}
|
|
107
126
|
});
|
|
108
127
|
}
|
|
128
|
+
return data;
|
|
129
|
+
}).catch(function (err) {
|
|
130
|
+
console.error(err);
|
|
109
131
|
});
|
|
110
132
|
} else {
|
|
111
133
|
form === null || form === void 0 ? void 0 : form.reset();
|
|
@@ -158,14 +180,20 @@ function findDataTemplates(fieldSchema) {
|
|
|
158
180
|
}
|
|
159
181
|
return {};
|
|
160
182
|
}
|
|
161
|
-
function fetchTemplateData(_x4, _x5) {
|
|
183
|
+
function fetchTemplateData(_x4, _x5, _x6) {
|
|
162
184
|
return _fetchTemplateData.apply(this, arguments);
|
|
163
185
|
}
|
|
164
186
|
function _fetchTemplateData() {
|
|
165
|
-
_fetchTemplateData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(api, template) {
|
|
187
|
+
_fetchTemplateData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(api, template, t) {
|
|
166
188
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
167
189
|
while (1) switch (_context2.prev = _context2.next) {
|
|
168
190
|
case 0:
|
|
191
|
+
if (!(template.fields.length === 0)) {
|
|
192
|
+
_context2.next = 2;
|
|
193
|
+
break;
|
|
194
|
+
}
|
|
195
|
+
return _context2.abrupt("return");
|
|
196
|
+
case 2:
|
|
169
197
|
return _context2.abrupt("return", api.resource(template.collection).get({
|
|
170
198
|
filterByTk: template.dataId,
|
|
171
199
|
fields: template.fields,
|
|
@@ -174,7 +202,7 @@ function _fetchTemplateData() {
|
|
|
174
202
|
var _data$data;
|
|
175
203
|
return (_data$data = data.data) === null || _data$data === void 0 ? void 0 : _data$data.data;
|
|
176
204
|
}));
|
|
177
|
-
case
|
|
205
|
+
case 3:
|
|
178
206
|
case "end":
|
|
179
207
|
return _context2.stop();
|
|
180
208
|
}
|
|
@@ -76,7 +76,9 @@ var linkageMergeAction = function linkageMergeAction(_ref, field, condition, val
|
|
|
76
76
|
}
|
|
77
77
|
}));
|
|
78
78
|
valueResult.push(result);
|
|
79
|
-
} catch (error) {
|
|
79
|
+
} catch (error) {
|
|
80
|
+
console.log(error);
|
|
81
|
+
}
|
|
80
82
|
} else if ((value === null || value === void 0 ? void 0 : value.mode) === 'constant') {
|
|
81
83
|
valueResult.push((value === null || value === void 0 ? void 0 : value.value) || value);
|
|
82
84
|
} else {
|
|
@@ -107,7 +107,7 @@ var StandardTooltipContent = function StandardTooltipContent(_ref2) {
|
|
|
107
107
|
}
|
|
108
108
|
}, task.name, ": ", (0, _otherHelper.getYmd)(task.start), " ~ ", (0, _otherHelper.getYmd)(task.end)), task.end.getTime() - task.start.getTime() !== 0 && /*#__PURE__*/_react.default.createElement("p", {
|
|
109
109
|
className: (0, _css.cx)(_style.tooltipDefaultContainerParagraph)
|
|
110
|
-
}, "Duration: ".concat(
|
|
110
|
+
}, "Duration: ".concat(Math.round((task.end.getTime() - task.start.getTime()) / (1000 * 60 * 60 * 24) * 10) / 10, " day(s)")), /*#__PURE__*/_react.default.createElement("p", {
|
|
111
111
|
className: (0, _css.cx)(_style.tooltipDefaultContainerParagraph)
|
|
112
112
|
}, !!task.progress && "Progress: ".concat(task.progress, "%")));
|
|
113
113
|
};
|
|
@@ -242,21 +242,25 @@ var wrapColSchema = function wrapColSchema(schema) {
|
|
|
242
242
|
};
|
|
243
243
|
var useRowProperties = function useRowProperties() {
|
|
244
244
|
var fieldSchema = (0, _react.useFieldSchema)();
|
|
245
|
-
return
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
245
|
+
return (0, _react2.useMemo)(function () {
|
|
246
|
+
return fieldSchema.reduceProperties(function (buf, s) {
|
|
247
|
+
if (s['x-component'] === 'Grid.Row' && !s['x-hidden']) {
|
|
248
|
+
buf.push(s);
|
|
249
|
+
}
|
|
250
|
+
return buf;
|
|
251
|
+
}, []);
|
|
252
|
+
}, [Object.keys(fieldSchema.properties || {}).join(',')]);
|
|
251
253
|
};
|
|
252
254
|
var useColProperties = function useColProperties() {
|
|
253
255
|
var fieldSchema = (0, _react.useFieldSchema)();
|
|
254
|
-
return
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
256
|
+
return (0, _react2.useMemo)(function () {
|
|
257
|
+
return fieldSchema.reduceProperties(function (buf, s) {
|
|
258
|
+
if (s['x-component'] === 'Grid.Col' && !s['x-hidden']) {
|
|
259
|
+
buf.push(s);
|
|
260
|
+
}
|
|
261
|
+
return buf;
|
|
262
|
+
}, []);
|
|
263
|
+
}, [Object.keys(fieldSchema.properties || {}).join(',')]);
|
|
260
264
|
};
|
|
261
265
|
var DndWrapper = function DndWrapper(props) {
|
|
262
266
|
if (props.dndContext === false) {
|
|
@@ -277,7 +281,8 @@ var Grid = (0, _react.observer)(function (props) {
|
|
|
277
281
|
var field = (0, _react.useField)();
|
|
278
282
|
var fieldSchema = (0, _react.useFieldSchema)();
|
|
279
283
|
var _useSchemaInitializer = (0, _.useSchemaInitializer)(fieldSchema['x-initializer']),
|
|
280
|
-
render = _useSchemaInitializer.render
|
|
284
|
+
render = _useSchemaInitializer.render,
|
|
285
|
+
InitializerComponent = _useSchemaInitializer.InitializerComponent;
|
|
281
286
|
var addr = field.address.toString();
|
|
282
287
|
var rows = useRowProperties();
|
|
283
288
|
var _useFormBlockContext = (0, _.useFormBlockContext)(),
|
|
@@ -289,7 +294,8 @@ var Grid = (0, _react.observer)(function (props) {
|
|
|
289
294
|
value: {
|
|
290
295
|
ref: gridRef,
|
|
291
296
|
fieldSchema: fieldSchema,
|
|
292
|
-
renderSchemaInitializer: render
|
|
297
|
+
renderSchemaInitializer: render,
|
|
298
|
+
InitializerComponent: InitializerComponent
|
|
293
299
|
}
|
|
294
300
|
}, /*#__PURE__*/_react2.default.createElement("div", {
|
|
295
301
|
className: 'nb-grid',
|
|
@@ -311,7 +317,7 @@ var Grid = (0, _react.observer)(function (props) {
|
|
|
311
317
|
}
|
|
312
318
|
}), rows.map(function (schema, index) {
|
|
313
319
|
return /*#__PURE__*/_react2.default.createElement(_react2.default.Fragment, {
|
|
314
|
-
key:
|
|
320
|
+
key: index
|
|
315
321
|
}, /*#__PURE__*/_react2.default.createElement(_react.RecursionField, {
|
|
316
322
|
name: schema.name,
|
|
317
323
|
schema: schema
|
|
@@ -326,7 +332,7 @@ var Grid = (0, _react.observer)(function (props) {
|
|
|
326
332
|
schema: schema
|
|
327
333
|
}
|
|
328
334
|
}));
|
|
329
|
-
})),
|
|
335
|
+
})), /*#__PURE__*/_react2.default.createElement(InitializerComponent, null)));
|
|
330
336
|
});
|
|
331
337
|
exports.Grid = Grid;
|
|
332
338
|
Grid.Row = (0, _react.observer)(function () {
|
|
@@ -353,7 +359,7 @@ Grid.Row = (0, _react.observer)(function () {
|
|
|
353
359
|
}
|
|
354
360
|
}), cols.map(function (schema, index) {
|
|
355
361
|
return /*#__PURE__*/_react2.default.createElement(_react2.default.Fragment, {
|
|
356
|
-
key:
|
|
362
|
+
key: index
|
|
357
363
|
}, /*#__PURE__*/_react2.default.createElement(_react.RecursionField, {
|
|
358
364
|
name: schema.name,
|
|
359
365
|
schema: schema
|
|
@@ -372,17 +378,21 @@ Grid.Row = (0, _react.observer)(function () {
|
|
|
372
378
|
})));
|
|
373
379
|
});
|
|
374
380
|
Grid.Col = (0, _react.observer)(function (props) {
|
|
381
|
+
var _schema$xComponentP2;
|
|
375
382
|
var _useContext = (0, _react2.useContext)(GridRowContext),
|
|
376
383
|
_useContext$cols = _useContext.cols,
|
|
377
384
|
cols = _useContext$cols === void 0 ? [] : _useContext$cols;
|
|
378
385
|
var schema = (0, _react.useFieldSchema)();
|
|
379
386
|
var field = (0, _react.useField)();
|
|
380
|
-
var width =
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
387
|
+
var width = (0, _react2.useMemo)(function () {
|
|
388
|
+
var width = '';
|
|
389
|
+
if (cols === null || cols === void 0 ? void 0 : cols.length) {
|
|
390
|
+
var _schema$xComponentP;
|
|
391
|
+
var w = (schema === null || schema === void 0 ? void 0 : (_schema$xComponentP = schema['x-component-props']) === null || _schema$xComponentP === void 0 ? void 0 : _schema$xComponentP['width']) || 100 / cols.length;
|
|
392
|
+
width = "calc(".concat(w, "% - var(--nb-spacing) * ").concat((cols.length + 1) / cols.length, ")");
|
|
393
|
+
}
|
|
394
|
+
return width;
|
|
395
|
+
}, [cols === null || cols === void 0 ? void 0 : cols.length, schema === null || schema === void 0 ? void 0 : (_schema$xComponentP2 = schema['x-component-props']) === null || _schema$xComponentP2 === void 0 ? void 0 : _schema$xComponentP2['width']]);
|
|
386
396
|
var _useDroppable3 = (0, _core.useDroppable)({
|
|
387
397
|
id: field.address.toString(),
|
|
388
398
|
data: {
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const GridCardBlockContext: React.Context<any>;
|
|
3
|
+
export declare const GridCardBlockProvider: (props: any) => JSX.Element;
|
|
4
|
+
export declare const useGridCardBlockContext: () => any;
|
|
5
|
+
export declare const useGridCardItemProps: () => {};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.useGridCardItemProps = exports.useGridCardBlockContext = exports.GridCardBlockProvider = exports.GridCardBlockContext = void 0;
|
|
8
|
+
var _core = require("@formily/core");
|
|
9
|
+
var _react = require("@formily/react");
|
|
10
|
+
var _react2 = _interopRequireWildcard(require("react"));
|
|
11
|
+
var _blockProvider = require("../../../block-provider");
|
|
12
|
+
var _antd = require("@formily/antd");
|
|
13
|
+
var _css = require("@emotion/css");
|
|
14
|
+
var _hooks = require("../../../block-provider/hooks");
|
|
15
|
+
var _templateObject;
|
|
16
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
17
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
18
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
19
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
20
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
21
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
22
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
23
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
24
|
+
var GridCardBlockContext = /*#__PURE__*/(0, _react2.createContext)({});
|
|
25
|
+
exports.GridCardBlockContext = GridCardBlockContext;
|
|
26
|
+
var InternalGridCardBlockProvider = function InternalGridCardBlockProvider(props) {
|
|
27
|
+
var _service$data2;
|
|
28
|
+
var _useBlockRequestConte = (0, _blockProvider.useBlockRequestContext)(),
|
|
29
|
+
resource = _useBlockRequestConte.resource,
|
|
30
|
+
service = _useBlockRequestConte.service;
|
|
31
|
+
var field = (0, _react.useField)();
|
|
32
|
+
var form = (0, _react2.useMemo)(function () {
|
|
33
|
+
return (0, _core.createForm)({
|
|
34
|
+
readPretty: true
|
|
35
|
+
});
|
|
36
|
+
}, []);
|
|
37
|
+
(0, _react2.useEffect)(function () {
|
|
38
|
+
if (!(service === null || service === void 0 ? void 0 : service.loading)) {
|
|
39
|
+
var _service$data;
|
|
40
|
+
form.setValuesIn(field.address.concat('list').toString(), service === null || service === void 0 ? void 0 : (_service$data = service.data) === null || _service$data === void 0 ? void 0 : _service$data.data);
|
|
41
|
+
}
|
|
42
|
+
}, [service === null || service === void 0 ? void 0 : (_service$data2 = service.data) === null || _service$data2 === void 0 ? void 0 : _service$data2.data, service === null || service === void 0 ? void 0 : service.loading]);
|
|
43
|
+
return /*#__PURE__*/_react2.default.createElement(GridCardBlockContext.Provider, {
|
|
44
|
+
value: {
|
|
45
|
+
service: service,
|
|
46
|
+
resource: resource,
|
|
47
|
+
columnCount: props.columnCount
|
|
48
|
+
}
|
|
49
|
+
}, /*#__PURE__*/_react2.default.createElement(_react.FormContext.Provider, {
|
|
50
|
+
value: form
|
|
51
|
+
}, /*#__PURE__*/_react2.default.createElement(_antd.FormLayout, {
|
|
52
|
+
layout: 'vertical'
|
|
53
|
+
}, /*#__PURE__*/_react2.default.createElement("div", {
|
|
54
|
+
className: (0, _css.css)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n & > .nb-block-item {\n margin-bottom: var(--nb-spacing);\n & > .nb-action-bar:has(:first-child:not(:empty)) {\n padding: var(--nb-spacing);\n background: #fff;\n }\n .ant-list-pagination {\n padding: var(--nb-spacing);\n background: #fff;\n }\n }\n "])))
|
|
55
|
+
}, props.children))));
|
|
56
|
+
};
|
|
57
|
+
var GridCardBlockProvider = function GridCardBlockProvider(props) {
|
|
58
|
+
var params = _objectSpread({}, props.params);
|
|
59
|
+
var collection = props.collection;
|
|
60
|
+
var _useAssociationNames = (0, _hooks.useAssociationNames)(collection),
|
|
61
|
+
appends = _useAssociationNames.appends;
|
|
62
|
+
if (!Object.keys(params).includes('appends')) {
|
|
63
|
+
params['appends'] = appends;
|
|
64
|
+
}
|
|
65
|
+
return /*#__PURE__*/_react2.default.createElement(_blockProvider.BlockProvider, _objectSpread(_objectSpread({}, props), {}, {
|
|
66
|
+
params: params
|
|
67
|
+
}), /*#__PURE__*/_react2.default.createElement(InternalGridCardBlockProvider, _objectSpread({}, props)));
|
|
68
|
+
};
|
|
69
|
+
exports.GridCardBlockProvider = GridCardBlockProvider;
|
|
70
|
+
var useGridCardBlockContext = function useGridCardBlockContext() {
|
|
71
|
+
return (0, _react2.useContext)(GridCardBlockContext);
|
|
72
|
+
};
|
|
73
|
+
exports.useGridCardBlockContext = useGridCardBlockContext;
|
|
74
|
+
var useGridCardItemProps = function useGridCardItemProps() {
|
|
75
|
+
return {};
|
|
76
|
+
};
|
|
77
|
+
exports.useGridCardItemProps = useGridCardItemProps;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const GridCardDesigner: () => JSX.Element;
|