@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
|
@@ -173,14 +173,13 @@ var getIsOverriding = function getIsOverriding(currentFields, record) {
|
|
|
173
173
|
};
|
|
174
174
|
|
|
175
175
|
export var OverridingFieldAction = function OverridingFieldAction(props) {
|
|
176
|
-
var _getChildrenCollectio;
|
|
177
|
-
|
|
178
176
|
var scope = props.scope,
|
|
179
177
|
getContainer = props.getContainer,
|
|
180
178
|
record = props.item,
|
|
181
179
|
children = props.children,
|
|
182
180
|
currentCollection = props.currentCollection;
|
|
183
|
-
var target = record.target
|
|
181
|
+
var target = record.target,
|
|
182
|
+
through = record.through;
|
|
184
183
|
|
|
185
184
|
var _useCollectionManager2 = useCollectionManager(),
|
|
186
185
|
getInterface = _useCollectionManager2.getInterface,
|
|
@@ -203,9 +202,15 @@ export var OverridingFieldAction = function OverridingFieldAction(props) {
|
|
|
203
202
|
t = _useTranslation.t;
|
|
204
203
|
|
|
205
204
|
var compile = useCompile();
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
205
|
+
|
|
206
|
+
var getFilterCollections = function getFilterCollections(filterKey) {
|
|
207
|
+
var _getChildrenCollectio;
|
|
208
|
+
|
|
209
|
+
var childCollections = filterKey && ((_getChildrenCollectio = getChildrenCollections(filterKey)) === null || _getChildrenCollectio === void 0 ? void 0 : _getChildrenCollectio.map(function (v) {
|
|
210
|
+
return v.name;
|
|
211
|
+
}).concat([filterKey]));
|
|
212
|
+
return childCollections;
|
|
213
|
+
};
|
|
209
214
|
|
|
210
215
|
var _useState5 = useState({}),
|
|
211
216
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
@@ -215,7 +220,9 @@ export var OverridingFieldAction = function OverridingFieldAction(props) {
|
|
|
215
220
|
var currentFields = getCurrentCollectionFields(currentCollection);
|
|
216
221
|
var disabled = getIsOverriding(currentFields, record);
|
|
217
222
|
return /*#__PURE__*/React.createElement(RecordProvider, {
|
|
218
|
-
record: record
|
|
223
|
+
record: _objectSpread(_objectSpread({}, record), {}, {
|
|
224
|
+
collectionName: record.__parent.name
|
|
225
|
+
})
|
|
219
226
|
}, /*#__PURE__*/React.createElement(ActionContext.Provider, {
|
|
220
227
|
value: {
|
|
221
228
|
visible: visible,
|
|
@@ -288,9 +295,11 @@ export var OverridingFieldAction = function OverridingFieldAction(props) {
|
|
|
288
295
|
useCancelAction: useCancelAction,
|
|
289
296
|
showReverseFieldConfig: !(data === null || data === void 0 ? void 0 : data.reverseField),
|
|
290
297
|
createOnly: true,
|
|
298
|
+
override: true,
|
|
291
299
|
isOverride: true,
|
|
292
300
|
targetScope: {
|
|
293
|
-
|
|
301
|
+
target: getFilterCollections(target),
|
|
302
|
+
through: getFilterCollections(through)
|
|
294
303
|
}
|
|
295
304
|
}, scope)
|
|
296
305
|
})));
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { observer } from '@formily/react';
|
|
2
|
+
import { Tag } from 'antd';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { useCompile } from '../../../schema-component';
|
|
5
|
+
export var CollectionCategory = observer(function (props) {
|
|
6
|
+
var value = props.value;
|
|
7
|
+
var compile = useCompile();
|
|
8
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, value.map(function (item) {
|
|
9
|
+
return /*#__PURE__*/React.createElement(Tag, {
|
|
10
|
+
color: item.color
|
|
11
|
+
}, compile(item === null || item === void 0 ? void 0 : item.name));
|
|
12
|
+
}));
|
|
13
|
+
});
|
|
@@ -9,3 +9,6 @@ export * from './OverridingCollectionField';
|
|
|
9
9
|
export * from './ViewInheritedField';
|
|
10
10
|
export * from './AddCollectionAction';
|
|
11
11
|
export * from './EditCollectionAction';
|
|
12
|
+
export * from './ConfigurationTabs';
|
|
13
|
+
export * from './AddCategoryAction';
|
|
14
|
+
export * from './EditCategoryAction';
|
|
@@ -10,6 +10,9 @@ export * from './OverridingCollectionField';
|
|
|
10
10
|
export * from './ViewInheritedField';
|
|
11
11
|
export * from './AddCollectionAction';
|
|
12
12
|
export * from './EditCollectionAction';
|
|
13
|
+
export * from './ConfigurationTabs';
|
|
14
|
+
export * from './AddCategoryAction';
|
|
15
|
+
export * from './EditCategoryAction';
|
|
13
16
|
registerValidateFormats({
|
|
14
17
|
uid: /^[A-Za-z0-9][A-Za-z0-9_-]*$/
|
|
15
18
|
});
|
|
@@ -2,3 +2,6 @@ import { ISchema } from '@formily/react';
|
|
|
2
2
|
import { CollectionOptions } from '../../types';
|
|
3
3
|
export declare const collection: CollectionOptions;
|
|
4
4
|
export declare const collectionSchema: ISchema;
|
|
5
|
+
export declare const collectionTableSchema: ISchema;
|
|
6
|
+
export declare const collectionCategorySchema: ISchema;
|
|
7
|
+
export declare const collectionCategoryEditSchema: ISchema;
|
|
@@ -1,13 +1,19 @@
|
|
|
1
|
+
var _properties;
|
|
2
|
+
|
|
3
|
+
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; }
|
|
4
|
+
|
|
1
5
|
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
6
|
|
|
3
7
|
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
8
|
|
|
5
9
|
import { Schema } from '@formily/react';
|
|
6
10
|
import { message } from 'antd';
|
|
11
|
+
import { uid } from '@formily/shared';
|
|
7
12
|
import { useTranslation } from 'react-i18next';
|
|
8
13
|
import { useAPIClient } from '../../../api-client';
|
|
9
14
|
import { i18n } from '../../../i18n';
|
|
10
15
|
import { CollectionTemplate } from '../components/CollectionTemplate';
|
|
16
|
+
import { CollectionCategory } from '../components/CollectionCategory';
|
|
11
17
|
import { collectionFieldSchema } from './collectionFields';
|
|
12
18
|
|
|
13
19
|
var compile = function compile(source) {
|
|
@@ -91,205 +97,332 @@ export var collectionSchema = {
|
|
|
91
97
|
filter: {
|
|
92
98
|
'hidden.$isFalsy': true
|
|
93
99
|
},
|
|
94
|
-
appends: []
|
|
100
|
+
appends: ['category']
|
|
95
101
|
}
|
|
96
102
|
}
|
|
97
103
|
},
|
|
98
104
|
properties: {
|
|
99
|
-
|
|
105
|
+
tabs: {
|
|
100
106
|
type: 'void',
|
|
101
|
-
'x-component': '
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
107
|
+
'x-component': 'ConfigurationTabs'
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
export var collectionTableSchema = {
|
|
114
|
+
type: 'object',
|
|
115
|
+
properties: (_properties = {}, _defineProperty(_properties, uid(), {
|
|
116
|
+
type: 'void',
|
|
117
|
+
'x-component': 'ActionBar',
|
|
118
|
+
'x-component-props': {
|
|
119
|
+
style: {
|
|
120
|
+
marginBottom: 16
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
properties: {
|
|
124
|
+
filter: {
|
|
125
|
+
type: 'void',
|
|
126
|
+
title: '{{ t("Filter") }}',
|
|
127
|
+
default: {
|
|
128
|
+
$and: [{
|
|
129
|
+
title: {
|
|
130
|
+
$includes: ''
|
|
105
131
|
}
|
|
106
|
-
},
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
132
|
+
}, {
|
|
133
|
+
name: {
|
|
134
|
+
$includes: ''
|
|
135
|
+
}
|
|
136
|
+
}]
|
|
137
|
+
},
|
|
138
|
+
'x-action': 'filter',
|
|
139
|
+
'x-component': 'Filter.Action',
|
|
140
|
+
'x-component-props': {
|
|
141
|
+
icon: 'FilterOutlined',
|
|
142
|
+
useProps: '{{ cm.useFilterActionProps }}'
|
|
143
|
+
},
|
|
144
|
+
'x-align': 'left'
|
|
145
|
+
},
|
|
146
|
+
delete: {
|
|
147
|
+
type: 'void',
|
|
148
|
+
title: '{{ t("Delete") }}',
|
|
149
|
+
'x-component': 'Action',
|
|
150
|
+
'x-component-props': {
|
|
151
|
+
icon: 'DeleteOutlined',
|
|
152
|
+
useAction: '{{ cm.useBulkDestroyActionAndRefreshCM }}',
|
|
153
|
+
confirm: {
|
|
154
|
+
title: "{{t('Delete record')}}",
|
|
155
|
+
content: "{{t('Are you sure you want to delete it?')}}"
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
create: {
|
|
160
|
+
type: 'void',
|
|
161
|
+
title: '{{ t("Create collection") }}',
|
|
162
|
+
'x-component': 'AddCollection',
|
|
163
|
+
'x-component-props': {
|
|
164
|
+
type: 'primary'
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}), _defineProperty(_properties, uid(), {
|
|
169
|
+
type: 'void',
|
|
170
|
+
'x-uid': 'input',
|
|
171
|
+
'x-component': 'Table.Void',
|
|
172
|
+
'x-component-props': {
|
|
173
|
+
rowKey: 'name',
|
|
174
|
+
rowSelection: {
|
|
175
|
+
type: 'checkbox'
|
|
176
|
+
},
|
|
177
|
+
useDataSource: '{{ cm.useDataSourceFromRAC }}',
|
|
178
|
+
useAction: function useAction() {
|
|
179
|
+
var api = useAPIClient();
|
|
180
|
+
|
|
181
|
+
var _useTranslation = useTranslation(),
|
|
182
|
+
t = _useTranslation.t;
|
|
183
|
+
|
|
184
|
+
return {
|
|
185
|
+
move: function move(from, to) {
|
|
186
|
+
return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
|
|
187
|
+
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
188
|
+
while (1) {
|
|
189
|
+
switch (_context.prev = _context.next) {
|
|
190
|
+
case 0:
|
|
191
|
+
_context.next = 2;
|
|
192
|
+
return api.resource('collections').move({
|
|
193
|
+
sourceId: from.key,
|
|
194
|
+
targetId: to.key
|
|
195
|
+
});
|
|
196
|
+
|
|
197
|
+
case 2:
|
|
198
|
+
message.success(t('Saved successfully'), 0.2);
|
|
199
|
+
|
|
200
|
+
case 3:
|
|
201
|
+
case "end":
|
|
202
|
+
return _context.stop();
|
|
115
203
|
}
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
|
|
204
|
+
}
|
|
205
|
+
}, _callee);
|
|
206
|
+
}))();
|
|
207
|
+
}
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
},
|
|
211
|
+
properties: {
|
|
212
|
+
column1: {
|
|
213
|
+
type: 'void',
|
|
214
|
+
'x-decorator': 'Table.Column.Decorator',
|
|
215
|
+
'x-component': 'Table.Column',
|
|
216
|
+
properties: {
|
|
217
|
+
title: {
|
|
218
|
+
'x-component': 'CollectionField',
|
|
219
|
+
'x-read-pretty': true
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
},
|
|
223
|
+
column2: {
|
|
224
|
+
type: 'void',
|
|
225
|
+
'x-decorator': 'Table.Column.Decorator',
|
|
226
|
+
'x-component': 'Table.Column',
|
|
227
|
+
properties: {
|
|
228
|
+
name: {
|
|
229
|
+
type: 'string',
|
|
230
|
+
'x-component': 'CollectionField',
|
|
231
|
+
'x-read-pretty': true
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
},
|
|
235
|
+
column3: {
|
|
236
|
+
type: 'void',
|
|
237
|
+
'x-decorator': 'Table.Column.Decorator',
|
|
238
|
+
'x-component': 'Table.Column',
|
|
239
|
+
title: '{{t("Collection template")}}',
|
|
240
|
+
properties: {
|
|
241
|
+
template: {
|
|
242
|
+
'x-component': CollectionTemplate,
|
|
243
|
+
'x-read-pretty': true
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
},
|
|
247
|
+
column4: {
|
|
248
|
+
type: 'void',
|
|
249
|
+
'x-decorator': 'Table.Column.Decorator',
|
|
250
|
+
'x-component': 'Table.Column',
|
|
251
|
+
'x-visible': 'categoryVisible',
|
|
252
|
+
title: '{{t("Collection category")}}',
|
|
253
|
+
properties: {
|
|
254
|
+
category: {
|
|
255
|
+
'x-component': CollectionCategory,
|
|
256
|
+
'x-read-pretty': true
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
},
|
|
260
|
+
column5: {
|
|
261
|
+
type: 'void',
|
|
262
|
+
title: '{{ t("Actions") }}',
|
|
263
|
+
'x-component': 'Table.Column',
|
|
264
|
+
properties: {
|
|
265
|
+
actions: {
|
|
266
|
+
type: 'void',
|
|
267
|
+
'x-component': 'Space',
|
|
268
|
+
'x-component-props': {
|
|
269
|
+
split: '|'
|
|
270
|
+
},
|
|
271
|
+
properties: {
|
|
272
|
+
view: {
|
|
273
|
+
type: 'void',
|
|
274
|
+
title: '{{ t("Configure fields") }}',
|
|
275
|
+
'x-component': 'Action.Link',
|
|
276
|
+
'x-component-props': {},
|
|
277
|
+
properties: {
|
|
278
|
+
drawer: {
|
|
279
|
+
type: 'void',
|
|
280
|
+
'x-component': 'Action.Drawer',
|
|
281
|
+
'x-component-props': {
|
|
282
|
+
destroyOnClose: true
|
|
283
|
+
},
|
|
284
|
+
'x-reactions': function xReactions(field) {
|
|
285
|
+
var i = field.path.segments[1];
|
|
286
|
+
var table = field.form.getValuesIn("table.".concat(i));
|
|
287
|
+
|
|
288
|
+
if (table) {
|
|
289
|
+
field.title = "".concat(compile(table.title), " - ").concat(compile('{{ t("Configure fields") }}'));
|
|
290
|
+
}
|
|
291
|
+
},
|
|
292
|
+
properties: {
|
|
293
|
+
collectionFieldSchema: collectionFieldSchema
|
|
294
|
+
}
|
|
119
295
|
}
|
|
120
|
-
}
|
|
296
|
+
}
|
|
121
297
|
},
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
298
|
+
update: {
|
|
299
|
+
type: 'void',
|
|
300
|
+
title: '{{ t("Edit") }}',
|
|
301
|
+
'x-component': 'EditCollection',
|
|
302
|
+
'x-component-props': {
|
|
303
|
+
type: 'primary'
|
|
304
|
+
}
|
|
127
305
|
},
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
306
|
+
delete: {
|
|
307
|
+
type: 'void',
|
|
308
|
+
title: '{{ t("Delete") }}',
|
|
309
|
+
'x-component': 'Action.Link',
|
|
310
|
+
'x-component-props': {
|
|
311
|
+
confirm: {
|
|
312
|
+
title: "{{t('Delete record')}}",
|
|
313
|
+
content: "{{t('Are you sure you want to delete it?')}}"
|
|
314
|
+
},
|
|
315
|
+
useAction: '{{ cm.useDestroyActionAndRefreshCM }}'
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
}), _properties)
|
|
324
|
+
};
|
|
325
|
+
export var collectionCategorySchema = {
|
|
326
|
+
type: 'object',
|
|
327
|
+
properties: {
|
|
328
|
+
form: {
|
|
329
|
+
type: 'void',
|
|
330
|
+
'x-decorator': 'Form',
|
|
331
|
+
'x-component': 'Action.Modal',
|
|
332
|
+
title: '{{ t("Add category") }}',
|
|
333
|
+
'x-component-props': {
|
|
334
|
+
width: 520,
|
|
335
|
+
getContainer: '{{ getContainer }}'
|
|
336
|
+
},
|
|
337
|
+
properties: {
|
|
338
|
+
name: {
|
|
339
|
+
type: 'string',
|
|
340
|
+
title: '{{t("Category name")}}',
|
|
341
|
+
required: true,
|
|
342
|
+
'x-disabled': '{{ !createOnly }}',
|
|
343
|
+
'x-decorator': 'FormItem',
|
|
344
|
+
'x-component': 'Input'
|
|
345
|
+
},
|
|
346
|
+
color: {
|
|
347
|
+
type: 'string',
|
|
348
|
+
title: '{{t("Color")}}',
|
|
349
|
+
required: false,
|
|
350
|
+
'x-decorator': 'FormItem',
|
|
351
|
+
'x-component': 'ColorSelect'
|
|
352
|
+
},
|
|
353
|
+
footer: {
|
|
354
|
+
type: 'void',
|
|
355
|
+
'x-component': 'Action.Modal.Footer',
|
|
356
|
+
properties: {
|
|
357
|
+
action1: {
|
|
358
|
+
title: '{{ t("Cancel") }}',
|
|
133
359
|
'x-component': 'Action',
|
|
134
360
|
'x-component-props': {
|
|
135
|
-
|
|
136
|
-
useAction: '{{ cm.useBulkDestroyActionAndRefreshCM }}',
|
|
137
|
-
confirm: {
|
|
138
|
-
title: "{{t('Delete record')}}",
|
|
139
|
-
content: "{{t('Are you sure you want to delete it?')}}"
|
|
140
|
-
}
|
|
361
|
+
useAction: '{{ useCancelAction }}'
|
|
141
362
|
}
|
|
142
363
|
},
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
'x-component': 'AddCollection',
|
|
364
|
+
action2: {
|
|
365
|
+
title: '{{ t("Submit") }}',
|
|
366
|
+
'x-component': 'Action',
|
|
147
367
|
'x-component-props': {
|
|
148
|
-
type: 'primary'
|
|
368
|
+
type: 'primary',
|
|
369
|
+
useAction: '{{ useCreateCategry }}'
|
|
149
370
|
}
|
|
150
371
|
}
|
|
151
372
|
}
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
};
|
|
378
|
+
export var collectionCategoryEditSchema = {
|
|
379
|
+
type: 'object',
|
|
380
|
+
properties: {
|
|
381
|
+
form: {
|
|
382
|
+
type: 'void',
|
|
383
|
+
'x-decorator': 'Form',
|
|
384
|
+
'x-decorator-props': {
|
|
385
|
+
useValues: '{{ useValuesFromRecord }}'
|
|
386
|
+
},
|
|
387
|
+
'x-component': 'Action.Modal',
|
|
388
|
+
title: '{{ t("Edit category") }}',
|
|
389
|
+
'x-component-props': {
|
|
390
|
+
width: 520,
|
|
391
|
+
getContainer: '{{ getContainer }}'
|
|
392
|
+
},
|
|
393
|
+
properties: {
|
|
394
|
+
name: {
|
|
395
|
+
type: 'string',
|
|
396
|
+
title: '{{t("Category name")}}',
|
|
397
|
+
required: true,
|
|
398
|
+
'x-disabled': '{{ !createOnly }}',
|
|
399
|
+
'x-decorator': 'FormItem',
|
|
400
|
+
'x-component': 'Input'
|
|
401
|
+
},
|
|
402
|
+
color: {
|
|
403
|
+
type: 'string',
|
|
404
|
+
title: '{{t("Color")}}',
|
|
405
|
+
required: false,
|
|
406
|
+
'x-decorator': 'FormItem',
|
|
407
|
+
'x-component': 'ColorSelect'
|
|
152
408
|
},
|
|
153
|
-
|
|
409
|
+
footer: {
|
|
154
410
|
type: 'void',
|
|
155
|
-
'x-
|
|
156
|
-
'x-component': 'Table.Void',
|
|
157
|
-
'x-component-props': {
|
|
158
|
-
rowKey: 'name',
|
|
159
|
-
rowSelection: {
|
|
160
|
-
type: 'checkbox'
|
|
161
|
-
},
|
|
162
|
-
useDataSource: '{{ cm.useDataSourceFromRAC }}',
|
|
163
|
-
useAction: function useAction() {
|
|
164
|
-
var api = useAPIClient();
|
|
165
|
-
|
|
166
|
-
var _useTranslation = useTranslation(),
|
|
167
|
-
t = _useTranslation.t;
|
|
168
|
-
|
|
169
|
-
return {
|
|
170
|
-
move: function move(from, to) {
|
|
171
|
-
return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
|
|
172
|
-
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
173
|
-
while (1) {
|
|
174
|
-
switch (_context.prev = _context.next) {
|
|
175
|
-
case 0:
|
|
176
|
-
console.log(from, to);
|
|
177
|
-
_context.next = 3;
|
|
178
|
-
return api.resource('collections').move({
|
|
179
|
-
sourceId: from.key,
|
|
180
|
-
targetId: to.key
|
|
181
|
-
});
|
|
182
|
-
|
|
183
|
-
case 3:
|
|
184
|
-
message.success(t('Saved successfully'), 0.2);
|
|
185
|
-
|
|
186
|
-
case 4:
|
|
187
|
-
case "end":
|
|
188
|
-
return _context.stop();
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
}, _callee);
|
|
192
|
-
}))();
|
|
193
|
-
}
|
|
194
|
-
};
|
|
195
|
-
}
|
|
196
|
-
},
|
|
411
|
+
'x-component': 'Action.Modal.Footer',
|
|
197
412
|
properties: {
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
'x-
|
|
201
|
-
'x-component':
|
|
202
|
-
|
|
203
|
-
title: {
|
|
204
|
-
'x-component': 'CollectionField',
|
|
205
|
-
'x-read-pretty': true
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
},
|
|
209
|
-
column2: {
|
|
210
|
-
type: 'void',
|
|
211
|
-
'x-decorator': 'Table.Column.Decorator',
|
|
212
|
-
'x-component': 'Table.Column',
|
|
213
|
-
properties: {
|
|
214
|
-
name: {
|
|
215
|
-
type: 'string',
|
|
216
|
-
'x-component': 'CollectionField',
|
|
217
|
-
'x-read-pretty': true
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
},
|
|
221
|
-
column3: {
|
|
222
|
-
type: 'void',
|
|
223
|
-
'x-decorator': 'Table.Column.Decorator',
|
|
224
|
-
'x-component': 'Table.Column',
|
|
225
|
-
title: '{{t("Collection template")}}',
|
|
226
|
-
properties: {
|
|
227
|
-
template: {
|
|
228
|
-
'x-component': CollectionTemplate,
|
|
229
|
-
'x-read-pretty': true
|
|
230
|
-
}
|
|
413
|
+
action1: {
|
|
414
|
+
title: '{{ t("Cancel") }}',
|
|
415
|
+
'x-component': 'Action',
|
|
416
|
+
'x-component-props': {
|
|
417
|
+
useAction: '{{ useCancelAction }}'
|
|
231
418
|
}
|
|
232
419
|
},
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
'x-component':
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
type: 'void',
|
|
240
|
-
'x-component': 'Space',
|
|
241
|
-
'x-component-props': {
|
|
242
|
-
split: '|'
|
|
243
|
-
},
|
|
244
|
-
properties: {
|
|
245
|
-
view: {
|
|
246
|
-
type: 'void',
|
|
247
|
-
title: '{{ t("Configure fields") }}',
|
|
248
|
-
'x-component': 'Action.Link',
|
|
249
|
-
'x-component-props': {},
|
|
250
|
-
properties: {
|
|
251
|
-
drawer: {
|
|
252
|
-
type: 'void',
|
|
253
|
-
'x-component': 'Action.Drawer',
|
|
254
|
-
'x-component-props': {
|
|
255
|
-
destroyOnClose: true
|
|
256
|
-
},
|
|
257
|
-
'x-reactions': function xReactions(field) {
|
|
258
|
-
var i = field.path.segments[1];
|
|
259
|
-
var table = field.form.getValuesIn("table.".concat(i));
|
|
260
|
-
|
|
261
|
-
if (table) {
|
|
262
|
-
field.title = "".concat(compile(table.title), " - ").concat(compile('{{ t("Configure fields") }}'));
|
|
263
|
-
}
|
|
264
|
-
},
|
|
265
|
-
properties: {
|
|
266
|
-
collectionFieldSchema: collectionFieldSchema
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
},
|
|
271
|
-
update: {
|
|
272
|
-
type: 'void',
|
|
273
|
-
title: '{{ t("Edit") }}',
|
|
274
|
-
'x-component': 'EditCollection',
|
|
275
|
-
'x-component-props': {
|
|
276
|
-
type: 'primary'
|
|
277
|
-
}
|
|
278
|
-
},
|
|
279
|
-
delete: {
|
|
280
|
-
type: 'void',
|
|
281
|
-
title: '{{ t("Delete") }}',
|
|
282
|
-
'x-component': 'Action.Link',
|
|
283
|
-
'x-component-props': {
|
|
284
|
-
confirm: {
|
|
285
|
-
title: "{{t('Delete record')}}",
|
|
286
|
-
content: "{{t('Are you sure you want to delete it?')}}"
|
|
287
|
-
},
|
|
288
|
-
useAction: '{{ cm.useDestroyActionAndRefreshCM }}'
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
}
|
|
420
|
+
action2: {
|
|
421
|
+
title: '{{ t("Submit") }}',
|
|
422
|
+
'x-component': 'Action',
|
|
423
|
+
'x-component-props': {
|
|
424
|
+
type: 'primary',
|
|
425
|
+
useAction: '{{ useEditCategry }}'
|
|
293
426
|
}
|
|
294
427
|
}
|
|
295
428
|
}
|
|
@@ -54,5 +54,6 @@ export declare const templates: Map<string, import("@formily/react").Stringify<{
|
|
|
54
54
|
"x-read-only"?: boolean;
|
|
55
55
|
"x-read-pretty"?: boolean;
|
|
56
56
|
}>>;
|
|
57
|
+
export declare const collectionTemplates: any;
|
|
57
58
|
export declare function registerTemplate(key: string, schema: any): void;
|
|
58
59
|
export declare const templateOptions: () => any[];
|
|
@@ -6,7 +6,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
6
6
|
|
|
7
7
|
import * as types from '../templates';
|
|
8
8
|
export var templates = new Map();
|
|
9
|
-
var collectionTemplates = {};
|
|
9
|
+
export var collectionTemplates = {};
|
|
10
10
|
export function registerTemplate(key, schema) {
|
|
11
11
|
collectionTemplates[key] = schema;
|
|
12
12
|
}
|
|
@@ -718,6 +718,8 @@ export var useBulkDestroyActionAndRefreshCM = function useBulkDestroyActionAndRe
|
|
|
718
718
|
};
|
|
719
719
|
};
|
|
720
720
|
export var useFilterActionProps = function useFilterActionProps() {
|
|
721
|
+
var _service$state, _service$state$params;
|
|
722
|
+
|
|
721
723
|
var _useResourceContext8 = useResourceContext(),
|
|
722
724
|
collection = _useResourceContext8.collection;
|
|
723
725
|
|
|
@@ -725,7 +727,7 @@ export var useFilterActionProps = function useFilterActionProps() {
|
|
|
725
727
|
var service = useResourceActionContext();
|
|
726
728
|
return useFilterFieldProps({
|
|
727
729
|
options: options,
|
|
728
|
-
params: service.params,
|
|
730
|
+
params: ((_service$state = service.state) === null || _service$state === void 0 ? void 0 : (_service$state$params = _service$state.params) === null || _service$state$params === void 0 ? void 0 : _service$state$params[0]) || service.params,
|
|
729
731
|
service: service
|
|
730
732
|
});
|
|
731
733
|
};
|
|
@@ -3,3 +3,7 @@ import { CollectionFieldOptions, CollectionManagerOptions, CollectionOptions } f
|
|
|
3
3
|
export declare const CollectionManagerContext: import("react").Context<CollectionManagerOptions>;
|
|
4
4
|
export declare const CollectionContext: import("react").Context<CollectionOptions>;
|
|
5
5
|
export declare const CollectionFieldContext: import("react").Context<CollectionFieldOptions>;
|
|
6
|
+
export declare const CollectionCategroriesContext: import("react").Context<{
|
|
7
|
+
data: any[];
|
|
8
|
+
refresh: () => void;
|
|
9
|
+
}>;
|