@univerjs/sheets-crosshair-highlight 0.5.5-nightly.202501211606 → 0.5.5
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/LICENSE +176 -0
- package/lib/es/facade.js +24 -31
- package/lib/es/index.js +314 -329
- package/lib/es/locale/en-US.js +2 -2
- package/lib/es/locale/fa-IR.js +2 -2
- package/lib/es/locale/fr-FR.js +2 -2
- package/lib/es/locale/ru-RU.js +2 -2
- package/lib/es/locale/vi-VN.js +2 -2
- package/lib/es/locale/zh-CN.js +2 -2
- package/lib/es/locale/zh-TW.js +2 -2
- package/lib/types/facade/f-univer.d.ts +0 -3
- package/package.json +6 -6
package/LICENSE
ADDED
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
package/lib/es/facade.js
CHANGED
|
@@ -1,50 +1,43 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const commandService = injector.get(ICommandService);
|
|
11
|
-
this.disposeWithMe(commandService.onCommandExecuted((commandInfo) => {
|
|
12
|
-
if (commandInfo.id === EnableCrosshairHighlightOperation.id || commandInfo.id === DisableCrosshairHighlightOperation.id) {
|
|
13
|
-
const activeSheet = this.getActiveSheet();
|
|
14
|
-
if (!activeSheet || !this._eventListend(this.Event.CrosshairHighlightEnabledChanged)) return;
|
|
1
|
+
import { FUniver as o, ICommandService as a } from "@univerjs/core";
|
|
2
|
+
import { EnableCrosshairHighlightOperation as h, DisableCrosshairHighlightOperation as r, SetCrosshairHighlightColorOperation as s, SheetsCrosshairHighlightService as n, CROSSHAIR_HIGHLIGHT_COLORS as l } from "@univerjs/sheets-crosshair-highlight";
|
|
3
|
+
class c extends o {
|
|
4
|
+
_initialize(i) {
|
|
5
|
+
const g = i.get(a);
|
|
6
|
+
this.disposeWithMe(g.onCommandExecuted((t) => {
|
|
7
|
+
if (t.id === h.id || t.id === r.id) {
|
|
8
|
+
const e = this.getActiveSheet();
|
|
9
|
+
if (!e || !this._eventListend(this.Event.CrosshairHighlightEnabledChanged)) return;
|
|
15
10
|
this.fireEvent(this.Event.CrosshairHighlightEnabledChanged, {
|
|
16
11
|
enabled: this.getCrosshairHighlightEnabled(),
|
|
17
|
-
...
|
|
12
|
+
...e
|
|
18
13
|
});
|
|
19
14
|
}
|
|
20
|
-
if (
|
|
21
|
-
const
|
|
22
|
-
if (!
|
|
15
|
+
if (t.id === s.id) {
|
|
16
|
+
const e = this.getActiveSheet();
|
|
17
|
+
if (!e || !this._eventListend(this.Event.CrosshairHighlightColorChanged)) return;
|
|
23
18
|
this.fireEvent(this.Event.CrosshairHighlightColorChanged, {
|
|
24
19
|
color: this.getCrosshairHighlightColor(),
|
|
25
|
-
...
|
|
20
|
+
...e
|
|
26
21
|
});
|
|
27
22
|
}
|
|
28
23
|
}));
|
|
29
24
|
}
|
|
30
|
-
setCrosshairHighlightEnabled(
|
|
31
|
-
return
|
|
25
|
+
setCrosshairHighlightEnabled(i) {
|
|
26
|
+
return i ? this._commandService.syncExecuteCommand(h.id) : this._commandService.syncExecuteCommand(r.id), this;
|
|
32
27
|
}
|
|
33
|
-
setCrosshairHighlightColor(
|
|
34
|
-
return this._commandService.syncExecuteCommand(
|
|
35
|
-
value:
|
|
28
|
+
setCrosshairHighlightColor(i) {
|
|
29
|
+
return this._commandService.syncExecuteCommand(s.id, {
|
|
30
|
+
value: i
|
|
36
31
|
}), this;
|
|
37
32
|
}
|
|
38
33
|
getCrosshairHighlightEnabled() {
|
|
39
|
-
return this._injector.get(
|
|
34
|
+
return this._injector.get(n).enabled;
|
|
40
35
|
}
|
|
41
36
|
getCrosshairHighlightColor() {
|
|
42
|
-
return this._injector.get(
|
|
37
|
+
return this._injector.get(n).color;
|
|
43
38
|
}
|
|
44
39
|
get CROSSHAIR_HIGHLIGHT_COLORS() {
|
|
45
|
-
return
|
|
40
|
+
return l;
|
|
46
41
|
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
let FUniverCrosshairHighlightMixin = _FUniverCrosshairHighlightMixin;
|
|
50
|
-
FUniver.extend(FUniverCrosshairHighlightMixin);
|
|
42
|
+
}
|
|
43
|
+
o.extend(c);
|
package/lib/es/index.js
CHANGED
|
@@ -1,71 +1,66 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
s =
|
|
17
|
-
for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && (t[p] = s[p]);
|
|
1
|
+
var re = Object.defineProperty;
|
|
2
|
+
var ne = (n, e, t) => e in n ? re(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
3
|
+
var h = (n, e, t) => ne(n, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { Disposable as $, CommandType as O, useDependency as se, useObservable as ie, UniverInstanceType as x, Inject as p, ICommandService as oe, RANGE_TYPE as v, Rectangle as T, IContextService as ae, ColorKit as ce, Plugin as le, merge as he, Injector as ge, IConfigService as ue } from "@univerjs/core";
|
|
5
|
+
import { Shape as de, Rect as fe, IRenderManagerService as _e } from "@univerjs/engine-render";
|
|
6
|
+
import { MenuItemType as Se, getMenuHiddenObservable as pe, ContextMenuPosition as ve, ContextMenuGroup as me, ComponentManager as Ce, IMenuManagerService as Re } from "@univerjs/ui";
|
|
7
|
+
import { BehaviorSubject as N, combineLatest as be, startWith as He, tap as Oe, merge as j, map as V } from "rxjs";
|
|
8
|
+
import Ie, { forwardRef as Z, useRef as ye, createElement as B, useCallback as Ee } from "react";
|
|
9
|
+
import { SheetsSelectionsService as we, REF_SELECTIONS_ENABLED as xe, IRefSelectionsService as $e } from "@univerjs/sheets";
|
|
10
|
+
import { SheetSkeletonManagerService as Me, getCoordByCell as L } from "@univerjs/sheets-ui";
|
|
11
|
+
const Pe = "sheets-crosshair-highlight.config", A = {};
|
|
12
|
+
var g = function() {
|
|
13
|
+
return g = Object.assign || function(n) {
|
|
14
|
+
for (var e, t = 1, r = arguments.length; t < r; t++) {
|
|
15
|
+
e = arguments[t];
|
|
16
|
+
for (var s in e) Object.prototype.hasOwnProperty.call(e, s) && (n[s] = e[s]);
|
|
18
17
|
}
|
|
19
|
-
return
|
|
20
|
-
},
|
|
21
|
-
},
|
|
18
|
+
return n;
|
|
19
|
+
}, g.apply(this, arguments);
|
|
20
|
+
}, Te = function(n, e) {
|
|
22
21
|
var t = {};
|
|
23
|
-
for (var
|
|
24
|
-
if (
|
|
25
|
-
for (var
|
|
26
|
-
e.indexOf(
|
|
22
|
+
for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && e.indexOf(r) < 0 && (t[r] = n[r]);
|
|
23
|
+
if (n != null && typeof Object.getOwnPropertySymbols == "function")
|
|
24
|
+
for (var s = 0, r = Object.getOwnPropertySymbols(n); s < r.length; s++)
|
|
25
|
+
e.indexOf(r[s]) < 0 && Object.prototype.propertyIsEnumerable.call(n, r[s]) && (t[r[s]] = n[r[s]]);
|
|
27
26
|
return t;
|
|
28
|
-
},
|
|
29
|
-
var
|
|
30
|
-
return
|
|
27
|
+
}, F = Z(function(n, e) {
|
|
28
|
+
var t = n.icon, r = n.id, s = n.className, i = n.extend, o = Te(n, ["icon", "id", "className", "extend"]), a = "univerjs-icon univerjs-icon-".concat(r, " ").concat(s || "").trim(), c = ye("_".concat(Ve()));
|
|
29
|
+
return W(t, "".concat(r), { defIds: t.defIds, idSuffix: c.current }, g({ ref: e, className: a }, o), i);
|
|
31
30
|
});
|
|
32
|
-
function
|
|
33
|
-
return
|
|
34
|
-
return
|
|
31
|
+
function W(n, e, t, r, s) {
|
|
32
|
+
return B(n.tag, g(g({ key: e }, Ne(n, t, s)), r), (je(n, t).children || []).map(function(i, o) {
|
|
33
|
+
return W(i, "".concat(e, "-").concat(n.tag, "-").concat(o), t, void 0, s);
|
|
35
34
|
}));
|
|
36
35
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
})), attrs;
|
|
36
|
+
function Ne(n, e, t) {
|
|
37
|
+
var r = g({}, n.attrs);
|
|
38
|
+
t != null && t.colorChannel1 && r.fill === "colorChannel1" && (r.fill = t.colorChannel1);
|
|
39
|
+
var s = e.defIds;
|
|
40
|
+
return !s || s.length === 0 || (n.tag === "use" && r["xlink:href"] && (r["xlink:href"] = r["xlink:href"] + e.idSuffix), Object.entries(r).forEach(function(i) {
|
|
41
|
+
var o = i[0], a = i[1];
|
|
42
|
+
typeof a == "string" && (r[o] = a.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
|
|
43
|
+
})), r;
|
|
46
44
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}) }) : node;
|
|
45
|
+
function je(n, e) {
|
|
46
|
+
var t, r = e.defIds;
|
|
47
|
+
return !r || r.length === 0 ? n : n.tag === "defs" && (!((t = n.children) === null || t === void 0) && t.length) ? g(g({}, n), { children: n.children.map(function(s) {
|
|
48
|
+
return typeof s.attrs.id == "string" && r && r.indexOf(s.attrs.id) > -1 ? g(g({}, s), { attrs: g(g({}, s.attrs), { id: s.attrs.id + e.idSuffix }) }) : s;
|
|
49
|
+
}) }) : n;
|
|
53
50
|
}
|
|
54
|
-
|
|
55
|
-
function generateShortUuid() {
|
|
51
|
+
function Ve() {
|
|
56
52
|
return Math.random().toString(36).substring(2, 8);
|
|
57
53
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
return createElement(IconBase, Object.assign({}, props, {
|
|
54
|
+
F.displayName = "UniverIcon";
|
|
55
|
+
var Le = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "#E5E5E5", d: "M1.6499 3.65002C1.6499 2.54545 2.54533 1.65002 3.6499 1.65002H12.3499C13.4545 1.65002 14.3499 2.54545 14.3499 3.65002V12.35C14.3499 13.4546 13.4545 14.35 12.3499 14.35H3.6499C2.54533 14.35 1.6499 13.4546 1.6499 12.35V3.65002Z" } }, { tag: "path", attrs: { fill: "#fff", d: "M9.9998 1.65002H5.9998V6H1.6499V10H5.9998V14.35H9.9998V10H14.3499V6H9.9998V1.65002Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M3.6498 1.05005C2.21386 1.05005 1.0498 2.21411 1.0498 3.65005V12.35C1.0498 13.786 2.21386 14.95 3.6498 14.95H12.3498C13.7857 14.95 14.9498 13.786 14.9498 12.3501V3.65005C14.9498 2.21411 13.7857 1.05005 12.3498 1.05005H3.6498ZM5.4002 2.25005H3.6498C2.87661 2.25005 2.2498 2.87685 2.2498 3.65005V5.40002H5.4002V2.25005ZM2.2498 10.6V12.35C2.2498 13.1232 2.87661 13.75 3.6498 13.75H5.4002V10.6H2.2498ZM6.60019 13.75H9.4002V9.40002H13.7498V6.60002H9.4002V2.25005H6.60019V6.60002H2.25029V9.40002H6.60019V13.75ZM10.6002 2.25005V5.40002H13.7498V3.65005C13.7498 2.87685 13.123 2.25005 12.3498 2.25005H10.6002ZM13.7498 10.6H10.6002V13.75H12.3498C13.123 13.75 13.7498 13.1232 13.7498 12.3501V10.6Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Y = Z(function(n, e) {
|
|
56
|
+
return B(F, Object.assign({}, n, {
|
|
62
57
|
id: "cross-highlighting-single",
|
|
63
|
-
ref,
|
|
64
|
-
icon:
|
|
58
|
+
ref: e,
|
|
59
|
+
icon: Le
|
|
65
60
|
}));
|
|
66
61
|
});
|
|
67
|
-
|
|
68
|
-
const
|
|
62
|
+
Y.displayName = "CrossHighlightingSingle";
|
|
63
|
+
const q = [
|
|
69
64
|
"rgba(158, 109, 227, 0.3)",
|
|
70
65
|
"rgba(254, 75, 75, 0.3)",
|
|
71
66
|
"rgba(255, 140, 81, 0.3)",
|
|
@@ -82,13 +77,14 @@ const CROSSHAIR_HIGHLIGHT_COLORS = [
|
|
|
82
77
|
"rgba(58, 96, 247, 0.15)",
|
|
83
78
|
"rgba(242, 72, 166, 0.15)",
|
|
84
79
|
"rgba(153, 153, 153, 0.15)"
|
|
85
|
-
]
|
|
80
|
+
];
|
|
81
|
+
class S extends $ {
|
|
86
82
|
constructor() {
|
|
87
83
|
super(...arguments);
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
84
|
+
h(this, "_enabled$", new N(!1));
|
|
85
|
+
h(this, "enabled$", this._enabled$.asObservable());
|
|
86
|
+
h(this, "_color$", new N(q[0]));
|
|
87
|
+
h(this, "color$", this._color$.asObservable());
|
|
92
88
|
}
|
|
93
89
|
get enabled() {
|
|
94
90
|
return this._enabled$.getValue();
|
|
@@ -99,45 +95,43 @@ const CROSSHAIR_HIGHLIGHT_COLORS = [
|
|
|
99
95
|
dispose() {
|
|
100
96
|
this._enabled$.complete();
|
|
101
97
|
}
|
|
102
|
-
setEnabled(
|
|
103
|
-
this._enabled$.next(
|
|
98
|
+
setEnabled(t) {
|
|
99
|
+
this._enabled$.next(t);
|
|
104
100
|
}
|
|
105
|
-
setColor(
|
|
106
|
-
this._color$.next(
|
|
101
|
+
setColor(t) {
|
|
102
|
+
this._color$.next(t);
|
|
107
103
|
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
let SheetsCrosshairHighlightService = _SheetsCrosshairHighlightService;
|
|
111
|
-
const ToggleCrosshairHighlightOperation = {
|
|
104
|
+
}
|
|
105
|
+
const M = {
|
|
112
106
|
id: "sheet.operation.toggle-crosshair-highlight",
|
|
113
|
-
type:
|
|
114
|
-
handler(
|
|
115
|
-
const
|
|
116
|
-
return
|
|
107
|
+
type: O.OPERATION,
|
|
108
|
+
handler(n) {
|
|
109
|
+
const e = n.get(S), t = e.enabled;
|
|
110
|
+
return e.setEnabled(!t), !0;
|
|
117
111
|
}
|
|
118
|
-
},
|
|
112
|
+
}, J = {
|
|
119
113
|
id: "sheet.operation.set-crosshair-highlight-color",
|
|
120
|
-
type:
|
|
121
|
-
handler(
|
|
122
|
-
const
|
|
123
|
-
return
|
|
114
|
+
type: O.OPERATION,
|
|
115
|
+
handler(n, { value: e }) {
|
|
116
|
+
const t = n.get(S);
|
|
117
|
+
return t.enabled || t.setEnabled(!0), t.setColor(e), !0;
|
|
124
118
|
}
|
|
125
|
-
},
|
|
119
|
+
}, Ae = {
|
|
126
120
|
id: "sheet.operation.enable-crosshair-highlight",
|
|
127
|
-
type:
|
|
128
|
-
handler(
|
|
129
|
-
const
|
|
130
|
-
return
|
|
121
|
+
type: O.OPERATION,
|
|
122
|
+
handler(n) {
|
|
123
|
+
const e = n.get(S);
|
|
124
|
+
return e.enabled ? !1 : (e.setEnabled(!0), !0);
|
|
131
125
|
}
|
|
132
|
-
},
|
|
126
|
+
}, Ge = {
|
|
133
127
|
id: "sheet.operation.disable-crosshair-highlight",
|
|
134
|
-
type:
|
|
135
|
-
handler(
|
|
136
|
-
const
|
|
137
|
-
return
|
|
128
|
+
type: O.OPERATION,
|
|
129
|
+
handler(n) {
|
|
130
|
+
const e = n.get(S);
|
|
131
|
+
return e.enabled ? (e.setEnabled(!1), !0) : !1;
|
|
138
132
|
}
|
|
139
133
|
};
|
|
140
|
-
var
|
|
134
|
+
var I = { exports: {} }, m = {};
|
|
141
135
|
/**
|
|
142
136
|
* @license React
|
|
143
137
|
* react-jsx-runtime.production.min.js
|
|
@@ -147,158 +141,153 @@ var jsxRuntime = { exports: {} }, reactJsxRuntime_production_min = {};
|
|
|
147
141
|
* This source code is licensed under the MIT license found in the
|
|
148
142
|
* LICENSE file in the root directory of this source tree.
|
|
149
143
|
*/
|
|
150
|
-
var
|
|
151
|
-
function
|
|
152
|
-
if (
|
|
153
|
-
|
|
154
|
-
var
|
|
155
|
-
function
|
|
156
|
-
var
|
|
157
|
-
|
|
158
|
-
for (
|
|
159
|
-
if (
|
|
160
|
-
return { $$typeof:
|
|
161
|
-
}
|
|
162
|
-
return
|
|
144
|
+
var G;
|
|
145
|
+
function Ue() {
|
|
146
|
+
if (G) return m;
|
|
147
|
+
G = 1;
|
|
148
|
+
var n = Ie, e = Symbol.for("react.element"), t = Symbol.for("react.fragment"), r = Object.prototype.hasOwnProperty, s = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, i = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
149
|
+
function o(a, c, f) {
|
|
150
|
+
var l, d = {}, _ = null, u = null;
|
|
151
|
+
f !== void 0 && (_ = "" + f), c.key !== void 0 && (_ = "" + c.key), c.ref !== void 0 && (u = c.ref);
|
|
152
|
+
for (l in c) r.call(c, l) && !i.hasOwnProperty(l) && (d[l] = c[l]);
|
|
153
|
+
if (a && a.defaultProps) for (l in c = a.defaultProps, c) d[l] === void 0 && (d[l] = c[l]);
|
|
154
|
+
return { $$typeof: e, type: a, key: _, ref: u, props: d, _owner: s.current };
|
|
155
|
+
}
|
|
156
|
+
return m.Fragment = t, m.jsx = o, m.jsxs = o, m;
|
|
163
157
|
}
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
return hasRequiredJsxRuntime || (hasRequiredJsxRuntime = 1, jsxRuntime.exports = requireReactJsxRuntime_production_min()), jsxRuntime.exports;
|
|
158
|
+
var U;
|
|
159
|
+
function De() {
|
|
160
|
+
return U || (U = 1, I.exports = Ue()), I.exports;
|
|
168
161
|
}
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
if (typeof
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
return n;
|
|
162
|
+
var D = De();
|
|
163
|
+
function X(n) {
|
|
164
|
+
var e, t, r = "";
|
|
165
|
+
if (typeof n == "string" || typeof n == "number") r += n;
|
|
166
|
+
else if (typeof n == "object") if (Array.isArray(n)) {
|
|
167
|
+
var s = n.length;
|
|
168
|
+
for (e = 0; e < s; e++) n[e] && (t = X(n[e])) && (r && (r += " "), r += t);
|
|
169
|
+
} else for (t in n) n[t] && (r && (r += " "), r += t);
|
|
170
|
+
return r;
|
|
179
171
|
}
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
return n;
|
|
172
|
+
function ke() {
|
|
173
|
+
for (var n, e, t = 0, r = "", s = arguments.length; t < s; t++) (n = arguments[t]) && (e = X(n)) && (r && (r += " "), r += e);
|
|
174
|
+
return r;
|
|
184
175
|
}
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
crosshairHighlightItemSelected
|
|
176
|
+
const Ze = "univer-crosshair-highlight-overlay", Be = "univer-crosshair-highlight-item", Fe = "univer-crosshair-highlight-item-selected", y = {
|
|
177
|
+
crosshairHighlightOverlay: Ze,
|
|
178
|
+
crosshairHighlightItem: Be,
|
|
179
|
+
crosshairHighlightItemSelected: Fe
|
|
190
180
|
};
|
|
191
|
-
function
|
|
192
|
-
const { onChange } =
|
|
193
|
-
|
|
194
|
-
}, [
|
|
195
|
-
return /* @__PURE__ */
|
|
181
|
+
function We(n) {
|
|
182
|
+
const { onChange: e } = n, t = se(S), r = ie(t.color$), s = Ee((i) => {
|
|
183
|
+
e == null || e(i);
|
|
184
|
+
}, [e]);
|
|
185
|
+
return /* @__PURE__ */ D.jsx("div", { className: y.crosshairHighlightOverlay, children: q.map((i) => /* @__PURE__ */ D.jsx(
|
|
196
186
|
"div",
|
|
197
187
|
{
|
|
198
|
-
className:
|
|
199
|
-
[
|
|
188
|
+
className: ke(y.crosshairHighlightItem, {
|
|
189
|
+
[y.crosshairHighlightItemSelected]: i === r
|
|
200
190
|
}),
|
|
201
|
-
style: { backgroundColor:
|
|
202
|
-
onClick:
|
|
191
|
+
style: { backgroundColor: i },
|
|
192
|
+
onClick: () => s(i)
|
|
203
193
|
},
|
|
204
|
-
|
|
194
|
+
i
|
|
205
195
|
)) });
|
|
206
196
|
}
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
const crosshairHighlightService = accessor.get(SheetsCrosshairHighlightService);
|
|
197
|
+
const K = "CROSSHAIR_HIGHLIGHT_OVERLAY_COMPONENT";
|
|
198
|
+
function Ye(n) {
|
|
199
|
+
const e = n.get(S);
|
|
211
200
|
return {
|
|
212
|
-
id:
|
|
201
|
+
id: M.id,
|
|
213
202
|
tooltip: "crosshair.button.tooltip",
|
|
214
|
-
type:
|
|
203
|
+
type: Se.BUTTON_SELECTOR,
|
|
215
204
|
icon: "CrossHighlightingSingle",
|
|
216
205
|
selections: [
|
|
217
206
|
{
|
|
218
207
|
label: {
|
|
219
|
-
name:
|
|
208
|
+
name: K,
|
|
220
209
|
hoverable: !1
|
|
221
210
|
}
|
|
222
211
|
}
|
|
223
212
|
],
|
|
224
|
-
selectionsCommandId:
|
|
225
|
-
activated$:
|
|
226
|
-
hidden$:
|
|
213
|
+
selectionsCommandId: J.id,
|
|
214
|
+
activated$: e.enabled$,
|
|
215
|
+
hidden$: pe(n, x.UNIVER_SHEET)
|
|
227
216
|
};
|
|
228
217
|
}
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
[ToggleCrosshairHighlightOperation.id]: {
|
|
218
|
+
const qe = {
|
|
219
|
+
[ve.FOOTER_MENU]: {
|
|
220
|
+
[me.OTHERS]: {
|
|
221
|
+
[M.id]: {
|
|
234
222
|
order: 0,
|
|
235
|
-
menuItemFactory:
|
|
223
|
+
menuItemFactory: Ye
|
|
236
224
|
}
|
|
237
225
|
}
|
|
238
226
|
}
|
|
239
227
|
};
|
|
240
|
-
var
|
|
241
|
-
for (var
|
|
242
|
-
(
|
|
243
|
-
return
|
|
244
|
-
},
|
|
245
|
-
let
|
|
246
|
-
constructor(
|
|
247
|
-
super(), this._componentMgr =
|
|
228
|
+
var Je = Object.defineProperty, Xe = Object.getOwnPropertyDescriptor, Ke = (n, e, t, r) => {
|
|
229
|
+
for (var s = r > 1 ? void 0 : r ? Xe(e, t) : e, i = n.length - 1, o; i >= 0; i--)
|
|
230
|
+
(o = n[i]) && (s = (r ? o(e, t, s) : o(s)) || s);
|
|
231
|
+
return r && s && Je(e, t, s), s;
|
|
232
|
+
}, E = (n, e) => (t, r) => e(t, r, n);
|
|
233
|
+
let b = class extends $ {
|
|
234
|
+
constructor(n, e, t) {
|
|
235
|
+
super(), this._componentMgr = n, this._menuManagerService = e, this._cmdSrv = t, this._initCommands(), this._initMenus(), this._initComponents();
|
|
248
236
|
}
|
|
249
237
|
_initCommands() {
|
|
250
238
|
[
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
].forEach((
|
|
239
|
+
M,
|
|
240
|
+
J,
|
|
241
|
+
Ae,
|
|
242
|
+
Ge
|
|
243
|
+
].forEach((n) => this._cmdSrv.registerCommand(n));
|
|
256
244
|
}
|
|
257
245
|
_initMenus() {
|
|
258
|
-
this._menuManagerService.mergeMenu(
|
|
246
|
+
this._menuManagerService.mergeMenu(qe);
|
|
259
247
|
}
|
|
260
248
|
_initComponents() {
|
|
261
|
-
this._componentMgr.register(
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
],
|
|
269
|
-
const
|
|
249
|
+
this._componentMgr.register(K, We), this._componentMgr.register("CrossHighlightingSingle", Y);
|
|
250
|
+
}
|
|
251
|
+
};
|
|
252
|
+
b = Ke([
|
|
253
|
+
E(0, p(Ce)),
|
|
254
|
+
E(1, Re),
|
|
255
|
+
E(2, oe)
|
|
256
|
+
], b);
|
|
257
|
+
const ze = 1;
|
|
258
|
+
class Qe {
|
|
270
259
|
constructor() {
|
|
271
|
-
|
|
272
|
-
|
|
260
|
+
h(this, "_selectedRanges", []);
|
|
261
|
+
h(this, "_ranges", []);
|
|
273
262
|
}
|
|
274
|
-
addRange(
|
|
275
|
-
if (
|
|
263
|
+
addRange(e) {
|
|
264
|
+
if (e.rangeType === v.COLUMN || e.rangeType === v.ROW || e.rangeType === v.ALL)
|
|
276
265
|
return;
|
|
277
|
-
const
|
|
278
|
-
|
|
279
|
-
}
|
|
280
|
-
setSelectedRanges(
|
|
281
|
-
this._selectedRanges =
|
|
282
|
-
}
|
|
283
|
-
_getSplitRanges(
|
|
284
|
-
let
|
|
285
|
-
for (const
|
|
286
|
-
const
|
|
287
|
-
for (const
|
|
288
|
-
const
|
|
289
|
-
|
|
266
|
+
const t = this._getIntersects(e), r = this._getSplitRanges(e, t);
|
|
267
|
+
r.length > 0 && this._ranges.push(...r);
|
|
268
|
+
}
|
|
269
|
+
setSelectedRanges(e) {
|
|
270
|
+
this._selectedRanges = e;
|
|
271
|
+
}
|
|
272
|
+
_getSplitRanges(e, t) {
|
|
273
|
+
let r = [e];
|
|
274
|
+
for (const s of t.concat(this._selectedRanges)) {
|
|
275
|
+
const i = [];
|
|
276
|
+
for (const o of r) {
|
|
277
|
+
const a = T.subtract(o, s);
|
|
278
|
+
a && a.length > 0 && i.push(...a);
|
|
290
279
|
}
|
|
291
|
-
|
|
280
|
+
r = i;
|
|
292
281
|
}
|
|
293
|
-
return
|
|
282
|
+
return r.filter((s) => s.startRow <= s.endRow && s.startColumn <= s.endColumn);
|
|
294
283
|
}
|
|
295
|
-
_getIntersects(
|
|
296
|
-
const
|
|
297
|
-
for (const
|
|
298
|
-
const
|
|
299
|
-
|
|
284
|
+
_getIntersects(e) {
|
|
285
|
+
const t = [];
|
|
286
|
+
for (const r of this._ranges) {
|
|
287
|
+
const s = T.getIntersects(r, e);
|
|
288
|
+
s && t.push(s);
|
|
300
289
|
}
|
|
301
|
-
return
|
|
290
|
+
return t;
|
|
302
291
|
}
|
|
303
292
|
getRanges() {
|
|
304
293
|
return this._ranges;
|
|
@@ -306,193 +295,189 @@ const SHEETS_CROSSHAIR_HIGHLIGHT_Z_INDEX = 1, _CrossHairRangeCollection = class
|
|
|
306
295
|
reset() {
|
|
307
296
|
this._ranges = [], this._selectedRanges = [];
|
|
308
297
|
}
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
constructor(key, props) {
|
|
314
|
-
super(key, props);
|
|
298
|
+
}
|
|
299
|
+
class et extends de {
|
|
300
|
+
constructor(t, r) {
|
|
301
|
+
super(t, r);
|
|
315
302
|
// protected _showHighLight = false;
|
|
316
|
-
|
|
317
|
-
|
|
303
|
+
h(this, "_color");
|
|
304
|
+
r && this.setShapeProps(r);
|
|
318
305
|
}
|
|
319
|
-
setShapeProps(
|
|
320
|
-
typeof
|
|
321
|
-
width:
|
|
322
|
-
height:
|
|
306
|
+
setShapeProps(t) {
|
|
307
|
+
typeof t.color < "u" && (this._color = t.color), this.transformByState({
|
|
308
|
+
width: t.width,
|
|
309
|
+
height: t.height
|
|
323
310
|
});
|
|
324
311
|
}
|
|
325
|
-
_draw(
|
|
326
|
-
const
|
|
327
|
-
|
|
312
|
+
_draw(t) {
|
|
313
|
+
const r = `rgba(${this._color.r}, ${this._color.g}, ${this._color.b}, ${this._color.a})`;
|
|
314
|
+
fe.drawWith(t, {
|
|
328
315
|
width: this.width,
|
|
329
316
|
height: this.height,
|
|
330
|
-
fill:
|
|
317
|
+
fill: r,
|
|
331
318
|
stroke: void 0,
|
|
332
319
|
strokeWidth: 0,
|
|
333
320
|
evented: !1
|
|
334
321
|
});
|
|
335
322
|
}
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
let SheetCrosshairHighlightRenderController = (_a2 = class extends Disposable {
|
|
345
|
-
constructor(_context, _sheetSkeletonManagerService, _sheetsSelectionsService, _sheetsCrosshairHighlightService, _contextService, _refSelectionsService) {
|
|
323
|
+
}
|
|
324
|
+
var tt = Object.defineProperty, rt = Object.getOwnPropertyDescriptor, nt = (n, e, t, r) => {
|
|
325
|
+
for (var s = r > 1 ? void 0 : r ? rt(e, t) : e, i = n.length - 1, o; i >= 0; i--)
|
|
326
|
+
(o = n[i]) && (s = (r ? o(e, t, s) : o(s)) || s);
|
|
327
|
+
return r && s && tt(e, t, s), s;
|
|
328
|
+
}, C = (n, e) => (t, r) => e(t, r, n);
|
|
329
|
+
let H = class extends $ {
|
|
330
|
+
constructor(e, t, r, s, i, o) {
|
|
346
331
|
super();
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
this._context =
|
|
332
|
+
h(this, "_shapes", []);
|
|
333
|
+
h(this, "_rangeCollection", new Qe());
|
|
334
|
+
h(this, "_color", "rgba(255,0,0,0.5)");
|
|
335
|
+
this._context = e, this._sheetSkeletonManagerService = t, this._sheetsSelectionsService = r, this._sheetsCrosshairHighlightService = s, this._contextService = i, this._refSelectionsService = o, this._initRenderListener();
|
|
351
336
|
}
|
|
352
|
-
_transformSelection(
|
|
353
|
-
if (!
|
|
337
|
+
_transformSelection(e, t) {
|
|
338
|
+
if (!e)
|
|
354
339
|
return;
|
|
355
|
-
const
|
|
356
|
-
for (const
|
|
357
|
-
const { startRow, endRow, startColumn, endColumn } =
|
|
358
|
-
|
|
340
|
+
const r = t.getRowCount(), s = t.getColumnCount(), i = [];
|
|
341
|
+
for (const o of e) {
|
|
342
|
+
const { startRow: a, endRow: c, startColumn: f, endColumn: l } = o.range;
|
|
343
|
+
c - a + 1 === r || l - f + 1 === s || i.push(o.range);
|
|
359
344
|
}
|
|
360
|
-
this._rangeCollection.setSelectedRanges(
|
|
361
|
-
for (const
|
|
362
|
-
this.addSelection(
|
|
345
|
+
this._rangeCollection.setSelectedRanges(i);
|
|
346
|
+
for (const o of i)
|
|
347
|
+
this.addSelection(o, t);
|
|
363
348
|
}
|
|
364
349
|
_initRenderListener() {
|
|
365
|
-
const
|
|
366
|
-
this.disposeWithMe(
|
|
367
|
-
this._contextService.subscribeContextValue$(
|
|
350
|
+
const e = this._context.unit;
|
|
351
|
+
this.disposeWithMe(be([
|
|
352
|
+
this._contextService.subscribeContextValue$(xe).pipe(He(!1)),
|
|
368
353
|
this._sheetSkeletonManagerService.currentSkeleton$,
|
|
369
354
|
this._sheetsCrosshairHighlightService.enabled$,
|
|
370
|
-
this._sheetsCrosshairHighlightService.color$.pipe(
|
|
371
|
-
|
|
355
|
+
this._sheetsCrosshairHighlightService.color$.pipe(Oe((t) => this._color = t)),
|
|
356
|
+
j(
|
|
372
357
|
this._sheetsSelectionsService.selectionMoveStart$,
|
|
373
358
|
this._sheetsSelectionsService.selectionMoving$,
|
|
374
359
|
this._sheetsSelectionsService.selectionMoveEnd$,
|
|
375
360
|
this._sheetsSelectionsService.selectionSet$,
|
|
376
|
-
|
|
361
|
+
e.activeSheet$.pipe(V(() => this._sheetsSelectionsService.getCurrentSelections()))
|
|
377
362
|
),
|
|
378
|
-
|
|
363
|
+
j(
|
|
379
364
|
this._refSelectionsService.selectionMoveStart$,
|
|
380
365
|
this._refSelectionsService.selectionMoving$,
|
|
381
366
|
this._refSelectionsService.selectionMoveEnd$,
|
|
382
367
|
this._sheetsSelectionsService.selectionSet$,
|
|
383
|
-
|
|
368
|
+
e.activeSheet$.pipe(V(() => this._refSelectionsService.getCurrentSelections()))
|
|
384
369
|
)
|
|
385
|
-
]).subscribe(([
|
|
386
|
-
if (this._clear(), !
|
|
387
|
-
const
|
|
388
|
-
this._rangeCollection.reset(), this._transformSelection(
|
|
370
|
+
]).subscribe(([t, r, s, i, o, a]) => {
|
|
371
|
+
if (this._clear(), !s) return;
|
|
372
|
+
const c = t ? a : o;
|
|
373
|
+
this._rangeCollection.reset(), this._transformSelection(c, e.getActiveSheet()), this.render(this._rangeCollection.getRanges());
|
|
389
374
|
}));
|
|
390
375
|
}
|
|
391
|
-
addSelection(
|
|
392
|
-
if (
|
|
376
|
+
addSelection(e, t) {
|
|
377
|
+
if (e.rangeType === v.COLUMN || e.rangeType === v.ROW || e.rangeType === v.ALL)
|
|
393
378
|
return;
|
|
394
|
-
const
|
|
395
|
-
startRow,
|
|
396
|
-
endRow,
|
|
379
|
+
const r = t.getRowCount(), s = t.getColumnCount(), { startRow: i, endRow: o, startColumn: a, endColumn: c } = e, f = {
|
|
380
|
+
startRow: i,
|
|
381
|
+
endRow: o,
|
|
397
382
|
startColumn: 0,
|
|
398
|
-
endColumn:
|
|
399
|
-
},
|
|
400
|
-
startRow,
|
|
401
|
-
endRow,
|
|
402
|
-
startColumn:
|
|
403
|
-
endColumn:
|
|
404
|
-
},
|
|
383
|
+
endColumn: a - 1
|
|
384
|
+
}, l = {
|
|
385
|
+
startRow: i,
|
|
386
|
+
endRow: o,
|
|
387
|
+
startColumn: c + 1,
|
|
388
|
+
endColumn: s
|
|
389
|
+
}, d = {
|
|
405
390
|
startRow: 0,
|
|
406
|
-
endRow:
|
|
407
|
-
startColumn,
|
|
408
|
-
endColumn
|
|
409
|
-
},
|
|
410
|
-
startRow:
|
|
411
|
-
endRow:
|
|
412
|
-
startColumn,
|
|
413
|
-
endColumn
|
|
391
|
+
endRow: i - 1,
|
|
392
|
+
startColumn: a,
|
|
393
|
+
endColumn: c
|
|
394
|
+
}, _ = {
|
|
395
|
+
startRow: o + 1,
|
|
396
|
+
endRow: r,
|
|
397
|
+
startColumn: a,
|
|
398
|
+
endColumn: c
|
|
414
399
|
};
|
|
415
|
-
for (const
|
|
416
|
-
|
|
400
|
+
for (const u of [f, l, d, _])
|
|
401
|
+
u.startRow <= u.endRow && u.startColumn <= u.endColumn && this._rangeCollection.addRange(u);
|
|
417
402
|
}
|
|
418
403
|
_clear() {
|
|
419
|
-
this._shapes.forEach((
|
|
420
|
-
|
|
404
|
+
this._shapes.forEach((e) => {
|
|
405
|
+
e.dispose();
|
|
421
406
|
}), this._shapes = [];
|
|
422
407
|
}
|
|
423
|
-
_addShapes(
|
|
424
|
-
const { startRow, endRow, startColumn, endColumn } =
|
|
425
|
-
left:
|
|
426
|
-
top:
|
|
427
|
-
color: new
|
|
428
|
-
width,
|
|
429
|
-
height,
|
|
430
|
-
zIndex:
|
|
408
|
+
_addShapes(e, t, r, s) {
|
|
409
|
+
const { startRow: i, endRow: o, startColumn: a, endColumn: c } = e, f = L(i, a, r, s), l = L(o, c, r, s), { startX: d, startY: _ } = f, { endX: u, endY: z } = l, Q = u - d, ee = z - _, te = {
|
|
410
|
+
left: d,
|
|
411
|
+
top: _,
|
|
412
|
+
color: new ce(this._color).toRgb(),
|
|
413
|
+
width: Q,
|
|
414
|
+
height: ee,
|
|
415
|
+
zIndex: ze,
|
|
431
416
|
evented: !1
|
|
432
|
-
},
|
|
433
|
-
this._shapes.push(
|
|
417
|
+
}, P = new et(`crosshair-${t}`, te);
|
|
418
|
+
this._shapes.push(P), r.addObject(P);
|
|
434
419
|
}
|
|
435
|
-
render(
|
|
436
|
-
const
|
|
437
|
-
if (!
|
|
420
|
+
render(e) {
|
|
421
|
+
const t = this._sheetSkeletonManagerService.getCurrentSkeleton();
|
|
422
|
+
if (!t)
|
|
438
423
|
return;
|
|
439
|
-
const { scene } = this._context;
|
|
424
|
+
const { scene: r } = this._context;
|
|
440
425
|
this._clear();
|
|
441
|
-
for (let
|
|
442
|
-
const
|
|
443
|
-
this._addShapes(
|
|
426
|
+
for (let s = 0; s < e.length; s++) {
|
|
427
|
+
const i = e[s];
|
|
428
|
+
this._addShapes(i, s, r, t);
|
|
444
429
|
}
|
|
445
|
-
|
|
430
|
+
r.makeDirty(!0);
|
|
446
431
|
}
|
|
447
432
|
async dispose() {
|
|
448
433
|
super.dispose();
|
|
449
434
|
}
|
|
450
|
-
}
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
],
|
|
458
|
-
var
|
|
459
|
-
for (var
|
|
460
|
-
(
|
|
461
|
-
return
|
|
462
|
-
},
|
|
463
|
-
let
|
|
464
|
-
constructor(
|
|
465
|
-
super(), this._config =
|
|
466
|
-
const { ...
|
|
435
|
+
};
|
|
436
|
+
H = nt([
|
|
437
|
+
C(1, p(Me)),
|
|
438
|
+
C(2, p(we)),
|
|
439
|
+
C(3, p(S)),
|
|
440
|
+
C(4, p(ae)),
|
|
441
|
+
C(5, $e)
|
|
442
|
+
], H);
|
|
443
|
+
var st = Object.defineProperty, it = Object.getOwnPropertyDescriptor, ot = (n, e, t, r) => {
|
|
444
|
+
for (var s = r > 1 ? void 0 : r ? it(e, t) : e, i = n.length - 1, o; i >= 0; i--)
|
|
445
|
+
(o = n[i]) && (s = (r ? o(e, t, s) : o(s)) || s);
|
|
446
|
+
return r && s && st(e, t, s), s;
|
|
447
|
+
}, w = (n, e) => (t, r) => e(t, r, n), R;
|
|
448
|
+
let k = (R = class extends le {
|
|
449
|
+
constructor(n = A, e, t, r) {
|
|
450
|
+
super(), this._config = n, this._injector = e, this._renderManagerService = t, this._configService = r;
|
|
451
|
+
const { ...s } = he(
|
|
467
452
|
{},
|
|
468
|
-
|
|
453
|
+
A,
|
|
469
454
|
this._config
|
|
470
455
|
);
|
|
471
|
-
this._configService.setConfig(
|
|
456
|
+
this._configService.setConfig(Pe, s);
|
|
472
457
|
}
|
|
473
458
|
onStarting() {
|
|
474
459
|
[
|
|
475
|
-
[
|
|
476
|
-
[
|
|
477
|
-
].forEach((
|
|
460
|
+
[S],
|
|
461
|
+
[b]
|
|
462
|
+
].forEach((n) => this._injector.add(n));
|
|
478
463
|
}
|
|
479
464
|
onReady() {
|
|
480
465
|
[
|
|
481
|
-
[
|
|
482
|
-
].forEach((
|
|
483
|
-
}
|
|
484
|
-
},
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
],
|
|
466
|
+
[H]
|
|
467
|
+
].forEach((n) => this._injector.add(n)), this._injector.get(b), this._renderManagerService.registerRenderModule(x.UNIVER_SHEET, [H]);
|
|
468
|
+
}
|
|
469
|
+
}, h(R, "pluginName", "SHEET_CROSSHAIR_HIGHLIGHT_PLUGIN"), h(R, "type", x.UNIVER_SHEET), R);
|
|
470
|
+
k = ot([
|
|
471
|
+
w(1, p(ge)),
|
|
472
|
+
w(2, _e),
|
|
473
|
+
w(3, ue)
|
|
474
|
+
], k);
|
|
490
475
|
export {
|
|
491
|
-
CROSSHAIR_HIGHLIGHT_COLORS,
|
|
492
|
-
DisableCrosshairHighlightOperation,
|
|
493
|
-
EnableCrosshairHighlightOperation,
|
|
494
|
-
SetCrosshairHighlightColorOperation,
|
|
495
|
-
SheetsCrosshairHighlightService,
|
|
496
|
-
ToggleCrosshairHighlightOperation,
|
|
497
|
-
UniverSheetsCrosshairHighlightPlugin
|
|
476
|
+
q as CROSSHAIR_HIGHLIGHT_COLORS,
|
|
477
|
+
Ge as DisableCrosshairHighlightOperation,
|
|
478
|
+
Ae as EnableCrosshairHighlightOperation,
|
|
479
|
+
J as SetCrosshairHighlightColorOperation,
|
|
480
|
+
S as SheetsCrosshairHighlightService,
|
|
481
|
+
M as ToggleCrosshairHighlightOperation,
|
|
482
|
+
k as UniverSheetsCrosshairHighlightPlugin
|
|
498
483
|
};
|
package/lib/es/locale/en-US.js
CHANGED
package/lib/es/locale/fa-IR.js
CHANGED
package/lib/es/locale/fr-FR.js
CHANGED
package/lib/es/locale/ru-RU.js
CHANGED
package/lib/es/locale/vi-VN.js
CHANGED
package/lib/es/locale/zh-CN.js
CHANGED
package/lib/es/locale/zh-TW.js
CHANGED
|
@@ -107,9 +107,6 @@ export interface IFUniverCrosshairHighlightMixin {
|
|
|
107
107
|
readonly CROSSHAIR_HIGHLIGHT_COLORS: string[];
|
|
108
108
|
}
|
|
109
109
|
export declare class FUniverCrosshairHighlightMixin extends FUniver implements IFUniverCrosshairHighlightMixin {
|
|
110
|
-
/**
|
|
111
|
-
* @ignore
|
|
112
|
-
*/
|
|
113
110
|
_initialize(injector: Injector): void;
|
|
114
111
|
setCrosshairHighlightEnabled(enabled: boolean): FUniver;
|
|
115
112
|
setCrosshairHighlightColor(color: string): FUniver;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@univerjs/sheets-crosshair-highlight",
|
|
3
|
-
"version": "0.5.5
|
|
3
|
+
"version": "0.5.5",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"author": "DreamNum <developer@univer.ai>",
|
|
@@ -59,11 +59,11 @@
|
|
|
59
59
|
"dependencies": {
|
|
60
60
|
"@univerjs/icons": "^0.2.12",
|
|
61
61
|
"clsx": "^2.1.1",
|
|
62
|
-
"@univerjs/core": "0.5.5
|
|
63
|
-
"@univerjs/
|
|
64
|
-
"@univerjs/
|
|
65
|
-
"@univerjs/ui": "0.5.5
|
|
66
|
-
"@univerjs/
|
|
62
|
+
"@univerjs/core": "0.5.5",
|
|
63
|
+
"@univerjs/sheets": "0.5.5",
|
|
64
|
+
"@univerjs/engine-render": "0.5.5",
|
|
65
|
+
"@univerjs/sheets-ui": "0.5.5",
|
|
66
|
+
"@univerjs/ui": "0.5.5"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
69
|
"less": "^4.2.1",
|