@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
|
@@ -124,7 +124,7 @@ export declare const BlockInitializers: {
|
|
|
124
124
|
};
|
|
125
125
|
};
|
|
126
126
|
};
|
|
127
|
-
items:
|
|
127
|
+
items: {
|
|
128
128
|
key: string;
|
|
129
129
|
type: string;
|
|
130
130
|
title: string;
|
|
@@ -134,187 +134,5 @@ export declare const BlockInitializers: {
|
|
|
134
134
|
title: string;
|
|
135
135
|
component: string;
|
|
136
136
|
}[];
|
|
137
|
-
}
|
|
138
|
-
key: string;
|
|
139
|
-
type: string;
|
|
140
|
-
title: string;
|
|
141
|
-
children: ({
|
|
142
|
-
key: string;
|
|
143
|
-
type: string;
|
|
144
|
-
title: string;
|
|
145
|
-
component: string;
|
|
146
|
-
icon: string;
|
|
147
|
-
schema: {
|
|
148
|
-
type: string;
|
|
149
|
-
'x-designer': string;
|
|
150
|
-
'x-decorator': string;
|
|
151
|
-
'x-component': string;
|
|
152
|
-
'x-component-props': {
|
|
153
|
-
plot: string;
|
|
154
|
-
config: {
|
|
155
|
-
data: {
|
|
156
|
-
type: string;
|
|
157
|
-
sales: number;
|
|
158
|
-
}[];
|
|
159
|
-
xField: string;
|
|
160
|
-
yField: string;
|
|
161
|
-
label: {
|
|
162
|
-
position: string;
|
|
163
|
-
style: {
|
|
164
|
-
fill: string;
|
|
165
|
-
opacity: number;
|
|
166
|
-
};
|
|
167
|
-
};
|
|
168
|
-
xAxis: {
|
|
169
|
-
label: {
|
|
170
|
-
autoHide: boolean;
|
|
171
|
-
autoRotate: boolean;
|
|
172
|
-
};
|
|
173
|
-
};
|
|
174
|
-
meta: {
|
|
175
|
-
type: {
|
|
176
|
-
alias: string;
|
|
177
|
-
};
|
|
178
|
-
sales: {
|
|
179
|
-
alias: string;
|
|
180
|
-
};
|
|
181
|
-
};
|
|
182
|
-
};
|
|
183
|
-
};
|
|
184
|
-
};
|
|
185
|
-
} | {
|
|
186
|
-
key: string;
|
|
187
|
-
type: string;
|
|
188
|
-
title: string;
|
|
189
|
-
component: string;
|
|
190
|
-
icon: string;
|
|
191
|
-
schema: {
|
|
192
|
-
type: string;
|
|
193
|
-
'x-designer': string;
|
|
194
|
-
'x-decorator': string;
|
|
195
|
-
'x-component': string;
|
|
196
|
-
'x-component-props': {
|
|
197
|
-
plot: string;
|
|
198
|
-
config: {
|
|
199
|
-
data: {
|
|
200
|
-
year: string;
|
|
201
|
-
value: number;
|
|
202
|
-
}[];
|
|
203
|
-
xField: string;
|
|
204
|
-
yField: string;
|
|
205
|
-
seriesField: string;
|
|
206
|
-
legend: {
|
|
207
|
-
position: string;
|
|
208
|
-
};
|
|
209
|
-
};
|
|
210
|
-
};
|
|
211
|
-
};
|
|
212
|
-
} | {
|
|
213
|
-
key: string;
|
|
214
|
-
type: string;
|
|
215
|
-
title: string;
|
|
216
|
-
component: string;
|
|
217
|
-
icon: string;
|
|
218
|
-
schema: {
|
|
219
|
-
type: string;
|
|
220
|
-
'x-designer': string;
|
|
221
|
-
'x-decorator': string;
|
|
222
|
-
'x-component': string;
|
|
223
|
-
'x-component-props': {
|
|
224
|
-
plot: string;
|
|
225
|
-
config: {
|
|
226
|
-
data: {
|
|
227
|
-
Date: string;
|
|
228
|
-
scales: number;
|
|
229
|
-
}[];
|
|
230
|
-
padding: string;
|
|
231
|
-
xField: string;
|
|
232
|
-
yField: string;
|
|
233
|
-
xAxis: {
|
|
234
|
-
tickCount: number;
|
|
235
|
-
};
|
|
236
|
-
};
|
|
237
|
-
};
|
|
238
|
-
};
|
|
239
|
-
} | {
|
|
240
|
-
key: string;
|
|
241
|
-
type: string;
|
|
242
|
-
title: string;
|
|
243
|
-
component: string;
|
|
244
|
-
icon: string;
|
|
245
|
-
schema: {
|
|
246
|
-
type: string;
|
|
247
|
-
'x-designer': string;
|
|
248
|
-
'x-decorator': string;
|
|
249
|
-
'x-component': string;
|
|
250
|
-
'x-component-props': {
|
|
251
|
-
plot: string;
|
|
252
|
-
config: {
|
|
253
|
-
appendPadding: number;
|
|
254
|
-
data: {
|
|
255
|
-
type: string;
|
|
256
|
-
value: number;
|
|
257
|
-
}[];
|
|
258
|
-
angleField: string;
|
|
259
|
-
colorField: string;
|
|
260
|
-
radius: number;
|
|
261
|
-
label: {
|
|
262
|
-
type: string;
|
|
263
|
-
offset: string;
|
|
264
|
-
content: string;
|
|
265
|
-
style: {
|
|
266
|
-
fontSize: number;
|
|
267
|
-
textAlign: string;
|
|
268
|
-
};
|
|
269
|
-
};
|
|
270
|
-
interactions: {
|
|
271
|
-
type: string;
|
|
272
|
-
}[];
|
|
273
|
-
};
|
|
274
|
-
};
|
|
275
|
-
};
|
|
276
|
-
} | {
|
|
277
|
-
key: string;
|
|
278
|
-
type: string;
|
|
279
|
-
title: string;
|
|
280
|
-
component: string;
|
|
281
|
-
icon: string;
|
|
282
|
-
schema: {
|
|
283
|
-
type: string;
|
|
284
|
-
'x-designer': string;
|
|
285
|
-
'x-decorator': string;
|
|
286
|
-
'x-component': string;
|
|
287
|
-
'x-component-props': {
|
|
288
|
-
plot: string;
|
|
289
|
-
config: {
|
|
290
|
-
data: {
|
|
291
|
-
timePeriod: string;
|
|
292
|
-
value: number;
|
|
293
|
-
}[];
|
|
294
|
-
xField: string;
|
|
295
|
-
yField: string;
|
|
296
|
-
xAxis: {
|
|
297
|
-
range: number[];
|
|
298
|
-
};
|
|
299
|
-
};
|
|
300
|
-
};
|
|
301
|
-
};
|
|
302
|
-
} | {
|
|
303
|
-
key: string;
|
|
304
|
-
type: string;
|
|
305
|
-
title: string;
|
|
306
|
-
component: string;
|
|
307
|
-
icon: string;
|
|
308
|
-
schema: {
|
|
309
|
-
type: string;
|
|
310
|
-
'x-designer': string;
|
|
311
|
-
'x-decorator': string;
|
|
312
|
-
'x-component': string;
|
|
313
|
-
'x-component-props': {
|
|
314
|
-
plot?: undefined;
|
|
315
|
-
config?: undefined;
|
|
316
|
-
};
|
|
317
|
-
};
|
|
318
|
-
})[];
|
|
319
|
-
})[];
|
|
137
|
+
}[];
|
|
320
138
|
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { gridRowColWrap } from '../utils';
|
|
2
|
-
import * as chartConfig from './chart-config'; // 页面里添加区块
|
|
1
|
+
import { gridRowColWrap } from '../utils'; // 页面里添加区块
|
|
3
2
|
|
|
4
3
|
export var BlockInitializers = {
|
|
5
4
|
title: '{{t("Add block")}}',
|
|
@@ -35,106 +34,6 @@ export var BlockInitializers = {
|
|
|
35
34
|
title: '{{t("Kanban")}}',
|
|
36
35
|
component: 'KanbanBlockInitializer'
|
|
37
36
|
}]
|
|
38
|
-
}, {
|
|
39
|
-
key: 'g2plot',
|
|
40
|
-
type: 'itemGroup',
|
|
41
|
-
title: '{{t("Chart blocks")}}',
|
|
42
|
-
children: [{
|
|
43
|
-
key: 'column',
|
|
44
|
-
type: 'item',
|
|
45
|
-
title: '{{t("Column chart")}}',
|
|
46
|
-
component: 'G2PlotInitializer',
|
|
47
|
-
icon: 'BarChartOutlined',
|
|
48
|
-
schema: {
|
|
49
|
-
type: 'void',
|
|
50
|
-
'x-designer': 'G2Plot.Designer',
|
|
51
|
-
'x-decorator': 'CardItem',
|
|
52
|
-
'x-component': 'G2Plot',
|
|
53
|
-
'x-component-props': {
|
|
54
|
-
plot: 'Column',
|
|
55
|
-
config: chartConfig.column
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}, {
|
|
59
|
-
key: 'bar',
|
|
60
|
-
type: 'item',
|
|
61
|
-
title: '{{t("Bar chart")}}',
|
|
62
|
-
component: 'G2PlotInitializer',
|
|
63
|
-
icon: 'BarChartOutlined',
|
|
64
|
-
schema: {
|
|
65
|
-
type: 'void',
|
|
66
|
-
'x-designer': 'G2Plot.Designer',
|
|
67
|
-
'x-decorator': 'CardItem',
|
|
68
|
-
'x-component': 'G2Plot',
|
|
69
|
-
'x-component-props': {
|
|
70
|
-
plot: 'Bar',
|
|
71
|
-
config: chartConfig.bar
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}, {
|
|
75
|
-
key: 'line',
|
|
76
|
-
type: 'item',
|
|
77
|
-
title: '{{t("Line chart")}}',
|
|
78
|
-
component: 'G2PlotInitializer',
|
|
79
|
-
icon: 'LineChartOutlined',
|
|
80
|
-
schema: {
|
|
81
|
-
type: 'void',
|
|
82
|
-
'x-designer': 'G2Plot.Designer',
|
|
83
|
-
'x-decorator': 'CardItem',
|
|
84
|
-
'x-component': 'G2Plot',
|
|
85
|
-
'x-component-props': {
|
|
86
|
-
plot: 'Line',
|
|
87
|
-
config: chartConfig.line
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}, {
|
|
91
|
-
key: 'pie',
|
|
92
|
-
type: 'item',
|
|
93
|
-
title: '{{t("Pie chart")}}',
|
|
94
|
-
component: 'G2PlotInitializer',
|
|
95
|
-
icon: 'PieChartOutlined',
|
|
96
|
-
schema: {
|
|
97
|
-
type: 'void',
|
|
98
|
-
'x-designer': 'G2Plot.Designer',
|
|
99
|
-
'x-decorator': 'CardItem',
|
|
100
|
-
'x-component': 'G2Plot',
|
|
101
|
-
'x-component-props': {
|
|
102
|
-
plot: 'Pie',
|
|
103
|
-
config: chartConfig.pie
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
}, {
|
|
107
|
-
key: 'area',
|
|
108
|
-
type: 'item',
|
|
109
|
-
title: '{{t("Area chart")}}',
|
|
110
|
-
component: 'G2PlotInitializer',
|
|
111
|
-
icon: 'AreaChartOutlined',
|
|
112
|
-
schema: {
|
|
113
|
-
type: 'void',
|
|
114
|
-
'x-designer': 'G2Plot.Designer',
|
|
115
|
-
'x-decorator': 'CardItem',
|
|
116
|
-
'x-component': 'G2Plot',
|
|
117
|
-
'x-component-props': {
|
|
118
|
-
plot: 'Area',
|
|
119
|
-
config: chartConfig.area
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
}, {
|
|
123
|
-
key: 'other',
|
|
124
|
-
type: 'item',
|
|
125
|
-
title: '{{t("Other chart")}}',
|
|
126
|
-
component: 'G2PlotInitializer',
|
|
127
|
-
icon: 'AreaChartOutlined',
|
|
128
|
-
schema: {
|
|
129
|
-
type: 'void',
|
|
130
|
-
'x-designer': 'G2Plot.Designer',
|
|
131
|
-
'x-decorator': 'CardItem',
|
|
132
|
-
'x-component': 'G2Plot',
|
|
133
|
-
'x-component-props': {// plot: 'Area',
|
|
134
|
-
// config: {},
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
}]
|
|
138
37
|
}, {
|
|
139
38
|
key: 'media',
|
|
140
39
|
type: 'itemGroup',
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2
|
+
|
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
+
|
|
5
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
|
|
1
7
|
import { useFieldSchema } from '@formily/react';
|
|
2
8
|
import React from 'react';
|
|
3
9
|
import { useTranslation } from 'react-i18next';
|
|
@@ -111,17 +117,21 @@ var useRelationFields = function useRelationFields() {
|
|
|
111
117
|
return relationFields;
|
|
112
118
|
};
|
|
113
119
|
|
|
114
|
-
var
|
|
115
|
-
var actionInitializers = props.actionInitializers
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
var
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
120
|
+
var useDetailCollections = function useDetailCollections(props) {
|
|
121
|
+
var actionInitializers = props.actionInitializers,
|
|
122
|
+
childrenCollections = props.childrenCollections,
|
|
123
|
+
collection = props.collection;
|
|
124
|
+
var detailCollections = [{
|
|
125
|
+
key: collection.name,
|
|
126
|
+
type: 'item',
|
|
127
|
+
title: (collection === null || collection === void 0 ? void 0 : collection.title) || collection.name,
|
|
128
|
+
component: 'RecordReadPrettyFormBlockInitializer',
|
|
129
|
+
icon: false,
|
|
130
|
+
targetCollection: collection,
|
|
131
|
+
actionInitializers: actionInitializers
|
|
132
|
+
}].concat(childrenCollections.map(function (c) {
|
|
123
133
|
return {
|
|
124
|
-
key: c.
|
|
134
|
+
key: c.name,
|
|
125
135
|
type: 'item',
|
|
126
136
|
title: (c === null || c === void 0 ? void 0 : c.title) || c.name,
|
|
127
137
|
component: 'RecordReadPrettyFormBlockInitializer',
|
|
@@ -129,7 +139,34 @@ var useInheritFields = function useInheritFields(props) {
|
|
|
129
139
|
targetCollection: c,
|
|
130
140
|
actionInitializers: actionInitializers
|
|
131
141
|
};
|
|
132
|
-
});
|
|
142
|
+
}));
|
|
143
|
+
return detailCollections;
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
var useFormCollections = function useFormCollections(props) {
|
|
147
|
+
var actionInitializers = props.actionInitializers,
|
|
148
|
+
childrenCollections = props.childrenCollections,
|
|
149
|
+
collection = props.collection;
|
|
150
|
+
var formCollections = [{
|
|
151
|
+
key: collection.name,
|
|
152
|
+
type: 'item',
|
|
153
|
+
title: (collection === null || collection === void 0 ? void 0 : collection.title) || collection.name,
|
|
154
|
+
component: 'RecordFormBlockInitializer',
|
|
155
|
+
icon: false,
|
|
156
|
+
targetCollection: collection,
|
|
157
|
+
actionInitializers: actionInitializers
|
|
158
|
+
}].concat(childrenCollections.map(function (c) {
|
|
159
|
+
return {
|
|
160
|
+
key: c.name,
|
|
161
|
+
type: 'item',
|
|
162
|
+
title: (c === null || c === void 0 ? void 0 : c.title) || c.name,
|
|
163
|
+
component: 'RecordFormBlockInitializer',
|
|
164
|
+
icon: false,
|
|
165
|
+
targetCollection: c,
|
|
166
|
+
actionInitializers: actionInitializers
|
|
167
|
+
};
|
|
168
|
+
}));
|
|
169
|
+
return formCollections;
|
|
133
170
|
};
|
|
134
171
|
|
|
135
172
|
export var RecordBlockInitializers = function RecordBlockInitializers(props) {
|
|
@@ -139,6 +176,13 @@ export var RecordBlockInitializers = function RecordBlockInitializers(props) {
|
|
|
139
176
|
var insertPosition = props.insertPosition,
|
|
140
177
|
component = props.component,
|
|
141
178
|
actionInitializers = props.actionInitializers;
|
|
179
|
+
var collection = useCollection();
|
|
180
|
+
|
|
181
|
+
var _useCollectionManager2 = useCollectionManager(),
|
|
182
|
+
getChildrenCollections = _useCollectionManager2.getChildrenCollections;
|
|
183
|
+
|
|
184
|
+
var childrenCollections = getChildrenCollections(collection.name);
|
|
185
|
+
var hasChildCollection = (childrenCollections === null || childrenCollections === void 0 ? void 0 : childrenCollections.length) > 0;
|
|
142
186
|
return /*#__PURE__*/React.createElement(SchemaInitializer.Button, {
|
|
143
187
|
wrap: gridRowColWrap,
|
|
144
188
|
insertPosition: insertPosition,
|
|
@@ -148,7 +192,23 @@ export var RecordBlockInitializers = function RecordBlockInitializers(props) {
|
|
|
148
192
|
items: [{
|
|
149
193
|
type: 'itemGroup',
|
|
150
194
|
title: '{{t("Current record blocks")}}',
|
|
151
|
-
children: [{
|
|
195
|
+
children: hasChildCollection ? [{
|
|
196
|
+
key: 'details',
|
|
197
|
+
type: 'subMenu',
|
|
198
|
+
title: '{{t("Details")}}',
|
|
199
|
+
children: useDetailCollections(_objectSpread(_objectSpread({}, props), {}, {
|
|
200
|
+
childrenCollections: childrenCollections,
|
|
201
|
+
collection: collection
|
|
202
|
+
}))
|
|
203
|
+
}, {
|
|
204
|
+
key: 'form',
|
|
205
|
+
type: 'subMenu',
|
|
206
|
+
title: '{{t("Form")}}',
|
|
207
|
+
children: useFormCollections(_objectSpread(_objectSpread({}, props), {}, {
|
|
208
|
+
childrenCollections: childrenCollections,
|
|
209
|
+
collection: collection
|
|
210
|
+
}))
|
|
211
|
+
}] : [{
|
|
152
212
|
key: 'details',
|
|
153
213
|
type: 'item',
|
|
154
214
|
title: '{{t("Details")}}',
|
|
@@ -160,10 +220,6 @@ export var RecordBlockInitializers = function RecordBlockInitializers(props) {
|
|
|
160
220
|
title: '{{t("Form")}}',
|
|
161
221
|
component: 'RecordFormBlockInitializer'
|
|
162
222
|
}]
|
|
163
|
-
}, {
|
|
164
|
-
type: 'itemGroup',
|
|
165
|
-
title: '{{t("Children collection blocks")}}',
|
|
166
|
-
children: useInheritFields(props)
|
|
167
223
|
}, {
|
|
168
224
|
type: 'itemGroup',
|
|
169
225
|
title: '{{t("Relationship blocks")}}',
|
|
@@ -7,8 +7,7 @@ import { useTranslation } from 'react-i18next';
|
|
|
7
7
|
import { SchemaInitializer, SchemaSettings } from '../..';
|
|
8
8
|
import { useAPIClient } from '../../api-client';
|
|
9
9
|
import { createDesignable, useDesignable } from '../../schema-component';
|
|
10
|
-
|
|
11
|
-
var Resizable = function Resizable(props) {
|
|
10
|
+
export var Resizable = function Resizable(props) {
|
|
12
11
|
var _fieldSchema$xCompon;
|
|
13
12
|
|
|
14
13
|
var _useTranslation = useTranslation(),
|
|
@@ -48,7 +47,6 @@ var Resizable = function Resizable(props) {
|
|
|
48
47
|
}
|
|
49
48
|
});
|
|
50
49
|
};
|
|
51
|
-
|
|
52
50
|
export var TableActionColumnInitializers = function TableActionColumnInitializers(props) {
|
|
53
51
|
var fieldSchema = useFieldSchema();
|
|
54
52
|
var api = useAPIClient();
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
var _templateObject;
|
|
2
|
+
|
|
3
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
+
|
|
5
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
|
+
|
|
7
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
8
|
+
|
|
9
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
10
|
+
|
|
11
|
+
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."); }
|
|
12
|
+
|
|
13
|
+
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); }
|
|
14
|
+
|
|
15
|
+
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
|
+
|
|
17
|
+
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; }
|
|
18
|
+
|
|
19
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
20
|
+
|
|
21
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
22
|
+
|
|
23
|
+
import React, { useState } from 'react';
|
|
24
|
+
import { DownOutlined, PlusOutlined } from '@ant-design/icons';
|
|
25
|
+
import { RecursionField, useFieldSchema, useField } from '@formily/react';
|
|
26
|
+
import { Dropdown, Menu, Button } from 'antd';
|
|
27
|
+
import { css } from '@emotion/css';
|
|
28
|
+
import { observer } from '@formily/react';
|
|
29
|
+
import { useCollectionManager, useCollection, CollectionProvider } from '../../collection-manager';
|
|
30
|
+
import { ActionContext, useCompile, useActionContext } from '../../schema-component';
|
|
31
|
+
import { useRecordPkValue, useACLRolesCheck } from '../../acl/ACLProvider';
|
|
32
|
+
export var actionDesignerCss = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n &:hover {\n .general-schema-designer {\n display: block;\n }\n }\n .general-schema-designer {\n position: absolute;\n z-index: 999;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n display: none;\n background: rgba(241, 139, 98, 0.06);\n border: 0;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n pointer-events: none;\n > .general-schema-designer-icons {\n position: absolute;\n right: 2px;\n top: 2px;\n line-height: 16px;\n pointer-events: all;\n .ant-space-item {\n background-color: #f18b62;\n color: #fff;\n line-height: 16px;\n width: 16px;\n padding-left: 1px;\n }\n }\n }\n"])));
|
|
33
|
+
|
|
34
|
+
var actionAclCheck = function actionAclCheck(actionPath) {
|
|
35
|
+
var _actionPath;
|
|
36
|
+
|
|
37
|
+
var _useACLRolesCheck = useACLRolesCheck(),
|
|
38
|
+
data = _useACLRolesCheck.data,
|
|
39
|
+
inResources = _useACLRolesCheck.inResources,
|
|
40
|
+
getResourceActionParams = _useACLRolesCheck.getResourceActionParams,
|
|
41
|
+
getStrategyActionParams = _useACLRolesCheck.getStrategyActionParams;
|
|
42
|
+
|
|
43
|
+
var recordPkValue = useRecordPkValue();
|
|
44
|
+
var collection = useCollection();
|
|
45
|
+
var resource = collection.resource;
|
|
46
|
+
|
|
47
|
+
var parseAction = function parseAction(actionPath) {
|
|
48
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
49
|
+
|
|
50
|
+
var _actionPath$split = actionPath.split(':'),
|
|
51
|
+
_actionPath$split2 = _slicedToArray(_actionPath$split, 1),
|
|
52
|
+
resourceName = _actionPath$split2[0];
|
|
53
|
+
|
|
54
|
+
if (data === null || data === void 0 ? void 0 : data.allowAll) {
|
|
55
|
+
return {};
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (inResources(resourceName)) {
|
|
59
|
+
return getResourceActionParams(actionPath);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return getStrategyActionParams(actionPath);
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
if (!actionPath && resource) {
|
|
66
|
+
actionPath = "".concat(resource, ":create}");
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
if (!((_actionPath = actionPath) === null || _actionPath === void 0 ? void 0 : _actionPath.includes(':'))) {
|
|
70
|
+
actionPath = "".concat(resource, ":").concat(actionPath);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if (!actionPath) {
|
|
74
|
+
return true;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
var params = parseAction(actionPath, {
|
|
78
|
+
recordPkValue: recordPkValue
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
if (!params) {
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
return true;
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
export var CreateRecordAction = observer(function (props) {
|
|
89
|
+
var _useState = useState(false),
|
|
90
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
91
|
+
visible = _useState2[0],
|
|
92
|
+
setVisible = _useState2[1];
|
|
93
|
+
|
|
94
|
+
var collection = useCollection();
|
|
95
|
+
var fieldSchema = useFieldSchema();
|
|
96
|
+
var enableChildren = fieldSchema['x-enable-children'] || [];
|
|
97
|
+
var field = useField();
|
|
98
|
+
|
|
99
|
+
var _useCollectionManager = useCollectionManager(),
|
|
100
|
+
getChildrenCollections = _useCollectionManager.getChildrenCollections;
|
|
101
|
+
|
|
102
|
+
var totalChildCollections = getChildrenCollections(collection.name);
|
|
103
|
+
var inheritsCollections = enableChildren.map(function (k) {
|
|
104
|
+
var childCollection = totalChildCollections.find(function (j) {
|
|
105
|
+
return j.name === k.collection;
|
|
106
|
+
});
|
|
107
|
+
return _objectSpread(_objectSpread({}, childCollection), {}, {
|
|
108
|
+
title: k.title || childCollection.title
|
|
109
|
+
});
|
|
110
|
+
}).filter(function (v) {
|
|
111
|
+
return actionAclCheck("".concat(v.name, ":create"));
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
var _useState3 = useState(collection.name),
|
|
115
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
116
|
+
currentCollection = _useState4[0],
|
|
117
|
+
setCurrentCollection = _useState4[1];
|
|
118
|
+
|
|
119
|
+
var ctx = useActionContext();
|
|
120
|
+
var compile = useCompile();
|
|
121
|
+
var menu = /*#__PURE__*/React.createElement(Menu, null, inheritsCollections.map(function (option) {
|
|
122
|
+
return /*#__PURE__*/React.createElement(Menu.Item, {
|
|
123
|
+
key: option.name,
|
|
124
|
+
onClick: function onClick(info) {
|
|
125
|
+
setVisible(true);
|
|
126
|
+
setCurrentCollection(option.name);
|
|
127
|
+
}
|
|
128
|
+
}, compile(option.title));
|
|
129
|
+
}));
|
|
130
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
131
|
+
className: actionDesignerCss
|
|
132
|
+
}, /*#__PURE__*/React.createElement(ActionContext.Provider, {
|
|
133
|
+
value: _objectSpread(_objectSpread({}, ctx), {}, {
|
|
134
|
+
visible: visible,
|
|
135
|
+
setVisible: setVisible
|
|
136
|
+
})
|
|
137
|
+
}, (inheritsCollections === null || inheritsCollections === void 0 ? void 0 : inheritsCollections.length) > 0 ? /*#__PURE__*/React.createElement(Dropdown.Button, {
|
|
138
|
+
type: "primary",
|
|
139
|
+
icon: /*#__PURE__*/React.createElement(DownOutlined, null),
|
|
140
|
+
buttonsRender: function buttonsRender(_ref) {
|
|
141
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
142
|
+
leftButton = _ref2[0],
|
|
143
|
+
rightButton = _ref2[1];
|
|
144
|
+
|
|
145
|
+
return [leftButton, /*#__PURE__*/React.cloneElement(rightButton, {
|
|
146
|
+
loading: false
|
|
147
|
+
})];
|
|
148
|
+
},
|
|
149
|
+
overlay: menu,
|
|
150
|
+
onClick: function onClick(info) {
|
|
151
|
+
setVisible(true);
|
|
152
|
+
setCurrentCollection(collection.name);
|
|
153
|
+
}
|
|
154
|
+
}, /*#__PURE__*/React.createElement(PlusOutlined, null), props.children) : /*#__PURE__*/React.createElement(Button, {
|
|
155
|
+
type: 'primary',
|
|
156
|
+
icon: /*#__PURE__*/React.createElement(PlusOutlined, null),
|
|
157
|
+
onClick: function onClick(info) {
|
|
158
|
+
setVisible(true);
|
|
159
|
+
setCurrentCollection(collection.name);
|
|
160
|
+
}
|
|
161
|
+
}, props.children), /*#__PURE__*/React.createElement(CollectionProvider, {
|
|
162
|
+
name: currentCollection
|
|
163
|
+
}, /*#__PURE__*/React.createElement(RecursionField, {
|
|
164
|
+
schema: fieldSchema,
|
|
165
|
+
basePath: field.address,
|
|
166
|
+
onlyRenderProperties: true
|
|
167
|
+
}))));
|
|
168
|
+
}); // export const CreateRecordAction = observer((props: any) => {
|
|
169
|
+
// return (
|
|
170
|
+
// <Action {...props} component={CreateAction}>
|
|
171
|
+
// {props.children}
|
|
172
|
+
// </Action>
|
|
173
|
+
// );
|
|
174
|
+
// });
|
|
@@ -2,4 +2,5 @@ export * from './SchemaInitializer';
|
|
|
2
2
|
export * from './SchemaInitializerProvider';
|
|
3
3
|
export * from './types';
|
|
4
4
|
export * from './items';
|
|
5
|
-
export { gridRowColWrap, useRecordCollectionDataSourceItems } from './utils';
|
|
5
|
+
export { gridRowColWrap, useRecordCollectionDataSourceItems, createTableBlockSchema, useAssociatedTableColumnInitializerFields, useInheritsTableColumnInitializerFields, useTableColumnInitializerFields, itemsMerge, } from './utils';
|
|
6
|
+
export * from './buttons';
|
|
@@ -2,4 +2,5 @@ export * from './SchemaInitializer';
|
|
|
2
2
|
export * from './SchemaInitializerProvider';
|
|
3
3
|
export * from './types';
|
|
4
4
|
export * from './items';
|
|
5
|
-
export { gridRowColWrap, useRecordCollectionDataSourceItems } from './utils';
|
|
5
|
+
export { gridRowColWrap, useRecordCollectionDataSourceItems, createTableBlockSchema, useAssociatedTableColumnInitializerFields, useInheritsTableColumnInitializerFields, useTableColumnInitializerFields, itemsMerge } from './utils';
|
|
6
|
+
export * from './buttons';
|