@univerjs/sheets-sort-ui 0.7.0-nightly.202505251606 → 0.8.0-beta.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/LICENSE +176 -0
- package/lib/cjs/index.js +1 -1
- package/lib/es/index.js +83 -77
- package/lib/index.css +1 -1
- package/lib/index.js +83 -77
- package/lib/umd/index.js +1 -1
- package/package.json +10 -10
package/lib/index.js
CHANGED
|
@@ -5,9 +5,9 @@ import { LocaleService as P, IUniverInstanceService as _e, ILogService as Ze, In
|
|
|
5
5
|
import { SheetsSortService as Me, SortType as U, SortRangeCommand as Qe, UniverSheetsSortPlugin as et } from "@univerjs/sheets-sort";
|
|
6
6
|
import { serializeRange as tt } from "@univerjs/engine-formula";
|
|
7
7
|
import { getCurrentRangeDisable$ as N, getCurrentExclusiveRangeInterest$ as rt, SheetsRenderService as nt, SheetsUIPart as it } from "@univerjs/sheets-ui";
|
|
8
|
-
import { useDependency as E, IConfirmService as st, useObservable as ot, MenuItemType as S, getMenuHiddenObservable as Re, ContextMenuPosition as
|
|
8
|
+
import { useDependency as E, IConfirmService as st, useObservable as ot, MenuItemType as S, getMenuHiddenObservable as Re, ContextMenuPosition as ct, ContextMenuGroup as at, RibbonDataGroup as lt, IMenuManagerService as ut, IDialogService as dt, ILayoutService as ht, IUIPartsService as gt, ComponentManager as mt, connectInjector as vt } from "@univerjs/ui";
|
|
9
9
|
import { BehaviorSubject as Ct, takeUntil as ft } from "rxjs";
|
|
10
|
-
import { jsxs as m, jsx as
|
|
10
|
+
import { jsxs as m, jsx as c } from "react/jsx-runtime";
|
|
11
11
|
import { SheetsSelectionsService as St, getPrimaryForRange as pt, SetSelectionsOperation as yt, expandToContinuousRange as fe, getSheetCommandTarget as _t, RangeProtectionPermissionEditPoint as k, WorksheetSortPermission as L, WorksheetEditPermission as D, WorkbookEditablePermission as H } from "@univerjs/sheets";
|
|
12
12
|
import { RadioGroup as we, Radio as Z, Checkbox as xt, DraggableList as It, Button as z, Dropdown as Mt, ButtonGroup as Rt } from "@univerjs/design";
|
|
13
13
|
import { forwardRef as y, useRef as Ee, createElement as _, useState as j, useCallback as O, useEffect as Te } from "react";
|
|
@@ -28,8 +28,8 @@ var f = function() {
|
|
|
28
28
|
t.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[i]) && (n[r[i]] = e[r[i]]);
|
|
29
29
|
return n;
|
|
30
30
|
}, x = y(function(e, t) {
|
|
31
|
-
var n = e.icon, r = e.id, i = e.className, s = e.extend, o = Et(e, ["icon", "id", "className", "extend"]),
|
|
32
|
-
return be(n, "".concat(r), { defIds: n.defIds, idSuffix: l.current }, f({ ref: t, className:
|
|
31
|
+
var n = e.icon, r = e.id, i = e.className, s = e.extend, o = Et(e, ["icon", "id", "className", "extend"]), a = "univerjs-icon univerjs-icon-".concat(r, " ").concat(i || "").trim(), l = Ee("_".concat(Ot()));
|
|
32
|
+
return be(n, "".concat(r), { defIds: n.defIds, idSuffix: l.current }, f({ ref: t, className: a }, o), s);
|
|
33
33
|
});
|
|
34
34
|
function be(e, t, n, r, i) {
|
|
35
35
|
return _(e.tag, f(f({ key: t }, Tt(e, n, i)), r), (bt(e, n).children || []).map(function(s, o) {
|
|
@@ -39,13 +39,13 @@ function be(e, t, n, r, i) {
|
|
|
39
39
|
function Tt(e, t, n) {
|
|
40
40
|
var r = f({}, e.attrs);
|
|
41
41
|
n != null && n.colorChannel1 && r.fill === "colorChannel1" && (r.fill = n.colorChannel1), e.tag === "mask" && r.id && (r.id = r.id + t.idSuffix), Object.entries(r).forEach(function(s) {
|
|
42
|
-
var o = s[0],
|
|
43
|
-
o === "mask" && typeof
|
|
42
|
+
var o = s[0], a = s[1];
|
|
43
|
+
o === "mask" && typeof a == "string" && (r[o] = a.replace(/url\(#(.*)\)/, "url(#$1".concat(t.idSuffix, ")")));
|
|
44
44
|
});
|
|
45
45
|
var i = t.defIds;
|
|
46
46
|
return !i || i.length === 0 || (e.tag === "use" && r["xlink:href"] && (r["xlink:href"] = r["xlink:href"] + t.idSuffix), Object.entries(r).forEach(function(s) {
|
|
47
|
-
var o = s[0],
|
|
48
|
-
typeof
|
|
47
|
+
var o = s[0], a = s[1];
|
|
48
|
+
typeof a == "string" && (r[o] = a.replace(/url\(#(.*)\)/, "url(#$1".concat(t.idSuffix, ")")));
|
|
49
49
|
})), r;
|
|
50
50
|
}
|
|
51
51
|
function bt(e, t) {
|
|
@@ -141,7 +141,7 @@ Ue.displayName = "SequenceSingle";
|
|
|
141
141
|
const Bt = (e) => {
|
|
142
142
|
const [t, n] = j("0"), r = E(P);
|
|
143
143
|
return /* @__PURE__ */ m("div", { className: "univer-text-sm", children: [
|
|
144
|
-
/* @__PURE__ */
|
|
144
|
+
/* @__PURE__ */ c("div", { className: "extend-confirm-desc", children: r.t("sheets-sort.dialog.sort-reminder-desc") }),
|
|
145
145
|
/* @__PURE__ */ m(
|
|
146
146
|
we,
|
|
147
147
|
{
|
|
@@ -152,8 +152,8 @@ const Bt = (e) => {
|
|
|
152
152
|
n(i), e.onChange(i);
|
|
153
153
|
},
|
|
154
154
|
children: [
|
|
155
|
-
/* @__PURE__ */
|
|
156
|
-
/* @__PURE__ */
|
|
155
|
+
/* @__PURE__ */ c(Z, { value: "0", children: r.t("sheets-sort.dialog.sort-reminder-no") }),
|
|
156
|
+
/* @__PURE__ */ c(Z, { value: "1", children: r.t("sheets-sort.dialog.sort-reminder-ext") })
|
|
157
157
|
]
|
|
158
158
|
}
|
|
159
159
|
)
|
|
@@ -171,11 +171,11 @@ const V = {
|
|
|
171
171
|
FORMULA_ARRAY: "sheets-sort.error.formula-array"
|
|
172
172
|
};
|
|
173
173
|
let g = class extends ze {
|
|
174
|
-
constructor(t, n, r, i, s, o,
|
|
174
|
+
constructor(t, n, r, i, s, o, a) {
|
|
175
175
|
super();
|
|
176
176
|
K(this, "_customSortState$", new Ct(null));
|
|
177
177
|
K(this, "customSortState$", this._customSortState$.asObservable());
|
|
178
|
-
this._univerInstanceService = t, this._confirmService = n, this._logService = r, this._selectionManagerService = i, this._sheetsSortService = s, this._localeService = o, this._commandService =
|
|
178
|
+
this._univerInstanceService = t, this._confirmService = n, this._logService = r, this._selectionManagerService = i, this._sheetsSortService = s, this._localeService = o, this._commandService = a;
|
|
179
179
|
}
|
|
180
180
|
async triggerSortDirectly(t, n, r) {
|
|
181
181
|
const i = r || await this._detectSortLocation(n);
|
|
@@ -205,13 +205,13 @@ let g = class extends ze {
|
|
|
205
205
|
const { unitId: r, subUnitId: i, range: s } = n, o = (d = this._univerInstanceService.getUnit(r)) == null ? void 0 : d.getSheetBySheetId(i);
|
|
206
206
|
if (!o)
|
|
207
207
|
return [];
|
|
208
|
-
const
|
|
208
|
+
const a = Zt(this._localeService);
|
|
209
209
|
return Array.from({ length: s.endColumn - s.startColumn + 1 }, (I, C) => {
|
|
210
210
|
var v;
|
|
211
211
|
const T = (v = o.getCell(s.startRow, C + s.startColumn)) == null ? void 0 : v.v;
|
|
212
212
|
return {
|
|
213
213
|
index: C + s.startColumn,
|
|
214
|
-
label: t ? `${T != null ? T :
|
|
214
|
+
label: t ? `${T != null ? T : a(C + s.startColumn)}` : a(C + s.startColumn)
|
|
215
215
|
};
|
|
216
216
|
});
|
|
217
217
|
}
|
|
@@ -234,7 +234,7 @@ let g = class extends ze {
|
|
|
234
234
|
title: this._localeService.t("info.tooltip")
|
|
235
235
|
},
|
|
236
236
|
children: {
|
|
237
|
-
title: /* @__PURE__ */
|
|
237
|
+
title: /* @__PURE__ */ c("div", { children: this._localeService.t(t) })
|
|
238
238
|
}
|
|
239
239
|
});
|
|
240
240
|
}
|
|
@@ -246,7 +246,7 @@ let g = class extends ze {
|
|
|
246
246
|
title: this._localeService.t("sheets-sort.dialog.sort-reminder")
|
|
247
247
|
},
|
|
248
248
|
children: {
|
|
249
|
-
title: /* @__PURE__ */
|
|
249
|
+
title: /* @__PURE__ */ c(
|
|
250
250
|
Bt,
|
|
251
251
|
{
|
|
252
252
|
onChange: (r) => {
|
|
@@ -271,19 +271,19 @@ let g = class extends ze {
|
|
|
271
271
|
const n = this._univerInstanceService.getCurrentUnitForType(Y.UNIVER_SHEET), r = n.getActiveSheet(), i = n.getUnitId(), s = r.getSheetId(), o = this._selectionManagerService.getCurrentLastSelection();
|
|
272
272
|
if (!o)
|
|
273
273
|
return null;
|
|
274
|
-
let
|
|
274
|
+
let a;
|
|
275
275
|
if (t === !0)
|
|
276
|
-
|
|
276
|
+
a = fe(o.range, { up: !0, down: !0, left: !0, right: !0 }, r), this.setSelection(i, s, a);
|
|
277
277
|
else if (t === !1)
|
|
278
|
-
|
|
278
|
+
a = o.range;
|
|
279
279
|
else {
|
|
280
280
|
const l = await this.showExtendConfirm();
|
|
281
281
|
if (l === "cancel")
|
|
282
282
|
return null;
|
|
283
|
-
l === "keep" ?
|
|
283
|
+
l === "keep" ? a = o.range : (a = fe(o.range, { up: !0, down: !0, left: !0, right: !0 }, r), this.setSelection(i, s, a));
|
|
284
284
|
}
|
|
285
285
|
return {
|
|
286
|
-
range:
|
|
286
|
+
range: a,
|
|
287
287
|
unitId: i,
|
|
288
288
|
subUnitId: s,
|
|
289
289
|
colIndex: o.primary.actualColumn
|
|
@@ -332,11 +332,11 @@ const re = {
|
|
|
332
332
|
id: "sheet.command.sort-range-custom",
|
|
333
333
|
type: R.COMMAND,
|
|
334
334
|
handler: async (e) => await e.get(g).triggerSortCustomize()
|
|
335
|
-
},
|
|
335
|
+
}, ce = {
|
|
336
336
|
id: "sheet.command.sort-range-asc-ctx",
|
|
337
337
|
type: R.COMMAND,
|
|
338
338
|
handler: async (e) => await e.get(g).triggerSortDirectly(!0, !1)
|
|
339
|
-
},
|
|
339
|
+
}, ae = {
|
|
340
340
|
id: "sheet.command.sort-range-asc-ext-ctx",
|
|
341
341
|
type: R.COMMAND,
|
|
342
342
|
handler: async (e) => await e.get(g).triggerSortDirectly(!0, !0)
|
|
@@ -355,10 +355,10 @@ const re = {
|
|
|
355
355
|
};
|
|
356
356
|
function zt() {
|
|
357
357
|
const e = E(g), t = ot(e.customSortState$);
|
|
358
|
-
return !t || !t.location ? null : /* @__PURE__ */
|
|
358
|
+
return !t || !t.location ? null : /* @__PURE__ */ c(Gt, { state: t });
|
|
359
359
|
}
|
|
360
360
|
function Gt({ state: e }) {
|
|
361
|
-
const t = E(Me), n = E(P), r = E(g), [i, s] = j(!1), [o,
|
|
361
|
+
const t = E(Me), n = E(P), r = E(g), [i, s] = j(!1), [o, a] = j(0), l = Ee(null), { range: d, unitId: I, subUnitId: C } = e.location, T = r.getTitles(i), [v, A] = j([
|
|
362
362
|
{ type: U.ASC, colIndex: d.startColumn }
|
|
363
363
|
]), q = O((u, p) => {
|
|
364
364
|
const $ = [...v];
|
|
@@ -385,15 +385,15 @@ function Gt({ state: e }) {
|
|
|
385
385
|
u.stopPropagation();
|
|
386
386
|
}, children: [
|
|
387
387
|
/* @__PURE__ */ m("div", { className: "univer-flex univer-items-center univer-justify-between", children: [
|
|
388
|
-
/* @__PURE__ */
|
|
388
|
+
/* @__PURE__ */ c(xt, { checked: i, onChange: (u) => je(!!u), children: n.t("sheets-sort.dialog.first-row-check") }),
|
|
389
389
|
Be ? /* @__PURE__ */ m(
|
|
390
390
|
"div",
|
|
391
391
|
{
|
|
392
392
|
className: "univer-flex univer-cursor-pointer univer-select-none univer-items-center univer-text-base",
|
|
393
393
|
onClick: F,
|
|
394
394
|
children: [
|
|
395
|
-
/* @__PURE__ */
|
|
396
|
-
/* @__PURE__ */
|
|
395
|
+
/* @__PURE__ */ c(Q, {}),
|
|
396
|
+
/* @__PURE__ */ c("span", { className: "univer-ml-1.5", children: n.t("sheets-sort.dialog.add-condition") })
|
|
397
397
|
]
|
|
398
398
|
}
|
|
399
399
|
) : /* @__PURE__ */ m(
|
|
@@ -401,29 +401,29 @@ function Gt({ state: e }) {
|
|
|
401
401
|
{
|
|
402
402
|
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",
|
|
403
403
|
children: [
|
|
404
|
-
/* @__PURE__ */
|
|
405
|
-
/* @__PURE__ */
|
|
404
|
+
/* @__PURE__ */ c(Q, {}),
|
|
405
|
+
/* @__PURE__ */ c("span", { className: "univer-ml-1.5 univer-text-xs", children: n.t("sheets-sort.dialog.add-condition") })
|
|
406
406
|
]
|
|
407
407
|
}
|
|
408
408
|
)
|
|
409
409
|
] }),
|
|
410
|
-
/* @__PURE__ */
|
|
410
|
+
/* @__PURE__ */ c(
|
|
411
411
|
"div",
|
|
412
412
|
{
|
|
413
413
|
className: "univer-max-h-[310px] univer-overflow-y-auto univer-overflow-x-hidden",
|
|
414
414
|
onScroll: (u) => {
|
|
415
415
|
const p = u.currentTarget.scrollTop;
|
|
416
|
-
|
|
416
|
+
a(p);
|
|
417
417
|
},
|
|
418
418
|
ref: l,
|
|
419
|
-
children: /* @__PURE__ */
|
|
419
|
+
children: /* @__PURE__ */ c(
|
|
420
420
|
It,
|
|
421
421
|
{
|
|
422
422
|
list: Ce,
|
|
423
423
|
onListChange: A,
|
|
424
424
|
idKey: "id",
|
|
425
425
|
draggableHandle: "[data-u-comp=sort-panel-item-handler]",
|
|
426
|
-
itemRender: (u) => /* @__PURE__ */
|
|
426
|
+
itemRender: (u) => /* @__PURE__ */ c(
|
|
427
427
|
Wt,
|
|
428
428
|
{
|
|
429
429
|
titles: T,
|
|
@@ -441,7 +441,7 @@ function Gt({ state: e }) {
|
|
|
441
441
|
)
|
|
442
442
|
] }),
|
|
443
443
|
/* @__PURE__ */ m("div", { className: "univer-mt-5 univer-flex univer-justify-end", children: [
|
|
444
|
-
/* @__PURE__ */
|
|
444
|
+
/* @__PURE__ */ c(
|
|
445
445
|
z,
|
|
446
446
|
{
|
|
447
447
|
className: "univer-ml-3",
|
|
@@ -449,7 +449,7 @@ function Gt({ state: e }) {
|
|
|
449
449
|
children: n.t("sheets-sort.dialog.cancel")
|
|
450
450
|
}
|
|
451
451
|
),
|
|
452
|
-
/* @__PURE__ */
|
|
452
|
+
/* @__PURE__ */ c(
|
|
453
453
|
z,
|
|
454
454
|
{
|
|
455
455
|
className: "univer-ml-3",
|
|
@@ -463,7 +463,7 @@ function Gt({ state: e }) {
|
|
|
463
463
|
}
|
|
464
464
|
function Wt(e) {
|
|
465
465
|
var F;
|
|
466
|
-
const { list: t, item: n, titles: r, onChange: i, scrollPosition: s } = e, o = E(P),
|
|
466
|
+
const { list: t, item: n, titles: r, onChange: i, scrollPosition: s } = e, o = E(P), a = r.filter((h) => !t.some((X) => X.colIndex === h.index) || h.index === n.colIndex), l = t.findIndex((h) => h.colIndex === n.colIndex), d = O((h) => {
|
|
467
467
|
i({ ...n, colIndex: h.index }, l), C(!1);
|
|
468
468
|
}, [l, n, i]), [I, C] = j(!1), T = (h) => {
|
|
469
469
|
C(h);
|
|
@@ -474,36 +474,36 @@ function Wt(e) {
|
|
|
474
474
|
const v = t.length > 1, A = (F = r.find((h) => h.index === n.colIndex)) == null ? void 0 : F.label, q = o.getCurrentLocale() === J.ZH_CN ? "univer-flex univer-px-5" : "univer-flex univer-px-2.5";
|
|
475
475
|
return /* @__PURE__ */ m("div", { className: "univer-flex univer-items-center", children: [
|
|
476
476
|
/* @__PURE__ */ m("div", { className: "univer-flex univer-items-center", children: [
|
|
477
|
-
/* @__PURE__ */
|
|
477
|
+
/* @__PURE__ */ c(
|
|
478
478
|
"div",
|
|
479
479
|
{
|
|
480
480
|
"data-u-comp": "sort-panel-item-handler",
|
|
481
481
|
className: "univer-flex univer-cursor-pointer univer-items-center univer-justify-center univer-text-base univer-text-gray-700",
|
|
482
|
-
children: /* @__PURE__ */
|
|
482
|
+
children: /* @__PURE__ */ c(Ue, {})
|
|
483
483
|
}
|
|
484
484
|
),
|
|
485
|
-
/* @__PURE__ */
|
|
485
|
+
/* @__PURE__ */ c("div", { children: /* @__PURE__ */ c(
|
|
486
486
|
Mt,
|
|
487
487
|
{
|
|
488
488
|
align: "start",
|
|
489
|
-
overlay: /* @__PURE__ */
|
|
489
|
+
overlay: /* @__PURE__ */ c(
|
|
490
490
|
"ul",
|
|
491
491
|
{
|
|
492
492
|
className: "univer-my-0 univer-box-border univer-grid univer-max-h-[310px] 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",
|
|
493
|
-
children:
|
|
493
|
+
children: a.map((h) => /* @__PURE__ */ m(
|
|
494
494
|
"li",
|
|
495
495
|
{
|
|
496
496
|
onClick: () => d(h),
|
|
497
497
|
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 dark:hover:!univer-bg-gray-700 hover:univer-bg-gray-100",
|
|
498
498
|
children: [
|
|
499
|
-
/* @__PURE__ */
|
|
499
|
+
/* @__PURE__ */ c(
|
|
500
500
|
"span",
|
|
501
501
|
{
|
|
502
502
|
className: "univer-max-w-[220px] univer-truncate",
|
|
503
503
|
children: h.label
|
|
504
504
|
}
|
|
505
505
|
),
|
|
506
|
-
/* @__PURE__ */
|
|
506
|
+
/* @__PURE__ */ c("span", { children: h.index === n.colIndex && /* @__PURE__ */ c(Oe, {}) })
|
|
507
507
|
]
|
|
508
508
|
},
|
|
509
509
|
h.index
|
|
@@ -517,21 +517,21 @@ function Wt(e) {
|
|
|
517
517
|
{
|
|
518
518
|
className: "univer-ml-2 univer-flex univer-w-[236px] univer-items-center univer-justify-between univer-overflow-hidden univer-rounded-md univer-border univer-border-gray-200 univer-px-2.5 univer-py-1.5 univer-text-sm univer-text-gray-900 dark:!univer-text-white",
|
|
519
519
|
children: [
|
|
520
|
-
/* @__PURE__ */
|
|
520
|
+
/* @__PURE__ */ c(
|
|
521
521
|
"span",
|
|
522
522
|
{
|
|
523
523
|
className: "univer-max-w-[220px] univer-truncate",
|
|
524
524
|
children: A
|
|
525
525
|
}
|
|
526
526
|
),
|
|
527
|
-
/* @__PURE__ */
|
|
527
|
+
/* @__PURE__ */ c(He, {})
|
|
528
528
|
]
|
|
529
529
|
}
|
|
530
530
|
)
|
|
531
531
|
}
|
|
532
532
|
) })
|
|
533
533
|
] }),
|
|
534
|
-
/* @__PURE__ */
|
|
534
|
+
/* @__PURE__ */ c("div", { children: /* @__PURE__ */ m(
|
|
535
535
|
we,
|
|
536
536
|
{
|
|
537
537
|
className: q,
|
|
@@ -540,12 +540,12 @@ function Wt(e) {
|
|
|
540
540
|
i({ ...n, type: h }, l);
|
|
541
541
|
},
|
|
542
542
|
children: [
|
|
543
|
-
/* @__PURE__ */
|
|
544
|
-
/* @__PURE__ */
|
|
543
|
+
/* @__PURE__ */ c(Z, { value: U.ASC, children: o.t("sheets-sort.general.sort-asc") }),
|
|
544
|
+
/* @__PURE__ */ c(Z, { value: U.DESC, children: o.t("sheets-sort.general.sort-desc") })
|
|
545
545
|
]
|
|
546
546
|
}
|
|
547
547
|
) }),
|
|
548
|
-
/* @__PURE__ */
|
|
548
|
+
/* @__PURE__ */ c("div", { className: "univer-absolute univer-right-0 univer-cursor-pointer univer-text-sm univer-s-[14px]", children: v && /* @__PURE__ */ c(ke, { onClick: () => i(null, l) }) })
|
|
549
549
|
] });
|
|
550
550
|
}
|
|
551
551
|
function Yt(e, t) {
|
|
@@ -556,7 +556,7 @@ function Yt(e, t) {
|
|
|
556
556
|
return null;
|
|
557
557
|
}
|
|
558
558
|
function qt(e) {
|
|
559
|
-
const { range: t, colIndex: n, onClose: r } = e, i = E(g), s = E(_e), o = E(P),
|
|
559
|
+
const { range: t, colIndex: n, onClose: r } = e, i = E(g), s = E(_e), o = E(P), a = O((l) => {
|
|
560
560
|
const { unitId: d, subUnitId: I } = _t(s) || {};
|
|
561
561
|
if (t && d && I) {
|
|
562
562
|
const C = { ...t, startRow: t.startRow + 1 };
|
|
@@ -565,16 +565,22 @@ function qt(e) {
|
|
|
565
565
|
throw new Error(`Cannot find the target to sort. unitId: ${d}, subUnitId: ${I}, range: ${t}, colIndex: ${n}`);
|
|
566
566
|
r();
|
|
567
567
|
}, [t, n, i, s, r]);
|
|
568
|
-
return /* @__PURE__ */ m(
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
568
|
+
return /* @__PURE__ */ m(
|
|
569
|
+
Rt,
|
|
570
|
+
{
|
|
571
|
+
className: "univer-mb-3 univer-grid univer-w-full univer-grid-flow-col univer-grid-cols-2 univer-gap-2",
|
|
572
|
+
children: [
|
|
573
|
+
/* @__PURE__ */ m(z, { onClick: () => a(!0), children: [
|
|
574
|
+
/* @__PURE__ */ c(ee, {}),
|
|
575
|
+
o.t("sheets-sort.general.sort-asc")
|
|
576
|
+
] }),
|
|
577
|
+
/* @__PURE__ */ m(z, { onClick: () => a(!1), children: [
|
|
578
|
+
/* @__PURE__ */ c(te, {}),
|
|
579
|
+
o.t("sheets-sort.general.sort-desc")
|
|
580
|
+
] })
|
|
581
|
+
]
|
|
582
|
+
}
|
|
583
|
+
);
|
|
578
584
|
}
|
|
579
585
|
const Pe = "sheet.menu.sheets-sort", Ae = "sheet.menu.sheets-sort-ctx", B = "AscendingSingle", he = "ExpandAscendingSingle", ge = "DescendingSingle", me = "ExpandDescendingSingle", ve = "CustomSortSingle";
|
|
580
586
|
function Xt(e) {
|
|
@@ -644,7 +650,7 @@ function rr(e) {
|
|
|
644
650
|
}
|
|
645
651
|
function nr(e) {
|
|
646
652
|
return {
|
|
647
|
-
id:
|
|
653
|
+
id: ce.id,
|
|
648
654
|
title: "sheets-sort.general.sort-asc-cur",
|
|
649
655
|
type: S.BUTTON,
|
|
650
656
|
icon: B,
|
|
@@ -653,7 +659,7 @@ function nr(e) {
|
|
|
653
659
|
}
|
|
654
660
|
function ir(e) {
|
|
655
661
|
return {
|
|
656
|
-
id:
|
|
662
|
+
id: ae.id,
|
|
657
663
|
title: "sheets-sort.general.sort-asc-ext",
|
|
658
664
|
type: S.BUTTON,
|
|
659
665
|
icon: he,
|
|
@@ -678,7 +684,7 @@ function or(e) {
|
|
|
678
684
|
disabled$: N(e, { workbookTypes: [H], worksheetTypes: [L, D], rangeTypes: [k] })
|
|
679
685
|
};
|
|
680
686
|
}
|
|
681
|
-
function
|
|
687
|
+
function cr(e) {
|
|
682
688
|
return {
|
|
683
689
|
id: de.id,
|
|
684
690
|
title: "sheets-sort.general.sort-custom",
|
|
@@ -687,7 +693,7 @@ function ar(e) {
|
|
|
687
693
|
disabled$: N(e, { workbookTypes: [H], worksheetTypes: [L, D], rangeTypes: [k] })
|
|
688
694
|
};
|
|
689
695
|
}
|
|
690
|
-
const
|
|
696
|
+
const ar = {
|
|
691
697
|
[lt.ORGANIZATION]: {
|
|
692
698
|
[Pe]: {
|
|
693
699
|
order: 3,
|
|
@@ -714,16 +720,16 @@ const cr = {
|
|
|
714
720
|
}
|
|
715
721
|
}
|
|
716
722
|
},
|
|
717
|
-
[
|
|
718
|
-
[
|
|
723
|
+
[ct.MAIN_AREA]: {
|
|
724
|
+
[at.DATA]: {
|
|
719
725
|
[Ae]: {
|
|
720
726
|
order: 0,
|
|
721
727
|
menuItemFactory: rr,
|
|
722
|
-
[
|
|
728
|
+
[ce.id]: {
|
|
723
729
|
order: 0,
|
|
724
730
|
menuItemFactory: nr
|
|
725
731
|
},
|
|
726
|
-
[
|
|
732
|
+
[ae.id]: {
|
|
727
733
|
order: 1,
|
|
728
734
|
menuItemFactory: ir
|
|
729
735
|
},
|
|
@@ -737,7 +743,7 @@ const cr = {
|
|
|
737
743
|
},
|
|
738
744
|
[de.id]: {
|
|
739
745
|
order: 4,
|
|
740
|
-
menuItemFactory:
|
|
746
|
+
menuItemFactory: cr
|
|
741
747
|
}
|
|
742
748
|
}
|
|
743
749
|
}
|
|
@@ -750,11 +756,11 @@ var lr = Object.getOwnPropertyDescriptor, ur = (e, t, n, r) => {
|
|
|
750
756
|
}, M = (e, t) => (n, r) => t(n, r, e);
|
|
751
757
|
const pe = "custom-sort-dialog", dr = 560;
|
|
752
758
|
let G = class extends Ye {
|
|
753
|
-
constructor(e, t, n, r, i, s, o,
|
|
754
|
-
super(), this._commandService = e, this._menuManagerService = t, this._dialogService = n, this._layoutService = r, this._uiPartsService = i, this._sheetRenderService = s, this._localeService = o, this._sheetsSortUIService =
|
|
759
|
+
constructor(e, t, n, r, i, s, o, a, l, d) {
|
|
760
|
+
super(), this._commandService = e, this._menuManagerService = t, this._dialogService = n, this._layoutService = r, this._uiPartsService = i, this._sheetRenderService = s, this._localeService = o, this._sheetsSortUIService = a, this._injector = l, this._componentManager = d, this._initCommands(), this._initMenu(), this._initUI();
|
|
755
761
|
}
|
|
756
762
|
_initMenu() {
|
|
757
|
-
this._menuManagerService.mergeMenu(
|
|
763
|
+
this._menuManagerService.mergeMenu(ar);
|
|
758
764
|
}
|
|
759
765
|
_initCommands() {
|
|
760
766
|
[
|
|
@@ -763,8 +769,8 @@ let G = class extends Ye {
|
|
|
763
769
|
ie,
|
|
764
770
|
se,
|
|
765
771
|
oe,
|
|
766
|
-
ae,
|
|
767
772
|
ce,
|
|
773
|
+
ae,
|
|
768
774
|
le,
|
|
769
775
|
ue,
|
|
770
776
|
de
|
|
@@ -857,8 +863,8 @@ W = Cr([
|
|
|
857
863
|
export {
|
|
858
864
|
re as SortRangeAscCommand,
|
|
859
865
|
ne as SortRangeAscExtCommand,
|
|
860
|
-
|
|
861
|
-
|
|
866
|
+
ae as SortRangeAscExtInCtxMenuCommand,
|
|
867
|
+
ce as SortRangeAscInCtxMenuCommand,
|
|
862
868
|
oe as SortRangeCustomCommand,
|
|
863
869
|
de as SortRangeCustomInCtxMenuCommand,
|
|
864
870
|
ie as SortRangeDescCommand,
|