@gct-paas/word 0.1.47-beta.2 → 0.1.47-beta.4

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 (44) hide show
  1. package/dist/base/input/src/input.vue.d.ts +5 -5
  2. package/dist/base/input/src/text-area.vue.d.ts +4 -4
  3. package/dist/capabilities/panel/schema/types.d.ts +14 -4
  4. package/dist/core/cursor/render/cursor-renderer.vue.d.ts +2 -2
  5. package/dist/core/interaction/types.d.ts +3 -0
  6. package/dist/core/interaction/useInteraction.d.ts +16 -0
  7. package/dist/core/layout/LayoutMapper.d.ts +4 -0
  8. package/dist/core/layout/attach-field/AttachFieldContext.d.ts +59 -0
  9. package/dist/core/layout/attach-field/index.d.ts +2 -0
  10. package/dist/core/layout/attach-field/types.d.ts +20 -0
  11. package/dist/core/layout/handlers/fields/AttachFieldHandler.d.ts +10 -0
  12. package/dist/core/layout/handlers/fields/OptionHandler.d.ts +2 -0
  13. package/dist/core/layout/handlers/fields/index.d.ts +1 -0
  14. package/dist/domain/active/active-types.d.ts +5 -1
  15. package/dist/domain/field/attach-field.d.ts +15 -0
  16. package/dist/index.es.js +5760 -4820
  17. package/dist/runtime/_register_/composables/panel/useActivePanel.d.ts +2 -0
  18. package/dist/runtime/canvas/table/utils/useTableSelection.d.ts +16 -0
  19. package/dist/runtime/factories/useFormValidator.d.ts +13 -4
  20. package/dist/runtime/factories/validation-refresh-scheduler.d.ts +7 -0
  21. package/dist/runtime/renderer/dialogs/device-scan/device-scan-dialog.vue.d.ts +12 -12
  22. package/dist/runtime/renderer/dropdowns/components/tables/composables/useTableDropdown.d.ts +1 -0
  23. package/dist/runtime/renderer/dropdowns/components/tables/rdo-table-dropdown.vue.d.ts +12 -12
  24. package/dist/runtime/renderer/dropdowns/components/tables/strategy/selectStrategy.d.ts +2 -0
  25. package/dist/runtime/renderer/dropdowns/components/tables/table-dropdown.vue.d.ts +12 -12
  26. package/dist/runtime/renderer/dropdowns/components/tree/tree-node.vue.d.ts +2 -0
  27. package/dist/runtime/renderer/validation/validation-comment-item.vue.d.ts +2 -0
  28. package/dist/sdk/doc-runtime/composables/useValidationFullSync.d.ts +9 -0
  29. package/dist/sdk/doc-runtime/factories/document-initializer.d.ts +21 -0
  30. package/dist/sdk/plugins/index.d.ts +1 -1
  31. package/dist/sdk/plugins/register-panel-schemas.d.ts +1 -1
  32. package/dist/suites/edhr/panel-schema/field/field.basic.d.ts +5 -0
  33. package/dist/suites/edhr/panel-schema/index.d.ts +4 -0
  34. package/dist/suites/shared/hooks/panel-props-source.d.ts +33 -0
  35. package/dist/suites/shared/hooks/useAttachedFieldActivate.d.ts +6 -0
  36. package/dist/suites/shared/hooks/useFieldPanel.d.ts +7 -0
  37. package/dist/suites/shared/hooks/useFieldPanelMeta.d.ts +11 -0
  38. package/dist/suites/shared/hooks/usePanelProps.d.ts +4 -0
  39. package/dist/suites/shared/panel/config/editor/attach-fields-editor/resolve-attach-field.d.ts +5 -0
  40. package/dist/suites/shared/panel/config/editor/attach-fields-editor/types.d.ts +4 -0
  41. package/dist/suites/shared/panel/config/editor/enum-opt-editor/types.d.ts +3 -0
  42. package/dist/utils/func/form.d.ts +26 -0
  43. package/dist/word.css +254 -227
  44. package/package.json +1 -1
@@ -15,7 +15,7 @@ declare const __VLS_component: import('vue').DefineComponent<GctInputProps, {
15
15
  focus: () => void;
16
16
  blur: () => void;
17
17
  select: () => void;
18
- inputRef: import('vue').Ref<HTMLInputElement | HTMLTextAreaElement | null, HTMLInputElement | HTMLTextAreaElement | null>;
18
+ inputRef: import('vue').Ref<HTMLTextAreaElement | HTMLInputElement | null, HTMLTextAreaElement | HTMLInputElement | null>;
19
19
  }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
