@tachybase/client 1.3.17 → 1.3.18

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.
Files changed (111) hide show
  1. package/es/application/CustomRouterContextProvider.mjs +2 -1
  2. package/es/application/components/AppComponent.mjs +3 -1
  3. package/es/application/schema-initializer/hooks/index.d.ts +1 -1
  4. package/es/application/schema-initializer/hooks/index.mjs +2 -2
  5. package/es/block-provider/hooks/index.mjs +1 -1
  6. package/es/built-in/acl/Configuration/schemas/scopes.mjs +5 -4
  7. package/es/built-in/dynamic-page/DynamicPage.context.d.ts +0 -0
  8. package/es/built-in/dynamic-page/DynamicPage.context.mjs +0 -0
  9. package/es/built-in/dynamic-page/DynamicPage.mjs +33 -16
  10. package/es/built-in/dynamic-page/DynamicPage.style.d.ts +3 -0
  11. package/es/built-in/dynamic-page/DynamicPage.style.mjs +26 -0
  12. package/es/built-in/dynamic-page/PageNavBar.d.ts +3 -0
  13. package/es/built-in/dynamic-page/PageNavBar.mjs +47 -0
  14. package/es/built-in/dynamic-page/PageNavBar.style.d.ts +3 -0
  15. package/es/built-in/dynamic-page/PageNavBar.style.mjs +25 -0
  16. package/es/built-in/dynamic-page/utils.d.ts +2 -1
  17. package/es/built-in/dynamic-page/utils.mjs +3 -0
  18. package/es/built-in/locale/LocalePlugin.mjs +1 -1
  19. package/es/built-in/page-style/CustomAdminHeader.mjs +2 -2
  20. package/es/built-in/page-style/PageStyle.provider.d.ts +7 -2
  21. package/es/built-in/page-style/PageStyle.provider.mjs +8 -3
  22. package/es/built-in/page-style/TabContent.mjs +7 -5
  23. package/es/built-in/page-style/usePageStyle.d.ts +1 -1
  24. package/es/built-in/page-style/usePageStyle.mjs +1 -1
  25. package/es/built-in/page-style/useTabSettings.d.ts +4 -3
  26. package/es/built-in/page-style/useTabSettings.mjs +8 -7
  27. package/es/built-in/quick-access/PopupActionSchemaInitializerItem.mjs +2 -2
  28. package/es/modules/actions/add-child/CreateChildInitializer.mjs +2 -2
  29. package/es/modules/actions/add-new/CreateActionInitializer.mjs +2 -2
  30. package/es/modules/actions/add-record/CustomizeAddRecordActionInitializer.mjs +2 -2
  31. package/es/modules/actions/associate/AssociateActionInitializer.mjs +2 -1
  32. package/es/modules/actions/submit/createSubmitActionSettings.mjs +6 -3
  33. package/es/modules/actions/view-edit-popup/PopupActionInitializer.mjs +2 -2
  34. package/es/modules/actions/view-edit-popup/UpdateActionInitializer.mjs +2 -2
  35. package/es/modules/actions/view-edit-popup/ViewActionInitializer.mjs +2 -2
  36. package/es/modules/fields/component/DrawerSubTable/drawerSubTableComponentFieldSettings.mjs +2 -2
  37. package/es/modules/fields/component/Picker/recordPickerComponentFieldSettings.mjs +2 -2
  38. package/es/modules/fields/component/Select/selectComponentFieldSettings.mjs +2 -2
  39. package/es/schema-component/antd/action/Action.Container.mjs +26 -5
  40. package/es/schema-component/antd/action/Action.Designer.mjs +14 -3
  41. package/es/schema-component/antd/action/Action.Page.mjs +1 -1
  42. package/es/schema-component/antd/action/Action.mjs +56 -11
  43. package/es/schema-component/antd/action/context.d.ts +9 -1
  44. package/es/schema-component/antd/action/context.mjs +10 -1
  45. package/es/schema-component/antd/action/hooks.d.ts +2 -1
  46. package/es/schema-component/antd/action/hooks.mjs +2 -2
  47. package/es/schema-component/antd/association-field/FileManager.mjs +2 -2
  48. package/es/schema-component/antd/association-field/InternalDrawerSubTable.mjs +2 -2
  49. package/es/schema-component/antd/association-field/InternalPicker.mjs +2 -2
  50. package/es/schema-component/antd/association-field/InternalTag.mjs +2 -2
  51. package/es/schema-component/antd/association-field/InternalViewer.mjs +2 -2
  52. package/es/schema-component/antd/association-field/SubTable.mjs +2 -2
  53. package/es/schema-component/antd/form-item/FormItem.Settings.mjs +3 -2
  54. package/es/schema-component/antd/page/Page.mjs +27 -22
  55. package/es/schema-component/antd/record-picker/InputRecordPicker.mjs +2 -2
  56. package/es/schema-component/antd/record-picker/ReadPrettyRecordPicker.mjs +2 -2
  57. package/es/schema-initializer/items/SelectActionInitializer.mjs +2 -2
  58. package/es/schema-items/OpenModeSchemaItems.mjs +37 -16
  59. package/es/schema-templates/schemas/uiSchemaTemplates.mjs +1 -1
  60. package/es/user/ChangePassword.mjs +19 -4
  61. package/lib/application/CustomRouterContextProvider.js +2 -1
  62. package/lib/application/components/AppComponent.js +3 -1
  63. package/lib/application/schema-initializer/hooks/index.js +152 -193
  64. package/lib/block-provider/hooks/index.js +3 -3
  65. package/lib/built-in/acl/Configuration/schemas/scopes.js +4 -3
  66. package/lib/built-in/dynamic-page/DynamicPage.context.js +5 -0
  67. package/lib/built-in/dynamic-page/DynamicPage.js +31 -14
  68. package/lib/built-in/dynamic-page/DynamicPage.style.js +60 -0
  69. package/lib/built-in/dynamic-page/PageNavBar.js +81 -0
  70. package/lib/built-in/dynamic-page/PageNavBar.style.js +59 -0
  71. package/lib/built-in/dynamic-page/utils.js +3 -0
  72. package/lib/built-in/locale/LocalePlugin.js +1 -1
  73. package/lib/built-in/page-style/CustomAdminHeader.js +2 -2
  74. package/lib/built-in/page-style/PageStyle.provider.js +10 -2
  75. package/lib/built-in/page-style/TabContent.js +6 -4
  76. package/lib/built-in/page-style/usePageStyle.js +1 -1
  77. package/lib/built-in/page-style/useTabSettings.js +8 -7
  78. package/lib/built-in/quick-access/PopupActionSchemaInitializerItem.js +1 -1
  79. package/lib/locale/en_US.js +1 -0
  80. package/lib/modules/actions/add-child/CreateChildInitializer.js +2 -2
  81. package/lib/modules/actions/add-new/CreateActionInitializer.js +2 -2
  82. package/lib/modules/actions/add-record/CustomizeAddRecordActionInitializer.js +2 -2
  83. package/lib/modules/actions/associate/AssociateActionInitializer.js +2 -1
  84. package/lib/modules/actions/submit/createSubmitActionSettings.js +5 -2
  85. package/lib/modules/actions/view-edit-popup/PopupActionInitializer.js +2 -2
  86. package/lib/modules/actions/view-edit-popup/UpdateActionInitializer.js +2 -2
  87. package/lib/modules/actions/view-edit-popup/ViewActionInitializer.js +2 -2
  88. package/lib/modules/fields/component/DrawerSubTable/drawerSubTableComponentFieldSettings.js +1 -1
  89. package/lib/modules/fields/component/Picker/recordPickerComponentFieldSettings.js +1 -1
  90. package/lib/modules/fields/component/Select/selectComponentFieldSettings.js +1 -1
  91. package/lib/schema-component/antd/action/Action.Container.js +25 -4
  92. package/lib/schema-component/antd/action/Action.Designer.js +13 -2
  93. package/lib/schema-component/antd/action/Action.Page.js +1 -1
  94. package/lib/schema-component/antd/action/Action.js +55 -10
  95. package/lib/schema-component/antd/action/context.js +13 -1
  96. package/lib/schema-component/antd/action/hooks.js +1 -1
  97. package/lib/schema-component/antd/association-field/FileManager.js +1 -1
  98. package/lib/schema-component/antd/association-field/InternalDrawerSubTable.js +1 -1
  99. package/lib/schema-component/antd/association-field/InternalPicker.js +1 -1
  100. package/lib/schema-component/antd/association-field/InternalTag.js +1 -1
  101. package/lib/schema-component/antd/association-field/InternalViewer.js +1 -1
  102. package/lib/schema-component/antd/association-field/SubTable.js +1 -1
  103. package/lib/schema-component/antd/form-item/FormItem.Settings.js +3 -2
  104. package/lib/schema-component/antd/page/Page.js +26 -21
  105. package/lib/schema-component/antd/record-picker/InputRecordPicker.js +1 -1
  106. package/lib/schema-component/antd/record-picker/ReadPrettyRecordPicker.js +1 -1
  107. package/lib/schema-initializer/items/SelectActionInitializer.js +2 -2
  108. package/lib/schema-items/OpenModeSchemaItems.js +36 -15
  109. package/lib/schema-templates/schemas/uiSchemaTemplates.js +1 -1
  110. package/lib/user/ChangePassword.js +18 -3
  111. package/package.json +10 -11
