@univerjs/find-replace 0.6.6 → 0.6.7
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 +4 -1
- package/lib/es/index.js +269 -264
- package/lib/index.css +1 -1
- package/lib/types/views/dialog/FindReplaceDialog.d.ts +17 -3
- package/lib/umd/index.js +4 -1
- package/package.json +9 -10
package/lib/es/index.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var o = (t, e, n) =>
|
|
4
|
-
import { createIdentifier as
|
|
5
|
-
import { IConfirmService as
|
|
6
|
-
import { throttleTime as Mt, BehaviorSubject as P, combineLatest as
|
|
7
|
-
import { MessageType as N, InputWithSlot as
|
|
8
|
-
import { RENDER_RAW_FORMULA_KEY as
|
|
9
|
-
import { jsx as l, jsxs as I, Fragment as
|
|
10
|
-
import { forwardRef as
|
|
11
|
-
const
|
|
12
|
-
var
|
|
13
|
-
return
|
|
1
|
+
var rt = Object.defineProperty;
|
|
2
|
+
var st = (t, e, n) => e in t ? rt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
|
+
var o = (t, e, n) => st(t, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
+
import { createIdentifier as at, Inject as D, Injector as Q, IContextService as X, Disposable as ee, DisposableCollection as ot, toDisposable as A, IUniverInstanceService as fe, ICommandService as W, CommandType as b, LocaleService as B, FOCUSING_SHEET as pe, EDITOR_ACTIVATED as _e, UniverInstanceType as ct, RxDisposable as lt, IConfigService as dt, Plugin as ht, merge as ut } from "@univerjs/core";
|
|
5
|
+
import { IConfirmService as ft, IMessageService as ge, useDependency as v, useObservable as x, ILayoutService as me, KeyCode as C, MetaKeys as y, getMenuHiddenObservable as pt, MenuItemType as _t, RibbonStartGroup as gt, IMenuManagerService as mt, IShortcutService as vt, IDialogService as St, ComponentManager as Ct } from "@univerjs/ui";
|
|
6
|
+
import { throttleTime as Mt, BehaviorSubject as P, combineLatest as ve, debounceTime as Rt, Subject as Se, fromEvent as bt, map as It, takeUntil as ae } from "rxjs";
|
|
7
|
+
import { MessageType as N, InputWithSlot as yt, Pager as Ft, FormLayout as R, Input as Dt, Select as V, FormDualColumnLayout as oe, Checkbox as ce, Button as G } from "@univerjs/design";
|
|
8
|
+
import { RENDER_RAW_FORMULA_KEY as xt } from "@univerjs/engine-render";
|
|
9
|
+
import { jsx as l, jsxs as I, Fragment as $ } from "react/jsx-runtime";
|
|
10
|
+
import { forwardRef as j, useRef as K, createElement as Ce, useCallback as u, useEffect as L, useMemo as te, useImperativeHandle as Pt } from "react";
|
|
11
|
+
const Tt = "find-replace.config", le = {};
|
|
12
|
+
var _ = function() {
|
|
13
|
+
return _ = Object.assign || function(t) {
|
|
14
14
|
for (var e, n = 1, i = arguments.length; n < i; n++) {
|
|
15
15
|
e = arguments[n];
|
|
16
16
|
for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
|
|
17
17
|
}
|
|
18
18
|
return t;
|
|
19
|
-
},
|
|
19
|
+
}, _.apply(this, arguments);
|
|
20
20
|
}, Ot = function(t, e) {
|
|
21
21
|
var n = {};
|
|
22
22
|
for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && e.indexOf(i) < 0 && (n[i] = t[i]);
|
|
@@ -24,17 +24,17 @@ var g = function() {
|
|
|
24
24
|
for (var r = 0, i = Object.getOwnPropertySymbols(t); r < i.length; r++)
|
|
25
25
|
e.indexOf(i[r]) < 0 && Object.prototype.propertyIsEnumerable.call(t, i[r]) && (n[i[r]] = t[i[r]]);
|
|
26
26
|
return n;
|
|
27
|
-
}, Me =
|
|
28
|
-
var n = t.icon, i = t.id, r = t.className, s = t.extend, a = Ot(t, ["icon", "id", "className", "extend"]), c = "univerjs-icon univerjs-icon-".concat(i, " ").concat(r || "").trim(), d =
|
|
29
|
-
return
|
|
27
|
+
}, Me = j(function(t, e) {
|
|
28
|
+
var n = t.icon, i = t.id, r = t.className, s = t.extend, a = Ot(t, ["icon", "id", "className", "extend"]), c = "univerjs-icon univerjs-icon-".concat(i, " ").concat(r || "").trim(), d = K("_".concat($t()));
|
|
29
|
+
return Re(n, "".concat(i), { defIds: n.defIds, idSuffix: d.current }, _({ ref: e, className: c }, a), s);
|
|
30
30
|
});
|
|
31
|
-
function
|
|
32
|
-
return
|
|
33
|
-
return
|
|
31
|
+
function Re(t, e, n, i, r) {
|
|
32
|
+
return Ce(t.tag, _(_({ key: e }, Et(t, n, r)), i), (Nt(t, n).children || []).map(function(s, a) {
|
|
33
|
+
return Re(s, "".concat(e, "-").concat(t.tag, "-").concat(a), n, void 0, r);
|
|
34
34
|
}));
|
|
35
35
|
}
|
|
36
|
-
function
|
|
37
|
-
var i =
|
|
36
|
+
function Et(t, e, n) {
|
|
37
|
+
var i = _({}, t.attrs);
|
|
38
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
39
|
var a = s[0], c = s[1];
|
|
40
40
|
a === "mask" && typeof c == "string" && (i[a] = c.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
|
|
@@ -45,37 +45,37 @@ function Nt(t, e, n) {
|
|
|
45
45
|
typeof c == "string" && (i[a] = c.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
|
|
46
46
|
})), i;
|
|
47
47
|
}
|
|
48
|
-
function
|
|
48
|
+
function Nt(t, e) {
|
|
49
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) ?
|
|
51
|
-
return typeof r.attrs.id == "string" && i && i.indexOf(r.attrs.id) > -1 ?
|
|
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.indexOf(r.attrs.id) > -1 ? _(_({}, r), { attrs: _(_({}, r.attrs), { id: r.attrs.id + e.idSuffix }) }) : r;
|
|
52
52
|
}) }) : t;
|
|
53
53
|
}
|
|
54
|
-
function
|
|
54
|
+
function $t() {
|
|
55
55
|
return Math.random().toString(36).substring(2, 8);
|
|
56
56
|
}
|
|
57
57
|
Me.displayName = "UniverIcon";
|
|
58
|
-
var
|
|
59
|
-
return
|
|
58
|
+
var At = { tag: "svg", attrs: { 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" } }] }, be = j(function(t, e) {
|
|
59
|
+
return Ce(Me, Object.assign({}, t, {
|
|
60
60
|
id: "search-single",
|
|
61
61
|
ref: e,
|
|
62
|
-
icon:
|
|
62
|
+
icon: At
|
|
63
63
|
}));
|
|
64
64
|
});
|
|
65
|
-
|
|
66
|
-
const
|
|
67
|
-
var
|
|
68
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
65
|
+
be.displayName = "SearchSingle";
|
|
66
|
+
const Ie = "FIND_REPLACE_INPUT_FOCUS", ye = "FIND_REPLACE_DIALOG_FOCUS", Fe = "FIND_REPLACE_REPLACE_REVEALED";
|
|
67
|
+
var Lt = Object.getOwnPropertyDescriptor, De = (t, e, n, i) => {
|
|
68
|
+
for (var r = i > 1 ? void 0 : i ? Lt(e, n) : e, s = t.length - 1, a; s >= 0; s--)
|
|
69
69
|
(a = t[s]) && (r = a(r) || r);
|
|
70
70
|
return r;
|
|
71
|
-
},
|
|
72
|
-
class
|
|
71
|
+
}, w = (t, e) => (n, i) => e(n, i, t);
|
|
72
|
+
class mi extends ee {
|
|
73
73
|
}
|
|
74
|
-
const
|
|
75
|
-
function
|
|
74
|
+
const g = at("find-replace.service");
|
|
75
|
+
function wt(t) {
|
|
76
76
|
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
77
|
}
|
|
78
|
-
let
|
|
78
|
+
let q = class extends ee {
|
|
79
79
|
constructor(e, n, i, r) {
|
|
80
80
|
super();
|
|
81
81
|
o(this, "currentMatch$", new P(null));
|
|
@@ -89,7 +89,7 @@ let z = class extends te {
|
|
|
89
89
|
this._state = e, this._providers = n, this._univerInstanceService = i, this._commandService = r, this.disposeWithMe(
|
|
90
90
|
this._state.stateUpdates$.pipe(Mt(200, void 0, { leading: !0, trailing: !0 })).subscribe(async (s) => {
|
|
91
91
|
const a = this._state.state;
|
|
92
|
-
|
|
92
|
+
wt(s) && (a.findString !== "" && !a.replaceRevealed ? (await this._startSearching(), this._state.changeState({ findCompleted: !0 })) : s.replaceRevealed !== !0 && this._stopSearching());
|
|
93
93
|
})
|
|
94
94
|
);
|
|
95
95
|
}
|
|
@@ -97,7 +97,7 @@ let z = class extends te {
|
|
|
97
97
|
return this._findModels.length > 0;
|
|
98
98
|
}
|
|
99
99
|
dispose() {
|
|
100
|
-
super.dispose(), this._stopSearching(), this.currentMatch$.complete(), this.replaceables$.complete(), this._state.changeState({ ...
|
|
100
|
+
super.dispose(), this._stopSearching(), this.currentMatch$.complete(), this.replaceables$.complete(), this._state.changeState({ ...ie(), revealed: !1 });
|
|
101
101
|
}
|
|
102
102
|
async start() {
|
|
103
103
|
if (!this._state.findString)
|
|
@@ -137,14 +137,14 @@ let z = class extends te {
|
|
|
137
137
|
}
|
|
138
138
|
// When a document's content changes, we should reset all matches and try to move to the next match.
|
|
139
139
|
_subscribeToModelsChanges(e) {
|
|
140
|
-
const n = this._currentSearchingDisposables = new
|
|
140
|
+
const n = this._currentSearchingDisposables = new ot(), i = ve(e.map((r) => r.matchesUpdate$)).pipe(Rt(220)).subscribe(([...r]) => {
|
|
141
141
|
const s = this._matches = r.flat();
|
|
142
142
|
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
143
|
});
|
|
144
|
-
e.forEach((r) => n.add(
|
|
144
|
+
e.forEach((r) => n.add(A(r.activelyChangingMatch$.subscribe((s) => {
|
|
145
145
|
const a = this._matches.findIndex((c) => c === s);
|
|
146
146
|
this._state.changeState({ matchesPosition: a + 1 });
|
|
147
|
-
})))), n.add(
|
|
147
|
+
})))), n.add(A(i));
|
|
148
148
|
}
|
|
149
149
|
async replace() {
|
|
150
150
|
return this._matchingModel ? this._matchingModel.replace(this._state.replaceString) : !1;
|
|
@@ -218,12 +218,12 @@ let z = class extends te {
|
|
|
218
218
|
return this._moveToNextUnitMatch(r), 0;
|
|
219
219
|
}
|
|
220
220
|
};
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
],
|
|
225
|
-
var
|
|
226
|
-
function
|
|
221
|
+
q = De([
|
|
222
|
+
w(2, fe),
|
|
223
|
+
w(3, W)
|
|
224
|
+
], q);
|
|
225
|
+
var z = /* @__PURE__ */ ((t) => (t.ROW = "row", t.COLUMN = "column", t))(z || {}), Y = /* @__PURE__ */ ((t) => (t.VALUE = "value", t.FORMULA = "formula", t))(Y || {}), Z = /* @__PURE__ */ ((t) => (t.SUBUNIT = "subunit", t.UNIT = "unit", t))(Z || {});
|
|
226
|
+
function ie() {
|
|
227
227
|
return {
|
|
228
228
|
caseSensitive: !1,
|
|
229
229
|
findBy: "value",
|
|
@@ -240,11 +240,11 @@ function ne() {
|
|
|
240
240
|
revealed: !0
|
|
241
241
|
};
|
|
242
242
|
}
|
|
243
|
-
class
|
|
243
|
+
class Ut {
|
|
244
244
|
constructor() {
|
|
245
|
-
o(this, "_stateUpdates$", new
|
|
245
|
+
o(this, "_stateUpdates$", new Se());
|
|
246
246
|
o(this, "stateUpdates$", this._stateUpdates$.asObservable());
|
|
247
|
-
o(this, "_state$", new P(
|
|
247
|
+
o(this, "_state$", new P(ie()));
|
|
248
248
|
o(this, "state$", this._state$.asObservable());
|
|
249
249
|
o(this, "_findString", "");
|
|
250
250
|
o(this, "_inputtingFindString", "");
|
|
@@ -322,17 +322,17 @@ class Bt {
|
|
|
322
322
|
}), this._stateUpdates$.next(i));
|
|
323
323
|
}
|
|
324
324
|
}
|
|
325
|
-
let
|
|
325
|
+
let J = class extends ee {
|
|
326
326
|
constructor(e, n) {
|
|
327
327
|
super();
|
|
328
328
|
o(this, "_providers", /* @__PURE__ */ new Set());
|
|
329
|
-
o(this, "_state", new
|
|
329
|
+
o(this, "_state", new Ut());
|
|
330
330
|
o(this, "_model");
|
|
331
331
|
o(this, "_currentMatch$", new P(null));
|
|
332
332
|
o(this, "currentMatch$", this._currentMatch$.asObservable());
|
|
333
333
|
o(this, "_replaceables$", new P([]));
|
|
334
334
|
o(this, "replaceables$", this._replaceables$.asObservable());
|
|
335
|
-
o(this, "_focusSignal$", new
|
|
335
|
+
o(this, "_focusSignal$", new Se());
|
|
336
336
|
o(this, "focusSignal$", this._focusSignal$.asObservable());
|
|
337
337
|
this._injector = e, this._contextService = n;
|
|
338
338
|
}
|
|
@@ -415,8 +415,8 @@ let Q = class extends te {
|
|
|
415
415
|
start(e = !1) {
|
|
416
416
|
if (this._providers.size === 0)
|
|
417
417
|
return !1;
|
|
418
|
-
this._model = this._injector.createInstance(
|
|
419
|
-
const n =
|
|
418
|
+
this._model = this._injector.createInstance(q, this._state, this._providers), this._model.currentMatch$.subscribe((i) => this._currentMatch$.next(i)), this._model.replaceables$.subscribe((i) => this._replaceables$.next(i));
|
|
419
|
+
const n = ie();
|
|
420
420
|
return e && (n.replaceRevealed = !0), this._state.changeState(n), this._toggleRevealReplace(e), !0;
|
|
421
421
|
}
|
|
422
422
|
find() {
|
|
@@ -428,28 +428,28 @@ let Q = class extends te {
|
|
|
428
428
|
(e = this._model) == null || e.dispose(), this._model = null, this._toggleDisplayRawFormula(!1), this._toggleRevealReplace(!1);
|
|
429
429
|
}
|
|
430
430
|
registerFindReplaceProvider(e) {
|
|
431
|
-
return this._providers.add(e),
|
|
431
|
+
return this._providers.add(e), A(() => this._providers.delete(e));
|
|
432
432
|
}
|
|
433
433
|
_toggleRevealReplace(e) {
|
|
434
|
-
this._contextService.setContextValue(
|
|
434
|
+
this._contextService.setContextValue(Fe, e);
|
|
435
435
|
}
|
|
436
436
|
_toggleDisplayRawFormula(e) {
|
|
437
|
-
this._contextService.setContextValue(
|
|
437
|
+
this._contextService.setContextValue(xt, e);
|
|
438
438
|
}
|
|
439
439
|
};
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
],
|
|
444
|
-
const
|
|
440
|
+
J = De([
|
|
441
|
+
w(0, D(Q)),
|
|
442
|
+
w(1, X)
|
|
443
|
+
], J);
|
|
444
|
+
const xe = {
|
|
445
445
|
id: "ui.command.replace-current-match",
|
|
446
446
|
type: b.COMMAND,
|
|
447
|
-
handler: (t) => t.get(
|
|
448
|
-
}, Wt = "CONFIRM_REPLACE_ALL",
|
|
447
|
+
handler: (t) => t.get(g).replace()
|
|
448
|
+
}, Wt = "CONFIRM_REPLACE_ALL", Pe = {
|
|
449
449
|
id: "ui.command.replace-all-matches",
|
|
450
450
|
type: b.COMMAND,
|
|
451
451
|
handler: async (t) => {
|
|
452
|
-
const e = t.get(
|
|
452
|
+
const e = t.get(ft), n = t.get(B), i = t.get(ge);
|
|
453
453
|
if (!await e.confirm({
|
|
454
454
|
id: Wt,
|
|
455
455
|
title: { title: n.t("find-replace.replace.confirm.title") },
|
|
@@ -457,7 +457,7 @@ const Pe = {
|
|
|
457
457
|
confirmText: n.t("button.confirm")
|
|
458
458
|
}))
|
|
459
459
|
return !1;
|
|
460
|
-
const s = await t.get(
|
|
460
|
+
const s = await t.get(g).replaceAll(), { success: a, failure: c } = s;
|
|
461
461
|
return c > 0 ? (a === 0 ? i.show({
|
|
462
462
|
type: N.Error,
|
|
463
463
|
content: n.t("find-replace.replace.all-failure")
|
|
@@ -473,43 +473,38 @@ const Pe = {
|
|
|
473
473
|
id: "ui.operation.open-find-dialog",
|
|
474
474
|
type: b.OPERATION,
|
|
475
475
|
handler: (t) => {
|
|
476
|
-
const e = t.get(
|
|
476
|
+
const e = t.get(g);
|
|
477
477
|
return e.revealed ? e.focusFindInput() : e.start(), !0;
|
|
478
478
|
}
|
|
479
|
-
},
|
|
479
|
+
}, ne = {
|
|
480
480
|
id: "ui.operation.open-replace-dialog",
|
|
481
481
|
type: b.OPERATION,
|
|
482
482
|
handler: (t) => {
|
|
483
|
-
const e = t.get(
|
|
483
|
+
const e = t.get(g);
|
|
484
484
|
return e.revealed ? e.replaceRevealed ? e.focusFindInput() : e.revealReplace() : e.start(!0), !0;
|
|
485
485
|
}
|
|
486
|
-
},
|
|
486
|
+
}, Te = {
|
|
487
487
|
type: b.OPERATION,
|
|
488
488
|
id: "ui.operation.go-to-next-match",
|
|
489
|
-
handler: (t) => (t.get(
|
|
489
|
+
handler: (t) => (t.get(g).moveToNextMatch(), !0)
|
|
490
490
|
}, Oe = {
|
|
491
491
|
type: b.OPERATION,
|
|
492
492
|
id: "ui.operation.go-to-previous-match",
|
|
493
|
-
handler: (t) => (t.get(
|
|
494
|
-
},
|
|
493
|
+
handler: (t) => (t.get(g).moveToPreviousMatch(), !0)
|
|
494
|
+
}, Ee = {
|
|
495
495
|
type: b.OPERATION,
|
|
496
496
|
id: "ui.operation.focus-selection",
|
|
497
|
-
handler: (t) => (t.get(
|
|
498
|
-
}, kt = "univer-find-replace-dialog-container", jt = "univer-find-replace-expand-container", Gt = "univer-find-replace-buttons-group", Vt = "univer-find-replace-buttons-group-right", B = {
|
|
499
|
-
findReplaceDialogContainer: kt,
|
|
500
|
-
findReplaceExpandContainer: jt,
|
|
501
|
-
findReplaceButtonsGroup: Gt,
|
|
502
|
-
findReplaceButtonsGroupRight: Vt
|
|
497
|
+
handler: (t) => (t.get(g).focusSelection(), !0)
|
|
503
498
|
};
|
|
504
|
-
function
|
|
499
|
+
function Ne(t) {
|
|
505
500
|
const { findCompleted: e, localeService: n, matchesCount: i, matchesPosition: r, findString: s, findReplaceService: a, onChange: c, ...d } = t, f = e && i === 0 ? n.t("find-replace.dialog.no-result") : i === 0 ? " " : void 0;
|
|
506
501
|
return /* @__PURE__ */ l(
|
|
507
|
-
|
|
502
|
+
yt,
|
|
508
503
|
{
|
|
509
504
|
autoFocus: !0,
|
|
510
505
|
placeholder: n.t("find-replace.dialog.find-placeholder"),
|
|
511
506
|
slot: /* @__PURE__ */ l(
|
|
512
|
-
|
|
507
|
+
Ft,
|
|
513
508
|
{
|
|
514
509
|
loop: !0,
|
|
515
510
|
text: f,
|
|
@@ -526,7 +521,7 @@ function $e(t) {
|
|
|
526
521
|
}
|
|
527
522
|
);
|
|
528
523
|
}
|
|
529
|
-
function
|
|
524
|
+
function $e(t, e) {
|
|
530
525
|
const n = u(() => {
|
|
531
526
|
var r;
|
|
532
527
|
(r = document.querySelector(".univer-find-input input")) == null || r.focus();
|
|
@@ -534,18 +529,18 @@ function Ae(t, e) {
|
|
|
534
529
|
const r = document.querySelectorAll(".univer-find-replace-dialog-container .univer-select-selection-search-input");
|
|
535
530
|
return Array.from(r).some((s) => s === document.activeElement);
|
|
536
531
|
}, []);
|
|
537
|
-
return
|
|
532
|
+
return Pt(e, () => ({ focus: n, selectHasFocus: i })), L(() => {
|
|
538
533
|
const r = t.focusSignal$.subscribe(() => n());
|
|
539
534
|
return () => r.unsubscribe();
|
|
540
535
|
}, [t, n]), { focus: n, selectHasFocus: i };
|
|
541
536
|
}
|
|
542
|
-
const
|
|
543
|
-
const i = v(
|
|
544
|
-
s.executeCommand(
|
|
545
|
-
}, [s]),
|
|
546
|
-
return
|
|
537
|
+
const Bt = j(function(e, n) {
|
|
538
|
+
const i = v(B), r = v(g), s = v(W), a = x(r.state$, void 0, !0), { findCompleted: c, findString: d, matchesCount: S, matchesPosition: f } = a, p = u(() => {
|
|
539
|
+
s.executeCommand(ne.id);
|
|
540
|
+
}, [s]), E = u((M) => r.changeFindString(M), [r]);
|
|
541
|
+
return $e(r, n), /* @__PURE__ */ I($, { children: [
|
|
547
542
|
/* @__PURE__ */ l(
|
|
548
|
-
|
|
543
|
+
Ne,
|
|
549
544
|
{
|
|
550
545
|
findCompleted: c,
|
|
551
546
|
className: "univer-find-input",
|
|
@@ -554,87 +549,97 @@ const Ht = G(function(e, n) {
|
|
|
554
549
|
findReplaceService: r,
|
|
555
550
|
localeService: i,
|
|
556
551
|
findString: d,
|
|
557
|
-
onChange:
|
|
552
|
+
onChange: E
|
|
558
553
|
}
|
|
559
554
|
),
|
|
560
|
-
/* @__PURE__ */ l("div", { className:
|
|
555
|
+
/* @__PURE__ */ l("div", { className: "univer-mt-4 univer-text-center", children: /* @__PURE__ */ l(
|
|
556
|
+
"a",
|
|
557
|
+
{
|
|
558
|
+
className: `
|
|
559
|
+
univer-cursor-pointer univer-text-sm univer-text-primary-500 univer-transition-colors
|
|
560
|
+
hover:univer-text-primary-500/80
|
|
561
|
+
`,
|
|
562
|
+
onClick: p,
|
|
563
|
+
children: i.t("find-replace.dialog.advanced-finding")
|
|
564
|
+
}
|
|
565
|
+
) })
|
|
561
566
|
] });
|
|
562
|
-
}),
|
|
563
|
-
const i = v(
|
|
567
|
+
}), jt = j(function(e, n) {
|
|
568
|
+
const i = v(g), r = v(B), s = v(W), a = v(ge), c = x(i.currentMatch$, void 0, !0), d = x(i.replaceables$, void 0, !0), S = x(i.state$, void 0, !0), {
|
|
564
569
|
matchesCount: f,
|
|
565
570
|
matchesPosition: p,
|
|
566
|
-
findString:
|
|
567
|
-
inputtingFindString:
|
|
568
|
-
replaceString:
|
|
569
|
-
caseSensitive:
|
|
571
|
+
findString: E,
|
|
572
|
+
inputtingFindString: M,
|
|
573
|
+
replaceString: we,
|
|
574
|
+
caseSensitive: Ue,
|
|
570
575
|
matchesTheWholeCell: We,
|
|
571
|
-
findDirection:
|
|
576
|
+
findDirection: Be,
|
|
572
577
|
findScope: je,
|
|
573
|
-
findBy:
|
|
574
|
-
findCompleted:
|
|
575
|
-
} = S, Ve =
|
|
578
|
+
findBy: ke,
|
|
579
|
+
findCompleted: k
|
|
580
|
+
} = S, Ve = M.length === 0, Ge = f === 0 || !(c != null && c.replaceable), He = d.length === 0, Ke = u(
|
|
576
581
|
(h) => i.changeInputtingFindString(h),
|
|
577
582
|
[i]
|
|
578
|
-
),
|
|
583
|
+
), qe = u(
|
|
579
584
|
(h) => i.changeReplaceString(h),
|
|
580
585
|
[i]
|
|
581
|
-
), { focus:
|
|
582
|
-
|
|
583
|
-
}, [
|
|
584
|
-
await s.executeCommand(
|
|
585
|
-
}, [s]),
|
|
586
|
+
), { focus: ze } = $e(i, n), Ye = u(() => {
|
|
587
|
+
E === M ? i.moveToNextMatch() : (i.changeFindString(M), i.find());
|
|
588
|
+
}, [E, M, i]), Ze = u(() => s.executeCommand(xe.id), [s]), Je = u(async () => {
|
|
589
|
+
await s.executeCommand(Pe.id), ze();
|
|
590
|
+
}, [s]), Qe = u((h) => {
|
|
586
591
|
i.changeFindDirection(h);
|
|
587
|
-
}, [i]),
|
|
592
|
+
}, [i]), Xe = u((h) => {
|
|
588
593
|
i.changeFindScope(h);
|
|
589
|
-
}, [i]),
|
|
594
|
+
}, [i]), et = u((h) => {
|
|
590
595
|
i.changeFindBy(h);
|
|
591
|
-
}, [i]),
|
|
592
|
-
return
|
|
593
|
-
|
|
596
|
+
}, [i]), tt = Vt(r), it = Gt(r), nt = Ht(r);
|
|
597
|
+
return L(() => {
|
|
598
|
+
k && f === 0 && a.show({
|
|
594
599
|
content: r.t("find-replace.dialog.no-match"),
|
|
595
600
|
type: N.Warning,
|
|
596
601
|
duration: 5e3
|
|
597
602
|
});
|
|
598
|
-
}, [
|
|
599
|
-
/* @__PURE__ */ l(
|
|
600
|
-
|
|
603
|
+
}, [k, f, a, r]), /* @__PURE__ */ I($, { children: [
|
|
604
|
+
/* @__PURE__ */ l(R, { label: r.t("find-replace.dialog.find"), children: /* @__PURE__ */ l(
|
|
605
|
+
Ne,
|
|
601
606
|
{
|
|
602
|
-
findCompleted:
|
|
607
|
+
findCompleted: k,
|
|
603
608
|
className: "univer-find-input",
|
|
604
609
|
matchesCount: f,
|
|
605
610
|
matchesPosition: p,
|
|
606
611
|
findReplaceService: i,
|
|
607
612
|
localeService: r,
|
|
608
|
-
findString:
|
|
609
|
-
onChange:
|
|
613
|
+
findString: M,
|
|
614
|
+
onChange: Ke
|
|
610
615
|
}
|
|
611
616
|
) }),
|
|
612
|
-
/* @__PURE__ */ l(
|
|
613
|
-
|
|
617
|
+
/* @__PURE__ */ l(R, { label: r.t("find-replace.dialog.replace"), children: /* @__PURE__ */ l(
|
|
618
|
+
Dt,
|
|
614
619
|
{
|
|
615
620
|
placeholder: r.t("find-replace.dialog.replace-placeholder"),
|
|
616
|
-
value:
|
|
617
|
-
onChange: (h) =>
|
|
621
|
+
value: we,
|
|
622
|
+
onChange: (h) => qe(h)
|
|
618
623
|
}
|
|
619
624
|
) }),
|
|
620
|
-
/* @__PURE__ */ l(
|
|
621
|
-
/* @__PURE__ */ l(
|
|
622
|
-
/* @__PURE__ */ l(
|
|
623
|
-
/* @__PURE__ */ l(
|
|
625
|
+
/* @__PURE__ */ l(R, { label: r.t("find-replace.dialog.find-direction.title"), children: /* @__PURE__ */ l(V, { value: Be, options: it, onChange: Qe }) }),
|
|
626
|
+
/* @__PURE__ */ l(oe, { children: /* @__PURE__ */ I($, { children: [
|
|
627
|
+
/* @__PURE__ */ l(R, { label: r.t("find-replace.dialog.find-scope.title"), children: /* @__PURE__ */ l(V, { value: je, options: tt, onChange: Xe }) }),
|
|
628
|
+
/* @__PURE__ */ l(R, { label: r.t("find-replace.dialog.find-by.title"), children: /* @__PURE__ */ l(V, { value: ke, options: nt, onChange: et }) })
|
|
624
629
|
] }) }),
|
|
625
|
-
/* @__PURE__ */ l(
|
|
626
|
-
/* @__PURE__ */ l(
|
|
627
|
-
|
|
630
|
+
/* @__PURE__ */ l(oe, { children: /* @__PURE__ */ I($, { children: [
|
|
631
|
+
/* @__PURE__ */ l(R, { children: /* @__PURE__ */ l(
|
|
632
|
+
ce,
|
|
628
633
|
{
|
|
629
|
-
checked:
|
|
634
|
+
checked: Ue,
|
|
630
635
|
onChange: (h) => {
|
|
631
636
|
i.changeCaseSensitive(h);
|
|
632
637
|
},
|
|
633
638
|
children: r.t("find-replace.dialog.case-sensitive")
|
|
634
639
|
}
|
|
635
640
|
) }),
|
|
636
|
-
/* @__PURE__ */ l(
|
|
637
|
-
|
|
641
|
+
/* @__PURE__ */ l(R, { children: /* @__PURE__ */ l(
|
|
642
|
+
ce,
|
|
638
643
|
{
|
|
639
644
|
checked: We,
|
|
640
645
|
onChange: (h) => {
|
|
@@ -644,158 +649,158 @@ const Ht = G(function(e, n) {
|
|
|
644
649
|
}
|
|
645
650
|
) })
|
|
646
651
|
] }) }),
|
|
647
|
-
/* @__PURE__ */ I("div", { className:
|
|
648
|
-
/* @__PURE__ */ l(
|
|
649
|
-
/* @__PURE__ */ I("span", { className:
|
|
650
|
-
/* @__PURE__ */ l(
|
|
651
|
-
/* @__PURE__ */ l(
|
|
652
|
+
/* @__PURE__ */ I("div", { className: "univer-mt-6 univer-flex univer-justify-between", children: [
|
|
653
|
+
/* @__PURE__ */ l(G, { type: "primary", onClick: Ye, disabled: Ve, children: r.t("find-replace.dialog.find") }),
|
|
654
|
+
/* @__PURE__ */ I("span", { className: "univer-inline-flex univer-gap-2", children: [
|
|
655
|
+
/* @__PURE__ */ l(G, { disabled: Ge, onClick: Ze, children: r.t("find-replace.dialog.replace") }),
|
|
656
|
+
/* @__PURE__ */ l(G, { disabled: He, onClick: Je, children: r.t("find-replace.dialog.replace-all") })
|
|
652
657
|
] })
|
|
653
658
|
] })
|
|
654
659
|
] });
|
|
655
660
|
});
|
|
656
|
-
function
|
|
657
|
-
const t = v(
|
|
658
|
-
|
|
661
|
+
function kt() {
|
|
662
|
+
const t = v(g), e = v(me), n = v(X), i = x(t.state$, void 0, !0), r = K(null);
|
|
663
|
+
L(() => {
|
|
659
664
|
let d;
|
|
660
665
|
return r.current && (d = e.registerContainerElement(r.current)), () => d == null ? void 0 : d.dispose();
|
|
661
666
|
}, [e]);
|
|
662
|
-
const s =
|
|
663
|
-
(d) => n.setContextValue(
|
|
667
|
+
const s = K(null), a = u(
|
|
668
|
+
(d) => n.setContextValue(ye, d),
|
|
664
669
|
[n]
|
|
665
670
|
), c = u(
|
|
666
|
-
(d) => n.setContextValue(
|
|
671
|
+
(d) => n.setContextValue(Ie, d),
|
|
667
672
|
[n]
|
|
668
673
|
);
|
|
669
|
-
return
|
|
674
|
+
return L(() => {
|
|
670
675
|
var S;
|
|
671
|
-
const d =
|
|
676
|
+
const d = bt(document, "focusin").subscribe((f) => {
|
|
672
677
|
var p;
|
|
673
678
|
f.target && ((p = r.current) != null && p.contains(f.target)) ? a(!0) : a(!1), !s.current || !s.current.selectHasFocus() ? c(!0) : c(!1);
|
|
674
679
|
});
|
|
675
680
|
return (S = s.current) == null || S.focus(), a(!0), c(!0), () => {
|
|
676
681
|
d.unsubscribe(), a(!1);
|
|
677
682
|
};
|
|
678
|
-
}, [a, c]), /* @__PURE__ */ l("div", {
|
|
683
|
+
}, [a, c]), /* @__PURE__ */ l("div", { ref: r, children: i.replaceRevealed ? /* @__PURE__ */ l(jt, { ref: s }) : /* @__PURE__ */ l(Bt, { ref: s }) });
|
|
679
684
|
}
|
|
680
|
-
function
|
|
685
|
+
function Vt(t) {
|
|
681
686
|
const e = t.getCurrentLocale();
|
|
682
|
-
return
|
|
683
|
-
{ label: t.t("find-replace.dialog.find-scope.current-sheet"), value:
|
|
684
|
-
{ label: t.t("find-replace.dialog.find-scope.workbook"), value:
|
|
687
|
+
return te(() => [
|
|
688
|
+
{ label: t.t("find-replace.dialog.find-scope.current-sheet"), value: Z.SUBUNIT },
|
|
689
|
+
{ label: t.t("find-replace.dialog.find-scope.workbook"), value: Z.UNIT }
|
|
685
690
|
], [e]);
|
|
686
691
|
}
|
|
687
|
-
function
|
|
692
|
+
function Gt(t) {
|
|
688
693
|
const e = t.getCurrentLocale();
|
|
689
|
-
return
|
|
690
|
-
{ label: t.t("find-replace.dialog.find-direction.row"), value:
|
|
691
|
-
{ label: t.t("find-replace.dialog.find-direction.column"), value:
|
|
694
|
+
return te(() => [
|
|
695
|
+
{ label: t.t("find-replace.dialog.find-direction.row"), value: z.ROW },
|
|
696
|
+
{ label: t.t("find-replace.dialog.find-direction.column"), value: z.COLUMN }
|
|
692
697
|
], [e]);
|
|
693
698
|
}
|
|
694
|
-
function
|
|
699
|
+
function Ht(t) {
|
|
695
700
|
const e = t.getCurrentLocale();
|
|
696
|
-
return
|
|
697
|
-
{ label: t.t("find-replace.dialog.find-by.value"), value:
|
|
698
|
-
{ label: t.t("find-replace.dialog.find-by.formula"), value:
|
|
701
|
+
return te(() => [
|
|
702
|
+
{ label: t.t("find-replace.dialog.find-by.value"), value: Y.VALUE },
|
|
703
|
+
{ label: t.t("find-replace.dialog.find-by.formula"), value: Y.FORMULA }
|
|
699
704
|
], [e]);
|
|
700
705
|
}
|
|
701
706
|
function F(t) {
|
|
707
|
+
return t.getContextValue(ye);
|
|
708
|
+
}
|
|
709
|
+
function Kt(t) {
|
|
702
710
|
return t.getContextValue(Fe);
|
|
703
711
|
}
|
|
704
|
-
function
|
|
705
|
-
return t.getContextValue(
|
|
712
|
+
function Ae(t) {
|
|
713
|
+
return t.getContextValue(Ie);
|
|
706
714
|
}
|
|
707
|
-
|
|
708
|
-
|
|
715
|
+
const O = "7_find-replace-shortcuts";
|
|
716
|
+
function re(t) {
|
|
717
|
+
return t.getContextValue(pe);
|
|
709
718
|
}
|
|
710
|
-
const E = "7_find-replace-shortcuts";
|
|
711
719
|
function se(t) {
|
|
712
|
-
return t.getContextValue(ge);
|
|
713
|
-
}
|
|
714
|
-
function ae(t) {
|
|
715
720
|
return !t.getContextValue(_e);
|
|
716
721
|
}
|
|
717
|
-
const
|
|
722
|
+
const qt = {
|
|
718
723
|
id: T.id,
|
|
719
724
|
description: "find-replace.shortcut.open-find-dialog",
|
|
720
725
|
binding: C.F | y.CTRL_COMMAND,
|
|
721
|
-
group:
|
|
726
|
+
group: O,
|
|
722
727
|
preconditions(t) {
|
|
723
|
-
return !F(t) &&
|
|
728
|
+
return !F(t) && re(t) && se(t);
|
|
724
729
|
}
|
|
725
|
-
},
|
|
730
|
+
}, zt = {
|
|
726
731
|
id: T.id,
|
|
727
732
|
description: "find-replace.shortcut.open-find-dialog",
|
|
728
733
|
binding: C.F | y.CTRL_COMMAND,
|
|
729
734
|
mac: C.F | y.MAC_CTRL,
|
|
730
735
|
preconditions(t) {
|
|
731
|
-
return !F(t) &&
|
|
736
|
+
return !F(t) && re(t) && se(t);
|
|
732
737
|
}
|
|
733
|
-
},
|
|
734
|
-
id:
|
|
738
|
+
}, Yt = {
|
|
739
|
+
id: ne.id,
|
|
735
740
|
description: "find-replace.shortcut.open-replace-dialog",
|
|
736
741
|
binding: C.H | y.CTRL_COMMAND,
|
|
737
742
|
mac: C.H | y.MAC_CTRL,
|
|
738
|
-
group:
|
|
743
|
+
group: O,
|
|
739
744
|
preconditions(t) {
|
|
740
|
-
return
|
|
745
|
+
return re(t) && se(t) && (!F(t) || !Kt(t));
|
|
741
746
|
}
|
|
742
|
-
},
|
|
743
|
-
id:
|
|
747
|
+
}, Zt = {
|
|
748
|
+
id: Te.id,
|
|
744
749
|
description: "find-replace.shortcut.go-to-next-match",
|
|
745
750
|
binding: C.ENTER,
|
|
746
|
-
group:
|
|
751
|
+
group: O,
|
|
747
752
|
priority: 1e3,
|
|
748
753
|
preconditions(t) {
|
|
749
|
-
return
|
|
754
|
+
return Ae(t) && F(t);
|
|
750
755
|
}
|
|
751
|
-
},
|
|
756
|
+
}, Jt = {
|
|
752
757
|
id: Oe.id,
|
|
753
758
|
description: "find-replace.shortcut.go-to-previous-match",
|
|
754
759
|
binding: C.ENTER | y.SHIFT,
|
|
755
|
-
group:
|
|
760
|
+
group: O,
|
|
756
761
|
priority: 1e3,
|
|
757
762
|
preconditions(t) {
|
|
758
|
-
return
|
|
763
|
+
return Ae(t) && F(t);
|
|
759
764
|
}
|
|
760
|
-
},
|
|
761
|
-
id:
|
|
765
|
+
}, Qt = {
|
|
766
|
+
id: Ee.id,
|
|
762
767
|
description: "find-replace.shortcut.focus-selection",
|
|
763
768
|
binding: C.ESC,
|
|
764
|
-
group:
|
|
769
|
+
group: O,
|
|
765
770
|
priority: 1e3,
|
|
766
771
|
preconditions(t) {
|
|
767
772
|
return F(t);
|
|
768
773
|
}
|
|
769
774
|
};
|
|
770
|
-
function
|
|
771
|
-
const e = t.get(
|
|
775
|
+
function Xt(t) {
|
|
776
|
+
const e = t.get(X);
|
|
772
777
|
return {
|
|
773
778
|
id: T.id,
|
|
774
779
|
icon: "SearchIcon",
|
|
775
780
|
tooltip: "find-replace.toolbar",
|
|
776
781
|
type: _t.BUTTON,
|
|
777
|
-
hidden$:
|
|
778
|
-
disabled$:
|
|
782
|
+
hidden$: pt(t, ct.UNIVER_SHEET),
|
|
783
|
+
disabled$: ve([
|
|
779
784
|
e.subscribeContextValue$(_e),
|
|
780
|
-
e.subscribeContextValue$(
|
|
781
|
-
]).pipe(
|
|
785
|
+
e.subscribeContextValue$(pe)
|
|
786
|
+
]).pipe(It(([n, i]) => n || !i))
|
|
782
787
|
};
|
|
783
788
|
}
|
|
784
|
-
const
|
|
785
|
-
[
|
|
789
|
+
const ei = {
|
|
790
|
+
[gt.OTHERS]: {
|
|
786
791
|
[T.id]: {
|
|
787
792
|
order: 2,
|
|
788
|
-
menuItemFactory:
|
|
793
|
+
menuItemFactory: Xt
|
|
789
794
|
}
|
|
790
795
|
}
|
|
791
796
|
};
|
|
792
|
-
var
|
|
793
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
797
|
+
var ti = Object.getOwnPropertyDescriptor, ii = (t, e, n, i) => {
|
|
798
|
+
for (var r = i > 1 ? void 0 : i ? ti(e, n) : e, s = t.length - 1, a; s >= 0; s--)
|
|
794
799
|
(a = t[s]) && (r = a(r) || r);
|
|
795
800
|
return r;
|
|
796
801
|
}, m = (t, e) => (n, i) => e(n, i, t);
|
|
797
|
-
const
|
|
798
|
-
let
|
|
802
|
+
const de = "DESKTOP_FIND_REPLACE_DIALOG", Le = 350, ni = 20, ri = -90;
|
|
803
|
+
let U = class extends lt {
|
|
799
804
|
constructor(e, n, i, r, s, a, c, d, S, f) {
|
|
800
805
|
super();
|
|
801
806
|
o(this, "_closingListenerDisposable");
|
|
@@ -808,112 +813,112 @@ let W = class extends dt {
|
|
|
808
813
|
_initCommands() {
|
|
809
814
|
[
|
|
810
815
|
T,
|
|
811
|
-
|
|
812
|
-
Ee,
|
|
813
|
-
Oe,
|
|
816
|
+
ne,
|
|
814
817
|
Te,
|
|
818
|
+
Oe,
|
|
815
819
|
Pe,
|
|
816
|
-
|
|
820
|
+
xe,
|
|
821
|
+
Ee
|
|
817
822
|
].forEach((e) => {
|
|
818
823
|
this.disposeWithMe(this._commandService.registerCommand(e));
|
|
819
824
|
});
|
|
820
825
|
}
|
|
821
826
|
_initShortcuts() {
|
|
822
827
|
[
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
828
|
+
Yt,
|
|
829
|
+
qt,
|
|
830
|
+
zt,
|
|
831
|
+
Jt,
|
|
832
|
+
Zt,
|
|
833
|
+
Qt
|
|
829
834
|
].forEach((e) => this.disposeWithMe(this._shortcutService.registerShortcut(e)));
|
|
830
835
|
}
|
|
831
836
|
_initUI() {
|
|
832
|
-
this.disposeWithMe(this._componentManager.register("FindReplaceDialog",
|
|
837
|
+
this.disposeWithMe(this._componentManager.register("FindReplaceDialog", kt)), this.disposeWithMe(this._componentManager.register("SearchIcon", be)), this._menuManagerService.mergeMenu(ei), this._findReplaceService.stateUpdates$.pipe(ae(this.dispose$)).subscribe((e) => {
|
|
833
838
|
e.revealed === !0 && this._openPanel();
|
|
834
839
|
});
|
|
835
840
|
}
|
|
836
841
|
_openPanel() {
|
|
837
842
|
this._dialogService.open({
|
|
838
|
-
id:
|
|
843
|
+
id: de,
|
|
839
844
|
draggable: !0,
|
|
840
|
-
width:
|
|
845
|
+
width: Le,
|
|
841
846
|
title: { title: this._localeService.t("find-replace.dialog.title") },
|
|
842
847
|
children: { label: "FindReplaceDialog" },
|
|
843
848
|
destroyOnClose: !0,
|
|
844
|
-
defaultPosition:
|
|
849
|
+
defaultPosition: si(),
|
|
845
850
|
preservePositionOnDestroy: !0,
|
|
846
851
|
onClose: () => this.closePanel()
|
|
847
|
-
}), this._closingListenerDisposable =
|
|
852
|
+
}), this._closingListenerDisposable = A(this._univerInstanceService.focused$.pipe(ae(this.dispose$)).subscribe((e) => {
|
|
848
853
|
(!e || !this._univerInstanceService.getUniverSheetInstance(e)) && this.closePanel();
|
|
849
854
|
}));
|
|
850
855
|
}
|
|
851
856
|
closePanel() {
|
|
852
|
-
this._closingListenerDisposable && (this._closingListenerDisposable.dispose(), this._closingListenerDisposable = null, this._dialogService.close(
|
|
857
|
+
this._closingListenerDisposable && (this._closingListenerDisposable.dispose(), this._closingListenerDisposable = null, this._dialogService.close(de), this._findReplaceService.terminate(), queueMicrotask(() => this._layoutService.focus()));
|
|
853
858
|
}
|
|
854
859
|
};
|
|
855
|
-
|
|
856
|
-
m(0,
|
|
857
|
-
m(1,
|
|
858
|
-
m(2,
|
|
859
|
-
m(3,
|
|
860
|
-
m(4,
|
|
861
|
-
m(5,
|
|
862
|
-
m(6,
|
|
863
|
-
m(7, D(
|
|
864
|
-
m(8, D(
|
|
865
|
-
m(9, D(
|
|
866
|
-
],
|
|
867
|
-
function
|
|
860
|
+
U = ii([
|
|
861
|
+
m(0, fe),
|
|
862
|
+
m(1, mt),
|
|
863
|
+
m(2, vt),
|
|
864
|
+
m(3, W),
|
|
865
|
+
m(4, g),
|
|
866
|
+
m(5, St),
|
|
867
|
+
m(6, me),
|
|
868
|
+
m(7, D(B)),
|
|
869
|
+
m(8, D(Ct)),
|
|
870
|
+
m(9, D(Q))
|
|
871
|
+
], U);
|
|
872
|
+
function si() {
|
|
868
873
|
const { innerWidth: t } = window;
|
|
869
|
-
return { x: (t -
|
|
874
|
+
return { x: (t - Le) / 2 - ni, y: ri };
|
|
870
875
|
}
|
|
871
|
-
var
|
|
872
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
876
|
+
var ai = Object.getOwnPropertyDescriptor, oi = (t, e, n, i) => {
|
|
877
|
+
for (var r = i > 1 ? void 0 : i ? ai(e, n) : e, s = t.length - 1, a; s >= 0; s--)
|
|
873
878
|
(a = t[s]) && (r = a(r) || r);
|
|
874
879
|
return r;
|
|
875
|
-
},
|
|
876
|
-
const
|
|
877
|
-
var
|
|
878
|
-
let
|
|
879
|
-
constructor(t =
|
|
880
|
+
}, he = (t, e) => (n, i) => e(n, i, t);
|
|
881
|
+
const ci = "UNIVER_FIND_REPLACE_PLUGIN";
|
|
882
|
+
var H;
|
|
883
|
+
let ue = (H = class extends ht {
|
|
884
|
+
constructor(t = le, e, n) {
|
|
880
885
|
super(), this._config = t, this._injector = e, this._configService = n;
|
|
881
|
-
const { ...i } =
|
|
886
|
+
const { ...i } = ut(
|
|
882
887
|
{},
|
|
883
|
-
|
|
888
|
+
le,
|
|
884
889
|
this._config
|
|
885
890
|
);
|
|
886
|
-
this._configService.setConfig(
|
|
891
|
+
this._configService.setConfig(Tt, i);
|
|
887
892
|
}
|
|
888
893
|
onStarting() {
|
|
889
894
|
[
|
|
890
|
-
[
|
|
891
|
-
[
|
|
895
|
+
[U],
|
|
896
|
+
[g, { useClass: J }]
|
|
892
897
|
].forEach((t) => this._injector.add(t));
|
|
893
898
|
}
|
|
894
899
|
onRendered() {
|
|
895
|
-
this._injector.get(
|
|
900
|
+
this._injector.get(U);
|
|
896
901
|
}
|
|
897
|
-
}, o(
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
],
|
|
902
|
+
}, o(H, "pluginName", ci), H);
|
|
903
|
+
ue = oi([
|
|
904
|
+
he(1, D(Q)),
|
|
905
|
+
he(2, dt)
|
|
906
|
+
], ue);
|
|
902
907
|
export {
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
908
|
+
Y as FindBy,
|
|
909
|
+
z as FindDirection,
|
|
910
|
+
mi as FindModel,
|
|
911
|
+
U as FindReplaceController,
|
|
912
|
+
q as FindReplaceModel,
|
|
913
|
+
Ut as FindReplaceState,
|
|
914
|
+
Z as FindScope,
|
|
915
|
+
Te as GoToNextMatchOperation,
|
|
911
916
|
Oe as GoToPreviousMatchOperation,
|
|
912
|
-
|
|
917
|
+
g as IFindReplaceService,
|
|
913
918
|
T as OpenFindDialogOperation,
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
+
ne as OpenReplaceDialogOperation,
|
|
920
|
+
Pe as ReplaceAllMatchesCommand,
|
|
921
|
+
xe as ReplaceCurrentMatchCommand,
|
|
922
|
+
ue as UniverFindReplacePlugin,
|
|
923
|
+
ie as createInitFindReplaceState
|
|
919
924
|
};
|