@nocobase/client 0.9.0-alpha.2 → 0.9.1-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/acl/ACLProvider.js +7 -8
- package/es/api-client/APIClient.js +6 -0
- package/es/block-provider/BlockProvider.js +9 -6
- package/es/block-provider/FormBlockProvider.js +18 -9
- package/es/block-provider/KanbanBlockProvider.js +1 -1
- package/es/block-provider/SharedFilterProvider.js +9 -1
- package/es/block-provider/TableBlockProvider.js +1 -1
- package/es/block-provider/TableSelectorProvider.js +2 -2
- package/es/block-provider/hooks/index.js +22 -7
- package/es/collection-manager/CollectionManagerProvider.d.ts +1 -0
- package/es/collection-manager/CollectionManagerProvider.js +71 -9
- package/es/collection-manager/CollectionManagerShortcut.js +36 -23
- package/es/collection-manager/Configuration/AddCategoryAction.d.ts +2 -0
- package/es/collection-manager/Configuration/AddCategoryAction.js +117 -0
- package/es/collection-manager/Configuration/AddCollectionAction.js +8 -3
- package/es/collection-manager/Configuration/AddFieldAction.js +1 -0
- package/es/collection-manager/Configuration/ConfigurationTable.js +33 -4
- package/es/collection-manager/Configuration/ConfigurationTabs.d.ts +1 -0
- package/es/collection-manager/Configuration/ConfigurationTabs.js +381 -0
- package/es/collection-manager/Configuration/EditCategoryAction.d.ts +2 -0
- package/es/collection-manager/Configuration/EditCategoryAction.js +150 -0
- package/es/collection-manager/Configuration/EditCollectionAction.js +6 -2
- package/es/collection-manager/Configuration/OverridingCollectionField.js +17 -8
- package/es/collection-manager/Configuration/components/CollectionCategory.d.ts +2 -0
- package/es/collection-manager/Configuration/components/CollectionCategory.js +13 -0
- package/es/collection-manager/Configuration/index.d.ts +3 -0
- package/es/collection-manager/Configuration/index.js +3 -0
- package/es/collection-manager/Configuration/schemas/collections.d.ts +3 -0
- package/es/collection-manager/Configuration/schemas/collections.js +309 -176
- package/es/collection-manager/Configuration/templates.d.ts +1 -0
- package/es/collection-manager/Configuration/templates.js +1 -1
- package/es/collection-manager/action-hooks.d.ts +4 -0
- package/es/collection-manager/action-hooks.js +26 -12
- package/es/collection-manager/context.d.ts +4 -0
- package/es/collection-manager/context.js +5 -1
- package/es/collection-manager/hooks/useCollectionManager.d.ts +7 -0
- package/es/collection-manager/hooks/useCollectionManager.js +52 -7
- package/es/collection-manager/interfaces/m2m.js +2 -2
- package/es/collection-manager/interfaces/properties/index.d.ts +0 -56
- package/es/collection-manager/interfaces/properties/index.js +1 -2
- package/es/collection-manager/templates/calendar.js +1 -1
- package/es/collection-manager/templates/general.js +1 -1
- package/es/collection-manager/templates/properties/index.d.ts +12 -1
- package/es/collection-manager/templates/properties/index.js +11 -0
- package/es/i18n/i18n.js +3 -1
- package/es/locale/en_US.d.ts +23 -0
- package/es/locale/en_US.js +23 -0
- package/es/locale/ja_JP.d.ts +23 -0
- package/es/locale/ja_JP.js +24 -1
- package/es/locale/ru_RU.d.ts +1 -0
- package/es/locale/ru_RU.js +1 -0
- package/es/locale/zh_CN.d.ts +43 -4
- package/es/locale/zh_CN.js +44 -5
- package/es/route-switch/antd/admin-layout/index.js +13 -33
- package/es/schema-component/antd/action/Action.Designer.js +28 -15
- package/es/schema-component/antd/action/Action.js +28 -5
- package/es/schema-component/antd/action/utils.d.ts +1 -0
- package/es/schema-component/antd/action/utils.js +49 -0
- package/es/schema-component/antd/association-filter/AssociationFilter.js +4 -4
- package/es/schema-component/antd/association-select/AssociationSelect.d.ts +2 -2
- package/es/schema-component/antd/association-select/useServiceOptions.js +47 -6
- package/es/schema-component/antd/calendar/Calendar.Designer.js +17 -36
- package/es/schema-component/antd/checkbox/Checkbox.js +9 -8
- package/es/schema-component/antd/date-picker/util.d.ts +1 -1
- package/es/schema-component/antd/date-picker/util.js +1 -1
- package/es/schema-component/antd/filter/DynamicComponent.js +3 -1
- package/es/schema-component/antd/filter/Filter.js +2 -1
- package/es/schema-component/antd/filter/FilterGroup.js +7 -4
- package/es/schema-component/antd/filter/FilterItem.js +3 -2
- package/es/schema-component/antd/filter/context.d.ts +1 -0
- package/es/schema-component/antd/filter/useValues.js +14 -11
- package/es/schema-component/antd/form/Form.js +11 -5
- package/es/schema-component/antd/form-item/FormItem.js +17 -8
- package/es/schema-component/antd/form-v2/Form.Designer.js +2 -0
- package/es/schema-component/antd/form-v2/Form.js +94 -7
- package/es/schema-component/antd/form-v2/utils.d.ts +5 -0
- package/es/schema-component/antd/form-v2/utils.js +161 -0
- package/es/schema-component/antd/g2plot/G2Plot.js +3 -1
- package/es/schema-component/antd/grid/Grid.js +10 -5
- package/es/schema-component/antd/icon-picker/IconPicker.js +1 -0
- package/es/schema-component/antd/index.d.ts +1 -0
- package/es/schema-component/antd/index.js +1 -0
- package/es/schema-component/antd/input/Input.d.ts +2 -1
- package/es/schema-component/antd/input/Json.d.ts +5 -3
- package/es/schema-component/antd/input/Json.js +3 -2
- package/es/schema-component/antd/input/ReadPretty.js +1 -1
- package/es/schema-component/antd/input-number/InputNumber.js +3 -1
- package/es/schema-component/antd/page/FixedBlock.js +3 -1
- package/es/schema-component/antd/page/Page.js +11 -5
- package/es/schema-component/antd/page/PageTabDesigner.js +3 -3
- package/es/schema-component/antd/record-picker/ReadPrettyRecordPicker.js +3 -1
- package/es/schema-component/antd/record-picker/RecordPicker.js +1 -2
- package/es/schema-component/antd/record-picker/util.js +7 -0
- package/es/schema-component/antd/remote-select/RemoteSelect.d.ts +2 -0
- package/es/schema-component/antd/remote-select/RemoteSelect.js +78 -36
- package/es/schema-component/antd/rich-text/RichText.js +4 -2
- package/es/schema-component/antd/select/Select.js +14 -4
- package/es/schema-component/antd/table/Table.Array.js +10 -3
- package/es/schema-component/antd/table-v2/Table.Column.Designer.js +2 -2
- package/es/schema-component/antd/table-v2/TableBlockDesigner.js +3 -2
- package/es/schema-component/antd/tabs/Tabs.Designer.js +1 -0
- package/es/schema-component/antd/tabs/Tabs.js +1 -0
- package/es/schema-component/antd/time-picker/TimePicker.js +1 -1
- package/es/schema-component/antd/variable/Input.d.ts +2 -0
- package/es/schema-component/antd/variable/Input.js +244 -0
- package/es/schema-component/antd/variable/JSONInput.d.ts +2 -0
- package/es/schema-component/antd/variable/JSONInput.js +82 -0
- package/es/schema-component/antd/variable/TextArea.d.ts +2 -0
- package/es/schema-component/antd/variable/TextArea.js +322 -0
- package/es/schema-component/antd/variable/Variable.d.ts +8 -0
- package/es/schema-component/antd/variable/Variable.js +11 -0
- package/es/schema-component/antd/variable/index.d.ts +1 -0
- package/es/schema-component/antd/variable/index.js +1 -0
- package/es/schema-component/common/sortable-item/SortableItem.js +36 -6
- package/es/schema-component/common/utils/logic.js +523 -0
- package/es/schema-component/common/utils/uitls.d.ts +1 -0
- package/es/schema-component/common/utils/uitls.js +89 -0
- package/es/schema-initializer/SchemaInitializer.js +9 -4
- package/es/schema-initializer/buttons/BlockInitializers.d.ts +2 -184
- package/es/schema-initializer/buttons/BlockInitializers.js +1 -102
- package/es/schema-initializer/buttons/RecordBlockInitializers.js +72 -16
- package/es/schema-initializer/buttons/TableActionColumnInitializers.d.ts +1 -0
- package/es/schema-initializer/buttons/TableActionColumnInitializers.js +1 -3
- package/es/schema-initializer/components/CreateRecordAction.d.ts +3 -0
- package/es/schema-initializer/components/CreateRecordAction.js +174 -0
- package/es/schema-initializer/components/index.d.ts +1 -0
- package/es/schema-initializer/components/index.js +2 -1
- package/es/schema-initializer/index.d.ts +2 -1
- package/es/schema-initializer/index.js +2 -1
- package/es/schema-initializer/items/CalendarBlockInitializer.js +24 -41
- package/es/schema-initializer/items/CreateActionInitializer.js +3 -3
- package/es/schema-initializer/items/RecordFormBlockInitializer.js +9 -9
- package/es/schema-initializer/items/index.d.ts +4 -4
- package/es/schema-initializer/items/index.js +6 -6
- package/es/schema-initializer/utils.js +22 -7
- package/es/schema-settings/EnableChildCollections/index.d.ts +2 -0
- package/es/schema-settings/EnableChildCollections/index.js +141 -0
- package/es/schema-settings/LinkageRules/DynamicComponent.d.ts +1 -0
- package/es/schema-settings/LinkageRules/DynamicComponent.js +113 -0
- package/es/schema-settings/LinkageRules/FilterDynamicComponent.d.ts +2 -0
- package/es/schema-settings/LinkageRules/FilterDynamicComponent.js +15 -0
- package/es/schema-settings/LinkageRules/LinkageRuleAction.d.ts +3 -0
- package/es/schema-settings/LinkageRules/LinkageRuleAction.js +162 -0
- package/es/schema-settings/LinkageRules/LinkageRuleActionGroup.d.ts +3 -0
- package/es/schema-settings/LinkageRules/LinkageRuleActionGroup.js +71 -0
- package/es/schema-settings/LinkageRules/ValueDynamicComponent.d.ts +1 -0
- package/es/schema-settings/LinkageRules/ValueDynamicComponent.js +82 -0
- package/es/schema-settings/LinkageRules/Variables.d.ts +7 -0
- package/es/schema-settings/LinkageRules/Variables.js +115 -0
- package/es/schema-settings/LinkageRules/action-hooks.d.ts +1 -0
- package/es/schema-settings/LinkageRules/action-hooks.js +115 -0
- package/es/schema-settings/LinkageRules/context.d.ts +13 -0
- package/es/schema-settings/LinkageRules/context.js +4 -0
- package/es/schema-settings/LinkageRules/index.d.ts +2 -0
- package/es/schema-settings/LinkageRules/index.js +132 -0
- package/es/schema-settings/LinkageRules/type.d.ts +13 -0
- package/es/schema-settings/LinkageRules/type.js +15 -0
- package/es/schema-settings/LinkageRules/useValues.d.ts +1 -0
- package/es/schema-settings/LinkageRules/useValues.js +84 -0
- package/es/schema-settings/SchemaSettings.d.ts +4 -1
- package/es/schema-settings/SchemaSettings.js +219 -26
- package/es/schema-templates/BlockTemplate.js +9 -1
- package/es/system-settings/SystemSettingsShortcut.js +1 -1
- package/lib/acl/ACLProvider.js +7 -8
- package/lib/api-client/APIClient.js +6 -0
- package/lib/block-provider/BlockProvider.js +9 -6
- package/lib/block-provider/FormBlockProvider.js +17 -8
- package/lib/block-provider/KanbanBlockProvider.js +1 -1
- package/lib/block-provider/SharedFilterProvider.js +9 -3
- package/lib/block-provider/TableBlockProvider.js +1 -1
- package/lib/block-provider/TableSelectorProvider.js +2 -2
- package/lib/block-provider/hooks/index.js +23 -7
- package/lib/collection-manager/CollectionManagerProvider.d.ts +1 -0
- package/lib/collection-manager/CollectionManagerProvider.js +81 -16
- package/lib/collection-manager/CollectionManagerShortcut.js +36 -23
- package/lib/collection-manager/Configuration/AddCategoryAction.d.ts +2 -0
- package/lib/collection-manager/Configuration/AddCategoryAction.js +145 -0
- package/lib/collection-manager/Configuration/AddCollectionAction.js +8 -3
- package/lib/collection-manager/Configuration/AddFieldAction.js +1 -0
- package/lib/collection-manager/Configuration/ConfigurationTable.js +34 -4
- package/lib/collection-manager/Configuration/ConfigurationTabs.d.ts +1 -0
- package/lib/collection-manager/Configuration/ConfigurationTabs.js +407 -0
- package/lib/collection-manager/Configuration/EditCategoryAction.d.ts +2 -0
- package/lib/collection-manager/Configuration/EditCategoryAction.js +178 -0
- package/lib/collection-manager/Configuration/EditCollectionAction.js +6 -2
- package/lib/collection-manager/Configuration/OverridingCollectionField.js +17 -8
- package/lib/collection-manager/Configuration/components/CollectionCategory.d.ts +2 -0
- package/lib/collection-manager/Configuration/components/CollectionCategory.js +27 -0
- package/lib/collection-manager/Configuration/index.d.ts +3 -0
- package/lib/collection-manager/Configuration/index.js +39 -0
- package/lib/collection-manager/Configuration/schemas/collections.d.ts +3 -0
- package/lib/collection-manager/Configuration/schemas/collections.js +316 -178
- package/lib/collection-manager/Configuration/templates.d.ts +1 -0
- package/lib/collection-manager/Configuration/templates.js +2 -0
- package/lib/collection-manager/action-hooks.d.ts +4 -0
- package/lib/collection-manager/action-hooks.js +30 -13
- package/lib/collection-manager/context.d.ts +4 -0
- package/lib/collection-manager/context.js +7 -2
- package/lib/collection-manager/hooks/useCollectionManager.d.ts +7 -0
- package/lib/collection-manager/hooks/useCollectionManager.js +52 -6
- package/lib/collection-manager/interfaces/m2m.js +2 -2
- package/lib/collection-manager/interfaces/properties/index.d.ts +0 -56
- package/lib/collection-manager/interfaces/properties/index.js +1 -2
- package/lib/collection-manager/templates/calendar.js +1 -1
- package/lib/collection-manager/templates/general.js +1 -1
- package/lib/collection-manager/templates/properties/index.d.ts +12 -1
- package/lib/collection-manager/templates/properties/index.js +11 -0
- package/lib/i18n/i18n.js +3 -1
- package/lib/locale/en_US.d.ts +23 -0
- package/lib/locale/en_US.js +23 -0
- package/lib/locale/ja_JP.d.ts +23 -0
- package/lib/locale/ja_JP.js +24 -1
- package/lib/locale/ru_RU.d.ts +1 -0
- package/lib/locale/ru_RU.js +1 -0
- package/lib/locale/zh_CN.d.ts +43 -4
- package/lib/locale/zh_CN.js +44 -5
- package/lib/route-switch/antd/admin-layout/index.js +13 -33
- package/lib/schema-component/antd/action/Action.Designer.js +30 -14
- package/lib/schema-component/antd/action/Action.js +29 -3
- package/lib/schema-component/antd/action/utils.d.ts +1 -0
- package/lib/schema-component/antd/action/utils.js +58 -2
- package/lib/schema-component/antd/association-filter/AssociationFilter.js +3 -3
- package/lib/schema-component/antd/association-select/AssociationSelect.d.ts +2 -2
- package/lib/schema-component/antd/association-select/useServiceOptions.js +47 -4
- package/lib/schema-component/antd/calendar/Calendar.Designer.js +15 -33
- package/lib/schema-component/antd/checkbox/Checkbox.js +8 -7
- package/lib/schema-component/antd/date-picker/util.d.ts +1 -1
- package/lib/schema-component/antd/date-picker/util.js +1 -1
- package/lib/schema-component/antd/filter/DynamicComponent.js +3 -1
- package/lib/schema-component/antd/filter/Filter.js +2 -1
- package/lib/schema-component/antd/filter/FilterGroup.js +7 -4
- package/lib/schema-component/antd/filter/FilterItem.js +3 -2
- package/lib/schema-component/antd/filter/context.d.ts +1 -0
- package/lib/schema-component/antd/filter/useValues.js +15 -11
- package/lib/schema-component/antd/form/Form.js +9 -3
- package/lib/schema-component/antd/form-item/FormItem.js +21 -7
- package/lib/schema-component/antd/form-v2/Form.Designer.js +2 -0
- package/lib/schema-component/antd/form-v2/Form.js +93 -5
- package/lib/schema-component/antd/form-v2/utils.d.ts +5 -0
- package/lib/schema-component/antd/form-v2/utils.js +181 -0
- package/lib/schema-component/antd/g2plot/G2Plot.js +3 -1
- package/lib/schema-component/antd/grid/Grid.js +10 -5
- package/lib/schema-component/antd/icon-picker/IconPicker.js +1 -0
- package/lib/schema-component/antd/index.d.ts +1 -0
- package/lib/schema-component/antd/index.js +13 -0
- package/lib/schema-component/antd/input/Input.d.ts +2 -1
- package/lib/schema-component/antd/input/Json.d.ts +5 -3
- package/lib/schema-component/antd/input/Json.js +6 -3
- package/lib/schema-component/antd/input/ReadPretty.js +1 -1
- package/lib/schema-component/antd/input-number/InputNumber.js +2 -0
- package/lib/schema-component/antd/page/FixedBlock.js +3 -1
- package/lib/schema-component/antd/page/Page.js +14 -5
- package/lib/schema-component/antd/page/PageTabDesigner.js +1 -1
- package/lib/schema-component/antd/record-picker/ReadPrettyRecordPicker.js +3 -1
- package/lib/schema-component/antd/record-picker/RecordPicker.js +1 -2
- package/lib/schema-component/antd/record-picker/util.js +7 -0
- package/lib/schema-component/antd/remote-select/RemoteSelect.d.ts +2 -0
- package/lib/schema-component/antd/remote-select/RemoteSelect.js +78 -37
- package/lib/schema-component/antd/rich-text/RichText.js +4 -2
- package/lib/schema-component/antd/select/Select.js +14 -4
- package/lib/schema-component/antd/table/Table.Array.js +8 -1
- package/lib/schema-component/antd/table-v2/Table.Column.Designer.js +2 -2
- package/lib/schema-component/antd/table-v2/TableBlockDesigner.js +3 -2
- package/lib/schema-component/antd/tabs/Tabs.Designer.js +1 -0
- package/lib/schema-component/antd/tabs/Tabs.js +1 -0
- package/lib/schema-component/antd/time-picker/TimePicker.js +1 -1
- package/lib/schema-component/antd/variable/Input.d.ts +2 -0
- package/lib/schema-component/antd/variable/Input.js +262 -0
- package/lib/schema-component/antd/variable/JSONInput.d.ts +2 -0
- package/lib/schema-component/antd/variable/JSONInput.js +100 -0
- package/lib/schema-component/antd/variable/TextArea.d.ts +2 -0
- package/lib/schema-component/antd/variable/TextArea.js +341 -0
- package/lib/schema-component/antd/variable/Variable.d.ts +8 -0
- package/lib/schema-component/antd/variable/Variable.js +25 -0
- package/lib/schema-component/antd/variable/index.d.ts +1 -0
- package/lib/schema-component/antd/variable/index.js +18 -0
- package/lib/schema-component/common/sortable-item/SortableItem.js +36 -6
- package/lib/schema-component/common/utils/logic.js +525 -0
- package/lib/schema-component/common/utils/uitls.d.ts +1 -0
- package/lib/schema-component/common/utils/uitls.js +103 -0
- package/lib/schema-initializer/SchemaInitializer.js +9 -4
- package/lib/schema-initializer/buttons/BlockInitializers.d.ts +2 -184
- package/lib/schema-initializer/buttons/BlockInitializers.js +0 -108
- package/lib/schema-initializer/buttons/RecordBlockInitializers.js +72 -16
- package/lib/schema-initializer/buttons/TableActionColumnInitializers.d.ts +1 -0
- package/lib/schema-initializer/buttons/TableActionColumnInitializers.js +3 -1
- package/lib/schema-initializer/components/CreateRecordAction.d.ts +3 -0
- package/lib/schema-initializer/components/CreateRecordAction.js +199 -0
- package/lib/schema-initializer/components/index.d.ts +1 -0
- package/lib/schema-initializer/components/index.js +13 -0
- package/lib/schema-initializer/index.d.ts +2 -1
- package/lib/schema-initializer/index.js +51 -2
- package/lib/schema-initializer/items/CalendarBlockInitializer.js +16 -33
- package/lib/schema-initializer/items/CreateActionInitializer.js +3 -3
- package/lib/schema-initializer/items/RecordFormBlockInitializer.js +3 -3
- package/lib/schema-initializer/items/index.d.ts +4 -4
- package/lib/schema-initializer/items/index.js +52 -52
- package/lib/schema-initializer/utils.js +22 -6
- package/lib/schema-settings/EnableChildCollections/index.d.ts +2 -0
- package/lib/schema-settings/EnableChildCollections/index.js +156 -0
- package/lib/schema-settings/LinkageRules/DynamicComponent.d.ts +1 -0
- package/lib/schema-settings/LinkageRules/DynamicComponent.js +139 -0
- package/lib/schema-settings/LinkageRules/FilterDynamicComponent.d.ts +2 -0
- package/lib/schema-settings/LinkageRules/FilterDynamicComponent.js +27 -0
- package/lib/schema-settings/LinkageRules/LinkageRuleAction.d.ts +3 -0
- package/lib/schema-settings/LinkageRules/LinkageRuleAction.js +190 -0
- package/lib/schema-settings/LinkageRules/LinkageRuleActionGroup.d.ts +3 -0
- package/lib/schema-settings/LinkageRules/LinkageRuleActionGroup.js +90 -0
- package/lib/schema-settings/LinkageRules/ValueDynamicComponent.d.ts +1 -0
- package/lib/schema-settings/LinkageRules/ValueDynamicComponent.js +104 -0
- package/lib/schema-settings/LinkageRules/Variables.d.ts +7 -0
- package/lib/schema-settings/LinkageRules/Variables.js +124 -0
- package/lib/schema-settings/LinkageRules/action-hooks.d.ts +1 -0
- package/lib/schema-settings/LinkageRules/action-hooks.js +127 -0
- package/lib/schema-settings/LinkageRules/context.d.ts +13 -0
- package/lib/schema-settings/LinkageRules/context.js +15 -0
- package/lib/schema-settings/LinkageRules/index.d.ts +2 -0
- package/lib/schema-settings/LinkageRules/index.js +149 -0
- package/lib/schema-settings/LinkageRules/type.d.ts +13 -0
- package/lib/schema-settings/LinkageRules/type.js +22 -0
- package/lib/schema-settings/LinkageRules/useValues.d.ts +1 -0
- package/lib/schema-settings/LinkageRules/useValues.js +95 -0
- package/lib/schema-settings/SchemaSettings.d.ts +4 -1
- package/lib/schema-settings/SchemaSettings.js +243 -48
- package/lib/schema-templates/BlockTemplate.js +9 -1
- package/lib/system-settings/SystemSettingsShortcut.js +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
var _templateObject;
|
|
2
|
+
|
|
3
|
+
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; }
|
|
4
|
+
|
|
5
|
+
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; }
|
|
6
|
+
|
|
7
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
8
|
+
|
|
9
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
10
|
+
|
|
11
|
+
import { css } from '@emotion/css';
|
|
12
|
+
import { observer, useFieldSchema } from '@formily/react';
|
|
13
|
+
import React from 'react';
|
|
14
|
+
import { SchemaComponent } from '../../schema-component';
|
|
15
|
+
import { FilterContext } from '../../schema-component/antd/filter/context';
|
|
16
|
+
import { FilterDynamicComponent } from './FilterDynamicComponent';
|
|
17
|
+
import { LinkageRuleActionGroup } from './LinkageRuleActionGroup';
|
|
18
|
+
export var FormLinkageRules = observer(function (props) {
|
|
19
|
+
var fieldSchema = useFieldSchema();
|
|
20
|
+
var useProps = props.useProps,
|
|
21
|
+
dynamicComponent = props.dynamicComponent;
|
|
22
|
+
|
|
23
|
+
var _useProps = useProps(),
|
|
24
|
+
options = _useProps.options,
|
|
25
|
+
defaultValues = _useProps.defaultValues,
|
|
26
|
+
collectionName = _useProps.collectionName;
|
|
27
|
+
|
|
28
|
+
return /*#__PURE__*/React.createElement(FilterContext.Provider, {
|
|
29
|
+
value: {
|
|
30
|
+
field: options,
|
|
31
|
+
fieldSchema: fieldSchema,
|
|
32
|
+
dynamicComponent: dynamicComponent,
|
|
33
|
+
options: options || []
|
|
34
|
+
}
|
|
35
|
+
}, /*#__PURE__*/React.createElement(SchemaComponent, {
|
|
36
|
+
schema: {
|
|
37
|
+
type: 'object',
|
|
38
|
+
properties: {
|
|
39
|
+
rules: {
|
|
40
|
+
type: 'array',
|
|
41
|
+
default: defaultValues,
|
|
42
|
+
'x-component': 'ArrayCollapse',
|
|
43
|
+
'x-decorator': 'FormItem',
|
|
44
|
+
'x-component-props': {
|
|
45
|
+
accordion: true
|
|
46
|
+
},
|
|
47
|
+
items: {
|
|
48
|
+
type: 'object',
|
|
49
|
+
'x-component': 'ArrayCollapse.CollapsePanel',
|
|
50
|
+
'x-component-props': {
|
|
51
|
+
header: '{{ t("Linkage rule") }}'
|
|
52
|
+
},
|
|
53
|
+
properties: {
|
|
54
|
+
index: {
|
|
55
|
+
type: 'void',
|
|
56
|
+
'x-component': 'ArrayCollapse.Index'
|
|
57
|
+
},
|
|
58
|
+
layout: {
|
|
59
|
+
type: 'void',
|
|
60
|
+
'x-component': 'FormLayout',
|
|
61
|
+
'x-component-props': {
|
|
62
|
+
labelStyle: {
|
|
63
|
+
marginTop: '6px'
|
|
64
|
+
},
|
|
65
|
+
labelCol: 8,
|
|
66
|
+
wrapperCol: 16
|
|
67
|
+
},
|
|
68
|
+
properties: {
|
|
69
|
+
conditions: {
|
|
70
|
+
'x-component': 'h4',
|
|
71
|
+
'x-content': '{{ t("Condition") }}'
|
|
72
|
+
},
|
|
73
|
+
condition: {
|
|
74
|
+
'x-component': 'Filter',
|
|
75
|
+
'x-component-props': {
|
|
76
|
+
useProps: function useProps() {
|
|
77
|
+
return {
|
|
78
|
+
options: options,
|
|
79
|
+
className: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n width: 100%;\n margin-left: 10px;\n "])))
|
|
80
|
+
};
|
|
81
|
+
},
|
|
82
|
+
dynamicComponent: function dynamicComponent(props) {
|
|
83
|
+
return FilterDynamicComponent(_objectSpread(_objectSpread({}, props), {}, {
|
|
84
|
+
collectionName: collectionName
|
|
85
|
+
}));
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
actions: {
|
|
90
|
+
'x-component': 'h4',
|
|
91
|
+
'x-content': '{{ t("Properties") }}'
|
|
92
|
+
},
|
|
93
|
+
action: {
|
|
94
|
+
type: 'void',
|
|
95
|
+
'x-component': LinkageRuleActionGroup,
|
|
96
|
+
'x-component-props': _objectSpread({}, props)
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
remove: {
|
|
101
|
+
type: 'void',
|
|
102
|
+
'x-component': 'ArrayCollapse.Remove'
|
|
103
|
+
},
|
|
104
|
+
moveUp: {
|
|
105
|
+
type: 'void',
|
|
106
|
+
'x-component': 'ArrayCollapse.MoveUp'
|
|
107
|
+
},
|
|
108
|
+
moveDown: {
|
|
109
|
+
type: 'void',
|
|
110
|
+
'x-component': 'ArrayCollapse.MoveDown'
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
properties: {
|
|
115
|
+
add: {
|
|
116
|
+
type: 'void',
|
|
117
|
+
title: '{{ t("Add linkage rule") }}',
|
|
118
|
+
'x-component': 'ArrayCollapse.Addition',
|
|
119
|
+
'x-reactions': {
|
|
120
|
+
dependencies: ['rules'],
|
|
121
|
+
fulfill: {
|
|
122
|
+
state: {// disabled: '{{$deps[0].length >= 3}}',
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}));
|
|
132
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare enum ActionType {
|
|
2
|
+
Visible = "visible",
|
|
3
|
+
Editable = "editable",
|
|
4
|
+
ReadOnly = "disabled",
|
|
5
|
+
ReadPretty = "readPretty",
|
|
6
|
+
None = "none",
|
|
7
|
+
Hidden = "hidden",
|
|
8
|
+
Required = "required",
|
|
9
|
+
InRequired = "notRequired",
|
|
10
|
+
Disabled = "disabled",
|
|
11
|
+
Value = "value",
|
|
12
|
+
Active = "enabled"
|
|
13
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export var ActionType;
|
|
2
|
+
|
|
3
|
+
(function (ActionType) {
|
|
4
|
+
ActionType["Visible"] = "visible";
|
|
5
|
+
ActionType["Editable"] = "editable";
|
|
6
|
+
ActionType["ReadOnly"] = "disabled";
|
|
7
|
+
ActionType["ReadPretty"] = "readPretty";
|
|
8
|
+
ActionType["None"] = "none";
|
|
9
|
+
ActionType["Hidden"] = "hidden";
|
|
10
|
+
ActionType["Required"] = "required";
|
|
11
|
+
ActionType["InRequired"] = "notRequired";
|
|
12
|
+
ActionType["Disabled"] = "disabled";
|
|
13
|
+
ActionType["Value"] = "value";
|
|
14
|
+
ActionType["Active"] = "enabled";
|
|
15
|
+
})(ActionType || (ActionType = {}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useValues: (options: any) => any;
|
|
@@ -0,0 +1,84 @@
|
|
|
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
|
+
|
|
3
|
+
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; }
|
|
4
|
+
|
|
5
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
|
|
7
|
+
import { useField } from '@formily/react';
|
|
8
|
+
import { useContext, useEffect } from 'react';
|
|
9
|
+
import { FilterLogicContext } from './context';
|
|
10
|
+
|
|
11
|
+
var findOption = function findOption() {
|
|
12
|
+
var _dataIndex$forEach;
|
|
13
|
+
|
|
14
|
+
var dataIndex = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
15
|
+
var options = arguments.length > 1 ? arguments[1] : undefined;
|
|
16
|
+
var items = options;
|
|
17
|
+
var option;
|
|
18
|
+
dataIndex === null || dataIndex === void 0 ? void 0 : (_dataIndex$forEach = dataIndex.forEach) === null || _dataIndex$forEach === void 0 ? void 0 : _dataIndex$forEach.call(dataIndex, function (name, index) {
|
|
19
|
+
var item = items.find(function (v) {
|
|
20
|
+
return v.name === name;
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
if (item) {
|
|
24
|
+
option = item;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
items = (item === null || item === void 0 ? void 0 : item.children) || [];
|
|
28
|
+
});
|
|
29
|
+
return option;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export var useValues = function useValues(options) {
|
|
33
|
+
var field = useField();
|
|
34
|
+
var logic = useContext(FilterLogicContext);
|
|
35
|
+
|
|
36
|
+
var value2data = function value2data() {
|
|
37
|
+
var _field$initialValue;
|
|
38
|
+
|
|
39
|
+
field.data = _objectSpread({}, field.initialValue);
|
|
40
|
+
var dataIndex = (_field$initialValue = field.initialValue) === null || _field$initialValue === void 0 ? void 0 : _field$initialValue.targetFields;
|
|
41
|
+
var option = dataIndex && findOption(dataIndex, options) || {};
|
|
42
|
+
var operators = (option === null || option === void 0 ? void 0 : option.operators) || [];
|
|
43
|
+
field.data.operators = operators;
|
|
44
|
+
field.data.schema = option === null || option === void 0 ? void 0 : option.schema;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
useEffect(value2data, [logic]);
|
|
48
|
+
return _objectSpread(_objectSpread({
|
|
49
|
+
fields: options
|
|
50
|
+
}, field.data), {}, {
|
|
51
|
+
setDataIndex: function setDataIndex(dataIndex) {
|
|
52
|
+
var option = findOption(dataIndex, options);
|
|
53
|
+
field.data = field.data || {};
|
|
54
|
+
var operators = option === null || option === void 0 ? void 0 : option.operators;
|
|
55
|
+
field.data.operators = operators === null || operators === void 0 ? void 0 : operators.filter(function (v) {
|
|
56
|
+
// if (dataIndex.length > 1) {
|
|
57
|
+
// return v.value !== 'value';
|
|
58
|
+
// }
|
|
59
|
+
return true;
|
|
60
|
+
});
|
|
61
|
+
field.data.schema = option === null || option === void 0 ? void 0 : option.schema;
|
|
62
|
+
field.value = field.value || [];
|
|
63
|
+
field.data.operator = undefined;
|
|
64
|
+
field.data.value = undefined;
|
|
65
|
+
field.value = _objectSpread(_objectSpread({}, field.value), {}, {
|
|
66
|
+
targetFields: dataIndex,
|
|
67
|
+
operator: undefined,
|
|
68
|
+
value: undefined
|
|
69
|
+
});
|
|
70
|
+
},
|
|
71
|
+
setOperator: function setOperator(operatorValue) {
|
|
72
|
+
field.data.operator = operatorValue;
|
|
73
|
+
field.value = _objectSpread(_objectSpread({}, field.value), {}, {
|
|
74
|
+
operator: operatorValue
|
|
75
|
+
});
|
|
76
|
+
},
|
|
77
|
+
setValue: function setValue(value) {
|
|
78
|
+
field.data.value = value;
|
|
79
|
+
field.value = _objectSpread(_objectSpread({}, field.value), {}, {
|
|
80
|
+
value: value
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { GeneralField } from '@formily/core';
|
|
2
2
|
import { ISchema, Schema } from '@formily/react';
|
|
3
|
-
import { MenuItemProps } from 'antd';
|
|
3
|
+
import { CascaderProps, MenuItemProps } from 'antd';
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { Designable } from '..';
|
|
6
6
|
interface SchemaSettingsProps {
|
|
@@ -32,6 +32,9 @@ declare type SchemaSettingsNested = {
|
|
|
32
32
|
schema?: ISchema;
|
|
33
33
|
}>;
|
|
34
34
|
SwitchItem?: React.FC<SwitchItemProps>;
|
|
35
|
+
CascaderItem?: React.FC<CascaderProps<any> & Omit<MenuItemProps, 'title'> & {
|
|
36
|
+
title: any;
|
|
37
|
+
}>;
|
|
35
38
|
[key: string]: any;
|
|
36
39
|
};
|
|
37
40
|
interface SchemaSettingsProviderProps {
|