@nocobase/client 0.7.0-alpha.82 → 0.7.1-alpha.4
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/.umirc.ts +24 -0
- package/es/antd-config-provider/index.js +5 -4
- package/es/api-client/APIClient.d.ts +2 -0
- package/es/api-client/APIClient.js +42 -2
- package/es/application/Application.d.ts +23 -0
- package/es/application/Application.js +176 -0
- package/es/application/index.d.ts +1 -0
- package/es/application/index.js +1 -0
- package/es/block-provider/BlockProvider.js +27 -11
- package/es/block-provider/TableBlockProvider.d.ts +2 -1
- package/es/block-provider/TableBlockProvider.js +90 -23
- package/es/block-provider/TableFieldProvider.d.ts +1 -0
- package/es/block-provider/TableFieldProvider.js +5 -2
- package/es/block-provider/hooks/index.d.ts +3 -0
- package/es/block-provider/hooks/index.js +307 -166
- package/es/collection-manager/CollectionField.js +8 -1
- package/es/collection-manager/Configuration/AddFieldAction.js +53 -24
- package/es/collection-manager/Configuration/AddSubFieldAction.js +3 -2
- package/es/collection-manager/Configuration/ConfigurationTable.js +32 -6
- package/es/collection-manager/Configuration/EditFieldAction.js +44 -15
- package/es/collection-manager/Configuration/EditSubFieldAction.js +3 -2
- package/es/collection-manager/Configuration/components/FieldSummary.d.ts +2 -0
- package/es/collection-manager/Configuration/components/FieldSummary.js +32 -0
- package/es/collection-manager/Configuration/components/index.d.ts +7 -0
- package/es/collection-manager/Configuration/components/index.js +121 -0
- package/es/collection-manager/Configuration/interfaces.js +1 -0
- package/es/collection-manager/Configuration/schemas/collectionFields.js +4 -0
- package/es/collection-manager/Configuration/schemas/collections.js +17 -1
- package/es/collection-manager/hooks/useCollectionManager.d.ts +2 -1
- package/es/collection-manager/hooks/useCollectionManager.js +42 -19
- package/es/collection-manager/index.d.ts +1 -0
- package/es/collection-manager/index.js +1 -0
- package/es/collection-manager/interfaces/attachment.js +1 -1
- package/es/collection-manager/interfaces/chinaRegion.js +2 -2
- package/es/collection-manager/interfaces/components/index.d.ts +6 -0
- package/es/collection-manager/interfaces/components/index.js +30 -0
- package/es/collection-manager/interfaces/datetime.js +10 -1
- package/es/collection-manager/interfaces/formula.d.ts +2 -0
- package/es/collection-manager/interfaces/formula.js +74 -0
- package/es/collection-manager/interfaces/index.d.ts +5 -0
- package/es/collection-manager/interfaces/index.js +6 -1
- package/es/collection-manager/interfaces/linkTo.js +12 -11
- package/es/collection-manager/interfaces/m2m.d.ts +2 -0
- package/es/collection-manager/interfaces/m2m.js +251 -0
- package/es/collection-manager/interfaces/m2o.d.ts +2 -0
- package/es/collection-manager/interfaces/m2o.js +174 -0
- package/es/collection-manager/interfaces/o2m.d.ts +2 -0
- package/es/collection-manager/interfaces/o2m.js +238 -0
- package/es/collection-manager/interfaces/o2o.d.ts +4 -0
- package/es/collection-manager/interfaces/o2o.js +518 -0
- package/es/collection-manager/interfaces/percent.js +7 -7
- package/es/collection-manager/interfaces/phone.js +4 -1
- package/es/collection-manager/interfaces/properties/index.d.ts +1 -0
- package/es/collection-manager/interfaces/properties/index.js +31 -2
- package/es/i18n/i18n.js +6 -6
- package/es/index.d.ts +1 -2
- package/es/index.js +1 -2
- package/es/locale/en_US.d.ts +293 -29
- package/es/locale/en_US.js +297 -34
- package/es/locale/index.d.ts +7 -751
- package/es/locale/index.js +20 -3
- package/es/locale/zh_CN.d.ts +107 -5
- package/es/locale/zh_CN.js +110 -7
- package/es/schema-component/antd/action/Action.Designer.js +34 -15
- package/es/schema-component/antd/action/Action.Drawer.js +1 -1
- package/es/schema-component/antd/action/utils.d.ts +2 -0
- package/es/schema-component/antd/action/utils.js +60 -0
- package/es/schema-component/antd/calendar/Calendar.Designer.js +5 -3
- package/es/schema-component/antd/cascader/Cascader.js +1 -1
- package/es/schema-component/antd/date-picker/ReadPretty.js +15 -5
- package/es/schema-component/antd/date-picker/util.d.ts +13 -1
- package/es/schema-component/antd/date-picker/util.js +110 -3
- package/es/schema-component/antd/filter/FilterItem.js +7 -7
- package/es/schema-component/antd/form-item/FormItem.js +80 -1
- package/es/schema-component/antd/form-v2/Form.Designer.js +20 -9
- package/es/schema-component/antd/form-v2/Form.js +2 -2
- package/es/schema-component/antd/formula-input/Compute.d.ts +3 -0
- package/es/schema-component/antd/formula-input/Compute.js +55 -0
- package/es/schema-component/antd/formula-input/FormulaInput.d.ts +3 -0
- package/es/schema-component/antd/formula-input/FormulaInput.js +173 -0
- package/es/schema-component/antd/formula-input/index.d.ts +1 -0
- package/es/schema-component/antd/formula-input/index.js +7 -0
- package/es/schema-component/antd/g2plot/G2Plot.d.ts +8 -0
- package/es/schema-component/antd/g2plot/G2Plot.js +123 -0
- package/es/schema-component/antd/g2plot/G2PlotDesigner.d.ts +1 -0
- package/es/schema-component/antd/g2plot/G2PlotDesigner.js +127 -0
- package/es/schema-component/antd/g2plot/index.d.ts +1 -0
- package/es/schema-component/antd/g2plot/index.js +1 -0
- package/es/schema-component/antd/grid/Grid.js +3 -3
- package/es/schema-component/antd/index.d.ts +3 -1
- package/es/schema-component/antd/index.js +3 -1
- package/es/schema-component/antd/input/EllipsisWithTooltip.d.ts +8 -1
- package/es/schema-component/antd/input/EllipsisWithTooltip.js +9 -3
- package/es/schema-component/antd/input/ReadPretty.js +5 -3
- package/es/schema-component/antd/kanban/Kanban.Card.Designer.js +1 -1
- package/es/schema-component/antd/kanban/Kanban.Designer.js +5 -3
- package/es/schema-component/antd/markdown/Markdown.d.ts +1 -0
- package/es/schema-component/antd/markdown/Markdown.js +3 -1
- package/es/schema-component/antd/markdown/style.less +4 -0
- package/es/schema-component/antd/percent/Percent.d.ts +2 -0
- package/es/{action-logs/ActionLogBlockInitializer.js → schema-component/antd/percent/Percent.js} +20 -25
- package/es/schema-component/antd/percent/index.d.ts +1 -0
- package/es/schema-component/antd/percent/index.js +1 -0
- package/es/schema-component/antd/record-picker/InputRecordPicker.js +7 -5
- package/es/schema-component/antd/record-picker/ReadPrettyRecordPicker.js +43 -26
- package/es/schema-component/antd/table-v2/Table.Column.Designer.js +18 -4
- package/es/schema-component/antd/table-v2/Table.js +16 -2
- package/es/schema-component/antd/table-v2/TableBlockDesigner.js +7 -4
- package/es/schema-initializer/SchemaInitializer.js +22 -16
- package/es/schema-initializer/SchemaInitializerProvider.d.ts +1 -0
- package/es/schema-initializer/SchemaInitializerProvider.js +1 -0
- package/es/schema-initializer/buttons/BlockInitializers.d.ts +184 -2
- package/es/schema-initializer/buttons/BlockInitializers.js +108 -2
- package/es/schema-initializer/buttons/CreateFormBlockInitializers.js +1 -1
- package/es/schema-initializer/buttons/FormActionInitializers.d.ts +84 -0
- package/es/schema-initializer/buttons/FormActionInitializers.js +66 -0
- package/es/schema-initializer/buttons/ReadPrettyFormActionInitializers.d.ts +28 -0
- package/es/schema-initializer/buttons/ReadPrettyFormActionInitializers.js +22 -0
- package/es/schema-initializer/buttons/RecordBlockInitializers.js +70 -5
- package/es/schema-initializer/buttons/RecordFormBlockInitializers.js +1 -1
- package/es/schema-initializer/buttons/TableActionColumnInitializers.js +21 -0
- package/es/schema-initializer/buttons/TableSelectorInitializers.js +1 -1
- package/es/schema-initializer/buttons/chart-config/area.d.ts +11 -0
- package/es/schema-initializer/buttons/chart-config/area.js +179 -0
- package/es/schema-initializer/buttons/chart-config/bar.d.ts +12 -0
- package/es/schema-initializer/buttons/chart-config/bar.js +24 -0
- package/es/schema-initializer/buttons/chart-config/column.d.ts +29 -0
- package/es/schema-initializer/buttons/chart-config/column.js +52 -0
- package/es/schema-initializer/buttons/chart-config/index.d.ts +5 -0
- package/es/schema-initializer/buttons/chart-config/index.js +5 -0
- package/es/schema-initializer/buttons/chart-config/line.d.ts +12 -0
- package/es/schema-initializer/buttons/chart-config/line.js +37 -0
- package/es/schema-initializer/buttons/chart-config/pie.d.ts +22 -0
- package/es/schema-initializer/buttons/chart-config/pie.js +37 -0
- package/es/schema-initializer/items/index.d.ts +5 -0
- package/es/schema-initializer/items/index.js +472 -46
- package/es/schema-initializer/utils.d.ts +6 -3
- package/es/schema-initializer/utils.js +23 -12
- package/es/schema-settings/SchemaSettings.js +114 -29
- package/es/schema-templates/SchemaTemplateManagerProvider.d.ts +1 -1
- package/es/schema-templates/SchemaTemplateManagerProvider.js +1 -0
- package/es/system-settings/SystemSettingsShortcut.js +19 -8
- package/es/user/ChangePassword.js +1 -0
- package/es/user/CurrentUser.js +25 -5
- package/es/user/EditProfile.js +1 -0
- package/es/user/LanguageSettings.js +24 -8
- package/es/user/SigninPage.d.ts +3 -0
- package/es/user/SigninPage.js +2 -4
- package/es/user/SignupPage.d.ts +3 -0
- package/es/user/SignupPage.js +2 -4
- package/es/user/SwitchRole.js +1 -0
- package/es/workflow/ExecutionResourceProvider.js +1 -1
- package/es/workflow/WorkflowCanvas.js +16 -15
- package/es/workflow/calculators.js +12 -6
- package/es/workflow/components/Duration.d.ts +5 -0
- package/es/workflow/components/Duration.js +61 -0
- package/es/workflow/nodes/condition.js +1 -1
- package/es/workflow/nodes/create.d.ts +3 -0
- package/es/workflow/nodes/delay.d.ts +35 -0
- package/es/workflow/nodes/delay.js +37 -0
- package/es/workflow/nodes/destroy.d.ts +3 -0
- package/es/workflow/nodes/index.d.ts +1 -1
- package/es/workflow/nodes/index.js +11 -8
- package/es/workflow/nodes/query.d.ts +3 -0
- package/es/workflow/nodes/update.d.ts +3 -0
- package/es/workflow/schemas/collection.d.ts +3 -0
- package/es/workflow/schemas/collection.js +4 -1
- package/es/workflow/schemas/executions.d.ts +15 -0
- package/es/workflow/schemas/executions.js +26 -1
- package/es/workflow/schemas/workflows.js +2 -2
- package/es/workflow/triggers/collection.d.ts +5 -0
- package/es/workflow/triggers/collection.js +13 -3
- package/es/workflow/triggers/index.d.ts +2 -2
- package/es/workflow/triggers/index.js +23 -11
- package/es/workflow/triggers/schedule/DateFieldsSelect.d.ts +2 -0
- package/es/workflow/triggers/schedule/DateFieldsSelect.js +39 -0
- package/es/workflow/triggers/schedule/EndsByField.d.ts +5 -0
- package/es/workflow/triggers/schedule/EndsByField.js +57 -0
- package/es/workflow/triggers/schedule/OnField.d.ts +5 -0
- package/es/workflow/triggers/schedule/OnField.js +87 -0
- package/es/workflow/triggers/schedule/RepeatField.d.ts +5 -0
- package/es/workflow/triggers/schedule/RepeatField.js +131 -0
- package/es/workflow/triggers/schedule/ScheduleConfig.d.ts +1 -0
- package/es/workflow/triggers/schedule/ScheduleConfig.js +225 -0
- package/es/workflow/triggers/schedule/index.d.ts +25 -0
- package/es/workflow/triggers/schedule/index.js +77 -0
- package/es/workflow/triggers/schedule/locale/Cron.zh-CN.d.ts +34 -0
- package/es/workflow/triggers/schedule/locale/Cron.zh-CN.js +37 -0
- package/lib/antd-config-provider/index.js +6 -6
- package/lib/api-client/APIClient.d.ts +2 -0
- package/lib/api-client/APIClient.js +46 -2
- package/lib/application/Application.d.ts +23 -0
- package/lib/application/Application.js +207 -0
- package/lib/application/index.d.ts +1 -0
- package/lib/application/index.js +13 -0
- package/lib/block-provider/BlockProvider.js +26 -10
- package/lib/block-provider/TableBlockProvider.d.ts +2 -1
- package/lib/block-provider/TableBlockProvider.js +94 -20
- package/lib/block-provider/TableFieldProvider.d.ts +1 -0
- package/lib/block-provider/TableFieldProvider.js +7 -3
- package/lib/block-provider/hooks/index.d.ts +3 -0
- package/lib/block-provider/hooks/index.js +316 -167
- package/lib/collection-manager/CollectionField.js +8 -1
- package/lib/collection-manager/Configuration/AddFieldAction.js +54 -24
- package/lib/collection-manager/Configuration/AddSubFieldAction.js +4 -2
- package/lib/collection-manager/Configuration/ConfigurationTable.js +34 -6
- package/lib/collection-manager/Configuration/EditFieldAction.js +44 -14
- package/lib/collection-manager/Configuration/EditSubFieldAction.js +4 -2
- package/lib/collection-manager/Configuration/components/FieldSummary.d.ts +2 -0
- package/lib/collection-manager/Configuration/components/FieldSummary.js +49 -0
- package/lib/collection-manager/Configuration/components/index.d.ts +7 -0
- package/lib/collection-manager/Configuration/components/index.js +142 -0
- package/lib/collection-manager/Configuration/interfaces.js +1 -0
- package/lib/collection-manager/Configuration/schemas/collectionFields.js +4 -0
- package/lib/collection-manager/Configuration/schemas/collections.js +18 -1
- package/lib/collection-manager/hooks/useCollectionManager.d.ts +2 -1
- package/lib/collection-manager/hooks/useCollectionManager.js +43 -20
- package/lib/collection-manager/index.d.ts +1 -0
- package/lib/collection-manager/index.js +28 -0
- package/lib/collection-manager/interfaces/attachment.js +1 -1
- package/lib/collection-manager/interfaces/chinaRegion.js +2 -2
- package/lib/collection-manager/interfaces/components/index.d.ts +6 -0
- package/lib/collection-manager/interfaces/components/index.js +58 -0
- package/lib/collection-manager/interfaces/datetime.js +10 -1
- package/lib/collection-manager/interfaces/formula.d.ts +2 -0
- package/lib/collection-manager/interfaces/formula.js +83 -0
- package/lib/collection-manager/interfaces/index.d.ts +5 -0
- package/lib/collection-manager/interfaces/index.js +65 -0
- package/lib/collection-manager/interfaces/linkTo.js +12 -11
- package/lib/collection-manager/interfaces/m2m.d.ts +2 -0
- package/lib/collection-manager/interfaces/m2m.js +262 -0
- package/lib/collection-manager/interfaces/m2o.d.ts +2 -0
- package/lib/collection-manager/interfaces/m2o.js +184 -0
- package/lib/collection-manager/interfaces/o2m.d.ts +2 -0
- package/lib/collection-manager/interfaces/o2m.js +247 -0
- package/lib/collection-manager/interfaces/o2o.d.ts +4 -0
- package/lib/collection-manager/interfaces/o2o.js +530 -0
- package/lib/collection-manager/interfaces/percent.js +7 -7
- package/lib/collection-manager/interfaces/phone.js +4 -1
- package/lib/collection-manager/interfaces/properties/index.d.ts +1 -0
- package/lib/collection-manager/interfaces/properties/index.js +34 -3
- package/lib/i18n/i18n.js +7 -7
- package/lib/index.d.ts +1 -2
- package/lib/index.js +2 -26
- package/lib/locale/en_US.d.ts +293 -29
- package/lib/locale/en_US.js +297 -34
- package/lib/locale/index.d.ts +7 -751
- package/lib/locale/index.js +26 -7
- package/lib/locale/zh_CN.d.ts +107 -5
- package/lib/locale/zh_CN.js +110 -7
- package/lib/schema-component/antd/action/Action.Designer.js +35 -16
- package/lib/schema-component/antd/action/Action.Drawer.js +1 -1
- package/lib/schema-component/antd/action/utils.d.ts +2 -0
- package/lib/schema-component/antd/action/utils.js +67 -0
- package/lib/schema-component/antd/calendar/Calendar.Designer.js +5 -3
- package/lib/schema-component/antd/cascader/Cascader.js +1 -1
- package/lib/schema-component/antd/date-picker/ReadPretty.js +13 -3
- package/lib/schema-component/antd/date-picker/util.d.ts +13 -1
- package/lib/schema-component/antd/date-picker/util.js +118 -4
- package/lib/schema-component/antd/filter/FilterItem.js +8 -7
- package/lib/schema-component/antd/form-item/FormItem.js +81 -1
- package/lib/schema-component/antd/form-v2/Form.Designer.js +20 -9
- package/lib/schema-component/antd/form-v2/Form.js +3 -3
- package/lib/schema-component/antd/formula-input/Compute.d.ts +3 -0
- package/lib/schema-component/antd/formula-input/Compute.js +79 -0
- package/lib/schema-component/antd/formula-input/FormulaInput.d.ts +3 -0
- package/lib/schema-component/antd/formula-input/FormulaInput.js +197 -0
- package/lib/schema-component/antd/formula-input/index.d.ts +1 -0
- package/lib/schema-component/antd/formula-input/index.js +18 -0
- package/lib/schema-component/antd/g2plot/G2Plot.d.ts +8 -0
- package/lib/schema-component/antd/g2plot/G2Plot.js +148 -0
- package/lib/schema-component/antd/g2plot/G2PlotDesigner.d.ts +1 -0
- package/lib/schema-component/antd/g2plot/G2PlotDesigner.js +145 -0
- package/lib/schema-component/antd/g2plot/index.d.ts +1 -0
- package/lib/schema-component/antd/{chart → g2plot}/index.js +4 -4
- package/lib/schema-component/antd/grid/Grid.js +3 -3
- package/lib/schema-component/antd/index.d.ts +3 -1
- package/lib/schema-component/antd/index.js +39 -13
- package/lib/schema-component/antd/input/EllipsisWithTooltip.d.ts +8 -1
- package/lib/schema-component/antd/input/EllipsisWithTooltip.js +8 -4
- package/lib/schema-component/antd/input/ReadPretty.js +5 -5
- package/lib/schema-component/antd/kanban/Kanban.Card.Designer.js +1 -1
- package/lib/schema-component/antd/kanban/Kanban.Designer.js +5 -3
- package/lib/schema-component/antd/markdown/Markdown.d.ts +1 -0
- package/lib/schema-component/antd/markdown/Markdown.js +4 -1
- package/lib/schema-component/antd/markdown/style.less +4 -0
- package/lib/schema-component/antd/percent/Percent.d.ts +2 -0
- package/lib/{action-logs/ActionLogProvider.js → schema-component/antd/percent/Percent.js} +29 -22
- package/lib/schema-component/antd/percent/index.d.ts +1 -0
- package/lib/{slate → schema-component/antd/percent}/index.js +4 -4
- package/lib/schema-component/antd/record-picker/InputRecordPicker.js +7 -5
- package/lib/schema-component/antd/record-picker/ReadPrettyRecordPicker.js +42 -25
- package/lib/schema-component/antd/table-v2/Table.Column.Designer.js +18 -4
- package/lib/schema-component/antd/table-v2/Table.js +16 -2
- package/lib/schema-component/antd/table-v2/TableBlockDesigner.js +7 -4
- package/lib/schema-initializer/SchemaInitializer.js +22 -16
- package/lib/schema-initializer/SchemaInitializerProvider.d.ts +1 -0
- package/lib/schema-initializer/SchemaInitializerProvider.js +3 -1
- package/lib/schema-initializer/buttons/BlockInitializers.d.ts +184 -2
- package/lib/schema-initializer/buttons/BlockInitializers.js +114 -1
- package/lib/schema-initializer/buttons/CreateFormBlockInitializers.js +1 -1
- package/lib/schema-initializer/buttons/FormActionInitializers.d.ts +84 -0
- package/lib/schema-initializer/buttons/FormActionInitializers.js +66 -0
- package/lib/schema-initializer/buttons/ReadPrettyFormActionInitializers.d.ts +28 -0
- package/lib/schema-initializer/buttons/ReadPrettyFormActionInitializers.js +22 -0
- package/lib/schema-initializer/buttons/RecordBlockInitializers.js +70 -5
- package/lib/schema-initializer/buttons/RecordFormBlockInitializers.js +1 -1
- package/lib/schema-initializer/buttons/TableActionColumnInitializers.js +21 -0
- package/lib/schema-initializer/buttons/TableSelectorInitializers.js +1 -1
- package/lib/schema-initializer/buttons/chart-config/area.d.ts +11 -0
- package/lib/schema-initializer/buttons/chart-config/area.js +186 -0
- package/lib/schema-initializer/buttons/chart-config/bar.d.ts +12 -0
- package/lib/schema-initializer/buttons/chart-config/bar.js +31 -0
- package/lib/schema-initializer/buttons/chart-config/column.d.ts +29 -0
- package/lib/schema-initializer/buttons/chart-config/column.js +59 -0
- package/lib/schema-initializer/buttons/chart-config/index.d.ts +5 -0
- package/lib/schema-initializer/buttons/chart-config/index.js +70 -0
- package/lib/schema-initializer/buttons/chart-config/line.d.ts +12 -0
- package/lib/schema-initializer/buttons/chart-config/line.js +44 -0
- package/lib/schema-initializer/buttons/chart-config/pie.d.ts +22 -0
- package/lib/schema-initializer/buttons/chart-config/pie.js +44 -0
- package/lib/schema-initializer/items/index.d.ts +5 -0
- package/lib/schema-initializer/items/index.js +488 -47
- package/lib/schema-initializer/utils.d.ts +6 -3
- package/lib/schema-initializer/utils.js +23 -12
- package/lib/schema-settings/SchemaSettings.js +113 -27
- package/lib/schema-templates/SchemaTemplateManagerProvider.d.ts +1 -1
- package/lib/schema-templates/SchemaTemplateManagerProvider.js +1 -0
- package/lib/system-settings/SystemSettingsShortcut.js +23 -8
- package/lib/user/ChangePassword.js +1 -0
- package/lib/user/CurrentUser.js +25 -5
- package/lib/user/EditProfile.js +1 -0
- package/lib/user/LanguageSettings.js +26 -7
- package/lib/user/SigninPage.d.ts +3 -0
- package/lib/user/SigninPage.js +4 -2
- package/lib/user/SignupPage.d.ts +3 -0
- package/lib/user/SignupPage.js +4 -2
- package/lib/user/SwitchRole.js +1 -0
- package/lib/workflow/ExecutionResourceProvider.js +1 -1
- package/lib/workflow/WorkflowCanvas.js +17 -14
- package/lib/workflow/calculators.js +12 -6
- package/lib/workflow/components/Duration.d.ts +5 -0
- package/lib/workflow/components/Duration.js +74 -0
- package/lib/workflow/nodes/condition.js +1 -1
- package/lib/workflow/nodes/create.d.ts +3 -0
- package/lib/workflow/nodes/delay.d.ts +35 -0
- package/lib/workflow/nodes/delay.js +48 -0
- package/lib/workflow/nodes/destroy.d.ts +3 -0
- package/lib/workflow/nodes/index.d.ts +1 -1
- package/lib/workflow/nodes/index.js +15 -11
- package/lib/workflow/nodes/query.d.ts +3 -0
- package/lib/workflow/nodes/update.d.ts +3 -0
- package/lib/workflow/schemas/collection.d.ts +3 -0
- package/lib/workflow/schemas/collection.js +4 -1
- package/lib/workflow/schemas/executions.d.ts +15 -0
- package/lib/workflow/schemas/executions.js +26 -1
- package/lib/workflow/schemas/workflows.js +2 -2
- package/lib/workflow/triggers/collection.d.ts +5 -0
- package/lib/workflow/triggers/collection.js +14 -3
- package/lib/workflow/triggers/index.d.ts +2 -2
- package/lib/workflow/triggers/index.js +32 -18
- package/lib/workflow/triggers/schedule/DateFieldsSelect.d.ts +2 -0
- package/lib/{action-logs/ActionLogBlockInitializer.js → workflow/triggers/schedule/DateFieldsSelect.js} +31 -25
- package/lib/workflow/triggers/schedule/EndsByField.d.ts +5 -0
- package/lib/workflow/triggers/schedule/EndsByField.js +73 -0
- package/lib/workflow/triggers/schedule/OnField.d.ts +5 -0
- package/lib/workflow/triggers/schedule/OnField.js +105 -0
- package/lib/workflow/triggers/schedule/RepeatField.d.ts +5 -0
- package/lib/workflow/triggers/schedule/RepeatField.js +146 -0
- package/lib/workflow/triggers/schedule/ScheduleConfig.d.ts +1 -0
- package/lib/workflow/triggers/schedule/ScheduleConfig.js +250 -0
- package/lib/workflow/triggers/schedule/index.d.ts +25 -0
- package/lib/workflow/triggers/schedule/index.js +94 -0
- package/lib/workflow/triggers/schedule/locale/Cron.zh-CN.d.ts +34 -0
- package/lib/workflow/triggers/schedule/locale/Cron.zh-CN.js +44 -0
- package/package.json +8 -7
- package/es/action-logs/ActionLog.Designer.d.ts +0 -1
- package/es/action-logs/ActionLog.Designer.js +0 -104
- package/es/action-logs/ActionLog.d.ts +0 -7
- package/es/action-logs/ActionLog.js +0 -63
- package/es/action-logs/ActionLogBlockInitializer.d.ts +0 -1
- package/es/action-logs/ActionLogProvider.d.ts +0 -1
- package/es/action-logs/ActionLogProvider.js +0 -24
- package/es/action-logs/index.d.ts +0 -3
- package/es/action-logs/index.js +0 -3
- package/es/action-logs/utils.d.ts +0 -363
- package/es/action-logs/utils.js +0 -313
- package/es/schema-component/antd/chart/Chart.d.ts +0 -1
- package/es/schema-component/antd/chart/Chart.js +0 -4
- package/es/schema-component/antd/chart/index.d.ts +0 -1
- package/es/schema-component/antd/chart/index.js +0 -1
- package/es/slate/RichText.d.ts +0 -1
- package/es/slate/RichText.js +0 -305
- package/es/slate/Slate.d.ts +0 -6
- package/es/slate/Slate.js +0 -40
- package/es/slate/components.d.ts +0 -20
- package/es/slate/components.js +0 -95
- package/es/slate/index.d.ts +0 -1
- package/es/slate/index.js +0 -1
- package/es/slate/index.less +0 -51
- package/es/slate/materialicons.woff2 +0 -0
- package/lib/action-logs/ActionLog.Designer.d.ts +0 -1
- package/lib/action-logs/ActionLog.Designer.js +0 -122
- package/lib/action-logs/ActionLog.d.ts +0 -7
- package/lib/action-logs/ActionLog.js +0 -80
- package/lib/action-logs/ActionLogBlockInitializer.d.ts +0 -1
- package/lib/action-logs/ActionLogProvider.d.ts +0 -1
- package/lib/action-logs/index.d.ts +0 -3
- package/lib/action-logs/index.js +0 -44
- package/lib/action-logs/utils.d.ts +0 -363
- package/lib/action-logs/utils.js +0 -323
- package/lib/schema-component/antd/chart/Chart.d.ts +0 -1
- package/lib/schema-component/antd/chart/Chart.js +0 -16
- package/lib/schema-component/antd/chart/index.d.ts +0 -1
- package/lib/slate/RichText.d.ts +0 -1
- package/lib/slate/RichText.js +0 -340
- package/lib/slate/Slate.d.ts +0 -6
- package/lib/slate/Slate.js +0 -56
- package/lib/slate/components.d.ts +0 -20
- package/lib/slate/components.js +0 -127
- package/lib/slate/index.d.ts +0 -1
- package/lib/slate/index.less +0 -51
- package/lib/slate/materialicons.woff2 +0 -0
- package/src/acl/ACLProvider.tsx +0 -167
- package/src/acl/ACLShortcut.tsx +0 -42
- package/src/acl/Configuration/MenuConfigure.tsx +0 -110
- package/src/acl/Configuration/RoleConfigure.tsx +0 -68
- package/src/acl/Configuration/RoleTable.tsx +0 -70
- package/src/acl/Configuration/RolesResourcesActions.tsx +0 -214
- package/src/acl/Configuration/ScopeSelect.tsx +0 -44
- package/src/acl/Configuration/StrategyActions.tsx +0 -117
- package/src/acl/Configuration/index.tsx +0 -6
- package/src/acl/Configuration/schemas/roleCollections.ts +0 -211
- package/src/acl/Configuration/schemas/roles.ts +0 -357
- package/src/acl/Configuration/schemas/scopes.ts +0 -358
- package/src/acl/Configuration/schemas/useRoleResourceValues.ts +0 -31
- package/src/acl/Configuration/schemas/useSaveRoleResourceAction.ts +0 -23
- package/src/acl/index.md +0 -12
- package/src/acl/index.tsx +0 -3
- package/src/action-logs/ActionLog.Designer.tsx +0 -86
- package/src/action-logs/ActionLog.tsx +0 -58
- package/src/action-logs/ActionLogBlockInitializer.tsx +0 -25
- package/src/action-logs/ActionLogProvider.tsx +0 -20
- package/src/action-logs/demos/demo1.tsx +0 -88
- package/src/action-logs/demos/mockData.ts +0 -285
- package/src/action-logs/index.md +0 -12
- package/src/action-logs/index.ts +0 -3
- package/src/action-logs/utils.ts +0 -303
- package/src/antd-config-provider/demos/demo1.tsx +0 -25
- package/src/antd-config-provider/index.md +0 -12
- package/src/antd-config-provider/index.tsx +0 -35
- package/src/api-client/APIClient.ts +0 -6
- package/src/api-client/APIClientProvider.tsx +0 -12
- package/src/api-client/__tests__/APIClient.test.tsx +0 -26
- package/src/api-client/context.ts +0 -4
- package/src/api-client/demos/demo1.tsx +0 -24
- package/src/api-client/demos/demo2.tsx +0 -23
- package/src/api-client/demos/demo3.tsx +0 -67
- package/src/api-client/hooks/assign.ts +0 -118
- package/src/api-client/hooks/index.ts +0 -4
- package/src/api-client/hooks/useAPIClient.ts +0 -6
- package/src/api-client/hooks/useRequest.ts +0 -63
- package/src/api-client/hooks/useResource.ts +0 -7
- package/src/api-client/index.md +0 -174
- package/src/api-client/index.tsx +0 -3
- package/src/application/__tests__/__snapshots__/compose.test.tsx.snap +0 -77
- package/src/application/__tests__/compose.test.tsx +0 -95
- package/src/application/compose.tsx +0 -18
- package/src/application/demos/demo1/Hello.tsx +0 -20
- package/src/application/demos/demo1/RouteSchemaComponent.tsx +0 -7
- package/src/application/demos/demo1/index.tsx +0 -23
- package/src/application/demos/demo1/routes.ts +0 -29
- package/src/application/demos/demo2/apiClient.ts +0 -10
- package/src/application/demos/demo2/index.tsx +0 -65
- package/src/application/demos/demo2/mock.ts +0 -198
- package/src/application/index.md +0 -14
- package/src/application/index.tsx +0 -1
- package/src/async-data-provider/demos/demo1.tsx +0 -22
- package/src/async-data-provider/demos/demo2.tsx +0 -50
- package/src/async-data-provider/demos/demo3.tsx +0 -85
- package/src/async-data-provider/index.md +0 -155
- package/src/async-data-provider/index.tsx +0 -25
- package/src/block-provider/BlockProvider.tsx +0 -193
- package/src/block-provider/BlockSchemaComponentProvider.tsx +0 -43
- package/src/block-provider/CalendarBlockProvider.tsx +0 -53
- package/src/block-provider/DetailsBlockProvider.tsx +0 -62
- package/src/block-provider/FormBlockProvider.tsx +0 -58
- package/src/block-provider/KanbanBlockProvider.tsx +0 -104
- package/src/block-provider/TableBlockProvider.tsx +0 -123
- package/src/block-provider/TableFieldProvider.tsx +0 -150
- package/src/block-provider/TableSelectorProvider.tsx +0 -100
- package/src/block-provider/hooks/index.ts +0 -333
- package/src/block-provider/index.tsx +0 -10
- package/src/board/Board.tsx +0 -294
- package/src/board/Card.tsx +0 -24
- package/src/board/CardAdder.tsx +0 -24
- package/src/board/CardForm.tsx +0 -44
- package/src/board/Column.tsx +0 -75
- package/src/board/ColumnAdder.tsx +0 -26
- package/src/board/ColumnForm.tsx +0 -27
- package/src/board/DefaultCard.tsx +0 -21
- package/src/board/DefaultColumnHeader.tsx +0 -72
- package/src/board/Kanban.tsx +0 -128
- package/src/board/demos/demo2.tsx +0 -122
- package/src/board/helpers.ts +0 -91
- package/src/board/index.md +0 -14
- package/src/board/index.ts +0 -2
- package/src/board/services.ts +0 -41
- package/src/board/style.less +0 -153
- package/src/board/utils.ts +0 -56
- package/src/board/withDroppable.tsx +0 -19
- package/src/china-region/index.tsx +0 -78
- package/src/collection-manager/CollectionField.tsx +0 -77
- package/src/collection-manager/CollectionFieldProvider.tsx +0 -19
- package/src/collection-manager/CollectionManagerProvider.tsx +0 -61
- package/src/collection-manager/CollectionManagerSchemaComponentProvider.tsx +0 -29
- package/src/collection-manager/CollectionManagerShortcut.tsx +0 -41
- package/src/collection-manager/CollectionProvider.tsx +0 -14
- package/src/collection-manager/Configuration/AddFieldAction.tsx +0 -148
- package/src/collection-manager/Configuration/AddSubFieldAction.tsx +0 -140
- package/src/collection-manager/Configuration/ConfigurationTable.tsx +0 -180
- package/src/collection-manager/Configuration/EditFieldAction.tsx +0 -120
- package/src/collection-manager/Configuration/EditSubFieldAction.tsx +0 -120
- package/src/collection-manager/Configuration/index.tsx +0 -4
- package/src/collection-manager/Configuration/interfaces.tsx +0 -48
- package/src/collection-manager/Configuration/schemas/collectionFields.ts +0 -204
- package/src/collection-manager/Configuration/schemas/collections.ts +0 -279
- package/src/collection-manager/ResourceActionProvider.tsx +0 -127
- package/src/collection-manager/action-hooks.ts +0 -325
- package/src/collection-manager/context.ts +0 -11
- package/src/collection-manager/demos/demo2.tsx +0 -124
- package/src/collection-manager/demos/demo3.tsx +0 -67
- package/src/collection-manager/demos/demo4.tsx +0 -164
- package/src/collection-manager/hooks/index.ts +0 -4
- package/src/collection-manager/hooks/useCollection.ts +0 -18
- package/src/collection-manager/hooks/useCollectionDataSource.ts +0 -17
- package/src/collection-manager/hooks/useCollectionField.ts +0 -24
- package/src/collection-manager/hooks/useCollectionManager.ts +0 -40
- package/src/collection-manager/index.md +0 -145
- package/src/collection-manager/index.tsx +0 -11
- package/src/collection-manager/interfaces/attachment.ts +0 -92
- package/src/collection-manager/interfaces/checkbox.ts +0 -24
- package/src/collection-manager/interfaces/checkboxGroup.ts +0 -27
- package/src/collection-manager/interfaces/chinaRegion.ts +0 -91
- package/src/collection-manager/interfaces/createdAt.ts +0 -30
- package/src/collection-manager/interfaces/createdBy.ts +0 -63
- package/src/collection-manager/interfaces/datetime.ts +0 -30
- package/src/collection-manager/interfaces/email.ts +0 -27
- package/src/collection-manager/interfaces/icon.ts +0 -22
- package/src/collection-manager/interfaces/id.ts +0 -47
- package/src/collection-manager/interfaces/index.ts +0 -27
- package/src/collection-manager/interfaces/input.ts +0 -32
- package/src/collection-manager/interfaces/linkTo.ts +0 -139
- package/src/collection-manager/interfaces/markdown.ts +0 -28
- package/src/collection-manager/interfaces/multipleSelect.ts +0 -31
- package/src/collection-manager/interfaces/number.ts +0 -45
- package/src/collection-manager/interfaces/password.ts +0 -22
- package/src/collection-manager/interfaces/percent.ts +0 -46
- package/src/collection-manager/interfaces/phone.ts +0 -27
- package/src/collection-manager/interfaces/properties/index.ts +0 -277
- package/src/collection-manager/interfaces/properties/operators.ts +0 -127
- package/src/collection-manager/interfaces/radioGroup.ts +0 -27
- package/src/collection-manager/interfaces/richText.ts +0 -29
- package/src/collection-manager/interfaces/select.ts +0 -28
- package/src/collection-manager/interfaces/subTable.ts +0 -209
- package/src/collection-manager/interfaces/textarea.ts +0 -29
- package/src/collection-manager/interfaces/time.ts +0 -42
- package/src/collection-manager/interfaces/types.ts +0 -14
- package/src/collection-manager/interfaces/updatedAt.ts +0 -30
- package/src/collection-manager/interfaces/updatedBy.ts +0 -62
- package/src/collection-manager/sub-table.tsx +0 -273
- package/src/collection-manager/types.ts +0 -38
- package/src/document-title/index.md +0 -21
- package/src/document-title/index.tsx +0 -54
- package/src/file-manager/FileStorageShortcut.tsx +0 -40
- package/src/file-manager/StorageOptions.tsx +0 -106
- package/src/file-manager/index.ts +0 -1
- package/src/file-manager/schemas/storage.ts +0 -348
- package/src/global.less +0 -27
- package/src/i18n/i18n.ts +0 -37
- package/src/i18n/index.md +0 -10
- package/src/i18n/index.ts +0 -1
- package/src/icon/Icon.tsx +0 -61
- package/src/icon/index.md +0 -76
- package/src/icon/index.ts +0 -1
- package/src/index.tsx +0 -30
- package/src/locale/en_US.ts +0 -305
- package/src/locale/index.ts +0 -15
- package/src/locale/zh_CN.ts +0 -512
- package/src/plugin-manager/PluginManager.tsx +0 -122
- package/src/plugin-manager/PluginManagerProvider.tsx +0 -7
- package/src/plugin-manager/context.ts +0 -3
- package/src/plugin-manager/demos/demo1.tsx +0 -34
- package/src/plugin-manager/demos/plugins/index.tsx +0 -5
- package/src/plugin-manager/demos/plugins/plugin1.tsx +0 -16
- package/src/plugin-manager/demos/plugins/plugin2.tsx +0 -65
- package/src/plugin-manager/demos/plugins/plugin3.tsx +0 -17
- package/src/plugin-manager/demos/plugins/plugin4.tsx +0 -65
- package/src/plugin-manager/demos/plugins/plugin5.tsx +0 -17
- package/src/plugin-manager/index.md +0 -59
- package/src/plugin-manager/index.ts +0 -3
- package/src/powered-by/index.tsx +0 -27
- package/src/record-provider/index.md +0 -30
- package/src/record-provider/index.tsx +0 -33
- package/src/route-switch/RouteSwitch.tsx +0 -59
- package/src/route-switch/RouteSwitchProvider.tsx +0 -20
- package/src/route-switch/__tests__/RouteSwitch.test.tsx +0 -33
- package/src/route-switch/__tests__/__snapshots__/RouteSwitch.test.tsx.snap +0 -9
- package/src/route-switch/antd/admin-layout/index.md +0 -27
- package/src/route-switch/antd/admin-layout/index.tsx +0 -206
- package/src/route-switch/antd/auth-layout/index.md +0 -9
- package/src/route-switch/antd/auth-layout/index.tsx +0 -31
- package/src/route-switch/antd/index.ts +0 -4
- package/src/route-switch/antd/route-schema-component/index.tsx +0 -8
- package/src/route-switch/context.ts +0 -9
- package/src/route-switch/demos/demo1.tsx +0 -31
- package/src/route-switch/hooks.ts +0 -23
- package/src/route-switch/index.md +0 -10
- package/src/route-switch/index.tsx +0 -7
- package/src/route-switch/types.ts +0 -34
- package/src/schema-component/antd/AntdSchemaComponentProvider.tsx +0 -10
- package/src/schema-component/antd/action/Action.Container.tsx +0 -26
- package/src/schema-component/antd/action/Action.Designer.tsx +0 -301
- package/src/schema-component/antd/action/Action.Drawer.tsx +0 -105
- package/src/schema-component/antd/action/Action.Link.tsx +0 -8
- package/src/schema-component/antd/action/Action.Modal.tsx +0 -94
- package/src/schema-component/antd/action/Action.Page.tsx +0 -74
- package/src/schema-component/antd/action/Action.Popover.tsx +0 -0
- package/src/schema-component/antd/action/Action.tsx +0 -178
- package/src/schema-component/antd/action/ActionBar.tsx +0 -52
- package/src/schema-component/antd/action/context.tsx +0 -13
- package/src/schema-component/antd/action/demos/demo1.tsx +0 -65
- package/src/schema-component/antd/action/demos/demo2.tsx +0 -66
- package/src/schema-component/antd/action/demos/demo3.tsx +0 -107
- package/src/schema-component/antd/action/demos/demo4.tsx +0 -53
- package/src/schema-component/antd/action/hooks.ts +0 -53
- package/src/schema-component/antd/action/index.md +0 -42
- package/src/schema-component/antd/action/index.tsx +0 -5
- package/src/schema-component/antd/action/types.ts +0 -17
- package/src/schema-component/antd/block-item/BlockItem.tsx +0 -63
- package/src/schema-component/antd/block-item/TestDesigner.tsx +0 -19
- package/src/schema-component/antd/block-item/demos/demo1.tsx +0 -46
- package/src/schema-component/antd/block-item/index.md +0 -12
- package/src/schema-component/antd/block-item/index.tsx +0 -3
- package/src/schema-component/antd/calendar/Calendar.Designer.tsx +0 -142
- package/src/schema-component/antd/calendar/Calendar.tsx +0 -156
- package/src/schema-component/antd/calendar/Event.tsx +0 -6
- package/src/schema-component/antd/calendar/Nav.tsx +0 -19
- package/src/schema-component/antd/calendar/Title.tsx +0 -15
- package/src/schema-component/antd/calendar/Today.tsx +0 -23
- package/src/schema-component/antd/calendar/ViewSelect.tsx +0 -25
- package/src/schema-component/antd/calendar/context.ts +0 -5
- package/src/schema-component/antd/calendar/demos/collections.ts +0 -1321
- package/src/schema-component/antd/calendar/demos/data.ts +0 -131
- package/src/schema-component/antd/calendar/demos/defaultValues.ts +0 -180
- package/src/schema-component/antd/calendar/demos/demo1.tsx +0 -67
- package/src/schema-component/antd/calendar/demos/demo2.tsx +0 -117
- package/src/schema-component/antd/calendar/index.md +0 -18
- package/src/schema-component/antd/calendar/index.ts +0 -21
- package/src/schema-component/antd/calendar/style.less +0 -767
- package/src/schema-component/antd/calendar/types.d.ts +0 -8
- package/src/schema-component/antd/calendar/utils.ts +0 -13
- package/src/schema-component/antd/card-item/CardItem.tsx +0 -13
- package/src/schema-component/antd/card-item/index.md +0 -10
- package/src/schema-component/antd/card-item/index.ts +0 -1
- package/src/schema-component/antd/cascader/Cascader.tsx +0 -99
- package/src/schema-component/antd/cascader/ReadPretty.tsx +0 -35
- package/src/schema-component/antd/cascader/defaultFieldNames.ts +0 -5
- package/src/schema-component/antd/cascader/demos/demo1.tsx +0 -83
- package/src/schema-component/antd/cascader/demos/demo2.tsx +0 -130
- package/src/schema-component/antd/cascader/index.md +0 -37
- package/src/schema-component/antd/cascader/index.ts +0 -1
- package/src/schema-component/antd/chart/Chart.tsx +0 -5
- package/src/schema-component/antd/chart/index.md +0 -8
- package/src/schema-component/antd/chart/index.ts +0 -1
- package/src/schema-component/antd/checkbox/Checkbox.tsx +0 -65
- package/src/schema-component/antd/checkbox/demos/demo1.tsx +0 -41
- package/src/schema-component/antd/checkbox/demos/demo2.tsx +0 -56
- package/src/schema-component/antd/checkbox/index.md +0 -18
- package/src/schema-component/antd/checkbox/index.ts +0 -1
- package/src/schema-component/antd/color-select/ColorSelect.tsx +0 -51
- package/src/schema-component/antd/color-select/demos/demo1.tsx +0 -41
- package/src/schema-component/antd/color-select/index.md +0 -14
- package/src/schema-component/antd/color-select/index.ts +0 -1
- package/src/schema-component/antd/date-picker/DatePicker.tsx +0 -27
- package/src/schema-component/antd/date-picker/ReadPretty.tsx +0 -43
- package/src/schema-component/antd/date-picker/demos/demo1.tsx +0 -49
- package/src/schema-component/antd/date-picker/demos/demo2.tsx +0 -41
- package/src/schema-component/antd/date-picker/index.md +0 -25
- package/src/schema-component/antd/date-picker/index.ts +0 -1
- package/src/schema-component/antd/date-picker/util.ts +0 -42
- package/src/schema-component/antd/filter/DynamicComponent.tsx +0 -56
- package/src/schema-component/antd/filter/Filter.Action.Designer.tsx +0 -120
- package/src/schema-component/antd/filter/Filter.tsx +0 -42
- package/src/schema-component/antd/filter/FilterAction.tsx +0 -121
- package/src/schema-component/antd/filter/FilterGroup.tsx +0 -103
- package/src/schema-component/antd/filter/FilterItem.tsx +0 -57
- package/src/schema-component/antd/filter/FilterItems.tsx +0 -21
- package/src/schema-component/antd/filter/SaveDefaultValue.tsx +0 -43
- package/src/schema-component/antd/filter/context.ts +0 -14
- package/src/schema-component/antd/filter/demos/demo2.tsx +0 -101
- package/src/schema-component/antd/filter/demos/demo3.tsx +0 -180
- package/src/schema-component/antd/filter/demos/demo4.tsx +0 -170
- package/src/schema-component/antd/filter/demos/demo5.tsx +0 -104
- package/src/schema-component/antd/filter/demos/demo6.tsx +0 -105
- package/src/schema-component/antd/filter/index.md +0 -30
- package/src/schema-component/antd/filter/index.ts +0 -3
- package/src/schema-component/antd/filter/style.less +0 -18
- package/src/schema-component/antd/filter/useFilterActionProps.ts +0 -120
- package/src/schema-component/antd/filter/useValues.ts +0 -83
- package/src/schema-component/antd/form/Form.Designer.tsx +0 -19
- package/src/schema-component/antd/form/Form.tsx +0 -125
- package/src/schema-component/antd/form/demos/apiClient.ts +0 -21
- package/src/schema-component/antd/form/demos/demo1.tsx +0 -62
- package/src/schema-component/antd/form/demos/demo2.tsx +0 -61
- package/src/schema-component/antd/form/demos/demo3.tsx +0 -60
- package/src/schema-component/antd/form/demos/demo4.tsx +0 -67
- package/src/schema-component/antd/form/demos/demo5.tsx +0 -106
- package/src/schema-component/antd/form/demos/demo6.tsx +0 -61
- package/src/schema-component/antd/form/demos/demo7.tsx +0 -68
- package/src/schema-component/antd/form/demos/demo8.tsx +0 -85
- package/src/schema-component/antd/form/index.md +0 -54
- package/src/schema-component/antd/form/index.tsx +0 -1
- package/src/schema-component/antd/form-item/FormItem.tsx +0 -213
- package/src/schema-component/antd/form-item/index.md +0 -10
- package/src/schema-component/antd/form-item/index.tsx +0 -1
- package/src/schema-component/antd/form-v2/Form.Designer.tsx +0 -217
- package/src/schema-component/antd/form-v2/Form.tsx +0 -106
- package/src/schema-component/antd/form-v2/demos/collections.ts +0 -1321
- package/src/schema-component/antd/form-v2/demos/demo1.tsx +0 -83
- package/src/schema-component/antd/form-v2/demos/demo2.tsx +0 -103
- package/src/schema-component/antd/form-v2/demos/demo3.tsx +0 -103
- package/src/schema-component/antd/form-v2/index.md +0 -30
- package/src/schema-component/antd/form-v2/index.ts +0 -7
- package/src/schema-component/antd/grid/Block.tsx +0 -13
- package/src/schema-component/antd/grid/Grid.tsx +0 -247
- package/src/schema-component/antd/grid/demos/demo1.tsx +0 -162
- package/src/schema-component/antd/grid/demos/demo2.tsx +0 -73
- package/src/schema-component/antd/grid/demos/demo3.tsx +0 -47
- package/src/schema-component/antd/grid/index.md +0 -14
- package/src/schema-component/antd/grid/index.tsx +0 -3
- package/src/schema-component/antd/icon-picker/IconPicker.tsx +0 -79
- package/src/schema-component/antd/icon-picker/demos/demo1.tsx +0 -41
- package/src/schema-component/antd/icon-picker/index.md +0 -14
- package/src/schema-component/antd/icon-picker/index.ts +0 -1
- package/src/schema-component/antd/index.less +0 -4
- package/src/schema-component/antd/index.ts +0 -35
- package/src/schema-component/antd/input/EllipsisWithTooltip.tsx +0 -47
- package/src/schema-component/antd/input/Input.tsx +0 -39
- package/src/schema-component/antd/input/ReadPretty.tsx +0 -116
- package/src/schema-component/antd/input/demos/demo1.tsx +0 -41
- package/src/schema-component/antd/input/demos/demo2.tsx +0 -66
- package/src/schema-component/antd/input/demos/demo3.tsx +0 -43
- package/src/schema-component/antd/input/index.md +0 -28
- package/src/schema-component/antd/input/index.ts +0 -2
- package/src/schema-component/antd/input/shared.ts +0 -7
- package/src/schema-component/antd/input-number/InputNumber.tsx +0 -8
- package/src/schema-component/antd/input-number/ReadPretty.tsx +0 -21
- package/src/schema-component/antd/input-number/demos/demo1.tsx +0 -41
- package/src/schema-component/antd/input-number/demos/demo2.tsx +0 -49
- package/src/schema-component/antd/input-number/demos/demo3.tsx +0 -51
- package/src/schema-component/antd/input-number/index.md +0 -22
- package/src/schema-component/antd/input-number/index.ts +0 -1
- package/src/schema-component/antd/kanban/Kanban.Card.Designer.tsx +0 -103
- package/src/schema-component/antd/kanban/Kanban.Card.tsx +0 -98
- package/src/schema-component/antd/kanban/Kanban.CardViewer.tsx +0 -5
- package/src/schema-component/antd/kanban/Kanban.Designer.tsx +0 -64
- package/src/schema-component/antd/kanban/Kanban.tsx +0 -146
- package/src/schema-component/antd/kanban/context.ts +0 -4
- package/src/schema-component/antd/kanban/demos/collections.ts +0 -1321
- package/src/schema-component/antd/kanban/demos/data.ts +0 -2145
- package/src/schema-component/antd/kanban/demos/demo1.tsx +0 -92
- package/src/schema-component/antd/kanban/index.less +0 -16
- package/src/schema-component/antd/kanban/index.md +0 -12
- package/src/schema-component/antd/kanban/index.ts +0 -16
- package/src/schema-component/antd/markdown/Markdown.Void.Designer.tsx +0 -26
- package/src/schema-component/antd/markdown/Markdown.Void.tsx +0 -78
- package/src/schema-component/antd/markdown/Markdown.tsx +0 -30
- package/src/schema-component/antd/markdown/demos/demo1.tsx +0 -41
- package/src/schema-component/antd/markdown/demos/demo2.tsx +0 -51
- package/src/schema-component/antd/markdown/index.md +0 -18
- package/src/schema-component/antd/markdown/index.ts +0 -1
- package/src/schema-component/antd/markdown/style.less +0 -12
- package/src/schema-component/antd/markdown/util.ts +0 -16
- package/src/schema-component/antd/menu/Menu.Designer.tsx +0 -342
- package/src/schema-component/antd/menu/Menu.tsx +0 -433
- package/src/schema-component/antd/menu/MenuItemInitializers/index.tsx +0 -229
- package/src/schema-component/antd/menu/demos/demo1.tsx +0 -93
- package/src/schema-component/antd/menu/demos/demo2.tsx +0 -93
- package/src/schema-component/antd/menu/demos/demo3.tsx +0 -118
- package/src/schema-component/antd/menu/index.md +0 -27
- package/src/schema-component/antd/menu/index.ts +0 -4
- package/src/schema-component/antd/menu/util.ts +0 -53
- package/src/schema-component/antd/page/Page.tsx +0 -21
- package/src/schema-component/antd/page/demos/demo1.tsx +0 -31
- package/src/schema-component/antd/page/index.md +0 -12
- package/src/schema-component/antd/page/index.ts +0 -1
- package/src/schema-component/antd/pagination/index.tsx +0 -12
- package/src/schema-component/antd/password/Password.tsx +0 -69
- package/src/schema-component/antd/password/PasswordStrength.tsx +0 -162
- package/src/schema-component/antd/password/demos/demo1.tsx +0 -41
- package/src/schema-component/antd/password/demos/demo2.tsx +0 -45
- package/src/schema-component/antd/password/index.md +0 -24
- package/src/schema-component/antd/password/index.ts +0 -1
- package/src/schema-component/antd/radio/Radio.tsx +0 -47
- package/src/schema-component/antd/radio/demos/demo1.tsx +0 -42
- package/src/schema-component/antd/radio/demos/demo2.tsx +0 -55
- package/src/schema-component/antd/radio/demos/demo3.tsx +0 -56
- package/src/schema-component/antd/radio/index.md +0 -22
- package/src/schema-component/antd/radio/index.ts +0 -1
- package/src/schema-component/antd/record-picker/InputRecordPicker.tsx +0 -112
- package/src/schema-component/antd/record-picker/ReadPrettyRecordPicker.tsx +0 -56
- package/src/schema-component/antd/record-picker/RecordPicker.tsx +0 -9
- package/src/schema-component/antd/record-picker/demos/demo1.tsx +0 -125
- package/src/schema-component/antd/record-picker/index.md +0 -82
- package/src/schema-component/antd/record-picker/index.tsx +0 -8
- package/src/schema-component/antd/record-picker/useFieldNames.ts +0 -7
- package/src/schema-component/antd/rich-text/RichText.tsx +0 -42
- package/src/schema-component/antd/rich-text/demos/demo1.tsx +0 -39
- package/src/schema-component/antd/rich-text/index.md +0 -12
- package/src/schema-component/antd/rich-text/index.ts +0 -1
- package/src/schema-component/antd/rich-text/style.less +0 -950
- package/src/schema-component/antd/select/ReadPretty.tsx +0 -33
- package/src/schema-component/antd/select/Select.tsx +0 -83
- package/src/schema-component/antd/select/demos/demo1.tsx +0 -60
- package/src/schema-component/antd/select/demos/demo2.tsx +0 -64
- package/src/schema-component/antd/select/demos/demo3.tsx +0 -77
- package/src/schema-component/antd/select/index.md +0 -38
- package/src/schema-component/antd/select/index.ts +0 -1
- package/src/schema-component/antd/select/shared.ts +0 -26
- package/src/schema-component/antd/space/index.tsx +0 -18
- package/src/schema-component/antd/table/Table.Array.Designer.tsx +0 -15
- package/src/schema-component/antd/table/Table.Array.tsx +0 -277
- package/src/schema-component/antd/table/Table.Column.ActionBar.tsx +0 -53
- package/src/schema-component/antd/table/Table.Column.Decorator.tsx +0 -59
- package/src/schema-component/antd/table/Table.Column.Designer.tsx +0 -147
- package/src/schema-component/antd/table/Table.Column.tsx +0 -7
- package/src/schema-component/antd/table/Table.Designer.tsx +0 -17
- package/src/schema-component/antd/table/Table.RowActionDesigner.tsx +0 -23
- package/src/schema-component/antd/table/Table.RowSelection.tsx +0 -28
- package/src/schema-component/antd/table/Table.Void.Designer.tsx +0 -208
- package/src/schema-component/antd/table/Table.Void.tsx +0 -118
- package/src/schema-component/antd/table/demos/demo1.tsx +0 -47
- package/src/schema-component/antd/table/demos/demo2.tsx +0 -47
- package/src/schema-component/antd/table/demos/demo3.tsx +0 -47
- package/src/schema-component/antd/table/demos/demo4.tsx +0 -228
- package/src/schema-component/antd/table/index.md +0 -29
- package/src/schema-component/antd/table/index.tsx +0 -27
- package/src/schema-component/antd/table-v2/Table.ActionColumnDesigner.tsx +0 -23
- package/src/schema-component/antd/table-v2/Table.Column.ActionBar.tsx +0 -53
- package/src/schema-component/antd/table-v2/Table.Column.Decorator.tsx +0 -59
- package/src/schema-component/antd/table-v2/Table.Column.Designer.tsx +0 -106
- package/src/schema-component/antd/table-v2/Table.Column.tsx +0 -7
- package/src/schema-component/antd/table-v2/Table.Designer.tsx +0 -17
- package/src/schema-component/antd/table-v2/Table.tsx +0 -283
- package/src/schema-component/antd/table-v2/TableBlockDesigner.tsx +0 -213
- package/src/schema-component/antd/table-v2/TableField.tsx +0 -27
- package/src/schema-component/antd/table-v2/TableSelector.tsx +0 -3
- package/src/schema-component/antd/table-v2/TableSelectorDesigner.tsx +0 -196
- package/src/schema-component/antd/table-v2/demos/collections.ts +0 -1321
- package/src/schema-component/antd/table-v2/demos/data.ts +0 -0
- package/src/schema-component/antd/table-v2/demos/demo1.tsx +0 -220
- package/src/schema-component/antd/table-v2/demos/demo2.tsx +0 -192
- package/src/schema-component/antd/table-v2/index.md +0 -16
- package/src/schema-component/antd/table-v2/index.ts +0 -20
- package/src/schema-component/antd/tabs/Tabs.Designer.tsx +0 -49
- package/src/schema-component/antd/tabs/Tabs.tsx +0 -91
- package/src/schema-component/antd/tabs/demos/demo1.tsx +0 -56
- package/src/schema-component/antd/tabs/index.md +0 -15
- package/src/schema-component/antd/tabs/index.ts +0 -1
- package/src/schema-component/antd/time-picker/ReadPretty.tsx +0 -19
- package/src/schema-component/antd/time-picker/TimePicker.tsx +0 -37
- package/src/schema-component/antd/time-picker/demos/demo1.tsx +0 -41
- package/src/schema-component/antd/time-picker/demos/demo2.tsx +0 -42
- package/src/schema-component/antd/time-picker/index.md +0 -18
- package/src/schema-component/antd/time-picker/index.ts +0 -1
- package/src/schema-component/antd/tree-select/ReadPretty.tsx +0 -56
- package/src/schema-component/antd/tree-select/TreeSelect.tsx +0 -23
- package/src/schema-component/antd/tree-select/demos/demo1.tsx +0 -85
- package/src/schema-component/antd/tree-select/index.md +0 -14
- package/src/schema-component/antd/tree-select/index.ts +0 -1
- package/src/schema-component/antd/upload/ReadPretty.tsx +0 -146
- package/src/schema-component/antd/upload/Upload.tsx +0 -209
- package/src/schema-component/antd/upload/demos/apiClient.ts +0 -43
- package/src/schema-component/antd/upload/demos/demo1.tsx +0 -51
- package/src/schema-component/antd/upload/demos/demo2.tsx +0 -115
- package/src/schema-component/antd/upload/index.md +0 -18
- package/src/schema-component/antd/upload/index.ts +0 -1
- package/src/schema-component/antd/upload/placeholder.ts +0 -62
- package/src/schema-component/antd/upload/shared.ts +0 -227
- package/src/schema-component/antd/upload/style.less +0 -61
- package/src/schema-component/antd/upload/type.d.ts +0 -26
- package/src/schema-component/common/dnd-context/index.md +0 -8
- package/src/schema-component/common/dnd-context/index.tsx +0 -74
- package/src/schema-component/common/index.ts +0 -3
- package/src/schema-component/common/sortable-item/SortableItem.tsx +0 -91
- package/src/schema-component/common/sortable-item/index.md +0 -9
- package/src/schema-component/common/sortable-item/index.ts +0 -1
- package/src/schema-component/context.ts +0 -4
- package/src/schema-component/core/DesignableSwitch.tsx +0 -25
- package/src/schema-component/core/FormProvider.tsx +0 -24
- package/src/schema-component/core/RemoteSchemaComponent.tsx +0 -64
- package/src/schema-component/core/SchemaComponent.tsx +0 -45
- package/src/schema-component/core/SchemaComponentOptions.tsx +0 -16
- package/src/schema-component/core/SchemaComponentProvider.tsx +0 -64
- package/src/schema-component/core/index.tsx +0 -7
- package/src/schema-component/demos/demo1.tsx +0 -83
- package/src/schema-component/demos/demo3.tsx +0 -65
- package/src/schema-component/hooks/__tests__/designable.test.ts +0 -491
- package/src/schema-component/hooks/__tests__/splitWrapSchema.test.ts +0 -87
- package/src/schema-component/hooks/index.ts +0 -8
- package/src/schema-component/hooks/useAttach.ts +0 -21
- package/src/schema-component/hooks/useCompile.ts +0 -13
- package/src/schema-component/hooks/useComponent.ts +0 -14
- package/src/schema-component/hooks/useDesignable.tsx +0 -589
- package/src/schema-component/hooks/useDesigner.ts +0 -11
- package/src/schema-component/hooks/useFieldProps.ts +0 -18
- package/src/schema-component/hooks/useProps.ts +0 -16
- package/src/schema-component/hooks/useSchemaComponentContext.ts +0 -6
- package/src/schema-component/index.md +0 -133
- package/src/schema-component/index.tsx +0 -7
- package/src/schema-component/types.ts +0 -34
- package/src/schema-initializer/SchemaInitializer.tsx +0 -224
- package/src/schema-initializer/SchemaInitializerProvider.tsx +0 -58
- package/src/schema-initializer/buttons/BlockInitializers.tsx +0 -60
- package/src/schema-initializer/buttons/CalendarActionInitializers.tsx +0 -79
- package/src/schema-initializer/buttons/CreateFormBlockInitializers.tsx +0 -42
- package/src/schema-initializer/buttons/CustomFormItemInitializers.tsx +0 -26
- package/src/schema-initializer/buttons/DetailsActionInitializers.tsx +0 -37
- package/src/schema-initializer/buttons/FormActionInitializers.tsx +0 -321
- package/src/schema-initializer/buttons/FormItemInitializers.tsx +0 -44
- package/src/schema-initializer/buttons/KanbanActionInitializers.tsx +0 -35
- package/src/schema-initializer/buttons/KanbanCardFormItemInitializers.tsx +0 -0
- package/src/schema-initializer/buttons/ReadPrettyFormActionInitializers.tsx +0 -119
- package/src/schema-initializer/buttons/ReadPrettyFormItemInitializers.tsx +0 -43
- package/src/schema-initializer/buttons/RecordBlockInitializers.tsx +0 -70
- package/src/schema-initializer/buttons/RecordFormBlockInitializers.tsx +0 -39
- package/src/schema-initializer/buttons/SubTableActionInitializers.tsx +0 -39
- package/src/schema-initializer/buttons/TabPaneInitializers.tsx +0 -106
- package/src/schema-initializer/buttons/TableActionColumnInitializers.tsx +0 -158
- package/src/schema-initializer/buttons/TableActionInitializers.tsx +0 -48
- package/src/schema-initializer/buttons/TableColumnInitializers.tsx +0 -52
- package/src/schema-initializer/buttons/TableSelectorInitializers.tsx +0 -50
- package/src/schema-initializer/buttons/index.ts +0 -18
- package/src/schema-initializer/components/assigned-field/AssignedField.tsx +0 -70
- package/src/schema-initializer/components/assigned-field/index.ts +0 -1
- package/src/schema-initializer/components/index.ts +0 -1
- package/src/schema-initializer/demos/demo1.tsx +0 -123
- package/src/schema-initializer/demos/demo2.tsx +0 -77
- package/src/schema-initializer/demos/demo3.tsx +0 -125
- package/src/schema-initializer/demos/demo4.tsx +0 -130
- package/src/schema-initializer/index.md +0 -121
- package/src/schema-initializer/index.ts +0 -4
- package/src/schema-initializer/items/index.tsx +0 -774
- package/src/schema-initializer/types.ts +0 -73
- package/src/schema-initializer/utils.ts +0 -835
- package/src/schema-settings/GeneralSchemaDesigner.tsx +0 -88
- package/src/schema-settings/SchemaSettings.tsx +0 -572
- package/src/schema-settings/index.ts +0 -3
- package/src/schema-templates/BlockTemplate.tsx +0 -26
- package/src/schema-templates/BlockTemplateDetails.tsx +0 -91
- package/src/schema-templates/BlockTemplatePage.tsx +0 -21
- package/src/schema-templates/SchemaTemplateManagerProvider.tsx +0 -154
- package/src/schema-templates/SchemaTemplateShortcut.tsx +0 -19
- package/src/schema-templates/collections/uiSchemaTemplates.ts +0 -20
- package/src/schema-templates/index.ts +0 -5
- package/src/schema-templates/schemas/uiSchemaTemplates.ts +0 -223
- package/src/settings-form/SettingsForm.tsx +0 -269
- package/src/settings-form/demos/demo1.tsx +0 -133
- package/src/settings-form/index.md +0 -10
- package/src/settings-form/index.ts +0 -1
- package/src/slate/RichText.tsx +0 -258
- package/src/slate/Slate.tsx +0 -32
- package/src/slate/components.tsx +0 -172
- package/src/slate/demos/demo1.tsx +0 -27
- package/src/slate/demos/demo2.tsx +0 -79
- package/src/slate/demos/demo3.tsx +0 -44
- package/src/slate/index.less +0 -51
- package/src/slate/index.md +0 -22
- package/src/slate/index.ts +0 -1
- package/src/slate/materialicons.woff2 +0 -0
- package/src/system-settings/SystemSettingsProvider.tsx +0 -20
- package/src/system-settings/SystemSettingsShortcut.tsx +0 -145
- package/src/system-settings/demos/demo1.tsx +0 -55
- package/src/system-settings/index.md +0 -22
- package/src/system-settings/index.tsx +0 -3
- package/src/user/ChangePassword.tsx +0 -134
- package/src/user/CurrentUser.tsx +0 -55
- package/src/user/CurrentUserProvider.tsx +0 -26
- package/src/user/EditProfile.tsx +0 -119
- package/src/user/LanguageSettings.tsx +0 -44
- package/src/user/SigninPage.tsx +0 -86
- package/src/user/SignupPage.tsx +0 -114
- package/src/user/SwitchRole.tsx +0 -55
- package/src/user/index.md +0 -23
- package/src/user/index.ts +0 -5
- package/src/workflow/ExecutionResourceProvider.tsx +0 -24
- package/src/workflow/WorkflowCanvas.tsx +0 -250
- package/src/workflow/WorkflowLink.tsx +0 -14
- package/src/workflow/WorkflowPage.tsx +0 -47
- package/src/workflow/WorkflowRouteProvider.tsx +0 -12
- package/src/workflow/WorkflowShortcut.tsx +0 -50
- package/src/workflow/calculators.tsx +0 -481
- package/src/workflow/index.tsx +0 -5
- package/src/workflow/nodes/calculation.tsx +0 -34
- package/src/workflow/nodes/condition.tsx +0 -226
- package/src/workflow/nodes/create.tsx +0 -60
- package/src/workflow/nodes/destroy.tsx +0 -31
- package/src/workflow/nodes/index.tsx +0 -269
- package/src/workflow/nodes/parallel.tsx +0 -134
- package/src/workflow/nodes/query.tsx +0 -66
- package/src/workflow/nodes/update.tsx +0 -27
- package/src/workflow/schemas/collection.ts +0 -56
- package/src/workflow/schemas/executions.ts +0 -132
- package/src/workflow/schemas/workflows.ts +0 -323
- package/src/workflow/style.tsx +0 -200
- package/src/workflow/triggers/collection.tsx +0 -102
- package/src/workflow/triggers/index.tsx +0 -135
|
@@ -1,774 +0,0 @@
|
|
|
1
|
-
import { FormOutlined, TableOutlined } from '@ant-design/icons';
|
|
2
|
-
import { FormDialog, FormLayout } from '@formily/antd';
|
|
3
|
-
import { ISchema, SchemaOptionsContext } from '@formily/react';
|
|
4
|
-
import { merge } from '@formily/shared';
|
|
5
|
-
import React, { useContext } from 'react';
|
|
6
|
-
import { useTranslation } from 'react-i18next';
|
|
7
|
-
import { useAPIClient } from '../../api-client';
|
|
8
|
-
import { useBlockAssociationContext } from '../../block-provider';
|
|
9
|
-
import { useCollection, useCollectionManager } from '../../collection-manager';
|
|
10
|
-
import { SchemaComponent, SchemaComponentOptions } from '../../schema-component';
|
|
11
|
-
import { useSchemaTemplateManager } from '../../schema-templates';
|
|
12
|
-
import { SchemaInitializer } from '../SchemaInitializer';
|
|
13
|
-
import {
|
|
14
|
-
createCalendarBlockSchema,
|
|
15
|
-
createDetailsBlockSchema,
|
|
16
|
-
createFormBlockSchema,
|
|
17
|
-
createKanbanBlockSchema,
|
|
18
|
-
createReadPrettyFormBlockSchema,
|
|
19
|
-
createTableBlockSchema,
|
|
20
|
-
createTableSelectorSchema,
|
|
21
|
-
useCollectionDataSourceItems,
|
|
22
|
-
useCurrentSchema,
|
|
23
|
-
useRecordCollectionDataSourceItems,
|
|
24
|
-
} from '../utils';
|
|
25
|
-
|
|
26
|
-
// Block
|
|
27
|
-
export const BlockInitializer = (props) => {
|
|
28
|
-
const { item, insert } = props;
|
|
29
|
-
return (
|
|
30
|
-
<SchemaInitializer.Item
|
|
31
|
-
onClick={() => {
|
|
32
|
-
insert({
|
|
33
|
-
...item.schema,
|
|
34
|
-
});
|
|
35
|
-
}}
|
|
36
|
-
/>
|
|
37
|
-
);
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
export const CustomizeActionInitializer = (props) => {
|
|
41
|
-
return <BlockInitializer {...props} />;
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
export const InitializerWithSwitch = (props) => {
|
|
45
|
-
const { type, schema, item, insert } = props;
|
|
46
|
-
const { exists, remove } = useCurrentSchema(schema?.[type] || item?.schema?.[type], type, item.find, item.remove);
|
|
47
|
-
return (
|
|
48
|
-
<SchemaInitializer.SwitchItem
|
|
49
|
-
checked={exists}
|
|
50
|
-
title={item.title}
|
|
51
|
-
onClick={() => {
|
|
52
|
-
if (exists) {
|
|
53
|
-
return remove();
|
|
54
|
-
}
|
|
55
|
-
const s = merge(schema || {}, item.schema || {});
|
|
56
|
-
item?.schemaInitialize?.(s);
|
|
57
|
-
insert(s);
|
|
58
|
-
}}
|
|
59
|
-
/>
|
|
60
|
-
);
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
export const ActionInitializer = (props) => {
|
|
64
|
-
return <InitializerWithSwitch {...props} type={'x-action'} />;
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
export const DataBlockInitializer = (props) => {
|
|
68
|
-
const { templateWrap, onCreateBlockSchema, componentType, createBlockSchema, insert, ...others } = props;
|
|
69
|
-
const { getTemplateSchemaByMode } = useSchemaTemplateManager();
|
|
70
|
-
return (
|
|
71
|
-
<SchemaInitializer.Item
|
|
72
|
-
icon={<TableOutlined />}
|
|
73
|
-
{...others}
|
|
74
|
-
onClick={async ({ item }) => {
|
|
75
|
-
if (item.template) {
|
|
76
|
-
const s = await getTemplateSchemaByMode(item);
|
|
77
|
-
templateWrap ? insert(templateWrap(s, { item })) : insert(s);
|
|
78
|
-
} else {
|
|
79
|
-
if (onCreateBlockSchema) {
|
|
80
|
-
onCreateBlockSchema({ item });
|
|
81
|
-
} else if (createBlockSchema) {
|
|
82
|
-
insert(createBlockSchema({ collection: item.name }));
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}}
|
|
86
|
-
items={useCollectionDataSourceItems(componentType)}
|
|
87
|
-
/>
|
|
88
|
-
);
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
export const TableBlockInitializer = (props) => {
|
|
92
|
-
const { insert } = props;
|
|
93
|
-
const { getCollection } = useCollectionManager();
|
|
94
|
-
return (
|
|
95
|
-
<DataBlockInitializer
|
|
96
|
-
{...props}
|
|
97
|
-
icon={<TableOutlined />}
|
|
98
|
-
componentType={'Table'}
|
|
99
|
-
onCreateBlockSchema={async ({ item }) => {
|
|
100
|
-
const collection = getCollection(item.name);
|
|
101
|
-
const schema = createTableBlockSchema({ collection: item.name, rowKey: collection.filterTargetKey || 'id' });
|
|
102
|
-
insert(schema);
|
|
103
|
-
}}
|
|
104
|
-
/>
|
|
105
|
-
);
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
export const FormBlockInitializer = (props) => {
|
|
109
|
-
return (
|
|
110
|
-
<DataBlockInitializer
|
|
111
|
-
{...props}
|
|
112
|
-
icon={<FormOutlined />}
|
|
113
|
-
componentType={'FormItem'}
|
|
114
|
-
templateWrap={(templateSchema, { item }) => {
|
|
115
|
-
const s = createFormBlockSchema({
|
|
116
|
-
template: templateSchema,
|
|
117
|
-
collection: item.name,
|
|
118
|
-
});
|
|
119
|
-
if (item.template && item.mode === 'reference') {
|
|
120
|
-
s['x-template-key'] = item.template.key;
|
|
121
|
-
}
|
|
122
|
-
return s;
|
|
123
|
-
}}
|
|
124
|
-
createBlockSchema={createFormBlockSchema}
|
|
125
|
-
/>
|
|
126
|
-
);
|
|
127
|
-
};
|
|
128
|
-
|
|
129
|
-
export const DetailsBlockInitializer = (props) => {
|
|
130
|
-
const { insert } = props;
|
|
131
|
-
const { getCollection } = useCollectionManager();
|
|
132
|
-
return (
|
|
133
|
-
<DataBlockInitializer
|
|
134
|
-
{...props}
|
|
135
|
-
icon={<TableOutlined />}
|
|
136
|
-
componentType={'Details'}
|
|
137
|
-
onCreateBlockSchema={async ({ item }) => {
|
|
138
|
-
const collection = getCollection(item.name);
|
|
139
|
-
const schema = createDetailsBlockSchema({ collection: item.name, rowKey: collection.filterTargetKey || 'id' });
|
|
140
|
-
insert(schema);
|
|
141
|
-
}}
|
|
142
|
-
/>
|
|
143
|
-
);
|
|
144
|
-
};
|
|
145
|
-
|
|
146
|
-
export const CalendarBlockInitializer = (props) => {
|
|
147
|
-
const { insert } = props;
|
|
148
|
-
const { t } = useTranslation();
|
|
149
|
-
const { getCollection } = useCollectionManager();
|
|
150
|
-
const options = useContext(SchemaOptionsContext);
|
|
151
|
-
return (
|
|
152
|
-
<DataBlockInitializer
|
|
153
|
-
{...props}
|
|
154
|
-
componentType={'Calendar'}
|
|
155
|
-
icon={<FormOutlined />}
|
|
156
|
-
onCreateBlockSchema={async ({ item }) => {
|
|
157
|
-
const collection = getCollection(item.name);
|
|
158
|
-
const stringFields = collection?.fields
|
|
159
|
-
?.filter((field) => field.type === 'string')
|
|
160
|
-
?.map((field) => {
|
|
161
|
-
return {
|
|
162
|
-
label: field?.uiSchema?.title,
|
|
163
|
-
value: field.name,
|
|
164
|
-
};
|
|
165
|
-
});
|
|
166
|
-
const dateFields = collection?.fields
|
|
167
|
-
?.filter((field) => field.type === 'date')
|
|
168
|
-
?.map((field) => {
|
|
169
|
-
return {
|
|
170
|
-
label: field?.uiSchema?.title,
|
|
171
|
-
value: field.name,
|
|
172
|
-
};
|
|
173
|
-
});
|
|
174
|
-
const values = await FormDialog(t('Create calendar block'), () => {
|
|
175
|
-
return (
|
|
176
|
-
<SchemaComponentOptions scope={options.scope} components={{ ...options.components }}>
|
|
177
|
-
<FormLayout layout={'vertical'}>
|
|
178
|
-
<SchemaComponent
|
|
179
|
-
schema={{
|
|
180
|
-
properties: {
|
|
181
|
-
title: {
|
|
182
|
-
title: t('Title field'),
|
|
183
|
-
enum: stringFields,
|
|
184
|
-
required: true,
|
|
185
|
-
'x-component': 'Select',
|
|
186
|
-
'x-decorator': 'FormItem',
|
|
187
|
-
},
|
|
188
|
-
start: {
|
|
189
|
-
title: t('Start date field'),
|
|
190
|
-
enum: dateFields,
|
|
191
|
-
required: true,
|
|
192
|
-
default: 'createdAt',
|
|
193
|
-
'x-component': 'Select',
|
|
194
|
-
'x-decorator': 'FormItem',
|
|
195
|
-
},
|
|
196
|
-
end: {
|
|
197
|
-
title: t('End date field'),
|
|
198
|
-
enum: dateFields,
|
|
199
|
-
'x-component': 'Select',
|
|
200
|
-
'x-decorator': 'FormItem',
|
|
201
|
-
},
|
|
202
|
-
},
|
|
203
|
-
}}
|
|
204
|
-
/>
|
|
205
|
-
</FormLayout>
|
|
206
|
-
</SchemaComponentOptions>
|
|
207
|
-
);
|
|
208
|
-
}).open({
|
|
209
|
-
initialValues: {},
|
|
210
|
-
});
|
|
211
|
-
insert(
|
|
212
|
-
createCalendarBlockSchema({
|
|
213
|
-
collection: item.name,
|
|
214
|
-
fieldNames: {
|
|
215
|
-
...values,
|
|
216
|
-
},
|
|
217
|
-
}),
|
|
218
|
-
);
|
|
219
|
-
}}
|
|
220
|
-
/>
|
|
221
|
-
);
|
|
222
|
-
};
|
|
223
|
-
|
|
224
|
-
export const KanbanBlockInitializer = (props) => {
|
|
225
|
-
const { insert } = props;
|
|
226
|
-
const { t } = useTranslation();
|
|
227
|
-
const { getCollection } = useCollectionManager();
|
|
228
|
-
const options = useContext(SchemaOptionsContext);
|
|
229
|
-
const api = useAPIClient();
|
|
230
|
-
return (
|
|
231
|
-
<DataBlockInitializer
|
|
232
|
-
{...props}
|
|
233
|
-
componentType={'Kanban'}
|
|
234
|
-
icon={<FormOutlined />}
|
|
235
|
-
onCreateBlockSchema={async ({ item }) => {
|
|
236
|
-
const collection = getCollection(item.name);
|
|
237
|
-
const fields = collection?.fields
|
|
238
|
-
?.filter((field) => ['select', 'radioGroup'].includes(field.interface))
|
|
239
|
-
?.map((field) => {
|
|
240
|
-
return {
|
|
241
|
-
label: field?.uiSchema?.title,
|
|
242
|
-
value: field.name,
|
|
243
|
-
uiSchema: {
|
|
244
|
-
...field.uiSchema,
|
|
245
|
-
name: field.name,
|
|
246
|
-
},
|
|
247
|
-
};
|
|
248
|
-
});
|
|
249
|
-
const values = await FormDialog(t('Create kanban block'), () => {
|
|
250
|
-
return (
|
|
251
|
-
<SchemaComponentOptions scope={options.scope} components={{ ...options.components }}>
|
|
252
|
-
<FormLayout layout={'vertical'}>
|
|
253
|
-
<SchemaComponent
|
|
254
|
-
schema={{
|
|
255
|
-
properties: {
|
|
256
|
-
groupField: {
|
|
257
|
-
title: t('Group field'),
|
|
258
|
-
enum: fields,
|
|
259
|
-
required: true,
|
|
260
|
-
'x-component': 'Select',
|
|
261
|
-
'x-component-props': {
|
|
262
|
-
objectValue: true,
|
|
263
|
-
fieldNames: { label: 'label', value: 'value' },
|
|
264
|
-
},
|
|
265
|
-
'x-decorator': 'FormItem',
|
|
266
|
-
},
|
|
267
|
-
},
|
|
268
|
-
}}
|
|
269
|
-
/>
|
|
270
|
-
</FormLayout>
|
|
271
|
-
</SchemaComponentOptions>
|
|
272
|
-
);
|
|
273
|
-
}).open({
|
|
274
|
-
initialValues: {},
|
|
275
|
-
});
|
|
276
|
-
const sortName = `${values.groupField.value}_sort`;
|
|
277
|
-
const exists = collection?.fields?.find((field) => field.name === sortName);
|
|
278
|
-
if (!exists) {
|
|
279
|
-
await api.resource('collections.fields', item.name).create({
|
|
280
|
-
values: {
|
|
281
|
-
type: 'sort',
|
|
282
|
-
name: sortName,
|
|
283
|
-
hidden: true,
|
|
284
|
-
scopeKey: values.groupField.value,
|
|
285
|
-
},
|
|
286
|
-
});
|
|
287
|
-
}
|
|
288
|
-
insert(
|
|
289
|
-
createKanbanBlockSchema({
|
|
290
|
-
groupField: values.groupField.value,
|
|
291
|
-
collection: item.name,
|
|
292
|
-
params: {
|
|
293
|
-
sort: [sortName],
|
|
294
|
-
paginate: false,
|
|
295
|
-
},
|
|
296
|
-
}),
|
|
297
|
-
);
|
|
298
|
-
}}
|
|
299
|
-
/>
|
|
300
|
-
);
|
|
301
|
-
};
|
|
302
|
-
|
|
303
|
-
export const MarkdownBlockInitializer = (props) => {
|
|
304
|
-
const { insert } = props;
|
|
305
|
-
const { t } = useTranslation();
|
|
306
|
-
return (
|
|
307
|
-
<SchemaInitializer.Item
|
|
308
|
-
{...props}
|
|
309
|
-
icon={<FormOutlined />}
|
|
310
|
-
onClick={() => {
|
|
311
|
-
insert({
|
|
312
|
-
type: 'void',
|
|
313
|
-
'x-designer': 'Markdown.Void.Designer',
|
|
314
|
-
'x-decorator': 'CardItem',
|
|
315
|
-
'x-component': 'Markdown.Void',
|
|
316
|
-
'x-editable': false,
|
|
317
|
-
'x-component-props': {
|
|
318
|
-
content: t('This is a demo text, **supports Markdown syntax**.'),
|
|
319
|
-
},
|
|
320
|
-
});
|
|
321
|
-
}}
|
|
322
|
-
/>
|
|
323
|
-
);
|
|
324
|
-
};
|
|
325
|
-
|
|
326
|
-
export const FilterActionInitializer = (props) => {
|
|
327
|
-
const schema = {
|
|
328
|
-
type: 'void',
|
|
329
|
-
title: '{{ t("Filter") }}',
|
|
330
|
-
'x-action': 'filter',
|
|
331
|
-
'x-designer': 'Filter.Action.Designer',
|
|
332
|
-
'x-component': 'Filter.Action',
|
|
333
|
-
'x-component-props': {
|
|
334
|
-
icon: 'FilterOutlined',
|
|
335
|
-
useProps: '{{ useFilterActionProps }}',
|
|
336
|
-
},
|
|
337
|
-
};
|
|
338
|
-
return <ActionInitializer {...props} schema={schema} />;
|
|
339
|
-
};
|
|
340
|
-
|
|
341
|
-
export const CreateActionInitializer = (props) => {
|
|
342
|
-
const schema = {
|
|
343
|
-
type: 'void',
|
|
344
|
-
title: '{{ t("Add new") }}',
|
|
345
|
-
'x-action': 'create',
|
|
346
|
-
'x-designer': 'Action.Designer',
|
|
347
|
-
'x-component': 'Action',
|
|
348
|
-
'x-component-props': {
|
|
349
|
-
icon: 'PlusOutlined',
|
|
350
|
-
openMode: 'drawer',
|
|
351
|
-
type: 'primary',
|
|
352
|
-
},
|
|
353
|
-
properties: {
|
|
354
|
-
drawer: {
|
|
355
|
-
type: 'void',
|
|
356
|
-
title: '{{ t("Add record") }}',
|
|
357
|
-
'x-component': 'Action.Container',
|
|
358
|
-
'x-component-props': {
|
|
359
|
-
className: 'nb-action-popup',
|
|
360
|
-
},
|
|
361
|
-
properties: {
|
|
362
|
-
grid: {
|
|
363
|
-
type: 'void',
|
|
364
|
-
'x-component': 'Grid',
|
|
365
|
-
'x-initializer': 'CreateFormBlockInitializers',
|
|
366
|
-
properties: {},
|
|
367
|
-
},
|
|
368
|
-
},
|
|
369
|
-
},
|
|
370
|
-
},
|
|
371
|
-
};
|
|
372
|
-
return <ActionInitializer {...props} schema={schema} />;
|
|
373
|
-
};
|
|
374
|
-
|
|
375
|
-
export const ViewActionInitializer = (props) => {
|
|
376
|
-
const schema = {
|
|
377
|
-
type: 'void',
|
|
378
|
-
title: '{{ t("View") }}',
|
|
379
|
-
'x-action': 'view',
|
|
380
|
-
'x-designer': 'Action.Designer',
|
|
381
|
-
'x-component': 'Action',
|
|
382
|
-
'x-component-props': {
|
|
383
|
-
openMode: 'drawer',
|
|
384
|
-
},
|
|
385
|
-
properties: {
|
|
386
|
-
drawer: {
|
|
387
|
-
type: 'void',
|
|
388
|
-
title: '{{ t("View record") }}',
|
|
389
|
-
'x-component': 'Action.Container',
|
|
390
|
-
'x-component-props': {
|
|
391
|
-
className: 'nb-action-popup',
|
|
392
|
-
},
|
|
393
|
-
properties: {
|
|
394
|
-
tabs: {
|
|
395
|
-
type: 'void',
|
|
396
|
-
'x-component': 'Tabs',
|
|
397
|
-
'x-component-props': {},
|
|
398
|
-
'x-initializer': 'TabPaneInitializers',
|
|
399
|
-
properties: {
|
|
400
|
-
tab1: {
|
|
401
|
-
type: 'void',
|
|
402
|
-
title: '{{t("Details")}}',
|
|
403
|
-
'x-component': 'Tabs.TabPane',
|
|
404
|
-
'x-designer': 'Tabs.Designer',
|
|
405
|
-
'x-component-props': {},
|
|
406
|
-
properties: {
|
|
407
|
-
grid: {
|
|
408
|
-
type: 'void',
|
|
409
|
-
'x-component': 'Grid',
|
|
410
|
-
'x-initializer': 'RecordBlockInitializers',
|
|
411
|
-
properties: {},
|
|
412
|
-
},
|
|
413
|
-
},
|
|
414
|
-
},
|
|
415
|
-
},
|
|
416
|
-
},
|
|
417
|
-
},
|
|
418
|
-
},
|
|
419
|
-
},
|
|
420
|
-
};
|
|
421
|
-
return <ActionInitializer {...props} schema={schema} />;
|
|
422
|
-
};
|
|
423
|
-
|
|
424
|
-
export const UpdateActionInitializer = (props) => {
|
|
425
|
-
const schema = {
|
|
426
|
-
type: 'void',
|
|
427
|
-
title: '{{ t("Edit") }}',
|
|
428
|
-
'x-action': 'update',
|
|
429
|
-
'x-designer': 'Action.Designer',
|
|
430
|
-
'x-component': 'Action',
|
|
431
|
-
'x-component-props': {
|
|
432
|
-
openMode: 'drawer',
|
|
433
|
-
icon: 'EditOutlined',
|
|
434
|
-
},
|
|
435
|
-
properties: {
|
|
436
|
-
drawer: {
|
|
437
|
-
type: 'void',
|
|
438
|
-
title: '{{ t("Edit record") }}',
|
|
439
|
-
'x-component': 'Action.Container',
|
|
440
|
-
'x-component-props': {
|
|
441
|
-
className: 'nb-action-popup',
|
|
442
|
-
},
|
|
443
|
-
properties: {
|
|
444
|
-
tabs: {
|
|
445
|
-
type: 'void',
|
|
446
|
-
'x-component': 'Tabs',
|
|
447
|
-
'x-component-props': {},
|
|
448
|
-
'x-initializer': 'TabPaneInitializers',
|
|
449
|
-
properties: {
|
|
450
|
-
tab1: {
|
|
451
|
-
type: 'void',
|
|
452
|
-
title: '{{t("Edit")}}',
|
|
453
|
-
'x-component': 'Tabs.TabPane',
|
|
454
|
-
'x-designer': 'Tabs.Designer',
|
|
455
|
-
'x-component-props': {},
|
|
456
|
-
properties: {
|
|
457
|
-
grid: {
|
|
458
|
-
type: 'void',
|
|
459
|
-
'x-component': 'Grid',
|
|
460
|
-
'x-initializer': 'RecordBlockInitializers',
|
|
461
|
-
properties: {},
|
|
462
|
-
},
|
|
463
|
-
},
|
|
464
|
-
},
|
|
465
|
-
},
|
|
466
|
-
},
|
|
467
|
-
},
|
|
468
|
-
},
|
|
469
|
-
},
|
|
470
|
-
};
|
|
471
|
-
return <ActionInitializer {...props} schema={schema} />;
|
|
472
|
-
};
|
|
473
|
-
|
|
474
|
-
export const DestroyActionInitializer = (props) => {
|
|
475
|
-
const schema = {
|
|
476
|
-
title: '{{ t("Delete") }}',
|
|
477
|
-
'x-action': 'destroy',
|
|
478
|
-
'x-component': 'Action',
|
|
479
|
-
'x-designer': 'Action.Designer',
|
|
480
|
-
'x-component-props': {
|
|
481
|
-
icon: 'DeleteOutlined',
|
|
482
|
-
confirm: {
|
|
483
|
-
title: "{{t('Delete record')}}",
|
|
484
|
-
content: "{{t('Are you sure you want to delete it?')}}",
|
|
485
|
-
},
|
|
486
|
-
useProps: '{{ useDestroyActionProps }}',
|
|
487
|
-
},
|
|
488
|
-
};
|
|
489
|
-
return <ActionInitializer {...props} schema={schema} />;
|
|
490
|
-
};
|
|
491
|
-
|
|
492
|
-
export const BulkDestroyActionInitializer = (props) => {
|
|
493
|
-
const schema = {
|
|
494
|
-
title: '{{ t("Delete") }}',
|
|
495
|
-
'x-action': 'destroy',
|
|
496
|
-
'x-component': 'Action',
|
|
497
|
-
'x-designer': 'Action.Designer',
|
|
498
|
-
'x-component-props': {
|
|
499
|
-
icon: 'DeleteOutlined',
|
|
500
|
-
confirm: {
|
|
501
|
-
title: "{{t('Delete record')}}",
|
|
502
|
-
content: "{{t('Are you sure you want to delete it?')}}",
|
|
503
|
-
},
|
|
504
|
-
useProps: '{{ useBulkDestroyActionProps }}',
|
|
505
|
-
},
|
|
506
|
-
};
|
|
507
|
-
return <ActionInitializer {...props} schema={schema} />;
|
|
508
|
-
};
|
|
509
|
-
|
|
510
|
-
export const SubmitActionInitializer = (props) => {
|
|
511
|
-
const schema = {
|
|
512
|
-
title: '{{ t("Submit") }}',
|
|
513
|
-
'x-action': 'submit',
|
|
514
|
-
'x-component': 'Action',
|
|
515
|
-
'x-designer': 'Action.Designer',
|
|
516
|
-
'x-component-props': {
|
|
517
|
-
type: 'primary',
|
|
518
|
-
htmlType: 'submit',
|
|
519
|
-
// useProps: '{{ bp.useSubmitActionProps }}',
|
|
520
|
-
},
|
|
521
|
-
};
|
|
522
|
-
return <ActionInitializer {...props} schema={schema} />;
|
|
523
|
-
};
|
|
524
|
-
|
|
525
|
-
export const CreateSubmitActionInitializer = (props) => {
|
|
526
|
-
const schema = {
|
|
527
|
-
title: '{{ t("Submit") }}',
|
|
528
|
-
'x-action': 'submit',
|
|
529
|
-
'x-component': 'Action',
|
|
530
|
-
'x-designer': 'Action.Designer',
|
|
531
|
-
'x-component-props': {
|
|
532
|
-
type: 'primary',
|
|
533
|
-
htmlType: 'submit',
|
|
534
|
-
useProps: '{{ useCreateActionProps }}',
|
|
535
|
-
},
|
|
536
|
-
};
|
|
537
|
-
return <ActionInitializer {...props} schema={schema} />;
|
|
538
|
-
};
|
|
539
|
-
|
|
540
|
-
export const UpdateSubmitActionInitializer = (props) => {
|
|
541
|
-
const schema = {
|
|
542
|
-
title: '{{ t("Submit") }}',
|
|
543
|
-
'x-action': 'submit',
|
|
544
|
-
'x-component': 'Action',
|
|
545
|
-
'x-designer': 'Action.Designer',
|
|
546
|
-
'x-component-props': {
|
|
547
|
-
type: 'primary',
|
|
548
|
-
htmlType: 'submit',
|
|
549
|
-
useProps: '{{ useUpdateActionProps }}',
|
|
550
|
-
},
|
|
551
|
-
};
|
|
552
|
-
return <ActionInitializer {...props} schema={schema} />;
|
|
553
|
-
};
|
|
554
|
-
|
|
555
|
-
export const CreateFormBlockInitializer = (props) => {
|
|
556
|
-
const { onCreateBlockSchema, componentType, createBlockSchema, insert, ...others } = props;
|
|
557
|
-
const { getTemplateSchemaByMode } = useSchemaTemplateManager();
|
|
558
|
-
const association = useBlockAssociationContext();
|
|
559
|
-
const collection = useCollection();
|
|
560
|
-
return (
|
|
561
|
-
<SchemaInitializer.Item
|
|
562
|
-
icon={<FormOutlined />}
|
|
563
|
-
{...others}
|
|
564
|
-
onClick={async ({ item }) => {
|
|
565
|
-
if (item.template) {
|
|
566
|
-
const s = await getTemplateSchemaByMode(item);
|
|
567
|
-
if (item.template.componentName === 'FormItem') {
|
|
568
|
-
const blockSchema = createFormBlockSchema({
|
|
569
|
-
actionInitializers: 'CreateFormActionInitializers',
|
|
570
|
-
association,
|
|
571
|
-
collection: collection.name,
|
|
572
|
-
template: s,
|
|
573
|
-
});
|
|
574
|
-
if (item.mode === 'reference') {
|
|
575
|
-
blockSchema['x-template-key'] = item.template.key;
|
|
576
|
-
}
|
|
577
|
-
insert(blockSchema);
|
|
578
|
-
} else {
|
|
579
|
-
insert(s);
|
|
580
|
-
}
|
|
581
|
-
} else {
|
|
582
|
-
insert(
|
|
583
|
-
createFormBlockSchema({
|
|
584
|
-
actionInitializers: 'CreateFormActionInitializers',
|
|
585
|
-
association,
|
|
586
|
-
collection: collection.name,
|
|
587
|
-
}),
|
|
588
|
-
);
|
|
589
|
-
}
|
|
590
|
-
}}
|
|
591
|
-
items={useRecordCollectionDataSourceItems('FormItem')}
|
|
592
|
-
/>
|
|
593
|
-
);
|
|
594
|
-
};
|
|
595
|
-
|
|
596
|
-
export const RecordFormBlockInitializer = (props) => {
|
|
597
|
-
const { onCreateBlockSchema, componentType, createBlockSchema, insert, ...others } = props;
|
|
598
|
-
const { getTemplateSchemaByMode } = useSchemaTemplateManager();
|
|
599
|
-
const collection = useCollection();
|
|
600
|
-
const association = useBlockAssociationContext();
|
|
601
|
-
return (
|
|
602
|
-
<SchemaInitializer.Item
|
|
603
|
-
icon={<FormOutlined />}
|
|
604
|
-
{...others}
|
|
605
|
-
onClick={async ({ item }) => {
|
|
606
|
-
if (item.template) {
|
|
607
|
-
const s = await getTemplateSchemaByMode(item);
|
|
608
|
-
if (item.template.componentName === 'FormItem') {
|
|
609
|
-
const blockSchema = createFormBlockSchema({
|
|
610
|
-
association,
|
|
611
|
-
collection: collection.name,
|
|
612
|
-
action: 'get',
|
|
613
|
-
useSourceId: '{{ useSourceIdFromParentRecord }}',
|
|
614
|
-
useParams: '{{ useParamsFromRecord }}',
|
|
615
|
-
actionInitializers: 'UpdateFormActionInitializers',
|
|
616
|
-
template: s,
|
|
617
|
-
});
|
|
618
|
-
if (item.mode === 'reference') {
|
|
619
|
-
blockSchema['x-template-key'] = item.template.key;
|
|
620
|
-
}
|
|
621
|
-
insert(blockSchema);
|
|
622
|
-
} else {
|
|
623
|
-
insert(s);
|
|
624
|
-
}
|
|
625
|
-
} else {
|
|
626
|
-
insert(
|
|
627
|
-
createFormBlockSchema({
|
|
628
|
-
association,
|
|
629
|
-
collection: collection.name,
|
|
630
|
-
action: 'get',
|
|
631
|
-
useSourceId: '{{ useSourceIdFromParentRecord }}',
|
|
632
|
-
useParams: '{{ useParamsFromRecord }}',
|
|
633
|
-
actionInitializers: 'UpdateFormActionInitializers',
|
|
634
|
-
}),
|
|
635
|
-
);
|
|
636
|
-
}
|
|
637
|
-
}}
|
|
638
|
-
items={useRecordCollectionDataSourceItems('FormItem')}
|
|
639
|
-
/>
|
|
640
|
-
);
|
|
641
|
-
};
|
|
642
|
-
|
|
643
|
-
export const RecordReadPrettyFormBlockInitializer = (props) => {
|
|
644
|
-
const { onCreateBlockSchema, componentType, createBlockSchema, insert, ...others } = props;
|
|
645
|
-
const { getTemplateSchemaByMode } = useSchemaTemplateManager();
|
|
646
|
-
const collection = useCollection();
|
|
647
|
-
const association = useBlockAssociationContext();
|
|
648
|
-
return (
|
|
649
|
-
<SchemaInitializer.Item
|
|
650
|
-
icon={<FormOutlined />}
|
|
651
|
-
{...others}
|
|
652
|
-
onClick={async ({ item }) => {
|
|
653
|
-
if (item.template) {
|
|
654
|
-
const s = await getTemplateSchemaByMode(item);
|
|
655
|
-
if (item.template.componentName === 'ReadPrettyFormItem') {
|
|
656
|
-
const blockSchema = createReadPrettyFormBlockSchema({
|
|
657
|
-
association,
|
|
658
|
-
collection: collection.name,
|
|
659
|
-
action: 'get',
|
|
660
|
-
useSourceId: '{{ useSourceIdFromParentRecord }}',
|
|
661
|
-
useParams: '{{ useParamsFromRecord }}',
|
|
662
|
-
template: s,
|
|
663
|
-
});
|
|
664
|
-
if (item.mode === 'reference') {
|
|
665
|
-
blockSchema['x-template-key'] = item.template.key;
|
|
666
|
-
}
|
|
667
|
-
insert(blockSchema);
|
|
668
|
-
} else {
|
|
669
|
-
insert(s);
|
|
670
|
-
}
|
|
671
|
-
} else {
|
|
672
|
-
insert(
|
|
673
|
-
createReadPrettyFormBlockSchema({
|
|
674
|
-
association,
|
|
675
|
-
collection: collection.name,
|
|
676
|
-
action: 'get',
|
|
677
|
-
useSourceId: '{{ useSourceIdFromParentRecord }}',
|
|
678
|
-
useParams: '{{ useParamsFromRecord }}',
|
|
679
|
-
}),
|
|
680
|
-
);
|
|
681
|
-
}
|
|
682
|
-
}}
|
|
683
|
-
items={useRecordCollectionDataSourceItems('ReadPrettyFormItem')}
|
|
684
|
-
/>
|
|
685
|
-
);
|
|
686
|
-
};
|
|
687
|
-
|
|
688
|
-
export const RecordAssociationBlockInitializer = (props) => {
|
|
689
|
-
const { item, onCreateBlockSchema, componentType, createBlockSchema, insert, ...others } = props;
|
|
690
|
-
const { getTemplateSchemaByMode } = useSchemaTemplateManager();
|
|
691
|
-
const { getCollection } = useCollectionManager();
|
|
692
|
-
return (
|
|
693
|
-
<SchemaInitializer.Item
|
|
694
|
-
icon={<TableOutlined />}
|
|
695
|
-
{...others}
|
|
696
|
-
onClick={async ({ item }) => {
|
|
697
|
-
console.log('RecordAssociationBlockInitializer', item);
|
|
698
|
-
const field = item.field;
|
|
699
|
-
const collection = getCollection(field.target);
|
|
700
|
-
insert(
|
|
701
|
-
createTableBlockSchema({
|
|
702
|
-
rowKey: collection.filterTargetKey,
|
|
703
|
-
collection: field.target,
|
|
704
|
-
resource: `${field.collectionName}.${field.name}`,
|
|
705
|
-
association: `${field.collectionName}.${field.name}`,
|
|
706
|
-
}),
|
|
707
|
-
);
|
|
708
|
-
// if (item.template) {
|
|
709
|
-
// const s = await getTemplateSchemaByMode(item);
|
|
710
|
-
// insert(s);
|
|
711
|
-
// } else {
|
|
712
|
-
// insert(createTableBlockSchema({ collection: item.name }));
|
|
713
|
-
// }
|
|
714
|
-
}}
|
|
715
|
-
// items={useRecordCollectionDataSourceItems('Table')}
|
|
716
|
-
/>
|
|
717
|
-
);
|
|
718
|
-
};
|
|
719
|
-
|
|
720
|
-
export const TableActionColumnInitializer = (props) => {
|
|
721
|
-
const schema = {
|
|
722
|
-
type: 'void',
|
|
723
|
-
title: '{{ t("Actions") }}',
|
|
724
|
-
'x-decorator': 'TableV2.Column.ActionBar',
|
|
725
|
-
'x-component': 'TableV2.Column',
|
|
726
|
-
'x-designer': 'TableV2.ActionColumnDesigner',
|
|
727
|
-
'x-initializer': 'TableActionColumnInitializers',
|
|
728
|
-
'x-action-column': 'actions',
|
|
729
|
-
properties: {
|
|
730
|
-
actions: {
|
|
731
|
-
type: 'void',
|
|
732
|
-
'x-decorator': 'DndContext',
|
|
733
|
-
'x-component': 'Space',
|
|
734
|
-
'x-component-props': {
|
|
735
|
-
split: '|',
|
|
736
|
-
},
|
|
737
|
-
properties: {},
|
|
738
|
-
},
|
|
739
|
-
},
|
|
740
|
-
};
|
|
741
|
-
return <InitializerWithSwitch {...props} schema={schema} type={'x-action-column'} />;
|
|
742
|
-
};
|
|
743
|
-
|
|
744
|
-
export const TableCollectionFieldInitializer = (props) => {
|
|
745
|
-
const schema: ISchema = {};
|
|
746
|
-
return <InitializerWithSwitch {...props} schema={schema} type={'x-collection-field'} />;
|
|
747
|
-
};
|
|
748
|
-
|
|
749
|
-
export const CollectionFieldInitializer = (props) => {
|
|
750
|
-
const schema: ISchema = {};
|
|
751
|
-
return <InitializerWithSwitch {...props} schema={schema} type={'x-collection-field'} />;
|
|
752
|
-
};
|
|
753
|
-
|
|
754
|
-
export const TableSelectorInitializer = (props) => {
|
|
755
|
-
const { onCreateBlockSchema, componentType, createBlockSchema, insert, ...others } = props;
|
|
756
|
-
const { getTemplateSchemaByMode } = useSchemaTemplateManager();
|
|
757
|
-
const collection = useCollection();
|
|
758
|
-
return (
|
|
759
|
-
<SchemaInitializer.Item
|
|
760
|
-
icon={<FormOutlined />}
|
|
761
|
-
{...others}
|
|
762
|
-
onClick={async ({ item }) => {
|
|
763
|
-
const field = item.field;
|
|
764
|
-
insert(
|
|
765
|
-
createTableSelectorSchema({
|
|
766
|
-
rowKey: collection.filterTargetKey,
|
|
767
|
-
collection: collection.name,
|
|
768
|
-
resource: collection.name,
|
|
769
|
-
}),
|
|
770
|
-
);
|
|
771
|
-
}}
|
|
772
|
-
/>
|
|
773
|
-
);
|
|
774
|
-
};
|