20
20
  input: (value: string | number, event: Event) => any;
21
21
  search: (value: string | number) => any;
@@ -25,8 +25,8 @@ declare const __VLS_component: import('vue').DefineComponent<GctInputProps, {
25
25
  keydown: (event: KeyboardEvent) => any;
26
26
  keypress: (event: KeyboardEvent) => any;
27
27
  keyup: (event: KeyboardEvent) => any;
28
- "update:modelValue": (value: string | number) => any;
29
28
  clear: () => any;
29
+ "update:modelValue": (value: string | number) => any;
30
30
  pressEnter: (event: KeyboardEvent) => any;
31
31
  }, string, import('vue').PublicProps, Readonly<GctInputProps> & Readonly<{
32
32
  onInput?: ((value: string | number, event: Event) => any) | undefined;
@@ -37,8 +37,8 @@ declare const __VLS_component: import('vue').DefineComponent<GctInputProps, {
37
37
  onKeydown?: ((event: KeyboardEvent) => any) | undefined;
38
38
  onKeypress?: ((event: KeyboardEvent) => any) | undefined;
39
39
  onKeyup?: ((event: KeyboardEvent) => any) | undefined;
40
- "onUpdate:modelValue"?: ((value: string | number) => any) | undefined;
41
40
  onClear?: (() => any) | undefined;
41
+ "onUpdate:modelValue"?: ((value: string | number) => any) | undefined;
42
42
  onPressEnter?: ((event: KeyboardEvent) => any) | undefined;
43
43
  }>, {
44
44
  name: string;
@@ -47,6 +47,8 @@ declare const __VLS_component: import('vue').DefineComponent<GctInputProps, {
47
47
  readonly: boolean;
48
48
  disabled: boolean;
49
49
  size: import('./types').InputSize;
50
+ autocomplete: string;
51
+ spellcheck: boolean;
50
52
  placeholder: string;
51
53
  modelValue: string | number;
52
54
  prefix: string;
@@ -58,11 +60,9 @@ declare const __VLS_component: import('vue').DefineComponent<GctInputProps, {
58
60
  showPasswordToggle: boolean;
59
61
  maxLength: number;
60
62
  autofocus: boolean;
61
- autocomplete: string;
62
63
  rows: number;
63
64
  bordered: boolean;
64
65
  showSearchButton: boolean;
65
- spellcheck: boolean;
66
66
  customStyle: Record<string, string | number>;
67
67
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
68
68
  inputRef: HTMLInputElement;
@@ -23,8 +23,8 @@ declare const __VLS_component: import('vue').DefineComponent<GctInputProps, {
23
23
  keydown: (event: KeyboardEvent) => any;
24
24
  keypress: (event: KeyboardEvent) => any;
25
25
  keyup: (event: KeyboardEvent) => any;
26
- "update:modelValue": (value: string | number) => any;
27
26
  clear: () => any;
27
+ "update:modelValue": (value: string | number) => any;
28
28
  pressEnter: (event: KeyboardEvent) => any;
29
29
  }, string, import('vue').PublicProps, Readonly<GctInputProps> & Readonly<{
30
30
  onInput?: ((value: string | number, event: Event) => any) | undefined;
@@ -35,23 +35,23 @@ declare const __VLS_component: import('vue').DefineComponent<GctInputProps, {
35
35
  onKeydown?: ((event: KeyboardEvent) => any) | undefined;
36
36
  onKeypress?: ((event: KeyboardEvent) => any) | undefined;
37
37
  onKeyup?: ((event: KeyboardEvent) => any) | undefined;
38
- "onUpdate:modelValue"?: ((value: string | number) => any) | undefined;
39
38
  onClear?: (() => any) | undefined;
39
+ "onUpdate:modelValue"?: ((value: string | number) => any) | undefined;
40
40
  onPressEnter?: ((event: KeyboardEvent) => any) | undefined;
41
41
  }>, {
42
42
  name: string;
43
43
  readonly: boolean;
44
44
  disabled: boolean;
45
+ autocomplete: string;
46
+ spellcheck: boolean;
45
47
  placeholder: string;
46
48
  modelValue: string | number;
47
49
  allowClear: boolean;
48
50
  showCount: boolean;
49
51
  maxLength: number;
50
52
  autofocus: boolean;
51
- autocomplete: string;
52
53
  rows: number;
53
54
  bordered: boolean;
54
- spellcheck: boolean;
55
55
  customStyle: Record<string, string | number>;
56
56
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
57
57
  textareaRef: HTMLTextAreaElement;
@@ -1,11 +1,21 @@
1
+ import { ActivePanelData } from '../../../domain/active/active-types';
2
+ import { AttachFieldTarget } from '../../../domain/field/attach-field';
3
+ export type PanelBreadcrumbItem = {
4
+ key: string;
5
+ value: string;
6
+ };
7
+ export type PanelTitle = string | PanelBreadcrumbItem[];
8
+ export type PanelTitleContext = {
9
+ active: ActivePanelData | null;
10
+ attachFieldTarget: AttachFieldTarget | null;
11
+ };
1
12
  export interface PanelSchema {
2
13
  /** schema 唯一 key */
3
14
  key: PanelSchemaKey;
4
15
  /** 面板标题 */
5
- title: string | Array<{
6
- key: string;
7
- value: string;
8
- }>;
16
+ title: PanelTitle;
17
+ /** 按当前上下文解析标题(如引用字段面包屑) */
18
+ resolveTitle?: (ctx: PanelTitleContext) => PanelTitle;
9
19
  /** 实际渲染组件 */
10
20
  render: any;
11
21
  }
@@ -9,10 +9,10 @@ type __VLS_Props = {
9
9
  visible?: boolean;
10
10
  };
11
11
  declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
12
- visible: boolean;
13
- caretColor: string;
14
12
  caretWidth: number;
13
+ caretColor: string;
15
14
  blinkInterval: number;
16
15
  alwaysVisibleAfterEventMs: number;
16
+ visible: boolean;
17
17
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
18
18
  export default _default;
@@ -1,4 +1,5 @@
1
1
  import { ActivePanelData } from '../../domain/active/active-types';
2
+ import { AttachFieldTarget } from '../../domain/field/attach-field';
2
3
  export type ITableSelection = {
3
4
  tableId: string;
4
5
  axis: 'row' | 'col' | 'all';
@@ -20,6 +21,8 @@ export type InteractionState = {
20
21
  focusTick: number | undefined;
21
22
  /** 当前点击的组件 右侧面板 */
22
23
  panelData: ActivePanelData | null;
24
+ /** 引用字段配置定位(与 panel:attach-field 配合) */
25
+ attachFieldTarget: AttachFieldTarget | null;
23
26
  /** 字段校验批注信息集合 */
24
27
  validationCommentMap: Record<string, Array<{
25
28
  field: string;
@@ -18,11 +18,27 @@ export declare function useInteraction(docRef: Ref<Doc | null>): {
18
18
  readonly context: {
19
19
  readonly mainModelKey?: string | undefined;
20
20
  readonly subFieldKey?: string | undefined;
21
+ readonly parentModelId?: string | undefined;
21
22
  readonly isDataGroup2DClicked?: boolean | undefined;
22
23
  readonly regionId?: string | undefined;
23
24
  readonly secRefId?: string | undefined;
24
25
  };
25
26
  } | null | undefined;
27
+ readonly attachFieldTarget?: {
28
+ readonly kind: "boolean";
29
+ readonly itemsKey: "trueAttachFields" | "falseAttachFields";
30
+ readonly parentModelId: string;
31
+ readonly itemId: string;
32
+ readonly attachFieldLabel: string;
33
+ readonly subFieldKey?: string | undefined;
34
+ } | {
35
+ readonly kind: "enum-option";
36
+ readonly optionId: string;
37
+ readonly parentModelId: string;
38
+ readonly itemId: string;
39
+ readonly attachFieldLabel: string;
40
+ readonly subFieldKey?: string | undefined;
41
+ } | null | undefined;
26
42
  readonly validationCommentMap?: {
27
43
  readonly [x: string]: readonly {
28
44
  readonly field: string;
@@ -16,10 +16,14 @@ export declare class LayoutMapper {
16
16
  /** 组件信息中心 */
17
17
  widgetMetaMap: Map<string, any>;
18
18
  modelMap: Map<string, ModelMode>;
19
+ /** 布局期生成的 model 节点(如布尔/枚举引用字段),不在 doc.model 树中 */
20
+ runtimeModelMap: Map<string, ModelMode>;
19
21
  modelSplitMap: Map<string, string[]>;
20
22
  /** 扁平处理 layout 数据 */
21
23
  buildLayoutIndex(): void;
22
24
  buildModelMap(): void;
25
+ /** 注册布局期生成的 model 节点,供 getModelNodeById 查找 */
26
+ registerRuntimeModelNode(node: ModelMode): void;
23
27
  getBaseMetaNodeById<T extends BaseMetaNode>(id?: string): T | undefined;
24
28
  getBaseMetaNodeByIds<T extends BaseMetaNode>(ids: string[]): T[] | undefined;
25
29
  getLayoutNodeById(id: string): Page | import('../view/base').BandContainer | import('..').Paragraph | import('..').Table | import('../view/TableCell').TableCell | import('../view/TableRow').TableRow | import('..').OverlayLayout | import('../view/base').OverlayContainer | import('..').TextRun | import('..').ImageRun | undefined;
@@ -0,0 +1,59 @@
1
+ import { Doc } from '../..';
2
+ import { BaseMetaNode } from '../types';
3
+ import { WidgetMeta } from '../../widget/widget-meta';
4
+ import { MultipleItem } from '../../../suites/shared/panel/config/editor/attach-fields-editor/types';
5
+ import { AttachFieldTarget } from '../../../domain/field/attach-field';
6
+ import { AttachFieldParentMeta, WidgetOptionLike } from './types';
7
+ export type AttachFieldCursorPin = {
8
+ nodeId: string;
9
+ side: 'before' | 'after';
10
+ };
11
+ /**
12
+ * 引用字段(attach field)运行时上下文。
13
+ */
14
+ export declare class AttachFieldContext {
15
+ /** `widgetMeta.extra.biz` 上标识「此为引用字段」的键 */
16
+ static readonly BIZ_FLAG: "isAttachField";
17
+ /**
18
+ * 为布局生成的 widgetMeta.extra 打上引用字段标记。
19
+ */
20
+ static markAttachFieldMeta(extra?: WidgetMeta['extra']): WidgetMeta['extra'];
21
+ /** 当前 widget 是否为引用字段(非画布拖入的独立字段组件) */
22
+ static isAttachFieldWidget(widgetMeta: WidgetMeta | undefined | null): boolean;
23
+ /** 读取布局阶段写入的「父选项」绑定信息,非引用字段返回 null */
24
+ static getParentMeta(widgetMeta: WidgetMeta | undefined | null): AttachFieldParentMeta | null;
25
+ /** 由父字段 props 与选项值解析列表定位,供面板与画布点击共用 */
26
+ private static resolveListContext;
27
+ /** 根据引用字段 widgetMeta.id 解析画布上的 modelRef.id */
28
+ static resolveAttachFieldModelId(doc: Doc, itemId: string): string | null;
29
+ /** 画布点击引用字段时,生成与 panel 列表点击一致的 `attachFieldTarget` */
30
+ static resolveAttachFieldTarget(doc: Doc, widgetMeta: WidgetMeta): AttachFieldTarget | null;
31
+ private static isFieldMarkerRun;
32
+ /** 引用字段 model 分组内的正文字符 run(排除 [ ] 与间距占位) */
33
+ private static getAttachFieldContentNodes;
34
+ /** 取节点内最后一个字符索引(单字节点为 0) */
35
+ private static getNodeLastCharOffset;
36
+ /**
37
+ * 点击引用字段【/】时,落到内侧首尾字符:
38
+ * 【 → 首字 before;】 → 末字 after
39
+ */
40
+ static resolveAttachFieldMarkerContentPin(doc: Doc, modelId: string, marker: 'left' | 'right'): (AttachFieldCursorPin & {
41
+ offset: number;
42
+ }) | null;
43
+ static getModelSplitNodes(doc: Doc, modelId: string): BaseMetaNode[];
44
+ /**
45
+ * 从父组件 props 解析某一选项下的引用字段列表。
46
+ * - 布尔:`trueAttachFields` / `falseAttachFields`
47
+ * - 枚举:选项对象上的 `attachFields`(通常来自 computedOptions)
48
+ */
49
+ static getOptionAttachFields(widgetProps: Record<string, any> | undefined, option: WidgetOptionLike): MultipleItem[];
50
+ /**
51
+ * 父字段当前值是否包含本引用字段绑定的选项值。
52
+ * 用于条件校验、overlay 禁用等:未选中对应选项时不应要求填写引用字段。
53
+ */
54
+ private static isParentOptionActive;
55
+ /** 引用字段当前是否处于可填报 / 可校验状态。无父绑定信息时视为普通字段,恒为 true。 */
56
+ static isActive(doc: Doc, widgetMeta: WidgetMeta | undefined | null): boolean;
57
+ /** 枚举 / 布尔选项值相等比较(布尔走 toBoolean,其余按字符串) */
58
+ private static isSameOptionValue;
59
+ }
@@ -0,0 +1,2 @@
1
+ export { AttachFieldContext } from './AttachFieldContext';
2
+ export type { AttachFieldParentMeta, WidgetOptionLike } from './types';
@@ -0,0 +1,20 @@
1
+ import { MultipleItem } from '../../../suites/shared/panel/config/editor/attach-fields-editor/types';
2
+ /** 布局时写入引用字段 widgetMeta 的父选项绑定(见 AttachFieldHandler) */
3
+ export type AttachFieldParentMeta = {
4
+ /** 父字段 layout modelRef.id,设计态 hover 委托用 */
5
+ parentModelRefId: string;
6
+ /** 父字段运行时 valuePath,用于读取当前选中值 */
7
+ parentRuntimeValuePath: string;
8
+ /** 本引用字段绑定的选项值(true/false 或枚举项 value) */
9
+ parentOptionValue: unknown;
10
+ /** 父字段是否为多选枚举(fw:enum-multiple) */
11
+ isMultiple: boolean;
12
+ /** 父字段子表 subFieldKey,设计态面板 extra 用 */
13
+ parentSubFieldKey?: string;
14
+ };
15
+ /** 布局解析 computedOptions 时的选项结构(含 attachFields) */
16
+ export type WidgetOptionLike = {
17
+ value: unknown;
18
+ label: string;
19
+ attachFields?: MultipleItem[];
20
+ };
@@ -0,0 +1,10 @@
1
+ import { FieldBaseHandler } from './FieldBaseHandler';
2
+ import { TextRun } from '../../../view/runs/TextRun';
3
+ import { HandlerContext } from '../../types';
4
+ import { WidgetOptionLike } from '../../attach-field/types';
5
+ /** 布尔 / 枚举选项后的引用字段布局 */
6
+ export declare class AttachFieldHandler extends FieldBaseHandler {
7
+ static layoutOptionAttachFields(ctx: HandlerContext, option: WidgetOptionLike, layoutStyle: ReturnType<typeof TextRun.textStyle2LayoutStyle>): void;
8
+ private static buildWidgetMeta;
9
+ private static layoutItem;
10
+ }
@@ -3,9 +3,11 @@ import { WrText } from '../../../model/document';
3
3
  import { LayoutContext } from '../../LayoutContext';
4
4
  import { TextRun } from '../../../view/runs/TextRun';
5
5
  import { HandlerContext } from '../../types';
6
+ import { MultipleItem } from '../../../../suites/shared/panel/config/editor/attach-fields-editor/types';
6
7
  type WidgetOption = {
7
8
  value: any;
8
9
  label: string;
10
+ attachFields?: MultipleItem[];
9
11
  };
10
12
  export declare class OptionHandler extends FieldBaseHandler {
11
13
  static layout(ctx: HandlerContext): void;
@@ -4,3 +4,4 @@ export { SignatureHandler } from './SignatureHandler';
4
4
  export { InputHandler } from './InputHandler';
5
5
  export { AttachmentHandler } from './AttachmentHandler';
6
6
  export { FieldBaseHandler } from './FieldBaseHandler';
7
+ export { AttachFieldHandler } from './AttachFieldHandler';
@@ -23,10 +23,14 @@ export type PanelType =
23
23
  /** 表头 */
24
24
  | 'panel:table-header'
25
25
  /** 组件 */
26
- | 'panel:widget';
26
+ | 'panel:widget'
27
+ /** 布尔/枚举等父字段下的引用字段 */
28
+ | 'panel:attach-field';
27
29
  type ActiveContext = {
28
30
  mainModelKey: string;
29
31
  subFieldKey: string | undefined;
32
+ /** 引用字段 panel 时父字段的 modelId */
33
+ parentModelId?: string;
30
34
  isDataGroup2DClicked?: boolean;
31
35
  regionId: string;
32
36
  /** 章节引用 id */
@@ -0,0 +1,15 @@
1
+ /** 引用字段列表在父字段 props 中的定位(布尔 / 枚举选项) */
2
+ export type AttachFieldListContext = {
3
+ kind: 'boolean';
4
+ itemsKey: 'trueAttachFields' | 'falseAttachFields';
5
+ } | {
6
+ kind: 'enum-option';
7
+ optionId: string;
8
+ };
9
+ /** 侧边栏 `panel:attach-field` 与 props 回写用的完整定位 */
10
+ export type AttachFieldTarget = AttachFieldListContext & {
11
+ parentModelId: string;
12
+ itemId: string;
13
+ attachFieldLabel: string;
14
+ subFieldKey?: string;
15
+ };