ooxml-excel-editor 1.16.0 → 1.16.2

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.
@@ -1,5 +1,5 @@
1
1
  import { c as Va, g as il } from "./_commonjsHelpers-bAxELxBV.js";
2
- import { _ as La } from "./jspdf.es.min-0SH7s6ux.js";
2
+ import { _ as La } from "./jspdf.es.min-DOtW0DYo.js";
3
3
  var fn = {}, cn = {}, cr, vn;
4
4
  function Q() {
5
5
  if (vn) return cr;
@@ -1,5 +1,5 @@
1
1
  import { c as Va, g as il } from "./_commonjsHelpers-bAxELxBV.js";
2
- import { _ as La } from "./jspdf.es.min-BGxE3IHn.js";
2
+ import { _ as La } from "./jspdf.es.min-DcIe7UWW.js";
3
3
  var fn = {}, cn = {}, cr, vn;
4
4
  function Q() {
5
5
  if (vn) return cr;
@@ -1,7 +1,7 @@
1
1
  var Yh = Object.defineProperty;
2
2
  var Jh = (n, e, t) => e in n ? Yh(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
3
  var xe = (n, e, t) => Jh(n, typeof e != "symbol" ? e + "" : e, t);
4
- import { aA as ko } from "./index-CoOchGdS.js";
4
+ import { z as ko } from "./index-DKKEwcK8.js";
5
5
  function _e(n) {
6
6
  "@babel/helpers - typeof";
7
7
  return _e = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
@@ -8911,7 +8911,7 @@ endobj\r
8911
8911
  var d = c.getContext("2d");
8912
8912
  d.fillStyle = "#fff", d.fillRect(0, 0, c.width, c.height);
8913
8913
  var m = { ignoreMouse: !0, ignoreAnimation: !0, ignoreDimensions: !0 }, A = this;
8914
- return ($t.canvg ? Promise.resolve($t.canvg) : import("./index.es-4CG-9vV3.js")).catch(function(P) {
8914
+ return ($t.canvg ? Promise.resolve($t.canvg) : import("./index.es-BFDtb3m5.js")).catch(function(P) {
8915
8915
  return Promise.reject(new Error("Could not load canvg: " + P));
8916
8916
  }).then(function(P) {
8917
8917
  return P.default ? P.default : P;
@@ -1,7 +1,7 @@
1
1
  var Yh = Object.defineProperty;
2
2
  var Jh = (n, e, t) => e in n ? Yh(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
3
  var xe = (n, e, t) => Jh(n, typeof e != "symbol" ? e + "" : e, t);
4
- import { z as ko } from "./index-B524VYpT.js";
4
+ import { aA as ko } from "./index-Dg4LsUaW.js";
5
5
  function _e(n) {
6
6
  "@babel/helpers - typeof";
7
7
  return _e = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
@@ -8911,7 +8911,7 @@ endobj\r
8911
8911
  var d = c.getContext("2d");
8912
8912
  d.fillStyle = "#fff", d.fillRect(0, 0, c.width, c.height);
8913
8913
  var m = { ignoreMouse: !0, ignoreAnimation: !0, ignoreDimensions: !0 }, A = this;
8914
- return ($t.canvg ? Promise.resolve($t.canvg) : import("./index.es-DXHaUdz8.js")).catch(function(P) {
8914
+ return ($t.canvg ? Promise.resolve($t.canvg) : import("./index.es-_lLUy2tE.js")).catch(function(P) {
8915
8915
  return Promise.reject(new Error("Could not load canvg: " + P));
8916
8916
  }).then(function(P) {
8917
8917
  return P.default ? P.default : P;
@@ -11,7 +11,7 @@ var H = (t, o, e) => o in t ? Se(t, o, { enumerable: !0, configurable: !0, writa
11
11
  return t;
12
12
  }, $ = (t, o) => Ce(t, ze(o));
13
13
  var C = (t, o, e) => H(t, typeof o != "symbol" ? o + "" : o, e);
14
- import { L as ue, af as qe, D as N, ai as B, az as Ae, K as Le, t as xe, j as be, F as j, $ as _ } from "./index-CoOchGdS.js";
14
+ import { L as ue, af as qe, D as N, ai as B, az as Ae, K as Le, t as xe, j as be, F as j, $ as _ } from "./index-Dg4LsUaW.js";
15
15
  function Je(t, o) {
16
16
  var u;
17
17
  const e = o.sheets[0], l = t.sheets[0];
@@ -374,6 +374,14 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {
374
374
  getCalcMode(): "auto" | "manual";
375
375
  setCalcMode(mode: "auto" | "manual"): void;
376
376
  reapplyFilters(): boolean;
377
+ toggleAutoFilter(): void;
378
+ hasFilters(): boolean;
379
+ clearAllFilters(): void;
380
+ openFilterConditionDialog(col: number): void;
381
+ applyFilterCondition(col: number, cond: import('../core/viewer/filter-engine').FilterCondition | null): boolean;
382
+ openFindReplaceDialog(tab?: "find" | "replace"): void;
383
+ closeFindReplaceDialog(): void;
384
+ isFindDialogOpen(): boolean;
377
385
  openDataValidationDialog(presetType?: "list" | "whole" | "decimal" | "date" | "time" | "textLength" | "custom"): boolean;
378
386
  openRemoveDuplicatesDialog(): boolean;
379
387
  openTextToColumnsDialog(): boolean;
@@ -18,7 +18,7 @@ export type { WorkbookModel, SheetModel, CellModel, CellStyle, MergeRange, Condi
18
18
  export { CanvasRenderer } from './render/canvas-renderer';
19
19
  export type { ViewState, RendererOptions } from './render/canvas-renderer';
20
20
  export { ViewerController } from './viewer/controller';
21
- export type { Cell, TooltipState, FindState, FilterPopupState, ViewerControllerEls, ViewerControllerHooks, } from './viewer/controller';
21
+ export type { Cell, TooltipState, FindState, ViewerControllerEls, ViewerControllerHooks, } from './viewer/controller';
22
22
  export { OverlayManager } from './viewer/overlay-manager';
23
23
  export type { OverlayQuads } from './viewer/overlay-manager';
24
24
  export { PluginOverlayHost } from './viewer/plugin-overlay';
@@ -294,6 +294,22 @@ export interface ViewerApi {
294
294
  setCalcMode(mode: 'auto' | 'manual'): void;
295
295
  /** 重新应用当前筛选(数据变更后手动重跑)。 */
296
296
  reapplyFilters(): boolean;
297
+ /** 切换自动筛选(在已用区/选区建立筛选区或取消)。 */
298
+ toggleAutoFilter(): void;
299
+ /** 当前表是否有生效的筛选。 */
300
+ hasFilters(): boolean;
301
+ /** 清除当前表全部筛选。 */
302
+ clearAllFilters(): void;
303
+ /** 打开某列「条件筛选」对话框(数字/文本/日期,按列型;含前十项、高于/低于平均)。1.16.0 */
304
+ openFilterConditionDialog(col: number): void;
305
+ /** 设/清某列条件筛选(cond=null 清除);程序化用。 */
306
+ applyFilterCondition(col: number, cond: import('./viewer/filter-engine').FilterCondition | null): boolean;
307
+ /** 打开 WPS「查找和替换」对话框(tab='find'|'replace';框架无关 core DOM,含范围/方向/查找范围/通配符/全部查找)。1.16.1 */
308
+ openFindReplaceDialog(tab?: 'find' | 'replace'): void;
309
+ /** 关闭查找和替换对话框 + 清查找态。1.16.1 */
310
+ closeFindReplaceDialog(): void;
311
+ /** 当前查找和替换对话框是否打开。1.16.1 */
312
+ isFindDialogOpen(): boolean;
297
313
  /** 打开数据有效性对话框(presetType='list' 供「下拉列表」直达)。需 editable。 */
298
314
  openDataValidationDialog(presetType?: 'list' | 'whole' | 'decimal' | 'date' | 'time' | 'textLength' | 'custom'): boolean;
299
315
  /** 打开删除重复项对话框。需 editable。 */
@@ -166,14 +166,6 @@ export declare class CanvasRenderer {
166
166
  setExtraSelection(ranges: MergeRange[]): void;
167
167
  private findHits;
168
168
  private findCurrent;
169
- /** 扫描非空单元格,返回命中的格(按阅读顺序: 先行后列) */
170
- searchCells(query: string, opts?: {
171
- matchCase?: boolean;
172
- wholeCell?: boolean;
173
- }): {
174
- row: number;
175
- col: number;
176
- }[];
177
169
  /** 设置高亮命中集 + 当前项(供 drawFind 绘制) */
178
170
  setFind(hits: {
179
171
  row: number;
@@ -8,6 +8,8 @@ import { CellInspection } from '../model/inspect';
8
8
  import { MenuItem } from '../edit/context-menu';
9
9
  import { PivotOutputChoice } from './pivot-dialog-host';
10
10
  import { PasteBehavior } from '../edit/paste-behavior';
11
+ import { FilterCondition } from './filter-engine';
12
+ import { FindScope, FindDirection, FindLookIn } from './find-engine';
11
13
  import { EditorCommitValue, EditorResolver } from '../edit/editor-context';
12
14
  import { CanvasRenderer, CellImageFit, RendererOptions, ViewState } from '../render/canvas-renderer';
13
15
  import { OverlayQuads } from './overlay-manager';
@@ -24,7 +26,7 @@ export interface TooltipState {
24
26
  y: number;
25
27
  kind: 'overflow' | 'comment';
26
28
  }
27
- /** 查找状态快照(供壳渲染 FindBar) */
29
+ /** 查找状态快照(供壳渲染查找和替换对话框) */
28
30
  export interface FindState {
29
31
  query: string;
30
32
  matchCase: boolean;
@@ -33,16 +35,11 @@ export interface FindState {
33
35
  index: number;
34
36
  /** 替换文本(1.11.0;替换功能需 editable) */
35
37
  replace: string;
36
- }
37
- /** 自动筛选下拉浮层(列去重值 + 已选 + 屏幕位置) */
38
- export interface FilterPopupState {
39
- col: number;
40
- values: string[];
41
- selected: string[];
42
- x: number;
43
- y: number;
44
- /** 该列当前排序方向(用于浮层高亮 ↑/↓);null = 未按此列排序 */
45
- sortDir: 'asc' | 'desc' | null;
38
+ /** WPS「查找和替换」深化(1.16.1) */
39
+ scope: FindScope;
40
+ direction: FindDirection;
41
+ lookIn: FindLookIn;
42
+ wildcard: boolean;
46
43
  }
47
44
  export interface ViewerControllerEls {
48
45
  canvas: HTMLCanvasElement;
@@ -78,6 +75,8 @@ export interface ViewerControllerHooks {
78
75
  onFilterChange: () => void;
79
76
  /** core 里新增/切换工作表时通知壳同步 activeSheet。 */
80
77
  onActiveSheetChange?: (index: number) => void;
78
+ /** core 手势(触屏 pinch / 双击)改了缩放时通知壳同步缩放显示(工具栏 %)。1.16.2 */
79
+ onZoomChange?: (zoom: number) => void;
81
80
  /** 编辑事件(cell-change/edit-start/edit-commit;壳转 emit + 插件派发) */
82
81
  onEditEvent: (event: EditEventName, payload: unknown) => void;
83
82
  /** 右键菜单触发前(Plan C):用户可调 `preventDefault()` 阻止内置菜单弹出(然后自渲染) */
@@ -202,11 +201,19 @@ export declare class ViewerController {
202
201
  private findReplace;
203
202
  private findMatchCase;
204
203
  private findWholeCell;
204
+ private findScope;
205
+ private findDirection;
206
+ private findLookIn;
207
+ private findWildcard;
205
208
  private findHits;
206
209
  private findIndex;
210
+ /** 跨表跳转:切表后待定位的命中(rebuild 重跑查找后应用) */
211
+ private pendingFindFocus;
212
+ /** WPS 查找和替换对话框(框架无关 DOM,三壳共用)。1.16.1 */
213
+ private findDialog;
207
214
  private filterState;
215
+ private filterPopupHost;
208
216
  private filterOrigHidden;
209
- private filterPopup;
210
217
  private sortCol;
211
218
  private sortDir;
212
219
  private editCfg;
@@ -218,6 +225,18 @@ export declare class ViewerController {
218
225
  private editorResolver?;
219
226
  /** paste 事件处理器(绑在 scroller 上;Ctrl+V 走它拿**原始**剪贴板 HTML,避开 clipboard.read() 的净化) */
220
227
  private readonly onPasteHandler;
228
+ private pinching;
229
+ private pinchStartDist;
230
+ private pinchStartZoom;
231
+ private lastTapTime;
232
+ private lastTapX;
233
+ private lastTapY;
234
+ private touchDist;
235
+ /** 手势请求缩放:立即 setZoom(即时顺滑重绘)+ 通知壳同步显示。clamp 0.3–3(比下拉 0.5–2 宽,方便手机看清)。 */
236
+ private requestZoom;
237
+ private readonly onTouchStartHandler;
238
+ private readonly onTouchMoveHandler;
239
+ private readonly onTouchEndHandler;
221
240
  constructor(els: ViewerControllerEls, hooks: ViewerControllerHooks);
222
241
  /** 切表/换簿/主题变化: 清状态,重建渲染器,重置滚动,量尺寸,建叠加层,绘制,按需重跑查找 */
223
242
  rebuild(sheet: SheetModel, workbook: WorkbookModel, zoom: number, opts: RendererOptions): void;
@@ -229,6 +248,8 @@ export declare class ViewerController {
229
248
  measure(): void;
230
249
  /** 同步滚动量(壳的 scroll 事件里调) */
231
250
  setScroll(scrollX: number, scrollY: number): void;
251
+ /** 当前缩放(壳 watch 用它去重,避免 pinch 已改 core 后 watch 再回调一次 setZoom 双重渲染)。 */
252
+ getZoom(): number;
232
253
  /** 缩放: 保持视口中心相对内容的比例,避免跳到左上角 */
233
254
  setZoom(zoom: number): void;
234
255
  /** 拖拽改列宽(px) */
@@ -467,34 +488,60 @@ export declare class ViewerController {
467
488
  row: number;
468
489
  col: number;
469
490
  }): boolean;
470
- /** 查找状态快照(壳渲染 FindBar) */
491
+ /** 查找状态快照(壳渲染查找和替换对话框) */
471
492
  getFindState(): FindState;
493
+ /** 「全部查找」结果列表(跨表命中:sheet 下标 + 表名 + 行列 + 显示值)。 */
494
+ getFindResults(): {
495
+ sheet: number;
496
+ sheetName: string;
497
+ row: number;
498
+ col: number;
499
+ value: string;
500
+ }[];
472
501
  setFindQuery(q: string): void;
473
502
  setFindMatchCase(b: boolean): void;
474
503
  setFindWholeCell(b: boolean): void;
475
- /** 重算命中并应用(query/选项变化时) */
504
+ setFindScope(s: FindScope): void;
505
+ setFindDirection(d: FindDirection): void;
506
+ setFindLookIn(l: FindLookIn): void;
507
+ setFindWildcard(b: boolean): void;
508
+ private findOptions;
509
+ /** 重算命中并应用(query/选项变化时)。跨表命中,索引重置到第一处。 */
476
510
  private recomputeFind;
477
- /** 把当前命中应用到渲染器 + 移动选区/滚动到视图 */
511
+ /** 查找态变化通知(壳 + 对话框计数刷新)。 */
512
+ private notifyFindChange;
513
+ /** 把当前活动表的命中应用到渲染器(高亮),并定位当前命中(必要时跨表跳转)。 */
478
514
  private applyFind;
515
+ /** 打开 WPS 查找和替换对话框(框架无关;三壳只转发)。tab 缺省 'find'。 */
516
+ openFindReplaceDialog(tab?: 'find' | 'replace'): void;
517
+ isFindDialogOpen(): boolean;
518
+ /** 关闭对话框 + 清查找态。 */
519
+ closeFindReplaceDialog(): void;
520
+ /** 定位到第 gi 个全局命中;若在别的表 → 请求壳切表,rebuild 后由 pendingFindFocus 落位。 */
521
+ private focusHit;
522
+ /** rebuild 重跑查找后调用:若有待定位命中且落在当前表,选中它。 */
523
+ private resolvePendingFindFocus;
479
524
  findNext(): void;
480
525
  findPrev(): void;
481
- /** 关闭查找: 清 query + 命中(保留 matchCase/wholeCell 选项),清除高亮 */
526
+ /** 「全部查找」结果表点某行 → 跳到该命中。 */
527
+ gotoFindHit(gi: number): void;
528
+ /** 关闭查找: 清 query + 命中(保留选项),清除高亮 */
482
529
  clearFind(): void;
483
530
  setFindReplace(text: string): void;
484
531
  /** 按当前查找选项把字符串里的命中换掉;无命中返 null。 */
485
532
  private replaceInString;
486
533
  /** 替换当前命中格(替换后重算命中并定位下一个);返回是否替换了。 */
487
534
  replaceCurrent(): boolean;
488
- /** 全部替换;返回替换的格数(整体单次撤销)。 */
535
+ /** 全部替换(活动表);返回替换的格数(整体单次撤销)。 */
489
536
  replaceAll(): number;
490
537
  /** 当前是否有列处于筛选中(工具栏「清除筛选」启用判断) */
491
538
  hasFilters(): boolean;
492
- /** 当前筛选浮层(壳渲染 FilterPopup) */
493
- getFilterPopup(): FilterPopupState | null;
494
539
  /** 筛选数据区底行: 正常用 af.bottom;若 af 只含表头(bottom===top)则延伸到数据末行 */
495
540
  private filterDataBottom;
496
541
  /** 某列(自动筛选数据区)的去重值,数值/中文自然排序 */
497
542
  private distinctColumnValues;
543
+ /** 取一格喂给条件引擎的三元(显示文本 + 数值 + 日期 ms)。 */
544
+ private filterCellValue;
498
545
  /** 重算筛选导致的隐藏行并应用到模型(行隐藏机制 → 几何归零) */
499
546
  private applyFilters;
500
547
  /** 点中下拉按钮 / 命令式: 打开某列筛选浮层(算去重值 + 已选 + 屏幕位置) */
@@ -508,12 +555,15 @@ export declare class ViewerController {
508
555
  /** 选中带"输入提示"的数据验证格时,在格旁弹黄色气泡;否则隐藏。render() 末尾调用(随滚动跟手)。 */
509
556
  private updateValidationBubble;
510
557
  private hideValidationBubble;
511
- openFilterPopup(col: number): void;
558
+ /** 点表头筛选下拉 / 命令式:打开某列筛选浮层(WPS 式分页签:按内容 + 条件筛选;core DOM 三壳共用)。 */
559
+ openFilterPopup(col: number, initialTab?: 'values' | 'condition'): void;
512
560
  closeFilterPopup(): void;
513
- /** 浮层「确定」: 勾选值落筛选态(全选=取消该列;子集=保留;空集=全隐藏)。 */
514
- applyFilterSelection(checked: string[]): void;
515
- /** 浮层「清除」: 取消该列筛选 */
516
- clearFilterColumn(): void;
561
+ /** 「按内容」确定:勾选值落筛选态(全选=取消该列;子集=保留;空集=全隐藏)。 */
562
+ applyFilterValues(col: number, checked: string[]): void;
563
+ /** 打开某列筛选浮层并直达「条件筛选」页(程序化 / 数据 tab 入口)。1.16.0 */
564
+ openFilterConditionDialog(col: number): void;
565
+ /** 设/清某列条件筛选(cond=null 清除该列筛选)。 */
566
+ applyFilterCondition(col: number, cond: FilterCondition | null): boolean;
517
567
  /** 清除当前表全部筛选 */
518
568
  clearAllFilters(): void;
519
569
  /**
@@ -0,0 +1,57 @@
1
+ /**
2
+ * 自动筛选「条件筛选」引擎(框架无关,纯函数,可单测)。1.16.0
3
+ *
4
+ * 在原有"按值筛选"(去重值复选)之上补 WPS 的条件筛选:
5
+ * - 数字筛选:等于/不等于/大于/大于等于/小于/小于等于/介于/不介于
6
+ * - 文本筛选:等于/不等于/包含/不包含/开头是/结尾是
7
+ * - 日期筛选:等于/之前/之后/介于(操作数为日期序列 ms)
8
+ * - 前十项:最大/最小 N 项 或 百分比
9
+ * - 高于平均值 / 低于平均值
10
+ * top10/平均 依赖整列数值 → 由 `resolveDynamicCondition` 折算成一个具体的数字比较,再逐格 `matchesCondition`。
11
+ */
12
+ export type FilterColType = 'number' | 'text' | 'date';
13
+ export type NumOp = 'eq' | 'ne' | 'gt' | 'ge' | 'lt' | 'le' | 'between' | 'notBetween';
14
+ export type TextOp = 'eq' | 'ne' | 'contains' | 'notContains' | 'startsWith' | 'endsWith';
15
+ export type DateOp = 'eq' | 'before' | 'after' | 'between';
16
+ export type FilterCondition = {
17
+ type: 'number';
18
+ op: NumOp;
19
+ a: number;
20
+ b?: number;
21
+ } | {
22
+ type: 'text';
23
+ op: TextOp;
24
+ s: string;
25
+ } | {
26
+ type: 'date';
27
+ op: DateOp;
28
+ a: number;
29
+ b?: number;
30
+ } | {
31
+ type: 'top10';
32
+ bottom: boolean;
33
+ percent: boolean;
34
+ n: number;
35
+ } | {
36
+ type: 'aboveAvg';
37
+ } | {
38
+ type: 'belowAvg';
39
+ };
40
+ /** 一格喂进引擎的三元:显示文本 + 数值(无则 null) + 日期 ms(无则 null)。 */
41
+ export interface FilterCellValue {
42
+ text: string;
43
+ num: number | null;
44
+ dateMs: number | null;
45
+ }
46
+ export declare const NUM_OP_LABELS: Record<NumOp, string>;
47
+ export declare const TEXT_OP_LABELS: Record<TextOp, string>;
48
+ export declare const DATE_OP_LABELS: Record<DateOp, string>;
49
+ /** 从一组显示文本推断列的数据类型(多数派)。 */
50
+ export declare function inferFilterColType(texts: string[]): FilterColType;
51
+ /**
52
+ * 把动态条件(前十项/高于低于平均)折算成一个具体的数字比较(依整列数值)。
53
+ * 其余条件原样返回。columnNums = 该列所有数据行的数值(已过滤 null)。
54
+ */
55
+ export declare function resolveDynamicCondition(cond: FilterCondition, columnNums: number[]): FilterCondition;
56
+ /** 逐格判定是否通过条件(cond 已经过 resolveDynamicCondition)。 */
57
+ export declare function matchesCondition(cond: FilterCondition, cell: FilterCellValue): boolean;
@@ -0,0 +1,36 @@
1
+ import { FilterColType, FilterCondition } from './filter-engine';
2
+ export interface FilterPopupHostOptions {
3
+ values: string[];
4
+ selected: string[];
5
+ sortDir: 'asc' | 'desc' | null;
6
+ colType: FilterColType;
7
+ currentCond: FilterCondition | null;
8
+ condActive: boolean;
9
+ /** 视口坐标(fixed 定位)。 */
10
+ x: number;
11
+ y: number;
12
+ initialTab?: 'values' | 'condition';
13
+ onSort: (dir: 'asc' | 'desc') => void;
14
+ onApplyValues: (checked: string[]) => void;
15
+ onApplyCondition: (cond: FilterCondition | null) => void;
16
+ onClear: () => void;
17
+ onClose: () => void;
18
+ }
19
+ export declare class FilterPopupHost {
20
+ private el;
21
+ private cleanup;
22
+ private checked;
23
+ private search;
24
+ private tab;
25
+ private o;
26
+ isOpen(): boolean;
27
+ show(o: FilterPopupHostOptions): void;
28
+ private condLabel;
29
+ private render;
30
+ private renderValues;
31
+ private renderCondition;
32
+ private collectCondition;
33
+ private emitClose;
34
+ close(): void;
35
+ dispose(): void;
36
+ }
@@ -0,0 +1,31 @@
1
+ import { WorkbookModel, CellModel, SheetModel } from '../model/types';
2
+ export type FindScope = 'sheet' | 'workbook';
3
+ export type FindDirection = 'row' | 'col';
4
+ export type FindLookIn = 'value' | 'formula' | 'comment';
5
+ export interface FindOptions {
6
+ query: string;
7
+ matchCase: boolean;
8
+ /** 单元格匹配:整格等于(而非包含) */
9
+ wholeCell: boolean;
10
+ /** 通配符:* 任意多字符、? 任意单字符、~ 转义 */
11
+ wildcard: boolean;
12
+ scope: FindScope;
13
+ direction: FindDirection;
14
+ lookIn: FindLookIn;
15
+ }
16
+ export interface FindHit {
17
+ sheet: number;
18
+ row: number;
19
+ col: number;
20
+ /** 该格显示值(结果表展示用,总是取格式化文本,不随 lookIn 变) */
21
+ value: string;
22
+ }
23
+ /** 依选项构造单串匹配谓词;query 为空返回 null。 */
24
+ export declare function buildMatcher(o: Pick<FindOptions, 'query' | 'matchCase' | 'wholeCell' | 'wildcard'>): ((text: string) => boolean) | null;
25
+ /** 某格喂给匹配器的文本(按 lookIn):值=显示文本,公式=`=公式`(非公式格回退显示文本),批注=comment。 */
26
+ export declare function cellMatchText(sheet: SheetModel, cell: CellModel, lookIn: FindLookIn, date1904: boolean): string;
27
+ /**
28
+ * 在工作簿里搜索命中。scope='sheet' 只搜 activeSheet;'workbook' 搜全部表。
29
+ * 命中按 sheet 下标、再按方向(按行/按列)排序。
30
+ */
31
+ export declare function searchWorkbook(wb: WorkbookModel, activeSheet: number, o: FindOptions): FindHit[];
@@ -0,0 +1,69 @@
1
+ import { FindScope, FindDirection, FindLookIn } from './find-engine';
2
+ export interface FindDialogState {
3
+ query: string;
4
+ replace: string;
5
+ matchCase: boolean;
6
+ wholeCell: boolean;
7
+ wildcard: boolean;
8
+ scope: FindScope;
9
+ direction: FindDirection;
10
+ lookIn: FindLookIn;
11
+ count: number;
12
+ index: number;
13
+ }
14
+ export interface FindResultRow {
15
+ sheet: number;
16
+ sheetName: string;
17
+ row: number;
18
+ col: number;
19
+ value: string;
20
+ }
21
+ export interface FindReplaceDialogOptions {
22
+ editable: boolean;
23
+ initialTab?: 'find' | 'replace';
24
+ getState: () => FindDialogState;
25
+ onQuery: (v: string) => void;
26
+ onReplace: (v: string) => void;
27
+ onMatchCase: (v: boolean) => void;
28
+ onWholeCell: (v: boolean) => void;
29
+ onWildcard: (v: boolean) => void;
30
+ onScope: (v: FindScope) => void;
31
+ onDirection: (v: FindDirection) => void;
32
+ onLookIn: (v: FindLookIn) => void;
33
+ onFindNext: () => void;
34
+ onFindPrev: () => void;
35
+ onFindAll: () => FindResultRow[];
36
+ onGotoResult: (globalIndex: number) => void;
37
+ onReplaceOne: () => void;
38
+ onReplaceAll: () => number;
39
+ onClose: () => void;
40
+ }
41
+ export declare class FindReplaceDialogHost {
42
+ private el;
43
+ private cleanup;
44
+ private o;
45
+ private tab;
46
+ private qInput?;
47
+ private rInput?;
48
+ private replaceRow?;
49
+ private replaceBtns?;
50
+ private countEl?;
51
+ private tabFindBtn?;
52
+ private tabRepBtn?;
53
+ private resultsWrap?;
54
+ isOpen(): boolean;
55
+ open(o: FindReplaceDialogOptions): void;
56
+ private template;
57
+ private countText;
58
+ private bind;
59
+ private switchTab;
60
+ /** 批注 lookIn 只查不替:禁用替换按钮。 */
61
+ private syncReplaceEnabled;
62
+ /** 计数/状态刷新(控制器 onFindChange 时调)。不重建 DOM,不丢焦点。 */
63
+ refresh(): void;
64
+ private renderResults;
65
+ private enableDrag;
66
+ private emitClose;
67
+ close(): void;
68
+ dispose(): void;
69
+ }
package/dist/core.js CHANGED
@@ -1,4 +1,4 @@
1
- import { B as s, C as o, o as r, D as l, p as t, E as n, F as i, q as m, G as g, K as d, O as k, t as u, P as C, V as c, W as E, u as y, v as S, w as T, x as b, y as F, z as f, A as h, H as p, I as v, J as I, L as R, M as O, N as W, Q as A, R as B, j as D, S as w, T as _, U as x, X as N, Y as U, d as H, Z as M, e as P, f as V, k as L, _ as J, a as j, $ as z, a0 as G, a1 as K, h as X, i as Y, g as q, c as Q, a2 as Z, S as $, a3 as aa, a4 as ea, a5 as sa, a6 as oa, a7 as ra, a8 as la, a9 as ta, m as na, n as ia, l as ma, aa as ga, ab as da, ac as ka, ad as ua, ae as Ca, af as ca, b as Ea, ag as ya, ah as Sa, ai as Ta, aj as ba, ak as Fa, al as fa, am as ha, r as pa, an as va, ao as Ia, ap as Ra, aq as Oa, ar as Wa, as as Aa, s as Ba, at as Da, au as wa, av as _a, aw as xa, ax as Na, ay as Ua } from "./chunks/index-CoOchGdS.js";
1
+ import { B as s, C as o, o as r, D as l, p as t, E as n, F as i, q as m, G as g, K as d, O as k, t as u, P as C, V as c, W as E, u as y, v as S, w as T, x as b, y as F, z as f, A as h, H as p, I as v, J as I, L as R, M as O, N as W, Q as A, R as B, j as D, S as w, T as _, U as x, X as N, Y as U, d as H, Z as M, e as P, f as V, k as L, _ as J, a as j, $ as z, a0 as G, a1 as K, h as X, i as Y, g as q, c as Q, a2 as Z, S as $, a3 as aa, a4 as ea, a5 as sa, a6 as oa, a7 as ra, a8 as la, a9 as ta, m as na, n as ia, l as ma, aa as ga, ab as da, ac as ka, ad as ua, ae as Ca, af as ca, b as Ea, ag as ya, ah as Sa, ai as Ta, aj as ba, ak as Fa, al as fa, am as ha, r as pa, an as va, ao as Ia, ap as Ra, aq as Oa, ar as Wa, as as Aa, s as Ba, at as Da, au as wa, av as _a, aw as xa, ax as Na, ay as Ua } from "./chunks/index-Dg4LsUaW.js";
2
2
  export {
3
3
  s as BuiltinFormulaEngine,
4
4
  o as CanvasRenderer,