@nocobase/client 2.1.0-alpha.1 → 2.1.0-alpha.10

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 (176) hide show
  1. package/.dumirc.ts +8 -0
  2. package/LICENSE +201 -661
  3. package/README.md +79 -10
  4. package/es/ai/ai-manager.d.ts +15 -0
  5. package/es/ai/index.d.ts +11 -0
  6. package/es/ai/tools-manager/hooks/context.d.ts +17 -0
  7. package/es/ai/tools-manager/hooks/index.d.ts +11 -0
  8. package/es/ai/tools-manager/hooks/provider.d.ts +16 -0
  9. package/es/ai/tools-manager/index.d.ts +20 -0
  10. package/es/ai/tools-manager/types.d.ts +80 -0
  11. package/es/ai/utils.d.ts +10 -0
  12. package/es/api-client/APIClient.d.ts +1 -0
  13. package/es/application/Application.d.ts +7 -1
  14. package/es/application/Plugin.d.ts +1 -0
  15. package/es/application/RouteRepository.d.ts +23 -0
  16. package/es/application/globalOperators.d.ts +11 -0
  17. package/es/block-provider/TableUidContext.d.ts +10 -0
  18. package/es/collection-manager/templates/view.d.ts +11 -11
  19. package/es/data-source/collection/utils.d.ts +2 -4
  20. package/es/flow/actions/aclCheckRefresh.d.ts +9 -0
  21. package/es/flow/actions/afterSuccess.d.ts +9 -0
  22. package/es/flow/actions/blockHeight.d.ts +9 -0
  23. package/es/flow/actions/filterFormDefaultValues.d.ts +9 -0
  24. package/es/flow/actions/formAssignRules.d.ts +9 -0
  25. package/es/flow/actions/index.d.ts +7 -0
  26. package/es/flow/actions/linkageRulesRefresh.d.ts +9 -0
  27. package/es/flow/actions/numberFormat.d.ts +9 -0
  28. package/es/flow/components/BlockItemCard.d.ts +1 -0
  29. package/es/flow/components/ConditionBuilder.d.ts +2 -0
  30. package/es/flow/components/DefaultValue.d.ts +1 -0
  31. package/es/flow/components/FieldAssignEditor.d.ts +32 -0
  32. package/es/flow/components/FieldAssignExactDatePicker.d.ts +23 -0
  33. package/es/flow/components/FieldAssignRulesEditor.d.ts +70 -0
  34. package/es/flow/components/FieldAssignValueInput.d.ts +48 -1
  35. package/es/flow/components/RunJSValueEditor.d.ts +19 -0
  36. package/es/flow/components/TextAreaWithContextSelector.d.ts +1 -0
  37. package/es/flow/components/code-editor/core/EditorCore.d.ts +3 -1
  38. package/es/flow/components/code-editor/formatDocInfo.d.ts +17 -0
  39. package/es/flow/components/code-editor/hooks/useCodeRunner.d.ts +3 -1
  40. package/es/flow/components/code-editor/index.d.ts +1 -0
  41. package/es/flow/components/code-editor/linter.d.ts +10 -2
  42. package/es/flow/components/code-editor/runjsCompletionSource.d.ts +20 -0
  43. package/es/flow/components/code-editor/runjsDiagnostics.d.ts +46 -0
  44. package/es/flow/components/fieldAssignOptions.d.ts +23 -0
  45. package/es/flow/components/filter/LinkageFilterItem.d.ts +27 -1
  46. package/es/flow/components/useAssociationTitleFieldSync.d.ts +13 -0
  47. package/es/flow/index.d.ts +2 -0
  48. package/es/flow/internal/utils/modelUtils.d.ts +27 -0
  49. package/es/flow/internal/utils/saveStepParamsWithSubModels.d.ts +11 -0
  50. package/es/flow/internal/utils/titleFieldQuickSync.d.ts +35 -0
  51. package/es/flow/models/actions/AddChildActionModel.d.ts +1 -0
  52. package/es/flow/models/actions/BulkDeleteActionModel.d.ts +1 -0
  53. package/es/flow/models/actions/LinkActionModel.d.ts +1 -4
  54. package/es/flow/models/actions/LinkActionUtils.d.ts +34 -0
  55. package/es/flow/models/actions/UpdateRecordActionUtils.d.ts +12 -0
  56. package/es/flow/models/actions/joinUrlSearch.d.ts +12 -0
  57. package/es/flow/models/base/ActionGroupModel.d.ts +8 -0
  58. package/es/flow/models/base/AssociationFieldGroupModel.d.ts +1 -1
  59. package/es/flow/models/base/BlockModel.d.ts +29 -1
  60. package/es/flow/models/base/CollectionBlockModel.d.ts +12 -57
  61. package/es/flow/models/base/GridModel.d.ts +7 -0
  62. package/es/flow/models/base/PageModel/ChildPageModel.d.ts +1 -0
  63. package/es/flow/models/base/PageModel/PageModel.d.ts +17 -1
  64. package/es/flow/models/base/PageModel/RootPageModel.d.ts +8 -0
  65. package/es/flow/models/blocks/details/DetailsBlockModel.d.ts +4 -0
  66. package/es/flow/models/blocks/details/DetailsGridModel.d.ts +1 -0
  67. package/es/flow/models/blocks/details/utils.d.ts +16 -0
  68. package/es/flow/models/blocks/filter-form/FieldOperatorSelect.d.ts +10 -0
  69. package/es/flow/models/blocks/filter-form/FilterFormBlockModel.d.ts +6 -0
  70. package/es/flow/models/blocks/filter-form/FilterFormGridModel.d.ts +12 -1
  71. package/es/flow/models/blocks/filter-form/FilterFormItemModel.d.ts +5 -37
  72. package/es/flow/models/blocks/filter-form/customFieldOperators.d.ts +34 -0
  73. package/es/flow/models/blocks/filter-form/fields/FilterFormCustomFieldModel.d.ts +16 -0
  74. package/es/flow/models/blocks/filter-form/fields/FilterFormCustomRecordSelectFieldModel.d.ts +20 -0
  75. package/es/flow/models/blocks/filter-form/fields/FilterFormRecordSelectFieldModel.d.ts +12 -0
  76. package/es/flow/models/blocks/filter-form/fields/index.d.ts +2 -0
  77. package/es/flow/models/blocks/filter-form/index.d.ts +4 -0
  78. package/es/flow/models/blocks/filter-form/legacyDefaultValueMigration.d.ts +13 -0
  79. package/es/flow/models/blocks/filter-form/valueNormalization.d.ts +17 -0
  80. package/es/flow/models/blocks/filter-manager/flow-actions/defaultOperator.d.ts +1 -3
  81. package/es/flow/models/blocks/form/CreateFormModel.d.ts +3 -1
  82. package/es/flow/models/blocks/form/EditFormModel.d.ts +4 -1
  83. package/es/flow/models/blocks/form/FormAssociationFieldGroupModel.d.ts +12 -0
  84. package/es/flow/models/blocks/form/FormAssociationItemModel.d.ts +39 -0
  85. package/es/flow/models/blocks/form/FormBlockModel.d.ts +35 -2
  86. package/es/flow/models/blocks/form/FormGridModel.d.ts +1 -0
  87. package/es/flow/models/blocks/form/QuickEditFormModel.d.ts +4 -1
  88. package/es/flow/models/blocks/form/assignRulesUpdateAssociationValues.d.ts +18 -0
  89. package/es/flow/models/blocks/form/dynamicNamePath.d.ts +19 -0
  90. package/es/flow/models/blocks/form/index.d.ts +2 -0
  91. package/es/flow/models/blocks/form/legacyDefaultValueMigration.d.ts +13 -0
  92. package/es/flow/models/blocks/form/submitHandler.d.ts +1 -1
  93. package/es/flow/models/blocks/form/submitValues.d.ts +27 -0
  94. package/es/flow/models/blocks/form/value-runtime/conditions.d.ts +9 -0
  95. package/es/flow/models/blocks/form/value-runtime/deps.d.ts +23 -0
  96. package/es/flow/models/blocks/form/value-runtime/form-patch.d.ts +19 -0
  97. package/es/flow/models/blocks/form/value-runtime/index.d.ts +11 -0
  98. package/es/flow/models/blocks/form/value-runtime/path.d.ts +25 -0
  99. package/es/flow/models/blocks/form/value-runtime/rules.d.ts +131 -0
  100. package/es/flow/models/blocks/form/value-runtime/runtime.d.ts +75 -0
  101. package/es/flow/models/blocks/form/value-runtime/types.d.ts +62 -0
  102. package/es/flow/models/blocks/form/value-runtime/utils.d.ts +12 -0
  103. package/es/flow/models/blocks/shared/legacyDefaultValueMigrationBase.d.ts +20 -0
  104. package/es/flow/models/blocks/table/TableBlockModel.d.ts +1 -23
  105. package/es/flow/models/blocks/table/TableSelectModel.d.ts +0 -1
  106. package/es/flow/models/blocks/table/dragSort/dragSortComponents.d.ts +14 -0
  107. package/es/flow/models/blocks/table/dragSort/dragSortHooks.d.ts +13 -0
  108. package/es/flow/models/blocks/table/dragSort/dragSortSettings.d.ts +39 -0
  109. package/es/flow/models/blocks/table/dragSort/dragSortUtils.d.ts +37 -0
  110. package/es/flow/models/blocks/table/dragSort/index.d.ts +12 -0
  111. package/es/flow/models/blocks/table/utils.d.ts +8 -8
  112. package/es/flow/models/fields/AssociationFieldModel/AssociationFieldModel.d.ts +1 -0
  113. package/es/flow/models/fields/AssociationFieldModel/CascadeSelectFieldModel.d.ts +16 -0
  114. package/es/flow/models/fields/AssociationFieldModel/PopupSubTableFieldModel/PopupSubTableActionGroupModel.d.ts +11 -0
  115. package/es/flow/models/fields/AssociationFieldModel/PopupSubTableFieldModel/PopupSubTableActionsColumnModel.d.ts +19 -0
  116. package/es/flow/models/fields/AssociationFieldModel/PopupSubTableFieldModel/PopupSubTableFieldModel.d.ts +30 -0
  117. package/es/flow/models/fields/AssociationFieldModel/PopupSubTableFieldModel/actions/PopupSubTableEditActionModel.d.ts +28 -0
  118. package/es/flow/models/fields/AssociationFieldModel/PopupSubTableFieldModel/actions/PopupSubTableFormSubmitActionModel.d.ts +16 -0
  119. package/es/flow/models/fields/AssociationFieldModel/PopupSubTableFieldModel/actions/PopupSubTableRemoveActionModel.d.ts +14 -0
  120. package/es/flow/models/fields/AssociationFieldModel/PopupSubTableFieldModel/blocks/PopupSubTableFormModel.d.ts +36 -0
  121. package/es/flow/models/fields/AssociationFieldModel/PopupSubTableFieldModel/index.d.ts +17 -0
  122. package/es/flow/models/fields/AssociationFieldModel/RecordPickerFieldModel.d.ts +8 -1
  123. package/es/flow/models/fields/AssociationFieldModel/RecordSelectFieldModel.d.ts +15 -0
  124. package/es/flow/models/fields/AssociationFieldModel/SubTableFieldModel/SubTableColumnModel.d.ts +4 -1
  125. package/es/flow/models/fields/AssociationFieldModel/index.d.ts +1 -0
  126. package/es/flow/models/fields/AssociationFieldModel/itemChain.d.ts +94 -0
  127. package/es/flow/models/fields/AssociationFieldModel/recordSelectShared.d.ts +15 -5
  128. package/es/flow/models/fields/DisplayAssociationField/displaySubListUtils.d.ts +14 -0
  129. package/es/flow/models/fields/RichTextFieldModel/registerFontSize.d.ts +9 -0
  130. package/es/flow/models/fields/RichTextFieldModel/registerImageResize.d.ts +9 -0
  131. package/es/flow/models/fields/RichTextFieldModel/registerSmartBreak.d.ts +12 -0
  132. package/es/flow/models/fields/index.d.ts +0 -1
  133. package/es/flow/utils/actionCapability.d.ts +60 -0
  134. package/es/flow/utils/dispatchEventDeep.d.ts +20 -0
  135. package/es/flow/utils/index.d.ts +2 -0
  136. package/es/flow/utils/pagination.d.ts +29 -0
  137. package/es/flow/utils/useJsonTemplateResolver.d.ts +9 -0
  138. package/es/index.d.ts +1 -0
  139. package/es/index.mjs +37578 -24415
  140. package/es/pm/AdminSettingsLayoutModel.d.ts +13 -0
  141. package/es/pm/PluginSetting.d.ts +2 -1
  142. package/es/pm/index.d.ts +1 -0
  143. package/es/route-switch/antd/admin-layout/AdminLayoutModel.d.ts +27 -0
  144. package/es/route-switch/antd/admin-layout/AdminLayoutRouteCoordinator.d.ts +50 -0
  145. package/es/route-switch/antd/admin-layout/index.d.ts +5 -1
  146. package/es/route-switch/antd/admin-layout/mobileMenuNavigation.d.ts +15 -0
  147. package/es/schema-component/antd/association-field/Table.d.ts +0 -57
  148. package/es/schema-component/antd/date-picker/DatePicker.d.ts +26 -0
  149. package/es/schema-component/antd/form-item/hooks/useLazyLoadDisplayAssociationFieldsOfForm.d.ts +26 -0
  150. package/es/schema-settings/SchemaSettingsDefaultValue.d.ts +18 -0
  151. package/es/schema-settings/VariableInput/hooks/useParentIterationVariable.d.ts +3 -3
  152. package/es/user/CurrentUserProvider.d.ts +1 -1
  153. package/es/variables/index.d.ts +1 -1
  154. package/lib/index.js +504 -304
  155. package/lib/locale/de-DE.json +5 -0
  156. package/lib/locale/en-US.json +54 -0
  157. package/lib/locale/es-ES.json +5 -0
  158. package/lib/locale/fr-FR.json +5 -0
  159. package/lib/locale/hu-HU.json +5 -0
  160. package/lib/locale/id-ID.json +5 -0
  161. package/lib/locale/it-IT.json +5 -0
  162. package/lib/locale/ja-JP.json +5 -0
  163. package/lib/locale/ko-KR.json +5 -0
  164. package/lib/locale/nl-NL.json +5 -0
  165. package/lib/locale/pt-BR.json +5 -0
  166. package/lib/locale/ru-RU.json +5 -0
  167. package/lib/locale/tr-TR.json +5 -0
  168. package/lib/locale/uk-UA.json +5 -0
  169. package/lib/locale/vi-VN.json +5 -0
  170. package/lib/locale/zh-CN.json +82 -8
  171. package/lib/locale/zh-TW.json +15 -0
  172. package/package.json +9 -8
  173. package/es/flow/models/fields/UploadFieldModel.d.ts +0 -22
  174. package/es/index-C3fHjsMw.mjs +0 -279
  175. package/lib/index-C3fHjsMw-CDWZlvuM.js +0 -2237
  176. package/lib/style.css +0 -1