@@ -2,6 +2,7 @@ import { jsx } from "react/jsx-runtime";
2
2
  import react, { useCallback, useEffect, useMemo, useRef, useState } from "react";
3
3
  import lodash from "lodash";
4
4
  import { useHref, useLocation, useMatch, useNavigate, useParams, useSearchParams } from "react-router-dom";
5
+ import { OpenMode } from "../schema-component/index.mjs";
5
6
  const NavigateNoUpdateContext = /*#__PURE__*/ react.createContext(null);
6
7
  NavigateNoUpdateContext.displayName = 'NavigateNoUpdateContext';
7
8
  const LocationNoUpdateContext = /*#__PURE__*/ react.createContext(null);
@@ -37,7 +38,7 @@ const IsSubPageClosedByPageMenuProvider = (param)=>{
37
38
  const [fieldSchema, setFieldSchema] = useState(null);
38
39
  const isSubPageClosedByPageMenu = useCallback(()=>{
39
40
  var _fieldSchema_xcomponentprops, _prevParamsRef_current_;
40
- const result = lodash.isEmpty(params['*']) && (null == fieldSchema ? void 0 : null == (_fieldSchema_xcomponentprops = fieldSchema['x-component-props']) ? void 0 : _fieldSchema_xcomponentprops.openMode) === 'page' && !!(null == (_prevParamsRef_current_ = prevParamsRef.current['*']) ? void 0 : _prevParamsRef_current_.includes(fieldSchema['x-uid']));
41
+ const result = lodash.isEmpty(params['*']) && (null == fieldSchema ? void 0 : null == (_fieldSchema_xcomponentprops = fieldSchema['x-component-props']) ? void 0 : _fieldSchema_xcomponentprops.openMode) === OpenMode.PAGE && !!(null == (_prevParamsRef_current_ = prevParamsRef.current['*']) ? void 0 : _prevParamsRef_current_.includes(fieldSchema['x-uid']));
41
42
  prevParamsRef.current = params;
42
43
  return result;
43
44
  }, [
@@ -46,7 +46,9 @@ const AppComponent = observer((props)=>{
46
46
  app.renderComponent('AppMain')
47
47
  ]
48
48
  }),
49
- /*#__PURE__*/ jsx(ClickToComponent, {})
49
+ /*#__PURE__*/ jsx(ClickToComponent, {
50
+ editor: process.env.REACT_APP_CLICK_TO_COMPONENT_EDITOR || 'vscode'
51
+ })
50
52
  ]
51
53
  });
