@nocobase/client 1.3.39-beta → 1.4.0-alpha

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 (99) hide show
  1. package/.dumirc.ts +3 -0
  2. package/es/acl/ACLProvider.d.ts +1 -0
  3. package/es/application/schema-initializer/hooks/useSchemaInitializerRender.d.ts +1 -1
  4. package/es/application/utils/remotePlugins.d.ts +1 -1
  5. package/es/block-provider/TableFieldProvider.d.ts +1 -1
  6. package/es/block-provider/TableSelectorProvider.d.ts +1 -1
  7. package/es/block-provider/hooks/useBlockHeightProps.d.ts +1 -0
  8. package/es/collection-manager/interfaces/createdAt.d.ts +11 -3
  9. package/es/collection-manager/interfaces/dateOnly.d.ts +92 -0
  10. package/es/collection-manager/interfaces/datetime.d.ts +26 -2
  11. package/es/collection-manager/interfaces/datetimeNoTz.d.ts +111 -0
  12. package/es/collection-manager/interfaces/index.d.ts +2 -0
  13. package/es/collection-manager/interfaces/o2m.d.ts +0 -2
  14. package/es/collection-manager/interfaces/properties/operators.d.ts +10 -2
  15. package/es/collection-manager/interfaces/unixTimestamp.d.ts +36 -2
  16. package/es/collection-manager/interfaces/updatedAt.d.ts +11 -3
  17. package/es/collection-manager/interfaces/utils/index.d.ts +10 -0
  18. package/es/collection-manager/templates/sql.d.ts +3 -0
  19. package/es/collection-manager/templates/view.d.ts +3 -0
  20. package/es/data-source/collection-field-interface/CollectionFieldInterface.d.ts +5 -0
  21. package/es/data-source/collection-record/CollectionRecord.d.ts +1 -1
  22. package/es/i18n/SwitchLanguage.d.ts +10 -0
  23. package/es/index.d.ts +3 -0
  24. package/es/index.mjs +23415 -21589
  25. package/es/locale/index.d.ts +10 -2
  26. package/es/modules/blocks/data-blocks/table/hooks/useTableBlockProps.d.ts +1 -1
  27. package/es/modules/blocks/other-blocks/divider/DividerFormItemInitializer.d.ts +10 -0
  28. package/es/modules/blocks/other-blocks/divider/dividerSettings.d.ts +12 -0
  29. package/es/modules/fields/component/DatePicker/datePickerComponentFieldSettings.d.ts +1 -0
  30. package/es/modules/fields/component/Input/inputComponentSettings.d.ts +12 -0
  31. package/es/modules/fields/component/Input.JSON/inputJSONSettings.d.ts +10 -0
  32. package/es/modules/fields/component/Input.TextArea/inputTextAreaSettings.d.ts +10 -0
  33. package/es/modules/fields/component/Input.URL/inputURLSettings.d.ts +10 -0
  34. package/es/modules/fields/component/Markdown/markdownSettings.d.ts +10 -0
  35. package/es/modules/fields/component/MarkdownVditor/markdownVditorSettings.d.ts +10 -0
  36. package/es/modules/fields/component/RichText/richTextSettings.d.ts +10 -0
  37. package/es/modules/fields/component/SubTable/subTablePopoverComponentFieldSettings.d.ts +12 -0
  38. package/es/modules/popup/OpenModeProvider.d.ts +6 -0
  39. package/es/pm/types.d.ts +1 -0
  40. package/es/schema-component/antd/association-field/FileManager.d.ts +2 -1
  41. package/es/schema-component/antd/association-field/InternalPicker.d.ts +0 -1
  42. package/es/schema-component/antd/association-filter/AssociationFilter.d.ts +1 -1
  43. package/es/schema-component/antd/block-item/index.d.ts +1 -0
  44. package/es/schema-component/antd/date-picker/DatePicker.d.ts +1 -0
  45. package/es/schema-component/antd/date-picker/util.d.ts +1 -0
  46. package/es/schema-component/antd/divider/Divider.d.ts +11 -0
  47. package/es/schema-component/antd/divider/index.d.ts +9 -0
  48. package/es/{schema-settings/DateFormat/ExpiresRadio.d.ts → schema-component/antd/expiresRadio/index.d.ts} +2 -2
  49. package/es/schema-component/antd/form-item/hooks/useSpecialCase.d.ts +7 -0
  50. package/es/schema-component/antd/index.d.ts +2 -0
  51. package/es/schema-component/antd/input/ReadPretty.d.ts +2 -0
  52. package/es/schema-component/antd/markdown/Markdown.Void.d.ts +1 -1
  53. package/es/schema-component/antd/markdown/util.d.ts +2 -1
  54. package/es/schema-component/antd/page/index.d.ts +1 -1
  55. package/es/schema-component/antd/page/pagePopupUtils.d.ts +1 -1
  56. package/es/schema-component/antd/page/usePopupContextInActionOrAssociationField.d.ts +1 -1
  57. package/es/schema-component/antd/remote-select/ReadPretty.d.ts +1 -1
  58. package/es/schema-component/antd/remote-select/RemoteSelect.d.ts +3 -1
  59. package/es/schema-component/antd/table-v2/Table.Column.Decorator.d.ts +1 -0
  60. package/es/schema-component/antd/table-v2/components/ColumnFieldProvider.d.ts +2 -3
  61. package/es/schema-component/antd/unix-timestamp/UnixTimestamp.d.ts +1 -2
  62. package/es/schema-component/antd/upload/index.d.ts +2 -0
  63. package/es/schema-component/antd/upload/shared.d.ts +37 -37
  64. package/es/schema-component/antd/upload/style.d.ts +1 -0
  65. package/es/schema-component/antd/variable/Input.d.ts +2 -0
  66. package/es/schema-component/antd/variable/Variable.d.ts +1 -1
  67. package/es/schema-settings/LinkageRules/type.d.ts +2 -1
  68. package/es/schema-settings/SchemaSettings.d.ts +4 -0
  69. package/es/schema-settings/SchemaSettingsDefaultValue.d.ts +1 -0
  70. package/es/schema-settings/VariableInput/VariableInput.d.ts +1 -0
  71. package/es/schema-settings/VariableInput/hooks/index.d.ts +1 -0
  72. package/es/schema-settings/VariableInput/hooks/useDateVariable.d.ts +33 -0
  73. package/es/schema-settings/VariableInput/hooks/useFormVariable.d.ts +11 -0
  74. package/es/schema-settings/VariableInput/hooks/useIterationVariable.d.ts +12 -0
  75. package/es/schema-settings/VariableInput/hooks/useParentIterationVariable.d.ts +9 -2
  76. package/es/schema-settings/VariableInput/hooks/useParentPopupVariable.d.ts +16 -3
  77. package/es/schema-settings/VariableInput/hooks/useParentRecordVariable.d.ts +10 -0
  78. package/es/schema-settings/VariableInput/hooks/usePopupVariable.d.ts +16 -3
  79. package/es/schema-settings/VariableInput/hooks/useRecordVariable.d.ts +14 -0
  80. package/es/variables/VariablesProvider.d.ts +5 -3
  81. package/es/variables/hooks/useVariables.d.ts +1 -1
  82. package/es/variables/index.d.ts +1 -0
  83. package/es/variables/types.d.ts +1 -0
  84. package/lib/index.js +330 -306
  85. package/lib/locale/{en_US.js → en-US.js} +7 -2
  86. package/lib/locale/{es_ES.js → es-ES.js} +2 -1
  87. package/lib/locale/{fr_FR.js → fr-FR.js} +2 -1
  88. package/lib/locale/index.js +6 -3
  89. package/lib/locale/{ja_JP.js → ja-JP.js} +1 -3
  90. package/lib/locale/{ko_KR.js → ko-KR.js} +2 -1
  91. package/lib/locale/{pt_BR.js → pt-BR.js} +2 -1
  92. package/lib/locale/{ru_RU.js → ru-RU.js} +2 -1
  93. package/lib/locale/{tr_TR.js → tr-TR.js} +2 -1
  94. package/lib/locale/{uk_UA.js → uk-UA.js} +2 -1
  95. package/lib/locale/zh-CN.js +45 -4
  96. package/lib/locale/zh-TW.js +3 -1
  97. package/package.json +8 -6
  98. /package/lib/locale/cron/{zh_CN.js → zh-CN.js} +0 -0
  99. /package/lib/locale/cron/{zh_TW.js → zh-TW.js} +0 -0
