@univerjs/find-replace 0.8.2 → 0.8.3-nightly.202506271607
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/cjs/index.js +1 -1
- package/lib/cjs/locale/ko-KR.js +1 -0
- package/lib/es/index.js +148 -148
- package/lib/es/locale/ko-KR.js +52 -0
- package/lib/index.js +148 -148
- package/lib/locale/ko-KR.js +52 -0
- package/lib/types/index.d.ts +4 -3
- package/lib/types/locale/ko-KR.d.ts +3 -0
- package/lib/umd/index.js +1 -1
- package/lib/umd/locale/ko-KR.js +1 -0
- package/package.json +7 -7
- package/LICENSE +0 -176
package/lib/index.js
CHANGED
|
@@ -3,76 +3,21 @@ var at = (t, e, n) => e in t ? st(t, e, { enumerable: !0, configurable: !0, writ
|
|
|
3
3
|
var o = (t, e, n) => at(t, typeof e != "symbol" ? e + "" : e, n);
|
|
4
4
|
import { createIdentifier as ot, Inject as x, Injector as Q, IContextService as X, Disposable as ee, DisposableCollection as ct, toDisposable as $, IUniverInstanceService as fe, ICommandService as U, CommandType as b, LocaleService as B, FOCUSING_SHEET as pe, EDITOR_ACTIVATED as _e, UniverInstanceType as lt, RxDisposable as dt, IConfigService as ht, Plugin as ut, merge as ft } from "@univerjs/core";
|
|
5
5
|
import { IConfirmService as pt, IMessageService as ge, useDependency as S, useObservable as P, useDebounceFn as _t, ILayoutService as me, KeyCode as C, MetaKeys as F, getMenuHiddenObservable as gt, MenuItemType as mt, RibbonDataGroup as vt, IMenuManagerService as St, IShortcutService as Ct, IDialogService as Mt, ComponentManager as Rt } from "@univerjs/ui";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
6
|
+
import { MessageType as N, Input as ve, Pager as bt, FormLayout as R, Select as j, FormDualColumnLayout as ae, Checkbox as oe, Button as V } from "@univerjs/design";
|
|
7
|
+
import { RENDER_RAW_FORMULA_KEY as It } from "@univerjs/engine-render";
|
|
8
|
+
import { throttleTime as yt, BehaviorSubject as T, combineLatest as Se, debounceTime as Ft, Subject as Ce, fromEvent as Dt, map as xt, takeUntil as ce } from "rxjs";
|
|
9
9
|
import { jsx as l, jsxs as y, Fragment as H } from "react/jsx-runtime";
|
|
10
10
|
import { forwardRef as W, useRef as K, createElement as Me, useState as Pt, useCallback as p, useEffect as A, useMemo as te, useImperativeHandle as Tt } from "react";
|
|
11
|
-
const
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
for (var e, n = 1, i = arguments.length; n < i; n++) {
|
|
15
|
-
e = arguments[n];
|
|
16
|
-
for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
|
|
17
|
-
}
|
|
18
|
-
return t;
|
|
19
|
-
}, _.apply(this, arguments);
|
|
20
|
-
}, Et = function(t, e) {
|
|
21
|
-
var n = {};
|
|
22
|
-
for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && e.indexOf(i) < 0 && (n[i] = t[i]);
|
|
23
|
-
if (t != null && typeof Object.getOwnPropertySymbols == "function")
|
|
24
|
-
for (var r = 0, i = Object.getOwnPropertySymbols(t); r < i.length; r++)
|
|
25
|
-
e.indexOf(i[r]) < 0 && Object.prototype.propertyIsEnumerable.call(t, i[r]) && (n[i[r]] = t[i[r]]);
|
|
26
|
-
return n;
|
|
27
|
-
}, Re = W(function(t, e) {
|
|
28
|
-
var n = t.icon, i = t.id, r = t.className, s = t.extend, a = Et(t, ["icon", "id", "className", "extend"]), c = "univerjs-icon univerjs-icon-".concat(i, " ").concat(r || "").trim(), d = K("_".concat(At()));
|
|
29
|
-
return be(n, "".concat(i), { defIds: n.defIds, idSuffix: d.current }, _({ ref: e, className: c }, a), s);
|
|
30
|
-
});
|
|
31
|
-
function be(t, e, n, i, r) {
|
|
32
|
-
return Me(t.tag, _(_({ key: e }, Nt(t, n, r)), i), ($t(t, n).children || []).map(function(s, a) {
|
|
33
|
-
return be(s, "".concat(e, "-").concat(t.tag, "-").concat(a), n, void 0, r);
|
|
34
|
-
}));
|
|
35
|
-
}
|
|
36
|
-
function Nt(t, e, n) {
|
|
37
|
-
var i = _({}, t.attrs);
|
|
38
|
-
n != null && n.colorChannel1 && i.fill === "colorChannel1" && (i.fill = n.colorChannel1), t.tag === "mask" && i.id && (i.id = i.id + e.idSuffix), Object.entries(i).forEach(function(s) {
|
|
39
|
-
var a = s[0], c = s[1];
|
|
40
|
-
a === "mask" && typeof c == "string" && (i[a] = c.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
|
|
41
|
-
});
|
|
42
|
-
var r = e.defIds;
|
|
43
|
-
return !r || r.length === 0 || (t.tag === "use" && i["xlink:href"] && (i["xlink:href"] = i["xlink:href"] + e.idSuffix), Object.entries(i).forEach(function(s) {
|
|
44
|
-
var a = s[0], c = s[1];
|
|
45
|
-
typeof c == "string" && (i[a] = c.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
|
|
46
|
-
})), i;
|
|
47
|
-
}
|
|
48
|
-
function $t(t, e) {
|
|
49
|
-
var n, i = e.defIds;
|
|
50
|
-
return !i || i.length === 0 ? t : t.tag === "defs" && (!((n = t.children) === null || n === void 0) && n.length) ? _(_({}, t), { children: t.children.map(function(r) {
|
|
51
|
-
return typeof r.attrs.id == "string" && i && i.includes(r.attrs.id) ? _(_({}, r), { attrs: _(_({}, r.attrs), { id: r.attrs.id + e.idSuffix }) }) : r;
|
|
52
|
-
}) }) : t;
|
|
53
|
-
}
|
|
54
|
-
function At() {
|
|
55
|
-
return Math.random().toString(36).substring(2, 8);
|
|
56
|
-
}
|
|
57
|
-
Re.displayName = "UniverIcon";
|
|
58
|
-
var Lt = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M7.71899 1.36938C4.37604 1.36938 1.66602 4.07941 1.66602 7.42236C1.66602 10.7653 4.37604 13.4753 7.71899 13.4753C9.16744 13.4753 10.4971 12.9666 11.5389 12.118L13.6598 14.4109C13.8848 14.6542 14.2644 14.669 14.5077 14.444C14.7509 14.219 14.7657 13.8393 14.5407 13.5961L12.3906 11.2716C13.2536 10.2254 13.772 8.88442 13.772 7.42236C13.772 4.07941 11.0619 1.36938 7.71899 1.36938ZM2.86602 7.42236C2.86602 4.74215 5.03878 2.56938 7.71899 2.56938C10.3992 2.56938 12.572 4.74215 12.572 7.42236C12.572 10.1026 10.3992 12.2753 7.71899 12.2753C5.03878 12.2753 2.86602 10.1026 2.86602 7.42236Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Ie = W(function(t, e) {
|
|
59
|
-
return Me(Re, Object.assign({}, t, {
|
|
60
|
-
id: "search-icon",
|
|
61
|
-
ref: e,
|
|
62
|
-
icon: Lt
|
|
63
|
-
}));
|
|
64
|
-
});
|
|
65
|
-
Ie.displayName = "SearchIcon";
|
|
66
|
-
const ye = "FIND_REPLACE_INPUT_FOCUS", Fe = "FIND_REPLACE_DIALOG_FOCUS", De = "FIND_REPLACE_REPLACE_REVEALED";
|
|
67
|
-
var wt = Object.getOwnPropertyDescriptor, xe = (t, e, n, i) => {
|
|
68
|
-
for (var r = i > 1 ? void 0 : i ? wt(e, n) : e, s = t.length - 1, a; s >= 0; s--)
|
|
11
|
+
const Re = "FIND_REPLACE_INPUT_FOCUS", be = "FIND_REPLACE_DIALOG_FOCUS", Ie = "FIND_REPLACE_REPLACE_REVEALED";
|
|
12
|
+
var Ot = Object.getOwnPropertyDescriptor, ye = (t, e, n, i) => {
|
|
13
|
+
for (var r = i > 1 ? void 0 : i ? Ot(e, n) : e, s = t.length - 1, a; s >= 0; s--)
|
|
69
14
|
(a = t[s]) && (r = a(r) || r);
|
|
70
15
|
return r;
|
|
71
16
|
}, L = (t, e) => (n, i) => e(n, i, t);
|
|
72
17
|
class vi extends ee {
|
|
73
18
|
}
|
|
74
19
|
const g = ot("find-replace.service");
|
|
75
|
-
function
|
|
20
|
+
function Et(t) {
|
|
76
21
|
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";
|
|
77
22
|
}
|
|
78
23
|
let q = class extends ee {
|
|
@@ -87,9 +32,9 @@ let q = class extends ee {
|
|
|
87
32
|
o(this, "_matches", []);
|
|
88
33
|
o(this, "_currentSearchingDisposables", null);
|
|
89
34
|
this._state = e, this._providers = n, this._univerInstanceService = i, this._commandService = r, this.disposeWithMe(
|
|
90
|
-
this._state.stateUpdates$.pipe(
|
|
35
|
+
this._state.stateUpdates$.pipe(yt(200, void 0, { leading: !0, trailing: !0 })).subscribe(async (s) => {
|
|
91
36
|
const a = this._state.state;
|
|
92
|
-
|
|
37
|
+
Et(s) && (a.findString !== "" && !a.replaceRevealed ? (await this._startSearching(), this._state.changeState({ findCompleted: !0 })) : s.replaceRevealed !== !0 && this._stopSearching());
|
|
93
38
|
})
|
|
94
39
|
);
|
|
95
40
|
}
|
|
@@ -137,7 +82,7 @@ let q = class extends ee {
|
|
|
137
82
|
}
|
|
138
83
|
// When a document's content changes, we should reset all matches and try to move to the next match.
|
|
139
84
|
_subscribeToModelsChanges(e) {
|
|
140
|
-
const n = this._currentSearchingDisposables = new ct(), i =
|
|
85
|
+
const n = this._currentSearchingDisposables = new ct(), i = Se(e.map((r) => r.matchesUpdate$)).pipe(Ft(220)).subscribe(([...r]) => {
|
|
141
86
|
const s = this._matches = r.flat();
|
|
142
87
|
s.length ? (this._moveToInitialMatch(this._findModels, !0), this._state.changeState({ matchesCount: s.length }), this.replaceables$.next(s.filter((a) => a.replaceable))) : (this._state.changeState({ matchesCount: 0, matchesPosition: 0 }), this.replaceables$.next([]));
|
|
143
88
|
});
|
|
@@ -218,7 +163,7 @@ let q = class extends ee {
|
|
|
218
163
|
return this._moveToNextUnitMatch(r), 0;
|
|
219
164
|
}
|
|
220
165
|
};
|
|
221
|
-
q =
|
|
166
|
+
q = ye([
|
|
222
167
|
L(2, fe),
|
|
223
168
|
L(3, U)
|
|
224
169
|
], q);
|
|
@@ -240,9 +185,9 @@ function ie() {
|
|
|
240
185
|
revealed: !0
|
|
241
186
|
};
|
|
242
187
|
}
|
|
243
|
-
class
|
|
188
|
+
class Nt {
|
|
244
189
|
constructor() {
|
|
245
|
-
o(this, "_stateUpdates$", new
|
|
190
|
+
o(this, "_stateUpdates$", new Ce());
|
|
246
191
|
o(this, "stateUpdates$", this._stateUpdates$.asObservable());
|
|
247
192
|
o(this, "_state$", new T(ie()));
|
|
248
193
|
o(this, "state$", this._state$.asObservable());
|
|
@@ -326,13 +271,13 @@ let J = class extends ee {
|
|
|
326
271
|
constructor(e, n) {
|
|
327
272
|
super();
|
|
328
273
|
o(this, "_providers", /* @__PURE__ */ new Set());
|
|
329
|
-
o(this, "_state", new
|
|
274
|
+
o(this, "_state", new Nt());
|
|
330
275
|
o(this, "_model");
|
|
331
276
|
o(this, "_currentMatch$", new T(null));
|
|
332
277
|
o(this, "currentMatch$", this._currentMatch$.asObservable());
|
|
333
278
|
o(this, "_replaceables$", new T([]));
|
|
334
279
|
o(this, "replaceables$", this._replaceables$.asObservable());
|
|
335
|
-
o(this, "_focusSignal$", new
|
|
280
|
+
o(this, "_focusSignal$", new Ce());
|
|
336
281
|
o(this, "focusSignal$", this._focusSignal$.asObservable());
|
|
337
282
|
this._injector = e, this._contextService = n;
|
|
338
283
|
}
|
|
@@ -431,27 +376,27 @@ let J = class extends ee {
|
|
|
431
376
|
return this._providers.add(e), $(() => this._providers.delete(e));
|
|
432
377
|
}
|
|
433
378
|
_toggleRevealReplace(e) {
|
|
434
|
-
this._contextService.setContextValue(
|
|
379
|
+
this._contextService.setContextValue(Ie, e);
|
|
435
380
|
}
|
|
436
381
|
_toggleDisplayRawFormula(e) {
|
|
437
|
-
this._contextService.setContextValue(
|
|
382
|
+
this._contextService.setContextValue(It, e);
|
|
438
383
|
}
|
|
439
384
|
};
|
|
440
|
-
J =
|
|
385
|
+
J = ye([
|
|
441
386
|
L(0, x(Q)),
|
|
442
387
|
L(1, X)
|
|
443
388
|
], J);
|
|
444
|
-
const
|
|
389
|
+
const Fe = {
|
|
445
390
|
id: "ui.command.replace-current-match",
|
|
446
391
|
type: b.COMMAND,
|
|
447
392
|
handler: (t) => t.get(g).replace()
|
|
448
|
-
},
|
|
393
|
+
}, $t = "CONFIRM_REPLACE_ALL", De = {
|
|
449
394
|
id: "ui.command.replace-all-matches",
|
|
450
395
|
type: b.COMMAND,
|
|
451
396
|
handler: async (t) => {
|
|
452
397
|
const e = t.get(pt), n = t.get(B), i = t.get(ge);
|
|
453
398
|
if (!await e.confirm({
|
|
454
|
-
id:
|
|
399
|
+
id: $t,
|
|
455
400
|
title: { title: n.t("find-replace.replace.confirm.title") },
|
|
456
401
|
cancelText: n.t("button.cancel"),
|
|
457
402
|
confirmText: n.t("button.confirm")
|
|
@@ -483,23 +428,77 @@ const Pe = {
|
|
|
483
428
|
const e = t.get(g);
|
|
484
429
|
return e.revealed ? e.replaceRevealed ? e.focusFindInput() : e.revealReplace() : e.start(!0), !0;
|
|
485
430
|
}
|
|
486
|
-
},
|
|
431
|
+
}, xe = {
|
|
487
432
|
type: b.OPERATION,
|
|
488
433
|
id: "ui.operation.go-to-next-match",
|
|
489
434
|
handler: (t) => (t.get(g).moveToNextMatch(), !0)
|
|
490
|
-
},
|
|
435
|
+
}, Pe = {
|
|
491
436
|
type: b.OPERATION,
|
|
492
437
|
id: "ui.operation.go-to-previous-match",
|
|
493
438
|
handler: (t) => (t.get(g).moveToPreviousMatch(), !0)
|
|
494
|
-
},
|
|
439
|
+
}, Te = {
|
|
495
440
|
type: b.OPERATION,
|
|
496
441
|
id: "ui.operation.focus-selection",
|
|
497
442
|
handler: (t) => (t.get(g).focusSelection(), !0)
|
|
498
443
|
};
|
|
444
|
+
var _ = function() {
|
|
445
|
+
return _ = Object.assign || function(t) {
|
|
446
|
+
for (var e, n = 1, i = arguments.length; n < i; n++) {
|
|
447
|
+
e = arguments[n];
|
|
448
|
+
for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
|
|
449
|
+
}
|
|
450
|
+
return t;
|
|
451
|
+
}, _.apply(this, arguments);
|
|
452
|
+
}, At = function(t, e) {
|
|
453
|
+
var n = {};
|
|
454
|
+
for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && e.indexOf(i) < 0 && (n[i] = t[i]);
|
|
455
|
+
if (t != null && typeof Object.getOwnPropertySymbols == "function")
|
|
456
|
+
for (var r = 0, i = Object.getOwnPropertySymbols(t); r < i.length; r++)
|
|
457
|
+
e.indexOf(i[r]) < 0 && Object.prototype.propertyIsEnumerable.call(t, i[r]) && (n[i[r]] = t[i[r]]);
|
|
458
|
+
return n;
|
|
459
|
+
}, Oe = W(function(t, e) {
|
|
460
|
+
var n = t.icon, i = t.id, r = t.className, s = t.extend, a = At(t, ["icon", "id", "className", "extend"]), c = "univerjs-icon univerjs-icon-".concat(i, " ").concat(r || "").trim(), d = K("_".concat(Ut()));
|
|
461
|
+
return Ee(n, "".concat(i), { defIds: n.defIds, idSuffix: d.current }, _({ ref: e, className: c }, a), s);
|
|
462
|
+
});
|
|
463
|
+
function Ee(t, e, n, i, r) {
|
|
464
|
+
return Me(t.tag, _(_({ key: e }, Lt(t, n, r)), i), (wt(t, n).children || []).map(function(s, a) {
|
|
465
|
+
return Ee(s, "".concat(e, "-").concat(t.tag, "-").concat(a), n, void 0, r);
|
|
466
|
+
}));
|
|
467
|
+
}
|
|
468
|
+
function Lt(t, e, n) {
|
|
469
|
+
var i = _({}, t.attrs);
|
|
470
|
+
n != null && n.colorChannel1 && i.fill === "colorChannel1" && (i.fill = n.colorChannel1), t.tag === "mask" && i.id && (i.id = i.id + e.idSuffix), Object.entries(i).forEach(function(s) {
|
|
471
|
+
var a = s[0], c = s[1];
|
|
472
|
+
a === "mask" && typeof c == "string" && (i[a] = c.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
|
|
473
|
+
});
|
|
474
|
+
var r = e.defIds;
|
|
475
|
+
return !r || r.length === 0 || (t.tag === "use" && i["xlink:href"] && (i["xlink:href"] = i["xlink:href"] + e.idSuffix), Object.entries(i).forEach(function(s) {
|
|
476
|
+
var a = s[0], c = s[1];
|
|
477
|
+
typeof c == "string" && (i[a] = c.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
|
|
478
|
+
})), i;
|
|
479
|
+
}
|
|
480
|
+
function wt(t, e) {
|
|
481
|
+
var n, i = e.defIds;
|
|
482
|
+
return !i || i.length === 0 ? t : t.tag === "defs" && (!((n = t.children) === null || n === void 0) && n.length) ? _(_({}, t), { children: t.children.map(function(r) {
|
|
483
|
+
return typeof r.attrs.id == "string" && i && i.includes(r.attrs.id) ? _(_({}, r), { attrs: _(_({}, r.attrs), { id: r.attrs.id + e.idSuffix }) }) : r;
|
|
484
|
+
}) }) : t;
|
|
485
|
+
}
|
|
486
|
+
function Ut() {
|
|
487
|
+
return Math.random().toString(36).substring(2, 8);
|
|
488
|
+
}
|
|
489
|
+
Oe.displayName = "UniverIcon";
|
|
490
|
+
var Bt = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M7.71899 1.36938C4.37604 1.36938 1.66602 4.07941 1.66602 7.42236C1.66602 10.7653 4.37604 13.4753 7.71899 13.4753C9.16744 13.4753 10.4971 12.9666 11.5389 12.118L13.6598 14.4109C13.8848 14.6542 14.2644 14.669 14.5077 14.444C14.7509 14.219 14.7657 13.8393 14.5407 13.5961L12.3906 11.2716C13.2536 10.2254 13.772 8.88442 13.772 7.42236C13.772 4.07941 11.0619 1.36938 7.71899 1.36938ZM2.86602 7.42236C2.86602 4.74215 5.03878 2.56938 7.71899 2.56938C10.3992 2.56938 12.572 4.74215 12.572 7.42236C12.572 10.1026 10.3992 12.2753 7.71899 12.2753C5.03878 12.2753 2.86602 10.1026 2.86602 7.42236Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Ne = W(function(t, e) {
|
|
491
|
+
return Me(Oe, Object.assign({}, t, {
|
|
492
|
+
id: "search-icon",
|
|
493
|
+
ref: e,
|
|
494
|
+
icon: Bt
|
|
495
|
+
}));
|
|
496
|
+
});
|
|
497
|
+
Ne.displayName = "SearchIcon";
|
|
499
498
|
function $e(t) {
|
|
500
499
|
const { findCompleted: e, localeService: n, matchesCount: i, matchesPosition: r, initialFindString: s, findReplaceService: a, onChange: c, ...d } = t, [m, f] = Pt(s), I = e && i === 0 ? n.t("find-replace.dialog.no-result") : i === 0 ? " " : void 0;
|
|
501
500
|
return /* @__PURE__ */ l("div", { className: "univer-relative univer-flex univer-items-center univer-gap-2", onDrag: (h) => h.stopPropagation(), children: /* @__PURE__ */ l(
|
|
502
|
-
|
|
501
|
+
ve,
|
|
503
502
|
{
|
|
504
503
|
"data-u-comp": "search-input",
|
|
505
504
|
autoFocus: !0,
|
|
@@ -509,7 +508,7 @@ function $e(t) {
|
|
|
509
508
|
f(h), c == null || c(h);
|
|
510
509
|
},
|
|
511
510
|
slot: /* @__PURE__ */ l(
|
|
512
|
-
|
|
511
|
+
bt,
|
|
513
512
|
{
|
|
514
513
|
loop: !0,
|
|
515
514
|
text: I,
|
|
@@ -537,7 +536,7 @@ function Ae(t, e) {
|
|
|
537
536
|
return () => r.unsubscribe();
|
|
538
537
|
}, [t, n]), { focus: n, selectHasFocus: i };
|
|
539
538
|
}
|
|
540
|
-
const
|
|
539
|
+
const Wt = W(function(e, n) {
|
|
541
540
|
const i = S(B), r = S(g), s = S(U), a = P(r.state$, void 0, !0), { findCompleted: c, findString: d, matchesCount: m, matchesPosition: f } = a, M = p(() => {
|
|
542
541
|
s.executeCommand(ne.id);
|
|
543
542
|
}, [s]), I = _t((h) => r.changeFindString(h), 500);
|
|
@@ -558,13 +557,13 @@ const kt = W(function(e, n) {
|
|
|
558
557
|
/* @__PURE__ */ l("div", { className: "univer-mt-4 univer-text-center", children: /* @__PURE__ */ l(
|
|
559
558
|
"a",
|
|
560
559
|
{
|
|
561
|
-
className: "
|
|
560
|
+
className: "univer-cursor-pointer univer-text-sm univer-text-primary-500 univer-transition-colors hover:univer-text-primary-500/80",
|
|
562
561
|
onClick: M,
|
|
563
562
|
children: i.t("find-replace.dialog.advanced-finding")
|
|
564
563
|
}
|
|
565
564
|
) })
|
|
566
565
|
] });
|
|
567
|
-
}),
|
|
566
|
+
}), kt = W(function(e, n) {
|
|
568
567
|
const i = S(g), r = S(B), s = S(U), a = S(ge), c = P(i.currentMatch$, void 0, !0), d = P(i.replaceables$, void 0, !0), m = P(i.state$, void 0, !0), {
|
|
569
568
|
matchesCount: f,
|
|
570
569
|
matchesPosition: M,
|
|
@@ -585,15 +584,15 @@ const kt = W(function(e, n) {
|
|
|
585
584
|
[i]
|
|
586
585
|
), { focus: ze } = Ae(i, n), Ye = p(() => {
|
|
587
586
|
I === h ? i.moveToNextMatch() : (i.changeFindString(h), i.find());
|
|
588
|
-
}, [I, h, i]), Je = p(() => s.executeCommand(
|
|
589
|
-
await s.executeCommand(
|
|
587
|
+
}, [I, h, i]), Je = p(() => s.executeCommand(Fe.id), [s]), Qe = p(async () => {
|
|
588
|
+
await s.executeCommand(De.id), ze();
|
|
590
589
|
}, [s]), Xe = p((u) => {
|
|
591
590
|
i.changeFindDirection(u);
|
|
592
591
|
}, [i]), et = p((u) => {
|
|
593
592
|
i.changeFindScope(u);
|
|
594
593
|
}, [i]), tt = p((u) => {
|
|
595
594
|
i.changeFindBy(u);
|
|
596
|
-
}, [i]), it =
|
|
595
|
+
}, [i]), it = Vt(r), nt = Gt(r), rt = Ht(r);
|
|
597
596
|
return A(() => {
|
|
598
597
|
k && f === 0 && a.show({
|
|
599
598
|
content: r.t("find-replace.dialog.no-match"),
|
|
@@ -615,7 +614,7 @@ const kt = W(function(e, n) {
|
|
|
615
614
|
}
|
|
616
615
|
) }),
|
|
617
616
|
/* @__PURE__ */ l(R, { label: r.t("find-replace.dialog.replace"), children: /* @__PURE__ */ l(
|
|
618
|
-
|
|
617
|
+
ve,
|
|
619
618
|
{
|
|
620
619
|
placeholder: r.t("find-replace.dialog.replace-placeholder"),
|
|
621
620
|
value: Ue,
|
|
@@ -623,13 +622,13 @@ const kt = W(function(e, n) {
|
|
|
623
622
|
}
|
|
624
623
|
) }),
|
|
625
624
|
/* @__PURE__ */ l(R, { label: r.t("find-replace.dialog.find-direction.title"), children: /* @__PURE__ */ l(j, { value: ke, options: nt, onChange: Xe }) }),
|
|
626
|
-
/* @__PURE__ */ l(
|
|
625
|
+
/* @__PURE__ */ l(ae, { children: /* @__PURE__ */ y(H, { children: [
|
|
627
626
|
/* @__PURE__ */ l(R, { label: r.t("find-replace.dialog.find-scope.title"), children: /* @__PURE__ */ l(j, { value: je, options: it, onChange: et }) }),
|
|
628
627
|
/* @__PURE__ */ l(R, { label: r.t("find-replace.dialog.find-by.title"), children: /* @__PURE__ */ l(j, { value: Ve, options: rt, onChange: tt }) })
|
|
629
628
|
] }) }),
|
|
630
|
-
/* @__PURE__ */ l(
|
|
629
|
+
/* @__PURE__ */ l(ae, { children: /* @__PURE__ */ y(H, { children: [
|
|
631
630
|
/* @__PURE__ */ l(R, { children: /* @__PURE__ */ l(
|
|
632
|
-
|
|
631
|
+
oe,
|
|
633
632
|
{
|
|
634
633
|
checked: Be,
|
|
635
634
|
onChange: (u) => {
|
|
@@ -639,7 +638,7 @@ const kt = W(function(e, n) {
|
|
|
639
638
|
}
|
|
640
639
|
) }),
|
|
641
640
|
/* @__PURE__ */ l(R, { children: /* @__PURE__ */ l(
|
|
642
|
-
|
|
641
|
+
oe,
|
|
643
642
|
{
|
|
644
643
|
checked: We,
|
|
645
644
|
onChange: (u) => {
|
|
@@ -658,45 +657,45 @@ const kt = W(function(e, n) {
|
|
|
658
657
|
] })
|
|
659
658
|
] });
|
|
660
659
|
});
|
|
661
|
-
function
|
|
660
|
+
function jt() {
|
|
662
661
|
const t = S(g), e = S(me), n = S(X), i = P(t.state$, void 0, !0), r = K(null);
|
|
663
662
|
A(() => {
|
|
664
663
|
let d;
|
|
665
664
|
return r.current && (d = e.registerContainerElement(r.current)), () => d == null ? void 0 : d.dispose();
|
|
666
665
|
}, [e]);
|
|
667
666
|
const s = K(null), a = p(
|
|
668
|
-
(d) => n.setContextValue(
|
|
667
|
+
(d) => n.setContextValue(be, d),
|
|
669
668
|
[n]
|
|
670
669
|
), c = p(
|
|
671
|
-
(d) => n.setContextValue(
|
|
670
|
+
(d) => n.setContextValue(Re, d),
|
|
672
671
|
[n]
|
|
673
672
|
);
|
|
674
673
|
return A(() => {
|
|
675
674
|
var m;
|
|
676
|
-
const d =
|
|
675
|
+
const d = Dt(document, "focusin").subscribe((f) => {
|
|
677
676
|
var M;
|
|
678
677
|
f.target && ((M = r.current) != null && M.contains(f.target)) ? a(!0) : a(!1), !s.current || !s.current.selectHasFocus() ? c(!0) : c(!1);
|
|
679
678
|
});
|
|
680
679
|
return (m = s.current) == null || m.focus(), a(!0), c(!0), () => {
|
|
681
680
|
d.unsubscribe(), a(!1);
|
|
682
681
|
};
|
|
683
|
-
}, [a, c]), /* @__PURE__ */ l("div", { ref: r, "data-u-comp": "find-replace-dialog", children: i.replaceRevealed ? /* @__PURE__ */ l(
|
|
682
|
+
}, [a, c]), /* @__PURE__ */ l("div", { ref: r, "data-u-comp": "find-replace-dialog", children: i.replaceRevealed ? /* @__PURE__ */ l(kt, { ref: s }) : /* @__PURE__ */ l(Wt, { ref: s }) });
|
|
684
683
|
}
|
|
685
|
-
function
|
|
684
|
+
function Vt(t) {
|
|
686
685
|
const e = t.getCurrentLocale();
|
|
687
686
|
return te(() => [
|
|
688
687
|
{ label: t.t("find-replace.dialog.find-scope.current-sheet"), value: Y.SUBUNIT },
|
|
689
688
|
{ label: t.t("find-replace.dialog.find-scope.workbook"), value: Y.UNIT }
|
|
690
689
|
], [e]);
|
|
691
690
|
}
|
|
692
|
-
function
|
|
691
|
+
function Gt(t) {
|
|
693
692
|
const e = t.getCurrentLocale();
|
|
694
693
|
return te(() => [
|
|
695
694
|
{ label: t.t("find-replace.dialog.find-direction.row"), value: Z.ROW },
|
|
696
695
|
{ label: t.t("find-replace.dialog.find-direction.column"), value: Z.COLUMN }
|
|
697
696
|
], [e]);
|
|
698
697
|
}
|
|
699
|
-
function
|
|
698
|
+
function Ht(t) {
|
|
700
699
|
const e = t.getCurrentLocale();
|
|
701
700
|
return te(() => [
|
|
702
701
|
{ label: t.t("find-replace.dialog.find-by.value"), value: z.VALUE },
|
|
@@ -704,13 +703,13 @@ function Kt(t) {
|
|
|
704
703
|
], [e]);
|
|
705
704
|
}
|
|
706
705
|
function D(t) {
|
|
707
|
-
return t.getContextValue(
|
|
706
|
+
return t.getContextValue(be);
|
|
708
707
|
}
|
|
709
|
-
function
|
|
710
|
-
return t.getContextValue(
|
|
708
|
+
function Kt(t) {
|
|
709
|
+
return t.getContextValue(Ie);
|
|
711
710
|
}
|
|
712
711
|
function Le(t) {
|
|
713
|
-
return t.getContextValue(
|
|
712
|
+
return t.getContextValue(Re);
|
|
714
713
|
}
|
|
715
714
|
const E = "7_find-replace-shortcuts";
|
|
716
715
|
function re(t) {
|
|
@@ -719,7 +718,7 @@ function re(t) {
|
|
|
719
718
|
function se(t) {
|
|
720
719
|
return !t.getContextValue(_e);
|
|
721
720
|
}
|
|
722
|
-
const
|
|
721
|
+
const qt = {
|
|
723
722
|
id: O.id,
|
|
724
723
|
description: "find-replace.shortcut.open-find-dialog",
|
|
725
724
|
binding: C.F | F.CTRL_COMMAND,
|
|
@@ -727,7 +726,7 @@ const Zt = {
|
|
|
727
726
|
preconditions(t) {
|
|
728
727
|
return !D(t) && re(t) && se(t);
|
|
729
728
|
}
|
|
730
|
-
},
|
|
729
|
+
}, Zt = {
|
|
731
730
|
id: O.id,
|
|
732
731
|
description: "find-replace.shortcut.open-find-dialog",
|
|
733
732
|
binding: C.F | F.CTRL_COMMAND,
|
|
@@ -735,17 +734,17 @@ const Zt = {
|
|
|
735
734
|
preconditions(t) {
|
|
736
735
|
return !D(t) && re(t) && se(t);
|
|
737
736
|
}
|
|
738
|
-
},
|
|
737
|
+
}, zt = {
|
|
739
738
|
id: ne.id,
|
|
740
739
|
description: "find-replace.shortcut.open-replace-dialog",
|
|
741
740
|
binding: C.H | F.CTRL_COMMAND,
|
|
742
741
|
mac: C.H | F.MAC_CTRL,
|
|
743
742
|
group: E,
|
|
744
743
|
preconditions(t) {
|
|
745
|
-
return re(t) && se(t) && (!D(t) || !
|
|
744
|
+
return re(t) && se(t) && (!D(t) || !Kt(t));
|
|
746
745
|
}
|
|
747
|
-
},
|
|
748
|
-
id:
|
|
746
|
+
}, Yt = {
|
|
747
|
+
id: xe.id,
|
|
749
748
|
description: "find-replace.shortcut.go-to-next-match",
|
|
750
749
|
binding: C.ENTER,
|
|
751
750
|
group: E,
|
|
@@ -753,8 +752,8 @@ const Zt = {
|
|
|
753
752
|
preconditions(t) {
|
|
754
753
|
return Le(t) && D(t);
|
|
755
754
|
}
|
|
756
|
-
},
|
|
757
|
-
id:
|
|
755
|
+
}, Jt = {
|
|
756
|
+
id: Pe.id,
|
|
758
757
|
description: "find-replace.shortcut.go-to-previous-match",
|
|
759
758
|
binding: C.ENTER | F.SHIFT,
|
|
760
759
|
group: E,
|
|
@@ -762,8 +761,8 @@ const Zt = {
|
|
|
762
761
|
preconditions(t) {
|
|
763
762
|
return Le(t) && D(t);
|
|
764
763
|
}
|
|
765
|
-
},
|
|
766
|
-
id:
|
|
764
|
+
}, Qt = {
|
|
765
|
+
id: Te.id,
|
|
767
766
|
description: "find-replace.shortcut.focus-selection",
|
|
768
767
|
binding: C.ESC,
|
|
769
768
|
group: E,
|
|
@@ -772,7 +771,7 @@ const Zt = {
|
|
|
772
771
|
return D(t);
|
|
773
772
|
}
|
|
774
773
|
};
|
|
775
|
-
function
|
|
774
|
+
function Xt(t) {
|
|
776
775
|
const e = t.get(X);
|
|
777
776
|
return {
|
|
778
777
|
id: O.id,
|
|
@@ -780,26 +779,26 @@ function ei(t) {
|
|
|
780
779
|
tooltip: "find-replace.toolbar",
|
|
781
780
|
type: mt.BUTTON,
|
|
782
781
|
hidden$: gt(t, lt.UNIVER_SHEET),
|
|
783
|
-
disabled$:
|
|
782
|
+
disabled$: Se([
|
|
784
783
|
e.subscribeContextValue$(_e),
|
|
785
784
|
e.subscribeContextValue$(pe)
|
|
786
|
-
]).pipe(
|
|
785
|
+
]).pipe(xt(([n, i]) => n || !i))
|
|
787
786
|
};
|
|
788
787
|
}
|
|
789
|
-
const
|
|
788
|
+
const ei = {
|
|
790
789
|
[vt.ORGANIZATION]: {
|
|
791
790
|
[O.id]: {
|
|
792
791
|
order: 2,
|
|
793
|
-
menuItemFactory:
|
|
792
|
+
menuItemFactory: Xt
|
|
794
793
|
}
|
|
795
794
|
}
|
|
796
795
|
};
|
|
797
|
-
var
|
|
798
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
796
|
+
var ti = Object.getOwnPropertyDescriptor, ii = (t, e, n, i) => {
|
|
797
|
+
for (var r = i > 1 ? void 0 : i ? ti(e, n) : e, s = t.length - 1, a; s >= 0; s--)
|
|
799
798
|
(a = t[s]) && (r = a(r) || r);
|
|
800
799
|
return r;
|
|
801
800
|
}, v = (t, e) => (n, i) => e(n, i, t);
|
|
802
|
-
const
|
|
801
|
+
const le = "DESKTOP_FIND_REPLACE_DIALOG", we = 350, ni = 20, ri = 64;
|
|
803
802
|
let w = class extends dt {
|
|
804
803
|
constructor(e, n, i, r, s, a, c, d, m, f) {
|
|
805
804
|
super();
|
|
@@ -814,40 +813,40 @@ let w = class extends dt {
|
|
|
814
813
|
[
|
|
815
814
|
O,
|
|
816
815
|
ne,
|
|
817
|
-
|
|
818
|
-
Ee,
|
|
819
|
-
Te,
|
|
816
|
+
xe,
|
|
820
817
|
Pe,
|
|
821
|
-
|
|
818
|
+
De,
|
|
819
|
+
Fe,
|
|
820
|
+
Te
|
|
822
821
|
].forEach((e) => {
|
|
823
822
|
this.disposeWithMe(this._commandService.registerCommand(e));
|
|
824
823
|
});
|
|
825
824
|
}
|
|
826
825
|
_initShortcuts() {
|
|
827
826
|
[
|
|
828
|
-
Yt,
|
|
829
|
-
Zt,
|
|
830
827
|
zt,
|
|
831
|
-
|
|
828
|
+
qt,
|
|
829
|
+
Zt,
|
|
832
830
|
Jt,
|
|
833
|
-
|
|
831
|
+
Yt,
|
|
832
|
+
Qt
|
|
834
833
|
].forEach((e) => this.disposeWithMe(this._shortcutService.registerShortcut(e)));
|
|
835
834
|
}
|
|
836
835
|
_initUI() {
|
|
837
836
|
[
|
|
838
|
-
["FindReplaceDialog",
|
|
839
|
-
["SearchIcon",
|
|
837
|
+
["FindReplaceDialog", jt],
|
|
838
|
+
["SearchIcon", Ne]
|
|
840
839
|
].forEach(([e, n]) => {
|
|
841
840
|
this.disposeWithMe(
|
|
842
841
|
this._componentManager.register(e, n)
|
|
843
842
|
);
|
|
844
|
-
}), this._menuManagerService.mergeMenu(
|
|
843
|
+
}), this._menuManagerService.mergeMenu(ei), this._findReplaceService.stateUpdates$.pipe(ce(this.dispose$)).subscribe((e) => {
|
|
845
844
|
e.revealed === !0 && this._openPanel();
|
|
846
845
|
});
|
|
847
846
|
}
|
|
848
847
|
_openPanel() {
|
|
849
848
|
this._dialogService.open({
|
|
850
|
-
id:
|
|
849
|
+
id: le,
|
|
851
850
|
draggable: !0,
|
|
852
851
|
width: we,
|
|
853
852
|
title: { title: this._localeService.t("find-replace.dialog.title") },
|
|
@@ -855,18 +854,18 @@ let w = class extends dt {
|
|
|
855
854
|
destroyOnClose: !0,
|
|
856
855
|
mask: !1,
|
|
857
856
|
maskClosable: !1,
|
|
858
|
-
defaultPosition:
|
|
857
|
+
defaultPosition: si(),
|
|
859
858
|
preservePositionOnDestroy: !0,
|
|
860
859
|
onClose: () => this.closePanel()
|
|
861
|
-
}), this._closingListenerDisposable = $(this._univerInstanceService.focused$.pipe(
|
|
860
|
+
}), this._closingListenerDisposable = $(this._univerInstanceService.focused$.pipe(ce(this.dispose$)).subscribe((e) => {
|
|
862
861
|
(!e || !this._univerInstanceService.getUniverSheetInstance(e)) && this.closePanel();
|
|
863
862
|
}));
|
|
864
863
|
}
|
|
865
864
|
closePanel() {
|
|
866
|
-
this._closingListenerDisposable && (this._closingListenerDisposable.dispose(), this._closingListenerDisposable = null, this._dialogService.close(
|
|
865
|
+
this._closingListenerDisposable && (this._closingListenerDisposable.dispose(), this._closingListenerDisposable = null, this._dialogService.close(le), this._findReplaceService.terminate(), queueMicrotask(() => this._layoutService.focus()));
|
|
867
866
|
}
|
|
868
867
|
};
|
|
869
|
-
w =
|
|
868
|
+
w = ii([
|
|
870
869
|
v(0, fe),
|
|
871
870
|
v(1, St),
|
|
872
871
|
v(2, Ct),
|
|
@@ -878,10 +877,11 @@ w = ni([
|
|
|
878
877
|
v(8, x(Rt)),
|
|
879
878
|
v(9, x(Q))
|
|
880
879
|
], w);
|
|
881
|
-
function
|
|
880
|
+
function si() {
|
|
882
881
|
const { innerWidth: t } = window;
|
|
883
|
-
return { x: t - we -
|
|
882
|
+
return { x: t - we - ni, y: ri };
|
|
884
883
|
}
|
|
884
|
+
const ai = "find-replace.config", de = {};
|
|
885
885
|
var oi = Object.getOwnPropertyDescriptor, ci = (t, e, n, i) => {
|
|
886
886
|
for (var r = i > 1 ? void 0 : i ? oi(e, n) : e, s = t.length - 1, a; s >= 0; s--)
|
|
887
887
|
(a = t[s]) && (r = a(r) || r);
|
|
@@ -890,14 +890,14 @@ var oi = Object.getOwnPropertyDescriptor, ci = (t, e, n, i) => {
|
|
|
890
890
|
const li = "UNIVER_FIND_REPLACE_PLUGIN";
|
|
891
891
|
var G;
|
|
892
892
|
let ue = (G = class extends ut {
|
|
893
|
-
constructor(t =
|
|
893
|
+
constructor(t = de, e, n) {
|
|
894
894
|
super(), this._config = t, this._injector = e, this._configService = n;
|
|
895
895
|
const { ...i } = ft(
|
|
896
896
|
{},
|
|
897
|
-
|
|
897
|
+
de,
|
|
898
898
|
this._config
|
|
899
899
|
);
|
|
900
|
-
this._configService.setConfig(
|
|
900
|
+
this._configService.setConfig(ai, i);
|
|
901
901
|
}
|
|
902
902
|
onStarting() {
|
|
903
903
|
[
|
|
@@ -919,15 +919,15 @@ export {
|
|
|
919
919
|
vi as FindModel,
|
|
920
920
|
w as FindReplaceController,
|
|
921
921
|
q as FindReplaceModel,
|
|
922
|
-
|
|
922
|
+
Nt as FindReplaceState,
|
|
923
923
|
Y as FindScope,
|
|
924
|
-
|
|
925
|
-
|
|
924
|
+
xe as GoToNextMatchOperation,
|
|
925
|
+
Pe as GoToPreviousMatchOperation,
|
|
926
926
|
g as IFindReplaceService,
|
|
927
927
|
O as OpenFindDialogOperation,
|
|
928
928
|
ne as OpenReplaceDialogOperation,
|
|
929
|
-
|
|
930
|
-
|
|
929
|
+
De as ReplaceAllMatchesCommand,
|
|
930
|
+
Fe as ReplaceCurrentMatchCommand,
|
|
931
931
|
ue as UniverFindReplacePlugin,
|
|
932
932
|
ie as createInitFindReplaceState
|
|
933
933
|
};
|