@tachybase/client 1.6.20 → 1.6.22

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 (190) hide show
  1. package/es/api-client/APIClient.d.ts +2 -1
  2. package/es/api-client/APIClient.mjs +6 -3
  3. package/es/application/Plugin.d.ts +2 -2
  4. package/es/application/hoc/withDynamicSchemaProps.mjs +1 -1
  5. package/es/application/schema-initializer/hooks/index.mjs +4 -1
  6. package/es/application/schema-settings/components/SchemaSettingsChildren.mjs +14 -14
  7. package/es/application/utils/clientModuleRegistry.d.ts +2 -0
  8. package/es/application/utils/clientModuleRegistry.mjs +9 -0
  9. package/es/application/utils/globalDeps.mjs +3 -3
  10. package/es/block-provider/BlockProvider.d.ts +1 -27
  11. package/es/block-provider/BlockProvider.mjs +1 -3
  12. package/es/block-provider/BlockRequestContext.d.ts +27 -0
  13. package/es/block-provider/BlockRequestContext.mjs +5 -0
  14. package/es/block-provider/FormBlockContext.d.ts +32 -0
  15. package/es/block-provider/FormBlockContext.mjs +5 -0
  16. package/es/block-provider/FormBlockProvider.d.ts +1 -33
  17. package/es/block-provider/FormBlockProvider.mjs +4 -5
  18. package/es/built-in/acl/ACLCollectionFieldProvider.d.ts +1 -0
  19. package/es/built-in/acl/ACLCollectionFieldProvider.mjs +42 -0
  20. package/es/built-in/acl/ACLContext.d.ts +9 -0
  21. package/es/built-in/acl/ACLContext.mjs +24 -0
  22. package/es/built-in/acl/ACLPlugin.mjs +2 -1
  23. package/es/built-in/acl/ACLProvider.d.ts +0 -11
  24. package/es/built-in/acl/ACLProvider.mjs +6 -51
  25. package/es/built-in/acl/index.d.ts +2 -0
  26. package/es/built-in/acl/index.mjs +2 -0
  27. package/es/collection-manager/hooks/useCollectionManager_deprecated.mjs +2 -1
  28. package/es/collection-manager/sub-table.d.ts +1 -1
  29. package/es/data-source/data-source/DataSourceManager.d.ts +1 -2
  30. package/es/data-source/data-source/DataSourceManager.mjs +1 -2
  31. package/es/data-source/data-source/constants.d.ts +2 -0
  32. package/es/data-source/data-source/constants.mjs +3 -0
  33. package/es/data-source/utils.d.ts +2 -2
  34. package/es/data-source/utils.mjs +1 -1
  35. package/es/exports.d.ts +46 -0
  36. package/es/exports.mjs +46 -0
  37. package/es/filter-provider/utils.d.ts +2 -14
  38. package/es/filter-provider/utils.mjs +2 -57
  39. package/es/index.d.ts +1 -46
  40. package/es/index.mjs +4 -46
  41. package/es/modules/fields/component/SubTable/subTablePopoverComponentFieldSettings.d.ts +2 -86
  42. package/es/record-provider/index.mjs +3 -3
  43. package/es/schema-component/antd/action/Action.mjs +7 -6
  44. package/es/schema-component/antd/action/hooks.mjs +3 -2
  45. package/es/schema-component/antd/association-field/AssociationSelect.mjs +4 -3
  46. package/es/schema-component/antd/association-field/hooks.mjs +18 -1
  47. package/es/schema-component/antd/cron/CronSet.mjs +9 -3
  48. package/es/schema-component/antd/date-picker/util.mjs +4 -0
  49. package/es/schema-component/antd/filter/conditionUtils.d.ts +2 -0
  50. package/es/schema-component/antd/filter/conditionUtils.mjs +133 -0
  51. package/es/schema-component/antd/filter/dateValueUtils.d.ts +13 -0
  52. package/es/schema-component/antd/filter/dateValueUtils.mjs +66 -0
  53. package/es/schema-component/antd/filter/useFilterActionProps.d.ts +2 -4
  54. package/es/schema-component/antd/filter/useFilterActionProps.mjs +3 -181
  55. package/es/schema-component/antd/filter/useGetFilterOptions.d.ts +2 -0
  56. package/es/schema-component/antd/filter/useGetFilterOptions.mjs +54 -0
  57. package/es/schema-component/antd/form/Form.mjs +1 -1
  58. package/es/schema-component/antd/form-item/FormItem.FilterFormDesigner.mjs +1 -1
  59. package/es/schema-component/antd/form-item/FormItem.d.ts +1 -1
  60. package/es/schema-component/antd/form-item/FormItem.mjs +14 -12
  61. package/es/schema-component/antd/form-item/SchemaSettingOptions.d.ts +1 -14
  62. package/es/schema-component/antd/form-item/SchemaSettingOptions.mjs +1 -33
  63. package/es/schema-component/antd/form-item/hooks/useLazyLoadDisplayAssociationFieldsOfForm.mjs +4 -3
  64. package/es/schema-component/antd/form-item/hooks/useParseDefaultValue.mjs +5 -3
  65. package/es/schema-component/antd/form-item/operatorUtils.d.ts +14 -0
  66. package/es/schema-component/antd/form-item/operatorUtils.mjs +36 -0
  67. package/es/schema-component/antd/form-v2/Form.mjs +26 -167
  68. package/es/schema-component/antd/form-v2/FormLinkageRules.d.ts +9 -0
  69. package/es/schema-component/antd/form-v2/FormLinkageRules.mjs +191 -0
  70. package/es/schema-component/antd/form-v2/Templates.mjs +1 -1
  71. package/es/schema-component/antd/grid/Grid.mjs +6 -4
  72. package/es/schema-component/antd/grid-card/GridCard.Item.mjs +2 -2
  73. package/es/schema-component/antd/icon-picker/IconFilterInput.mjs +12 -4
  74. package/es/schema-component/antd/icon-picker/IconPicker.mjs +1 -1
  75. package/es/schema-component/antd/input/Json.d.ts +1 -4
  76. package/es/schema-component/antd/input/ReadPretty.mjs +2 -2
  77. package/es/schema-component/antd/input-number/ReadPretty.mjs +1 -1
  78. package/es/schema-component/antd/markdown/Markdown.Void.Designer.mjs +2 -1
  79. package/es/schema-component/antd/markdown/Markdown.Void.mjs +10 -2
  80. package/es/schema-component/antd/markdown/Markdown.mjs +1 -1
  81. package/es/schema-component/antd/markdown/util.mjs +5 -0
  82. package/es/schema-component/antd/rich-text/RichText.mjs +1 -1
  83. package/es/schema-component/antd/select/FormulaSelect.mjs +1 -2
  84. package/es/schema-component/antd/select/ReadPretty.mjs +2 -2
  85. package/es/schema-component/antd/select/Select.mjs +1 -2
  86. package/es/schema-component/antd/select/utils.d.ts +2 -1
  87. package/es/schema-component/antd/select/utils.mjs +2 -2
  88. package/es/schema-component/antd/time-picker/ReadPretty.mjs +1 -1
  89. package/es/schema-component/antd/upload/ReadPretty.mjs +5 -5
  90. package/es/schema-component/antd/upload/Upload.mjs +6 -5
  91. package/es/schema-component/antd/variable/Input.mjs +1 -1
  92. package/es/schema-component/antd/variable/TextArea.mjs +1 -1
  93. package/es/schema-component/hooks/useDesigner.mjs +9 -3
  94. package/es/schema-component/hooks/useOptionalNavigate.d.ts +1 -0
  95. package/es/schema-component/hooks/useOptionalNavigate.mjs +2 -0
  96. package/es/schema-settings/DataTemplates/components/Designer.mjs +2 -1
  97. package/es/schema-settings/VariableInput/hooks/useBaseVariable.mjs +2 -1
  98. package/es/schema-settings/VariableInput/hooks/useBlockCollection.mjs +1 -1
  99. package/es/schema-settings/VariableInput/hooks/useContextAssociationFields.mjs +2 -1
  100. package/es/schema-settings/VariableInput/hooks/useFormVariable.mjs +1 -1
  101. package/es/schema-settings/VariableInput/hooks/useRecordVariable.mjs +1 -1
  102. package/es/style/theme/AntdAppProvider.mjs +2 -2
  103. package/es/user/ChangePassword.d.ts +4 -1
  104. package/es/user/CurrentUserContext.d.ts +2 -0
  105. package/es/user/CurrentUserContext.mjs +5 -0
  106. package/es/user/CurrentUserProvider.d.ts +0 -3
  107. package/es/user/CurrentUserProvider.mjs +3 -5
  108. package/es/user/EditProfile.d.ts +4 -1
  109. package/es/user/LanguageSettings.d.ts +4 -1
  110. package/es/user/SwitchRole.d.ts +4 -1
  111. package/es/user/index.d.ts +1 -0
  112. package/es/user/index.mjs +1 -0
  113. package/es/variables/VariablesProvider.mjs +1 -1
  114. package/lib/api-client/APIClient.js +8 -5
  115. package/lib/application/hoc/withDynamicSchemaProps.js +3 -3
  116. package/lib/application/schema-initializer/hooks/index.js +4 -1
  117. package/lib/application/schema-settings/components/SchemaSettingsChildren.js +14 -14
  118. package/lib/application/utils/clientModuleRegistry.js +46 -0
  119. package/lib/application/utils/globalDeps.js +2 -2
  120. package/lib/block-provider/BlockProvider.js +6 -8
  121. package/lib/block-provider/BlockRequestContext.js +42 -0
  122. package/lib/block-provider/FormBlockContext.js +42 -0
  123. package/lib/block-provider/FormBlockProvider.js +13 -14
  124. package/lib/built-in/acl/ACLCollectionFieldProvider.js +76 -0
  125. package/lib/built-in/acl/ACLContext.js +70 -0
  126. package/lib/built-in/acl/ACLPlugin.js +2 -1
  127. package/lib/built-in/acl/ACLProvider.js +13 -76
  128. package/lib/built-in/acl/index.js +27 -9
  129. package/lib/collection-manager/hooks/useCollectionManager_deprecated.js +4 -3
  130. package/lib/data-source/data-source/DataSourceManager.js +6 -7
  131. package/lib/data-source/data-source/constants.js +40 -0
  132. package/lib/data-source/utils.js +2 -2
  133. package/lib/exports.js +769 -0
  134. package/lib/filter-provider/utils.js +7 -63
  135. package/lib/index.js +10 -714
  136. package/lib/record-provider/index.js +6 -6
  137. package/lib/schema-component/antd/action/Action.js +9 -8
  138. package/lib/schema-component/antd/action/hooks.js +3 -2
  139. package/lib/schema-component/antd/association-field/AssociationSelect.js +3 -2
  140. package/lib/schema-component/antd/association-field/hooks.js +18 -1
  141. package/lib/schema-component/antd/cron/CronSet.js +8 -2
  142. package/lib/schema-component/antd/date-picker/util.js +4 -0
  143. package/lib/schema-component/antd/filter/conditionUtils.js +180 -0
  144. package/lib/schema-component/antd/filter/dateValueUtils.js +116 -0
  145. package/lib/schema-component/antd/filter/useFilterActionProps.js +7 -186
  146. package/lib/schema-component/antd/filter/useGetFilterOptions.js +91 -0
  147. package/lib/schema-component/antd/form/Form.js +4 -4
  148. package/lib/schema-component/antd/form-item/FormItem.FilterFormDesigner.js +2 -2
  149. package/lib/schema-component/antd/form-item/FormItem.js +23 -20
  150. package/lib/schema-component/antd/form-item/SchemaSettingOptions.js +6 -38
  151. package/lib/schema-component/antd/form-item/hooks/useLazyLoadDisplayAssociationFieldsOfForm.js +9 -7
  152. package/lib/schema-component/antd/form-item/hooks/useParseDefaultValue.js +12 -8
  153. package/lib/schema-component/antd/form-item/operatorUtils.js +76 -0
  154. package/lib/schema-component/antd/form-v2/Form.js +204 -317
  155. package/lib/schema-component/antd/form-v2/FormLinkageRules.js +236 -0
  156. package/lib/schema-component/antd/form-v2/Templates.js +2 -2
  157. package/lib/schema-component/antd/grid/Grid.js +11 -9
  158. package/lib/schema-component/antd/grid-card/GridCard.Item.js +2 -2
  159. package/lib/schema-component/antd/icon-picker/IconFilterInput.js +12 -4
  160. package/lib/schema-component/antd/icon-picker/IconPicker.js +1 -1
  161. package/lib/schema-component/antd/input/ReadPretty.js +10 -10
  162. package/lib/schema-component/antd/input-number/ReadPretty.js +1 -1
  163. package/lib/schema-component/antd/markdown/Markdown.Void.Designer.js +6 -5
  164. package/lib/schema-component/antd/markdown/Markdown.Void.js +138 -111
  165. package/lib/schema-component/antd/markdown/Markdown.js +2 -2
  166. package/lib/schema-component/antd/markdown/util.js +5 -0
  167. package/lib/schema-component/antd/rich-text/RichText.js +2 -2
  168. package/lib/schema-component/antd/select/FormulaSelect.js +1 -2
  169. package/lib/schema-component/antd/select/ReadPretty.js +2 -2
  170. package/lib/schema-component/antd/select/Select.js +1 -2
  171. package/lib/schema-component/antd/select/utils.js +6 -3
  172. package/lib/schema-component/antd/time-picker/ReadPretty.js +2 -2
  173. package/lib/schema-component/antd/upload/ReadPretty.js +5 -5
  174. package/lib/schema-component/antd/upload/Upload.js +6 -5
  175. package/lib/schema-component/antd/variable/Input.js +1 -1
  176. package/lib/schema-component/antd/variable/TextArea.js +1 -1
  177. package/lib/schema-component/hooks/useDesigner.js +57 -23
  178. package/lib/schema-component/hooks/useOptionalNavigate.js +36 -0
  179. package/lib/schema-settings/DataTemplates/components/Designer.js +4 -3
  180. package/lib/schema-settings/VariableInput/hooks/useBaseVariable.js +4 -3
  181. package/lib/schema-settings/VariableInput/hooks/useBlockCollection.js +2 -2
  182. package/lib/schema-settings/VariableInput/hooks/useContextAssociationFields.js +4 -3
  183. package/lib/schema-settings/VariableInput/hooks/useFormVariable.js +2 -2
  184. package/lib/schema-settings/VariableInput/hooks/useRecordVariable.js +2 -2
  185. package/lib/style/theme/AntdAppProvider.js +4 -4
  186. package/lib/user/CurrentUserContext.js +42 -0
  187. package/lib/user/CurrentUserProvider.js +6 -14
  188. package/lib/user/index.js +24 -12
  189. package/lib/variables/VariablesProvider.js +2 -2
  190. package/package.json +5 -4
