@gct-paas/word 0.1.12 → 0.1.13

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 (69) hide show
  1. package/dist/base/calendar/src/calendar.vue.d.ts +1 -0
  2. package/dist/base/calendar/src/time.vue.d.ts +1 -0
  3. package/dist/base/index.d.ts +2 -0
  4. package/dist/base/modal/src/ModalRoot.vue.d.ts +2 -0
  5. package/dist/base/modal/src/modal.type.d.ts +3 -0
  6. package/dist/base/select/src/basic-select.vue.d.ts +9 -1
  7. package/dist/base/table/src/table.type.d.ts +19 -0
  8. package/dist/base/table/src/table.vue.d.ts +31 -56
  9. package/dist/base/tree/index.d.ts +1 -0
  10. package/dist/base/tree/src/tree-node.vue.d.ts +14 -0
  11. package/dist/base/tree/src/tree.type.d.ts +6 -0
  12. package/dist/base/tree/src/tree.vue.d.ts +18 -0
  13. package/dist/base/tree-select/index.d.ts +1 -0
  14. package/dist/base/tree-select/src/tree-select.vue.d.ts +45 -0
  15. package/dist/capabilities/panel/schema/types.d.ts +4 -1
  16. package/dist/core/data/DataManager.d.ts +38 -36
  17. package/dist/core/index.d.ts +3 -0
  18. package/dist/core/layout/handlers/FieldHandler.d.ts +0 -21
  19. package/dist/core/layout/handlers/fields/AttachmentHandler.d.ts +14 -0
  20. package/dist/core/layout/handlers/fields/BaseHandler.d.ts +67 -0
  21. package/dist/core/layout/handlers/fields/ImgHandler.d.ts +5 -0
  22. package/dist/core/layout/handlers/fields/InputHandler.d.ts +5 -0
  23. package/dist/core/layout/handlers/fields/OptionHandler.d.ts +15 -0
  24. package/dist/core/layout/handlers/fields/SignatureHandler.d.ts +24 -0
  25. package/dist/core/layout/handlers/fields/index.d.ts +6 -0
  26. package/dist/core/model/document/WsecPr.d.ts +39 -0
  27. package/dist/core/sdk/types/public-types.d.ts +2 -0
  28. package/dist/core/utils/calculate-formula.d.ts +5 -0
  29. package/dist/core/view/Page.d.ts +0 -3
  30. package/dist/core/view/Section.d.ts +4 -18
  31. package/dist/core/view/runs/ImageRun.d.ts +12 -0
  32. package/dist/core/view/runs/TextRun.d.ts +1 -0
  33. package/dist/core/view/runs/TextWidget.d.ts +8 -8
  34. package/dist/core/widget/widget-state.d.ts +21 -0
  35. package/dist/index.es.js +4712 -3844
  36. package/dist/runtime/canvas/__common__/widget-container/overlay-layer.vue.d.ts +2 -0
  37. package/dist/runtime/canvas/__common__/widget-container/overlay-render.vue.d.ts +1 -1
  38. package/dist/runtime/designer/doc-design-layout.vue.d.ts +3 -1
  39. package/dist/runtime/factories/createValidateFactory.d.ts +3 -1
  40. package/dist/runtime/factories/useDependency.d.ts +5 -0
  41. package/dist/runtime/factories/useRenderData.d.ts +2 -0
  42. package/dist/runtime/interface/computed.d.ts +18 -0
  43. package/dist/runtime/interface/data.d.ts +1 -4
  44. package/dist/runtime/interface/render.d.ts +11 -0
  45. package/dist/runtime/interface/utils.d.ts +8 -0
  46. package/dist/setup.d.ts +11 -0
  47. package/dist/suites/edhr/field-manifest/_common_/basic.d.ts +2 -0
  48. package/dist/suites/edhr/panel-schema/data-group/data-group.basic.d.ts +4 -1
  49. package/dist/suites/edhr/panel-schema/data-init/common/add-builtin-field/add-builtin-field-modal.vue.d.ts +1 -1
  50. package/dist/suites/edhr/panel-schema/data-init/common/add-builtin-param/add-builtin-param-modal.vue.d.ts +5 -3
  51. package/dist/suites/edhr/panel-schema/data-init/common/add-field/add-field-modal.vue.d.ts +15 -6
  52. package/dist/suites/edhr/panel-schema/data-init/common/add-field/add-field-select.vue.d.ts +1 -5
  53. package/dist/suites/edhr/panel-schema/data-init/common/add-field/useField.d.ts +1 -4
  54. package/dist/suites/edhr/panel-schema/data-init/common/add-online-form-model/online-form-model-select.vue.d.ts +12 -0
  55. package/dist/suites/edhr/panel-schema/data-init/common/add-sql/add-sql-modal.vue.d.ts +3 -4
  56. package/dist/suites/edhr/panel-schema/data-init/common/data-source-model-link.vue.d.ts +2 -2
  57. package/dist/suites/edhr/panel-schema/data-init/utils/index.d.ts +9 -17
  58. package/dist/suites/edhr/panel-schema/dynamic-table/dynamic-table.basic.d.ts +4 -1
  59. package/dist/suites/edhr/panel-schema/fixed-table/fixed-table.basic.d.ts +4 -1
  60. package/dist/suites/edhr/panel-schema/index.d.ts +12 -3
  61. package/dist/utils/ServiceUtil.d.ts +31 -4
  62. package/dist/utils/TriggerUtil.d.ts +27 -0
  63. package/dist/utils/func/core.d.ts +6 -0
  64. package/dist/utils/func/file.d.ts +2 -0
  65. package/dist/word.css +886 -889
  66. package/package.json +2 -2
  67. package/dist/core/layout/handlers/fields/image.d.ts +0 -1
  68. package/dist/core/layout/handlers/fields/signature.d.ts +0 -1
  69. package/dist/runtime/renderer/dialogs/upload-file/utils.d.ts +0 -16
