@tachybase/client 1.3.18 → 1.3.20

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 (148) hide show
  1. package/es/application/CustomRouterContextProvider.mjs +1 -2
  2. package/es/application/components/AppComponent.mjs +1 -3
  3. package/es/block-provider/hooks/index.mjs +1 -1
  4. package/es/built-in/acl/Configuration/schemas/scopes.mjs +4 -5
  5. package/es/built-in/dynamic-page/DynamicPage.mjs +16 -33
  6. package/es/built-in/dynamic-page/utils.d.ts +1 -2
  7. package/es/built-in/dynamic-page/utils.mjs +0 -3
  8. package/es/built-in/page-style/CustomAdminHeader.mjs +2 -2
  9. package/es/built-in/page-style/PageStyle.provider.d.ts +2 -7
  10. package/es/built-in/page-style/PageStyle.provider.mjs +3 -8
  11. package/es/built-in/page-style/TabContent.mjs +5 -7
  12. package/es/built-in/page-style/usePageStyle.d.ts +1 -1
  13. package/es/built-in/page-style/usePageStyle.mjs +1 -1
  14. package/es/built-in/page-style/useTabSettings.d.ts +3 -4
  15. package/es/built-in/page-style/useTabSettings.mjs +7 -8
  16. package/es/built-in/quick-access/PopupActionSchemaInitializerItem.mjs +2 -2
  17. package/es/collection-manager/Configuration/components/Summary.mjs +3 -3
  18. package/es/flag-provider/FlagProvider.d.ts +1 -0
  19. package/es/flag-provider/hooks/useFlag.mjs +1 -1
  20. package/es/modules/actions/add-child/CreateChildInitializer.mjs +2 -2
  21. package/es/modules/actions/add-new/CreateActionInitializer.mjs +2 -2
  22. package/es/modules/actions/add-record/CustomizeAddRecordActionInitializer.mjs +2 -2
  23. package/es/modules/actions/associate/AssociateActionInitializer.mjs +1 -2
  24. package/es/modules/actions/submit/createSubmitActionSettings.mjs +3 -6
  25. package/es/modules/actions/view-edit-popup/PopupActionInitializer.mjs +2 -2
  26. package/es/modules/actions/view-edit-popup/UpdateActionInitializer.mjs +2 -2
  27. package/es/modules/actions/view-edit-popup/ViewActionInitializer.mjs +2 -2
  28. package/es/modules/fields/component/DrawerSubTable/drawerSubTableComponentFieldSettings.mjs +2 -2
  29. package/es/modules/fields/component/Picker/recordPickerComponentFieldSettings.mjs +2 -2
  30. package/es/modules/fields/component/Select/selectComponentFieldSettings.mjs +2 -2
  31. package/es/schema-component/antd/action/Action.Container.mjs +5 -26
  32. package/es/schema-component/antd/action/Action.Designer.mjs +3 -14
  33. package/es/schema-component/antd/action/Action.Page.mjs +1 -1
  34. package/es/schema-component/antd/action/Action.mjs +11 -56
  35. package/es/schema-component/antd/action/context.d.ts +1 -9
  36. package/es/schema-component/antd/action/context.mjs +1 -10
  37. package/es/schema-component/antd/action/hooks.d.ts +1 -2
  38. package/es/schema-component/antd/action/hooks.mjs +2 -2
  39. package/es/schema-component/antd/association-field/FileManager.mjs +2 -2
  40. package/es/schema-component/antd/association-field/InternalDrawerSubTable.mjs +2 -2
  41. package/es/schema-component/antd/association-field/InternalPicker.mjs +2 -2
  42. package/es/schema-component/antd/association-field/InternalTag.mjs +2 -2
  43. package/es/schema-component/antd/association-field/InternalViewer.mjs +2 -2
  44. package/es/schema-component/antd/association-field/SubTable.mjs +2 -2
  45. package/es/schema-component/antd/color-select/ColorSelect.mjs +3 -3
  46. package/es/schema-component/antd/date-picker/util.d.ts +13 -0
  47. package/es/schema-component/antd/date-picker/util.mjs +14 -1
  48. package/es/schema-component/antd/form-item/FormItem.Settings.mjs +2 -3
  49. package/es/schema-component/antd/markdown/Markdown.mjs +4 -4
  50. package/es/schema-component/antd/page/Page.mjs +22 -27
  51. package/es/schema-component/antd/password/utils.d.ts +1 -1
  52. package/es/schema-component/antd/record-picker/InputRecordPicker.mjs +2 -2
  53. package/es/schema-component/antd/record-picker/ReadPrettyRecordPicker.mjs +2 -2
  54. package/es/schema-initializer/items/SelectActionInitializer.mjs +2 -2
  55. package/es/schema-items/OpenModeSchemaItems.mjs +16 -37
  56. package/es/schema-settings/SchemaSettingsDefaultValue.mjs +3 -2
  57. package/es/schema-settings/VariableInput/hooks/index.d.ts +1 -0
  58. package/es/schema-settings/VariableInput/hooks/index.mjs +1 -0
  59. package/es/schema-settings/VariableInput/hooks/useExactDateVariable.d.ts +93 -0
  60. package/es/schema-settings/VariableInput/hooks/useExactDateVariable.mjs +75 -0
  61. package/es/schema-settings/VariableInput/hooks/useVariableOptions.mjs +11 -1
  62. package/es/schema-templates/schemas/uiSchemaTemplates.mjs +1 -1
  63. package/es/user/ChangePassword.mjs +109 -6
  64. package/es/user/index.d.ts +1 -0
  65. package/es/user/index.mjs +2 -0
  66. package/es/variables/hooks/useBuiltinVariables.mjs +8 -2
  67. package/lib/application/CustomRouterContextProvider.js +1 -2
  68. package/lib/application/components/AppComponent.js +1 -3
  69. package/lib/block-provider/hooks/index.js +7 -7
  70. package/lib/built-in/acl/Configuration/MenuItemsProvider.js +2 -2
  71. package/lib/built-in/acl/Configuration/schemas/scopes.js +3 -4
  72. package/lib/built-in/attachment-preview/previewers/file-sheet.js +2 -2
  73. package/lib/built-in/dynamic-page/DynamicPage.js +14 -31
  74. package/lib/built-in/dynamic-page/utils.js +0 -3
  75. package/lib/built-in/page-style/CustomAdminHeader.js +2 -2
  76. package/lib/built-in/page-style/PageStyle.provider.js +2 -10
  77. package/lib/built-in/page-style/TabContent.js +4 -6
  78. package/lib/built-in/page-style/usePageStyle.js +1 -1
  79. package/lib/built-in/page-style/useTabSettings.js +7 -8
  80. package/lib/built-in/pm/index.js +1 -1
  81. package/lib/built-in/quick-access/PopupActionSchemaInitializerItem.js +1 -1
  82. package/lib/collection-manager/Configuration/components/Summary.js +3 -3
  83. package/lib/collection-manager/index.js +17 -17
  84. package/lib/flag-provider/hooks/useFlag.js +1 -1
  85. package/lib/icon/Icon.js +2 -2
  86. package/lib/locale/en_US.js +0 -1
  87. package/lib/locale/zh-CN.js +5 -0
  88. package/lib/modules/actions/add-child/CreateChildInitializer.js +2 -2
  89. package/lib/modules/actions/add-new/CreateActionInitializer.js +2 -2
  90. package/lib/modules/actions/add-record/CustomizeAddRecordActionInitializer.js +2 -2
  91. package/lib/modules/actions/associate/AssociateActionInitializer.js +1 -2
  92. package/lib/modules/actions/submit/createSubmitActionSettings.js +2 -5
  93. package/lib/modules/actions/view-edit-popup/PopupActionInitializer.js +2 -2
  94. package/lib/modules/actions/view-edit-popup/UpdateActionInitializer.js +2 -2
  95. package/lib/modules/actions/view-edit-popup/ViewActionInitializer.js +2 -2
  96. package/lib/modules/fields/component/DrawerSubTable/drawerSubTableComponentFieldSettings.js +1 -1
  97. package/lib/modules/fields/component/Picker/recordPickerComponentFieldSettings.js +1 -1
  98. package/lib/modules/fields/component/Select/selectComponentFieldSettings.js +1 -1
  99. package/lib/schema-component/antd/action/Action.Container.js +6 -27
  100. package/lib/schema-component/antd/action/Action.Designer.js +2 -13
  101. package/lib/schema-component/antd/action/Action.Modal.js +2 -2
  102. package/lib/schema-component/antd/action/Action.Page.js +1 -1
  103. package/lib/schema-component/antd/action/Action.Sheet.js +2 -2
  104. package/lib/schema-component/antd/action/Action.js +10 -55
  105. package/lib/schema-component/antd/action/context.js +1 -13
  106. package/lib/schema-component/antd/action/hooks.js +1 -1
  107. package/lib/schema-component/antd/association-field/FileManager.js +1 -1
  108. package/lib/schema-component/antd/association-field/InternalDrawerSubTable.js +1 -1
  109. package/lib/schema-component/antd/association-field/InternalPicker.js +1 -1
  110. package/lib/schema-component/antd/association-field/InternalTag.js +1 -1
  111. package/lib/schema-component/antd/association-field/InternalViewer.js +1 -1
  112. package/lib/schema-component/antd/association-field/SubTable.js +1 -1
  113. package/lib/schema-component/antd/color-select/ColorSelect.js +4 -4
  114. package/lib/schema-component/antd/date-picker/util.js +16 -0
  115. package/lib/schema-component/antd/form-item/FormItem.Settings.js +2 -3
  116. package/lib/schema-component/antd/form-tab/index.js +2 -2
  117. package/lib/schema-component/antd/form-v2/index.js +2 -2
  118. package/lib/schema-component/antd/markdown/Markdown.js +5 -5
  119. package/lib/schema-component/antd/page/Page.js +21 -26
  120. package/lib/schema-component/antd/record-picker/InputRecordPicker.js +1 -1
  121. package/lib/schema-component/antd/record-picker/ReadPrettyRecordPicker.js +1 -1
  122. package/lib/schema-component/antd/scroll-area/ScrollArea.js +2 -2
  123. package/lib/schema-component/antd/table-v2/index.js +3 -3
  124. package/lib/schema-component/antd/upload/shared.js +4 -4
  125. package/lib/schema-initializer/items/SelectActionInitializer.js +2 -2
  126. package/lib/schema-items/OpenModeSchemaItems.js +15 -36
  127. package/lib/schema-settings/SchemaSettingsDefaultValue.js +3 -2
  128. package/lib/schema-settings/VariableInput/hooks/index.js +9 -0
  129. package/lib/schema-settings/VariableInput/hooks/useExactDateVariable.js +112 -0
  130. package/lib/schema-settings/VariableInput/hooks/useVariableOptions.js +11 -1
  131. package/lib/schema-templates/schemas/uiSchemaTemplates.js +1 -1
  132. package/lib/user/ChangePassword.js +118 -5
  133. package/lib/user/index.js +24 -4
  134. package/lib/variables/VariablesProvider.js +2 -2
  135. package/lib/variables/hooks/useBuiltinVariables.js +7 -1
  136. package/package.json +10 -10
  137. package/es/built-in/dynamic-page/DynamicPage.context.d.ts +0 -0
  138. package/es/built-in/dynamic-page/DynamicPage.context.mjs +0 -0
  139. package/es/built-in/dynamic-page/DynamicPage.style.d.ts +0 -3
  140. package/es/built-in/dynamic-page/DynamicPage.style.mjs +0 -26
  141. package/es/built-in/dynamic-page/PageNavBar.d.ts +0 -3
  142. package/es/built-in/dynamic-page/PageNavBar.mjs +0 -47
  143. package/es/built-in/dynamic-page/PageNavBar.style.d.ts +0 -3
  144. package/es/built-in/dynamic-page/PageNavBar.style.mjs +0 -25
  145. package/lib/built-in/dynamic-page/DynamicPage.context.js +0 -5
  146. package/lib/built-in/dynamic-page/DynamicPage.style.js +0 -60
  147. package/lib/built-in/dynamic-page/PageNavBar.js +0 -81
  148. package/lib/built-in/dynamic-page/PageNavBar.style.js +0 -59
