@tachybase/client 0.23.48 → 0.23.58

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 (101) hide show
  1. package/es/application/Application.d.ts +3 -0
  2. package/es/application/Application.mjs +8 -0
  3. package/es/application/hooks/index.d.ts +1 -0
  4. package/es/application/hooks/index.mjs +1 -0
  5. package/es/application/hooks/useGlobalVariable.d.ts +1 -0
  6. package/es/application/hooks/useGlobalVariable.mjs +18 -0
  7. package/es/application/schema-settings/hooks/index.d.ts +1 -1
  8. package/es/application/schema-settings/hooks/index.mjs +6 -8
  9. package/es/block-provider/hooks/index.mjs +4 -1
  10. package/es/built-in/index.mjs +3 -0
  11. package/es/built-in/locale/LocalePlugin.mjs +5 -1
  12. package/es/built-in/system-settings/SystemSettingsProvider.d.ts +2 -3
  13. package/es/built-in/system-settings/SystemSettingsProvider.mjs +4 -3
  14. package/es/built-in/system-settings/SystemSettingsShortcut.mjs +11 -8
  15. package/es/collection-manager/Configuration/AddCollectionAction.mjs +12 -2
  16. package/es/collection-manager/Configuration/ImportXlsx/ImportXlsxMetaAction.d.ts +2 -0
  17. package/es/collection-manager/Configuration/ImportXlsx/ImportXlsxMetaAction.mjs +255 -0
  18. package/es/collection-manager/Configuration/ImportXlsx/XlsxCollectionSchema.d.ts +89 -0
  19. package/es/collection-manager/Configuration/ImportXlsx/XlsxCollectionSchema.mjs +96 -0
  20. package/es/collection-manager/Configuration/ImportXlsx/XlsxEditFieldAction.d.ts +3 -0
  21. package/es/collection-manager/Configuration/ImportXlsx/XlsxEditFieldAction.mjs +47 -0
  22. package/es/collection-manager/Configuration/ImportXlsx/setUpdateXlsxCollectionField.d.ts +3 -0
  23. package/es/collection-manager/Configuration/ImportXlsx/setUpdateXlsxCollectionField.mjs +44 -0
  24. package/es/collection-manager/Configuration/ImportXlsx/xlsxFieldsConfigure.d.ts +1 -0
  25. package/es/collection-manager/Configuration/ImportXlsx/xlsxFieldsConfigure.mjs +380 -0
  26. package/es/collection-manager/Configuration/ImportXlsx/xlsxFormValueContextProvider.d.ts +8 -0
  27. package/es/collection-manager/Configuration/ImportXlsx/xlsxFormValueContextProvider.mjs +4 -0
  28. package/es/collection-manager/Configuration/ImportXlsx/xlsxImportAction.d.ts +1 -0
  29. package/es/collection-manager/Configuration/ImportXlsx/xlsxImportAction.mjs +187 -0
  30. package/es/collection-manager/Configuration/ImportXlsx/xlsxPreviewTable.d.ts +1 -0
  31. package/es/collection-manager/Configuration/ImportXlsx/xlsxPreviewTable.mjs +30 -0
  32. package/es/collection-manager/collectionPlugin.mjs +3 -1
  33. package/es/collection-manager/templates/import.mjs +1 -1
  34. package/es/collection-manager/templates/xlsx.d.ts +11 -0
  35. package/es/collection-manager/templates/xlsx.mjs +19 -0
  36. package/es/modules/blocks/data-blocks/table/hooks/useTableBlockProps.mjs +4 -2
  37. package/es/modules/fields/component/Radio/radioComponentFieldSettings.mjs +0 -4
  38. package/es/schema-component/antd/action/Action.Designer.mjs +5 -2
  39. package/es/schema-component/antd/action/Action.Modal.mjs +20 -31
  40. package/es/schema-component/antd/action/Action.Modal.style.d.ts +4 -0
  41. package/es/schema-component/antd/action/Action.Modal.style.mjs +35 -0
  42. package/es/schema-component/antd/action/utils.d.ts +1 -1
  43. package/es/schema-component/antd/action/utils.mjs +70 -70
  44. package/es/schema-component/antd/checkbox/Checkbox.mjs +6 -1
  45. package/es/schema-component/antd/page/Page.d.ts +1 -5
  46. package/es/schema-component/antd/page/Page.mjs +227 -146
  47. package/es/schema-component/antd/page/Page.style.d.ts +5 -0
  48. package/es/schema-component/antd/page/Page.style.mjs +45 -0
  49. package/es/schema-component/antd/page/PageDesigner.d.ts +3 -0
  50. package/es/schema-component/antd/page/PageDesigner.mjs +28 -0
  51. package/es/schema-component/antd/page/PageTabDesigner.d.ts +0 -3
  52. package/es/schema-component/antd/page/PageTabDesigner.mjs +3 -50
  53. package/es/schema-component/antd/page/style.d.ts +1 -1
  54. package/es/schema-component/antd/page/style.mjs +3 -13
  55. package/es/schema-component/antd/password/Password.d.ts +1 -1
  56. package/es/schema-component/antd/scroll-area/ScrollArea.d.ts +1 -1
  57. package/es/schema-component/antd/scroll-area/ScrollArea.mjs +2 -1
  58. package/es/schema-component/antd/variable/TextArea.mjs +1 -1
  59. package/es/schema-component/antd/variable/TextAreaWithGlobalScope.d.ts +13 -0
  60. package/es/schema-component/antd/variable/TextAreaWithGlobalScope.mjs +59 -0
  61. package/es/schema-component/antd/variable/index.d.ts +1 -0
  62. package/es/schema-component/antd/variable/index.mjs +3 -0
  63. package/lib/application/Application.js +8 -0
  64. package/lib/application/hooks/index.js +9 -0
  65. package/lib/application/hooks/useGlobalVariable.js +52 -0
  66. package/lib/application/schema-settings/hooks/index.js +6 -8
  67. package/lib/block-provider/hooks/index.js +6 -3
  68. package/lib/built-in/index.js +3 -0
  69. package/lib/built-in/locale/LocalePlugin.js +5 -1
  70. package/lib/built-in/system-settings/SystemSettingsProvider.js +4 -3
  71. package/lib/built-in/system-settings/SystemSettingsShortcut.js +11 -8
  72. package/lib/collection-manager/Configuration/AddCollectionAction.js +12 -2
  73. package/lib/collection-manager/Configuration/ImportXlsx/ImportXlsxMetaAction.js +304 -0
  74. package/lib/collection-manager/Configuration/ImportXlsx/XlsxCollectionSchema.js +130 -0
  75. package/lib/collection-manager/Configuration/ImportXlsx/XlsxEditFieldAction.js +81 -0
  76. package/lib/collection-manager/Configuration/ImportXlsx/setUpdateXlsxCollectionField.js +78 -0
  77. package/lib/collection-manager/Configuration/ImportXlsx/xlsxFieldsConfigure.js +414 -0
  78. package/lib/collection-manager/Configuration/ImportXlsx/xlsxFormValueContextProvider.js +53 -0
  79. package/lib/collection-manager/Configuration/ImportXlsx/xlsxImportAction.js +235 -0
  80. package/lib/collection-manager/Configuration/ImportXlsx/xlsxPreviewTable.js +64 -0
  81. package/lib/collection-manager/collectionPlugin.js +3 -1
  82. package/lib/collection-manager/templates/import.js +1 -1
  83. package/lib/collection-manager/templates/xlsx.js +53 -0
  84. package/lib/locale/zh-CN.js +4 -1
  85. package/lib/modules/blocks/data-blocks/table/hooks/useTableBlockProps.js +4 -2
  86. package/lib/modules/fields/component/Radio/radioComponentFieldSettings.js +0 -4
  87. package/lib/schema-component/antd/action/Action.Designer.js +5 -2
  88. package/lib/schema-component/antd/action/Action.Modal.js +20 -31
  89. package/lib/schema-component/antd/action/Action.Modal.style.js +69 -0
  90. package/lib/schema-component/antd/action/utils.js +70 -70
  91. package/lib/schema-component/antd/checkbox/Checkbox.js +6 -1
  92. package/lib/schema-component/antd/page/Page.js +227 -146
  93. package/lib/schema-component/antd/page/Page.style.js +79 -0
  94. package/lib/schema-component/antd/page/PageDesigner.js +62 -0
  95. package/lib/schema-component/antd/page/PageTabDesigner.js +2 -50
  96. package/lib/schema-component/antd/page/style.js +3 -13
  97. package/lib/schema-component/antd/scroll-area/ScrollArea.js +2 -1
  98. package/lib/schema-component/antd/variable/TextArea.js +1 -1
  99. package/lib/schema-component/antd/variable/TextAreaWithGlobalScope.js +94 -0
  100. package/lib/schema-component/antd/variable/index.js +13 -1
  101. package/package.json +7 -7
