@nocobase/client 0.11.0-alpha.1 → 0.11.1-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/acl/ACLProvider.js +10 -8
- package/es/acl/Configuration/MenuConfigure.js +20 -1
- package/es/acl/Configuration/schemas/useRoleResourceValues.d.ts +32 -1
- package/es/api-client/APIClient.d.ts +3 -1
- package/es/api-client/APIClient.js +10 -8
- package/es/api-client/hooks/useRequest.d.ts +15 -1
- package/es/api-client/hooks/useRequest.js +4 -5
- package/es/api-client/hooks/useResource.js +2 -3
- package/es/application/hooks/useAppPluginLoad.js +4 -3
- package/es/async-data-provider/index.js +1 -1
- package/es/auth/SigninPage.js +8 -3
- package/es/block-provider/FormBlockProvider.js +10 -3
- package/es/block-provider/GanttBlockProvider.js +3 -2
- package/es/block-provider/TableBlockProvider.js +1 -51
- package/es/block-provider/hooks/index.d.ts +5 -3
- package/es/block-provider/hooks/index.js +38 -21
- package/es/board/style.js +3 -2
- package/es/china-region/index.js +3 -0
- package/es/collection-manager/CollectionFieldProvider.js +10 -2
- package/es/collection-manager/CollectionHistoryProvider.js +2 -2
- package/es/collection-manager/CollectionManagerProvider.js +39 -1
- package/es/collection-manager/Configuration/AddCollectionAction.js +8 -5
- package/es/collection-manager/Configuration/AddFieldAction.js +6 -2
- package/es/collection-manager/Configuration/CollectionFields.d.ts +1 -1
- package/es/collection-manager/Configuration/CollectionFields.js +27 -32
- package/es/collection-manager/Configuration/CollectionFieldsTable.js +5 -1
- package/es/collection-manager/Configuration/ConfigurationTable.js +6 -3
- package/es/collection-manager/Configuration/ConfigurationTabs.js +11 -4
- package/es/collection-manager/Configuration/EditCategoryAction.js +1 -1
- package/es/collection-manager/Configuration/EditCollectionAction.d.ts +14 -1
- package/es/collection-manager/Configuration/EditFieldAction.js +3 -1
- package/es/collection-manager/Configuration/ViewInheritedField.js +13 -3
- package/es/collection-manager/Configuration/components/FieldSummary.d.ts +4 -1
- package/es/collection-manager/Configuration/components/FieldSummary.js +14 -24
- package/es/collection-manager/Configuration/components/Summary.d.ts +6 -0
- package/es/collection-manager/Configuration/components/Summary.js +44 -0
- package/es/collection-manager/Configuration/components/TemplateSummary.d.ts +7 -0
- package/es/collection-manager/Configuration/components/TemplateSummary.js +18 -0
- package/es/collection-manager/ResourceActionProvider.js +5 -4
- package/es/collection-manager/action-hooks.d.ts +43 -4
- package/es/collection-manager/action-hooks.js +18 -11
- package/es/collection-manager/hooks/useCollection.d.ts +2 -1
- package/es/collection-manager/hooks/useCollectionManager.d.ts +1 -1
- package/es/collection-manager/hooks/useCollectionManager.js +7 -9
- package/es/collection-manager/interfaces/createdAt.js +2 -1
- package/es/collection-manager/interfaces/datetime.js +2 -1
- package/es/collection-manager/interfaces/email.js +1 -0
- package/es/collection-manager/interfaces/id.js +2 -1
- package/es/collection-manager/interfaces/input.js +1 -0
- package/es/collection-manager/interfaces/integer.js +1 -0
- package/es/collection-manager/interfaces/markdown.js +2 -2
- package/es/collection-manager/interfaces/number.js +1 -0
- package/es/collection-manager/interfaces/percent.js +1 -0
- package/es/collection-manager/interfaces/phone.js +2 -1
- package/es/collection-manager/interfaces/radioGroup.js +2 -1
- package/es/collection-manager/interfaces/select.js +1 -0
- package/es/collection-manager/interfaces/time.js +2 -1
- package/es/collection-manager/interfaces/types.d.ts +1 -0
- package/es/collection-manager/interfaces/updatedAt.js +2 -1
- package/es/collection-manager/interfaces/url.js +2 -1
- package/es/collection-manager/sub-table.d.ts +14 -1
- package/es/collection-manager/templates/view.js +8 -1
- package/es/collection-manager/types.d.ts +1 -0
- package/es/css-variable/CSSVariableProvider.d.ts +7 -0
- package/es/css-variable/CSSVariableProvider.js +46 -0
- package/es/css-variable/index.d.ts +1 -0
- package/es/css-variable/index.js +1 -0
- package/es/document-title/index.js +4 -1
- package/es/global-theme/AntdAppProvider.d.ts +8 -0
- package/es/global-theme/AntdAppProvider.js +19 -0
- package/es/global-theme/compatOldTheme.d.ts +3 -0
- package/es/global-theme/compatOldTheme.js +16 -0
- package/es/global-theme/defaultTheme.d.ts +3 -0
- package/es/global-theme/defaultTheme.js +18 -0
- package/es/global-theme/index.d.ts +28 -0
- package/es/global-theme/index.js +64 -0
- package/es/global-theme/type.d.ts +33 -0
- package/es/global-theme/type.js +1 -0
- package/es/global.less +14 -4
- package/es/i18n/i18n.js +1 -0
- package/es/index.d.ts +3 -0
- package/es/index.js +3 -0
- package/es/locale/en_US.d.ts +1 -0
- package/es/locale/en_US.js +2 -1
- package/es/locale/index.d.ts +68 -0
- package/es/locale/index.js +69 -0
- package/es/locale/ja_JP.d.ts +1 -0
- package/es/locale/ja_JP.js +2 -1
- package/es/locale/zh_CN.d.ts +1 -0
- package/es/locale/zh_CN.js +2 -1
- package/es/nocobase-buildin-plugin/index.js +13 -8
- package/es/nocobase-buildin-plugin/plugins/LocalePlugin.d.ts +5 -0
- package/es/nocobase-buildin-plugin/plugins/LocalePlugin.js +97 -0
- package/es/pm/Card.js +23 -21
- package/es/pm/index.js +7 -7
- package/es/pm/style.d.ts +52 -1
- package/es/pm/style.js +55 -3
- package/es/powered-by/index.js +4 -1
- package/es/route-switch/antd/admin-layout/index.d.ts +1 -1
- package/es/route-switch/antd/admin-layout/index.js +10 -8
- package/es/schema-component/antd/__builtins__/hooks/useToken.d.ts +6 -1
- package/es/schema-component/antd/__builtins__/hooks/useToken.js +5 -1
- package/es/schema-component/antd/__builtins__/index.d.ts +2 -0
- package/es/schema-component/antd/__builtins__/index.js +2 -0
- package/es/schema-component/antd/__builtins__/loading.d.ts +1 -0
- package/es/schema-component/antd/__builtins__/loading.js +42 -0
- package/es/schema-component/antd/__builtins__/portal.d.ts +10 -0
- package/es/schema-component/antd/__builtins__/portal.js +48 -0
- package/es/schema-component/antd/__builtins__/render.d.ts +9 -0
- package/es/schema-component/antd/__builtins__/render.js +80 -0
- package/es/schema-component/antd/__builtins__/style.d.ts +2 -1
- package/es/schema-component/antd/action/Action.Designer.d.ts +6 -1
- package/es/schema-component/antd/action/Action.Designer.js +158 -73
- package/es/schema-component/antd/action/Action.Drawer.js +6 -11
- package/es/schema-component/antd/action/Action.Drawer.style.d.ts +1 -0
- package/es/schema-component/antd/action/Action.Drawer.style.js +44 -0
- package/es/schema-component/antd/action/Action.d.ts +0 -1
- package/es/schema-component/antd/action/Action.js +22 -11
- package/es/schema-component/antd/action/Action.style.d.ts +2 -0
- package/es/schema-component/antd/action/Action.style.js +59 -0
- package/es/schema-component/antd/action/ActionBar.js +3 -1
- package/es/schema-component/antd/action/hooks.js +6 -4
- package/es/schema-component/antd/appends-tree-select/AppendsTreeSelect.d.ts +8 -0
- package/es/schema-component/antd/appends-tree-select/AppendsTreeSelect.js +223 -0
- package/es/schema-component/antd/appends-tree-select/index.d.ts +1 -0
- package/es/schema-component/antd/appends-tree-select/index.js +1 -0
- package/es/schema-component/antd/association-field/FileManager.d.ts +1 -1
- package/es/schema-component/antd/association-field/FileManager.js +3 -3
- package/es/schema-component/antd/association-field/InternalViewer.js +1 -1
- package/es/schema-component/antd/association-field/SubTable.js +1 -1
- package/es/schema-component/antd/association-field/util.d.ts +1 -2
- package/es/schema-component/antd/association-field/util.js +3 -3
- package/es/schema-component/antd/association-filter/AssociationFilter.Item.js +25 -18
- package/es/schema-component/antd/association-filter/AssociationFilter.Item.style.d.ts +2 -0
- package/es/schema-component/antd/association-filter/AssociationFilter.Item.style.js +102 -0
- package/es/schema-component/antd/association-filter/AssociationFilter.js +4 -1
- package/es/schema-component/antd/block-item/BlockItem.js +1 -1
- package/es/schema-component/antd/calendar/Calendar.js +20 -20
- package/es/schema-component/antd/calendar/global.style.js +58 -1
- package/es/schema-component/antd/calendar/style.js +31 -31
- package/es/schema-component/antd/calendar/utils.d.ts +1 -1
- package/es/schema-component/antd/card-item/CardItem.js +9 -6
- package/es/schema-component/antd/card-item/style.d.ts +2 -0
- package/es/schema-component/antd/card-item/style.js +14 -0
- package/es/schema-component/antd/cascader/Cascader.js +1 -1
- package/es/schema-component/antd/date-picker/util.d.ts +20 -21
- package/es/schema-component/antd/date-picker/util.js +1 -1
- package/es/schema-component/antd/expand-action/Expand.Action.js +1 -1
- package/es/schema-component/antd/filter/FilterAction.js +1 -1
- package/es/schema-component/antd/filter/FilterGroup.js +9 -5
- package/es/schema-component/antd/filter/SaveDefaultValue.js +1 -1
- package/es/schema-component/antd/form/Form.js +1 -1
- package/es/schema-component/antd/form-dialog/index.d.ts +29 -0
- package/es/schema-component/antd/form-dialog/index.js +258 -0
- package/es/schema-component/antd/form-v2/Templates.js +25 -17
- package/es/schema-component/antd/gantt/components/calendar/calendar.js +18 -14
- package/es/schema-component/antd/gantt/components/calendar/style.d.ts +2 -4
- package/es/schema-component/antd/gantt/components/calendar/style.js +46 -7
- package/es/schema-component/antd/gantt/components/calendar/top-part-of-calendar.js +3 -4
- package/es/schema-component/antd/gantt/components/gantt/gantt.js +26 -17
- package/es/schema-component/antd/gantt/components/gantt/style.d.ts +2 -3
- package/es/schema-component/antd/gantt/components/gantt/style.js +47 -6
- package/es/schema-component/antd/gantt/components/gantt/task-gantt.d.ts +1 -1
- package/es/schema-component/antd/gantt/components/gantt/task-gantt.js +6 -13
- package/es/schema-component/antd/gantt/components/grid/grid-body.js +12 -8
- package/es/schema-component/antd/gantt/components/grid/style.d.ts +2 -4
- package/es/schema-component/antd/gantt/components/grid/style.js +26 -7
- package/es/schema-component/antd/gantt/components/other/horizontal-scroll.js +10 -7
- package/es/schema-component/antd/gantt/components/other/style.d.ts +2 -7
- package/es/schema-component/antd/gantt/components/other/style.js +101 -10
- package/es/schema-component/antd/gantt/components/other/tooltip.js +18 -10
- package/es/schema-component/antd/gantt/components/other/vertical-scroll.js +9 -5
- package/es/schema-component/antd/gantt/components/task-item/style.d.ts +2 -3
- package/es/schema-component/antd/gantt/components/task-item/style.js +45 -6
- package/es/schema-component/antd/gantt/components/task-item/task-item.js +9 -4
- package/es/schema-component/antd/grid/Grid.js +45 -30
- package/es/schema-component/antd/grid/Grid.style.d.ts +2 -0
- package/es/schema-component/antd/grid/Grid.style.js +46 -0
- package/es/schema-component/antd/grid-card/GridCard.Decorator.js +8 -6
- package/es/schema-component/antd/grid-card/GridCard.Decorator.style.d.ts +2 -0
- package/es/schema-component/antd/grid-card/GridCard.Decorator.style.js +25 -0
- package/es/schema-component/antd/grid-card/GridCard.d.ts +1 -1
- package/es/schema-component/antd/grid-card/GridCard.js +6 -6
- package/es/schema-component/antd/index.d.ts +2 -0
- package/es/schema-component/antd/index.js +2 -0
- package/es/schema-component/antd/index.less +0 -16
- package/es/schema-component/antd/kanban/Kanban.Card.Designer.js +1 -1
- package/es/schema-component/antd/list/List.Item.js +1 -5
- package/es/schema-component/antd/list/List.js +10 -8
- package/es/schema-component/antd/list/List.style.d.ts +2 -0
- package/es/schema-component/antd/list/List.style.js +54 -0
- package/es/schema-component/antd/markdown/Markdown.Void.js +7 -2
- package/es/schema-component/antd/markdown/Markdown.js +1 -1
- package/es/schema-component/antd/markdown/md.d.ts +0 -2
- package/es/schema-component/antd/markdown/md.js +0 -2
- package/es/schema-component/antd/markdown/style.js +212 -4
- package/es/schema-component/antd/menu/Menu.Designer.js +15 -13
- package/es/schema-component/antd/menu/Menu.js +13 -6
- package/es/schema-component/antd/menu/MenuItemInitializers/index.js +198 -197
- package/es/schema-component/antd/page/Page.d.ts +4 -1
- package/es/schema-component/antd/page/Page.js +37 -32
- package/es/schema-component/antd/page/PageTabDesigner.js +4 -2
- package/es/schema-component/antd/page/style.d.ts +1 -0
- package/es/schema-component/antd/page/style.js +127 -0
- package/es/schema-component/antd/remote-select/ReadPretty.js +2 -2
- package/es/schema-component/antd/rich-text/style.js +20 -20
- package/es/schema-component/antd/select/Select.js +5 -2
- package/es/schema-component/antd/table/Table.Array.js +7 -7
- package/es/schema-component/antd/table/Table.Column.ActionBar.js +1 -1
- package/es/schema-component/antd/table-v2/Table.Column.ActionBar.js +1 -1
- package/es/schema-component/antd/table-v2/Table.js +21 -6
- package/es/schema-component/antd/table-v2/components/ColumnFieldProvider.d.ts +6 -0
- package/es/schema-component/antd/table-v2/components/ColumnFieldProvider.js +37 -0
- package/es/schema-component/antd/tabs/Tabs.js +3 -3
- package/es/schema-component/antd/upload/ReadPretty.js +6 -1
- package/es/schema-component/antd/upload/style.js +11 -1
- package/es/schema-component/antd/variable/Input.js +2 -3
- package/es/schema-component/antd/variable/Variable.d.ts +10 -5
- package/es/schema-component/antd/variable/Variable.js +13 -0
- package/es/schema-component/antd/variable/VariableSelect.js +19 -9
- package/es/schema-component/antd/variable/VariableSelect.style.d.ts +2 -0
- package/es/schema-component/antd/variable/VariableSelect.style.js +31 -0
- package/es/schema-component/antd/variable/XButton.js +8 -5
- package/es/schema-component/antd/variable/style.js +12 -3
- package/es/schema-component/common/sortable-item/SortableItem.js +5 -1
- package/es/schema-component/common/utils/logic.js +46 -0
- package/es/schema-component/common/utils/uitls.d.ts +1 -1
- package/es/schema-component/common/utils/uitls.js +6 -1
- package/es/schema-component/core/DesignableSwitch.js +1 -1
- package/es/schema-initializer/SchemaInitializer.js +21 -21
- package/es/schema-initializer/SelectCollection.js +17 -1
- package/es/schema-initializer/buttons/CalendarActionInitializers.js +2 -2
- package/es/schema-initializer/buttons/CalendarFormActionInitializers.js +9 -9
- package/es/schema-initializer/buttons/GridCardActionInitializers.js +4 -4
- package/es/schema-initializer/buttons/KanbanActionInitializers.js +2 -2
- package/es/schema-initializer/buttons/ListActionInitializers.js +8 -8
- package/es/schema-initializer/buttons/ReadPrettyFormActionInitializers.js +1 -1
- package/es/schema-initializer/buttons/RecordBlockInitializers.js +1 -1
- package/es/schema-initializer/buttons/TabPaneInitializers.js +2 -2
- package/es/schema-initializer/buttons/TableActionColumnInitializers.js +8 -6
- package/es/schema-initializer/buttons/TableActionInitializers.js +4 -4
- package/es/schema-initializer/buttons/index.d.ts +6 -7
- package/es/schema-initializer/buttons/index.js +6 -7
- package/es/schema-initializer/components/CreateRecordAction.js +1 -1
- package/es/schema-initializer/components/DuplicateAction.js +8 -6
- package/es/schema-initializer/components/assigned-field/AssignedField.js +6 -4
- package/es/schema-initializer/items/CalendarBlockInitializer.js +6 -4
- package/es/schema-initializer/items/DetailsBlockInitializer.js +2 -2
- package/es/schema-initializer/items/GanttBlockInitializer.js +6 -3
- package/es/schema-initializer/items/KanbanBlockInitializer.js +7 -5
- package/es/schema-initializer/items/RecordAssociationCalendarBlockInitializer.js +6 -3
- package/es/schema-initializer/items/index.d.ts +1 -1
- package/es/schema-initializer/items/index.js +1 -1
- package/es/schema-initializer/style.d.ts +7 -1
- package/es/schema-initializer/style.js +9 -2
- package/es/schema-initializer/utils.js +1 -1
- package/es/schema-settings/GeneralSchemaDesigner.js +1 -1
- package/es/schema-settings/LinkageRules/components/LinkageHeader.js +5 -2
- package/es/schema-settings/SchemaSettings.js +16 -14
- package/es/style/index.d.ts +2 -0
- package/es/style/index.js +2 -0
- package/es/style/useToken.d.ts +11 -0
- package/es/style/useToken.js +7 -0
- package/es/system-settings/SystemSettingsShortcut.js +2 -110
- package/es/test/AppContextProvider.d.ts +11 -0
- package/es/test/AppContextProvider.js +15 -0
- package/es/user/CurrentUser.js +39 -16
- package/es/user/CurrentUserProvider.d.ts +6 -2
- package/es/user/CurrentUserProvider.js +12 -7
- package/es/user/CurrentUserSettingsMenuProvider.d.ts +21 -0
- package/es/user/CurrentUserSettingsMenuProvider.js +81 -0
- package/es/user/index.d.ts +1 -0
- package/es/user/index.js +1 -0
- package/lib/acl/ACLProvider.js +10 -8
- package/lib/acl/Configuration/MenuConfigure.js +20 -1
- package/lib/acl/Configuration/schemas/useRoleResourceValues.d.ts +32 -1
- package/lib/api-client/APIClient.d.ts +3 -1
- package/lib/api-client/APIClient.js +9 -7
- package/lib/api-client/hooks/useRequest.d.ts +15 -1
- package/lib/api-client/hooks/useRequest.js +4 -5
- package/lib/api-client/hooks/useResource.js +2 -3
- package/lib/application/hooks/useAppPluginLoad.js +4 -3
- package/lib/async-data-provider/index.js +1 -1
- package/lib/auth/SigninPage.js +7 -2
- package/lib/block-provider/FormBlockProvider.js +10 -3
- package/lib/block-provider/GanttBlockProvider.js +3 -2
- package/lib/block-provider/TableBlockProvider.js +1 -51
- package/lib/block-provider/hooks/index.d.ts +5 -3
- package/lib/block-provider/hooks/index.js +36 -19
- package/lib/board/style.js +3 -2
- package/lib/china-region/index.js +3 -0
- package/lib/collection-manager/CollectionFieldProvider.js +10 -2
- package/lib/collection-manager/CollectionHistoryProvider.js +1 -1
- package/lib/collection-manager/CollectionManagerProvider.js +39 -1
- package/lib/collection-manager/Configuration/AddCollectionAction.js +8 -5
- package/lib/collection-manager/Configuration/AddFieldAction.js +6 -2
- package/lib/collection-manager/Configuration/CollectionFields.d.ts +1 -1
- package/lib/collection-manager/Configuration/CollectionFields.js +28 -33
- package/lib/collection-manager/Configuration/CollectionFieldsTable.js +5 -1
- package/lib/collection-manager/Configuration/ConfigurationTable.js +6 -3
- package/lib/collection-manager/Configuration/ConfigurationTabs.js +10 -3
- package/lib/collection-manager/Configuration/EditCategoryAction.js +1 -1
- package/lib/collection-manager/Configuration/EditCollectionAction.d.ts +14 -1
- package/lib/collection-manager/Configuration/EditFieldAction.js +3 -1
- package/lib/collection-manager/Configuration/ViewInheritedField.js +12 -2
- package/lib/collection-manager/Configuration/components/FieldSummary.d.ts +4 -1
- package/lib/collection-manager/Configuration/components/FieldSummary.js +18 -25
- package/lib/collection-manager/Configuration/components/Summary.d.ts +6 -0
- package/lib/collection-manager/Configuration/components/Summary.js +54 -0
- package/lib/collection-manager/Configuration/components/TemplateSummary.d.ts +7 -0
- package/lib/collection-manager/Configuration/components/TemplateSummary.js +29 -0
- package/lib/collection-manager/ResourceActionProvider.js +5 -4
- package/lib/collection-manager/action-hooks.d.ts +43 -4
- package/lib/collection-manager/action-hooks.js +18 -11
- package/lib/collection-manager/hooks/useCollection.d.ts +2 -1
- package/lib/collection-manager/hooks/useCollectionManager.d.ts +1 -1
- package/lib/collection-manager/hooks/useCollectionManager.js +7 -9
- package/lib/collection-manager/interfaces/createdAt.js +2 -1
- package/lib/collection-manager/interfaces/datetime.js +2 -1
- package/lib/collection-manager/interfaces/email.js +1 -0
- package/lib/collection-manager/interfaces/id.js +2 -1
- package/lib/collection-manager/interfaces/input.js +1 -0
- package/lib/collection-manager/interfaces/integer.js +1 -0
- package/lib/collection-manager/interfaces/markdown.js +2 -2
- package/lib/collection-manager/interfaces/number.js +1 -0
- package/lib/collection-manager/interfaces/percent.js +1 -0
- package/lib/collection-manager/interfaces/phone.js +2 -1
- package/lib/collection-manager/interfaces/radioGroup.js +2 -1
- package/lib/collection-manager/interfaces/select.js +1 -0
- package/lib/collection-manager/interfaces/time.js +2 -1
- package/lib/collection-manager/interfaces/types.d.ts +1 -0
- package/lib/collection-manager/interfaces/updatedAt.js +2 -1
- package/lib/collection-manager/interfaces/url.js +2 -1
- package/lib/collection-manager/sub-table.d.ts +14 -1
- package/lib/collection-manager/templates/view.js +8 -1
- package/lib/collection-manager/types.d.ts +1 -0
- package/lib/css-variable/CSSVariableProvider.d.ts +7 -0
- package/lib/css-variable/CSSVariableProvider.js +53 -0
- package/lib/css-variable/index.d.ts +1 -0
- package/lib/css-variable/index.js +13 -0
- package/lib/document-title/index.js +4 -1
- package/lib/global-theme/AntdAppProvider.d.ts +8 -0
- package/lib/global-theme/AntdAppProvider.js +29 -0
- package/lib/global-theme/compatOldTheme.d.ts +3 -0
- package/lib/global-theme/compatOldTheme.js +24 -0
- package/lib/global-theme/defaultTheme.d.ts +3 -0
- package/lib/global-theme/defaultTheme.js +25 -0
- package/lib/global-theme/index.d.ts +28 -0
- package/lib/global-theme/index.js +111 -0
- package/lib/global-theme/type.d.ts +33 -0
- package/lib/global-theme/type.js +5 -0
- package/lib/global.less +14 -4
- package/lib/i18n/i18n.js +1 -0
- package/lib/index.d.ts +3 -0
- package/lib/index.js +67 -1
- package/lib/locale/en_US.d.ts +1 -0
- package/lib/locale/en_US.js +2 -1
- package/lib/locale/index.d.ts +68 -0
- package/lib/locale/index.js +71 -1
- package/lib/locale/ja_JP.d.ts +1 -0
- package/lib/locale/ja_JP.js +2 -1
- package/lib/locale/zh_CN.d.ts +1 -0
- package/lib/locale/zh_CN.js +2 -1
- package/lib/nocobase-buildin-plugin/index.js +13 -8
- package/lib/nocobase-buildin-plugin/plugins/LocalePlugin.d.ts +5 -0
- package/lib/nocobase-buildin-plugin/plugins/LocalePlugin.js +112 -0
- package/lib/pm/Card.js +22 -20
- package/lib/pm/index.js +10 -10
- package/lib/pm/style.d.ts +52 -1
- package/lib/pm/style.js +55 -3
- package/lib/powered-by/index.js +4 -1
- package/lib/route-switch/antd/admin-layout/index.d.ts +1 -1
- package/lib/route-switch/antd/admin-layout/index.js +9 -7
- package/lib/schema-component/antd/__builtins__/hooks/useToken.d.ts +6 -1
- package/lib/schema-component/antd/__builtins__/hooks/useToken.js +5 -1
- package/lib/schema-component/antd/__builtins__/index.d.ts +2 -0
- package/lib/schema-component/antd/__builtins__/index.js +22 -0
- package/lib/schema-component/antd/__builtins__/loading.d.ts +1 -0
- package/lib/schema-component/antd/__builtins__/loading.js +49 -0
- package/lib/schema-component/antd/__builtins__/portal.d.ts +10 -0
- package/lib/schema-component/antd/__builtins__/portal.js +59 -0
- package/lib/schema-component/antd/__builtins__/render.d.ts +9 -0
- package/lib/schema-component/antd/__builtins__/render.js +89 -0
- package/lib/schema-component/antd/__builtins__/style.d.ts +2 -1
- package/lib/schema-component/antd/action/Action.Designer.d.ts +6 -1
- package/lib/schema-component/antd/action/Action.Designer.js +159 -74
- package/lib/schema-component/antd/action/Action.Drawer.js +6 -11
- package/lib/schema-component/antd/action/Action.Drawer.style.d.ts +1 -0
- package/lib/schema-component/antd/action/Action.Drawer.style.js +51 -0
- package/lib/schema-component/antd/action/Action.d.ts +0 -1
- package/lib/schema-component/antd/action/Action.js +22 -12
- package/lib/schema-component/antd/action/Action.style.d.ts +2 -0
- package/lib/schema-component/antd/action/Action.style.js +66 -0
- package/lib/schema-component/antd/action/ActionBar.js +3 -1
- package/lib/schema-component/antd/action/hooks.js +4 -2
- package/lib/schema-component/antd/appends-tree-select/AppendsTreeSelect.d.ts +8 -0
- package/lib/schema-component/antd/appends-tree-select/AppendsTreeSelect.js +232 -0
- package/lib/schema-component/antd/appends-tree-select/index.d.ts +1 -0
- package/lib/schema-component/antd/appends-tree-select/index.js +16 -0
- package/lib/schema-component/antd/association-field/FileManager.d.ts +1 -1
- package/lib/schema-component/antd/association-field/FileManager.js +2 -2
- package/lib/schema-component/antd/association-field/InternalViewer.js +1 -1
- package/lib/schema-component/antd/association-field/SubTable.js +1 -1
- package/lib/schema-component/antd/association-field/util.d.ts +1 -2
- package/lib/schema-component/antd/association-field/util.js +3 -3
- package/lib/schema-component/antd/association-filter/AssociationFilter.Item.js +25 -18
- package/lib/schema-component/antd/association-filter/AssociationFilter.Item.style.d.ts +2 -0
- package/lib/schema-component/antd/association-filter/AssociationFilter.Item.style.js +109 -0
- package/lib/schema-component/antd/association-filter/AssociationFilter.js +4 -1
- package/lib/schema-component/antd/block-item/BlockItem.js +1 -1
- package/lib/schema-component/antd/calendar/Calendar.js +20 -20
- package/lib/schema-component/antd/calendar/global.style.js +58 -1
- package/lib/schema-component/antd/calendar/style.js +31 -31
- package/lib/schema-component/antd/calendar/utils.d.ts +1 -1
- package/lib/schema-component/antd/card-item/CardItem.js +9 -6
- package/lib/schema-component/antd/card-item/style.d.ts +2 -0
- package/lib/schema-component/antd/card-item/style.js +21 -0
- package/lib/schema-component/antd/cascader/Cascader.js +1 -1
- package/lib/schema-component/antd/date-picker/util.d.ts +20 -21
- package/lib/schema-component/antd/date-picker/util.js +1 -1
- package/lib/schema-component/antd/expand-action/Expand.Action.js +1 -1
- package/lib/schema-component/antd/filter/FilterAction.js +1 -1
- package/lib/schema-component/antd/filter/FilterGroup.js +9 -5
- package/lib/schema-component/antd/filter/SaveDefaultValue.js +1 -1
- package/lib/schema-component/antd/form/Form.js +1 -1
- package/lib/schema-component/antd/form-dialog/index.d.ts +29 -0
- package/lib/schema-component/antd/form-dialog/index.js +268 -0
- package/lib/schema-component/antd/form-v2/Templates.js +24 -16
- package/lib/schema-component/antd/gantt/components/calendar/calendar.js +18 -14
- package/lib/schema-component/antd/gantt/components/calendar/style.d.ts +2 -4
- package/lib/schema-component/antd/gantt/components/calendar/style.js +48 -12
- package/lib/schema-component/antd/gantt/components/calendar/top-part-of-calendar.js +3 -4
- package/lib/schema-component/antd/gantt/components/gantt/gantt.js +27 -17
- package/lib/schema-component/antd/gantt/components/gantt/style.d.ts +2 -3
- package/lib/schema-component/antd/gantt/components/gantt/style.js +49 -10
- package/lib/schema-component/antd/gantt/components/gantt/task-gantt.d.ts +1 -1
- package/lib/schema-component/antd/gantt/components/gantt/task-gantt.js +5 -12
- package/lib/schema-component/antd/gantt/components/grid/grid-body.js +12 -8
- package/lib/schema-component/antd/gantt/components/grid/style.d.ts +2 -4
- package/lib/schema-component/antd/gantt/components/grid/style.js +28 -12
- package/lib/schema-component/antd/gantt/components/other/horizontal-scroll.js +10 -6
- package/lib/schema-component/antd/gantt/components/other/style.d.ts +2 -7
- package/lib/schema-component/antd/gantt/components/other/style.js +103 -18
- package/lib/schema-component/antd/gantt/components/other/tooltip.js +19 -10
- package/lib/schema-component/antd/gantt/components/other/vertical-scroll.js +10 -5
- package/lib/schema-component/antd/gantt/components/task-item/style.d.ts +2 -3
- package/lib/schema-component/antd/gantt/components/task-item/style.js +47 -10
- package/lib/schema-component/antd/gantt/components/task-item/task-item.js +10 -4
- package/lib/schema-component/antd/grid/Grid.js +45 -30
- package/lib/schema-component/antd/grid/Grid.style.d.ts +2 -0
- package/lib/schema-component/antd/grid/Grid.style.js +53 -0
- package/lib/schema-component/antd/grid-card/GridCard.Decorator.js +10 -7
- package/lib/schema-component/antd/grid-card/GridCard.Decorator.style.d.ts +2 -0
- package/lib/schema-component/antd/grid-card/GridCard.Decorator.style.js +32 -0
- package/lib/schema-component/antd/grid-card/GridCard.d.ts +1 -1
- package/lib/schema-component/antd/grid-card/GridCard.js +28 -28
- package/lib/schema-component/antd/index.d.ts +2 -0
- package/lib/schema-component/antd/index.js +22 -0
- package/lib/schema-component/antd/index.less +0 -16
- package/lib/schema-component/antd/kanban/Kanban.Card.Designer.js +1 -1
- package/lib/schema-component/antd/list/List.Item.js +1 -5
- package/lib/schema-component/antd/list/List.js +10 -7
- package/lib/schema-component/antd/list/List.style.d.ts +2 -0
- package/lib/schema-component/antd/list/List.style.js +61 -0
- package/lib/schema-component/antd/markdown/Markdown.Void.js +6 -1
- package/lib/schema-component/antd/markdown/Markdown.js +1 -1
- package/lib/schema-component/antd/markdown/md.d.ts +0 -2
- package/lib/schema-component/antd/markdown/md.js +0 -2
- package/lib/schema-component/antd/markdown/style.js +212 -4
- package/lib/schema-component/antd/menu/Menu.Designer.js +15 -13
- package/lib/schema-component/antd/menu/Menu.js +13 -6
- package/lib/schema-component/antd/menu/MenuItemInitializers/index.js +195 -194
- package/lib/schema-component/antd/page/Page.d.ts +4 -1
- package/lib/schema-component/antd/page/Page.js +38 -33
- package/lib/schema-component/antd/page/PageTabDesigner.js +3 -1
- package/lib/schema-component/antd/page/style.d.ts +1 -0
- package/lib/schema-component/antd/page/style.js +134 -0
- package/lib/schema-component/antd/remote-select/ReadPretty.js +2 -2
- package/lib/schema-component/antd/rich-text/style.js +20 -20
- package/lib/schema-component/antd/select/Select.js +5 -2
- package/lib/schema-component/antd/table/Table.Array.js +7 -7
- package/lib/schema-component/antd/table/Table.Column.ActionBar.js +1 -1
- package/lib/schema-component/antd/table-v2/Table.Column.ActionBar.js +1 -1
- package/lib/schema-component/antd/table-v2/Table.js +20 -5
- package/lib/schema-component/antd/table-v2/components/ColumnFieldProvider.d.ts +6 -0
- package/lib/schema-component/antd/table-v2/components/ColumnFieldProvider.js +45 -0
- package/lib/schema-component/antd/tabs/Tabs.js +3 -3
- package/lib/schema-component/antd/upload/ReadPretty.js +8 -3
- package/lib/schema-component/antd/upload/style.js +11 -1
- package/lib/schema-component/antd/variable/Input.js +1 -2
- package/lib/schema-component/antd/variable/Variable.d.ts +10 -5
- package/lib/schema-component/antd/variable/Variable.js +23 -5
- package/lib/schema-component/antd/variable/VariableSelect.js +19 -8
- package/lib/schema-component/antd/variable/VariableSelect.style.d.ts +2 -0
- package/lib/schema-component/antd/variable/VariableSelect.style.js +38 -0
- package/lib/schema-component/antd/variable/XButton.js +8 -5
- package/lib/schema-component/antd/variable/style.js +12 -3
- package/lib/schema-component/common/sortable-item/SortableItem.js +5 -1
- package/lib/schema-component/common/utils/logic.js +46 -0
- package/lib/schema-component/common/utils/uitls.d.ts +1 -1
- package/lib/schema-component/common/utils/uitls.js +6 -1
- package/lib/schema-component/core/DesignableSwitch.js +1 -1
- package/lib/schema-initializer/SchemaInitializer.js +22 -22
- package/lib/schema-initializer/SelectCollection.js +17 -1
- package/lib/schema-initializer/buttons/CalendarActionInitializers.js +2 -2
- package/lib/schema-initializer/buttons/CalendarFormActionInitializers.js +9 -9
- package/lib/schema-initializer/buttons/GridCardActionInitializers.js +4 -4
- package/lib/schema-initializer/buttons/KanbanActionInitializers.js +2 -2
- package/lib/schema-initializer/buttons/ListActionInitializers.js +8 -8
- package/lib/schema-initializer/buttons/ReadPrettyFormActionInitializers.js +1 -1
- package/lib/schema-initializer/buttons/RecordBlockInitializers.js +1 -1
- package/lib/schema-initializer/buttons/TabPaneInitializers.js +2 -2
- package/lib/schema-initializer/buttons/TableActionColumnInitializers.js +8 -6
- package/lib/schema-initializer/buttons/TableActionInitializers.js +4 -4
- package/lib/schema-initializer/buttons/index.d.ts +6 -7
- package/lib/schema-initializer/buttons/index.js +60 -60
- package/lib/schema-initializer/components/CreateRecordAction.js +1 -1
- package/lib/schema-initializer/components/DuplicateAction.js +7 -5
- package/lib/schema-initializer/components/assigned-field/AssignedField.js +5 -3
- package/lib/schema-initializer/items/CalendarBlockInitializer.js +5 -3
- package/lib/schema-initializer/items/DetailsBlockInitializer.js +2 -2
- package/lib/schema-initializer/items/GanttBlockInitializer.js +5 -2
- package/lib/schema-initializer/items/KanbanBlockInitializer.js +6 -4
- package/lib/schema-initializer/items/RecordAssociationCalendarBlockInitializer.js +5 -2
- package/lib/schema-initializer/items/index.d.ts +1 -1
- package/lib/schema-initializer/items/index.js +11 -11
- package/lib/schema-initializer/style.d.ts +7 -1
- package/lib/schema-initializer/style.js +9 -2
- package/lib/schema-initializer/utils.js +1 -1
- package/lib/schema-settings/GeneralSchemaDesigner.js +1 -1
- package/lib/schema-settings/LinkageRules/components/LinkageHeader.js +5 -2
- package/lib/schema-settings/SchemaSettings.js +16 -15
- package/lib/style/index.d.ts +2 -0
- package/lib/style/index.js +27 -0
- package/lib/style/useToken.d.ts +11 -0
- package/lib/style/useToken.js +13 -0
- package/lib/system-settings/SystemSettingsShortcut.js +2 -110
- package/lib/test/AppContextProvider.d.ts +11 -0
- package/lib/test/AppContextProvider.js +25 -0
- package/lib/user/CurrentUser.js +35 -12
- package/lib/user/CurrentUserProvider.d.ts +6 -2
- package/lib/user/CurrentUserProvider.js +15 -9
- package/lib/user/CurrentUserSettingsMenuProvider.d.ts +21 -0
- package/lib/user/CurrentUserSettingsMenuProvider.js +92 -0
- package/lib/user/index.d.ts +1 -0
- package/lib/user/index.js +11 -0
- package/package.json +7 -6
- package/es/collection-manager/Configuration/components/TemplateSummay.d.ts +0 -2
- package/es/collection-manager/Configuration/components/TemplateSummay.js +0 -28
- package/es/schema-component/antd/markdown/highlight-theme/default.less +0 -98
- package/es/schema-component/antd/markdown/highlight-theme/table.less +0 -36
- package/lib/collection-manager/Configuration/components/TemplateSummay.d.ts +0 -2
- package/lib/collection-manager/Configuration/components/TemplateSummay.js +0 -36
- package/lib/schema-component/antd/markdown/highlight-theme/default.less +0 -98
- package/lib/schema-component/antd/markdown/highlight-theme/table.less +0 -36
package/es/acl/ACLProvider.js
CHANGED
|
@@ -145,15 +145,17 @@ var getIgnoreScope = function getIgnoreScope() {
|
|
|
145
145
|
};
|
|
146
146
|
var useAllowedActions = function useAllowedActions() {
|
|
147
147
|
var _result$allowedAction, _result$service, _result$service$data, _result$service$data$;
|
|
148
|
+
var service = useResourceActionContext();
|
|
148
149
|
var result = useBlockRequestContext() || {
|
|
149
|
-
service:
|
|
150
|
+
service: service
|
|
150
151
|
};
|
|
151
152
|
return (_result$allowedAction = result === null || result === void 0 ? void 0 : result.allowedActions) !== null && _result$allowedAction !== void 0 ? _result$allowedAction : result === null || result === void 0 ? void 0 : (_result$service = result.service) === null || _result$service === void 0 ? void 0 : (_result$service$data = _result$service.data) === null || _result$service$data === void 0 ? void 0 : (_result$service$data$ = _result$service$data.meta) === null || _result$service$data$ === void 0 ? void 0 : _result$service$data$.allowedActions;
|
|
152
153
|
};
|
|
153
154
|
var useResourceName = function useResourceName() {
|
|
154
155
|
var _result$props, _result$service2, _result$service2$defa;
|
|
156
|
+
var service = useResourceActionContext();
|
|
155
157
|
var result = useBlockRequestContext() || {
|
|
156
|
-
service:
|
|
158
|
+
service: service
|
|
157
159
|
};
|
|
158
160
|
return (result === null || result === void 0 ? void 0 : (_result$props = result.props) === null || _result$props === void 0 ? void 0 : _result$props.resource) || (result === null || result === void 0 ? void 0 : (_result$service2 = result.service) === null || _result$service2 === void 0 ? void 0 : (_result$service2$defa = _result$service2.defaultRequest) === null || _result$service2$defa === void 0 ? void 0 : _result$service2$defa.resource);
|
|
159
161
|
};
|
|
@@ -283,12 +285,6 @@ export var ACLCollectionFieldProvider = function ACLCollectionFieldProvider(prop
|
|
|
283
285
|
var field = useField();
|
|
284
286
|
var _useACLRoleContext4 = useACLRoleContext(),
|
|
285
287
|
allowAll = _useACLRoleContext4.allowAll;
|
|
286
|
-
if (allowAll) {
|
|
287
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, props.children);
|
|
288
|
-
}
|
|
289
|
-
if (!fieldSchema['x-collection-field']) {
|
|
290
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, props.children);
|
|
291
|
-
}
|
|
292
288
|
var _useACLFieldWhitelist = useACLFieldWhitelist(),
|
|
293
289
|
whitelist = _useACLFieldWhitelist.whitelist;
|
|
294
290
|
var allowed = whitelist.length > 0 ? whitelist.includes(fieldSchema.name) : true;
|
|
@@ -298,6 +294,12 @@ export var ACLCollectionFieldProvider = function ACLCollectionFieldProvider(prop
|
|
|
298
294
|
field.display = 'hidden';
|
|
299
295
|
}
|
|
300
296
|
}, [allowed]);
|
|
297
|
+
if (allowAll) {
|
|
298
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, props.children);
|
|
299
|
+
}
|
|
300
|
+
if (!fieldSchema['x-collection-field']) {
|
|
301
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, props.children);
|
|
302
|
+
}
|
|
301
303
|
if (!allowed) {
|
|
302
304
|
return null;
|
|
303
305
|
}
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
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; }
|
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
+
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; }
|
|
5
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
|
+
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); }
|
|
2
7
|
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; }
|
|
3
8
|
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); } }
|
|
4
9
|
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); }); }; }
|
|
@@ -162,6 +167,20 @@ export var MenuConfigure = function MenuConfigure() {
|
|
|
162
167
|
return _ref.apply(this, arguments);
|
|
163
168
|
};
|
|
164
169
|
}();
|
|
170
|
+
var translateTitle = function translateTitle(menus) {
|
|
171
|
+
return menus.map(function (menu) {
|
|
172
|
+
var title = t(menu.title);
|
|
173
|
+
if (menu.children) {
|
|
174
|
+
return _objectSpread(_objectSpread({}, menu), {}, {
|
|
175
|
+
title: title,
|
|
176
|
+
children: translateTitle(menu.children)
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
return _objectSpread(_objectSpread({}, menu), {}, {
|
|
180
|
+
title: title
|
|
181
|
+
});
|
|
182
|
+
});
|
|
183
|
+
};
|
|
165
184
|
return /*#__PURE__*/React.createElement(Table, {
|
|
166
185
|
className: styles,
|
|
167
186
|
loading: loading,
|
|
@@ -223,6 +242,6 @@ export var MenuConfigure = function MenuConfigure() {
|
|
|
223
242
|
});
|
|
224
243
|
}
|
|
225
244
|
}],
|
|
226
|
-
dataSource: items
|
|
245
|
+
dataSource: translateTitle(items)
|
|
227
246
|
});
|
|
228
247
|
};
|
|
@@ -1 +1,32 @@
|
|
|
1
|
-
export declare const useRoleResourceValues: (options: any) =>
|
|
1
|
+
export declare const useRoleResourceValues: (options: any) => {
|
|
2
|
+
state: {};
|
|
3
|
+
setState: import("ahooks/lib/useSetState").SetState<{}>;
|
|
4
|
+
loading: boolean;
|
|
5
|
+
data?: {
|
|
6
|
+
appends: string[];
|
|
7
|
+
filterByTk: any;
|
|
8
|
+
};
|
|
9
|
+
error?: Error;
|
|
10
|
+
params: any;
|
|
11
|
+
cancel: () => void;
|
|
12
|
+
refresh: () => void;
|
|
13
|
+
refreshAsync: () => Promise<{
|
|
14
|
+
appends: string[];
|
|
15
|
+
filterByTk: any;
|
|
16
|
+
}>;
|
|
17
|
+
run: (...params: any) => void;
|
|
18
|
+
runAsync: (...params: any) => Promise<{
|
|
19
|
+
appends: string[];
|
|
20
|
+
filterByTk: any;
|
|
21
|
+
}>;
|
|
22
|
+
mutate: (data?: {
|
|
23
|
+
appends: string[];
|
|
24
|
+
filterByTk: any;
|
|
25
|
+
} | ((oldData?: {
|
|
26
|
+
appends: string[];
|
|
27
|
+
filterByTk: any;
|
|
28
|
+
}) => {
|
|
29
|
+
appends: string[];
|
|
30
|
+
filterByTk: any;
|
|
31
|
+
})) => void;
|
|
32
|
+
};
|
|
@@ -3,8 +3,10 @@ import { Result } from 'ahooks/es/useRequest/src/types';
|
|
|
3
3
|
export declare class APIClient extends APIClientSDK {
|
|
4
4
|
services: Record<string, Result<any, any>>;
|
|
5
5
|
silence: boolean;
|
|
6
|
+
/** 该值会在 AntdAppProvider 中被重新赋值 */
|
|
7
|
+
notification: any;
|
|
6
8
|
service(uid: string): Result<any, any>;
|
|
7
9
|
interceptors(): void;
|
|
8
|
-
|
|
10
|
+
useNotificationMiddleware(): void;
|
|
9
11
|
silent(): this;
|
|
10
12
|
}
|
|
@@ -14,15 +14,15 @@ function _assertThisInitialized(self) { if (self === void 0) { throw new Referen
|
|
|
14
14
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
15
15
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
16
16
|
import { APIClient as APIClientSDK } from '@nocobase/sdk';
|
|
17
|
-
import { notification
|
|
17
|
+
import { notification } from 'antd';
|
|
18
18
|
import React from 'react';
|
|
19
|
-
var handleErrorMessage = function handleErrorMessage(error) {
|
|
19
|
+
var handleErrorMessage = function handleErrorMessage(error, notification) {
|
|
20
20
|
var _error$response;
|
|
21
21
|
var reader = new FileReader();
|
|
22
22
|
reader.readAsText(error === null || error === void 0 ? void 0 : (_error$response = error.response) === null || _error$response === void 0 ? void 0 : _error$response.data, 'utf-8');
|
|
23
23
|
reader.onload = function () {
|
|
24
24
|
var _JSON$parse$errors, _JSON$parse$errors$ma;
|
|
25
|
-
|
|
25
|
+
notification.error({
|
|
26
26
|
message: (_JSON$parse$errors = JSON.parse(reader.result).errors) === null || _JSON$parse$errors === void 0 ? void 0 : (_JSON$parse$errors$ma = _JSON$parse$errors.map) === null || _JSON$parse$errors$ma === void 0 ? void 0 : _JSON$parse$errors$ma.call(_JSON$parse$errors, function (error) {
|
|
27
27
|
return /*#__PURE__*/React.createElement('div', {
|
|
28
28
|
children: error.message
|
|
@@ -44,6 +44,8 @@ export var APIClient = /*#__PURE__*/function (_APIClientSDK) {
|
|
|
44
44
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
45
45
|
_this.services = {};
|
|
46
46
|
_this.silence = false;
|
|
47
|
+
/** 该值会在 AntdAppProvider 中被重新赋值 */
|
|
48
|
+
_this.notification = notification;
|
|
47
49
|
return _this;
|
|
48
50
|
}
|
|
49
51
|
_createClass(APIClient, [{
|
|
@@ -63,11 +65,11 @@ export var APIClient = /*#__PURE__*/function (_APIClientSDK) {
|
|
|
63
65
|
return config;
|
|
64
66
|
});
|
|
65
67
|
_get(_getPrototypeOf(APIClient.prototype), "interceptors", this).call(this);
|
|
66
|
-
this.
|
|
68
|
+
this.useNotificationMiddleware();
|
|
67
69
|
}
|
|
68
70
|
}, {
|
|
69
|
-
key: "
|
|
70
|
-
value: function
|
|
71
|
+
key: "useNotificationMiddleware",
|
|
72
|
+
value: function useNotificationMiddleware() {
|
|
71
73
|
var _this2 = this;
|
|
72
74
|
this.axios.interceptors.response.use(function (response) {
|
|
73
75
|
return response;
|
|
@@ -81,7 +83,7 @@ export var APIClient = /*#__PURE__*/function (_APIClientSDK) {
|
|
|
81
83
|
return window.location.href = redirectTo;
|
|
82
84
|
}
|
|
83
85
|
if ((error === null || error === void 0 ? void 0 : (_error$response3 = error.response) === null || _error$response3 === void 0 ? void 0 : (_error$response3$data = _error$response3.data) === null || _error$response3$data === void 0 ? void 0 : _error$response3$data.type) === 'application/json') {
|
|
84
|
-
handleErrorMessage(error);
|
|
86
|
+
handleErrorMessage(error, _this2.notification);
|
|
85
87
|
} else {
|
|
86
88
|
var _error$response4, _error$response4$data, _errs, _errs$map;
|
|
87
89
|
if (errorCache.size > 10) {
|
|
@@ -101,7 +103,7 @@ export var APIClient = /*#__PURE__*/function (_APIClientSDK) {
|
|
|
101
103
|
if (errs.length === 0) {
|
|
102
104
|
throw error;
|
|
103
105
|
}
|
|
104
|
-
|
|
106
|
+
_this2.notification.error({
|
|
105
107
|
message: (_errs = errs) === null || _errs === void 0 ? void 0 : (_errs$map = _errs.map) === null || _errs$map === void 0 ? void 0 : _errs$map.call(_errs, function (error) {
|
|
106
108
|
return /*#__PURE__*/React.createElement('div', {}, error.message);
|
|
107
109
|
})
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Options } from 'ahooks/es/useRequest/src/types';
|
|
2
2
|
import { AxiosRequestConfig } from 'axios';
|
|
3
3
|
type FunctionService = (...args: any[]) => Promise<any>;
|
|
4
|
+
export type ReturnTypeOfUseRequest<TData = any> = ReturnType<typeof useRequest<TData>>;
|
|
4
5
|
export type ResourceActionOptions<P = any> = {
|
|
5
6
|
resource?: string;
|
|
6
7
|
resourceOf?: any;
|
|
@@ -9,5 +10,18 @@ export type ResourceActionOptions<P = any> = {
|
|
|
9
10
|
};
|
|
10
11
|
export declare function useRequest<P>(service: AxiosRequestConfig<P> | ResourceActionOptions<P> | FunctionService, options?: Options<any, any> & {
|
|
11
12
|
uid?: string;
|
|
12
|
-
}):
|
|
13
|
+
}): {
|
|
14
|
+
state: {};
|
|
15
|
+
setState: import("ahooks/lib/useSetState").SetState<{}>;
|
|
16
|
+
loading: boolean;
|
|
17
|
+
data?: P;
|
|
18
|
+
error?: Error;
|
|
19
|
+
params: any;
|
|
20
|
+
cancel: () => void;
|
|
21
|
+
refresh: () => void;
|
|
22
|
+
refreshAsync: () => Promise<P>;
|
|
23
|
+
run: (...params: any) => void;
|
|
24
|
+
runAsync: (...params: any) => Promise<P>;
|
|
25
|
+
mutate: (data?: P | ((oldData?: P) => P)) => void;
|
|
26
|
+
};
|
|
13
27
|
export {};
|
|
@@ -17,9 +17,8 @@ import { merge } from '@formily/shared';
|
|
|
17
17
|
import { useSetState } from 'ahooks';
|
|
18
18
|
import { default as useReq } from 'ahooks/es/useRequest';
|
|
19
19
|
import cloneDeep from 'lodash/cloneDeep';
|
|
20
|
-
import { useContext } from 'react';
|
|
21
|
-
import { APIClientContext } from '../context';
|
|
22
20
|
import { assign } from './assign';
|
|
21
|
+
import { useAPIClient } from './useAPIClient';
|
|
23
22
|
export function useRequest(service) {
|
|
24
23
|
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
25
24
|
// 缓存用途
|
|
@@ -27,8 +26,8 @@ export function useRequest(service) {
|
|
|
27
26
|
_useSetState2 = _slicedToArray(_useSetState, 2),
|
|
28
27
|
state = _useSetState2[0],
|
|
29
28
|
setState = _useSetState2[1];
|
|
30
|
-
var api =
|
|
31
|
-
var
|
|
29
|
+
var api = useAPIClient();
|
|
30
|
+
var tempService;
|
|
32
31
|
if (typeof service === 'function') {
|
|
33
32
|
tempService = service;
|
|
34
33
|
} else {
|
|
@@ -67,7 +66,7 @@ export function useRequest(service) {
|
|
|
67
66
|
};
|
|
68
67
|
}();
|
|
69
68
|
}
|
|
70
|
-
tempOptions = _objectSpread(_objectSpread({}, options), {}, {
|
|
69
|
+
var tempOptions = _objectSpread(_objectSpread({}, options), {}, {
|
|
71
70
|
onSuccess: function onSuccess() {
|
|
72
71
|
var _options$onSuccess;
|
|
73
72
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { APIClientContext } from '../context';
|
|
1
|
+
import { useAPIClient } from './useAPIClient';
|
|
3
2
|
export function useResource(name, of) {
|
|
4
|
-
var apiClient =
|
|
3
|
+
var apiClient = useAPIClient();
|
|
5
4
|
return apiClient.resource(name, of);
|
|
6
5
|
}
|
|
@@ -31,15 +31,16 @@ export function useAppPluginLoad(app) {
|
|
|
31
31
|
_context.next = 3;
|
|
32
32
|
return app.load();
|
|
33
33
|
case 3:
|
|
34
|
-
_context.next =
|
|
34
|
+
_context.next = 9;
|
|
35
35
|
break;
|
|
36
36
|
case 5:
|
|
37
37
|
_context.prev = 5;
|
|
38
38
|
_context.t0 = _context["catch"](0);
|
|
39
|
+
console.error(_context.t0);
|
|
39
40
|
setError(_context.t0);
|
|
40
|
-
case 8:
|
|
41
|
-
setLoading(false);
|
|
42
41
|
case 9:
|
|
42
|
+
setLoading(false);
|
|
43
|
+
case 10:
|
|
43
44
|
case "end":
|
|
44
45
|
return _context.stop();
|
|
45
46
|
}
|
|
@@ -15,12 +15,12 @@ export var AsyncDataProvider = function AsyncDataProvider(props) {
|
|
|
15
15
|
request = props.request,
|
|
16
16
|
children = props.children,
|
|
17
17
|
others = _objectWithoutProperties(props, _excluded);
|
|
18
|
+
var result = useRequest(request, _objectSpread({}, others));
|
|
18
19
|
if (value) {
|
|
19
20
|
return /*#__PURE__*/React.createElement(AsyncDataContext.Provider, {
|
|
20
21
|
value: value
|
|
21
22
|
}, children);
|
|
22
23
|
}
|
|
23
|
-
var result = useRequest(request, _objectSpread({}, others));
|
|
24
24
|
return /*#__PURE__*/React.createElement(AsyncDataContext.Provider, {
|
|
25
25
|
value: result
|
|
26
26
|
}, children);
|
package/es/auth/SigninPage.js
CHANGED
|
@@ -21,7 +21,7 @@ import { Space, Tabs } from 'antd';
|
|
|
21
21
|
import React, { createContext, createElement, useCallback, useContext, useState } from 'react';
|
|
22
22
|
import { useTranslation } from 'react-i18next';
|
|
23
23
|
import { useNavigate, useSearchParams } from 'react-router-dom';
|
|
24
|
-
import { useAPIClient, useCurrentDocumentTitle, useRequest, useViewport } from '..';
|
|
24
|
+
import { useAPIClient, useCurrentDocumentTitle, useCurrentUserContext, useRequest, useViewport } from '..';
|
|
25
25
|
import { useSigninPageExtension } from './SigninPageExtension';
|
|
26
26
|
var SigninPageContext = /*#__PURE__*/createContext({});
|
|
27
27
|
export var SigninPageProvider = function SigninPageProvider(props) {
|
|
@@ -51,6 +51,8 @@ export var useSignIn = function useSignIn(authenticator) {
|
|
|
51
51
|
var form = useForm();
|
|
52
52
|
var api = useAPIClient();
|
|
53
53
|
var redirect = useRedirect();
|
|
54
|
+
var _useCurrentUserContex = useCurrentUserContext(),
|
|
55
|
+
refreshAsync = _useCurrentUserContex.refreshAsync;
|
|
54
56
|
return {
|
|
55
57
|
run: function run() {
|
|
56
58
|
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
@@ -63,8 +65,11 @@ export var useSignIn = function useSignIn(authenticator) {
|
|
|
63
65
|
_context.next = 4;
|
|
64
66
|
return api.auth.signIn(form.values, authenticator);
|
|
65
67
|
case 4:
|
|
68
|
+
_context.next = 6;
|
|
69
|
+
return refreshAsync();
|
|
70
|
+
case 6:
|
|
66
71
|
redirect();
|
|
67
|
-
case
|
|
72
|
+
case 7:
|
|
68
73
|
case "end":
|
|
69
74
|
return _context.stop();
|
|
70
75
|
}
|
|
@@ -132,7 +137,7 @@ export var SigninPage = function SigninPage() {
|
|
|
132
137
|
}, tabs.length > 1 ? /*#__PURE__*/React.createElement(Tabs, {
|
|
133
138
|
items: tabs.map(function (tab) {
|
|
134
139
|
return {
|
|
135
|
-
label: tab.tabTitle,
|
|
140
|
+
label: t(tab.tabTitle),
|
|
136
141
|
key: tab.name,
|
|
137
142
|
children: tab.component
|
|
138
143
|
};
|
|
@@ -6,8 +6,8 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _ty
|
|
|
6
6
|
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); }
|
|
7
7
|
import { createForm } from '@formily/core';
|
|
8
8
|
import { RecursionField, useField, useFieldSchema } from '@formily/react';
|
|
9
|
-
import { isEmpty } from 'lodash';
|
|
10
9
|
import { Spin } from 'antd';
|
|
10
|
+
import { isEmpty } from 'lodash';
|
|
11
11
|
import React, { createContext, useContext, useEffect, useMemo, useRef } from 'react';
|
|
12
12
|
import { useCollection } from '../collection-manager';
|
|
13
13
|
import { RecordProvider, useRecord } from '../record-provider';
|
|
@@ -84,8 +84,15 @@ export var FormBlockProvider = function FormBlockProvider(props) {
|
|
|
84
84
|
}
|
|
85
85
|
var createFlag = currentCollection.name === ((collection === null || collection === void 0 ? void 0 : collection.name) || collection) && !isEmptyRecord || !currentCollection.name;
|
|
86
86
|
return (detailFlag || createFlag) && /*#__PURE__*/React.createElement(BlockProvider, _objectSpread(_objectSpread({}, props), {}, {
|
|
87
|
-
block: 'form'
|
|
88
|
-
|
|
87
|
+
block: 'form',
|
|
88
|
+
params: _objectSpread(_objectSpread({}, props === null || props === void 0 ? void 0 : props.params), {}, {
|
|
89
|
+
targetCollection: collection
|
|
90
|
+
})
|
|
91
|
+
}), /*#__PURE__*/React.createElement(InternalFormBlockProvider, _objectSpread(_objectSpread({}, props), {}, {
|
|
92
|
+
params: _objectSpread(_objectSpread({}, props === null || props === void 0 ? void 0 : props.params), {}, {
|
|
93
|
+
targetCollection: collection
|
|
94
|
+
})
|
|
95
|
+
})));
|
|
89
96
|
};
|
|
90
97
|
export var useFormBlockContext = function useFormBlockContext() {
|
|
91
98
|
return useContext(FormBlockContext);
|
|
@@ -104,7 +104,8 @@ export var useGanttBlockProps = function useGanttBlockProps() {
|
|
|
104
104
|
var _useCollection = useCollection(),
|
|
105
105
|
getPrimaryKey = _useCollection.getPrimaryKey,
|
|
106
106
|
name = _useCollection.name,
|
|
107
|
-
template = _useCollection.template
|
|
107
|
+
template = _useCollection.template,
|
|
108
|
+
writableView = _useCollection.writableView;
|
|
108
109
|
var _useACLRoleContext = useACLRoleContext(),
|
|
109
110
|
parseAction = _useACLRoleContext.parseAction;
|
|
110
111
|
var primaryKey = getPrimaryKey();
|
|
@@ -116,7 +117,7 @@ export var useGanttBlockProps = function useGanttBlockProps() {
|
|
|
116
117
|
schema: schema,
|
|
117
118
|
recordPkValue: recordPkValue
|
|
118
119
|
});
|
|
119
|
-
return template === 'view' || !params;
|
|
120
|
+
return template === 'view' && !writableView || !params;
|
|
120
121
|
};
|
|
121
122
|
var onExpanderClick = function onExpanderClick(task) {
|
|
122
123
|
var data = ctx.field.data;
|
|
@@ -23,7 +23,6 @@ import { FormContext, useField, useFieldSchema } from '@formily/react';
|
|
|
23
23
|
import React, { createContext, useContext, useEffect, useMemo, useState } from 'react';
|
|
24
24
|
import { useCollectionManager } from '../collection-manager';
|
|
25
25
|
import { useFilterBlock } from '../filter-provider/FilterProvider';
|
|
26
|
-
import { useRecord } from '../record-provider';
|
|
27
26
|
import { FixedBlockWrapper, removeNullCondition, SchemaComponentOptions } from '../schema-component';
|
|
28
27
|
import { BlockProvider, RenderChildrenWithAssociationFilter, useBlockRequestContext } from './BlockProvider';
|
|
29
28
|
import { findFilterTargets } from './hooks';
|
|
@@ -93,59 +92,9 @@ var InternalTableBlockProvider = function InternalTableBlockProvider(props) {
|
|
|
93
92
|
}
|
|
94
93
|
}, /*#__PURE__*/React.createElement(RenderChildrenWithAssociationFilter, _objectSpread({}, props))));
|
|
95
94
|
};
|
|
96
|
-
// export const useAssociationNames = (collection) => {
|
|
97
|
-
// const { getCollectionFields } = useCollectionManager();
|
|
98
|
-
// const collectionFields = getCollectionFields(collection);
|
|
99
|
-
// const associationFields = new Set();
|
|
100
|
-
// for (const collectionField of collectionFields) {
|
|
101
|
-
// if (collectionField.target) {
|
|
102
|
-
// associationFields.add(collectionField.name);
|
|
103
|
-
// const fields = getCollectionFields(collectionField.target);
|
|
104
|
-
// for (const field of fields) {
|
|
105
|
-
// if (field.target) {
|
|
106
|
-
// associationFields.add(`${collectionField.name}.${field.name}`);
|
|
107
|
-
// }
|
|
108
|
-
// }
|
|
109
|
-
// }
|
|
110
|
-
// }
|
|
111
|
-
// const fieldSchema = useFieldSchema();
|
|
112
|
-
// const tableSchema = fieldSchema.reduceProperties((buf, schema) => {
|
|
113
|
-
// if (schema['x-component'] === 'TableV2') {
|
|
114
|
-
// return schema;
|
|
115
|
-
// }
|
|
116
|
-
// if (schema['x-component'] === 'Gantt') {
|
|
117
|
-
// return schema.properties?.table;
|
|
118
|
-
// }
|
|
119
|
-
// return buf;
|
|
120
|
-
// }, new Schema({}));
|
|
121
|
-
// return uniq(
|
|
122
|
-
// tableSchema.reduceProperties((buf, schema) => {
|
|
123
|
-
// if (schema['x-component'] === 'TableV2.Column') {
|
|
124
|
-
// const s = schema.reduceProperties((buf, s) => {
|
|
125
|
-
// const [name] = (s.name as string).split('.');
|
|
126
|
-
// if (s['x-collection-field'] && associationFields.has(name)) {
|
|
127
|
-
// return s;
|
|
128
|
-
// }
|
|
129
|
-
// return buf;
|
|
130
|
-
// }, null);
|
|
131
|
-
// if (s) {
|
|
132
|
-
// // 关联字段和关联的关联字段
|
|
133
|
-
// const [firstName] = s.name.split('.');
|
|
134
|
-
// if (associationFields.has(s.name)) {
|
|
135
|
-
// buf.push(s.name);
|
|
136
|
-
// } else if (associationFields.has(firstName)) {
|
|
137
|
-
// buf.push(firstName);
|
|
138
|
-
// }
|
|
139
|
-
// }
|
|
140
|
-
// }
|
|
141
|
-
// return buf;
|
|
142
|
-
// }, []),
|
|
143
|
-
// );
|
|
144
|
-
// };
|
|
145
95
|
export var TableBlockProvider = function TableBlockProvider(props) {
|
|
146
96
|
var resourceName = props.resource;
|
|
147
97
|
var params = _objectSpread({}, props.params);
|
|
148
|
-
var record = useRecord();
|
|
149
98
|
var fieldSchema = useFieldSchema();
|
|
150
99
|
var _useCollectionManager = useCollectionManager(),
|
|
151
100
|
getCollection = _useCollectionManager.getCollection,
|
|
@@ -206,6 +155,7 @@ export var useTableBlockProps = function useTableBlockProps() {
|
|
|
206
155
|
var _ctx$service;
|
|
207
156
|
if (!(ctx !== null && ctx !== void 0 && (_ctx$service = ctx.service) !== null && _ctx$service !== void 0 && _ctx$service.loading)) {
|
|
208
157
|
var _ctx$service2, _ctx$service2$data, _ctx$field, _ctx$field$data, _ctx$service3, _ctx$service3$data, _ctx$service3$data$me, _ctx$service4, _ctx$service4$data, _ctx$service4$data$me, _ctx$service5, _ctx$service5$data, _ctx$service5$data$me;
|
|
158
|
+
field.value = [];
|
|
209
159
|
field.value = ctx === null || ctx === void 0 ? void 0 : (_ctx$service2 = ctx.service) === null || _ctx$service2 === void 0 ? void 0 : (_ctx$service2$data = _ctx$service2.data) === null || _ctx$service2$data === void 0 ? void 0 : _ctx$service2$data.data;
|
|
210
160
|
field.data = field.data || {};
|
|
211
161
|
field.data.selectedRowKeys = ctx === null || ctx === void 0 ? void 0 : (_ctx$field = ctx.field) === null || _ctx$field === void 0 ? void 0 : (_ctx$field$data = _ctx$field.data) === null || _ctx$field$data === void 0 ? void 0 : _ctx$field$data.selectedRowKeys;
|
|
@@ -69,11 +69,13 @@ export declare const useDetailsPaginationProps: () => {
|
|
|
69
69
|
};
|
|
70
70
|
export declare const useAssociationFilterProps: () => {
|
|
71
71
|
/** 渲染 Collapse 的列表数据 */
|
|
72
|
-
list:
|
|
72
|
+
list: {
|
|
73
|
+
[key: string]: any;
|
|
74
|
+
}[];
|
|
73
75
|
onSelected: (value: any) => void;
|
|
74
76
|
handleSearchInput: (e: ChangeEvent<any>) => void;
|
|
75
77
|
params: any;
|
|
76
|
-
run: any;
|
|
78
|
+
run: (...params: any) => void;
|
|
77
79
|
};
|
|
78
80
|
export declare const useOptionalFieldList: () => import("../..").FieldOptions[];
|
|
79
81
|
export declare const useAssociationFilterBlockProps: () => {
|
|
@@ -88,7 +90,7 @@ export declare const useAssociationFilterBlockProps: () => {
|
|
|
88
90
|
} | {
|
|
89
91
|
/** 渲染 Collapse 的列表数据 */
|
|
90
92
|
list: any;
|
|
91
|
-
onSelected: any;
|
|
93
|
+
onSelected: (value: any) => void;
|
|
92
94
|
handleSearchInput: any;
|
|
93
95
|
params: any;
|
|
94
96
|
run: any;
|