@univerjs/sheets-note-ui 0.8.0-beta.0 → 0.8.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +1 -1
- package/lib/es/index.js +343 -343
- package/lib/index.js +343 -343
- package/lib/umd/index.js +1 -1
- package/package.json +9 -9
package/lib/es/index.js
CHANGED
|
@@ -1,45 +1,42 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { Inject as
|
|
5
|
-
import { SheetsNoteModel as
|
|
6
|
-
import { IRenderManagerService as
|
|
7
|
-
import { SheetInterceptorService as
|
|
8
|
-
import { debounceTime as
|
|
9
|
-
import { CellPopupManagerService as
|
|
10
|
-
import { IZenZoneService as
|
|
11
|
-
import { debounceTime as
|
|
12
|
-
import { jsx as
|
|
13
|
-
import { clsx as
|
|
14
|
-
import { forwardRef as
|
|
15
|
-
const
|
|
16
|
-
var
|
|
17
|
-
for (var
|
|
18
|
-
(s =
|
|
19
|
-
return
|
|
20
|
-
},
|
|
21
|
-
let
|
|
22
|
-
constructor(
|
|
23
|
-
super(), this._sheetInterceptorService =
|
|
1
|
+
var Ce = Object.defineProperty;
|
|
2
|
+
var me = (t, e, i) => e in t ? Ce(t, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : t[e] = i;
|
|
3
|
+
var S = (t, e, i) => me(t, typeof e != "symbol" ? e + "" : e, i);
|
|
4
|
+
import { Inject as d, IUniverInstanceService as D, Disposable as w, InterceptorEffectEnum as Se, UniverInstanceType as b, DisposableCollection as Ne, ObjectMatrix as k, RANGE_TYPE as X, Rectangle as Pe, CommandType as Ie, LocaleService as we, ICommandService as ne, DependentOn as be, Injector as Me, IConfigService as ye, Plugin as Ee, merge as Oe, touchDependencies as ee } from "@univerjs/core";
|
|
5
|
+
import { SheetsNoteModel as M, SheetUpdateNoteCommand as xe, SheetDeleteNoteCommand as F, SheetToggleNotePopupCommand as oe, UniverSheetsNotePlugin as He } from "@univerjs/sheets-note";
|
|
6
|
+
import { IRenderManagerService as W } from "@univerjs/engine-render";
|
|
7
|
+
import { SheetInterceptorService as Te, INTERCEPTOR_POINT as $e, SheetsSelectionsService as z, WorksheetEditPermission as se, WorkbookEditablePermission as ae, getSheetCommandTarget as Ue } from "@univerjs/sheets";
|
|
8
|
+
import { debounceTime as Le, BehaviorSubject as De, switchMap as Re, of as ce, map as R, combineLatest as Ve } from "rxjs";
|
|
9
|
+
import { CellPopupManagerService as ue, IEditorBridgeService as je, HoverManagerService as Ze, SheetSkeletonManagerService as ke, getCurrentRangeDisable$ as le } from "@univerjs/sheets-ui";
|
|
10
|
+
import { IZenZoneService as Be, useDependency as y, useConfigValue as Ae, useDebounceFn as Fe, MenuItemType as G, getMenuHiddenObservable as We, ContextMenuPosition as ze, ContextMenuGroup as Ge, ComponentManager as Ke, IMenuManagerService as Ye } from "@univerjs/ui";
|
|
11
|
+
import { debounceTime as qe } from "rxjs/operators";
|
|
12
|
+
import { jsx as Je } from "react/jsx-runtime";
|
|
13
|
+
import { clsx as Qe, borderClassName as Xe, scrollbarClassName as et } from "@univerjs/design";
|
|
14
|
+
import { forwardRef as V, useRef as pe, createElement as j, useState as tt, useMemo as it, useEffect as B } from "react";
|
|
15
|
+
const he = "sheets-note-ui.config", te = {};
|
|
16
|
+
var rt = Object.getOwnPropertyDescriptor, nt = (t, e, i, r) => {
|
|
17
|
+
for (var n = r > 1 ? void 0 : r ? rt(e, i) : e, o = t.length - 1, s; o >= 0; o--)
|
|
18
|
+
(s = t[o]) && (n = s(n) || n);
|
|
19
|
+
return n;
|
|
20
|
+
}, E = (t, e) => (i, r) => e(i, r, t);
|
|
21
|
+
let x = class extends w {
|
|
22
|
+
constructor(t, e, i, r) {
|
|
23
|
+
super(), this._sheetInterceptorService = t, this._sheetsNoteModel = e, this._renderManagerService = i, this._univerInstanceService = r, this._initViewModelIntercept(), this._initSkeletonChange();
|
|
24
24
|
}
|
|
25
25
|
_initViewModelIntercept() {
|
|
26
26
|
this.disposeWithMe(
|
|
27
27
|
this._sheetInterceptorService.intercept(
|
|
28
|
-
|
|
28
|
+
$e.CELL_CONTENT,
|
|
29
29
|
{
|
|
30
|
-
effect:
|
|
31
|
-
handler: (
|
|
32
|
-
const { row: r, col:
|
|
33
|
-
return this._sheetsNoteModel.getNote(o, s, r, t)
|
|
34
|
-
...
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
color: "#FFBD37",
|
|
39
|
-
size: 6
|
|
40
|
-
}
|
|
30
|
+
effect: Se.Style,
|
|
31
|
+
handler: (t, e, i) => {
|
|
32
|
+
const { row: r, col: n, unitId: o, subUnitId: s } = e;
|
|
33
|
+
return this._sheetsNoteModel.getNote(o, s, r, n) && ((!t || t === e.rawData) && (t = { ...e.rawData }), t.markers = {
|
|
34
|
+
...t == null ? void 0 : t.markers,
|
|
35
|
+
tr: {
|
|
36
|
+
color: "#FFBD37",
|
|
37
|
+
size: 6
|
|
41
38
|
}
|
|
42
|
-
})
|
|
39
|
+
}), i(t);
|
|
43
40
|
},
|
|
44
41
|
priority: 100
|
|
45
42
|
}
|
|
@@ -47,38 +44,38 @@ let y = class extends P {
|
|
|
47
44
|
);
|
|
48
45
|
}
|
|
49
46
|
_initSkeletonChange() {
|
|
50
|
-
const
|
|
51
|
-
var
|
|
47
|
+
const t = () => {
|
|
48
|
+
var n;
|
|
52
49
|
const e = this._univerInstanceService.getCurrentUnitForType(b.UNIVER_SHEET);
|
|
53
50
|
if (!e) return;
|
|
54
|
-
const
|
|
55
|
-
(
|
|
51
|
+
const i = e.getUnitId(), r = this._renderManagerService.getRenderById(i);
|
|
52
|
+
(n = r == null ? void 0 : r.mainComponent) == null || n.makeForceDirty();
|
|
56
53
|
};
|
|
57
|
-
this.disposeWithMe(this._sheetsNoteModel.change$.pipe(
|
|
58
|
-
|
|
54
|
+
this.disposeWithMe(this._sheetsNoteModel.change$.pipe(Le(16)).subscribe(() => {
|
|
55
|
+
t();
|
|
59
56
|
}));
|
|
60
57
|
}
|
|
61
58
|
};
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
],
|
|
68
|
-
const
|
|
69
|
-
var
|
|
70
|
-
for (var
|
|
71
|
-
(s =
|
|
72
|
-
return
|
|
73
|
-
},
|
|
74
|
-
let
|
|
75
|
-
constructor(e,
|
|
59
|
+
x = nt([
|
|
60
|
+
E(0, d(Te)),
|
|
61
|
+
E(1, d(M)),
|
|
62
|
+
E(2, W),
|
|
63
|
+
E(3, D)
|
|
64
|
+
], x);
|
|
65
|
+
const K = "SHEET_NOTE_COMPONENT";
|
|
66
|
+
var ot = Object.getOwnPropertyDescriptor, st = (t, e, i, r) => {
|
|
67
|
+
for (var n = r > 1 ? void 0 : r ? ot(e, i) : e, o = t.length - 1, s; o >= 0; o--)
|
|
68
|
+
(s = t[o]) && (n = s(n) || n);
|
|
69
|
+
return n;
|
|
70
|
+
}, ie = (t, e) => (i, r) => e(i, r, t);
|
|
71
|
+
let P = class extends w {
|
|
72
|
+
constructor(e, i) {
|
|
76
73
|
super();
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
this._zenZoneService = e, this._cellPopupManagerService =
|
|
74
|
+
S(this, "_lastPopup", null);
|
|
75
|
+
S(this, "_activePopup");
|
|
76
|
+
S(this, "_activePopup$", new De(null));
|
|
77
|
+
S(this, "activePopup$", this._activePopup$.asObservable());
|
|
78
|
+
this._zenZoneService = e, this._cellPopupManagerService = i, this._initZenVisible(), this.disposeWithMe(() => {
|
|
82
79
|
this._activePopup$.complete();
|
|
83
80
|
});
|
|
84
81
|
}
|
|
@@ -90,10 +87,10 @@ let S = class extends P {
|
|
|
90
87
|
e && this.hidePopup();
|
|
91
88
|
}));
|
|
92
89
|
}
|
|
93
|
-
showPopup(e,
|
|
90
|
+
showPopup(e, i) {
|
|
94
91
|
var l;
|
|
95
|
-
const { row: r, col:
|
|
96
|
-
if (this._activePopup && r === this._activePopup.row &&
|
|
92
|
+
const { row: r, col: n, unitId: o, subUnitId: s } = e;
|
|
93
|
+
if (this._activePopup && r === this._activePopup.row && n === this._activePopup.col && o === this._activePopup.unitId && s === ((l = this.activePopup) == null ? void 0 : l.subUnitId)) {
|
|
97
94
|
this._activePopup = e, this._activePopup$.next(e);
|
|
98
95
|
return;
|
|
99
96
|
}
|
|
@@ -105,10 +102,10 @@ let S = class extends P {
|
|
|
105
102
|
unitId: o,
|
|
106
103
|
subUnitId: s,
|
|
107
104
|
row: r,
|
|
108
|
-
col:
|
|
105
|
+
col: n
|
|
109
106
|
},
|
|
110
107
|
{
|
|
111
|
-
componentKey:
|
|
108
|
+
componentKey: K,
|
|
112
109
|
onClickOutside: () => {
|
|
113
110
|
this.hidePopup();
|
|
114
111
|
},
|
|
@@ -121,10 +118,10 @@ let S = class extends P {
|
|
|
121
118
|
);
|
|
122
119
|
if (!a)
|
|
123
120
|
throw new Error("[SheetsNotePopupService]: cannot show popup!");
|
|
124
|
-
const c = new
|
|
121
|
+
const c = new Ne();
|
|
125
122
|
c.add(a), c.add({
|
|
126
123
|
dispose: () => {
|
|
127
|
-
|
|
124
|
+
i == null || i();
|
|
128
125
|
}
|
|
129
126
|
}), this._lastPopup = c;
|
|
130
127
|
}
|
|
@@ -138,76 +135,76 @@ let S = class extends P {
|
|
|
138
135
|
}, this._activePopup$.next(this._activePopup));
|
|
139
136
|
}
|
|
140
137
|
};
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
],
|
|
145
|
-
var
|
|
146
|
-
for (var
|
|
147
|
-
(s =
|
|
148
|
-
return
|
|
149
|
-
},
|
|
150
|
-
let
|
|
151
|
-
constructor(e,
|
|
138
|
+
P = st([
|
|
139
|
+
ie(0, Be),
|
|
140
|
+
ie(1, d(ue))
|
|
141
|
+
], P);
|
|
142
|
+
var at = Object.getOwnPropertyDescriptor, ct = (t, e, i, r) => {
|
|
143
|
+
for (var n = r > 1 ? void 0 : r ? at(e, i) : e, o = t.length - 1, s; o >= 0; o--)
|
|
144
|
+
(s = t[o]) && (n = s(n) || n);
|
|
145
|
+
return n;
|
|
146
|
+
}, O = (t, e) => (i, r) => e(i, r, t);
|
|
147
|
+
let H = class extends w {
|
|
148
|
+
constructor(e, i, r, n) {
|
|
152
149
|
super();
|
|
153
|
-
|
|
154
|
-
this._sheetsNoteModel = e, this._univerInstanceService =
|
|
150
|
+
S(this, "_noteMatrix", new k());
|
|
151
|
+
this._sheetsNoteModel = e, this._univerInstanceService = i, this._cellPopupManagerService = r, this._sheetsNotePopupService = n, this._initNoteChangeListener();
|
|
155
152
|
}
|
|
156
|
-
_showPopup(e,
|
|
153
|
+
_showPopup(e, i, r, n) {
|
|
157
154
|
return this._sheetsNotePopupService.hidePopup(!0), this._cellPopupManagerService.showPopup(
|
|
158
155
|
{
|
|
159
156
|
unitId: e,
|
|
160
|
-
subUnitId:
|
|
157
|
+
subUnitId: i,
|
|
161
158
|
row: r,
|
|
162
|
-
col:
|
|
159
|
+
col: n
|
|
163
160
|
},
|
|
164
161
|
{
|
|
165
|
-
componentKey:
|
|
162
|
+
componentKey: K,
|
|
166
163
|
direction: "horizontal",
|
|
167
164
|
extraProps: {
|
|
168
165
|
location: {
|
|
169
166
|
unitId: e,
|
|
170
|
-
subUnitId:
|
|
167
|
+
subUnitId: i,
|
|
171
168
|
row: r,
|
|
172
|
-
col:
|
|
169
|
+
col: n
|
|
173
170
|
}
|
|
174
171
|
},
|
|
175
172
|
priority: 3
|
|
176
173
|
}
|
|
177
174
|
);
|
|
178
175
|
}
|
|
179
|
-
_initSheet(e,
|
|
176
|
+
_initSheet(e, i) {
|
|
180
177
|
var o;
|
|
181
178
|
this._noteMatrix.forValue((s, a, c) => {
|
|
182
179
|
c.dispose();
|
|
183
|
-
}), this._noteMatrix = new
|
|
184
|
-
const
|
|
185
|
-
const p = this._noteMatrix,
|
|
186
|
-
if (
|
|
187
|
-
if (!
|
|
188
|
-
const
|
|
189
|
-
|
|
180
|
+
}), this._noteMatrix = new k();
|
|
181
|
+
const n = (s, a, c, l, h) => {
|
|
182
|
+
const p = this._noteMatrix, f = p.getValue(c, l);
|
|
183
|
+
if (h != null && h.show) {
|
|
184
|
+
if (!f) {
|
|
185
|
+
const g = this._showPopup(s, a, c, l);
|
|
186
|
+
g && p.setValue(c, l, g);
|
|
190
187
|
}
|
|
191
188
|
} else
|
|
192
|
-
|
|
189
|
+
f && (f.dispose(), p.realDeleteValue(c, l));
|
|
193
190
|
};
|
|
194
|
-
return (o = this._sheetsNoteModel.getSheetNotes(e,
|
|
195
|
-
|
|
191
|
+
return (o = this._sheetsNoteModel.getSheetNotes(e, i)) == null || o.forValue((s, a, c) => {
|
|
192
|
+
n(e, i, s, a, c);
|
|
196
193
|
}), this._sheetsNoteModel.change$.subscribe((s) => {
|
|
197
|
-
if (!(s.unitId !== e || s.sheetId !==
|
|
194
|
+
if (!(s.unitId !== e || s.sheetId !== i))
|
|
198
195
|
switch (s.type) {
|
|
199
196
|
case "ref": {
|
|
200
|
-
const { unitId: a, sheetId: c, row: l, col:
|
|
201
|
-
if (!
|
|
202
|
-
const
|
|
203
|
-
|
|
204
|
-
const
|
|
205
|
-
|
|
197
|
+
const { unitId: a, sheetId: c, row: l, col: h, newPosition: p, note: f } = s, g = this._noteMatrix;
|
|
198
|
+
if (!f.show) return;
|
|
199
|
+
const C = g.getValue(l, h);
|
|
200
|
+
C && (C.dispose(), g.realDeleteValue(l, h));
|
|
201
|
+
const u = this._showPopup(a, c, p.row, p.col);
|
|
202
|
+
u && g.setValue(p.row, p.col, u);
|
|
206
203
|
break;
|
|
207
204
|
}
|
|
208
205
|
case "update": {
|
|
209
|
-
const { unitId: a, sheetId: c, row: l, col:
|
|
210
|
-
|
|
206
|
+
const { unitId: a, sheetId: c, row: l, col: h, note: p } = s;
|
|
207
|
+
n(a, c, l, h, p);
|
|
211
208
|
break;
|
|
212
209
|
}
|
|
213
210
|
}
|
|
@@ -216,57 +213,57 @@ let O = class extends P {
|
|
|
216
213
|
_initNoteChangeListener() {
|
|
217
214
|
this.disposeWithMe(
|
|
218
215
|
this._univerInstanceService.getCurrentTypeOfUnit$(b.UNIVER_SHEET).pipe(
|
|
219
|
-
|
|
220
|
-
var
|
|
221
|
-
return (
|
|
216
|
+
Re((e) => {
|
|
217
|
+
var i;
|
|
218
|
+
return (i = e == null ? void 0 : e.activeSheet$) != null ? i : ce(null);
|
|
222
219
|
})
|
|
223
220
|
).subscribe((e) => {
|
|
224
221
|
if (e) {
|
|
225
|
-
const
|
|
222
|
+
const i = this._initSheet(e.getUnitId(), e.getSheetId());
|
|
226
223
|
return () => {
|
|
227
|
-
|
|
224
|
+
i.unsubscribe();
|
|
228
225
|
};
|
|
229
226
|
} else
|
|
230
|
-
this._noteMatrix.forValue((
|
|
231
|
-
|
|
232
|
-
}), this._noteMatrix = new
|
|
227
|
+
this._noteMatrix.forValue((i, r, n) => {
|
|
228
|
+
n.dispose();
|
|
229
|
+
}), this._noteMatrix = new k();
|
|
233
230
|
})
|
|
234
231
|
);
|
|
235
232
|
}
|
|
236
233
|
};
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
],
|
|
243
|
-
var
|
|
244
|
-
for (var
|
|
245
|
-
(s =
|
|
246
|
-
return
|
|
247
|
-
},
|
|
248
|
-
let
|
|
249
|
-
constructor(e,
|
|
234
|
+
H = ct([
|
|
235
|
+
O(0, d(M)),
|
|
236
|
+
O(1, d(D)),
|
|
237
|
+
O(2, d(ue)),
|
|
238
|
+
O(3, d(P))
|
|
239
|
+
], H);
|
|
240
|
+
var ut = Object.getOwnPropertyDescriptor, lt = (t, e, i, r) => {
|
|
241
|
+
for (var n = r > 1 ? void 0 : r ? ut(e, i) : e, o = t.length - 1, s; o >= 0; o--)
|
|
242
|
+
(s = t[o]) && (n = s(n) || n);
|
|
243
|
+
return n;
|
|
244
|
+
}, N = (t, e) => (i, r) => e(i, r, t);
|
|
245
|
+
let T = class extends w {
|
|
246
|
+
constructor(e, i, r, n, o, s) {
|
|
250
247
|
super();
|
|
251
|
-
|
|
252
|
-
this._sheetsNotePopupService = e, this._sheetsNoteModel =
|
|
248
|
+
S(this, "_isSwitchingSheet", !1);
|
|
249
|
+
this._sheetsNotePopupService = e, this._sheetsNoteModel = i, this._sheetSelectionService = r, this._editorBridgeService = n, this._renderManagerService = o, this._hoverManagerService = s, this._initSelectionUpdateListener(), this._initEditorBridge(), this._initHoverEvent();
|
|
253
250
|
}
|
|
254
|
-
_handleSelectionChange(e,
|
|
255
|
-
var
|
|
256
|
-
const
|
|
257
|
-
if (!s || !
|
|
251
|
+
_handleSelectionChange(e, i, r) {
|
|
252
|
+
var f, g, C;
|
|
253
|
+
const n = (f = e[0]) == null ? void 0 : f.range, o = this._renderManagerService.getRenderById(i), s = (g = o == null ? void 0 : o.with(ke).getSkeletonParam(r)) == null ? void 0 : g.skeleton;
|
|
254
|
+
if (!s || !n)
|
|
258
255
|
return;
|
|
259
|
-
const a = s.getCellWithCoordByIndex(
|
|
260
|
-
if ((((
|
|
256
|
+
const a = s.getCellWithCoordByIndex(n.startRow, n.startColumn);
|
|
257
|
+
if ((((C = n.rangeType) != null ? C : X.NORMAL) !== X.NORMAL || n.endColumn - n.startColumn > 0 || n.endRow - n.startRow > 0) && !((a.isMerged || a.isMergedMainCell) && Pe.equals(a.mergeInfo, n))) {
|
|
261
258
|
this._sheetsNotePopupService.hidePopup();
|
|
262
259
|
return;
|
|
263
260
|
}
|
|
264
|
-
const l = a.actualRow,
|
|
261
|
+
const l = a.actualRow, h = a.actualColumn, p = this._sheetsNoteModel.getNote(i, r, l, h);
|
|
265
262
|
p != null && p.show || (p ? this._sheetsNotePopupService.showPopup({
|
|
266
|
-
unitId:
|
|
263
|
+
unitId: i,
|
|
267
264
|
subUnitId: r,
|
|
268
265
|
row: l,
|
|
269
|
-
col:
|
|
266
|
+
col: h
|
|
270
267
|
}) : this._sheetsNotePopupService.hidePopup(!0));
|
|
271
268
|
}
|
|
272
269
|
_initSelectionUpdateListener() {
|
|
@@ -274,8 +271,8 @@ let x = class extends P {
|
|
|
274
271
|
this._sheetSelectionService.selectionMoveEnd$.subscribe((e) => {
|
|
275
272
|
if (this._isSwitchingSheet)
|
|
276
273
|
return;
|
|
277
|
-
const
|
|
278
|
-
|
|
274
|
+
const i = this._sheetSelectionService.currentSelectionParam;
|
|
275
|
+
i && this._handleSelectionChange(e, i.unitId, i.sheetId);
|
|
279
276
|
})
|
|
280
277
|
);
|
|
281
278
|
}
|
|
@@ -288,13 +285,13 @@ let x = class extends P {
|
|
|
288
285
|
}
|
|
289
286
|
_initHoverEvent() {
|
|
290
287
|
this.disposeWithMe(
|
|
291
|
-
this._hoverManagerService.currentCell$.pipe(
|
|
288
|
+
this._hoverManagerService.currentCell$.pipe(qe(100)).subscribe((e) => {
|
|
292
289
|
if (!(e != null && e.location)) return;
|
|
293
|
-
const { unitId:
|
|
290
|
+
const { unitId: i, subUnitId: r, row: n, col: o } = e.location, s = this._sheetsNoteModel.getNote(i, r, n, o);
|
|
294
291
|
s != null && s.show || (s ? this._sheetsNotePopupService.showPopup({
|
|
295
|
-
unitId:
|
|
292
|
+
unitId: i,
|
|
296
293
|
subUnitId: r,
|
|
297
|
-
row:
|
|
294
|
+
row: n,
|
|
298
295
|
col: o,
|
|
299
296
|
temp: !0
|
|
300
297
|
}) : this._sheetsNotePopupService.hidePopup());
|
|
@@ -302,92 +299,92 @@ let x = class extends P {
|
|
|
302
299
|
);
|
|
303
300
|
}
|
|
304
301
|
};
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
],
|
|
313
|
-
var
|
|
314
|
-
return
|
|
315
|
-
for (var e,
|
|
316
|
-
e = arguments[
|
|
317
|
-
for (var
|
|
302
|
+
T = lt([
|
|
303
|
+
N(0, d(P)),
|
|
304
|
+
N(1, d(M)),
|
|
305
|
+
N(2, d(z)),
|
|
306
|
+
N(3, je),
|
|
307
|
+
N(4, W),
|
|
308
|
+
N(5, d(Ze))
|
|
309
|
+
], T);
|
|
310
|
+
var v = function() {
|
|
311
|
+
return v = Object.assign || function(t) {
|
|
312
|
+
for (var e, i = 1, r = arguments.length; i < r; i++) {
|
|
313
|
+
e = arguments[i];
|
|
314
|
+
for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]);
|
|
318
315
|
}
|
|
319
|
-
return
|
|
320
|
-
},
|
|
321
|
-
},
|
|
322
|
-
var
|
|
323
|
-
for (var r in
|
|
324
|
-
if (
|
|
325
|
-
for (var
|
|
326
|
-
e.indexOf(r[
|
|
327
|
-
return
|
|
328
|
-
},
|
|
329
|
-
var
|
|
330
|
-
return
|
|
316
|
+
return t;
|
|
317
|
+
}, v.apply(this, arguments);
|
|
318
|
+
}, pt = function(t, e) {
|
|
319
|
+
var i = {};
|
|
320
|
+
for (var r in t) Object.prototype.hasOwnProperty.call(t, r) && e.indexOf(r) < 0 && (i[r] = t[r]);
|
|
321
|
+
if (t != null && typeof Object.getOwnPropertySymbols == "function")
|
|
322
|
+
for (var n = 0, r = Object.getOwnPropertySymbols(t); n < r.length; n++)
|
|
323
|
+
e.indexOf(r[n]) < 0 && Object.prototype.propertyIsEnumerable.call(t, r[n]) && (i[r[n]] = t[r[n]]);
|
|
324
|
+
return i;
|
|
325
|
+
}, Z = V(function(t, e) {
|
|
326
|
+
var i = t.icon, r = t.id, n = t.className, o = t.extend, s = pt(t, ["icon", "id", "className", "extend"]), a = "univerjs-icon univerjs-icon-".concat(r, " ").concat(n || "").trim(), c = pe("_".concat(vt()));
|
|
327
|
+
return de(i, "".concat(r), { defIds: i.defIds, idSuffix: c.current }, v({ ref: e, className: a }, s), o);
|
|
331
328
|
});
|
|
332
|
-
function
|
|
333
|
-
return
|
|
334
|
-
return
|
|
329
|
+
function de(t, e, i, r, n) {
|
|
330
|
+
return j(t.tag, v(v({ key: e }, ht(t, i, n)), r), (dt(t, i).children || []).map(function(o, s) {
|
|
331
|
+
return de(o, "".concat(e, "-").concat(t.tag, "-").concat(s), i, void 0, n);
|
|
335
332
|
}));
|
|
336
333
|
}
|
|
337
|
-
function
|
|
338
|
-
var r =
|
|
339
|
-
|
|
334
|
+
function ht(t, e, i) {
|
|
335
|
+
var r = v({}, t.attrs);
|
|
336
|
+
i != null && i.colorChannel1 && r.fill === "colorChannel1" && (r.fill = i.colorChannel1), t.tag === "mask" && r.id && (r.id = r.id + e.idSuffix), Object.entries(r).forEach(function(o) {
|
|
340
337
|
var s = o[0], a = o[1];
|
|
341
338
|
s === "mask" && typeof a == "string" && (r[s] = a.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
|
|
342
339
|
});
|
|
343
|
-
var
|
|
344
|
-
return !
|
|
340
|
+
var n = e.defIds;
|
|
341
|
+
return !n || n.length === 0 || (t.tag === "use" && r["xlink:href"] && (r["xlink:href"] = r["xlink:href"] + e.idSuffix), Object.entries(r).forEach(function(o) {
|
|
345
342
|
var s = o[0], a = o[1];
|
|
346
343
|
typeof a == "string" && (r[s] = a.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
|
|
347
344
|
})), r;
|
|
348
345
|
}
|
|
349
|
-
function
|
|
350
|
-
var
|
|
351
|
-
return !r || r.length === 0 ?
|
|
352
|
-
return typeof
|
|
353
|
-
}) }) :
|
|
346
|
+
function dt(t, e) {
|
|
347
|
+
var i, r = e.defIds;
|
|
348
|
+
return !r || r.length === 0 ? t : t.tag === "defs" && (!((i = t.children) === null || i === void 0) && i.length) ? v(v({}, t), { children: t.children.map(function(n) {
|
|
349
|
+
return typeof n.attrs.id == "string" && r && r.includes(n.attrs.id) ? v(v({}, n), { attrs: v(v({}, n.attrs), { id: n.attrs.id + e.idSuffix }) }) : n;
|
|
350
|
+
}) }) : t;
|
|
354
351
|
}
|
|
355
|
-
function
|
|
352
|
+
function vt() {
|
|
356
353
|
return Math.random().toString(36).substring(2, 8);
|
|
357
354
|
}
|
|
358
|
-
|
|
359
|
-
var
|
|
360
|
-
return
|
|
361
|
-
id: "add-note-
|
|
355
|
+
Z.displayName = "UniverIcon";
|
|
356
|
+
var ft = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M12.8481 8.00049V3.87451C12.8481 3.13737 12.2503 2.5398 11.5132 2.53955H4.48682C3.74952 2.53955 3.15186 3.13721 3.15186 3.87451V12.1255C3.15186 12.8628 3.74952 13.4604 4.48682 13.4604H6.99951L7.1333 13.4741C7.43655 13.536 7.66454 13.804 7.66455 14.1255C7.66455 14.447 7.43655 14.715 7.1333 14.7769L6.99951 14.7905H4.48682C3.01498 14.7905 1.82178 13.5973 1.82178 12.1255V3.87451C1.82178 2.40267 3.01498 1.20947 4.48682 1.20947H11.5132C12.9848 1.20972 14.1772 2.40283 14.1772 3.87451V8.00049C14.177 8.36738 13.8801 8.6643 13.5132 8.66455C13.1461 8.66455 12.8484 8.36754 12.8481 8.00049Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M10.1463 4.53859L10.2801 4.55226C10.5832 4.61419 10.8113 4.8822 10.8113 5.20363C10.8113 5.52506 10.5832 5.79306 10.2801 5.85499L10.1463 5.86867H5.85331C5.48604 5.86867 5.18827 5.5709 5.18827 5.20363C5.18827 4.83636 5.48604 4.53859 5.85331 4.53859H10.1463Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M8.11307 7.33497L8.24686 7.34865C8.54984 7.41069 8.77811 7.67869 8.77811 8.00001C8.77811 8.32134 8.54984 8.58933 8.24686 8.65138L8.11307 8.66505H5.85331C5.48604 8.66505 5.18827 8.36728 5.18827 8.00001C5.18827 7.63274 5.48604 7.33497 5.85331 7.33497H8.11307Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M6.98319 10.1314L7.11698 10.145C7.42003 10.207 7.64823 10.475 7.64823 10.7964C7.64823 11.1178 7.42003 11.3858 7.11698 11.4478L6.98319 11.4614H5.85331C5.48604 11.4614 5.18827 11.1637 5.18827 10.7964C5.18827 10.4291 5.48604 10.1314 5.85331 10.1314H6.98319Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M10.8813 14.4312V10.2925C10.8813 9.92522 11.1791 9.62745 11.5463 9.62745C11.9136 9.62745 12.2114 9.92522 12.2114 10.2925V14.4312C12.2112 14.7983 11.9135 15.0962 11.5463 15.0962C11.1791 15.0962 10.8814 14.7983 10.8813 14.4312Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M9.47697 11.6968H11.5463H13.6156C13.9829 11.6968 14.2807 11.9946 14.2807 12.3618C14.2807 12.7291 13.9829 13.0269 13.6156 13.0269H9.47697C9.10981 13.0267 8.81193 12.729 8.81193 12.3618C8.81193 11.9946 9.10981 11.6969 9.47697 11.6968Z" } }] }, ve = V(function(t, e) {
|
|
357
|
+
return j(Z, Object.assign({}, t, {
|
|
358
|
+
id: "add-note-icon",
|
|
362
359
|
ref: e,
|
|
363
|
-
icon:
|
|
360
|
+
icon: ft
|
|
364
361
|
}));
|
|
365
362
|
});
|
|
366
|
-
|
|
367
|
-
var
|
|
368
|
-
return
|
|
369
|
-
id: "delete-note-
|
|
363
|
+
ve.displayName = "AddNoteIcon";
|
|
364
|
+
var gt = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M12.8481 8.00049V3.87451C12.8481 3.13737 12.2503 2.5398 11.5132 2.53955H4.48682C3.74952 2.53955 3.15186 3.13721 3.15186 3.87451V12.1255C3.15186 12.8628 3.74952 13.4604 4.48682 13.4604H6.99951L7.1333 13.4741C7.43655 13.536 7.66454 13.804 7.66455 14.1255C7.66455 14.447 7.43655 14.715 7.1333 14.7769L6.99951 14.7905H4.48682C3.01498 14.7905 1.82178 13.5973 1.82178 12.1255V3.87451C1.82178 2.40267 3.01498 1.20947 4.48682 1.20947H11.5132C12.9848 1.20972 14.1772 2.40283 14.1772 3.87451V8.00049C14.177 8.36738 13.8801 8.6643 13.5132 8.66455C13.1461 8.66455 12.8484 8.36754 12.8481 8.00049Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M10.1463 4.53859L10.2801 4.55226C10.5832 4.61419 10.8113 4.8822 10.8113 5.20363C10.8113 5.52506 10.5832 5.79306 10.2801 5.85499L10.1463 5.86867H5.85331C5.48604 5.86867 5.18827 5.5709 5.18827 5.20363C5.18827 4.83636 5.48604 4.53859 5.85331 4.53859H10.1463Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M8.11307 7.33497L8.24686 7.34865C8.54984 7.41069 8.77811 7.67869 8.77811 8.00001C8.77811 8.32134 8.54984 8.58933 8.24686 8.65138L8.11307 8.66505H5.85331C5.48604 8.66505 5.18827 8.36728 5.18827 8.00001C5.18827 7.63274 5.48604 7.33497 5.85331 7.33497H8.11307Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M6.98319 10.1314L7.11698 10.145C7.42003 10.207 7.64823 10.475 7.64823 10.7964C7.64823 11.1178 7.42003 11.3858 7.11698 11.4478L6.98319 11.4614H5.85331C5.48604 11.4614 5.18827 11.1637 5.18827 10.7964C5.18827 10.4291 5.48604 10.1314 5.85331 10.1314H6.98319Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M9.47489 11.6968H13.6175C13.9847 11.6968 14.2825 11.9946 14.2825 12.3618C14.2825 12.7291 13.9847 13.0269 13.6175 13.0269H9.47489C9.10762 13.0269 8.80985 12.7291 8.80985 12.3618C8.80985 11.9946 9.10762 11.6968 9.47489 11.6968Z" } }] }, fe = V(function(t, e) {
|
|
365
|
+
return j(Z, Object.assign({}, t, {
|
|
366
|
+
id: "delete-note-icon",
|
|
370
367
|
ref: e,
|
|
371
|
-
icon:
|
|
368
|
+
icon: gt
|
|
372
369
|
}));
|
|
373
370
|
});
|
|
374
|
-
|
|
375
|
-
var
|
|
376
|
-
return
|
|
377
|
-
id: "hide-note-
|
|
371
|
+
fe.displayName = "DeleteNoteIcon";
|
|
372
|
+
var _t = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M12.8481 8.00049V3.87451C12.8481 3.13737 12.2503 2.5398 11.5132 2.53955H4.48682C3.74952 2.53955 3.15186 3.13721 3.15186 3.87451V12.1255C3.15186 12.8628 3.74952 13.4604 4.48682 13.4604H6.99951L7.1333 13.4741C7.43655 13.536 7.66454 13.804 7.66455 14.1255C7.66455 14.447 7.43655 14.715 7.1333 14.7769L6.99951 14.7905H4.48682C3.01498 14.7905 1.82178 13.5973 1.82178 12.1255V3.87451C1.82178 2.40267 3.01498 1.20947 4.48682 1.20947H11.5132C12.9848 1.20972 14.1772 2.40283 14.1772 3.87451V8.00049C14.177 8.36738 13.8801 8.6643 13.5132 8.66455C13.1461 8.66455 12.8484 8.36754 12.8481 8.00049Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M10.1463 4.53859L10.2801 4.55226C10.5832 4.61419 10.8113 4.8822 10.8113 5.20363C10.8113 5.52506 10.5832 5.79306 10.2801 5.85499L10.1463 5.86867H5.85331C5.48604 5.86867 5.18827 5.5709 5.18827 5.20363C5.18827 4.83636 5.48604 4.53859 5.85331 4.53859H10.1463Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M8.11307 7.33497L8.24686 7.34865C8.54984 7.41069 8.77811 7.67869 8.77811 8.00001C8.77811 8.32134 8.54984 8.58933 8.24686 8.65138L8.11307 8.66505H5.85331C5.48604 8.66505 5.18827 8.36728 5.18827 8.00001C5.18827 7.63274 5.48604 7.33497 5.85331 7.33497H8.11307Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M6.98319 10.1314L7.11698 10.145C7.42003 10.207 7.64823 10.475 7.64823 10.7964C7.64823 11.1178 7.42003 11.3858 7.11698 11.4478L6.98319 11.4614H5.85331C5.48604 11.4614 5.18827 11.1637 5.18827 10.7964C5.18827 10.4291 5.48604 10.1314 5.85331 10.1314H6.98319Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M13.8743 12.6147C13.8742 12.5394 13.7749 12.2553 13.3909 11.9477C13.039 11.6659 12.5573 11.4614 12.0394 11.4614C11.5213 11.4614 11.0398 11.6666 10.6878 11.9487C10.3037 12.2565 10.2045 12.5399 10.2044 12.6147C10.2044 12.6893 10.3034 12.9737 10.6878 13.2817C11.0398 13.5636 11.5215 13.768 12.0394 13.768C12.5574 13.768 13.039 13.5635 13.3909 13.2817C13.7751 12.9739 13.8743 12.6897 13.8743 12.6147ZM15.2044 12.6147C15.2044 13.2772 14.7436 13.9027 14.223 14.3198C13.6701 14.7627 12.9019 15.0981 12.0394 15.0981C11.1768 15.0981 10.4085 14.7627 9.85577 14.3198C9.33533 13.9027 8.87433 13.2769 8.87433 12.6147C8.8744 11.9526 9.33541 11.3276 9.85577 10.9106C10.4086 10.4676 11.1767 10.1313 12.0394 10.1313C12.9018 10.1313 13.6701 10.4668 14.223 10.9096C14.7435 11.3267 15.2043 11.9523 15.2044 12.6147Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M12.0394 13.299C12.4172 13.299 12.7234 12.9927 12.7234 12.6149C12.7234 12.2371 12.4172 11.9308 12.0394 11.9308C11.6616 11.9308 11.3553 12.2371 11.3553 12.6149C11.3553 12.9927 11.6616 13.299 12.0394 13.299Z" } }] }, ge = V(function(t, e) {
|
|
373
|
+
return j(Z, Object.assign({}, t, {
|
|
374
|
+
id: "hide-note-icon",
|
|
378
375
|
ref: e,
|
|
379
|
-
icon:
|
|
376
|
+
icon: _t
|
|
380
377
|
}));
|
|
381
378
|
});
|
|
382
|
-
|
|
383
|
-
const
|
|
379
|
+
ge.displayName = "HideNoteIcon";
|
|
380
|
+
const $ = {
|
|
384
381
|
id: "sheet.operation.add-note-popup",
|
|
385
|
-
type:
|
|
386
|
-
handler: async (
|
|
387
|
-
const
|
|
382
|
+
type: Ie.OPERATION,
|
|
383
|
+
handler: async (t, e) => {
|
|
384
|
+
const i = t.get(z), r = t.get(P), o = t.get(D).getCurrentUnitForType(b.UNIVER_SHEET);
|
|
388
385
|
if (!o)
|
|
389
386
|
return !1;
|
|
390
|
-
const s = o.getActiveSheet(), a =
|
|
387
|
+
const s = o.getActiveSheet(), a = i.getCurrentLastSelection();
|
|
391
388
|
if (!(a != null && a.primary))
|
|
392
389
|
return !1;
|
|
393
390
|
const { primary: c } = a;
|
|
@@ -400,215 +397,218 @@ const E = {
|
|
|
400
397
|
trigger: e == null ? void 0 : e.trigger
|
|
401
398
|
}), !0;
|
|
402
399
|
}
|
|
403
|
-
},
|
|
404
|
-
var
|
|
405
|
-
const e =
|
|
406
|
-
if (!
|
|
400
|
+
}, Ct = (t) => {
|
|
401
|
+
var C;
|
|
402
|
+
const e = y(M), i = y(we), r = y(W), n = Ae(he), o = (C = t.popup.extraProps) == null ? void 0 : C.location;
|
|
403
|
+
if (!o)
|
|
407
404
|
return console.error("Popup extraProps or location is undefined."), null;
|
|
408
|
-
const
|
|
409
|
-
var
|
|
410
|
-
const u = { width: ((
|
|
411
|
-
return e.getNote(
|
|
412
|
-
}),
|
|
413
|
-
|
|
414
|
-
unitId:
|
|
415
|
-
sheetId:
|
|
416
|
-
row:
|
|
417
|
-
col:
|
|
405
|
+
const s = r.getRenderById(o.unitId), [a, c] = tt(() => {
|
|
406
|
+
var m, I;
|
|
407
|
+
const u = { width: ((m = n == null ? void 0 : n.defaultNoteSize) == null ? void 0 : m.width) || 216, height: ((I = n == null ? void 0 : n.defaultNoteSize) == null ? void 0 : I.height) || 92, note: "" };
|
|
408
|
+
return e.getNote(o.unitId, o.subUnitId, o.row, o.col) || u;
|
|
409
|
+
}), l = pe(null), h = y(ne), p = it(() => o ? e.getCellNoteChange$(o.unitId, o.subUnitId, o.row, o.col) : ce(null), [o]), f = Fe((u) => {
|
|
410
|
+
o && (u.note ? h.executeCommand(xe.id, {
|
|
411
|
+
unitId: o.unitId,
|
|
412
|
+
sheetId: o.subUnitId,
|
|
413
|
+
row: o.row,
|
|
414
|
+
col: o.col,
|
|
418
415
|
note: u
|
|
419
|
-
}) :
|
|
420
|
-
unitId:
|
|
421
|
-
sheetId:
|
|
422
|
-
row:
|
|
423
|
-
col:
|
|
416
|
+
}) : h.executeCommand(F.id, {
|
|
417
|
+
unitId: o.unitId,
|
|
418
|
+
sheetId: o.subUnitId,
|
|
419
|
+
row: o.row,
|
|
420
|
+
col: o.col
|
|
424
421
|
}));
|
|
425
422
|
});
|
|
426
|
-
|
|
423
|
+
B(() => {
|
|
427
424
|
var u;
|
|
428
|
-
|
|
429
|
-
}, [
|
|
430
|
-
const u =
|
|
431
|
-
if (!
|
|
432
|
-
const
|
|
433
|
-
|
|
425
|
+
o && (e.getNote(o.unitId, o.subUnitId, o.row, o.col) || (u = l.current) == null || u.focus());
|
|
426
|
+
}, [o, e]), B(() => {
|
|
427
|
+
const u = p.subscribe(() => {
|
|
428
|
+
if (!o) return;
|
|
429
|
+
const _ = e.getNote(o.unitId, o.subUnitId, o.row, o.col);
|
|
430
|
+
_ && c(_);
|
|
434
431
|
});
|
|
435
432
|
return () => u.unsubscribe();
|
|
436
|
-
}, [
|
|
437
|
-
const u =
|
|
433
|
+
}, [p]), B(() => {
|
|
434
|
+
const u = l.current;
|
|
438
435
|
if (!u) return;
|
|
439
|
-
const
|
|
440
|
-
const
|
|
441
|
-
if (!
|
|
442
|
-
const { width:
|
|
443
|
-
if (
|
|
444
|
-
const
|
|
445
|
-
|
|
436
|
+
const _ = new ResizeObserver((m) => {
|
|
437
|
+
const I = m[0];
|
|
438
|
+
if (!I) return;
|
|
439
|
+
const { width: q, height: J } = I.contentRect;
|
|
440
|
+
if (q === 0 && J === 0) return;
|
|
441
|
+
const Q = { ...a, width: q, height: J };
|
|
442
|
+
c(Q), f(Q);
|
|
446
443
|
});
|
|
447
|
-
return
|
|
448
|
-
|
|
444
|
+
return _.observe(u), () => {
|
|
445
|
+
_.unobserve(u), _.disconnect();
|
|
449
446
|
};
|
|
450
|
-
}, [
|
|
451
|
-
const
|
|
452
|
-
const
|
|
453
|
-
|
|
447
|
+
}, [a.note]);
|
|
448
|
+
const g = (u) => {
|
|
449
|
+
const _ = u.target.value, m = { ...a, note: _ };
|
|
450
|
+
c(m), f(m);
|
|
454
451
|
};
|
|
455
|
-
return /* @__PURE__ */
|
|
452
|
+
return /* @__PURE__ */ Je(
|
|
456
453
|
"textarea",
|
|
457
454
|
{
|
|
458
|
-
|
|
455
|
+
onWheel: (u) => {
|
|
456
|
+
document.activeElement !== l.current && s.engine.getCanvasElement().dispatchEvent(new WheelEvent(u.type, u.nativeEvent));
|
|
457
|
+
},
|
|
458
|
+
ref: l,
|
|
459
459
|
"data-u-comp": "note-textarea",
|
|
460
|
-
className:
|
|
461
|
-
style: { width:
|
|
462
|
-
value:
|
|
463
|
-
placeholder:
|
|
464
|
-
onChange:
|
|
460
|
+
className: Qe("univer-resize-both univer-ml-px univer-rounded-md univer-bg-white univer-p-2 univer-text-gray-900 univer-shadow dark:!univer-bg-gray-800 dark:!univer-text-white focus:univer-outline-none", Xe, et),
|
|
461
|
+
style: { width: a.width, height: a.height },
|
|
462
|
+
value: a.note,
|
|
463
|
+
placeholder: i.t("note.placeholder"),
|
|
464
|
+
onChange: g
|
|
465
465
|
}
|
|
466
466
|
);
|
|
467
467
|
};
|
|
468
|
-
function
|
|
469
|
-
const e =
|
|
470
|
-
return e.selectionMoveEnd$.pipe(
|
|
468
|
+
function Y(t) {
|
|
469
|
+
const e = t.get(z), i = t.get(D);
|
|
470
|
+
return e.selectionMoveEnd$.pipe(R(() => {
|
|
471
471
|
const r = e.getCurrentLastSelection();
|
|
472
472
|
if (!(r != null && r.primary)) return !1;
|
|
473
|
-
const
|
|
474
|
-
if (!
|
|
473
|
+
const n = Ue(i);
|
|
474
|
+
if (!n) return !1;
|
|
475
475
|
const { actualColumn: o, actualRow: s } = r.primary;
|
|
476
|
-
return !!
|
|
476
|
+
return !!t.get(M).getNote(n.unitId, n.subUnitId, s, o);
|
|
477
477
|
}));
|
|
478
478
|
}
|
|
479
|
-
function
|
|
479
|
+
function mt(t) {
|
|
480
480
|
return {
|
|
481
|
-
id:
|
|
482
|
-
type:
|
|
481
|
+
id: $.id,
|
|
482
|
+
type: G.BUTTON,
|
|
483
483
|
title: "rightClick.addNote",
|
|
484
|
-
icon: "
|
|
485
|
-
hidden$:
|
|
486
|
-
disabled$:
|
|
487
|
-
commandId:
|
|
484
|
+
icon: "AddNoteIcon",
|
|
485
|
+
hidden$: Ve([We(t, b.UNIVER_SHEET), Y(t)]).pipe(R(([e, i]) => e || i)),
|
|
486
|
+
disabled$: le(t, { workbookTypes: [ae], worksheetTypes: [se] }),
|
|
487
|
+
commandId: $.id
|
|
488
488
|
};
|
|
489
489
|
}
|
|
490
|
-
function
|
|
490
|
+
function St(t) {
|
|
491
491
|
return {
|
|
492
|
-
id:
|
|
493
|
-
type:
|
|
492
|
+
id: F.id,
|
|
493
|
+
type: G.BUTTON,
|
|
494
494
|
title: "rightClick.deleteNote",
|
|
495
|
-
icon: "
|
|
496
|
-
hidden$:
|
|
497
|
-
disabled$:
|
|
495
|
+
icon: "DeleteNoteIcon",
|
|
496
|
+
hidden$: Y(t).pipe(R((e) => !e)),
|
|
497
|
+
disabled$: le(t, { workbookTypes: [ae], worksheetTypes: [se] })
|
|
498
498
|
};
|
|
499
499
|
}
|
|
500
|
-
function
|
|
500
|
+
function Nt(t) {
|
|
501
501
|
return {
|
|
502
|
-
id:
|
|
503
|
-
type:
|
|
502
|
+
id: oe.id,
|
|
503
|
+
type: G.BUTTON,
|
|
504
504
|
title: "rightClick.toggleNote",
|
|
505
|
-
icon: "
|
|
506
|
-
hidden$:
|
|
505
|
+
icon: "HideNoteIcon",
|
|
506
|
+
hidden$: Y(t).pipe(R((e) => !e))
|
|
507
507
|
};
|
|
508
508
|
}
|
|
509
|
-
const
|
|
510
|
-
[
|
|
511
|
-
[
|
|
509
|
+
const Pt = {
|
|
510
|
+
[ze.MAIN_AREA]: {
|
|
511
|
+
[Ge.OTHERS]: {
|
|
512
512
|
order: 0,
|
|
513
|
-
[
|
|
513
|
+
[$.id]: {
|
|
514
514
|
order: 0,
|
|
515
|
-
menuItemFactory:
|
|
515
|
+
menuItemFactory: mt
|
|
516
516
|
},
|
|
517
|
-
[
|
|
517
|
+
[F.id]: {
|
|
518
518
|
order: 0,
|
|
519
|
-
menuItemFactory:
|
|
519
|
+
menuItemFactory: St
|
|
520
520
|
},
|
|
521
|
-
[
|
|
521
|
+
[oe.id]: {
|
|
522
522
|
order: 0,
|
|
523
|
-
menuItemFactory:
|
|
523
|
+
menuItemFactory: Nt
|
|
524
524
|
}
|
|
525
525
|
}
|
|
526
526
|
}
|
|
527
527
|
};
|
|
528
|
-
var
|
|
529
|
-
for (var
|
|
530
|
-
(s =
|
|
531
|
-
return
|
|
532
|
-
},
|
|
533
|
-
let
|
|
534
|
-
constructor(
|
|
535
|
-
super(), this._componentManager =
|
|
528
|
+
var It = Object.getOwnPropertyDescriptor, wt = (t, e, i, r) => {
|
|
529
|
+
for (var n = r > 1 ? void 0 : r ? It(e, i) : e, o = t.length - 1, s; o >= 0; o--)
|
|
530
|
+
(s = t[o]) && (n = s(n) || n);
|
|
531
|
+
return n;
|
|
532
|
+
}, A = (t, e) => (i, r) => e(i, r, t);
|
|
533
|
+
let U = class extends w {
|
|
534
|
+
constructor(t, e, i) {
|
|
535
|
+
super(), this._componentManager = t, this._menuManagerService = e, this._commandService = i, this._initComponents(), this._initMenu(), this._initCommands();
|
|
536
536
|
}
|
|
537
537
|
_initComponents() {
|
|
538
538
|
[
|
|
539
|
-
[
|
|
540
|
-
["
|
|
541
|
-
["
|
|
542
|
-
["
|
|
543
|
-
].forEach(([
|
|
539
|
+
[K, Ct],
|
|
540
|
+
["AddNoteIcon", ve],
|
|
541
|
+
["DeleteNoteIcon", fe],
|
|
542
|
+
["HideNoteIcon", ge]
|
|
543
|
+
].forEach(([t, e]) => {
|
|
544
544
|
this.disposeWithMe(
|
|
545
|
-
this._componentManager.register(
|
|
545
|
+
this._componentManager.register(t, e)
|
|
546
546
|
);
|
|
547
547
|
});
|
|
548
548
|
}
|
|
549
549
|
_initMenu() {
|
|
550
|
-
this._menuManagerService.mergeMenu(
|
|
550
|
+
this._menuManagerService.mergeMenu(Pt);
|
|
551
551
|
}
|
|
552
552
|
_initCommands() {
|
|
553
|
-
this._commandService.registerCommand(
|
|
553
|
+
this._commandService.registerCommand($);
|
|
554
554
|
}
|
|
555
555
|
};
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
],
|
|
561
|
-
var bt = Object.defineProperty,
|
|
562
|
-
for (var
|
|
563
|
-
(s =
|
|
564
|
-
return
|
|
565
|
-
},
|
|
566
|
-
const
|
|
567
|
-
let
|
|
568
|
-
constructor(
|
|
569
|
-
super(), this._config =
|
|
570
|
-
const { menu: r, ...
|
|
556
|
+
U = wt([
|
|
557
|
+
A(0, d(Ke)),
|
|
558
|
+
A(1, d(Ye)),
|
|
559
|
+
A(2, ne)
|
|
560
|
+
], U);
|
|
561
|
+
var bt = Object.defineProperty, Mt = Object.getOwnPropertyDescriptor, yt = (t, e, i) => e in t ? bt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : t[e] = i, Et = (t, e, i, r) => {
|
|
562
|
+
for (var n = r > 1 ? void 0 : r ? Mt(e, i) : e, o = t.length - 1, s; o >= 0; o--)
|
|
563
|
+
(s = t[o]) && (n = s(n) || n);
|
|
564
|
+
return n;
|
|
565
|
+
}, re = (t, e) => (i, r) => e(i, r, t), _e = (t, e, i) => yt(t, typeof e != "symbol" ? e + "" : e, i);
|
|
566
|
+
const Ot = "SHEET_NOTE_UI_PLUGIN";
|
|
567
|
+
let L = class extends Ee {
|
|
568
|
+
constructor(t = te, e, i) {
|
|
569
|
+
super(), this._config = t, this._injector = e, this._configService = i;
|
|
570
|
+
const { menu: r, ...n } = Oe(
|
|
571
571
|
{},
|
|
572
|
-
|
|
572
|
+
te,
|
|
573
573
|
this._config
|
|
574
574
|
);
|
|
575
|
-
r && this._configService.setConfig("menu", r, { merge: !0 }), this._configService.setConfig(
|
|
575
|
+
r && this._configService.setConfig("menu", r, { merge: !0 }), this._configService.setConfig(he, n);
|
|
576
576
|
}
|
|
577
577
|
onStarting() {
|
|
578
578
|
[
|
|
579
|
-
[
|
|
580
|
-
[y],
|
|
579
|
+
[P],
|
|
581
580
|
[x],
|
|
582
|
-
[
|
|
583
|
-
[
|
|
584
|
-
|
|
585
|
-
|
|
581
|
+
[T],
|
|
582
|
+
[U],
|
|
583
|
+
[H]
|
|
584
|
+
].forEach((t) => {
|
|
585
|
+
this._injector.add(t);
|
|
586
586
|
});
|
|
587
587
|
}
|
|
588
588
|
onReady() {
|
|
589
|
-
|
|
590
|
-
[
|
|
591
|
-
[
|
|
589
|
+
ee(this._injector, [
|
|
590
|
+
[U],
|
|
591
|
+
[x]
|
|
592
592
|
]);
|
|
593
593
|
}
|
|
594
594
|
onRendered() {
|
|
595
|
-
|
|
596
|
-
[
|
|
597
|
-
[
|
|
595
|
+
ee(this._injector, [
|
|
596
|
+
[T],
|
|
597
|
+
[H]
|
|
598
598
|
]);
|
|
599
599
|
}
|
|
600
600
|
};
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
be(
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
],
|
|
601
|
+
_e(L, "pluginName", Ot);
|
|
602
|
+
_e(L, "type", b.UNIVER_SHEET);
|
|
603
|
+
L = Et([
|
|
604
|
+
be(He),
|
|
605
|
+
re(1, d(Me)),
|
|
606
|
+
re(2, ye)
|
|
607
|
+
], L);
|
|
608
608
|
export {
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
609
|
+
x as SheetsCellContentController,
|
|
610
|
+
Ct as SheetsNote,
|
|
611
|
+
T as SheetsNotePopupController,
|
|
612
|
+
P as SheetsNotePopupService,
|
|
613
|
+
L as UniverSheetsNoteUIPlugin
|
|
614
614
|
};
|