@@ -0,0 +1,45 @@
1
+ import * as __WEBPACK_EXTERNAL_MODULE_antd_style__ 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 .ant-tabs-nav-wrap.ant-tabs-nav-wrap {\n flex: none;\n }\n .ant-tabs-tab.ant-tabs-tab {\n border: none;\n background-color: #ffffff;\n }\n\n .ant-tabs-tab-active.ant-tabs-tab-active.ant-tabs-tab-active.ant-tabs-tab-active {\n border-radius: 8px 8px 0 0;\n box-shadow: none;\n text-shadow: none;\n background-color: var(--tb-box-bg);\n }\n .ant-tabs-extra-content {\n flex: 1;\n }\n "
13
+ ]);
14
+ _templateObject = function() {
15
+ return data;
16
+ };
17
+ return data;
18
+ }
19
+ function _templateObject1() {
20
+ const data = _tagged_template_literal([
21
+ "\n display: flex;\n flex-direction: row;\n justify-content: flex-end;\n\n &.designable {\n justify-content: space-between;\n }\n\n .scroll-area-extra-content {\n align-self: flex-end;\n }\n "
22
+ ]);
23
+ _templateObject1 = function() {
24
+ return data;
25
+ };
26
+ return data;
27
+ }
28
+ function _templateObject2() {
29
+ const data = _tagged_template_literal([
30
+ "\n position: relative;\n &:hover {\n .tab-designer-wrapper {\n display: block;\n }\n }\n .tab-designer-wrapper {\n display: none;\n position: absolute;\n top: 0;\n right: 0;\n padding: 0 2px;\n border-radius: 3px;\n color: #000000;\n background-color: #ffffff;\n\n &:hover {\n color: #ffffff;\n background-color: var(--colorSettings);\n }\n }\n "
31
+ ]);
32
+ _templateObject2 = function() {
33
+ return data;
34
+ };
35
+ return data;
36
+ }
37
+ const useStyles = (0, __WEBPACK_EXTERNAL_MODULE_antd_style__.createStyles)((param)=>{
38
+ let { css, token } = param;
39
+ return {
40
+ tabComponentClass: css(_templateObject()),
41
+ tabWrapper: css(_templateObject1()),
42
+ tabItemClass: css(_templateObject2())
43
+ };
44
+ });
45
+ export { useStyles };
@@ -0,0 +1,3 @@
1
+ export declare const PageDesigner: ({ title }: {
2
+ title: any;
3
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,28 @@
1
+ import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__ from "react/jsx-runtime";
2
+ import * as __WEBPACK_EXTERNAL_MODULE__tachybase_schema__ from "@tachybase/schema";
3
+ import * as __WEBPACK_EXTERNAL_MODULE_antd__ from "antd";
4
+ import * as __WEBPACK_EXTERNAL_MODULE__index_mjs__ from "../../index.mjs";
5
+ import * as __WEBPACK_EXTERNAL_MODULE__application_schema_settings_hooks_index_mjs__ from "../../../application/schema-settings/hooks/index.mjs";
6
+ import * as __WEBPACK_EXTERNAL_MODULE__application_schema_toolbar_context_index_mjs__ from "../../../application/schema-toolbar/context/index.mjs";
7
+ const PageDesigner = (param)=>{
8
+ let { title } = param;
9
+ const { designable } = (0, __WEBPACK_EXTERNAL_MODULE__index_mjs__.useDesignable)();
10
+ const fieldSchema = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useFieldSchema)();
11
+ const { render } = (0, __WEBPACK_EXTERNAL_MODULE__application_schema_settings_hooks_index_mjs__.useSchemaSettingsRender)(fieldSchema['x-settings'] || 'PageSettings', fieldSchema['x-settings-props']);
12
+ if (!designable) return null;
13
+ return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__application_schema_toolbar_context_index_mjs__.SchemaToolbarProvider, {
14
+ title: title,
15
+ children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("div", {
16
+ className: 'general-schema-designer',
17
+ children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("div", {
18
+ className: 'general-schema-designer-icons',
19
+ children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE_antd__.Space, {
20
+ size: 2,
21
+ align: 'center',
22
+ children: render()
23
+ })
24
+ })
25
+ })
26
+ });
27
+ };
28
+ export { PageDesigner };
@@ -1,6 +1,3 @@
1
- export declare const PageDesigner: ({ title }: {
2
- title: any;
3
- }) => import("react/jsx-runtime").JSX.Element;
4
1
  export declare const PageTabDesigner: ({ schema }: {
5
2
  schema: any;
6
3
  }) => import("react/jsx-runtime").JSX.Element;
