@nocobase/client-v2 2.1.0-beta.34 → 2.1.0-beta.36

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 (76) hide show
  1. package/es/BaseApplication.d.ts +7 -1
  2. package/es/PluginManager.d.ts +2 -0
  3. package/es/components/PoweredBy.d.ts +18 -0
  4. package/es/components/SwitchLanguage.d.ts +11 -0
  5. package/es/components/form/DialogFormLayout.d.ts +75 -0
  6. package/es/components/form/DrawerFormLayout.d.ts +11 -11
  7. package/es/components/form/PasswordInput.d.ts +40 -0
  8. package/es/components/form/RemoteSelect.d.ts +79 -0
  9. package/es/components/form/index.d.ts +3 -0
  10. package/es/components/form/table/styles.d.ts +10 -0
  11. package/es/components/index.d.ts +2 -0
  12. package/es/flow/models/base/ActionModelCore.d.ts +6 -0
  13. package/es/flow/models/base/GridModel.d.ts +2 -0
  14. package/es/flow/models/blocks/filter-form/FilterFormBlockModel.d.ts +9 -1
  15. package/es/flow/utils/dataScopeFormValueClear.d.ts +14 -0
  16. package/es/flow-compat/passwordUtils.d.ts +1 -1
  17. package/es/hooks/index.d.ts +2 -0
  18. package/es/hooks/useCurrentAppInfo.d.ts +9 -0
  19. package/es/index.mjs +117 -105
  20. package/es/json-logic/globalOperators.d.ts +11 -0
  21. package/es/nocobase-buildin-plugin/index.d.ts +25 -0
  22. package/es/utils/appVersionHTML.d.ts +10 -0
  23. package/es/utils/globalDeps.d.ts +7 -0
  24. package/es/utils/index.d.ts +1 -0
  25. package/es/utils/remotePlugins.d.ts +4 -1
  26. package/lib/index.js +120 -108
  27. package/package.json +7 -6
  28. package/src/BaseApplication.tsx +11 -3
  29. package/src/PluginManager.ts +2 -0
  30. package/src/PluginSettingsManager.ts +2 -1
  31. package/src/__tests__/PluginSettingsManager.test.ts +19 -0
  32. package/src/__tests__/PoweredBy.test.tsx +130 -0
  33. package/src/__tests__/app.test.tsx +39 -0
  34. package/src/__tests__/nocobase-buildin-plugin-auth.test.tsx +39 -72
  35. package/src/__tests__/remotePlugins.test.ts +203 -0
  36. package/src/__tests__/useCurrentRoles.test.tsx +100 -0
  37. package/src/components/PoweredBy.tsx +71 -0
  38. package/src/components/README.md +314 -0
  39. package/src/components/README.zh-CN.md +312 -0
  40. package/src/components/SwitchLanguage.tsx +48 -0
  41. package/src/components/form/DialogFormLayout.tsx +111 -0
  42. package/src/components/form/DrawerFormLayout.tsx +13 -32
  43. package/src/components/form/PasswordInput.tsx +211 -0
  44. package/src/components/form/RemoteSelect.tsx +137 -0
  45. package/src/components/form/index.tsx +3 -0
  46. package/src/components/form/table/Table.tsx +2 -1
  47. package/src/components/form/table/styles.ts +19 -0
  48. package/src/components/index.ts +2 -0
  49. package/src/css-variable/CSSVariableProvider.tsx +10 -1
  50. package/src/flow/actions/__tests__/dataScopeFormValueClear.test.ts +96 -0
  51. package/src/flow/actions/dataScope.tsx +3 -0
  52. package/src/flow/actions/filterFormDefaultValues.tsx +1 -2
  53. package/src/flow/admin-shell/admin-layout/AdminLayoutComponent.tsx +1 -4
  54. package/src/flow/admin-shell/admin-layout/HelpLite.tsx +7 -33
  55. package/src/flow/components/BlockItemCard.tsx +2 -2
  56. package/src/flow/models/base/ActionModel.tsx +8 -7
  57. package/src/flow/models/base/ActionModelCore.tsx +15 -7
  58. package/src/flow/models/base/GridModel.tsx +93 -36
  59. package/src/flow/models/base/__tests__/GridModel.visibleLayout.test.ts +83 -11
  60. package/src/flow/models/blocks/details/DetailsItemModel.tsx +2 -0
  61. package/src/flow/models/blocks/filter-form/FilterFormBlockModel.tsx +329 -5
  62. package/src/flow/models/blocks/filter-form/__tests__/defaultValues.wiring.test.ts +337 -0
  63. package/src/flow/models/blocks/form/FormItemModel.tsx +5 -3
  64. package/src/flow/models/blocks/form/__tests__/FormItemModel.defineChildren.test.ts +108 -0
  65. package/src/flow/models/blocks/table/TableActionsColumnModel.tsx +5 -0
  66. package/src/flow/models/blocks/table/TableColumnModel.tsx +2 -0
  67. package/src/flow/models/fields/AssociationFieldModel/SubTableFieldModel/SubTableColumnModel.tsx +2 -0
  68. package/src/flow/utils/dataScopeFormValueClear.ts +278 -0
  69. package/src/hooks/index.ts +2 -0
  70. package/src/hooks/useCurrentAppInfo.ts +36 -0
  71. package/src/json-logic/globalOperators.js +731 -0
  72. package/src/nocobase-buildin-plugin/index.tsx +70 -16
  73. package/src/utils/appVersionHTML.ts +28 -0
  74. package/src/utils/globalDeps.ts +47 -31
  75. package/src/utils/index.tsx +2 -0
  76. package/src/utils/remotePlugins.ts +119 -13