@@ -0,0 +1,12 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ export * from './dragSortUtils';
10
+ export * from './dragSortComponents';
11
+ export * from './dragSortHooks';
12
+ export * from './dragSortSettings';
@@ -1,11 +1,4 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
1
+ /// <reference types="react" />
9
2
  export declare function extractIndex(str: any): string;
10
3
  export declare function adjustColumnOrder(columns: any): any[];
11
4
  export declare function setNestedValue(data: any, recordIndex: any, value: any): void;
@@ -16,3 +9,10 @@ export declare function extractIds(data: any): any[];
16
9
  * @param key string | string[] 单字段或多字段
17
10
  */
18
11
  export declare function getRowKey(record: any, key: string | string[]): any;
12
+ type UseBlockHeightOptions = {
13
+ heightMode?: string;
14
+ tableAreaRef: React.RefObject<HTMLDivElement>;
15
+ deps?: React.DependencyList;
16
+ };
17
+ export declare const useBlockHeight: ({ heightMode, tableAreaRef, deps }: UseBlockHeightOptions) => number;
18
+ export {};
@@ -1,4 +1,5 @@
1
1
  import { FieldModel } from '../../base/FieldModel';
2
2
  export declare class AssociationFieldModel extends FieldModel {
3
3
  operator: string;
4
+ updateAssociation: boolean;
4
5
  }