@@ -1,64 +1,17 @@
1
1
  import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__ from "react/jsx-runtime";
2
- import "react";
3
2
  import * as __WEBPACK_EXTERNAL_MODULE__tachybase_schema__ from "@tachybase/schema";
4
- import * as __WEBPACK_EXTERNAL_MODULE__ant_design_icons__ from "@ant-design/icons";
5
- import * as __WEBPACK_EXTERNAL_MODULE_antd__ from "antd";
6
3
  import * as __WEBPACK_EXTERNAL_MODULE__index_mjs__ from "../../index.mjs";
7
4
  import * as __WEBPACK_EXTERNAL_MODULE__application_schema_settings_hooks_index_mjs__ from "../../../application/schema-settings/hooks/index.mjs";
8
5
  import * as __WEBPACK_EXTERNAL_MODULE__application_schema_toolbar_context_index_mjs__ from "../../../application/schema-toolbar/context/index.mjs";
9
- import * as __WEBPACK_EXTERNAL_MODULE__schema_settings_hooks_useGetAriaLabelOfDesigner_mjs__ from "../../../schema-settings/hooks/useGetAriaLabelOfDesigner.mjs";
10
- const PageDesigner = (param)=>{
11
- let { title } = param;
12
- const { designable } = (0, __WEBPACK_EXTERNAL_MODULE__index_mjs__.useDesignable)();
13
- const fieldSchema = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useFieldSchema)();
14
- const { render } = (0, __WEBPACK_EXTERNAL_MODULE__application_schema_settings_hooks_index_mjs__.useSchemaSettingsRender)(fieldSchema['x-settings'] || 'PageSettings', fieldSchema['x-settings-props']);
15
- if (!designable) return null;
16
- return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__application_schema_toolbar_context_index_mjs__.SchemaToolbarProvider, {
17
- title: title,
18
- children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("div", {
19
- className: 'general-schema-designer',
20
- children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("div", {
21
- className: 'general-schema-designer-icons',
22
- children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE_antd__.Space, {
23
- size: 2,
24
- align: 'center',
25
- children: render()
26
- })
27
- })
28
- })
29
- });
30
- };
31
6
  const PageTabDesigner = (param)=>{
32
7
  let { schema } = param;
33
8
  const { designable } = (0, __WEBPACK_EXTERNAL_MODULE__index_mjs__.useDesignable)();
34
- const { getAriaLabel } = (0, __WEBPACK_EXTERNAL_MODULE__schema_settings_hooks_useGetAriaLabelOfDesigner_mjs__.useGetAriaLabelOfDesigner)();
35
9
  const fieldSchema = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useFieldSchema)();
