@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
package/es/acl/ACLProvider.js
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
function _toArray(arr) { return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest(); }
|
|
2
|
-
|
|
3
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
4
|
-
|
|
5
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; }
|
|
6
2
|
|
|
7
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; }
|
|
@@ -311,6 +307,8 @@ export var useRecordPkValue = function useRecordPkValue() {
|
|
|
311
307
|
return record === null || record === void 0 ? void 0 : record[primaryKey];
|
|
312
308
|
};
|
|
313
309
|
export var ACLActionProvider = function ACLActionProvider(props) {
|
|
310
|
+
var _actionPath;
|
|
311
|
+
|
|
314
312
|
var recordPkValue = useRecordPkValue();
|
|
315
313
|
var resource = useResourceName();
|
|
316
314
|
|
|
@@ -324,7 +322,7 @@ export var ACLActionProvider = function ACLActionProvider(props) {
|
|
|
324
322
|
actionPath = "".concat(resource, ":").concat(schema['x-action']);
|
|
325
323
|
}
|
|
326
324
|
|
|
327
|
-
if (!actionPath.includes(':')) {
|
|
325
|
+
if (!((_actionPath = actionPath) === null || _actionPath === void 0 ? void 0 : _actionPath.includes(':'))) {
|
|
328
326
|
actionPath = "".concat(resource, ":").concat(actionPath);
|
|
329
327
|
}
|
|
330
328
|
|
|
@@ -364,10 +362,11 @@ export var useACLFieldWhitelist = function useACLFieldWhitelist() {
|
|
|
364
362
|
}
|
|
365
363
|
|
|
366
364
|
var _fieldSchema$xCollec = fieldSchema['x-collection-field'].split('.'),
|
|
367
|
-
_fieldSchema$xCollec2 =
|
|
368
|
-
|
|
365
|
+
_fieldSchema$xCollec2 = _slicedToArray(_fieldSchema$xCollec, 2),
|
|
366
|
+
key1 = _fieldSchema$xCollec2[0],
|
|
367
|
+
key2 = _fieldSchema$xCollec2[1];
|
|
369
368
|
|
|
370
|
-
return whitelist === null || whitelist === void 0 ? void 0 : whitelist.includes(
|
|
369
|
+
return whitelist === null || whitelist === void 0 ? void 0 : whitelist.includes(key2 || key1);
|
|
371
370
|
}
|
|
372
371
|
};
|
|
373
372
|
};
|
|
@@ -76,6 +76,12 @@ export var APIClient = /*#__PURE__*/function (_APIClientSDK) {
|
|
|
76
76
|
value: function interceptors() {
|
|
77
77
|
this.axios.interceptors.request.use(function (config) {
|
|
78
78
|
config.headers['X-With-ACL-Meta'] = true;
|
|
79
|
+
var match = location.pathname.match(/^\/apps\/([^/]*)\//);
|
|
80
|
+
|
|
81
|
+
if (match) {
|
|
82
|
+
config.headers['X-App'] = match[1];
|
|
83
|
+
}
|
|
84
|
+
|
|
79
85
|
return config;
|
|
80
86
|
});
|
|
81
87
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var _excluded = ["title", "to"];
|
|
2
2
|
|
|
3
|
-
var _templateObject, _templateObject2;
|
|
3
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
4
4
|
|
|
5
5
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
6
6
|
|
|
@@ -31,7 +31,7 @@ import { useRecordIndex } from '../record-provider';
|
|
|
31
31
|
import { SharedFilterProvider } from './SharedFilterProvider';
|
|
32
32
|
export var BlockResourceContext = /*#__PURE__*/createContext(null);
|
|
33
33
|
export var BlockAssociationContext = /*#__PURE__*/createContext(null);
|
|
34
|
-
export var BlockRequestContext = /*#__PURE__*/createContext(
|
|
34
|
+
export var BlockRequestContext = /*#__PURE__*/createContext({});
|
|
35
35
|
export var useBlockResource = function useBlockResource() {
|
|
36
36
|
return useContext(BlockResourceContext);
|
|
37
37
|
};
|
|
@@ -108,7 +108,7 @@ export var useResourceAction = function useResourceAction(props) {
|
|
|
108
108
|
fields = _useCollection.fields;
|
|
109
109
|
|
|
110
110
|
var appends = fields === null || fields === void 0 ? void 0 : fields.filter(function (field) {
|
|
111
|
-
return field.target
|
|
111
|
+
return field.target;
|
|
112
112
|
}).map(function (field) {
|
|
113
113
|
return field.name;
|
|
114
114
|
});
|
|
@@ -222,10 +222,11 @@ export var RenderChildrenWithAssociationFilter = function RenderChildrenWithAsso
|
|
|
222
222
|
|
|
223
223
|
if (associationFilterSchema) {
|
|
224
224
|
return /*#__PURE__*/React.createElement(Component, _objectSpread({}, field.componentProps), /*#__PURE__*/React.createElement(Row, {
|
|
225
|
+
className: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n height: 100%;\n "]))),
|
|
225
226
|
gutter: 16,
|
|
226
227
|
wrap: false
|
|
227
228
|
}, /*#__PURE__*/React.createElement(Col, {
|
|
228
|
-
className: css(
|
|
229
|
+
className: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n width: 200px;\n flex: 0 0 auto;\n "])))
|
|
229
230
|
}, /*#__PURE__*/React.createElement(RecursionField, {
|
|
230
231
|
schema: fieldSchema,
|
|
231
232
|
onlyRenderProperties: true,
|
|
@@ -233,14 +234,16 @@ export var RenderChildrenWithAssociationFilter = function RenderChildrenWithAsso
|
|
|
233
234
|
return s['x-component'] === 'AssociationFilter';
|
|
234
235
|
}
|
|
235
236
|
})), /*#__PURE__*/React.createElement(Col, {
|
|
236
|
-
className: css(
|
|
237
|
+
className: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n flex: 1 1 auto;\n min-width: 0;\n "])))
|
|
238
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
239
|
+
className: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n height: 100%;\n "])))
|
|
237
240
|
}, /*#__PURE__*/React.createElement(RecursionField, {
|
|
238
241
|
schema: fieldSchema,
|
|
239
242
|
onlyRenderProperties: true,
|
|
240
243
|
filterProperties: function filterProperties(s) {
|
|
241
244
|
return s['x-component'] !== 'AssociationFilter';
|
|
242
245
|
}
|
|
243
|
-
}))));
|
|
246
|
+
})))));
|
|
244
247
|
}
|
|
245
248
|
|
|
246
249
|
return props.children;
|
|
@@ -9,7 +9,7 @@ import { useField } from '@formily/react';
|
|
|
9
9
|
import { Spin } from 'antd';
|
|
10
10
|
import isEmpty from 'lodash/isEmpty';
|
|
11
11
|
import React, { createContext, useContext, useEffect, useMemo, useRef } from 'react';
|
|
12
|
-
import {
|
|
12
|
+
import { useCollection } from '../collection-manager';
|
|
13
13
|
import { RecordProvider, useRecord } from '../record-provider';
|
|
14
14
|
import { useDesignable } from '../schema-component';
|
|
15
15
|
import { BlockProvider, useBlockRequestContext } from './BlockProvider';
|
|
@@ -60,18 +60,27 @@ var InternalFormBlockProvider = function InternalFormBlockProvider(props) {
|
|
|
60
60
|
|
|
61
61
|
export var FormBlockProvider = function FormBlockProvider(props) {
|
|
62
62
|
var record = useRecord();
|
|
63
|
-
var
|
|
64
|
-
|
|
65
|
-
var
|
|
66
|
-
getInheritCollections = _useCollectionManager.getInheritCollections;
|
|
67
|
-
|
|
68
|
-
var inheritCollections = getInheritCollections(__tableName);
|
|
63
|
+
var collection = props.collection;
|
|
64
|
+
var __collection = record.__collection;
|
|
65
|
+
var currentCollection = useCollection();
|
|
69
66
|
|
|
70
67
|
var _useDesignable = useDesignable(),
|
|
71
68
|
designable = _useDesignable.designable;
|
|
72
69
|
|
|
73
|
-
var
|
|
74
|
-
|
|
70
|
+
var detailFlag = false;
|
|
71
|
+
|
|
72
|
+
if (Object.keys(record).length > 0) {
|
|
73
|
+
detailFlag = true;
|
|
74
|
+
|
|
75
|
+
if (!designable && __collection) {
|
|
76
|
+
detailFlag = __collection === collection;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
var createFlag = currentCollection.name === collection && !Object.keys(record).length || !currentCollection.name;
|
|
81
|
+
return (detailFlag || createFlag) && /*#__PURE__*/React.createElement(BlockProvider, _objectSpread(_objectSpread({}, props), {}, {
|
|
82
|
+
block: 'form'
|
|
83
|
+
}), /*#__PURE__*/React.createElement(InternalFormBlockProvider, _objectSpread({}, props)));
|
|
75
84
|
};
|
|
76
85
|
export var useFormBlockContext = function useFormBlockContext() {
|
|
77
86
|
return useContext(FormBlockContext);
|
|
@@ -124,7 +124,7 @@ var useAssociationNames = function useAssociationNames(collection) {
|
|
|
124
124
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
125
125
|
var collectionField = _step.value;
|
|
126
126
|
|
|
127
|
-
if (collectionField.target
|
|
127
|
+
if (collectionField.target) {
|
|
128
128
|
associationFields.add(collectionField.name);
|
|
129
129
|
var fields = getCollectionFields(collectionField.target);
|
|
130
130
|
|
|
@@ -12,6 +12,8 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
12
12
|
|
|
13
13
|
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; }
|
|
14
14
|
|
|
15
|
+
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); }
|
|
16
|
+
|
|
15
17
|
import React, { createContext, useState } from 'react';
|
|
16
18
|
export var SHARED_FILTER_CONDITION;
|
|
17
19
|
|
|
@@ -22,7 +24,13 @@ export var SHARED_FILTER_CONDITION;
|
|
|
22
24
|
|
|
23
25
|
export var mergeFilter = function mergeFilter(filters) {
|
|
24
26
|
var op = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '$and';
|
|
25
|
-
var items = filters.filter(
|
|
27
|
+
var items = filters.filter(function (f) {
|
|
28
|
+
if (f && _typeof(f) === 'object' && !Array.isArray(f)) {
|
|
29
|
+
return Object.values(f).filter(function (v) {
|
|
30
|
+
return v !== undefined;
|
|
31
|
+
}).length;
|
|
32
|
+
}
|
|
33
|
+
});
|
|
26
34
|
|
|
27
35
|
if (items.length === 0) {
|
|
28
36
|
return {};
|
|
@@ -73,7 +73,7 @@ export var useAssociationNames = function useAssociationNames(collection) {
|
|
|
73
73
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
74
74
|
var collectionField = _step.value;
|
|
75
75
|
|
|
76
|
-
if (collectionField.target
|
|
76
|
+
if (collectionField.target) {
|
|
77
77
|
associationFields.add(collectionField.name);
|
|
78
78
|
var fields = getCollectionFields(collectionField.target);
|
|
79
79
|
|
|
@@ -65,7 +65,7 @@ var useAssociationNames2 = function useAssociationNames2(collection) {
|
|
|
65
65
|
getCollectionFields = _useCollectionManager.getCollectionFields;
|
|
66
66
|
|
|
67
67
|
var names = (_getCollectionFields = getCollectionFields(collection)) === null || _getCollectionFields === void 0 ? void 0 : _getCollectionFields.filter(function (field) {
|
|
68
|
-
return field.target
|
|
68
|
+
return field.target;
|
|
69
69
|
}).map(function (field) {
|
|
70
70
|
return field.name;
|
|
71
71
|
});
|
|
@@ -90,7 +90,7 @@ var useAssociationNames = function useAssociationNames(collection) {
|
|
|
90
90
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
91
91
|
var collectionField = _step.value;
|
|
92
92
|
|
|
93
|
-
if (collectionField.target
|
|
93
|
+
if (collectionField.target) {
|
|
94
94
|
associationFields.add(collectionField.name);
|
|
95
95
|
var fields = getCollectionFields(collectionField.target);
|
|
96
96
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
2
|
+
|
|
3
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
4
|
+
|
|
1
5
|
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
6
|
|
|
3
7
|
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
8
|
|
|
5
9
|
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
10
|
|
|
7
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
8
|
-
|
|
9
|
-
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
10
|
-
|
|
11
11
|
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); }
|
|
12
12
|
|
|
13
13
|
import { useField, useFieldSchema, useForm } from '@formily/react';
|
|
@@ -15,6 +15,7 @@ import { message, Modal } from 'antd';
|
|
|
15
15
|
import parse from 'json-templates';
|
|
16
16
|
import { cloneDeep } from 'lodash';
|
|
17
17
|
import get from 'lodash/get';
|
|
18
|
+
import omit from 'lodash/omit';
|
|
18
19
|
import { useTranslation } from 'react-i18next';
|
|
19
20
|
import { useHistory } from 'react-router-dom';
|
|
20
21
|
import { useReactToPrint } from 'react-to-print';
|
|
@@ -89,6 +90,20 @@ var filterValue = function filterValue(value) {
|
|
|
89
90
|
};
|
|
90
91
|
|
|
91
92
|
function getFormValues(filterByTk, field, form, fieldNames, getField, resource) {
|
|
93
|
+
if (filterByTk) {
|
|
94
|
+
var _field$data;
|
|
95
|
+
|
|
96
|
+
var actionFields = field === null || field === void 0 ? void 0 : (_field$data = field.data) === null || _field$data === void 0 ? void 0 : _field$data.activeFields;
|
|
97
|
+
|
|
98
|
+
if (actionFields) {
|
|
99
|
+
var keys = Object.keys(form.values).filter(function (key) {
|
|
100
|
+
var f = getField(key);
|
|
101
|
+
return !actionFields.has(key) && ['hasOne', 'hasMany', 'belongsTo', 'belongsToMany'].includes(f === null || f === void 0 ? void 0 : f.type);
|
|
102
|
+
});
|
|
103
|
+
return omit(_objectSpread({}, form.values), keys);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
92
107
|
return form.values;
|
|
93
108
|
var values = {};
|
|
94
109
|
|
|
@@ -1166,13 +1181,13 @@ export var useBulkDestroyActionProps = function useBulkDestroyActionProps() {
|
|
|
1166
1181
|
return {
|
|
1167
1182
|
onClick: function onClick() {
|
|
1168
1183
|
return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee17() {
|
|
1169
|
-
var _field$
|
|
1184
|
+
var _field$data2, _field$data2$selected, _field$data3, _service$refresh5;
|
|
1170
1185
|
|
|
1171
1186
|
return regeneratorRuntime.wrap(function _callee17$(_context17) {
|
|
1172
1187
|
while (1) {
|
|
1173
1188
|
switch (_context17.prev = _context17.next) {
|
|
1174
1189
|
case 0:
|
|
1175
|
-
if (field === null || field === void 0 ? void 0 : (_field$
|
|
1190
|
+
if (field === null || field === void 0 ? void 0 : (_field$data2 = field.data) === null || _field$data2 === void 0 ? void 0 : (_field$data2$selected = _field$data2.selectedRowKeys) === null || _field$data2$selected === void 0 ? void 0 : _field$data2$selected.length) {
|
|
1176
1191
|
_context17.next = 2;
|
|
1177
1192
|
break;
|
|
1178
1193
|
}
|
|
@@ -1182,7 +1197,7 @@ export var useBulkDestroyActionProps = function useBulkDestroyActionProps() {
|
|
|
1182
1197
|
case 2:
|
|
1183
1198
|
_context17.next = 4;
|
|
1184
1199
|
return resource.destroy({
|
|
1185
|
-
filterByTk: (_field$
|
|
1200
|
+
filterByTk: (_field$data3 = field.data) === null || _field$data3 === void 0 ? void 0 : _field$data3.selectedRowKeys
|
|
1186
1201
|
});
|
|
1187
1202
|
|
|
1188
1203
|
case 4:
|
|
@@ -2,3 +2,4 @@ import React from 'react';
|
|
|
2
2
|
import { CollectionManagerOptions } from './types';
|
|
3
3
|
export declare const CollectionManagerProvider: React.FC<CollectionManagerOptions>;
|
|
4
4
|
export declare const RemoteCollectionManagerProvider: (props: any) => JSX.Element;
|
|
5
|
+
export declare const CollectionCategroriesProvider: (props: any) => JSX.Element;
|
|
@@ -6,13 +6,21 @@ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArra
|
|
|
6
6
|
|
|
7
7
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
8
8
|
|
|
9
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
10
|
+
|
|
11
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
|
+
|
|
13
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
14
|
+
|
|
15
|
+
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."); }
|
|
16
|
+
|
|
9
17
|
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); }
|
|
10
18
|
|
|
11
|
-
function
|
|
19
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
12
20
|
|
|
13
|
-
function
|
|
21
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
14
22
|
|
|
15
|
-
function
|
|
23
|
+
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; }
|
|
16
24
|
|
|
17
25
|
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; }
|
|
18
26
|
|
|
@@ -21,14 +29,14 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
21
29
|
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; }
|
|
22
30
|
|
|
23
31
|
import { Spin } from 'antd';
|
|
24
|
-
import React, { useContext, useState } from 'react';
|
|
25
32
|
import { keyBy } from 'lodash';
|
|
33
|
+
import React, { useContext, useState } from 'react';
|
|
26
34
|
import { useAPIClient, useRequest } from '../api-client';
|
|
27
|
-
import { CollectionManagerSchemaComponentProvider } from './CollectionManagerSchemaComponentProvider';
|
|
28
|
-
import { CollectionManagerContext } from './context';
|
|
29
35
|
import { templateOptions } from '../collection-manager/Configuration/templates';
|
|
30
|
-
import * as defaultInterfaces from './interfaces';
|
|
31
36
|
import { useCollectionHistory } from './CollectionHistoryProvider';
|
|
37
|
+
import { CollectionManagerSchemaComponentProvider } from './CollectionManagerSchemaComponentProvider';
|
|
38
|
+
import { CollectionCategroriesContext, CollectionManagerContext } from './context';
|
|
39
|
+
import * as defaultInterfaces from './interfaces';
|
|
32
40
|
export var CollectionManagerProvider = function CollectionManagerProvider(props) {
|
|
33
41
|
var service = props.service,
|
|
34
42
|
interfaces = props.interfaces,
|
|
@@ -45,7 +53,7 @@ export var CollectionManagerProvider = function CollectionManagerProvider(props)
|
|
|
45
53
|
service: service,
|
|
46
54
|
interfaces: _objectSpread(_objectSpread(_objectSpread({}, defaultInterfaces), ctx.interfaces), interfaces),
|
|
47
55
|
templates: _objectSpread(_objectSpread({}, defaultTemplates), templates),
|
|
48
|
-
collections: collections,
|
|
56
|
+
collections: [].concat(_toConsumableArray(ctx.collections), _toConsumableArray(collections)),
|
|
49
57
|
refreshCM: refreshCM
|
|
50
58
|
})
|
|
51
59
|
}, /*#__PURE__*/React.createElement(CollectionManagerSchemaComponentProvider, null, props.children));
|
|
@@ -68,7 +76,7 @@ export var RemoteCollectionManagerProvider = function RemoteCollectionManagerPro
|
|
|
68
76
|
action: 'list',
|
|
69
77
|
params: {
|
|
70
78
|
paginate: false,
|
|
71
|
-
appends: ['fields', 'fields.uiSchema'],
|
|
79
|
+
appends: ['fields', 'fields.uiSchema', 'category'],
|
|
72
80
|
filter: {// inherit: false,
|
|
73
81
|
},
|
|
74
82
|
sort: ['sort']
|
|
@@ -130,4 +138,58 @@ export var RemoteCollectionManagerProvider = function RemoteCollectionManagerPro
|
|
|
130
138
|
collections: service === null || service === void 0 ? void 0 : (_service$data = service.data) === null || _service$data === void 0 ? void 0 : _service$data.data,
|
|
131
139
|
refreshCM: refreshCM
|
|
132
140
|
}, props));
|
|
141
|
+
};
|
|
142
|
+
export var CollectionCategroriesProvider = function CollectionCategroriesProvider(props) {
|
|
143
|
+
var _result$data;
|
|
144
|
+
|
|
145
|
+
var api = useAPIClient();
|
|
146
|
+
var options = {
|
|
147
|
+
url: 'collectionCategories:list',
|
|
148
|
+
params: {
|
|
149
|
+
paginate: false,
|
|
150
|
+
sort: ['sort']
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
var result = useRequest(options);
|
|
154
|
+
|
|
155
|
+
if (result.loading) {
|
|
156
|
+
return /*#__PURE__*/React.createElement(Spin, null);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
return /*#__PURE__*/React.createElement(CollectionCategroriesContext.Provider, {
|
|
160
|
+
value: _objectSpread(_objectSpread({}, result), {}, {
|
|
161
|
+
data: result === null || result === void 0 ? void 0 : (_result$data = result.data) === null || _result$data === void 0 ? void 0 : _result$data.data,
|
|
162
|
+
refresh: function () {
|
|
163
|
+
var _refresh = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
|
|
164
|
+
var _yield$api$request2, data;
|
|
165
|
+
|
|
166
|
+
return regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
167
|
+
while (1) {
|
|
168
|
+
switch (_context2.prev = _context2.next) {
|
|
169
|
+
case 0:
|
|
170
|
+
_context2.next = 2;
|
|
171
|
+
return api.request(options);
|
|
172
|
+
|
|
173
|
+
case 2:
|
|
174
|
+
_yield$api$request2 = _context2.sent;
|
|
175
|
+
data = _yield$api$request2.data;
|
|
176
|
+
result.mutate(data);
|
|
177
|
+
return _context2.abrupt("return", (data === null || data === void 0 ? void 0 : data.data) || []);
|
|
178
|
+
|
|
179
|
+
case 6:
|
|
180
|
+
case "end":
|
|
181
|
+
return _context2.stop();
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}, _callee2);
|
|
185
|
+
}));
|
|
186
|
+
|
|
187
|
+
function refresh() {
|
|
188
|
+
return _refresh.apply(this, arguments);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
return refresh;
|
|
192
|
+
}()
|
|
193
|
+
})
|
|
194
|
+
}, props.children);
|
|
133
195
|
};
|
|
@@ -14,13 +14,13 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
14
14
|
|
|
15
15
|
import { DatabaseOutlined } from '@ant-design/icons';
|
|
16
16
|
import { uid } from '@formily/shared';
|
|
17
|
-
import { Card } from 'antd';
|
|
18
17
|
import React, { useState } from 'react';
|
|
19
18
|
import { useTranslation } from 'react-i18next';
|
|
20
19
|
import { useHistory } from 'react-router-dom';
|
|
21
20
|
import { PluginManager } from '../plugin-manager';
|
|
22
21
|
import { ActionContext, SchemaComponent } from '../schema-component';
|
|
23
|
-
import { AddCollectionField, AddFieldAction, ConfigurationTable, EditFieldAction, EditCollectionField, OverridingFieldAction, OverridingCollectionField, ViewCollectionField, ViewFieldAction, AddCollection, AddCollectionAction, EditCollection, EditCollectionAction } from './Configuration';
|
|
22
|
+
import { AddCollectionField, AddFieldAction, ConfigurationTable, EditFieldAction, EditCollectionField, OverridingFieldAction, OverridingCollectionField, ViewCollectionField, ViewFieldAction, AddCollection, AddCollectionAction, AddCategoryAction, AddCategory, EditCollection, EditCollectionAction, ConfigurationTabs, EditCategory, EditCategoryAction } from './Configuration';
|
|
23
|
+
import { CollectionCategroriesProvider } from './CollectionManagerProvider';
|
|
24
24
|
var schema = {
|
|
25
25
|
type: 'object',
|
|
26
26
|
properties: _defineProperty({}, uid(), {
|
|
@@ -37,30 +37,40 @@ var schema = {
|
|
|
37
37
|
var schema2 = {
|
|
38
38
|
type: 'object',
|
|
39
39
|
properties: _defineProperty({}, uid(), {
|
|
40
|
+
'x-decorator': 'CollectionCategroriesProvider',
|
|
40
41
|
'x-component': 'ConfigurationTable'
|
|
41
42
|
})
|
|
42
43
|
};
|
|
43
44
|
export var CollectionManagerPane = function CollectionManagerPane() {
|
|
44
|
-
return
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
45
|
+
return (
|
|
46
|
+
/*#__PURE__*/
|
|
47
|
+
// <Card bordered={false}>
|
|
48
|
+
React.createElement(SchemaComponent, {
|
|
49
|
+
schema: schema2,
|
|
50
|
+
components: {
|
|
51
|
+
CollectionCategroriesProvider: CollectionCategroriesProvider,
|
|
52
|
+
ConfigurationTable: ConfigurationTable,
|
|
53
|
+
ConfigurationTabs: ConfigurationTabs,
|
|
54
|
+
AddFieldAction: AddFieldAction,
|
|
55
|
+
AddCollectionField: AddCollectionField,
|
|
56
|
+
AddCollection: AddCollection,
|
|
57
|
+
AddCollectionAction: AddCollectionAction,
|
|
58
|
+
AddCategoryAction: AddCategoryAction,
|
|
59
|
+
AddCategory: AddCategory,
|
|
60
|
+
EditCollection: EditCollection,
|
|
61
|
+
EditCollectionAction: EditCollectionAction,
|
|
62
|
+
EditFieldAction: EditFieldAction,
|
|
63
|
+
EditCollectionField: EditCollectionField,
|
|
64
|
+
OverridingCollectionField: OverridingCollectionField,
|
|
65
|
+
OverridingFieldAction: OverridingFieldAction,
|
|
66
|
+
ViewCollectionField: ViewCollectionField,
|
|
67
|
+
ViewFieldAction: ViewFieldAction,
|
|
68
|
+
EditCategory: EditCategory,
|
|
69
|
+
EditCategoryAction: EditCategoryAction
|
|
70
|
+
}
|
|
71
|
+
}) // </Card>
|
|
72
|
+
|
|
73
|
+
);
|
|
64
74
|
};
|
|
65
75
|
export var CollectionManagerShortcut = function CollectionManagerShortcut() {
|
|
66
76
|
var _useTranslation = useTranslation(),
|
|
@@ -99,12 +109,15 @@ export var CollectionManagerShortcut2 = function CollectionManagerShortcut2() {
|
|
|
99
109
|
schema: schema,
|
|
100
110
|
components: {
|
|
101
111
|
ConfigurationTable: ConfigurationTable,
|
|
112
|
+
ConfigurationTabs: ConfigurationTabs,
|
|
102
113
|
AddFieldAction: AddFieldAction,
|
|
103
114
|
EditFieldAction: EditFieldAction,
|
|
104
115
|
OverridingFieldAction: OverridingFieldAction,
|
|
105
116
|
ViewFieldAction: ViewFieldAction,
|
|
106
117
|
AddCollectionAction: AddCollectionAction,
|
|
107
|
-
EditCollectionAction: EditCollectionAction
|
|
118
|
+
EditCollectionAction: EditCollectionAction,
|
|
119
|
+
AddCategoryAction: AddCategoryAction,
|
|
120
|
+
EditCategoryAction: EditCategoryAction
|
|
108
121
|
}
|
|
109
122
|
}));
|
|
110
123
|
};
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
|
|
3
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
|
+
|
|
5
|
+
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); }
|
|
6
|
+
|
|
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
|
+
|
|
9
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
10
|
+
|
|
11
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
|
+
|
|
13
|
+
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; }
|
|
14
|
+
|
|
15
|
+
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; }
|
|
16
|
+
|
|
17
|
+
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; }
|
|
18
|
+
|
|
19
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
20
|
+
|
|
21
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
22
|
+
|
|
23
|
+
import { PlusOutlined } from '@ant-design/icons';
|
|
24
|
+
import { useForm } from '@formily/react';
|
|
25
|
+
import { cloneDeep } from 'lodash';
|
|
26
|
+
import React, { useContext, useState } from 'react';
|
|
27
|
+
import { useTranslation } from 'react-i18next';
|
|
28
|
+
import { useAPIClient } from '../../api-client';
|
|
29
|
+
import { ActionContext, SchemaComponent, useActionContext } from '../../schema-component';
|
|
30
|
+
import { useCancelAction } from '../action-hooks';
|
|
31
|
+
import { CollectionCategroriesContext } from '../context';
|
|
32
|
+
import * as components from './components';
|
|
33
|
+
import { collectionCategorySchema } from './schemas/collections';
|
|
34
|
+
|
|
35
|
+
var useCreateCategry = function useCreateCategry() {
|
|
36
|
+
var form = useForm();
|
|
37
|
+
var ctx = useActionContext();
|
|
38
|
+
|
|
39
|
+
var _useContext = useContext(CollectionCategroriesContext),
|
|
40
|
+
refresh = _useContext.refresh;
|
|
41
|
+
|
|
42
|
+
var api = useAPIClient();
|
|
43
|
+
return {
|
|
44
|
+
run: function run() {
|
|
45
|
+
return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
|
|
46
|
+
var values;
|
|
47
|
+
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
48
|
+
while (1) {
|
|
49
|
+
switch (_context.prev = _context.next) {
|
|
50
|
+
case 0:
|
|
51
|
+
_context.next = 2;
|
|
52
|
+
return form.submit();
|
|
53
|
+
|
|
54
|
+
case 2:
|
|
55
|
+
values = cloneDeep(form.values);
|
|
56
|
+
_context.next = 5;
|
|
57
|
+
return api.resource('collectionCategories').create({
|
|
58
|
+
values: _objectSpread({}, values)
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
case 5:
|
|
62
|
+
ctx.setVisible(false);
|
|
63
|
+
_context.next = 8;
|
|
64
|
+
return form.reset();
|
|
65
|
+
|
|
66
|
+
case 8:
|
|
67
|
+
_context.next = 10;
|
|
68
|
+
return refresh();
|
|
69
|
+
|
|
70
|
+
case 10:
|
|
71
|
+
case "end":
|
|
72
|
+
return _context.stop();
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}, _callee);
|
|
76
|
+
}))();
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
export var AddCategory = function AddCategory(props) {
|
|
82
|
+
return /*#__PURE__*/React.createElement(AddCategoryAction, _objectSpread({}, props));
|
|
83
|
+
};
|
|
84
|
+
export var AddCategoryAction = function AddCategoryAction(props) {
|
|
85
|
+
var scope = props.scope,
|
|
86
|
+
getContainer = props.getContainer,
|
|
87
|
+
children = props.children;
|
|
88
|
+
|
|
89
|
+
var _useState = useState(false),
|
|
90
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
91
|
+
visible = _useState2[0],
|
|
92
|
+
setVisible = _useState2[1];
|
|
93
|
+
|
|
94
|
+
var _useTranslation = useTranslation(),
|
|
95
|
+
t = _useTranslation.t;
|
|
96
|
+
|
|
97
|
+
return /*#__PURE__*/React.createElement(ActionContext.Provider, {
|
|
98
|
+
value: {
|
|
99
|
+
visible: visible,
|
|
100
|
+
setVisible: setVisible
|
|
101
|
+
}
|
|
102
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
103
|
+
onClick: function onClick() {
|
|
104
|
+
return setVisible(true);
|
|
105
|
+
},
|
|
106
|
+
title: t('Add category')
|
|
107
|
+
}, children || /*#__PURE__*/React.createElement(PlusOutlined, null)), /*#__PURE__*/React.createElement(SchemaComponent, {
|
|
108
|
+
schema: collectionCategorySchema,
|
|
109
|
+
components: _objectSpread({}, components),
|
|
110
|
+
scope: _objectSpread({
|
|
111
|
+
getContainer: getContainer,
|
|
112
|
+
useCancelAction: useCancelAction,
|
|
113
|
+
createOnly: true,
|
|
114
|
+
useCreateCategry: useCreateCategry
|
|
115
|
+
}, scope)
|
|
116
|
+
}));
|
|
117
|
+
};
|