@tachybase/client 0.23.48 → 1.0.6
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/api-client/APIClient.d.ts +5 -2
- package/es/api-client/APIClient.mjs +93 -49
- package/es/api-client/hooks/useRequest.d.ts +2 -0
- package/es/application/Application.d.ts +6 -0
- package/es/application/Application.mjs +19 -0
- package/es/application/CustomRouterContextProvider.d.ts +54 -0
- package/es/application/CustomRouterContextProvider.mjs +209 -0
- package/es/application/RouterManager.d.ts +8 -3
- package/es/application/RouterManager.mjs +48 -15
- package/es/application/hooks/index.d.ts +1 -0
- package/es/application/hooks/index.mjs +1 -0
- package/es/application/hooks/useGlobalVariable.d.ts +1 -0
- package/es/application/hooks/useGlobalVariable.mjs +18 -0
- package/es/application/schema-initializer/context/index.d.ts +1 -1
- package/es/application/schema-settings/hooks/index.d.ts +1 -1
- package/es/application/schema-settings/hooks/index.mjs +6 -8
- package/es/block-provider/hooks/index.d.ts +2 -0
- package/es/block-provider/hooks/index.mjs +29 -22
- package/es/built-in/context-menu/ContextMenu.provider.mjs +6 -6
- package/es/built-in/context-menu/ContextMenuItemsProps.d.ts +4 -4
- package/es/built-in/context-menu/ContextMenuItemsProps.mjs +6 -6
- package/es/built-in/context-menu/index.mjs +1 -1
- package/es/built-in/context-menu/useContextMenu.d.ts +2 -2
- package/es/built-in/index.mjs +8 -0
- package/es/built-in/locale/LocalePlugin.mjs +5 -1
- package/es/built-in/page-style/PageStyle.provider.mjs +2 -2
- package/es/built-in/system-settings/SystemSettingsProvider.d.ts +2 -3
- package/es/built-in/system-settings/SystemSettingsProvider.mjs +4 -3
- package/es/built-in/system-settings/SystemSettingsShortcut.mjs +11 -8
- package/es/collection-manager/Configuration/AddCollectionAction.mjs +12 -2
- package/es/collection-manager/Configuration/ImportXlsx/ImportXlsxMetaAction.d.ts +2 -0
- package/es/collection-manager/Configuration/ImportXlsx/ImportXlsxMetaAction.mjs +255 -0
- package/es/collection-manager/Configuration/ImportXlsx/XlsxCollectionSchema.d.ts +89 -0
- package/es/collection-manager/Configuration/ImportXlsx/XlsxCollectionSchema.mjs +96 -0
- package/es/collection-manager/Configuration/ImportXlsx/XlsxEditFieldAction.d.ts +3 -0
- package/es/collection-manager/Configuration/ImportXlsx/XlsxEditFieldAction.mjs +47 -0
- package/es/collection-manager/Configuration/ImportXlsx/setUpdateXlsxCollectionField.d.ts +3 -0
- package/es/collection-manager/Configuration/ImportXlsx/setUpdateXlsxCollectionField.mjs +44 -0
- package/es/collection-manager/Configuration/ImportXlsx/xlsxFieldsConfigure.d.ts +1 -0
- package/es/collection-manager/Configuration/ImportXlsx/xlsxFieldsConfigure.mjs +380 -0
- package/es/collection-manager/Configuration/ImportXlsx/xlsxFormValueContextProvider.d.ts +8 -0
- package/es/collection-manager/Configuration/ImportXlsx/xlsxFormValueContextProvider.mjs +4 -0
- package/es/collection-manager/Configuration/ImportXlsx/xlsxImportAction.d.ts +1 -0
- package/es/collection-manager/Configuration/ImportXlsx/xlsxImportAction.mjs +187 -0
- package/es/collection-manager/Configuration/ImportXlsx/xlsxPreviewTable.d.ts +1 -0
- package/es/collection-manager/Configuration/ImportXlsx/xlsxPreviewTable.mjs +30 -0
- package/es/collection-manager/collectionPlugin.mjs +3 -1
- package/es/collection-manager/templates/import.mjs +1 -1
- package/es/collection-manager/templates/sql.d.ts +1 -1
- package/es/collection-manager/templates/view.d.ts +1 -1
- package/es/collection-manager/templates/xlsx.d.ts +11 -0
- package/es/collection-manager/templates/xlsx.mjs +19 -0
- package/es/data-source/collection-field-interface/CollectionFieldInterface.d.ts +1 -0
- package/es/data-source/collection-field-interface/CollectionFieldInterface.mjs +18 -0
- package/es/data-source/collection-field-interface/CollectionFieldInterfaceManager.d.ts +8 -1
- package/es/data-source/collection-field-interface/CollectionFieldInterfaceManager.mjs +20 -0
- package/es/data-source/commonsSettingsItem/fieldComponent.mjs +3 -1
- package/es/data-source/data-source/DataSource.d.ts +1 -1
- package/es/filter-provider/utils.mjs +6 -0
- package/es/i18n/i18n.mjs +7 -12
- package/es/modules/actions/delete/deleteActionSettings.mjs +10 -0
- package/es/modules/blocks/data-blocks/form/FilterItemCustomSettings.mjs +1 -1
- package/es/modules/blocks/data-blocks/form/fieldSettingsFormItem.mjs +9 -4
- package/es/modules/blocks/data-blocks/table/hooks/useTableBlockProps.mjs +6 -4
- package/es/modules/blocks/data-blocks/table/tableBlockSettings.mjs +4 -0
- package/es/modules/blocks/data-blocks/table/tableColumnSettings.mjs +44 -0
- package/es/modules/blocks/filter-blocks/collapse/filterCollapseItemFieldSettings.mjs +4 -0
- package/es/modules/blocks/filter-blocks/form/filterFormItemFieldSettings.mjs +9 -0
- package/es/modules/fields/component/Radio/radioComponentFieldSettings.mjs +0 -4
- package/es/modules/fields/component/SubTable/secondLevelSelect.d.ts +11 -0
- package/es/modules/fields/component/SubTable/secondLevelSelect.mjs +102 -0
- package/es/modules/fields/component/SubTable/subTablePopoverComponentFieldSettings.d.ts +79 -41
- package/es/modules/fields/component/SubTable/subTablePopoverComponentFieldSettings.mjs +103 -100
- package/es/powered-by/index.mjs +4 -7
- package/es/schema-component/antd/action/Action.Designer.mjs +43 -5
- package/es/schema-component/antd/action/Action.Modal.mjs +19 -31
- package/es/schema-component/antd/action/Action.Modal.style.d.ts +4 -0
- package/es/schema-component/antd/action/Action.Modal.style.mjs +35 -0
- package/es/schema-component/antd/action/Action.mjs +1 -3
- package/es/schema-component/antd/action/utils.d.ts +1 -1
- package/es/schema-component/antd/action/utils.mjs +70 -70
- package/es/schema-component/antd/association-field/SubTabs/InternalCollapse.mjs +2 -1
- package/es/schema-component/antd/checkbox/Checkbox.mjs +9 -2
- package/es/schema-component/antd/index.d.ts +1 -0
- package/es/schema-component/antd/index.mjs +1 -0
- package/es/schema-component/antd/media-card/MediaCard.d.ts +11 -0
- package/es/schema-component/antd/media-card/MediaCard.mjs +35 -0
- package/es/schema-component/antd/media-card/index.d.ts +1 -0
- package/es/schema-component/antd/media-card/index.mjs +1 -0
- package/es/schema-component/antd/media-card/style.d.ts +3 -0
- package/es/schema-component/antd/media-card/style.mjs +25 -0
- package/es/schema-component/antd/page/Page.d.ts +1 -5
- package/es/schema-component/antd/page/Page.mjs +235 -144
- package/es/schema-component/antd/page/Page.style.d.ts +5 -0
- package/es/schema-component/antd/page/Page.style.mjs +45 -0
- package/es/schema-component/antd/page/PageDesigner.d.ts +3 -0
- package/es/schema-component/antd/page/PageDesigner.mjs +28 -0
- package/es/schema-component/antd/page/PageTabDesigner.d.ts +0 -3
- package/es/schema-component/antd/page/PageTabDesigner.mjs +3 -50
- package/es/schema-component/antd/page/style.d.ts +1 -1
- package/es/schema-component/antd/page/style.mjs +3 -13
- package/es/schema-component/antd/password/Password.d.ts +1 -1
- package/es/schema-component/antd/password/utils.d.ts +1 -1
- package/es/schema-component/antd/scroll-area/ScrollArea.d.ts +1 -1
- package/es/schema-component/antd/scroll-area/ScrollArea.mjs +2 -1
- package/es/schema-component/antd/variable/TextArea.mjs +1 -1
- package/es/schema-component/antd/variable/TextAreaWithGlobalScope.d.ts +13 -0
- package/es/schema-component/antd/variable/TextAreaWithGlobalScope.mjs +59 -0
- package/es/schema-component/antd/variable/index.d.ts +1 -0
- package/es/schema-component/antd/variable/index.mjs +3 -0
- package/es/schema-component/common/dnd-context/index.mjs +1 -7
- package/es/schema-component/common/sortable-item/DragHandlePageTab.d.ts +1 -0
- package/es/schema-component/common/sortable-item/DragHandlePageTab.mjs +71 -0
- package/es/schema-component/common/sortable-item/DragHandlePageTab.style.d.ts +3 -0
- package/es/schema-component/common/sortable-item/DragHandlePageTab.style.mjs +25 -0
- package/es/schema-items/GeneralSettings.mjs +5 -0
- package/es/schema-settings/EditCustomDefaultValue.mjs +1 -1
- package/es/schema-settings/SchemaSettings.mjs +1 -1
- package/es/schema-settings/SchemaSettingsDefaultValue.mjs +2 -0
- package/es/schema-settings/utils/createModalSettingsItem.d.ts +26 -0
- package/es/schema-settings/utils/createModalSettingsItem.mjs +46 -0
- package/es/schema-settings/utils/createSelectSettingsItem.d.ts +25 -0
- package/es/schema-settings/utils/createSelectSettingsItem.mjs +40 -0
- package/es/schema-settings/utils/createSwitchSettingsItem.d.ts +21 -0
- package/es/schema-settings/utils/createSwitchSettingsItem.mjs +38 -0
- package/es/schema-settings/utils/createTextSettingsItem.d.ts +9 -0
- package/es/schema-settings/utils/createTextSettingsItem.mjs +21 -0
- package/es/schema-settings/utils/index.d.ts +4 -0
- package/es/schema-settings/utils/index.mjs +4 -0
- package/es/schema-settings/utils/util.d.ts +12 -0
- package/es/schema-settings/utils/util.mjs +24 -0
- package/es/user/CurrentUserProvider.mjs +6 -3
- package/lib/api-client/APIClient.js +93 -49
- package/lib/application/Application.js +19 -0
- package/lib/application/CustomRouterContextProvider.js +276 -0
- package/lib/application/RouterManager.js +49 -15
- package/lib/application/hooks/index.js +9 -0
- package/lib/application/hooks/useGlobalVariable.js +52 -0
- package/lib/application/schema-initializer/hooks/index.js +2 -2
- package/lib/application/schema-settings/hooks/index.js +6 -8
- package/lib/block-provider/hooks/index.js +80 -59
- package/lib/built-in/context-menu/ContextMenu.provider.js +6 -6
- package/lib/built-in/context-menu/ContextMenuItemsProps.js +6 -6
- package/lib/built-in/context-menu/index.js +1 -1
- package/lib/built-in/index.js +8 -0
- package/lib/built-in/locale/LocalePlugin.js +5 -1
- package/lib/built-in/page-style/PageStyle.provider.js +2 -2
- package/lib/built-in/system-settings/SystemSettingsProvider.js +4 -3
- package/lib/built-in/system-settings/SystemSettingsShortcut.js +11 -8
- package/lib/collection-manager/Configuration/AddCollectionAction.js +12 -2
- package/lib/collection-manager/Configuration/ImportXlsx/ImportXlsxMetaAction.js +304 -0
- package/lib/collection-manager/Configuration/ImportXlsx/XlsxCollectionSchema.js +130 -0
- package/lib/collection-manager/Configuration/ImportXlsx/XlsxEditFieldAction.js +81 -0
- package/lib/collection-manager/Configuration/ImportXlsx/setUpdateXlsxCollectionField.js +78 -0
- package/lib/collection-manager/Configuration/ImportXlsx/xlsxFieldsConfigure.js +414 -0
- package/lib/collection-manager/Configuration/ImportXlsx/xlsxFormValueContextProvider.js +53 -0
- package/lib/collection-manager/Configuration/ImportXlsx/xlsxImportAction.js +235 -0
- package/lib/collection-manager/Configuration/ImportXlsx/xlsxPreviewTable.js +64 -0
- package/lib/collection-manager/collectionPlugin.js +3 -1
- package/lib/collection-manager/templates/import.js +1 -1
- package/lib/collection-manager/templates/xlsx.js +53 -0
- package/lib/data-source/collection-field-interface/CollectionFieldInterface.js +18 -0
- package/lib/data-source/collection-field-interface/CollectionFieldInterfaceManager.js +20 -0
- package/lib/data-source/commonsSettingsItem/fieldComponent.js +3 -1
- package/lib/filter-provider/utils.js +6 -0
- package/lib/i18n/i18n.js +7 -12
- package/lib/locale/en_US.js +1 -0
- package/lib/locale/zh-CN.js +14 -2
- package/lib/modules/actions/delete/deleteActionSettings.js +10 -0
- package/lib/modules/blocks/data-blocks/form/FilterItemCustomSettings.js +1 -1
- package/lib/modules/blocks/data-blocks/form/fieldSettingsFormItem.js +9 -4
- package/lib/modules/blocks/data-blocks/table/hooks/useTableBlockProps.js +6 -4
- package/lib/modules/blocks/data-blocks/table/tableBlockSettings.js +4 -0
- package/lib/modules/blocks/data-blocks/table/tableColumnSettings.js +44 -0
- package/lib/modules/blocks/filter-blocks/collapse/filterCollapseItemFieldSettings.js +4 -0
- package/lib/modules/blocks/filter-blocks/form/filterFormItemFieldSettings.js +9 -0
- package/lib/modules/fields/component/Radio/radioComponentFieldSettings.js +0 -4
- package/lib/modules/fields/component/SubTable/secondLevelSelect.js +136 -0
- package/lib/modules/fields/component/SubTable/subTablePopoverComponentFieldSettings.js +104 -103
- package/lib/powered-by/index.js +4 -7
- package/lib/schema-component/antd/action/Action.Designer.js +43 -5
- package/lib/schema-component/antd/action/Action.Modal.js +19 -31
- package/lib/schema-component/antd/action/Action.Modal.style.js +69 -0
- package/lib/schema-component/antd/action/Action.js +1 -3
- package/lib/schema-component/antd/action/utils.js +70 -70
- package/lib/schema-component/antd/association-field/SubTabs/InternalCollapse.js +2 -1
- package/lib/schema-component/antd/checkbox/Checkbox.js +9 -2
- package/lib/schema-component/antd/index.js +18 -4
- package/lib/schema-component/antd/media-card/MediaCard.js +69 -0
- package/lib/schema-component/antd/media-card/index.js +65 -0
- package/lib/schema-component/antd/media-card/style.js +59 -0
- package/lib/schema-component/antd/page/Page.js +235 -144
- package/lib/schema-component/antd/page/Page.style.js +79 -0
- package/lib/schema-component/antd/page/PageDesigner.js +62 -0
- package/lib/schema-component/antd/page/PageTabDesigner.js +2 -50
- package/lib/schema-component/antd/page/style.js +3 -13
- package/lib/schema-component/antd/scroll-area/ScrollArea.js +2 -1
- package/lib/schema-component/antd/variable/TextArea.js +1 -1
- package/lib/schema-component/antd/variable/TextAreaWithGlobalScope.js +94 -0
- package/lib/schema-component/antd/variable/index.js +13 -1
- package/lib/schema-component/common/dnd-context/index.js +1 -7
- package/lib/schema-component/common/sortable-item/DragHandlePageTab.js +105 -0
- package/lib/schema-component/common/sortable-item/DragHandlePageTab.style.js +59 -0
- package/lib/schema-items/GeneralSettings.js +5 -0
- package/lib/schema-settings/EditCustomDefaultValue.js +1 -1
- package/lib/schema-settings/SchemaSettings.js +1 -1
- package/lib/schema-settings/SchemaSettingsDefaultValue.js +2 -0
- package/lib/schema-settings/utils/createModalSettingsItem.js +94 -0
- package/lib/schema-settings/utils/createSelectSettingsItem.js +88 -0
- package/lib/schema-settings/utils/createSwitchSettingsItem.js +86 -0
- package/lib/schema-settings/utils/createTextSettingsItem.js +55 -0
- package/lib/schema-settings/utils/index.js +92 -0
- package/lib/schema-settings/utils/util.js +74 -0
- package/lib/user/CurrentUserProvider.js +6 -3
- package/package.json +7 -7
|
@@ -2,7 +2,9 @@ import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__ from "react/jsx-runtim
|
|
|
2
2
|
import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
|
|
3
3
|
import * as __WEBPACK_EXTERNAL_MODULE_lodash__ from "lodash";
|
|
4
4
|
import * as __WEBPACK_EXTERNAL_MODULE_react_router_dom__ from "react-router-dom";
|
|
5
|
+
import * as __WEBPACK_EXTERNAL_MODULE__variables_VariablesProvider_mjs__ from "../variables/VariablesProvider.mjs";
|
|
5
6
|
import * as __WEBPACK_EXTERNAL_MODULE__components_index_mjs__ from "./components/index.mjs";
|
|
7
|
+
import * as __WEBPACK_EXTERNAL_MODULE__CustomRouterContextProvider_mjs__ from "./CustomRouterContextProvider.mjs";
|
|
6
8
|
function _define_property(obj, key, value) {
|
|
7
9
|
if (key in obj) Object.defineProperty(obj, key, {
|
|
8
10
|
value: value,
|
|
@@ -14,6 +16,15 @@ function _define_property(obj, key, value) {
|
|
|
14
16
|
return obj;
|
|
15
17
|
}
|
|
16
18
|
class RouterManager {
|
|
19
|
+
get basename() {
|
|
20
|
+
return this.router.basename;
|
|
21
|
+
}
|
|
22
|
+
get state() {
|
|
23
|
+
return this.router.state;
|
|
24
|
+
}
|
|
25
|
+
get navigate() {
|
|
26
|
+
return this.router.navigate;
|
|
27
|
+
}
|
|
17
28
|
getRoutesTree() {
|
|
18
29
|
const routes = {};
|
|
19
30
|
for (const [name, route] of Object.entries(this.routes))(0, __WEBPACK_EXTERNAL_MODULE_lodash__.set)(routes, name.split('.').join('.children.'), {
|
|
@@ -49,26 +60,46 @@ class RouterManager {
|
|
|
49
60
|
setBasename(basename) {
|
|
50
61
|
this.options.basename = basename;
|
|
51
62
|
}
|
|
52
|
-
getRouterComponent() {
|
|
63
|
+
getRouterComponent(children) {
|
|
53
64
|
const { type = 'browser', ...opts } = this.options;
|
|
54
|
-
const
|
|
55
|
-
hash: __WEBPACK_EXTERNAL_MODULE_react_router_dom__.
|
|
56
|
-
browser: __WEBPACK_EXTERNAL_MODULE_react_router_dom__.
|
|
57
|
-
memory: __WEBPACK_EXTERNAL_MODULE_react_router_dom__.
|
|
65
|
+
const routerCreators = {
|
|
66
|
+
hash: __WEBPACK_EXTERNAL_MODULE_react_router_dom__.createHashRouter,
|
|
67
|
+
browser: __WEBPACK_EXTERNAL_MODULE_react_router_dom__.createBrowserRouter,
|
|
68
|
+
memory: __WEBPACK_EXTERNAL_MODULE_react_router_dom__.createMemoryRouter
|
|
69
|
+
};
|
|
70
|
+
const routes = this.getRoutesTree();
|
|
71
|
+
const BaseLayoutContext = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react__.createContext)(null);
|
|
72
|
+
const Provider = ()=>{
|
|
73
|
+
const BaseLayout = (0, __WEBPACK_EXTERNAL_MODULE_react__.useContext)(BaseLayoutContext);
|
|
74
|
+
return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__CustomRouterContextProvider_mjs__.CustomRouterContextProvider, {
|
|
75
|
+
children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(BaseLayout, {
|
|
76
|
+
children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsxs)(__WEBPACK_EXTERNAL_MODULE__variables_VariablesProvider_mjs__["default"], {
|
|
77
|
+
children: [
|
|
78
|
+
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE_react_router_dom__.Outlet, {}),
|
|
79
|
+
children
|
|
80
|
+
]
|
|
81
|
+
})
|
|
82
|
+
})
|
|
83
|
+
});
|
|
58
84
|
};
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
const element = (0, __WEBPACK_EXTERNAL_MODULE_react_router_dom__.useRoutes)(routes);
|
|
63
|
-
return element;
|
|
85
|
+
const ErrorElement = ()=>{
|
|
86
|
+
const error = (0, __WEBPACK_EXTERNAL_MODULE_react_router_dom__.useRouteError)();
|
|
87
|
+
throw error;
|
|
64
88
|
};
|
|
89
|
+
this.router = routerCreators[type]([
|
|
90
|
+
{
|
|
91
|
+
element: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(Provider, {}),
|
|
92
|
+
errorElement: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(ErrorElement, {}),
|
|
93
|
+
children: routes
|
|
94
|
+
}
|
|
95
|
+
], opts);
|
|
65
96
|
const RenderRouter = (param)=>{
|
|
66
97
|
let { BaseLayout = __WEBPACK_EXTERNAL_MODULE__components_index_mjs__.BlankComponent } = param;
|
|
67
|
-
return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(
|
|
71
|
-
|
|
98
|
+
return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(BaseLayoutContext.Provider, {
|
|
99
|
+
value: BaseLayout,
|
|
100
|
+
children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__components_index_mjs__.RouterContextCleaner, {
|
|
101
|
+
children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE_react_router_dom__.RouterProvider, {
|
|
102
|
+
router: this.router
|
|
72
103
|
})
|
|
73
104
|
})
|
|
74
105
|
});
|
|
@@ -91,8 +122,10 @@ class RouterManager {
|
|
|
91
122
|
_define_property(this, "routes", {});
|
|
92
123
|
_define_property(this, "options", void 0);
|
|
93
124
|
_define_property(this, "app", void 0);
|
|
125
|
+
_define_property(this, "router", void 0);
|
|
94
126
|
this.options = options;
|
|
95
127
|
this.app = app;
|
|
128
|
+
this.routes = options.routes || {};
|
|
96
129
|
}
|
|
97
130
|
}
|
|
98
131
|
function createRouterManager(options, app) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useGlobalVariable: (key: string) => any;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
|
|
2
|
+
import * as __WEBPACK_EXTERNAL_MODULE_lodash__ from "lodash";
|
|
3
|
+
import * as __WEBPACK_EXTERNAL_MODULE__index_mjs__ from "./index.mjs";
|
|
4
|
+
const useGlobalVariable = (key)=>{
|
|
5
|
+
const app = (0, __WEBPACK_EXTERNAL_MODULE__index_mjs__.useApp)();
|
|
6
|
+
const variable = (0, __WEBPACK_EXTERNAL_MODULE_react__.useMemo)(()=>app.getGlobalVar(key), [
|
|
7
|
+
app,
|
|
8
|
+
key
|
|
9
|
+
]);
|
|
10
|
+
if ((0, __WEBPACK_EXTERNAL_MODULE_lodash__.isFunction)(variable)) try {
|
|
11
|
+
return variable();
|
|
12
|
+
} catch (error) {
|
|
13
|
+
console.error("Error calling global variable function for key: ".concat(key), error);
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
return variable;
|
|
17
|
+
};
|
|
18
|
+
export { useGlobalVariable };
|
|
@@ -12,5 +12,5 @@ export declare const useSchemaInitializer: () => {
|
|
|
12
12
|
visible: boolean;
|
|
13
13
|
setVisible: (v: boolean) => void;
|
|
14
14
|
};
|
|
15
|
-
export declare const SchemaInitializerItemContext: React.Context<Omit<SchemaInitializerItemType, "type" | "component" | "
|
|
15
|
+
export declare const SchemaInitializerItemContext: React.Context<Omit<SchemaInitializerItemType, "type" | "component" | "sort" | "componentProps" | "Component" | "useVisible" | "useChildren" | "hideIfNoChildren">>;
|
|
16
16
|
export declare const useSchemaInitializerItem: <T = any>() => T;
|
|
@@ -13,6 +13,6 @@ export declare function useSchemaSettingsRender<T = {}>(name: string, options?:
|
|
|
13
13
|
render: () => any;
|
|
14
14
|
} | {
|
|
15
15
|
exists: boolean;
|
|
16
|
-
render: (options2?: UseSchemaSettingsRenderOptions) => React.FunctionComponentElement<
|
|
16
|
+
render: (options2?: UseSchemaSettingsRenderOptions) => React.FunctionComponentElement<SchemaSettingOptions<any>>;
|
|
17
17
|
};
|
|
18
18
|
export {};
|
|
@@ -8,7 +8,6 @@ function useSchemaSettingsRender(name, options) {
|
|
|
8
8
|
app.schemaSettingsManager,
|
|
9
9
|
name
|
|
10
10
|
]);
|
|
11
|
-
const renderCache = __WEBPACK_EXTERNAL_MODULE_react__["default"].useRef({});
|
|
12
11
|
if (!name) return {
|
|
13
12
|
exists: false,
|
|
14
13
|
render: ()=>null
|
|
@@ -24,17 +23,16 @@ function useSchemaSettingsRender(name, options) {
|
|
|
24
23
|
exists: true,
|
|
25
24
|
render: function() {
|
|
26
25
|
let options2 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
|
|
27
|
-
const key = JSON.stringify(options2);
|
|
28
|
-
if (key && renderCache.current[key]) return renderCache.current[key];
|
|
29
26
|
const newItems = [
|
|
30
27
|
...__WEBPACK_EXTERNAL_MODULE__SchemaSettingsDefaults_mjs__.defaultSettingItems,
|
|
31
28
|
...schemaSetting.options.items
|
|
32
29
|
];
|
|
33
|
-
|
|
34
|
-
...
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
30
|
+
const newOptions = {
|
|
31
|
+
...schemaSetting.options,
|
|
32
|
+
items: newItems
|
|
33
|
+
};
|
|
34
|
+
return /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement(__WEBPACK_EXTERNAL_MODULE__components_index_mjs__.SchemaSettingsWrapper, {
|
|
35
|
+
...newOptions,
|
|
38
36
|
...options,
|
|
39
37
|
...options2
|
|
40
38
|
});
|
|
@@ -17,6 +17,8 @@ export declare const useInsertSchema: () => (ss: any) => void;
|
|
|
17
17
|
export declare const useCancelActionProps: () => {
|
|
18
18
|
onClick(): Promise<void>;
|
|
19
19
|
};
|
|
20
|
+
export declare function getAfterWorkflows(triggerWorkflows: any[]): string | undefined;
|
|
21
|
+
export declare function getBeforeWorkflows(triggerWorkflows: any[]): string | undefined;
|
|
20
22
|
export declare const useCreateActionProps: () => {
|
|
21
23
|
onClick(): Promise<void>;
|
|
22
24
|
};
|
|
@@ -196,6 +196,20 @@ const useJumpDetails = ()=>{
|
|
|
196
196
|
})));
|
|
197
197
|
};
|
|
198
198
|
};
|
|
199
|
+
function getAfterWorkflows(triggerWorkflows) {
|
|
200
|
+
if (!(null == triggerWorkflows ? void 0 : triggerWorkflows.length)) return;
|
|
201
|
+
return triggerWorkflows.filter((row)=>row && 'before' !== row.order).map((row)=>[
|
|
202
|
+
row.workflowKey,
|
|
203
|
+
row.context
|
|
204
|
+
].join('!')).join(',');
|
|
205
|
+
}
|
|
206
|
+
function getBeforeWorkflows(triggerWorkflows) {
|
|
207
|
+
if (!(null == triggerWorkflows ? void 0 : triggerWorkflows.length)) return;
|
|
208
|
+
return triggerWorkflows.filter((row)=>row && 'before' === row.order).map((row)=>[
|
|
209
|
+
row.workflowKey,
|
|
210
|
+
row.context
|
|
211
|
+
].join('!')).join(',');
|
|
212
|
+
}
|
|
199
213
|
const useCreateActionProps = ()=>{
|
|
200
214
|
var _actionField_componentProps_filterKeys;
|
|
201
215
|
const record = (0, __WEBPACK_EXTERNAL_MODULE__index_mjs__.useCollectionRecord)();
|
|
@@ -225,10 +239,8 @@ const useCreateActionProps = ()=>{
|
|
|
225
239
|
const data = await resource[action]({
|
|
226
240
|
values: await collectValues(),
|
|
227
241
|
filterKeys: filterKeys,
|
|
228
|
-
triggerWorkflows: (
|
|
229
|
-
|
|
230
|
-
row.context
|
|
231
|
-
].filter(Boolean).join('!')).join(',') : void 0,
|
|
242
|
+
triggerWorkflows: getAfterWorkflows(triggerWorkflows),
|
|
243
|
+
beforeWorkflows: getBeforeWorkflows(triggerWorkflows),
|
|
232
244
|
updateAssociationValues
|
|
233
245
|
});
|
|
234
246
|
actionField.data.loading = false;
|
|
@@ -336,10 +348,8 @@ const useAssociationCreateActionProps = ()=>{
|
|
|
336
348
|
...assignedValues
|
|
337
349
|
},
|
|
338
350
|
filterKeys: filterKeys,
|
|
339
|
-
triggerWorkflows: (
|
|
340
|
-
|
|
341
|
-
row.context
|
|
342
|
-
].filter(Boolean).join('!')).join(',') : void 0
|
|
351
|
+
triggerWorkflows: getAfterWorkflows(triggerWorkflows),
|
|
352
|
+
beforeWorkflows: getBeforeWorkflows(triggerWorkflows)
|
|
343
353
|
});
|
|
344
354
|
actionField.data.loading = false;
|
|
345
355
|
actionField.data.data = data;
|
|
@@ -447,6 +457,7 @@ const useResetBlockActionProps = ()=>{
|
|
|
447
457
|
const { targets, uid } = findFilterTargets(fieldSchema);
|
|
448
458
|
form.reset();
|
|
449
459
|
actionField.data.loading = true;
|
|
460
|
+
let prevMergedFilter = {};
|
|
450
461
|
try {
|
|
451
462
|
await Promise.all(getDataBlocks().map(async (block)=>{
|
|
452
463
|
var _block_service_params, _block_service_params_, _block_service_params1;
|
|
@@ -458,8 +469,10 @@ const useResetBlockActionProps = ()=>{
|
|
|
458
469
|
delete storedFilter[uid];
|
|
459
470
|
const mergedFilter = (0, __WEBPACK_EXTERNAL_MODULE__filter_provider_utils_mjs__.mergeFilter)([
|
|
460
471
|
...Object.values(storedFilter),
|
|
461
|
-
block.defaultFilter
|
|
472
|
+
block.defaultFilter,
|
|
473
|
+
prevMergedFilter
|
|
462
474
|
]);
|
|
475
|
+
prevMergedFilter = mergedFilter;
|
|
463
476
|
return block.doFilter({
|
|
464
477
|
...param,
|
|
465
478
|
page: 1,
|
|
@@ -511,10 +524,8 @@ const useCustomizeUpdateActionProps = ()=>{
|
|
|
511
524
|
values: {
|
|
512
525
|
...assignedValues
|
|
513
526
|
},
|
|
514
|
-
triggerWorkflows: (
|
|
515
|
-
|
|
516
|
-
row.context
|
|
517
|
-
].filter(Boolean).join('!')).join(',') : void 0
|
|
527
|
+
triggerWorkflows: getAfterWorkflows(triggerWorkflows),
|
|
528
|
+
beforeWorkflows: getBeforeWorkflows(triggerWorkflows)
|
|
518
529
|
});
|
|
519
530
|
null == service || null === (_service_refresh = service.refresh) || void 0 === _service_refresh || _service_refresh.call(service);
|
|
520
531
|
if (!(resource instanceof __WEBPACK_EXTERNAL_MODULE__TableFieldProvider_mjs__.TableFieldResource)) {
|
|
@@ -704,10 +715,8 @@ const useUpdateActionProps = ()=>{
|
|
|
704
715
|
values: isDeltaChanged ? filterValues(rawValues) : rawValues,
|
|
705
716
|
...data,
|
|
706
717
|
updateAssociationValues,
|
|
707
|
-
triggerWorkflows: (
|
|
708
|
-
|
|
709
|
-
row.context
|
|
710
|
-
].filter(Boolean).join('!')).join(',') : void 0
|
|
718
|
+
triggerWorkflows: getAfterWorkflows(triggerWorkflows),
|
|
719
|
+
beforeWorkflows: getBeforeWorkflows(triggerWorkflows)
|
|
711
720
|
});
|
|
712
721
|
actionField.data.loading = false;
|
|
713
722
|
null == __parent || null === (__parent_service = __parent.service) || void 0 === __parent_service || null === (__parent_service_refresh = __parent_service.refresh) || void 0 === __parent_service_refresh || __parent_service_refresh.call(__parent_service);
|
|
@@ -749,10 +758,8 @@ const useDestroyActionProps = ()=>{
|
|
|
749
758
|
const { triggerWorkflows } = null !== (_actionSchema_xactionsettings = null == actionSchema ? void 0 : actionSchema['x-action-settings']) && void 0 !== _actionSchema_xactionsettings ? _actionSchema_xactionsettings : {};
|
|
750
759
|
await resource.destroy({
|
|
751
760
|
filterByTk,
|
|
752
|
-
triggerWorkflows: (
|
|
753
|
-
|
|
754
|
-
row.context
|
|
755
|
-
].filter(Boolean).join('!')).join(',') : void 0,
|
|
761
|
+
triggerWorkflows: getAfterWorkflows(triggerWorkflows),
|
|
762
|
+
beforeWorkflows: getBeforeWorkflows(triggerWorkflows),
|
|
756
763
|
...data
|
|
757
764
|
});
|
|
758
765
|
const { count = 0, page = 0, pageSize = 0 } = (null == service ? void 0 : null === (_service_data = service.data) || void 0 === _service_data ? void 0 : _service_data.meta) || {};
|
|
@@ -1222,4 +1229,4 @@ async function resetFormCorrectly(form) {
|
|
|
1222
1229
|
});
|
|
1223
1230
|
await form.reset();
|
|
1224
1231
|
}
|
|
1225
|
-
export { findFilterTargets, getAssociationPath, getFormValues, updateFilterTargets, useAssociationCreateActionProps, useAssociationFilterBlockProps, useAssociationFilterProps, useAssociationNames, useBulkDestroyActionProps, useCancelActionProps, useCollectValuesToSubmit, useCreateActionProps, useCustomizeRequestActionProps, useCustomizeUpdateActionProps, useDestroyActionProps, useDetailPrintActionProps, useDetailsPaginationProps, useDisassociateActionProps, useFilterBlockActionProps, useInsertSchema, useOptionalFieldList, useRefreshActionProps, useRemoveActionProps, useResetBlockActionProps, useUpdateActionProps };
|
|
1232
|
+
export { findFilterTargets, getAfterWorkflows, getAssociationPath, getBeforeWorkflows, getFormValues, updateFilterTargets, useAssociationCreateActionProps, useAssociationFilterBlockProps, useAssociationFilterProps, useAssociationNames, useBulkDestroyActionProps, useCancelActionProps, useCollectValuesToSubmit, useCreateActionProps, useCustomizeRequestActionProps, useCustomizeUpdateActionProps, useDestroyActionProps, useDetailPrintActionProps, useDetailsPaginationProps, useDisassociateActionProps, useFilterBlockActionProps, useInsertSchema, useOptionalFieldList, useRefreshActionProps, useRemoveActionProps, useResetBlockActionProps, useUpdateActionProps };
|
|
@@ -8,7 +8,7 @@ import * as __WEBPACK_EXTERNAL_MODULE__schema_component_index_mjs__ from "../../
|
|
|
8
8
|
import * as __WEBPACK_EXTERNAL_MODULE__pinned_list_index_mjs__ from "../pinned-list/index.mjs";
|
|
9
9
|
import * as __WEBPACK_EXTERNAL_MODULE__useContextMenu_mjs__ from "./useContextMenu.mjs";
|
|
10
10
|
const STORAGE_KEYS = {
|
|
11
|
-
|
|
11
|
+
SHOW_SCROLL_AREA: 'show-scroll-area',
|
|
12
12
|
CONTEXT_MENU_ENABLED: 'context-menu-enabled'
|
|
13
13
|
};
|
|
14
14
|
const ContextMenuProvider = (param)=>{
|
|
@@ -16,7 +16,7 @@ const ContextMenuProvider = (param)=>{
|
|
|
16
16
|
const [enable, setEnable] = (0, __WEBPACK_EXTERNAL_MODULE_ahooks__.useLocalStorageState)(STORAGE_KEYS.CONTEXT_MENU_ENABLED, {
|
|
17
17
|
defaultValue: true
|
|
18
18
|
});
|
|
19
|
-
const [
|
|
19
|
+
const [showScrollArea, setShowScrollArea] = (0, __WEBPACK_EXTERNAL_MODULE_ahooks__.useLocalStorageState)(STORAGE_KEYS.SHOW_SCROLL_AREA, {
|
|
20
20
|
defaultValue: false
|
|
21
21
|
});
|
|
22
22
|
const contextItems = (0, __WEBPACK_EXTERNAL_MODULE__application_index_mjs__.useApp)().pluginContextMenu.get();
|
|
@@ -30,8 +30,8 @@ const ContextMenuProvider = (param)=>{
|
|
|
30
30
|
const { actionProps, title, icon } = item.useLoadMethod({
|
|
31
31
|
enable,
|
|
32
32
|
setEnable,
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
showScrollArea,
|
|
34
|
+
setShowScrollArea,
|
|
35
35
|
position
|
|
36
36
|
});
|
|
37
37
|
items.push({
|
|
@@ -45,8 +45,8 @@ const ContextMenuProvider = (param)=>{
|
|
|
45
45
|
value: {
|
|
46
46
|
contextMenuEnabled: enable,
|
|
47
47
|
setContextMenuEnable: setEnable,
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
showScrollArea,
|
|
49
|
+
setShowScrollArea,
|
|
50
50
|
position
|
|
51
51
|
},
|
|
52
52
|
children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE_antd__.Dropdown, {
|
|
@@ -31,12 +31,12 @@ export declare const disableRightMenu: {
|
|
|
31
31
|
};
|
|
32
32
|
};
|
|
33
33
|
};
|
|
34
|
-
export declare const
|
|
34
|
+
export declare const showScrollArea: {
|
|
35
35
|
name: string;
|
|
36
36
|
sort: number;
|
|
37
|
-
useLoadMethod: ({
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
useLoadMethod: ({ showScrollArea, setShowScrollArea }: {
|
|
38
|
+
showScrollArea: any;
|
|
39
|
+
setShowScrollArea: any;
|
|
40
40
|
}) => {
|
|
41
41
|
title: string;
|
|
42
42
|
actionProps: {
|
|
@@ -49,17 +49,17 @@ const disableRightMenu = {
|
|
|
49
49
|
};
|
|
50
50
|
}
|
|
51
51
|
};
|
|
52
|
-
const
|
|
53
|
-
name: '
|
|
52
|
+
const ContextMenuItemsProps_rslib_entry_showScrollArea = {
|
|
53
|
+
name: 'showScrollArea',
|
|
54
54
|
sort: 3,
|
|
55
55
|
useLoadMethod: (param)=>{
|
|
56
|
-
let {
|
|
56
|
+
let { showScrollArea, setShowScrollArea } = param;
|
|
57
57
|
const { t } = (0, __WEBPACK_EXTERNAL_MODULE_react_i18next__.useTranslation)();
|
|
58
58
|
return {
|
|
59
|
-
title:
|
|
59
|
+
title: showScrollArea ? t('Hidden scroll area') : t('Show scroll area'),
|
|
60
60
|
actionProps: {
|
|
61
61
|
onClick: ()=>{
|
|
62
|
-
|
|
62
|
+
setShowScrollArea(!showScrollArea);
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
};
|
|
@@ -143,4 +143,4 @@ const removeNode = (param)=>{
|
|
|
143
143
|
const autoPage = document.querySelector('.autoPage' + classId);
|
|
144
144
|
if (autoPage) autoPage.parentNode.removeChild(autoPage);
|
|
145
145
|
};
|
|
146
|
-
export { designerMode, disableRightMenu, fullScreen,
|
|
146
|
+
export { designerMode, disableRightMenu, fullScreen, ContextMenuItemsProps_rslib_entry_showScrollArea as showScrollArea };
|
|
@@ -11,7 +11,7 @@ class PluginContextMenu extends __WEBPACK_EXTERNAL_MODULE__application_Plugin_mj
|
|
|
11
11
|
this.app.pluginContextMenu.add(__WEBPACK_EXTERNAL_MODULE__ContextMenuItemsProps_mjs__.designerMode.name, __WEBPACK_EXTERNAL_MODULE__ContextMenuItemsProps_mjs__.designerMode);
|
|
12
12
|
this.app.pluginContextMenu.add(__WEBPACK_EXTERNAL_MODULE__ContextMenuItemsProps_mjs__.fullScreen.name, __WEBPACK_EXTERNAL_MODULE__ContextMenuItemsProps_mjs__.fullScreen);
|
|
13
13
|
this.app.pluginContextMenu.add(__WEBPACK_EXTERNAL_MODULE__ContextMenuItemsProps_mjs__.disableRightMenu.name, __WEBPACK_EXTERNAL_MODULE__ContextMenuItemsProps_mjs__.disableRightMenu);
|
|
14
|
-
this.app.pluginContextMenu.add(__WEBPACK_EXTERNAL_MODULE__ContextMenuItemsProps_mjs__.
|
|
14
|
+
this.app.pluginContextMenu.add(__WEBPACK_EXTERNAL_MODULE__ContextMenuItemsProps_mjs__.showScrollArea.name, __WEBPACK_EXTERNAL_MODULE__ContextMenuItemsProps_mjs__.showScrollArea);
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
var __webpack_exports__ContextMenuContext = __WEBPACK_EXTERNAL_MODULE__useContextMenu_mjs__.ContextMenuContext;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export interface ContextMenuContextProps {
|
|
2
2
|
contextMenuEnabled: boolean;
|
|
3
3
|
setContextMenuEnable: (enabled: boolean) => void;
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
showScrollArea: boolean;
|
|
5
|
+
setShowScrollArea: (isShow: boolean) => void;
|
|
6
6
|
position: any;
|
|
7
7
|
setPosition: (any: any) => void;
|
|
8
8
|
}
|
package/es/built-in/index.mjs
CHANGED
|
@@ -229,6 +229,9 @@ const getProps = (app)=>{
|
|
|
229
229
|
},
|
|
230
230
|
'pm.remove': {
|
|
231
231
|
title: 'Removing plugin'
|
|
232
|
+
},
|
|
233
|
+
refreshEventSource: {
|
|
234
|
+
title: 'Refreshing event source'
|
|
232
235
|
}
|
|
233
236
|
};
|
|
234
237
|
return {
|
|
@@ -311,6 +314,11 @@ class BuiltInPlugin extends __WEBPACK_EXTERNAL_MODULE__application_Plugin_mjs__.
|
|
|
311
314
|
icon: 'BlockOutlined',
|
|
312
315
|
sort: -30
|
|
313
316
|
});
|
|
317
|
+
this.app.systemSettingsManager.add('security', {
|
|
318
|
+
title: this.t('Security'),
|
|
319
|
+
icon: 'SafetyOutlined',
|
|
320
|
+
sort: -20
|
|
321
|
+
});
|
|
314
322
|
this.app.systemSettingsManager.add('system-services', {
|
|
315
323
|
title: this.t('System Services'),
|
|
316
324
|
icon: 'CloudServerOutlined',
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as __WEBPACK_EXTERNAL_MODULE__tachybase_schema__ from "@tachybase/schema";
|
|
2
2
|
import * as __WEBPACK_EXTERNAL_MODULE_antd__ from "antd";
|
|
3
3
|
import * as __WEBPACK_EXTERNAL_MODULE_dayjs__ from "dayjs";
|
|
4
|
-
import * as __WEBPACK_EXTERNAL_MODULE__loadConstrueLocale_mjs__ from "./loadConstrueLocale.mjs";
|
|
5
4
|
import * as __WEBPACK_EXTERNAL_MODULE__application_Plugin_mjs__ from "../../application/Plugin.mjs";
|
|
6
5
|
import * as __WEBPACK_EXTERNAL_MODULE__locale_index_mjs__ from "../../locale/index.mjs";
|
|
6
|
+
import * as __WEBPACK_EXTERNAL_MODULE__loadConstrueLocale_mjs__ from "./loadConstrueLocale.mjs";
|
|
7
7
|
function _define_property(obj, key, value) {
|
|
8
8
|
if (key in obj) Object.defineProperty(obj, key, {
|
|
9
9
|
value: value,
|
|
@@ -60,6 +60,10 @@ class LocalePlugin extends __WEBPACK_EXTERNAL_MODULE__application_Plugin_mjs__.P
|
|
|
60
60
|
__WEBPACK_EXTERNAL_MODULE_dayjs__["default"].updateLocale(dayjsLang, localeSetting);
|
|
61
61
|
window['cronLocale'] = null == data ? void 0 : null === (_data_data4 = data.data) || void 0 === _data_data4 ? void 0 : _data_data4.cron;
|
|
62
62
|
} catch (error) {
|
|
63
|
+
var _error_response;
|
|
64
|
+
if ((null == error ? void 0 : null === (_error_response = error.response) || void 0 === _error_response ? void 0 : _error_response.status) === 401) setTimeout(()=>{
|
|
65
|
+
window.location.href = '/signIn';
|
|
66
|
+
}, 1000);
|
|
63
67
|
throw error;
|
|
64
68
|
}
|
|
65
69
|
}
|
|
@@ -7,7 +7,7 @@ const PageStyleContext = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react__.cre
|
|
|
7
7
|
});
|
|
8
8
|
const PageStyleProvider = (param)=>{
|
|
9
9
|
let { children } = param;
|
|
10
|
-
var _currentUser_data_data_systemSettings;
|
|
10
|
+
var _currentUser_data_data_systemSettings, _currentUser_data_data, _currentUser_data;
|
|
11
11
|
const currentUser = (0, __WEBPACK_EXTERNAL_MODULE__user_index_mjs__.useCurrentUserContext)();
|
|
12
12
|
const tabItem = (0, __WEBPACK_EXTERNAL_MODULE__useTabSettings_mjs__.useTabSettings)();
|
|
13
13
|
const [items, setItems] = (0, __WEBPACK_EXTERNAL_MODULE_react__.useState)([]);
|
|
@@ -22,7 +22,7 @@ const PageStyleProvider = (param)=>{
|
|
|
22
22
|
]);
|
|
23
23
|
return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(PageStyleContext.Provider, {
|
|
24
24
|
value: {
|
|
25
|
-
style: (null === (
|
|
25
|
+
style: (null == currentUser ? void 0 : null === (_currentUser_data = currentUser.data) || void 0 === _currentUser_data ? void 0 : null === (_currentUser_data_data = _currentUser_data.data) || void 0 === _currentUser_data_data ? void 0 : null === (_currentUser_data_data_systemSettings = _currentUser_data_data.systemSettings) || void 0 === _currentUser_data_data_systemSettings ? void 0 : _currentUser_data_data_systemSettings.pageStyle) || 'classical',
|
|
26
26
|
items,
|
|
27
27
|
setItems
|
|
28
28
|
},
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
|
-
|
|
3
|
-
export declare const
|
|
4
|
-
export declare const useSystemSettings: () => Result<any, any>;
|
|
2
|
+
export declare const SystemSettingsContext: React.Context<any>;
|
|
3
|
+
export declare const useSystemSettings: () => any;
|
|
5
4
|
export declare const SystemSettingsProvider: React.FC<{
|
|
6
5
|
children?: ReactNode;
|
|
7
6
|
}>;
|
|
@@ -6,11 +6,12 @@ SystemSettingsContext.displayName = 'SystemSettingsContext';
|
|
|
6
6
|
const useSystemSettings = ()=>(0, __WEBPACK_EXTERNAL_MODULE_react__.useContext)(SystemSettingsContext);
|
|
7
7
|
const SystemSettingsProvider = (props)=>{
|
|
8
8
|
const result = (0, __WEBPACK_EXTERNAL_MODULE__api_client_index_mjs__.useRequest)({
|
|
9
|
-
url: 'systemSettings:get
|
|
9
|
+
url: 'systemSettings:get'
|
|
10
10
|
});
|
|
11
|
-
if (result.loading) return;
|
|
12
11
|
return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(SystemSettingsContext.Provider, {
|
|
13
|
-
value:
|
|
12
|
+
value: {
|
|
13
|
+
...result
|
|
14
|
+
},
|
|
14
15
|
children: props.children
|
|
15
16
|
});
|
|
16
17
|
};
|
|
@@ -23,18 +23,18 @@ const useCloseAction = ()=>{
|
|
|
23
23
|
const useSystemSettingsValues = (options)=>{
|
|
24
24
|
const { visible } = (0, __WEBPACK_EXTERNAL_MODULE__schema_component_index_mjs__.useActionContext)();
|
|
25
25
|
const result = (0, __WEBPACK_EXTERNAL_MODULE__index_mjs__.useSystemSettings)();
|
|
26
|
-
return (0, __WEBPACK_EXTERNAL_MODULE__index_mjs__.useRequest)(()=>Promise.resolve(result.data), {
|
|
26
|
+
return (0, __WEBPACK_EXTERNAL_MODULE__index_mjs__.useRequest)(()=>Promise.resolve(null == result ? void 0 : result.data), {
|
|
27
27
|
...options,
|
|
28
28
|
refreshDeps: [
|
|
29
|
-
visible
|
|
29
|
+
visible,
|
|
30
|
+
null == result ? void 0 : result.data
|
|
30
31
|
]
|
|
31
32
|
});
|
|
32
33
|
};
|
|
33
34
|
const useSaveSystemSettingsValues = ()=>{
|
|
34
35
|
const { setVisible } = (0, __WEBPACK_EXTERNAL_MODULE__schema_component_index_mjs__.useActionContext)();
|
|
35
36
|
const form = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useForm)();
|
|
36
|
-
const {
|
|
37
|
-
const { mutate, data } = (0, __WEBPACK_EXTERNAL_MODULE__index_mjs__.useSystemSettings)();
|
|
37
|
+
const { mutate, data } = (0, __WEBPACK_EXTERNAL_MODULE__index_mjs__.useSystemSettings)() || {};
|
|
38
38
|
const api = (0, __WEBPACK_EXTERNAL_MODULE__index_mjs__.useAPIClient)();
|
|
39
39
|
const { t } = (0, __WEBPACK_EXTERNAL_MODULE_react_i18next__.useTranslation)();
|
|
40
40
|
return {
|
|
@@ -49,11 +49,11 @@ const useSaveSystemSettingsValues = ()=>{
|
|
|
49
49
|
}
|
|
50
50
|
});
|
|
51
51
|
await api.request({
|
|
52
|
-
url: 'systemSettings:
|
|
52
|
+
url: 'systemSettings:put',
|
|
53
53
|
method: 'post',
|
|
54
54
|
data: values
|
|
55
55
|
});
|
|
56
|
-
message.success(t('Saved successfully'));
|
|
56
|
+
__WEBPACK_EXTERNAL_MODULE_antd__.message.success(t('Saved successfully'));
|
|
57
57
|
const lang = (null === (_values_enabledLanguages = values.enabledLanguages) || void 0 === _values_enabledLanguages ? void 0 : _values_enabledLanguages[0]) || 'en-US';
|
|
58
58
|
if (values.enabledLanguages.length < 2 && api.auth.getLocale() !== lang) {
|
|
59
59
|
api.auth.setLocale('');
|
|
@@ -74,11 +74,14 @@ const schema = {
|
|
|
74
74
|
type: 'void',
|
|
75
75
|
title: '{{t("System settings")}}',
|
|
76
76
|
properties: {
|
|
77
|
-
|
|
77
|
+
raw_title: {
|
|
78
78
|
type: 'string',
|
|
79
79
|
title: "{{t('System title')}}",
|
|
80
80
|
'x-decorator': 'FormItem',
|
|
81
|
-
'x-component': '
|
|
81
|
+
'x-component': 'TextAreaWithGlobalScope',
|
|
82
|
+
'x-component-props': {
|
|
83
|
+
supportsLineBreak: true
|
|
84
|
+
},
|
|
82
85
|
required: true
|
|
83
86
|
},
|
|
84
87
|
logo: {
|
|
@@ -15,6 +15,7 @@ import * as __WEBPACK_EXTERNAL_MODULE__ResourceActionProvider_mjs__ from "../Res
|
|
|
15
15
|
import * as __WEBPACK_EXTERNAL_MODULE__components_index_mjs__ from "./components/index.mjs";
|
|
16
16
|
import * as __WEBPACK_EXTERNAL_MODULE__components_TemplateSummary_mjs__ from "./components/TemplateSummary.mjs";
|
|
17
17
|
import * as __WEBPACK_EXTERNAL_MODULE__ImportCollectionMetaAction_mjs__ from "./ImportCollectionMetaAction.mjs";
|
|
18
|
+
import * as __WEBPACK_EXTERNAL_MODULE__ImportXlsx_ImportXlsxMetaAction_mjs__ from "./ImportXlsx/ImportXlsxMetaAction.mjs";
|
|
18
19
|
const getSchema = (schema, category, compile)=>{
|
|
19
20
|
if (!schema) return;
|
|
20
21
|
const properties = (0, __WEBPACK_EXTERNAL_MODULE_lodash__.cloneDeep)(schema.configurableProperties);
|
|
@@ -134,6 +135,7 @@ const AddCollectionAction = (props)=>{
|
|
|
134
135
|
const compile = (0, __WEBPACK_EXTERNAL_MODULE__schema_component_index_mjs__.useCompile)();
|
|
135
136
|
const { t } = (0, __WEBPACK_EXTERNAL_MODULE_react_i18next__.useTranslation)();
|
|
136
137
|
const importRef = (0, __WEBPACK_EXTERNAL_MODULE_react__.useRef)(null);
|
|
138
|
+
const importxlsxRef = (0, __WEBPACK_EXTERNAL_MODULE_react__.useRef)(null);
|
|
137
139
|
const items = (0, __WEBPACK_EXTERNAL_MODULE_react__.useMemo)(()=>{
|
|
138
140
|
const result = [];
|
|
139
141
|
collectionTemplates.forEach((item)=>{
|
|
@@ -158,10 +160,14 @@ const AddCollectionAction = (props)=>{
|
|
|
158
160
|
onClick: (info)=>{
|
|
159
161
|
if ('import' === info.key) {
|
|
160
162
|
var _importRef_current;
|
|
161
|
-
console.log('import', importRef.current);
|
|
162
163
|
null === (_importRef_current = importRef.current) || void 0 === _importRef_current || _importRef_current.showModal();
|
|
163
164
|
return;
|
|
164
165
|
}
|
|
166
|
+
if ('importXlsx' === info.key) {
|
|
167
|
+
var _importxlsxRef_current;
|
|
168
|
+
null === (_importxlsxRef_current = importxlsxRef.current) || void 0 === _importxlsxRef_current || _importxlsxRef_current.showModal();
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
165
171
|
const schema = getSchema(getTemplate(info.key), category, compile);
|
|
166
172
|
setSchema(schema);
|
|
167
173
|
setVisible(true);
|
|
@@ -170,7 +176,8 @@ const AddCollectionAction = (props)=>{
|
|
|
170
176
|
}), [
|
|
171
177
|
category,
|
|
172
178
|
items,
|
|
173
|
-
importRef
|
|
179
|
+
importRef,
|
|
180
|
+
importxlsxRef
|
|
174
181
|
]);
|
|
175
182
|
return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsxs)(__WEBPACK_EXTERNAL_MODULE__record_provider_index_mjs__.RecordProvider, {
|
|
176
183
|
record: record,
|
|
@@ -217,6 +224,9 @@ const AddCollectionAction = (props)=>{
|
|
|
217
224
|
}),
|
|
218
225
|
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__ImportCollectionMetaAction_mjs__.ImportCollectionMetaAction, {
|
|
219
226
|
ref: importRef
|
|
227
|
+
}),
|
|
228
|
+
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__ImportXlsx_ImportXlsxMetaAction_mjs__.ImportXlsxMetaAction, {
|
|
229
|
+
ref: importxlsxRef
|
|
220
230
|
})
|
|
221
231
|
]
|
|
222
232
|
});
|