36
- const { render } = (0, __WEBPACK_EXTERNAL_MODULE__application_schema_settings_hooks_index_mjs__.useSchemaSettingsRender)(fieldSchema['x-settings'] || 'PageTabSettings', fieldSchema['x-settings-props']);
10
+ const { render: renderDesigner } = (0, __WEBPACK_EXTERNAL_MODULE__application_schema_settings_hooks_index_mjs__.useSchemaSettingsRender)(fieldSchema['x-settings'] || 'PageTabSettings', fieldSchema['x-settings-props']);
37
11
  if (!designable) return null;
38
12
  return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__application_schema_toolbar_context_index_mjs__.SchemaToolbarProvider, {
39
13
  schema: schema,
40
- children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("div", {
41
- className: 'general-schema-designer',
42
- children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("div", {
43
- className: 'general-schema-designer-icons',
44
- children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsxs)(__WEBPACK_EXTERNAL_MODULE_antd__.Space, {
45
- size: 3,
46
- align: 'center',
47
- children: [
48
- /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__index_mjs__.DragHandler, {
49
- children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__ant_design_icons__.DragOutlined, {
50
- style: {
51
- marginRight: 0
52
- },
53
- role: "button",
54
- "aria-label": getAriaLabel('drag-handler', 'tab')
55
- })
56
- }),
57
- render()
58
- ]
59
- })
60
- })
61
- })
14
+ children: renderDesigner()
62
15
  });
63
16
  };
64
- export { PageDesigner, PageTabDesigner };
17
+ export { PageTabDesigner };
@@ -1 +1 @@
1
- export declare const useStyles: (props?: any) => import("./../__builtins__").UseComponentStyleResult;
1
+ export declare const getStyles: (props?: any) => import("./../__builtins__").UseComponentStyleResult;
@@ -1,5 +1,5 @@
1
1
  import * as __WEBPACK_EXTERNAL_MODULE__builtins_index_mjs__ from "../__builtins__/index.mjs";