@@ -7,6 +7,7 @@ type __VLS_Props = {
7
7
  disabledDates?: (d: Date) => boolean;
8
8
  minDate?: string | number | Date;
9
9
  maxDate?: string | number | Date;
10
+ timeFormat?: 'HH:mm:ss' | 'HH:mm' | 'HH';
10
11
  };
11
12
  declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
12
13
  change: (value: Date) => any;
@@ -1,6 +1,7 @@
1
1
  type __VLS_Props = {
2
2
  modelValue: string | undefined;
3
3
  disabled?: boolean;
4
+ format?: 'HH:mm:ss' | 'HH:mm' | 'HH';
4
5
  disabledTime?: () => {
5
6
  disabledHours?: () => number[];
6
7
  disabledMinutes?: (hour: number) => number[];
@@ -19,4 +19,6 @@ export * from './select';
19
19
  export * from './switch';
20
20
  export * from './table';
21
21
  export * from './tooltip';
22
+ export * from './tree';
23
+ export * from './tree-select';
22
24
  export * from './date-time-picker';
@@ -10,7 +10,9 @@ declare const _default: import('vue').DefineComponent<IModalProps, {}, {}, {}, {
10
10
  closeOnMaskClick: boolean;
11
11
  showFooter: boolean;
12
12
  showCancel: boolean;
13
+ showConfirmContinue: boolean;
13
14
  confirmText: string;
15
+ confirmContinueText: string;
14
16
  cancelText: string;
15
17
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
16
18
  bodyRef: unknown;
@@ -20,9 +20,12 @@ export interface IModalOptions {
20
20
  closeOnMaskClick?: boolean;
21
21
  showFooter?: boolean;
22
22
  showCancel?: boolean;
23
+ showConfirmContinue?: boolean;
23
24
  confirmText?: string;
25
+ confirmContinueText?: string;
24
26
  cancelText?: string;
25
27
  onConfirm?: (ins: IModalInstance) => Promise<void> | void;
28
+ onConfirmContinue?: (ins: IModalInstance) => Promise<void> | void;
26
29
  onCancel?: (ins: IModalInstance) => Promise<void> | void;
27
30
  }
28
31
  export interface IModalProps extends IModalOptions {
@@ -20,6 +20,8 @@ type __VLS_Props = {
20
20
  readonly?: boolean;
21
21
  /** 不显示右侧箭头 */
22
22
  noArrow?: boolean;
23
+ /** 是否需要分组展示 */
24
+ grouped?: boolean;
23
25
  };
24
26
  declare function __VLS_template(): {
25
27
  attrs: Partial<{}>;
@@ -27,6 +29,12 @@ declare function __VLS_template(): {
27
29
  option?(_: {
28
30
  option: DropdownOption;
29
31
  }): any;
32
+ option?(_: {
33
+ option: DropdownOption;
34
+ }): any;
35
+ 'option-icon'?(_: {
36
+ option: DropdownOption;
37
+ }): any;
30
38
  'option-icon'?(_: {
31
39
  option: DropdownOption;
32
40
  }): any;
@@ -55,8 +63,8 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {
55
63
  onChange?: ((val: string | number | (string | number)[], item?: DropdownOption | undefined) => any) | undefined;
56
64
  "onUpdate:modelValue"?: ((val: string | number | (string | number)[]) => any) | undefined;
57
65
  }>, {
58
- options: DropdownOption[];
59
66
  placeholder: string;
67
+ options: DropdownOption[];
60
68
  popperWidth: number;
61
69
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
62
70
  dropdownRef: import('vue').CreateComponentPublicInstanceWithMixins<Record<string, any> & {}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {}, false, {}, {}, {}, {}, string, {}, any, import('vue').ComponentProvideOptions, {
@@ -0,0 +1,19 @@
1
+ export interface TableColumn {
2
+ key: string;
3
+ name: string;
4
+ align?: 'left' | 'center' | 'right';
5
+ width?: number | string;
6
+ }
7
+ export type TableRow = Record<string, any>;
8
+ export interface TableProps {
9
+ rows: TableRow[];
10
+ columns?: TableColumn[];
11
+ height?: number | string;
12
+ stripe?: boolean;
13
+ selectable?: boolean;
14
+ multiple?: boolean;
15
+ selectedKeys?: string[];
16
+ loading?: boolean;
17
+ size?: 'small' | 'middle' | 'large';
18
+ getRowKey?: (row: TableRow) => string | number;
19
+ }
@@ -1,69 +1,44 @@
1
- interface Column {
2
- key: string;
3
- title: string;
4
- align?: string;
5
- width?: number | string;
6
- }
7
- interface Row {
8
- [key: string]: any;
9
- }
10
- type __VLS_Props = {
11
- stripe?: boolean;
12
- selectable?: boolean;
13
- height?: number | string;
14
- columns?: Column[];
15
- dataSource?: Row[];
16
- selectedRowKeys?: (string | number)[];
17
- rowHeight?: number;
18
- visibleRowCount?: number;
19
- isLoading?: boolean;
20
- getRowKey?: (row: Row) => string | number;
21
- };
1
+ import { TableColumn, TableProps, TableRow } from './table.type';
22
2
  declare function __VLS_template(): {
23
3
  attrs: Partial<{}>;
24
- slots: {
25
- title?(_: {}): any;
26
- bodyCell?(_: {
27
- row: Row;
28
- rowIndex: number;
29
- text: any;
30
- column: Column;
4
+ slots: Partial<Record<`header-${string}`, (_: {
5
+ column: TableColumn;
6
+ }) => any>> & Partial<Record<`cell-${string}`, (_: {
7
+ row: TableRow;
8
+ column: TableColumn;
9
+ value: any;
10
+ index: number;
11
+ }) => any>> & {
12
+ select?(_: {
13
+ row: TableRow;
14
+ checked: boolean;
15
+ }): any;
16
+ cell?(_: {
17
+ row: TableRow;
18
+ column: TableColumn;
19
+ value: any;
20
+ index: number;
31
21
  }): any;
32
22
  };
33
- refs: {
34
- wrapperRef: HTMLDivElement;
35
- };
23
+ refs: {};
36
24
  rootEl: any;
37
25
  };
38
26
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
39
- declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
40
- select: (key: string | number) => any;
41
- selectAll: (keys: (string | number)[]) => any;
42
- scrollToBottom: () => any;
43
- selectChange: (keys: (string | number)[]) => any;
44
- selectCancel: (key: string | number) => any;
45
- clearAll: () => any;
46
- }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
47
- onSelect?: ((key: string | number) => any) | undefined;
48
- onSelectAll?: ((keys: (string | number)[]) => any) | undefined;
49
- onScrollToBottom?: (() => any) | undefined;
50
- onSelectChange?: ((keys: (string | number)[]) => any) | undefined;
51
- onSelectCancel?: ((key: string | number) => any) | undefined;
52
- onClearAll?: (() => any) | undefined;
27
+ declare const __VLS_component: import('vue').DefineComponent<TableProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
28
+ select: (keys: string[]) => any;
29
+ "row-click": (row: TableRow) => any;
30
+ }, string, import('vue').PublicProps, Readonly<TableProps> & Readonly<{
31
+ onSelect?: ((keys: string[]) => any) | undefined;
32
+ "onRow-click"?: ((row: TableRow) => any) | undefined;
53
33
  }>, {
54
- height: number | string;
55
- columns: Column[];
56
- rowHeight: number;
34
+ columns: TableColumn[];
35
+ size: "small" | "middle" | "large";
36
+ multiple: boolean;
37
+ loading: boolean;
57
38
  stripe: boolean;
58
39
  selectable: boolean;
59
- dataSource: Row[];
60
- selectedRowKeys: (string | number)[];
61
- visibleRowCount: number;
62
- isLoading: boolean;
63
- getRowKey: (row: Row) => string | number;
64
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
65
- wrapperRef: HTMLDivElement;
66
- }, any>;
40
+ selectedKeys: string[];
41
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
67
42
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
68
43
  export default _default;
69
44
  type __VLS_WithTemplateSlots<T, S> = T & {
@@ -0,0 +1 @@
1
+ export { default as GctTree } from './src/tree.vue';
@@ -0,0 +1,14 @@
1
+ import { ITreeNode } from './tree.type';
2
+ type __VLS_Props = {
3
+ node: ITreeNode;
4
+ expandedKeys: (string | number)[];
5
+ selectedKeys: (string | number)[];
6
+ };
7
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
8
+ select: (key: string | number, node: ITreeNode) => any;
9
+ toggle: (key: string | number) => any;
10
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
11
+ onSelect?: ((key: string | number, node: ITreeNode) => any) | undefined;
12
+ onToggle?: ((key: string | number) => any) | undefined;
13
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLLIElement>;
14
+ export default _default;
@@ -0,0 +1,6 @@
1
+ export interface ITreeNode {
2
+ key: string | number;
3
+ title: string;
4
+ children?: ITreeNode[];
5
+ disabled?: boolean;
6
+ }
@@ -0,0 +1,18 @@
1
+ import { ITreeNode } from './tree.type';
2
+ type __VLS_Props = {
3
+ data: ITreeNode[];
4
+ expandedKeys?: (string | number)[];
5
+ selectedKeys?: (string | number)[];
6
+ defaultExpandedKeys?: (string | number)[];
7
+ defaultSelectedKeys?: (string | number)[];
8
+ };
9
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
10
+ select: (keys: (string | number)[], node: ITreeNode) => any;
11
+ "update:expandedKeys": (keys: (string | number)[]) => any;
12
+ "update:selectedKeys": (keys: (string | number)[]) => any;
13
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
14
+ onSelect?: ((keys: (string | number)[], node: ITreeNode) => any) | undefined;
15
+ "onUpdate:expandedKeys"?: ((keys: (string | number)[]) => any) | undefined;
16
+ "onUpdate:selectedKeys"?: ((keys: (string | number)[]) => any) | undefined;
17
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLUListElement>;
18
+ export default _default;
@@ -0,0 +1 @@
1
+ export { default as GctTreeSelect } from './src/tree-select.vue';
@@ -0,0 +1,45 @@
1
+ import { DropdownOption } from '../..';
2
+ type __VLS_Props = {
3
+ /** 选项列表 */
4
+ data: DropdownOption[];
5
+ /** 选中值(支持多选) */
6
+ modelValue?: string | number | Array<string | number>;
7
+ /** 是否多选 */
8
+ multiple?: boolean;
9
+ /** 自定义主键字段(默认 'value') */
10
+ valueKey?: string;
11
+ /** 自定义 label 字段(默认 'label') */
12
+ labelKey?: string;
13
+ placeholder?: string;
14
+ /** 下拉框宽度 */
15
+ popperWidth?: number;
16
+ dropdownExtraProps?: Record<string, any>;
17
+ /** 选择项额外的 class */
18
+ class?: string;
19
+ /** 是否只读 */
20
+ readonly?: boolean;
21
+ };
22
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {
23
+ getRef: import('vue').Ref<any, any>;
24
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
25
+ edit: (option: DropdownOption) => any;
26
+ change: (val: string | number | (string | number)[], item?: DropdownOption | undefined) => any;
27
+ "update:modelValue": (val: string | number | (string | number)[]) => any;
28
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
29
+ onEdit?: ((option: DropdownOption) => any) | undefined;
30
+ onChange?: ((val: string | number | (string | number)[], item?: DropdownOption | undefined) => any) | undefined;
31
+ "onUpdate:modelValue"?: ((val: string | number | (string | number)[]) => any) | undefined;
32
+ }>, {
33
+ placeholder: string;
34
+ popperWidth: number;
35
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
36
+ dropdownRef: import('vue').CreateComponentPublicInstanceWithMixins<Record<string, any> & {}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {}, false, {}, {}, {}, {}, string, {}, any, import('vue').ComponentProvideOptions, {
37
+ P: {};
38
+ B: {};
39
+ D: {};
40
+ C: {};
41
+ M: {};
42
+ Defaults: {};
43
+ }, Record<string, any> & {}, {}, {}, {}, {}, {}> | null;
44
+ }, HTMLDivElement>;
45
+ export default _default;
@@ -2,7 +2,10 @@ export interface PanelSchema {
2
2
  /** schema 唯一 key */
3
3
  key: PanelSchemaKey;
4
4
  /** 面板标题 */
5
- title: string | string[];
5
+ title: string | Array<{
6
+ key: string;
7
+ value: string;
8
+ }>;
6
9
  /** 实际渲染组件 */
7
10
  render: any;
8
11
  }
@@ -8,9 +8,15 @@ type SubscriptionCallback = (newValue: any, oldValue: any) => void;
8
8
  * 所有数据读写都基于 jsonpath 查询进行
9
9
  */
10
10
  export declare class DataManager {
11
- private doc;
11
+ private doc?;
12
12
  private subscriptions;
13
+ private depGraph;
14
+ private depQueue;
15
+ private depScheduled;
16
+ private computing;
13
17
  private layoutScheduled;
18
+ private emitScheduled;
19
+ private emitQueue;
14
20
  private rawData;
15
21
  /**
16
22
  * 默认值 Map
@@ -18,15 +24,15 @@ export declare class DataManager {
18
24
  * value: 默认值
19
25
  */
20
26
  private defaults;
21
- constructor(_doc: Doc, data?: Data);
22
- /**
23
- * 从 JSON 数据创建 DataManager
24
- */
25
- static create(doc: Doc, data?: Data): DataManager;
27
+ constructor(options?: {
28
+ doc?: Doc;
29
+ data?: Data;
30
+ });
26
31
  /**
27
32
  * 调度 layout,自动合并同一微任务队列中的多个操作
28
33
  */
29
34
  private scheduleLayout;
35
+ getLabelPath(path: JsonPath): JsonPath;
30
36
  /**
31
37
  * 根据 jsonpath 获取原始数据(仅返回 rawData 中的值)
32
38
  * @param path jsonpath 路径 (例如: "document.body.children[0].text" 或 "user.name")
@@ -40,27 +46,19 @@ export declare class DataManager {
40
46
  * @returns 指定路径的标签值或原值,不存在返回 undefined
41
47
  */
42
48
  getLabel<T = any>(path: JsonPath): T | undefined;
43
- resolve<T = any>(path: JsonPath): T | undefined;
44
- resolveLabel<T = any>(path: JsonPath): T | undefined;
45
49
  /**
46
50
  * 根据 jsonpath 设置数据
47
51
  * @param path jsonpath 路径
48
52
  * @param value 要设置的值
49
53
  * @returns 是否设置成功
50
54
  */
51
- set(path: JsonPath, value: any): boolean;
55
+ set(path: JsonPath, value: any, source?: 'user' | 'dependency'): boolean;
52
56
  /**
53
57
  * 根据 jsonpath 删除数据
54
58
  * @param path jsonpath 路径
55
59
  * @returns 是否删除成功
56
60
  */
57
61
  delete(path: JsonPath): boolean;
58
- /**
59
- * 检查指定路径是否存在(检查原始值)
60
- * @param path jsonpath 路径
61
- * @returns 是否存在
62
- */
63
- has(path: JsonPath): boolean;
64
62
  /**
65
63
  * 根据 jsonpath 更新数据(使用回调函数)
66
64
  * @param path jsonpath 路径
@@ -73,7 +71,7 @@ export declare class DataManager {
73
71
  * @param updates 路径与值的映射对象
74
72
  * @returns 是否全部设置成功
75
73
  */
76
- setMultiple(updates: Record<JsonPath, any>): boolean;
74
+ setMultiple(updates: Record<JsonPath, any>, source?: 'user' | 'dependency'): boolean;
77
75
  /**
78
76
  * 在数组末尾添加一个或多个元素
79
77
  * @param path 数组的 jsonpath 路径
@@ -111,7 +109,7 @@ export declare class DataManager {
111
109
  * 设置整个原始数据
112
110
  * @param data 新的 JSON 数据
113
111
  */
114
- setRawData(data: Data): void;
112
+ setRawData(data: Data, defaultsMap?: Record<string, any>): void;
115
113
  /**
116
114
  * 内部方法:根据路径获取值
117
115
  */
@@ -133,14 +131,6 @@ export declare class DataManager {
133
131
  * 深拷贝对象
134
132
  */
135
133
  private deepClone;
136
- /**
137
- * 序列化为 JSON 字符串
138
- */
139
- toJSON(): string;
140
- /**
141
- * 从 JSON 字符串加载
142
- */
143
- static fromJSONString(doc: Doc, jsonString: JsonPath): DataManager;
144
134
  /**
145
135
  * 订阅指定路径的数据变化
146
136
  * @param path jsonpath 路径
@@ -154,13 +144,13 @@ export declare class DataManager {
154
144
  */
155
145
  unsubscribe(path?: JsonPath): void;
156
146
  /**
157
- * 清空所有数据
147
+ * 调度 emit 事件,自动合并相同 path 的事件
158
148
  */
159
- clear(): void;
149
+ private emit;
160
150
  /**
161
- * 发送数据变化事件
151
+ * 实际执行 emit 逻辑
162
152
  */
163
- private emit;
153
+ private doEmit;
164
154
  /**
165
155
  * 获取父路径
166
156
  */
@@ -192,14 +182,26 @@ export declare class DataManager {
192
182
  */
193
183
  private convertPathToWildcard;
194
184
  private formatRuntimeValue;
185
+ /** 组件依赖路径映射 */
186
+ private resolveDepPaths;
187
+ /**
188
+ * 注册依赖
189
+ * @param targetPath 依赖值计算后需写入的字段路径
190
+ * @param expr 计算公式字符串
191
+ * @param callback 回调函数
192
+ */
193
+ registerFieldDependency(targetPath: string, expr: string, callback?: (res: any) => any): void;
194
+ /** 收集依赖 */
195
+ private collectDependencies;
196
+ /** 统一执行组件依赖 */
197
+ private flushDependencies;
198
+ /** 执行依赖 */
199
+ private runDepsByPath;
200
+ /** 运行公式 */
201
+ private runDependency;
195
202
  /**
196
- * 获取所有默认值
197
- * @returns 默认值 Map 的副本
198
- */
199
- getDefaults(): Map<JsonPath, any>;
200
- /**
201
- * 清空所有默认值
203
+ * 清空所有数据
202
204
  */
203
- clearDefaults(): void;
205
+ clear(): void;
204
206
  }
205
207
  export {};
@@ -2,6 +2,8 @@ export { createDoc, createDocInfo } from './sdk/createDoc';
2
2
  export { useDocPubApiContext } from './sdk/DocPubApiContext';
3
3
  export { usePagesToPdf } from './sdk/usePagesToPdf';
4
4
  export { useInteraction } from './interaction/useInteraction';
5
+ export { formulaUtils } from './utils/calculate-formula';
6
+ export { resolveWidgetState } from './widget/widget-state';
5
7
  export { CommandType } from './command/types';
6
8
  export { ModelConverter } from './model';
7
9
  export { DocumentEventBridge } from './event/DocumentEventBridge';
@@ -24,3 +26,4 @@ export type { Table } from './view/Table';
24
26
  export type { SubRenderer } from './view/TableCell';
25
27
  export type { Wtbl } from './model/document';
26
28
  export type { BoundedRegion } from './model/logic';
29
+ export type { WidgetStateContext } from './widget/widget-state';
@@ -1,26 +1,5 @@
1
1
  import { WrText } from '../../model/document';
2
2
  import { LayoutContext } from '../LayoutContext';
3
- type ValueType = string | number | undefined | null;
4
- type WidgetOption = {
5
- value: any;
6
- label: string;
7
- };
8
3
  export declare class FieldHandler {
9
- static getValue(context: LayoutContext, wr: WrText): ValueType;
10
- static hasValue(value: ValueType): boolean;
11
4
  static layout(context: LayoutContext, wr: WrText): void;
12
- static getId(context: LayoutContext, wr: WrText): string;
13
- static layoutRun(context: LayoutContext, wr: WrText): void;
14
- private static addOptionSpacing;
15
- private static addOptionLabel;
16
- private static addOptionIcon;
17
- static layoutWidgetOption(context: LayoutContext, wr: WrText, option: WidgetOption, optionIndex: number): void;
18
- static isVerticalLayout(wr: WrText): boolean;
19
- static layoutWidgetOptions(context: LayoutContext, wr: WrText): void;
20
- static layoutWidgetLabel(context: LayoutContext, wr: WrText): void;
21
- static getNoValueLabel(wr: WrText): string;
22
- static layoutWidgetInput(context: LayoutContext, wr: WrText): void;
23
- static layoutWidgetImage(context: LayoutContext, wr: WrText): void;
24
- static layoutWidgetSignature(context: LayoutContext, wr: WrText): void;
25
5
  }
26
- export {};
@@ -0,0 +1,14 @@
1
+ import { BaseHandler, HandlerContext } from './BaseHandler';
2
+ import { TextRun } from '../../../view/runs/TextRun';
3
+ export declare class AttachmentHandler extends BaseHandler {
4
+ static layout(ctx: HandlerContext): void;
5
+ static layoutField(ctx: HandlerContext): void;
6
+ static layoutFileItem(payload: {
7
+ ctx: HandlerContext;
8
+ item: string;
9
+ itemIndex: number;
10
+ layoutStyle: ReturnType<typeof TextRun.textStyle2LayoutStyle>;
11
+ itemIsFirst: boolean;
12
+ itemIsLast: boolean;
13
+ }): void;
14
+ }
@@ -0,0 +1,67 @@
1
+ import { WrText } from '../../../model/document';
2
+ import { LayoutContext } from '../../LayoutContext';
3
+ import { TextWidget } from '../../../view/runs/TextWidget';
4
+ type ValueType = string | number | undefined | null;
5
+ export type HandlerContext = {
6
+ context: LayoutContext;
7
+ wr: WrText;
8
+ };
9
+ export declare class BaseHandler {
10
+ static hasValue(value: ValueType): boolean;
11
+ static getId(context: LayoutContext, wr: WrText): string;
12
+ static getValue(ctx: HandlerContext, valuePath: string): any;
13
+ static getLabel(ctx: HandlerContext, valuePath: string): any;
14
+ static getNoValueLabel(ctx: HandlerContext): {
15
+ label: string;
16
+ type: 'placeholder' | 'fieldName' | 'noneLabel' | 'default';
17
+ };
18
+ /**
19
+ * 渲染组件值 label -> value
20
+ * @param ctx
21
+ */
22
+ static layoutValue(ctx: HandlerContext): void;
23
+ /**
24
+ * 填报时候的空值渲染
25
+ * @param ctx
26
+ */
27
+ static layoutNoValueLabel(ctx: HandlerContext): void;
28
+ /**
29
+ * 渲染时增加间距
30
+ * @param payload
31
+ */
32
+ static addSpace(payload: {
33
+ ctx: HandlerContext;
34
+ textMetrics: {
35
+ width: number;
36
+ height: number;
37
+ ascent: number;
38
+ descent: number;
39
+ };
40
+ extra?: Partial<TextWidget>;
41
+ }): void;
42
+ /**
43
+ * 渲染时增加文本
44
+ * @param payload
45
+ */
46
+ static addLabel(payload: {
47
+ ctx: HandlerContext;
48
+ fontSize: number;
49
+ label: string;
50
+ extra?: Partial<TextWidget>;
51
+ }): void;
52
+ /**
53
+ * 渲染时增加图标
54
+ * @param payload
55
+ */
56
+ static addIcon(payload: {
57
+ ctx: HandlerContext;
58
+ textMetrics: {
59
+ width: number;
60
+ height: number;
61
+ ascent: number;
62
+ descent: number;
63
+ };
64
+ extra?: Partial<TextWidget>;
65
+ }): void;
66
+ }
67
+ export {};
@@ -0,0 +1,5 @@
1
+ import { BaseHandler, HandlerContext } from './BaseHandler';
2
+ export declare class ImgHandler extends BaseHandler {
3
+ static layout(ctx: HandlerContext): void;
4
+ static layoutField(ctx: HandlerContext): void;
5
+ }
@@ -0,0 +1,5 @@
1
+ import { BaseHandler, HandlerContext } from './BaseHandler';
2
+ export declare class InputHandler extends BaseHandler {
3
+ static layout(ctx: HandlerContext): void;
4
+ static layoutField(ctx: HandlerContext): void;
5
+ }
@@ -0,0 +1,15 @@
1
+ import { BaseHandler, HandlerContext } from './BaseHandler';
2
+ import { WrText } from '../../../model/document';
3
+ import { LayoutContext } from '../../LayoutContext';
4
+ import { TextRun } from '../../../view/runs/TextRun';
5
+ type WidgetOption = {
6
+ value: any;
7
+ label: string;
8
+ };
9
+ export declare class OptionHandler extends BaseHandler {
10
+ static layout(ctx: HandlerContext): void;
11
+ static isVerticalLayout(wr: WrText): boolean;
12
+ static layoutField(ctx: HandlerContext): void;
13
+ static layoutOptionItem(context: LayoutContext, wr: WrText, option: WidgetOption, optionIndex: number, layoutStyle: ReturnType<typeof TextRun.textStyle2LayoutStyle>): void;
14
+ }
15
+ export {};
@@ -0,0 +1,24 @@
1
+ import { BaseHandler, HandlerContext } from './BaseHandler';
2
+ import { ImageWidgetOptions } from '../../../view/runs/ImageWidget';
3
+ export declare class SignatureHandler extends BaseHandler {
4
+ static layout(ctx: HandlerContext): void;
5
+ /**
6
+ * 获取签名装饰信息
7
+ * @param ctx
8
+ * @param width
9
+ * @param height
10
+ * @param time
11
+ * @returns
12
+ */
13
+ static getDecorationsInfo(ctx: HandlerContext, width: number, height: number, time: number): {
14
+ render: boolean;
15
+ rectWidth: number;
16
+ rectHeight: number;
17
+ decorations?: ImageWidgetOptions['decorations'];
18
+ };
19
+ /**
20
+ * 签名字段处理
21
+ * @param ctx
22
+ */
23
+ static layoutField(ctx: HandlerContext): void;
24
+ }
@@ -0,0 +1,6 @@
1
+ export { BaseHandler, type HandlerContext } from './BaseHandler';
2
+ export { OptionHandler } from './OptionHandler';
3
+ export { ImgHandler } from './ImgHandler';
4
+ export { SignatureHandler } from './SignatureHandler';
5
+ export { InputHandler } from './InputHandler';
6
+ export { AttachmentHandler } from './AttachmentHandler';