@@ -13,3 +13,4 @@ export * from './useRoleVariable';
13
13
  export * from './useURLSearchParamsVariable';
14
14
  export * from './useUserVariable';
15
15
  export * from './useVariableOptions';
16
+ export * from './usePopupVariable';
@@ -39,6 +39,39 @@ export declare const useDateVariable: ({ operator, schema, noDisabled }: Props)
39
39
  disabled: boolean;
40
40
  }[];
41
41
  };
42
+ /**
43
+ * 变量:`日期变量`的上下文
44
+ * @returns
45
+ */
46
+ export declare const useDatetimeVariableContext: () => {
47
+ datetimeCtx: {
48
+ now: () => any;
49
+ today: (params?: any) => any;
50
+ yesterday: (params?: any) => any;
51
+ tomorrow: (params?: any) => any;
52
+ thisWeek: (params?: any) => any;
53
+ lastWeek: (params?: any) => any;
54
+ nextWeek: (params?: any) => any;
55
+ thisIsoWeek: (params?: any) => any;
56
+ lastIsoWeek: (params?: any) => any;
57
+ nextIsoWeek: (params?: any) => any;
58
+ thisMonth: (params?: any) => any;
59
+ lastMonth: (params?: any) => any;
60
+ nextMonth: (params?: any) => any;
61
+ thisQuarter: (params?: any) => any;
62
+ lastQuarter: (params?: any) => any;
63
+ nextQuarter: (params?: any) => any;
64
+ thisYear: (params?: any) => any;
65
+ lastYear: (params?: any) => any;
66
+ nextYear: (params?: any) => any;
67
+ last7Days: (params?: any) => any;
68
+ next7Days: (params?: any) => any;
69
+ last30Days: (params?: any) => any;
70
+ next30Days: (params?: any) => any;
71
+ last90Days: (params?: any) => any;
72
+ next90Days: (params?: any) => any;
73
+ };
74
+ };
42
75
  /**
43
76
  * 变量:`日期变量`
44
77
  * @param param0
@@ -27,6 +27,17 @@ interface Props {
27
27
  * @returns
28
28
  */
