@univerjs/find-replace 0.1.12 → 0.1.13-nightly.202406041140

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/lib/es/index.js CHANGED
@@ -1,12 +1,12 @@
1
1
  var at = Object.defineProperty;
2
2
  var ot = (t, e, n) => e in t ? at(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
3
  var c = (t, e, n) => (ot(t, typeof e != "symbol" ? e + "" : e, n), n);
4
- import { Disposable as X, IUniverInstanceService as pe, ILogService as ct, toDisposable as q, IContextService as ee, DisposableCollection as lt, CommandType as y, LocaleService as P, ICommandService as te, FOCUSING_SHEET as _e, EDITOR_ACTIVATED as ge, UniverInstanceType as dt, RxDisposable as ht, OnLifecycle as ut, LifecycleStages as ft, Plugin as pt, Tools as _t } from "@univerjs/core";
5
- import { createIdentifier as gt, Inject as M, Injector as ie } from "@wendellhu/redi";
6
- import { IConfirmService as mt, IMessageService as me, useObservable as I, ILayoutService as ve, KeyCode as b, MetaKeys as x, MenuGroup as vt, MenuItemType as St, MenuPosition as Ct, getMenuHiddenObservable as Rt, ComponentManager as bt, IMenuService as Mt, IShortcutService as xt, IDialogService as yt } from "@univerjs/ui";
7
- import { BehaviorSubject as D, Subject as Se, throttleTime as It, combineLatest as Ce, debounceTime as Ft, fromEvent as Dt, map as Pt, takeUntil as ce } from "rxjs";
8
- import { RENDER_RAW_FORMULA_KEY as Ot } from "@univerjs/engine-render";
9
- import Tt, { forwardRef as U, useRef as z, createElement as Re, useCallback as _, Fragment as $, useEffect as w, useMemo as ne, useImperativeHandle as Et } from "react";
4
+ import { Disposable as X, IUniverInstanceService as pe, ILogService as ct, toDisposable as q, IContextService as ee, DisposableCollection as lt, CommandType as b, LocaleService as T, ICommandService as te, FOCUSING_SHEET as _e, EDITOR_ACTIVATED as ge, UniverInstanceType as dt, RxDisposable as ht, OnLifecycle as ut, LifecycleStages as ft, Plugin as pt, Tools as _t } from "@univerjs/core";
5
+ import { createIdentifier as gt, Inject as x, Injector as ie } from "@wendellhu/redi";
6
+ import { IConfirmService as mt, IMessageService as me, useObservable as I, ILayoutService as ve, KeyCode as M, MetaKeys as y, MenuGroup as vt, MenuItemType as St, MenuPosition as Ct, getMenuHiddenObservable as Rt, ComponentManager as Mt, IMenuService as xt, IShortcutService as yt, IDialogService as bt } from "@univerjs/ui";
7
+ import { BehaviorSubject as D, Subject as Se, throttleTime as It, combineLatest as Ce, debounceTime as Ft, fromEvent as Dt, map as Tt, takeUntil as ce } from "rxjs";
8
+ import { RENDER_RAW_FORMULA_KEY as Pt } from "@univerjs/engine-render";
9
+ import Ot, { forwardRef as U, useRef as z, createElement as Re, useCallback as _, Fragment as $, useEffect as L, useMemo as ne, useImperativeHandle as Et } from "react";
10
10
  import { MessageType as N, InputWithSlot as $t, Pager as Nt, Button as A, FormLayout as R, Input as At, Select as V, FormDualColumnLayout as le, Checkbox as de } from "@univerjs/design";
11
11
  import { useDependency as S } from "@wendellhu/redi/react-bindings";
12
12
  var g = function() {
@@ -18,7 +18,7 @@ var g = function() {
18
18
  }
19
19
  return t;
20
20
  }, g.apply(this, arguments);
21
- }, wt = function(t, e) {
21
+ }, Lt = function(t, e) {
22
22
  var n = {};
23
23
  for (var i in t)
24
24
  Object.prototype.hasOwnProperty.call(t, i) && e.indexOf(i) < 0 && (n[i] = t[i]);
@@ -26,13 +26,13 @@ var g = function() {
26
26
  for (var s = 0, i = Object.getOwnPropertySymbols(t); s < i.length; s++)
27
27
  e.indexOf(i[s]) < 0 && Object.prototype.propertyIsEnumerable.call(t, i[s]) && (n[i[s]] = t[i[s]]);
28
28
  return n;
29
- }, be = U(function(t, e) {
30
- var n = t.icon, i = t.id, s = t.className, r = t.extend, a = wt(t, ["icon", "id", "className", "extend"]), o = "univerjs-icon univerjs-icon-".concat(i, " ").concat(s || "").trim(), d = z("_".concat(Ut()));
31
- return Me(n, "".concat(i), { defIds: n.defIds, idSuffix: d.current }, g({ ref: e, className: o }, a), r);
29
+ }, Me = U(function(t, e) {
30
+ var n = t.icon, i = t.id, s = t.className, r = t.extend, a = Lt(t, ["icon", "id", "className", "extend"]), o = "univerjs-icon univerjs-icon-".concat(i, " ").concat(s || "").trim(), d = z("_".concat(Ut()));
31
+ return xe(n, "".concat(i), { defIds: n.defIds, idSuffix: d.current }, g({ ref: e, className: o }, a), r);
32
32
  });
33
- function Me(t, e, n, i, s) {
34
- return Re(t.tag, g(g({ key: e }, jt(t, n, s)), i), (Lt(t, n).children || []).map(function(r, a) {
35
- return Me(r, "".concat(e, "-").concat(t.tag, "-").concat(a), n, void 0, s);
33
+ function xe(t, e, n, i, s) {
34
+ return Re(t.tag, g(g({ key: e }, jt(t, n, s)), i), (wt(t, n).children || []).map(function(r, a) {
35
+ return xe(r, "".concat(e, "-").concat(t.tag, "-").concat(a), n, void 0, s);
36
36
  }));
37
37
  }
38
38
  function jt(t, e, n) {
@@ -44,7 +44,7 @@ function jt(t, e, n) {
44
44
  typeof o == "string" && (i[a] = o.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
45
45
  })), i;
46
46
  }
47
- function Lt(t, e) {
47
+ function wt(t, e) {
48
48
  var n, i = e.defIds;
49
49
  return !i || i.length === 0 ? t : t.tag === "defs" && (!((n = t.children) === null || n === void 0) && n.length) ? g(g({}, t), { children: t.children.map(function(s) {
50
50
  return typeof s.attrs.id == "string" && i && i.indexOf(s.attrs.id) > -1 ? g(g({}, s), { attrs: g(g({}, s.attrs), { id: s.attrs.id + e.idSuffix }) }) : s;
@@ -53,25 +53,25 @@ function Lt(t, e) {
53
53
  function Ut() {
54
54
  return Math.random().toString(36).substring(2, 8);
55
55
  }
56
- be.displayName = "UniverIcon";
57
- var Bt = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 17 17", width: "1em", height: "1em" }, children: [{ tag: "mask", attrs: { id: "mask0_217_40", style: { maskType: "alpha" }, width: 17, height: 17, x: 0, y: 0, maskUnits: "userSpaceOnUse" }, children: [{ tag: "path", attrs: { fill: "#D9D9D9", d: "M0.9 0.09H16.9V16.09H0.9z" } }] }, { tag: "g", attrs: { mask: "url(#mask0_217_40)" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M2.39551 7.37266C2.39551 4.18105 4.98281 1.59375 8.17441 1.59375C11.366 1.59375 13.9533 4.18105 13.9533 7.37266C13.9533 8.72342 13.4898 9.96603 12.7133 10.95L15.1964 13.4331C15.4619 13.6986 15.4619 14.1291 15.1964 14.3946C14.9309 14.6601 14.5004 14.6601 14.2349 14.3946L11.7518 11.9115C10.7678 12.6881 9.52525 13.1516 8.17441 13.1516C4.98281 13.1516 2.39551 10.5642 2.39551 7.37266ZM8.17441 2.95349C5.73378 2.95349 3.75525 4.93202 3.75525 7.37266C3.75525 9.81333 5.73378 11.7918 8.17441 11.7918C10.6151 11.7918 12.5936 9.81333 12.5936 7.37266C12.5936 4.93202 10.6151 2.95349 8.17441 2.95349Z", fillRule: "evenodd", clipRule: "evenodd" } }] }] }, xe = U(function(t, e) {
58
- return Re(be, Object.assign({}, t, {
56
+ Me.displayName = "UniverIcon";
57
+ var Bt = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 17 17", width: "1em", height: "1em" }, children: [{ tag: "mask", attrs: { id: "mask0_217_40", style: { maskType: "alpha" }, width: 17, height: 17, x: 0, y: 0, maskUnits: "userSpaceOnUse" }, children: [{ tag: "path", attrs: { fill: "#D9D9D9", d: "M0.9 0.09H16.9V16.09H0.9z" } }] }, { tag: "g", attrs: { mask: "url(#mask0_217_40)" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M2.39551 7.37266C2.39551 4.18105 4.98281 1.59375 8.17441 1.59375C11.366 1.59375 13.9533 4.18105 13.9533 7.37266C13.9533 8.72342 13.4898 9.96603 12.7133 10.95L15.1964 13.4331C15.4619 13.6986 15.4619 14.1291 15.1964 14.3946C14.9309 14.6601 14.5004 14.6601 14.2349 14.3946L11.7518 11.9115C10.7678 12.6881 9.52525 13.1516 8.17441 13.1516C4.98281 13.1516 2.39551 10.5642 2.39551 7.37266ZM8.17441 2.95349C5.73378 2.95349 3.75525 4.93202 3.75525 7.37266C3.75525 9.81333 5.73378 11.7918 8.17441 11.7918C10.6151 11.7918 12.5936 9.81333 12.5936 7.37266C12.5936 4.93202 10.6151 2.95349 8.17441 2.95349Z", fillRule: "evenodd", clipRule: "evenodd" } }] }] }, ye = U(function(t, e) {
58
+ return Re(Me, Object.assign({}, t, {
59
59
  id: "search-single-16",
60
60
  ref: e,
61
61
  icon: Bt
62
62
  }));
63
63
  });
64
- xe.displayName = "SearchSingle16";
65
- const ye = "FIND_REPLACE_INPUT_FOCUS", Ie = "FIND_REPLACE_DIALOG_FOCUS", Fe = "FIND_REPLACE_REPLACE_REVEALED";
66
- var Wt = Object.defineProperty, kt = Object.getOwnPropertyDescriptor, De = (t, e, n, i) => {
67
- for (var s = i > 1 ? void 0 : i ? kt(e, n) : e, r = t.length - 1, a; r >= 0; r--)
68
- (a = t[r]) && (s = (i ? a(e, n, s) : a(s)) || s);
69
- return i && s && Wt(e, n, s), s;
64
+ ye.displayName = "SearchSingle16";
65
+ const be = "FIND_REPLACE_INPUT_FOCUS", Ie = "FIND_REPLACE_DIALOG_FOCUS", Fe = "FIND_REPLACE_REPLACE_REVEALED";
66
+ var De = (t, e, n, i) => {
67
+ for (var s = e, r = t.length - 1, a; r >= 0; r--)
68
+ (a = t[r]) && (s = a(s) || s);
69
+ return s;
70
70
  }, j = (t, e) => (n, i) => e(n, i, t);
71
- class Bi extends X {
71
+ class Pi extends X {
72
72
  }
73
73
  const m = gt("find-replace.service");
74
- function Gt(t) {
74
+ function kt(t) {
75
75
  return typeof t.findString < "u" || typeof t.inputtingFindString < "u" || typeof t.findDirection < "u" || typeof t.matchesTheWholeCell < "u" || typeof t.caseSensitive < "u" || typeof t.findScope < "u" || typeof t.findBy < "u";
76
76
  }
77
77
  let K = class extends X {
@@ -88,7 +88,7 @@ let K = class extends X {
88
88
  this._state = e, this._providers = n, this._univerInstanceService = i, this._logService = s, this.disposeWithMe(
89
89
  this._state.stateUpdates$.pipe(It(200, void 0, { leading: !0, trailing: !0 })).subscribe(async (r) => {
90
90
  const a = this._state.state;
91
- Gt(r) && (a.findString !== "" && !a.replaceRevealed ? (await this._startSearching(), this._state.changeState({ findCompleted: !0 })) : r.replaceRevealed !== !0 && this._stopSearching());
91
+ kt(r) && (a.findString !== "" && !a.replaceRevealed ? (await this._startSearching(), this._state.changeState({ findCompleted: !0 })) : r.replaceRevealed !== !0 && this._stopSearching());
92
92
  })
93
93
  );
94
94
  }
@@ -232,7 +232,7 @@ function se() {
232
232
  revealed: !0
233
233
  };
234
234
  }
235
- class Vt {
235
+ class Wt {
236
236
  constructor() {
237
237
  c(this, "_stateUpdates$", new Se());
238
238
  c(this, "stateUpdates$", this._stateUpdates$.asObservable());
@@ -317,7 +317,7 @@ let Q = class extends X {
317
317
  constructor(e, n) {
318
318
  super();
319
319
  c(this, "_providers", /* @__PURE__ */ new Set());
320
- c(this, "_state", new Vt());
320
+ c(this, "_state", new Wt());
321
321
  c(this, "_model");
322
322
  c(this, "_currentMatch$", new D(null));
323
323
  c(this, "currentMatch$", this._currentMatch$.asObservable());
@@ -418,37 +418,37 @@ let Q = class extends X {
418
418
  this._contextService.setContextValue(Fe, e);
419
419
  }
420
420
  _toggleDisplayRawFormula(e) {
421
- this._contextService.setContextValue(Ot, e);
421
+ this._contextService.setContextValue(Pt, e);
422
422
  }
423
423
  };
424
424
  Q = De([
425
- j(0, M(ie)),
425
+ j(0, x(ie)),
426
426
  j(1, ee)
427
427
  ], Q);
428
428
  const B = {
429
429
  id: "ui.operation.open-find-dialog",
430
- type: y.OPERATION,
430
+ type: b.OPERATION,
431
431
  handler: (t) => {
432
432
  const e = t.get(m);
433
433
  return e.revealed ? e.focusFindInput() : e.start(), !0;
434
434
  }
435
435
  }, re = {
436
436
  id: "ui.operation.open-replace-dialog",
437
- type: y.OPERATION,
437
+ type: b.OPERATION,
438
438
  handler: (t) => {
439
439
  const e = t.get(m);
440
440
  return e.revealed ? e.replaceRevealed ? e.focusFindInput() : e.revealReplace() : e.start(!0), !0;
441
441
  }
442
- }, Pe = {
443
- type: y.OPERATION,
442
+ }, Te = {
443
+ type: b.OPERATION,
444
444
  id: "ui.operation.go-to-next-match",
445
445
  handler: (t) => (t.get(m).moveToNextMatch(), !0)
446
- }, Oe = {
447
- type: y.OPERATION,
446
+ }, Pe = {
447
+ type: b.OPERATION,
448
448
  id: "ui.operation.go-to-previous-match",
449
449
  handler: (t) => (t.get(m).moveToPreviousMatch(), !0)
450
450
  };
451
- var Te = { exports: {} }, W = {};
451
+ var Oe = { exports: {} }, k = {};
452
452
  /**
453
453
  * @license React
454
454
  * react-jsx-runtime.production.min.js
@@ -458,33 +458,33 @@ var Te = { exports: {} }, W = {};
458
458
  * This source code is licensed under the MIT license found in the
459
459
  * LICENSE file in the root directory of this source tree.
460
460
  */
461
- var Ht = Tt, qt = Symbol.for("react.element"), zt = Symbol.for("react.fragment"), Kt = Object.prototype.hasOwnProperty, Yt = Ht.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, Zt = { key: !0, ref: !0, __self: !0, __source: !0 };
461
+ var Gt = Ot, Vt = Symbol.for("react.element"), Ht = Symbol.for("react.fragment"), qt = Object.prototype.hasOwnProperty, zt = Gt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, Kt = { key: !0, ref: !0, __self: !0, __source: !0 };
462
462
  function Ee(t, e, n) {
463
463
  var i, s = {}, r = null, a = null;
464
464
  n !== void 0 && (r = "" + n), e.key !== void 0 && (r = "" + e.key), e.ref !== void 0 && (a = e.ref);
465
465
  for (i in e)
466
- Kt.call(e, i) && !Zt.hasOwnProperty(i) && (s[i] = e[i]);
466
+ qt.call(e, i) && !Kt.hasOwnProperty(i) && (s[i] = e[i]);
467
467
  if (t && t.defaultProps)
468
468
  for (i in e = t.defaultProps, e)
469
469
  s[i] === void 0 && (s[i] = e[i]);
470
- return { $$typeof: qt, type: t, key: r, ref: a, props: s, _owner: Yt.current };
470
+ return { $$typeof: Vt, type: t, key: r, ref: a, props: s, _owner: zt.current };
471
471
  }
472
- W.Fragment = zt;
473
- W.jsx = Ee;
474
- W.jsxs = Ee;
475
- Te.exports = W;
476
- var l = Te.exports;
472
+ k.Fragment = Ht;
473
+ k.jsx = Ee;
474
+ k.jsxs = Ee;
475
+ Oe.exports = k;
476
+ var l = Oe.exports;
477
477
  const $e = {
478
478
  id: "ui.command.replace-current-match",
479
- type: y.COMMAND,
479
+ type: b.COMMAND,
480
480
  handler: (t) => t.get(m).replace()
481
- }, Jt = "CONFIRM_REPLACE_ALL", Ne = {
481
+ }, Yt = "CONFIRM_REPLACE_ALL", Ne = {
482
482
  id: "ui.command.replace-all-matches",
483
- type: y.COMMAND,
483
+ type: b.COMMAND,
484
484
  handler: async (t) => {
485
- const e = t.get(mt), n = t.get(P), i = t.get(me);
485
+ const e = t.get(mt), n = t.get(T), i = t.get(me);
486
486
  if (!await e.confirm({
487
- id: Jt,
487
+ id: Yt,
488
488
  title: { title: n.t("find-replace.replace.confirm.title") },
489
489
  cancelText: n.t("button.cancel"),
490
490
  confirmText: n.t("button.confirm")
@@ -528,14 +528,14 @@ function Ae(t) {
528
528
  }
529
529
  );
530
530
  }
531
- const Qt = "univer-find-replace-dialog-container", Xt = "univer-find-replace-expand-container", ei = "univer-button-text", ti = "univer-find-replace-buttons-group", ii = "univer-find-replace-buttons-group-right", L = {
532
- findReplaceDialogContainer: Qt,
533
- findReplaceExpandContainer: Xt,
534
- buttonText: ei,
535
- findReplaceButtonsGroup: ti,
536
- findReplaceButtonsGroupRight: ii
531
+ const Zt = "univer-find-replace-dialog-container", Jt = "univer-find-replace-expand-container", Qt = "univer-button-text", Xt = "univer-find-replace-buttons-group", ei = "univer-find-replace-buttons-group-right", w = {
532
+ findReplaceDialogContainer: Zt,
533
+ findReplaceExpandContainer: Jt,
534
+ buttonText: Qt,
535
+ findReplaceButtonsGroup: Xt,
536
+ findReplaceButtonsGroupRight: ei
537
537
  };
538
- function we(t, e) {
538
+ function Le(t, e) {
539
539
  const n = _(() => {
540
540
  var s;
541
541
  (s = document.querySelector(".univer-find-input input")) == null || s.focus();
@@ -543,16 +543,16 @@ function we(t, e) {
543
543
  const s = document.querySelectorAll(".univer-find-replace-dialog-container .univer-select-selection-search-input");
544
544
  return Array.from(s).some((r) => r === document.activeElement);
545
545
  }, []);
546
- return Et(e, () => ({ focus: n, selectHasFocus: i })), w(() => {
546
+ return Et(e, () => ({ focus: n, selectHasFocus: i })), L(() => {
547
547
  const s = t.focusSignal$.subscribe(() => n());
548
548
  return () => s.unsubscribe();
549
549
  }, [t, n]), { focus: n, selectHasFocus: i };
550
550
  }
551
- const ni = U(function(e, n) {
552
- const i = S(P), s = S(m), r = S(te), a = I(s.state$, void 0, !0), { findCompleted: o, findString: d, matchesCount: u, matchesPosition: f } = a, p = _(() => {
551
+ const ti = U(function(e, n) {
552
+ const i = S(T), s = S(m), r = S(te), a = I(s.state$, void 0, !0), { findCompleted: o, findString: d, matchesCount: u, matchesPosition: f } = a, p = _(() => {
553
553
  r.executeCommand(re.id);
554
- }, [r]), T = _((C) => s.changeFindString(C), [s]);
555
- return we(s, n), /* @__PURE__ */ l.jsxs($, { children: [
554
+ }, [r]), O = _((C) => s.changeFindString(C), [s]);
555
+ return Le(s, n), /* @__PURE__ */ l.jsxs($, { children: [
556
556
  /* @__PURE__ */ l.jsx(
557
557
  Ae,
558
558
  {
@@ -563,21 +563,21 @@ const ni = U(function(e, n) {
563
563
  findReplaceService: s,
564
564
  localeService: i,
565
565
  findString: d,
566
- onChange: T
566
+ onChange: O
567
567
  }
568
568
  ),
569
- /* @__PURE__ */ l.jsx("div", { className: L.findReplaceExpandContainer, children: /* @__PURE__ */ l.jsx(A, { type: "text", size: "small", onClick: p, children: i.t("find-replace.dialog.advanced-finding") }) })
569
+ /* @__PURE__ */ l.jsx("div", { className: w.findReplaceExpandContainer, children: /* @__PURE__ */ l.jsx(A, { type: "text", size: "small", onClick: p, children: i.t("find-replace.dialog.advanced-finding") }) })
570
570
  ] });
571
- }), si = U(function(e, n) {
572
- const i = S(m), s = S(P), r = S(te), a = S(me), o = I(i.currentMatch$, void 0, !0), d = I(i.replaceables$, void 0, !0), u = I(i.state$, void 0, !0), {
571
+ }), ii = U(function(e, n) {
572
+ const i = S(m), s = S(T), r = S(te), a = S(me), o = I(i.currentMatch$, void 0, !0), d = I(i.replaceables$, void 0, !0), u = I(i.state$, void 0, !0), {
573
573
  matchesCount: f,
574
574
  matchesPosition: p,
575
- findString: T,
575
+ findString: O,
576
576
  inputtingFindString: C,
577
577
  replaceString: Ue,
578
578
  caseSensitive: Be,
579
- matchesTheWholeCell: We,
580
- findDirection: ke,
579
+ matchesTheWholeCell: ke,
580
+ findDirection: We,
581
581
  findScope: Ge,
582
582
  findBy: Ve,
583
583
  findCompleted: G
@@ -587,9 +587,9 @@ const ni = U(function(e, n) {
587
587
  ), Ye = _(
588
588
  (h) => i.changeReplaceString(h),
589
589
  [i]
590
- ), { focus: Ze } = we(i, n), Je = _(() => {
591
- T === C ? i.moveToNextMatch() : (i.changeFindString(C), i.find());
592
- }, [T, C, i]), Qe = _(() => r.executeCommand($e.id), [r]), Xe = _(async () => {
590
+ ), { focus: Ze } = Le(i, n), Je = _(() => {
591
+ O === C ? i.moveToNextMatch() : (i.changeFindString(C), i.find());
592
+ }, [O, C, i]), Qe = _(() => r.executeCommand($e.id), [r]), Xe = _(async () => {
593
593
  await r.executeCommand(Ne.id), Ze();
594
594
  }, [r]), et = _((h) => {
595
595
  i.changeFindDirection(h);
@@ -597,14 +597,14 @@ const ni = U(function(e, n) {
597
597
  i.changeFindScope(h);
598
598
  }, [i]), it = _((h) => {
599
599
  i.changeFindBy(h);
600
- }, [i]), nt = ai(s), st = oi(s), rt = ci(s);
601
- return w(() => {
600
+ }, [i]), nt = si(s), st = ri(s), rt = ai(s);
601
+ return L(() => {
602
602
  const h = G && f === 0;
603
603
  let E = null;
604
604
  return h && (E = a.show({
605
605
  content: s.t("find-replace.dialog.no-match"),
606
606
  type: N.Warning,
607
- delay: 5e3
607
+ duration: 5e3
608
608
  })), () => E == null ? void 0 : E.dispose();
609
609
  }, [G, f, a, s]), /* @__PURE__ */ l.jsxs($, { children: [
610
610
  /* @__PURE__ */ l.jsx(R, { label: s.t("find-replace.dialog.find"), children: /* @__PURE__ */ l.jsx(
@@ -628,7 +628,7 @@ const ni = U(function(e, n) {
628
628
  onChange: (h) => Ye(h)
629
629
  }
630
630
  ) }),
631
- /* @__PURE__ */ l.jsx(R, { label: s.t("find-replace.dialog.find-direction.title"), children: /* @__PURE__ */ l.jsx(V, { value: ke, options: st, onChange: et }) }),
631
+ /* @__PURE__ */ l.jsx(R, { label: s.t("find-replace.dialog.find-direction.title"), children: /* @__PURE__ */ l.jsx(V, { value: We, options: st, onChange: et }) }),
632
632
  /* @__PURE__ */ l.jsx(le, { children: /* @__PURE__ */ l.jsxs($, { children: [
633
633
  /* @__PURE__ */ l.jsx(R, { label: s.t("find-replace.dialog.find-scope.title"), children: /* @__PURE__ */ l.jsx(V, { value: Ge, options: nt, onChange: tt }) }),
634
634
  /* @__PURE__ */ l.jsx(R, { label: s.t("find-replace.dialog.find-by.title"), children: /* @__PURE__ */ l.jsx(V, { value: Ve, options: rt, onChange: it }) })
@@ -647,7 +647,7 @@ const ni = U(function(e, n) {
647
647
  /* @__PURE__ */ l.jsx(R, { children: /* @__PURE__ */ l.jsx(
648
648
  de,
649
649
  {
650
- checked: We,
650
+ checked: ke,
651
651
  onChange: (h) => {
652
652
  i.changeMatchesTheWholeCell(h);
653
653
  },
@@ -655,18 +655,18 @@ const ni = U(function(e, n) {
655
655
  }
656
656
  ) })
657
657
  ] }) }),
658
- /* @__PURE__ */ l.jsxs("div", { className: L.findReplaceButtonsGroup, children: [
658
+ /* @__PURE__ */ l.jsxs("div", { className: w.findReplaceButtonsGroup, children: [
659
659
  /* @__PURE__ */ l.jsx(A, { type: "primary", onClick: Je, disabled: He, children: s.t("find-replace.dialog.find") }),
660
- /* @__PURE__ */ l.jsxs("span", { className: L.findReplaceButtonsGroupRight, children: [
660
+ /* @__PURE__ */ l.jsxs("span", { className: w.findReplaceButtonsGroupRight, children: [
661
661
  /* @__PURE__ */ l.jsx(A, { disabled: qe, onClick: Qe, children: s.t("find-replace.dialog.replace") }),
662
662
  /* @__PURE__ */ l.jsx(A, { disabled: ze, onClick: Xe, children: s.t("find-replace.dialog.replace-all") })
663
663
  ] })
664
664
  ] })
665
665
  ] });
666
666
  });
667
- function ri() {
667
+ function ni() {
668
668
  const t = S(m), e = S(ve), n = S(ee), i = I(t.state$, void 0, !0), s = z(null);
669
- w(() => {
669
+ L(() => {
670
670
  let d;
671
671
  return s.current && (d = e.registerContainerElement(s.current)), () => d == null ? void 0 : d.dispose();
672
672
  }, [e]);
@@ -674,10 +674,10 @@ function ri() {
674
674
  (d) => n.setContextValue(Ie, d),
675
675
  [n]
676
676
  ), o = _(
677
- (d) => n.setContextValue(ye, d),
677
+ (d) => n.setContextValue(be, d),
678
678
  [n]
679
679
  );
680
- return w(() => {
680
+ return L(() => {
681
681
  var u;
682
682
  const d = Dt(document, "focusin").subscribe((f) => {
683
683
  var p;
@@ -686,90 +686,90 @@ function ri() {
686
686
  return (u = r.current) == null || u.focus(), a(!0), o(!0), () => {
687
687
  d.unsubscribe(), a(!1);
688
688
  };
689
- }, [a, o]), /* @__PURE__ */ l.jsx("div", { className: L.findReplaceDialogContainer, ref: s, children: i.replaceRevealed ? /* @__PURE__ */ l.jsx(si, { ref: r }) : /* @__PURE__ */ l.jsx(ni, { ref: r }) });
689
+ }, [a, o]), /* @__PURE__ */ l.jsx("div", { className: w.findReplaceDialogContainer, ref: s, children: i.replaceRevealed ? /* @__PURE__ */ l.jsx(ii, { ref: r }) : /* @__PURE__ */ l.jsx(ti, { ref: r }) });
690
690
  }
691
- function ai(t) {
691
+ function si(t) {
692
692
  const e = t.getCurrentLocale();
693
693
  return ne(() => [
694
694
  { label: t.t("find-replace.dialog.find-scope.current-sheet"), value: J.SUBUNIT },
695
695
  { label: t.t("find-replace.dialog.find-scope.workbook"), value: J.UNIT }
696
696
  ], [e]);
697
697
  }
698
- function oi(t) {
698
+ function ri(t) {
699
699
  const e = t.getCurrentLocale();
700
700
  return ne(() => [
701
701
  { label: t.t("find-replace.dialog.find-direction.row"), value: Y.ROW },
702
702
  { label: t.t("find-replace.dialog.find-direction.column"), value: Y.COLUMN }
703
703
  ], [e]);
704
704
  }
705
- function ci(t) {
705
+ function ai(t) {
706
706
  const e = t.getCurrentLocale();
707
707
  return ne(() => [
708
708
  { label: t.t("find-replace.dialog.find-by.value"), value: Z.VALUE },
709
709
  { label: t.t("find-replace.dialog.find-by.formula"), value: Z.FORMULA }
710
710
  ], [e]);
711
711
  }
712
- function O(t) {
712
+ function P(t) {
713
713
  return t.getContextValue(Ie);
714
714
  }
715
- function li(t) {
715
+ function oi(t) {
716
716
  return t.getContextValue(Fe);
717
717
  }
718
718
  function je(t) {
719
- return t.getContextValue(ye);
719
+ return t.getContextValue(be);
720
720
  }
721
- const k = "7_find-replace-shortcuts";
721
+ const W = "7_find-replace-shortcuts";
722
722
  function ae(t) {
723
723
  return t.getContextValue(_e);
724
724
  }
725
725
  function oe(t) {
726
726
  return !t.getContextValue(ge);
727
727
  }
728
- const di = {
728
+ const ci = {
729
729
  id: B.id,
730
730
  description: "find-replace.shortcut.open-find-dialog",
731
- binding: b.F | x.CTRL_COMMAND,
732
- group: k,
731
+ binding: M.F | y.CTRL_COMMAND,
732
+ group: W,
733
733
  preconditions(t) {
734
- return !O(t) && ae(t) && oe(t);
734
+ return !P(t) && ae(t) && oe(t);
735
735
  }
736
- }, hi = {
736
+ }, li = {
737
737
  id: B.id,
738
738
  description: "find-replace.shortcut.open-find-dialog",
739
- binding: b.F | x.CTRL_COMMAND,
740
- mac: b.F | x.MAC_CTRL,
739
+ binding: M.F | y.CTRL_COMMAND,
740
+ mac: M.F | y.MAC_CTRL,
741
741
  preconditions(t) {
742
- return !O(t) && ae(t) && oe(t);
742
+ return !P(t) && ae(t) && oe(t);
743
743
  }
744
- }, ui = {
744
+ }, di = {
745
745
  id: re.id,
746
746
  description: "find-replace.shortcut.open-replace-dialog",
747
- binding: b.H | x.CTRL_COMMAND,
748
- mac: b.H | x.MAC_CTRL,
749
- group: k,
747
+ binding: M.H | y.CTRL_COMMAND,
748
+ mac: M.H | y.MAC_CTRL,
749
+ group: W,
750
750
  preconditions(t) {
751
- return ae(t) && oe(t) && (!O(t) || !li(t));
751
+ return ae(t) && oe(t) && (!P(t) || !oi(t));
752
752
  }
753
- }, fi = {
754
- id: Pe.id,
753
+ }, hi = {
754
+ id: Te.id,
755
755
  description: "find-replace.shortcut.go-to-next-match",
756
- binding: b.ENTER,
757
- group: k,
756
+ binding: M.ENTER,
757
+ group: W,
758
758
  priority: 1e3,
759
759
  preconditions(t) {
760
- return je(t) && O(t);
760
+ return je(t) && P(t);
761
761
  }
762
- }, pi = {
763
- id: Oe.id,
762
+ }, ui = {
763
+ id: Pe.id,
764
764
  description: "find-replace.shortcut.go-to-previous-match",
765
- binding: b.ENTER | x.SHIFT,
766
- group: k,
765
+ binding: M.ENTER | y.SHIFT,
766
+ group: W,
767
767
  priority: 1e3,
768
768
  preconditions(t) {
769
- return je(t) && O(t);
769
+ return je(t) && P(t);
770
770
  }
771
771
  };
772
- function _i(t) {
772
+ function fi(t) {
773
773
  const e = t.get(ee);
774
774
  return {
775
775
  id: B.id,
@@ -782,15 +782,15 @@ function _i(t) {
782
782
  disabled$: Ce([
783
783
  e.subscribeContextValue$(ge),
784
784
  e.subscribeContextValue$(_e)
785
- ]).pipe(Pt(([n, i]) => n || !i))
785
+ ]).pipe(Tt(([n, i]) => n || !i))
786
786
  };
787
787
  }
788
- var gi = Object.defineProperty, mi = Object.getOwnPropertyDescriptor, vi = (t, e, n, i) => {
789
- for (var s = i > 1 ? void 0 : i ? mi(e, n) : e, r = t.length - 1, a; r >= 0; r--)
790
- (a = t[r]) && (s = (i ? a(e, n, s) : a(s)) || s);
791
- return i && s && gi(e, n, s), s;
788
+ var pi = (t, e, n, i) => {
789
+ for (var s = e, r = t.length - 1, a; r >= 0; r--)
790
+ (a = t[r]) && (s = a(s) || s);
791
+ return s;
792
792
  }, v = (t, e) => (n, i) => e(n, i, t);
793
- const Si = {}, he = "DESKTOP_FIND_REPLACE_DIALOG", Le = 350, Ci = 20, Ri = -90;
793
+ const _i = {}, he = "DESKTOP_FIND_REPLACE_DIALOG", we = 350, gi = 20, mi = -90;
794
794
  let F = class extends ht {
795
795
  constructor(t, e, n, i, s, r, a, o, d, u, f) {
796
796
  super(), this._config = t, this._univerInstanceService = e, this._menuService = n, this._shortcutService = i, this._commandService = s, this._findReplaceService = r, this._dialogService = a, this._layoutService = o, this._localeService = d, this._componentManager = u, this._injector = f, this._initCommands(), this._initUI(), this._initShortcuts();
@@ -799,8 +799,8 @@ let F = class extends ht {
799
799
  [
800
800
  B,
801
801
  re,
802
+ Te,
802
803
  Pe,
803
- Oe,
804
804
  Ne,
805
805
  $e
806
806
  ].forEach((t) => {
@@ -809,16 +809,16 @@ let F = class extends ht {
809
809
  }
810
810
  _initShortcuts() {
811
811
  [
812
- ui,
813
812
  di,
814
- hi,
815
- pi,
816
- fi
813
+ ci,
814
+ li,
815
+ ui,
816
+ hi
817
817
  ].forEach((t) => this.disposeWithMe(this._shortcutService.registerShortcut(t)));
818
818
  }
819
819
  _initUI() {
820
820
  const { menu: t = {} } = this._config;
821
- this.disposeWithMe(this._menuService.addMenuItem(this._injector.invoke(_i), t)), this.disposeWithMe(this._componentManager.register("FindReplaceDialog", ri)), this.disposeWithMe(this._componentManager.register("SearchIcon", xe)), this._findReplaceService.stateUpdates$.pipe(ce(this.dispose$)).subscribe((e) => {
821
+ this.disposeWithMe(this._menuService.addMenuItem(this._injector.invoke(fi), t)), this.disposeWithMe(this._componentManager.register("FindReplaceDialog", ni)), this.disposeWithMe(this._componentManager.register("SearchIcon", ye)), this._findReplaceService.stateUpdates$.pipe(ce(this.dispose$)).subscribe((e) => {
822
822
  e.revealed === !0 && this._openPanel();
823
823
  }), this.disposeWithMe(
824
824
  this._univerInstanceService.focused$.pipe(ce(this.dispose$)).subscribe((e) => {
@@ -830,11 +830,11 @@ let F = class extends ht {
830
830
  this._dialogService.open({
831
831
  id: he,
832
832
  draggable: !0,
833
- width: Le,
833
+ width: we,
834
834
  title: { title: this._localeService.t("find-replace.dialog.title") },
835
835
  children: { label: "FindReplaceDialog" },
836
836
  destroyOnClose: !0,
837
- defaultPosition: bi(),
837
+ defaultPosition: vi(),
838
838
  preservePositionOnDestroy: !0,
839
839
  onClose: () => this.closePanel()
840
840
  });
@@ -843,175 +843,33 @@ let F = class extends ht {
843
843
  this._dialogService.close(he), this._findReplaceService.terminate(), queueMicrotask(() => this._layoutService.focus());
844
844
  }
845
845
  };
846
- F = vi([
846
+ F = pi([
847
847
  ut(ft.Rendered, F),
848
848
  v(1, pe),
849
- v(2, Mt),
850
- v(3, xt),
849
+ v(2, xt),
850
+ v(3, yt),
851
851
  v(4, te),
852
852
  v(5, m),
853
- v(6, yt),
853
+ v(6, bt),
854
854
  v(7, ve),
855
- v(8, M(P)),
856
- v(9, M(bt)),
857
- v(10, M(ie))
855
+ v(8, x(T)),
856
+ v(9, x(Mt)),
857
+ v(10, x(ie))
858
858
  ], F);
859
- function bi() {
859
+ function vi() {
860
860
  const { innerWidth: t } = window;
861
- return { x: (t - Le) / 2 - Ci, y: Ri };
861
+ return { x: (t - we) / 2 - gi, y: mi };
862
862
  }
863
- const Mi = {
864
- "find-replace": {
865
- toolbar: "Find & Replace",
866
- shortcut: {
867
- "open-find-dialog": "Open Find Dialog",
868
- "open-replace-dialog": "Open Replace Dialog",
869
- "close-dialog": "Close Find & Replace Dialog",
870
- "go-to-next-match": "Go to Next Match",
871
- "go-to-previous-match": "Go to Previous Match"
872
- },
873
- dialog: {
874
- title: "Find",
875
- find: "Find",
876
- replace: "Replace",
877
- "replace-all": "Replace All",
878
- "case-sensitive": "Case Sensitive",
879
- "find-placeholder": "Find in this Sheet",
880
- "advanced-finding": "Advanced Searching & Replace",
881
- "replace-placeholder": "Input Replace String",
882
- "match-the-whole-cell": "Match the Whole Cell",
883
- "find-direction": {
884
- title: "Find Direction",
885
- row: "Search by Row",
886
- column: "Search by Column"
887
- },
888
- "find-scope": {
889
- title: "Find Range",
890
- "current-sheet": "Current Sheet",
891
- workbook: "Workbook"
892
- },
893
- "find-by": {
894
- title: "Find By",
895
- value: "Find by Value",
896
- formula: "Find Formula"
897
- },
898
- "no-match": "Finding completed but no match found.",
899
- "no-result": "No Result"
900
- },
901
- replace: {
902
- "all-success": "Replaced all {0} matches",
903
- "all-failure": "Replace failed",
904
- confirm: {
905
- title: "Are you sure to replace all matches?"
906
- }
907
- }
908
- },
909
- "find-replace-shortcuts": "Find & Replace"
910
- }, Wi = Mi, xi = {
911
- "find-replace": {
912
- toolbar: "查找替换",
913
- shortcut: {
914
- "open-find-dialog": "打开查找对话框",
915
- "open-replace-dialog": "打开替换对话框",
916
- "close-dialog": "关闭查找替换对话框",
917
- "go-to-next-match": "下一个匹配项",
918
- "go-to-previous-match": "下一个匹配项"
919
- },
920
- dialog: {
921
- title: "查找",
922
- find: "查找",
923
- replace: "替换",
924
- "replace-all": "替换全部",
925
- "find-placeholder": "输入查找内容",
926
- "advanced-finding": "替换 / 高级查找",
927
- "replace-placeholder": "输入替换内容",
928
- "case-sensitive": "匹配大小写",
929
- "match-the-whole-cell": "匹配整个单元格",
930
- "find-scope": {
931
- title: "查找范围",
932
- "current-sheet": "当前子表",
933
- workbook: "整个工作簿"
934
- },
935
- "find-direction": {
936
- title: "查找顺序",
937
- column: "按列查找",
938
- row: "按行查找"
939
- },
940
- "find-by": {
941
- title: "查找方式",
942
- formula: "查找公式",
943
- value: "查找值"
944
- },
945
- "no-match": "已完成搜索,但是未找到任何匹配项",
946
- "no-result": "无结果"
947
- },
948
- replace: {
949
- "all-success": "已全部替换 {0} 个匹配项",
950
- "all-failure": "替换失败",
951
- confirm: {
952
- title: "确定要替换所有的匹配项吗?"
953
- }
954
- }
955
- },
956
- "find-replace-shortcuts": "查找替换"
957
- }, yi = xi, Ii = {
958
- "find-replace": {
959
- toolbar: "Найти и заменить",
960
- shortcut: {
961
- "open-find-dialog": "Открыть диалог поиска",
962
- "open-replace-dialog": "Открыть диалог замены",
963
- "close-dialog": "Закрыть диалог поиска и замены",
964
- "go-to-next-match": "Перейти к следующему совпадению",
965
- "go-to-previous-match": "Перейти к предыдущему совпадению"
966
- },
967
- dialog: {
968
- title: "Найти",
969
- find: "Найти",
970
- replace: "Заменить",
971
- "replace-all": "Заменить все",
972
- "case-sensitive": "С учетом регистра",
973
- "find-placeholder": "Найти в этом листе",
974
- "advanced-finding": "Расширенный поиск и замена",
975
- "replace-placeholder": "Введите строку для замены",
976
- "match-the-whole-cell": "Точное совпадение",
977
- "find-direction": {
978
- title: "Направление поиска",
979
- row: "Поиск по строкам",
980
- column: "Поиск по столбцам"
981
- },
982
- "find-scope": {
983
- title: "Область поиска",
984
- "current-sheet": "Текущий лист",
985
- workbook: "Книга"
986
- },
987
- "find-by": {
988
- title: "Поиск по",
989
- value: "Поиск по значению",
990
- formula: "Поиск по формуле"
991
- },
992
- "no-match": "Поиск завершен, совпадений не найдено.",
993
- "no-result": "Нет результатов"
994
- },
995
- replace: {
996
- "all-success": "Заменены все {0} совпадений",
997
- "all-failure": "Не удалось заменить",
998
- confirm: {
999
- title: "Вы уверены, что хотите заменить все совпадения?"
1000
- }
1001
- }
1002
- },
1003
- "find-replace-shortcuts": "Найти и заменить"
1004
- }, ki = Ii;
1005
- var Fi = Object.defineProperty, Di = Object.getOwnPropertyDescriptor, Pi = (t, e, n, i) => {
1006
- for (var s = i > 1 ? void 0 : i ? Di(e, n) : e, r = t.length - 1, a; r >= 0; r--)
1007
- (a = t[r]) && (s = (i ? a(e, n, s) : a(s)) || s);
1008
- return i && s && Fi(e, n, s), s;
863
+ var Si = (t, e, n, i) => {
864
+ for (var s = e, r = t.length - 1, a; r >= 0; r--)
865
+ (a = t[r]) && (s = a(s) || s);
866
+ return s;
1009
867
  }, ue = (t, e) => (n, i) => e(n, i, t);
1010
- const Oi = "FIND_REPLACE_PLUGIN";
868
+ const Ci = "FIND_REPLACE_PLUGIN";
1011
869
  var H;
1012
870
  let fe = (H = class extends pt {
1013
871
  constructor(t = {}, e, n) {
1014
- super(), this._config = t, this._injector = e, this._localeService = n, this._localeService.load({ zhCN: yi }), this._config = _t.deepMerge({}, Si, this._config);
872
+ super(), this._config = t, this._injector = e, this._localeService = n, this._config = _t.deepMerge({}, _i, this._config);
1015
873
  }
1016
874
  onStarting(t) {
1017
875
  [
@@ -1028,20 +886,17 @@ let fe = (H = class extends pt {
1028
886
  }
1029
887
  );
1030
888
  }
1031
- }, c(H, "pluginName", Oi), H);
1032
- fe = Pi([
1033
- ue(1, M(ie)),
1034
- ue(2, M(P))
889
+ }, c(H, "pluginName", Ci), H);
890
+ fe = Si([
891
+ ue(1, x(ie)),
892
+ ue(2, x(T))
1035
893
  ], fe);
1036
894
  export {
1037
895
  Z as FindBy,
1038
896
  Y as FindDirection,
1039
- Bi as FindModel,
897
+ Pi as FindModel,
1040
898
  F as FindReplaceController,
1041
899
  J as FindScope,
1042
900
  m as IFindReplaceService,
1043
- fe as UniverFindReplacePlugin,
1044
- Wi as enUS,
1045
- ki as ruRU,
1046
- yi as zhCN
901
+ fe as UniverFindReplacePlugin
1047
902
  };