@nocobase/client 0.8.0-alpha.9 → 0.8.1-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/acl/Configuration/MenuConfigure.js +129 -56
- package/es/acl/Configuration/MenuItemsProvider.d.ts +3 -0
- package/es/acl/Configuration/MenuItemsProvider.js +51 -0
- package/es/acl/Configuration/RoleTable.d.ts +0 -1
- package/es/acl/Configuration/RoleTable.js +7 -53
- package/es/acl/Configuration/RolesResourcesActions.js +16 -14
- package/es/acl/Configuration/schemas/roleCollections.js +3 -1
- package/es/acl/Configuration/schemas/roles.js +1 -0
- package/es/acl/Configuration/schemas/useRoleResourceValues.d.ts +1 -1
- package/es/api-client/APIClient.js +35 -9
- package/es/api-client/hooks/useRequest.d.ts +2 -2
- package/es/api-client/index.d.ts +1 -0
- package/es/api-client/index.js +2 -1
- package/es/appInfo/CurrentAppInfoProvider.d.ts +4 -0
- package/es/appInfo/CurrentAppInfoProvider.js +20 -0
- package/es/appInfo/index.d.ts +1 -0
- package/es/appInfo/index.js +1 -0
- package/es/application/Application.js +2 -0
- package/es/block-provider/BlockProvider.d.ts +3 -0
- package/es/block-provider/BlockProvider.js +89 -9
- package/es/block-provider/CalendarBlockProvider.js +3 -5
- package/es/block-provider/FormBlockProvider.js +16 -2
- package/es/block-provider/KanbanBlockProvider.js +8 -3
- package/es/block-provider/SharedFilterProvider.d.ts +24 -0
- package/es/block-provider/SharedFilterProvider.js +76 -0
- package/es/block-provider/TableBlockProvider.js +11 -9
- package/es/block-provider/TableSelectorProvider.js +109 -11
- package/es/block-provider/hooks/index.js +1 -0
- package/es/board/Board.js +3 -1
- package/es/board/Column.js +43 -11
- package/es/board/style.less +2 -1
- package/es/collection-manager/CollectionField.d.ts +1 -0
- package/es/collection-manager/CollectionField.js +37 -4
- package/es/collection-manager/CollectionFieldProvider.d.ts +1 -0
- package/es/collection-manager/CollectionFieldProvider.js +3 -2
- package/es/collection-manager/CollectionHistoryProvider.d.ts +8 -0
- package/es/collection-manager/CollectionHistoryProvider.js +82 -0
- package/es/collection-manager/CollectionManagerProvider.js +60 -45
- package/es/collection-manager/CollectionManagerShortcut.js +15 -3
- package/es/collection-manager/Configuration/AddCollectionAction.d.ts +2 -0
- package/es/collection-manager/Configuration/AddCollectionAction.js +385 -0
- package/es/collection-manager/Configuration/AddFieldAction.js +85 -18
- package/es/collection-manager/Configuration/AddSubFieldAction.js +18 -11
- package/es/collection-manager/Configuration/CollectionFieldsTableArray.js +144 -78
- package/es/collection-manager/Configuration/ConfigurationTable.js +36 -118
- package/es/collection-manager/Configuration/EditCollectionAction.d.ts +19 -0
- package/es/collection-manager/Configuration/EditCollectionAction.js +248 -0
- package/es/collection-manager/Configuration/OverridingCollectionField.d.ts +2 -0
- package/es/collection-manager/Configuration/OverridingCollectionField.js +297 -0
- package/es/collection-manager/Configuration/ViewInheritedField.d.ts +2 -0
- package/es/collection-manager/Configuration/ViewInheritedField.js +184 -0
- package/es/collection-manager/Configuration/components/CollectionFieldInterface.d.ts +2 -0
- package/es/collection-manager/Configuration/components/CollectionFieldInterface.js +16 -0
- package/es/collection-manager/Configuration/components/CollectionTemplate.d.ts +2 -0
- package/es/collection-manager/Configuration/components/CollectionTemplate.js +15 -0
- package/es/collection-manager/Configuration/index.d.ts +6 -1
- package/es/collection-manager/Configuration/index.js +6 -1
- package/es/collection-manager/Configuration/interfaces.d.ts +17 -2
- package/es/collection-manager/Configuration/interfaces.js +45 -26
- package/es/collection-manager/Configuration/schemas/collectionFields.d.ts +1 -0
- package/es/collection-manager/Configuration/schemas/collectionFields.js +37 -7
- package/es/collection-manager/Configuration/schemas/collections.js +85 -104
- package/es/collection-manager/Configuration/templates.d.ts +58 -0
- package/es/collection-manager/Configuration/templates.js +25 -0
- package/es/collection-manager/action-hooks.d.ts +20 -20
- package/es/collection-manager/action-hooks.js +51 -106
- package/es/collection-manager/hooks/useCollection.d.ts +4 -1
- package/es/collection-manager/hooks/useCollection.js +22 -4
- package/es/collection-manager/hooks/useCollectionManager.d.ts +9 -2
- package/es/collection-manager/hooks/useCollectionManager.js +120 -10
- package/es/collection-manager/hooks/useOptions.d.ts +5 -0
- package/es/collection-manager/hooks/useOptions.js +52 -0
- package/es/collection-manager/index.d.ts +7 -1
- package/es/collection-manager/index.js +8 -1
- package/es/collection-manager/interfaces/id.js +1 -1
- package/es/collection-manager/interfaces/index.d.ts +0 -1
- package/es/collection-manager/interfaces/index.js +0 -1
- package/es/collection-manager/interfaces/integer.js +3 -3
- package/es/collection-manager/interfaces/json.js +2 -2
- package/es/collection-manager/interfaces/linkTo.js +14 -4
- package/es/collection-manager/interfaces/m2m.js +19 -9
- package/es/collection-manager/interfaces/m2o.js +22 -54
- package/es/collection-manager/interfaces/o2m.js +58 -61
- package/es/collection-manager/interfaces/o2o.js +55 -47
- package/es/collection-manager/interfaces/properties/index.d.ts +1 -0
- package/es/collection-manager/interfaces/properties/index.js +7 -0
- package/es/collection-manager/sub-table.d.ts +1 -1
- package/es/collection-manager/sub-table.js +1 -2
- package/es/collection-manager/templates/calendar.d.ts +2 -0
- package/es/collection-manager/templates/calendar.js +39 -0
- package/es/collection-manager/templates/general.d.ts +2 -0
- package/es/collection-manager/templates/general.js +11 -0
- package/es/collection-manager/templates/index.d.ts +2 -0
- package/es/collection-manager/templates/index.js +2 -0
- package/es/collection-manager/templates/properties/index.d.ts +174 -0
- package/es/collection-manager/templates/properties/index.js +137 -0
- package/es/collection-manager/templates/treeCollection.d.ts +1 -0
- package/es/collection-manager/templates/treeCollection.js +0 -0
- package/es/collection-manager/templates/types.d.ts +44 -0
- package/es/collection-manager/templates/types.js +1 -0
- package/es/collection-manager/types.d.ts +2 -0
- package/es/index.d.ts +1 -0
- package/es/index.js +2 -1
- package/es/locale/en_US.d.ts +28 -89
- package/es/locale/en_US.js +29 -90
- package/es/locale/ja_JP.d.ts +17 -90
- package/es/locale/ja_JP.js +17 -90
- package/es/locale/ru_RU.d.ts +5 -89
- package/es/locale/ru_RU.js +6 -90
- package/es/locale/tr_TR.d.ts +5 -89
- package/es/locale/tr_TR.js +6 -90
- package/es/locale/zh_CN.d.ts +30 -125
- package/es/locale/zh_CN.js +32 -128
- package/es/pm/PluginManagerLink.js +3 -2
- package/es/pm/index.js +31 -17
- package/es/route-switch/antd/admin-layout/index.js +51 -24
- package/es/schema-component/antd/action/Action.Designer.js +40 -4
- package/es/schema-component/antd/action/Action.Drawer.js +7 -4
- package/es/schema-component/antd/action/Action.Modal.js +9 -6
- package/es/schema-component/antd/action/Action.js +3 -1
- package/es/schema-component/antd/action/ActionBar.js +11 -3
- package/es/schema-component/antd/action/context.d.ts +3 -0
- package/es/schema-component/antd/action/hooks.d.ts +2 -0
- package/es/schema-component/antd/association-filter/ActionBarAssociationFilterAction.d.ts +1 -0
- package/es/schema-component/antd/association-filter/ActionBarAssociationFilterAction.js +53 -0
- package/es/schema-component/antd/association-filter/AssociationFilter.Initializer.d.ts +1 -0
- package/es/schema-component/antd/association-filter/AssociationFilter.Initializer.js +60 -0
- package/es/schema-component/antd/association-filter/AssociationFilter.Item.Designer.d.ts +1 -0
- package/es/schema-component/antd/association-filter/AssociationFilter.Item.Designer.js +103 -0
- package/es/schema-component/antd/association-filter/AssociationFilter.Item.d.ts +1 -0
- package/es/schema-component/antd/association-filter/AssociationFilter.Item.js +208 -0
- package/es/schema-component/antd/association-filter/AssociationFilter.d.ts +9 -0
- package/es/schema-component/antd/association-filter/AssociationFilter.js +41 -0
- package/es/schema-component/antd/association-filter/AssociationFilterDesignerDelete.d.ts +1 -0
- package/es/schema-component/antd/association-filter/AssociationFilterDesignerDelete.js +32 -0
- package/es/schema-component/antd/association-filter/AssociationFilterDesignerDisplayField.d.ts +1 -0
- package/es/schema-component/antd/association-filter/AssociationFilterDesignerDisplayField.js +29 -0
- package/es/schema-component/antd/association-select/AssociationSelect.d.ts +12 -0
- package/es/schema-component/antd/association-select/AssociationSelect.js +689 -0
- package/es/schema-component/antd/association-select/ReadPretty.d.ts +2 -0
- package/es/schema-component/antd/association-select/ReadPretty.js +18 -0
- package/es/schema-component/antd/association-select/index.d.ts +1 -0
- package/es/schema-component/antd/association-select/index.js +1 -0
- package/es/schema-component/antd/association-select/useServiceOptions.d.ts +1 -0
- package/es/schema-component/antd/association-select/useServiceOptions.js +28 -0
- package/es/schema-component/antd/calendar/Calendar.d.ts +4 -0
- package/es/schema-component/antd/calendar/Calendar.js +65 -58
- package/es/schema-component/antd/calendar/DeleteEvent.js +9 -3
- package/es/schema-component/antd/calendar/context.d.ts +2 -0
- package/es/schema-component/antd/calendar/context.js +6 -2
- package/es/schema-component/antd/calendar/utils.d.ts +1 -0
- package/es/schema-component/antd/calendar/utils.js +3 -0
- package/es/schema-component/antd/card-item/CardItem.js +16 -2
- package/es/schema-component/antd/filter/Filter.Action.Designer.d.ts +1 -1
- package/es/schema-component/antd/filter/FilterItem.js +1 -1
- package/es/schema-component/antd/filter/FilterItems.js +1 -0
- package/es/schema-component/antd/filter/useFilterActionProps.d.ts +0 -1
- package/es/schema-component/antd/filter/useFilterActionProps.js +20 -22
- package/es/schema-component/antd/form-item/FormItem.js +19 -27
- package/es/schema-component/antd/formula-input/FormulaInput.js +9 -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/input/index.d.ts +1 -0
- package/es/schema-component/antd/input/index.js +2 -1
- package/es/schema-component/antd/kanban/Kanban.Designer.js +3 -1
- package/es/schema-component/antd/kanban/index.less +1 -1
- package/es/schema-component/antd/menu/Menu.Designer.js +2 -0
- package/es/schema-component/antd/menu/Menu.js +2 -1
- package/es/schema-component/antd/menu/MenuItemInitializers/index.js +7 -8
- package/es/schema-component/antd/page/FixedBlock.d.ts +14 -0
- package/es/schema-component/antd/page/FixedBlock.js +126 -0
- package/es/schema-component/antd/page/Page.js +189 -9
- package/es/schema-component/antd/page/PageTabDesigner.d.ts +6 -0
- package/es/schema-component/antd/page/PageTabDesigner.js +197 -0
- package/es/schema-component/antd/page/index.d.ts +1 -0
- package/es/schema-component/antd/page/index.js +2 -1
- package/es/schema-component/antd/record-picker/ReadPrettyRecordPicker.js +23 -8
- package/es/schema-component/antd/record-picker/index.d.ts +4 -0
- package/es/schema-component/antd/record-picker/index.js +5 -1
- package/es/schema-component/antd/remote-select/ReadPretty.d.ts +2 -0
- package/es/schema-component/antd/remote-select/ReadPretty.js +60 -0
- package/es/schema-component/antd/remote-select/RemoteSelect.d.ts +21 -0
- package/es/schema-component/antd/remote-select/RemoteSelect.js +114 -0
- package/es/schema-component/antd/remote-select/index.d.ts +1 -0
- package/es/schema-component/antd/remote-select/index.js +1 -0
- package/es/schema-component/antd/remote-select/shared.d.ts +1 -0
- package/es/schema-component/antd/remote-select/shared.js +10 -0
- package/es/schema-component/antd/select/ReadPretty.js +3 -1
- package/es/schema-component/antd/select/Select.d.ts +5 -1
- package/es/schema-component/antd/select/Select.js +39 -7
- package/es/schema-component/antd/select/index.d.ts +1 -0
- package/es/schema-component/antd/select/index.js +2 -1
- package/es/schema-component/antd/select/shared.js +44 -19
- package/es/schema-component/antd/table-v2/Table.Column.Decorator.js +2 -1
- package/es/schema-component/antd/table-v2/Table.Column.Designer.js +32 -3
- package/es/schema-component/antd/table-v2/Table.js +84 -25
- package/es/schema-component/antd/table-v2/TableBlockDesigner.js +4 -2
- package/es/schema-component/antd/table-v2/utils.d.ts +3 -0
- package/es/schema-component/antd/table-v2/utils.js +8 -0
- package/es/schema-component/antd/upload/ReadPretty.js +6 -5
- package/es/schema-component/antd/upload/shared.d.ts +1 -0
- package/es/schema-component/common/dnd-context/index.js +6 -0
- package/es/schema-component/common/sortable-item/SortableItem.js +2 -1
- package/es/schema-component/hooks/index.d.ts +2 -0
- package/es/schema-component/hooks/index.js +3 -1
- package/es/schema-component/hooks/useDesignable.js +1 -1
- package/es/schema-component/hooks/useFieldComponentOptions.d.ts +4 -0
- package/es/schema-component/hooks/useFieldComponentOptions.js +64 -0
- package/es/schema-component/hooks/useFieldTitle.d.ts +1 -0
- package/es/schema-component/hooks/useFieldTitle.js +24 -0
- package/es/schema-initializer/SchemaInitializer.d.ts +1 -0
- package/es/schema-initializer/SchemaInitializer.js +26 -5
- package/es/schema-initializer/SchemaInitializerProvider.d.ts +1 -1
- package/es/schema-initializer/SchemaInitializerProvider.js +9 -3
- package/es/schema-initializer/SelectCollection.d.ts +5 -0
- package/es/schema-initializer/SelectCollection.js +47 -0
- package/es/schema-initializer/buttons/CalendarFormActionInitializers.d.ts +12 -0
- package/es/schema-initializer/buttons/CalendarFormActionInitializers.js +2 -2
- package/es/schema-initializer/buttons/CustomFormItemInitializers.js +23 -6
- package/es/schema-initializer/buttons/FormItemInitializers.js +47 -29
- package/es/schema-initializer/buttons/ReadPrettyFormActionInitializers.d.ts +12 -0
- package/es/schema-initializer/buttons/ReadPrettyFormActionInitializers.js +2 -2
- package/es/schema-initializer/buttons/ReadPrettyFormItemInitializers.js +49 -29
- package/es/schema-initializer/buttons/RecordBlockInitializers.js +28 -2
- package/es/schema-initializer/buttons/TabPaneInitializers.d.ts +2 -2
- package/es/schema-initializer/buttons/TabPaneInitializers.js +22 -12
- package/es/schema-initializer/buttons/TableActionColumnInitializers.js +56 -5
- package/es/schema-initializer/buttons/TableActionInitializers.d.ts +31 -0
- package/es/schema-initializer/buttons/TableActionInitializers.js +37 -9
- package/es/schema-initializer/buttons/TableColumnInitializers.js +16 -1
- package/es/schema-initializer/buttons/TableSelectorInitializers.js +6 -2
- package/es/schema-initializer/buttons/index.d.ts +1 -0
- package/es/schema-initializer/buttons/index.js +3 -1
- package/es/schema-initializer/index.d.ts +2 -0
- package/es/schema-initializer/index.js +3 -1
- package/es/schema-initializer/items/BulkDestroyActionInitializer.js +13 -2
- package/es/schema-initializer/items/CalendarBlockInitializer.js +8 -8
- package/es/schema-initializer/items/CustomizeActionInitializer.js +12 -1
- package/es/schema-initializer/items/CustomizeBulkEditActionInitializer.js +2 -1
- package/es/schema-initializer/items/DataBlockInitializer.js +10 -4
- package/es/schema-initializer/items/InitializerWithSwitch.js +1 -1
- package/es/schema-initializer/items/KanbanBlockInitializer.js +7 -6
- package/es/schema-initializer/items/RecordReadPrettyFormBlockInitializer.js +6 -3
- package/es/schema-initializer/items/index.d.ts +5 -1
- package/es/schema-initializer/items/index.js +7 -2
- package/es/schema-initializer/style.less +1 -1
- package/es/schema-initializer/utils.d.ts +17 -1
- package/es/schema-initializer/utils.js +258 -84
- package/es/schema-settings/SchemaSettings.js +67 -24
- package/es/schema-templates/BlockTemplate.js +6 -2
- package/es/schema-templates/schemas/uiSchemaTemplates.js +63 -3
- package/es/user/ChangePassword.js +5 -1
- package/es/user/CurrentUser.js +2 -11
- package/es/user/EditProfile.js +16 -0
- package/es/user/SigninPage.d.ts +1 -0
- package/es/user/SigninPage.js +14 -6
- package/es/user/SigninPageExtension.d.ts +10 -0
- package/es/user/SigninPageExtension.js +37 -0
- package/es/user/index.d.ts +1 -0
- package/es/user/index.js +2 -1
- package/lib/acl/Configuration/MenuConfigure.js +129 -56
- package/lib/acl/Configuration/MenuItemsProvider.d.ts +3 -0
- package/lib/acl/Configuration/MenuItemsProvider.js +77 -0
- package/lib/acl/Configuration/RoleTable.d.ts +0 -1
- package/lib/acl/Configuration/RoleTable.js +9 -57
- package/lib/acl/Configuration/RolesResourcesActions.js +16 -14
- package/lib/acl/Configuration/schemas/roleCollections.js +3 -1
- package/lib/acl/Configuration/schemas/roles.js +1 -0
- package/lib/acl/Configuration/schemas/useRoleResourceValues.d.ts +1 -1
- package/lib/api-client/APIClient.js +34 -9
- package/lib/api-client/hooks/useRequest.d.ts +2 -2
- package/lib/api-client/index.d.ts +1 -0
- package/lib/api-client/index.js +13 -0
- package/lib/appInfo/CurrentAppInfoProvider.d.ts +4 -0
- package/lib/appInfo/CurrentAppInfoProvider.js +43 -0
- package/lib/appInfo/index.d.ts +1 -0
- package/lib/appInfo/index.js +18 -0
- package/lib/application/Application.js +3 -0
- package/lib/block-provider/BlockProvider.d.ts +3 -0
- package/lib/block-provider/BlockProvider.js +97 -5
- package/lib/block-provider/CalendarBlockProvider.js +3 -6
- package/lib/block-provider/FormBlockProvider.js +17 -1
- package/lib/block-provider/KanbanBlockProvider.js +9 -3
- package/lib/block-provider/SharedFilterProvider.d.ts +24 -0
- package/lib/block-provider/SharedFilterProvider.js +100 -0
- package/lib/block-provider/TableBlockProvider.js +11 -8
- package/lib/block-provider/TableSelectorProvider.js +109 -8
- package/lib/block-provider/hooks/index.js +1 -0
- package/lib/board/Board.js +3 -1
- package/lib/board/Column.js +43 -10
- package/lib/board/style.less +2 -1
- package/lib/collection-manager/CollectionField.d.ts +1 -0
- package/lib/collection-manager/CollectionField.js +39 -6
- package/lib/collection-manager/CollectionFieldProvider.d.ts +1 -0
- package/lib/collection-manager/CollectionFieldProvider.js +3 -2
- package/lib/collection-manager/CollectionHistoryProvider.d.ts +8 -0
- package/lib/collection-manager/CollectionHistoryProvider.js +107 -0
- package/lib/collection-manager/CollectionManagerProvider.js +62 -44
- package/lib/collection-manager/CollectionManagerShortcut.js +14 -2
- package/lib/collection-manager/Configuration/AddCollectionAction.d.ts +2 -0
- package/lib/collection-manager/Configuration/AddCollectionAction.js +418 -0
- package/lib/collection-manager/Configuration/AddFieldAction.js +84 -16
- package/lib/collection-manager/Configuration/AddSubFieldAction.js +19 -12
- package/lib/collection-manager/Configuration/CollectionFieldsTableArray.js +145 -77
- package/lib/collection-manager/Configuration/ConfigurationTable.js +36 -117
- package/lib/collection-manager/Configuration/EditCollectionAction.d.ts +19 -0
- package/lib/collection-manager/Configuration/EditCollectionAction.js +287 -0
- package/lib/collection-manager/Configuration/OverridingCollectionField.d.ts +2 -0
- package/lib/collection-manager/Configuration/OverridingCollectionField.js +329 -0
- package/lib/collection-manager/Configuration/ViewInheritedField.d.ts +2 -0
- package/lib/collection-manager/Configuration/ViewInheritedField.js +214 -0
- package/lib/collection-manager/Configuration/components/CollectionFieldInterface.d.ts +2 -0
- package/lib/collection-manager/Configuration/components/CollectionFieldInterface.js +31 -0
- package/lib/collection-manager/Configuration/components/CollectionTemplate.d.ts +2 -0
- package/lib/collection-manager/Configuration/components/CollectionTemplate.js +30 -0
- package/lib/collection-manager/Configuration/index.d.ts +6 -1
- package/lib/collection-manager/Configuration/index.js +73 -8
- package/lib/collection-manager/Configuration/interfaces.d.ts +17 -2
- package/lib/collection-manager/Configuration/interfaces.js +52 -28
- package/lib/collection-manager/Configuration/schemas/collectionFields.d.ts +1 -0
- package/lib/collection-manager/Configuration/schemas/collectionFields.js +40 -9
- package/lib/collection-manager/Configuration/schemas/collections.js +89 -104
- package/lib/collection-manager/Configuration/templates.d.ts +58 -0
- package/lib/collection-manager/Configuration/templates.js +46 -0
- package/lib/collection-manager/action-hooks.d.ts +20 -20
- package/lib/collection-manager/action-hooks.js +69 -130
- package/lib/collection-manager/hooks/useCollection.d.ts +4 -1
- package/lib/collection-manager/hooks/useCollection.js +24 -4
- package/lib/collection-manager/hooks/useCollectionManager.d.ts +9 -2
- package/lib/collection-manager/hooks/useCollectionManager.js +121 -10
- package/lib/collection-manager/hooks/useOptions.d.ts +5 -0
- package/lib/collection-manager/hooks/useOptions.js +65 -0
- package/lib/collection-manager/index.d.ts +7 -1
- package/lib/collection-manager/index.js +96 -10
- package/lib/collection-manager/interfaces/id.js +1 -1
- package/lib/collection-manager/interfaces/index.d.ts +0 -1
- package/lib/collection-manager/interfaces/index.js +0 -13
- package/lib/collection-manager/interfaces/integer.js +3 -3
- package/lib/collection-manager/interfaces/json.js +3 -3
- package/lib/collection-manager/interfaces/linkTo.js +14 -4
- package/lib/collection-manager/interfaces/m2m.js +19 -9
- package/lib/collection-manager/interfaces/m2o.js +27 -59
- package/lib/collection-manager/interfaces/o2m.js +58 -61
- package/lib/collection-manager/interfaces/o2o.js +55 -47
- package/lib/collection-manager/interfaces/properties/index.d.ts +1 -0
- package/lib/collection-manager/interfaces/properties/index.js +7 -0
- package/lib/collection-manager/sub-table.d.ts +1 -1
- package/lib/collection-manager/sub-table.js +1 -3
- package/lib/collection-manager/templates/calendar.d.ts +2 -0
- package/lib/collection-manager/templates/calendar.js +48 -0
- package/lib/collection-manager/templates/general.d.ts +2 -0
- package/lib/collection-manager/templates/general.js +20 -0
- package/lib/collection-manager/templates/index.d.ts +2 -0
- package/lib/collection-manager/templates/index.js +31 -0
- package/lib/collection-manager/templates/properties/index.d.ts +174 -0
- package/lib/collection-manager/templates/properties/index.js +151 -0
- package/lib/collection-manager/templates/treeCollection.d.ts +1 -0
- package/lib/collection-manager/templates/treeCollection.js +1 -0
- package/lib/collection-manager/templates/types.d.ts +44 -0
- package/lib/collection-manager/templates/types.js +5 -0
- package/lib/collection-manager/types.d.ts +2 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +13 -0
- package/lib/locale/en_US.d.ts +28 -89
- package/lib/locale/en_US.js +29 -90
- package/lib/locale/ja_JP.d.ts +17 -90
- package/lib/locale/ja_JP.js +17 -90
- package/lib/locale/ru_RU.d.ts +5 -89
- package/lib/locale/ru_RU.js +6 -90
- package/lib/locale/tr_TR.d.ts +5 -89
- package/lib/locale/tr_TR.js +6 -90
- package/lib/locale/zh_CN.d.ts +30 -125
- package/lib/locale/zh_CN.js +32 -128
- package/lib/pm/PluginManagerLink.js +3 -2
- package/lib/pm/index.js +31 -17
- package/lib/route-switch/antd/admin-layout/index.js +49 -22
- package/lib/schema-component/antd/action/Action.Designer.js +39 -3
- package/lib/schema-component/antd/action/Action.Drawer.js +7 -4
- package/lib/schema-component/antd/action/Action.Modal.js +9 -6
- package/lib/schema-component/antd/action/Action.js +3 -1
- package/lib/schema-component/antd/action/ActionBar.js +12 -3
- package/lib/schema-component/antd/action/context.d.ts +3 -0
- package/lib/schema-component/antd/action/hooks.d.ts +2 -0
- package/lib/schema-component/antd/association-filter/ActionBarAssociationFilterAction.d.ts +1 -0
- package/lib/schema-component/antd/association-filter/ActionBarAssociationFilterAction.js +74 -0
- package/lib/schema-component/antd/association-filter/AssociationFilter.Initializer.d.ts +1 -0
- package/lib/schema-component/antd/association-filter/AssociationFilter.Initializer.js +76 -0
- package/lib/schema-component/antd/association-filter/AssociationFilter.Item.Designer.d.ts +1 -0
- package/lib/schema-component/antd/association-filter/AssociationFilter.Item.Designer.js +121 -0
- package/lib/schema-component/antd/association-filter/AssociationFilter.Item.d.ts +1 -0
- package/lib/schema-component/antd/association-filter/AssociationFilter.Item.js +238 -0
- package/lib/schema-component/antd/association-filter/AssociationFilter.d.ts +9 -0
- package/lib/schema-component/antd/association-filter/AssociationFilter.js +63 -0
- package/lib/schema-component/antd/association-filter/AssociationFilterDesignerDelete.d.ts +1 -0
- package/lib/schema-component/antd/association-filter/AssociationFilterDesignerDelete.js +53 -0
- package/lib/schema-component/antd/association-filter/AssociationFilterDesignerDisplayField.d.ts +1 -0
- package/lib/schema-component/antd/association-filter/AssociationFilterDesignerDisplayField.js +44 -0
- package/lib/schema-component/antd/association-select/AssociationSelect.d.ts +12 -0
- package/lib/schema-component/antd/association-select/AssociationSelect.js +718 -0
- package/lib/schema-component/antd/association-select/ReadPretty.d.ts +2 -0
- package/lib/schema-component/antd/association-select/ReadPretty.js +33 -0
- package/lib/schema-component/antd/association-select/index.d.ts +1 -0
- package/lib/schema-component/antd/association-select/index.js +18 -0
- package/lib/schema-component/antd/association-select/useServiceOptions.d.ts +1 -0
- package/lib/schema-component/antd/association-select/useServiceOptions.js +38 -0
- package/lib/schema-component/antd/calendar/Calendar.d.ts +4 -0
- package/lib/schema-component/antd/calendar/Calendar.js +70 -59
- package/lib/schema-component/antd/calendar/DeleteEvent.js +13 -2
- package/lib/schema-component/antd/calendar/context.d.ts +2 -0
- package/lib/schema-component/antd/calendar/context.js +10 -2
- package/lib/schema-component/antd/calendar/utils.d.ts +1 -0
- package/lib/schema-component/antd/calendar/utils.js +8 -2
- package/lib/schema-component/antd/card-item/CardItem.js +20 -4
- package/lib/schema-component/antd/filter/Filter.Action.Designer.d.ts +1 -1
- package/lib/schema-component/antd/filter/FilterItem.js +1 -1
- package/lib/schema-component/antd/filter/FilterItems.js +1 -0
- package/lib/schema-component/antd/filter/useFilterActionProps.d.ts +0 -1
- package/lib/schema-component/antd/filter/useFilterActionProps.js +23 -26
- package/lib/schema-component/antd/form-item/FormItem.js +21 -29
- package/lib/schema-component/antd/formula-input/FormulaInput.js +9 -6
- package/lib/schema-component/antd/index.d.ts +2 -0
- package/lib/schema-component/antd/index.js +26 -0
- package/lib/schema-component/antd/input/index.d.ts +1 -0
- package/lib/schema-component/antd/input/index.js +13 -0
- package/lib/schema-component/antd/kanban/Kanban.Designer.js +4 -1
- package/lib/schema-component/antd/kanban/index.less +1 -1
- package/lib/schema-component/antd/menu/Menu.Designer.js +2 -0
- package/lib/schema-component/antd/menu/Menu.js +2 -1
- package/lib/schema-component/antd/menu/MenuItemInitializers/index.js +8 -8
- package/lib/schema-component/antd/page/FixedBlock.d.ts +14 -0
- package/lib/schema-component/antd/page/FixedBlock.js +156 -0
- package/lib/schema-component/antd/page/Page.js +204 -11
- package/lib/schema-component/antd/page/PageTabDesigner.d.ts +6 -0
- package/lib/schema-component/antd/page/PageTabDesigner.js +218 -0
- package/lib/schema-component/antd/page/index.d.ts +1 -0
- package/lib/schema-component/antd/page/index.js +13 -0
- package/lib/schema-component/antd/record-picker/ReadPrettyRecordPicker.js +20 -6
- package/lib/schema-component/antd/record-picker/index.d.ts +4 -0
- package/lib/schema-component/antd/record-picker/index.js +58 -0
- package/lib/schema-component/antd/remote-select/ReadPretty.d.ts +2 -0
- package/lib/schema-component/antd/remote-select/ReadPretty.js +77 -0
- package/lib/schema-component/antd/remote-select/RemoteSelect.d.ts +21 -0
- package/lib/schema-component/antd/remote-select/RemoteSelect.js +131 -0
- package/lib/schema-component/antd/remote-select/index.d.ts +1 -0
- package/lib/schema-component/antd/remote-select/index.js +18 -0
- package/lib/schema-component/antd/remote-select/shared.d.ts +1 -0
- package/lib/schema-component/antd/remote-select/shared.js +20 -0
- package/lib/schema-component/antd/select/ReadPretty.js +4 -1
- package/lib/schema-component/antd/select/Select.d.ts +5 -1
- package/lib/schema-component/antd/select/Select.js +39 -7
- package/lib/schema-component/antd/select/index.d.ts +1 -0
- package/lib/schema-component/antd/select/index.js +13 -0
- package/lib/schema-component/antd/select/shared.js +44 -19
- package/lib/schema-component/antd/table-v2/Table.Column.Decorator.js +3 -1
- package/lib/schema-component/antd/table-v2/Table.Column.Designer.js +32 -3
- package/lib/schema-component/antd/table-v2/Table.js +84 -24
- package/lib/schema-component/antd/table-v2/TableBlockDesigner.js +5 -2
- package/lib/schema-component/antd/table-v2/utils.d.ts +3 -0
- package/lib/schema-component/antd/table-v2/utils.js +20 -0
- package/lib/schema-component/antd/upload/ReadPretty.js +6 -5
- package/lib/schema-component/antd/upload/shared.d.ts +1 -0
- package/lib/schema-component/common/dnd-context/index.js +6 -0
- package/lib/schema-component/common/sortable-item/SortableItem.js +2 -1
- package/lib/schema-component/hooks/index.d.ts +2 -0
- package/lib/schema-component/hooks/index.js +26 -0
- package/lib/schema-component/hooks/useDesignable.js +1 -1
- package/lib/schema-component/hooks/useFieldComponentOptions.d.ts +4 -0
- package/lib/schema-component/hooks/useFieldComponentOptions.js +77 -0
- package/lib/schema-component/hooks/useFieldTitle.d.ts +1 -0
- package/lib/schema-component/hooks/useFieldTitle.js +36 -0
- package/lib/schema-initializer/SchemaInitializer.d.ts +1 -0
- package/lib/schema-initializer/SchemaInitializer.js +28 -6
- package/lib/schema-initializer/SchemaInitializerProvider.d.ts +1 -1
- package/lib/schema-initializer/SchemaInitializerProvider.js +20 -10
- package/lib/schema-initializer/SelectCollection.d.ts +5 -0
- package/lib/schema-initializer/SelectCollection.js +62 -0
- package/lib/schema-initializer/buttons/CalendarFormActionInitializers.d.ts +12 -0
- package/lib/schema-initializer/buttons/CalendarFormActionInitializers.js +2 -2
- package/lib/schema-initializer/buttons/CustomFormItemInitializers.js +23 -5
- package/lib/schema-initializer/buttons/FormItemInitializers.js +47 -29
- package/lib/schema-initializer/buttons/ReadPrettyFormActionInitializers.d.ts +12 -0
- package/lib/schema-initializer/buttons/ReadPrettyFormActionInitializers.js +2 -2
- package/lib/schema-initializer/buttons/ReadPrettyFormItemInitializers.js +49 -29
- package/lib/schema-initializer/buttons/RecordBlockInitializers.js +28 -2
- package/lib/schema-initializer/buttons/TabPaneInitializers.d.ts +2 -2
- package/lib/schema-initializer/buttons/TabPaneInitializers.js +22 -12
- package/lib/schema-initializer/buttons/TableActionColumnInitializers.js +54 -4
- package/lib/schema-initializer/buttons/TableActionInitializers.d.ts +31 -0
- package/lib/schema-initializer/buttons/TableActionInitializers.js +38 -9
- package/lib/schema-initializer/buttons/TableColumnInitializers.js +16 -0
- package/lib/schema-initializer/buttons/TableSelectorInitializers.js +6 -2
- package/lib/schema-initializer/buttons/index.d.ts +1 -0
- package/lib/schema-initializer/buttons/index.js +13 -0
- package/lib/schema-initializer/index.d.ts +2 -0
- package/lib/schema-initializer/index.js +36 -1
- package/lib/schema-initializer/items/BulkDestroyActionInitializer.js +12 -0
- package/lib/schema-initializer/items/CalendarBlockInitializer.js +8 -8
- package/lib/schema-initializer/items/CustomizeActionInitializer.js +13 -1
- package/lib/schema-initializer/items/CustomizeBulkEditActionInitializer.js +2 -1
- package/lib/schema-initializer/items/DataBlockInitializer.js +13 -3
- package/lib/schema-initializer/items/KanbanBlockInitializer.js +7 -6
- package/lib/schema-initializer/items/RecordReadPrettyFormBlockInitializer.js +6 -3
- package/lib/schema-initializer/items/index.d.ts +5 -1
- package/lib/schema-initializer/items/index.js +60 -8
- package/lib/schema-initializer/style.less +1 -1
- package/lib/schema-initializer/utils.d.ts +17 -1
- package/lib/schema-initializer/utils.js +272 -84
- package/lib/schema-settings/SchemaSettings.js +67 -24
- package/lib/schema-templates/BlockTemplate.js +7 -2
- package/lib/schema-templates/schemas/uiSchemaTemplates.js +62 -2
- package/lib/user/ChangePassword.js +5 -1
- package/lib/user/CurrentUser.js +3 -12
- package/lib/user/EditProfile.js +16 -0
- package/lib/user/SigninPage.d.ts +1 -0
- package/lib/user/SigninPage.js +15 -2
- package/lib/user/SigninPageExtension.d.ts +10 -0
- package/lib/user/SigninPageExtension.js +58 -0
- package/lib/user/index.d.ts +1 -0
- package/lib/user/index.js +13 -0
- package/package.json +7 -6
- package/es/collection-manager/interfaces/sequence.d.ts +0 -2
- package/es/collection-manager/interfaces/sequence.js +0 -435
- package/lib/collection-manager/interfaces/sequence.d.ts +0 -2
- package/lib/collection-manager/interfaces/sequence.js +0 -459
|
@@ -29,8 +29,8 @@ import React, { useState } from 'react';
|
|
|
29
29
|
import { useTranslation } from 'react-i18next';
|
|
30
30
|
import { useAPIClient, useRequest } from '../../api-client';
|
|
31
31
|
import { useRecord } from '../../record-provider';
|
|
32
|
-
import {
|
|
33
|
-
import { useMenuItems } from './
|
|
32
|
+
import { uniq } from 'lodash';
|
|
33
|
+
import { useMenuItems } from './MenuItemsProvider';
|
|
34
34
|
|
|
35
35
|
var findUids = function findUids(items) {
|
|
36
36
|
if (!Array.isArray(items)) {
|
|
@@ -57,11 +57,63 @@ var findUids = function findUids(items) {
|
|
|
57
57
|
return uids;
|
|
58
58
|
};
|
|
59
59
|
|
|
60
|
+
var getParentUids = function getParentUids(tree, func) {
|
|
61
|
+
var path = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
62
|
+
if (!tree) return [];
|
|
63
|
+
|
|
64
|
+
var _iterator2 = _createForOfIteratorHelper(tree),
|
|
65
|
+
_step2;
|
|
66
|
+
|
|
67
|
+
try {
|
|
68
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
69
|
+
var data = _step2.value;
|
|
70
|
+
path.push(data.uid);
|
|
71
|
+
if (func(data)) return path;
|
|
72
|
+
|
|
73
|
+
if (data.children) {
|
|
74
|
+
var findChildren = getParentUids(data.children, func, path);
|
|
75
|
+
if (findChildren.length) return findChildren;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
path.pop();
|
|
79
|
+
}
|
|
80
|
+
} catch (err) {
|
|
81
|
+
_iterator2.e(err);
|
|
82
|
+
} finally {
|
|
83
|
+
_iterator2.f();
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
return [];
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
var getChildrenUids = function getChildrenUids() {
|
|
90
|
+
var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
91
|
+
var arr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
92
|
+
|
|
93
|
+
var _iterator3 = _createForOfIteratorHelper(data),
|
|
94
|
+
_step3;
|
|
95
|
+
|
|
96
|
+
try {
|
|
97
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
98
|
+
var item = _step3.value;
|
|
99
|
+
arr.push(item.uid);
|
|
100
|
+
if (item.children && item.children.length) getChildrenUids(item.children, arr);
|
|
101
|
+
}
|
|
102
|
+
} catch (err) {
|
|
103
|
+
_iterator3.e(err);
|
|
104
|
+
} finally {
|
|
105
|
+
_iterator3.f();
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
return arr;
|
|
109
|
+
};
|
|
110
|
+
|
|
60
111
|
export var MenuConfigure = function MenuConfigure() {
|
|
61
112
|
var record = useRecord();
|
|
62
113
|
var api = useAPIClient();
|
|
63
|
-
|
|
64
|
-
var
|
|
114
|
+
|
|
115
|
+
var _useMenuItems = useMenuItems(),
|
|
116
|
+
items = _useMenuItems.items;
|
|
65
117
|
|
|
66
118
|
var _useTranslation = useTranslation(),
|
|
67
119
|
t = _useTranslation.t;
|
|
@@ -94,6 +146,65 @@ export var MenuConfigure = function MenuConfigure() {
|
|
|
94
146
|
|
|
95
147
|
var resource = api.resource('roles.menuUiSchemas', record.name);
|
|
96
148
|
var allChecked = allUids.length === uids.length;
|
|
149
|
+
|
|
150
|
+
var handleChange = /*#__PURE__*/function () {
|
|
151
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(checked, schema) {
|
|
152
|
+
var parentUids, childrenUids, totalUids, newUids, _totalUids;
|
|
153
|
+
|
|
154
|
+
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
155
|
+
while (1) {
|
|
156
|
+
switch (_context.prev = _context.next) {
|
|
157
|
+
case 0:
|
|
158
|
+
parentUids = getParentUids(items, function (data) {
|
|
159
|
+
return data.uid === schema.uid;
|
|
160
|
+
});
|
|
161
|
+
childrenUids = getChildrenUids(schema === null || schema === void 0 ? void 0 : schema.children, []);
|
|
162
|
+
|
|
163
|
+
if (!checked) {
|
|
164
|
+
_context.next = 10;
|
|
165
|
+
break;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
totalUids = childrenUids.concat(schema.uid);
|
|
169
|
+
newUids = uids.filter(function (v) {
|
|
170
|
+
return !totalUids.includes(v);
|
|
171
|
+
});
|
|
172
|
+
setUids(_toConsumableArray(newUids));
|
|
173
|
+
_context.next = 8;
|
|
174
|
+
return resource.remove({
|
|
175
|
+
values: totalUids
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
case 8:
|
|
179
|
+
_context.next = 14;
|
|
180
|
+
break;
|
|
181
|
+
|
|
182
|
+
case 10:
|
|
183
|
+
_totalUids = childrenUids.concat(parentUids);
|
|
184
|
+
setUids(function (prev) {
|
|
185
|
+
return uniq([].concat(_toConsumableArray(prev), _toConsumableArray(_totalUids)));
|
|
186
|
+
});
|
|
187
|
+
_context.next = 14;
|
|
188
|
+
return resource.add({
|
|
189
|
+
values: _totalUids
|
|
190
|
+
});
|
|
191
|
+
|
|
192
|
+
case 14:
|
|
193
|
+
message.success(t('Saved successfully'));
|
|
194
|
+
|
|
195
|
+
case 15:
|
|
196
|
+
case "end":
|
|
197
|
+
return _context.stop();
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}, _callee);
|
|
201
|
+
}));
|
|
202
|
+
|
|
203
|
+
return function handleChange(_x, _x2) {
|
|
204
|
+
return _ref.apply(this, arguments);
|
|
205
|
+
};
|
|
206
|
+
}();
|
|
207
|
+
|
|
97
208
|
return /*#__PURE__*/React.createElement(Table, {
|
|
98
209
|
loading: loading,
|
|
99
210
|
rowKey: 'uid',
|
|
@@ -109,27 +220,27 @@ export var MenuConfigure = function MenuConfigure() {
|
|
|
109
220
|
title: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Checkbox, {
|
|
110
221
|
checked: allChecked,
|
|
111
222
|
onChange: function () {
|
|
112
|
-
var _onChange = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function
|
|
113
|
-
return regeneratorRuntime.wrap(function
|
|
223
|
+
var _onChange = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(value) {
|
|
224
|
+
return regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
114
225
|
while (1) {
|
|
115
|
-
switch (
|
|
226
|
+
switch (_context2.prev = _context2.next) {
|
|
116
227
|
case 0:
|
|
117
228
|
if (!allChecked) {
|
|
118
|
-
|
|
229
|
+
_context2.next = 5;
|
|
119
230
|
break;
|
|
120
231
|
}
|
|
121
232
|
|
|
122
|
-
|
|
233
|
+
_context2.next = 3;
|
|
123
234
|
return resource.set({
|
|
124
235
|
values: []
|
|
125
236
|
});
|
|
126
237
|
|
|
127
238
|
case 3:
|
|
128
|
-
|
|
239
|
+
_context2.next = 7;
|
|
129
240
|
break;
|
|
130
241
|
|
|
131
242
|
case 5:
|
|
132
|
-
|
|
243
|
+
_context2.next = 7;
|
|
133
244
|
return resource.set({
|
|
134
245
|
values: allUids
|
|
135
246
|
});
|
|
@@ -140,64 +251,26 @@ export var MenuConfigure = function MenuConfigure() {
|
|
|
140
251
|
|
|
141
252
|
case 9:
|
|
142
253
|
case "end":
|
|
143
|
-
return
|
|
254
|
+
return _context2.stop();
|
|
144
255
|
}
|
|
145
256
|
}
|
|
146
|
-
},
|
|
257
|
+
}, _callee2);
|
|
147
258
|
}));
|
|
148
259
|
|
|
149
|
-
function onChange(
|
|
260
|
+
function onChange(_x3) {
|
|
150
261
|
return _onChange.apply(this, arguments);
|
|
151
262
|
}
|
|
152
263
|
|
|
153
264
|
return onChange;
|
|
154
265
|
}()
|
|
155
|
-
}),
|
|
266
|
+
}), t('Accessible')),
|
|
156
267
|
render: function render(_, schema) {
|
|
157
268
|
var checked = uids.includes(schema.uid);
|
|
158
269
|
return /*#__PURE__*/React.createElement(Checkbox, {
|
|
159
270
|
checked: checked,
|
|
160
|
-
onChange: function () {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
return regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
164
|
-
while (1) {
|
|
165
|
-
switch (_context2.prev = _context2.next) {
|
|
166
|
-
case 0:
|
|
167
|
-
if (checked) {
|
|
168
|
-
index = uids.indexOf(schema.uid);
|
|
169
|
-
uids.splice(index, 1);
|
|
170
|
-
setUids(_toConsumableArray(uids));
|
|
171
|
-
} else {
|
|
172
|
-
setUids(function (prev) {
|
|
173
|
-
return [].concat(_toConsumableArray(prev), [schema.uid]);
|
|
174
|
-
});
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
_context2.next = 3;
|
|
178
|
-
return resource.toggle({
|
|
179
|
-
values: {
|
|
180
|
-
tk: schema.uid
|
|
181
|
-
}
|
|
182
|
-
});
|
|
183
|
-
|
|
184
|
-
case 3:
|
|
185
|
-
message.success(t('Saved successfully'));
|
|
186
|
-
|
|
187
|
-
case 4:
|
|
188
|
-
case "end":
|
|
189
|
-
return _context2.stop();
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
}, _callee2);
|
|
193
|
-
}));
|
|
194
|
-
|
|
195
|
-
function onChange(_x2) {
|
|
196
|
-
return _onChange2.apply(this, arguments);
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
return onChange;
|
|
200
|
-
}()
|
|
271
|
+
onChange: function onChange() {
|
|
272
|
+
return handleChange(checked, schema);
|
|
273
|
+
}
|
|
201
274
|
});
|
|
202
275
|
}
|
|
203
276
|
}],
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Spin } from 'antd';
|
|
2
|
+
import React, { createContext, useContext } from 'react';
|
|
3
|
+
import { useRequest } from '../../api-client';
|
|
4
|
+
import { useRoute } from '../../route-switch';
|
|
5
|
+
var MenuItemsContext = /*#__PURE__*/createContext(null);
|
|
6
|
+
export var toItems = function toItems() {
|
|
7
|
+
var properties = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
8
|
+
var items = [];
|
|
9
|
+
|
|
10
|
+
for (var key in properties) {
|
|
11
|
+
if (Object.prototype.hasOwnProperty.call(properties, key)) {
|
|
12
|
+
var element = properties[key];
|
|
13
|
+
var item = {
|
|
14
|
+
title: element.title,
|
|
15
|
+
uid: element['x-uid']
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
if (element.properties) {
|
|
19
|
+
item['children'] = toItems(element.properties);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
items.push(item);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return items;
|
|
27
|
+
};
|
|
28
|
+
export var useMenuItems = function useMenuItems() {
|
|
29
|
+
return useContext(MenuItemsContext);
|
|
30
|
+
};
|
|
31
|
+
export var MenuItemsProvider = function MenuItemsProvider(props) {
|
|
32
|
+
var _service$data, _service$data$data;
|
|
33
|
+
|
|
34
|
+
var route = useRoute();
|
|
35
|
+
var options = {
|
|
36
|
+
url: "uiSchemas:getProperties/".concat(route.uiSchemaUid)
|
|
37
|
+
};
|
|
38
|
+
var service = useRequest(options);
|
|
39
|
+
|
|
40
|
+
if (service.loading) {
|
|
41
|
+
return /*#__PURE__*/React.createElement(Spin, null);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
var items = toItems((_service$data = service.data) === null || _service$data === void 0 ? void 0 : (_service$data$data = _service$data.data) === null || _service$data$data === void 0 ? void 0 : _service$data$data.properties);
|
|
45
|
+
return /*#__PURE__*/React.createElement(MenuItemsContext.Provider, {
|
|
46
|
+
value: {
|
|
47
|
+
service: service,
|
|
48
|
+
items: items
|
|
49
|
+
}
|
|
50
|
+
}, props.children);
|
|
51
|
+
};
|
|
@@ -1,35 +1,10 @@
|
|
|
1
1
|
import { Spin } from 'antd';
|
|
2
2
|
import React, { createContext, useContext } from 'react';
|
|
3
3
|
import { useRequest } from '../../api-client';
|
|
4
|
-
import { useRoute } from '../../route-switch';
|
|
5
4
|
import { SchemaComponent } from '../../schema-component';
|
|
6
5
|
import { roleSchema } from './schemas/roles';
|
|
7
|
-
|
|
8
|
-
var toItems = function toItems() {
|
|
9
|
-
var properties = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
10
|
-
var items = [];
|
|
11
|
-
|
|
12
|
-
for (var key in properties) {
|
|
13
|
-
if (Object.prototype.hasOwnProperty.call(properties, key)) {
|
|
14
|
-
var element = properties[key];
|
|
15
|
-
var item = {
|
|
16
|
-
title: element.title,
|
|
17
|
-
uid: element['x-uid']
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
if (element.properties) {
|
|
21
|
-
item['children'] = toItems(element.properties);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
items.push(item);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
return items;
|
|
29
|
-
};
|
|
30
|
-
|
|
6
|
+
import { MenuItemsProvider } from '../Configuration/MenuItemsProvider';
|
|
31
7
|
var AvailableActionsContext = /*#__PURE__*/createContext(null);
|
|
32
|
-
var MenuItemsContext = /*#__PURE__*/createContext(null);
|
|
33
8
|
|
|
34
9
|
var AvailableActionsProver = function AvailableActionsProver(props) {
|
|
35
10
|
var _useRequest = useRequest({
|
|
@@ -48,35 +23,14 @@ var AvailableActionsProver = function AvailableActionsProver(props) {
|
|
|
48
23
|
}, props.children);
|
|
49
24
|
};
|
|
50
25
|
|
|
51
|
-
var MenuItemsProver = function MenuItemsProver(props) {
|
|
52
|
-
var _data$data;
|
|
53
|
-
|
|
54
|
-
var route = useRoute();
|
|
55
|
-
|
|
56
|
-
var _useRequest2 = useRequest({
|
|
57
|
-
url: "uiSchemas:getProperties/".concat(route.uiSchemaUid)
|
|
58
|
-
}),
|
|
59
|
-
loading = _useRequest2.loading,
|
|
60
|
-
data = _useRequest2.data;
|
|
61
|
-
|
|
62
|
-
if (loading) {
|
|
63
|
-
return /*#__PURE__*/React.createElement(Spin, null);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
var items = toItems(data === null || data === void 0 ? void 0 : (_data$data = data.data) === null || _data$data === void 0 ? void 0 : _data$data.properties);
|
|
67
|
-
return /*#__PURE__*/React.createElement(MenuItemsContext.Provider, {
|
|
68
|
-
value: items
|
|
69
|
-
}, props.children);
|
|
70
|
-
};
|
|
71
|
-
|
|
72
26
|
export var useAvailableActions = function useAvailableActions() {
|
|
73
27
|
return useContext(AvailableActionsContext);
|
|
74
28
|
};
|
|
75
|
-
export var useMenuItems = function useMenuItems() {
|
|
76
|
-
return useContext(MenuItemsContext);
|
|
77
|
-
};
|
|
78
29
|
export var RoleTable = function RoleTable() {
|
|
79
|
-
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(AvailableActionsProver, null, /*#__PURE__*/React.createElement(
|
|
80
|
-
schema: roleSchema
|
|
81
|
-
|
|
30
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(AvailableActionsProver, null, /*#__PURE__*/React.createElement(SchemaComponent, {
|
|
31
|
+
schema: roleSchema,
|
|
32
|
+
components: {
|
|
33
|
+
MenuItemsProvider: MenuItemsProvider
|
|
34
|
+
}
|
|
35
|
+
})));
|
|
82
36
|
};
|
|
@@ -43,7 +43,7 @@ var toActionMap = function toActionMap(arr) {
|
|
|
43
43
|
|
|
44
44
|
export var RoleResourceCollectionContext = /*#__PURE__*/createContext({});
|
|
45
45
|
export var RolesResourcesActions = connect(function (props) {
|
|
46
|
-
var
|
|
46
|
+
var _collectionFields$fil;
|
|
47
47
|
|
|
48
48
|
// const { onChange } = props;
|
|
49
49
|
var _onChange = function onChange(values) {
|
|
@@ -60,9 +60,11 @@ export var RolesResourcesActions = connect(function (props) {
|
|
|
60
60
|
var availableActions = useAvailableActions();
|
|
61
61
|
|
|
62
62
|
var _useCollectionManager = useCollectionManager(),
|
|
63
|
-
getCollection = _useCollectionManager.getCollection
|
|
63
|
+
getCollection = _useCollectionManager.getCollection,
|
|
64
|
+
getCollectionFields = _useCollectionManager.getCollectionFields;
|
|
64
65
|
|
|
65
66
|
var collection = getCollection(roleCollection.name);
|
|
67
|
+
var collectionFields = getCollectionFields(roleCollection.name);
|
|
66
68
|
var compile = useCompile();
|
|
67
69
|
|
|
68
70
|
var _useTranslation = useTranslation(),
|
|
@@ -86,9 +88,9 @@ export var RolesResourcesActions = connect(function (props) {
|
|
|
86
88
|
var availableActionsWithFields = availableActions.filter(function (action) {
|
|
87
89
|
return action.allowConfigureFields;
|
|
88
90
|
});
|
|
89
|
-
var fieldPermissions =
|
|
91
|
+
var fieldPermissions = collectionFields === null || collectionFields === void 0 ? void 0 : (_collectionFields$fil = collectionFields.filter(function (field) {
|
|
90
92
|
return field.interface;
|
|
91
|
-
})) === null ||
|
|
93
|
+
})) === null || _collectionFields$fil === void 0 ? void 0 : _collectionFields$fil.map(function (field) {
|
|
92
94
|
var permission = _objectSpread({}, field);
|
|
93
95
|
|
|
94
96
|
var _iterator = _createForOfIteratorHelper(availableActionsWithFields),
|
|
@@ -112,13 +114,13 @@ export var RolesResourcesActions = connect(function (props) {
|
|
|
112
114
|
if (actionMap[actionName]) {
|
|
113
115
|
delete actionMap[actionName];
|
|
114
116
|
} else {
|
|
115
|
-
var
|
|
117
|
+
var _collectionFields$fil2, _collectionFields$fil3;
|
|
116
118
|
|
|
117
119
|
actionMap[actionName] = {
|
|
118
120
|
name: actionName,
|
|
119
|
-
fields:
|
|
121
|
+
fields: collectionFields === null || collectionFields === void 0 ? void 0 : (_collectionFields$fil2 = collectionFields.filter(function (field) {
|
|
120
122
|
return field.interface;
|
|
121
|
-
})) === null ||
|
|
123
|
+
})) === null || _collectionFields$fil2 === void 0 ? void 0 : (_collectionFields$fil3 = _collectionFields$fil2.map) === null || _collectionFields$fil3 === void 0 ? void 0 : _collectionFields$fil3.call(_collectionFields$fil2, function (item) {
|
|
122
124
|
return item.name;
|
|
123
125
|
})
|
|
124
126
|
};
|
|
@@ -145,12 +147,12 @@ export var RolesResourcesActions = connect(function (props) {
|
|
|
145
147
|
|
|
146
148
|
try {
|
|
147
149
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
148
|
-
var
|
|
150
|
+
var _collectionFields$fil4, _actionMap$action$nam, _actionMap$action$nam2;
|
|
149
151
|
|
|
150
152
|
var action = _step2.value;
|
|
151
|
-
allChecked[action.name] = (
|
|
153
|
+
allChecked[action.name] = (collectionFields === null || collectionFields === void 0 ? void 0 : (_collectionFields$fil4 = collectionFields.filter(function (field) {
|
|
152
154
|
return field.interface;
|
|
153
|
-
})) === null ||
|
|
155
|
+
})) === null || _collectionFields$fil4 === void 0 ? void 0 : _collectionFields$fil4.length) === (actionMap === null || actionMap === void 0 ? void 0 : (_actionMap$action$nam = actionMap[action.name]) === null || _actionMap$action$nam === void 0 ? void 0 : (_actionMap$action$nam2 = _actionMap$action$nam.fields) === null || _actionMap$action$nam2 === void 0 ? void 0 : _actionMap$action$nam2.length);
|
|
154
156
|
}
|
|
155
157
|
} catch (err) {
|
|
156
158
|
_iterator2.e(err);
|
|
@@ -185,7 +187,7 @@ export var RolesResourcesActions = connect(function (props) {
|
|
|
185
187
|
}
|
|
186
188
|
}, {
|
|
187
189
|
dataIndex: 'enabled',
|
|
188
|
-
title: t(
|
|
190
|
+
title: t('Allow'),
|
|
189
191
|
render: function render(enabled, action) {
|
|
190
192
|
return /*#__PURE__*/React.createElement(Checkbox, {
|
|
191
193
|
checked: enabled,
|
|
@@ -196,7 +198,7 @@ export var RolesResourcesActions = connect(function (props) {
|
|
|
196
198
|
}
|
|
197
199
|
}, {
|
|
198
200
|
dataIndex: 'scope',
|
|
199
|
-
title: t(
|
|
201
|
+
title: t('Data scope'),
|
|
200
202
|
render: function render(value, action) {
|
|
201
203
|
return !action.onNewRecord && /*#__PURE__*/React.createElement(ScopeSelect, {
|
|
202
204
|
value: value,
|
|
@@ -248,9 +250,9 @@ export var RolesResourcesActions = connect(function (props) {
|
|
|
248
250
|
if (checked) {
|
|
249
251
|
item.fields = [];
|
|
250
252
|
} else {
|
|
251
|
-
var
|
|
253
|
+
var _collectionFields$map;
|
|
252
254
|
|
|
253
|
-
item.fields =
|
|
255
|
+
item.fields = collectionFields === null || collectionFields === void 0 ? void 0 : (_collectionFields$map = collectionFields.map) === null || _collectionFields$map === void 0 ? void 0 : _collectionFields$map.call(collectionFields, function (item) {
|
|
254
256
|
return item.name;
|
|
255
257
|
});
|
|
256
258
|
}
|
|
@@ -27,6 +27,26 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
|
27
27
|
import { APIClient as APIClientSDK } from '@nocobase/sdk';
|
|
28
28
|
import { notification as _notification } from 'antd';
|
|
29
29
|
import React from 'react';
|
|
30
|
+
|
|
31
|
+
var handleErrorMessage = function handleErrorMessage(error) {
|
|
32
|
+
var _error$response;
|
|
33
|
+
|
|
34
|
+
var reader = new FileReader();
|
|
35
|
+
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');
|
|
36
|
+
|
|
37
|
+
reader.onload = function () {
|
|
38
|
+
var _JSON$parse$errors, _JSON$parse$errors$ma;
|
|
39
|
+
|
|
40
|
+
_notification.error({
|
|
41
|
+
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) {
|
|
42
|
+
return /*#__PURE__*/React.createElement('div', {
|
|
43
|
+
children: error.message
|
|
44
|
+
});
|
|
45
|
+
})
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
|
|
30
50
|
export var APIClient = /*#__PURE__*/function (_APIClientSDK) {
|
|
31
51
|
_inherits(APIClient, _APIClientSDK);
|
|
32
52
|
|
|
@@ -64,21 +84,27 @@ export var APIClient = /*#__PURE__*/function (_APIClientSDK) {
|
|
|
64
84
|
this.axios.interceptors.response.use(function (response) {
|
|
65
85
|
return response;
|
|
66
86
|
}, function (error) {
|
|
67
|
-
var _error$
|
|
87
|
+
var _error$response2, _error$response2$data;
|
|
68
88
|
|
|
69
|
-
var redirectTo = error === null || error === void 0 ? void 0 : (_error$
|
|
89
|
+
var redirectTo = error === null || error === void 0 ? void 0 : (_error$response2 = error.response) === null || _error$response2 === void 0 ? void 0 : (_error$response2$data = _error$response2.data) === null || _error$response2$data === void 0 ? void 0 : _error$response2$data.redirectTo;
|
|
70
90
|
|
|
71
91
|
if (redirectTo) {
|
|
72
92
|
return window.location.href = redirectTo;
|
|
73
93
|
}
|
|
74
94
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
95
|
+
if (error.response.data.type === 'application/json') {
|
|
96
|
+
handleErrorMessage(error);
|
|
97
|
+
} else {
|
|
98
|
+
var _error$response3, _error$response3$data, _error$response3$data2, _error$response3$data3;
|
|
99
|
+
|
|
100
|
+
_notification.error({
|
|
101
|
+
message: 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$data2 = _error$response3$data.errors) === null || _error$response3$data2 === void 0 ? void 0 : (_error$response3$data3 = _error$response3$data2.map) === null || _error$response3$data3 === void 0 ? void 0 : _error$response3$data3.call(_error$response3$data2, function (error) {
|
|
102
|
+
return /*#__PURE__*/React.createElement('div', {
|
|
103
|
+
children: error.message
|
|
104
|
+
});
|
|
105
|
+
})
|
|
106
|
+
});
|
|
107
|
+
}
|
|
82
108
|
|
|
83
109
|
throw error;
|
|
84
110
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Options } from 'ahooks/lib/useRequest/src/types';
|
|
2
2
|
import { AxiosRequestConfig } from 'axios';
|
|
3
3
|
declare type FunctionService = (...args: any[]) => Promise<any>;
|
|
4
|
-
declare type ResourceActionOptions<P = any> = {
|
|
4
|
+
export declare type ResourceActionOptions<P = any> = {
|
|
5
5
|
resource?: string;
|
|
6
6
|
resourceOf?: any;
|
|
7
7
|
action?: string;
|
|
@@ -11,7 +11,7 @@ export declare function useRequest<P>(service: AxiosRequestConfig<P> | ResourceA
|
|
|
11
11
|
uid?: string;
|
|
12
12
|
}): {
|
|
13
13
|
state: {};
|
|
14
|
-
setState: (
|
|
14
|
+
setState: import("ahooks/lib/useSetState").SetState<{}>;
|
|
15
15
|
loading: boolean;
|
|
16
16
|
data?: any;
|
|
17
17
|
error?: Error;
|
package/es/api-client/index.d.ts
CHANGED
package/es/api-client/index.js
CHANGED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React, { createContext, useContext } from 'react';
|
|
2
|
+
import { Spin } from 'antd';
|
|
3
|
+
import { useRequest } from '../api-client';
|
|
4
|
+
export var CurrentAppInfoContext = /*#__PURE__*/createContext(null);
|
|
5
|
+
export var useCurrentAppInfo = function useCurrentAppInfo() {
|
|
6
|
+
return useContext(CurrentAppInfoContext);
|
|
7
|
+
};
|
|
8
|
+
export var CurrentAppInfoProvider = function CurrentAppInfoProvider(props) {
|
|
9
|
+
var result = useRequest({
|
|
10
|
+
url: 'app:getInfo'
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
if (result.loading) {
|
|
14
|
+
return /*#__PURE__*/React.createElement(Spin, null);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
return /*#__PURE__*/React.createElement(CurrentAppInfoContext.Provider, {
|
|
18
|
+
value: result.data
|
|
19
|
+
}, props.children);
|
|
20
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './CurrentAppInfoProvider';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './CurrentAppInfoProvider';
|
|
@@ -55,6 +55,7 @@ import { SchemaInitializerProvider } from '../schema-initializer';
|
|
|
55
55
|
import { BlockTemplateDetails, BlockTemplatePage, SchemaTemplateShortcut } from '../schema-templates';
|
|
56
56
|
import { SystemSettingsProvider, SystemSettingsShortcut } from '../system-settings';
|
|
57
57
|
import { SigninPage, SignupPage } from '../user';
|
|
58
|
+
import { SigninPageExtensionProvider } from '../user/SigninPageExtension';
|
|
58
59
|
import { compose } from './compose';
|
|
59
60
|
export var getCurrentTimezone = function getCurrentTimezone() {
|
|
60
61
|
var timezoneOffset = new Date().getTimezoneOffset() / -60;
|
|
@@ -136,6 +137,7 @@ export var Application = /*#__PURE__*/function () {
|
|
|
136
137
|
});
|
|
137
138
|
this.use(BlockSchemaComponentProvider);
|
|
138
139
|
this.use(AntdSchemaComponentProvider);
|
|
140
|
+
this.use(SigninPageExtensionProvider);
|
|
139
141
|
this.use(ACLProvider);
|
|
140
142
|
this.use(RemoteDocumentTitleProvider);
|
|
141
143
|
this.use(PMProvider);
|