29
29
  export declare const useFormVariable: ({ collectionName, collectionField, schema, noDisabled, targetFieldSchema }: Props) => import("../type").Option;
30
+ /**
31
+ * 变量:`当前表单` 相关的 hook
32
+ * @param param0
33
+ * @returns
34
+ */
35
+ export declare const useCurrentFormContext: ({ form: _form }?: Pick<Props, 'form'>) => {
36
+ /** 变量值 */
37
+ currentFormCtx: any;
38
+ /** 用来判断是否可以显示`当前表单`变量 */
39
+ shouldDisplayCurrentForm: boolean;
40
+ };
30
41
  /**
31
42
  * 变量:`当前表单`
32
43
  * @param param0
@@ -25,6 +25,18 @@ export declare const useIterationVariable: ({ currentCollection, collectionField
25
25
  /** 消费变量值的字段 */
26
26
  targetFieldSchema?: Schema;
27
27
  }) => import("../type").Option;
28
+ /**
29
+ * 变量:`当前对象`相关的 hook
30
+ * @returns
31
+ */
32
+ export declare const useCurrentObjectContext: () => {
33
+ /** 是否显示变量 */
34
+ shouldDisplayCurrentObject: boolean;
35
+ /** 变量的值 */
36
+ currentObjectCtx: any;
37
+ /** 变量的 collection */
38
+ collectionOfCurrentObject: import("../../../data-source").Collection;
39
+ };
28
40
  /**
29
41
  * 变量:`当前对象`
30
42
  * @param param0
@@ -8,6 +8,13 @@
8
8
  */
9
9
  import { Schema } from '@formily/json-schema';
10
10
  import { CollectionFieldOptions } from '../../../data-source/collection/Collection';
11
+ export declare const useParentObjectContext: () => {
12
+ /** 是否显示变量 */
13
+ shouldDisplayParentObject: boolean;
14
+ /** 变量的值 */
15
+ parentObjectCtx: any;
16
+ collectionName: string;
17
+ };
11
18
  /**
12
19
  * 变量:`上级对象`
13
20
  * @param param0
@@ -20,11 +27,11 @@ export declare const useParentObjectVariable: ({ collectionField, schema, noDisa
20
27
  /** 消费变量值的字段 */
21
28
  targetFieldSchema?: Schema;
22
29
  }) => {
30
+ /** 变量的配置项 */
31
+ parentObjectSettings: import("../type").Option;
23
32
  /** 是否显示变量 */
24
33
  shouldDisplayParentObject: boolean;
25
34
  /** 变量的值 */
26
35
  parentObjectCtx: any;
27
- /** 变量的配置项 */
28
- parentObjectSettings: import("../type").Option;
29
36
  collectionName: string;
30
37
  };
@@ -6,6 +6,22 @@
6
6
  * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
+ /**
10
+ * 变量:`Parent popup record`的上下文
11
+ * @returns
12
+ */
13
+ export declare const useParentPopupVariableContext: () => {
14
+ /** 变量值 */
15
+ parentPopupRecordCtx: any;
16
+ /** 用于判断是否需要显示配置项 */
17
+ shouldDisplayParentPopupRecord: boolean;
18
+ /** 当前记录对应的 collection name */
19
+ collectionName: string;
20
+ dataSource: string;
21
+ /** 不可删除 */
22
+ defaultValue: any;
23
+ title: string;
24
+ };
9
25
  /**
10
26
  * 变量:`Parent popup record`
11
27
  * @param props
@@ -14,11 +30,8 @@
14
30
  export declare const useParentPopupVariable: (props?: any) => {
15
31
  /** 变量配置 */
