@gct-paas/word 0.1.18 → 0.1.19

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.
@@ -8,15 +8,17 @@ type __VLS_Props = {
8
8
  minDate?: string | number | Date;
9
9
  maxDate?: string | number | Date;
10
10
  timeFormat?: 'HH:mm:ss' | 'HH:mm' | 'HH';
11
+ showClearBtn?: boolean;
11
12
  };
12
13
  declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
13
- change: (value: Date) => any;
14
- "update:modelValue": (value: Date) => any;
14
+ change: (value: Date | null) => any;
15
+ "update:modelValue": (value: Date | null) => any;
15
16
  }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
16
- onChange?: ((value: Date) => any) | undefined;
17
- "onUpdate:modelValue"?: ((value: Date) => any) | undefined;
17
+ onChange?: ((value: Date | null) => any) | undefined;
18
+ "onUpdate:modelValue"?: ((value: Date | null) => any) | undefined;
18
19
  }>, {
19
20
  mode: "datetime" | "date";
21
+ showClearBtn: boolean;
20
22
  weekStart: number;
21
23
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
22
24
  export default _default;
@@ -2,6 +2,7 @@ type __VLS_Props = {
2
2
  modelValue: string | undefined;
3
3
  disabled?: boolean;
4
4
  format?: 'HH:mm:ss' | 'HH:mm' | 'HH';
5
+ showClearBtn?: boolean;
5
6
  disabledTime?: () => {
6
7
  disabledHours?: () => number[];
7
8
  disabledMinutes?: (hour: number) => number[];
@@ -30,6 +30,8 @@ export declare class Backspace extends CommandBase<'backspace'> {
30
30
  * 处理组件 run 的删除
31
31
  */
32
32
  private handleWidgetRun;
33
+ /** 处理悬浮 run 的删除 */
34
+ private handleOverlayPageWidgetRun;
33
35
  /**
34
36
  * 处理位置 >= 0 的删除情况
35
37
  */
@@ -1,12 +1,18 @@
1
1
  import { CommandBase } from '../base/CommandBase';
2
2
  import { Doc } from '../../view/Doc';
3
- import { WrText } from '../../model/document';
3
+ import { Wp, WrText } from '../../model/document';
4
4
  import { CommandPayloadMap } from '../types';
5
5
  export declare class MergeCells extends CommandBase<'mergeCells'> {
6
6
  constructor(doc: Doc, payload?: CommandPayloadMap['mergeCells']);
7
7
  protected execute(): Promise<{
8
+ wp: Wp;
9
+ pos: number;
10
+ side: string;
11
+ wr?: undefined;
12
+ } | {
8
13
  wr: WrText | undefined;
9
14
  pos: number;
10
15
  side: string;
16
+ wp?: undefined;
11
17
  } | null>;
12
18
  }
@@ -1,12 +1,18 @@
1
1
  import { CommandBase } from '../base/CommandBase';
2
2
  import { Doc } from '../../view/Doc';
3
- import { WrText } from '../../model/document';
3
+ import { Wp, WrText } from '../../model/document';
4
4
  import { CommandPayloadMap } from '../types';
5
5
  export declare class UnmergeCells extends CommandBase<'unmergeCells'> {
6
6
  constructor(doc: Doc, payload?: CommandPayloadMap['unmergeCells']);
7
7
  protected execute(): Promise<{
8
+ wp: Wp;
9
+ pos: number;
10
+ side: string;
11
+ wr?: undefined;
12
+ } | {
8
13
  wr: WrText | undefined;
9
14
  pos: number;
10
15
  side: string;
16
+ wp?: undefined;
11
17
  } | null | undefined>;
12
18
  }
@@ -7,6 +7,7 @@ export declare class InteractionController {
7
7
  onSelectTableRow(payload: {
8
8
  id: string;
9
9
  index: number;
10
+ realRowIndex: number;
10
11
  }): void;
11
12
  onSelectTableCol(payload: {
12
13
  id: string;
@@ -3,6 +3,7 @@ export type ITableSelection = {
3
3
  tableId: string;
4
4
  axis: 'row' | 'col' | 'all';
5
5
  index: number;
6
+ realRowIndex?: number;
6
7
  } | null;
7
8
  export type InteractionState = {
8
9
  /** 表格选择(行 / 列 / 全选) */
@@ -5,6 +5,7 @@ export declare function useInteraction(docRef: Ref<Doc | null>): {
5
5
  readonly tableId: string;
6
6
  readonly axis: "row" | "col" | "all";
7
7
  readonly index: number;
8
+ readonly realRowIndex?: number | undefined;
8
9
  } | null | undefined;
9
10
  readonly activeTableId?: string | undefined;
10
11
  readonly dragHoverId?: string | undefined;
@@ -20,7 +20,7 @@ export declare class BaseHandler {
20
20
  label: string;
21
21
  type: 'placeholder' | 'fieldName' | 'noneLabel' | 'default';
22
22
  };
23
- static formatDateTimeValue(ctx: HandlerContext, valuePath: string): any;
23
+ static formatFieldValue(ctx: HandlerContext, valuePath: string): any;
24
24
  /**
25
25
  * 渲染组件值 label -> value
26
26
  * @param ctx
@@ -1,5 +1,6 @@
1
1
  import { ModelNode, ModelNodeOptions } from './ModelNode';
2
2
  import { RawElement } from '../types/raw';
3
+ import { Wp } from '../document/Wp';
3
4
  export interface ModelGroupOptions<T = ModelNode | RawElement> extends ModelNodeOptions {
4
5
  children?: T[];
5
6
  }
@@ -52,6 +53,11 @@ export declare abstract class ModelGroup<T = ModelNode | RawElement> extends Mod
52
53
  * @returns 第一个子节点,如果没有子节点则返回 undefined
53
54
  */
54
55
  getFirstChild(): T | undefined;
56
+ /**
57
+ * 深度优先查找第一个段落节点(w:p)
58
+ * @returns 第一个 Wp,如果未找到则返回 undefined
59
+ */
60
+ getFirstWp(): Wp | undefined;
55
61
  /**
56
62
  * 获取最后一个子节点
57
63
  * @returns 最后一个子节点,如果没有子节点则返回 undefined
@@ -2,8 +2,8 @@ import { RawElement } from '../types/raw';
2
2
  import { Wtbl } from './Wtbl';
3
3
  import { Wtc } from './Wtc';
4
4
  import { ModelGroup, ModelGroupOptions } from '../base';
5
- import { WtrPr } from './WtrPr';
6
- type RowHeightRule = 'auto' | 'atLeast' | 'exact';
5
+ import { WtrPr, WtrHeightRule } from './WtrPr';
6
+ type RowHeightRule = WtrHeightRule;
7
7
  /**
8
8
  * w:tr 表格行
9
9
  */
@@ -1,5 +1,11 @@
1
1
  import { RawElement } from '../types/raw';
2
2
  import { ModelNode, ModelNodeOptions } from '../base';
3
+ export type WtrHeightRule = 'auto' | 'atLeast' | 'exact';
4
+ type ToXmlJsonOptions = {
5
+ rowHeight?: number;
6
+ rowHeightRule?: WtrHeightRule;
7
+ syncRowHeight?: boolean;
8
+ };
3
9
  export declare class WtrPr extends ModelNode {
4
10
  /** 节点名称 */
5
11
  name: 'w:trPr';
@@ -21,7 +27,7 @@ export declare class WtrPr extends ModelNode {
21
27
  *
22
28
  * @returns RawElement 格式的 XML JSON
23
29
  */
24
- toXmlJson(): RawElement;
30
+ toXmlJson(options?: ToXmlJsonOptions): RawElement;
25
31
  /**
26
32
  * 获取指定名称的子元素
27
33
  *
@@ -51,5 +57,11 @@ export declare class WtrPr extends ModelNode {
51
57
  * wpPr.removeElement('w:keepNext');
52
58
  */
53
59
  removeElement(name: string): boolean;
60
+ getRowHeight(): {
61
+ rowHeight?: number;
62
+ rowHeightRule?: WtrHeightRule;
63
+ };
64
+ setRowHeight(rowHeight?: number, rowHeightRule?: WtrHeightRule): void;
54
65
  static fromTemplate(): WtrPr;
55
66
  }
67
+ export {};
@@ -4,11 +4,14 @@ import { TableCell } from './TableCell';
4
4
  import { Wtr } from '../model/document';
5
5
  export interface TableRowOptions extends LayoutGroupOptions {
6
6
  allowRowSplit?: boolean;
7
+ /** 记录该行在原始模型表格中的真实行索引(全局索引) */
8
+ realRowIndex?: number;
7
9
  }
8
10
  export declare class TableRow extends LayoutGroup<TableCell> {
9
11
  component: "tableRow";
10
12
  parent: Table;
11
13
  allowRowSplit: boolean;
14
+ realRowIndex: number;
12
15
  constructor(options: TableRowOptions);
13
16
  get width(): number;
14
17
  get height(): number;