2
- const useStyles = (0, __WEBPACK_EXTERNAL_MODULE__builtins_index_mjs__.genStyleHook)('tb-page', (token)=>{
2
+ const getStyles = (0, __WEBPACK_EXTERNAL_MODULE__builtins_index_mjs__.genStyleHook)('tb-page', (token)=>{
3
3
  const { componentCls } = token;
4
4
  return {
5
5
  [componentCls]: {
@@ -46,8 +46,7 @@ const useStyles = (0, __WEBPACK_EXTERNAL_MODULE__builtins_index_mjs__.genStyleHo
46
46
  }
47
47
  },
48
48
  '.tb-page-header-wrapper': {
49
- zIndex: 10,
50
- boxShadow: '1px 1px 10px 1px rgba(0, 0, 0, 0.1)'
49
+ zIndex: 10
51
50
  },
52
51
  '.pageHeaderCss': {
53
52
  backgroundColor: token.colorBgContainer,
@@ -71,10 +70,6 @@ const useStyles = (0, __WEBPACK_EXTERNAL_MODULE__builtins_index_mjs__.genStyleHo
71
70
  fontSize: 0,
72
71
  height: 0
73
72
  },
74
- '.addTabBtn': {
75
- borderColor: 'var(--colorSettings)',
76
- color: 'var(--colorSettings)'
77
- },
78
73
  '.designerCss': {
79
74
  position: 'relative',
80
75
  '&:hover': {
@@ -131,13 +126,8 @@ const useStyles = (0, __WEBPACK_EXTERNAL_MODULE__builtins_index_mjs__.genStyleHo
131
126
  paddingBottom: 0,
132
127
  overflowX: 'hidden',
133
128
  overflowY: 'scroll'
134
- },
135
- '.tb-tabs-wrapper': {
136
- display: 'flex',
137
- flexDirection: 'row',
138
- justifyContent: 'flex-end'
139
129
  }
140
130
  }
141
131
  };
142
132
  });
143
- export { useStyles };
133
+ export { getStyles };
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { PasswordProps } from 'antd/es/input';
3
3
  export interface IPasswordProps extends PasswordProps {
4
- checkStrength: boolean;
4
+ checkStrength?: boolean;
5
5
  }
6
6
  export declare const Password: React.ForwardRefExoticComponent<IPasswordProps & React.RefAttributes<never>>;
7
7
  export default Password;
@@ -1,2 +1,2 @@
1
- export declare const ScrollArea: () => import("react/jsx-runtime").JSX.Element;
1
+ export declare const ScrollArea: (props: any) => import("react/jsx-runtime").JSX.Element;
2
2
  export default ScrollArea;
@@ -2,7 +2,7 @@ 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__index_mjs__ from "../../../index.mjs";
4
4
  import * as __WEBPACK_EXTERNAL_MODULE__built_in_scroll_assistant_useJoystick_mjs__ from "../../../built-in/scroll-assistant/useJoystick.mjs";
5
- const ScrollArea = ()=>{
5
+ const ScrollArea = (props)=>{
6
6
  const ref = (0, __WEBPACK_EXTERNAL_MODULE_react__.useRef)(null);
7
7
  const { t } = (0, __WEBPACK_EXTERNAL_MODULE__index_mjs__.useTranslation)();
8
8
  (0, __WEBPACK_EXTERNAL_MODULE__built_in_scroll_assistant_useJoystick_mjs__.useJoystick)(ref);
@@ -19,6 +19,7 @@ const ScrollArea = ()=>{
19
19
  cursor: 'pointer',
20
20
  userSelect: 'none'
21
21
  },
22
+ ...props,
22
23
  children: t('Horizontal scrolling area')
23
24
  });
24
25
  };
@@ -142,7 +142,7 @@ function getCurrentRange(element) {
142
142
  function TextArea(props) {
143
143
  const { value: propsValue, scope, onChange, multiline = true, changeOnSelect } = props;
144
144
  const fieldSchema = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useFieldSchema)();
145
- const value = propsValue || fieldSchema.default || '';
145
+ const value = propsValue || (null == fieldSchema ? void 0 : fieldSchema.default) || '';
146
146
  const { styles } = (0, __WEBPACK_EXTERNAL_MODULE__style_mjs__.useStyles)({
147
147
  multiline
148
148
  });
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ export declare const useEnvironmentVariableOptions: (scope: any) => any;
3
+ interface TextAreaWithGlobalScopeProps {
4
+ supportsLineBreak?: boolean;
5
+ password?: boolean;
6
+ number?: boolean;
7
+ boolean?: boolean;
8
+ value?: any;
9
+ scope?: string | object;
10
+ [key: string]: any;
11
+ }
12
+ export declare const TextAreaWithGlobalScope: React.ForwardRefExoticComponent<Omit<TextAreaWithGlobalScopeProps, "ref"> & React.RefAttributes<unknown>>;
13
+ export {};
@@ -0,0 +1,59 @@
1
+ import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__ from "react/jsx-runtime";
2
+ import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
3
+ import * as __WEBPACK_EXTERNAL_MODULE__tachybase_schema__ from "@tachybase/schema";
4
+ import * as __WEBPACK_EXTERNAL_MODULE__application_hooks_useGlobalVariable_mjs__ from "../../../application/hooks/useGlobalVariable.mjs";
5
+ import * as __WEBPACK_EXTERNAL_MODULE__input_index_mjs__ from "../input/index.mjs";
6
+ import * as __WEBPACK_EXTERNAL_MODULE__password_index_mjs__ from "../password/index.mjs";
7
+ import * as __WEBPACK_EXTERNAL_MODULE__RawTextArea_mjs__ from "./RawTextArea.mjs";
8
+ import * as __WEBPACK_EXTERNAL_MODULE__TextArea_mjs__ from "./TextArea.mjs";
9
+ import * as __WEBPACK_EXTERNAL_MODULE__Variable_mjs__ from "./Variable.mjs";
10
+ const useEnvironmentVariableOptions = (scope)=>{
11
+ const environmentVariables = (0, __WEBPACK_EXTERNAL_MODULE__application_hooks_useGlobalVariable_mjs__.useGlobalVariable)('$env');
12
+ return (0, __WEBPACK_EXTERNAL_MODULE_react__.useMemo)(()=>{
13
+ if (environmentVariables) return [
14
+ environmentVariables
15
+ ].filter(Boolean);
16
+ return scope;
17
+ }, [
18
+ environmentVariables,
19
+ scope
20
+ ]);
21
+ };
22
+ const isVariable = (value)=>{
23
+ const regex = /{{.*?}}/;
24
+ return regex.test(value);
25
+ };
26
+ const TextAreaWithGlobalScope = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.connect)((props)=>{
27
+ const { supportsLineBreak, password, number, boolean, ...others } = props;
28
+ const scope = useEnvironmentVariableOptions(props.scope);
29
+ const fieldNames = {
30
+ value: 'name',
31
+ label: 'title'
32
+ };
33
+ if (supportsLineBreak) return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__RawTextArea_mjs__.RawTextArea, {
34
+ ...others,
35
+ scope: scope,
36
+ fieldNames: fieldNames,
37
+ rows: 3
38
+ });
39
+ if (number) return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__Variable_mjs__.Variable.Input, {
40
+ ...props,
41
+ scope: scope,
42
+ fieldNames: fieldNames
43
+ });
44
+ if (password && props.value && !isVariable(props.value)) return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__password_index_mjs__.Password, {
45
+ ...others,
46
+ autoFocus: true
47
+ });
48
+ if (boolean) return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__Variable_mjs__.Variable.Input, {
49
+ ...props,
50
+ scope: scope,
51
+ fieldNames: fieldNames
52
+ });
53
+ return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__TextArea_mjs__.TextArea, {
54
+ ...others,
55
+ scope: scope,
56
+ fieldNames: fieldNames
57
+ });
58
+ }, (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.mapReadPretty)(__WEBPACK_EXTERNAL_MODULE__input_index_mjs__.Input.ReadPretty));
59
+ export { TextAreaWithGlobalScope, useEnvironmentVariableOptions };
@@ -1 +1,2 @@
1
1
  export * from './Variable';