16
32
  settings: import("../type").Option;
17
- /** 变量值 */
18
33
  parentPopupRecordCtx: any;
19
- /** 用于判断是否需要显示配置项 */
20
34
  shouldDisplayParentPopupRecord: boolean;
21
- /** 当前记录对应的 collection name */
22
35
  collectionName: string;
23
36
  dataSource: string;
24
37
  defaultValue: any;
@@ -25,6 +25,16 @@ interface Props {
25
25
  * @returns
26
26
  */
27
27
  export declare const useParentRecordVariable: (props: Props) => import("../type").Option;
28
+ /**
29
+ * 变量:`上级记录`的上下文
30
+ * @returns
31
+ */
32
+ export declare const useCurrentParentRecordContext: () => {
33
+ currentParentRecordCtx: {};
34
+ shouldDisplayCurrentParentRecord: boolean;
35
+ collectionName: string;
36
+ dataSource: string;
37
+ };
28
38
  /**
29
39
  * 变量:`上级记录`
30
40
  * @param props
@@ -6,6 +6,22 @@
6
6
  * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
+ /**
10
+ * 变量:`Current popup record`的上下文
11
+ * @returns
12
+ */
13
+ export declare const usePopupVariableContext: () => {
14
+ /** 变量值 */
15
+ popupRecordCtx: any;
16
+ /** 用于判断是否需要显示配置项 */
17
+ shouldDisplayPopupRecord: boolean;
18
+ /** 当前记录对应的 collection name */
19
+ collectionName: string;
20
+ dataSource: string;
21
+ /** 不可删除*/
22
+ defaultValue: any;
23
+ title: string;
24
+ };
9
25
  /**
10
26
  * 变量:`Current popup record`
11
27
  * @param props
@@ -14,11 +30,8 @@
14
30
  export declare const usePopupVariable: (props?: any) => {
15
31
  /** 变量配置 */
16
32
  settings: import("../type").Option;
17
- /** 变量值 */
18
33
  popupRecordCtx: any;
19
- /** 用于判断是否需要显示配置项 */
20
34
  shouldDisplayPopupRecord: boolean;
21
- /** 当前记录对应的 collection name */
22
35
  collectionName: string;
23
36
  dataSource: string;
24
37
  defaultValue: any;
@@ -25,6 +25,20 @@ interface Props {
25
25
  * @returns
26
26
  */
27
27
  export declare const useRecordVariable: (props: Props) => import("../type").Option;
28
+ /**
29
+ * 变量:`当前记录`的上下文
30
+ * @returns
31
+ */
32
+ export declare const useCurrentRecordContext: () => {
33
+ /** 变量值 */
34
+ currentRecordCtx: any;
35
+ /** 用于判断是否需要显示配置项 */
36
+ shouldDisplayCurrentRecord: boolean;
37
+ /** 当前记录对应的 collection name */
38
+ collectionName: string;
39
+ /** 块类型 */
40
+ blockType: string;
41
+ };
28
42
  /**
29
43
  * 变量:`当前记录`
30
44
  * @param props
@@ -10,10 +10,12 @@ import React from 'react';
10
10
  import type { CollectionFieldOptions_deprecated } from '../collection-manager';
11
11
  import { VariablesContextType } from './types';
12
12
  export declare const VariablesContext: React.Context<VariablesContextType>;
13
+ /**
14
+ * @internal
15
+ * Note: There can only be one VariablesProvider in the entire context. It cannot be used in plugins.
16
+ */
13
17
  declare const VariablesProvider: {
14
- ({ children }: {
15
- children: any;
16
- }): React.JSX.Element;
18
+ ({ children, filterVariables }: any): React.JSX.Element;
17
19
  displayName: string;
18
20
  };
19
21
  export default VariablesProvider;
@@ -6,5 +6,5 @@
6
6
  * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
- declare const useVariables: () => import("../types").VariablesContextType;
9
+ declare const useVariables: () => import("..").VariablesContextType;
10
10
  export default useVariables;
@@ -14,3 +14,4 @@ export { default as useVariables } from './hooks/useVariables';
14
14
  export * from './utils/isVariable';
15
15
  export * from './utils/transformVariableValue';
16
16
  export * from './constants';
17
+ export type { VariablesContextType } from './types';
@@ -78,6 +78,7 @@ export interface VariablesContextType {
78
78
  getVariable: (variableName: string) => VariableOption;
79
79
  getCollectionField: (variableString: string, localVariables?: VariableOption | VariableOption[]) => Promise<CollectionFieldOptions_deprecated>;
80
80
  removeVariable: (variableName: string) => void;
81
+ filterVariables?: (params: any) => boolean;
81
82
  }
82
83
  export interface VariableOption {
83
84
  /** 变量的表示,例如:`$user` */