@gct-paas/word 0.1.11 → 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.
- package/dist/base/calendar/src/calendar.vue.d.ts +1 -0
- package/dist/base/calendar/src/time.vue.d.ts +1 -0
- package/dist/base/index.d.ts +2 -0
- package/dist/base/modal/src/ModalRoot.vue.d.ts +2 -0
- package/dist/base/modal/src/modal.type.d.ts +3 -0
- package/dist/base/select/src/basic-select.vue.d.ts +9 -1
- package/dist/base/table/src/table.type.d.ts +19 -0
- package/dist/base/table/src/table.vue.d.ts +31 -56
- package/dist/base/tree/index.d.ts +1 -0
- package/dist/base/tree/src/tree-node.vue.d.ts +14 -0
- package/dist/base/tree/src/tree.type.d.ts +6 -0
- package/dist/base/tree/src/tree.vue.d.ts +18 -0
- package/dist/base/tree-select/index.d.ts +1 -0
- package/dist/base/tree-select/src/tree-select.vue.d.ts +45 -0
- package/dist/base/utils/image-size-util.d.ts +2 -0
- package/dist/capabilities/panel/schema/types.d.ts +4 -1
- package/dist/core/constants/index.d.ts +1 -0
- package/dist/core/cursor/logic/getCursorTextRawList.d.ts +2 -0
- package/dist/core/cursor/logic/index.d.ts +1 -0
- package/dist/core/data/DataManager.d.ts +38 -36
- package/dist/core/event/types.d.ts +1 -1
- package/dist/core/index.d.ts +3 -0
- package/dist/core/interaction/useInteraction.d.ts +0 -1
- package/dist/core/layout/LayoutContext.d.ts +1 -0
- package/dist/core/layout/handlers/FieldHandler.d.ts +0 -18
- package/dist/core/layout/handlers/fields/AttachmentHandler.d.ts +14 -0
- package/dist/core/layout/handlers/fields/BaseHandler.d.ts +67 -0
- package/dist/core/layout/handlers/fields/ImgHandler.d.ts +5 -0
- package/dist/core/layout/handlers/fields/InputHandler.d.ts +5 -0
- package/dist/core/layout/handlers/fields/OptionHandler.d.ts +15 -0
- package/dist/core/layout/handlers/fields/SignatureHandler.d.ts +24 -0
- package/dist/core/layout/handlers/fields/index.d.ts +6 -0
- package/dist/core/model/document/WrField.d.ts +3 -126
- package/dist/core/model/document/WsecPr.d.ts +39 -0
- package/dist/core/sdk/types/public-types.d.ts +2 -0
- package/dist/core/utils/calculate-formula.d.ts +5 -0
- package/dist/core/view/Doc.d.ts +5 -0
- package/dist/core/view/Page.d.ts +0 -3
- package/dist/core/view/Section.d.ts +4 -18
- package/dist/core/view/runs/ImageRun.d.ts +12 -0
- package/dist/core/view/runs/ImageWidget.d.ts +3 -0
- package/dist/core/view/runs/TextRun.d.ts +1 -0
- package/dist/core/view/runs/TextWidget.d.ts +8 -8
- package/dist/core/widget/widget-state.d.ts +21 -0
- package/dist/domain/active/active-types.d.ts +0 -1
- package/dist/domain/widget/component-type.d.ts +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.es.js +6367 -4743
- package/dist/runtime/_register_/composables/panel/useActivePanel.d.ts +1 -2
- package/dist/runtime/canvas/__common__/widget-container/overlay-layer.vue.d.ts +2 -0
- package/dist/runtime/canvas/__common__/widget-container/overlay-render.vue.d.ts +1 -1
- package/dist/runtime/canvas/table/design/table-structure-overlay/dynamic-label.vue.d.ts +1 -0
- package/dist/runtime/canvas/table/utils/useTableSelection.d.ts +0 -1
- package/dist/runtime/designer/doc-design-layout.vue.d.ts +3 -1
- package/dist/runtime/designer/ribbon/common/button-icon.vue.d.ts +3 -2
- package/dist/runtime/designer/ribbon/constant/font.d.ts +1 -1
- package/dist/runtime/factories/createValidateFactory.d.ts +3 -1
- package/dist/runtime/factories/useDependency.d.ts +5 -0
- package/dist/runtime/factories/useDocumentFactory.d.ts +2 -0
- package/dist/runtime/factories/useFormValidator.d.ts +3 -0
- package/dist/runtime/factories/useRenderData.d.ts +2 -0
- package/dist/runtime/interface/computed.d.ts +18 -0
- package/dist/runtime/interface/data.d.ts +1 -4
- package/dist/runtime/interface/render.d.ts +11 -0
- package/dist/runtime/interface/utils.d.ts +10 -0
- package/dist/runtime/renderer/doc-render-layout.vue.d.ts +58 -2
- package/dist/runtime/renderer/main/preview-canvas.vue.d.ts +3 -1
- package/dist/setup.d.ts +11 -0
- package/dist/suites/edhr/field-manifest/_common_/basic.d.ts +2 -0
- package/dist/suites/edhr/panel-schema/data-group/data-group.basic.d.ts +4 -1
- package/dist/suites/edhr/panel-schema/data-init/common/add-builtin-field/add-builtin-field-modal.vue.d.ts +1 -1
- package/dist/suites/edhr/panel-schema/data-init/common/add-builtin-param/add-builtin-param-modal.vue.d.ts +5 -3
- package/dist/suites/edhr/panel-schema/data-init/common/add-field/add-field-modal.vue.d.ts +15 -6
- package/dist/suites/edhr/panel-schema/data-init/common/add-field/add-field-select.vue.d.ts +1 -5
- package/dist/suites/edhr/panel-schema/data-init/common/add-field/useField.d.ts +1 -4
- package/dist/suites/edhr/panel-schema/data-init/common/add-online-form-model/online-form-model-select.vue.d.ts +12 -0
- package/dist/suites/edhr/panel-schema/data-init/common/add-sql/add-sql-modal.vue.d.ts +3 -4
- package/dist/suites/edhr/panel-schema/data-init/common/data-source-model-link.vue.d.ts +2 -2
- package/dist/suites/edhr/panel-schema/data-init/utils/index.d.ts +9 -17
- package/dist/suites/edhr/panel-schema/dynamic-table/dynamic-table.basic.d.ts +4 -1
- package/dist/suites/edhr/panel-schema/fixed-table/fixed-table.basic.d.ts +4 -1
- package/dist/suites/edhr/panel-schema/index.d.ts +12 -3
- package/dist/utils/ServiceUtil.d.ts +31 -4
- package/dist/utils/TriggerUtil.d.ts +27 -0
- package/dist/utils/func/core.d.ts +6 -0
- package/dist/utils/func/file.d.ts +2 -0
- package/dist/word.css +1005 -998
- package/package.json +2 -2
- package/dist/runtime/designer/ribbon/components/bullet-point-select.vue.d.ts +0 -73
- package/dist/runtime/designer/ribbon/components/multistage-no-select.vue.d.ts +0 -73
- 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;
|
package/dist/base/index.d.ts
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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<
|
|
40
|
-
select: (
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
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
|
-
|
|
55
|
-
|
|
56
|
-
|
|
34
|
+
columns: TableColumn[];
|
|
35
|
+
size: "small" | "middle" | "large";
|
|
36
|
+
multiple: boolean;
|
|
37
|
+
loading: boolean;
|
|
57
38
|
stripe: boolean;
|
|
58
39
|
selectable: boolean;
|
|
59
|
-
|
|
60
|
-
|
|
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,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;
|
|
@@ -16,3 +16,5 @@ export interface ImageSizeOptions {
|
|
|
16
16
|
* 根据图片原始尺寸 + 配置,计算最终显示尺寸
|
|
17
17
|
*/
|
|
18
18
|
export declare function computeImageDisplaySize(natural: ImageSize, opts?: ImageSizeOptions): ImageSize;
|
|
19
|
+
/** 创建签名图片 */
|
|
20
|
+
export declare function createSignatureImage(name: string, width: number, height: number): Promise<unknown>;
|
|
@@ -53,5 +53,6 @@ export declare const DEFAULT_PAGE_SIZE: {
|
|
|
53
53
|
export declare const DEFAULT_PAGE_PADDING: [number, number, number, number];
|
|
54
54
|
export declare const DEFAULT_CELL_PADDING: [number, number, number, number];
|
|
55
55
|
export declare const DEFAULT_FONT_SIZE = 16;
|
|
56
|
+
export declare const DEFAULT_FONT_FAMILY = "Roboto,RobotoDraft,Helvetica,Arial,sans-serif";
|
|
56
57
|
export declare const DEFAULT_TEXT_COLOR = "black";
|
|
57
58
|
export declare const ZERO_WIDTH_SPACE = "\u200B";
|
|
@@ -2,6 +2,7 @@ import { Doc } from '../../view/Doc';
|
|
|
2
2
|
import { HitIntentResult, HitResult } from '../hit/types';
|
|
3
3
|
import { ICursorPosition } from '../types/cursor';
|
|
4
4
|
export { getCursorCoords } from './getCursorCoords';
|
|
5
|
+
export { getCursorTextRawList } from './getCursorTextRawList';
|
|
5
6
|
export { getSelectionRects } from './getSelectionRects';
|
|
6
7
|
export { getSelectLinesInfo } from './selectionAnalyzer';
|
|
7
8
|
export { getImmediateNeighborNode, findFirstAtomBeyond, isAtBoundaryOfNode, findTargetLineId, locateByX, } from './layoutNavigation';
|
|
@@ -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(
|
|
22
|
-
|
|
23
|
-
|
|
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
|
|
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
|
-
|
|
149
|
+
private emit;
|
|
160
150
|
/**
|
|
161
|
-
*
|
|
151
|
+
* 实际执行 emit 逻辑
|
|
162
152
|
*/
|
|
163
|
-
private
|
|
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
|
-
|
|
205
|
+
clear(): void;
|
|
204
206
|
}
|
|
205
207
|
export {};
|
|
@@ -65,4 +65,4 @@ export type MoveOpts = Pick<KeydownOpts, 'dir' | 'shift' | 'ctrl'>;
|
|
|
65
65
|
* 定义了系统中所有需要进行分发/调度的事件类型标识
|
|
66
66
|
*/
|
|
67
67
|
export type DispatchEventType = 'ime:compositionstart' | 'ime:compositionupdate' | 'ime:compositionend' | 'ime:input' | 'ime:paste' | 'ime:focus' | 'ime:blur' | 'ime:keydown' | 'caret:locate' | 'konva:click' | 'konva:dragstart' | 'konva:dragmove' | 'konva:dragend' | 'konva:contextmenu' | 'inter:str' | 'inter:stc' | 'inter:stall' | 'inter:active' | 'inter:chg-hmid';
|
|
68
|
-
export type EventBusType = 'autoScroll:start' | 'autoScroll:move' | 'autoScroll:stop' | 'caret:changed' | 'caret:requestScroll' | 'cursor:change' | 'tableSelection:change' | 'dragHoverId:change' | 'hoverModelId:change' | 'focusModelId:change' | 'panelData:change';
|
|
68
|
+
export type EventBusType = 'autoScroll:start' | 'autoScroll:move' | 'autoScroll:stop' | 'caret:changed' | 'caret:requestScroll' | 'cursor:change' | 'cursor:changed' | 'tableSelection:change' | 'dragHoverId:change' | 'hoverModelId:change' | 'focusModelId:change' | 'panelData:change';
|
package/dist/core/index.d.ts
CHANGED
|
@@ -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';
|
|
@@ -15,7 +15,6 @@ export declare function useInteraction(publicDocApi: Ref<EnginePublic | null>):
|
|
|
15
15
|
readonly widgetId?: string | undefined;
|
|
16
16
|
readonly modelId?: string | undefined;
|
|
17
17
|
readonly context: {
|
|
18
|
-
readonly pageName?: string | undefined;
|
|
19
18
|
readonly mainModelKey?: string | undefined;
|
|
20
19
|
readonly subFieldKey?: string | undefined;
|
|
21
20
|
readonly regionId?: string | undefined;
|
|
@@ -32,6 +32,7 @@ export declare class LayoutContext {
|
|
|
32
32
|
ensureCellParagraphSpace(itemWidth: number): void;
|
|
33
33
|
ensurePageParagraphSpace(itemWidth: number, itemHeight: number): void;
|
|
34
34
|
ensureParagraphSpace(itemWidth: number, itemHeight: number): void;
|
|
35
|
+
insertLineBreak(): void;
|
|
35
36
|
createNewPage(payload?: Partial<PageOptions>): Page;
|
|
36
37
|
createNewParagraph(y?: number): Paragraph;
|
|
37
38
|
resetModelRef(id: string): void;
|
|
@@ -1,23 +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 layoutWidgetOptions(context: LayoutContext, wr: WrText): void;
|
|
19
|
-
static layoutWidgetLabel(context: LayoutContext, wr: WrText): void;
|
|
20
|
-
static layoutWidgetInput(context: LayoutContext, wr: WrText): void;
|
|
21
|
-
static layoutWidgetImage(context: LayoutContext, wr: WrText): void;
|
|
22
5
|
}
|
|
23
|
-
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 {};
|