@univerjs/find-replace 0.1.6 → 0.1.8
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 +2 -2
- package/lib/es/index.js +233 -232
- package/lib/types/plugin.d.ts +1 -0
- package/lib/umd/index.js +2 -2
- package/package.json +19 -19
package/lib/es/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var c = (t, e, n) => (
|
|
4
|
-
import { Disposable as
|
|
5
|
-
import { createIdentifier as
|
|
6
|
-
import { IConfirmService as
|
|
7
|
-
import { BehaviorSubject as F, Subject as
|
|
8
|
-
import { RENDER_RAW_FORMULA_KEY as
|
|
9
|
-
import
|
|
10
|
-
import { MessageType as $, InputWithSlot as
|
|
1
|
+
var at = Object.defineProperty;
|
|
2
|
+
var ot = (t, e, n) => e in t ? at(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
|
+
var c = (t, e, n) => (ot(t, typeof e != "symbol" ? e + "" : e, n), n);
|
|
4
|
+
import { Disposable as ee, IUniverInstanceService as ue, ILogService as pe, toDisposable as z, IContextService as U, DisposableCollection as ct, CommandType as M, LocaleService as D, ICommandService as te, FOCUSING_SHEET as fe, EDITOR_ACTIVATED as _e, UniverInstanceType as lt, RxDisposable as dt, OnLifecycle as ht, LifecycleStages as ut, Plugin as pt } from "@univerjs/core";
|
|
5
|
+
import { createIdentifier as ft, Inject as y, Injector as ge } from "@wendellhu/redi";
|
|
6
|
+
import { IConfirmService as _t, IMessageService as me, useObservable as I, ILayoutService as ve, KeyCode as b, MetaKeys as x, MenuGroup as gt, MenuItemType as mt, MenuPosition as vt, getMenuHiddenObservable as St, ComponentManager as Ct, IMenuService as Rt, IShortcutService as bt, IDialogService as xt } from "@univerjs/ui";
|
|
7
|
+
import { BehaviorSubject as F, Subject as Se, throttleTime as Mt, combineLatest as Ce, debounceTime as yt, fromEvent as It, map as Ft, takeUntil as oe } from "rxjs";
|
|
8
|
+
import { RENDER_RAW_FORMULA_KEY as Dt } from "@univerjs/engine-render";
|
|
9
|
+
import Pt, { forwardRef as B, useRef as K, createElement as Re, useCallback as _, Fragment as E, useEffect as w, useMemo as ie, useImperativeHandle as Ot } from "react";
|
|
10
|
+
import { MessageType as $, InputWithSlot as Tt, Pager as Et, Button as N, FormLayout as R, Input as $t, Select as H, FormDualColumnLayout as ce, Checkbox as le } from "@univerjs/design";
|
|
11
11
|
import { useDependency as S } from "@wendellhu/redi/react-bindings";
|
|
12
12
|
var m = function() {
|
|
13
13
|
return m = Object.assign || function(t) {
|
|
@@ -18,7 +18,7 @@ var m = function() {
|
|
|
18
18
|
}
|
|
19
19
|
return t;
|
|
20
20
|
}, m.apply(this, arguments);
|
|
21
|
-
},
|
|
21
|
+
}, Nt = 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,16 +26,16 @@ var m = 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
|
-
},
|
|
30
|
-
var n = t.icon, i = t.id, s = t.className, r = t.extend, a =
|
|
31
|
-
return
|
|
29
|
+
}, be = B(function(t, e) {
|
|
30
|
+
var n = t.icon, i = t.id, s = t.className, r = t.extend, a = Nt(t, ["icon", "id", "className", "extend"]), o = "univerjs-icon univerjs-icon-".concat(i, " ").concat(s || "").trim(), d = K("_".concat(jt()));
|
|
31
|
+
return xe(n, "".concat(i), { defIds: n.defIds, idSuffix: d.current }, m({ ref: e, className: o }, a), r);
|
|
32
32
|
});
|
|
33
|
-
function
|
|
34
|
-
return
|
|
35
|
-
return
|
|
33
|
+
function xe(t, e, n, i, s) {
|
|
34
|
+
return Re(t.tag, m(m({ key: e }, At(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
|
-
function
|
|
38
|
+
function At(t, e, n) {
|
|
39
39
|
var i = m({}, t.attrs);
|
|
40
40
|
n != null && n.colorChannel1 && i.fill === "colorChannel1" && (i.fill = n.colorChannel1);
|
|
41
41
|
var s = e.defIds;
|
|
@@ -44,37 +44,37 @@ function Nt(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
|
|
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) ? m(m({}, t), { children: t.children.map(function(s) {
|
|
50
50
|
return typeof s.attrs.id == "string" && i && i.indexOf(s.attrs.id) > -1 ? m(m({}, s), { attrs: m(m({}, s.attrs), { id: s.attrs.id + e.idSuffix }) }) : s;
|
|
51
51
|
}) }) : t;
|
|
52
52
|
}
|
|
53
|
-
function
|
|
53
|
+
function jt() {
|
|
54
54
|
return Math.random().toString(36).substring(2, 8);
|
|
55
55
|
}
|
|
56
|
-
|
|
57
|
-
var
|
|
58
|
-
return
|
|
56
|
+
be.displayName = "UniverIcon";
|
|
57
|
+
var Lt = { 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" } }] }] }, Me = B(function(t, e) {
|
|
58
|
+
return Re(be, Object.assign({}, t, {
|
|
59
59
|
id: "search-single-16",
|
|
60
60
|
ref: e,
|
|
61
|
-
icon:
|
|
61
|
+
icon: Lt
|
|
62
62
|
}));
|
|
63
63
|
});
|
|
64
|
-
|
|
65
|
-
const
|
|
66
|
-
var
|
|
67
|
-
for (var s = i > 1 ? void 0 : i ?
|
|
64
|
+
Me.displayName = "SearchSingle16";
|
|
65
|
+
const ye = "FIND_REPLACE_INPUT_FOCUS", Ie = "FIND_REPLACE_DIALOG_FOCUS", Fe = "FIND_REPLACE_REPLACE_REVEALED";
|
|
66
|
+
var Ut = Object.defineProperty, Bt = Object.getOwnPropertyDescriptor, De = (t, e, n, i) => {
|
|
67
|
+
for (var s = i > 1 ? void 0 : i ? Bt(e, n) : e, r = t.length - 1, a; r >= 0; r--)
|
|
68
68
|
(a = t[r]) && (s = (i ? a(e, n, s) : a(s)) || s);
|
|
69
|
-
return i && s &&
|
|
69
|
+
return i && s && Ut(e, n, s), s;
|
|
70
70
|
}, j = (t, e) => (n, i) => e(n, i, t);
|
|
71
|
-
class
|
|
71
|
+
class ji extends ee {
|
|
72
72
|
}
|
|
73
|
-
const v =
|
|
74
|
-
function
|
|
73
|
+
const v = ft("find-replace.service");
|
|
74
|
+
function Wt(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
|
-
let
|
|
77
|
+
let Y = class extends ee {
|
|
78
78
|
constructor(e, n, i, s) {
|
|
79
79
|
super();
|
|
80
80
|
c(this, "currentMatch$", new F(null));
|
|
@@ -86,9 +86,9 @@ let K = class extends X {
|
|
|
86
86
|
c(this, "_matches", []);
|
|
87
87
|
c(this, "_currentSearchingDisposables", null);
|
|
88
88
|
this._state = e, this._providers = n, this._univerInstanceService = i, this._logService = s, this.disposeWithMe(
|
|
89
|
-
this._state.stateUpdates$.pipe(
|
|
89
|
+
this._state.stateUpdates$.pipe(Mt(200, void 0, { leading: !0, trailing: !0 })).subscribe(async (r) => {
|
|
90
90
|
const a = this._state.state;
|
|
91
|
-
|
|
91
|
+
Wt(r) && (a.findString !== "" && !a.replaceRevealed ? (await this._startSearching(), this._state.changeState({ findCompleted: !0 })) : r.replaceRevealed !== !0 && this._stopSearching());
|
|
92
92
|
})
|
|
93
93
|
);
|
|
94
94
|
}
|
|
@@ -96,7 +96,7 @@ let K = class extends X {
|
|
|
96
96
|
return this._findModels.length > 0;
|
|
97
97
|
}
|
|
98
98
|
dispose() {
|
|
99
|
-
super.dispose(), this._stopSearching(), this.currentMatch$.complete(), this.replaceables$.complete(), this._state.changeState({ ...
|
|
99
|
+
super.dispose(), this._stopSearching(), this.currentMatch$.complete(), this.replaceables$.complete(), this._state.changeState({ ...ne(), revealed: !1 });
|
|
100
100
|
}
|
|
101
101
|
async start() {
|
|
102
102
|
if (!this._state.findString)
|
|
@@ -139,7 +139,7 @@ let K = class extends X {
|
|
|
139
139
|
}
|
|
140
140
|
// When a document's content changes, we should reset all matches and try to move to the next match.
|
|
141
141
|
_subscribeToModelsChanges(e) {
|
|
142
|
-
const n = this._currentSearchingDisposables = new
|
|
142
|
+
const n = this._currentSearchingDisposables = new ct(), i = Ce(e.map((s) => s.matchesUpdate$)).pipe(yt(220)).subscribe(([...s]) => {
|
|
143
143
|
const r = this._matches = s.flat();
|
|
144
144
|
if (r.length) {
|
|
145
145
|
const a = this._moveToInitialMatch(this._findModels, r, !0);
|
|
@@ -147,10 +147,10 @@ let K = class extends X {
|
|
|
147
147
|
} else
|
|
148
148
|
this._state.changeState({ matchesCount: 0, matchesPosition: 0 }), this.replaceables$.next([]);
|
|
149
149
|
});
|
|
150
|
-
e.forEach((s) => n.add(
|
|
150
|
+
e.forEach((s) => n.add(z(s.activelyChangingMatch$.subscribe((r) => {
|
|
151
151
|
const a = this._matches.findIndex((o) => o === r);
|
|
152
152
|
this._state.changeState({ matchesPosition: a + 1 });
|
|
153
|
-
})))), n.add(
|
|
153
|
+
})))), n.add(z(i));
|
|
154
154
|
}
|
|
155
155
|
async replace() {
|
|
156
156
|
return this._matchingModel ? this._matchingModel.replace(this._state.replaceString) : !1;
|
|
@@ -196,7 +196,7 @@ let K = class extends X {
|
|
|
196
196
|
}
|
|
197
197
|
_moveToInitialMatch(e, n, i = !1) {
|
|
198
198
|
var d;
|
|
199
|
-
const s = (d = this._univerInstanceService.
|
|
199
|
+
const s = (d = this._univerInstanceService.getFocusedUnit()) == null ? void 0 : d.getUnitId();
|
|
200
200
|
if (!s)
|
|
201
201
|
return -1;
|
|
202
202
|
const r = e.find((u) => u.unitId === s);
|
|
@@ -210,12 +210,12 @@ let K = class extends X {
|
|
|
210
210
|
return this.currentMatch$.next(a), o;
|
|
211
211
|
}
|
|
212
212
|
};
|
|
213
|
-
|
|
214
|
-
j(2,
|
|
215
|
-
j(3,
|
|
216
|
-
],
|
|
217
|
-
var
|
|
218
|
-
function
|
|
213
|
+
Y = De([
|
|
214
|
+
j(2, ue),
|
|
215
|
+
j(3, pe)
|
|
216
|
+
], Y);
|
|
217
|
+
var Z = /* @__PURE__ */ ((t) => (t.ROW = "row", t.COLUMN = "column", t))(Z || {}), J = /* @__PURE__ */ ((t) => (t.VALUE = "value", t.FORMULA = "formula", t))(J || {}), Q = /* @__PURE__ */ ((t) => (t.SUBUNIT = "subunit", t.UNIT = "unit", t))(Q || {});
|
|
218
|
+
function ne() {
|
|
219
219
|
return {
|
|
220
220
|
caseSensitive: !1,
|
|
221
221
|
findBy: "value",
|
|
@@ -232,11 +232,11 @@ function ie() {
|
|
|
232
232
|
revealed: !0
|
|
233
233
|
};
|
|
234
234
|
}
|
|
235
|
-
class
|
|
235
|
+
class kt {
|
|
236
236
|
constructor() {
|
|
237
|
-
c(this, "_stateUpdates$", new
|
|
237
|
+
c(this, "_stateUpdates$", new Se());
|
|
238
238
|
c(this, "stateUpdates$", this._stateUpdates$.asObservable());
|
|
239
|
-
c(this, "_state$", new F(
|
|
239
|
+
c(this, "_state$", new F(ne()));
|
|
240
240
|
c(this, "state$", this._state$.asObservable());
|
|
241
241
|
c(this, "_findString", "");
|
|
242
242
|
c(this, "_inputtingFindString", "");
|
|
@@ -313,17 +313,17 @@ class Wt {
|
|
|
313
313
|
}), this._stateUpdates$.next(i));
|
|
314
314
|
}
|
|
315
315
|
}
|
|
316
|
-
let
|
|
316
|
+
let X = class extends ee {
|
|
317
317
|
constructor(e, n) {
|
|
318
318
|
super();
|
|
319
319
|
c(this, "_providers", /* @__PURE__ */ new Set());
|
|
320
|
-
c(this, "_state", new
|
|
320
|
+
c(this, "_state", new kt());
|
|
321
321
|
c(this, "_model");
|
|
322
322
|
c(this, "_currentMatch$", new F(null));
|
|
323
323
|
c(this, "currentMatch$", this._currentMatch$.asObservable());
|
|
324
324
|
c(this, "_replaceables$", new F([]));
|
|
325
325
|
c(this, "replaceables$", this._replaceables$.asObservable());
|
|
326
|
-
c(this, "_focusSignal$", new
|
|
326
|
+
c(this, "_focusSignal$", new Se());
|
|
327
327
|
c(this, "focusSignal$", this._focusSignal$.asObservable());
|
|
328
328
|
this._injector = e, this._contextService = n;
|
|
329
329
|
}
|
|
@@ -399,8 +399,8 @@ let Q = class extends X {
|
|
|
399
399
|
start(e = !1) {
|
|
400
400
|
if (this._providers.size === 0)
|
|
401
401
|
return !1;
|
|
402
|
-
this._model = this._injector.createInstance(
|
|
403
|
-
const n =
|
|
402
|
+
this._model = this._injector.createInstance(Y, this._state, this._providers), this._model.currentMatch$.subscribe((i) => this._currentMatch$.next(i)), this._model.replaceables$.subscribe((i) => this._replaceables$.next(i));
|
|
403
|
+
const n = ne();
|
|
404
404
|
return e && (n.replaceRevealed = !0), this._state.changeState(n), this._toggleRevealReplace(e), !0;
|
|
405
405
|
}
|
|
406
406
|
find() {
|
|
@@ -412,19 +412,19 @@ let Q = class extends X {
|
|
|
412
412
|
(e = this._model) == null || e.dispose(), this._model = null, this._toggleDisplayRawFormula(!1), this._toggleRevealReplace(!1);
|
|
413
413
|
}
|
|
414
414
|
registerFindReplaceProvider(e) {
|
|
415
|
-
return this._providers.add(e),
|
|
415
|
+
return this._providers.add(e), z(() => this._providers.delete(e));
|
|
416
416
|
}
|
|
417
417
|
_toggleRevealReplace(e) {
|
|
418
|
-
this._contextService.setContextValue(
|
|
418
|
+
this._contextService.setContextValue(Fe, e);
|
|
419
419
|
}
|
|
420
420
|
_toggleDisplayRawFormula(e) {
|
|
421
|
-
this._contextService.setContextValue(
|
|
421
|
+
this._contextService.setContextValue(Dt, e);
|
|
422
422
|
}
|
|
423
423
|
};
|
|
424
|
-
|
|
425
|
-
j(0, y(
|
|
424
|
+
X = De([
|
|
425
|
+
j(0, y(ge)),
|
|
426
426
|
j(1, U)
|
|
427
|
-
],
|
|
427
|
+
], X);
|
|
428
428
|
const W = {
|
|
429
429
|
id: "ui.operation.open-find-dialog",
|
|
430
430
|
type: M.OPERATION,
|
|
@@ -432,23 +432,23 @@ const W = {
|
|
|
432
432
|
const e = t.get(v);
|
|
433
433
|
return e.revealed ? e.focusFindInput() : e.start(), !0;
|
|
434
434
|
}
|
|
435
|
-
},
|
|
435
|
+
}, se = {
|
|
436
436
|
id: "ui.operation.open-replace-dialog",
|
|
437
437
|
type: M.OPERATION,
|
|
438
438
|
handler: (t) => {
|
|
439
439
|
const e = t.get(v);
|
|
440
440
|
return e.revealed ? e.replaceRevealed ? e.focusFindInput() : e.revealReplace() : e.start(!0), !0;
|
|
441
441
|
}
|
|
442
|
-
},
|
|
442
|
+
}, Pe = {
|
|
443
443
|
type: M.OPERATION,
|
|
444
444
|
id: "ui.operation.go-to-next-match",
|
|
445
445
|
handler: (t) => (t.get(v).moveToNextMatch(), !0)
|
|
446
|
-
},
|
|
446
|
+
}, Oe = {
|
|
447
447
|
type: M.OPERATION,
|
|
448
448
|
id: "ui.operation.go-to-previous-match",
|
|
449
449
|
handler: (t) => (t.get(v).moveToPreviousMatch(), !0)
|
|
450
450
|
};
|
|
451
|
-
var
|
|
451
|
+
var Te = { exports: {} }, k = {};
|
|
452
452
|
/**
|
|
453
453
|
* @license React
|
|
454
454
|
* react-jsx-runtime.production.min.js
|
|
@@ -458,33 +458,33 @@ var Oe = { exports: {} }, k = {};
|
|
|
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
|
|
462
|
-
function
|
|
461
|
+
var Gt = Pt, 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
|
+
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
|
-
|
|
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:
|
|
470
|
+
return { $$typeof: Vt, type: t, key: r, ref: a, props: s, _owner: zt.current };
|
|
471
471
|
}
|
|
472
|
-
k.Fragment =
|
|
473
|
-
k.jsx =
|
|
474
|
-
k.jsxs =
|
|
475
|
-
|
|
476
|
-
var l =
|
|
477
|
-
const
|
|
472
|
+
k.Fragment = Ht;
|
|
473
|
+
k.jsx = Ee;
|
|
474
|
+
k.jsxs = Ee;
|
|
475
|
+
Te.exports = k;
|
|
476
|
+
var l = Te.exports;
|
|
477
|
+
const $e = {
|
|
478
478
|
id: "ui.command.replace-current-match",
|
|
479
479
|
type: M.COMMAND,
|
|
480
480
|
handler: (t) => t.get(v).replace()
|
|
481
|
-
},
|
|
481
|
+
}, Yt = "CONFIRM_REPLACE_ALL", Ne = {
|
|
482
482
|
id: "ui.command.replace-all-matches",
|
|
483
483
|
type: M.COMMAND,
|
|
484
484
|
handler: async (t) => {
|
|
485
|
-
const e = t.get(
|
|
485
|
+
const e = t.get(_t), n = t.get(D), i = t.get(me);
|
|
486
486
|
if (!await e.confirm({
|
|
487
|
-
id:
|
|
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")
|
|
@@ -503,15 +503,15 @@ const Ee = {
|
|
|
503
503
|
}), !0);
|
|
504
504
|
}
|
|
505
505
|
};
|
|
506
|
-
function
|
|
506
|
+
function Ae(t) {
|
|
507
507
|
const { findCompleted: e, localeService: n, matchesCount: i, matchesPosition: s, findString: r, findReplaceService: a, onChange: o, ...d } = t, f = e && i === 0 ? n.t("find-replace.dialog.no-result") : i === 0 ? " " : void 0;
|
|
508
508
|
return /* @__PURE__ */ l.jsx(
|
|
509
|
-
|
|
509
|
+
Tt,
|
|
510
510
|
{
|
|
511
511
|
autoFocus: !0,
|
|
512
512
|
placeholder: n.t("find-replace.dialog.find-placeholder"),
|
|
513
513
|
slot: /* @__PURE__ */ l.jsx(
|
|
514
|
-
|
|
514
|
+
Et,
|
|
515
515
|
{
|
|
516
516
|
loop: !0,
|
|
517
517
|
text: f,
|
|
@@ -528,14 +528,14 @@ function Ne(t) {
|
|
|
528
528
|
}
|
|
529
529
|
);
|
|
530
530
|
}
|
|
531
|
-
const
|
|
532
|
-
findReplaceDialogContainer:
|
|
533
|
-
findReplaceExpandContainer:
|
|
534
|
-
buttonText:
|
|
535
|
-
findReplaceButtonsGroup:
|
|
536
|
-
findReplaceButtonsGroupRight:
|
|
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", L = {
|
|
532
|
+
findReplaceDialogContainer: Zt,
|
|
533
|
+
findReplaceExpandContainer: Jt,
|
|
534
|
+
buttonText: Qt,
|
|
535
|
+
findReplaceButtonsGroup: Xt,
|
|
536
|
+
findReplaceButtonsGroupRight: ei
|
|
537
537
|
};
|
|
538
|
-
function
|
|
538
|
+
function we(t, e) {
|
|
539
539
|
const n = _(() => {
|
|
540
540
|
var s;
|
|
541
541
|
(s = document.querySelector(".univer-find-input input")) == null || s.focus();
|
|
@@ -543,18 +543,18 @@ function Ae(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
|
|
546
|
+
return Ot(e, () => ({ focus: n, selectHasFocus: i })), w(() => {
|
|
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
|
|
552
|
-
const i = S(D), s = S(v), r = S(
|
|
553
|
-
r.executeCommand(
|
|
551
|
+
const ti = B(function(e, n) {
|
|
552
|
+
const i = S(D), s = S(v), r = S(te), a = I(s.state$, void 0, !0), { findCompleted: o, findString: d, matchesCount: u, matchesPosition: f } = a, p = _(() => {
|
|
553
|
+
r.executeCommand(se.id);
|
|
554
554
|
}, [r]), O = _((C) => s.changeFindString(C), [s]);
|
|
555
|
-
return
|
|
555
|
+
return we(s, n), /* @__PURE__ */ l.jsxs(E, { children: [
|
|
556
556
|
/* @__PURE__ */ l.jsx(
|
|
557
|
-
|
|
557
|
+
Ae,
|
|
558
558
|
{
|
|
559
559
|
findCompleted: o,
|
|
560
560
|
className: "univer-find-input",
|
|
@@ -568,36 +568,36 @@ const ei = B(function(e, n) {
|
|
|
568
568
|
),
|
|
569
569
|
/* @__PURE__ */ l.jsx("div", { className: L.findReplaceExpandContainer, children: /* @__PURE__ */ l.jsx(N, { type: "text", size: "small", onClick: p, children: i.t("find-replace.dialog.advanced-finding") }) })
|
|
570
570
|
] });
|
|
571
|
-
}),
|
|
572
|
-
const i = S(v), s = S(D), r = S(
|
|
571
|
+
}), ii = B(function(e, n) {
|
|
572
|
+
const i = S(v), s = S(D), 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
575
|
findString: O,
|
|
576
576
|
inputtingFindString: C,
|
|
577
|
-
replaceString:
|
|
578
|
-
caseSensitive:
|
|
579
|
-
matchesTheWholeCell:
|
|
580
|
-
findDirection:
|
|
581
|
-
findScope:
|
|
582
|
-
findBy:
|
|
577
|
+
replaceString: Ue,
|
|
578
|
+
caseSensitive: Be,
|
|
579
|
+
matchesTheWholeCell: We,
|
|
580
|
+
findDirection: ke,
|
|
581
|
+
findScope: Ge,
|
|
582
|
+
findBy: Ve,
|
|
583
583
|
findCompleted: V
|
|
584
|
-
} = u,
|
|
584
|
+
} = u, He = C.length === 0, qe = f === 0 || !(o != null && o.replaceable), ze = d.length === 0, Ke = _(
|
|
585
585
|
(h) => i.changeInputtingFindString(h),
|
|
586
586
|
[i]
|
|
587
|
-
),
|
|
587
|
+
), Ye = _(
|
|
588
588
|
(h) => i.changeReplaceString(h),
|
|
589
589
|
[i]
|
|
590
|
-
), { focus:
|
|
590
|
+
), { focus: Ze } = we(i, n), Je = _(() => {
|
|
591
591
|
O === C ? i.moveToNextMatch() : (i.changeFindString(C), i.find());
|
|
592
|
-
}, [O, C, i]),
|
|
593
|
-
await r.executeCommand(
|
|
594
|
-
}, [r]),
|
|
592
|
+
}, [O, C, i]), Qe = _(() => r.executeCommand($e.id), [r]), Xe = _(async () => {
|
|
593
|
+
await r.executeCommand(Ne.id), Ze();
|
|
594
|
+
}, [r]), et = _((h) => {
|
|
595
595
|
i.changeFindDirection(h);
|
|
596
|
-
}, [i]), et = _((h) => {
|
|
597
|
-
i.changeFindScope(h);
|
|
598
596
|
}, [i]), tt = _((h) => {
|
|
597
|
+
i.changeFindScope(h);
|
|
598
|
+
}, [i]), it = _((h) => {
|
|
599
599
|
i.changeFindBy(h);
|
|
600
|
-
}, [i]),
|
|
600
|
+
}, [i]), nt = si(s), st = ri(s), rt = ai(s);
|
|
601
601
|
return w(() => {
|
|
602
602
|
const h = V && f === 0;
|
|
603
603
|
let T = null;
|
|
@@ -608,7 +608,7 @@ const ei = B(function(e, n) {
|
|
|
608
608
|
})), () => T == null ? void 0 : T.dispose();
|
|
609
609
|
}, [V, f, a, s]), /* @__PURE__ */ l.jsxs(E, { children: [
|
|
610
610
|
/* @__PURE__ */ l.jsx(R, { label: s.t("find-replace.dialog.find"), children: /* @__PURE__ */ l.jsx(
|
|
611
|
-
|
|
611
|
+
Ae,
|
|
612
612
|
{
|
|
613
613
|
findCompleted: V,
|
|
614
614
|
className: "univer-find-input",
|
|
@@ -617,27 +617,27 @@ const ei = B(function(e, n) {
|
|
|
617
617
|
findReplaceService: i,
|
|
618
618
|
localeService: s,
|
|
619
619
|
findString: C,
|
|
620
|
-
onChange:
|
|
620
|
+
onChange: Ke
|
|
621
621
|
}
|
|
622
622
|
) }),
|
|
623
623
|
/* @__PURE__ */ l.jsx(R, { label: s.t("find-replace.dialog.replace"), children: /* @__PURE__ */ l.jsx(
|
|
624
|
-
|
|
624
|
+
$t,
|
|
625
625
|
{
|
|
626
626
|
placeholder: s.t("find-replace.dialog.replace-placeholder"),
|
|
627
|
-
value:
|
|
628
|
-
onChange: (h) =>
|
|
627
|
+
value: Ue,
|
|
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(H, { value:
|
|
632
|
-
/* @__PURE__ */ l.jsx(
|
|
633
|
-
/* @__PURE__ */ l.jsx(R, { label: s.t("find-replace.dialog.find-scope.title"), children: /* @__PURE__ */ l.jsx(H, { value:
|
|
634
|
-
/* @__PURE__ */ l.jsx(R, { label: s.t("find-replace.dialog.find-by.title"), children: /* @__PURE__ */ l.jsx(H, { value:
|
|
631
|
+
/* @__PURE__ */ l.jsx(R, { label: s.t("find-replace.dialog.find-direction.title"), children: /* @__PURE__ */ l.jsx(H, { value: ke, options: st, onChange: et }) }),
|
|
632
|
+
/* @__PURE__ */ l.jsx(ce, { children: /* @__PURE__ */ l.jsxs(E, { children: [
|
|
633
|
+
/* @__PURE__ */ l.jsx(R, { label: s.t("find-replace.dialog.find-scope.title"), children: /* @__PURE__ */ l.jsx(H, { value: Ge, options: nt, onChange: tt }) }),
|
|
634
|
+
/* @__PURE__ */ l.jsx(R, { label: s.t("find-replace.dialog.find-by.title"), children: /* @__PURE__ */ l.jsx(H, { value: Ve, options: rt, onChange: it }) })
|
|
635
635
|
] }) }),
|
|
636
|
-
/* @__PURE__ */ l.jsx(
|
|
636
|
+
/* @__PURE__ */ l.jsx(ce, { children: /* @__PURE__ */ l.jsxs(E, { children: [
|
|
637
637
|
/* @__PURE__ */ l.jsx(R, { children: /* @__PURE__ */ l.jsx(
|
|
638
|
-
|
|
638
|
+
le,
|
|
639
639
|
{
|
|
640
|
-
checked:
|
|
640
|
+
checked: Be,
|
|
641
641
|
onChange: (h) => {
|
|
642
642
|
i.changeCaseSensitive(h);
|
|
643
643
|
},
|
|
@@ -645,9 +645,9 @@ const ei = B(function(e, n) {
|
|
|
645
645
|
}
|
|
646
646
|
) }),
|
|
647
647
|
/* @__PURE__ */ l.jsx(R, { children: /* @__PURE__ */ l.jsx(
|
|
648
|
-
|
|
648
|
+
le,
|
|
649
649
|
{
|
|
650
|
-
checked:
|
|
650
|
+
checked: We,
|
|
651
651
|
onChange: (h) => {
|
|
652
652
|
i.changeMatchesTheWholeCell(h);
|
|
653
653
|
},
|
|
@@ -656,212 +656,212 @@ const ei = B(function(e, n) {
|
|
|
656
656
|
) })
|
|
657
657
|
] }) }),
|
|
658
658
|
/* @__PURE__ */ l.jsxs("div", { className: L.findReplaceButtonsGroup, children: [
|
|
659
|
-
/* @__PURE__ */ l.jsx(N, { type: "primary", onClick:
|
|
659
|
+
/* @__PURE__ */ l.jsx(N, { type: "primary", onClick: Je, disabled: He, children: s.t("find-replace.dialog.find") }),
|
|
660
660
|
/* @__PURE__ */ l.jsxs("span", { className: L.findReplaceButtonsGroupRight, children: [
|
|
661
|
-
/* @__PURE__ */ l.jsx(N, { disabled:
|
|
662
|
-
/* @__PURE__ */ l.jsx(N, { disabled:
|
|
661
|
+
/* @__PURE__ */ l.jsx(N, { disabled: qe, onClick: Qe, children: s.t("find-replace.dialog.replace") }),
|
|
662
|
+
/* @__PURE__ */ l.jsx(N, { disabled: ze, onClick: Xe, children: s.t("find-replace.dialog.replace-all") })
|
|
663
663
|
] })
|
|
664
664
|
] })
|
|
665
665
|
] });
|
|
666
666
|
});
|
|
667
|
-
function
|
|
668
|
-
const t = S(v), e = S(
|
|
667
|
+
function ni() {
|
|
668
|
+
const t = S(v), e = S(ve), n = S(U), i = I(t.state$, void 0, !0), s = K(null);
|
|
669
669
|
w(() => {
|
|
670
670
|
let d;
|
|
671
671
|
return s.current && (d = e.registerContainerElement(s.current)), () => d == null ? void 0 : d.dispose();
|
|
672
672
|
}, [e]);
|
|
673
|
-
const r =
|
|
674
|
-
(d) => n.setContextValue(
|
|
673
|
+
const r = K(null), a = _(
|
|
674
|
+
(d) => n.setContextValue(Ie, d),
|
|
675
675
|
[n]
|
|
676
676
|
), o = _(
|
|
677
|
-
(d) => n.setContextValue(
|
|
677
|
+
(d) => n.setContextValue(ye, d),
|
|
678
678
|
[n]
|
|
679
679
|
);
|
|
680
680
|
return w(() => {
|
|
681
681
|
var u;
|
|
682
|
-
const d =
|
|
682
|
+
const d = It(document, "focusin").subscribe((f) => {
|
|
683
683
|
var p;
|
|
684
684
|
f.target && ((p = s.current) != null && p.contains(f.target)) ? a(!0) : a(!1), !r.current || !r.current.selectHasFocus() ? o(!0) : o(!1);
|
|
685
685
|
});
|
|
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(
|
|
689
|
+
}, [a, o]), /* @__PURE__ */ l.jsx("div", { className: L.findReplaceDialogContainer, ref: s, children: i.replaceRevealed ? /* @__PURE__ */ l.jsx(ii, { ref: r }) : /* @__PURE__ */ l.jsx(ti, { ref: r }) });
|
|
690
690
|
}
|
|
691
|
-
function
|
|
691
|
+
function si(t) {
|
|
692
692
|
const e = t.getCurrentLocale();
|
|
693
|
-
return
|
|
694
|
-
{ label: t.t("find-replace.dialog.find-scope.current-sheet"), value:
|
|
695
|
-
{ label: t.t("find-replace.dialog.find-scope.workbook"), value:
|
|
693
|
+
return ie(() => [
|
|
694
|
+
{ label: t.t("find-replace.dialog.find-scope.current-sheet"), value: Q.SUBUNIT },
|
|
695
|
+
{ label: t.t("find-replace.dialog.find-scope.workbook"), value: Q.UNIT }
|
|
696
696
|
], [e]);
|
|
697
697
|
}
|
|
698
|
-
function
|
|
698
|
+
function ri(t) {
|
|
699
699
|
const e = t.getCurrentLocale();
|
|
700
|
-
return
|
|
701
|
-
{ label: t.t("find-replace.dialog.find-direction.row"), value:
|
|
702
|
-
{ label: t.t("find-replace.dialog.find-direction.column"), value:
|
|
700
|
+
return ie(() => [
|
|
701
|
+
{ label: t.t("find-replace.dialog.find-direction.row"), value: Z.ROW },
|
|
702
|
+
{ label: t.t("find-replace.dialog.find-direction.column"), value: Z.COLUMN }
|
|
703
703
|
], [e]);
|
|
704
704
|
}
|
|
705
|
-
function
|
|
705
|
+
function ai(t) {
|
|
706
706
|
const e = t.getCurrentLocale();
|
|
707
|
-
return
|
|
708
|
-
{ label: t.t("find-replace.dialog.find-by.value"), value:
|
|
709
|
-
{ label: t.t("find-replace.dialog.find-by.formula"), value:
|
|
707
|
+
return ie(() => [
|
|
708
|
+
{ label: t.t("find-replace.dialog.find-by.value"), value: J.VALUE },
|
|
709
|
+
{ label: t.t("find-replace.dialog.find-by.formula"), value: J.FORMULA }
|
|
710
710
|
], [e]);
|
|
711
711
|
}
|
|
712
712
|
function P(t) {
|
|
713
|
-
return t.getContextValue(ye);
|
|
714
|
-
}
|
|
715
|
-
function ai(t) {
|
|
716
713
|
return t.getContextValue(Ie);
|
|
717
714
|
}
|
|
718
|
-
function
|
|
719
|
-
return t.getContextValue(
|
|
715
|
+
function oi(t) {
|
|
716
|
+
return t.getContextValue(Fe);
|
|
720
717
|
}
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
return t.getContextValue(pe);
|
|
718
|
+
function je(t) {
|
|
719
|
+
return t.getContextValue(ye);
|
|
724
720
|
}
|
|
721
|
+
const G = "7_find-replace-shortcuts";
|
|
725
722
|
function re(t) {
|
|
726
|
-
return
|
|
723
|
+
return t.getContextValue(fe);
|
|
724
|
+
}
|
|
725
|
+
function ae(t) {
|
|
726
|
+
return !t.getContextValue(_e);
|
|
727
727
|
}
|
|
728
|
-
const
|
|
728
|
+
const ci = {
|
|
729
729
|
id: W.id,
|
|
730
730
|
description: "find-replace.shortcut.open-find-dialog",
|
|
731
731
|
binding: b.F | x.CTRL_COMMAND,
|
|
732
732
|
group: G,
|
|
733
733
|
preconditions(t) {
|
|
734
|
-
return !P(t) &&
|
|
734
|
+
return !P(t) && re(t) && ae(t);
|
|
735
735
|
}
|
|
736
|
-
},
|
|
736
|
+
}, li = {
|
|
737
737
|
id: W.id,
|
|
738
738
|
description: "find-replace.shortcut.open-find-dialog",
|
|
739
739
|
binding: b.F | x.CTRL_COMMAND,
|
|
740
740
|
mac: b.F | x.MAC_CTRL,
|
|
741
741
|
preconditions(t) {
|
|
742
|
-
return !P(t) &&
|
|
742
|
+
return !P(t) && re(t) && ae(t);
|
|
743
743
|
}
|
|
744
|
-
},
|
|
745
|
-
id:
|
|
744
|
+
}, di = {
|
|
745
|
+
id: se.id,
|
|
746
746
|
description: "find-replace.shortcut.open-replace-dialog",
|
|
747
747
|
binding: b.H | x.CTRL_COMMAND,
|
|
748
748
|
mac: b.H | x.MAC_CTRL,
|
|
749
749
|
group: G,
|
|
750
750
|
preconditions(t) {
|
|
751
|
-
return
|
|
751
|
+
return re(t) && ae(t) && (!P(t) || !oi(t));
|
|
752
752
|
}
|
|
753
|
-
},
|
|
754
|
-
id:
|
|
753
|
+
}, hi = {
|
|
754
|
+
id: Pe.id,
|
|
755
755
|
description: "find-replace.shortcut.go-to-next-match",
|
|
756
756
|
binding: b.ENTER,
|
|
757
757
|
group: G,
|
|
758
758
|
priority: 1e3,
|
|
759
759
|
preconditions(t) {
|
|
760
|
-
return
|
|
760
|
+
return je(t) && P(t);
|
|
761
761
|
}
|
|
762
|
-
},
|
|
763
|
-
id:
|
|
762
|
+
}, ui = {
|
|
763
|
+
id: Oe.id,
|
|
764
764
|
description: "find-replace.shortcut.go-to-previous-match",
|
|
765
765
|
binding: b.ENTER | x.SHIFT,
|
|
766
766
|
group: G,
|
|
767
767
|
priority: 1e3,
|
|
768
768
|
preconditions(t) {
|
|
769
|
-
return
|
|
769
|
+
return je(t) && P(t);
|
|
770
770
|
}
|
|
771
771
|
};
|
|
772
|
-
function
|
|
772
|
+
function pi(t) {
|
|
773
773
|
const e = t.get(U);
|
|
774
774
|
return {
|
|
775
775
|
id: W.id,
|
|
776
776
|
icon: "SearchIcon",
|
|
777
777
|
tooltip: "find-replace.toolbar",
|
|
778
|
-
group:
|
|
779
|
-
type:
|
|
780
|
-
positions: [
|
|
781
|
-
hidden$:
|
|
782
|
-
disabled$:
|
|
783
|
-
e.subscribeContextValue$(
|
|
784
|
-
e.subscribeContextValue$(
|
|
785
|
-
]).pipe(
|
|
778
|
+
group: gt.TOOLBAR_OTHERS,
|
|
779
|
+
type: mt.BUTTON,
|
|
780
|
+
positions: [vt.TOOLBAR_START],
|
|
781
|
+
hidden$: St(t, lt.UNIVER_SHEET),
|
|
782
|
+
disabled$: Ce([
|
|
783
|
+
e.subscribeContextValue$(_e),
|
|
784
|
+
e.subscribeContextValue$(fe)
|
|
785
|
+
]).pipe(Ft(([n, i]) => n || !i))
|
|
786
786
|
};
|
|
787
787
|
}
|
|
788
|
-
var
|
|
789
|
-
for (var s = i > 1 ? void 0 : i ?
|
|
788
|
+
var fi = Object.defineProperty, _i = Object.getOwnPropertyDescriptor, gi = (t, e, n, i) => {
|
|
789
|
+
for (var s = i > 1 ? void 0 : i ? _i(e, n) : e, r = t.length - 1, a; r >= 0; r--)
|
|
790
790
|
(a = t[r]) && (s = (i ? a(e, n, s) : a(s)) || s);
|
|
791
|
-
return i && s &&
|
|
791
|
+
return i && s && fi(e, n, s), s;
|
|
792
792
|
}, g = (t, e) => (n, i) => e(n, i, t);
|
|
793
|
-
const
|
|
794
|
-
let A = class extends
|
|
793
|
+
const de = "DESKTOP_FIND_REPLACE_DIALOG", Le = 350, mi = 20, vi = -90;
|
|
794
|
+
let A = class extends dt {
|
|
795
795
|
constructor(t, e, n, i, s, r, a, o, d, u, f, p) {
|
|
796
796
|
super(), this._univerInstanceService = t, this._menuService = e, this._shortcutService = n, this._commandService = i, this._findReplaceService = s, this._logService = r, this._dialogService = a, this._contextService = o, this._layoutService = d, this._localeService = u, this._componentManager = f, this._injector = p, this._initCommands(), this._initUI(), this._initShortcuts();
|
|
797
797
|
}
|
|
798
798
|
_initCommands() {
|
|
799
799
|
[
|
|
800
800
|
W,
|
|
801
|
-
|
|
802
|
-
De,
|
|
801
|
+
se,
|
|
803
802
|
Pe,
|
|
804
|
-
|
|
805
|
-
|
|
803
|
+
Oe,
|
|
804
|
+
Ne,
|
|
805
|
+
$e
|
|
806
806
|
].forEach((t) => {
|
|
807
807
|
this.disposeWithMe(this._commandService.registerCommand(t));
|
|
808
808
|
});
|
|
809
809
|
}
|
|
810
810
|
_initShortcuts() {
|
|
811
811
|
[
|
|
812
|
-
|
|
813
|
-
oi,
|
|
812
|
+
di,
|
|
814
813
|
ci,
|
|
815
|
-
|
|
816
|
-
|
|
814
|
+
li,
|
|
815
|
+
ui,
|
|
816
|
+
hi
|
|
817
817
|
].forEach((t) => this.disposeWithMe(this._shortcutService.registerShortcut(t)));
|
|
818
818
|
}
|
|
819
819
|
_initUI() {
|
|
820
|
-
this.disposeWithMe(this._menuService.addMenuItem(this._injector.invoke(
|
|
820
|
+
this.disposeWithMe(this._menuService.addMenuItem(this._injector.invoke(pi))), this.disposeWithMe(this._componentManager.register("FindReplaceDialog", ni)), this.disposeWithMe(this._componentManager.register("SearchIcon", Me)), this._findReplaceService.stateUpdates$.pipe(oe(this.dispose$)).subscribe((t) => {
|
|
821
821
|
t.revealed === !0 && this._openPanel();
|
|
822
822
|
}), this.disposeWithMe(
|
|
823
|
-
this._univerInstanceService.focused$.pipe(
|
|
823
|
+
this._univerInstanceService.focused$.pipe(oe(this.dispose$)).subscribe((t) => {
|
|
824
824
|
(!t || !this._univerInstanceService.getUniverSheetInstance(t)) && this.closePanel();
|
|
825
825
|
})
|
|
826
826
|
);
|
|
827
827
|
}
|
|
828
828
|
_openPanel() {
|
|
829
829
|
this._dialogService.open({
|
|
830
|
-
id:
|
|
830
|
+
id: de,
|
|
831
831
|
draggable: !0,
|
|
832
|
-
width:
|
|
832
|
+
width: Le,
|
|
833
833
|
title: { title: this._localeService.t("find-replace.dialog.title") },
|
|
834
834
|
children: { label: "FindReplaceDialog" },
|
|
835
835
|
destroyOnClose: !0,
|
|
836
|
-
defaultPosition:
|
|
836
|
+
defaultPosition: Si(),
|
|
837
837
|
preservePositionOnDestroy: !0,
|
|
838
838
|
onClose: () => this.closePanel()
|
|
839
839
|
});
|
|
840
840
|
}
|
|
841
841
|
closePanel() {
|
|
842
|
-
this._dialogService.close(
|
|
842
|
+
this._dialogService.close(de), this._findReplaceService.terminate(), queueMicrotask(() => this._layoutService.focus());
|
|
843
843
|
}
|
|
844
844
|
};
|
|
845
|
-
A =
|
|
846
|
-
|
|
847
|
-
g(0,
|
|
848
|
-
g(1,
|
|
849
|
-
g(2,
|
|
850
|
-
g(3,
|
|
845
|
+
A = gi([
|
|
846
|
+
ht(ut.Rendered, A),
|
|
847
|
+
g(0, ue),
|
|
848
|
+
g(1, Rt),
|
|
849
|
+
g(2, bt),
|
|
850
|
+
g(3, te),
|
|
851
851
|
g(4, v),
|
|
852
|
-
g(5,
|
|
853
|
-
g(6,
|
|
852
|
+
g(5, pe),
|
|
853
|
+
g(6, xt),
|
|
854
854
|
g(7, U),
|
|
855
|
-
g(8,
|
|
855
|
+
g(8, ve),
|
|
856
856
|
g(9, y(D)),
|
|
857
|
-
g(10, y(
|
|
858
|
-
g(11, y(
|
|
857
|
+
g(10, y(Ct)),
|
|
858
|
+
g(11, y(ge))
|
|
859
859
|
], A);
|
|
860
|
-
function
|
|
860
|
+
function Si() {
|
|
861
861
|
const { innerWidth: t } = window;
|
|
862
|
-
return { x: (t -
|
|
862
|
+
return { x: (t - Le) / 2 - mi, y: vi };
|
|
863
863
|
}
|
|
864
|
-
const
|
|
864
|
+
const Ci = {
|
|
865
865
|
"find-replace": {
|
|
866
866
|
toolbar: "Find & Replace",
|
|
867
867
|
shortcut: {
|
|
@@ -908,7 +908,7 @@ const Si = {
|
|
|
908
908
|
}
|
|
909
909
|
},
|
|
910
910
|
"find-replace-shortcuts": "Find & Replace"
|
|
911
|
-
},
|
|
911
|
+
}, Li = Ci, Ri = {
|
|
912
912
|
"find-replace": {
|
|
913
913
|
toolbar: "查找替换",
|
|
914
914
|
shortcut: {
|
|
@@ -955,38 +955,39 @@ const Si = {
|
|
|
955
955
|
}
|
|
956
956
|
},
|
|
957
957
|
"find-replace-shortcuts": "查找替换"
|
|
958
|
-
},
|
|
959
|
-
var
|
|
960
|
-
for (var s = i > 1 ? void 0 : i ?
|
|
958
|
+
}, bi = Ri;
|
|
959
|
+
var xi = Object.defineProperty, Mi = Object.getOwnPropertyDescriptor, yi = (t, e, n, i) => {
|
|
960
|
+
for (var s = i > 1 ? void 0 : i ? Mi(e, n) : e, r = t.length - 1, a; r >= 0; r--)
|
|
961
961
|
(a = t[r]) && (s = (i ? a(e, n, s) : a(s)) || s);
|
|
962
|
-
return i && s &&
|
|
963
|
-
},
|
|
964
|
-
const
|
|
965
|
-
|
|
962
|
+
return i && s && xi(e, n, s), s;
|
|
963
|
+
}, Ii = (t, e) => (n, i) => e(n, i, t);
|
|
964
|
+
const Fi = "FIND_REPLACE";
|
|
965
|
+
var q;
|
|
966
|
+
let he = (q = class extends pt {
|
|
966
967
|
constructor(t, e) {
|
|
967
|
-
super(
|
|
968
|
-
zhCN:
|
|
968
|
+
super(), this._injector = t, this._localeService = e, this._localeService.load({
|
|
969
|
+
zhCN: bi
|
|
969
970
|
});
|
|
970
971
|
}
|
|
971
972
|
onStarting(t) {
|
|
972
|
-
[[A], [v, { useClass:
|
|
973
|
+
[[A], [v, { useClass: X }]].forEach(
|
|
973
974
|
(e) => {
|
|
974
975
|
t.add(e);
|
|
975
976
|
}
|
|
976
977
|
);
|
|
977
978
|
}
|
|
978
|
-
};
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
],
|
|
979
|
+
}, c(q, "pluginName", Fi), q);
|
|
980
|
+
he = yi([
|
|
981
|
+
Ii(1, y(D))
|
|
982
|
+
], he);
|
|
982
983
|
export {
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
984
|
+
J as FindBy,
|
|
985
|
+
Z as FindDirection,
|
|
986
|
+
ji as FindModel,
|
|
986
987
|
A as FindReplaceController,
|
|
987
|
-
|
|
988
|
+
Q as FindScope,
|
|
988
989
|
v as IFindReplaceService,
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
990
|
+
he as UniverFindReplacePlugin,
|
|
991
|
+
Li as enUS,
|
|
992
|
+
bi as zhCN
|
|
992
993
|
};
|