2
+ export { TextAreaWithGlobalScope } from './TextAreaWithGlobalScope';
@@ -1 +1,4 @@
1
+ import * as __WEBPACK_EXTERNAL_MODULE__TextAreaWithGlobalScope_mjs__ from "./TextAreaWithGlobalScope.mjs";
1
2
  export * from "./Variable.mjs";
3
+ var __webpack_exports__TextAreaWithGlobalScope = __WEBPACK_EXTERNAL_MODULE__TextAreaWithGlobalScope_mjs__.TextAreaWithGlobalScope;
4
+ export { __webpack_exports__TextAreaWithGlobalScope as TextAreaWithGlobalScope };
@@ -283,6 +283,12 @@ class Application {
283
283
  root.render(/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(App, {}));
284
284
  return root;
285
285
  }
286
+ addGlobalVar(key, value) {
287
+ (0, external_lodash_namespaceObject.set)(this.globalVars, key, value);
288
+ }
289
+ getGlobalVar(key) {
290
+ return (0, external_lodash_namespaceObject.get)(this.globalVars, key);
291
+ }
286
292
  constructor(options = {}){
287
293
  _define_property(this, "options", void 0);
288
294
  _define_property(this, "providers", void 0);
@@ -305,6 +311,7 @@ class Application {
305
311
  _define_property(this, "pluginContextMenu", void 0);
306
312
  _define_property(this, "AttachmentPreviewManager", void 0);
307
313
  _define_property(this, "name", void 0);
314
+ _define_property(this, "globalVars", void 0);
308
315
  _define_property(this, "loading", void 0);
309
316
  _define_property(this, "maintained", void 0);
310
317
  _define_property(this, "maintaining", void 0);
@@ -318,6 +325,7 @@ class Application {
318
325
  ...components_index_js_namespaceObject,
319
326
  CollectionField: CollectionField_js_namespaceObject.CollectionField
320
327
  };
328
+ this.globalVars = {};
321
329
  this.loading = true;
322
330
  this.maintained = false;
323
331
  this.maintaining = false;
@@ -3,6 +3,9 @@ var __webpack_modules__ = {
3
3
  "./useApp": function(module) {
4
4
  module.exports = require("./useApp.js");
5
5
  },
6
+ "./useGlobalVariable": function(module) {
7
+ module.exports = require("./useGlobalVariable.js");
8
+ },
6
9
  "./usePlugin": function(module) {
7
10
  module.exports = require("./usePlugin.js");
8
11
  },
@@ -76,6 +79,12 @@ for(var __WEBPACK_IMPORT_KEY__ in _useRouter__WEBPACK_IMPORTED_MODULE_2__)if ("d
76
79
  return _useRouter__WEBPACK_IMPORTED_MODULE_2__[key];
77
80
  }).bind(0, __WEBPACK_IMPORT_KEY__);
78
81
  __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
82
+ var _useGlobalVariable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./useGlobalVariable");
83
+ var __WEBPACK_REEXPORT_OBJECT__ = {};
84
+ for(var __WEBPACK_IMPORT_KEY__ in _useGlobalVariable__WEBPACK_IMPORTED_MODULE_3__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
85
+ return _useGlobalVariable__WEBPACK_IMPORTED_MODULE_3__[key];
86
+ }).bind(0, __WEBPACK_IMPORT_KEY__);
87
+ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
79
88
  var __webpack_export_target__ = exports;
80
89
  for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
81
90
  if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, '__esModule', {
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.d = function(exports1, definition) {
5
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
6
+ enumerable: true,
7
+ get: definition[key]
8
+ });
9
+ };
10
+ })();
11
+ (()=>{
12
+ __webpack_require__.o = function(obj, prop) {
13
+ return Object.prototype.hasOwnProperty.call(obj, prop);
14
+ };
15
+ })();
16
+ (()=>{
17
+ __webpack_require__.r = function(exports1) {
18
+ if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
19
+ value: 'Module'
20
+ });
21
+ Object.defineProperty(exports1, '__esModule', {
22
+ value: true
23
+ });
24
+ };
25
+ })();
26
+ var __webpack_exports__ = {};
27
+ __webpack_require__.r(__webpack_exports__);
28
+ __webpack_require__.d(__webpack_exports__, {
29
+ useGlobalVariable: ()=>useGlobalVariable
30
+ });
31
+ const external_react_namespaceObject = require("react");
32
+ const external_lodash_namespaceObject = require("lodash");
33
+ const external_index_js_namespaceObject = require("./index.js");
34
+ const useGlobalVariable = (key)=>{
35
+ const app = (0, external_index_js_namespaceObject.useApp)();
36
+ const variable = (0, external_react_namespaceObject.useMemo)(()=>app.getGlobalVar(key), [
37
+ app,
38
+ key
39
+ ]);
40
+ if ((0, external_lodash_namespaceObject.isFunction)(variable)) try {
41
+ return variable();
42
+ } catch (error) {
43
+ console.error("Error calling global variable function for key: ".concat(key), error);
44
+ return;
45
+ }
46
+ return variable;
47
+ };
48
+ var __webpack_export_target__ = exports;
49
+ for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
50
+ if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, '__esModule', {
51
+ value: true
52
+ });
@@ -52,7 +52,6 @@ function useSchemaSettingsRender(name, options) {
52
52
  app.schemaSettingsManager,
53
53
  name
54
54
  ]);
