@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
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
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; }
|
|
2
|
+
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; }
|
|
3
|
+
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; }
|
|
4
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
5
|
+
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); }
|
|
6
|
+
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); }
|
|
7
|
+
import { useFieldSchema } from '@formily/react';
|
|
8
|
+
import cloneDeep from 'lodash/cloneDeep';
|
|
9
|
+
import { useCallback, useContext, useMemo } from 'react';
|
|
10
|
+
import { mergeFilter } from '../../../block-provider/SharedFilterProvider';
|
|
11
|
+
import { useCollection, useCollectionManager } from '../../../collection-manager';
|
|
12
|
+
import { isInFilterFormBlock } from '../../../filter-provider';
|
|
13
|
+
import { useRecord } from '../../../record-provider';
|
|
14
|
+
import { useDesignable } from '../../hooks';
|
|
15
|
+
import { AssociationFieldContext } from './context';
|
|
16
|
+
export var useInsertSchema = function useInsertSchema(component) {
|
|
17
|
+
var fieldSchema = useFieldSchema();
|
|
18
|
+
var _useDesignable = useDesignable(),
|
|
19
|
+
insertAfterBegin = _useDesignable.insertAfterBegin;
|
|
20
|
+
var insert = useCallback(function (ss) {
|
|
21
|
+
var schema = fieldSchema.reduceProperties(function (buf, s) {
|
|
22
|
+
if (s['x-component'] === 'AssociationField.' + component) {
|
|
23
|
+
return s;
|
|
24
|
+
}
|
|
25
|
+
return buf;
|
|
26
|
+
}, null);
|
|
27
|
+
if (!schema) {
|
|
28
|
+
insertAfterBegin(cloneDeep(ss));
|
|
29
|
+
}
|
|
30
|
+
}, [component]);
|
|
31
|
+
return insert;
|
|
32
|
+
};
|
|
33
|
+
export function useAssociationFieldContext() {
|
|
34
|
+
return useContext(AssociationFieldContext);
|
|
35
|
+
}
|
|
36
|
+
export default function useServiceOptions(props) {
|
|
37
|
+
var _props$action = props.action,
|
|
38
|
+
action = _props$action === void 0 ? 'list' : _props$action,
|
|
39
|
+
service = props.service,
|
|
40
|
+
fieldNames = props.fieldNames;
|
|
41
|
+
var params = (service === null || service === void 0 ? void 0 : service.params) || {};
|
|
42
|
+
var fieldSchema = useFieldSchema();
|
|
43
|
+
var _useCollection = useCollection(),
|
|
44
|
+
getField = _useCollection.getField;
|
|
45
|
+
var _useCollectionManager = useCollectionManager(),
|
|
46
|
+
getCollectionFields = _useCollectionManager.getCollectionFields,
|
|
47
|
+
getCollectionJoinField = _useCollectionManager.getCollectionJoinField;
|
|
48
|
+
var record = useRecord();
|
|
49
|
+
var normalizeValues = useCallback(function (obj) {
|
|
50
|
+
if (obj && _typeof(obj) === 'object') {
|
|
51
|
+
return obj[fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.value];
|
|
52
|
+
}
|
|
53
|
+
return obj;
|
|
54
|
+
}, [fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.value]);
|
|
55
|
+
var value = useMemo(function () {
|
|
56
|
+
if (props.value === undefined || props.value === null) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
if (Array.isArray(props.value)) {
|
|
60
|
+
return props.value.map(normalizeValues);
|
|
61
|
+
} else {
|
|
62
|
+
return [normalizeValues(props.value)];
|
|
63
|
+
}
|
|
64
|
+
}, [props.value, normalizeValues]);
|
|
65
|
+
var collectionField = useMemo(function () {
|
|
66
|
+
return getField(fieldSchema.name) || getCollectionJoinField(fieldSchema === null || fieldSchema === void 0 ? void 0 : fieldSchema['x-collection-field']);
|
|
67
|
+
}, [fieldSchema.name]);
|
|
68
|
+
var sourceValue = record === null || record === void 0 ? void 0 : record[collectionField === null || collectionField === void 0 ? void 0 : collectionField.sourceKey];
|
|
69
|
+
var filter = useMemo(function () {
|
|
70
|
+
var isOToAny = ['oho', 'o2m'].includes(collectionField === null || collectionField === void 0 ? void 0 : collectionField.interface);
|
|
71
|
+
return mergeFilter([mergeFilter([isOToAny && !isInFilterFormBlock(fieldSchema) && (collectionField === null || collectionField === void 0 ? void 0 : collectionField.foreignKey) ? _defineProperty({}, collectionField.foreignKey, {
|
|
72
|
+
$is: null
|
|
73
|
+
}) : null, params === null || params === void 0 ? void 0 : params.filter]), isOToAny && sourceValue !== undefined && sourceValue !== null && !isInFilterFormBlock(fieldSchema) && (collectionField === null || collectionField === void 0 ? void 0 : collectionField.foreignKey) ? _defineProperty({}, collectionField.foreignKey, {
|
|
74
|
+
$eq: sourceValue
|
|
75
|
+
}) : null, (params === null || params === void 0 ? void 0 : params.filter) && value ? _defineProperty({}, fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.value, _defineProperty({}, '$in', value)) : null], '$or');
|
|
76
|
+
}, [params === null || params === void 0 ? void 0 : params.filter, getCollectionFields, collectionField, sourceValue, value, fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.value]);
|
|
77
|
+
return useMemo(function () {
|
|
78
|
+
return _objectSpread(_objectSpread({
|
|
79
|
+
resource: collectionField === null || collectionField === void 0 ? void 0 : collectionField.target,
|
|
80
|
+
action: action
|
|
81
|
+
}, service), {}, {
|
|
82
|
+
params: _objectSpread(_objectSpread({}, service === null || service === void 0 ? void 0 : service.params), {}, {
|
|
83
|
+
filter: filter
|
|
84
|
+
})
|
|
85
|
+
});
|
|
86
|
+
}, [collectionField === null || collectionField === void 0 ? void 0 : collectionField.target, action, filter, service]);
|
|
87
|
+
}
|
|
88
|
+
export var useFieldNames = function useFieldNames(props) {
|
|
89
|
+
var _fieldSchema$xCompon, _fieldSchema$xCompon$, _fieldSchema$xCompon$2, _fieldSchema$xCompon$3, _fieldSchema$xCompon2;
|
|
90
|
+
var fieldSchema = useFieldSchema();
|
|
91
|
+
var fieldNames = ((_fieldSchema$xCompon = fieldSchema['x-component-props']) === null || _fieldSchema$xCompon === void 0 ? void 0 : (_fieldSchema$xCompon$ = _fieldSchema$xCompon['field']) === null || _fieldSchema$xCompon$ === void 0 ? void 0 : (_fieldSchema$xCompon$2 = _fieldSchema$xCompon$['uiSchema']) === null || _fieldSchema$xCompon$2 === void 0 ? void 0 : (_fieldSchema$xCompon$3 = _fieldSchema$xCompon$2['x-component-props']) === null || _fieldSchema$xCompon$3 === void 0 ? void 0 : _fieldSchema$xCompon$3['fieldNames']) || (fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xCompon2 = fieldSchema['x-component-props']) === null || _fieldSchema$xCompon2 === void 0 ? void 0 : _fieldSchema$xCompon2['fieldNames']) || props.fieldNames;
|
|
92
|
+
return _objectSpread({
|
|
93
|
+
label: 'label',
|
|
94
|
+
value: 'value'
|
|
95
|
+
}, fieldNames);
|
|
96
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const AssociationField: any;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { connect, mapReadPretty } from '@formily/react';
|
|
2
|
+
import { Action } from '../action';
|
|
3
|
+
import { Editable } from './Editable';
|
|
4
|
+
import { InternalPicker } from './InternalPicker';
|
|
5
|
+
import { Nester } from './Nester';
|
|
6
|
+
import { ReadPretty } from './ReadPretty';
|
|
7
|
+
import { SubTable } from './SubTable';
|
|
8
|
+
export var AssociationField = connect(Editable, mapReadPretty(ReadPretty));
|
|
9
|
+
AssociationField.SubTable = SubTable;
|
|
10
|
+
AssociationField.Nester = Nester;
|
|
11
|
+
AssociationField.AddNewer = Action.Container;
|
|
12
|
+
AssociationField.Selector = Action.Container;
|
|
13
|
+
AssociationField.Viewer = Action.Container;
|
|
14
|
+
AssociationField.InternalSelect = InternalPicker;
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
Nester: {
|
|
3
|
+
type: string;
|
|
4
|
+
'x-component': string;
|
|
5
|
+
properties: {
|
|
6
|
+
grid: {
|
|
7
|
+
type: string;
|
|
8
|
+
'x-component': string;
|
|
9
|
+
'x-initializer': string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
AddNewer: {
|
|
14
|
+
type: string;
|
|
15
|
+
'x-component': string;
|
|
16
|
+
'x-action': string;
|
|
17
|
+
title: string;
|
|
18
|
+
'x-component-props': {
|
|
19
|
+
className: string;
|
|
20
|
+
};
|
|
21
|
+
properties: {
|
|
22
|
+
tabs: {
|
|
23
|
+
type: string;
|
|
24
|
+
'x-component': string;
|
|
25
|
+
'x-component-props': {};
|
|
26
|
+
'x-initializer': string;
|
|
27
|
+
properties: {
|
|
28
|
+
tab1: {
|
|
29
|
+
type: string;
|
|
30
|
+
title: string;
|
|
31
|
+
'x-component': string;
|
|
32
|
+
'x-designer': string;
|
|
33
|
+
'x-component-props': {};
|
|
34
|
+
properties: {
|
|
35
|
+
grid: {
|
|
36
|
+
type: string;
|
|
37
|
+
'x-component': string;
|
|
38
|
+
'x-initializer': string;
|
|
39
|
+
properties: {};
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
Selector: {
|
|
48
|
+
type: string;
|
|
49
|
+
'x-component': string;
|
|
50
|
+
title: string;
|
|
51
|
+
'x-component-props': {
|
|
52
|
+
className: string;
|
|
53
|
+
};
|
|
54
|
+
properties: {
|
|
55
|
+
grid: {
|
|
56
|
+
type: string;
|
|
57
|
+
'x-component': string;
|
|
58
|
+
'x-initializer': string;
|
|
59
|
+
properties: {};
|
|
60
|
+
};
|
|
61
|
+
footer: {
|
|
62
|
+
'x-component': string;
|
|
63
|
+
'x-component-props': {};
|
|
64
|
+
properties: {
|
|
65
|
+
actions: {
|
|
66
|
+
type: string;
|
|
67
|
+
'x-component': string;
|
|
68
|
+
'x-component-props': {};
|
|
69
|
+
properties: {
|
|
70
|
+
submit: {
|
|
71
|
+
title: string;
|
|
72
|
+
'x-action': string;
|
|
73
|
+
'x-component': string;
|
|
74
|
+
'x-designer': string;
|
|
75
|
+
'x-component-props': {
|
|
76
|
+
type: string;
|
|
77
|
+
htmlType: string;
|
|
78
|
+
useProps: string;
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
Viewer: {
|
|
88
|
+
type: string;
|
|
89
|
+
title: string;
|
|
90
|
+
'x-component': string;
|
|
91
|
+
'x-component-props': {
|
|
92
|
+
className: string;
|
|
93
|
+
};
|
|
94
|
+
properties: {
|
|
95
|
+
tabs: {
|
|
96
|
+
type: string;
|
|
97
|
+
'x-component': string;
|
|
98
|
+
'x-component-props': {};
|
|
99
|
+
'x-initializer': string;
|
|
100
|
+
properties: {
|
|
101
|
+
tab1: {
|
|
102
|
+
type: string;
|
|
103
|
+
title: string;
|
|
104
|
+
'x-component': string;
|
|
105
|
+
'x-designer': string;
|
|
106
|
+
'x-component-props': {};
|
|
107
|
+
properties: {
|
|
108
|
+
grid: {
|
|
109
|
+
type: string;
|
|
110
|
+
'x-component': string;
|
|
111
|
+
'x-initializer': string;
|
|
112
|
+
properties: {};
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
};
|
|
119
|
+
};
|
|
120
|
+
SubTable: {
|
|
121
|
+
type: string;
|
|
122
|
+
'x-component': string;
|
|
123
|
+
'x-initializer': string;
|
|
124
|
+
properties: {
|
|
125
|
+
indexCol: {
|
|
126
|
+
type: string;
|
|
127
|
+
'x-component': string;
|
|
128
|
+
'x-component-props': {
|
|
129
|
+
width: number;
|
|
130
|
+
};
|
|
131
|
+
properties: {
|
|
132
|
+
__index__: {
|
|
133
|
+
type: string;
|
|
134
|
+
'x-component': string;
|
|
135
|
+
'x-read-pretty': boolean;
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
};
|
|
139
|
+
};
|
|
140
|
+
};
|
|
141
|
+
};
|
|
142
|
+
export default _default;
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
Nester: {
|
|
3
|
+
type: 'void',
|
|
4
|
+
'x-component': 'AssociationField.Nester',
|
|
5
|
+
properties: {
|
|
6
|
+
grid: {
|
|
7
|
+
type: 'void',
|
|
8
|
+
'x-component': 'Grid',
|
|
9
|
+
'x-initializer': 'FormItemInitializers'
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
AddNewer: {
|
|
14
|
+
type: 'void',
|
|
15
|
+
'x-component': 'AssociationField.AddNewer',
|
|
16
|
+
'x-action': 'create',
|
|
17
|
+
title: '{{ t("Add record") }}',
|
|
18
|
+
'x-component-props': {
|
|
19
|
+
className: 'nb-action-popup'
|
|
20
|
+
},
|
|
21
|
+
properties: {
|
|
22
|
+
tabs: {
|
|
23
|
+
type: 'void',
|
|
24
|
+
'x-component': 'Tabs',
|
|
25
|
+
'x-component-props': {},
|
|
26
|
+
'x-initializer': 'TabPaneInitializersForCreateFormBlock',
|
|
27
|
+
properties: {
|
|
28
|
+
tab1: {
|
|
29
|
+
type: 'void',
|
|
30
|
+
title: '{{t("Add new")}}',
|
|
31
|
+
'x-component': 'Tabs.TabPane',
|
|
32
|
+
'x-designer': 'Tabs.Designer',
|
|
33
|
+
'x-component-props': {},
|
|
34
|
+
properties: {
|
|
35
|
+
grid: {
|
|
36
|
+
type: 'void',
|
|
37
|
+
'x-component': 'Grid',
|
|
38
|
+
'x-initializer': 'CreateFormBlockInitializers',
|
|
39
|
+
properties: {}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
Selector: {
|
|
48
|
+
type: 'void',
|
|
49
|
+
'x-component': 'AssociationField.Selector',
|
|
50
|
+
title: '{{ t("Select record") }}',
|
|
51
|
+
'x-component-props': {
|
|
52
|
+
className: 'nb-record-picker-selector'
|
|
53
|
+
},
|
|
54
|
+
properties: {
|
|
55
|
+
grid: {
|
|
56
|
+
type: 'void',
|
|
57
|
+
'x-component': 'Grid',
|
|
58
|
+
'x-initializer': 'TableSelectorInitializers',
|
|
59
|
+
properties: {}
|
|
60
|
+
},
|
|
61
|
+
footer: {
|
|
62
|
+
'x-component': 'Action.Container.Footer',
|
|
63
|
+
'x-component-props': {},
|
|
64
|
+
properties: {
|
|
65
|
+
actions: {
|
|
66
|
+
type: 'void',
|
|
67
|
+
'x-component': 'ActionBar',
|
|
68
|
+
'x-component-props': {},
|
|
69
|
+
properties: {
|
|
70
|
+
submit: {
|
|
71
|
+
title: '{{ t("Submit") }}',
|
|
72
|
+
'x-action': 'submit',
|
|
73
|
+
'x-component': 'Action',
|
|
74
|
+
'x-designer': 'Action.Designer',
|
|
75
|
+
'x-component-props': {
|
|
76
|
+
type: 'primary',
|
|
77
|
+
htmlType: 'submit',
|
|
78
|
+
useProps: '{{ usePickActionProps }}'
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
Viewer: {
|
|
88
|
+
type: 'void',
|
|
89
|
+
title: '{{ t("View record") }}',
|
|
90
|
+
'x-component': 'AssociationField.Viewer',
|
|
91
|
+
'x-component-props': {
|
|
92
|
+
className: 'nb-action-popup'
|
|
93
|
+
},
|
|
94
|
+
properties: {
|
|
95
|
+
tabs: {
|
|
96
|
+
type: 'void',
|
|
97
|
+
'x-component': 'Tabs',
|
|
98
|
+
'x-component-props': {},
|
|
99
|
+
'x-initializer': 'TabPaneInitializers',
|
|
100
|
+
properties: {
|
|
101
|
+
tab1: {
|
|
102
|
+
type: 'void',
|
|
103
|
+
title: '{{t("Details")}}',
|
|
104
|
+
'x-component': 'Tabs.TabPane',
|
|
105
|
+
'x-designer': 'Tabs.Designer',
|
|
106
|
+
'x-component-props': {},
|
|
107
|
+
properties: {
|
|
108
|
+
grid: {
|
|
109
|
+
type: 'void',
|
|
110
|
+
'x-component': 'Grid',
|
|
111
|
+
'x-initializer': 'RecordBlockInitializers',
|
|
112
|
+
properties: {}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
SubTable: {
|
|
121
|
+
type: 'void',
|
|
122
|
+
'x-component': 'AssociationField.SubTable',
|
|
123
|
+
'x-initializer': 'TableColumnInitializers',
|
|
124
|
+
properties: {
|
|
125
|
+
indexCol: {
|
|
126
|
+
type: 'void',
|
|
127
|
+
'x-component': 'TableV2.Column',
|
|
128
|
+
'x-component-props': {
|
|
129
|
+
width: 80
|
|
130
|
+
},
|
|
131
|
+
properties: {
|
|
132
|
+
__index__: {
|
|
133
|
+
type: 'void',
|
|
134
|
+
'x-component': 'TableV2.Index',
|
|
135
|
+
'x-read-pretty': true
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ISchema } from '@formily/react';
|
|
2
|
+
import { CollectionFieldOptions } from '../../../collection-manager';
|
|
3
|
+
export declare const useLabelUiSchema: (collectionField: CollectionFieldOptions, label: string) => ISchema;
|
|
4
|
+
export declare const getDatePickerLabels: (props: any) => string;
|
|
5
|
+
export declare const getLabelFormatValue: (labelUiSchema: ISchema, value: any, isTag?: boolean) => any;
|
|
6
|
+
export declare function flatData(data: any): any[];
|
|
7
|
+
export declare function isShowFilePicker(labelUiSchema: any): boolean;
|
|
8
|
+
export declare const toValue: (value: any, placeholder: any) => any;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
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); }
|
|
2
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
3
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
5
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
6
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
7
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
8
|
+
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; }
|
|
9
|
+
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; }
|
|
10
|
+
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; }
|
|
11
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
12
|
+
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); }
|
|
13
|
+
import { isArr } from '@formily/shared';
|
|
14
|
+
import { getDefaultFormat, str2moment } from '@nocobase/utils/client';
|
|
15
|
+
import { Tag } from 'antd';
|
|
16
|
+
import React from 'react';
|
|
17
|
+
import { useCollectionManager } from '../../../collection-manager';
|
|
18
|
+
export var useLabelUiSchema = function useLabelUiSchema(collectionField, label) {
|
|
19
|
+
var _useCollectionManager = useCollectionManager(),
|
|
20
|
+
getCollectionJoinField = _useCollectionManager.getCollectionJoinField;
|
|
21
|
+
if (!collectionField) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
var labelField = getCollectionJoinField("".concat(collectionField.target, ".").concat(label));
|
|
25
|
+
return labelField === null || labelField === void 0 ? void 0 : labelField.uiSchema;
|
|
26
|
+
};
|
|
27
|
+
export var getDatePickerLabels = function getDatePickerLabels(props) {
|
|
28
|
+
var format = getDefaultFormat(props);
|
|
29
|
+
var m = str2moment(props.value, props);
|
|
30
|
+
var labels = m && m.isValid() ? m.format(format) : props.value;
|
|
31
|
+
return isArr(labels) ? labels.join('~') : labels;
|
|
32
|
+
};
|
|
33
|
+
var toArr = function toArr(v) {
|
|
34
|
+
if (!v) {
|
|
35
|
+
return [];
|
|
36
|
+
}
|
|
37
|
+
return Array.isArray(v) ? v : [v];
|
|
38
|
+
};
|
|
39
|
+
export var getLabelFormatValue = function getLabelFormatValue(labelUiSchema, value) {
|
|
40
|
+
var isTag = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
41
|
+
var options = labelUiSchema === null || labelUiSchema === void 0 ? void 0 : labelUiSchema.enum;
|
|
42
|
+
if (Array.isArray(options) && value) {
|
|
43
|
+
var values = toArr(value).map(function (val) {
|
|
44
|
+
var opt = options.find(function (option) {
|
|
45
|
+
return option.value === val;
|
|
46
|
+
});
|
|
47
|
+
if (isTag) {
|
|
48
|
+
return /*#__PURE__*/React.createElement(Tag, {
|
|
49
|
+
color: opt === null || opt === void 0 ? void 0 : opt.color
|
|
50
|
+
}, opt === null || opt === void 0 ? void 0 : opt.label);
|
|
51
|
+
}
|
|
52
|
+
return opt === null || opt === void 0 ? void 0 : opt.label;
|
|
53
|
+
});
|
|
54
|
+
return isTag ? values : values.join(', ');
|
|
55
|
+
}
|
|
56
|
+
switch (labelUiSchema === null || labelUiSchema === void 0 ? void 0 : labelUiSchema['x-component']) {
|
|
57
|
+
case 'DatePicker':
|
|
58
|
+
return getDatePickerLabels(_objectSpread(_objectSpread({}, labelUiSchema === null || labelUiSchema === void 0 ? void 0 : labelUiSchema['x-component-props']), {}, {
|
|
59
|
+
value: value
|
|
60
|
+
}));
|
|
61
|
+
default:
|
|
62
|
+
return value;
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
export function flatData(data) {
|
|
66
|
+
var newArr = [];
|
|
67
|
+
for (var i = 0; i < data.length; i++) {
|
|
68
|
+
var children = data[i]['children'];
|
|
69
|
+
if (Array.isArray(children)) {
|
|
70
|
+
newArr.push.apply(newArr, _toConsumableArray(flatData(children)));
|
|
71
|
+
}
|
|
72
|
+
newArr.push(_objectSpread({}, data[i]));
|
|
73
|
+
}
|
|
74
|
+
return newArr;
|
|
75
|
+
}
|
|
76
|
+
export function isShowFilePicker(labelUiSchema) {
|
|
77
|
+
return (labelUiSchema === null || labelUiSchema === void 0 ? void 0 : labelUiSchema['x-component']) === 'Preview';
|
|
78
|
+
}
|
|
79
|
+
export var toValue = function toValue(value, placeholder) {
|
|
80
|
+
if (value === null || value === undefined) {
|
|
81
|
+
return placeholder;
|
|
82
|
+
}
|
|
83
|
+
return value;
|
|
84
|
+
};
|
|
@@ -20,9 +20,9 @@ import cls from 'classnames';
|
|
|
20
20
|
import React, { useMemo, useState } from 'react';
|
|
21
21
|
import { SortableItem } from '../../common';
|
|
22
22
|
import { useCompile, useDesigner, useProps } from '../../hooks';
|
|
23
|
+
import { EllipsisWithTooltip } from '../input';
|
|
23
24
|
import { getLabelFormatValue, useLabelUiSchema } from '../record-picker';
|
|
24
25
|
import { AssociationFilter } from './AssociationFilter';
|
|
25
|
-
import { EllipsisWithTooltip } from '../input';
|
|
26
26
|
var Panel = Collapse.Panel;
|
|
27
27
|
export var AssociationFilterItem = function AssociationFilterItem(props) {
|
|
28
28
|
var _fieldSchema$xCompon, _fieldSchema$xCompon$, _fieldSchema$title, _collectionField$uiSc;
|
|
@@ -45,7 +45,7 @@ export var AssociationFilterItem = function AssociationFilterItem(props) {
|
|
|
45
45
|
searchVisible = _useState2[0],
|
|
46
46
|
setSearchVisible = _useState2[1];
|
|
47
47
|
var defaultActiveKeyCollapse = useMemo(function () {
|
|
48
|
-
return defaultCollapse ? [collectionField.name] : [];
|
|
48
|
+
return defaultCollapse && (collectionField === null || collectionField === void 0 ? void 0 : collectionField.name) ? [collectionField.name] : [];
|
|
49
49
|
}, []);
|
|
50
50
|
var valueKey = _valueKey || (collectionField === null || collectionField === void 0 ? void 0 : collectionField.targetKey) || 'id';
|
|
51
51
|
var labelKey = _labelKey || ((_fieldSchema$xCompon = fieldSchema['x-component-props']) === null || _fieldSchema$xCompon === void 0 ? void 0 : (_fieldSchema$xCompon$ = _fieldSchema$xCompon.fieldNames) === null || _fieldSchema$xCompon$ === void 0 ? void 0 : _fieldSchema$xCompon$.label) || valueKey;
|
|
@@ -93,7 +93,7 @@ export var AssociationFilterItem = function AssociationFilterItem(props) {
|
|
|
93
93
|
var handleSearchInput = function handleSearchInput(e) {
|
|
94
94
|
_handleSearchInput(e);
|
|
95
95
|
};
|
|
96
|
-
var title = (_fieldSchema$title = fieldSchema.title) !== null && _fieldSchema$title !== void 0 ? _fieldSchema$title : (_collectionField$uiSc = collectionField.uiSchema) === null || _collectionField$uiSc === void 0 ? void 0 : _collectionField$uiSc.title;
|
|
96
|
+
var title = (_fieldSchema$title = fieldSchema.title) !== null && _fieldSchema$title !== void 0 ? _fieldSchema$title : collectionField === null || collectionField === void 0 ? void 0 : (_collectionField$uiSc = collectionField.uiSchema) === null || _collectionField$uiSc === void 0 ? void 0 : _collectionField$uiSc.title;
|
|
97
97
|
var labelUiSchema = useLabelUiSchema(collectionField, (fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.title) || 'label');
|
|
98
98
|
return /*#__PURE__*/React.createElement(SortableItem, {
|
|
99
99
|
className: cls('nb-block-item', props.className, css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n &:hover {\n > .general-schema-designer {\n display: block;\n }\n }\n &.nb-form-item:hover {\n > .general-schema-designer {\n background: rgba(241, 139, 98, 0.06) !important;\n border: 0 !important;\n top: -5px !important;\n bottom: -5px !important;\n left: -5px !important;\n right: -5px !important;\n }\n }\n > .general-schema-designer {\n position: absolute;\n z-index: 999;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n display: none;\n border: 2px solid rgba(241, 139, 98, 0.3);\n pointer-events: none;\n > .general-schema-designer-icons {\n position: absolute;\n right: 2px;\n top: 2px;\n line-height: 16px;\n pointer-events: all;\n .ant-space-item {\n background-color: #f18b62;\n color: #fff;\n line-height: 16px;\n width: 16px;\n padding-left: 1px;\n }\n }\n }\n "]))))
|