52
54
  }, {
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { ButtonProps } from 'antd';
3
3
  import { SchemaInitializerOptions } from '../types';
4
- export * from './useAriaAttributeOfMenuItem';
4
+ export { useAriaAttributeOfMenuItem } from './useAriaAttributeOfMenuItem';
5
5
  /**
6
6
  * @internal
7
7
  */
@@ -4,7 +4,7 @@ import { useApp } from "../../hooks/index.mjs";
4
4
  import { SchemaInitializerChild, SchemaInitializerItems } from "../components/index.mjs";
5
5
  import { SchemaInitializerButton } from "../components/SchemaInitializerButton.mjs";
6
6
  import { withInitializer } from "../hoc/index.mjs";
7
- export * from "./useAriaAttributeOfMenuItem.mjs";
7
+ import { useAriaAttributeOfMenuItem } from "./useAriaAttributeOfMenuItem.mjs";
8
8
  function useSchemaInitializerMenuItems(items, name, onClick) {
9
9
  const getMenuItems = useGetSchemaInitializerMenuItems(onClick);
10
10
  return useMemo(()=>getMenuItems(items, name), [
@@ -150,4 +150,4 @@ function useSchemaInitializerRender(name, options) {
150
150
  ]);
151
151
  return res;
152
152
  }
153
- export { useGetSchemaInitializerMenuItems, useSchemaInitializerMenuItems, useSchemaInitializerRender };
153
+ export { useAriaAttributeOfMenuItem, useGetSchemaInitializerMenuItems, useSchemaInitializerMenuItems, useSchemaInitializerRender };
@@ -212,7 +212,7 @@ const useJumpDetails = ()=>{
212
212
  if (s['x-component'] === pageDetailsViewer) return s;
213
213
  return buf;
214
214
  });
215
- if (targetSchema) navigate("../".concat(targetSchema['x-uid'], "/").concat(PathHandler.getInstance().toWildcardPath({
215
+ if (targetSchema) navigate("./sub/".concat(targetSchema['x-uid'], "/").concat(PathHandler.getInstance().toWildcardPath({
216
216
  collection: collection.name,
217
217
  filterByTk
218
218
  })));
@@ -1,6 +1,6 @@
1
1
  import { useContext, useEffect } from "react";
2
2
  import { useFormBlockContext } from "../../../../block-provider/index.mjs";
3
- import { useFilterOptions } from "../../../../schema-component/index.mjs";
3
+ import { OpenMode, useFilterOptions } from "../../../../schema-component/index.mjs";
4
4
  import { VariableInput } from "../../../../schema-settings/VariableInput/VariableInput.mjs";
5
5
  import { RoleResourceCollectionContext } from "../RolesResourcesActions.mjs";
6
6
  const rolesResourcesScopesCollection = {
@@ -27,7 +27,8 @@ const useFormBlockProps = ()=>{
27
27
  resourceName: name
28
28
  });
29
29
  }, [
30
- name
30
+ name,
31
+ ctx.form
31
32
  ]);
32
33
  return {
33
34
  form: ctx.form
@@ -104,7 +105,7 @@ const scopesSchema = {
104
105
  'x-component': 'Action',
105
106
  'x-component-props': {
106
107
  icon: 'PlusOutlined',
107
- openMode: 'drawer',
108
+ openMode: OpenMode.DRAWER_MODE,
108
109
  type: 'primary'
109
110
  },
110
111
  properties: {
@@ -228,7 +229,7 @@ const scopesSchema = {
228
229
  'x-decorator': 'ACLActionProvider',
229
230
  'x-component': 'Action.Link',
230
231
  'x-component-props': {
231
- openMode: 'drawer',
232
+ openMode: OpenMode.DRAWER_MODE,
232
233
  icon: 'EditOutlined'
233
234
  },
234
235
  properties: {
@@ -1,36 +1,53 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import "react";
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { Card } from "antd";
3
3
  import { useParams } from "react-router-dom";
4
4
  import { AppNotFound } from "../index.mjs";
5
5
  import { DataBlockProvider } from "../../data-source/index.mjs";
6
- import { RecordContext_deprecated } from "../../record-provider/index.mjs";
6
+ import { RecordContext_deprecated, RecordProvider } from "../../record-provider/index.mjs";
7
7
  import { RemoteSchemaComponent } from "../../schema-component/index.mjs";
8
+ import { useStyles } from "./DynamicPage.style.mjs";
9
+ import { PageNavBar } from "./PageNavBar.mjs";
8
10
  import { PathHandler } from "./utils.mjs";
9
11
  const DynamicPage = ()=>{
12
+ const { styles } = useStyles();
10
13
  const params = useParams();
11
- if (!params['*']) return /*#__PURE__*/ jsx(RemoteSchemaComponent, {
14
+ const pathParams = PathHandler.getInstance().parse(params['*'], params.name);
15
+ if (!pathParams) return /*#__PURE__*/ jsx(RemoteSchemaComponent, {
12
16
  uid: params.name,
13
17
  onlyRenderProperties: true
14
18
  });
15
- {
16
- const path = PathHandler.getInstance().parse(params['*'], params.name);
17
- if (!path) return /*#__PURE__*/ jsx(AppNotFound, {});
18
- return /*#__PURE__*/ jsx(DataBlockProvider, {
19
+ if (!pathParams.sub || !pathParams.collection || !pathParams.filterByTk || !pathParams.schemaId) return /*#__PURE__*/ jsx(AppNotFound, {});
20
+ return /*#__PURE__*/ jsx("div", {
21
+ className: styles['dynamic-page'],
22
+ children: /*#__PURE__*/ jsx(DataBlockProvider, {
19
23
  params: {
20
- filterByTk: path.filterByTk
24
+ filterByTk: pathParams.filterByTk
21
25
  },
22
26
  action: "get",
23
- collection: path.collection,
27
+ collection: pathParams.collection,
24
28
  children: /*#__PURE__*/ jsx(RecordContext_deprecated.Provider, {
25
29
  value: {
26
- id: path.filterByTk
30
+ id: pathParams.filterByTk
27
31
  },
28
- children: /*#__PURE__*/ jsx(RemoteSchemaComponent, {
29
- uid: params.name,
30
- onlyRenderProperties: true
32
+ children: /*#__PURE__*/ jsxs(RecordProvider, {
33
+ record: {
34
+ id: pathParams.filterByTk
35
+ },
36
+ children: [
37
+ /*#__PURE__*/ jsx(PageNavBar, {
38
+ uid: pathParams.sub
39
+ }),
40
+ /*#__PURE__*/ jsx(Card, {
41
+ className: "page-content",
42
+ children: /*#__PURE__*/ jsx(RemoteSchemaComponent, {
43
+ uid: pathParams.sub,
44
+ onlyRenderProperties: true
45
+ })
46
+ })
47
+ ]
31
48
  })
32
49
  })
33
- });
34
- }
50
+ })
51
+ });
35
52
  };
36
53
  export { DynamicPage };
@@ -0,0 +1,3 @@
1
+ export declare const useStyles: (props?: unknown) => import("antd-style").ReturnStyles<{
2
+ 'dynamic-page': import("antd-style").SerializedStyles;
3
+ }>;
@@ -0,0 +1,26 @@
1
+ import { createStyles } from "antd-style";
2
+ function _tagged_template_literal(strings, raw) {
3
+ if (!raw) raw = strings.slice(0);
4
+ return Object.freeze(Object.defineProperties(strings, {
5
+ raw: {
6
+ value: Object.freeze(raw)
7
+ }
8
+ }));
9
+ }
10
+ function _templateObject() {
11
+ const data = _tagged_template_literal([
12
+ "\n display: flex;\n flex-direction: column;\n /* height: 100vh; */\n .page-content {\n /* height: 90%; */\n margin: ",
13
+ "px;\n overflow: hidden;\n\n .ant-card-body {\n position: relative;\n height: 90vh;\n overflow: hidden;\n .ant-formily-layout {\n height: 100%;\n .ant-tb-grid {\n height: 70vh;\n overflow-x: hidden;\n overflow-y: scroll;\n margin-bottom: 200px;\n }\n }\n }\n }\n "
14
+ ]);
15
+ _templateObject = function() {
16
+ return data;
17
+ };
18
+ return data;
19
+ }
20
+ const useStyles = createStyles((param)=>{
21
+ let { css, token } = param;
22
+ return {
23
+ 'dynamic-page': css(_templateObject(), token.paddingContentHorizontal)
24
+ };
25
+ });
26
+ export { useStyles };
@@ -0,0 +1,3 @@
1
+ export declare const PageNavBar: ({ uid }: {
2
+ uid: string;
3
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,47 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { useMemo } from "react";
3
+ import { ArrowLeftOutlined } from "@ant-design/icons";
4
+ import { Typography } from "antd";
5
+ import { useNavigate } from "react-router-dom";
6
+ import { useRequest } from "../../api-client/index.mjs";
7
+ import { useCompile } from "../../schema-component/index.mjs";
8
+ import { useDocumentTitle } from "../document-title/index.mjs";
9
+ import { useStyles } from "./PageNavBar.style.mjs";
10
+ const { Title } = Typography;
11
+ const PageNavBar = (param)=>{
12
+ let { uid } = param;
13
+ var _data_data;
14
+ const compile = useCompile();
15
+ const navigate = useNavigate();
16
+ const { data } = useRequest({
17
+ url: "/uiSchemas:getJsonSchema/".concat(uid)
18
+ });
19
+ const currentTitle = null == data ? void 0 : null == (_data_data = data.data) ? void 0 : _data_data.title;
20
+ const { styles } = useStyles();
21
+ const { title: documentTitle } = useDocumentTitle();
22
+ const title = useMemo(()=>compile(currentTitle || documentTitle), [
23
+ currentTitle,
24
+ documentTitle
25
+ ]);
26
+ const handleBack = ()=>{
27
+ navigate(-1);
28
+ };
29
+ return /*#__PURE__*/ jsx("div", {
30
+ className: styles['page-nav-bar'],
31
+ children: /*#__PURE__*/ jsxs("div", {
32
+ className: "nav-title",
33
+ onClick: handleBack,
34
+ children: [
35
+ /*#__PURE__*/ jsx(ArrowLeftOutlined, {}),
36
+ /*#__PURE__*/ jsx(Title, {
37
+ level: 4,
38
+ style: {
39
+ margin: 0
40
+ },
41
+ children: title
42
+ })
43
+ ]
44
+ })
45
+ });
46
+ };
47
+ export { PageNavBar };
@@ -0,0 +1,3 @@
1
+ export declare const useStyles: (props?: unknown) => import("antd-style").ReturnStyles<{
2
+ 'page-nav-bar': import("antd-style").SerializedStyles;
3
+ }>;
@@ -0,0 +1,25 @@
1
+ import { createStyles } from "antd-style";
2
+ function _tagged_template_literal(strings, raw) {
3
+ if (!raw) raw = strings.slice(0);
4
+ return Object.freeze(Object.defineProperties(strings, {
5
+ raw: {
6
+ value: Object.freeze(raw)
7
+ }
8
+ }));
9
+ }
10
+ function _templateObject() {
11
+ const data = _tagged_template_literal([
12
+ "\n position: sticky;\n top: 0;\n z-index: 1000;\n background: #fff;\n padding: 16px 24px;\n border-bottom: 1px solid #f0f0f0;\n\n .nav-title {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: 12px;\n font-size: 16px;\n color: #000;\n cursor: pointer;\n }\n "
13
+ ]);
14
+ _templateObject = function() {
15
+ return data;
16
+ };
17
+ return data;
18
+ }
19
+ const useStyles = createStyles((param)=>{
20
+ let { css } = param;
21
+ return {
22
+ 'page-nav-bar': css(_templateObject())
23
+ };
24
+ });
25
+ export { useStyles };
@@ -1,11 +1,12 @@
1
1
  interface PathParams {
2
2
  schemaId: string;
3
+ sub?: string;
3
4
  collection?: string;
4
5
  filterByTk?: string;
5
6
  sourceId?: string;
6
7
  tab?: string;
7
8
  }
8
- interface ParsedPath extends PathParams {
9
+ export interface ParsedPath extends PathParams {
9
10
  }
10
11
  export declare class PathHandler {
11
12
  private static instance;
@@ -26,6 +26,9 @@ class PathHandler {
26
26
  if (!value) continue;
27
27
  let validKey = true;
28
28
  switch(key){
29
+ case 'sub':
30
+ result.sub = value;
31
+ break;
29
32
  case 'collection':
30
33
  result.collection = value;
31
34
  break;
@@ -50,7 +50,7 @@ class LocalePlugin extends Plugin {
50
50
  setValidateLanguage(null == data ? void 0 : null == (_data_data2 = data.data) ? void 0 : _data_data2.lang);
51
51
  loadConstrueLocale(null == data ? void 0 : data.data);
52
52
  const dayjsLang = dayjsLocale[null == data ? void 0 : null == (_data_data3 = data.data) ? void 0 : _data_data3.lang] || 'en';
53
- await import("dayjs/locale/".concat(dayjsLang));
53
+ await import("dayjs/locale/".concat(dayjsLang, ".js"));
54
54
  dayjs.locale(dayjsLang);
55
55
  const updateLocale = await import("dayjs/plugin/updateLocale");
56
56
  dayjs.extend(updateLocale.default);
@@ -1,9 +1,9 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import "react";
2
+ import { PageStyle } from "./PageStyle.provider.mjs";
3
3
  import { TabHeader } from "./TabHeader.mjs";
4
4
  import { usePageStyle } from "./usePageStyle.mjs";
5
5
  const CustomAdminHeader = ()=>{
6
6
  const pageStyle = usePageStyle();
7
- return 'tab' === pageStyle ? /*#__PURE__*/ jsx(TabHeader, {}) : null;
7
+ return pageStyle === PageStyle.TAB_STYLE ? /*#__PURE__*/ jsx(TabHeader, {}) : null;
8
8
  };
9
9
  export { CustomAdminHeader };
@@ -1,7 +1,11 @@
1
1
  import React from 'react';
2
2
  import { TabsProps } from 'antd';
3
- export interface PageStyleContextValue {
4
- style: string;
3
+ export declare enum PageStyle {
4
+ CLASSICAL = "classical",
5
+ TAB_STYLE = "tab-style"
6
+ }
7
+ interface PageStyleContextValue {
8
+ pageStyle: PageStyle;
5
9
  items: TabsProps['items'];
6
10
  setItems: React.Dispatch<React.SetStateAction<TabsProps['items']>>;
7
11
  }
@@ -9,3 +13,4 @@ export declare const PageStyleContext: React.Context<Partial<PageStyleContextVal
9
13
  export declare const PageStyleProvider: ({ children }: {
10
14
  children: any;
11
15
  }) => import("react/jsx-runtime").JSX.Element;
16
+ export {};
@@ -2,8 +2,13 @@ import { jsx } from "react/jsx-runtime";
2
2
  import { createContext, useEffect, useState } from "react";
3
3
  import { useCurrentUserContext, useCurrentUserSettingsMenu } from "../../user/index.mjs";
4
4
  import { useTabSettings } from "./useTabSettings.mjs";
5
+ var PageStyle_provider_PageStyle = /*#__PURE__*/ function(PageStyle) {
6
+ PageStyle["CLASSICAL"] = "classical";
7
+ PageStyle["TAB_STYLE"] = "tab-style";
8
+ return PageStyle;
9
+ }({});
5
10
  const PageStyleContext = /*#__PURE__*/ createContext({
6
- style: 'classical'
11
+ pageStyle: "classical"
7
12
  });
8
13
  const PageStyleProvider = (param)=>{
9
14
  let { children } = param;
@@ -22,11 +27,11 @@ const PageStyleProvider = (param)=>{
22
27
  ]);
23
28
  return /*#__PURE__*/ jsx(PageStyleContext.Provider, {
24
29
  value: {
25
- style: (null == currentUser ? void 0 : null == (_currentUser_data = currentUser.data) ? void 0 : null == (_currentUser_data_data = _currentUser_data.data) ? void 0 : null == (_currentUser_data_data_systemSettings = _currentUser_data_data.systemSettings) ? void 0 : _currentUser_data_data_systemSettings.pageStyle) || 'classical',
30
+ pageStyle: (null == currentUser ? void 0 : null == (_currentUser_data = currentUser.data) ? void 0 : null == (_currentUser_data_data = _currentUser_data.data) ? void 0 : null == (_currentUser_data_data_systemSettings = _currentUser_data_data.systemSettings) ? void 0 : _currentUser_data_data_systemSettings.pageStyle) || "classical",
26
31
  items,
27
32
  setItems
28
33
  },
29
34
  children: children
30
35
  });
31
36
  };
32
- export { PageStyleContext, PageStyleProvider };
37
+ export { PageStyle_provider_PageStyle as PageStyle, PageStyleContext, PageStyleProvider };
@@ -2,8 +2,9 @@ import { jsx } from "react/jsx-runtime";
2
2
  import { useContext, useEffect } from "react";
3
3
  import { css } from "@emotion/css";
4
4
  import { Outlet, useLocation, useOutlet, useParams } from "react-router-dom";
5
+ import { useTranslation } from "../../index.mjs";
5
6
  import { useDocumentTitle } from "../document-title/index.mjs";
6
- import { PageStyleContext } from "./PageStyle.provider.mjs";
7
+ import { PageStyle, PageStyleContext } from "./PageStyle.provider.mjs";
7
8
  import { usePageStyle } from "./usePageStyle.mjs";
8
9
  function _tagged_template_literal(strings, raw) {
9
10
  if (!raw) raw = strings.slice(0);
@@ -30,20 +31,21 @@ const TabContentInternal = (param)=>{
30
31
  }, item.key));
31
32
  };
32
33
  const TabContent = ()=>{
34
+ const { t } = useTranslation();
33
35
  const { title, setTitle } = useDocumentTitle();
34
36
  const location = useLocation();
35
37
  const { items, setItems } = useContext(PageStyleContext);
36
38
  const targetKey = location.pathname;
37
39
  const outlet = useOutlet();
38
40
  useEffect(()=>{
39
- if (targetKey && title) {
41
+ if (targetKey) {
40
42
  const targetItem = items.find((value)=>value.key === targetKey);
41
- if (targetItem) setTitle(targetItem.label);
43
+ if (targetItem) setTitle(null == targetItem ? void 0 : targetItem.label);
42
44
  else setItems([
43
45
  ...items,
44
46
  {
45
47
  key: targetKey,
46
- label: title,
48
+ label: title || t('Unnamed'),
47
49
  children: outlet
48
50
  }
49
51
  ]);
@@ -60,6 +62,6 @@ const TabContent = ()=>{
60
62
  const CustomAdminContent = ()=>{
61
63
  const params = useParams();
62
64
  const pageStyle = usePageStyle();
63
- return params.name && 'tab' === pageStyle ? /*#__PURE__*/ jsx(TabContent, {}) : /*#__PURE__*/ jsx(Outlet, {});
65
+ return params.name && pageStyle === PageStyle.TAB_STYLE ? /*#__PURE__*/ jsx(TabContent, {}) : /*#__PURE__*/ jsx(Outlet, {});
64
66
  };
65
67
  export { CustomAdminContent, TabContent, TabContentInternal };
@@ -1 +1 @@
1
- export declare const usePageStyle: () => string;
1
+ export declare const usePageStyle: () => import("./PageStyle.provider").PageStyle;
@@ -1,4 +1,4 @@
1
1
  import { useContext } from "react";
2
2
  import { PageStyleContext } from "./PageStyle.provider.mjs";
3
- const usePageStyle = ()=>useContext(PageStyleContext).style;
3
+ const usePageStyle = ()=>useContext(PageStyleContext).pageStyle;
4
4
  export { usePageStyle };
@@ -1,9 +1,10 @@
1
+ import { PageStyle } from './PageStyle.provider';
1
2
  export declare const useTabSettings: () => {
2
- key: string;
3
- eventKey: string;
3
+ key: PageStyle;
4
+ eventKey: PageStyle;
4
5
  label: import("react/jsx-runtime").JSX.Element;
5
6
  };
6
7
  export declare function Label(): import("react/jsx-runtime").JSX.Element;
7
8
  export declare function useUpdatePageStyleSettings(): {
8
- updateUserPageStyle: (pageStyle: string | null) => Promise<void>;
9
+ updateUserPageStyle: (pageStyle: PageStyle | null) => Promise<void>;
9
10
  };
@@ -5,9 +5,10 @@ import { useTranslation } from "react-i18next";
5
5
  import { useAPIClient } from "../../api-client/index.mjs";
6
6
  import { SelectWithTitle } from "../../common/index.mjs";
7
7
  import { useCurrentUserContext } from "../../user/index.mjs";
8
+ import { PageStyle } from "./PageStyle.provider.mjs";
8
9
  const useTabSettings = ()=>({
9
- key: 'tab',
10
- eventKey: 'tab',
10
+ key: PageStyle.TAB_STYLE,
11
+ eventKey: PageStyle.TAB_STYLE,
11
12
  label: /*#__PURE__*/ jsx(Label, {})
12
13
  });
13
14
  function Label() {
@@ -17,15 +18,15 @@ function Label() {
17
18
  const currentUser = useCurrentUserContext();
18
19
  return /*#__PURE__*/ jsx(SelectWithTitle, {
19
20
  title: t('Page style'),
20
- defaultValue: (null == (_currentUser_data_data_systemSettings = currentUser.data.data.systemSettings) ? void 0 : _currentUser_data_data_systemSettings.pageStyle) || 'classical',
21
+ defaultValue: (null == (_currentUser_data_data_systemSettings = currentUser.data.data.systemSettings) ? void 0 : _currentUser_data_data_systemSettings.pageStyle) || PageStyle.CLASSICAL,
21
22
  options: [
22
23
  {
23
24
  label: t('classical'),
24
- value: 'classical'
25
+ value: PageStyle.CLASSICAL
25
26
  },
26
27
  {
27
28
  label: t('tabs'),
28
- value: 'tab'
29
+ value: PageStyle.TAB_STYLE
29
30
  }
30
31
  ],
31
32
  onChange: updateUserPageStyle
@@ -41,7 +42,7 @@ function useUpdatePageStyleSettings() {
41
42
  await api.resource('users').updateProfile({
42
43
  values: {
43
44
  systemSettings: {
44
- ...currentUser.data.data.systemSettings || {},
45
+ ...currentUser.data.data.systemSettings,
45
46
  pageStyle
46
47
  }
47
48
  }
@@ -50,7 +51,7 @@ function useUpdatePageStyleSettings() {
50
51
  data: {
51
52
  ...currentUser.data.data,
52
53
  systemSettings: {
53
- ...currentUser.data.data.systemSettings || {},
54
+ ...currentUser.data.data.systemSettings,
54
55
  pageStyle
55
56
  }
56
57
  }
@@ -2,7 +2,7 @@ import { jsx } from "react/jsx-runtime";
2
2
  import "react";
3
3
  import { useTranslation } from "react-i18next";
4
4
  import { SchemaSettings, useSchemaInitializer } from "../../application/index.mjs";
5
- import { ButtonEditor } from "../../schema-component/index.mjs";
5
+ import { ButtonEditor, OpenMode } from "../../schema-component/index.mjs";
6
6
  import { SchemaSettingOpenModeSchemaItems } from "../../schema-items/index.mjs";
7
7
  import { ModalActionSchemaInitializerItem } from "./ModalActionSchemaInitializerItem.mjs";
8
8
  const quickAccessActionSettingsPopup = new SchemaSettings({
@@ -74,7 +74,7 @@ function QuickAccessPopupActionSchemaInitializerItem(props) {
74
74
  icon: values.icon,
75
75
  iconColor: values.iconColor,
76
76
  refreshDataBlockRequest: false,
77
- openMode: 'drawer'
77
+ openMode: OpenMode.DRAWER_MODE
78
78
  },
79
79
  properties: {
80
80
  drawer: {
@@ -1,5 +1,5 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import "react";
2
+ import { OpenMode } from "../../../schema-component/index.mjs";
3
3
  import { ActionInitializer } from "../../../schema-initializer/items/ActionInitializer.mjs";
4
4
  const CreateChildInitializer = (props)=>{
5
5
  const schema = {
@@ -11,7 +11,7 @@ const CreateChildInitializer = (props)=>{
11
11
  'x-component': 'Action',
12
12
  'x-visible': '{{treeTable}}',
13
13
  'x-component-props': {
14
- openMode: 'drawer',
14
+ openMode: OpenMode.DRAWER_MODE,
15
15
  type: 'link',
16
16
  addChild: true,
17
17
  style: {
@@ -1,6 +1,6 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import "react";
3
2
  import { useSchemaInitializerItem } from "../../../application/index.mjs";
3
+ import { OpenMode } from "../../../schema-component/index.mjs";
4
4
  import { ActionInitializer } from "../../../schema-initializer/items/ActionInitializer.mjs";
5
5
  const CreateActionInitializer = ()=>{
6
6
  const schema = {
@@ -13,7 +13,7 @@ const CreateActionInitializer = ()=>{
13
13
  'x-component': 'Action',
14
14
  'x-decorator': 'ACLActionProvider',
15
15
  'x-component-props': {
16
- openMode: 'drawer',
16
+ openMode: OpenMode.DRAWER_MODE,
17
17
  type: 'primary',
18
18
  component: 'CreateRecordAction',
19
19
  icon: 'PlusOutlined'
@@ -1,6 +1,6 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import "react";
3
2
  import { useSchemaInitializerItem } from "../../../application/index.mjs";
3
+ import { OpenMode } from "../../../schema-component/index.mjs";
4
4
  import { BlockInitializer } from "../../../schema-initializer/items/BlockInitializer.mjs";
5
5
  const CustomizeAddRecordActionInitializer = ()=>{
6
6
  const schema = {
@@ -11,7 +11,7 @@ const CustomizeAddRecordActionInitializer = ()=>{
11
11
  'x-component': 'Action',
12
12
  'x-action': 'customize:create',
13
13
  'x-component-props': {
14
- openMode: 'drawer',
14
+ openMode: OpenMode.DRAWER_MODE,
15
15
  icon: 'PlusOutlined'
16
16
  },
17
17
  properties: {
@@ -1,6 +1,7 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import "react";
3
3
  import { useSchemaInitializerItem } from "../../../application/index.mjs";
4
+ import { OpenMode } from "../../../schema-component/index.mjs";
4
5
  import { ActionInitializer } from "../../../schema-initializer/items/ActionInitializer.mjs";
5
6
  const AssociateActionInitializer = ()=>{
6
7
  const schema = {
@@ -13,7 +14,7 @@ const AssociateActionInitializer = ()=>{
13
14
  'x-component': 'Action',
14
15
  'x-component-props': {
15
16
  actionType: 'associations',
16
- openMode: 'drawer',
17
+ openMode: OpenMode.DRAWER_MODE,
17
18
  type: 'primary',
18
19
  icon: 'PlusOutlined'
19
20
  },
@@ -6,14 +6,17 @@ import { useTranslation } from "react-i18next";
6
6
  import { useSchemaToolbar } from "../../../application/index.mjs";
7
7
  import { SchemaSettings } from "../../../application/schema-settings/SchemaSettings.mjs";
8
8
  import { useCollection_deprecated } from "../../../collection-manager/index.mjs";
9
- import { useActionContext, useDesignable } from "../../../schema-component/index.mjs";
9
+ import { OpenMode, useActionContext, useDesignable } from "../../../schema-component/index.mjs";
10
10
  import { AfterSuccess, ButtonEditor, RemoveButton, SecondConFirm, WorkflowConfig, findSchema } from "../../../schema-component/antd/action/Action.Designer.mjs";
11
11
  import { useCollectionState } from "../../../schema-settings/DataTemplates/hooks/useCollectionState.mjs";
12
12
  import { SchemaSettingsModalItem } from "../../../schema-settings/SchemaSettings.mjs";
13
13
  const createSubmitActionSettings_Tree = connect(Tree, mapProps((props, field)=>{
14
14
  useEffect(()=>{
15
15
  field.value = props.defaultCheckedKeys || [];
16
- }, []);
16
+ }, [
17
+ field.value,
18
+ props.defaultCheckedKeys
19
+ ]);
17
20
  const [checkedKeys, setCheckedKeys] = useState(props.defaultCheckedKeys || []);
18
21
  const onCheck = (checkedKeys)=>{
19
22
  setCheckedKeys(checkedKeys);
@@ -151,7 +154,7 @@ const createSubmitActionSettings = new SchemaSettings({
151
154
  useVisible () {
152
155
  const { fieldSchema } = useActionContext();
153
156
  const openMode = findSchema(fieldSchema);
154
- return !openMode || 'page' === openMode;
157
+ return !openMode || openMode === OpenMode.PAGE;
155
158
  },
156
159
  useComponentProps () {
157
160
  var _fieldSchema_xactionsettings;