@nocobase/client 0.9.0-alpha.2 → 0.9.1-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 +4 -7
- package/es/api-client/APIClient.js +6 -0
- package/es/block-provider/BlockProvider.js +9 -6
- package/es/block-provider/FormBlockProvider.js +3 -1
- 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.js +3 -1
- 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 +51 -6
- 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 +22 -15
- package/es/schema-component/antd/action/Action.js +25 -3
- 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 +90 -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/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-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.js +76 -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/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 +0 -1
- package/es/schema-initializer/buttons/TableActionColumnInitializers.d.ts +1 -0
- package/es/schema-initializer/buttons/TableActionColumnInitializers.js +1 -3
- 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/utils.js +22 -7
- 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 +153 -26
- package/es/schema-templates/BlockTemplate.js +9 -1
- package/es/system-settings/SystemSettingsShortcut.js +1 -1
- package/lib/acl/ACLProvider.js +4 -7
- package/lib/api-client/APIClient.js +6 -0
- package/lib/block-provider/BlockProvider.js +9 -6
- package/lib/block-provider/FormBlockProvider.js +3 -1
- 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.js +3 -1
- 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 +24 -14
- package/lib/schema-component/antd/action/Action.js +27 -2
- 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 +89 -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/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-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.js +76 -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/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 +0 -1
- package/lib/schema-initializer/buttons/TableActionColumnInitializers.d.ts +1 -0
- package/lib/schema-initializer/buttons/TableActionColumnInitializers.js +3 -1
- 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/utils.js +22 -6
- 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 +176 -48
- package/lib/schema-templates/BlockTemplate.js +9 -1
- package/lib/system-settings/SystemSettingsShortcut.js +1 -1
- package/package.json +4 -4
|
@@ -3,10 +3,13 @@ var _templateObject;
|
|
|
3
3
|
var _excluded = ["children", "fieldSchema"],
|
|
4
4
|
_excluded2 = ["title", "dn"],
|
|
5
5
|
_excluded3 = ["title", "options", "value", "onChange"],
|
|
6
|
-
_excluded4 = ["title", "onChange"],
|
|
7
|
-
_excluded5 = ["
|
|
8
|
-
_excluded6 = ["
|
|
9
|
-
_excluded7 = ["
|
|
6
|
+
_excluded4 = ["title", "options", "value", "onChange"],
|
|
7
|
+
_excluded5 = ["title", "onChange"],
|
|
8
|
+
_excluded6 = ["schema"],
|
|
9
|
+
_excluded7 = ["title", "onSubmit", "initialValues", "initialSchema", "schema", "modalTip", "components"],
|
|
10
|
+
_excluded8 = ["hidden", "title", "components", "scope", "effects", "schema", "onSubmit", "asyncGetInitialValues", "initialValues", "width"];
|
|
11
|
+
|
|
12
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
10
13
|
|
|
11
14
|
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); } }
|
|
12
15
|
|
|
@@ -37,19 +40,22 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
37
40
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
38
41
|
|
|
39
42
|
import { css } from '@emotion/css';
|
|
40
|
-
import { FormDialog, FormItem, FormLayout, Input } from '@formily/antd';
|
|
43
|
+
import { FormDialog, FormItem, FormLayout, Input, ArrayCollapse } from '@formily/antd';
|
|
41
44
|
import { createForm } from '@formily/core';
|
|
42
45
|
import { SchemaOptionsContext, useField, useFieldSchema, useForm } from '@formily/react';
|
|
46
|
+
import _ from 'lodash';
|
|
43
47
|
import { uid } from '@formily/shared';
|
|
44
|
-
import { Alert, Button, Dropdown, Menu, Modal, Select, Space, Switch } from 'antd';
|
|
48
|
+
import { Alert, Button, Cascader, Dropdown, Menu, Modal, Select, Space, Switch } from 'antd';
|
|
45
49
|
import classNames from 'classnames';
|
|
46
50
|
import { cloneDeep } from 'lodash';
|
|
47
51
|
import React, { createContext, useContext, useMemo, useState } from 'react';
|
|
48
52
|
import { createPortal } from 'react-dom';
|
|
49
53
|
import { useTranslation } from 'react-i18next';
|
|
50
|
-
import { ActionContext, CollectionManagerContext, createDesignable, FormProvider, RemoteSchemaComponent, SchemaComponent, SchemaComponentOptions, useActionContext, useAPIClient, useCollection, useCompile, useDesignable } from '..';
|
|
54
|
+
import { ActionContext, CollectionManagerContext, createDesignable, FormProvider, RemoteSchemaComponent, SchemaComponent, SchemaComponentOptions, useActionContext, useAPIClient, useCollection, useCollectionManager, useCompile, useDesignable, useCollectionFilterOptions } from '..';
|
|
51
55
|
import { useSchemaTemplateManager } from '../schema-templates';
|
|
52
56
|
import { useBlockTemplateContext } from '../schema-templates/BlockTemplate';
|
|
57
|
+
import { FormLinkageRules } from './LinkageRules';
|
|
58
|
+
import { useLinkageCollectionFieldOptions } from './LinkageRules/action-hooks';
|
|
53
59
|
var SchemaSettingsContext = /*#__PURE__*/createContext(null);
|
|
54
60
|
export var useSchemaSettings = function useSchemaSettings() {
|
|
55
61
|
return useContext(SchemaSettingsContext);
|
|
@@ -112,12 +118,16 @@ SchemaSettings.Template = function (props) {
|
|
|
112
118
|
var _useTranslation = useTranslation(),
|
|
113
119
|
t = _useTranslation.t;
|
|
114
120
|
|
|
121
|
+
var _useCollectionManager = useCollectionManager(),
|
|
122
|
+
getCollection = _useCollectionManager.getCollection;
|
|
123
|
+
|
|
115
124
|
var _useSchemaSettings = useSchemaSettings(),
|
|
116
125
|
dn = _useSchemaSettings.dn,
|
|
117
126
|
setVisible = _useSchemaSettings.setVisible,
|
|
118
127
|
template = _useSchemaSettings.template,
|
|
119
128
|
fieldSchema = _useSchemaSettings.fieldSchema;
|
|
120
129
|
|
|
130
|
+
var compile = useCompile();
|
|
121
131
|
var api = useAPIClient();
|
|
122
132
|
|
|
123
133
|
var _useBlockTemplateCont = useBlockTemplateContext(),
|
|
@@ -188,14 +198,15 @@ SchemaSettings.Template = function (props) {
|
|
|
188
198
|
return /*#__PURE__*/React.createElement(SchemaSettings.Item, {
|
|
189
199
|
onClick: function () {
|
|
190
200
|
var _onClick2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3() {
|
|
191
|
-
var values, sdn, _yield$saveAsTemplate, key;
|
|
201
|
+
var _getCollection, title, values, sdn, _yield$saveAsTemplate, key;
|
|
192
202
|
|
|
193
203
|
return regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
194
204
|
while (1) {
|
|
195
205
|
switch (_context3.prev = _context3.next) {
|
|
196
206
|
case 0:
|
|
197
207
|
setVisible(false);
|
|
198
|
-
|
|
208
|
+
_getCollection = getCollection(collectionName), title = _getCollection.title;
|
|
209
|
+
_context3.next = 4;
|
|
199
210
|
return FormDialog(t('Save as template'), function () {
|
|
200
211
|
return /*#__PURE__*/React.createElement(FormLayout, {
|
|
201
212
|
layout: 'vertical'
|
|
@@ -210,6 +221,7 @@ SchemaSettings.Template = function (props) {
|
|
|
210
221
|
name: {
|
|
211
222
|
title: t('Template name'),
|
|
212
223
|
required: true,
|
|
224
|
+
default: "".concat(compile(title), "_").concat(t(componentName)),
|
|
213
225
|
'x-decorator': 'FormItem',
|
|
214
226
|
'x-component': 'Input'
|
|
215
227
|
}
|
|
@@ -218,7 +230,7 @@ SchemaSettings.Template = function (props) {
|
|
|
218
230
|
}));
|
|
219
231
|
}).open({});
|
|
220
232
|
|
|
221
|
-
case
|
|
233
|
+
case 4:
|
|
222
234
|
values = _context3.sent;
|
|
223
235
|
sdn = createDesignable({
|
|
224
236
|
t: t,
|
|
@@ -227,7 +239,7 @@ SchemaSettings.Template = function (props) {
|
|
|
227
239
|
current: fieldSchema.parent
|
|
228
240
|
});
|
|
229
241
|
sdn.loadAPIClientEvents();
|
|
230
|
-
_context3.next =
|
|
242
|
+
_context3.next = 9;
|
|
231
243
|
return saveAsTemplate({
|
|
232
244
|
collectionName: collectionName,
|
|
233
245
|
resourceName: resourceName,
|
|
@@ -236,7 +248,7 @@ SchemaSettings.Template = function (props) {
|
|
|
236
248
|
uid: fieldSchema['x-uid']
|
|
237
249
|
});
|
|
238
250
|
|
|
239
|
-
case
|
|
251
|
+
case 9:
|
|
240
252
|
_yield$saveAsTemplate = _context3.sent;
|
|
241
253
|
key = _yield$saveAsTemplate.key;
|
|
242
254
|
sdn.removeWithoutEmit(fieldSchema);
|
|
@@ -248,7 +260,7 @@ SchemaSettings.Template = function (props) {
|
|
|
248
260
|
}
|
|
249
261
|
});
|
|
250
262
|
|
|
251
|
-
case
|
|
263
|
+
case 13:
|
|
252
264
|
case "end":
|
|
253
265
|
return _context3.stop();
|
|
254
266
|
}
|
|
@@ -269,7 +281,7 @@ var findGridSchema = function findGridSchema(fieldSchema) {
|
|
|
269
281
|
return fieldSchema.reduceProperties(function (buf, s) {
|
|
270
282
|
if (s['x-component'] === 'FormV2') {
|
|
271
283
|
var f = s.reduceProperties(function (buf, s) {
|
|
272
|
-
if (s['x-component'] === 'Grid') {
|
|
284
|
+
if (s['x-component'] === 'Grid' || s['x-component'] === 'BlockTemplate') {
|
|
273
285
|
return s;
|
|
274
286
|
}
|
|
275
287
|
|
|
@@ -315,6 +327,11 @@ SchemaSettings.FormItemTemplate = function (props) {
|
|
|
315
327
|
var _useTranslation2 = useTranslation(),
|
|
316
328
|
t = _useTranslation2.t;
|
|
317
329
|
|
|
330
|
+
var compile = useCompile();
|
|
331
|
+
|
|
332
|
+
var _useCollectionManager2 = useCollectionManager(),
|
|
333
|
+
getCollection = _useCollectionManager2.getCollection;
|
|
334
|
+
|
|
318
335
|
var _useSchemaSettings2 = useSchemaSettings(),
|
|
319
336
|
dn = _useSchemaSettings2.dn,
|
|
320
337
|
setVisible = _useSchemaSettings2.setVisible,
|
|
@@ -409,16 +426,21 @@ SchemaSettings.FormItemTemplate = function (props) {
|
|
|
409
426
|
return /*#__PURE__*/React.createElement(SchemaSettings.Item, {
|
|
410
427
|
onClick: function () {
|
|
411
428
|
var _onClick4 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee6() {
|
|
412
|
-
var gridSchema, values, sdn, _yield$saveAsTemplate2, key;
|
|
429
|
+
var _getCollection2, title, gridSchema, values, sdn, _yield$saveAsTemplate2, key;
|
|
413
430
|
|
|
414
431
|
return regeneratorRuntime.wrap(function _callee6$(_context6) {
|
|
415
432
|
while (1) {
|
|
416
433
|
switch (_context6.prev = _context6.next) {
|
|
417
434
|
case 0:
|
|
418
435
|
setVisible(false);
|
|
436
|
+
_getCollection2 = getCollection(collectionName), title = _getCollection2.title;
|
|
419
437
|
gridSchema = findGridSchema(fieldSchema);
|
|
420
|
-
_context6.next =
|
|
438
|
+
_context6.next = 5;
|
|
421
439
|
return FormDialog(t('Save as template'), function () {
|
|
440
|
+
var componentTitle = {
|
|
441
|
+
FormItem: t('Form'),
|
|
442
|
+
ReadPrettyFormItem: t('Details')
|
|
443
|
+
};
|
|
422
444
|
return /*#__PURE__*/React.createElement(FormLayout, {
|
|
423
445
|
layout: 'vertical'
|
|
424
446
|
}, /*#__PURE__*/React.createElement(SchemaComponent, {
|
|
@@ -432,6 +454,7 @@ SchemaSettings.FormItemTemplate = function (props) {
|
|
|
432
454
|
name: {
|
|
433
455
|
title: t('Template name'),
|
|
434
456
|
required: true,
|
|
457
|
+
default: "".concat(compile(title), "_").concat(componentTitle[componentName] || componentName),
|
|
435
458
|
'x-decorator': 'FormItem',
|
|
436
459
|
'x-component': 'Input'
|
|
437
460
|
}
|
|
@@ -440,7 +463,7 @@ SchemaSettings.FormItemTemplate = function (props) {
|
|
|
440
463
|
}));
|
|
441
464
|
}).open({});
|
|
442
465
|
|
|
443
|
-
case
|
|
466
|
+
case 5:
|
|
444
467
|
values = _context6.sent;
|
|
445
468
|
sdn = createDesignable({
|
|
446
469
|
t: t,
|
|
@@ -449,7 +472,7 @@ SchemaSettings.FormItemTemplate = function (props) {
|
|
|
449
472
|
current: gridSchema.parent
|
|
450
473
|
});
|
|
451
474
|
sdn.loadAPIClientEvents();
|
|
452
|
-
_context6.next =
|
|
475
|
+
_context6.next = 10;
|
|
453
476
|
return saveAsTemplate({
|
|
454
477
|
collectionName: collectionName,
|
|
455
478
|
resourceName: resourceName,
|
|
@@ -458,7 +481,7 @@ SchemaSettings.FormItemTemplate = function (props) {
|
|
|
458
481
|
uid: gridSchema['x-uid']
|
|
459
482
|
});
|
|
460
483
|
|
|
461
|
-
case
|
|
484
|
+
case 10:
|
|
462
485
|
_yield$saveAsTemplate2 = _context6.sent;
|
|
463
486
|
key = _yield$saveAsTemplate2.key;
|
|
464
487
|
sdn.removeWithoutEmit(gridSchema);
|
|
@@ -470,7 +493,7 @@ SchemaSettings.FormItemTemplate = function (props) {
|
|
|
470
493
|
}
|
|
471
494
|
});
|
|
472
495
|
fieldSchema['x-template-key'] = key;
|
|
473
|
-
_context6.next =
|
|
496
|
+
_context6.next = 17;
|
|
474
497
|
return api.request({
|
|
475
498
|
url: "uiSchemas:patch",
|
|
476
499
|
method: 'post',
|
|
@@ -480,7 +503,7 @@ SchemaSettings.FormItemTemplate = function (props) {
|
|
|
480
503
|
}
|
|
481
504
|
});
|
|
482
505
|
|
|
483
|
-
case
|
|
506
|
+
case 17:
|
|
484
507
|
case "end":
|
|
485
508
|
return _context6.stop();
|
|
486
509
|
}
|
|
@@ -603,11 +626,36 @@ SchemaSettings.SelectItem = function (props) {
|
|
|
603
626
|
})));
|
|
604
627
|
};
|
|
605
628
|
|
|
606
|
-
SchemaSettings.
|
|
629
|
+
SchemaSettings.CascaderItem = function (props) {
|
|
607
630
|
var title = props.title,
|
|
631
|
+
options = props.options,
|
|
632
|
+
value = props.value,
|
|
608
633
|
onChange = props.onChange,
|
|
609
634
|
others = _objectWithoutProperties(props, _excluded4);
|
|
610
635
|
|
|
636
|
+
return /*#__PURE__*/React.createElement(SchemaSettings.Item, _objectSpread({}, others), /*#__PURE__*/React.createElement("div", {
|
|
637
|
+
style: {
|
|
638
|
+
alignItems: 'center',
|
|
639
|
+
display: 'flex',
|
|
640
|
+
justifyContent: 'space-between'
|
|
641
|
+
}
|
|
642
|
+
}, title, /*#__PURE__*/React.createElement(Cascader, {
|
|
643
|
+
bordered: false,
|
|
644
|
+
defaultValue: value,
|
|
645
|
+
onChange: onChange,
|
|
646
|
+
options: options,
|
|
647
|
+
style: {
|
|
648
|
+
textAlign: 'right',
|
|
649
|
+
minWidth: 100
|
|
650
|
+
}
|
|
651
|
+
})));
|
|
652
|
+
};
|
|
653
|
+
|
|
654
|
+
SchemaSettings.SwitchItem = function (props) {
|
|
655
|
+
var title = props.title,
|
|
656
|
+
onChange = props.onChange,
|
|
657
|
+
others = _objectWithoutProperties(props, _excluded5);
|
|
658
|
+
|
|
611
659
|
var _useState3 = useState(!!props.checked),
|
|
612
660
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
613
661
|
checked = _useState4[0],
|
|
@@ -635,7 +683,7 @@ SchemaSettings.SwitchItem = function (props) {
|
|
|
635
683
|
|
|
636
684
|
SchemaSettings.PopupItem = function (props) {
|
|
637
685
|
var schema = props.schema,
|
|
638
|
-
others = _objectWithoutProperties(props,
|
|
686
|
+
others = _objectWithoutProperties(props, _excluded6);
|
|
639
687
|
|
|
640
688
|
var _useState5 = useState(false),
|
|
641
689
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
@@ -670,7 +718,7 @@ SchemaSettings.ActionModalItem = /*#__PURE__*/React.memo(function (props) {
|
|
|
670
718
|
schema = props.schema,
|
|
671
719
|
modalTip = props.modalTip,
|
|
672
720
|
components = props.components,
|
|
673
|
-
others = _objectWithoutProperties(props,
|
|
721
|
+
others = _objectWithoutProperties(props, _excluded7);
|
|
674
722
|
|
|
675
723
|
var _useState7 = useState(false),
|
|
676
724
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
@@ -821,7 +869,8 @@ SchemaSettings.ModalItem = function (props) {
|
|
|
821
869
|
onSubmit = props.onSubmit,
|
|
822
870
|
asyncGetInitialValues = props.asyncGetInitialValues,
|
|
823
871
|
initialValues = props.initialValues,
|
|
824
|
-
|
|
872
|
+
width = props.width,
|
|
873
|
+
others = _objectWithoutProperties(props, _excluded8);
|
|
825
874
|
|
|
826
875
|
var options = useContext(SchemaOptionsContext);
|
|
827
876
|
var cm = useContext(CollectionManagerContext);
|
|
@@ -856,7 +905,10 @@ SchemaSettings.ModalItem = function (props) {
|
|
|
856
905
|
|
|
857
906
|
case 7:
|
|
858
907
|
values = _context9.t0;
|
|
859
|
-
FormDialog(
|
|
908
|
+
FormDialog({
|
|
909
|
+
title: schema.title || title,
|
|
910
|
+
width: width
|
|
911
|
+
}, function () {
|
|
860
912
|
return /*#__PURE__*/React.createElement(CollectionManagerContext.Provider, {
|
|
861
913
|
value: cm
|
|
862
914
|
}, /*#__PURE__*/React.createElement(SchemaComponentOptions, {
|
|
@@ -934,4 +986,79 @@ SchemaSettings.BlockTitleItem = function () {
|
|
|
934
986
|
dn.refresh();
|
|
935
987
|
}
|
|
936
988
|
});
|
|
989
|
+
};
|
|
990
|
+
|
|
991
|
+
SchemaSettings.LinkageRules = function (props) {
|
|
992
|
+
var collectionName = props.collectionName;
|
|
993
|
+
var fieldSchema = useFieldSchema();
|
|
994
|
+
|
|
995
|
+
var _useDesignable2 = useDesignable(),
|
|
996
|
+
dn = _useDesignable2.dn;
|
|
997
|
+
|
|
998
|
+
var _useTranslation6 = useTranslation(),
|
|
999
|
+
t = _useTranslation6.t;
|
|
1000
|
+
|
|
1001
|
+
var _useSchemaTemplateMan4 = useSchemaTemplateManager(),
|
|
1002
|
+
getTemplateById = _useSchemaTemplateMan4.getTemplateById;
|
|
1003
|
+
|
|
1004
|
+
var type = fieldSchema['x-component'] === 'Action' ? 'button' : 'field';
|
|
1005
|
+
var gridSchema = findGridSchema(fieldSchema) || fieldSchema;
|
|
1006
|
+
return /*#__PURE__*/React.createElement(SchemaSettings.ModalItem, {
|
|
1007
|
+
title: t('Linkage rules'),
|
|
1008
|
+
components: {
|
|
1009
|
+
ArrayCollapse: ArrayCollapse,
|
|
1010
|
+
FormLayout: FormLayout
|
|
1011
|
+
},
|
|
1012
|
+
width: 750,
|
|
1013
|
+
schema: {
|
|
1014
|
+
type: 'object',
|
|
1015
|
+
title: t('Linkage rules'),
|
|
1016
|
+
properties: {
|
|
1017
|
+
fieldReaction: {
|
|
1018
|
+
'x-component': FormLinkageRules,
|
|
1019
|
+
'x-component-props': {
|
|
1020
|
+
useProps: function useProps() {
|
|
1021
|
+
var options = useCollectionFilterOptions(collectionName);
|
|
1022
|
+
return {
|
|
1023
|
+
options: options,
|
|
1024
|
+
defaultValues: (gridSchema === null || gridSchema === void 0 ? void 0 : gridSchema['x-linkage-rules']) || (fieldSchema === null || fieldSchema === void 0 ? void 0 : fieldSchema['x-linkage-rules']),
|
|
1025
|
+
type: type,
|
|
1026
|
+
linkageOptions: useLinkageCollectionFieldOptions(collectionName),
|
|
1027
|
+
collectionName: collectionName
|
|
1028
|
+
};
|
|
1029
|
+
}
|
|
1030
|
+
}
|
|
1031
|
+
}
|
|
1032
|
+
}
|
|
1033
|
+
},
|
|
1034
|
+
onSubmit: function onSubmit(v) {
|
|
1035
|
+
var rules = [];
|
|
1036
|
+
|
|
1037
|
+
var _iterator = _createForOfIteratorHelper(v.fieldReaction.rules),
|
|
1038
|
+
_step;
|
|
1039
|
+
|
|
1040
|
+
try {
|
|
1041
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
1042
|
+
var rule = _step.value;
|
|
1043
|
+
rules.push(_.pickBy(rule, _.identity));
|
|
1044
|
+
}
|
|
1045
|
+
} catch (err) {
|
|
1046
|
+
_iterator.e(err);
|
|
1047
|
+
} finally {
|
|
1048
|
+
_iterator.f();
|
|
1049
|
+
}
|
|
1050
|
+
|
|
1051
|
+
var templateId = gridSchema['x-component'] === 'BlockTemplate' && gridSchema['x-component-props'].templateId;
|
|
1052
|
+
var uid = templateId && getTemplateById(templateId).uid || gridSchema['x-uid'];
|
|
1053
|
+
|
|
1054
|
+
var schema = _defineProperty({}, 'x-uid', uid);
|
|
1055
|
+
|
|
1056
|
+
gridSchema['x-linkage-rules'] = rules;
|
|
1057
|
+
schema['x-linkage-rules'] = rules;
|
|
1058
|
+
dn.emit('patch', {
|
|
1059
|
+
schema: schema
|
|
1060
|
+
});
|
|
1061
|
+
dn.refresh();
|
|
1062
|
+
}
|
|
1063
|
+
});
|
|
937
1064
|
};
|
|
@@ -25,6 +25,13 @@ export var BlockTemplate = observer(function (props) {
|
|
|
25
25
|
var template = useMemo(function () {
|
|
26
26
|
return getTemplateById(templateId);
|
|
27
27
|
}, [templateId]);
|
|
28
|
+
|
|
29
|
+
var onSuccess = function onSuccess(data) {
|
|
30
|
+
var _data$data;
|
|
31
|
+
|
|
32
|
+
fieldSchema['x-linkage-rules'] = (data === null || data === void 0 ? void 0 : (_data$data = data.data) === null || _data$data === void 0 ? void 0 : _data$data['x-linkage-rules']) || [];
|
|
33
|
+
};
|
|
34
|
+
|
|
28
35
|
return template ? /*#__PURE__*/React.createElement(BlockTemplateContext.Provider, {
|
|
29
36
|
value: {
|
|
30
37
|
dn: dn,
|
|
@@ -34,6 +41,7 @@ export var BlockTemplate = observer(function (props) {
|
|
|
34
41
|
}
|
|
35
42
|
}, /*#__PURE__*/React.createElement(RemoteSchemaComponent, {
|
|
36
43
|
noForm: true,
|
|
37
|
-
uid: template === null || template === void 0 ? void 0 : template.uid
|
|
44
|
+
uid: template === null || template === void 0 ? void 0 : template.uid,
|
|
45
|
+
onSuccess: onSuccess
|
|
38
46
|
})) : null;
|
|
39
47
|
});
|
package/lib/acl/ACLProvider.js
CHANGED
|
@@ -33,10 +33,6 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
33
33
|
|
|
34
34
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
35
35
|
|
|
36
|
-
function _toArray(arr) { return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest(); }
|
|
37
|
-
|
|
38
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
39
|
-
|
|
40
36
|
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; }
|
|
41
37
|
|
|
42
38
|
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; }
|
|
@@ -418,10 +414,11 @@ var useACLFieldWhitelist = function useACLFieldWhitelist() {
|
|
|
418
414
|
}
|
|
419
415
|
|
|
420
416
|
var _fieldSchema$xCollec = fieldSchema['x-collection-field'].split('.'),
|
|
421
|
-
_fieldSchema$xCollec2 =
|
|
422
|
-
|
|
417
|
+
_fieldSchema$xCollec2 = _slicedToArray(_fieldSchema$xCollec, 2),
|
|
418
|
+
key1 = _fieldSchema$xCollec2[0],
|
|
419
|
+
key2 = _fieldSchema$xCollec2[1];
|
|
423
420
|
|
|
424
|
-
return whitelist === null || whitelist === void 0 ? void 0 : whitelist.includes(
|
|
421
|
+
return whitelist === null || whitelist === void 0 ? void 0 : whitelist.includes(key2 || key1);
|
|
425
422
|
}
|
|
426
423
|
};
|
|
427
424
|
};
|
|
@@ -87,6 +87,12 @@ var APIClient = /*#__PURE__*/function (_APIClientSDK) {
|
|
|
87
87
|
value: function interceptors() {
|
|
88
88
|
this.axios.interceptors.request.use(function (config) {
|
|
89
89
|
config.headers['X-With-ACL-Meta'] = true;
|
|
90
|
+
var match = location.pathname.match(/^\/apps\/([^/]*)\//);
|
|
91
|
+
|
|
92
|
+
if (match) {
|
|
93
|
+
config.headers['X-App'] = match[1];
|
|
94
|
+
}
|
|
95
|
+
|
|
90
96
|
return config;
|
|
91
97
|
});
|
|
92
98
|
|
|
@@ -31,7 +31,7 @@ var _SharedFilterProvider = require("./SharedFilterProvider");
|
|
|
31
31
|
|
|
32
32
|
var _excluded = ["title", "to"];
|
|
33
33
|
|
|
34
|
-
var _templateObject, _templateObject2;
|
|
34
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
35
35
|
|
|
36
36
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
37
37
|
|
|
@@ -59,7 +59,7 @@ var BlockResourceContext = /*#__PURE__*/(0, _react2.createContext)(null);
|
|
|
59
59
|
exports.BlockResourceContext = BlockResourceContext;
|
|
60
60
|
var BlockAssociationContext = /*#__PURE__*/(0, _react2.createContext)(null);
|
|
61
61
|
exports.BlockAssociationContext = BlockAssociationContext;
|
|
62
|
-
var BlockRequestContext = /*#__PURE__*/(0, _react2.createContext)(
|
|
62
|
+
var BlockRequestContext = /*#__PURE__*/(0, _react2.createContext)({});
|
|
63
63
|
exports.BlockRequestContext = BlockRequestContext;
|
|
64
64
|
|
|
65
65
|
var useBlockResource = function useBlockResource() {
|
|
@@ -140,7 +140,7 @@ var useResourceAction = function useResourceAction(props) {
|
|
|
140
140
|
fields = _useCollection.fields;
|
|
141
141
|
|
|
142
142
|
var appends = fields === null || fields === void 0 ? void 0 : fields.filter(function (field) {
|
|
143
|
-
return field.target
|
|
143
|
+
return field.target;
|
|
144
144
|
}).map(function (field) {
|
|
145
145
|
return field.name;
|
|
146
146
|
});
|
|
@@ -264,10 +264,11 @@ var RenderChildrenWithAssociationFilter = function RenderChildrenWithAssociation
|
|
|
264
264
|
|
|
265
265
|
if (associationFilterSchema) {
|
|
266
266
|
return /*#__PURE__*/_react2.default.createElement(Component, _objectSpread({}, field.componentProps), /*#__PURE__*/_react2.default.createElement(_antd.Row, {
|
|
267
|
+
className: (0, _css.css)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n height: 100%;\n "]))),
|
|
267
268
|
gutter: 16,
|
|
268
269
|
wrap: false
|
|
269
270
|
}, /*#__PURE__*/_react2.default.createElement(_antd.Col, {
|
|
270
|
-
className: (0, _css.css)(
|
|
271
|
+
className: (0, _css.css)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n width: 200px;\n flex: 0 0 auto;\n "])))
|
|
271
272
|
}, /*#__PURE__*/_react2.default.createElement(_react.RecursionField, {
|
|
272
273
|
schema: fieldSchema,
|
|
273
274
|
onlyRenderProperties: true,
|
|
@@ -275,14 +276,16 @@ var RenderChildrenWithAssociationFilter = function RenderChildrenWithAssociation
|
|
|
275
276
|
return s['x-component'] === 'AssociationFilter';
|
|
276
277
|
}
|
|
277
278
|
})), /*#__PURE__*/_react2.default.createElement(_antd.Col, {
|
|
278
|
-
className: (0, _css.css)(
|
|
279
|
+
className: (0, _css.css)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n flex: 1 1 auto;\n min-width: 0;\n "])))
|
|
280
|
+
}, /*#__PURE__*/_react2.default.createElement("div", {
|
|
281
|
+
className: (0, _css.css)(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n height: 100%;\n "])))
|
|
279
282
|
}, /*#__PURE__*/_react2.default.createElement(_react.RecursionField, {
|
|
280
283
|
schema: fieldSchema,
|
|
281
284
|
onlyRenderProperties: true,
|
|
282
285
|
filterProperties: function filterProperties(s) {
|
|
283
286
|
return s['x-component'] !== 'AssociationFilter';
|
|
284
287
|
}
|
|
285
|
-
}))));
|
|
288
|
+
})))));
|
|
286
289
|
}
|
|
287
290
|
|
|
288
291
|
return props.children;
|
|
@@ -96,7 +96,9 @@ var FormBlockProvider = function FormBlockProvider(props) {
|
|
|
96
96
|
designable = _useDesignable.designable;
|
|
97
97
|
|
|
98
98
|
var flag = !designable && __tableName && !inheritCollections.includes(props.collection) && __tableName !== props.collection;
|
|
99
|
-
return !flag && /*#__PURE__*/_react2.default.createElement(_BlockProvider.BlockProvider, _objectSpread({}, props),
|
|
99
|
+
return !flag && /*#__PURE__*/_react2.default.createElement(_BlockProvider.BlockProvider, _objectSpread(_objectSpread({}, props), {}, {
|
|
100
|
+
block: 'form'
|
|
101
|
+
}), /*#__PURE__*/_react2.default.createElement(InternalFormBlockProvider, _objectSpread({}, props)));
|
|
100
102
|
};
|
|
101
103
|
|
|
102
104
|
exports.FormBlockProvider = FormBlockProvider;
|
|
@@ -149,7 +149,7 @@ var useAssociationNames = function useAssociationNames(collection) {
|
|
|
149
149
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
150
150
|
var collectionField = _step.value;
|
|
151
151
|
|
|
152
|
-
if (collectionField.target
|
|
152
|
+
if (collectionField.target) {
|
|
153
153
|
associationFields.add(collectionField.name);
|
|
154
154
|
var fields = getCollectionFields(collectionField.target);
|
|
155
155
|
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
@@ -27,6 +25,8 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
27
25
|
|
|
28
26
|
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; }
|
|
29
27
|
|
|
28
|
+
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); }
|
|
29
|
+
|
|
30
30
|
var SHARED_FILTER_CONDITION;
|
|
31
31
|
exports.SHARED_FILTER_CONDITION = SHARED_FILTER_CONDITION;
|
|
32
32
|
|
|
@@ -37,7 +37,13 @@ exports.SHARED_FILTER_CONDITION = SHARED_FILTER_CONDITION;
|
|
|
37
37
|
|
|
38
38
|
var mergeFilter = function mergeFilter(filters) {
|
|
39
39
|
var op = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '$and';
|
|
40
|
-
var items = filters.filter(
|
|
40
|
+
var items = filters.filter(function (f) {
|
|
41
|
+
if (f && _typeof(f) === 'object' && !Array.isArray(f)) {
|
|
42
|
+
return Object.values(f).filter(function (v) {
|
|
43
|
+
return v !== undefined;
|
|
44
|
+
}).length;
|
|
45
|
+
}
|
|
46
|
+
});
|
|
41
47
|
|
|
42
48
|
if (items.length === 0) {
|
|
43
49
|
return {};
|
|
@@ -96,7 +96,7 @@ var useAssociationNames = function useAssociationNames(collection) {
|
|
|
96
96
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
97
97
|
var collectionField = _step.value;
|
|
98
98
|
|
|
99
|
-
if (collectionField.target
|
|
99
|
+
if (collectionField.target) {
|
|
100
100
|
associationFields.add(collectionField.name);
|
|
101
101
|
var fields = getCollectionFields(collectionField.target);
|
|
102
102
|
|
|
@@ -88,7 +88,7 @@ var useAssociationNames2 = function useAssociationNames2(collection) {
|
|
|
88
88
|
getCollectionFields = _useCollectionManager.getCollectionFields;
|
|
89
89
|
|
|
90
90
|
var names = (_getCollectionFields = getCollectionFields(collection)) === null || _getCollectionFields === void 0 ? void 0 : _getCollectionFields.filter(function (field) {
|
|
91
|
-
return field.target
|
|
91
|
+
return field.target;
|
|
92
92
|
}).map(function (field) {
|
|
93
93
|
return field.name;
|
|
94
94
|
});
|
|
@@ -113,7 +113,7 @@ var useAssociationNames = function useAssociationNames(collection) {
|
|
|
113
113
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
114
114
|
var collectionField = _step.value;
|
|
115
115
|
|
|
116
|
-
if (collectionField.target
|
|
116
|
+
if (collectionField.target) {
|
|
117
117
|
associationFields.add(collectionField.name);
|
|
118
118
|
var fields = getCollectionFields(collectionField.target);
|
|
119
119
|
|