55
- const renderCache = external_react_default().useRef({});
56
55
  if (!name) return {
57
56
  exists: false,
58
57
  render: ()=>null
@@ -68,17 +67,16 @@ function useSchemaSettingsRender(name, options) {
68
67
  exists: true,
69
68
  render: function() {
70
69
  let options2 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
71
- const key = JSON.stringify(options2);
72
- if (key && renderCache.current[key]) return renderCache.current[key];
73
70
  const newItems = [
74
71
  ...external_SchemaSettingsDefaults_js_namespaceObject.defaultSettingItems,
75
72
  ...schemaSetting.options.items
76
73
  ];
77
- return renderCache.current[key] = /*#__PURE__*/ external_react_default().createElement(external_components_index_js_namespaceObject.SchemaSettingsWrapper, {
78
- ...{
79
- ...schemaSetting.options,
80
- items: newItems
81
- },
74
+ const newOptions = {
75
+ ...schemaSetting.options,
76
+ items: newItems
77
+ };
78
+ return /*#__PURE__*/ external_react_default().createElement(external_components_index_js_namespaceObject.SchemaSettingsWrapper, {
79
+ ...newOptions,
82
80
  ...options,
83
81
  ...options2
84
82
  });
@@ -15,7 +15,7 @@ var __webpack_modules__ = {
15
15
  "../../filter-provider/utils": function(module) {
16
16
  module.exports = require("../../filter-provider/utils.js");
17
17
  },
18
- "../../": function(module) {
18
+ "../..": function(module) {
19
19
  module.exports = require("../../index.js");
20
20
  },
21
21
  "../../record-provider": function(module) {
@@ -229,7 +229,7 @@ var lodash_omit__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/ __webpack_r
229
229
  var react_i18next__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("react-i18next");
230
230
  var react_router_dom__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__("react-router-dom");
231
231
  var react_to_print__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__("react-to-print");
232
- var ___WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__("../../");
232
+ var ___WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__("../..");
233
233
  var _api_client__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__("../../api-client");
234
234
  var _built_in_dynamic_page_utils__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__("../../built-in/dynamic-page/utils");
235
235
  var _collection_manager__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__("../../collection-manager");
@@ -796,6 +796,7 @@ const useResetBlockActionProps = ()=>{
796
796
  const { targets, uid } = findFilterTargets(fieldSchema);
797
797
  form.reset();
798
798
  actionField.data.loading = true;
799
+ let prevMergedFilter = {};
799
800
  try {
800
801
  await Promise.all(getDataBlocks().map(async (block)=>{
801
802
  var _block_service_params, _block_service_params_, _block_service_params1;
@@ -807,8 +808,10 @@ const useResetBlockActionProps = ()=>{
807
808
  delete storedFilter[uid];
808
809
  const mergedFilter = (0, _filter_provider_utils__WEBPACK_IMPORTED_MODULE_15__.mergeFilter)([
809
810
  ...Object.values(storedFilter),
810
- block.defaultFilter
811
+ block.defaultFilter,
812
+ prevMergedFilter
811
813
  ]);
814
+ prevMergedFilter = mergedFilter;
812
815
  return block.doFilter({
813
816
  ...param,
814
817
  page: 1,
@@ -435,6 +435,9 @@ const getProps = (app)=>{
435
435
  },
436
436
  'pm.remove': {
437
437
  title: 'Removing plugin'
438
+ },
439
+ refreshEventSource: {
440
+ title: 'Refreshing event source'
438
441
  }
439
442
  };
440
443
  return {
@@ -59,9 +59,9 @@ const schema_namespaceObject = require("@tachybase/schema");
59
59
  const external_antd_namespaceObject = require("antd");
60
60
  const external_dayjs_namespaceObject = require("dayjs");
61
61
  var external_dayjs_default = /*#__PURE__*/ __webpack_require__.n(external_dayjs_namespaceObject);
62
- const external_loadConstrueLocale_js_namespaceObject = require("./loadConstrueLocale.js");
63
62
  const Plugin_js_namespaceObject = require("../../application/Plugin.js");
64
63
  const index_js_namespaceObject = require("../../locale/index.js");
64
+ const external_loadConstrueLocale_js_namespaceObject = require("./loadConstrueLocale.js");
65
65
  function _define_property(obj, key, value) {
66
66
  if (key in obj) Object.defineProperty(obj, key, {
67
67
  value: value,
@@ -118,6 +118,10 @@ class LocalePlugin extends Plugin_js_namespaceObject.Plugin {
118
118
  external_dayjs_default().updateLocale(dayjsLang, localeSetting);
119
119
  window['cronLocale'] = null == data ? void 0 : null === (_data_data4 = data.data) || void 0 === _data_data4 ? void 0 : _data_data4.cron;
120
120
  } catch (error) {
121
+ var _error_response;
122
+ if ((null == error ? void 0 : null === (_error_response = error.response) || void 0 === _error_response ? void 0 : _error_response.status) === 401) setTimeout(()=>{
123
+ window.location.href = '/signIn';
124
+ }, 1000);
121
125
  throw error;
122
126
  }
123
127
  }
@@ -38,11 +38,12 @@ SystemSettingsContext.displayName = 'SystemSettingsContext';
38
38
  const useSystemSettings = ()=>(0, external_react_namespaceObject.useContext)(SystemSettingsContext);
39
39
  const SystemSettingsProvider = (props)=>{
40
40
  const result = (0, index_js_namespaceObject.useRequest)({
41
- url: 'systemSettings:get/1?appends=logo'
41
+ url: 'systemSettings:get'
42
42
  });
43
- if (result.loading) return;
44
43
  return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(SystemSettingsContext.Provider, {
45
- value: result,
44
+ value: {
45
+ ...result
46
+ },
46
47
  children: props.children
47
48
  });
48
49
  };
@@ -67,18 +67,18 @@ const useCloseAction = ()=>{
67
67
  const useSystemSettingsValues = (options)=>{
68
68
  const { visible } = (0, external_schema_component_index_js_namespaceObject.useActionContext)();
69
69
  const result = (0, external_index_js_namespaceObject.useSystemSettings)();
70
- return (0, external_index_js_namespaceObject_1.useRequest)(()=>Promise.resolve(result.data), {
70
+ return (0, external_index_js_namespaceObject_1.useRequest)(()=>Promise.resolve(null == result ? void 0 : result.data), {
71
71
  ...options,
72
72
  refreshDeps: [
73
- visible
73
+ visible,
74
+ null == result ? void 0 : result.data
74
75
  ]
75
76
  });
76
77
  };
77
78
  const useSaveSystemSettingsValues = ()=>{
78
79
  const { setVisible } = (0, external_schema_component_index_js_namespaceObject.useActionContext)();
79
80
  const form = (0, schema_namespaceObject.useForm)();
80
- const { message } = external_antd_namespaceObject.App.useApp();
81
- const { mutate, data } = (0, external_index_js_namespaceObject.useSystemSettings)();
81
+ const { mutate, data } = (0, external_index_js_namespaceObject.useSystemSettings)() || {};
82
82
  const api = (0, external_index_js_namespaceObject_1.useAPIClient)();
83
83
  const { t } = (0, external_react_i18next_namespaceObject.useTranslation)();
84
84
  return {
@@ -93,11 +93,11 @@ const useSaveSystemSettingsValues = ()=>{
93
93
  }
94
94
  });
95
95
  await api.request({
96
- url: 'systemSettings:update/1',
96
+ url: 'systemSettings:put',
97
97
  method: 'post',
98
98
  data: values
99
99
  });
100
- message.success(t('Saved successfully'));
100
+ external_antd_namespaceObject.message.success(t('Saved successfully'));
101
101
  const lang = (null === (_values_enabledLanguages = values.enabledLanguages) || void 0 === _values_enabledLanguages ? void 0 : _values_enabledLanguages[0]) || 'en-US';
102
102
  if (values.enabledLanguages.length < 2 && api.auth.getLocale() !== lang) {
103
103
  api.auth.setLocale('');
@@ -118,11 +118,14 @@ const schema = {
118
118
  type: 'void',
119
119
  title: '{{t("System settings")}}',
120
120
  properties: {
121
- title: {
121
+ raw_title: {
122
122
  type: 'string',
123
123
  title: "{{t('System title')}}",
124
124
  'x-decorator': 'FormItem',
125
- 'x-component': 'Input',
125
+ 'x-component': 'TextAreaWithGlobalScope',
126
+ 'x-component-props': {
127
+ supportsLineBreak: true
128
+ },
126
129
  required: true
127
130
  },
128
131
  logo: {