@nocobase/client 0.9.1-alpha.2 → 0.9.2-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.umirc.ts +2 -2
- package/es/acl/ACLProvider.js +35 -125
- package/es/acl/ACLShortcut.js +11 -18
- package/es/acl/Configuration/ConfigureCenter.js +57 -101
- package/es/acl/Configuration/MenuConfigure.js +92 -147
- package/es/acl/Configuration/MenuItemsProvider.js +0 -7
- package/es/acl/Configuration/PermisionProvider.js +54 -84
- package/es/acl/Configuration/RoleConfigure.js +22 -43
- package/es/acl/Configuration/RoleTable.js +5 -9
- package/es/acl/Configuration/RolesResourcesActions.js +10 -54
- package/es/acl/Configuration/ScopeSelect.js +5 -15
- package/es/acl/Configuration/StrategyActions.js +10 -31
- package/es/acl/Configuration/schemas/roles.js +4 -4
- package/es/acl/Configuration/schemas/scopes.js +4 -8
- package/es/acl/Configuration/schemas/useRoleResourceValues.js +5 -8
- package/es/acl/Configuration/schemas/useSaveRoleResourceAction.js +23 -30
- package/es/acl/style.less +1 -1
- package/es/antd-config-provider/index.js +30 -41
- package/es/antd-config-provider/loadConstrueLocale.js +4 -9
- package/es/api-client/APIClient.js +10 -42
- package/es/api-client/APIClientProvider.js +1 -1
- package/es/api-client/hooks/assign.js +0 -18
- package/es/api-client/hooks/useRequest.js +35 -59
- package/es/appInfo/CurrentAppInfoProvider.js +16 -3
- package/es/application/Application.js +87 -121
- package/es/application/compose.js +12 -23
- package/es/async-data-provider/index.js +7 -12
- package/es/block-provider/BlockProvider.d.ts +1 -0
- package/es/block-provider/BlockProvider.js +56 -96
- package/es/block-provider/BlockSchemaComponentProvider.js +10 -5
- package/es/block-provider/CalendarBlockProvider.d.ts +1 -0
- package/es/block-provider/CalendarBlockProvider.js +16 -19
- package/es/block-provider/DetailsBlockProvider.js +11 -16
- package/es/block-provider/FilterFormBlockProvider.d.ts +1 -0
- package/es/block-provider/FilterFormBlockProvider.js +16 -0
- package/es/block-provider/FormBlockProvider.d.ts +3 -0
- package/es/block-provider/FormBlockProvider.js +71 -29
- package/es/block-provider/FormFieldProvider.js +17 -21
- package/es/block-provider/GanttBlockProvider.d.ts +11 -0
- package/es/block-provider/GanttBlockProvider.js +150 -0
- package/es/block-provider/KanbanBlockProvider.js +54 -110
- package/es/block-provider/SharedFilterProvider.js +10 -25
- package/es/block-provider/TableBlockProvider.d.ts +3 -0
- package/es/block-provider/TableBlockProvider.js +164 -96
- package/es/block-provider/TableFieldProvider.js +107 -160
- package/es/block-provider/TableSelectorProvider.d.ts +18 -1
- package/es/block-provider/TableSelectorProvider.js +106 -105
- package/es/block-provider/hooks/index.d.ts +37 -0
- package/es/block-provider/hooks/index.js +1093 -972
- package/es/block-provider/index.d.ts +4 -0
- package/es/block-provider/index.js +5 -1
- package/es/board/Board.js +110 -153
- package/es/board/Card.js +7 -9
- package/es/board/CardAdder.js +6 -17
- package/es/board/CardForm.js +1 -5
- package/es/board/Column.js +27 -39
- package/es/board/ColumnAdder.js +5 -16
- package/es/board/ColumnForm.js +1 -5
- package/es/board/DefaultCard.js +3 -5
- package/es/board/DefaultColumnHeader.js +17 -34
- package/es/board/Kanban.js +5 -16
- package/es/board/helpers.js +7 -24
- package/es/board/services.js +4 -12
- package/es/board/utils.js +5 -24
- package/es/board/withDroppable.js +5 -11
- package/es/china-region/index.js +5 -21
- package/es/collection-manager/CollectionField.js +16 -42
- package/es/collection-manager/CollectionFieldProvider.js +5 -10
- package/es/collection-manager/CollectionHistoryProvider.js +24 -33
- package/es/collection-manager/CollectionManagerProvider.js +86 -121
- package/es/collection-manager/CollectionManagerSchemaComponentProvider.js +4 -4
- package/es/collection-manager/CollectionManagerShortcut.js +19 -23
- package/es/collection-manager/CollectionProvider.js +4 -8
- package/es/collection-manager/Configuration/AddCategoryAction.js +36 -56
- package/es/collection-manager/Configuration/AddCollectionAction.js +106 -129
- package/es/collection-manager/Configuration/AddFieldAction.js +87 -108
- package/es/collection-manager/Configuration/AddSubFieldAction.js +36 -56
- package/es/collection-manager/Configuration/CollectionFieldsTable.js +10 -16
- package/es/collection-manager/Configuration/CollectionFieldsTableArray.js +37 -86
- package/es/collection-manager/Configuration/ConfigurationTable.js +158 -113
- package/es/collection-manager/Configuration/ConfigurationTabs.js +94 -146
- package/es/collection-manager/Configuration/EditCategoryAction.js +44 -68
- package/es/collection-manager/Configuration/EditCollectionAction.js +59 -94
- package/es/collection-manager/Configuration/EditFieldAction.js +102 -133
- package/es/collection-manager/Configuration/EditSubFieldAction.js +54 -85
- package/es/collection-manager/Configuration/OverridingCollectionField.js +88 -134
- package/es/collection-manager/Configuration/SyncFieldsAction.d.ts +2 -0
- package/es/collection-manager/Configuration/SyncFieldsAction.js +236 -0
- package/es/collection-manager/Configuration/ViewInheritedField.js +51 -81
- package/es/collection-manager/Configuration/components/CollectionFieldInterface.js +1 -3
- package/es/collection-manager/Configuration/components/CollectionTemplate.js +1 -3
- package/es/collection-manager/Configuration/components/FieldSummary.js +2 -8
- package/es/collection-manager/Configuration/components/TemplateSummay.d.ts +2 -0
- package/es/collection-manager/Configuration/components/TemplateSummay.js +26 -0
- package/es/collection-manager/Configuration/components/index.js +5 -18
- package/es/collection-manager/Configuration/index.d.ts +1 -0
- package/es/collection-manager/Configuration/index.js +1 -0
- package/es/collection-manager/Configuration/interfaces.js +4 -7
- package/es/collection-manager/Configuration/schemas/collectionFields.js +17 -3
- package/es/collection-manager/Configuration/schemas/collections.js +22 -30
- package/es/collection-manager/Configuration/templates.js +6 -6
- package/es/collection-manager/ResourceActionProvider.js +18 -38
- package/es/collection-manager/action-hooks.d.ts +2 -0
- package/es/collection-manager/action-hooks.js +422 -432
- package/es/collection-manager/hooks/useCollection.d.ts +4 -0
- package/es/collection-manager/hooks/useCollection.js +12 -9
- package/es/collection-manager/hooks/useCollectionDataSource.d.ts +1 -1
- package/es/collection-manager/hooks/useCollectionDataSource.js +5 -6
- package/es/collection-manager/hooks/useCollectionField.js +4 -6
- package/es/collection-manager/hooks/useCollectionManager.d.ts +23 -3
- package/es/collection-manager/hooks/useCollectionManager.js +125 -90
- package/es/collection-manager/hooks/useOptions.js +5 -8
- package/es/collection-manager/index.d.ts +1 -1
- package/es/collection-manager/index.js +1 -1
- package/es/collection-manager/interfaces/attachment.js +5 -9
- package/es/collection-manager/interfaces/checkbox.js +5 -4
- package/es/collection-manager/interfaces/checkboxGroup.js +5 -4
- package/es/collection-manager/interfaces/chinaRegion.js +5 -8
- package/es/collection-manager/interfaces/createdAt.js +5 -4
- package/es/collection-manager/interfaces/createdBy.js +5 -4
- package/es/collection-manager/interfaces/datetime.js +5 -4
- package/es/collection-manager/interfaces/email.js +5 -4
- package/es/collection-manager/interfaces/icon.js +6 -5
- package/es/collection-manager/interfaces/id.js +1 -0
- package/es/collection-manager/interfaces/index.d.ts +1 -0
- package/es/collection-manager/interfaces/index.js +2 -1
- package/es/collection-manager/interfaces/input.js +5 -5
- package/es/collection-manager/interfaces/integer.js +6 -5
- package/es/collection-manager/interfaces/json.js +8 -6
- package/es/collection-manager/interfaces/linkTo.js +25 -12
- package/es/collection-manager/interfaces/m2m.js +21 -14
- package/es/collection-manager/interfaces/m2o.js +21 -10
- package/es/collection-manager/interfaces/markdown.js +5 -5
- package/es/collection-manager/interfaces/multipleSelect.js +5 -4
- package/es/collection-manager/interfaces/number.js +6 -5
- package/es/collection-manager/interfaces/o2m.js +12 -12
- package/es/collection-manager/interfaces/o2o.js +42 -30
- package/es/collection-manager/interfaces/password.js +6 -5
- package/es/collection-manager/interfaces/percent.js +11 -15
- package/es/collection-manager/interfaces/phone.js +8 -6
- package/es/collection-manager/interfaces/properties/index.js +7 -6
- package/es/collection-manager/interfaces/properties/operators.d.ts +11 -19
- package/es/collection-manager/interfaces/properties/operators.js +6 -21
- package/es/collection-manager/interfaces/radioGroup.js +5 -4
- package/es/collection-manager/interfaces/richText.js +5 -5
- package/es/collection-manager/interfaces/select.js +5 -4
- package/es/collection-manager/interfaces/subTable.js +15 -12
- package/es/collection-manager/interfaces/textarea.js +5 -5
- package/es/collection-manager/interfaces/time.js +5 -4
- package/es/collection-manager/interfaces/updatedAt.js +5 -4
- package/es/collection-manager/interfaces/updatedBy.js +5 -4
- package/es/collection-manager/interfaces/url.d.ts +2 -0
- package/es/collection-manager/interfaces/url.js +30 -0
- package/es/collection-manager/sub-table.js +79 -126
- package/es/collection-manager/templates/calendar.js +11 -10
- package/es/collection-manager/templates/components/PreviewFields.d.ts +2 -0
- package/es/collection-manager/templates/components/PreviewFields.js +256 -0
- package/es/collection-manager/templates/components/PreviewTable.d.ts +1 -0
- package/es/collection-manager/templates/components/PreviewTable.js +133 -0
- package/es/collection-manager/templates/expression.d.ts +2 -0
- package/es/collection-manager/templates/expression.js +52 -0
- package/es/collection-manager/templates/index.d.ts +3 -0
- package/es/collection-manager/templates/index.js +4 -1
- package/es/collection-manager/templates/properties/index.d.ts +1 -1
- package/es/collection-manager/templates/properties/index.js +5 -11
- package/es/collection-manager/templates/tree.d.ts +2 -0
- package/es/collection-manager/templates/tree.js +70 -0
- package/es/collection-manager/templates/types.d.ts +6 -0
- package/es/collection-manager/templates/view.d.ts +2 -0
- package/es/collection-manager/templates/view.js +135 -0
- package/es/collection-manager/types.d.ts +2 -0
- package/es/document-title/index.js +7 -17
- package/es/filter-provider/FilterProvider.d.ts +45 -0
- package/es/filter-provider/FilterProvider.js +143 -0
- package/es/filter-provider/index.d.ts +2 -0
- package/es/filter-provider/index.js +2 -0
- package/es/filter-provider/utils.d.ts +27 -0
- package/es/filter-provider/utils.js +170 -0
- package/es/formula/Expression.js +48 -112
- package/es/formula/Result.js +14 -33
- package/es/i18n/i18n.js +2 -3
- package/es/icon/Icon.js +7 -18
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/locale/en_US.d.ts +67 -4
- package/es/locale/en_US.js +68 -5
- package/es/locale/ja_JP.d.ts +54 -2
- package/es/locale/ja_JP.js +55 -4
- package/es/locale/pt_BR.d.ts +650 -0
- package/es/locale/pt_BR.js +649 -0
- package/es/locale/ru_RU.d.ts +29 -2
- package/es/locale/ru_RU.js +30 -3
- package/es/locale/tr_TR.d.ts +30 -2
- package/es/locale/tr_TR.js +31 -3
- package/es/locale/zh_CN.d.ts +84 -6
- package/es/locale/zh_CN.js +85 -7
- package/es/plugin-manager/PinnedPluginListProvider.d.ts +5 -0
- package/es/plugin-manager/PinnedPluginListProvider.js +50 -0
- package/es/plugin-manager/PluginManager.js +23 -52
- package/es/plugin-manager/PluginManagerProvider.js +1 -1
- package/es/plugin-manager/context.d.ts +3 -0
- package/es/plugin-manager/context.js +4 -1
- package/es/plugin-manager/index.d.ts +1 -0
- package/es/plugin-manager/index.js +1 -0
- package/es/pm/PluginManagerLink.js +24 -49
- package/es/pm/index.js +250 -209
- package/es/powered-by/index.js +1 -4
- package/es/record-provider/index.js +8 -14
- package/es/route-switch/RouteSwitch.js +5 -11
- package/es/route-switch/RouteSwitchProvider.js +10 -12
- package/es/route-switch/antd/admin-layout/index.js +45 -82
- package/es/route-switch/antd/auth-layout/index.js +1 -5
- package/es/route-switch/hooks.js +2 -6
- package/es/schema-component/antd/AntdSchemaComponentProvider.js +4 -4
- package/es/schema-component/antd/action/Action.Container.js +5 -8
- package/es/schema-component/antd/action/Action.Designer.js +54 -132
- package/es/schema-component/antd/action/Action.Drawer.js +11 -20
- package/es/schema-component/antd/action/Action.Link.js +4 -4
- package/es/schema-component/antd/action/Action.Modal.d.ts +2 -1
- package/es/schema-component/antd/action/Action.Modal.js +11 -19
- package/es/schema-component/antd/action/Action.Page.js +5 -15
- package/es/schema-component/antd/action/Action.js +44 -65
- package/es/schema-component/antd/action/ActionBar.js +11 -24
- package/es/schema-component/antd/action/hooks.d.ts +1 -0
- package/es/schema-component/antd/action/hooks.js +41 -50
- package/es/schema-component/antd/action/types.d.ts +1 -1
- package/es/schema-component/antd/action/utils.d.ts +1 -1
- package/es/schema-component/antd/action/utils.js +26 -19
- package/es/schema-component/antd/association-filter/ActionBarAssociationFilterAction.js +19 -13
- package/es/schema-component/antd/association-filter/AssociationFilter.BlockDesigner.d.ts +1 -0
- package/es/schema-component/antd/association-filter/AssociationFilter.BlockDesigner.js +34 -0
- package/es/schema-component/antd/association-filter/AssociationFilter.FilterBlockInitializer.d.ts +1 -0
- package/es/schema-component/antd/association-filter/AssociationFilter.FilterBlockInitializer.js +87 -0
- package/es/schema-component/antd/association-filter/AssociationFilter.Initializer.js +13 -17
- package/es/schema-component/antd/association-filter/AssociationFilter.Item.Designer.js +91 -29
- package/es/schema-component/antd/association-filter/AssociationFilter.Item.js +51 -110
- package/es/schema-component/antd/association-filter/AssociationFilter.d.ts +3 -0
- package/es/schema-component/antd/association-filter/AssociationFilter.js +9 -11
- package/es/schema-component/antd/association-filter/AssociationFilterDesignerDelete.js +2 -7
- package/es/schema-component/antd/association-filter/AssociationFilterDesignerDisplayField.js +4 -8
- package/es/schema-component/antd/association-filter/AssociationFilterProvider.d.ts +1 -0
- package/es/schema-component/antd/association-filter/AssociationFilterProvider.js +2 -0
- package/es/schema-component/antd/association-filter/utilts.d.ts +2 -0
- package/es/schema-component/antd/association-filter/utilts.js +3 -0
- package/es/schema-component/antd/association-select/AssociationSelect.d.ts +1 -0
- package/es/schema-component/antd/association-select/AssociationSelect.js +495 -88
- package/es/schema-component/antd/association-select/ReadPretty.js +4 -4
- package/es/schema-component/antd/association-select/useServiceOptions.js +8 -15
- package/es/schema-component/antd/block-item/BlockItem.js +0 -2
- package/es/schema-component/antd/block-item/TestDesigner.js +1 -2
- package/es/schema-component/antd/calendar/Calendar.Designer.js +23 -29
- package/es/schema-component/antd/calendar/Calendar.js +30 -63
- package/es/schema-component/antd/calendar/DeleteEvent.js +53 -81
- package/es/schema-component/antd/calendar/Nav.js +2 -4
- package/es/schema-component/antd/calendar/Title.js +5 -8
- package/es/schema-component/antd/calendar/Today.js +3 -6
- package/es/schema-component/antd/calendar/ViewSelect.js +5 -7
- package/es/schema-component/antd/calendar/components/Header.js +7 -10
- package/es/schema-component/antd/calendar/style.less +1 -1
- package/es/schema-component/antd/card-item/CardItem.js +5 -9
- package/es/schema-component/antd/cascader/Cascader.js +19 -36
- package/es/schema-component/antd/cascader/ReadPretty.js +3 -13
- package/es/schema-component/antd/checkbox/Checkbox.js +5 -8
- package/es/schema-component/antd/collection-select/CollectionSelect.d.ts +8 -0
- package/es/schema-component/antd/collection-select/CollectionSelect.js +61 -0
- package/es/schema-component/antd/collection-select/index.d.ts +1 -0
- package/es/schema-component/antd/collection-select/index.js +1 -0
- package/es/schema-component/antd/color-select/ColorSelect.js +4 -6
- package/es/schema-component/antd/cron/Cron.d.ts +6 -3
- package/es/schema-component/antd/cron/Cron.js +20 -19
- package/es/schema-component/antd/cron/CronSet.d.ts +7 -0
- package/es/schema-component/antd/cron/CronSet.js +106 -0
- package/es/schema-component/antd/cron/index.d.ts +1 -0
- package/es/schema-component/antd/cron/index.js +2 -1
- package/es/schema-component/antd/cron/locale/index.d.ts +0 -1
- package/es/schema-component/antd/cron/locale/index.js +1 -3
- package/es/schema-component/antd/cron/locale/zh-CN.js +8 -4
- package/es/schema-component/antd/date-picker/DatePicker.d.ts +8 -4
- package/es/schema-component/antd/date-picker/DatePicker.js +42 -3
- package/es/schema-component/antd/date-picker/ReadPretty.js +0 -9
- package/es/schema-component/antd/date-picker/util.d.ts +25 -2
- package/es/schema-component/antd/date-picker/util.js +129 -32
- package/es/schema-component/antd/details/Details.d.ts +7 -0
- package/es/schema-component/antd/details/Details.js +2 -0
- package/es/schema-component/antd/details/index.d.ts +1 -0
- package/es/schema-component/antd/details/index.js +1 -0
- package/es/schema-component/antd/filter/DynamicComponent.js +13 -61
- package/es/schema-component/antd/filter/Filter.Action.Designer.js +10 -27
- package/es/schema-component/antd/filter/Filter.js +14 -13
- package/es/schema-component/antd/filter/FilterAction.js +35 -65
- package/es/schema-component/antd/filter/FilterGroup.js +8 -16
- package/es/schema-component/antd/filter/FilterItem.js +10 -15
- package/es/schema-component/antd/filter/FilterItems.js +0 -1
- package/es/schema-component/antd/filter/SaveDefaultValue.js +4 -13
- package/es/schema-component/antd/filter/useFilterActionProps.js +69 -60
- package/es/schema-component/antd/filter/useOperators.d.ts +5 -0
- package/es/schema-component/antd/filter/useOperators.js +25 -0
- package/es/schema-component/antd/filter/useValues.js +17 -39
- package/es/schema-component/antd/form/Form.Designer.js +2 -3
- package/es/schema-component/antd/form/Form.js +35 -56
- package/es/schema-component/antd/form-item/FormItem.FilterFormDesigner.d.ts +1 -0
- package/es/schema-component/antd/form-item/FormItem.FilterFormDesigner.js +26 -0
- package/es/schema-component/antd/form-item/FormItem.js +89 -77
- package/es/schema-component/antd/form-item/SchemaSettingOptions.d.ts +23 -0
- package/es/schema-component/antd/form-item/SchemaSettingOptions.js +615 -0
- package/es/schema-component/antd/form-v2/Form.Designer.js +30 -45
- package/es/schema-component/antd/form-v2/Form.FilterDesigner.d.ts +5 -0
- package/es/schema-component/antd/form-v2/Form.FilterDesigner.js +40 -0
- package/es/schema-component/antd/form-v2/Form.d.ts +2 -0
- package/es/schema-component/antd/form-v2/Form.js +31 -50
- package/es/schema-component/antd/form-v2/FormField.js +1 -5
- package/es/schema-component/antd/form-v2/Templates.d.ts +4 -0
- package/es/schema-component/antd/form-v2/Templates.js +168 -0
- package/es/schema-component/antd/form-v2/index.d.ts +1 -1
- package/es/schema-component/antd/form-v2/index.js +4 -2
- package/es/schema-component/antd/form-v2/utils.d.ts +0 -1
- package/es/schema-component/antd/form-v2/utils.js +22 -95
- package/es/schema-component/antd/g2plot/G2Plot.js +8 -23
- package/es/schema-component/antd/g2plot/G2PlotDesigner.js +40 -51
- package/es/schema-component/antd/g2plot/requestChartData.js +19 -25
- package/es/schema-component/antd/gantt/Gantt.Designer.d.ts +1 -0
- package/es/schema-component/antd/gantt/Gantt.Designer.js +214 -0
- package/es/schema-component/antd/gantt/components/calendar/calendar.d.ts +14 -0
- package/es/schema-component/antd/gantt/components/calendar/calendar.js +324 -0
- package/es/schema-component/antd/gantt/components/calendar/style.d.ts +4 -0
- package/es/schema-component/antd/gantt/components/calendar/style.js +7 -0
- package/es/schema-component/antd/gantt/components/calendar/top-part-of-calendar.d.ts +11 -0
- package/es/schema-component/antd/gantt/components/calendar/top-part-of-calendar.js +26 -0
- package/es/schema-component/antd/gantt/components/gantt/Event.d.ts +2 -0
- package/es/schema-component/antd/gantt/components/gantt/Event.js +5 -0
- package/es/schema-component/antd/gantt/components/gantt/gantt.d.ts +5 -0
- package/es/schema-component/antd/gantt/components/gantt/gantt.js +638 -0
- package/es/schema-component/antd/gantt/components/gantt/style.d.ts +3 -0
- package/es/schema-component/antd/gantt/components/gantt/style.js +6 -0
- package/es/schema-component/antd/gantt/components/gantt/task-gantt-content.d.ts +25 -0
- package/es/schema-component/antd/gantt/components/gantt/task-gantt-content.js +366 -0
- package/es/schema-component/antd/gantt/components/gantt/task-gantt.d.ts +14 -0
- package/es/schema-component/antd/gantt/components/gantt/task-gantt.js +67 -0
- package/es/schema-component/antd/gantt/components/grid/grid-body.d.ts +13 -0
- package/es/schema-component/antd/gantt/components/grid/grid-body.js +112 -0
- package/es/schema-component/antd/gantt/components/grid/grid.d.ts +4 -0
- package/es/schema-component/antd/gantt/components/grid/grid.js +13 -0
- package/es/schema-component/antd/gantt/components/grid/style.d.ts +4 -0
- package/es/schema-component/antd/gantt/components/grid/style.js +7 -0
- package/es/schema-component/antd/gantt/components/other/arrow.d.ts +12 -0
- package/es/schema-component/antd/gantt/components/other/arrow.js +57 -0
- package/es/schema-component/antd/gantt/components/other/horizontal-scroll.d.ts +8 -0
- package/es/schema-component/antd/gantt/components/other/horizontal-scroll.js +30 -0
- package/es/schema-component/antd/gantt/components/other/style.d.ts +7 -0
- package/es/schema-component/antd/gantt/components/other/style.js +10 -0
- package/es/schema-component/antd/gantt/components/other/tooltip.d.ts +29 -0
- package/es/schema-component/antd/gantt/components/other/tooltip.js +103 -0
- package/es/schema-component/antd/gantt/components/other/vertical-scroll.d.ts +9 -0
- package/es/schema-component/antd/gantt/components/other/vertical-scroll.js +32 -0
- package/es/schema-component/antd/gantt/components/task-item/bar/bar-date-handle.d.ts +11 -0
- package/es/schema-component/antd/gantt/components/task-item/bar/bar-date-handle.js +19 -0
- package/es/schema-component/antd/gantt/components/task-item/bar/bar-display.d.ts +21 -0
- package/es/schema-component/antd/gantt/components/task-item/bar/bar-display.js +48 -0
- package/es/schema-component/antd/gantt/components/task-item/bar/bar-progress-handle.d.ts +7 -0
- package/es/schema-component/antd/gantt/components/task-item/bar/bar-progress-handle.js +10 -0
- package/es/schema-component/antd/gantt/components/task-item/bar/bar-small.d.ts +3 -0
- package/es/schema-component/antd/gantt/components/task-item/bar/bar-small.js +38 -0
- package/es/schema-component/antd/gantt/components/task-item/bar/bar.d.ts +3 -0
- package/es/schema-component/antd/gantt/components/task-item/bar/bar.js +60 -0
- package/es/schema-component/antd/gantt/components/task-item/bar/style.d.ts +2 -0
- package/es/schema-component/antd/gantt/components/task-item/bar/style.js +5 -0
- package/es/schema-component/antd/gantt/components/task-item/milestone/milestone.d.ts +3 -0
- package/es/schema-component/antd/gantt/components/task-item/milestone/milestone.js +30 -0
- package/es/schema-component/antd/gantt/components/task-item/milestone/style.d.ts +2 -0
- package/es/schema-component/antd/gantt/components/task-item/milestone/style.js +5 -0
- package/es/schema-component/antd/gantt/components/task-item/project/project.d.ts +3 -0
- package/es/schema-component/antd/gantt/components/task-item/project/project.js +31 -0
- package/es/schema-component/antd/gantt/components/task-item/project/style.d.ts +3 -0
- package/es/schema-component/antd/gantt/components/task-item/project/style.js +6 -0
- package/es/schema-component/antd/gantt/components/task-item/style.d.ts +3 -0
- package/es/schema-component/antd/gantt/components/task-item/style.js +6 -0
- package/es/schema-component/antd/gantt/components/task-item/task-item.d.ts +15 -0
- package/es/schema-component/antd/gantt/components/task-item/task-item.js +105 -0
- package/es/schema-component/antd/gantt/context.d.ts +3 -0
- package/es/schema-component/antd/gantt/context.js +4 -0
- package/es/schema-component/antd/gantt/helpers/bar-helper.d.ts +14 -0
- package/es/schema-component/antd/gantt/helpers/bar-helper.js +329 -0
- package/es/schema-component/antd/gantt/helpers/date-helper.d.ts +18 -0
- package/es/schema-component/antd/gantt/helpers/date-helper.js +182 -0
- package/es/schema-component/antd/gantt/helpers/other-helper.d.ts +9 -0
- package/es/schema-component/antd/gantt/helpers/other-helper.js +65 -0
- package/es/schema-component/antd/gantt/index.d.ts +2 -0
- package/es/schema-component/antd/gantt/index.js +11 -0
- package/es/schema-component/antd/gantt/types/bar-task.d.ts +22 -0
- package/es/schema-component/antd/gantt/types/bar-task.js +1 -0
- package/es/schema-component/antd/gantt/types/date-setup.d.ts +5 -0
- package/es/schema-component/antd/gantt/types/date-setup.js +1 -0
- package/es/schema-component/antd/gantt/types/gantt-task-actions.d.ts +8 -0
- package/es/schema-component/antd/gantt/types/gantt-task-actions.js +1 -0
- package/es/schema-component/antd/gantt/types/public-types.d.ts +136 -0
- package/es/schema-component/antd/gantt/types/public-types.js +12 -0
- package/es/schema-component/antd/grid/Grid.js +62 -116
- package/es/schema-component/antd/icon-picker/IconPicker.js +12 -29
- package/es/schema-component/antd/index.d.ts +6 -2
- package/es/schema-component/antd/index.js +6 -2
- package/es/schema-component/antd/index.less +28 -0
- package/es/schema-component/antd/input/EllipsisWithTooltip.js +12 -22
- package/es/schema-component/antd/input/Input.d.ts +3 -3
- package/es/schema-component/antd/input/Input.js +17 -16
- package/es/schema-component/antd/input/Json.d.ts +7 -5
- package/es/schema-component/antd/input/Json.js +9 -14
- package/es/schema-component/antd/input/ReadPretty.d.ts +2 -2
- package/es/schema-component/antd/input/ReadPretty.js +21 -21
- package/es/schema-component/antd/input-number/InputNumber.js +5 -11
- package/es/schema-component/antd/input-number/ReadPretty.js +3 -5
- package/es/schema-component/antd/kanban/Kanban.Card.Designer.TitleSwitch.d.ts +1 -0
- package/es/schema-component/antd/kanban/Kanban.Card.Designer.TitleSwitch.js +26 -0
- package/es/schema-component/antd/kanban/Kanban.Card.Designer.js +22 -22
- package/es/schema-component/antd/kanban/Kanban.Card.js +25 -38
- package/es/schema-component/antd/kanban/Kanban.Designer.js +19 -20
- package/es/schema-component/antd/kanban/Kanban.js +32 -59
- package/es/schema-component/antd/kanban/index.js +2 -0
- package/es/schema-component/antd/kanban/index.less +8 -5
- package/es/schema-component/antd/markdown/Markdown.Void.Designer.js +1 -3
- package/es/schema-component/antd/markdown/Markdown.Void.js +43 -58
- package/es/schema-component/antd/markdown/Markdown.js +14 -8
- package/es/schema-component/antd/markdown/highlight-theme/default.less +98 -0
- package/es/schema-component/antd/markdown/highlight-theme/table.less +36 -0
- package/es/schema-component/antd/markdown/markdown-it-plugins/mermaidPlugin.d.ts +5 -0
- package/es/schema-component/antd/markdown/markdown-it-plugins/mermaidPlugin.js +63 -0
- package/es/schema-component/antd/markdown/md.d.ts +5 -0
- package/es/schema-component/antd/markdown/md.js +14 -0
- package/es/schema-component/antd/markdown/util.d.ts +5 -1
- package/es/schema-component/antd/markdown/util.js +60 -8
- package/es/schema-component/antd/menu/Menu.Designer.js +27 -62
- package/es/schema-component/antd/menu/Menu.js +62 -114
- package/es/schema-component/antd/menu/MenuItemInitializers/index.js +170 -196
- package/es/schema-component/antd/menu/util.js +2 -21
- package/es/schema-component/antd/page/FixedBlock.d.ts +8 -7
- package/es/schema-component/antd/page/FixedBlock.js +100 -131
- package/es/schema-component/antd/page/Page.js +86 -113
- package/es/schema-component/antd/page/PageTabDesigner.js +11 -26
- package/es/schema-component/antd/pagination/index.js +6 -11
- package/es/schema-component/antd/password/Password.js +7 -12
- package/es/schema-component/antd/password/PasswordStrength.js +0 -32
- package/es/schema-component/antd/percent/Percent.js +5 -5
- package/es/schema-component/antd/preview/Preview.d.ts +15 -0
- package/es/schema-component/antd/preview/Preview.js +234 -0
- package/es/schema-component/antd/preview/index.d.ts +1 -0
- package/es/schema-component/antd/preview/index.js +1 -0
- package/es/schema-component/antd/radio/Radio.js +1 -4
- package/es/schema-component/antd/record-picker/InputRecordPicker.d.ts +2 -0
- package/es/schema-component/antd/record-picker/InputRecordPicker.js +166 -91
- package/es/schema-component/antd/record-picker/ReadPrettyRecordPicker.js +30 -46
- package/es/schema-component/antd/record-picker/useFieldNames.js +4 -5
- package/es/schema-component/antd/record-picker/util.d.ts +1 -1
- package/es/schema-component/antd/record-picker/util.js +14 -9
- package/es/schema-component/antd/remote-select/ReadPretty.js +22 -30
- package/es/schema-component/antd/remote-select/RemoteSelect.d.ts +2 -0
- package/es/schema-component/antd/remote-select/RemoteSelect.js +48 -70
- package/es/schema-component/antd/remote-select/shared.js +0 -1
- package/es/schema-component/antd/rich-text/RichText.js +6 -6
- package/es/schema-component/antd/select/ReadPretty.js +4 -9
- package/es/schema-component/antd/select/Select.js +15 -37
- package/es/schema-component/antd/select/shared.js +5 -25
- package/es/schema-component/antd/space/index.js +4 -7
- package/es/schema-component/antd/table/Table.Array.js +48 -97
- package/es/schema-component/antd/table/Table.Column.ActionBar.js +0 -2
- package/es/schema-component/antd/table/Table.Column.Decorator.js +5 -14
- package/es/schema-component/antd/table/Table.Column.Designer.js +37 -57
- package/es/schema-component/antd/table/Table.Designer.js +2 -3
- package/es/schema-component/antd/table/Table.RowActionDesigner.js +1 -3
- package/es/schema-component/antd/table/Table.RowSelection.js +6 -18
- package/es/schema-component/antd/table/Table.Void.Designer.js +8 -17
- package/es/schema-component/antd/table/Table.Void.js +17 -43
- package/es/schema-component/antd/table-v2/FilterDynamicComponent.d.ts +2 -0
- package/es/schema-component/antd/table-v2/FilterDynamicComponent.js +150 -0
- package/es/schema-component/antd/table-v2/Table.ActionColumnDesigner.js +1 -3
- package/es/schema-component/antd/table-v2/Table.Column.ActionBar.js +0 -2
- package/es/schema-component/antd/table-v2/Table.Column.Decorator.js +6 -17
- package/es/schema-component/antd/table-v2/Table.Column.Designer.js +28 -34
- package/es/schema-component/antd/table-v2/Table.Designer.js +2 -3
- package/es/schema-component/antd/table-v2/Table.js +145 -156
- package/es/schema-component/antd/table-v2/TableBlockDesigner.js +62 -46
- package/es/schema-component/antd/table-v2/TableField.js +5 -11
- package/es/schema-component/antd/table-v2/TableSelectorDesigner.js +42 -27
- package/es/schema-component/antd/table-v2/hooks/useUserVariable.d.ts +10 -0
- package/es/schema-component/antd/table-v2/hooks/useUserVariable.js +56 -0
- package/es/schema-component/antd/table-v2/utils.d.ts +2 -0
- package/es/schema-component/antd/table-v2/utils.js +38 -2
- package/es/schema-component/antd/tabs/Tabs.Designer.js +7 -9
- package/es/schema-component/antd/tabs/Tabs.js +1 -5
- package/es/schema-component/antd/time-picker/ReadPretty.js +2 -4
- package/es/schema-component/antd/time-picker/TimePicker.js +4 -6
- package/es/schema-component/antd/tree-select/ReadPretty.js +1 -8
- package/es/schema-component/antd/tree-select/TreeSelect.js +4 -4
- package/es/schema-component/antd/upload/ReadPretty.d.ts +1 -1
- package/es/schema-component/antd/upload/ReadPretty.js +18 -26
- package/es/schema-component/antd/upload/Upload.js +73 -58
- package/es/schema-component/antd/upload/shared.js +14 -53
- package/es/schema-component/antd/upload/type.d.ts +11 -0
- package/es/schema-component/antd/variable/Input.js +57 -67
- package/es/schema-component/antd/variable/JSONInput.js +19 -31
- package/es/schema-component/antd/variable/TextArea.d.ts +3 -0
- package/es/schema-component/antd/variable/TextArea.js +256 -161
- package/es/schema-component/antd/variable/Variable.js +2 -2
- package/es/schema-component/antd/variable/VariableSelect.d.ts +2 -0
- package/es/schema-component/antd/variable/VariableSelect.js +65 -0
- package/es/schema-component/antd/variable/XButton.d.ts +9 -0
- package/es/schema-component/antd/variable/XButton.js +17 -0
- package/es/schema-component/common/dnd-context/index.js +13 -39
- package/es/schema-component/common/sortable-item/SortableItem.js +21 -37
- package/es/schema-component/common/utils/logic.js +74 -93
- package/es/schema-component/common/utils/uitls.js +47 -43
- package/es/schema-component/core/DesignableSwitch.js +12 -14
- package/es/schema-component/core/FormProvider.js +5 -12
- package/es/schema-component/core/RemoteSchemaComponent.js +21 -30
- package/es/schema-component/core/SchemaComponent.js +12 -26
- package/es/schema-component/core/SchemaComponentOptions.js +4 -7
- package/es/schema-component/core/SchemaComponentProvider.js +19 -35
- package/es/schema-component/hooks/index.d.ts +2 -0
- package/es/schema-component/hooks/index.js +3 -1
- package/es/schema-component/hooks/useAttach.js +0 -1
- package/es/schema-component/hooks/useCompile.js +4 -5
- package/es/schema-component/hooks/useComponent.js +1 -4
- package/es/schema-component/hooks/useDesignable.js +205 -385
- package/es/schema-component/hooks/useDesigner.js +1 -4
- package/es/schema-component/hooks/useFieldComponentOptions.js +18 -13
- package/es/schema-component/hooks/useFieldProps.js +4 -5
- package/es/schema-component/hooks/useFieldTitle.js +2 -7
- package/es/schema-component/hooks/useProps.js +1 -5
- package/es/schema-component/hooks/useTableSize.d.ts +5 -0
- package/es/schema-component/hooks/useTableSize.js +42 -0
- package/es/schema-initializer/SchemaInitializer.js +47 -82
- package/es/schema-initializer/SchemaInitializerProvider.js +10 -16
- package/es/schema-initializer/SelectCollection.js +4 -9
- package/es/schema-initializer/buttons/BlockInitializers.js +22 -2
- package/es/schema-initializer/buttons/BulkEditFormItemInitializers.js +2 -3
- package/es/schema-initializer/buttons/CalendarActionInitializers.d.ts +4 -0
- package/es/schema-initializer/buttons/CalendarActionInitializers.js +5 -0
- package/es/schema-initializer/buttons/CalendarFormActionInitializers.d.ts +6 -0
- package/es/schema-initializer/buttons/CalendarFormActionInitializers.js +21 -0
- package/es/schema-initializer/buttons/CreateFormBlockInitializers.js +2 -3
- package/es/schema-initializer/buttons/CreateFormBulkEditBlockInitializers.js +2 -3
- package/es/schema-initializer/buttons/CustomFormItemInitializers.js +4 -7
- package/es/schema-initializer/buttons/FilterFormActionInitializers.d.ts +16 -0
- package/es/schema-initializer/buttons/FilterFormActionInitializers.js +24 -0
- package/es/schema-initializer/buttons/FormItemInitializers.d.ts +1 -0
- package/es/schema-initializer/buttons/FormItemInitializers.js +62 -8
- package/es/schema-initializer/buttons/GanttActionInitializers.d.ts +133 -0
- package/es/schema-initializer/buttons/GanttActionInitializers.js +9 -0
- package/es/schema-initializer/buttons/KanbanActionInitializers.d.ts +2 -0
- package/es/schema-initializer/buttons/KanbanActionInitializers.js +5 -0
- package/es/schema-initializer/buttons/ReadPrettyFormActionInitializers.d.ts +6 -0
- package/es/schema-initializer/buttons/ReadPrettyFormActionInitializers.js +17 -0
- package/es/schema-initializer/buttons/ReadPrettyFormItemInitializers.js +2 -6
- package/es/schema-initializer/buttons/RecordBlockInitializers.js +31 -47
- package/es/schema-initializer/buttons/RecordFormBlockInitializers.js +1 -2
- package/es/schema-initializer/buttons/SubTableActionInitializers.js +4 -4
- package/es/schema-initializer/buttons/TabPaneInitializers.js +53 -66
- package/es/schema-initializer/buttons/TableActionColumnInitializers.js +38 -18
- package/es/schema-initializer/buttons/TableActionInitializers.d.ts +17 -0
- package/es/schema-initializer/buttons/TableActionInitializers.js +51 -16
- package/es/schema-initializer/buttons/TableColumnInitializers.js +9 -15
- package/es/schema-initializer/buttons/TableSelectorInitializers.js +2 -3
- package/es/schema-initializer/buttons/index.d.ts +2 -0
- package/es/schema-initializer/buttons/index.js +4 -2
- package/es/schema-initializer/components/BulkEditField.js +31 -56
- package/es/schema-initializer/components/CreateRecordAction.js +74 -69
- package/es/schema-initializer/components/assigned-field/AssignedField.js +33 -77
- package/es/schema-initializer/index.d.ts +1 -1
- package/es/schema-initializer/index.js +1 -1
- package/es/schema-initializer/items/ActionInitializer.js +4 -4
- package/es/schema-initializer/items/BlockInitializer.js +4 -5
- package/es/schema-initializer/items/BulkDestroyActionInitializer.js +4 -6
- package/es/schema-initializer/items/BulkEditSubmitActionInitializer.js +4 -4
- package/es/schema-initializer/items/CalendarBlockInitializer.js +61 -71
- package/es/schema-initializer/items/CollectionFieldInitializer.js +6 -6
- package/es/schema-initializer/items/CreateActionInitializer.js +5 -4
- package/es/schema-initializer/items/CreateChildInitializer.d.ts +1 -0
- package/es/schema-initializer/items/CreateChildInitializer.js +62 -0
- package/es/schema-initializer/items/CreateFilterActionInitializer.d.ts +1 -0
- package/es/schema-initializer/items/CreateFilterActionInitializer.js +23 -0
- package/es/schema-initializer/items/CreateFormBlockInitializer.js +51 -70
- package/es/schema-initializer/items/CreateFormBulkEditBlockInitializer.js +47 -66
- package/es/schema-initializer/items/CreateResetActionInitializer.d.ts +1 -0
- package/es/schema-initializer/items/CreateResetActionInitializer.js +21 -0
- package/es/schema-initializer/items/CreateSubmitActionInitializer.js +6 -6
- package/es/schema-initializer/items/CustomizeActionInitializer.js +4 -6
- package/es/schema-initializer/items/CustomizeBulkEditActionInitializer.js +4 -4
- package/es/schema-initializer/items/DataBlockInitializer.js +44 -61
- package/es/schema-initializer/items/DeleteEventActionInitializer.js +4 -4
- package/es/schema-initializer/items/DestroyActionInitializer.js +4 -4
- package/es/schema-initializer/items/DetailsBlockInitializer.js +25 -32
- package/es/schema-initializer/items/ExpandActionInitializer.d.ts +2 -0
- package/es/schema-initializer/items/ExpandActionInitializer.js +58 -0
- package/es/schema-initializer/items/FilterActionInitializer.js +4 -4
- package/es/schema-initializer/items/FilterBlockInitializer.d.ts +1 -0
- package/es/schema-initializer/items/FilterBlockInitializer.js +77 -0
- package/es/schema-initializer/items/FilterCollapseBlockInitializer.d.ts +1 -0
- package/es/schema-initializer/items/FilterCollapseBlockInitializer.js +44 -0
- package/es/schema-initializer/items/FilterFormBlockInitializer.d.ts +1 -0
- package/es/schema-initializer/items/FilterFormBlockInitializer.js +28 -0
- package/es/schema-initializer/items/FormBlockInitializer.js +4 -6
- package/es/schema-initializer/items/G2PlotInitializer.js +6 -10
- package/es/schema-initializer/items/GanttBlockInitializer.d.ts +1 -0
- package/es/schema-initializer/items/GanttBlockInitializer.js +166 -0
- package/es/schema-initializer/items/InitializerWithSwitch.js +8 -12
- package/es/schema-initializer/items/KanbanBlockInitializer.js +85 -100
- package/es/schema-initializer/items/MarkdownBlockInitializer.js +5 -7
- package/es/schema-initializer/items/PrintActionInitializer.js +4 -4
- package/es/schema-initializer/items/RecordAssociationBlockInitializer.js +37 -53
- package/es/schema-initializer/items/RecordAssociationCalendarBlockInitializer.js +93 -115
- package/es/schema-initializer/items/RecordAssociationDetailsBlockInitializer.js +37 -53
- package/es/schema-initializer/items/RecordAssociationFormBlockInitializer.js +52 -71
- package/es/schema-initializer/items/RecordFormBlockInitializer.js +49 -68
- package/es/schema-initializer/items/RecordReadPrettyAssociationFormBlockInitializer.js +51 -72
- package/es/schema-initializer/items/RecordReadPrettyFormBlockInitializer.js +52 -73
- package/es/schema-initializer/items/RefreshActionInitializer.js +4 -4
- package/es/schema-initializer/items/SubmitActionInitializer.js +7 -6
- package/es/schema-initializer/items/TableActionColumnInitializer.js +4 -4
- package/es/schema-initializer/items/TableBlockInitializer.js +24 -32
- package/es/schema-initializer/items/TableCollectionFieldInitializer.js +4 -4
- package/es/schema-initializer/items/TableSelectorInitializer.js +24 -35
- package/es/schema-initializer/items/UpdateActionInitializer.js +4 -4
- package/es/schema-initializer/items/UpdateSubmitActionInitializer.js +4 -4
- package/es/schema-initializer/items/ViewActionInitializer.js +4 -4
- package/es/schema-initializer/items/index.d.ts +7 -0
- package/es/schema-initializer/items/index.js +9 -2
- package/es/schema-initializer/utils.d.ts +174 -1
- package/es/schema-initializer/utils.js +665 -336
- package/es/schema-items/OpenModeSchemaItems.d.ts +7 -0
- package/es/schema-items/OpenModeSchemaItems.js +78 -0
- package/es/schema-items/index.d.ts +1 -0
- package/es/schema-items/index.js +1 -0
- package/es/schema-settings/DataTemplates/FormDataTemplates.d.ts +2 -0
- package/es/schema-settings/DataTemplates/FormDataTemplates.js +174 -0
- package/es/schema-settings/DataTemplates/TreeLabel.d.ts +1 -0
- package/es/schema-settings/DataTemplates/TreeLabel.js +19 -0
- package/es/schema-settings/DataTemplates/components/AsDefaultTemplate.d.ts +2 -0
- package/es/schema-settings/DataTemplates/components/AsDefaultTemplate.js +47 -0
- package/es/schema-settings/DataTemplates/components/DataTemplateTitle.d.ts +11 -0
- package/es/schema-settings/DataTemplates/components/DataTemplateTitle.js +261 -0
- package/es/schema-settings/DataTemplates/hooks/useCollectionState.d.ts +13 -0
- package/es/schema-settings/DataTemplates/hooks/useCollectionState.js +146 -0
- package/es/schema-settings/DataTemplates/index.d.ts +1 -0
- package/es/schema-settings/DataTemplates/index.js +1 -0
- package/es/schema-settings/EnableChildCollections/index.js +28 -38
- package/es/schema-settings/GeneralSchemaDesigner.js +11 -20
- package/es/schema-settings/LinkageRules/DynamicComponent.js +9 -61
- package/es/schema-settings/LinkageRules/FilterDynamicComponent.js +3 -3
- package/es/schema-settings/LinkageRules/LinkageRuleAction.js +34 -49
- package/es/schema-settings/LinkageRules/LinkageRuleActionGroup.js +9 -13
- package/es/schema-settings/LinkageRules/ValueDynamicComponent.js +37 -29
- package/es/schema-settings/LinkageRules/Variables.js +11 -34
- package/es/schema-settings/LinkageRules/action-hooks.js +5 -20
- package/es/schema-settings/LinkageRules/components/EnableLinkage.d.ts +2 -0
- package/es/schema-settings/LinkageRules/components/EnableLinkage.js +40 -0
- package/es/schema-settings/LinkageRules/components/LinkageHeader.d.ts +11 -0
- package/es/schema-settings/LinkageRules/components/LinkageHeader.js +252 -0
- package/es/schema-settings/LinkageRules/context.d.ts +1 -1
- package/es/schema-settings/LinkageRules/context.js +1 -1
- package/es/schema-settings/LinkageRules/index.js +20 -18
- package/es/schema-settings/LinkageRules/type.js +0 -1
- package/es/schema-settings/LinkageRules/useValues.js +10 -21
- package/es/schema-settings/SchemaSettings.d.ts +3 -0
- package/es/schema-settings/SchemaSettings.js +733 -586
- package/es/schema-templates/BlockTemplate.js +3 -11
- package/es/schema-templates/BlockTemplateDetails.js +35 -52
- package/es/schema-templates/BlockTemplatePage.js +2 -3
- package/es/schema-templates/SchemaTemplateManagerProvider.js +100 -145
- package/es/schema-templates/SchemaTemplateShortcut.js +1 -2
- package/es/schema-templates/schemas/uiSchemaTemplates.js +41 -63
- package/es/settings-form/SettingsForm.js +87 -125
- package/es/system-settings/SystemSettingsProvider.js +14 -2
- package/es/system-settings/SystemSettingsShortcut.js +80 -98
- package/es/user/ChangePassword.js +43 -65
- package/es/user/CurrentUser.js +29 -44
- package/es/user/CurrentUserProvider.js +1 -6
- package/es/user/EditProfile.js +44 -69
- package/es/user/LanguageSettings.js +38 -53
- package/es/user/SigninPage.js +38 -56
- package/es/user/SigninPageExtension.js +3 -11
- package/es/user/SignupPage.js +29 -42
- package/es/user/SwitchRole.js +30 -38
- package/es/user/ThemeSettings.d.ts +1 -0
- package/es/user/ThemeSettings.js +70 -0
- package/es/user/VerificationCode.js +51 -76
- package/lib/acl/ACLProvider.js +34 -162
- package/lib/acl/ACLShortcut.js +11 -38
- package/lib/acl/Configuration/ConfigureCenter.js +56 -112
- package/lib/acl/Configuration/MenuConfigure.js +91 -159
- package/lib/acl/Configuration/MenuItemsProvider.js +0 -21
- package/lib/acl/Configuration/PermisionProvider.js +53 -96
- package/lib/acl/Configuration/RoleConfigure.js +21 -59
- package/lib/acl/Configuration/RoleTable.js +5 -23
- package/lib/acl/Configuration/RolesResourcesActions.js +10 -67
- package/lib/acl/Configuration/ScopeSelect.js +5 -26
- package/lib/acl/Configuration/StrategyActions.js +10 -38
- package/lib/acl/Configuration/index.js +0 -6
- package/lib/acl/Configuration/schemas/roleCollections.js +0 -3
- package/lib/acl/Configuration/schemas/roles.js +4 -13
- package/lib/acl/Configuration/schemas/scopes.js +4 -13
- package/lib/acl/Configuration/schemas/useRoleResourceValues.js +5 -12
- package/lib/acl/Configuration/schemas/useSaveRoleResourceAction.js +23 -34
- package/lib/acl/index.js +0 -5
- package/lib/acl/style.less +1 -1
- package/lib/antd-config-provider/index.js +29 -57
- package/lib/antd-config-provider/loadConstrueLocale.js +4 -12
- package/lib/api-client/APIClient.js +10 -47
- package/lib/api-client/APIClientProvider.js +1 -6
- package/lib/api-client/context.js +0 -3
- package/lib/api-client/hooks/assign.js +0 -23
- package/lib/api-client/hooks/index.js +0 -6
- package/lib/api-client/hooks/useAPIClient.js +0 -3
- package/lib/api-client/hooks/useRequest.js +35 -68
- package/lib/api-client/hooks/useResource.js +0 -3
- package/lib/api-client/index.js +0 -8
- package/lib/appInfo/CurrentAppInfoProvider.js +16 -14
- package/lib/appInfo/index.js +0 -2
- package/lib/application/Application.js +82 -147
- package/lib/application/compose.js +12 -26
- package/lib/application/index.js +0 -4
- package/lib/async-data-provider/index.js +6 -22
- package/lib/block-provider/BlockProvider.d.ts +1 -0
- package/lib/block-provider/BlockProvider.js +56 -136
- package/lib/block-provider/BlockSchemaComponentProvider.js +10 -24
- package/lib/block-provider/CalendarBlockProvider.d.ts +1 -0
- package/lib/block-provider/CalendarBlockProvider.js +16 -32
- package/lib/block-provider/DetailsBlockProvider.js +11 -32
- package/lib/block-provider/FilterFormBlockProvider.d.ts +1 -0
- package/lib/block-provider/FilterFormBlockProvider.js +24 -0
- package/lib/block-provider/FormBlockProvider.d.ts +3 -0
- package/lib/block-provider/FormBlockProvider.js +73 -49
- package/lib/block-provider/FormFieldProvider.js +17 -39
- package/lib/block-provider/GanttBlockProvider.d.ts +11 -0
- package/lib/block-provider/GanttBlockProvider.js +162 -0
- package/lib/block-provider/KanbanBlockProvider.js +52 -127
- package/lib/block-provider/SharedFilterProvider.js +10 -36
- package/lib/block-provider/TableBlockProvider.d.ts +3 -0
- package/lib/block-provider/TableBlockProvider.js +162 -114
- package/lib/block-provider/TableFieldProvider.js +107 -177
- package/lib/block-provider/TableSelectorProvider.d.ts +18 -1
- package/lib/block-provider/TableSelectorProvider.js +107 -123
- package/lib/block-provider/hooks/index.d.ts +37 -0
- package/lib/block-provider/hooks/index.js +1097 -1015
- package/lib/block-provider/index.d.ts +4 -0
- package/lib/block-provider/index.js +33 -18
- package/lib/board/Board.js +110 -169
- package/lib/board/Card.js +7 -12
- package/lib/board/CardAdder.js +6 -23
- package/lib/board/CardForm.js +1 -10
- package/lib/board/Column.js +27 -52
- package/lib/board/ColumnAdder.js +5 -22
- package/lib/board/ColumnForm.js +1 -10
- package/lib/board/DefaultCard.js +3 -7
- package/lib/board/DefaultColumnHeader.js +17 -38
- package/lib/board/Kanban.js +5 -26
- package/lib/board/helpers.js +7 -24
- package/lib/board/index.js +0 -2
- package/lib/board/services.js +4 -12
- package/lib/board/utils.js +5 -24
- package/lib/board/withDroppable.js +5 -14
- package/lib/china-region/index.js +5 -27
- package/lib/collection-manager/CollectionField.js +14 -51
- package/lib/collection-manager/CollectionFieldProvider.js +5 -17
- package/lib/collection-manager/CollectionHistoryProvider.js +23 -47
- package/lib/collection-manager/CollectionManagerProvider.js +86 -140
- package/lib/collection-manager/CollectionManagerSchemaComponentProvider.js +4 -16
- package/lib/collection-manager/CollectionManagerShortcut.js +17 -42
- package/lib/collection-manager/CollectionProvider.js +4 -14
- package/lib/collection-manager/Configuration/AddCategoryAction.js +35 -73
- package/lib/collection-manager/Configuration/AddCollectionAction.js +105 -151
- package/lib/collection-manager/Configuration/AddFieldAction.js +86 -132
- package/lib/collection-manager/Configuration/AddSubFieldAction.js +36 -74
- package/lib/collection-manager/Configuration/CollectionFieldsTable.js +10 -26
- package/lib/collection-manager/Configuration/CollectionFieldsTableArray.js +35 -98
- package/lib/collection-manager/Configuration/ConfigurationTable.js +159 -135
- package/lib/collection-manager/Configuration/ConfigurationTabs.js +94 -163
- package/lib/collection-manager/Configuration/EditCategoryAction.js +43 -85
- package/lib/collection-manager/Configuration/EditCollectionAction.js +59 -120
- package/lib/collection-manager/Configuration/EditFieldAction.js +101 -154
- package/lib/collection-manager/Configuration/EditSubFieldAction.js +54 -103
- package/lib/collection-manager/Configuration/OverridingCollectionField.js +88 -155
- package/lib/collection-manager/Configuration/SyncFieldsAction.d.ts +2 -0
- package/lib/collection-manager/Configuration/SyncFieldsAction.js +245 -0
- package/lib/collection-manager/Configuration/ViewInheritedField.js +50 -99
- package/lib/collection-manager/Configuration/components/CollectionCategory.js +0 -6
- package/lib/collection-manager/Configuration/components/CollectionFieldInterface.js +1 -10
- package/lib/collection-manager/Configuration/components/CollectionTemplate.js +1 -10
- package/lib/collection-manager/Configuration/components/FieldSummary.js +2 -17
- package/lib/collection-manager/Configuration/components/TemplateSummay.d.ts +2 -0
- package/lib/collection-manager/Configuration/components/TemplateSummay.js +34 -0
- package/lib/collection-manager/Configuration/components/index.js +5 -26
- package/lib/collection-manager/Configuration/index.d.ts +1 -0
- package/lib/collection-manager/Configuration/index.js +11 -29
- package/lib/collection-manager/Configuration/interfaces.js +4 -20
- package/lib/collection-manager/Configuration/schemas/collectionFields.js +17 -5
- package/lib/collection-manager/Configuration/schemas/collections.js +22 -39
- package/lib/collection-manager/Configuration/templates.js +6 -16
- package/lib/collection-manager/ResourceActionProvider.js +18 -55
- package/lib/collection-manager/action-hooks.d.ts +2 -0
- package/lib/collection-manager/action-hooks.js +425 -485
- package/lib/collection-manager/context.js +0 -2
- package/lib/collection-manager/hooks/index.js +0 -8
- package/lib/collection-manager/hooks/useCollection.d.ts +4 -0
- package/lib/collection-manager/hooks/useCollection.js +12 -16
- package/lib/collection-manager/hooks/useCollectionDataSource.d.ts +1 -1
- package/lib/collection-manager/hooks/useCollectionDataSource.js +5 -10
- package/lib/collection-manager/hooks/useCollectionField.js +4 -14
- package/lib/collection-manager/hooks/useCollectionManager.d.ts +23 -3
- package/lib/collection-manager/hooks/useCollectionManager.js +127 -97
- package/lib/collection-manager/hooks/useOptions.js +5 -13
- package/lib/collection-manager/index.d.ts +1 -1
- package/lib/collection-manager/index.js +7 -36
- package/lib/collection-manager/interfaces/attachment.js +5 -12
- package/lib/collection-manager/interfaces/checkbox.js +5 -6
- package/lib/collection-manager/interfaces/checkboxGroup.js +5 -6
- package/lib/collection-manager/interfaces/chinaRegion.js +5 -11
- package/lib/collection-manager/interfaces/components/index.js +0 -15
- package/lib/collection-manager/interfaces/createdAt.js +5 -6
- package/lib/collection-manager/interfaces/createdBy.js +5 -7
- package/lib/collection-manager/interfaces/datetime.js +5 -6
- package/lib/collection-manager/interfaces/email.js +5 -6
- package/lib/collection-manager/interfaces/icon.js +6 -7
- package/lib/collection-manager/interfaces/id.js +1 -2
- package/lib/collection-manager/interfaces/index.d.ts +1 -0
- package/lib/collection-manager/interfaces/index.js +11 -64
- package/lib/collection-manager/interfaces/input.js +5 -8
- package/lib/collection-manager/interfaces/integer.js +6 -9
- package/lib/collection-manager/interfaces/json.js +8 -9
- package/lib/collection-manager/interfaces/linkTo.js +25 -16
- package/lib/collection-manager/interfaces/m2m.js +21 -18
- package/lib/collection-manager/interfaces/m2o.js +21 -13
- package/lib/collection-manager/interfaces/markdown.js +5 -8
- package/lib/collection-manager/interfaces/multipleSelect.js +5 -6
- package/lib/collection-manager/interfaces/number.js +6 -8
- package/lib/collection-manager/interfaces/o2m.js +12 -15
- package/lib/collection-manager/interfaces/o2o.js +42 -32
- package/lib/collection-manager/interfaces/password.js +6 -8
- package/lib/collection-manager/interfaces/percent.js +11 -19
- package/lib/collection-manager/interfaces/phone.js +8 -8
- package/lib/collection-manager/interfaces/properties/index.js +7 -14
- package/lib/collection-manager/interfaces/properties/operators.d.ts +11 -19
- package/lib/collection-manager/interfaces/properties/operators.js +6 -21
- package/lib/collection-manager/interfaces/radioGroup.js +5 -6
- package/lib/collection-manager/interfaces/richText.js +5 -8
- package/lib/collection-manager/interfaces/select.js +5 -6
- package/lib/collection-manager/interfaces/subTable.js +15 -15
- package/lib/collection-manager/interfaces/textarea.js +5 -8
- package/lib/collection-manager/interfaces/time.js +5 -6
- package/lib/collection-manager/interfaces/updatedAt.js +5 -6
- package/lib/collection-manager/interfaces/updatedBy.js +5 -7
- package/lib/collection-manager/interfaces/url.d.ts +2 -0
- package/lib/collection-manager/interfaces/url.js +37 -0
- package/lib/collection-manager/sub-table.js +79 -136
- package/lib/collection-manager/templates/calendar.js +11 -12
- package/lib/collection-manager/templates/components/PreviewFields.d.ts +2 -0
- package/lib/collection-manager/templates/components/PreviewFields.js +265 -0
- package/lib/collection-manager/templates/components/PreviewTable.d.ts +1 -0
- package/lib/collection-manager/templates/components/PreviewTable.js +142 -0
- package/lib/collection-manager/templates/expression.d.ts +2 -0
- package/lib/collection-manager/templates/expression.js +59 -0
- package/lib/collection-manager/templates/general.js +0 -2
- package/lib/collection-manager/templates/index.d.ts +3 -0
- package/lib/collection-manager/templates/index.js +33 -4
- package/lib/collection-manager/templates/properties/index.d.ts +1 -1
- package/lib/collection-manager/templates/properties/index.js +5 -17
- package/lib/collection-manager/templates/tree.d.ts +2 -0
- package/lib/collection-manager/templates/tree.js +77 -0
- package/lib/collection-manager/templates/types.d.ts +6 -0
- package/lib/collection-manager/templates/view.d.ts +2 -0
- package/lib/collection-manager/templates/view.js +142 -0
- package/lib/collection-manager/types.d.ts +2 -0
- package/lib/document-title/index.js +7 -32
- package/lib/filter-provider/FilterProvider.d.ts +45 -0
- package/lib/filter-provider/FilterProvider.js +154 -0
- package/lib/filter-provider/index.d.ts +2 -0
- package/lib/filter-provider/index.js +27 -0
- package/lib/filter-provider/utils.d.ts +27 -0
- package/lib/filter-provider/utils.js +184 -0
- package/lib/formula/Expression.js +47 -124
- package/lib/formula/Result.js +13 -45
- package/lib/formula/index.js +0 -5
- package/lib/i18n/i18n.js +2 -8
- package/lib/i18n/index.js +0 -2
- package/lib/icon/Icon.js +6 -31
- package/lib/icon/index.js +0 -2
- package/lib/index.d.ts +1 -1
- package/lib/index.js +11 -55
- package/lib/locale/en_US.d.ts +67 -4
- package/lib/locale/en_US.js +68 -5
- package/lib/locale/index.js +0 -3
- package/lib/locale/ja_JP.d.ts +54 -2
- package/lib/locale/ja_JP.js +55 -4
- package/lib/locale/pt_BR.d.ts +650 -0
- package/lib/locale/pt_BR.js +656 -0
- package/lib/locale/ru_RU.d.ts +29 -2
- package/lib/locale/ru_RU.js +30 -3
- package/lib/locale/tr_TR.d.ts +30 -2
- package/lib/locale/tr_TR.js +31 -3
- package/lib/locale/zh_CN.d.ts +84 -6
- package/lib/locale/zh_CN.js +85 -7
- package/lib/plugin-manager/PinnedPluginListProvider.d.ts +5 -0
- package/lib/plugin-manager/PinnedPluginListProvider.js +60 -0
- package/lib/plugin-manager/PluginManager.js +22 -73
- package/lib/plugin-manager/PluginManagerProvider.js +1 -6
- package/lib/plugin-manager/context.d.ts +3 -0
- package/lib/plugin-manager/context.js +6 -4
- package/lib/plugin-manager/index.d.ts +1 -0
- package/lib/plugin-manager/index.js +11 -6
- package/lib/pm/PluginManagerLink.js +22 -63
- package/lib/pm/index.js +246 -235
- package/lib/powered-by/index.js +1 -10
- package/lib/record-provider/index.js +8 -29
- package/lib/route-switch/RouteSwitch.js +5 -17
- package/lib/route-switch/RouteSwitchProvider.js +10 -19
- package/lib/route-switch/antd/admin-layout/index.js +43 -94
- package/lib/route-switch/antd/auth-layout/index.js +1 -11
- package/lib/route-switch/antd/index.js +0 -6
- package/lib/route-switch/antd/route-schema-component/index.js +0 -5
- package/lib/route-switch/context.js +0 -2
- package/lib/route-switch/hooks.js +2 -13
- package/lib/route-switch/index.js +0 -12
- package/lib/schema-component/antd/AntdSchemaComponentProvider.js +4 -17
- package/lib/schema-component/antd/action/Action.Container.js +5 -16
- package/lib/schema-component/antd/action/Action.Designer.js +52 -146
- package/lib/schema-component/antd/action/Action.Drawer.js +11 -30
- package/lib/schema-component/antd/action/Action.Link.js +4 -9
- package/lib/schema-component/antd/action/Action.Modal.d.ts +2 -1
- package/lib/schema-component/antd/action/Action.Modal.js +11 -28
- package/lib/schema-component/antd/action/Action.Page.js +5 -23
- package/lib/schema-component/antd/action/Action.js +42 -90
- package/lib/schema-component/antd/action/ActionBar.js +11 -33
- package/lib/schema-component/antd/action/context.js +0 -2
- package/lib/schema-component/antd/action/hooks.d.ts +1 -0
- package/lib/schema-component/antd/action/hooks.js +43 -62
- package/lib/schema-component/antd/action/index.js +0 -8
- package/lib/schema-component/antd/action/types.d.ts +1 -1
- package/lib/schema-component/antd/action/utils.d.ts +1 -1
- package/lib/schema-component/antd/action/utils.js +26 -25
- package/lib/schema-component/antd/association-filter/ActionBarAssociationFilterAction.js +19 -25
- package/lib/schema-component/antd/association-filter/AssociationFilter.BlockDesigner.d.ts +1 -0
- package/lib/schema-component/antd/association-filter/AssociationFilter.BlockDesigner.js +42 -0
- package/lib/schema-component/antd/association-filter/AssociationFilter.FilterBlockInitializer.d.ts +1 -0
- package/lib/schema-component/antd/association-filter/AssociationFilter.FilterBlockInitializer.js +95 -0
- package/lib/schema-component/antd/association-filter/AssociationFilter.Initializer.js +13 -25
- package/lib/schema-component/antd/association-filter/AssociationFilter.Item.Designer.js +89 -37
- package/lib/schema-component/antd/association-filter/AssociationFilter.Item.js +48 -127
- package/lib/schema-component/antd/association-filter/AssociationFilter.d.ts +3 -0
- package/lib/schema-component/antd/association-filter/AssociationFilter.js +13 -29
- package/lib/schema-component/antd/association-filter/AssociationFilterDesignerDelete.js +2 -18
- package/lib/schema-component/antd/association-filter/AssociationFilterDesignerDisplayField.js +4 -15
- package/lib/schema-component/antd/association-filter/AssociationFilterProvider.d.ts +1 -0
- package/lib/schema-component/antd/association-filter/AssociationFilterProvider.js +12 -0
- package/lib/schema-component/antd/association-filter/utilts.d.ts +2 -0
- package/lib/schema-component/antd/association-filter/utilts.js +10 -0
- package/lib/schema-component/antd/association-select/AssociationSelect.d.ts +1 -0
- package/lib/schema-component/antd/association-select/AssociationSelect.js +492 -103
- package/lib/schema-component/antd/association-select/ReadPretty.js +4 -11
- package/lib/schema-component/antd/association-select/index.js +0 -2
- package/lib/schema-component/antd/association-select/useServiceOptions.js +8 -21
- package/lib/schema-component/antd/block-item/BlockItem.js +0 -10
- package/lib/schema-component/antd/block-item/TestDesigner.js +1 -8
- package/lib/schema-component/antd/block-item/index.js +0 -4
- package/lib/schema-component/antd/calendar/Calendar.Designer.js +22 -40
- package/lib/schema-component/antd/calendar/Calendar.js +29 -88
- package/lib/schema-component/antd/calendar/DeleteEvent.js +52 -97
- package/lib/schema-component/antd/calendar/Event.js +0 -4
- package/lib/schema-component/antd/calendar/Nav.js +2 -15
- package/lib/schema-component/antd/calendar/Title.js +5 -17
- package/lib/schema-component/antd/calendar/Today.js +3 -17
- package/lib/schema-component/antd/calendar/ViewSelect.js +5 -16
- package/lib/schema-component/antd/calendar/components/Header.js +7 -15
- package/lib/schema-component/antd/calendar/context.js +0 -4
- package/lib/schema-component/antd/calendar/index.js +0 -12
- package/lib/schema-component/antd/calendar/style.less +1 -1
- package/lib/schema-component/antd/calendar/utils.js +0 -13
- package/lib/schema-component/antd/card-item/CardItem.js +5 -17
- package/lib/schema-component/antd/card-item/index.js +0 -2
- package/lib/schema-component/antd/cascader/Cascader.js +19 -46
- package/lib/schema-component/antd/cascader/ReadPretty.js +3 -20
- package/lib/schema-component/antd/cascader/index.js +0 -2
- package/lib/schema-component/antd/checkbox/Checkbox.js +5 -16
- package/lib/schema-component/antd/checkbox/index.js +0 -2
- package/lib/schema-component/antd/collection-select/CollectionSelect.d.ts +8 -0
- package/lib/schema-component/antd/collection-select/CollectionSelect.js +69 -0
- package/lib/schema-component/antd/collection-select/index.d.ts +1 -0
- package/lib/schema-component/antd/collection-select/index.js +16 -0
- package/lib/schema-component/antd/color-select/ColorSelect.js +4 -13
- package/lib/schema-component/antd/color-select/index.js +0 -2
- package/lib/schema-component/antd/cron/Cron.d.ts +6 -3
- package/lib/schema-component/antd/cron/Cron.js +22 -26
- package/lib/schema-component/antd/cron/CronSet.d.ts +7 -0
- package/lib/schema-component/antd/cron/CronSet.js +116 -0
- package/lib/schema-component/antd/cron/index.d.ts +1 -0
- package/lib/schema-component/antd/cron/index.js +11 -2
- package/lib/schema-component/antd/cron/locale/index.d.ts +0 -1
- package/lib/schema-component/antd/cron/locale/index.js +1 -7
- package/lib/schema-component/antd/cron/locale/zh-CN.js +8 -4
- package/lib/schema-component/antd/date-picker/DatePicker.d.ts +8 -4
- package/lib/schema-component/antd/date-picker/DatePicker.js +45 -8
- package/lib/schema-component/antd/date-picker/ReadPretty.js +0 -18
- package/lib/schema-component/antd/date-picker/index.js +0 -2
- package/lib/schema-component/antd/date-picker/util.d.ts +25 -2
- package/lib/schema-component/antd/date-picker/util.js +133 -40
- package/lib/schema-component/antd/details/Details.d.ts +7 -0
- package/lib/schema-component/antd/details/Details.js +9 -0
- package/lib/schema-component/antd/details/index.d.ts +1 -0
- package/lib/schema-component/antd/details/index.js +16 -0
- package/lib/schema-component/antd/filter/DynamicComponent.js +11 -76
- package/lib/schema-component/antd/filter/Filter.Action.Designer.js +10 -39
- package/lib/schema-component/antd/filter/Filter.js +14 -23
- package/lib/schema-component/antd/filter/FilterAction.js +34 -79
- package/lib/schema-component/antd/filter/FilterGroup.js +7 -27
- package/lib/schema-component/antd/filter/FilterItem.js +10 -29
- package/lib/schema-component/antd/filter/FilterItems.js +0 -8
- package/lib/schema-component/antd/filter/SaveDefaultValue.js +4 -22
- package/lib/schema-component/antd/filter/context.js +0 -2
- package/lib/schema-component/antd/filter/index.js +0 -4
- package/lib/schema-component/antd/filter/useFilterActionProps.js +69 -76
- package/lib/schema-component/antd/filter/useOperators.d.ts +5 -0
- package/lib/schema-component/antd/filter/useOperators.js +32 -0
- package/lib/schema-component/antd/filter/useValues.js +15 -47
- package/lib/schema-component/antd/form/Form.Designer.js +2 -9
- package/lib/schema-component/antd/form/Form.js +34 -69
- package/lib/schema-component/antd/form/index.js +0 -2
- package/lib/schema-component/antd/form-item/FormItem.FilterFormDesigner.d.ts +1 -0
- package/lib/schema-component/antd/form-item/FormItem.FilterFormDesigner.js +34 -0
- package/lib/schema-component/antd/form-item/FormItem.js +88 -95
- package/lib/schema-component/antd/form-item/SchemaSettingOptions.d.ts +23 -0
- package/lib/schema-component/antd/form-item/SchemaSettingOptions.js +634 -0
- package/lib/schema-component/antd/form-item/index.js +0 -2
- package/lib/schema-component/antd/form-v2/Form.Designer.js +30 -64
- package/lib/schema-component/antd/form-v2/Form.FilterDesigner.d.ts +5 -0
- package/lib/schema-component/antd/form-v2/Form.FilterDesigner.js +48 -0
- package/lib/schema-component/antd/form-v2/Form.d.ts +2 -0
- package/lib/schema-component/antd/form-v2/Form.js +28 -61
- package/lib/schema-component/antd/form-v2/FormField.js +1 -14
- package/lib/schema-component/antd/form-v2/Templates.d.ts +4 -0
- package/lib/schema-component/antd/form-v2/Templates.js +178 -0
- package/lib/schema-component/antd/form-v2/index.d.ts +1 -1
- package/lib/schema-component/antd/form-v2/index.js +2 -4
- package/lib/schema-component/antd/form-v2/utils.d.ts +0 -1
- package/lib/schema-component/antd/form-v2/utils.js +22 -107
- package/lib/schema-component/antd/g2plot/G2Plot.js +8 -37
- package/lib/schema-component/antd/g2plot/G2PlotDesigner.js +40 -61
- package/lib/schema-component/antd/g2plot/index.js +0 -2
- package/lib/schema-component/antd/g2plot/requestChartData.js +19 -27
- package/lib/schema-component/antd/gantt/Gantt.Designer.d.ts +1 -0
- package/lib/schema-component/antd/gantt/Gantt.Designer.js +222 -0
- package/lib/schema-component/antd/gantt/components/calendar/calendar.d.ts +14 -0
- package/lib/schema-component/antd/gantt/components/calendar/calendar.js +332 -0
- package/lib/schema-component/antd/gantt/components/calendar/style.d.ts +4 -0
- package/lib/schema-component/antd/gantt/components/calendar/style.js +17 -0
- package/lib/schema-component/antd/gantt/components/calendar/top-part-of-calendar.d.ts +11 -0
- package/lib/schema-component/antd/gantt/components/calendar/top-part-of-calendar.js +34 -0
- package/lib/schema-component/antd/gantt/components/gantt/Event.d.ts +2 -0
- package/lib/schema-component/antd/gantt/components/gantt/Event.js +13 -0
- package/lib/schema-component/antd/gantt/components/gantt/gantt.d.ts +5 -0
- package/lib/schema-component/antd/gantt/components/gantt/gantt.js +648 -0
- package/lib/schema-component/antd/gantt/components/gantt/style.d.ts +3 -0
- package/lib/schema-component/antd/gantt/components/gantt/style.js +15 -0
- package/lib/schema-component/antd/gantt/components/gantt/task-gantt-content.d.ts +25 -0
- package/lib/schema-component/antd/gantt/components/gantt/task-gantt-content.js +375 -0
- package/lib/schema-component/antd/gantt/components/gantt/task-gantt.d.ts +14 -0
- package/lib/schema-component/antd/gantt/components/gantt/task-gantt.js +76 -0
- package/lib/schema-component/antd/gantt/components/grid/grid-body.d.ts +13 -0
- package/lib/schema-component/antd/gantt/components/grid/grid-body.js +120 -0
- package/lib/schema-component/antd/gantt/components/grid/grid.d.ts +4 -0
- package/lib/schema-component/antd/gantt/components/grid/grid.js +21 -0
- package/lib/schema-component/antd/gantt/components/grid/style.d.ts +4 -0
- package/lib/schema-component/antd/gantt/components/grid/style.js +17 -0
- package/lib/schema-component/antd/gantt/components/other/arrow.d.ts +12 -0
- package/lib/schema-component/antd/gantt/components/other/arrow.js +65 -0
- package/lib/schema-component/antd/gantt/components/other/horizontal-scroll.d.ts +8 -0
- package/lib/schema-component/antd/gantt/components/other/horizontal-scroll.js +40 -0
- package/lib/schema-component/antd/gantt/components/other/style.d.ts +7 -0
- package/lib/schema-component/antd/gantt/components/other/style.js +23 -0
- package/lib/schema-component/antd/gantt/components/other/tooltip.d.ts +29 -0
- package/lib/schema-component/antd/gantt/components/other/tooltip.js +114 -0
- package/lib/schema-component/antd/gantt/components/other/vertical-scroll.d.ts +9 -0
- package/lib/schema-component/antd/gantt/components/other/vertical-scroll.js +42 -0
- package/lib/schema-component/antd/gantt/components/task-item/bar/bar-date-handle.d.ts +11 -0
- package/lib/schema-component/antd/gantt/components/task-item/bar/bar-date-handle.js +27 -0
- package/lib/schema-component/antd/gantt/components/task-item/bar/bar-display.d.ts +21 -0
- package/lib/schema-component/antd/gantt/components/task-item/bar/bar-display.js +56 -0
- package/lib/schema-component/antd/gantt/components/task-item/bar/bar-progress-handle.d.ts +7 -0
- package/lib/schema-component/antd/gantt/components/task-item/bar/bar-progress-handle.js +18 -0
- package/lib/schema-component/antd/gantt/components/task-item/bar/bar-small.d.ts +3 -0
- package/lib/schema-component/antd/gantt/components/task-item/bar/bar-small.js +46 -0
- package/lib/schema-component/antd/gantt/components/task-item/bar/bar.d.ts +3 -0
- package/lib/schema-component/antd/gantt/components/task-item/bar/bar.js +68 -0
- package/lib/schema-component/antd/gantt/components/task-item/bar/style.d.ts +2 -0
- package/lib/schema-component/antd/gantt/components/task-item/bar/style.js +13 -0
- package/lib/schema-component/antd/gantt/components/task-item/milestone/milestone.d.ts +3 -0
- package/lib/schema-component/antd/gantt/components/task-item/milestone/milestone.js +38 -0
- package/lib/schema-component/antd/gantt/components/task-item/milestone/style.d.ts +2 -0
- package/lib/schema-component/antd/gantt/components/task-item/milestone/style.js +13 -0
- package/lib/schema-component/antd/gantt/components/task-item/project/project.d.ts +3 -0
- package/lib/schema-component/antd/gantt/components/task-item/project/project.js +39 -0
- package/lib/schema-component/antd/gantt/components/task-item/project/style.d.ts +3 -0
- package/lib/schema-component/antd/gantt/components/task-item/project/style.js +15 -0
- package/lib/schema-component/antd/gantt/components/task-item/style.d.ts +3 -0
- package/lib/schema-component/antd/gantt/components/task-item/style.js +15 -0
- package/lib/schema-component/antd/gantt/components/task-item/task-item.d.ts +15 -0
- package/lib/schema-component/antd/gantt/components/task-item/task-item.js +114 -0
- package/lib/schema-component/antd/gantt/context.d.ts +3 -0
- package/lib/schema-component/antd/gantt/context.js +12 -0
- package/lib/schema-component/antd/gantt/helpers/bar-helper.d.ts +14 -0
- package/lib/schema-component/antd/gantt/helpers/bar-helper.js +340 -0
- package/lib/schema-component/antd/gantt/helpers/date-helper.d.ts +18 -0
- package/lib/schema-component/antd/gantt/helpers/date-helper.js +197 -0
- package/lib/schema-component/antd/gantt/helpers/other-helper.d.ts +9 -0
- package/lib/schema-component/antd/gantt/helpers/other-helper.js +78 -0
- package/lib/schema-component/antd/gantt/index.d.ts +2 -0
- package/lib/schema-component/antd/gantt/index.js +21 -0
- package/lib/schema-component/antd/gantt/types/bar-task.d.ts +22 -0
- package/lib/schema-component/antd/gantt/types/bar-task.js +5 -0
- package/lib/schema-component/antd/gantt/types/date-setup.d.ts +5 -0
- package/lib/schema-component/antd/gantt/types/date-setup.js +5 -0
- package/lib/schema-component/antd/gantt/types/gantt-task-actions.d.ts +8 -0
- package/lib/schema-component/antd/gantt/types/gantt-task-actions.js +5 -0
- package/lib/schema-component/antd/gantt/types/public-types.d.ts +136 -0
- package/lib/schema-component/antd/gantt/types/public-types.js +19 -0
- package/lib/schema-component/antd/grid/Block.js +0 -5
- package/lib/schema-component/antd/grid/Grid.js +61 -132
- package/lib/schema-component/antd/grid/index.js +0 -4
- package/lib/schema-component/antd/icon-picker/IconPicker.js +11 -40
- package/lib/schema-component/antd/icon-picker/index.js +0 -2
- package/lib/schema-component/antd/index.d.ts +6 -2
- package/lib/schema-component/antd/index.js +66 -101
- package/lib/schema-component/antd/index.less +28 -0
- package/lib/schema-component/antd/input/EllipsisWithTooltip.js +11 -28
- package/lib/schema-component/antd/input/Input.d.ts +3 -3
- package/lib/schema-component/antd/input/Input.js +17 -24
- package/lib/schema-component/antd/input/Json.d.ts +7 -5
- package/lib/schema-component/antd/input/Json.js +9 -20
- package/lib/schema-component/antd/input/ReadPretty.d.ts +2 -2
- package/lib/schema-component/antd/input/ReadPretty.js +21 -39
- package/lib/schema-component/antd/input/index.js +0 -8
- package/lib/schema-component/antd/input/shared.js +0 -1
- package/lib/schema-component/antd/input-number/InputNumber.js +5 -17
- package/lib/schema-component/antd/input-number/ReadPretty.js +3 -11
- package/lib/schema-component/antd/input-number/index.js +0 -2
- package/lib/schema-component/antd/kanban/Kanban.Card.Designer.TitleSwitch.d.ts +1 -0
- package/lib/schema-component/antd/kanban/Kanban.Card.Designer.TitleSwitch.js +34 -0
- package/lib/schema-component/antd/kanban/Kanban.Card.Designer.js +22 -36
- package/lib/schema-component/antd/kanban/Kanban.Card.js +25 -51
- package/lib/schema-component/antd/kanban/Kanban.CardViewer.js +0 -2
- package/lib/schema-component/antd/kanban/Kanban.Designer.js +18 -32
- package/lib/schema-component/antd/kanban/Kanban.js +31 -77
- package/lib/schema-component/antd/kanban/context.js +0 -2
- package/lib/schema-component/antd/kanban/index.js +2 -7
- package/lib/schema-component/antd/kanban/index.less +8 -5
- package/lib/schema-component/antd/markdown/Markdown.Void.Designer.js +1 -10
- package/lib/schema-component/antd/markdown/Markdown.Void.js +40 -68
- package/lib/schema-component/antd/markdown/Markdown.js +12 -18
- package/lib/schema-component/antd/markdown/highlight-theme/default.less +98 -0
- package/lib/schema-component/antd/markdown/highlight-theme/table.less +36 -0
- package/lib/schema-component/antd/markdown/index.js +0 -2
- package/lib/schema-component/antd/markdown/markdown-it-plugins/mermaidPlugin.d.ts +5 -0
- package/lib/schema-component/antd/markdown/markdown-it-plugins/mermaidPlugin.js +69 -0
- package/lib/schema-component/antd/markdown/md.d.ts +5 -0
- package/lib/schema-component/antd/markdown/md.js +22 -0
- package/lib/schema-component/antd/markdown/util.d.ts +5 -1
- package/lib/schema-component/antd/markdown/util.js +66 -12
- package/lib/schema-component/antd/menu/Menu.Designer.js +27 -72
- package/lib/schema-component/antd/menu/Menu.js +61 -129
- package/lib/schema-component/antd/menu/MenuItemInitializers/index.js +170 -209
- package/lib/schema-component/antd/menu/index.js +0 -6
- package/lib/schema-component/antd/menu/util.js +2 -24
- package/lib/schema-component/antd/page/FixedBlock.d.ts +8 -7
- package/lib/schema-component/antd/page/FixedBlock.js +100 -149
- package/lib/schema-component/antd/page/Page.js +83 -135
- package/lib/schema-component/antd/page/PageTabDesigner.js +11 -38
- package/lib/schema-component/antd/page/index.js +0 -4
- package/lib/schema-component/antd/pagination/index.js +6 -17
- package/lib/schema-component/antd/password/Password.js +7 -18
- package/lib/schema-component/antd/password/PasswordStrength.js +0 -38
- package/lib/schema-component/antd/password/index.js +0 -2
- package/lib/schema-component/antd/percent/Percent.js +5 -16
- package/lib/schema-component/antd/percent/index.js +0 -2
- package/lib/schema-component/antd/preview/Preview.d.ts +15 -0
- package/lib/schema-component/antd/preview/Preview.js +246 -0
- package/lib/schema-component/antd/preview/index.d.ts +1 -0
- package/lib/schema-component/antd/preview/index.js +16 -0
- package/lib/schema-component/antd/radio/Radio.js +1 -10
- package/lib/schema-component/antd/radio/index.js +0 -2
- package/lib/schema-component/antd/record-picker/InputRecordPicker.d.ts +2 -0
- package/lib/schema-component/antd/record-picker/InputRecordPicker.js +166 -106
- package/lib/schema-component/antd/record-picker/ReadPrettyRecordPicker.js +29 -61
- package/lib/schema-component/antd/record-picker/RecordPicker.js +0 -4
- package/lib/schema-component/antd/record-picker/index.js +0 -10
- package/lib/schema-component/antd/record-picker/useFieldNames.js +4 -8
- package/lib/schema-component/antd/record-picker/util.d.ts +1 -1
- package/lib/schema-component/antd/record-picker/util.js +15 -18
- package/lib/schema-component/antd/remote-select/ReadPretty.js +22 -39
- package/lib/schema-component/antd/remote-select/RemoteSelect.d.ts +2 -0
- package/lib/schema-component/antd/remote-select/RemoteSelect.js +47 -80
- package/lib/schema-component/antd/remote-select/index.js +0 -2
- package/lib/schema-component/antd/remote-select/shared.js +0 -4
- package/lib/schema-component/antd/rich-text/RichText.js +6 -13
- package/lib/schema-component/antd/rich-text/index.js +0 -2
- package/lib/schema-component/antd/select/ReadPretty.js +4 -18
- package/lib/schema-component/antd/select/Select.js +15 -45
- package/lib/schema-component/antd/select/index.js +0 -4
- package/lib/schema-component/antd/select/shared.js +5 -29
- package/lib/schema-component/antd/space/index.js +4 -13
- package/lib/schema-component/antd/table/Table.Array.Designer.js +0 -5
- package/lib/schema-component/antd/table/Table.Array.js +48 -111
- package/lib/schema-component/antd/table/Table.Column.ActionBar.js +0 -8
- package/lib/schema-component/antd/table/Table.Column.Decorator.js +5 -25
- package/lib/schema-component/antd/table/Table.Column.Designer.js +37 -65
- package/lib/schema-component/antd/table/Table.Column.js +0 -5
- package/lib/schema-component/antd/table/Table.Designer.js +2 -9
- package/lib/schema-component/antd/table/Table.RowActionDesigner.js +1 -12
- package/lib/schema-component/antd/table/Table.RowSelection.js +6 -23
- package/lib/schema-component/antd/table/Table.Void.Designer.js +8 -29
- package/lib/schema-component/antd/table/Table.Void.js +17 -54
- package/lib/schema-component/antd/table/index.js +0 -13
- package/lib/schema-component/antd/table-v2/FilterDynamicComponent.d.ts +2 -0
- package/lib/schema-component/antd/table-v2/FilterDynamicComponent.js +157 -0
- package/lib/schema-component/antd/table-v2/Table.ActionColumnDesigner.js +1 -12
- package/lib/schema-component/antd/table-v2/Table.Column.ActionBar.js +0 -8
- package/lib/schema-component/antd/table-v2/Table.Column.Decorator.js +6 -29
- package/lib/schema-component/antd/table-v2/Table.Column.Designer.js +28 -42
- package/lib/schema-component/antd/table-v2/Table.Column.js +0 -5
- package/lib/schema-component/antd/table-v2/Table.Designer.js +2 -9
- package/lib/schema-component/antd/table-v2/Table.js +139 -169
- package/lib/schema-component/antd/table-v2/TableBlockDesigner.js +60 -59
- package/lib/schema-component/antd/table-v2/TableField.js +5 -22
- package/lib/schema-component/antd/table-v2/TableSelector.js +0 -2
- package/lib/schema-component/antd/table-v2/TableSelectorDesigner.js +42 -41
- package/lib/schema-component/antd/table-v2/hooks/useUserVariable.d.ts +10 -0
- package/lib/schema-component/antd/table-v2/hooks/useUserVariable.js +63 -0
- package/lib/schema-component/antd/table-v2/index.js +0 -13
- package/lib/schema-component/antd/table-v2/utils.d.ts +2 -0
- package/lib/schema-component/antd/table-v2/utils.js +40 -6
- package/lib/schema-component/antd/tabs/Tabs.Designer.js +7 -17
- package/lib/schema-component/antd/tabs/Tabs.js +1 -17
- package/lib/schema-component/antd/tabs/index.js +0 -2
- package/lib/schema-component/antd/time-picker/ReadPretty.js +2 -12
- package/lib/schema-component/antd/time-picker/TimePicker.js +4 -10
- package/lib/schema-component/antd/time-picker/index.js +0 -2
- package/lib/schema-component/antd/tree-select/ReadPretty.js +1 -16
- package/lib/schema-component/antd/tree-select/TreeSelect.js +4 -11
- package/lib/schema-component/antd/tree-select/index.js +0 -2
- package/lib/schema-component/antd/upload/ReadPretty.d.ts +1 -1
- package/lib/schema-component/antd/upload/ReadPretty.js +18 -40
- package/lib/schema-component/antd/upload/Upload.js +75 -80
- package/lib/schema-component/antd/upload/index.js +0 -2
- package/lib/schema-component/antd/upload/shared.js +14 -92
- package/lib/schema-component/antd/upload/type.d.ts +11 -0
- package/lib/schema-component/antd/variable/Input.js +68 -89
- package/lib/schema-component/antd/variable/JSONInput.js +15 -37
- package/lib/schema-component/antd/variable/TextArea.d.ts +3 -0
- package/lib/schema-component/antd/variable/TextArea.js +254 -169
- package/lib/schema-component/antd/variable/Variable.js +1 -7
- package/lib/schema-component/antd/variable/VariableSelect.d.ts +2 -0
- package/lib/schema-component/antd/variable/VariableSelect.js +74 -0
- package/lib/schema-component/antd/variable/XButton.d.ts +9 -0
- package/lib/schema-component/antd/variable/XButton.js +26 -0
- package/lib/schema-component/antd/variable/index.js +0 -2
- package/lib/schema-component/common/dnd-context/index.js +12 -48
- package/lib/schema-component/common/index.js +0 -4
- package/lib/schema-component/common/sortable-item/SortableItem.js +20 -50
- package/lib/schema-component/common/sortable-item/index.js +0 -2
- package/lib/schema-component/common/utils/logic.js +74 -93
- package/lib/schema-component/common/utils/uitls.js +46 -48
- package/lib/schema-component/context.js +0 -2
- package/lib/schema-component/core/DesignableSwitch.js +12 -23
- package/lib/schema-component/core/FormProvider.js +4 -21
- package/lib/schema-component/core/RemoteSchemaComponent.js +21 -42
- package/lib/schema-component/core/SchemaComponent.js +12 -34
- package/lib/schema-component/core/SchemaComponentOptions.js +4 -15
- package/lib/schema-component/core/SchemaComponentProvider.js +18 -50
- package/lib/schema-component/core/index.js +0 -12
- package/lib/schema-component/hooks/index.d.ts +2 -0
- package/lib/schema-component/hooks/index.js +22 -18
- package/lib/schema-component/hooks/useAttach.js +0 -4
- package/lib/schema-component/hooks/useCompile.js +4 -9
- package/lib/schema-component/hooks/useComponent.js +1 -9
- package/lib/schema-component/hooks/useDesignable.js +203 -404
- package/lib/schema-component/hooks/useDesigner.js +1 -7
- package/lib/schema-component/hooks/useFieldComponentOptions.js +18 -19
- package/lib/schema-component/hooks/useFieldProps.js +4 -9
- package/lib/schema-component/hooks/useFieldTitle.js +2 -13
- package/lib/schema-component/hooks/useProps.js +1 -8
- package/lib/schema-component/hooks/useSchemaComponentContext.js +0 -3
- package/lib/schema-component/hooks/useTableSize.d.ts +5 -0
- package/lib/schema-component/hooks/useTableSize.js +49 -0
- package/lib/schema-component/index.js +0 -14
- package/lib/schema-initializer/SchemaInitializer.js +46 -96
- package/lib/schema-initializer/SchemaInitializerProvider.js +11 -36
- package/lib/schema-initializer/SelectCollection.js +4 -16
- package/lib/schema-initializer/buttons/BlockInitializers.js +20 -2
- package/lib/schema-initializer/buttons/BulkEditFormItemInitializers.js +2 -11
- package/lib/schema-initializer/buttons/CalendarActionInitializers.d.ts +4 -0
- package/lib/schema-initializer/buttons/CalendarActionInitializers.js +5 -0
- package/lib/schema-initializer/buttons/CalendarFormActionInitializers.d.ts +6 -0
- package/lib/schema-initializer/buttons/CalendarFormActionInitializers.js +21 -0
- package/lib/schema-initializer/buttons/CreateFormBlockInitializers.js +2 -10
- package/lib/schema-initializer/buttons/CreateFormBulkEditBlockInitializers.js +2 -10
- package/lib/schema-initializer/buttons/CustomFormItemInitializers.js +2 -13
- package/lib/schema-initializer/buttons/FilterFormActionInitializers.d.ts +16 -0
- package/lib/schema-initializer/buttons/FilterFormActionInitializers.js +31 -0
- package/lib/schema-initializer/buttons/FormItemInitializers.d.ts +1 -0
- package/lib/schema-initializer/buttons/FormItemInitializers.js +63 -16
- package/lib/schema-initializer/buttons/GanttActionInitializers.d.ts +133 -0
- package/lib/schema-initializer/buttons/GanttActionInitializers.js +16 -0
- package/lib/schema-initializer/buttons/KanbanActionInitializers.d.ts +2 -0
- package/lib/schema-initializer/buttons/KanbanActionInitializers.js +5 -0
- package/lib/schema-initializer/buttons/ReadPrettyFormActionInitializers.d.ts +6 -0
- package/lib/schema-initializer/buttons/ReadPrettyFormActionInitializers.js +17 -0
- package/lib/schema-initializer/buttons/ReadPrettyFormItemInitializers.js +2 -14
- package/lib/schema-initializer/buttons/RecordBlockInitializers.js +31 -54
- package/lib/schema-initializer/buttons/RecordFormBlockInitializers.js +1 -9
- package/lib/schema-initializer/buttons/SubTableActionInitializers.js +4 -4
- package/lib/schema-initializer/buttons/TabPaneInitializers.js +55 -77
- package/lib/schema-initializer/buttons/TableActionColumnInitializers.js +41 -33
- package/lib/schema-initializer/buttons/TableActionInitializers.d.ts +17 -0
- package/lib/schema-initializer/buttons/TableActionInitializers.js +51 -17
- package/lib/schema-initializer/buttons/TableColumnInitializers.js +7 -21
- package/lib/schema-initializer/buttons/TableSelectorInitializers.js +2 -10
- package/lib/schema-initializer/buttons/chart-config/index.js +0 -10
- package/lib/schema-initializer/buttons/index.d.ts +2 -0
- package/lib/schema-initializer/buttons/index.js +22 -44
- package/lib/schema-initializer/components/BulkEditField.js +31 -69
- package/lib/schema-initializer/components/CreateRecordAction.js +85 -95
- package/lib/schema-initializer/components/assigned-field/AssignedField.js +33 -91
- package/lib/schema-initializer/components/assigned-field/index.js +0 -2
- package/lib/schema-initializer/components/index.js +0 -6
- package/lib/schema-initializer/index.d.ts +1 -1
- package/lib/schema-initializer/index.js +7 -11
- package/lib/schema-initializer/items/ActionInitializer.js +4 -9
- package/lib/schema-initializer/items/BlockInitializer.js +2 -9
- package/lib/schema-initializer/items/BulkDestroyActionInitializer.js +4 -12
- package/lib/schema-initializer/items/BulkEditSubmitActionInitializer.js +4 -9
- package/lib/schema-initializer/items/CalendarBlockInitializer.js +61 -86
- package/lib/schema-initializer/items/CollectionFieldInitializer.js +4 -9
- package/lib/schema-initializer/items/CreateActionInitializer.js +5 -9
- package/lib/schema-initializer/items/CreateChildInitializer.d.ts +1 -0
- package/lib/schema-initializer/items/CreateChildInitializer.js +70 -0
- package/lib/schema-initializer/items/CreateFilterActionInitializer.d.ts +1 -0
- package/lib/schema-initializer/items/CreateFilterActionInitializer.js +31 -0
- package/lib/schema-initializer/items/CreateFormBlockInitializer.js +45 -74
- package/lib/schema-initializer/items/CreateFormBulkEditBlockInitializer.js +47 -76
- package/lib/schema-initializer/items/CreateResetActionInitializer.d.ts +1 -0
- package/lib/schema-initializer/items/CreateResetActionInitializer.js +29 -0
- package/lib/schema-initializer/items/CreateSubmitActionInitializer.js +4 -9
- package/lib/schema-initializer/items/CustomizeActionInitializer.js +4 -12
- package/lib/schema-initializer/items/CustomizeBulkEditActionInitializer.js +4 -9
- package/lib/schema-initializer/items/DataBlockInitializer.js +43 -71
- package/lib/schema-initializer/items/DeleteEventActionInitializer.js +4 -9
- package/lib/schema-initializer/items/DestroyActionInitializer.js +4 -9
- package/lib/schema-initializer/items/DetailsBlockInitializer.js +21 -36
- package/lib/schema-initializer/items/ExpandActionInitializer.d.ts +2 -0
- package/lib/schema-initializer/items/ExpandActionInitializer.js +67 -0
- package/lib/schema-initializer/items/FilterActionInitializer.js +4 -9
- package/lib/schema-initializer/items/FilterBlockInitializer.d.ts +1 -0
- package/lib/schema-initializer/items/FilterBlockInitializer.js +86 -0
- package/lib/schema-initializer/items/FilterCollapseBlockInitializer.d.ts +1 -0
- package/lib/schema-initializer/items/FilterCollapseBlockInitializer.js +52 -0
- package/lib/schema-initializer/items/FilterFormBlockInitializer.d.ts +1 -0
- package/lib/schema-initializer/items/FilterFormBlockInitializer.js +36 -0
- package/lib/schema-initializer/items/FormBlockInitializer.js +4 -13
- package/lib/schema-initializer/items/G2PlotInitializer.js +6 -15
- package/lib/schema-initializer/items/GanttBlockInitializer.d.ts +1 -0
- package/lib/schema-initializer/items/GanttBlockInitializer.js +175 -0
- package/lib/schema-initializer/items/InitializerWithSwitch.js +8 -19
- package/lib/schema-initializer/items/KanbanBlockInitializer.js +85 -116
- package/lib/schema-initializer/items/MarkdownBlockInitializer.js +5 -14
- package/lib/schema-initializer/items/PrintActionInitializer.js +4 -9
- package/lib/schema-initializer/items/RecordAssociationBlockInitializer.js +37 -62
- package/lib/schema-initializer/items/RecordAssociationCalendarBlockInitializer.js +92 -130
- package/lib/schema-initializer/items/RecordAssociationDetailsBlockInitializer.js +37 -62
- package/lib/schema-initializer/items/RecordAssociationFormBlockInitializer.js +52 -79
- package/lib/schema-initializer/items/RecordFormBlockInitializer.js +49 -78
- package/lib/schema-initializer/items/RecordReadPrettyAssociationFormBlockInitializer.js +51 -81
- package/lib/schema-initializer/items/RecordReadPrettyFormBlockInitializer.js +52 -83
- package/lib/schema-initializer/items/RefreshActionInitializer.js +4 -9
- package/lib/schema-initializer/items/SubmitActionInitializer.js +7 -11
- package/lib/schema-initializer/items/TableActionColumnInitializer.js +4 -9
- package/lib/schema-initializer/items/TableBlockInitializer.js +20 -36
- package/lib/schema-initializer/items/TableCollectionFieldInitializer.js +4 -9
- package/lib/schema-initializer/items/TableSelectorInitializer.js +24 -44
- package/lib/schema-initializer/items/UpdateActionInitializer.js +4 -9
- package/lib/schema-initializer/items/UpdateSubmitActionInitializer.js +4 -9
- package/lib/schema-initializer/items/ViewActionInitializer.js +4 -9
- package/lib/schema-initializer/items/index.d.ts +7 -0
- package/lib/schema-initializer/items/index.js +77 -86
- package/lib/schema-initializer/utils.d.ts +174 -1
- package/lib/schema-initializer/utils.js +672 -397
- package/lib/schema-items/OpenModeSchemaItems.d.ts +7 -0
- package/lib/schema-items/OpenModeSchemaItems.js +86 -0
- package/lib/schema-items/index.d.ts +1 -0
- package/lib/schema-items/index.js +16 -0
- package/lib/schema-settings/DataTemplates/FormDataTemplates.d.ts +2 -0
- package/lib/schema-settings/DataTemplates/FormDataTemplates.js +182 -0
- package/lib/schema-settings/DataTemplates/TreeLabel.d.ts +1 -0
- package/lib/schema-settings/DataTemplates/TreeLabel.js +27 -0
- package/lib/schema-settings/DataTemplates/components/AsDefaultTemplate.d.ts +2 -0
- package/lib/schema-settings/DataTemplates/components/AsDefaultTemplate.js +55 -0
- package/lib/schema-settings/DataTemplates/components/DataTemplateTitle.d.ts +11 -0
- package/lib/schema-settings/DataTemplates/components/DataTemplateTitle.js +271 -0
- package/lib/schema-settings/DataTemplates/hooks/useCollectionState.d.ts +13 -0
- package/lib/schema-settings/DataTemplates/hooks/useCollectionState.js +155 -0
- package/lib/schema-settings/DataTemplates/index.d.ts +1 -0
- package/lib/schema-settings/DataTemplates/index.js +16 -0
- package/lib/schema-settings/EnableChildCollections/index.js +28 -45
- package/lib/schema-settings/GeneralSchemaDesigner.js +11 -34
- package/lib/schema-settings/LinkageRules/DynamicComponent.js +7 -76
- package/lib/schema-settings/LinkageRules/FilterDynamicComponent.js +3 -8
- package/lib/schema-settings/LinkageRules/LinkageRuleAction.js +33 -65
- package/lib/schema-settings/LinkageRules/LinkageRuleActionGroup.js +9 -23
- package/lib/schema-settings/LinkageRules/ValueDynamicComponent.js +36 -40
- package/lib/schema-settings/LinkageRules/Variables.js +11 -37
- package/lib/schema-settings/LinkageRules/action-hooks.js +5 -25
- package/lib/schema-settings/LinkageRules/components/EnableLinkage.d.ts +2 -0
- package/lib/schema-settings/LinkageRules/components/EnableLinkage.js +48 -0
- package/lib/schema-settings/LinkageRules/components/LinkageHeader.d.ts +11 -0
- package/lib/schema-settings/LinkageRules/components/LinkageHeader.js +262 -0
- package/lib/schema-settings/LinkageRules/context.d.ts +1 -1
- package/lib/schema-settings/LinkageRules/context.js +3 -5
- package/lib/schema-settings/LinkageRules/index.js +20 -27
- package/lib/schema-settings/LinkageRules/type.js +0 -1
- package/lib/schema-settings/LinkageRules/useValues.js +8 -23
- package/lib/schema-settings/SchemaSettings.d.ts +3 -0
- package/lib/schema-settings/SchemaSettings.js +731 -611
- package/lib/schema-settings/index.js +0 -4
- package/lib/schema-templates/BlockTemplate.js +3 -22
- package/lib/schema-templates/BlockTemplateDetails.js +34 -61
- package/lib/schema-templates/BlockTemplatePage.js +2 -15
- package/lib/schema-templates/SchemaTemplateManagerProvider.js +99 -164
- package/lib/schema-templates/SchemaTemplateShortcut.js +1 -10
- package/lib/schema-templates/index.js +0 -8
- package/lib/schema-templates/schemas/uiSchemaTemplates.js +41 -66
- package/lib/settings-form/SettingsForm.js +86 -138
- package/lib/settings-form/index.js +0 -2
- package/lib/system-settings/SystemSettingsProvider.js +14 -13
- package/lib/system-settings/SystemSettingsShortcut.js +78 -121
- package/lib/system-settings/index.js +0 -4
- package/lib/user/ChangePassword.js +42 -78
- package/lib/user/CurrentUser.js +28 -59
- package/lib/user/CurrentUserProvider.js +1 -18
- package/lib/user/EditProfile.js +43 -81
- package/lib/user/LanguageSettings.js +37 -64
- package/lib/user/SigninPage.js +37 -76
- package/lib/user/SigninPageExtension.js +3 -20
- package/lib/user/SignupPage.js +29 -57
- package/lib/user/SwitchRole.js +30 -47
- package/lib/user/ThemeSettings.d.ts +1 -0
- package/lib/user/ThemeSettings.js +78 -0
- package/lib/user/VerificationCode.js +50 -87
- package/lib/user/index.js +0 -10
- package/package.json +13 -9
- package/es/collection-manager/templates/treeCollection.d.ts +0 -1
- package/es/collection-manager/templates/treeCollection.js +0 -0
- package/lib/collection-manager/templates/treeCollection.d.ts +0 -1
- package/lib/collection-manager/templates/treeCollection.js +0 -1
|
@@ -3,60 +3,46 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.useUpdateActionProps = exports.useRefreshActionProps = exports.usePickActionProps = exports.useDetailsPaginationProps = exports.useDetailPrintActionProps = exports.useDestroyActionProps = exports.useCustomizeUpdateActionProps = exports.useCustomizeRequestActionProps = exports.useCustomizeBulkUpdateActionProps = exports.useCustomizeBulkEditActionProps = exports.useCreateActionProps = exports.useBulkDestroyActionProps = void 0;
|
|
7
|
-
|
|
6
|
+
exports.useUpdateActionProps = exports.useResetBlockActionProps = exports.useRefreshActionProps = exports.usePickActionProps = exports.useOptionalFieldList = exports.useFilterBlockActionProps = exports.useDetailsPaginationProps = exports.useDetailPrintActionProps = exports.useDestroyActionProps = exports.useCustomizeUpdateActionProps = exports.useCustomizeRequestActionProps = exports.useCustomizeBulkUpdateActionProps = exports.useCustomizeBulkEditActionProps = exports.useCreateActionProps = exports.useBulkDestroyActionProps = exports.useAssociationFilterProps = exports.useAssociationFilterBlockProps = exports.updateFilterTargets = exports.findFilterTargets = void 0;
|
|
8
7
|
var _react = require("@formily/react");
|
|
9
|
-
|
|
10
8
|
var _antd = require("antd");
|
|
11
|
-
|
|
12
9
|
var _jsonTemplates = _interopRequireDefault(require("json-templates"));
|
|
13
|
-
|
|
14
10
|
var _lodash = require("lodash");
|
|
15
|
-
|
|
16
11
|
var _get = _interopRequireDefault(require("lodash/get"));
|
|
17
|
-
|
|
18
12
|
var _omit = _interopRequireDefault(require("lodash/omit"));
|
|
19
|
-
|
|
13
|
+
var _react2 = require("react");
|
|
20
14
|
var _reactI18next = require("react-i18next");
|
|
21
|
-
|
|
22
15
|
var _reactRouterDom = require("react-router-dom");
|
|
23
|
-
|
|
24
16
|
var _reactToPrint = require("react-to-print");
|
|
25
|
-
|
|
26
17
|
var _2 = require("../..");
|
|
27
|
-
|
|
28
18
|
var _apiClient = require("../../api-client");
|
|
29
|
-
|
|
30
19
|
var _collectionManager = require("../../collection-manager");
|
|
31
|
-
|
|
20
|
+
var _FilterProvider = require("../../filter-provider/FilterProvider");
|
|
21
|
+
var _utils = require("../../filter-provider/utils");
|
|
32
22
|
var _recordProvider = require("../../record-provider");
|
|
33
|
-
|
|
34
23
|
var _schemaComponent = require("../../schema-component");
|
|
35
|
-
|
|
36
24
|
var _components = require("../../schema-initializer/components");
|
|
37
|
-
|
|
38
25
|
var _user = require("../../user");
|
|
39
|
-
|
|
40
26
|
var _BlockProvider = require("../BlockProvider");
|
|
41
|
-
|
|
42
27
|
var _DetailsBlockProvider = require("../DetailsBlockProvider");
|
|
43
|
-
|
|
28
|
+
var _SharedFilterProvider = require("../SharedFilterProvider");
|
|
44
29
|
var _TableFieldProvider = require("../TableFieldProvider");
|
|
45
|
-
|
|
46
30
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
47
|
-
|
|
31
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
32
|
+
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."); }
|
|
33
|
+
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); }
|
|
34
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
35
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
36
|
+
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; }
|
|
37
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
48
38
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
49
|
-
|
|
50
39
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
51
|
-
|
|
52
40
|
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; }
|
|
53
|
-
|
|
54
41
|
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; }
|
|
55
|
-
|
|
56
|
-
function
|
|
57
|
-
|
|
42
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
43
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
44
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
58
45
|
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); }
|
|
59
|
-
|
|
60
46
|
var usePickActionProps = function usePickActionProps() {
|
|
61
47
|
var form = (0, _react.useForm)();
|
|
62
48
|
return {
|
|
@@ -65,66 +51,50 @@ var usePickActionProps = function usePickActionProps() {
|
|
|
65
51
|
}
|
|
66
52
|
};
|
|
67
53
|
};
|
|
68
|
-
|
|
69
54
|
exports.usePickActionProps = usePickActionProps;
|
|
70
|
-
|
|
71
55
|
function renderTemplate(str, data) {
|
|
72
56
|
var re = /\{\{\s*((\w+\.?)+)\s*\}\}/g;
|
|
73
57
|
return str.replace(re, function (_, key) {
|
|
74
58
|
return (0, _get.default)(data, key) || '';
|
|
75
59
|
});
|
|
76
60
|
}
|
|
77
|
-
|
|
78
61
|
function isURL(string) {
|
|
79
62
|
var url;
|
|
80
|
-
|
|
81
63
|
try {
|
|
82
64
|
url = new URL(string);
|
|
83
65
|
} catch (e) {
|
|
84
66
|
return false;
|
|
85
67
|
}
|
|
86
|
-
|
|
87
68
|
return url.protocol === 'http:' || url.protocol === 'https:';
|
|
88
69
|
}
|
|
89
|
-
|
|
90
70
|
var filterValue = function filterValue(value) {
|
|
91
71
|
if (_typeof(value) !== 'object') {
|
|
92
72
|
return value;
|
|
93
73
|
}
|
|
94
|
-
|
|
95
74
|
if (!value) {
|
|
96
75
|
return value;
|
|
97
76
|
}
|
|
98
|
-
|
|
99
77
|
if (Array.isArray(value)) {
|
|
100
78
|
return value.map(function (v) {
|
|
101
79
|
return filterValue(v);
|
|
102
80
|
});
|
|
103
81
|
}
|
|
104
|
-
|
|
105
82
|
var obj = {};
|
|
106
|
-
|
|
107
83
|
for (var key in value) {
|
|
108
84
|
if (Object.prototype.hasOwnProperty.call(value, key)) {
|
|
109
85
|
var val = value[key];
|
|
110
|
-
|
|
111
86
|
if (Array.isArray(val) || val && _typeof(val) === 'object') {
|
|
112
87
|
continue;
|
|
113
88
|
}
|
|
114
|
-
|
|
115
89
|
obj[key] = val;
|
|
116
90
|
}
|
|
117
91
|
}
|
|
118
|
-
|
|
119
92
|
return obj;
|
|
120
93
|
};
|
|
121
|
-
|
|
122
94
|
function getFormValues(filterByTk, field, form, fieldNames, getField, resource) {
|
|
123
95
|
if (filterByTk) {
|
|
124
96
|
var _field$data;
|
|
125
|
-
|
|
126
97
|
var actionFields = field === null || field === void 0 ? void 0 : (_field$data = field.data) === null || _field$data === void 0 ? void 0 : _field$data.activeFields;
|
|
127
|
-
|
|
128
98
|
if (actionFields) {
|
|
129
99
|
var keys = Object.keys(form.values).filter(function (key) {
|
|
130
100
|
var f = getField(key);
|
|
@@ -133,88 +103,75 @@ function getFormValues(filterByTk, field, form, fieldNames, getField, resource)
|
|
|
133
103
|
return (0, _omit.default)(_objectSpread({}, form.values), keys);
|
|
134
104
|
}
|
|
135
105
|
}
|
|
136
|
-
|
|
106
|
+
console.log('form.values', form.values);
|
|
137
107
|
return form.values;
|
|
138
108
|
var values = {};
|
|
139
|
-
|
|
140
|
-
for (var key in form.values) {
|
|
109
|
+
var _loop = function _loop() {
|
|
141
110
|
if (fieldNames.includes(key)) {
|
|
142
111
|
var collectionField = getField(key);
|
|
143
|
-
|
|
144
112
|
if (filterByTk) {
|
|
145
113
|
if (field.added && !field.added.has(key)) {
|
|
146
|
-
continue;
|
|
114
|
+
return "continue";
|
|
147
115
|
}
|
|
148
|
-
|
|
149
116
|
if (['subTable', 'o2m', 'o2o', 'oho', 'obo', 'm2o'].includes(collectionField.interface)) {
|
|
150
117
|
values[key] = form.values[key];
|
|
151
|
-
continue;
|
|
118
|
+
return "continue";
|
|
152
119
|
}
|
|
153
120
|
}
|
|
154
|
-
|
|
155
121
|
var items = form.values[key];
|
|
156
|
-
|
|
157
122
|
if (['linkTo', 'm2o', 'm2m'].includes(collectionField.interface)) {
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
} else if (items && _typeof(items) === 'object') {
|
|
165
|
-
values[key] = filterValue(items);
|
|
166
|
-
} else {
|
|
167
|
-
values[key] = items;
|
|
168
|
-
}
|
|
123
|
+
var targetKey = collectionField.targetKey || 'id';
|
|
124
|
+
if (resource instanceof _TableFieldProvider.TableFieldResource) {
|
|
125
|
+
if (Array.isArray(items)) {
|
|
126
|
+
values[key] = filterValue(items);
|
|
127
|
+
} else if (items && _typeof(items) === 'object') {
|
|
128
|
+
values[key] = filterValue(items);
|
|
169
129
|
} else {
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
|
|
130
|
+
values[key] = items;
|
|
131
|
+
}
|
|
132
|
+
} else {
|
|
133
|
+
if (Array.isArray(items)) {
|
|
134
|
+
values[key] = items.map(function (item) {
|
|
135
|
+
return item[targetKey];
|
|
136
|
+
});
|
|
137
|
+
} else if (items && _typeof(items) === 'object') {
|
|
138
|
+
values[key] = items[targetKey];
|
|
139
|
+
} else {
|
|
140
|
+
values[key] = items;
|
|
179
141
|
}
|
|
180
|
-
}
|
|
142
|
+
}
|
|
181
143
|
} else {
|
|
182
144
|
values[key] = form.values[key];
|
|
183
145
|
}
|
|
184
146
|
} else {
|
|
185
147
|
values[key] = form.values[key];
|
|
186
148
|
}
|
|
149
|
+
};
|
|
150
|
+
for (var key in form.values) {
|
|
151
|
+
var _ret = _loop();
|
|
152
|
+
if (_ret === "continue") continue;
|
|
187
153
|
}
|
|
188
|
-
|
|
189
154
|
return values;
|
|
190
155
|
}
|
|
191
|
-
|
|
192
156
|
var useCreateActionProps = function useCreateActionProps() {
|
|
193
157
|
var _currentUserContext$d;
|
|
194
|
-
|
|
195
158
|
var form = (0, _react.useForm)();
|
|
196
|
-
|
|
197
159
|
var _useBlockRequestConte = (0, _BlockProvider.useBlockRequestContext)(),
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
160
|
+
field = _useBlockRequestConte.field,
|
|
161
|
+
resource = _useBlockRequestConte.resource,
|
|
162
|
+
__parent = _useBlockRequestConte.__parent;
|
|
202
163
|
var _useActionContext = (0, _schemaComponent.useActionContext)(),
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
164
|
+
setVisible = _useActionContext.setVisible,
|
|
165
|
+
fieldSchema = _useActionContext.fieldSchema;
|
|
206
166
|
var history = (0, _reactRouterDom.useHistory)();
|
|
207
|
-
|
|
208
167
|
var _useTranslation = (0, _reactI18next.useTranslation)(),
|
|
209
|
-
|
|
210
|
-
|
|
168
|
+
t = _useTranslation.t;
|
|
211
169
|
var actionSchema = (0, _react.useFieldSchema)();
|
|
212
170
|
var actionField = (0, _react.useField)();
|
|
213
|
-
|
|
214
171
|
var _useCollection = (0, _collectionManager.useCollection)(),
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
172
|
+
fields = _useCollection.fields,
|
|
173
|
+
getField = _useCollection.getField,
|
|
174
|
+
getTreeParentField = _useCollection.getTreeParentField;
|
|
218
175
|
var compile = (0, _schemaComponent.useCompile)();
|
|
219
176
|
var filterByTk = (0, _BlockProvider.useFilterByTk)();
|
|
220
177
|
var currentRecord = (0, _recordProvider.useRecord)();
|
|
@@ -222,125 +179,277 @@ var useCreateActionProps = function useCreateActionProps() {
|
|
|
222
179
|
var currentUser = currentUserContext === null || currentUserContext === void 0 ? void 0 : (_currentUserContext$d = currentUserContext.data) === null || _currentUserContext$d === void 0 ? void 0 : _currentUserContext$d.data;
|
|
223
180
|
return {
|
|
224
181
|
onClick: function onClick() {
|
|
225
|
-
return _asyncToGenerator( /*#__PURE__*/
|
|
226
|
-
var _actionSchema$xActio;
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
if (skipValidator) {
|
|
245
|
-
_context2.next = 6;
|
|
246
|
-
break;
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
_context2.next = 6;
|
|
250
|
-
return form.submit();
|
|
251
|
-
|
|
252
|
-
case 6:
|
|
253
|
-
values = getFormValues(filterByTk, field, form, fieldNames, getField, resource);
|
|
254
|
-
actionField.data = field.data || {};
|
|
255
|
-
actionField.data.loading = true;
|
|
256
|
-
_context2.prev = 9;
|
|
257
|
-
_context2.next = 12;
|
|
258
|
-
return resource.create({
|
|
259
|
-
values: _objectSpread(_objectSpread(_objectSpread({}, values), overwriteValues), assignedValues)
|
|
260
|
-
});
|
|
261
|
-
|
|
262
|
-
case 12:
|
|
263
|
-
actionField.data.loading = false;
|
|
264
|
-
__parent === null || __parent === void 0 ? void 0 : (_parent$service = __parent.service) === null || _parent$service === void 0 ? void 0 : (_parent$service$refre = _parent$service.refresh) === null || _parent$service$refre === void 0 ? void 0 : _parent$service$refre.call(_parent$service);
|
|
265
|
-
setVisible === null || setVisible === void 0 ? void 0 : setVisible(false);
|
|
266
|
-
|
|
267
|
-
if (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage) {
|
|
268
|
-
_context2.next = 17;
|
|
269
|
-
break;
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
return _context2.abrupt("return");
|
|
273
|
-
|
|
274
|
-
case 17:
|
|
275
|
-
if (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.manualClose) {
|
|
276
|
-
_antd.Modal.success({
|
|
277
|
-
title: compile(onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage),
|
|
278
|
-
onOk: function () {
|
|
279
|
-
var _onOk = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
|
|
280
|
-
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
281
|
-
while (1) {
|
|
282
|
-
switch (_context.prev = _context.next) {
|
|
283
|
-
case 0:
|
|
284
|
-
_context.next = 2;
|
|
285
|
-
return form.reset();
|
|
286
|
-
|
|
287
|
-
case 2:
|
|
288
|
-
if ((onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.redirecting) && (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.redirectTo)) {
|
|
289
|
-
if (isURL(onSuccess.redirectTo)) {
|
|
290
|
-
window.location.href = onSuccess.redirectTo;
|
|
291
|
-
} else {
|
|
292
|
-
history.push(onSuccess.redirectTo);
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
case 3:
|
|
297
|
-
case "end":
|
|
298
|
-
return _context.stop();
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
}, _callee);
|
|
302
|
-
}));
|
|
303
|
-
|
|
304
|
-
function onOk() {
|
|
305
|
-
return _onOk.apply(this, arguments);
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
return onOk;
|
|
309
|
-
}()
|
|
310
|
-
});
|
|
311
|
-
} else {
|
|
312
|
-
_antd.message.success(compile(onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage));
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
_context2.next = 23;
|
|
182
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
183
|
+
var _actionSchema$xActio, _fieldSchema$xCompon;
|
|
184
|
+
var fieldNames, _ref, _ref$assignedValues, originalAssignedValues, onSuccess, overwriteValues, skipValidator, addChild, assignedValues, values, _treeParentField$name, _treeParentField$fore, treeParentField, _parent$service, _parent$service$refre;
|
|
185
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
186
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
187
|
+
case 0:
|
|
188
|
+
fieldNames = fields.map(function (field) {
|
|
189
|
+
return field.name;
|
|
190
|
+
});
|
|
191
|
+
_ref = (_actionSchema$xActio = actionSchema === null || actionSchema === void 0 ? void 0 : actionSchema['x-action-settings']) !== null && _actionSchema$xActio !== void 0 ? _actionSchema$xActio : {}, _ref$assignedValues = _ref.assignedValues, originalAssignedValues = _ref$assignedValues === void 0 ? {} : _ref$assignedValues, onSuccess = _ref.onSuccess, overwriteValues = _ref.overwriteValues, skipValidator = _ref.skipValidator;
|
|
192
|
+
addChild = fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xCompon = fieldSchema['x-component-props']) === null || _fieldSchema$xCompon === void 0 ? void 0 : _fieldSchema$xCompon.addChild;
|
|
193
|
+
assignedValues = (0, _jsonTemplates.default)(originalAssignedValues)({
|
|
194
|
+
currentTime: new Date(),
|
|
195
|
+
currentRecord: currentRecord,
|
|
196
|
+
currentUser: currentUser
|
|
197
|
+
});
|
|
198
|
+
if (skipValidator) {
|
|
199
|
+
_context2.next = 7;
|
|
316
200
|
break;
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
201
|
+
}
|
|
202
|
+
_context2.next = 7;
|
|
203
|
+
return form.submit();
|
|
204
|
+
case 7:
|
|
205
|
+
values = getFormValues(filterByTk, field, form, fieldNames, getField, resource);
|
|
206
|
+
if (addChild) {
|
|
207
|
+
treeParentField = getTreeParentField();
|
|
208
|
+
values[(_treeParentField$name = treeParentField === null || treeParentField === void 0 ? void 0 : treeParentField.name) !== null && _treeParentField$name !== void 0 ? _treeParentField$name : 'parent'] = currentRecord;
|
|
209
|
+
values[(_treeParentField$fore = treeParentField === null || treeParentField === void 0 ? void 0 : treeParentField.foreignKey) !== null && _treeParentField$fore !== void 0 ? _treeParentField$fore : 'parentId'] = currentRecord.id;
|
|
210
|
+
}
|
|
211
|
+
actionField.data = field.data || {};
|
|
212
|
+
actionField.data.loading = true;
|
|
213
|
+
_context2.prev = 11;
|
|
214
|
+
_context2.next = 14;
|
|
215
|
+
return resource.create({
|
|
216
|
+
values: _objectSpread(_objectSpread(_objectSpread({}, values), overwriteValues), assignedValues)
|
|
217
|
+
});
|
|
218
|
+
case 14:
|
|
219
|
+
actionField.data.loading = false;
|
|
220
|
+
__parent === null || __parent === void 0 ? void 0 : (_parent$service = __parent.service) === null || _parent$service === void 0 ? void 0 : (_parent$service$refre = _parent$service.refresh) === null || _parent$service$refre === void 0 ? void 0 : _parent$service$refre.call(_parent$service);
|
|
221
|
+
setVisible === null || setVisible === void 0 ? void 0 : setVisible(false);
|
|
222
|
+
if (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage) {
|
|
223
|
+
_context2.next = 19;
|
|
224
|
+
break;
|
|
225
|
+
}
|
|
226
|
+
return _context2.abrupt("return");
|
|
227
|
+
case 19:
|
|
228
|
+
if (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.manualClose) {
|
|
229
|
+
_antd.Modal.success({
|
|
230
|
+
title: compile(onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage),
|
|
231
|
+
onOk: function () {
|
|
232
|
+
var _onOk = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
233
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
234
|
+
while (1) switch (_context.prev = _context.next) {
|
|
235
|
+
case 0:
|
|
236
|
+
_context.next = 2;
|
|
237
|
+
return form.reset();
|
|
238
|
+
case 2:
|
|
239
|
+
if ((onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.redirecting) && (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.redirectTo)) {
|
|
240
|
+
if (isURL(onSuccess.redirectTo)) {
|
|
241
|
+
window.location.href = onSuccess.redirectTo;
|
|
242
|
+
} else {
|
|
243
|
+
history.push(onSuccess.redirectTo);
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
case 3:
|
|
247
|
+
case "end":
|
|
248
|
+
return _context.stop();
|
|
249
|
+
}
|
|
250
|
+
}, _callee);
|
|
251
|
+
}));
|
|
252
|
+
function onOk() {
|
|
253
|
+
return _onOk.apply(this, arguments);
|
|
254
|
+
}
|
|
255
|
+
return onOk;
|
|
256
|
+
}()
|
|
257
|
+
});
|
|
258
|
+
} else {
|
|
259
|
+
_antd.message.success(compile(onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage));
|
|
260
|
+
}
|
|
261
|
+
_context2.next = 25;
|
|
262
|
+
break;
|
|
263
|
+
case 22:
|
|
264
|
+
_context2.prev = 22;
|
|
265
|
+
_context2.t0 = _context2["catch"](11);
|
|
266
|
+
actionField.data.loading = false;
|
|
267
|
+
case 25:
|
|
268
|
+
case "end":
|
|
269
|
+
return _context2.stop();
|
|
327
270
|
}
|
|
328
|
-
}, _callee2, null, [[
|
|
271
|
+
}, _callee2, null, [[11, 22]]);
|
|
329
272
|
}))();
|
|
330
273
|
}
|
|
331
274
|
};
|
|
332
275
|
};
|
|
333
|
-
|
|
334
276
|
exports.useCreateActionProps = useCreateActionProps;
|
|
335
|
-
|
|
277
|
+
var findFilterTargets = function findFilterTargets(fieldSchema) {
|
|
278
|
+
while (fieldSchema) {
|
|
279
|
+
if (fieldSchema['x-filter-targets']) {
|
|
280
|
+
return {
|
|
281
|
+
targets: fieldSchema['x-filter-targets'],
|
|
282
|
+
uid: fieldSchema['x-uid']
|
|
283
|
+
};
|
|
284
|
+
}
|
|
285
|
+
fieldSchema = fieldSchema.parent;
|
|
286
|
+
}
|
|
287
|
+
return {};
|
|
288
|
+
};
|
|
289
|
+
exports.findFilterTargets = findFilterTargets;
|
|
290
|
+
var updateFilterTargets = function updateFilterTargets(fieldSchema, targets) {
|
|
291
|
+
while (fieldSchema) {
|
|
292
|
+
if (fieldSchema['x-filter-targets']) {
|
|
293
|
+
fieldSchema['x-filter-targets'] = targets;
|
|
294
|
+
return;
|
|
295
|
+
}
|
|
296
|
+
fieldSchema = fieldSchema.parent;
|
|
297
|
+
}
|
|
298
|
+
};
|
|
299
|
+
exports.updateFilterTargets = updateFilterTargets;
|
|
300
|
+
var useFilterBlockActionProps = function useFilterBlockActionProps() {
|
|
301
|
+
var form = (0, _react.useForm)();
|
|
302
|
+
var actionField = (0, _react.useField)();
|
|
303
|
+
var fieldSchema = (0, _react.useFieldSchema)();
|
|
304
|
+
var _useFilterBlock = (0, _FilterProvider.useFilterBlock)(),
|
|
305
|
+
getDataBlocks = _useFilterBlock.getDataBlocks;
|
|
306
|
+
actionField.data = actionField.data || {};
|
|
307
|
+
return {
|
|
308
|
+
onClick: function onClick() {
|
|
309
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
310
|
+
var _findFilterTargets, _findFilterTargets$ta, targets, uid;
|
|
311
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
312
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
313
|
+
case 0:
|
|
314
|
+
_findFilterTargets = findFilterTargets(fieldSchema), _findFilterTargets$ta = _findFilterTargets.targets, targets = _findFilterTargets$ta === void 0 ? [] : _findFilterTargets$ta, uid = _findFilterTargets.uid;
|
|
315
|
+
actionField.data.loading = true;
|
|
316
|
+
_context4.prev = 2;
|
|
317
|
+
_context4.next = 5;
|
|
318
|
+
return Promise.all(getDataBlocks().map( /*#__PURE__*/function () {
|
|
319
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(block) {
|
|
320
|
+
var _block$service$params, _block$service$params2, _block$service$params3;
|
|
321
|
+
var target, param, storedFilter, mergedFilter;
|
|
322
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
323
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
324
|
+
case 0:
|
|
325
|
+
target = targets.find(function (target) {
|
|
326
|
+
return target.uid === block.uid;
|
|
327
|
+
});
|
|
328
|
+
if (target) {
|
|
329
|
+
_context3.next = 3;
|
|
330
|
+
break;
|
|
331
|
+
}
|
|
332
|
+
return _context3.abrupt("return");
|
|
333
|
+
case 3:
|
|
334
|
+
param = ((_block$service$params = block.service.params) === null || _block$service$params === void 0 ? void 0 : _block$service$params[0]) || {}; // 保留原有的 filter
|
|
335
|
+
storedFilter = ((_block$service$params2 = block.service.params) === null || _block$service$params2 === void 0 ? void 0 : (_block$service$params3 = _block$service$params2[1]) === null || _block$service$params3 === void 0 ? void 0 : _block$service$params3.filters) || {};
|
|
336
|
+
storedFilter[uid] = (0, _schemaComponent.removeNullCondition)((0, _utils.transformToFilter)(form.values, fieldSchema));
|
|
337
|
+
mergedFilter = (0, _SharedFilterProvider.mergeFilter)([].concat(_toConsumableArray(Object.values(storedFilter).map(function (filter) {
|
|
338
|
+
return (0, _schemaComponent.removeNullCondition)(filter);
|
|
339
|
+
})), [block.defaultFilter]));
|
|
340
|
+
return _context3.abrupt("return", block.doFilter(_objectSpread(_objectSpread({}, param), {}, {
|
|
341
|
+
page: 1,
|
|
342
|
+
filter: mergedFilter
|
|
343
|
+
}), {
|
|
344
|
+
filters: storedFilter
|
|
345
|
+
}));
|
|
346
|
+
case 8:
|
|
347
|
+
case "end":
|
|
348
|
+
return _context3.stop();
|
|
349
|
+
}
|
|
350
|
+
}, _callee3);
|
|
351
|
+
}));
|
|
352
|
+
return function (_x) {
|
|
353
|
+
return _ref2.apply(this, arguments);
|
|
354
|
+
};
|
|
355
|
+
}()));
|
|
356
|
+
case 5:
|
|
357
|
+
actionField.data.loading = false;
|
|
358
|
+
_context4.next = 11;
|
|
359
|
+
break;
|
|
360
|
+
case 8:
|
|
361
|
+
_context4.prev = 8;
|
|
362
|
+
_context4.t0 = _context4["catch"](2);
|
|
363
|
+
actionField.data.loading = false;
|
|
364
|
+
case 11:
|
|
365
|
+
case "end":
|
|
366
|
+
return _context4.stop();
|
|
367
|
+
}
|
|
368
|
+
}, _callee4, null, [[2, 8]]);
|
|
369
|
+
}))();
|
|
370
|
+
}
|
|
371
|
+
};
|
|
372
|
+
};
|
|
373
|
+
exports.useFilterBlockActionProps = useFilterBlockActionProps;
|
|
374
|
+
var useResetBlockActionProps = function useResetBlockActionProps() {
|
|
375
|
+
var form = (0, _react.useForm)();
|
|
376
|
+
var actionField = (0, _react.useField)();
|
|
377
|
+
var fieldSchema = (0, _react.useFieldSchema)();
|
|
378
|
+
var _useFilterBlock2 = (0, _FilterProvider.useFilterBlock)(),
|
|
379
|
+
getDataBlocks = _useFilterBlock2.getDataBlocks;
|
|
380
|
+
actionField.data = actionField.data || {};
|
|
381
|
+
return {
|
|
382
|
+
onClick: function onClick() {
|
|
383
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
|
|
384
|
+
var _findFilterTargets2, targets, uid;
|
|
385
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
386
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
387
|
+
case 0:
|
|
388
|
+
_findFilterTargets2 = findFilterTargets(fieldSchema), targets = _findFilterTargets2.targets, uid = _findFilterTargets2.uid;
|
|
389
|
+
form.reset();
|
|
390
|
+
actionField.data.loading = true;
|
|
391
|
+
_context6.prev = 3;
|
|
392
|
+
_context6.next = 6;
|
|
393
|
+
return Promise.all(getDataBlocks().map( /*#__PURE__*/function () {
|
|
394
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(block) {
|
|
395
|
+
var _block$service$params4, _block$service$params5, _block$service$params6;
|
|
396
|
+
var target, param, storedFilter, mergedFilter;
|
|
397
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
398
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
399
|
+
case 0:
|
|
400
|
+
target = targets.find(function (target) {
|
|
401
|
+
return target.uid === block.uid;
|
|
402
|
+
});
|
|
403
|
+
if (target) {
|
|
404
|
+
_context5.next = 3;
|
|
405
|
+
break;
|
|
406
|
+
}
|
|
407
|
+
return _context5.abrupt("return");
|
|
408
|
+
case 3:
|
|
409
|
+
param = ((_block$service$params4 = block.service.params) === null || _block$service$params4 === void 0 ? void 0 : _block$service$params4[0]) || {}; // 保留原有的 filter
|
|
410
|
+
storedFilter = ((_block$service$params5 = block.service.params) === null || _block$service$params5 === void 0 ? void 0 : (_block$service$params6 = _block$service$params5[1]) === null || _block$service$params6 === void 0 ? void 0 : _block$service$params6.filters) || {};
|
|
411
|
+
delete storedFilter[uid];
|
|
412
|
+
mergedFilter = (0, _SharedFilterProvider.mergeFilter)([].concat(_toConsumableArray(Object.values(storedFilter)), [block.defaultFilter]));
|
|
413
|
+
return _context5.abrupt("return", block.doFilter(_objectSpread(_objectSpread({}, param), {}, {
|
|
414
|
+
page: 1,
|
|
415
|
+
filter: mergedFilter
|
|
416
|
+
}), {
|
|
417
|
+
filters: storedFilter
|
|
418
|
+
}));
|
|
419
|
+
case 8:
|
|
420
|
+
case "end":
|
|
421
|
+
return _context5.stop();
|
|
422
|
+
}
|
|
423
|
+
}, _callee5);
|
|
424
|
+
}));
|
|
425
|
+
return function (_x2) {
|
|
426
|
+
return _ref3.apply(this, arguments);
|
|
427
|
+
};
|
|
428
|
+
}()));
|
|
429
|
+
case 6:
|
|
430
|
+
actionField.data.loading = false;
|
|
431
|
+
_context6.next = 12;
|
|
432
|
+
break;
|
|
433
|
+
case 9:
|
|
434
|
+
_context6.prev = 9;
|
|
435
|
+
_context6.t0 = _context6["catch"](3);
|
|
436
|
+
actionField.data.loading = false;
|
|
437
|
+
case 12:
|
|
438
|
+
case "end":
|
|
439
|
+
return _context6.stop();
|
|
440
|
+
}
|
|
441
|
+
}, _callee6, null, [[3, 9]]);
|
|
442
|
+
}))();
|
|
443
|
+
}
|
|
444
|
+
};
|
|
445
|
+
};
|
|
446
|
+
exports.useResetBlockActionProps = useResetBlockActionProps;
|
|
336
447
|
var useCustomizeUpdateActionProps = function useCustomizeUpdateActionProps() {
|
|
337
448
|
var _currentUserContext$d2;
|
|
338
|
-
|
|
339
449
|
var _useBlockRequestConte2 = (0, _BlockProvider.useBlockRequestContext)(),
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
450
|
+
resource = _useBlockRequestConte2.resource,
|
|
451
|
+
__parent = _useBlockRequestConte2.__parent,
|
|
452
|
+
service = _useBlockRequestConte2.service;
|
|
344
453
|
var filterByTk = (0, _BlockProvider.useFilterByTk)();
|
|
345
454
|
var actionSchema = (0, _react.useFieldSchema)();
|
|
346
455
|
var currentRecord = (0, _recordProvider.useRecord)();
|
|
@@ -351,854 +460,680 @@ var useCustomizeUpdateActionProps = function useCustomizeUpdateActionProps() {
|
|
|
351
460
|
var form = (0, _react.useForm)();
|
|
352
461
|
return {
|
|
353
462
|
onClick: function onClick() {
|
|
354
|
-
return _asyncToGenerator( /*#__PURE__*/
|
|
463
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
|
|
355
464
|
var _actionSchema$xActio2, _service$refresh;
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
onOk: function () {
|
|
404
|
-
var _onOk2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3() {
|
|
405
|
-
return regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
406
|
-
while (1) {
|
|
407
|
-
switch (_context3.prev = _context3.next) {
|
|
408
|
-
case 0:
|
|
409
|
-
if ((onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.redirecting) && (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.redirectTo)) {
|
|
410
|
-
if (isURL(onSuccess.redirectTo)) {
|
|
411
|
-
window.location.href = onSuccess.redirectTo;
|
|
412
|
-
} else {
|
|
413
|
-
history.push(onSuccess.redirectTo);
|
|
414
|
-
}
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
case 1:
|
|
418
|
-
case "end":
|
|
419
|
-
return _context3.stop();
|
|
465
|
+
var _ref4, _ref4$assignedValues, originalAssignedValues, onSuccess, skipValidator, assignedValues, _parent$service2, _parent$service2$refr;
|
|
466
|
+
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
467
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
468
|
+
case 0:
|
|
469
|
+
_ref4 = (_actionSchema$xActio2 = actionSchema === null || actionSchema === void 0 ? void 0 : actionSchema['x-action-settings']) !== null && _actionSchema$xActio2 !== void 0 ? _actionSchema$xActio2 : {}, _ref4$assignedValues = _ref4.assignedValues, originalAssignedValues = _ref4$assignedValues === void 0 ? {} : _ref4$assignedValues, onSuccess = _ref4.onSuccess, skipValidator = _ref4.skipValidator;
|
|
470
|
+
assignedValues = (0, _jsonTemplates.default)(originalAssignedValues)({
|
|
471
|
+
currentTime: new Date(),
|
|
472
|
+
currentRecord: currentRecord,
|
|
473
|
+
currentUser: currentUser
|
|
474
|
+
});
|
|
475
|
+
if (!(skipValidator === false)) {
|
|
476
|
+
_context8.next = 5;
|
|
477
|
+
break;
|
|
478
|
+
}
|
|
479
|
+
_context8.next = 5;
|
|
480
|
+
return form.submit();
|
|
481
|
+
case 5:
|
|
482
|
+
_context8.next = 7;
|
|
483
|
+
return resource.update({
|
|
484
|
+
filterByTk: filterByTk,
|
|
485
|
+
values: _objectSpread({}, assignedValues)
|
|
486
|
+
});
|
|
487
|
+
case 7:
|
|
488
|
+
service === null || service === void 0 ? void 0 : (_service$refresh = service.refresh) === null || _service$refresh === void 0 ? void 0 : _service$refresh.call(service);
|
|
489
|
+
if (!(resource instanceof _TableFieldProvider.TableFieldResource)) {
|
|
490
|
+
__parent === null || __parent === void 0 ? void 0 : (_parent$service2 = __parent.service) === null || _parent$service2 === void 0 ? void 0 : (_parent$service2$refr = _parent$service2.refresh) === null || _parent$service2$refr === void 0 ? void 0 : _parent$service2$refr.call(_parent$service2);
|
|
491
|
+
}
|
|
492
|
+
if (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage) {
|
|
493
|
+
_context8.next = 11;
|
|
494
|
+
break;
|
|
495
|
+
}
|
|
496
|
+
return _context8.abrupt("return");
|
|
497
|
+
case 11:
|
|
498
|
+
if (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.manualClose) {
|
|
499
|
+
_antd.Modal.success({
|
|
500
|
+
title: compile(onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage),
|
|
501
|
+
onOk: function () {
|
|
502
|
+
var _onOk2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
|
|
503
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
504
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
505
|
+
case 0:
|
|
506
|
+
if ((onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.redirecting) && (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.redirectTo)) {
|
|
507
|
+
if (isURL(onSuccess.redirectTo)) {
|
|
508
|
+
window.location.href = onSuccess.redirectTo;
|
|
509
|
+
} else {
|
|
510
|
+
history.push(onSuccess.redirectTo);
|
|
511
|
+
}
|
|
420
512
|
}
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
})
|
|
432
|
-
}
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
}
|
|
513
|
+
case 1:
|
|
514
|
+
case "end":
|
|
515
|
+
return _context7.stop();
|
|
516
|
+
}
|
|
517
|
+
}, _callee7);
|
|
518
|
+
}));
|
|
519
|
+
function onOk() {
|
|
520
|
+
return _onOk2.apply(this, arguments);
|
|
521
|
+
}
|
|
522
|
+
return onOk;
|
|
523
|
+
}()
|
|
524
|
+
});
|
|
525
|
+
} else {
|
|
526
|
+
_antd.message.success(compile(onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage));
|
|
527
|
+
}
|
|
528
|
+
case 12:
|
|
529
|
+
case "end":
|
|
530
|
+
return _context8.stop();
|
|
440
531
|
}
|
|
441
|
-
},
|
|
532
|
+
}, _callee8);
|
|
442
533
|
}))();
|
|
443
534
|
}
|
|
444
535
|
};
|
|
445
536
|
};
|
|
446
|
-
|
|
447
537
|
exports.useCustomizeUpdateActionProps = useCustomizeUpdateActionProps;
|
|
448
|
-
|
|
449
538
|
var useCustomizeBulkUpdateActionProps = function useCustomizeBulkUpdateActionProps() {
|
|
450
|
-
var _tableBlockContext$fi, _tableBlockContext$fi2, _currentUserContext$d3;
|
|
451
|
-
|
|
539
|
+
var _ref5, _tableBlockContext$fi, _tableBlockContext$fi2, _tableBlockContext$fi3, _currentUserContext$d3;
|
|
452
540
|
var _useBlockRequestConte3 = (0, _BlockProvider.useBlockRequestContext)(),
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
541
|
+
field = _useBlockRequestConte3.field,
|
|
542
|
+
resource = _useBlockRequestConte3.resource,
|
|
543
|
+
__parent = _useBlockRequestConte3.__parent,
|
|
544
|
+
service = _useBlockRequestConte3.service;
|
|
545
|
+
var expressionScope = (0, _react2.useContext)(_react.SchemaExpressionScopeContext);
|
|
458
546
|
var actionSchema = (0, _react.useFieldSchema)();
|
|
459
|
-
var currentRecord = (0, _recordProvider.useRecord)();
|
|
460
547
|
var tableBlockContext = (0, _2.useTableBlockContext)();
|
|
461
548
|
var rowKey = tableBlockContext.rowKey;
|
|
462
|
-
|
|
463
|
-
var _ref3 = (_tableBlockContext$fi = (_tableBlockContext$fi2 = tableBlockContext.field) === null || _tableBlockContext$fi2 === void 0 ? void 0 : _tableBlockContext$fi2.data) !== null && _tableBlockContext$fi !== void 0 ? _tableBlockContext$fi : {},
|
|
464
|
-
selectedRowKeys = _ref3.selectedRowKeys;
|
|
465
|
-
|
|
549
|
+
var selectedRecordKeys = (_ref5 = (_tableBlockContext$fi = (_tableBlockContext$fi2 = tableBlockContext.field) === null || _tableBlockContext$fi2 === void 0 ? void 0 : (_tableBlockContext$fi3 = _tableBlockContext$fi2.data) === null || _tableBlockContext$fi3 === void 0 ? void 0 : _tableBlockContext$fi3.selectedRowKeys) !== null && _tableBlockContext$fi !== void 0 ? _tableBlockContext$fi : expressionScope === null || expressionScope === void 0 ? void 0 : expressionScope.selectedRecordKeys) !== null && _ref5 !== void 0 ? _ref5 : {};
|
|
466
550
|
var currentUserContext = (0, _user.useCurrentUserContext)();
|
|
467
551
|
var currentUser = currentUserContext === null || currentUserContext === void 0 ? void 0 : (_currentUserContext$d3 = currentUserContext.data) === null || _currentUserContext$d3 === void 0 ? void 0 : _currentUserContext$d3.data;
|
|
468
552
|
var history = (0, _reactRouterDom.useHistory)();
|
|
469
553
|
var compile = (0, _schemaComponent.useCompile)();
|
|
470
|
-
|
|
471
554
|
var _useTranslation2 = (0, _reactI18next.useTranslation)(),
|
|
472
|
-
|
|
473
|
-
|
|
555
|
+
t = _useTranslation2.t;
|
|
474
556
|
var actionField = (0, _react.useField)();
|
|
475
557
|
return {
|
|
476
558
|
onClick: function onClick() {
|
|
477
|
-
return _asyncToGenerator( /*#__PURE__*/
|
|
559
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12() {
|
|
478
560
|
var _actionSchema$xActio3;
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
if (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage) {
|
|
566
|
-
_context6.next = 23;
|
|
567
|
-
break;
|
|
568
|
-
}
|
|
569
|
-
|
|
570
|
-
return _context6.abrupt("return");
|
|
571
|
-
|
|
572
|
-
case 23:
|
|
573
|
-
if (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.manualClose) {
|
|
574
|
-
_antd.Modal.success({
|
|
575
|
-
title: compile(onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage),
|
|
576
|
-
onOk: function () {
|
|
577
|
-
var _onOk3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5() {
|
|
578
|
-
return regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
579
|
-
while (1) {
|
|
580
|
-
switch (_context5.prev = _context5.next) {
|
|
581
|
-
case 0:
|
|
582
|
-
if ((onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.redirecting) && (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.redirectTo)) {
|
|
583
|
-
if (isURL(onSuccess.redirectTo)) {
|
|
584
|
-
window.location.href = onSuccess.redirectTo;
|
|
585
|
-
} else {
|
|
586
|
-
history.push(onSuccess.redirectTo);
|
|
587
|
-
}
|
|
588
|
-
}
|
|
589
|
-
|
|
590
|
-
case 1:
|
|
591
|
-
case "end":
|
|
592
|
-
return _context5.stop();
|
|
561
|
+
var _ref6, _ref6$assignedValues, originalAssignedValues, onSuccess, updateMode, assignedValues;
|
|
562
|
+
return _regeneratorRuntime().wrap(function _callee12$(_context12) {
|
|
563
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
564
|
+
case 0:
|
|
565
|
+
_ref6 = (_actionSchema$xActio3 = actionSchema === null || actionSchema === void 0 ? void 0 : actionSchema['x-action-settings']) !== null && _actionSchema$xActio3 !== void 0 ? _actionSchema$xActio3 : {}, _ref6$assignedValues = _ref6.assignedValues, originalAssignedValues = _ref6$assignedValues === void 0 ? {} : _ref6$assignedValues, onSuccess = _ref6.onSuccess, updateMode = _ref6.updateMode;
|
|
566
|
+
actionField.data = field.data || {};
|
|
567
|
+
actionField.data.loading = true;
|
|
568
|
+
assignedValues = (0, _jsonTemplates.default)(originalAssignedValues)({
|
|
569
|
+
currentTime: new Date(),
|
|
570
|
+
currentUser: currentUser
|
|
571
|
+
});
|
|
572
|
+
_antd.Modal.confirm({
|
|
573
|
+
title: t('Bulk update'),
|
|
574
|
+
content: updateMode === 'selected' ? t('Update selected data?') : t('Update all data?'),
|
|
575
|
+
onOk: function onOk() {
|
|
576
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10() {
|
|
577
|
+
var _service$params$, _service$params, _service$refresh2;
|
|
578
|
+
var _ref7, filter, updateData, _parent$service3, _parent$service3$refr;
|
|
579
|
+
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
580
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
581
|
+
case 0:
|
|
582
|
+
_ref7 = (_service$params$ = (_service$params = service.params) === null || _service$params === void 0 ? void 0 : _service$params[0]) !== null && _service$params$ !== void 0 ? _service$params$ : {}, filter = _ref7.filter;
|
|
583
|
+
updateData = {
|
|
584
|
+
values: _objectSpread({}, assignedValues),
|
|
585
|
+
filter: filter,
|
|
586
|
+
forceUpdate: false
|
|
587
|
+
};
|
|
588
|
+
if (!(updateMode === 'selected')) {
|
|
589
|
+
_context10.next = 8;
|
|
590
|
+
break;
|
|
591
|
+
}
|
|
592
|
+
if (selectedRecordKeys === null || selectedRecordKeys === void 0 ? void 0 : selectedRecordKeys.length) {
|
|
593
|
+
_context10.next = 7;
|
|
594
|
+
break;
|
|
595
|
+
}
|
|
596
|
+
_antd.message.error(t('Please select the records to be updated'));
|
|
597
|
+
actionField.data.loading = false;
|
|
598
|
+
return _context10.abrupt("return");
|
|
599
|
+
case 7:
|
|
600
|
+
updateData.filter = {
|
|
601
|
+
$and: [_defineProperty({}, rowKey || 'id', {
|
|
602
|
+
$in: selectedRecordKeys
|
|
603
|
+
})]
|
|
604
|
+
};
|
|
605
|
+
case 8:
|
|
606
|
+
if (!updateData.filter) {
|
|
607
|
+
updateData.forceUpdate = true;
|
|
608
|
+
}
|
|
609
|
+
_context10.prev = 9;
|
|
610
|
+
_context10.next = 12;
|
|
611
|
+
return resource.update(updateData);
|
|
612
|
+
case 12:
|
|
613
|
+
_context10.next = 16;
|
|
614
|
+
break;
|
|
615
|
+
case 14:
|
|
616
|
+
_context10.prev = 14;
|
|
617
|
+
_context10.t0 = _context10["catch"](9);
|
|
618
|
+
case 16:
|
|
619
|
+
_context10.prev = 16;
|
|
620
|
+
actionField.data.loading = false;
|
|
621
|
+
return _context10.finish(16);
|
|
622
|
+
case 19:
|
|
623
|
+
service === null || service === void 0 ? void 0 : (_service$refresh2 = service.refresh) === null || _service$refresh2 === void 0 ? void 0 : _service$refresh2.call(service);
|
|
624
|
+
if (!(resource instanceof _TableFieldProvider.TableFieldResource)) {
|
|
625
|
+
__parent === null || __parent === void 0 ? void 0 : (_parent$service3 = __parent.service) === null || _parent$service3 === void 0 ? void 0 : (_parent$service3$refr = _parent$service3.refresh) === null || _parent$service3$refr === void 0 ? void 0 : _parent$service3$refr.call(_parent$service3);
|
|
626
|
+
}
|
|
627
|
+
if (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage) {
|
|
628
|
+
_context10.next = 23;
|
|
629
|
+
break;
|
|
630
|
+
}
|
|
631
|
+
return _context10.abrupt("return");
|
|
632
|
+
case 23:
|
|
633
|
+
if (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.manualClose) {
|
|
634
|
+
_antd.Modal.success({
|
|
635
|
+
title: compile(onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage),
|
|
636
|
+
onOk: function () {
|
|
637
|
+
var _onOk3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
|
|
638
|
+
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
639
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
640
|
+
case 0:
|
|
641
|
+
if ((onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.redirecting) && (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.redirectTo)) {
|
|
642
|
+
if (isURL(onSuccess.redirectTo)) {
|
|
643
|
+
window.location.href = onSuccess.redirectTo;
|
|
644
|
+
} else {
|
|
645
|
+
history.push(onSuccess.redirectTo);
|
|
593
646
|
}
|
|
594
647
|
}
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
function onOk() {
|
|
599
|
-
return _onOk3.apply(this, arguments);
|
|
648
|
+
case 1:
|
|
649
|
+
case "end":
|
|
650
|
+
return _context9.stop();
|
|
600
651
|
}
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
}
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
return _context6.stop();
|
|
612
|
-
}
|
|
613
|
-
}
|
|
614
|
-
}, _callee6, null, [[9, 14, 16, 19]]);
|
|
615
|
-
}))();
|
|
616
|
-
},
|
|
617
|
-
onCancel: function onCancel() {
|
|
618
|
-
return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee7() {
|
|
619
|
-
return regeneratorRuntime.wrap(function _callee7$(_context7) {
|
|
620
|
-
while (1) {
|
|
621
|
-
switch (_context7.prev = _context7.next) {
|
|
622
|
-
case 0:
|
|
623
|
-
actionField.data.loading = false;
|
|
624
|
-
|
|
625
|
-
case 1:
|
|
626
|
-
case "end":
|
|
627
|
-
return _context7.stop();
|
|
652
|
+
}, _callee9);
|
|
653
|
+
}));
|
|
654
|
+
function onOk() {
|
|
655
|
+
return _onOk3.apply(this, arguments);
|
|
656
|
+
}
|
|
657
|
+
return onOk;
|
|
658
|
+
}()
|
|
659
|
+
});
|
|
660
|
+
} else {
|
|
661
|
+
_antd.message.success(compile(onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage));
|
|
628
662
|
}
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
663
|
+
case 24:
|
|
664
|
+
case "end":
|
|
665
|
+
return _context10.stop();
|
|
666
|
+
}
|
|
667
|
+
}, _callee10, null, [[9, 14, 16, 19]]);
|
|
668
|
+
}))();
|
|
669
|
+
},
|
|
670
|
+
onCancel: function onCancel() {
|
|
671
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11() {
|
|
672
|
+
return _regeneratorRuntime().wrap(function _callee11$(_context11) {
|
|
673
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
674
|
+
case 0:
|
|
675
|
+
actionField.data.loading = false;
|
|
676
|
+
case 1:
|
|
677
|
+
case "end":
|
|
678
|
+
return _context11.stop();
|
|
679
|
+
}
|
|
680
|
+
}, _callee11);
|
|
681
|
+
}))();
|
|
682
|
+
}
|
|
683
|
+
});
|
|
684
|
+
case 5:
|
|
685
|
+
case "end":
|
|
686
|
+
return _context12.stop();
|
|
639
687
|
}
|
|
640
|
-
},
|
|
688
|
+
}, _callee12);
|
|
641
689
|
}))();
|
|
642
690
|
}
|
|
643
691
|
};
|
|
644
692
|
};
|
|
645
|
-
|
|
646
693
|
exports.useCustomizeBulkUpdateActionProps = useCustomizeBulkUpdateActionProps;
|
|
647
|
-
|
|
648
694
|
var useCustomizeBulkEditActionProps = function useCustomizeBulkEditActionProps() {
|
|
649
|
-
var _tableBlockContext$
|
|
650
|
-
|
|
695
|
+
var _ref9, _tableBlockContext$fi4, _tableBlockContext$fi5, _tableBlockContext$fi6;
|
|
651
696
|
var form = (0, _react.useForm)();
|
|
652
|
-
|
|
653
697
|
var _useTranslation3 = (0, _reactI18next.useTranslation)(),
|
|
654
|
-
|
|
655
|
-
|
|
698
|
+
t = _useTranslation3.t;
|
|
656
699
|
var _useBlockRequestConte4 = (0, _BlockProvider.useBlockRequestContext)(),
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
700
|
+
field = _useBlockRequestConte4.field,
|
|
701
|
+
resource = _useBlockRequestConte4.resource,
|
|
702
|
+
__parent = _useBlockRequestConte4.__parent;
|
|
703
|
+
var expressionScope = (0, _react2.useContext)(_react.SchemaExpressionScopeContext);
|
|
661
704
|
var actionContext = (0, _schemaComponent.useActionContext)();
|
|
662
705
|
var history = (0, _reactRouterDom.useHistory)();
|
|
663
706
|
var compile = (0, _schemaComponent.useCompile)();
|
|
664
707
|
var actionField = (0, _react.useField)();
|
|
665
708
|
var tableBlockContext = (0, _2.useTableBlockContext)();
|
|
666
709
|
var rowKey = tableBlockContext.rowKey;
|
|
667
|
-
|
|
668
|
-
var _ref7 = (_tableBlockContext$fi3 = (_tableBlockContext$fi4 = tableBlockContext.field) === null || _tableBlockContext$fi4 === void 0 ? void 0 : _tableBlockContext$fi4.data) !== null && _tableBlockContext$fi3 !== void 0 ? _tableBlockContext$fi3 : {},
|
|
669
|
-
selectedRowKeys = _ref7.selectedRowKeys;
|
|
670
|
-
|
|
710
|
+
var selectedRecordKeys = (_ref9 = (_tableBlockContext$fi4 = (_tableBlockContext$fi5 = tableBlockContext.field) === null || _tableBlockContext$fi5 === void 0 ? void 0 : (_tableBlockContext$fi6 = _tableBlockContext$fi5.data) === null || _tableBlockContext$fi6 === void 0 ? void 0 : _tableBlockContext$fi6.selectedRowKeys) !== null && _tableBlockContext$fi4 !== void 0 ? _tableBlockContext$fi4 : expressionScope === null || expressionScope === void 0 ? void 0 : expressionScope.selectedRecordKeys) !== null && _ref9 !== void 0 ? _ref9 : {};
|
|
671
711
|
var setVisible = actionContext.setVisible,
|
|
672
|
-
|
|
712
|
+
actionSchema = actionContext.fieldSchema;
|
|
673
713
|
return {
|
|
674
714
|
onClick: function onClick() {
|
|
675
|
-
return _asyncToGenerator( /*#__PURE__*/
|
|
715
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14() {
|
|
676
716
|
var _actionSchema$xActio4, _parent$service$para, _parent$service$para2;
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
value = values[key];
|
|
703
|
-
|
|
704
|
-
if (_components.BulkEditFormItemValueType.Clear in value) {
|
|
705
|
-
values[key] = null;
|
|
706
|
-
} else if (_components.BulkEditFormItemValueType.ChangedTo in value) {
|
|
707
|
-
values[key] = value[_components.BulkEditFormItemValueType.ChangedTo];
|
|
708
|
-
} else if (_components.BulkEditFormItemValueType.RemainsTheSame in value) {
|
|
709
|
-
delete values[key];
|
|
710
|
-
}
|
|
717
|
+
var _ref10, onSuccess, skipValidator, updateMode, _ref11, filter, values, key, value, _parent$service4, _parent$service4$refr, updateData, _parent$__parent, _parent$__parent$serv, _parent$__parent$serv2;
|
|
718
|
+
return _regeneratorRuntime().wrap(function _callee14$(_context14) {
|
|
719
|
+
while (1) switch (_context14.prev = _context14.next) {
|
|
720
|
+
case 0:
|
|
721
|
+
_ref10 = (_actionSchema$xActio4 = actionSchema === null || actionSchema === void 0 ? void 0 : actionSchema['x-action-settings']) !== null && _actionSchema$xActio4 !== void 0 ? _actionSchema$xActio4 : {}, onSuccess = _ref10.onSuccess, skipValidator = _ref10.skipValidator, updateMode = _ref10.updateMode;
|
|
722
|
+
_ref11 = (_parent$service$para = (_parent$service$para2 = __parent.service.params) === null || _parent$service$para2 === void 0 ? void 0 : _parent$service$para2[0]) !== null && _parent$service$para !== void 0 ? _parent$service$para : {}, filter = _ref11.filter;
|
|
723
|
+
if (skipValidator) {
|
|
724
|
+
_context14.next = 5;
|
|
725
|
+
break;
|
|
726
|
+
}
|
|
727
|
+
_context14.next = 5;
|
|
728
|
+
return form.submit();
|
|
729
|
+
case 5:
|
|
730
|
+
values = (0, _lodash.cloneDeep)(form.values);
|
|
731
|
+
actionField.data = field.data || {};
|
|
732
|
+
actionField.data.loading = true;
|
|
733
|
+
for (key in values) {
|
|
734
|
+
if (Object.prototype.hasOwnProperty.call(values, key)) {
|
|
735
|
+
value = values[key];
|
|
736
|
+
if (_components.BulkEditFormItemValueType.Clear in value) {
|
|
737
|
+
values[key] = null;
|
|
738
|
+
} else if (_components.BulkEditFormItemValueType.ChangedTo in value) {
|
|
739
|
+
values[key] = value[_components.BulkEditFormItemValueType.ChangedTo];
|
|
740
|
+
} else if (_components.BulkEditFormItemValueType.RemainsTheSame in value) {
|
|
741
|
+
delete values[key];
|
|
711
742
|
}
|
|
712
743
|
}
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
var _onOk4 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee9() {
|
|
773
|
-
return regeneratorRuntime.wrap(function _callee9$(_context9) {
|
|
774
|
-
while (1) {
|
|
775
|
-
switch (_context9.prev = _context9.next) {
|
|
776
|
-
case 0:
|
|
777
|
-
_context9.next = 2;
|
|
778
|
-
return form.reset();
|
|
779
|
-
|
|
780
|
-
case 2:
|
|
781
|
-
if ((onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.redirecting) && (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.redirectTo)) {
|
|
782
|
-
if (isURL(onSuccess.redirectTo)) {
|
|
783
|
-
window.location.href = onSuccess.redirectTo;
|
|
784
|
-
} else {
|
|
785
|
-
history.push(onSuccess.redirectTo);
|
|
786
|
-
}
|
|
787
|
-
}
|
|
788
|
-
|
|
789
|
-
case 3:
|
|
790
|
-
case "end":
|
|
791
|
-
return _context9.stop();
|
|
744
|
+
}
|
|
745
|
+
_context14.prev = 9;
|
|
746
|
+
updateData = {
|
|
747
|
+
values: values,
|
|
748
|
+
filter: filter,
|
|
749
|
+
forceUpdate: false
|
|
750
|
+
};
|
|
751
|
+
if (!(updateMode === 'selected')) {
|
|
752
|
+
_context14.next = 16;
|
|
753
|
+
break;
|
|
754
|
+
}
|
|
755
|
+
if (selectedRecordKeys === null || selectedRecordKeys === void 0 ? void 0 : selectedRecordKeys.length) {
|
|
756
|
+
_context14.next = 15;
|
|
757
|
+
break;
|
|
758
|
+
}
|
|
759
|
+
_antd.message.error(t('Please select the records to be updated'));
|
|
760
|
+
return _context14.abrupt("return");
|
|
761
|
+
case 15:
|
|
762
|
+
updateData.filter = {
|
|
763
|
+
$and: [_defineProperty({}, rowKey || 'id', {
|
|
764
|
+
$in: selectedRecordKeys
|
|
765
|
+
})]
|
|
766
|
+
};
|
|
767
|
+
case 16:
|
|
768
|
+
if (!updateData.filter) {
|
|
769
|
+
updateData.forceUpdate = true;
|
|
770
|
+
}
|
|
771
|
+
_context14.next = 19;
|
|
772
|
+
return resource.update(updateData);
|
|
773
|
+
case 19:
|
|
774
|
+
actionField.data.loading = false;
|
|
775
|
+
if (!(resource instanceof _TableFieldProvider.TableFieldResource)) {
|
|
776
|
+
__parent === null || __parent === void 0 ? void 0 : (_parent$__parent = __parent.__parent) === null || _parent$__parent === void 0 ? void 0 : (_parent$__parent$serv = _parent$__parent.service) === null || _parent$__parent$serv === void 0 ? void 0 : (_parent$__parent$serv2 = _parent$__parent$serv.refresh) === null || _parent$__parent$serv2 === void 0 ? void 0 : _parent$__parent$serv2.call(_parent$__parent$serv);
|
|
777
|
+
}
|
|
778
|
+
__parent === null || __parent === void 0 ? void 0 : (_parent$service4 = __parent.service) === null || _parent$service4 === void 0 ? void 0 : (_parent$service4$refr = _parent$service4.refresh) === null || _parent$service4$refr === void 0 ? void 0 : _parent$service4$refr.call(_parent$service4);
|
|
779
|
+
setVisible === null || setVisible === void 0 ? void 0 : setVisible(false);
|
|
780
|
+
if (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage) {
|
|
781
|
+
_context14.next = 25;
|
|
782
|
+
break;
|
|
783
|
+
}
|
|
784
|
+
return _context14.abrupt("return");
|
|
785
|
+
case 25:
|
|
786
|
+
if (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.manualClose) {
|
|
787
|
+
_antd.Modal.success({
|
|
788
|
+
title: compile(onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage),
|
|
789
|
+
onOk: function () {
|
|
790
|
+
var _onOk4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13() {
|
|
791
|
+
return _regeneratorRuntime().wrap(function _callee13$(_context13) {
|
|
792
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
793
|
+
case 0:
|
|
794
|
+
_context13.next = 2;
|
|
795
|
+
return form.reset();
|
|
796
|
+
case 2:
|
|
797
|
+
if ((onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.redirecting) && (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.redirectTo)) {
|
|
798
|
+
if (isURL(onSuccess.redirectTo)) {
|
|
799
|
+
window.location.href = onSuccess.redirectTo;
|
|
800
|
+
} else {
|
|
801
|
+
history.push(onSuccess.redirectTo);
|
|
802
|
+
}
|
|
792
803
|
}
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
})
|
|
804
|
-
}
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
return _context10.stop();
|
|
816
|
-
}
|
|
804
|
+
case 3:
|
|
805
|
+
case "end":
|
|
806
|
+
return _context13.stop();
|
|
807
|
+
}
|
|
808
|
+
}, _callee13);
|
|
809
|
+
}));
|
|
810
|
+
function onOk() {
|
|
811
|
+
return _onOk4.apply(this, arguments);
|
|
812
|
+
}
|
|
813
|
+
return onOk;
|
|
814
|
+
}()
|
|
815
|
+
});
|
|
816
|
+
} else {
|
|
817
|
+
_antd.message.success(compile(onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage));
|
|
818
|
+
}
|
|
819
|
+
case 26:
|
|
820
|
+
_context14.prev = 26;
|
|
821
|
+
actionField.data.loading = false;
|
|
822
|
+
return _context14.finish(26);
|
|
823
|
+
case 29:
|
|
824
|
+
case "end":
|
|
825
|
+
return _context14.stop();
|
|
817
826
|
}
|
|
818
|
-
},
|
|
827
|
+
}, _callee14, null, [[9,, 26, 29]]);
|
|
819
828
|
}))();
|
|
820
829
|
}
|
|
821
830
|
};
|
|
822
831
|
};
|
|
823
|
-
|
|
824
832
|
exports.useCustomizeBulkEditActionProps = useCustomizeBulkEditActionProps;
|
|
825
|
-
|
|
826
833
|
var useCustomizeRequestActionProps = function useCustomizeRequestActionProps() {
|
|
827
834
|
var _currentUserContext$d4;
|
|
828
|
-
|
|
829
835
|
var apiClient = (0, _apiClient.useAPIClient)();
|
|
830
836
|
var history = (0, _reactRouterDom.useHistory)();
|
|
831
837
|
var filterByTk = (0, _BlockProvider.useFilterByTk)();
|
|
832
838
|
var actionSchema = (0, _react.useFieldSchema)();
|
|
833
839
|
var compile = (0, _schemaComponent.useCompile)();
|
|
834
840
|
var form = (0, _react.useForm)();
|
|
835
|
-
|
|
836
841
|
var _useCollection2 = (0, _collectionManager.useCollection)(),
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
842
|
+
fields = _useCollection2.fields,
|
|
843
|
+
getField = _useCollection2.getField;
|
|
840
844
|
var _useBlockRequestConte5 = (0, _BlockProvider.useBlockRequestContext)(),
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
845
|
+
field = _useBlockRequestConte5.field,
|
|
846
|
+
resource = _useBlockRequestConte5.resource,
|
|
847
|
+
__parent = _useBlockRequestConte5.__parent,
|
|
848
|
+
service = _useBlockRequestConte5.service;
|
|
846
849
|
var currentRecord = (0, _recordProvider.useRecord)();
|
|
847
850
|
var currentUserContext = (0, _user.useCurrentUserContext)();
|
|
848
851
|
var currentUser = currentUserContext === null || currentUserContext === void 0 ? void 0 : (_currentUserContext$d4 = currentUserContext.data) === null || _currentUserContext$d4 === void 0 ? void 0 : _currentUserContext$d4.data;
|
|
849
852
|
var actionField = (0, _react.useField)();
|
|
850
|
-
|
|
851
853
|
var _useActionContext2 = (0, _schemaComponent.useActionContext)(),
|
|
852
|
-
|
|
853
|
-
setVisible = _useActionContext2.setVisible;
|
|
854
|
-
|
|
854
|
+
setVisible = _useActionContext2.setVisible;
|
|
855
855
|
return {
|
|
856
856
|
onClick: function onClick() {
|
|
857
|
-
return _asyncToGenerator( /*#__PURE__*/
|
|
857
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16() {
|
|
858
858
|
var _actionSchema$xActio5;
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
return _context12.abrupt("return");
|
|
943
|
-
|
|
944
|
-
case 24:
|
|
945
|
-
if (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.manualClose) {
|
|
946
|
-
_antd.Modal.success({
|
|
947
|
-
title: compile(onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage),
|
|
948
|
-
onOk: function () {
|
|
949
|
-
var _onOk5 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee11() {
|
|
950
|
-
return regeneratorRuntime.wrap(function _callee11$(_context11) {
|
|
951
|
-
while (1) {
|
|
952
|
-
switch (_context11.prev = _context11.next) {
|
|
953
|
-
case 0:
|
|
954
|
-
if ((onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.redirecting) && (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.redirectTo)) {
|
|
955
|
-
if (isURL(onSuccess.redirectTo)) {
|
|
956
|
-
window.location.href = onSuccess.redirectTo;
|
|
957
|
-
} else {
|
|
958
|
-
history.push(onSuccess.redirectTo);
|
|
959
|
-
}
|
|
960
|
-
}
|
|
961
|
-
|
|
962
|
-
case 1:
|
|
963
|
-
case "end":
|
|
964
|
-
return _context11.stop();
|
|
859
|
+
var _ref13, skipValidator, onSuccess, requestSettings, xAction, headers, params, data, methods, fieldNames, values, requestBody, _service$refresh3, _parent$service5, _parent$service5$refr;
|
|
860
|
+
return _regeneratorRuntime().wrap(function _callee16$(_context16) {
|
|
861
|
+
while (1) switch (_context16.prev = _context16.next) {
|
|
862
|
+
case 0:
|
|
863
|
+
_ref13 = (_actionSchema$xActio5 = actionSchema === null || actionSchema === void 0 ? void 0 : actionSchema['x-action-settings']) !== null && _actionSchema$xActio5 !== void 0 ? _actionSchema$xActio5 : {}, skipValidator = _ref13.skipValidator, onSuccess = _ref13.onSuccess, requestSettings = _ref13.requestSettings;
|
|
864
|
+
xAction = actionSchema === null || actionSchema === void 0 ? void 0 : actionSchema['x-action'];
|
|
865
|
+
if (requestSettings['url']) {
|
|
866
|
+
_context16.next = 4;
|
|
867
|
+
break;
|
|
868
|
+
}
|
|
869
|
+
return _context16.abrupt("return");
|
|
870
|
+
case 4:
|
|
871
|
+
if (!(skipValidator !== true && xAction === 'customize:form:request')) {
|
|
872
|
+
_context16.next = 7;
|
|
873
|
+
break;
|
|
874
|
+
}
|
|
875
|
+
_context16.next = 7;
|
|
876
|
+
return form.submit();
|
|
877
|
+
case 7:
|
|
878
|
+
headers = requestSettings['headers'] ? JSON.parse(requestSettings['headers']) : {};
|
|
879
|
+
params = requestSettings['params'] ? JSON.parse(requestSettings['params']) : {};
|
|
880
|
+
data = requestSettings['data'] ? JSON.parse(requestSettings['data']) : {};
|
|
881
|
+
methods = ['POST', 'PUT', 'PATCH'];
|
|
882
|
+
if (xAction === 'customize:form:request' && methods.includes(requestSettings['method'])) {
|
|
883
|
+
fieldNames = fields.map(function (field) {
|
|
884
|
+
return field.name;
|
|
885
|
+
});
|
|
886
|
+
values = getFormValues(filterByTk, field, form, fieldNames, getField, resource);
|
|
887
|
+
Object.assign(data, values);
|
|
888
|
+
}
|
|
889
|
+
requestBody = {
|
|
890
|
+
url: renderTemplate(requestSettings['url'], {
|
|
891
|
+
currentRecord: currentRecord,
|
|
892
|
+
currentUser: currentUser
|
|
893
|
+
}),
|
|
894
|
+
method: requestSettings['method'],
|
|
895
|
+
headers: (0, _jsonTemplates.default)(headers)({
|
|
896
|
+
currentRecord: currentRecord,
|
|
897
|
+
currentUser: currentUser
|
|
898
|
+
}),
|
|
899
|
+
params: (0, _jsonTemplates.default)(params)({
|
|
900
|
+
currentRecord: currentRecord,
|
|
901
|
+
currentUser: currentUser
|
|
902
|
+
}),
|
|
903
|
+
data: (0, _jsonTemplates.default)(data)({
|
|
904
|
+
currentRecord: currentRecord,
|
|
905
|
+
currentUser: currentUser
|
|
906
|
+
})
|
|
907
|
+
};
|
|
908
|
+
actionField.data = field.data || {};
|
|
909
|
+
actionField.data.loading = true;
|
|
910
|
+
_context16.prev = 15;
|
|
911
|
+
_context16.next = 18;
|
|
912
|
+
return apiClient.request(_objectSpread({}, requestBody));
|
|
913
|
+
case 18:
|
|
914
|
+
actionField.data.loading = false;
|
|
915
|
+
if (!(resource instanceof _TableFieldProvider.TableFieldResource)) {
|
|
916
|
+
__parent === null || __parent === void 0 ? void 0 : (_parent$service5 = __parent.service) === null || _parent$service5 === void 0 ? void 0 : (_parent$service5$refr = _parent$service5.refresh) === null || _parent$service5$refr === void 0 ? void 0 : _parent$service5$refr.call(_parent$service5);
|
|
917
|
+
}
|
|
918
|
+
service === null || service === void 0 ? void 0 : (_service$refresh3 = service.refresh) === null || _service$refresh3 === void 0 ? void 0 : _service$refresh3.call(service);
|
|
919
|
+
if (xAction === 'customize:form:request') {
|
|
920
|
+
setVisible === null || setVisible === void 0 ? void 0 : setVisible(false);
|
|
921
|
+
}
|
|
922
|
+
if (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage) {
|
|
923
|
+
_context16.next = 24;
|
|
924
|
+
break;
|
|
925
|
+
}
|
|
926
|
+
return _context16.abrupt("return");
|
|
927
|
+
case 24:
|
|
928
|
+
if (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.manualClose) {
|
|
929
|
+
_antd.Modal.success({
|
|
930
|
+
title: compile(onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage),
|
|
931
|
+
onOk: function () {
|
|
932
|
+
var _onOk5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15() {
|
|
933
|
+
return _regeneratorRuntime().wrap(function _callee15$(_context15) {
|
|
934
|
+
while (1) switch (_context15.prev = _context15.next) {
|
|
935
|
+
case 0:
|
|
936
|
+
if ((onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.redirecting) && (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.redirectTo)) {
|
|
937
|
+
if (isURL(onSuccess.redirectTo)) {
|
|
938
|
+
window.location.href = onSuccess.redirectTo;
|
|
939
|
+
} else {
|
|
940
|
+
history.push(onSuccess.redirectTo);
|
|
941
|
+
}
|
|
965
942
|
}
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
})
|
|
977
|
-
}
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
return _context12.stop();
|
|
989
|
-
}
|
|
943
|
+
case 1:
|
|
944
|
+
case "end":
|
|
945
|
+
return _context15.stop();
|
|
946
|
+
}
|
|
947
|
+
}, _callee15);
|
|
948
|
+
}));
|
|
949
|
+
function onOk() {
|
|
950
|
+
return _onOk5.apply(this, arguments);
|
|
951
|
+
}
|
|
952
|
+
return onOk;
|
|
953
|
+
}()
|
|
954
|
+
});
|
|
955
|
+
} else {
|
|
956
|
+
_antd.message.success(compile(onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage));
|
|
957
|
+
}
|
|
958
|
+
case 25:
|
|
959
|
+
_context16.prev = 25;
|
|
960
|
+
actionField.data.loading = false;
|
|
961
|
+
return _context16.finish(25);
|
|
962
|
+
case 28:
|
|
963
|
+
case "end":
|
|
964
|
+
return _context16.stop();
|
|
990
965
|
}
|
|
991
|
-
},
|
|
966
|
+
}, _callee16, null, [[15,, 25, 28]]);
|
|
992
967
|
}))();
|
|
993
968
|
}
|
|
994
969
|
};
|
|
995
970
|
};
|
|
996
|
-
|
|
997
971
|
exports.useCustomizeRequestActionProps = useCustomizeRequestActionProps;
|
|
998
|
-
|
|
999
972
|
var useUpdateActionProps = function useUpdateActionProps() {
|
|
1000
973
|
var _currentUserContext$d5;
|
|
1001
|
-
|
|
1002
974
|
var form = (0, _react.useForm)();
|
|
1003
975
|
var filterByTk = (0, _BlockProvider.useFilterByTk)();
|
|
1004
|
-
|
|
1005
976
|
var _useBlockRequestConte6 = (0, _BlockProvider.useBlockRequestContext)(),
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
977
|
+
field = _useBlockRequestConte6.field,
|
|
978
|
+
resource = _useBlockRequestConte6.resource,
|
|
979
|
+
__parent = _useBlockRequestConte6.__parent;
|
|
1010
980
|
var _useActionContext3 = (0, _schemaComponent.useActionContext)(),
|
|
1011
|
-
|
|
1012
|
-
|
|
981
|
+
setVisible = _useActionContext3.setVisible;
|
|
1013
982
|
var actionSchema = (0, _react.useFieldSchema)();
|
|
1014
983
|
var history = (0, _reactRouterDom.useHistory)();
|
|
1015
|
-
|
|
1016
984
|
var _useCollection3 = (0, _collectionManager.useCollection)(),
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
985
|
+
fields = _useCollection3.fields,
|
|
986
|
+
getField = _useCollection3.getField;
|
|
1020
987
|
var compile = (0, _schemaComponent.useCompile)();
|
|
1021
988
|
var actionField = (0, _react.useField)();
|
|
1022
|
-
|
|
1023
989
|
var _useFormBlockContext = (0, _2.useFormBlockContext)(),
|
|
1024
|
-
|
|
1025
|
-
|
|
990
|
+
updateAssociationValues = _useFormBlockContext.updateAssociationValues;
|
|
1026
991
|
var currentRecord = (0, _recordProvider.useRecord)();
|
|
1027
992
|
var currentUserContext = (0, _user.useCurrentUserContext)();
|
|
1028
993
|
var currentUser = currentUserContext === null || currentUserContext === void 0 ? void 0 : (_currentUserContext$d5 = currentUserContext.data) === null || _currentUserContext$d5 === void 0 ? void 0 : _currentUserContext$d5.data;
|
|
1029
994
|
return {
|
|
1030
995
|
onClick: function onClick() {
|
|
1031
|
-
return _asyncToGenerator( /*#__PURE__*/
|
|
996
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18() {
|
|
1032
997
|
var _actionSchema$xActio6;
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
});
|
|
1046
|
-
|
|
1047
|
-
if (skipValidator) {
|
|
1048
|
-
_context14.next = 5;
|
|
1049
|
-
break;
|
|
1050
|
-
}
|
|
1051
|
-
|
|
1052
|
-
_context14.next = 5;
|
|
1053
|
-
return form.submit();
|
|
1054
|
-
|
|
1055
|
-
case 5:
|
|
1056
|
-
fieldNames = fields.map(function (field) {
|
|
1057
|
-
return field.name;
|
|
1058
|
-
});
|
|
1059
|
-
values = getFormValues(filterByTk, field, form, fieldNames, getField, resource);
|
|
1060
|
-
actionField.data = field.data || {};
|
|
1061
|
-
actionField.data.loading = true;
|
|
1062
|
-
_context14.prev = 9;
|
|
1063
|
-
_context14.next = 12;
|
|
1064
|
-
return resource.update({
|
|
1065
|
-
filterByTk: filterByTk,
|
|
1066
|
-
values: _objectSpread(_objectSpread(_objectSpread({}, values), overwriteValues), assignedValues),
|
|
1067
|
-
updateAssociationValues: updateAssociationValues
|
|
1068
|
-
});
|
|
1069
|
-
|
|
1070
|
-
case 12:
|
|
1071
|
-
actionField.data.loading = false;
|
|
1072
|
-
|
|
1073
|
-
if (!(resource instanceof _TableFieldProvider.TableFieldResource)) {
|
|
1074
|
-
__parent === null || __parent === void 0 ? void 0 : (_parent$__parent2 = __parent.__parent) === null || _parent$__parent2 === void 0 ? void 0 : (_parent$__parent2$ser = _parent$__parent2.service) === null || _parent$__parent2$ser === void 0 ? void 0 : (_parent$__parent2$ser2 = _parent$__parent2$ser.refresh) === null || _parent$__parent2$ser2 === void 0 ? void 0 : _parent$__parent2$ser2.call(_parent$__parent2$ser);
|
|
1075
|
-
}
|
|
1076
|
-
|
|
1077
|
-
__parent === null || __parent === void 0 ? void 0 : (_parent$service6 = __parent.service) === null || _parent$service6 === void 0 ? void 0 : (_parent$service6$refr = _parent$service6.refresh) === null || _parent$service6$refr === void 0 ? void 0 : _parent$service6$refr.call(_parent$service6);
|
|
1078
|
-
setVisible === null || setVisible === void 0 ? void 0 : setVisible(false);
|
|
1079
|
-
|
|
1080
|
-
if (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage) {
|
|
1081
|
-
_context14.next = 18;
|
|
1082
|
-
break;
|
|
1083
|
-
}
|
|
1084
|
-
|
|
1085
|
-
return _context14.abrupt("return");
|
|
1086
|
-
|
|
1087
|
-
case 18:
|
|
1088
|
-
if (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.manualClose) {
|
|
1089
|
-
_antd.Modal.success({
|
|
1090
|
-
title: compile(onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage),
|
|
1091
|
-
onOk: function () {
|
|
1092
|
-
var _onOk6 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee13() {
|
|
1093
|
-
return regeneratorRuntime.wrap(function _callee13$(_context13) {
|
|
1094
|
-
while (1) {
|
|
1095
|
-
switch (_context13.prev = _context13.next) {
|
|
1096
|
-
case 0:
|
|
1097
|
-
_context13.next = 2;
|
|
1098
|
-
return form.reset();
|
|
1099
|
-
|
|
1100
|
-
case 2:
|
|
1101
|
-
if ((onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.redirecting) && (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.redirectTo)) {
|
|
1102
|
-
if (isURL(onSuccess.redirectTo)) {
|
|
1103
|
-
window.location.href = onSuccess.redirectTo;
|
|
1104
|
-
} else {
|
|
1105
|
-
history.push(onSuccess.redirectTo);
|
|
1106
|
-
}
|
|
1107
|
-
}
|
|
1108
|
-
|
|
1109
|
-
case 3:
|
|
1110
|
-
case "end":
|
|
1111
|
-
return _context13.stop();
|
|
1112
|
-
}
|
|
1113
|
-
}
|
|
1114
|
-
}, _callee13);
|
|
1115
|
-
}));
|
|
1116
|
-
|
|
1117
|
-
function onOk() {
|
|
1118
|
-
return _onOk6.apply(this, arguments);
|
|
1119
|
-
}
|
|
1120
|
-
|
|
1121
|
-
return onOk;
|
|
1122
|
-
}()
|
|
1123
|
-
});
|
|
1124
|
-
} else {
|
|
1125
|
-
_antd.message.success(compile(onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage));
|
|
1126
|
-
}
|
|
1127
|
-
|
|
1128
|
-
_context14.next = 24;
|
|
998
|
+
var _ref14, _ref14$assignedValues, originalAssignedValues, onSuccess, overwriteValues, skipValidator, assignedValues, fieldNames, values, _parent$service6, _parent$service6$refr, _parent$__parent2, _parent$__parent2$ser, _parent$__parent2$ser2;
|
|
999
|
+
return _regeneratorRuntime().wrap(function _callee18$(_context18) {
|
|
1000
|
+
while (1) switch (_context18.prev = _context18.next) {
|
|
1001
|
+
case 0:
|
|
1002
|
+
_ref14 = (_actionSchema$xActio6 = actionSchema === null || actionSchema === void 0 ? void 0 : actionSchema['x-action-settings']) !== null && _actionSchema$xActio6 !== void 0 ? _actionSchema$xActio6 : {}, _ref14$assignedValues = _ref14.assignedValues, originalAssignedValues = _ref14$assignedValues === void 0 ? {} : _ref14$assignedValues, onSuccess = _ref14.onSuccess, overwriteValues = _ref14.overwriteValues, skipValidator = _ref14.skipValidator;
|
|
1003
|
+
assignedValues = (0, _jsonTemplates.default)(originalAssignedValues)({
|
|
1004
|
+
currentTime: new Date(),
|
|
1005
|
+
currentRecord: currentRecord,
|
|
1006
|
+
currentUser: currentUser
|
|
1007
|
+
});
|
|
1008
|
+
if (skipValidator) {
|
|
1009
|
+
_context18.next = 5;
|
|
1129
1010
|
break;
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1011
|
+
}
|
|
1012
|
+
_context18.next = 5;
|
|
1013
|
+
return form.submit();
|
|
1014
|
+
case 5:
|
|
1015
|
+
fieldNames = fields.map(function (field) {
|
|
1016
|
+
return field.name;
|
|
1017
|
+
});
|
|
1018
|
+
values = getFormValues(filterByTk, field, form, fieldNames, getField, resource);
|
|
1019
|
+
actionField.data = field.data || {};
|
|
1020
|
+
actionField.data.loading = true;
|
|
1021
|
+
_context18.prev = 9;
|
|
1022
|
+
_context18.next = 12;
|
|
1023
|
+
return resource.update({
|
|
1024
|
+
filterByTk: filterByTk,
|
|
1025
|
+
values: _objectSpread(_objectSpread(_objectSpread({}, values), overwriteValues), assignedValues),
|
|
1026
|
+
updateAssociationValues: updateAssociationValues
|
|
1027
|
+
});
|
|
1028
|
+
case 12:
|
|
1029
|
+
actionField.data.loading = false;
|
|
1030
|
+
if (!(resource instanceof _TableFieldProvider.TableFieldResource)) {
|
|
1031
|
+
__parent === null || __parent === void 0 ? void 0 : (_parent$__parent2 = __parent.__parent) === null || _parent$__parent2 === void 0 ? void 0 : (_parent$__parent2$ser = _parent$__parent2.service) === null || _parent$__parent2$ser === void 0 ? void 0 : (_parent$__parent2$ser2 = _parent$__parent2$ser.refresh) === null || _parent$__parent2$ser2 === void 0 ? void 0 : _parent$__parent2$ser2.call(_parent$__parent2$ser);
|
|
1032
|
+
}
|
|
1033
|
+
__parent === null || __parent === void 0 ? void 0 : (_parent$service6 = __parent.service) === null || _parent$service6 === void 0 ? void 0 : (_parent$service6$refr = _parent$service6.refresh) === null || _parent$service6$refr === void 0 ? void 0 : _parent$service6$refr.call(_parent$service6);
|
|
1034
|
+
setVisible === null || setVisible === void 0 ? void 0 : setVisible(false);
|
|
1035
|
+
if (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage) {
|
|
1036
|
+
_context18.next = 18;
|
|
1037
|
+
break;
|
|
1038
|
+
}
|
|
1039
|
+
return _context18.abrupt("return");
|
|
1040
|
+
case 18:
|
|
1041
|
+
if (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.manualClose) {
|
|
1042
|
+
_antd.Modal.success({
|
|
1043
|
+
title: compile(onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage),
|
|
1044
|
+
onOk: function () {
|
|
1045
|
+
var _onOk6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17() {
|
|
1046
|
+
return _regeneratorRuntime().wrap(function _callee17$(_context17) {
|
|
1047
|
+
while (1) switch (_context17.prev = _context17.next) {
|
|
1048
|
+
case 0:
|
|
1049
|
+
_context17.next = 2;
|
|
1050
|
+
return form.reset();
|
|
1051
|
+
case 2:
|
|
1052
|
+
if ((onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.redirecting) && (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.redirectTo)) {
|
|
1053
|
+
if (isURL(onSuccess.redirectTo)) {
|
|
1054
|
+
window.location.href = onSuccess.redirectTo;
|
|
1055
|
+
} else {
|
|
1056
|
+
history.push(onSuccess.redirectTo);
|
|
1057
|
+
}
|
|
1058
|
+
}
|
|
1059
|
+
case 3:
|
|
1060
|
+
case "end":
|
|
1061
|
+
return _context17.stop();
|
|
1062
|
+
}
|
|
1063
|
+
}, _callee17);
|
|
1064
|
+
}));
|
|
1065
|
+
function onOk() {
|
|
1066
|
+
return _onOk6.apply(this, arguments);
|
|
1067
|
+
}
|
|
1068
|
+
return onOk;
|
|
1069
|
+
}()
|
|
1070
|
+
});
|
|
1071
|
+
} else {
|
|
1072
|
+
_antd.message.success(compile(onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage));
|
|
1073
|
+
}
|
|
1074
|
+
_context18.next = 24;
|
|
1075
|
+
break;
|
|
1076
|
+
case 21:
|
|
1077
|
+
_context18.prev = 21;
|
|
1078
|
+
_context18.t0 = _context18["catch"](9);
|
|
1079
|
+
actionField.data.loading = false;
|
|
1080
|
+
case 24:
|
|
1081
|
+
case "end":
|
|
1082
|
+
return _context18.stop();
|
|
1140
1083
|
}
|
|
1141
|
-
},
|
|
1084
|
+
}, _callee18, null, [[9, 21]]);
|
|
1142
1085
|
}))();
|
|
1143
1086
|
}
|
|
1144
1087
|
};
|
|
1145
1088
|
};
|
|
1146
|
-
|
|
1147
1089
|
exports.useUpdateActionProps = useUpdateActionProps;
|
|
1148
|
-
|
|
1149
1090
|
var useDestroyActionProps = function useDestroyActionProps() {
|
|
1150
1091
|
var filterByTk = (0, _BlockProvider.useFilterByTk)();
|
|
1151
|
-
|
|
1152
1092
|
var _useBlockRequestConte7 = (0, _BlockProvider.useBlockRequestContext)(),
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1093
|
+
resource = _useBlockRequestConte7.resource,
|
|
1094
|
+
service = _useBlockRequestConte7.service,
|
|
1095
|
+
block = _useBlockRequestConte7.block,
|
|
1096
|
+
__parent = _useBlockRequestConte7.__parent;
|
|
1158
1097
|
var _useActionContext4 = (0, _schemaComponent.useActionContext)(),
|
|
1159
|
-
|
|
1160
|
-
|
|
1098
|
+
setVisible = _useActionContext4.setVisible;
|
|
1161
1099
|
return {
|
|
1162
1100
|
onClick: function onClick() {
|
|
1163
|
-
return _asyncToGenerator( /*#__PURE__*/
|
|
1164
|
-
var _service$
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1101
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19() {
|
|
1102
|
+
var _service$data;
|
|
1103
|
+
var _ref15, _ref15$count, count, _ref15$page, page, _ref15$pageSize, pageSize, _service$params2, _service$refresh4, _parent$service7, _parent$service7$refr;
|
|
1104
|
+
return _regeneratorRuntime().wrap(function _callee19$(_context19) {
|
|
1105
|
+
while (1) switch (_context19.prev = _context19.next) {
|
|
1106
|
+
case 0:
|
|
1107
|
+
_context19.next = 2;
|
|
1108
|
+
return resource.destroy({
|
|
1109
|
+
filterByTk: filterByTk
|
|
1110
|
+
});
|
|
1111
|
+
case 2:
|
|
1112
|
+
_ref15 = (service === null || service === void 0 ? void 0 : (_service$data = service.data) === null || _service$data === void 0 ? void 0 : _service$data.meta) || {}, _ref15$count = _ref15.count, count = _ref15$count === void 0 ? 0 : _ref15$count, _ref15$page = _ref15.page, page = _ref15$page === void 0 ? 0 : _ref15$page, _ref15$pageSize = _ref15.pageSize, pageSize = _ref15$pageSize === void 0 ? 0 : _ref15$pageSize;
|
|
1113
|
+
if (count % pageSize === 1) {
|
|
1114
|
+
service.run(_objectSpread(_objectSpread({}, service === null || service === void 0 ? void 0 : (_service$params2 = service.params) === null || _service$params2 === void 0 ? void 0 : _service$params2[0]), {}, {
|
|
1115
|
+
page: page - 1
|
|
1116
|
+
}));
|
|
1117
|
+
} else {
|
|
1178
1118
|
service === null || service === void 0 ? void 0 : (_service$refresh4 = service.refresh) === null || _service$refresh4 === void 0 ? void 0 : _service$refresh4.call(service);
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
return _context15.stop();
|
|
1188
|
-
}
|
|
1119
|
+
}
|
|
1120
|
+
if (block !== 'TableField') {
|
|
1121
|
+
__parent === null || __parent === void 0 ? void 0 : (_parent$service7 = __parent.service) === null || _parent$service7 === void 0 ? void 0 : (_parent$service7$refr = _parent$service7.refresh) === null || _parent$service7$refr === void 0 ? void 0 : _parent$service7$refr.call(_parent$service7);
|
|
1122
|
+
setVisible === null || setVisible === void 0 ? void 0 : setVisible(false);
|
|
1123
|
+
}
|
|
1124
|
+
case 5:
|
|
1125
|
+
case "end":
|
|
1126
|
+
return _context19.stop();
|
|
1189
1127
|
}
|
|
1190
|
-
},
|
|
1128
|
+
}, _callee19);
|
|
1191
1129
|
}))();
|
|
1192
1130
|
}
|
|
1193
1131
|
};
|
|
1194
1132
|
};
|
|
1195
|
-
|
|
1196
1133
|
exports.useDestroyActionProps = useDestroyActionProps;
|
|
1197
|
-
|
|
1198
1134
|
var useDetailPrintActionProps = function useDetailPrintActionProps() {
|
|
1199
1135
|
var _useFormBlockContext2 = (0, _2.useFormBlockContext)(),
|
|
1200
|
-
|
|
1201
|
-
|
|
1136
|
+
formBlockRef = _useFormBlockContext2.formBlockRef;
|
|
1202
1137
|
var printHandler = (0, _reactToPrint.useReactToPrint)({
|
|
1203
1138
|
content: function content() {
|
|
1204
1139
|
return formBlockRef.current;
|
|
@@ -1207,104 +1142,80 @@ var useDetailPrintActionProps = function useDetailPrintActionProps() {
|
|
|
1207
1142
|
});
|
|
1208
1143
|
return {
|
|
1209
1144
|
onClick: function onClick() {
|
|
1210
|
-
return _asyncToGenerator( /*#__PURE__*/
|
|
1211
|
-
return
|
|
1212
|
-
while (1) {
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
case "end":
|
|
1219
|
-
return _context16.stop();
|
|
1220
|
-
}
|
|
1145
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20() {
|
|
1146
|
+
return _regeneratorRuntime().wrap(function _callee20$(_context20) {
|
|
1147
|
+
while (1) switch (_context20.prev = _context20.next) {
|
|
1148
|
+
case 0:
|
|
1149
|
+
printHandler();
|
|
1150
|
+
case 1:
|
|
1151
|
+
case "end":
|
|
1152
|
+
return _context20.stop();
|
|
1221
1153
|
}
|
|
1222
|
-
},
|
|
1154
|
+
}, _callee20);
|
|
1223
1155
|
}))();
|
|
1224
1156
|
}
|
|
1225
1157
|
};
|
|
1226
1158
|
};
|
|
1227
|
-
|
|
1228
1159
|
exports.useDetailPrintActionProps = useDetailPrintActionProps;
|
|
1229
|
-
|
|
1230
1160
|
var useBulkDestroyActionProps = function useBulkDestroyActionProps() {
|
|
1231
1161
|
var _useBlockRequestConte8 = (0, _BlockProvider.useBlockRequestContext)(),
|
|
1232
|
-
|
|
1233
|
-
|
|
1162
|
+
field = _useBlockRequestConte8.field;
|
|
1234
1163
|
var _useBlockRequestConte9 = (0, _BlockProvider.useBlockRequestContext)(),
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1164
|
+
resource = _useBlockRequestConte9.resource,
|
|
1165
|
+
service = _useBlockRequestConte9.service;
|
|
1238
1166
|
return {
|
|
1239
1167
|
onClick: function onClick() {
|
|
1240
|
-
return _asyncToGenerator( /*#__PURE__*/
|
|
1168
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21() {
|
|
1241
1169
|
var _field$data2, _field$data2$selected, _field$data3, _service$refresh5;
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
field.data.selectedRowKeys = [];
|
|
1262
|
-
service === null || service === void 0 ? void 0 : (_service$refresh5 = service.refresh) === null || _service$refresh5 === void 0 ? void 0 : _service$refresh5.call(service);
|
|
1263
|
-
|
|
1264
|
-
case 6:
|
|
1265
|
-
case "end":
|
|
1266
|
-
return _context17.stop();
|
|
1267
|
-
}
|
|
1170
|
+
return _regeneratorRuntime().wrap(function _callee21$(_context21) {
|
|
1171
|
+
while (1) switch (_context21.prev = _context21.next) {
|
|
1172
|
+
case 0:
|
|
1173
|
+
if (field === null || field === void 0 ? void 0 : (_field$data2 = field.data) === null || _field$data2 === void 0 ? void 0 : (_field$data2$selected = _field$data2.selectedRowKeys) === null || _field$data2$selected === void 0 ? void 0 : _field$data2$selected.length) {
|
|
1174
|
+
_context21.next = 2;
|
|
1175
|
+
break;
|
|
1176
|
+
}
|
|
1177
|
+
return _context21.abrupt("return");
|
|
1178
|
+
case 2:
|
|
1179
|
+
_context21.next = 4;
|
|
1180
|
+
return resource.destroy({
|
|
1181
|
+
filterByTk: (_field$data3 = field.data) === null || _field$data3 === void 0 ? void 0 : _field$data3.selectedRowKeys
|
|
1182
|
+
});
|
|
1183
|
+
case 4:
|
|
1184
|
+
field.data.selectedRowKeys = [];
|
|
1185
|
+
service === null || service === void 0 ? void 0 : (_service$refresh5 = service.refresh) === null || _service$refresh5 === void 0 ? void 0 : _service$refresh5.call(service);
|
|
1186
|
+
case 6:
|
|
1187
|
+
case "end":
|
|
1188
|
+
return _context21.stop();
|
|
1268
1189
|
}
|
|
1269
|
-
},
|
|
1190
|
+
}, _callee21);
|
|
1270
1191
|
}))();
|
|
1271
1192
|
}
|
|
1272
1193
|
};
|
|
1273
1194
|
};
|
|
1274
|
-
|
|
1275
1195
|
exports.useBulkDestroyActionProps = useBulkDestroyActionProps;
|
|
1276
|
-
|
|
1277
1196
|
var useRefreshActionProps = function useRefreshActionProps() {
|
|
1278
1197
|
var _useBlockRequestConte10 = (0, _BlockProvider.useBlockRequestContext)(),
|
|
1279
|
-
|
|
1280
|
-
|
|
1198
|
+
service = _useBlockRequestConte10.service;
|
|
1281
1199
|
return {
|
|
1282
1200
|
onClick: function onClick() {
|
|
1283
|
-
return _asyncToGenerator( /*#__PURE__*/
|
|
1201
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee22() {
|
|
1284
1202
|
var _service$refresh6;
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
case 1:
|
|
1293
|
-
case "end":
|
|
1294
|
-
return _context18.stop();
|
|
1295
|
-
}
|
|
1203
|
+
return _regeneratorRuntime().wrap(function _callee22$(_context22) {
|
|
1204
|
+
while (1) switch (_context22.prev = _context22.next) {
|
|
1205
|
+
case 0:
|
|
1206
|
+
service === null || service === void 0 ? void 0 : (_service$refresh6 = service.refresh) === null || _service$refresh6 === void 0 ? void 0 : _service$refresh6.call(service);
|
|
1207
|
+
case 1:
|
|
1208
|
+
case "end":
|
|
1209
|
+
return _context22.stop();
|
|
1296
1210
|
}
|
|
1297
|
-
},
|
|
1211
|
+
}, _callee22);
|
|
1298
1212
|
}))();
|
|
1299
1213
|
}
|
|
1300
1214
|
};
|
|
1301
1215
|
};
|
|
1302
|
-
|
|
1303
1216
|
exports.useRefreshActionProps = useRefreshActionProps;
|
|
1304
|
-
|
|
1305
1217
|
var useDetailsPaginationProps = function useDetailsPaginationProps() {
|
|
1306
1218
|
var _ctx$service, _ctx$service$data, _ctx$service$data$met, _ctx$service2, _ctx$service2$data, _ctx$service2$data$me;
|
|
1307
|
-
|
|
1308
1219
|
var ctx = (0, _DetailsBlockProvider.useDetailsBlockContext)();
|
|
1309
1220
|
var count = ((_ctx$service = ctx.service) === null || _ctx$service === void 0 ? void 0 : (_ctx$service$data = _ctx$service.data) === null || _ctx$service$data === void 0 ? void 0 : (_ctx$service$data$met = _ctx$service$data.meta) === null || _ctx$service$data$met === void 0 ? void 0 : _ctx$service$data$met.count) || 0;
|
|
1310
1221
|
return {
|
|
@@ -1314,25 +1225,21 @@ var useDetailsPaginationProps = function useDetailsPaginationProps() {
|
|
|
1314
1225
|
total: count,
|
|
1315
1226
|
pageSize: 1,
|
|
1316
1227
|
onChange: function onChange(page) {
|
|
1317
|
-
return _asyncToGenerator( /*#__PURE__*/
|
|
1228
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee23() {
|
|
1318
1229
|
var _ctx$service3, _ctx$service3$params;
|
|
1319
|
-
|
|
1320
1230
|
var params;
|
|
1321
|
-
return
|
|
1322
|
-
while (1) {
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
case "end":
|
|
1332
|
-
return _context19.stop();
|
|
1333
|
-
}
|
|
1231
|
+
return _regeneratorRuntime().wrap(function _callee23$(_context23) {
|
|
1232
|
+
while (1) switch (_context23.prev = _context23.next) {
|
|
1233
|
+
case 0:
|
|
1234
|
+
params = (_ctx$service3 = ctx.service) === null || _ctx$service3 === void 0 ? void 0 : (_ctx$service3$params = _ctx$service3.params) === null || _ctx$service3$params === void 0 ? void 0 : _ctx$service3$params[0];
|
|
1235
|
+
ctx.service.run(_objectSpread(_objectSpread({}, params), {}, {
|
|
1236
|
+
page: page
|
|
1237
|
+
}));
|
|
1238
|
+
case 2:
|
|
1239
|
+
case "end":
|
|
1240
|
+
return _context23.stop();
|
|
1334
1241
|
}
|
|
1335
|
-
},
|
|
1242
|
+
}, _callee23);
|
|
1336
1243
|
}))();
|
|
1337
1244
|
},
|
|
1338
1245
|
style: {
|
|
@@ -1341,5 +1248,180 @@ var useDetailsPaginationProps = function useDetailsPaginationProps() {
|
|
|
1341
1248
|
}
|
|
1342
1249
|
};
|
|
1343
1250
|
};
|
|
1344
|
-
|
|
1345
|
-
|
|
1251
|
+
exports.useDetailsPaginationProps = useDetailsPaginationProps;
|
|
1252
|
+
var useAssociationFilterProps = function useAssociationFilterProps() {
|
|
1253
|
+
var _fieldSchema$xCompon2, _fieldSchema$xCompon3, _field$componentProps, _field$componentProps2;
|
|
1254
|
+
var collectionField = _2.AssociationFilter.useAssociationField();
|
|
1255
|
+
var _useBlockRequestConte11 = (0, _BlockProvider.useBlockRequestContext)(),
|
|
1256
|
+
service = _useBlockRequestConte11.service,
|
|
1257
|
+
blockProps = _useBlockRequestConte11.props;
|
|
1258
|
+
var fieldSchema = (0, _react.useFieldSchema)();
|
|
1259
|
+
var valueKey = (collectionField === null || collectionField === void 0 ? void 0 : collectionField.targetKey) || 'id';
|
|
1260
|
+
var labelKey = ((_fieldSchema$xCompon2 = fieldSchema['x-component-props']) === null || _fieldSchema$xCompon2 === void 0 ? void 0 : (_fieldSchema$xCompon3 = _fieldSchema$xCompon2.fieldNames) === null || _fieldSchema$xCompon3 === void 0 ? void 0 : _fieldSchema$xCompon3.label) || valueKey;
|
|
1261
|
+
var field = (0, _react.useField)();
|
|
1262
|
+
var collectionFieldName = collectionField.name;
|
|
1263
|
+
var _useRequest = (0, _apiClient.useRequest)({
|
|
1264
|
+
resource: collectionField.target,
|
|
1265
|
+
action: 'list',
|
|
1266
|
+
params: _objectSpread({
|
|
1267
|
+
fields: [labelKey, valueKey],
|
|
1268
|
+
pageSize: 200,
|
|
1269
|
+
page: 1
|
|
1270
|
+
}, (_field$componentProps = field.componentProps) === null || _field$componentProps === void 0 ? void 0 : _field$componentProps.params)
|
|
1271
|
+
}, {
|
|
1272
|
+
refreshDeps: [labelKey, valueKey, JSON.stringify(((_field$componentProps2 = field.componentProps) === null || _field$componentProps2 === void 0 ? void 0 : _field$componentProps2.params) || {})],
|
|
1273
|
+
debounceWait: 300
|
|
1274
|
+
}),
|
|
1275
|
+
data = _useRequest.data,
|
|
1276
|
+
params = _useRequest.params,
|
|
1277
|
+
run = _useRequest.run;
|
|
1278
|
+
var list = (data === null || data === void 0 ? void 0 : data.data) || [];
|
|
1279
|
+
var onSelected = function onSelected(value) {
|
|
1280
|
+
var _service$params3, _service$params3$, _service$params4, _blockProps$params;
|
|
1281
|
+
var filters = ((_service$params3 = service.params) === null || _service$params3 === void 0 ? void 0 : (_service$params3$ = _service$params3[1]) === null || _service$params3$ === void 0 ? void 0 : _service$params3$.filters) || {};
|
|
1282
|
+
if (value.length) {
|
|
1283
|
+
filters["af.".concat(collectionFieldName)] = _defineProperty({}, "".concat(collectionFieldName, ".").concat(valueKey, ".$in"), value);
|
|
1284
|
+
} else {
|
|
1285
|
+
delete filters["af.".concat(collectionFieldName)];
|
|
1286
|
+
}
|
|
1287
|
+
service.run(_objectSpread(_objectSpread({}, (_service$params4 = service.params) === null || _service$params4 === void 0 ? void 0 : _service$params4[0]), {}, {
|
|
1288
|
+
pageSize: 200,
|
|
1289
|
+
page: 1,
|
|
1290
|
+
filter: (0, _SharedFilterProvider.mergeFilter)([].concat(_toConsumableArray(Object.values(filters)), [blockProps === null || blockProps === void 0 ? void 0 : (_blockProps$params = blockProps.params) === null || _blockProps$params === void 0 ? void 0 : _blockProps$params.filter]))
|
|
1291
|
+
}), {
|
|
1292
|
+
filters: filters
|
|
1293
|
+
});
|
|
1294
|
+
};
|
|
1295
|
+
var handleSearchInput = function handleSearchInput(e) {
|
|
1296
|
+
run(_objectSpread(_objectSpread({}, params === null || params === void 0 ? void 0 : params[0]), {}, {
|
|
1297
|
+
filter: _defineProperty({}, "".concat(labelKey, ".$includes"), e.target.value)
|
|
1298
|
+
}));
|
|
1299
|
+
};
|
|
1300
|
+
return {
|
|
1301
|
+
/** 渲染 Collapse 的列表数据 */
|
|
1302
|
+
list: list,
|
|
1303
|
+
onSelected: onSelected,
|
|
1304
|
+
handleSearchInput: handleSearchInput,
|
|
1305
|
+
params: params,
|
|
1306
|
+
run: run
|
|
1307
|
+
};
|
|
1308
|
+
};
|
|
1309
|
+
exports.useAssociationFilterProps = useAssociationFilterProps;
|
|
1310
|
+
var useOptionalFieldList = function useOptionalFieldList() {
|
|
1311
|
+
var _useCollection4 = (0, _collectionManager.useCollection)(),
|
|
1312
|
+
_useCollection4$curre = _useCollection4.currentFields,
|
|
1313
|
+
currentFields = _useCollection4$curre === void 0 ? [] : _useCollection4$curre;
|
|
1314
|
+
return currentFields.filter(function (field) {
|
|
1315
|
+
return isOptionalField(field) && field.uiSchema.enum;
|
|
1316
|
+
});
|
|
1317
|
+
};
|
|
1318
|
+
exports.useOptionalFieldList = useOptionalFieldList;
|
|
1319
|
+
var isOptionalField = function isOptionalField(field) {
|
|
1320
|
+
var optionalInterfaces = ['select', 'multipleSelect', 'checkbox', 'checkboxGroup', 'chinaRegion'];
|
|
1321
|
+
return optionalInterfaces.includes(field.interface);
|
|
1322
|
+
};
|
|
1323
|
+
var useAssociationFilterBlockProps = function useAssociationFilterBlockProps() {
|
|
1324
|
+
var collectionField = _2.AssociationFilter.useAssociationField();
|
|
1325
|
+
var fieldSchema = (0, _react.useFieldSchema)();
|
|
1326
|
+
var optionalFieldList = useOptionalFieldList();
|
|
1327
|
+
var _useFilterBlock3 = (0, _FilterProvider.useFilterBlock)(),
|
|
1328
|
+
getDataBlocks = _useFilterBlock3.getDataBlocks;
|
|
1329
|
+
var collectionFieldName = collectionField.name;
|
|
1330
|
+
var list, onSelected, handleSearchInput, params, run, data, valueKey, labelKey, filterKey;
|
|
1331
|
+
if (isOptionalField(fieldSchema)) {
|
|
1332
|
+
var _field$uiSchema;
|
|
1333
|
+
var field = optionalFieldList.find(function (field) {
|
|
1334
|
+
return field.name === fieldSchema.name;
|
|
1335
|
+
});
|
|
1336
|
+
var operatorMap = {
|
|
1337
|
+
select: '$in',
|
|
1338
|
+
multipleSelect: '$anyOf',
|
|
1339
|
+
checkbox: '$in',
|
|
1340
|
+
checkboxGroup: '$anyOf'
|
|
1341
|
+
};
|
|
1342
|
+
var _list = (field === null || field === void 0 ? void 0 : (_field$uiSchema = field.uiSchema) === null || _field$uiSchema === void 0 ? void 0 : _field$uiSchema.enum) || [];
|
|
1343
|
+
valueKey = 'value';
|
|
1344
|
+
labelKey = 'label';
|
|
1345
|
+
list = _list;
|
|
1346
|
+
params = {};
|
|
1347
|
+
run = function run() {};
|
|
1348
|
+
filterKey = "".concat(field.name, ".").concat(operatorMap[field.interface]);
|
|
1349
|
+
handleSearchInput = function handleSearchInput(e) {
|
|
1350
|
+
// TODO: 列表没有刷新,在这个 hook 中使用 useState 会产生 re-render 次数过多的错误
|
|
1351
|
+
var value = e.target.value;
|
|
1352
|
+
if (!value) {
|
|
1353
|
+
list = _list;
|
|
1354
|
+
return;
|
|
1355
|
+
}
|
|
1356
|
+
list = _list.filter(function (item) {
|
|
1357
|
+
return item.label.includes(value);
|
|
1358
|
+
});
|
|
1359
|
+
};
|
|
1360
|
+
} else {
|
|
1361
|
+
var _fieldSchema$xCompon4, _fieldSchema$xCompon5, _data;
|
|
1362
|
+
valueKey = (collectionField === null || collectionField === void 0 ? void 0 : collectionField.targetKey) || 'id';
|
|
1363
|
+
labelKey = ((_fieldSchema$xCompon4 = fieldSchema['x-component-props']) === null || _fieldSchema$xCompon4 === void 0 ? void 0 : (_fieldSchema$xCompon5 = _fieldSchema$xCompon4.fieldNames) === null || _fieldSchema$xCompon5 === void 0 ? void 0 : _fieldSchema$xCompon5.label) || valueKey;
|
|
1364
|
+
var _useRequest2 = (0, _apiClient.useRequest)({
|
|
1365
|
+
resource: collectionField.target,
|
|
1366
|
+
action: 'list',
|
|
1367
|
+
params: {
|
|
1368
|
+
fields: [labelKey, valueKey],
|
|
1369
|
+
pageSize: 200,
|
|
1370
|
+
page: 1
|
|
1371
|
+
}
|
|
1372
|
+
}, {
|
|
1373
|
+
refreshDeps: [labelKey, valueKey],
|
|
1374
|
+
debounceWait: 300
|
|
1375
|
+
});
|
|
1376
|
+
data = _useRequest2.data;
|
|
1377
|
+
params = _useRequest2.params;
|
|
1378
|
+
run = _useRequest2.run;
|
|
1379
|
+
filterKey = "".concat(collectionFieldName, ".").concat(valueKey, ".$in");
|
|
1380
|
+
list = ((_data = data) === null || _data === void 0 ? void 0 : _data.data) || [];
|
|
1381
|
+
handleSearchInput = function handleSearchInput(e) {
|
|
1382
|
+
var _params;
|
|
1383
|
+
run(_objectSpread(_objectSpread({}, (_params = params) === null || _params === void 0 ? void 0 : _params[0]), {}, {
|
|
1384
|
+
filter: _defineProperty({}, "".concat(labelKey, ".$includes"), e.target.value)
|
|
1385
|
+
}));
|
|
1386
|
+
};
|
|
1387
|
+
}
|
|
1388
|
+
onSelected = function onSelected(value) {
|
|
1389
|
+
var _findFilterTargets3 = findFilterTargets(fieldSchema),
|
|
1390
|
+
targets = _findFilterTargets3.targets,
|
|
1391
|
+
uid = _findFilterTargets3.uid;
|
|
1392
|
+
getDataBlocks().forEach(function (block) {
|
|
1393
|
+
var _block$service$params7, _block$service$params8, _block$service$params9;
|
|
1394
|
+
var target = targets.find(function (target) {
|
|
1395
|
+
return target.uid === block.uid;
|
|
1396
|
+
});
|
|
1397
|
+
if (!target) return;
|
|
1398
|
+
var key = "".concat(uid).concat(fieldSchema.name);
|
|
1399
|
+
var param = ((_block$service$params7 = block.service.params) === null || _block$service$params7 === void 0 ? void 0 : _block$service$params7[0]) || {};
|
|
1400
|
+
// 保留原有的 filter
|
|
1401
|
+
var storedFilter = ((_block$service$params8 = block.service.params) === null || _block$service$params8 === void 0 ? void 0 : (_block$service$params9 = _block$service$params8[1]) === null || _block$service$params9 === void 0 ? void 0 : _block$service$params9.filters) || {};
|
|
1402
|
+
if (value.length) {
|
|
1403
|
+
storedFilter[key] = _defineProperty({}, filterKey, value);
|
|
1404
|
+
} else {
|
|
1405
|
+
delete storedFilter[key];
|
|
1406
|
+
}
|
|
1407
|
+
var mergedFilter = (0, _SharedFilterProvider.mergeFilter)([].concat(_toConsumableArray(Object.values(storedFilter)), [block.defaultFilter]));
|
|
1408
|
+
return block.doFilter(_objectSpread(_objectSpread({}, param), {}, {
|
|
1409
|
+
page: 1,
|
|
1410
|
+
filter: mergedFilter
|
|
1411
|
+
}), {
|
|
1412
|
+
filters: storedFilter
|
|
1413
|
+
});
|
|
1414
|
+
});
|
|
1415
|
+
};
|
|
1416
|
+
return {
|
|
1417
|
+
/** 渲染 Collapse 的列表数据 */
|
|
1418
|
+
list: list,
|
|
1419
|
+
onSelected: onSelected,
|
|
1420
|
+
handleSearchInput: handleSearchInput,
|
|
1421
|
+
params: params,
|
|
1422
|
+
run: run,
|
|
1423
|
+
valueKey: valueKey,
|
|
1424
|
+
labelKey: labelKey
|
|
1425
|
+
};
|
|
1426
|
+
};
|
|
1427
|
+
exports.useAssociationFilterBlockProps = useAssociationFilterBlockProps;
|