@@ -1,14 +1,22 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
+ import { useEffect, useMemo } from "react";
2
3
  import { Input } from "antd";
3
4
  import lodash from "lodash";
4
5
  import { useTranslation } from "react-i18next";
5
6
  const IconFilterInput = (props)=>{
6
7
  const { changeFilterKey } = props;
7
8
  const { t } = useTranslation();
8
- const onChange = lodash.debounce((e)=>{
9
- const inputValue = e.target.value;
10
- changeFilterKey(inputValue);
11
- }, 100);
9
+ const onChange = useMemo(()=>lodash.debounce((e)=>{
10
+ const inputValue = e.target.value;
11
+ changeFilterKey(inputValue);
12
+ }, 100), [
13
+ changeFilterKey
14
+ ]);
15
+ useEffect(()=>()=>{
16
+ onChange.cancel();
17
+ }, [
18
+ onChange
19
+ ]);
12
20
  return /*#__PURE__*/ jsx(Input, {
13
21
  allowClear: true,
14
22
  placeholder: t("The key in Antd, such as 'ApiOutlined', ignoring case"),
@@ -1,8 +1,8 @@
1
1
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
2
  import { useState } from "react";
3
3
  import { connect, isValid, mapProps, mapReadPretty } from "@tachybase/schema";
4
- import { CloseOutlined, LoadingOutlined } from "@ant-design/icons";
5
4
  import { useFormLayout } from "@tego/client";
5
+ import { CloseOutlined, LoadingOutlined } from "@ant-design/icons";
6
6
  import { Button, Space } from "antd";
7
7
  import { useTranslation } from "react-i18next";
8
8
  import { Icon, hasIcon } from "../../../icon/index.mjs";
@@ -4,7 +4,4 @@ export type JSONTextAreaProps = TextAreaProps & {
4
4
  value?: string;
5
5
  space?: number;
6
6
  };
7
- export declare const Json: React.ForwardRefExoticComponent<TextAreaProps & {
8
- value?: string;
9
- space?: number;
10
- } & React.RefAttributes<React.ForwardRefExoticComponent<TextAreaProps & React.RefAttributes<import("antd/es/input/TextArea").TextAreaRef>>>>;
7
+ export declare const Json: React.ForwardRefExoticComponent<JSONTextAreaProps & React.RefAttributes<any>>;
@@ -1,11 +1,11 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import "react";
3
3
  import { useFieldSchema } from "@tachybase/schema";
4
- import { usePrefixCls } from "@tego/client";
5
4
  import { css } from "@emotion/css";
6
5
  import { Image, Typography } from "antd";
7
6
  import classnames from "classnames";
8
- import { useCompile } from "../../index.mjs";
7
+ import { usePrefixCls } from "../__builtins__/index.mjs";
8
+ import { useCompile } from "../../hooks/useCompile.mjs";
9
9
  import { EllipsisWithTooltip } from "./EllipsisWithTooltip.mjs";
10
10
  import { HTMLEncode } from "./shared.mjs";
11
11
  function _tagged_template_literal(strings, raw) {
@@ -1,7 +1,7 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { useMemo } from "react";
3
3
  import { isValid } from "@tachybase/schema";
4
- import { toFixedByStep } from "@tego/client";
4
+ import { toFixedByStep } from "@tachybase/utils/client";
5
5
  import { format as external_d3_format_format } from "d3-format";
6
6
  import { round } from "mathjs";
7
7
  function countDecimalPlaces(value) {
@@ -2,7 +2,8 @@ import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import "react";
3
3
  import { useField } from "@tachybase/schema";
4
4
  import { useTranslation } from "react-i18next";
5
- import { GeneralSchemaDesigner, SchemaSettingsDivider, SchemaSettingsItem, SchemaSettingsRemove } from "../../../schema-settings/index.mjs";
5
+ import { GeneralSchemaDesigner } from "../../../schema-settings/GeneralSchemaDesigner.mjs";
6
+ import { SchemaSettingsDivider, SchemaSettingsItem, SchemaSettingsRemove } from "../../../schema-settings/SchemaSettings.mjs";
6
7
  const MarkdownVoidDesigner = ()=>{
7
8
  const field = useField();
8
9
  const { t } = useTranslation();
@@ -1,14 +1,22 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
- import { useState } from "react";
2
+ import react, { useState } from "react";
3
3
  import { observer, useField, useFieldSchema } from "@tachybase/schema";
4
4
  import { Button, Input, Space, Spin } from "antd";
5
5
  import classnames from "classnames";
6
6
  import { useTranslation } from "react-i18next";
7
7
  import { useGlobalTheme } from "../../../style/theme/index.mjs";
8
8
  import { useDesignable } from "../../hooks/useDesignable.mjs";
9
- import { MarkdownVoidDesigner } from "./Markdown.Void.Designer.mjs";
10
9
  import { useStyles } from "./style.mjs";
11
10
  import { useParseMarkdown } from "./util.mjs";
11
+ const LazyMarkdownVoidDesigner = /*#__PURE__*/ react.lazy(()=>import("./Markdown.Void.Designer.mjs").then((module)=>({
12
+ default: module.MarkdownVoidDesigner
13
+ })));
14
+ const MarkdownVoidDesigner = (props)=>/*#__PURE__*/ jsx(react.Suspense, {
15
+ fallback: null,
16
+ children: /*#__PURE__*/ jsx(LazyMarkdownVoidDesigner, {
17
+ ...props
18
+ })
19
+ });
12
20
  const MarkdownEditor = (props)=>{
13
21
  const { t } = useTranslation();
14
22
  const [value, setValue] = useState(props.defaultValue);
@@ -4,7 +4,7 @@ import { connect, mapProps, mapReadPretty } from "@tachybase/schema";
4
4
  import { LoadingOutlined } from "@ant-design/icons";
5
5
  import { Input, Spin } from "antd";
6
6
  import { useGlobalTheme } from "../../../style/theme/index.mjs";
7
- import { ReadPretty } from "../input/index.mjs";
7
+ import { ReadPretty } from "../input/ReadPretty.mjs";
8
8
  import { MarkdownVoid } from "./Markdown.Void.mjs";
9
9
  import { useStyles } from "./style.mjs";
10
10
  import { convertToText, useParseMarkdown } from "./util.mjs";
@@ -14,11 +14,16 @@ function useParseMarkdown(text) {
14
14
  const [html, setHtml] = useState('');
15
15
  const [loading, setLoading] = useState(false);
16
16
  useEffect(()=>{
17
+ let mounted = true;
17
18
  setLoading(true);
18
19
  parseMarkdown(text).then((r)=>{
20
+ if (!mounted) return;
19
21
  setHtml(r);
20
22
  setLoading(false);
21
23
  });
24
+ return ()=>{
25
+ mounted = false;
26
+ };
22
27
  }, [
23
28
  text
24
29
  ]);
@@ -3,7 +3,7 @@ import "react";
3
3
  import { connect, mapProps, mapReadPretty } from "@tachybase/schema";
4
4
  import react_quill from "react-quill";
5
5
  import { isVariable } from "../../../variables/utils/isVariable.mjs";
6
- import { ReadPretty } from "../input/index.mjs";
6
+ import { ReadPretty } from "../input/ReadPretty.mjs";
7
7
  import { useStyles } from "./style.mjs";
8
8
  const RichText = connect((props)=>{
9
9
  const { wrapSSR, hashId, componentCls } = useStyles();
@@ -2,11 +2,10 @@ import { jsx } from "react/jsx-runtime";
2
2
  import { useEffect, useMemo, useState } from "react";
3
3
  import { isValid, toArr, useFieldSchema, useForm } from "@tachybase/schema";
4
4
  import { CloseCircleFilled, CloseOutlined } from "@ant-design/icons";
5
- import { isPlainObject } from "@tego/client";
6
5
  import { Empty, Select, Spin, Tag } from "antd";
7
6
  import { useAPIClient, useRequest } from "../../../api-client/index.mjs";
8
7
  import { useCollection_deprecated } from "../../../collection-manager/index.mjs";
9
- import { getCurrentOptions } from "./utils.mjs";
8
+ import { getCurrentOptions, isPlainObject } from "./utils.mjs";
10
9
  const isEmptyObject = (val)=>!isValid(val) || 'object' == typeof val && 0 === Object.keys(val).length;
11
10
  const ObjectSelect = (props)=>{
12
11
  const { value, options, onChange, mode, fieldNames, loading, rawOptions, defaultValue, ...others } = props;
@@ -12,10 +12,10 @@ const ReadPretty = observer((props)=>{
12
12
  ...props.fieldNames
13
13
  };
14
14
  const field = useField();
15
- if (!isValid(props.value)) return /*#__PURE__*/ jsx("div", {});
16
- if (isArrayField(field) && (null == field ? void 0 : null == (_field_value = field.value) ? void 0 : _field_value.length) === 0) return /*#__PURE__*/ jsx("div", {});
17
15
  const collectionField = useCollectionField();
18
16
  const fieldSchema = useFieldSchema();
17
+ if (!isValid(props.value)) return /*#__PURE__*/ jsx("div", {});
18
+ if (isArrayField(field) && (null == field ? void 0 : null == (_field_value = field.value) ? void 0 : _field_value.length) === 0) return /*#__PURE__*/ jsx("div", {});
19
19
  const dataSource = field.dataSource || props.options || (null == collectionField ? void 0 : collectionField.uiSchema.enum) || [];
20
20
  const options = getCurrentOptions(field.value, dataSource, fieldNames);
21
21
  const currentOptions = getFormulaValue(null == (_fieldSchema_xcomponentprops = fieldSchema['x-component-props']) ? void 0 : null == (_fieldSchema_xcomponentprops_fieldNames = _fieldSchema_xcomponentprops.fieldNames) ? void 0 : _fieldSchema_xcomponentprops_fieldNames['formula'], options, fieldSchema);
@@ -1,11 +1,10 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { connect, isValid, mapProps, mapReadPretty, toArr } from "@tachybase/schema";
3
3
  import { CloseCircleFilled, CloseOutlined, LoadingOutlined } from "@ant-design/icons";
4
- import { isPlainObject } from "@tego/client";
5
4
  import { Empty, Radio, Select, Spin, Tag } from "antd";
6
5
  import FormulaSelect from "./FormulaSelect.mjs";
7
6
  import { ReadPretty } from "./ReadPretty.mjs";
8
- import { defaultFieldNames, getCurrentOptions } from "./utils.mjs";
7
+ import { defaultFieldNames, getCurrentOptions, isPlainObject } from "./utils.mjs";
9
8
  const isEmptyObject = (val)=>!isValid(val) || 'object' == typeof val && 0 === Object.keys(val).length;
10
9
  const ObjectSelect = (props)=>{
11
10
  const { value, options, onChange, fieldNames, mode, loading, rawOptions, defaultValue, ...others } = props;
@@ -1,3 +1,4 @@
1
+ import { isPlainObject } from '@tachybase/utils/client';
1
2
  export interface FieldNames {
2
3
  label: string;
3
4
  value: string;
@@ -5,10 +6,10 @@ export interface FieldNames {
5
6
  options: string;
6
7
  }
7
8
  export declare const defaultFieldNames: FieldNames;
9
+ export { isPlainObject };
8
10
  interface Option {
9
11
  label: string;
10
12
  value: string;
11
13
  icon?: any;
12
14
  }
13
15
  export declare function getCurrentOptions(values: string | string[], dataSource: any[], fieldNames: FieldNames): Option[];
14
- export {};
@@ -1,4 +1,4 @@
1
- import { isPlainObject } from "@tego/client";
1
+ import { isPlainObject } from "@tachybase/utils/client";
2
2
  import { castArray } from "lodash";
3
3
  const defaultFieldNames = {
4
4
  label: 'label',
@@ -35,4 +35,4 @@ function getCurrentOptions(values, dataSource, fieldNames) {
35
35
  }
36
36
  return findOptions(result);
37
37
  }
38
- export { defaultFieldNames, getCurrentOptions };
38
+ export { defaultFieldNames, getCurrentOptions, isPlainObject };
@@ -1,9 +1,9 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import "react";
3
3
  import { toArr } from "@tachybase/schema";
4
- import { usePrefixCls } from "@tego/client";
5
4
  import classnames from "classnames";
6
5
  import dayjs from "dayjs";
6
+ import { usePrefixCls } from "../__builtins__/index.mjs";
7
7
  const ReadPretty = (props)=>{
8
8
  const { value, format = 'HH:mm:ss' } = props;
9
9
  const prefixCls = usePrefixCls("description-text", props);
@@ -13,7 +13,7 @@ import { toFileList } from "./shared.mjs";
13
13
  import { useStyles } from "./style.mjs";
14
14
  const ReadPretty = ()=>null;
15
15
  ReadPretty.File = function(props) {
16
- var _images_fileIndex, _images_, _images_1, _images_fileIndex1;
16
+ var _app_AttachmentPreviewManager_get, _app_AttachmentPreviewManager, _images_fileIndex, _images_, _images_1, _images_fileIndex1;
17
17
  const { size, showCount = 0 } = props;
18
18
  const record = useRecord();
19
19
  const field = useField();
@@ -24,7 +24,7 @@ ReadPretty.File = function(props) {
24
24
  const [rotate, setRotate] = useState(0);
25
25
  const { wrapSSR, hashId, componentCls: prefixCls } = useStyles();
26
26
  const useUploadStyleVal = style["default"] ? style["default"] : style;
27
- const previewList = app.AttachmentPreviewManager.get();
27
+ const previewList = (null == (_app_AttachmentPreviewManager = app.AttachmentPreviewManager) ? void 0 : null == (_app_AttachmentPreviewManager_get = _app_AttachmentPreviewManager.get) ? void 0 : _app_AttachmentPreviewManager_get.call(_app_AttachmentPreviewManager)) || {};
28
28
  useUploadStyleVal(prefixCls);
29
29
  return wrapSSR(/*#__PURE__*/ jsxs("div", {
30
30
  children: [
@@ -136,7 +136,7 @@ ReadPretty.Upload = function() {
136
136
  };
137
137
  const ReadFile = (param)=>{
138
138
  let { file, prefixCls, size, images, setFileIndex, setVisible, preview } = param;
139
- const { viewComponet } = preview;
139
+ const viewComponet = null == preview ? void 0 : preview.viewComponet;
140
140
  const handleClick = (e)=>{
141
141
  const index = images.indexOf(file);
142
142
  e.preventDefault();
@@ -167,14 +167,14 @@ const ReadFile = (param)=>{
167
167
  style: {
168
168
  lineHeight: '100%'
169
169
  },
170
- children: viewComponet({
170
+ children: viewComponet ? viewComponet({
171
171
  images,
172
172
  size,
173
173
  prefixCls,
174
174
  file,
175
175
  setFileIndex,
176
176
  setVisible
177
- })
177
+ }) : null
178
178
  }),
179
179
  /*#__PURE__*/ jsx("a", {
180
180
  target: "_blank",
@@ -19,12 +19,13 @@ const Upload_Upload = connect((props)=>/*#__PURE__*/ jsx(Upload, {
19
19
  value: 'fileList'
20
20
  }), mapReadPretty(ReadPretty.Upload));
21
21
  Upload_Upload.Attachment = connect((props)=>{
22
- var _images_fileIndex, _images_, _images_1, _images_fileIndex1;
22
+ var _app_AttachmentPreviewManager, _images_fileIndex, _images_, _images_1, _images_fileIndex1;
23
23
  const { disabled, multiple, value, onChange } = props;
24
24
  const [fileList, setFileList] = useState([]);
25
25
  const [sync, setSync] = useState(true);
26
26
  const app = useApp();
27
- const previewList = app.AttachmentPreviewManager.get();
27
+ var _app_AttachmentPreviewManager_get;
28
+ const previewList = null != (_app_AttachmentPreviewManager_get = null == app ? void 0 : null == (_app_AttachmentPreviewManager = app.AttachmentPreviewManager) ? void 0 : _app_AttachmentPreviewManager.get()) ? _app_AttachmentPreviewManager_get : {};
28
29
  const images = fileList;
29
30
  const [fileIndex, setFileIndex] = useState(0);
30
31
  const [visible, setVisible] = useState(false);
@@ -264,7 +265,7 @@ const UploadReadFile = (props)=>{
264
265
  setVisible(true);
265
266
  setFileIndex(index);
266
267
  };
267
- const { viewComponet } = preview;
268
+ const viewComponet = null == preview ? void 0 : preview.viewComponet;
268
269
  return /*#__PURE__*/ jsx("div", {
269
270
  className: "".concat(prefixCls, "-list-picture-card-container ").concat(prefixCls, "-list-item-container"),
270
271
  children: /*#__PURE__*/ jsxs("div", {
@@ -284,12 +285,12 @@ const UploadReadFile = (props)=>{
284
285
  style: {
285
286
  lineHeight: '100%'
286
287
  },
287
- children: viewComponet({
288
+ children: viewComponet ? viewComponet({
288
289
  prefixCls,
289
290
  file,
290
291
  setFileIndex,
291
292
  setVisible
292
- })
293
+ }) : null
293
294
  }),
294
295
  /*#__PURE__*/ jsx("a", {
295
296
  target: "_blank",
@@ -1,8 +1,8 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import react, { useCallback, useEffect, useMemo } from "react";
3
3
  import { useForm } from "@tachybase/schema";
4
+ import { error } from "@tachybase/utils/client";
4
5
  import { CloseCircleFilled } from "@ant-design/icons";
5
- import { error } from "@tego/client";
6
6
  import { Cascader, DatePicker, Input, InputNumber, Select, Space, Tag } from "antd";
7
7
  import { createStyles } from "antd-style";
8
8
  import classnames from "classnames";
@@ -1,7 +1,7 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { useCallback, useEffect, useMemo, useRef, useState } from "react";
3
3
  import { useFieldSchema, useForm } from "@tachybase/schema";
4
- import { error } from "@tego/client";
4
+ import { error } from "@tachybase/utils/client";
5
5
  import { Space } from "antd";
6
6
  import classnames from "classnames";
7
7
  import { cloneDeep } from "lodash";
@@ -1,8 +1,14 @@
1
- import { useMemo } from "react";
1
+ import react, { useMemo } from "react";
2
2
  import { useFieldSchema } from "@tachybase/schema";
3
- import { useComponent, useDesignable } from "./index.mjs";
4
- import { SchemaToolbar } from "../../schema-settings/index.mjs";
3
+ import { useComponent } from "./useComponent.mjs";
4
+ import { useDesignable } from "./useDesignable.mjs";
5
5
  const Def = ()=>null;
6
+ const LazySchemaToolbar = react.lazy(()=>import("../../schema-settings/GeneralSchemaDesigner.mjs").then((module)=>({
7
+ default: module.SchemaToolbar
8
+ })));
9
+ const SchemaToolbar = (props)=>react.createElement(react.Suspense, {
10
+ fallback: null
11
+ }, react.createElement(LazySchemaToolbar, props));
6
12
  const useDesigner = ()=>{
7
13
  const { designable } = useDesignable();
8
14
  const fieldSchema = useFieldSchema();
@@ -0,0 +1 @@
1
+ export { useNavigate as useOptionalNavigate } from 'react-router-dom';
@@ -0,0 +1,2 @@
1
+ import { useNavigate } from "react-router-dom";
2
+ export { useNavigate as useOptionalNavigate };
@@ -5,11 +5,12 @@ import { error } from "@tego/client";
5
5
  import { Select } from "antd";
6
6
  import lodash from "lodash";
7
7
  import { useTranslation } from "react-i18next";
8
- import { GeneralSchemaDesigner, SchemaSettingsItem } from "../../index.mjs";
9
8
  import { useFormBlockContext } from "../../../block-provider/index.mjs";
10
9
  import { useCollectionManager_deprecated } from "../../../collection-manager/index.mjs";
11
10
  import { mergeFilter } from "../../../filter-provider/utils.mjs";
12
11
  import { removeNullCondition, useCompile, useDesignable } from "../../../schema-component/index.mjs";
12
+ import { GeneralSchemaDesigner } from "../../GeneralSchemaDesigner.mjs";
13
+ import { SchemaSettingsItem } from "../../SchemaSettings.mjs";
13
14
  import { SchemaSettingsDataScope } from "../../SchemaSettingsDataScope.mjs";
14
15
  const Designer = observer(()=>{
15
16
  const { getCollectionFields, getCollectionField, getCollection, isTitleField } = useCollectionManager_deprecated();
@@ -1,8 +1,9 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import react, { useContext, useMemo } from "react";
3
3
  import { useCollectionManager_deprecated } from "../../../collection-manager/index.mjs";
4
- import { useCompile, useGetFilterOptions } from "../../../schema-component/index.mjs";
4
+ import { useGetFilterOptions } from "../../../schema-component/antd/filter/useGetFilterOptions.mjs";
5
5
  import { isSpecialCaseField } from "../../../schema-component/antd/form-item/hooks/useSpecialCase.mjs";
6
+ import { useCompile } from "../../../schema-component/hooks/useCompile.mjs";
6
7
  const BaseVariableContext = /*#__PURE__*/ react.createContext(null);
7
8
  const BaseVariableProvider = (props)=>/*#__PURE__*/ jsx(BaseVariableContext.Provider, {
8
9
  value: props,
@@ -1,4 +1,4 @@
1
- import { useBlockRequestContext } from "../../../block-provider/BlockProvider.mjs";
1
+ import { useBlockRequestContext } from "../../../block-provider/BlockRequestContext.mjs";
2
2
  const useBlockCollection = ()=>{
3
3
  var _ctx_props, _ctx_props1;
4
4
  const ctx = useBlockRequestContext();
@@ -2,7 +2,8 @@ import { useMemo } from "react";
2
2
  import { error } from "@tego/client";
3
3
  import { useTranslation } from "react-i18next";
4
4
  import { useCollectionManager_deprecated } from "../../../collection-manager/index.mjs";
5
- import { useCompile, useGetFilterOptions } from "../../../schema-component/index.mjs";
5
+ import { useGetFilterOptions } from "../../../schema-component/antd/filter/useGetFilterOptions.mjs";
6
+ import { useCompile } from "../../../schema-component/hooks/useCompile.mjs";
6
7
  const useIsSameOrChildCollection = ()=>{
7
8
  const { getChildrenCollections } = useCollectionManager_deprecated();
8
9
  return (contextCollection, targetCollection)=>{
@@ -1,5 +1,5 @@
1
1
  import { useTranslation } from "react-i18next";
2
- import { useFormBlockContext } from "../../../block-provider/index.mjs";
2
+ import { useFormBlockContext } from "../../../block-provider/FormBlockContext.mjs";
3
3
  import { useBaseVariable } from "./useBaseVariable.mjs";
4
4
  const useFormVariable = (param)=>{
5
5
  let { collectionName, collectionField, schema, noDisabled, targetFieldSchema } = param;
@@ -1,6 +1,6 @@
1
1
  import lodash from "lodash";
2
2
  import { useTranslation } from "react-i18next";
3
- import { useFormBlockContext } from "../../../block-provider/FormBlockProvider.mjs";
3
+ import { useFormBlockContext } from "../../../block-provider/FormBlockContext.mjs";
4
4
  import { useBaseVariable } from "./useBaseVariable.mjs";
5
5
  const useRecordVariable = (props)=>{
6
6
  const { t } = useTranslation();
@@ -1,8 +1,8 @@
1
1
  import { Fragment, jsx } from "react/jsx-runtime";
2
2
  import { memo, useEffect } from "react";
3
3
  import { App } from "antd";
4
- import { useAPIClient } from "../../api-client/index.mjs";
5
- import { useApp } from "../../application/index.mjs";
4
+ import { useAPIClient } from "../../api-client/hooks/useAPIClient.mjs";
5
+ import { useApp } from "../../application/hooks/useApp.mjs";
6
6
  const AppInner = /*#__PURE__*/ memo((param)=>{
7
7
  let { children } = param;
8
8
  const app = useApp();
@@ -1 +1,4 @@
1
- export declare const useChangePassword: () => import("antd/es/menu/interface").ItemType;
1
+ import { MenuProps } from 'antd';
2
+ type MenuItem = NonNullable<MenuProps['items']>[number];
3
+ export declare const useChangePassword: () => MenuItem;
4
+ export {};
@@ -0,0 +1,2 @@
1
+ export declare const CurrentUserContext: import("react").Context<any>;
2
+ export declare const useCurrentUserContext: () => any;
@@ -0,0 +1,5 @@
1
+ import { createContext, useContext } from "react";
2
+ const CurrentUserContext = createContext(null);
3
+ CurrentUserContext.displayName = 'CurrentUserContext';
4
+ const useCurrentUserContext = ()=>useContext(CurrentUserContext);
5
+ export { CurrentUserContext, useCurrentUserContext };
@@ -1,6 +1,3 @@
1
- import React from 'react';
2
- export declare const CurrentUserContext: React.Context<import("..").UseRequestResult<any>>;
3
- export declare const useCurrentUserContext: () => import("..").UseRequestResult<any>;
4
1
  export declare const useCurrentRoles: () => any;
5
2
  export declare const CurrentUserProvider: (props: any) => import("react/jsx-runtime").JSX.Element;
6
3
  export declare const NavigateIfNotSignIn: ({ children }: {
@@ -1,12 +1,10 @@
1
1
  import { Fragment, jsx } from "react/jsx-runtime";
2
- import { createContext, useContext, useMemo } from "react";
2
+ import { useMemo } from "react";
3
3
  import { Navigate, useLocation } from "react-router-dom";
4
4
  import { useAPIClient, useRequest } from "../api-client/index.mjs";
5
5
  import { useACLRoleContext } from "../built-in/acl/index.mjs";
6
6
  import { useCompile } from "../schema-component/index.mjs";
7
- const CurrentUserContext = /*#__PURE__*/ createContext(null);
8
- CurrentUserContext.displayName = 'CurrentUserContext';
9
- const useCurrentUserContext = ()=>useContext(CurrentUserContext);
7
+ import { CurrentUserContext, useCurrentUserContext } from "./CurrentUserContext.mjs";
10
8
  const useCurrentRoles = ()=>{
11
9
  var _data_data;
12
10
  const { allowAnonymous } = useACLRoleContext();
@@ -59,4 +57,4 @@ const NavigateIfNotSignIn = (param)=>{
59
57
  children: children
60
58
  });
61
59
  };
62
- export { CurrentUserContext, CurrentUserProvider, NavigateIfNotSignIn, useCurrentRoles, useCurrentUserContext };
60
+ export { CurrentUserProvider, NavigateIfNotSignIn, useCurrentRoles };
@@ -1 +1,4 @@
1
- export declare const useEditProfile: () => import("antd/es/menu/interface").ItemType;
1
+ import { MenuProps } from 'antd';
2
+ type MenuItem = NonNullable<MenuProps['items']>[number];
3
+ export declare const useEditProfile: () => MenuItem;
4
+ export {};
@@ -1 +1,4 @@
1
- export declare const useLanguageSettings: () => import("antd/es/menu/interface").ItemType;
1
+ import { MenuProps } from 'antd';
2
+ type MenuItem = NonNullable<MenuProps['items']>[number];
3
+ export declare const useLanguageSettings: () => MenuItem | null;
4
+ export {};
@@ -1 +1,4 @@
1
- export declare const useSwitchRole: () => import("antd/es/menu/interface").ItemType;
1
+ import { MenuProps } from 'antd';
2
+ type MenuItem = NonNullable<MenuProps['items']>[number];
3
+ export declare const useSwitchRole: () => MenuItem | null;
4
+ export {};
@@ -1,3 +1,4 @@
1
+ export * from './CurrentUserContext';
1
2
  export * from './CurrentUser';
2
3
  export * from './CurrentUserProvider';
3
4
  export * from './CurrentUserSettingsMenuProvider';
package/es/user/index.mjs CHANGED
@@ -1,4 +1,5 @@
1
1
  import VerificationCode from "./VerificationCode.mjs";
2
+ export * from "./CurrentUserContext.mjs";
2
3
  export * from "./CurrentUser.mjs";
3
4
  export * from "./CurrentUserProvider.mjs";
4
5
  export * from "./CurrentUserSettingsMenuProvider.mjs";
@@ -5,7 +5,7 @@ import { getValuesByPath } from "@tego/client";
5
5
  import lodash from "lodash";
6
6
  import { useAPIClient } from "../api-client/index.mjs";
7
7
  import { useCollectionManager_deprecated } from "../collection-manager/index.mjs";
8
- import { useCompile } from "../schema-component/index.mjs";
8
+ import { useCompile } from "../schema-component/hooks/useCompile.mjs";
9
9
  import useBuiltinVariables from "./hooks/useBuiltinVariables.mjs";
10
10
  import { filterEmptyValues } from "./utils/filterEmptyValues.mjs";
11
11
  import { getAction } from "./utils/getAction.mjs";
@@ -39,7 +39,7 @@ const external_react_namespaceObject = require("react");
39
39
  var external_react_default = /*#__PURE__*/ __webpack_require__.n(external_react_namespaceObject);
40
40
  const client_namespaceObject = require("@tego/client");
41
41
  const external_antd_namespaceObject = require("antd");
42
- const external_index_js_namespaceObject = require("../index.js");
42
+ const index_js_namespaceObject = require("../i18n/index.js");
43
43
  function _define_property(obj, key, value) {
44
44
  if (key in obj) Object.defineProperty(obj, key, {
45
45
  value: value,
@@ -62,10 +62,10 @@ function notify(type, messages, instance) {
62
62
  if (!(null == messages ? void 0 : messages.length)) return;
63
63
  const translatedMessages = messages.map((item)=>{
64
64
  const msg = 'string' == typeof item ? item : item.message;
65
- const translated = external_index_js_namespaceObject.i18n.t(msg);
65
+ const translated = index_js_namespaceObject.i18n.t(msg);
66
66
  if (TECH_PATTERNS.some((r)=>r.test(msg))) {
67
67
  console.error('[TechError]', msg);
68
- return external_index_js_namespaceObject.i18n.t('The current operation was not successful. You can wait a moment or contact technical support.');
68
+ return index_js_namespaceObject.i18n.t('The current operation was not successful. You can wait a moment or contact technical support.');
69
69
  }
70
70
  return translated;
71
71
  });
@@ -142,16 +142,19 @@ class APIClient extends client_namespaceObject.APIClient {
142
142
  const errs = this.toErrMessages(error);
143
143
  if (errs.find((error)=>'ROLE_NOT_FOUND_ERR' === error.code)) {
144
144
  this.auth.setRole(null);
145
- window.location.reload();
145
+ this.reloadLocation();
146
146
  }
147
147
  if (errs.find((error)=>'TOKEN_INVALID' === error.code || 'USER_LOCKED' === error.code)) this.auth.setToken(null);
148
148
  if (errs.find((error)=>'ROLE_NOT_FOUND_FOR_USER' === error.code)) {
149
149
  this.auth.setRole(null);
150
- window.location.reload();
150
+ this.reloadLocation();
151
151
  }
152
152
  throw error;
153
153
  });
154
154
  }
155
+ reloadLocation() {
156
+ window.location.reload();
157
+ }
155
158
  toErrMessages(error) {
156
159
  var _error_response, _error_response_data, _error_response1, _error_response_data1, _error_response2, _error_response3;
157
160
  if ('string' == typeof (null == error ? void 0 : null == (_error_response = error.response) ? void 0 : _error_response.data)) {
@@ -41,13 +41,13 @@ const external_react_namespaceObject = require("react");
41
41
  const schema_namespaceObject = require("@tachybase/schema");
42
42
  const external_lodash_namespaceObject = require("lodash");
43
43
  var external_lodash_default = /*#__PURE__*/ __webpack_require__.n(external_lodash_namespaceObject);
44
- const index_js_namespaceObject = require("../../schema-component/index.js");
44
+ const useDesignable_js_namespaceObject = require("../../schema-component/hooks/useDesignable.js");
45
45
  const useDefaultSchemaProps = ()=>void 0;
46
46
  function withDynamicSchemaProps(Component) {
47
47
  let options = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
48
48
  const displayName = options.displayName || Component.displayName || Component.name;
49
49
  const ComponentWithProps = (props)=>{
50
- const { dn, findComponent } = (0, index_js_namespaceObject.useDesignable)();
50
+ const { dn, findComponent } = (0, useDesignable_js_namespaceObject.useDesignable)();
51
51
  const scope = (0, schema_namespaceObject.useExpressionScope)();
52
52
  const useComponentPropsStr = (0, external_react_namespaceObject.useMemo)(()=>{
53
53
  const xComponent = dn.getSchemaAttribute('x-component');
@@ -101,7 +101,7 @@ function DynamicSchemaProps() {
101
101
  return (Component, _context)=>{
102
102
  const displayName = options.displayName || Component.displayName || Component.name;
103
103
  const ComponentWithProps = (props)=>{
104
- const { dn, findComponent } = (0, index_js_namespaceObject.useDesignable)();
104
+ const { dn, findComponent } = (0, useDesignable_js_namespaceObject.useDesignable)();
105
105
  const scope = (0, schema_namespaceObject.useExpressionScope)();
106
106
  const useComponentPropsStr = (0, external_react_namespaceObject.useMemo)(()=>{
107
107
  const xComponent = dn.getSchemaAttribute('x-component');