@@ -28,6 +28,11 @@ type AuthTokenPayload = {
28
28
  token: string;
29
29
  authenticator: string | null;
30
30
  };
31
+ export type JsonLogic = {
32
+ apply: (logic: any, data?: any) => any;
33
+ addOperation: (name: string, fn?: any) => void;
34
+ rmOperation: (name: string) => void;
35
+ };
31
36
  export type DevDynamicImport = (packageName: string) => Promise<{
32
37
  default: PluginClass;
33
38
  }>;
@@ -73,6 +78,7 @@ export declare abstract class BaseApplication<TOptions extends BaseApplicationOp
73
78
  favicon: string;
74
79
  flowEngine: FlowEngine;
75
80
  dataSourceManager: any;
81
+ jsonLogic: JsonLogic;
76
82
  context: FlowEngineContext & {
77
83
  routeRepository: RouteRepository;
78
84
  appInfo: Promise<Record<string, any>>;
@@ -124,7 +130,7 @@ export declare abstract class BaseApplication<TOptions extends BaseApplicationOp
124
130
  protected addFinalProviders(): void;
125
131
  addReactRouterComponents(): void;
126
132
  addRoutes(): void;
127
- updateFavicon(favicon?: string): void;
133
+ updateFavicon(favicon?: string | null): void;
128
134
  setWsAuthorized(authorized: boolean): void;
129
135
  setMaintaining(maintaining: boolean): void;
130
136
  getOptions(): TOptions;
@@ -18,6 +18,8 @@ export type PluginData = {
18
18
  version: string;
19
19
  url: string;
20
20
  clientV2Url?: string;
21
+ devMode?: 'esm';
22
+ appDevDependencies?: string[];
21
23
  type: 'local' | 'upload' | 'npm';
22
24
  };
23
25
  export declare class PluginManager<TApp extends BaseApplication<any> = BaseApplication<any>> {
@@ -0,0 +1,18 @@
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
+ /**
11
+ * Footer brand rendered on auth pages and other layout entry points. Falls
12
+ * back to "Powered by NocoBase" when `@nocobase/plugin-custom-brand` is not
13
+ * installed; otherwise renders the plugin's HTML template with the
14
+ * `{{appVersion}}` placeholder substituted. The version is escaped via
15
+ * `getAppVersionHTML` so a malicious app version cannot inject script tags.
16
+ */
17
+ export declare function PoweredBy(): React.JSX.Element;
18
+ export default PoweredBy;
@@ -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 React from 'react';
10
+ export declare function SwitchLanguage(): React.JSX.Element;
11
+ export default SwitchLanguage;
@@ -0,0 +1,75 @@
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
+ export interface DialogFormLayoutProps {
11
+ /** Header title rendered in the dialog's title slot. */
12
+ title: React.ReactNode;
13
+ /** Form body — typically a `<Form>` wrapping `<Form.Item>` fields. */
14
+ children: React.ReactNode;
15
+ /**
16
+ * Called before the dialog is closed by the Cancel button or the
17
+ * top-right close (X) icon. Use for "discard changes" confirmations.
18
+ */
19
+ onCancel?: () => void | Promise<void>;
20
+ /**
21
+ * Called when the Submit button is clicked. Caller owns validation
22
+ * + the actual API call; the dialog is closed automatically when
23
+ * `onSubmit` resolves. Throw from `onSubmit` to keep the dialog open
24
+ * (e.g. on a validation error).
25
+ */
26
+ onSubmit?: () => void | Promise<void>;
27
+ /** Drives the Submit button's loading state. */
28
+ submitting?: boolean;
29
+ /** Override the Submit button label. Defaults to "Submit". */
30
+ submitText?: React.ReactNode;
31
+ /** Override the Cancel button label. Defaults to "Cancel". */
32
+ cancelText?: React.ReactNode;
33
+ /**
34
+ * Full override of the footer content. When provided, the default
35
+ * Cancel + Submit buttons are replaced. Useful for forms that need
36
+ * extra actions (e.g. Preview, Save draft).
37
+ */
38
+ footer?: React.ReactNode;
39
+ }
40
+ /**
41
+ * Standard layout for dialog-hosted forms — the dialog counterpart of
42
+ * `DrawerFormLayout`. Title sits left-aligned in the dialog's native
43
+ * header (no inline close icon — the dialog provides its own X in the
44
+ * top-right when opened with `viewer.dialog({ closable: true, ... })`),
45
+ * the form body fills the middle, and a Cancel + Submit footer sits
46
+ * at the bottom.
47
+ *
48
+ * Why not just reuse `DrawerFormLayout`? `DrawerFormLayout` injects a
49
+ * `<CloseOutlined>` button next to the title — that's the drawer
50
+ * visual contract (close lives near the title in a side panel). In a
51
+ * centered dialog the native top-right close button is the expected
52
+ * affordance, so a separate layout keeps the visual contract clean.
53
+ *
54
+ * Callers own the `<Form>` instance, validation, and the actual API
55
+ * call. This component only handles the chrome and close behaviour.
56
+ *
57
+ * Example:
58
+ *
59
+ * ```tsx
60
+ * ctx.viewer.dialog({
61
+ * closable: true, // native top-right X
62
+ * content: () => (
63
+ * <DialogFormLayout
64
+ * title={t('Bind verifier')}
65
+ * onSubmit={handleSubmit}
66
+ * submitting={submitting}
67
+ * submitText={t('Bind')}
68
+ * >
69
+ * <Form form={form} layout="vertical">...</Form>
70
+ * </DialogFormLayout>
71
+ * ),
72
+ * });
73
+ * ```
74
+ */
75
+ export declare function DialogFormLayout(props: DialogFormLayoutProps): React.JSX.Element;
@@ -8,15 +8,10 @@
8
8
  */
9
9
  import React from 'react';
10
10
  export interface DrawerFormLayoutProps {
11
- /** Header title rendered next to the close (X) button. */
11
+ /** Header title rendered next to antd Drawer's native close (X) icon. */
12
12
  title: React.ReactNode;
13
13
  /** Form body — typically a `<Form>` wrapping `<Form.Item>` fields. */
14
14
  children: React.ReactNode;
15
- /**
16
- * Called before the drawer is closed by either the Cancel button or the
17
- * header's X icon. Use for "discard changes" confirmations.
18
- */
19
- onCancel?: () => void | Promise<void>;
20
15
  /**
21
16
  * Called when the Submit button is clicked. Caller owns validation + the
22
17
  * actual API call; the drawer is closed automatically when `onSubmit`
@@ -38,12 +33,17 @@ export interface DrawerFormLayoutProps {
38
33
  footer?: React.ReactNode;
39
34
  }
40
35
  /**
41
- * Standard layout for drawer-hosted forms: a close-icon + title header on
42
- * top, the caller-provided form body in the middle, and a Cancel + Submit
43
- * footer at the bottom. Wraps `useFlowView()`'s `Header` / `Footer` slots
44
- * so the drawer chrome stays consistent across plugins.
36
+ * Standard layout for drawer-hosted forms: a title-only header on top
37
+ * (caller must open the drawer with `viewer.drawer({ closable: true })`
38
+ * so antd Drawer renders its native left-side X next to the title),
39
+ * the caller-provided form body in the middle, and a Cancel + Submit
40
+ * footer at the bottom. Wraps `useFlowView()`'s `Header` / `Footer`
41
+ * slots so the drawer chrome stays consistent across plugins.
42
+ *
43
+ * To intercept close (e.g. dirty-form confirmation), use the lower-level
44
+ * `viewer.drawer({ preventClose, beforeClose, ... })` hooks — this
45
+ * layout no longer wraps a custom close handler.
45
46
  *
46
47
  * Callers own the `<Form>` instance, validation, and the actual API call.
47
- * This component only handles the chrome and the close behaviour.
48
48
  */
49
49
  export declare function DrawerFormLayout(props: DrawerFormLayoutProps): React.JSX.Element;
@@ -0,0 +1,40 @@
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 { PasswordProps as AntdPasswordProps } from 'antd/es/input';
10
+ import React from 'react';
11
+ export interface PasswordInputProps extends AntdPasswordProps {
12
+ /**
13
+ * Render a visual strength bar beneath the input. Defaults to `false`. The
14
+ * score is computed locally — opting in does NOT add any form validation;
15
+ * use a separate `Form.Item.rules` entry for that (or wire the entry up to
16
+ * a cross-plugin password-validator extension point if your project
17
+ * provides one).
18
+ */
19
+ checkStrength?: boolean;
20
+ }
21
+ /**
22
+ * `Input.Password` plus an optional strength meter, ported from the v1
23
+ * `Password` component. The strength scoring and bar UI are identical to v1,
24
+ * so users who switch from a v1 page to a v2 page see the same visual signal.
25
+ *
26
+ * The component is value-shape compatible with antd `Input.Password` — drop
27
+ * it into any existing `Form.Item<password>` and toggle the meter with
28
+ * `checkStrength`.
29
+ *
30
+ * Caveats:
31
+ *
32
+ * - Strength scoring is purely a UX hint, not validation. Submitting a weak
33
+ * password is still allowed unless the server (or a separately installed
34
+ * password-policy plugin) rejects it.
35
+ * - The meter swallows the gap between `<Input.Password>` and the next form
36
+ * element. If your `Form.Item` already adds vertical rhythm, the meter
37
+ * inherits it; no extra spacing is added.
38
+ */
39
+ export declare function PasswordInput(props: PasswordInputProps): React.JSX.Element;
40
+ export default PasswordInput;
@@ -0,0 +1,79 @@
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 SelectProps } from 'antd';
10
+ import React from 'react';
11
+ export interface RemoteSelectFieldNames {
12
+ label?: string;
13
+ value?: string;
14
+ }
15
+ export interface RemoteSelectProps<RawItem = any, Resp = RawItem[], V = any> extends Omit<SelectProps<V>, 'options' | 'loading'> {
16
+ /**
17
+ * Fetch the option source. Receives no arguments; caller closes over the
18
+ * `ctx.api.resource(...)` (or any other source) it needs. May resolve
19
+ * with either an array of raw items (the common case) or an arbitrary
20
+ * envelope object — in the latter case, supply `selectItems` to pluck
21
+ * the array out.
22
+ */
23
+ request: () => Promise<Resp | undefined>;
24
+ /**
25
+ * When `request` returns an envelope (object with metadata around the
26
+ * list), use this to extract the array of items that drives the
27
+ * dropdown. Defaults to identity, i.e. `request` itself returns the
28
+ * array.
29
+ */
30
+ selectItems?: (response: Resp) => RawItem[] | undefined;
31
+ /**
32
+ * Names of the raw item properties that hold the display label and the
33
+ * persisted value. Defaults to `{ label: 'label', value: 'value' }`.
34
+ * Ignored when `mapOptions` is supplied.
35
+ */
36
+ fieldNames?: RemoteSelectFieldNames;
37
+ /**
38
+ * Full custom mapping from a raw item to an antd `OptionType`. When
39
+ * provided, overrides `fieldNames`.
40
+ */
41
+ mapOptions?: (item: RawItem, index: number) => {
42
+ label: React.ReactNode;
43
+ value: any;
44
+ };
45
+ /**
46
+ * Stable cache key for ahooks `useRequest` so the dropdown doesn't re-fetch
47
+ * on every re-mount. Pass a value tied to the request's effective inputs.
48
+ */
49
+ cacheKey?: string;
50
+ /**
51
+ * Re-run the request when any of these values changes. Forwarded to
52
+ * `useRequest`'s `refreshDeps`.
53
+ */
54
+ refreshDeps?: unknown[];
55
+ /**
56
+ * Skip the auto-fetch on mount when `false`. Defaults to `true`.
57
+ */
58
+ ready?: boolean;
59
+ /**
60
+ * Notified once the request resolves. Receives both the mapped item
61
+ * array and the raw response envelope — useful when callers need to
62
+ * read sibling metadata (counts, availability hints, etc.) without
63
+ * issuing a second request.
64
+ */
65
+ onLoaded?: (items: RawItem[], response: Resp) => void;
66
+ }
67
+ /**
68
+ * Generic settings-page Select bound to an async option source. The
69
+ * component itself stays framework-agnostic — it knows nothing about
70
+ * NocoBase resources, data sources, or Formily. Pass any async `request`
71
+ * that resolves with an array, and supply `fieldNames` (or `mapOptions`)
72
+ * to map raw items to antd option shape.
73
+ *
74
+ * Search is local-only (antd's default `optionFilterProp="label"`). For
75
+ * server-side search, drive `request` from external state and pass the
76
+ * search input via `refreshDeps`.
77
+ */
78
+ export declare function RemoteSelect<RawItem = any, Resp = RawItem[], V = any>(props: RemoteSelectProps<RawItem, Resp, V>): React.JSX.Element;
79
+ export default RemoteSelect;
@@ -7,8 +7,11 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
  export * from './createFormRegistry';
10
+ export * from './DialogFormLayout';
10
11
  export * from './DrawerFormLayout';
11
12
  export * from './EnvVariableInput';
12
13
  export * from './FileSizeInput';
13
14
  export * from './JsonTextArea';
15
+ export * from './PasswordInput';
16
+ export * from './RemoteSelect';
14
17
  export * from './VariableInput';
@@ -6,6 +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
+ /**
10
+ * Restore horizontal scrolling on `.ant-table-content` so wide tables in
11
+ * narrow containers (drawer / settings panel) scroll their inner `<table>`
12
+ * instead of getting clipped or forcing the outer container to grow.
13
+ *
14
+ * `width: max-content` on the inner `<table>` lets columns size to their
15
+ * natural width; `min-width: 100%` keeps the table filling the viewport
16
+ * when total column width is smaller than the container.
17
+ */
18
+ export declare const tableScrollClassName: string;
9
19
  /**
10
20
  * Reserve a `SORT_HANDLE_GUTTER`-wide gap on the left of the rowSelection
11
21
  * column so the handle's `left:0` lands inside a `position:relative` cell.
@@ -11,5 +11,7 @@ export * from './BlankComponent';
11
11
  export * from './form/table/dnd';
12
12
  export * from './form';
13
13
  export * from './Icon';
14
+ export * from './PoweredBy';
14
15
  export * from './RouterContextCleaner';
16
+ export * from './SwitchLanguage';
15
17
  export * from './form/table';
@@ -20,10 +20,12 @@ export declare const ActionSceneEnum: {
20
20
  export declare class ActionModel<T extends DefaultStructure = DefaultStructure> extends FlowModel<T> {
21
21
  props: ButtonProps & {
22
22
  tooltip?: string;
23
+ iconOnly?: boolean;
23
24
  };
24
25
  scene: ActionSceneType;
25
26
  defaultProps: ButtonProps & {
26
27
  tooltip?: string;
28
+ iconOnly?: boolean;
27
29
  };
28
30
  enableEditTooltip: boolean;
29
31
  enableEditTitle: boolean;
@@ -31,6 +33,10 @@ export declare class ActionModel<T extends DefaultStructure = DefaultStructure>
31
33
  enableEditType: boolean;
32
34
  enableEditDanger: boolean;
33
35
  enableEditColor: boolean;
36
+ buttonTypeOptions: {
37
+ value: string;
38
+ label: string;
39
+ }[];
34
40
  static _getScene(): any[];
35
41
  static _isScene(scene: ActionSceneType): boolean;
36
42
  getAclActionName(): any;
@@ -55,6 +55,7 @@ export declare class GridModel<T extends {
55
55
  private buildResizedCells;
56
56
  private getResizeRowPath;
57
57
  private getResizeContainerWidth;
58
+ private prunePlaceholderOnlyRows;
58
59
  private resizeGridLayout;
59
60
  onMount(): void;
60
61
  saveGridLayout(layout?: GridLayoutData | GridLayoutV2): void;
@@ -82,6 +83,7 @@ export declare class GridModel<T extends {
82
83
  * 运行态按可见 block 过滤行/列,避免“整行都是 hidden block”但依然保留行间距占位。
83
84
  * - 配置态(flowSettingsEnabled)保持原始 rows/sizes 以便拖拽和布局编辑。
84
85
  * - 运行态仅在判断为“整列/整行都不可见”时做过滤,不写回 props/stepParams,布局元数据保持不变。
86
+ * - 空列是拖拽缩窄后保存的布局占位,运行态需要保留其宽度,但 Grid 渲染层不会渲染其内容。
85
87
  */
86
88
  private getVisibleLayout;
87
89
  render(): React.JSX.Element;
@@ -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 { PropertyMetaFactory } from '@nocobase/flow-engine';
9
10
  import React from 'react';
10
11
  import { FilterBlockModel } from '../../base/FilterBlockModel';
11
12
  export declare class FilterFormBlockModel extends FilterBlockModel<{
@@ -22,8 +23,11 @@ export declare class FilterFormBlockModel extends FilterBlockModel<{
22
23
  private removeTargetBlockListener?;
23
24
  private initialDefaultsPromise?;
24
25
  private initialRefreshHandledTargetIds;
26
+ private lastDefaultValueByFieldName;
27
+ private defaultValuesRefreshSeq;
25
28
  get form(): any;
26
29
  get title(): string;
30
+ protected createFormValuesMetaFactory(): PropertyMetaFactory;
27
31
  useHooksBeforeRender(): void;
28
32
  saveStepParams(): Promise<any>;
29
33
  addAppends(): void;
@@ -34,9 +38,13 @@ export declare class FilterFormBlockModel extends FilterBlockModel<{
34
38
  prepareInitialFilterValues(): Promise<boolean>;
35
39
  markInitialTargetRefreshHandled(targetId: string): void;
36
40
  private ensureFilterItemsBeforeRender;
41
+ private canApplyFormDefaultValue;
42
+ private matchDefaultValueCondition;
37
43
  applyFormDefaultValues(options?: {
38
44
  force?: boolean;
39
- }): Promise<void>;
45
+ refreshSeq?: number;
46
+ }): Promise<Record<string, any>>;
47
+ private handleFilterFormValuesChange;
40
48
  private handleTargetBlockRemoved;
41
49
  destroy(): Promise<boolean>;
42
50
  renderComponent(): React.JSX.Element;
@@ -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 { FlowContext } from '@nocobase/flow-engine';
10
+ /**
11
+ * When a field's dataScope filter references other form values (e.g. `{{ ctx.formValues.school.id }}`),
12
+ * clear current field value after the dependency changes, so users don't keep an invalid stale selection.
13
+ */
14
+ export declare function ensureFormValueDrivenDataScopeClear(ctx: FlowContext, params: any): void;
@@ -6,4 +6,4 @@
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
- export declare const getStrength: (val: any) => 60 | 0 | 20 | 100 | 40 | 80;
9
+ export declare const getStrength: (val: any) => 60 | 0 | 20 | 100 | 80 | 40;
@@ -7,5 +7,7 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
  export * from './useApp';
10
+ export * from './useCurrentAppInfo';
10
11
  export * from './usePlugin';
11
12
  export * from './useRouter';
13
+ export { escapeHTML, getAppVersionHTML } from '../utils/appVersionHTML';
@@ -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 function useCurrentAppInfo<TAppInfo extends Record<string, any> = Record<string, any>>(): TAppInfo;