@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
package/.umirc.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { resolveNocobasePackagesAlias } from '@nocobase/devtools/umiConfig';
|
|
2
|
+
import { defineConfig } from 'dumi';
|
|
3
|
+
|
|
4
|
+
export default defineConfig({
|
|
5
|
+
title: 'NocoBase',
|
|
6
|
+
// outputPath: `./docs/dist/${lang}`,
|
|
7
|
+
mode: 'site',
|
|
8
|
+
resolve: {
|
|
9
|
+
includes: ['./'],
|
|
10
|
+
},
|
|
11
|
+
// locales: [[lang, lang]],
|
|
12
|
+
hash: true,
|
|
13
|
+
logo: 'https://www.nocobase.com/images/logo.png',
|
|
14
|
+
navs: [
|
|
15
|
+
null,
|
|
16
|
+
{
|
|
17
|
+
title: 'GitHub',
|
|
18
|
+
path: 'https://github.com/nocobase/nocobase',
|
|
19
|
+
},
|
|
20
|
+
],
|
|
21
|
+
chainWebpack(config) {
|
|
22
|
+
resolveNocobasePackagesAlias(config);
|
|
23
|
+
},
|
|
24
|
+
});
|
|
@@ -11,11 +11,10 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
11
11
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
12
12
|
|
|
13
13
|
import { ConfigProvider, Spin } from 'antd';
|
|
14
|
-
import enUS from 'antd/lib/locale/en_US';
|
|
15
|
-
import zhCN from 'antd/lib/locale/zh_CN';
|
|
16
14
|
import React from 'react';
|
|
17
15
|
import { useTranslation } from 'react-i18next';
|
|
18
16
|
import { useAPIClient, useRequest } from '../api-client';
|
|
17
|
+
import locale from '../locale';
|
|
19
18
|
export function AntdConfigProvider(props) {
|
|
20
19
|
var remoteLocale = props.remoteLocale,
|
|
21
20
|
others = _objectWithoutProperties(props, _excluded);
|
|
@@ -48,7 +47,9 @@ export function AntdConfigProvider(props) {
|
|
|
48
47
|
return /*#__PURE__*/React.createElement(Spin, null);
|
|
49
48
|
}
|
|
50
49
|
|
|
51
|
-
return /*#__PURE__*/React.createElement(ConfigProvider, _objectSpread(_objectSpread({
|
|
52
|
-
|
|
50
|
+
return /*#__PURE__*/React.createElement(ConfigProvider, _objectSpread(_objectSpread({
|
|
51
|
+
dropdownMatchSelectWidth: false
|
|
52
|
+
}, others), {}, {
|
|
53
|
+
locale: locale[i18n.language].antd
|
|
53
54
|
}), props.children);
|
|
54
55
|
}
|
|
@@ -2,4 +2,6 @@ import { APIClient as APIClientSDK } from '@nocobase/sdk';
|
|
|
2
2
|
import { Result } from 'ahooks/lib/useRequest/src/types';
|
|
3
3
|
export declare class APIClient extends APIClientSDK {
|
|
4
4
|
services: Record<string, Result<any, any>>;
|
|
5
|
+
interceptors(): void;
|
|
6
|
+
notification(): void;
|
|
5
7
|
}
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
2
|
|
|
3
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
4
|
+
|
|
3
5
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
4
6
|
|
|
5
7
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
6
8
|
|
|
7
|
-
function
|
|
9
|
+
function _get() { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }
|
|
10
|
+
|
|
11
|
+
function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
|
|
8
12
|
|
|
9
13
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
10
14
|
|
|
@@ -21,6 +25,8 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
21
25
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
22
26
|
|
|
23
27
|
import { APIClient as APIClientSDK } from '@nocobase/sdk';
|
|
28
|
+
import { notification as _notification } from 'antd';
|
|
29
|
+
import React from 'react';
|
|
24
30
|
export var APIClient = /*#__PURE__*/function (_APIClientSDK) {
|
|
25
31
|
_inherits(APIClient, _APIClientSDK);
|
|
26
32
|
|
|
@@ -40,5 +46,39 @@ export var APIClient = /*#__PURE__*/function (_APIClientSDK) {
|
|
|
40
46
|
return _this;
|
|
41
47
|
}
|
|
42
48
|
|
|
43
|
-
|
|
49
|
+
_createClass(APIClient, [{
|
|
50
|
+
key: "interceptors",
|
|
51
|
+
value: function interceptors() {
|
|
52
|
+
_get(_getPrototypeOf(APIClient.prototype), "interceptors", this).call(this);
|
|
53
|
+
|
|
54
|
+
this.notification();
|
|
55
|
+
}
|
|
56
|
+
}, {
|
|
57
|
+
key: "notification",
|
|
58
|
+
value: function notification() {
|
|
59
|
+
this.axios.interceptors.response.use(function (response) {
|
|
60
|
+
return response;
|
|
61
|
+
}, function (error) {
|
|
62
|
+
var _error$response, _error$response$data, _error$response2, _error$response2$data, _error$response2$data2, _error$response2$data3;
|
|
63
|
+
|
|
64
|
+
var redirectTo = error === null || error === void 0 ? void 0 : (_error$response = error.response) === null || _error$response === void 0 ? void 0 : (_error$response$data = _error$response.data) === null || _error$response$data === void 0 ? void 0 : _error$response$data.redirectTo;
|
|
65
|
+
|
|
66
|
+
if (redirectTo) {
|
|
67
|
+
return window.location.href = redirectTo;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
_notification.error({
|
|
71
|
+
message: error === null || error === void 0 ? void 0 : (_error$response2 = error.response) === null || _error$response2 === void 0 ? void 0 : (_error$response2$data = _error$response2.data) === null || _error$response2$data === void 0 ? void 0 : (_error$response2$data2 = _error$response2$data.errors) === null || _error$response2$data2 === void 0 ? void 0 : (_error$response2$data3 = _error$response2$data2.map) === null || _error$response2$data3 === void 0 ? void 0 : _error$response2$data3.call(_error$response2$data2, function (error) {
|
|
72
|
+
return /*#__PURE__*/React.createElement('div', {
|
|
73
|
+
children: error.message
|
|
74
|
+
});
|
|
75
|
+
})
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
throw error;
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
}]);
|
|
82
|
+
|
|
83
|
+
return APIClient;
|
|
44
84
|
}(APIClientSDK);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { i18n as i18next } from 'i18next';
|
|
2
|
+
import { APIClient } from '../api-client';
|
|
3
|
+
export interface ApplicationOptions {
|
|
4
|
+
apiClient?: any;
|
|
5
|
+
i18n?: any;
|
|
6
|
+
plugins?: any[];
|
|
7
|
+
}
|
|
8
|
+
export declare type PluginCallback = () => Promise<any>;
|
|
9
|
+
export declare class Application {
|
|
10
|
+
providers: any[];
|
|
11
|
+
mainComponent: any;
|
|
12
|
+
apiClient: APIClient;
|
|
13
|
+
i18n: i18next;
|
|
14
|
+
plugins: PluginCallback[];
|
|
15
|
+
constructor(options: ApplicationOptions);
|
|
16
|
+
use(component: any, props?: any): void;
|
|
17
|
+
main(mainComponent: any): void;
|
|
18
|
+
/**
|
|
19
|
+
* TODO
|
|
20
|
+
*/
|
|
21
|
+
plugin(plugin: PluginCallback): void;
|
|
22
|
+
render(): (props?: any) => JSX.Element;
|
|
23
|
+
}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
2
|
+
|
|
3
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
|
+
|
|
5
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
6
|
+
|
|
7
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
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 _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; }
|
|
14
|
+
|
|
15
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
16
|
+
|
|
17
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
18
|
+
|
|
19
|
+
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); }
|
|
20
|
+
|
|
21
|
+
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; }
|
|
22
|
+
|
|
23
|
+
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; }
|
|
24
|
+
|
|
25
|
+
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; }
|
|
26
|
+
|
|
27
|
+
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; }
|
|
28
|
+
|
|
29
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
30
|
+
|
|
31
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
32
|
+
|
|
33
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
34
|
+
|
|
35
|
+
import React from 'react';
|
|
36
|
+
import { I18nextProvider } from 'react-i18next';
|
|
37
|
+
import { Link, NavLink } from 'react-router-dom';
|
|
38
|
+
import { ACLProvider, ACLShortcut } from '../acl';
|
|
39
|
+
import { AntdConfigProvider } from '../antd-config-provider';
|
|
40
|
+
import { APIClient, APIClientProvider } from '../api-client';
|
|
41
|
+
import { BlockSchemaComponentProvider } from '../block-provider';
|
|
42
|
+
import { CollectionManagerShortcut } from '../collection-manager';
|
|
43
|
+
import { RemoteDocumentTitleProvider } from '../document-title';
|
|
44
|
+
import { FileStorageShortcut } from '../file-manager';
|
|
45
|
+
import { i18n } from '../i18n';
|
|
46
|
+
import { PluginManagerProvider } from '../plugin-manager';
|
|
47
|
+
import { AdminLayout, AuthLayout, RemoteRouteSwitchProvider, RouteSchemaComponent, RouteSwitch, useRoutes } from '../route-switch';
|
|
48
|
+
import { AntdSchemaComponentProvider, DesignableSwitch, MenuItemInitializers, SchemaComponentProvider } from '../schema-component';
|
|
49
|
+
import { SchemaInitializerProvider } from '../schema-initializer';
|
|
50
|
+
import { BlockTemplateDetails, BlockTemplatePage, SchemaTemplateShortcut } from '../schema-templates';
|
|
51
|
+
import { SystemSettingsProvider, SystemSettingsShortcut } from '../system-settings';
|
|
52
|
+
import { SigninPage, SignupPage } from '../user';
|
|
53
|
+
import { WorkflowPage, WorkflowRouteProvider, WorkflowShortcut } from '../workflow';
|
|
54
|
+
import { compose } from './compose';
|
|
55
|
+
export var Application = /*#__PURE__*/function () {
|
|
56
|
+
function Application(options) {
|
|
57
|
+
var _window, _window$location;
|
|
58
|
+
|
|
59
|
+
_classCallCheck(this, Application);
|
|
60
|
+
|
|
61
|
+
this.providers = [];
|
|
62
|
+
this.mainComponent = null;
|
|
63
|
+
this.apiClient = void 0;
|
|
64
|
+
this.i18n = void 0;
|
|
65
|
+
this.plugins = [];
|
|
66
|
+
this.apiClient = new APIClient(_objectSpread({
|
|
67
|
+
baseURL: process.env.API_BASE_URL,
|
|
68
|
+
headers: {
|
|
69
|
+
'X-Hostname': (_window = window) === null || _window === void 0 ? void 0 : (_window$location = _window.location) === null || _window$location === void 0 ? void 0 : _window$location.hostname
|
|
70
|
+
}
|
|
71
|
+
}, options.apiClient));
|
|
72
|
+
this.i18n = options.i18n || i18n;
|
|
73
|
+
this.use(APIClientProvider, {
|
|
74
|
+
apiClient: this.apiClient
|
|
75
|
+
});
|
|
76
|
+
this.use(I18nextProvider, {
|
|
77
|
+
i18n: this.i18n
|
|
78
|
+
});
|
|
79
|
+
this.use(AntdConfigProvider, {
|
|
80
|
+
remoteLocale: true
|
|
81
|
+
});
|
|
82
|
+
this.use(RemoteRouteSwitchProvider, {
|
|
83
|
+
components: {
|
|
84
|
+
AuthLayout: AuthLayout,
|
|
85
|
+
AdminLayout: AdminLayout,
|
|
86
|
+
RouteSchemaComponent: RouteSchemaComponent,
|
|
87
|
+
SigninPage: SigninPage,
|
|
88
|
+
SignupPage: SignupPage,
|
|
89
|
+
WorkflowPage: WorkflowPage,
|
|
90
|
+
BlockTemplatePage: BlockTemplatePage,
|
|
91
|
+
BlockTemplateDetails: BlockTemplateDetails
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
this.use(SystemSettingsProvider);
|
|
95
|
+
this.use(PluginManagerProvider, {
|
|
96
|
+
components: {
|
|
97
|
+
ACLShortcut: ACLShortcut,
|
|
98
|
+
DesignableSwitch: DesignableSwitch,
|
|
99
|
+
CollectionManagerShortcut: CollectionManagerShortcut,
|
|
100
|
+
WorkflowShortcut: WorkflowShortcut,
|
|
101
|
+
SystemSettingsShortcut: SystemSettingsShortcut,
|
|
102
|
+
SchemaTemplateShortcut: SchemaTemplateShortcut,
|
|
103
|
+
FileStorageShortcut: FileStorageShortcut
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
this.use(SchemaComponentProvider, {
|
|
107
|
+
components: {
|
|
108
|
+
Link: Link,
|
|
109
|
+
NavLink: NavLink
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
this.use(SchemaInitializerProvider, {
|
|
113
|
+
initializers: {
|
|
114
|
+
MenuItemInitializers: MenuItemInitializers
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
this.use(BlockSchemaComponentProvider);
|
|
118
|
+
this.use(AntdSchemaComponentProvider);
|
|
119
|
+
this.use(ACLProvider);
|
|
120
|
+
this.use(RemoteDocumentTitleProvider);
|
|
121
|
+
this.use(WorkflowRouteProvider);
|
|
122
|
+
|
|
123
|
+
var _iterator = _createForOfIteratorHelper(options.plugins),
|
|
124
|
+
_step;
|
|
125
|
+
|
|
126
|
+
try {
|
|
127
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
128
|
+
var plugin = _step.value;
|
|
129
|
+
|
|
130
|
+
var _ref = Array.isArray(plugin) ? plugin : [plugin],
|
|
131
|
+
_ref2 = _slicedToArray(_ref, 2),
|
|
132
|
+
component = _ref2[0],
|
|
133
|
+
props = _ref2[1];
|
|
134
|
+
|
|
135
|
+
this.use(component, props);
|
|
136
|
+
}
|
|
137
|
+
} catch (err) {
|
|
138
|
+
_iterator.e(err);
|
|
139
|
+
} finally {
|
|
140
|
+
_iterator.f();
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
_createClass(Application, [{
|
|
145
|
+
key: "use",
|
|
146
|
+
value: function use(component, props) {
|
|
147
|
+
this.providers.push(props ? [component, props] : component);
|
|
148
|
+
}
|
|
149
|
+
}, {
|
|
150
|
+
key: "main",
|
|
151
|
+
value: function main(mainComponent) {
|
|
152
|
+
this.mainComponent = mainComponent;
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* TODO
|
|
156
|
+
*/
|
|
157
|
+
|
|
158
|
+
}, {
|
|
159
|
+
key: "plugin",
|
|
160
|
+
value: function plugin(_plugin) {
|
|
161
|
+
this.plugins.push(_plugin);
|
|
162
|
+
}
|
|
163
|
+
}, {
|
|
164
|
+
key: "render",
|
|
165
|
+
value: function render() {
|
|
166
|
+
return compose.apply(void 0, _toConsumableArray(this.providers))(this.mainComponent || function () {
|
|
167
|
+
var routes = useRoutes();
|
|
168
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(RouteSwitch, {
|
|
169
|
+
routes: routes
|
|
170
|
+
}));
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
}]);
|
|
174
|
+
|
|
175
|
+
return Application;
|
|
176
|
+
}();
|
package/es/application/index.js
CHANGED
|
@@ -15,7 +15,7 @@ import { useRequest } from 'ahooks';
|
|
|
15
15
|
import template from 'lodash/template';
|
|
16
16
|
import React, { createContext, useContext } from 'react';
|
|
17
17
|
import { Link } from 'react-router-dom';
|
|
18
|
-
import { ACLCollectionProvider, TableFieldResource, useAPIClient, useRecord } from '../';
|
|
18
|
+
import { ACLCollectionProvider, TableFieldResource, useAPIClient, useRecord, WithoutTableFieldResource } from '../';
|
|
19
19
|
import { CollectionProvider, useCollection, useCollectionManager } from '../collection-manager';
|
|
20
20
|
import { useRecordIndex } from '../record-provider';
|
|
21
21
|
export var BlockResourceContext = /*#__PURE__*/createContext(null);
|
|
@@ -38,7 +38,7 @@ var useAssociation = function useAssociation(props) {
|
|
|
38
38
|
}
|
|
39
39
|
};
|
|
40
40
|
|
|
41
|
-
var
|
|
41
|
+
var useResource = function useResource(props) {
|
|
42
42
|
var block = props.block,
|
|
43
43
|
resource = props.resource,
|
|
44
44
|
useSourceId = props.useSourceId;
|
|
@@ -58,9 +58,11 @@ var useReousrce = function useReousrce(props) {
|
|
|
58
58
|
return new TableFieldResource(options);
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
+
var withoutTableFieldResource = useContext(WithoutTableFieldResource);
|
|
62
|
+
|
|
61
63
|
var __parent = useContext(BlockRequestContext);
|
|
62
64
|
|
|
63
|
-
if ((__parent === null || __parent === void 0 ? void 0 : __parent.block) === 'TableField' && (__parent === null || __parent === void 0 ? void 0 : __parent.resource) instanceof TableFieldResource) {
|
|
65
|
+
if (!withoutTableFieldResource && (__parent === null || __parent === void 0 ? void 0 : __parent.block) === 'TableField' && (__parent === null || __parent === void 0 ? void 0 : __parent.resource) instanceof TableFieldResource) {
|
|
64
66
|
return __parent.resource;
|
|
65
67
|
}
|
|
66
68
|
|
|
@@ -96,16 +98,27 @@ export var useResourceAction = function useResourceAction(props) {
|
|
|
96
98
|
});
|
|
97
99
|
var params = useActionParams(props);
|
|
98
100
|
|
|
99
|
-
if (appends === null || appends === void 0 ? void 0 : appends.length) {
|
|
101
|
+
if (!Object.keys(params).includes('appends') && (appends === null || appends === void 0 ? void 0 : appends.length)) {
|
|
100
102
|
params['appends'] = appends;
|
|
101
103
|
}
|
|
102
104
|
|
|
103
|
-
var result = useRequest(function (
|
|
104
|
-
|
|
105
|
+
var result = useRequest(function (opts) {
|
|
106
|
+
if (!action) {
|
|
107
|
+
return Promise.resolve({});
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
var actionParams = _objectSpread({}, opts);
|
|
111
|
+
|
|
112
|
+
if (params.appends) {
|
|
113
|
+
actionParams.appends = params.appends;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
return resource[action](actionParams).then(function (res) {
|
|
105
117
|
return res.data;
|
|
106
|
-
})
|
|
118
|
+
});
|
|
107
119
|
}, _objectSpread(_objectSpread({}, opts), {}, {
|
|
108
|
-
defaultParams: [params]
|
|
120
|
+
defaultParams: [params],
|
|
121
|
+
refreshDeps: [JSON.stringify(params.appends)]
|
|
109
122
|
}));
|
|
110
123
|
return result;
|
|
111
124
|
};
|
|
@@ -144,7 +157,7 @@ export var useBlockRequestContext = function useBlockRequestContext() {
|
|
|
144
157
|
export var BlockProvider = function BlockProvider(props) {
|
|
145
158
|
var collection = props.collection,
|
|
146
159
|
association = props.association;
|
|
147
|
-
var resource =
|
|
160
|
+
var resource = useResource(props);
|
|
148
161
|
return /*#__PURE__*/React.createElement(MaybeCollectionProvider, {
|
|
149
162
|
collection: collection
|
|
150
163
|
}, /*#__PURE__*/React.createElement(BlockAssociationContext.Provider, {
|
|
@@ -169,9 +182,12 @@ export var useFilterByTk = function useFilterByTk() {
|
|
|
169
182
|
getCollectionField = _useCollectionManager2.getCollectionField;
|
|
170
183
|
|
|
171
184
|
var assoc = useContext(BlockAssociationContext);
|
|
185
|
+
var withoutTableFieldResource = useContext(WithoutTableFieldResource);
|
|
172
186
|
|
|
173
|
-
if (
|
|
174
|
-
|
|
187
|
+
if (!withoutTableFieldResource) {
|
|
188
|
+
if (resource instanceof TableFieldResource || (__parent === null || __parent === void 0 ? void 0 : __parent.block) === 'TableField') {
|
|
189
|
+
return recordIndex;
|
|
190
|
+
}
|
|
175
191
|
}
|
|
176
192
|
|
|
177
193
|
if (assoc) {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
export declare const TableBlockContext: React.Context<any>;
|
|
3
|
+
export declare const useAssociationNames: (collection: any) => any[];
|
|
3
4
|
export declare const TableBlockProvider: (props: any) => JSX.Element;
|
|
4
5
|
export declare const useTableBlockContext: () => any;
|
|
5
6
|
export declare const useTableBlockProps: () => {
|
|
@@ -19,5 +20,5 @@ export declare const useTableBlockProps: () => {
|
|
|
19
20
|
onChange({ current, pageSize }: {
|
|
20
21
|
current: any;
|
|
21
22
|
pageSize: any;
|
|
22
|
-
}): void;
|
|
23
|
+
}, filters: any, sorter: any): void;
|
|
23
24
|
};
|
|
@@ -8,8 +8,24 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
8
8
|
|
|
9
9
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
12
|
+
|
|
13
|
+
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."); }
|
|
14
|
+
|
|
15
|
+
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; }
|
|
16
|
+
|
|
17
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
18
|
+
|
|
19
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
20
|
+
|
|
21
|
+
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); }
|
|
22
|
+
|
|
23
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
24
|
+
|
|
25
|
+
import { createForm } from '@formily/core';
|
|
26
|
+
import { FormContext, Schema, useField, useFieldSchema } from '@formily/react';
|
|
27
|
+
import uniq from 'lodash/uniq';
|
|
28
|
+
import React, { createContext, useContext, useEffect, useMemo } from 'react';
|
|
13
29
|
import { useCollectionManager } from '../collection-manager';
|
|
14
30
|
import { BlockProvider, useBlockRequestContext } from './BlockProvider';
|
|
15
31
|
export var TableBlockContext = /*#__PURE__*/createContext({});
|
|
@@ -41,18 +57,48 @@ var InternalTableBlockProvider = function InternalTableBlockProvider(props) {
|
|
|
41
57
|
}, props.children);
|
|
42
58
|
};
|
|
43
59
|
|
|
44
|
-
var useAssociationNames = function useAssociationNames(collection) {
|
|
45
|
-
var _getCollectionFields;
|
|
46
|
-
|
|
60
|
+
export var useAssociationNames = function useAssociationNames(collection) {
|
|
47
61
|
var _useCollectionManager = useCollectionManager(),
|
|
48
62
|
getCollectionFields = _useCollectionManager.getCollectionFields;
|
|
49
63
|
|
|
50
|
-
var
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
64
|
+
var collectionFields = getCollectionFields(collection);
|
|
65
|
+
var associationFields = new Set();
|
|
66
|
+
|
|
67
|
+
var _iterator = _createForOfIteratorHelper(collectionFields),
|
|
68
|
+
_step;
|
|
69
|
+
|
|
70
|
+
try {
|
|
71
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
72
|
+
var collectionField = _step.value;
|
|
73
|
+
|
|
74
|
+
if (collectionField.target) {
|
|
75
|
+
associationFields.add(collectionField.name);
|
|
76
|
+
var fields = getCollectionFields(collectionField.target);
|
|
77
|
+
|
|
78
|
+
var _iterator2 = _createForOfIteratorHelper(fields),
|
|
79
|
+
_step2;
|
|
80
|
+
|
|
81
|
+
try {
|
|
82
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
83
|
+
var field = _step2.value;
|
|
84
|
+
|
|
85
|
+
if (field.target) {
|
|
86
|
+
associationFields.add("".concat(collectionField.name, ".").concat(field.name));
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
} catch (err) {
|
|
90
|
+
_iterator2.e(err);
|
|
91
|
+
} finally {
|
|
92
|
+
_iterator2.f();
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
} catch (err) {
|
|
97
|
+
_iterator.e(err);
|
|
98
|
+
} finally {
|
|
99
|
+
_iterator.f();
|
|
100
|
+
}
|
|
101
|
+
|
|
56
102
|
var fieldSchema = useFieldSchema();
|
|
57
103
|
var tableSchema = fieldSchema.reduceProperties(function (buf, schema) {
|
|
58
104
|
if (schema['x-component'] === 'TableV2') {
|
|
@@ -60,11 +106,15 @@ var useAssociationNames = function useAssociationNames(collection) {
|
|
|
60
106
|
}
|
|
61
107
|
|
|
62
108
|
return buf;
|
|
63
|
-
},
|
|
64
|
-
return tableSchema.reduceProperties(function (buf, schema) {
|
|
109
|
+
}, new Schema({}));
|
|
110
|
+
return uniq(tableSchema.reduceProperties(function (buf, schema) {
|
|
65
111
|
if (schema['x-component'] === 'TableV2.Column') {
|
|
66
112
|
var s = schema.reduceProperties(function (buf, s) {
|
|
67
|
-
|
|
113
|
+
var _s$name$split = s.name.split('.'),
|
|
114
|
+
_s$name$split2 = _slicedToArray(_s$name$split, 1),
|
|
115
|
+
name = _s$name$split2[0];
|
|
116
|
+
|
|
117
|
+
if (s['x-collection-field'] && associationFields.has(name)) {
|
|
68
118
|
return s;
|
|
69
119
|
}
|
|
70
120
|
|
|
@@ -72,41 +122,56 @@ var useAssociationNames = function useAssociationNames(collection) {
|
|
|
72
122
|
}, null);
|
|
73
123
|
|
|
74
124
|
if (s) {
|
|
75
|
-
|
|
125
|
+
// 关联字段和关联的关联字段
|
|
126
|
+
var _s$name$split3 = s.name.split('.'),
|
|
127
|
+
_s$name$split4 = _slicedToArray(_s$name$split3, 1),
|
|
128
|
+
firstName = _s$name$split4[0];
|
|
129
|
+
|
|
130
|
+
if (associationFields.has(s.name)) {
|
|
131
|
+
buf.push(s.name);
|
|
132
|
+
} else if (associationFields.has(firstName)) {
|
|
133
|
+
buf.push(firstName);
|
|
134
|
+
}
|
|
76
135
|
}
|
|
77
136
|
}
|
|
78
137
|
|
|
79
138
|
return buf;
|
|
80
|
-
}, []);
|
|
139
|
+
}, []));
|
|
81
140
|
};
|
|
82
|
-
|
|
83
141
|
export var TableBlockProvider = function TableBlockProvider(props) {
|
|
84
142
|
var params = _objectSpread({}, props.params);
|
|
85
143
|
|
|
86
144
|
var appends = useAssociationNames(props.collection);
|
|
145
|
+
var form = useMemo(function () {
|
|
146
|
+
return createForm();
|
|
147
|
+
}, []);
|
|
87
148
|
|
|
88
149
|
if (props.dragSort) {
|
|
89
150
|
params['sort'] = ['sort'];
|
|
90
151
|
}
|
|
91
152
|
|
|
92
|
-
if (
|
|
153
|
+
if (!Object.keys(params).includes('appends')) {
|
|
93
154
|
params['appends'] = appends;
|
|
94
155
|
}
|
|
95
156
|
|
|
96
|
-
return /*#__PURE__*/React.createElement(
|
|
157
|
+
return /*#__PURE__*/React.createElement(FormContext.Provider, {
|
|
158
|
+
value: form
|
|
159
|
+
}, /*#__PURE__*/React.createElement(BlockProvider, _objectSpread(_objectSpread({}, props), {}, {
|
|
97
160
|
params: params
|
|
98
161
|
}), /*#__PURE__*/React.createElement(InternalTableBlockProvider, _objectSpread(_objectSpread({}, props), {}, {
|
|
99
162
|
params: params
|
|
100
|
-
})));
|
|
163
|
+
}))));
|
|
101
164
|
};
|
|
102
165
|
export var useTableBlockContext = function useTableBlockContext() {
|
|
103
166
|
return useContext(TableBlockContext);
|
|
104
167
|
};
|
|
105
168
|
export var useTableBlockProps = function useTableBlockProps() {
|
|
106
|
-
var _ctx$service6, _ctx$service7, _ctx$params, _ctx$params2, _ctx$params3;
|
|
169
|
+
var _fieldSchema$parent, _fieldSchema$parent$x, _fieldSchema$parent$x2, _ctx$service6, _ctx$service7, _ctx$params, _ctx$params2, _ctx$params3;
|
|
107
170
|
|
|
108
171
|
var field = useField();
|
|
172
|
+
var fieldSchema = useFieldSchema();
|
|
109
173
|
var ctx = useTableBlockContext();
|
|
174
|
+
var globalSort = (_fieldSchema$parent = fieldSchema.parent) === null || _fieldSchema$parent === void 0 ? void 0 : (_fieldSchema$parent$x = _fieldSchema$parent['x-decorator-props']) === null || _fieldSchema$parent$x === void 0 ? void 0 : (_fieldSchema$parent$x2 = _fieldSchema$parent$x['params']) === null || _fieldSchema$parent$x2 === void 0 ? void 0 : _fieldSchema$parent$x2['sort'];
|
|
110
175
|
useEffect(function () {
|
|
111
176
|
var _ctx$service;
|
|
112
177
|
|
|
@@ -162,14 +227,16 @@ export var useTableBlockProps = function useTableBlockProps() {
|
|
|
162
227
|
}, _callee);
|
|
163
228
|
}))();
|
|
164
229
|
},
|
|
165
|
-
onChange: function onChange(_ref2) {
|
|
230
|
+
onChange: function onChange(_ref2, filters, sorter) {
|
|
166
231
|
var _ctx$service$params;
|
|
167
232
|
|
|
168
233
|
var current = _ref2.current,
|
|
169
234
|
pageSize = _ref2.pageSize;
|
|
235
|
+
var sort = sorter.order ? sorter.order === "ascend" ? [sorter.field] : ["-".concat(sorter.field)] : globalSort || null;
|
|
170
236
|
ctx.service.run(_objectSpread(_objectSpread({}, (_ctx$service$params = ctx.service.params) === null || _ctx$service$params === void 0 ? void 0 : _ctx$service$params[0]), {}, {
|
|
171
237
|
page: current,
|
|
172
|
-
pageSize: pageSize
|
|
238
|
+
pageSize: pageSize,
|
|
239
|
+
sort: sort
|
|
173
240
|
}));
|
|
174
241
|
}
|
|
175
242
|
};
|
|
@@ -22,6 +22,7 @@ export declare class TableFieldResource {
|
|
|
22
22
|
update(options: any): Promise<void>;
|
|
23
23
|
destroy(options: any): Promise<void>;
|
|
24
24
|
}
|
|
25
|
+
export declare const WithoutTableFieldResource: React.Context<any>;
|
|
25
26
|
export declare const TableFieldProvider: (props: any) => JSX.Element;
|
|
26
27
|
export declare const useTableFieldContext: () => any;
|
|
27
28
|
export declare const useTableFieldProps: () => {
|
|
@@ -250,10 +250,13 @@ export var TableFieldResource = /*#__PURE__*/function () {
|
|
|
250
250
|
|
|
251
251
|
return TableFieldResource;
|
|
252
252
|
}();
|
|
253
|
+
export var WithoutTableFieldResource = /*#__PURE__*/createContext(null);
|
|
253
254
|
export var TableFieldProvider = function TableFieldProvider(props) {
|
|
254
|
-
return /*#__PURE__*/React.createElement(
|
|
255
|
+
return /*#__PURE__*/React.createElement(WithoutTableFieldResource.Provider, {
|
|
256
|
+
value: false
|
|
257
|
+
}, /*#__PURE__*/React.createElement(BlockProvider, _objectSpread({
|
|
255
258
|
block: 'TableField'
|
|
256
|
-
}, props), /*#__PURE__*/React.createElement(InternalTableFieldProvider, _objectSpread({}, props)));
|
|
259
|
+
}, props), /*#__PURE__*/React.createElement(InternalTableFieldProvider, _objectSpread({}, props))));
|
|
257
260
|
};
|
|
258
261
|
export var useTableFieldContext = function useTableFieldContext() {
|
|
259
262
|
return useContext(TableFieldContext);
|