@univerjs/sheets-sort-ui 0.16.1 → 0.17.0
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 +397 -394
- package/lib/index.css +1 -1
- package/lib/index.js +397 -394
- package/lib/types/index.d.ts +1 -1
- package/lib/types/plugin.d.ts +3 -1
- package/lib/umd/index.js +1 -1
- package/package.json +11 -11
- /package/lib/types/{controllers/config.schema.d.ts → config/config.d.ts} +0 -0
- /package/lib/types/{controllers/menu.schema.d.ts → menu/schema.d.ts} +0 -0
- /package/lib/types/{controllers → menu}/sheets-sort.menu.d.ts +0 -0
package/lib/es/index.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { LocaleService as
|
|
1
|
+
var Ge = Object.defineProperty;
|
|
2
|
+
var We = (e, t, r) => t in e ? Ge(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
|
+
var X = (e, t, r) => We(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
|
+
import { LocaleService as U, IUniverInstanceService as ye, IConfirmService as qe, Inject as M, ICommandService as _e, Disposable as ze, UniverInstanceType as q, Tools as Ye, LocaleType as ve, CommandType as I, throttle as Xe, Injector as Ie, RxDisposable as Ke, DependentOn as Je, IConfigService as Qe, Plugin as et, merge as tt } from "@univerjs/core";
|
|
5
5
|
import { jsxs as g, jsx as c } from "react/jsx-runtime";
|
|
6
|
-
import { SheetsSelectionsService as
|
|
7
|
-
import { SheetsSortService as
|
|
8
|
-
import { BehaviorSubject as
|
|
9
|
-
import { RadioGroup as
|
|
10
|
-
import { useDependency as R,
|
|
11
|
-
import { useState as
|
|
12
|
-
import { serializeRange as
|
|
13
|
-
import { getCurrentRangeDisable$ as
|
|
14
|
-
const
|
|
15
|
-
const [t, r] =
|
|
6
|
+
import { SheetsSelectionsService as rt, getPrimaryForRange as nt, SetSelectionsOperation as ot, expandToContinuousRange as fe, RangeProtectionPermissionEditPoint as b, WorksheetSortPermission as O, WorksheetEditPermission as N, WorkbookEditablePermission as k, getSheetCommandTarget as st } from "@univerjs/sheets";
|
|
7
|
+
import { SheetsSortService as we, SortType as $, SortRangeCommand as it, UniverSheetsSortPlugin as ct } from "@univerjs/sheets-sort";
|
|
8
|
+
import { BehaviorSubject as at, takeUntil as lt } from "rxjs";
|
|
9
|
+
import { RadioGroup as Me, Radio as V, Checkbox as dt, clsx as K, DraggableList as ut, scrollbarClassName as Re, Button as G, Dropdown as ht, ButtonGroup as gt } from "@univerjs/design";
|
|
10
|
+
import { useDependency as R, MenuItemType as f, getMenuHiddenObservable as Ee, ContextMenuPosition as Ct, ContextMenuGroup as mt, RibbonDataGroup as vt, useObservable as ft, IMenuManagerService as St, IDialogService as pt, ILayoutService as xt, IUIPartsService as yt, ComponentManager as _t, connectInjector as It } from "@univerjs/ui";
|
|
11
|
+
import { useState as Z, useRef as Te, createElement as p, forwardRef as w, useCallback as T, useEffect as be } from "react";
|
|
12
|
+
import { serializeRange as wt } from "@univerjs/engine-formula";
|
|
13
|
+
import { getCurrentRangeDisable$ as L, getCurrentExclusiveRangeInterest$ as Mt, SheetsRenderService as Rt, SheetsUIPart as Et } from "@univerjs/sheets-ui";
|
|
14
|
+
const Tt = (e) => {
|
|
15
|
+
const [t, r] = Z("0"), n = R(U);
|
|
16
16
|
return /* @__PURE__ */ g("div", { className: "univer-text-sm", children: [
|
|
17
17
|
/* @__PURE__ */ c("div", { className: "extend-confirm-desc", children: n.t("sheets-sort.dialog.sort-reminder-desc") }),
|
|
18
18
|
/* @__PURE__ */ g(
|
|
19
|
-
|
|
19
|
+
Me,
|
|
20
20
|
{
|
|
21
21
|
className: "univer-mt-4",
|
|
22
22
|
value: t,
|
|
@@ -25,29 +25,29 @@ const Et = (e) => {
|
|
|
25
25
|
r(o), e.onChange(o);
|
|
26
26
|
},
|
|
27
27
|
children: [
|
|
28
|
-
/* @__PURE__ */ c(
|
|
29
|
-
/* @__PURE__ */ c(
|
|
28
|
+
/* @__PURE__ */ c(V, { value: "0", children: n.t("sheets-sort.dialog.sort-reminder-no") }),
|
|
29
|
+
/* @__PURE__ */ c(V, { value: "1", children: n.t("sheets-sort.dialog.sort-reminder-ext") })
|
|
30
30
|
]
|
|
31
31
|
}
|
|
32
32
|
)
|
|
33
33
|
] });
|
|
34
34
|
};
|
|
35
|
-
var
|
|
36
|
-
for (var o = n > 1 ? void 0 : n ?
|
|
35
|
+
var bt = Object.getOwnPropertyDescriptor, Ot = (e, t, r, n) => {
|
|
36
|
+
for (var o = n > 1 ? void 0 : n ? bt(t, r) : t, s = e.length - 1, i; s >= 0; s--)
|
|
37
37
|
(i = e[s]) && (o = i(o) || o);
|
|
38
38
|
return o;
|
|
39
39
|
}, D = (e, t) => (r, n) => t(r, n, e);
|
|
40
|
-
const
|
|
40
|
+
const F = {
|
|
41
41
|
MERGE_ERROR: "sheets-sort.error.merge-size",
|
|
42
42
|
EMPTY_ERROR: "sheets-sort.error.empty",
|
|
43
43
|
SINGLE_ERROR: "sheets-sort.error.single",
|
|
44
44
|
FORMULA_ARRAY: "sheets-sort.error.formula-array"
|
|
45
45
|
};
|
|
46
|
-
let C = class extends
|
|
46
|
+
let C = class extends ze {
|
|
47
47
|
constructor(t, r, n, o, s, i) {
|
|
48
48
|
super();
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
X(this, "_customSortState$", new at(null));
|
|
50
|
+
X(this, "customSortState$", this._customSortState$.asObservable());
|
|
51
51
|
this._univerInstanceService = t, this._confirmService = r, this._selectionManagerService = n, this._sheetsSortService = o, this._localeService = s, this._commandService = i;
|
|
52
52
|
}
|
|
53
53
|
async triggerSortDirectly(t, r, n) {
|
|
@@ -78,8 +78,8 @@ let C = class extends qe {
|
|
|
78
78
|
const { unitId: n, subUnitId: o, range: s } = r, i = (u = this._univerInstanceService.getUnit(n)) == null ? void 0 : u.getSheetBySheetId(o);
|
|
79
79
|
if (!i)
|
|
80
80
|
return [];
|
|
81
|
-
const a =
|
|
82
|
-
return Array.from({ length: s.endColumn - s.startColumn + 1 }, (
|
|
81
|
+
const a = Nt(this._localeService);
|
|
82
|
+
return Array.from({ length: s.endColumn - s.startColumn + 1 }, (y, v) => {
|
|
83
83
|
var m;
|
|
84
84
|
const E = (m = i.getCell(s.startRow, v + s.startColumn)) == null ? void 0 : m.v;
|
|
85
85
|
return {
|
|
@@ -96,9 +96,9 @@ let C = class extends qe {
|
|
|
96
96
|
const s = {
|
|
97
97
|
unitId: t,
|
|
98
98
|
subUnitId: r,
|
|
99
|
-
selections: [{ range: n, primary:
|
|
99
|
+
selections: [{ range: n, primary: nt(n, o), style: null }]
|
|
100
100
|
};
|
|
101
|
-
this._commandService.executeCommand(
|
|
101
|
+
this._commandService.executeCommand(ot.id, s);
|
|
102
102
|
}
|
|
103
103
|
async showCheckError(t) {
|
|
104
104
|
return await this._confirmService.confirm({
|
|
@@ -122,7 +122,7 @@ let C = class extends qe {
|
|
|
122
122
|
},
|
|
123
123
|
children: {
|
|
124
124
|
title: /* @__PURE__ */ c(
|
|
125
|
-
|
|
125
|
+
Tt,
|
|
126
126
|
{
|
|
127
127
|
onChange: (n) => {
|
|
128
128
|
t = n === "1";
|
|
@@ -142,7 +142,7 @@ let C = class extends qe {
|
|
|
142
142
|
this._customSortState$.next({ show: !1 });
|
|
143
143
|
}
|
|
144
144
|
_check(t) {
|
|
145
|
-
return this._sheetsSortService.singleCheck(t) ? this._sheetsSortService.mergeCheck(t) ? this._sheetsSortService.formulaCheck(t) ? this._sheetsSortService.emptyCheck(t) ? !0 : (this.showCheckError(
|
|
145
|
+
return this._sheetsSortService.singleCheck(t) ? this._sheetsSortService.mergeCheck(t) ? this._sheetsSortService.formulaCheck(t) ? this._sheetsSortService.emptyCheck(t) ? !0 : (this.showCheckError(F.EMPTY_ERROR), !1) : (this.showCheckError(F.FORMULA_ARRAY), !1) : (this.showCheckError(F.MERGE_ERROR), !1) : (this.showCheckError(F.SINGLE_ERROR), !1);
|
|
146
146
|
}
|
|
147
147
|
async _detectSortLocation(t) {
|
|
148
148
|
const r = this._univerInstanceService.getCurrentUnitForType(q.UNIVER_SHEET), n = r.getActiveSheet(), o = r.getUnitId(), s = n.getSheetId(), i = this._selectionManagerService.getCurrentLastSelection();
|
|
@@ -150,14 +150,14 @@ let C = class extends qe {
|
|
|
150
150
|
return null;
|
|
151
151
|
let a;
|
|
152
152
|
if (t === !0)
|
|
153
|
-
a =
|
|
153
|
+
a = fe(i.range, { up: !0, down: !0, left: !0, right: !0 }, n), this.setSelection(o, s, a);
|
|
154
154
|
else if (t === !1)
|
|
155
155
|
a = i.range;
|
|
156
156
|
else {
|
|
157
157
|
const l = await this.showExtendConfirm();
|
|
158
158
|
if (l === "cancel")
|
|
159
159
|
return null;
|
|
160
|
-
l === "keep" ? a = i.range : (a =
|
|
160
|
+
l === "keep" ? a = i.range : (a = fe(i.range, { up: !0, down: !0, left: !0, right: !0 }, n), this.setSelection(o, s, a));
|
|
161
161
|
}
|
|
162
162
|
return {
|
|
163
163
|
range: a,
|
|
@@ -167,71 +167,74 @@ let C = class extends qe {
|
|
|
167
167
|
};
|
|
168
168
|
}
|
|
169
169
|
};
|
|
170
|
-
C =
|
|
171
|
-
D(0,
|
|
172
|
-
D(1,
|
|
173
|
-
D(2, M(
|
|
174
|
-
D(3, M(
|
|
175
|
-
D(4, M(
|
|
170
|
+
C = Ot([
|
|
171
|
+
D(0, ye),
|
|
172
|
+
D(1, qe),
|
|
173
|
+
D(2, M(rt)),
|
|
174
|
+
D(3, M(we)),
|
|
175
|
+
D(4, M(U)),
|
|
176
176
|
D(5, _e)
|
|
177
177
|
], C);
|
|
178
|
-
function
|
|
178
|
+
function Nt(e) {
|
|
179
179
|
return (t) => {
|
|
180
|
-
const r =
|
|
180
|
+
const r = Ye.chatAtABC(t);
|
|
181
181
|
switch (e.getCurrentLocale()) {
|
|
182
|
-
case
|
|
182
|
+
case ve.ZH_CN:
|
|
183
183
|
return `"${r}"列`;
|
|
184
|
-
case
|
|
184
|
+
case ve.EN_US:
|
|
185
185
|
return `Column "${r}"`;
|
|
186
186
|
default:
|
|
187
187
|
return `Column "${r}"`;
|
|
188
188
|
}
|
|
189
189
|
};
|
|
190
190
|
}
|
|
191
|
-
const
|
|
191
|
+
const Q = {
|
|
192
192
|
id: "sheet.command.sort-range-asc",
|
|
193
193
|
type: I.COMMAND,
|
|
194
194
|
handler: async (e) => await e.get(C).triggerSortDirectly(!0, !1)
|
|
195
|
-
},
|
|
195
|
+
}, ee = {
|
|
196
196
|
id: "sheet.command.sort-range-asc-ext",
|
|
197
197
|
type: I.COMMAND,
|
|
198
198
|
handler: async (e) => await e.get(C).triggerSortDirectly(!0, !0)
|
|
199
|
-
},
|
|
199
|
+
}, te = {
|
|
200
200
|
id: "sheet.command.sort-range-desc",
|
|
201
201
|
type: I.COMMAND,
|
|
202
202
|
handler: async (e) => await e.get(C).triggerSortDirectly(!1, !1)
|
|
203
|
-
},
|
|
203
|
+
}, re = {
|
|
204
204
|
id: "sheet.command.sort-range-desc-ext",
|
|
205
205
|
type: I.COMMAND,
|
|
206
206
|
handler: async (e) => await e.get(C).triggerSortDirectly(!1, !0)
|
|
207
|
-
},
|
|
207
|
+
}, ne = {
|
|
208
208
|
id: "sheet.command.sort-range-custom",
|
|
209
209
|
type: I.COMMAND,
|
|
210
210
|
handler: async (e) => await e.get(C).triggerSortCustomize()
|
|
211
|
-
},
|
|
211
|
+
}, oe = {
|
|
212
212
|
id: "sheet.command.sort-range-asc-ctx",
|
|
213
213
|
type: I.COMMAND,
|
|
214
214
|
handler: async (e) => await e.get(C).triggerSortDirectly(!0, !1)
|
|
215
|
-
},
|
|
215
|
+
}, se = {
|
|
216
216
|
id: "sheet.command.sort-range-asc-ext-ctx",
|
|
217
217
|
type: I.COMMAND,
|
|
218
218
|
handler: async (e) => await e.get(C).triggerSortDirectly(!0, !0)
|
|
219
|
-
},
|
|
219
|
+
}, ie = {
|
|
220
220
|
id: "sheet.command.sort-range-desc-ctx",
|
|
221
221
|
type: I.COMMAND,
|
|
222
222
|
handler: async (e) => await e.get(C).triggerSortDirectly(!1, !1)
|
|
223
|
-
},
|
|
223
|
+
}, ce = {
|
|
224
224
|
id: "sheet.command.sort-range-desc-ext-ctx",
|
|
225
225
|
type: I.COMMAND,
|
|
226
226
|
handler: async (e) => await e.get(C).triggerSortDirectly(!1, !0)
|
|
227
|
-
},
|
|
227
|
+
}, ae = {
|
|
228
228
|
id: "sheet.command.sort-range-custom-ctx",
|
|
229
229
|
type: I.COMMAND,
|
|
230
230
|
handler: async (e) => await e.get(C).triggerSortCustomize()
|
|
231
|
-
},
|
|
231
|
+
}, kt = "@univerjs/sheets-sort-ui", Lt = "0.17.0", Oe = {
|
|
232
|
+
name: kt,
|
|
233
|
+
version: Lt
|
|
234
|
+
}, Dt = "sheets-sort-ui.config", Se = {};
|
|
232
235
|
function x({ ref: e, ...t }) {
|
|
233
|
-
const { icon: r, id: n, className: o, extend: s, ...i } = t, a = `univerjs-icon univerjs-icon-${n} ${o || ""}`.trim(), l =
|
|
234
|
-
return
|
|
236
|
+
const { icon: r, id: n, className: o, extend: s, ...i } = t, a = `univerjs-icon univerjs-icon-${n} ${o || ""}`.trim(), l = Te(`_${Ut()}`);
|
|
237
|
+
return Ne(r, `${n}`, {
|
|
235
238
|
defIds: r.defIds,
|
|
236
239
|
idSuffix: l.current
|
|
237
240
|
}, {
|
|
@@ -240,14 +243,14 @@ function x({ ref: e, ...t }) {
|
|
|
240
243
|
...i
|
|
241
244
|
}, s);
|
|
242
245
|
}
|
|
243
|
-
function
|
|
246
|
+
function Ne(e, t, r, n, o) {
|
|
244
247
|
return p(e.tag, {
|
|
245
248
|
key: t,
|
|
246
|
-
|
|
249
|
+
...$t(e, r, o),
|
|
247
250
|
...n
|
|
248
|
-
}, (
|
|
251
|
+
}, (Ht(e, r).children || []).map((s, i) => Ne(s, `${t}-${e.tag}-${i}`, r, void 0, o)));
|
|
249
252
|
}
|
|
250
|
-
function
|
|
253
|
+
function $t(e, t, r) {
|
|
251
254
|
const n = { ...e.attrs };
|
|
252
255
|
r != null && r.colorChannel1 && n.fill === "colorChannel1" && (n.fill = r.colorChannel1), e.tag === "mask" && n.id && (n.id = n.id + t.idSuffix), Object.entries(n).forEach(([s, i]) => {
|
|
253
256
|
s === "mask" && typeof i == "string" && (n[s] = i.replace(/url\(#(.*)\)/, `url(#$1${t.idSuffix})`));
|
|
@@ -257,7 +260,7 @@ function Lt(e, t, r) {
|
|
|
257
260
|
typeof i == "string" && (n[s] = i.replace(/url\(#(.*)\)/, `url(#$1${t.idSuffix})`));
|
|
258
261
|
})), n;
|
|
259
262
|
}
|
|
260
|
-
function
|
|
263
|
+
function Ht(e, t) {
|
|
261
264
|
var n;
|
|
262
265
|
const { defIds: r } = t;
|
|
263
266
|
return !r || r.length === 0 ? e : e.tag === "defs" && ((n = e.children) != null && n.length) ? {
|
|
@@ -271,11 +274,11 @@ function kt(e, t) {
|
|
|
271
274
|
} : o)
|
|
272
275
|
} : e;
|
|
273
276
|
}
|
|
274
|
-
function
|
|
277
|
+
function Ut() {
|
|
275
278
|
return Math.random().toString(36).substring(2, 8);
|
|
276
279
|
}
|
|
277
280
|
x.displayName = "UniverIcon";
|
|
278
|
-
const
|
|
281
|
+
const At = {
|
|
279
282
|
tag: "svg",
|
|
280
283
|
attrs: {
|
|
281
284
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -311,15 +314,15 @@ const $t = {
|
|
|
311
314
|
}
|
|
312
315
|
}
|
|
313
316
|
]
|
|
314
|
-
},
|
|
317
|
+
}, le = w(function(t, r) {
|
|
315
318
|
return p(x, Object.assign({}, t, {
|
|
316
319
|
id: "ascending-icon",
|
|
317
320
|
ref: r,
|
|
318
|
-
icon:
|
|
321
|
+
icon: At
|
|
319
322
|
}));
|
|
320
323
|
});
|
|
321
|
-
|
|
322
|
-
const
|
|
324
|
+
le.displayName = "AscendingIcon";
|
|
325
|
+
const Pt = {
|
|
323
326
|
tag: "svg",
|
|
324
327
|
attrs: {
|
|
325
328
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -337,15 +340,15 @@ const Ht = {
|
|
|
337
340
|
clipRule: "evenodd"
|
|
338
341
|
}
|
|
339
342
|
}]
|
|
340
|
-
},
|
|
343
|
+
}, ke = w(function(t, r) {
|
|
341
344
|
return p(x, Object.assign({}, t, {
|
|
342
345
|
id: "check-mark-icon",
|
|
343
346
|
ref: r,
|
|
344
|
-
icon:
|
|
347
|
+
icon: Pt
|
|
345
348
|
}));
|
|
346
349
|
});
|
|
347
|
-
|
|
348
|
-
const
|
|
350
|
+
ke.displayName = "CheckMarkIcon";
|
|
351
|
+
const Zt = {
|
|
349
352
|
tag: "svg",
|
|
350
353
|
attrs: {
|
|
351
354
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -379,15 +382,15 @@ const At = {
|
|
|
379
382
|
}
|
|
380
383
|
}
|
|
381
384
|
]
|
|
382
|
-
},
|
|
385
|
+
}, Le = w(function(t, r) {
|
|
383
386
|
return p(x, Object.assign({}, t, {
|
|
384
387
|
id: "custom-sort-icon",
|
|
385
388
|
ref: r,
|
|
386
|
-
icon:
|
|
389
|
+
icon: Zt
|
|
387
390
|
}));
|
|
388
391
|
});
|
|
389
|
-
|
|
390
|
-
const
|
|
392
|
+
Le.displayName = "CustomSortIcon";
|
|
393
|
+
const jt = {
|
|
391
394
|
tag: "svg",
|
|
392
395
|
attrs: {
|
|
393
396
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -421,15 +424,15 @@ const Ut = {
|
|
|
421
424
|
}
|
|
422
425
|
}
|
|
423
426
|
]
|
|
424
|
-
},
|
|
427
|
+
}, De = w(function(t, r) {
|
|
425
428
|
return p(x, Object.assign({}, t, {
|
|
426
429
|
id: "delete-empty-icon",
|
|
427
430
|
ref: r,
|
|
428
|
-
icon:
|
|
431
|
+
icon: jt
|
|
429
432
|
}));
|
|
430
433
|
});
|
|
431
|
-
|
|
432
|
-
const
|
|
434
|
+
De.displayName = "DeleteEmptyIcon";
|
|
435
|
+
const Bt = {
|
|
433
436
|
tag: "svg",
|
|
434
437
|
attrs: {
|
|
435
438
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -465,15 +468,15 @@ const Pt = {
|
|
|
465
468
|
}
|
|
466
469
|
}
|
|
467
470
|
]
|
|
468
|
-
},
|
|
471
|
+
}, de = w(function(t, r) {
|
|
469
472
|
return p(x, Object.assign({}, t, {
|
|
470
473
|
id: "descending-icon",
|
|
471
474
|
ref: r,
|
|
472
|
-
icon:
|
|
475
|
+
icon: Bt
|
|
473
476
|
}));
|
|
474
477
|
});
|
|
475
|
-
|
|
476
|
-
const
|
|
478
|
+
de.displayName = "DescendingIcon";
|
|
479
|
+
const Ft = {
|
|
477
480
|
tag: "svg",
|
|
478
481
|
attrs: {
|
|
479
482
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -497,15 +500,15 @@ const Zt = {
|
|
|
497
500
|
d: "M12.4267 14.2667C12.4267 14.5981 12.1581 14.8667 11.8267 14.8667C11.4953 14.8667 11.2267 14.5981 11.2267 14.2667V3.18198L9.98447 4.42422C9.75015 4.65853 9.37026 4.65853 9.13594 4.42422C8.90163 4.1899 8.90163 3.81 9.13594 3.57569L11.4026 1.30902C11.6369 1.07471 12.0168 1.07471 12.2511 1.30902L14.5178 3.57569C14.7521 3.81 14.7521 4.1899 14.5178 4.42422C14.2835 4.65853 13.9036 4.65853 13.6693 4.42422L12.4267 3.18165V14.2667Z"
|
|
498
501
|
}
|
|
499
502
|
}]
|
|
500
|
-
},
|
|
503
|
+
}, $e = w(function(t, r) {
|
|
501
504
|
return p(x, Object.assign({}, t, {
|
|
502
505
|
id: "expand-ascending-icon",
|
|
503
506
|
ref: r,
|
|
504
|
-
icon:
|
|
507
|
+
icon: Ft
|
|
505
508
|
}));
|
|
506
509
|
});
|
|
507
|
-
|
|
508
|
-
const
|
|
510
|
+
$e.displayName = "ExpandAscendingIcon";
|
|
511
|
+
const Vt = {
|
|
509
512
|
tag: "svg",
|
|
510
513
|
attrs: {
|
|
511
514
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -529,15 +532,15 @@ const jt = {
|
|
|
529
532
|
d: "M12.4267 1.7333C12.4267 1.40193 12.1581 1.1333 11.8267 1.1333C11.4953 1.1333 11.2267 1.40193 11.2267 1.7333V12.818L9.98447 11.5758C9.75015 11.3415 9.37026 11.3415 9.13594 11.5758C8.90163 11.8101 8.90163 12.19 9.13594 12.4243L11.4026 14.691C11.6369 14.9253 12.0168 14.9253 12.2511 14.691L14.5178 12.4243C14.7521 12.19 14.7521 11.8101 14.5178 11.5758C14.2835 11.3415 13.9036 11.3415 13.6693 11.5758L12.4267 12.8183V1.7333Z"
|
|
530
533
|
}
|
|
531
534
|
}]
|
|
532
|
-
},
|
|
535
|
+
}, He = w(function(t, r) {
|
|
533
536
|
return p(x, Object.assign({}, t, {
|
|
534
537
|
id: "expand-descending-icon",
|
|
535
538
|
ref: r,
|
|
536
|
-
icon:
|
|
539
|
+
icon: Vt
|
|
537
540
|
}));
|
|
538
541
|
});
|
|
539
|
-
|
|
540
|
-
const
|
|
542
|
+
He.displayName = "ExpandDescendingIcon";
|
|
543
|
+
const Gt = {
|
|
541
544
|
tag: "svg",
|
|
542
545
|
attrs: {
|
|
543
546
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -553,15 +556,15 @@ const Bt = {
|
|
|
553
556
|
d: "M8.6 1.99991C8.60001 1.66854 8.33138 1.39991 8.00001 1.3999C7.66864 1.3999 7.40001 1.66853 7.4 1.9999L7.39996 7.3999H1.9999C1.66853 7.3999 1.3999 7.66853 1.3999 7.9999C1.3999 8.33127 1.66853 8.5999 1.9999 8.5999H7.39995L7.3999 13.9999C7.3999 14.3313 7.66853 14.5999 7.9999 14.5999C8.33127 14.5999 8.5999 14.3313 8.5999 13.9999L8.59995 8.5999H13.9999C14.3313 8.5999 14.5999 8.33127 14.5999 7.9999C14.5999 7.66853 14.3313 7.3999 13.9999 7.3999H8.59996L8.6 1.99991Z"
|
|
554
557
|
}
|
|
555
558
|
}]
|
|
556
|
-
},
|
|
559
|
+
}, J = w(function(t, r) {
|
|
557
560
|
return p(x, Object.assign({}, t, {
|
|
558
561
|
id: "increase-icon",
|
|
559
562
|
ref: r,
|
|
560
|
-
icon:
|
|
563
|
+
icon: Gt
|
|
561
564
|
}));
|
|
562
565
|
});
|
|
563
|
-
|
|
564
|
-
const
|
|
566
|
+
J.displayName = "IncreaseIcon";
|
|
567
|
+
const Wt = {
|
|
565
568
|
tag: "svg",
|
|
566
569
|
attrs: {
|
|
567
570
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -579,15 +582,15 @@ const Ft = {
|
|
|
579
582
|
clipRule: "evenodd"
|
|
580
583
|
}
|
|
581
584
|
}]
|
|
582
|
-
},
|
|
585
|
+
}, Ue = w(function(t, r) {
|
|
583
586
|
return p(x, Object.assign({}, t, {
|
|
584
587
|
id: "more-down-icon",
|
|
585
588
|
ref: r,
|
|
586
|
-
icon:
|
|
589
|
+
icon: Wt
|
|
587
590
|
}));
|
|
588
591
|
});
|
|
589
|
-
|
|
590
|
-
const
|
|
592
|
+
Ue.displayName = "MoreDownIcon";
|
|
593
|
+
const qt = {
|
|
591
594
|
tag: "svg",
|
|
592
595
|
attrs: {
|
|
593
596
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -640,54 +643,221 @@ const Vt = {
|
|
|
640
643
|
}
|
|
641
644
|
}
|
|
642
645
|
]
|
|
643
|
-
},
|
|
646
|
+
}, Ae = w(function(t, r) {
|
|
644
647
|
return p(x, Object.assign({}, t, {
|
|
645
648
|
id: "sequence-icon",
|
|
646
649
|
ref: r,
|
|
647
|
-
icon:
|
|
650
|
+
icon: qt
|
|
648
651
|
}));
|
|
649
652
|
});
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
return
|
|
653
|
+
Ae.displayName = "SequenceIcon";
|
|
654
|
+
const Pe = "sheet.menu.sheets-sort", Ze = "sheet.menu.sheets-sort-ctx", j = "AscendingIcon", ue = "ExpandAscendingIcon", he = "DescendingIcon", ge = "ExpandDescendingIcon", Ce = "CustomSortIcon";
|
|
655
|
+
function zt(e) {
|
|
656
|
+
return {
|
|
657
|
+
id: Pe,
|
|
658
|
+
type: f.SUBITEMS,
|
|
659
|
+
icon: j,
|
|
660
|
+
tooltip: "sheets-sort.general.sort",
|
|
661
|
+
hidden$: Ee(e, q.UNIVER_SHEET),
|
|
662
|
+
disabled$: L(e, { workbookTypes: [k], worksheetTypes: [O, N], rangeTypes: [b] })
|
|
663
|
+
};
|
|
664
|
+
}
|
|
665
|
+
function Yt(e) {
|
|
666
|
+
return {
|
|
667
|
+
id: Q.id,
|
|
668
|
+
icon: j,
|
|
669
|
+
title: "sheets-sort.general.sort-asc-cur",
|
|
670
|
+
type: f.BUTTON,
|
|
671
|
+
hidden$: Mt(e)
|
|
672
|
+
};
|
|
673
|
+
}
|
|
674
|
+
function Xt(e) {
|
|
675
|
+
return {
|
|
676
|
+
id: ee.id,
|
|
677
|
+
title: "sheets-sort.general.sort-asc-ext",
|
|
678
|
+
icon: ue,
|
|
679
|
+
type: f.BUTTON
|
|
680
|
+
};
|
|
681
|
+
}
|
|
682
|
+
function Kt(e) {
|
|
683
|
+
return {
|
|
684
|
+
id: te.id,
|
|
685
|
+
title: "sheets-sort.general.sort-desc-cur",
|
|
686
|
+
icon: he,
|
|
687
|
+
type: f.BUTTON
|
|
688
|
+
};
|
|
689
|
+
}
|
|
690
|
+
function Jt(e) {
|
|
691
|
+
return {
|
|
692
|
+
id: re.id,
|
|
693
|
+
title: "sheets-sort.general.sort-desc-ext",
|
|
694
|
+
icon: ge,
|
|
695
|
+
type: f.BUTTON
|
|
696
|
+
};
|
|
697
|
+
}
|
|
698
|
+
function Qt(e) {
|
|
699
|
+
return {
|
|
700
|
+
id: ne.id,
|
|
701
|
+
title: "sheets-sort.general.sort-custom",
|
|
702
|
+
type: f.BUTTON,
|
|
703
|
+
icon: Ce
|
|
704
|
+
};
|
|
705
|
+
}
|
|
706
|
+
function er(e) {
|
|
707
|
+
return {
|
|
708
|
+
id: Ze,
|
|
709
|
+
title: "sheets-sort.general.sort",
|
|
710
|
+
type: f.SUBITEMS,
|
|
711
|
+
icon: j,
|
|
712
|
+
hidden$: Ee(e, q.UNIVER_SHEET),
|
|
713
|
+
disabled$: L(e, {
|
|
714
|
+
workbookTypes: [k],
|
|
715
|
+
worksheetTypes: [O, N],
|
|
716
|
+
rangeTypes: [b]
|
|
717
|
+
})
|
|
718
|
+
};
|
|
719
|
+
}
|
|
720
|
+
function tr(e) {
|
|
721
|
+
return {
|
|
722
|
+
id: oe.id,
|
|
723
|
+
title: "sheets-sort.general.sort-asc-cur",
|
|
724
|
+
type: f.BUTTON,
|
|
725
|
+
icon: j,
|
|
726
|
+
disabled$: L(e, { workbookTypes: [k], worksheetTypes: [O, N], rangeTypes: [b] })
|
|
727
|
+
};
|
|
728
|
+
}
|
|
729
|
+
function rr(e) {
|
|
730
|
+
return {
|
|
731
|
+
id: se.id,
|
|
732
|
+
title: "sheets-sort.general.sort-asc-ext",
|
|
733
|
+
type: f.BUTTON,
|
|
734
|
+
icon: ue,
|
|
735
|
+
disabled$: L(e, { workbookTypes: [k], worksheetTypes: [O, N], rangeTypes: [b] })
|
|
736
|
+
};
|
|
737
|
+
}
|
|
738
|
+
function nr(e) {
|
|
739
|
+
return {
|
|
740
|
+
id: ie.id,
|
|
741
|
+
title: "sheets-sort.general.sort-desc-cur",
|
|
742
|
+
type: f.BUTTON,
|
|
743
|
+
icon: he,
|
|
744
|
+
disabled$: L(e, { workbookTypes: [k], worksheetTypes: [O, N], rangeTypes: [b] })
|
|
745
|
+
};
|
|
746
|
+
}
|
|
747
|
+
function or(e) {
|
|
748
|
+
return {
|
|
749
|
+
id: ce.id,
|
|
750
|
+
title: "sheets-sort.general.sort-desc-ext",
|
|
751
|
+
type: f.BUTTON,
|
|
752
|
+
icon: ge,
|
|
753
|
+
disabled$: L(e, { workbookTypes: [k], worksheetTypes: [O, N], rangeTypes: [b] })
|
|
754
|
+
};
|
|
755
|
+
}
|
|
756
|
+
function sr(e) {
|
|
757
|
+
return {
|
|
758
|
+
id: ae.id,
|
|
759
|
+
title: "sheets-sort.general.sort-custom",
|
|
760
|
+
type: f.BUTTON,
|
|
761
|
+
icon: Ce,
|
|
762
|
+
disabled$: L(e, { workbookTypes: [k], worksheetTypes: [O, N], rangeTypes: [b] })
|
|
763
|
+
};
|
|
654
764
|
}
|
|
655
|
-
|
|
656
|
-
|
|
765
|
+
const ir = {
|
|
766
|
+
[vt.ORGANIZATION]: {
|
|
767
|
+
[Pe]: {
|
|
768
|
+
order: 3,
|
|
769
|
+
menuItemFactory: zt,
|
|
770
|
+
[Q.id]: {
|
|
771
|
+
order: 0,
|
|
772
|
+
menuItemFactory: Yt
|
|
773
|
+
},
|
|
774
|
+
[ee.id]: {
|
|
775
|
+
order: 1,
|
|
776
|
+
menuItemFactory: Xt
|
|
777
|
+
},
|
|
778
|
+
[te.id]: {
|
|
779
|
+
order: 2,
|
|
780
|
+
menuItemFactory: Kt
|
|
781
|
+
},
|
|
782
|
+
[re.id]: {
|
|
783
|
+
order: 3,
|
|
784
|
+
menuItemFactory: Jt
|
|
785
|
+
},
|
|
786
|
+
[ne.id]: {
|
|
787
|
+
order: 4,
|
|
788
|
+
menuItemFactory: Qt
|
|
789
|
+
}
|
|
790
|
+
}
|
|
791
|
+
},
|
|
792
|
+
[Ct.MAIN_AREA]: {
|
|
793
|
+
[mt.DATA]: {
|
|
794
|
+
[Ze]: {
|
|
795
|
+
order: 0,
|
|
796
|
+
menuItemFactory: er,
|
|
797
|
+
[oe.id]: {
|
|
798
|
+
order: 0,
|
|
799
|
+
menuItemFactory: tr
|
|
800
|
+
},
|
|
801
|
+
[se.id]: {
|
|
802
|
+
order: 1,
|
|
803
|
+
menuItemFactory: rr
|
|
804
|
+
},
|
|
805
|
+
[ie.id]: {
|
|
806
|
+
order: 2,
|
|
807
|
+
menuItemFactory: nr
|
|
808
|
+
},
|
|
809
|
+
[ce.id]: {
|
|
810
|
+
order: 3,
|
|
811
|
+
menuItemFactory: or
|
|
812
|
+
},
|
|
813
|
+
[ae.id]: {
|
|
814
|
+
order: 4,
|
|
815
|
+
menuItemFactory: sr
|
|
816
|
+
}
|
|
817
|
+
}
|
|
818
|
+
}
|
|
819
|
+
}
|
|
820
|
+
};
|
|
821
|
+
function cr() {
|
|
822
|
+
const e = R(C), t = ft(e.customSortState$);
|
|
823
|
+
return !t || !t.location ? null : /* @__PURE__ */ c(ar, { state: t });
|
|
824
|
+
}
|
|
825
|
+
function ar({ state: e }) {
|
|
826
|
+
const t = R(we), r = R(U), n = R(C), [o, s] = Z(!1), [i, a] = Z(0), l = Te(null), { range: u, unitId: y, subUnitId: v } = e.location, E = n.getTitles(o), [m, A] = Z([
|
|
657
827
|
{ type: $.ASC, colIndex: u.startColumn }
|
|
658
|
-
]),
|
|
659
|
-
const
|
|
660
|
-
S === null ?
|
|
828
|
+
]), B = T((d, S) => {
|
|
829
|
+
const P = [...m];
|
|
830
|
+
S === null ? P.splice(d, 1) : P[d] = S, A(P);
|
|
661
831
|
}, [m]), h = T(
|
|
662
|
-
|
|
663
|
-
const d = [...m], S =
|
|
832
|
+
Xe(() => {
|
|
833
|
+
const d = [...m], S = dr(u, m);
|
|
664
834
|
S !== null && (d.push({ type: $.ASC, colIndex: S }), A(d));
|
|
665
835
|
}, 200),
|
|
666
836
|
[m, u]
|
|
667
|
-
),
|
|
837
|
+
), Y = T((d, S) => {
|
|
668
838
|
t.applySort({ range: u, orderRules: d, hasTitle: S }), n.closeCustomSortPanel();
|
|
669
|
-
}, [t, n, u]),
|
|
839
|
+
}, [t, n, u]), Be = T(() => {
|
|
670
840
|
n.closeCustomSortPanel();
|
|
671
|
-
}, [n]),
|
|
672
|
-
s(d), d ? n.setSelection(
|
|
673
|
-
}, [n, u, v,
|
|
674
|
-
|
|
841
|
+
}, [n]), Fe = T((d) => {
|
|
842
|
+
s(d), d ? n.setSelection(y, v, { ...u, startRow: u.startRow + 1 }) : n.setSelection(y, v, u);
|
|
843
|
+
}, [n, u, v, y]);
|
|
844
|
+
be(() => {
|
|
675
845
|
l.current && m.length > 5 && (l.current.scrollTop = l.current.scrollHeight);
|
|
676
846
|
}, [m]);
|
|
677
|
-
const
|
|
847
|
+
const Ve = m.length < E.length, me = m.map((d) => ({ ...d, id: `${d.colIndex}` }));
|
|
678
848
|
return /* @__PURE__ */ g("div", { children: [
|
|
679
849
|
/* @__PURE__ */ g("div", { onMouseDown: (d) => {
|
|
680
850
|
d.stopPropagation();
|
|
681
851
|
}, children: [
|
|
682
|
-
/* @__PURE__ */ g("div", { className: "univer-flex univer-items-center univer-justify-between", children: [
|
|
683
|
-
/* @__PURE__ */ c(
|
|
684
|
-
|
|
852
|
+
/* @__PURE__ */ g("div", { className: "univer-mb-2 univer-flex univer-items-center univer-justify-between", children: [
|
|
853
|
+
/* @__PURE__ */ c(dt, { checked: o, onChange: (d) => Fe(!!d), children: r.t("sheets-sort.dialog.first-row-check") }),
|
|
854
|
+
Ve ? /* @__PURE__ */ g(
|
|
685
855
|
"div",
|
|
686
856
|
{
|
|
687
857
|
className: "univer-flex univer-cursor-pointer univer-select-none univer-items-center univer-text-base",
|
|
688
858
|
onClick: h,
|
|
689
859
|
children: [
|
|
690
|
-
/* @__PURE__ */ c(
|
|
860
|
+
/* @__PURE__ */ c(J, {}),
|
|
691
861
|
/* @__PURE__ */ c("span", { className: "univer-ml-1.5", children: r.t("sheets-sort.dialog.add-condition") })
|
|
692
862
|
]
|
|
693
863
|
}
|
|
@@ -696,7 +866,7 @@ function Wt({ state: e }) {
|
|
|
696
866
|
{
|
|
697
867
|
className: "univer-flex univer-cursor-pointer univer-select-none univer-items-center univer-text-base univer-text-primary-500 disabled:univer-cursor-not-allowed disabled:univer-divide-opacity-30 disabled:univer-text-gray-800",
|
|
698
868
|
children: [
|
|
699
|
-
/* @__PURE__ */ c(
|
|
869
|
+
/* @__PURE__ */ c(J, {}),
|
|
700
870
|
/* @__PURE__ */ c("span", { className: "univer-ml-1.5 univer-text-xs", children: r.t("sheets-sort.dialog.add-condition") })
|
|
701
871
|
]
|
|
702
872
|
}
|
|
@@ -706,26 +876,25 @@ function Wt({ state: e }) {
|
|
|
706
876
|
"div",
|
|
707
877
|
{
|
|
708
878
|
ref: l,
|
|
709
|
-
className:
|
|
879
|
+
className: K("univer-max-h-[310px] univer-overflow-y-auto univer-overflow-x-hidden", Re),
|
|
710
880
|
onScroll: (d) => {
|
|
711
881
|
const S = d.currentTarget.scrollTop;
|
|
712
882
|
a(S);
|
|
713
883
|
},
|
|
714
884
|
children: /* @__PURE__ */ c(
|
|
715
|
-
|
|
885
|
+
ut,
|
|
716
886
|
{
|
|
717
|
-
|
|
718
|
-
list: Ce,
|
|
887
|
+
list: me,
|
|
719
888
|
onListChange: A,
|
|
720
889
|
idKey: "id",
|
|
721
890
|
draggableHandle: "[data-u-comp=sort-panel-item-handler]",
|
|
722
891
|
itemRender: (d) => /* @__PURE__ */ c(
|
|
723
|
-
|
|
892
|
+
lr,
|
|
724
893
|
{
|
|
725
894
|
titles: E,
|
|
726
|
-
list:
|
|
895
|
+
list: me,
|
|
727
896
|
item: d,
|
|
728
|
-
onChange: (S,
|
|
897
|
+
onChange: (S, P) => B(P, S),
|
|
729
898
|
scrollPosition: i
|
|
730
899
|
}
|
|
731
900
|
),
|
|
@@ -738,36 +907,36 @@ function Wt({ state: e }) {
|
|
|
738
907
|
] }),
|
|
739
908
|
/* @__PURE__ */ g("div", { className: "univer-mt-5 univer-flex univer-justify-end", children: [
|
|
740
909
|
/* @__PURE__ */ c(
|
|
741
|
-
|
|
910
|
+
G,
|
|
742
911
|
{
|
|
743
912
|
className: "univer-ml-3",
|
|
744
|
-
onClick: () =>
|
|
913
|
+
onClick: () => Be(),
|
|
745
914
|
children: r.t("sheets-sort.dialog.cancel")
|
|
746
915
|
}
|
|
747
916
|
),
|
|
748
917
|
/* @__PURE__ */ c(
|
|
749
|
-
|
|
918
|
+
G,
|
|
750
919
|
{
|
|
751
920
|
className: "univer-ml-3",
|
|
752
921
|
variant: "primary",
|
|
753
|
-
onClick: () =>
|
|
922
|
+
onClick: () => Y(m, o),
|
|
754
923
|
children: r.t("sheets-sort.dialog.confirm")
|
|
755
924
|
}
|
|
756
925
|
)
|
|
757
926
|
] })
|
|
758
927
|
] });
|
|
759
928
|
}
|
|
760
|
-
function
|
|
761
|
-
var
|
|
762
|
-
const { list: t, item: r, titles: n, onChange: o, scrollPosition: s } = e, i = R(
|
|
929
|
+
function lr(e) {
|
|
930
|
+
var B;
|
|
931
|
+
const { list: t, item: r, titles: n, onChange: o, scrollPosition: s } = e, i = R(U), a = n.filter((h) => !t.some((Y) => Y.colIndex === h.index) || h.index === r.colIndex), l = t.findIndex((h) => h.colIndex === r.colIndex), u = T((h) => {
|
|
763
932
|
o({ ...r, colIndex: h.index }, l), v(!1);
|
|
764
|
-
}, [l, r, o]), [
|
|
933
|
+
}, [l, r, o]), [y, v] = Z(!1), E = (h) => {
|
|
765
934
|
v(h);
|
|
766
935
|
};
|
|
767
|
-
|
|
936
|
+
be(() => {
|
|
768
937
|
v(!1);
|
|
769
938
|
}, [s]);
|
|
770
|
-
const m = t.length > 1, A = (
|
|
939
|
+
const m = t.length > 1, A = (B = n.find((h) => h.index === r.colIndex)) == null ? void 0 : B.label;
|
|
771
940
|
return /* @__PURE__ */ g("div", { className: "univer-grid univer-grid-flow-col univer-grid-cols-2 univer-items-center univer-gap-2", children: [
|
|
772
941
|
/* @__PURE__ */ g("div", { className: "univer-flex univer-items-center", children: [
|
|
773
942
|
/* @__PURE__ */ c(
|
|
@@ -775,16 +944,16 @@ function qt(e) {
|
|
|
775
944
|
{
|
|
776
945
|
"data-u-comp": "sort-panel-item-handler",
|
|
777
946
|
className: "univer-flex univer-cursor-pointer univer-items-center univer-justify-center univer-text-base univer-text-gray-700",
|
|
778
|
-
children: /* @__PURE__ */ c(
|
|
947
|
+
children: /* @__PURE__ */ c(Ae, {})
|
|
779
948
|
}
|
|
780
949
|
),
|
|
781
950
|
/* @__PURE__ */ c(
|
|
782
|
-
|
|
951
|
+
ht,
|
|
783
952
|
{
|
|
784
953
|
overlay: /* @__PURE__ */ c(
|
|
785
954
|
"ul",
|
|
786
955
|
{
|
|
787
|
-
className:
|
|
956
|
+
className: K("univer-my-0 univer-box-border univer-grid univer-max-h-[310px] univer-w-[--radix-popper-anchor-width] univer-items-center univer-gap-1 univer-overflow-y-auto univer-overflow-x-hidden univer-rounded-lg univer-border univer-bg-white univer-p-1 univer-text-base univer-shadow-lg", Re),
|
|
788
957
|
children: a.map((h) => /* @__PURE__ */ g(
|
|
789
958
|
"li",
|
|
790
959
|
{
|
|
@@ -792,19 +961,19 @@ function qt(e) {
|
|
|
792
961
|
className: "univer-relative univer-box-border univer-flex univer-h-7 univer-cursor-pointer univer-list-none univer-items-center univer-justify-between univer-rounded univer-px-2 univer-text-sm univer-transition-all hover:univer-bg-gray-100 dark:hover:!univer-bg-gray-700",
|
|
793
962
|
children: [
|
|
794
963
|
/* @__PURE__ */ c("span", { className: "univer-max-w-[220px] univer-truncate", children: h.label }),
|
|
795
|
-
/* @__PURE__ */ c("span", { children: h.index === r.colIndex && /* @__PURE__ */ c(
|
|
964
|
+
/* @__PURE__ */ c("span", { children: h.index === r.colIndex && /* @__PURE__ */ c(ke, {}) })
|
|
796
965
|
]
|
|
797
966
|
},
|
|
798
967
|
h.index
|
|
799
968
|
))
|
|
800
969
|
}
|
|
801
970
|
),
|
|
802
|
-
open:
|
|
971
|
+
open: y,
|
|
803
972
|
onOpenChange: E,
|
|
804
973
|
children: /* @__PURE__ */ g(
|
|
805
974
|
"div",
|
|
806
975
|
{
|
|
807
|
-
className:
|
|
976
|
+
className: K("univer-ml-2 univer-flex univer-w-full univer-items-center univer-justify-between univer-overflow-hidden univer-rounded-md univer-py-1.5 univer-text-sm univer-text-gray-900 dark:!univer-text-white"),
|
|
808
977
|
children: [
|
|
809
978
|
/* @__PURE__ */ c(
|
|
810
979
|
"span",
|
|
@@ -813,7 +982,7 @@ function qt(e) {
|
|
|
813
982
|
children: A
|
|
814
983
|
}
|
|
815
984
|
),
|
|
816
|
-
/* @__PURE__ */ c(
|
|
985
|
+
/* @__PURE__ */ c(Ue, {})
|
|
817
986
|
]
|
|
818
987
|
}
|
|
819
988
|
)
|
|
@@ -822,15 +991,15 @@ function qt(e) {
|
|
|
822
991
|
] }),
|
|
823
992
|
/* @__PURE__ */ g("div", { className: "univer-flex univer-items-center univer-justify-end univer-gap-2", children: [
|
|
824
993
|
/* @__PURE__ */ g(
|
|
825
|
-
|
|
994
|
+
Me,
|
|
826
995
|
{
|
|
827
996
|
value: r.type,
|
|
828
997
|
onChange: (h) => {
|
|
829
998
|
o({ ...r, type: h }, l);
|
|
830
999
|
},
|
|
831
1000
|
children: [
|
|
832
|
-
/* @__PURE__ */ c(
|
|
833
|
-
/* @__PURE__ */ c(
|
|
1001
|
+
/* @__PURE__ */ c(V, { value: $.ASC, children: i.t("sheets-sort.general.sort-asc") }),
|
|
1002
|
+
/* @__PURE__ */ c(V, { value: $.DESC, children: i.t("sheets-sort.general.sort-desc") })
|
|
834
1003
|
]
|
|
835
1004
|
}
|
|
836
1005
|
),
|
|
@@ -839,223 +1008,55 @@ function qt(e) {
|
|
|
839
1008
|
{
|
|
840
1009
|
className: "univer-flex univer-cursor-pointer univer-items-center univer-text-sm univer-transition-colors hover:univer-text-red-500",
|
|
841
1010
|
onClick: () => o(null, l),
|
|
842
|
-
children: !m && /* @__PURE__ */ c(
|
|
1011
|
+
children: !m && /* @__PURE__ */ c(De, {})
|
|
843
1012
|
}
|
|
844
1013
|
)
|
|
845
1014
|
] })
|
|
846
1015
|
] });
|
|
847
1016
|
}
|
|
848
|
-
function
|
|
1017
|
+
function dr(e, t) {
|
|
849
1018
|
const { startColumn: r, endColumn: n } = e, o = new Set(t.map((s) => s == null ? void 0 : s.colIndex));
|
|
850
1019
|
for (let s = r; s <= n; s++)
|
|
851
1020
|
if (!o.has(s))
|
|
852
1021
|
return s;
|
|
853
1022
|
return null;
|
|
854
1023
|
}
|
|
855
|
-
function
|
|
856
|
-
const { range: t, colIndex: r, onClose: n } = e, o = R(C), s = R(
|
|
857
|
-
const { unitId: u, subUnitId:
|
|
858
|
-
if (t && u &&
|
|
1024
|
+
function ur(e) {
|
|
1025
|
+
const { range: t, colIndex: r, onClose: n } = e, o = R(C), s = R(ye), i = R(U), a = T((l) => {
|
|
1026
|
+
const { unitId: u, subUnitId: y } = st(s) || {};
|
|
1027
|
+
if (t && u && y) {
|
|
859
1028
|
const v = { ...t, startRow: t.startRow + 1 };
|
|
860
|
-
o.triggerSortDirectly(l, !1, { unitId: u, subUnitId:
|
|
1029
|
+
o.triggerSortDirectly(l, !1, { unitId: u, subUnitId: y, range: v, colIndex: r });
|
|
861
1030
|
} else
|
|
862
|
-
throw new Error(`Cannot find the target to sort. unitId: ${u}, subUnitId: ${
|
|
1031
|
+
throw new Error(`Cannot find the target to sort. unitId: ${u}, subUnitId: ${y}, range: ${t}, colIndex: ${r}`);
|
|
863
1032
|
n();
|
|
864
1033
|
}, [t, r, o, s, n]);
|
|
865
|
-
return /* @__PURE__ */ g(
|
|
866
|
-
/* @__PURE__ */ g(
|
|
867
|
-
/* @__PURE__ */ c(
|
|
1034
|
+
return /* @__PURE__ */ g(gt, { className: "univer-mb-3 univer-w-full univer-grid-cols-2", children: [
|
|
1035
|
+
/* @__PURE__ */ g(G, { onClick: () => a(!0), children: [
|
|
1036
|
+
/* @__PURE__ */ c(le, {}),
|
|
868
1037
|
i.t("sheets-sort.general.sort-asc")
|
|
869
1038
|
] }),
|
|
870
|
-
/* @__PURE__ */ g(
|
|
871
|
-
/* @__PURE__ */ c(
|
|
1039
|
+
/* @__PURE__ */ g(G, { onClick: () => a(!1), children: [
|
|
1040
|
+
/* @__PURE__ */ c(de, {}),
|
|
872
1041
|
i.t("sheets-sort.general.sort-desc")
|
|
873
1042
|
] })
|
|
874
1043
|
] });
|
|
875
1044
|
}
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
return {
|
|
879
|
-
id: Ae,
|
|
880
|
-
type: f.SUBITEMS,
|
|
881
|
-
icon: Z,
|
|
882
|
-
tooltip: "sheets-sort.general.sort",
|
|
883
|
-
hidden$: Re(e, q.UNIVER_SHEET),
|
|
884
|
-
disabled$: k(e, { workbookTypes: [L], worksheetTypes: [O, N], rangeTypes: [b] })
|
|
885
|
-
};
|
|
886
|
-
}
|
|
887
|
-
function Kt(e) {
|
|
888
|
-
return {
|
|
889
|
-
id: J.id,
|
|
890
|
-
icon: Z,
|
|
891
|
-
title: "sheets-sort.general.sort-asc-cur",
|
|
892
|
-
type: f.BUTTON,
|
|
893
|
-
hidden$: wt(e)
|
|
894
|
-
};
|
|
895
|
-
}
|
|
896
|
-
function Jt(e) {
|
|
897
|
-
return {
|
|
898
|
-
id: Q.id,
|
|
899
|
-
title: "sheets-sort.general.sort-asc-ext",
|
|
900
|
-
icon: de,
|
|
901
|
-
type: f.BUTTON
|
|
902
|
-
};
|
|
903
|
-
}
|
|
904
|
-
function Qt(e) {
|
|
905
|
-
return {
|
|
906
|
-
id: ee.id,
|
|
907
|
-
title: "sheets-sort.general.sort-desc-cur",
|
|
908
|
-
icon: ue,
|
|
909
|
-
type: f.BUTTON
|
|
910
|
-
};
|
|
911
|
-
}
|
|
912
|
-
function er(e) {
|
|
913
|
-
return {
|
|
914
|
-
id: te.id,
|
|
915
|
-
title: "sheets-sort.general.sort-desc-ext",
|
|
916
|
-
icon: he,
|
|
917
|
-
type: f.BUTTON
|
|
918
|
-
};
|
|
919
|
-
}
|
|
920
|
-
function tr(e) {
|
|
921
|
-
return {
|
|
922
|
-
id: re.id,
|
|
923
|
-
title: "sheets-sort.general.sort-custom",
|
|
924
|
-
type: f.BUTTON,
|
|
925
|
-
icon: ge
|
|
926
|
-
};
|
|
927
|
-
}
|
|
928
|
-
function rr(e) {
|
|
929
|
-
return {
|
|
930
|
-
id: Ue,
|
|
931
|
-
title: "sheets-sort.general.sort",
|
|
932
|
-
type: f.SUBITEMS,
|
|
933
|
-
icon: Z,
|
|
934
|
-
hidden$: Re(e, q.UNIVER_SHEET),
|
|
935
|
-
disabled$: k(e, {
|
|
936
|
-
workbookTypes: [L],
|
|
937
|
-
worksheetTypes: [O, N],
|
|
938
|
-
rangeTypes: [b]
|
|
939
|
-
})
|
|
940
|
-
};
|
|
941
|
-
}
|
|
942
|
-
function nr(e) {
|
|
943
|
-
return {
|
|
944
|
-
id: ne.id,
|
|
945
|
-
title: "sheets-sort.general.sort-asc-cur",
|
|
946
|
-
type: f.BUTTON,
|
|
947
|
-
icon: Z,
|
|
948
|
-
disabled$: k(e, { workbookTypes: [L], worksheetTypes: [O, N], rangeTypes: [b] })
|
|
949
|
-
};
|
|
950
|
-
}
|
|
951
|
-
function or(e) {
|
|
952
|
-
return {
|
|
953
|
-
id: oe.id,
|
|
954
|
-
title: "sheets-sort.general.sort-asc-ext",
|
|
955
|
-
type: f.BUTTON,
|
|
956
|
-
icon: de,
|
|
957
|
-
disabled$: k(e, { workbookTypes: [L], worksheetTypes: [O, N], rangeTypes: [b] })
|
|
958
|
-
};
|
|
959
|
-
}
|
|
960
|
-
function sr(e) {
|
|
961
|
-
return {
|
|
962
|
-
id: se.id,
|
|
963
|
-
title: "sheets-sort.general.sort-desc-cur",
|
|
964
|
-
type: f.BUTTON,
|
|
965
|
-
icon: ue,
|
|
966
|
-
disabled$: k(e, { workbookTypes: [L], worksheetTypes: [O, N], rangeTypes: [b] })
|
|
967
|
-
};
|
|
968
|
-
}
|
|
969
|
-
function ir(e) {
|
|
970
|
-
return {
|
|
971
|
-
id: ie.id,
|
|
972
|
-
title: "sheets-sort.general.sort-desc-ext",
|
|
973
|
-
type: f.BUTTON,
|
|
974
|
-
icon: he,
|
|
975
|
-
disabled$: k(e, { workbookTypes: [L], worksheetTypes: [O, N], rangeTypes: [b] })
|
|
976
|
-
};
|
|
977
|
-
}
|
|
978
|
-
function cr(e) {
|
|
979
|
-
return {
|
|
980
|
-
id: ce.id,
|
|
981
|
-
title: "sheets-sort.general.sort-custom",
|
|
982
|
-
type: f.BUTTON,
|
|
983
|
-
icon: ge,
|
|
984
|
-
disabled$: k(e, { workbookTypes: [L], worksheetTypes: [O, N], rangeTypes: [b] })
|
|
985
|
-
};
|
|
986
|
-
}
|
|
987
|
-
const ar = {
|
|
988
|
-
[vt.ORGANIZATION]: {
|
|
989
|
-
[Ae]: {
|
|
990
|
-
order: 3,
|
|
991
|
-
menuItemFactory: Xt,
|
|
992
|
-
[J.id]: {
|
|
993
|
-
order: 0,
|
|
994
|
-
menuItemFactory: Kt
|
|
995
|
-
},
|
|
996
|
-
[Q.id]: {
|
|
997
|
-
order: 1,
|
|
998
|
-
menuItemFactory: Jt
|
|
999
|
-
},
|
|
1000
|
-
[ee.id]: {
|
|
1001
|
-
order: 2,
|
|
1002
|
-
menuItemFactory: Qt
|
|
1003
|
-
},
|
|
1004
|
-
[te.id]: {
|
|
1005
|
-
order: 3,
|
|
1006
|
-
menuItemFactory: er
|
|
1007
|
-
},
|
|
1008
|
-
[re.id]: {
|
|
1009
|
-
order: 4,
|
|
1010
|
-
menuItemFactory: tr
|
|
1011
|
-
}
|
|
1012
|
-
}
|
|
1013
|
-
},
|
|
1014
|
-
[Ct.MAIN_AREA]: {
|
|
1015
|
-
[mt.DATA]: {
|
|
1016
|
-
[Ue]: {
|
|
1017
|
-
order: 0,
|
|
1018
|
-
menuItemFactory: rr,
|
|
1019
|
-
[ne.id]: {
|
|
1020
|
-
order: 0,
|
|
1021
|
-
menuItemFactory: nr
|
|
1022
|
-
},
|
|
1023
|
-
[oe.id]: {
|
|
1024
|
-
order: 1,
|
|
1025
|
-
menuItemFactory: or
|
|
1026
|
-
},
|
|
1027
|
-
[se.id]: {
|
|
1028
|
-
order: 2,
|
|
1029
|
-
menuItemFactory: sr
|
|
1030
|
-
},
|
|
1031
|
-
[ie.id]: {
|
|
1032
|
-
order: 3,
|
|
1033
|
-
menuItemFactory: ir
|
|
1034
|
-
},
|
|
1035
|
-
[ce.id]: {
|
|
1036
|
-
order: 4,
|
|
1037
|
-
menuItemFactory: cr
|
|
1038
|
-
}
|
|
1039
|
-
}
|
|
1040
|
-
}
|
|
1041
|
-
}
|
|
1042
|
-
};
|
|
1043
|
-
var lr = Object.getOwnPropertyDescriptor, dr = (e, t, r, n) => {
|
|
1044
|
-
for (var o = n > 1 ? void 0 : n ? lr(t, r) : t, s = e.length - 1, i; s >= 0; s--)
|
|
1045
|
+
var hr = Object.getOwnPropertyDescriptor, gr = (e, t, r, n) => {
|
|
1046
|
+
for (var o = n > 1 ? void 0 : n ? hr(t, r) : t, s = e.length - 1, i; s >= 0; s--)
|
|
1045
1047
|
(i = e[s]) && (o = i(o) || o);
|
|
1046
1048
|
return o;
|
|
1047
|
-
},
|
|
1048
|
-
const
|
|
1049
|
-
let
|
|
1049
|
+
}, _ = (e, t) => (r, n) => t(r, n, e);
|
|
1050
|
+
const pe = "custom-sort-dialog", je = 560, Cr = 128;
|
|
1051
|
+
let W = class extends Ke {
|
|
1050
1052
|
constructor(e, t, r, n, o, s, i, a, l, u) {
|
|
1051
1053
|
super(), this._commandService = e, this._menuManagerService = t, this._dialogService = r, this._layoutService = n, this._uiPartsService = o, this._sheetRenderService = s, this._localeService = i, this._sheetsSortUIService = a, this._injector = l, this._componentManager = u, this._initCommands(), this._initMenu(), this._initUI();
|
|
1052
1054
|
}
|
|
1053
1055
|
_initMenu() {
|
|
1054
|
-
this._menuManagerService.mergeMenu(
|
|
1056
|
+
this._menuManagerService.mergeMenu(ir);
|
|
1055
1057
|
}
|
|
1056
1058
|
_initCommands() {
|
|
1057
1059
|
[
|
|
1058
|
-
J,
|
|
1059
1060
|
Q,
|
|
1060
1061
|
ee,
|
|
1061
1062
|
te,
|
|
@@ -1064,103 +1065,105 @@ let G = class extends Xe {
|
|
|
1064
1065
|
oe,
|
|
1065
1066
|
se,
|
|
1066
1067
|
ie,
|
|
1067
|
-
ce
|
|
1068
|
-
|
|
1068
|
+
ce,
|
|
1069
|
+
ae
|
|
1070
|
+
].forEach((e) => this.disposeWithMe(this._commandService.registerCommand(e))), this.disposeWithMe(this._sheetRenderService.registerSkeletonChangingMutations(it.id));
|
|
1069
1071
|
}
|
|
1070
1072
|
_initUI() {
|
|
1071
1073
|
this.disposeWithMe(
|
|
1072
|
-
this._uiPartsService.registerComponent(
|
|
1074
|
+
this._uiPartsService.registerComponent(Et.FILTER_PANEL_EMBED_POINT, () => It(ur, this._injector))
|
|
1073
1075
|
), [
|
|
1074
|
-
["CustomSortPanel",
|
|
1075
|
-
[
|
|
1076
|
-
[
|
|
1077
|
-
[
|
|
1078
|
-
[
|
|
1079
|
-
[
|
|
1076
|
+
["CustomSortPanel", cr],
|
|
1077
|
+
[j, le],
|
|
1078
|
+
[ue, $e],
|
|
1079
|
+
[he, de],
|
|
1080
|
+
[ge, He],
|
|
1081
|
+
[Ce, Le]
|
|
1080
1082
|
].forEach(([e, t]) => {
|
|
1081
1083
|
this.disposeWithMe(
|
|
1082
1084
|
this._componentManager.register(e, t)
|
|
1083
1085
|
);
|
|
1084
|
-
}), this._sheetsSortUIService.customSortState$.pipe(
|
|
1086
|
+
}), this._sheetsSortUIService.customSortState$.pipe(lt(this.dispose$)).subscribe((e) => {
|
|
1085
1087
|
e && e.show && e.location ? this._openCustomSortPanel(e.location) : e && !(e != null && e.show) && this._closePanel();
|
|
1086
1088
|
});
|
|
1087
1089
|
}
|
|
1088
1090
|
_openCustomSortPanel(e) {
|
|
1089
1091
|
this._dialogService.open({
|
|
1090
|
-
id:
|
|
1092
|
+
id: pe,
|
|
1091
1093
|
draggable: !0,
|
|
1092
|
-
width:
|
|
1093
|
-
title: { title: `${this._localeService.t("sheets-sort.general.sort-custom")}: ${
|
|
1094
|
+
width: je,
|
|
1095
|
+
title: { title: `${this._localeService.t("sheets-sort.general.sort-custom")}: ${wt(e.range)}` },
|
|
1094
1096
|
children: { label: "CustomSortPanel" },
|
|
1095
1097
|
destroyOnClose: !0,
|
|
1096
|
-
defaultPosition:
|
|
1098
|
+
defaultPosition: mr(),
|
|
1097
1099
|
preservePositionOnDestroy: !1,
|
|
1098
1100
|
onClose: () => this._closePanel(),
|
|
1099
1101
|
mask: !0
|
|
1100
1102
|
});
|
|
1101
1103
|
}
|
|
1102
1104
|
_closePanel() {
|
|
1103
|
-
this._dialogService.close(
|
|
1105
|
+
this._dialogService.close(pe), queueMicrotask(() => this._layoutService.focus());
|
|
1104
1106
|
}
|
|
1105
1107
|
};
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
],
|
|
1118
|
-
function
|
|
1119
|
-
return { x: (window.innerWidth -
|
|
1108
|
+
W = gr([
|
|
1109
|
+
_(0, _e),
|
|
1110
|
+
_(1, St),
|
|
1111
|
+
_(2, pt),
|
|
1112
|
+
_(3, xt),
|
|
1113
|
+
_(4, yt),
|
|
1114
|
+
_(5, M(Rt)),
|
|
1115
|
+
_(6, M(U)),
|
|
1116
|
+
_(7, M(C)),
|
|
1117
|
+
_(8, M(Ie)),
|
|
1118
|
+
_(9, M(_t))
|
|
1119
|
+
], W);
|
|
1120
|
+
function mr() {
|
|
1121
|
+
return { x: (window.innerWidth - je) / 2, y: Cr };
|
|
1120
1122
|
}
|
|
1121
|
-
var
|
|
1122
|
-
for (var o = n > 1 ? void 0 : n ?
|
|
1123
|
+
var vr = Object.defineProperty, fr = Object.getOwnPropertyDescriptor, Sr = (e, t, r) => t in e ? vr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, pr = (e, t, r, n) => {
|
|
1124
|
+
for (var o = n > 1 ? void 0 : n ? fr(t, r) : t, s = e.length - 1, i; s >= 0; s--)
|
|
1123
1125
|
(i = e[s]) && (o = i(o) || o);
|
|
1124
1126
|
return o;
|
|
1125
|
-
},
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
constructor(e = fe, t, r) {
|
|
1127
|
+
}, xe = (e, t) => (r, n) => t(r, n, e), z = (e, t, r) => Sr(e, typeof t != "symbol" ? t + "" : t, r);
|
|
1128
|
+
let H = class extends et {
|
|
1129
|
+
constructor(e = Se, t, r) {
|
|
1129
1130
|
super(), this._config = e, this._injector = t, this._configService = r;
|
|
1130
|
-
const { ...n } =
|
|
1131
|
+
const { ...n } = tt(
|
|
1131
1132
|
{},
|
|
1132
|
-
|
|
1133
|
+
Se,
|
|
1133
1134
|
this._config
|
|
1134
1135
|
);
|
|
1135
|
-
this._configService.setConfig(
|
|
1136
|
+
this._configService.setConfig(Dt, n);
|
|
1136
1137
|
}
|
|
1137
1138
|
onStarting() {
|
|
1138
1139
|
[
|
|
1139
1140
|
[C],
|
|
1140
|
-
[
|
|
1141
|
+
[W]
|
|
1141
1142
|
].forEach((e) => this._injector.add(e));
|
|
1142
1143
|
}
|
|
1143
1144
|
onRendered() {
|
|
1144
|
-
this._injector.get(
|
|
1145
|
+
this._injector.get(W);
|
|
1145
1146
|
}
|
|
1146
1147
|
};
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1148
|
+
z(H, "type", q.UNIVER_SHEET);
|
|
1149
|
+
z(H, "pluginName", "SHEET_SORT_UI_PLUGIN");
|
|
1150
|
+
z(H, "packageName", Oe.name);
|
|
1151
|
+
z(H, "version", Oe.version);
|
|
1152
|
+
H = pr([
|
|
1153
|
+
Je(ct),
|
|
1154
|
+
xe(1, M(Ie)),
|
|
1155
|
+
xe(2, Qe)
|
|
1156
|
+
], H);
|
|
1154
1157
|
export {
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1158
|
+
Q as SortRangeAscCommand,
|
|
1159
|
+
ee as SortRangeAscExtCommand,
|
|
1160
|
+
se as SortRangeAscExtInCtxMenuCommand,
|
|
1161
|
+
oe as SortRangeAscInCtxMenuCommand,
|
|
1162
|
+
ne as SortRangeCustomCommand,
|
|
1163
|
+
ae as SortRangeCustomInCtxMenuCommand,
|
|
1164
|
+
te as SortRangeDescCommand,
|
|
1165
|
+
re as SortRangeDescExtCommand,
|
|
1166
|
+
ce as SortRangeDescExtInCtxMenuCommand,
|
|
1167
|
+
ie as SortRangeDescInCtxMenuCommand,
|
|
1168
|
+
H as UniverSheetsSortUIPlugin
|
|
1166
1169
|
};
|