@@ -9,6 +9,21 @@
9
9
  import { CollectionField, MultiRecordResource } from '@nocobase/flow-engine';
10
10
  import React from 'react';
11
11
  import { AssociationFieldModel } from './AssociationFieldModel';
12
+ type CascadeHydrateStatus = 'pending' | 'done';
13
+ export declare function collectCascadeHydrationCandidate(options: {
14
+ value: any;
15
+ valueKey: string;
16
+ labelKey?: string;
17
+ labelKeys?: string[];
18
+ statusMap: Map<string, CascadeHydrateStatus>;
19
+ }): {
20
+ item: Record<string, any>;
21
+ tk: any;
22
+ tkKey: string;
23
+ } | null;
24
+ export declare function markCascadeHydrationDone(statusMap: Map<string, CascadeHydrateStatus>, tkKey: string | null | undefined): void;
25
+ export declare function buildDisplayPathFromValue(value: any, labelKeyOrKeys: string | string[]): string[];
26
+ export declare function findOptionPathByTk(options: any[], tk: any, valueKey: string): any[];
12
27
  export declare class CascadeSelectInnerFieldModel extends AssociationFieldModel {
13
28
  resource: MultiRecordResource;
14
29
  get collectionField(): CollectionField;
@@ -27,3 +42,4 @@ export declare class CascadeSelectFieldModel extends CascadeSelectInnerFieldMode
27
42
  export declare class CascadeSelectListFieldModel extends CascadeSelectInnerFieldModel {
28
43
  render(): React.JSX.Element;
29
44
  }
45
+ export {};
@@ -0,0 +1,11 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import { ActionGroupModel } from '../../../base/ActionGroupModel';
10
+ export declare class PopupSubTableActionGroupModel extends ActionGroupModel {
11
+ }
@@ -0,0 +1,19 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import React from 'react';
10
+ import { TableCustomColumnModel } from '../../../blocks/table/TableCustomColumnModel';
11
+ export declare class PopupSubTableActionsColumnModel extends TableCustomColumnModel {
12
+ _subTableModel: any;
13
+ afterAddAsSubModel(): Promise<void>;
14
+ getColumnProps(model: any): {
15
+ title: React.JSX.Element;
16
+ render: (value: any, record: any, index: any) => React.JSX.Element;
17
+ };
18
+ render(): (value: any, record: any, index: any) => React.JSX.Element;
19
+ }
@@ -0,0 +1,30 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import React from 'react';
10
+ import { AssociationFieldModel } from '../AssociationFieldModel';
11
+ export declare class PopupSubTableFieldModel extends AssociationFieldModel {
12
+ disableTitleField: boolean;
13
+ defaultOverflowMode: string;
14
+ updateAssociation: boolean;
15
+ selectedRows: {
16
+ value: any[];
17
+ };
18
+ setCurrentPage: any;
19
+ currentPageSize: any;
20
+ get collection(): any;
21
+ get collectionField(): any;
22
+ onInit(options: any): void;
23
+ onDispatchEventStart(eventName: string): Promise<void>;
24
+ set onSelectExitRecordClick(fn: any);
25
+ set onAddRecordClick(fn: any);
26
+ afterAddAsSubModel(): Promise<void>;
27
+ getBaseColumns(model: any): any;
28
+ change(): void;
29
+ render(): React.JSX.Element;
30
+ }
@@ -0,0 +1,28 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import type { ButtonProps } from 'antd/es/button';
10
+ import React from 'react';
11
+ import { ActionModel } from '../../../../base/ActionModel';
12
+ export declare function EditFormContent({ model, scene }: {
13
+ model: any;
14
+ scene?: string;
15
+ }): React.JSX.Element;
16
+ export declare class SubTableRecordAction extends ActionModel {
17
+ renderHiddenInConfig(): React.ReactNode | undefined;
18
+ }
19
+ export declare class PopupSubTableEditActionModel extends SubTableRecordAction {
20
+ renderHiddenInConfig(): React.ReactNode | undefined;
21
+ selectedRows: {
22
+ value: any[];
23
+ };
24
+ defaultPopupTitle: string;
25
+ defaultProps: ButtonProps;
26
+ getAclActionName(): string;
27
+ onDispatchEventStart(eventName: string): Promise<void>;
28
+ }
@@ -0,0 +1,16 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import { ButtonProps } from 'antd';
10
+ import { ActionGroupModel, ActionModel } from '../../../../base';
11
+ export declare class PopupSubTableFormSubmitActionModel extends ActionModel {
12
+ defaultProps: ButtonProps;
13
+ }
14
+ export declare class PopupSubTableFormActionGroupModel extends ActionGroupModel {
15
+ static baseClass: typeof PopupSubTableFormSubmitActionModel;
16
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import type { ButtonProps } from 'antd/es/button';
10
+ import { SubTableRecordAction } from './PopupSubTableEditActionModel';
11
+ export declare class PopupSubTableRemoveActionModel extends SubTableRecordAction {
12
+ defaultProps: ButtonProps;
13
+ onDispatchEventStart(eventName: string): Promise<void>;
14
+ }
@@ -0,0 +1,36 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import { FlowModelContext, SingleRecordResource } from '@nocobase/flow-engine';
10
+ import React from 'react';
11
+ import { FormBlockModel } from '../../../../blocks/form/FormBlockModel';
12
+ export declare class PopupSubTableFormModel extends FormBlockModel {
13
+ static scene: import("../../../../base").BlockSceneType;
14
+ private actionFlowSettings;
15
+ private actionExtraToolbarItems;
16
+ onInit(options: any): void;
17
+ createResource(_ctx: FlowModelContext, params: any): SingleRecordResource<unknown>;
18
+ _defaultCustomModelClasses: {
19
+ FormActionGroupModel: string;
20
+ FormItemModel: string;
21
+ FormCustomItemModel: string;
22
+ FormAssociationFieldGroupModel: string;
23
+ };
24
+ protected defaultBlockTitle(): string;
25
+ /**
26
+ * 定义子菜单选项
27
+ */
28
+ static defineChildren(ctx: any): Promise<{
29
+ key: string;
30
+ label: string;
31
+ useModel: string;
32
+ createModelOptions: any;
33
+ }[]>;
34
+ onMount(): Promise<void>;
35
+ renderComponent(): React.JSX.Element;
36
+ }
@@ -0,0 +1,17 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ export * from './PopupSubTableFieldModel';
10
+ export * from './PopupSubTableActionGroupModel';
11
+ export * from './PopupSubTableActionsColumnModel';
12
+ export * from './actions/PopupSubTableEditActionModel';
13
+ export * from './actions/PopupSubTableRemoveActionModel';
14
+ export * from './actions/PopupSubTableFormSubmitActionModel';
15
+ export * from './PopupSubTableActionGroupModel';
16
+ export * from './blocks/PopupSubTableFormModel';
17
+ export * from './PopupSubTableActionsColumnModel';
@@ -6,9 +6,16 @@
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
- import { CollectionField } from '@nocobase/flow-engine';
9
+ import { CollectionField, FlowModel } from '@nocobase/flow-engine';
10
10
  import React from 'react';
11
11
  import { FieldModel } from '../../base';
12
+ import { type ItemChain } from './itemChain';
13
+ export declare function buildRecordPickerParentItemContext(ctx: any): {
14
+ parentItem: ItemChain;
15
+ parentItemMeta: any;
16
+ parentItemResolver: ((subPath: string) => boolean) | undefined;
17
+ };
18
+ export declare function injectRecordPickerPopupContext(model: FlowModel, viewCtx: any, fieldModel?: any): void;
12
19
  export declare function RecordPickerContent({ model, toOne }: {
13
20
  model: any;
14
21
  toOne?: boolean;
@@ -9,6 +9,20 @@
9
9
  import { CollectionField, MultiRecordResource } from '@nocobase/flow-engine';
10
10
  import React from 'react';
11
11
  import { AssociationFieldModel } from './AssociationFieldModel';
12
+ import { type AssociationOption, type LazySelectProps } from './recordSelectShared';
13
+ type HydrateStatus = 'pending' | 'done';
14
+ type HydrationCandidate = {
15
+ item: AssociationOption;
16
+ tk: any;
17
+ tkKey: string;
18
+ };
19
+ export declare function collectAssociationHydrationCandidates(options: {
20
+ value: LazySelectProps['value'];
21
+ isMultiple: boolean;
22
+ valueKey: string;
23
+ labelKey: string;
24
+ statusMap: Map<string, HydrateStatus>;
25
+ }): HydrationCandidate[];
12
26
  export declare function CreateContent({ model, toOne }: {
13
27
  model: any;
14
28
  toOne?: boolean;
@@ -29,3 +43,4 @@ export declare class RecordSelectFieldModel extends AssociationFieldModel {
29
43
  change(value: any): void;
30
44
  render(): React.JSX.Element;
31
45
  }
46
+ export {};
@@ -10,7 +10,10 @@ import { EditableItemModel, FlowModelContext, ModelRenderMode } from '@nocobase/
10
10
  import { TableColumnProps } from 'antd';
11
11
  import React from 'react';
12
12
  import { SubTableFieldModel } from '.';
13
- import { FieldModel } from '../../../base';
13
+ import { FieldModel } from '../../../base/FieldModel';
14
+ export declare function FieldWithoutPermissionPlaceholder({ targetModel }: {
15
+ targetModel: any;
16
+ }): React.JSX.Element;
14
17
  export interface SubTableColumnModelStructure {
15
18
  parent: SubTableFieldModel;
16
19
  subModels: {
@@ -12,3 +12,4 @@ export * from './SubTableFieldModel';
12
12
  export * from './SubFormFieldModel';
13
13
  export * from './RecordPickerFieldModel';
14
14
  export * from './CascadeSelectFieldModel';
15
+ export * from './PopupSubTableFieldModel';
@@ -0,0 +1,94 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ export type ItemChain = {
10
+ index?: number;
11
+ length?: number;
12
+ __is_new__?: boolean;
13
+ __is_stored__?: boolean;
14
+ value: any;
15
+ parentItem?: ItemChain;
16
+ };
17
+ export type ItemChainResolver = (subPath: string) => boolean;
18
+ export type ParentItemAccessors = {
19
+ parentPropertiesAccessor: (ctx?: any) => any;
20
+ parentItemMetaAccessor: () => any;
21
+ parentItemResolverAccessor: () => ItemChainResolver | undefined;
22
+ };
23
+ export declare function createItemChainGetter(options: {
24
+ valueAccessor: () => any;
25
+ parentItemAccessor?: () => ItemChain | undefined;
26
+ indexAccessor?: () => number | undefined;
27
+ lengthAccessor?: () => number | undefined;
28
+ isNewAccessor?: () => boolean | undefined;
29
+ isStoredAccessor?: () => boolean | undefined;
30
+ }): () => ItemChain;
31
+ export declare function createRootItemChain(formValues: any): ItemChain;
32
+ export declare function resolveRecordPersistenceState(record: any, filterTargetKey: string | string[] | null | undefined): {
33
+ record: any;
34
+ hasPrimaryKey: boolean;
35
+ isNew: boolean;
36
+ isStored: boolean;
37
+ };
38
+ export declare function buildCurrentItemTitle(t: (key: string) => string, collectionField?: any, fallbackName?: string): string;
39
+ export declare function createParentItemAccessorsFromContext(options: {
40
+ parentContextAccessor: () => any;
41
+ fallbackParentPropertiesAccessor?: (ctx?: any) => any;
42
+ }): ParentItemAccessors;
43
+ export declare function createParentItemAccessorsFromInputArgs(inputArgsAccessor: () => any): ParentItemAccessors;
44
+ export declare function createItemChainMetaFactory(options: {
45
+ t: (key: string) => string;
46
+ title: string;
47
+ showIndex?: boolean;
48
+ showParentIndex?: boolean;
49
+ collectionAccessor: () => any;
50
+ propertiesAccessor: (ctx: any) => any;
51
+ parentCollectionAccessor?: () => any;
52
+ parentPropertiesAccessor?: (ctx: any) => any;
53
+ parentItemMetaAccessor?: () => any;
54
+ }): any;
55
+ export declare function createItemChainResolver(options: {
56
+ collectionAccessor: () => any;
57
+ propertiesAccessor?: () => unknown;
58
+ parentCollectionAccessor?: () => any;
59
+ parentPropertiesAccessor?: () => unknown;
60
+ parentItemResolverAccessor?: () => ((subPath: string) => boolean) | undefined;
61
+ }): (subPath: string) => boolean;
62
+ export type ItemChainMetaAndResolverOptions = {
63
+ metaFactoryOptions: Parameters<typeof createItemChainMetaFactory>[0];
64
+ resolverOptions: Parameters<typeof createItemChainResolver>[0];
65
+ };
66
+ export declare function createItemChainMetaAndResolver(options: ItemChainMetaAndResolverOptions): {
67
+ meta: any;
68
+ resolveOnServer: (subPath: string) => boolean;
69
+ };
70
+ export type AssociationItemChainContextPropertyOptions = {
71
+ t: (key: string) => string;
72
+ title: string;
73
+ showIndex?: boolean;
74
+ showParentIndex?: boolean;
75
+ collectionAccessor: () => any;
76
+ propertiesAccessor: (ctx: any) => any;
77
+ resolverPropertiesAccessor?: () => unknown;
78
+ parentCollectionAccessor?: () => any;
79
+ parentAccessors?: Partial<ParentItemAccessors>;
80
+ useParentItemMeta?: boolean;
81
+ useParentItemResolver?: boolean;
82
+ };
83
+ export declare function createAssociationItemChainContextPropertyOptions(options: AssociationItemChainContextPropertyOptions): {
84
+ serverOnlyWhenContextParams: true;
85
+ meta: any;
86
+ resolveOnServer: (subPath: string) => boolean;
87
+ cache: false;
88
+ };
89
+ export declare function createItemChainContextPropertyOptions(options: ItemChainMetaAndResolverOptions): {
90
+ serverOnlyWhenContextParams: true;
91
+ meta: any;
92
+ resolveOnServer: (subPath: string) => boolean;
93
+ cache: false;
94
+ };
@@ -6,6 +6,7 @@
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
+ import { type FlowRuntimeContext } from '@nocobase/flow-engine';
9
10
  import type { SelectProps } from 'antd';
10
11
  import React from 'react';
11
12
  export interface AssociationFieldNames {
@@ -14,13 +15,16 @@ export interface AssociationFieldNames {
14
15
  }
15
16
  export type AssociationOption = Record<string, any>;
16
17
  export type PopupScrollEvent = Parameters<NonNullable<SelectProps<any>['onPopupScroll']>>[0];
18
+ export declare function buildOpenerUids(ctx: FlowRuntimeContext, inputArgs?: Record<string, unknown>): string[];
17
19
  export interface LazySelectProps extends Omit<SelectProps<any>, 'mode' | 'options' | 'value' | 'onChange'> {
18
20
  fieldNames: AssociationFieldNames;
19
- value?: AssociationOption | AssociationOption[];
21
+ value?: AssociationOption | AssociationOption[] | string | string[] | number | number[];
20
22
  multiple?: boolean;
21
23
  allowMultiple?: boolean;
24
+ keepDropdownOpenOnSelect?: boolean;
22
25
  options?: AssociationOption[];
23
- onChange: (option: AssociationOption | AssociationOption[]) => void;
26
+ valueMode?: 'record' | 'value';
27
+ onChange: (option: AssociationOption | AssociationOption[] | string | string[] | number | number[]) => void;
24
28
  onDropdownVisibleChange?: (open: boolean) => void;
25
29
  onPopupScroll?: SelectProps<any>['onPopupScroll'];
26
30
  onSearch?: SelectProps<any>['onSearch'];
@@ -39,11 +43,17 @@ export interface LabelByFieldProps {
39
43
  fieldNames: AssociationFieldNames;
40
44
  }
41
45
  export declare function LabelByField(props: Readonly<LabelByFieldProps>): React.JSX.Element;
42
- export declare function toSelectValue(record: AssociationOption | AssociationOption[] | undefined, fieldNames: AssociationFieldNames, multiple?: boolean): {
46
+ export declare function toSelectValue(record: AssociationOption | AssociationOption[] | string | string[] | number | number[] | undefined, fieldNames: AssociationFieldNames, multiple?: boolean, valueMode?: 'record' | 'value', options?: AssociationOption[]): {
43
47
  label: React.JSX.Element;
44
48
  value: any;
45
49
  } | {
50
+ label: string | number | AssociationOption;
51
+ value: string | number | AssociationOption;
52
+ } | ({
46
53
  label: React.JSX.Element;
47
54
  value: any;
48
- }[];
49
- export declare function resolveOptions(options: AssociationOption[] | undefined, value: AssociationOption | AssociationOption[] | undefined, isMultiple: boolean): AssociationOption[];
55
+ } | {
56
+ label: string | number | AssociationOption;
57
+ value: string | number | AssociationOption;
58
+ })[];
59
+ export declare function resolveOptions(options: AssociationOption[] | undefined, value: AssociationOption | AssociationOption[] | string | string[] | number | number[] | undefined, isMultiple: boolean): AssociationOption[];
@@ -0,0 +1,14 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ export declare const normalizeFieldIndexChain: (fieldIndex: unknown) => string[];
10
+ export declare const buildDisplaySubListForkKey: ({ parentFieldIndex, index, blockPage, }: {
11
+ parentFieldIndex: string[];
12
+ index: number;
13
+ blockPage: number;
14
+ }) => string;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ export declare const registerFontSize: (Quill: any) => void;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ export declare const registerImageResize: (Quill: any) => void;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ export declare const registerSmartBreak: (Quill: any) => void;
10
+ export declare function lineBreakMatcher(node: any, delta: any): any;
11
+ export declare function handleLinebreak(range: any, context: any): boolean;
12
+ export declare function handleEnter(range: any, context: any): boolean;
@@ -23,7 +23,6 @@ export * from './RichTextFieldModel';
23
23
  export * from './SelectFieldModel';
24
24
  export * from './TextareaFieldModel';
25
25
  export * from './TimeFieldModel';
26
- export * from './UploadFieldModel';
27
26
  export * from './VariableFieldFormModel';
28
27
  export * from './JSFieldModel';
29
28
  export * from './JSEditableFieldModel';
@@ -0,0 +1,60 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ type CapabilityCollection = {
10
+ options?: Record<string, any>;
11
+ };
12
+ type CapabilityModelClass = {
13
+ prototype?: {
14
+ getAclActionName?: () => string | null | undefined;
15
+ };
16
+ capabilityActionName?: string | null;
17
+ capabilityActionNames?: string[] | null;
18
+ blockCapabilityActionName?: string | null;
19
+ blockCapabilityActionNames?: string[] | null;
20
+ };
21
+ /**
22
+ * 统一动作能力名,保证 v2 与 v1 使用同一套数据源动作键。
23
+ *
24
+ * @param actionName 动作名
25
+ * @returns 归一化后的动作能力名
26
+ */
27
+ export declare const normalizeCapabilityActionName: (actionName?: string | null) => string;
28
+ /**
29
+ * 判断 collection 是否支持指定动作能力。
30
+ *
31
+ * @param collection 数据表
32
+ * @param capabilityName 动作能力键
33
+ * @returns 是否支持
34
+ */
35
+ export declare const isCapabilitySupported: (collection: CapabilityCollection | null | undefined, capabilityName?: string | null) => boolean;
36
+ /**
37
+ * 判断 collection 是否支持一组动作能力。
38
+ *
39
+ * @param collection 数据表
40
+ * @param capabilityNames 动作能力键数组
41
+ * @returns 是否全部支持
42
+ */
43
+ export declare const areCapabilitiesSupported: (collection: CapabilityCollection | null | undefined, capabilityNames?: Array<string | null | undefined> | null) => boolean;
44
+ /**
45
+ * 推导动作模型使用的数据源动作能力键。
46
+ * 默认会回落到 getAclActionName,但允许通过静态字段显式覆写。
47
+ *
48
+ * @param ModelClass 动作模型类
49
+ * @returns 动作能力键数组或 null
50
+ */
51
+ export declare const getActionCapabilityNamesFromModelClass: (ModelClass: CapabilityModelClass) => string[];
52
+ /**
53
+ * 推导区块模型在“选择 collection”时需要满足的数据源动作能力键。
54
+ * 仅对显式声明的区块生效,避免误把所有区块都套上 view/create/update 过滤。
55
+ *
56
+ * @param ModelClass 区块模型类
57
+ * @returns 动作能力键数组或 null
58
+ */
59
+ export declare const getBlockCapabilityNamesFromModelClass: (ModelClass: CapabilityModelClass) => string[];
60
+ export {};
@@ -0,0 +1,20 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import { FlowModel } from '@nocobase/flow-engine';
10
+ import type { DispatchEventOptions } from '@nocobase/flow-engine';
11
+ /**
12
+ * 递归向子模型(及其 forks)分发指定事件。
13
+ * - 默认包含自身(用于类似分页切换等“整棵树状态刷新”的场景,例如 `paginationChange`)
14
+ */
15
+ export declare function dispatchEventDeep(root: FlowModel, eventName: string, inputArgs?: Record<string, any>, options?: {
16
+ debounce?: boolean;
17
+ } & DispatchEventOptions, deepOptions?: {
18
+ includeSelf?: boolean;
19
+ includeForks?: boolean;
20
+ }): Promise<void>;
@@ -7,3 +7,5 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
  export * from './blockUtils';
10
+ export * from './dispatchEventDeep';
11
+ export * from './pagination';
@@ -0,0 +1,29 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import type { PaginationProps } from 'antd';
10
+ /**
11
+ * 计算未知总数场景下的 Pagination total:
12
+ * - 本页不足 pageSize 或 hasNext=false,说明到末页
13
+ * - 否则用 +1 触发“还有下一页”
14
+ */
15
+ export declare const getUnknownCountPaginationTotal: (options: {
16
+ dataLength?: number;
17
+ pageSize?: number;
18
+ current?: number;
19
+ hasNext?: boolean;
20
+ }) => number;
21
+ export declare const getSimpleModePaginationClassName: (withLineHeight?: boolean) => string;
22
+ export declare const getMobileCompactPaginationClassName: () => string;
23
+ export declare const mergePaginationClassName: (...classNames: Array<string | undefined | false>) => string;
24
+ export declare const createCompactSimpleItemRender: (options: {
25
+ current?: number;
26
+ controlHeight?: number;
27
+ currentTextMarginLeft?: number;
28
+ }) => PaginationProps['itemRender'];
29
+ export declare const applyMobilePaginationProps: <T extends PaginationProps>(pagination: T, isMobileLayout: boolean) => PaginationProps;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ export declare const useJsonTemplateResolver: (template: string, deps?: any[]) => import("ahooks/lib/useRequest/src/types").Result<any, []>;