@@ -2,7 +2,6 @@ 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";
6
5
  const NavigateNoUpdateContext = /*#__PURE__*/ react.createContext(null);
7
6
  NavigateNoUpdateContext.displayName = 'NavigateNoUpdateContext';
8
7
  const LocationNoUpdateContext = /*#__PURE__*/ react.createContext(null);
@@ -38,7 +37,7 @@ const IsSubPageClosedByPageMenuProvider = (param)=>{
38
37
  const [fieldSchema, setFieldSchema] = useState(null);
39
38
  const isSubPageClosedByPageMenu = useCallback(()=>{
40
39
  var _fieldSchema_xcomponentprops, _prevParamsRef_current_;
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']));
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']));
42
41
  prevParamsRef.current = params;
43
42
  return result;
44
43
  }, [
@@ -46,9 +46,7 @@ const AppComponent = observer((props)=>{
46
46
  app.renderComponent('AppMain')
47
47
  ]
48
48
  }),
49
- /*#__PURE__*/ jsx(ClickToComponent, {
50
- editor: process.env.REACT_APP_CLICK_TO_COMPONENT_EDITOR || 'vscode'
51
- })
49
+ /*#__PURE__*/ jsx(ClickToComponent, {})
52
50
  ]
53
51
  });
54
52
  }, {
@@ -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("./sub/".concat(targetSchema['x-uid'], "/").concat(PathHandler.getInstance().toWildcardPath({
215
+ if (targetSchema) navigate("../".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 { OpenMode, useFilterOptions } from "../../../../schema-component/index.mjs";
3
+ import { 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,8 +27,7 @@ const useFormBlockProps = ()=>{
27
27
  resourceName: name
28
28
  });
29
29
  }, [
30
- name,
31
- ctx.form
30
+ name
32
31
  ]);
33
32
  return {
34
33
  form: ctx.form
@@ -105,7 +104,7 @@ const scopesSchema = {
105
104
  'x-component': 'Action',
106
105
  'x-component-props': {
107
106
  icon: 'PlusOutlined',
108
- openMode: OpenMode.DRAWER_MODE,
107
+ openMode: 'drawer',
109
108
  type: 'primary'
110
109
  },
111
110
  properties: {
@@ -229,7 +228,7 @@ const scopesSchema = {
229
228
  'x-decorator': 'ACLActionProvider',
230
229
  'x-component': 'Action.Link',
231
230
  'x-component-props': {
232
- openMode: OpenMode.DRAWER_MODE,
231
+ openMode: 'drawer',
233
232
  icon: 'EditOutlined'
234
233
  },
235
234
  properties: {
@@ -1,53 +1,36 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
- import { Card } from "antd";
1
+ import { jsx } from "react/jsx-runtime";
2
+ import "react";
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, RecordProvider } from "../../record-provider/index.mjs";
6
+ import { RecordContext_deprecated } 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";
10
8
  import { PathHandler } from "./utils.mjs";
11
9
  const DynamicPage = ()=>{
12
- const { styles } = useStyles();
13
10
  const params = useParams();
14
- const pathParams = PathHandler.getInstance().parse(params['*'], params.name);
15
- if (!pathParams) return /*#__PURE__*/ jsx(RemoteSchemaComponent, {
11
+ if (!params['*']) return /*#__PURE__*/ jsx(RemoteSchemaComponent, {
16
12
  uid: params.name,
17
13
  onlyRenderProperties: true
18
14
  });
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, {
15
+ {
16
+ const path = PathHandler.getInstance().parse(params['*'], params.name);
17
+ if (!path) return /*#__PURE__*/ jsx(AppNotFound, {});
18
+ return /*#__PURE__*/ jsx(DataBlockProvider, {
23
19
  params: {
24
- filterByTk: pathParams.filterByTk
20
+ filterByTk: path.filterByTk
25
21
  },
26
22
  action: "get",
27
- collection: pathParams.collection,
23
+ collection: path.collection,
28
24
  children: /*#__PURE__*/ jsx(RecordContext_deprecated.Provider, {
29
25
  value: {
30
- id: pathParams.filterByTk
26
+ id: path.filterByTk
31
27
  },
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
- ]
28
+ children: /*#__PURE__*/ jsx(RemoteSchemaComponent, {
29
+ uid: params.name,
30
+ onlyRenderProperties: true
48
31
  })
49
32
  })
50
- })
51
- });
33
+ });
34
+ }
52
35
  };
53
36
  export { DynamicPage };
@@ -1,12 +1,11 @@
1
1
  interface PathParams {
2
2
  schemaId: string;
3
- sub?: string;
4
3
  collection?: string;
5
4
  filterByTk?: string;
6
5
  sourceId?: string;
7
6
  tab?: string;
8
7
  }
9
- export interface ParsedPath extends PathParams {
8
+ interface ParsedPath extends PathParams {
10
9
  }
11
10
  export declare class PathHandler {
12
11
  private static instance;
@@ -26,9 +26,6 @@ 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;
32
29
  case 'collection':
33
30
  result.collection = value;
34
31
  break;
@@ -1,9 +1,9 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import { PageStyle } from "./PageStyle.provider.mjs";
2
+ import "react";
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 pageStyle === PageStyle.TAB_STYLE ? /*#__PURE__*/ jsx(TabHeader, {}) : null;
7
+ return 'tab' === pageStyle ? /*#__PURE__*/ jsx(TabHeader, {}) : null;
8
8
  };
9
9
  export { CustomAdminHeader };
@@ -1,11 +1,7 @@
1
1
  import React from 'react';
2
2
  import { TabsProps } from 'antd';
3
- export declare enum PageStyle {
4
- CLASSICAL = "classical",
5
- TAB_STYLE = "tab-style"
6
- }
7
- interface PageStyleContextValue {
8
- pageStyle: PageStyle;
3
+ export interface PageStyleContextValue {
4
+ style: string;
9
5
  items: TabsProps['items'];
10
6
  setItems: React.Dispatch<React.SetStateAction<TabsProps['items']>>;
11
7
  }
@@ -13,4 +9,3 @@ export declare const PageStyleContext: React.Context<Partial<PageStyleContextVal
13
9
  export declare const PageStyleProvider: ({ children }: {
14
10
  children: any;
15
11
  }) => import("react/jsx-runtime").JSX.Element;
16
- export {};
@@ -2,13 +2,8 @@ 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
- }({});
10
5
  const PageStyleContext = /*#__PURE__*/ createContext({
11
- pageStyle: "classical"
6
+ style: 'classical'
12
7
  });
13
8
  const PageStyleProvider = (param)=>{
14
9
  let { children } = param;
@@ -27,11 +22,11 @@ const PageStyleProvider = (param)=>{
27
22
  ]);
28
23
  return /*#__PURE__*/ jsx(PageStyleContext.Provider, {
29
24
  value: {
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",
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',
31
26
  items,
32
27
  setItems
33
28
  },
34
29
  children: children
35
30
  });
36
31
  };
37
- export { PageStyle_provider_PageStyle as PageStyle, PageStyleContext, PageStyleProvider };
32
+ export { PageStyleContext, PageStyleProvider };
@@ -2,9 +2,8 @@ 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";
6
5
  import { useDocumentTitle } from "../document-title/index.mjs";
7
- import { PageStyle, PageStyleContext } from "./PageStyle.provider.mjs";
6
+ import { PageStyleContext } from "./PageStyle.provider.mjs";
8
7
  import { usePageStyle } from "./usePageStyle.mjs";
9
8
  function _tagged_template_literal(strings, raw) {
10
9
  if (!raw) raw = strings.slice(0);
@@ -31,21 +30,20 @@ const TabContentInternal = (param)=>{
31
30
  }, item.key));
32
31
  };
33
32
  const TabContent = ()=>{
34
- const { t } = useTranslation();
35
33
  const { title, setTitle } = useDocumentTitle();
36
34
  const location = useLocation();
37
35
  const { items, setItems } = useContext(PageStyleContext);
38
36
  const targetKey = location.pathname;
39
37
  const outlet = useOutlet();
40
38
  useEffect(()=>{
41
- if (targetKey) {
39
+ if (targetKey && title) {
42
40
  const targetItem = items.find((value)=>value.key === targetKey);
43
- if (targetItem) setTitle(null == targetItem ? void 0 : targetItem.label);
41
+ if (targetItem) setTitle(targetItem.label);
44
42
  else setItems([
45
43
  ...items,
46
44
  {
47
45
  key: targetKey,
48
- label: title || t('Unnamed'),
46
+ label: title,
49
47
  children: outlet
50
48
  }
51
49
  ]);
@@ -62,6 +60,6 @@ const TabContent = ()=>{
62
60
  const CustomAdminContent = ()=>{
63
61
  const params = useParams();
64
62
  const pageStyle = usePageStyle();
65
- return params.name && pageStyle === PageStyle.TAB_STYLE ? /*#__PURE__*/ jsx(TabContent, {}) : /*#__PURE__*/ jsx(Outlet, {});
63
+ return params.name && 'tab' === pageStyle ? /*#__PURE__*/ jsx(TabContent, {}) : /*#__PURE__*/ jsx(Outlet, {});
66
64
  };
67
65
  export { CustomAdminContent, TabContent, TabContentInternal };
@@ -1 +1 @@
1
- export declare const usePageStyle: () => import("./PageStyle.provider").PageStyle;
1
+ export declare const usePageStyle: () => string;
@@ -1,4 +1,4 @@
1
1
  import { useContext } from "react";
2
2
  import { PageStyleContext } from "./PageStyle.provider.mjs";
3
- const usePageStyle = ()=>useContext(PageStyleContext).pageStyle;
3
+ const usePageStyle = ()=>useContext(PageStyleContext).style;
4
4
  export { usePageStyle };
@@ -1,10 +1,9 @@
1
- import { PageStyle } from './PageStyle.provider';
2
1
  export declare const useTabSettings: () => {
3
- key: PageStyle;
4
- eventKey: PageStyle;
2
+ key: string;
3
+ eventKey: string;
5
4
  label: import("react/jsx-runtime").JSX.Element;
6
5
  };
7
6
  export declare function Label(): import("react/jsx-runtime").JSX.Element;
8
7
  export declare function useUpdatePageStyleSettings(): {
9
- updateUserPageStyle: (pageStyle: PageStyle | null) => Promise<void>;
8
+ updateUserPageStyle: (pageStyle: string | null) => Promise<void>;
10
9
  };
@@ -5,10 +5,9 @@ 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";
9
8
  const useTabSettings = ()=>({
10
- key: PageStyle.TAB_STYLE,
11
- eventKey: PageStyle.TAB_STYLE,
9
+ key: 'tab',
10
+ eventKey: 'tab',
12
11
  label: /*#__PURE__*/ jsx(Label, {})
13
12
  });
14
13
  function Label() {
@@ -18,15 +17,15 @@ function Label() {
18
17
  const currentUser = useCurrentUserContext();
19
18
  return /*#__PURE__*/ jsx(SelectWithTitle, {
20
19
  title: t('Page style'),
21
- defaultValue: (null == (_currentUser_data_data_systemSettings = currentUser.data.data.systemSettings) ? void 0 : _currentUser_data_data_systemSettings.pageStyle) || PageStyle.CLASSICAL,
20
+ defaultValue: (null == (_currentUser_data_data_systemSettings = currentUser.data.data.systemSettings) ? void 0 : _currentUser_data_data_systemSettings.pageStyle) || 'classical',
22
21
  options: [
23
22
  {
24
23
  label: t('classical'),
25
- value: PageStyle.CLASSICAL
24
+ value: 'classical'
26
25
  },
27
26
  {
28
27
  label: t('tabs'),
29
- value: PageStyle.TAB_STYLE
28
+ value: 'tab'
30
29
  }
31
30
  ],
32
31
  onChange: updateUserPageStyle
@@ -42,7 +41,7 @@ function useUpdatePageStyleSettings() {
42
41
  await api.resource('users').updateProfile({
43
42
  values: {
44
43
  systemSettings: {
45
- ...currentUser.data.data.systemSettings,
44
+ ...currentUser.data.data.systemSettings || {},
46
45
  pageStyle
47
46
  }
48
47
  }
@@ -51,7 +50,7 @@ function useUpdatePageStyleSettings() {
51
50
  data: {
52
51
  ...currentUser.data.data,
53
52
  systemSettings: {
54
- ...currentUser.data.data.systemSettings,
53
+ ...currentUser.data.data.systemSettings || {},
55
54
  pageStyle
56
55
  }
57
56
  }
@@ -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, OpenMode } from "../../schema-component/index.mjs";
5
+ import { ButtonEditor } 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: OpenMode.DRAWER_MODE
77
+ openMode: 'drawer'
78
78
  },
79
79
  properties: {
80
80
  drawer: {
@@ -4,7 +4,7 @@ import { observer } from "@tachybase/schema";
4
4
  import { Tag } from "antd";
5
5
  import { useAntdToken } from "antd-style";
6
6
  import { useCompile } from "../../../schema-component/index.mjs";
7
- const Summary = observer((props)=>{
7
+ const Summary_Summary = observer((props)=>{
8
8
  const { schema, label } = props;
9
9
  const compile = useCompile();
10
10
  const token = useAntdToken();
@@ -57,5 +57,5 @@ const Summary = observer((props)=>{
57
57
  }, {
58
58
  displayName: 'Summary'
59
59
  });
60
- const components_Summary = Summary;
61
- export { components_Summary as default };
60
+ const Summary = Summary_Summary;
61
+ export { Summary as default };
@@ -21,6 +21,7 @@ export interface FlagProviderProps {
21
21
  */
22
22
  isInSubForm?: boolean;
23
23
  children: any;
24
+ collectionField?: any;
24
25
  }
25
26
  export declare const FlagContext: React.Context<Omit<FlagProviderProps, "children">>;
26
27
  export declare const FlagProvider: (props: FlagProviderProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,4 @@
1
1
  import { useContext } from "react";
2
2
  import { FlagContext } from "../FlagProvider.mjs";
3
- const useFlag = ()=>useContext(FlagContext);
3
+ const useFlag = ()=>useContext(FlagContext) || {};
4
4
  export { useFlag };
@@ -1,5 +1,5 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import { OpenMode } from "../../../schema-component/index.mjs";
2
+ import "react";
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: OpenMode.DRAWER_MODE,
14
+ openMode: 'drawer',
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";
2
3
  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: OpenMode.DRAWER_MODE,
16
+ openMode: 'drawer',
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";
2
3
  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: OpenMode.DRAWER_MODE,
14
+ openMode: 'drawer',
15
15
  icon: 'PlusOutlined'
16
16
  },
17
17
  properties: {
@@ -1,7 +1,6 @@
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";
5
4
  import { ActionInitializer } from "../../../schema-initializer/items/ActionInitializer.mjs";
6
5
  const AssociateActionInitializer = ()=>{
7
6
  const schema = {
@@ -14,7 +13,7 @@ const AssociateActionInitializer = ()=>{
14
13
  'x-component': 'Action',
15
14
  'x-component-props': {
16
15
  actionType: 'associations',
17
- openMode: OpenMode.DRAWER_MODE,
16
+ openMode: 'drawer',
18
17
  type: 'primary',
19
18
  icon: 'PlusOutlined'
20
19
  },
@@ -6,17 +6,14 @@ 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 { OpenMode, useActionContext, useDesignable } from "../../../schema-component/index.mjs";
9
+ import { 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
- }, [
17
- field.value,
18
- props.defaultCheckedKeys
19
- ]);
16
+ }, []);
20
17
  const [checkedKeys, setCheckedKeys] = useState(props.defaultCheckedKeys || []);
21
18
  const onCheck = (checkedKeys)=>{
22
19
  setCheckedKeys(checkedKeys);
@@ -154,7 +151,7 @@ const createSubmitActionSettings = new SchemaSettings({
154
151
  useVisible () {
155
152
  const { fieldSchema } = useActionContext();
156
153
  const openMode = findSchema(fieldSchema);
157
- return !openMode || openMode === OpenMode.PAGE;
154
+ return !openMode || 'page' === openMode;
158
155
  },
159
156
  useComponentProps () {
160
157
  var _fieldSchema_xactionsettings;
@@ -1,6 +1,6 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
+ import "react";
2
3
  import { useSchemaInitializerItem } from "../../../application/index.mjs";
3
- import { OpenMode } from "../../../schema-component/index.mjs";
4
4
  import { BlockInitializer } from "../../../schema-initializer/items/index.mjs";
5
5
  const PopupActionInitializer = (props)=>{
6
6
  const schema = {
@@ -11,7 +11,7 @@ const PopupActionInitializer = (props)=>{
11
11
  'x-settings': 'actionSettings:popup',
12
12
  'x-component': (null == props ? void 0 : props['x-component']) || 'Action.Link',
13
13
  'x-component-props': {
14
- openMode: OpenMode.DRAWER_MODE
14
+ openMode: 'drawer'
15
15
  },
16
16
  properties: {
17
17
  drawer: {
@@ -1,5 +1,5 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import { OpenMode } from "../../../schema-component/index.mjs";
2
+ import "react";
3
3
  import { ActionInitializer } from "../../../schema-initializer/items/ActionInitializer.mjs";
4
4
  const UpdateActionInitializer = (props)=>{
5
5
  const schema = {
@@ -10,7 +10,7 @@ const UpdateActionInitializer = (props)=>{
10
10
  'x-settings': 'actionSettings:edit',
11
11
  'x-component': 'Action',
12
12
  'x-component-props': {
13
- openMode: OpenMode.DRAWER_MODE,
13
+ openMode: 'drawer',
14
14
  icon: 'EditOutlined'
15
15
  },
16
16
  properties: {
@@ -1,5 +1,5 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import { OpenMode } from "../../../schema-component/index.mjs";
2
+ import "react";
3
3
  import { ActionInitializer } from "../../../schema-initializer/items/ActionInitializer.mjs";
4
4
  const ViewActionInitializer = (props)=>{
5
5
  const schema = {
@@ -10,7 +10,7 @@ const ViewActionInitializer = (props)=>{
10
10
  'x-settings': 'actionSettings:view',
11
11
  'x-component': 'Action',
12
12
  'x-component-props': {
13
- openMode: OpenMode.DRAWER_MODE
13
+ openMode: 'drawer'
14
14
  },
15
15
  properties: {
16
16
  drawer: {
@@ -3,7 +3,7 @@ import { useTranslation } from "react-i18next";
3
3
  import { SchemaSettings } from "../../../../application/schema-settings/SchemaSettings.mjs";
4
4
  import { useFieldComponentName } from "../../../../common/useFieldComponentName.mjs";
5
5
  import { useCollectionField } from "../../../../data-source/index.mjs";
6
- import { OpenMode, useDesignable, useFieldModeOptions, useIsAddNewForm } from "../../../../schema-component/index.mjs";
6
+ import { useDesignable, useFieldModeOptions, useIsAddNewForm } from "../../../../schema-component/index.mjs";
7
7
  import { isSubMode } from "../../../../schema-component/antd/association-field/util.mjs";
8
8
  import { useIsFieldReadPretty } from "../../../../schema-component/antd/form-item/FormItem.Settings.mjs";
9
9
  import { useColumnSchema } from "../../../../schema-component/antd/table-v2/Table.Column.Decorator.mjs";
@@ -126,7 +126,7 @@ const drawerSubTableComponentFieldSettings = new SchemaSettings({
126
126
  value: 'large'
127
127
  }
128
128
  ],
129
- value: null != (_fieldSchema_xcomponentprops_openSize = null == fieldSchema ? void 0 : null == (_fieldSchema_xcomponentprops = fieldSchema['x-component-props']) ? void 0 : _fieldSchema_xcomponentprops['openSize']) ? _fieldSchema_xcomponentprops_openSize : (null == fieldSchema ? void 0 : null == (_fieldSchema_xcomponentprops1 = fieldSchema['x-component-props']) ? void 0 : _fieldSchema_xcomponentprops1['openMode']) === OpenMode.MODAL ? 'large' : 'middle',
129
+ value: null != (_fieldSchema_xcomponentprops_openSize = null == fieldSchema ? void 0 : null == (_fieldSchema_xcomponentprops = fieldSchema['x-component-props']) ? void 0 : _fieldSchema_xcomponentprops['openSize']) ? _fieldSchema_xcomponentprops_openSize : (null == fieldSchema ? void 0 : null == (_fieldSchema_xcomponentprops1 = fieldSchema['x-component-props']) ? void 0 : _fieldSchema_xcomponentprops1['openMode']) == 'modal' ? 'large' : 'middle',
130
130
  onChange: (value)=>{
131
131
  field.componentProps.openSize = value;
132
132
  fieldSchema['x-component-props'] = {
@@ -3,7 +3,7 @@ import { useTranslation } from "react-i18next";
3
3
  import { SchemaSettings } from "../../../../application/schema-settings/SchemaSettings.mjs";
4
4
  import { useFieldComponentName } from "../../../../common/useFieldComponentName.mjs";
5
5
  import { useCollectionField } from "../../../../data-source/index.mjs";
6
- import { OpenMode, useDesignable, useFieldModeOptions, useIsAddNewForm } from "../../../../schema-component/index.mjs";
6
+ import { useDesignable, useFieldModeOptions, useIsAddNewForm } from "../../../../schema-component/index.mjs";
7
7
  import { isSubMode } from "../../../../schema-component/antd/association-field/util.mjs";
8
8
  import { useIsFieldReadPretty, useTitleFieldOptions } from "../../../../schema-component/antd/form-item/FormItem.Settings.mjs";
9
9
  import { useColumnSchema } from "../../../../schema-component/antd/table-v2/Table.Column.Decorator.mjs";
@@ -165,7 +165,7 @@ const recordPickerComponentFieldSettings = new SchemaSettings({
165
165
  value: 'large'
166
166
  }
167
167
  ],
168
- value: null != (_fieldSchema_xcomponentprops_openSize = null == fieldSchema ? void 0 : null == (_fieldSchema_xcomponentprops = fieldSchema['x-component-props']) ? void 0 : _fieldSchema_xcomponentprops['openSize']) ? _fieldSchema_xcomponentprops_openSize : (null == fieldSchema ? void 0 : null == (_fieldSchema_xcomponentprops1 = fieldSchema['x-component-props']) ? void 0 : _fieldSchema_xcomponentprops1['openMode']) === OpenMode.MODAL ? 'large' : 'middle',
168
+ value: null != (_fieldSchema_xcomponentprops_openSize = null == fieldSchema ? void 0 : null == (_fieldSchema_xcomponentprops = fieldSchema['x-component-props']) ? void 0 : _fieldSchema_xcomponentprops['openSize']) ? _fieldSchema_xcomponentprops_openSize : (null == fieldSchema ? void 0 : null == (_fieldSchema_xcomponentprops1 = fieldSchema['x-component-props']) ? void 0 : _fieldSchema_xcomponentprops1['openMode']) == 'modal' ? 'large' : 'middle',
169
169
  onChange: (value)=>{
170
170
  field.componentProps.openSize = value;
171
171
  fieldSchema['x-component-props'] = {
@@ -9,7 +9,7 @@ import { useCollectionManager_deprecated, useCollection_deprecated } from "../..
9
9
  import { useFieldComponentName } from "../../../../common/useFieldComponentName.mjs";
10
10
  import { useCollectionField } from "../../../../data-source/index.mjs";
11
11
  import { useRecord } from "../../../../record-provider/index.mjs";
12
- import { OpenMode, removeNullCondition, useDesignable, useFieldModeOptions, useIsAddNewForm } from "../../../../schema-component/index.mjs";
12
+ import { removeNullCondition, useDesignable, useFieldModeOptions, useIsAddNewForm } from "../../../../schema-component/index.mjs";
13
13
  import { isSubMode } from "../../../../schema-component/antd/association-field/util.mjs";
14
14
  import { useIsAssociationField, useIsFieldReadPretty, useIsMuiltipleAble, useIsSelectFieldMode, useTitleFieldOptions } from "../../../../schema-component/antd/form-item/FormItem.Settings.mjs";
15
15
  import { useColumnSchema } from "../../../../schema-component/antd/table-v2/Table.Column.Decorator.mjs";
@@ -192,7 +192,7 @@ const quickCreate = {
192
192
  'x-component': 'Action',
193
193
  'x-decorator': 'ACLActionProvider',
194
194
  'x-component-props': {
195
- openMode: OpenMode.DRAWER_MODE,
195
+ openMode: 'drawer',
196
196
  type: 'default',
197
197
  component: 'CreateRecordAction'
198
198
  }