@univerjs/sheets-sort-ui 0.4.2 → 0.5.0-nightly.202411091605
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 +9 -1
- package/lib/cjs/locale/en-US.js +1 -0
- package/lib/cjs/locale/fa-IR.js +1 -0
- package/lib/cjs/locale/ru-RU.js +1 -0
- package/lib/cjs/locale/vi-VN.js +1 -0
- package/lib/cjs/locale/zh-CN.js +1 -0
- package/lib/cjs/locale/zh-TW.js +1 -0
- package/lib/es/index.js +617 -574
- package/lib/{locale/en-US.json → es/locale/en-US.js} +13 -10
- package/lib/{locale/fa-IR.json → es/locale/fa-IR.js} +13 -10
- package/lib/{locale/ru-RU.json → es/locale/ru-RU.js} +13 -10
- package/lib/{locale/vi-VN.json → es/locale/vi-VN.js} +13 -10
- package/lib/{locale/zh-CN.json → es/locale/zh-CN.js} +13 -10
- package/lib/{locale/zh-TW.json → es/locale/zh-TW.js} +13 -10
- package/lib/umd/index.js +9 -1
- package/lib/umd/locale/en-US.js +1 -0
- package/lib/umd/locale/fa-IR.js +1 -0
- package/lib/umd/locale/ru-RU.js +1 -0
- package/lib/umd/locale/vi-VN.js +1 -0
- package/lib/umd/locale/zh-CN.js +1 -0
- package/lib/umd/locale/zh-TW.js +1 -0
- package/package.json +30 -22
- package/LICENSE +0 -176
package/lib/es/index.js
CHANGED
|
@@ -1,806 +1,849 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { SheetsSelectionsService, getPrimaryForRange, SetSelectionsOperation, expandToContinuousRange, getSheetCommandTarget, WorkbookEditablePermission, WorksheetSortPermission, WorksheetEditPermission, RangeProtectionPermissionEditPoint } from "@univerjs/sheets";
|
|
12
|
-
import
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && (t[p] = s[p]);
|
|
1
|
+
var Ze = Object.defineProperty;
|
|
2
|
+
var Ge = (e, t, n) => t in e ? Ze(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
+
var K = (e, t, n) => Ge(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
+
import { useDependency as O, LocaleService as H, Inject as b, Disposable as We, UniverInstanceType as W, IUniverInstanceService as xe, ILogService as qe, ICommandService as Ie, Tools as Ye, LocaleType as J, CommandType as R, throttle as Xe, Injector as ye, RxDisposable as Ke, connectInjector as Je, DependentOn as Qe, Plugin as et, IConfigService as tt } from "@univerjs/core";
|
|
5
|
+
import { SheetsSortService as Me, SortType as k, SortRangeCommand as nt, UniverSheetsSortPlugin as rt } from "@univerjs/sheets-sort";
|
|
6
|
+
import { serializeRange as ot } from "@univerjs/engine-formula";
|
|
7
|
+
import { getCurrentRangeDisable$ as w, getCurrentExclusiveRangeInterest$ as st, SheetsRenderService as it, SheetsUIPart as ct } from "@univerjs/sheets-ui";
|
|
8
|
+
import { IConfirmService as at, MenuItemType as v, getMenuHiddenObservable as Re, RibbonStartGroup as lt, ContextMenuPosition as dt, ContextMenuGroup as ut, ComponentManager as mt, IMenuManagerService as ht, IDialogService as gt, ILayoutService as Ct, IUIPartsService as St } from "@univerjs/ui";
|
|
9
|
+
import { BehaviorSubject as ft, takeUntil as vt } from "rxjs";
|
|
10
|
+
import pt, { forwardRef as _, useRef as be, createElement as x, useState as A, useCallback as P, useEffect as Ee } from "react";
|
|
11
|
+
import { SheetsSelectionsService as _t, getPrimaryForRange as xt, SetSelectionsOperation as It, expandToContinuousRange as fe, getSheetCommandTarget as yt, WorkbookEditablePermission as N, WorksheetSortPermission as L, WorksheetEditPermission as j, RangeProtectionPermissionEditPoint as D } from "@univerjs/sheets";
|
|
12
|
+
import { RadioGroup as Oe, Radio as z, Checkbox as Mt, DraggableList as Rt, Button as ve, Dropdown as bt } from "@univerjs/design";
|
|
13
|
+
const Et = "sheets-sort-ui.config", Ot = {};
|
|
14
|
+
var f = function() {
|
|
15
|
+
return f = Object.assign || function(e) {
|
|
16
|
+
for (var t, n = 1, r = arguments.length; n < r; n++) {
|
|
17
|
+
t = arguments[n];
|
|
18
|
+
for (var o in t) Object.prototype.hasOwnProperty.call(t, o) && (e[o] = t[o]);
|
|
20
19
|
}
|
|
21
|
-
return
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
var
|
|
25
|
-
for (var
|
|
26
|
-
if (
|
|
27
|
-
for (var
|
|
28
|
-
|
|
29
|
-
return
|
|
30
|
-
},
|
|
31
|
-
var
|
|
32
|
-
return
|
|
20
|
+
return e;
|
|
21
|
+
}, f.apply(this, arguments);
|
|
22
|
+
}, Tt = function(e, t) {
|
|
23
|
+
var n = {};
|
|
24
|
+
for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
|
|
25
|
+
if (e != null && typeof Object.getOwnPropertySymbols == "function")
|
|
26
|
+
for (var o = 0, r = Object.getOwnPropertySymbols(e); o < r.length; o++)
|
|
27
|
+
t.indexOf(r[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[o]) && (n[r[o]] = e[r[o]]);
|
|
28
|
+
return n;
|
|
29
|
+
}, I = _(function(e, t) {
|
|
30
|
+
var n = e.icon, r = e.id, o = e.className, s = e.extend, c = Tt(e, ["icon", "id", "className", "extend"]), l = "univerjs-icon univerjs-icon-".concat(r, " ").concat(o || "").trim(), u = be("_".concat(Nt()));
|
|
31
|
+
return Te(n, "".concat(r), { defIds: n.defIds, idSuffix: u.current }, f({ ref: t, className: l }, c), s);
|
|
33
32
|
});
|
|
34
|
-
function
|
|
35
|
-
return
|
|
36
|
-
return
|
|
33
|
+
function Te(e, t, n, r, o) {
|
|
34
|
+
return x(e.tag, f(f({ key: t }, Pt(e, n, o)), r), (wt(e, n).children || []).map(function(s, c) {
|
|
35
|
+
return Te(s, "".concat(t, "-").concat(e.tag, "-").concat(c), n, void 0, o);
|
|
37
36
|
}));
|
|
38
37
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
})), attrs;
|
|
38
|
+
function Pt(e, t, n) {
|
|
39
|
+
var r = f({}, e.attrs);
|
|
40
|
+
n != null && n.colorChannel1 && r.fill === "colorChannel1" && (r.fill = n.colorChannel1);
|
|
41
|
+
var o = t.defIds;
|
|
42
|
+
return !o || o.length === 0 || (e.tag === "use" && r["xlink:href"] && (r["xlink:href"] = r["xlink:href"] + t.idSuffix), Object.entries(r).forEach(function(s) {
|
|
43
|
+
var c = s[0], l = s[1];
|
|
44
|
+
typeof l == "string" && (r[c] = l.replace(/url\(#(.*)\)/, "url(#$1".concat(t.idSuffix, ")")));
|
|
45
|
+
})), r;
|
|
48
46
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}) }) : node;
|
|
47
|
+
function wt(e, t) {
|
|
48
|
+
var n, r = t.defIds;
|
|
49
|
+
return !r || r.length === 0 ? e : e.tag === "defs" && (!((n = e.children) === null || n === void 0) && n.length) ? f(f({}, e), { children: e.children.map(function(o) {
|
|
50
|
+
return typeof o.attrs.id == "string" && r && r.indexOf(o.attrs.id) > -1 ? f(f({}, o), { attrs: f(f({}, o.attrs), { id: o.attrs.id + t.idSuffix }) }) : o;
|
|
51
|
+
}) }) : e;
|
|
55
52
|
}
|
|
56
|
-
|
|
57
|
-
function generateShortUuid() {
|
|
53
|
+
function Nt() {
|
|
58
54
|
return Math.random().toString(36).substring(2, 8);
|
|
59
55
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
return createElement(IconBase, Object.assign({}, props, {
|
|
56
|
+
I.displayName = "UniverIcon";
|
|
57
|
+
var Lt = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M12.4208 14.4667C12.4208 14.798 12.1522 15.0667 11.8208 15.0667C11.4895 15.0667 11.2208 14.798 11.2208 14.4667V2.98193L9.97861 4.22417C9.7443 4.45848 9.3644 4.45848 9.13008 4.22417C8.89577 3.98985 8.89577 3.60995 9.13008 3.37564L11.3967 1.10897C11.6311 0.874657 12.011 0.874657 12.2453 1.10897L14.5119 3.37564C14.7463 3.60995 14.7463 3.98985 14.5119 4.22417C14.2776 4.45848 13.8977 4.45848 13.6634 4.22417L12.4208 2.9816V14.4667Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M1.98967 10.2798C1.6583 10.2798 1.38967 10.0112 1.38967 9.67983 1.38967 9.34846 1.6583 9.07983 1.98967 9.07983H6.50138C6.74406 9.07983 6.96284 9.22602 7.05571 9.45022 7.14858 9.67443 7.09725 9.9325 6.92565 10.1041L3.43819 13.5916H6.50138C6.83276 13.5916 7.10138 13.8602 7.10138 14.1916 7.10138 14.5229 6.83276 14.7916 6.50138 14.7916H1.98967C1.74699 14.7916 1.52821 14.6454 1.43534 14.4212 1.34247 14.197 1.3938 13.9389 1.5654 13.7673L5.05286 10.2798H1.98967zM5.1846 1.86439C4.8641.989866 3.62725.989866 3.30674 1.86439L1.34882 7.20672C1.23479 7.51786 1.39458 7.86252 1.70571 7.97655 2.01684 8.09058 2.3615 7.93079 2.47553 7.61966L3.06159 6.02055 3.06338 6.02056H5.42975L6.01581 7.61966C6.12984 7.93079 6.4745 8.09058 6.78563 7.97655 7.09677 7.86252 7.25655 7.51786 7.14252 7.20672L5.1846 1.86439zM4.98996 4.82056L4.24567 2.78971 3.50138 4.82056H4.98996z", fillRule: "evenodd", clipRule: "evenodd" } }] }, ee = _(function(e, t) {
|
|
58
|
+
return x(I, Object.assign({}, e, {
|
|
64
59
|
id: "ascending- single",
|
|
65
|
-
ref,
|
|
66
|
-
icon:
|
|
60
|
+
ref: t,
|
|
61
|
+
icon: Lt
|
|
67
62
|
}));
|
|
68
63
|
});
|
|
69
|
-
|
|
70
|
-
var
|
|
71
|
-
return
|
|
64
|
+
ee.displayName = "AscendingSingle";
|
|
65
|
+
var jt = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M14.1544 3.75557C14.3887 3.98988 14.3887 4.36978 14.1544 4.6041L6.51409 12.2444C6.40157 12.3569 6.24896 12.4201 6.08983 12.4201C5.9307 12.4201 5.77808 12.3569 5.66556 12.2444L1.84541 8.42425C1.6111 8.18993 1.6111 7.81003 1.84541 7.57572C2.07973 7.34141 2.45963 7.34141 2.69394 7.57572L6.08983 10.9716L13.3059 3.75557C13.5402 3.52126 13.9201 3.52126 14.1544 3.75557Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Pe = _(function(e, t) {
|
|
66
|
+
return x(I, Object.assign({}, e, {
|
|
72
67
|
id: "check-mark-single",
|
|
73
|
-
ref,
|
|
74
|
-
icon:
|
|
68
|
+
ref: t,
|
|
69
|
+
icon: jt
|
|
75
70
|
}));
|
|
76
71
|
});
|
|
77
|
-
|
|
78
|
-
var
|
|
79
|
-
return
|
|
72
|
+
Pe.displayName = "CheckMarkSingle";
|
|
73
|
+
var Dt = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M9.77445 9.24306L9.77457 11.9573C9.77458 12.2887 9.50597 12.5574 9.17459 12.5574 8.84322 12.5574 8.57458 12.2888 8.57457 11.9574L8.57439 7.79509C8.57438 7.46372 8.84299 7.19508 9.17436 7.19507 9.3281 7.19493 9.48196 7.25351 9.59925 7.3708L11.3465 9.11808C11.5808 9.3524 11.5808 9.7323 11.3465 9.96661 11.1122 10.2009 10.7323 10.2009 10.498 9.96661L9.77445 9.24306zM6.22584 10.5094L6.22572 7.79514C6.22571 7.46377 6.49433 7.19513 6.8257 7.19512 7.15707 7.1951 7.42571 7.46372 7.42572 7.79509L7.4259 11.9574C7.42592 12.2888 7.1573 12.5574 6.82593 12.5574 6.67228 12.5575 6.51828 12.4989 6.40104 12.3817L4.65376 10.6344C4.41945 10.4001 4.41945 10.0202 4.65376 9.78588 4.88808 9.55156 5.26798 9.55156 5.50229 9.78588L6.22584 10.5094z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M1.14014 3.73989C1.14014 2.30396 2.3042 1.13989 3.74014 1.13989H12.2601C13.6961 1.13989 14.8601 2.30395 14.8601 3.73989V12.2599C14.8601 13.6958 13.6961 14.8599 12.2601 14.8599H3.74014C2.3042 14.8599 1.14014 13.6958 1.14014 12.2599V3.73989ZM2.34014 5.86724V12.2599C2.34014 13.0331 2.96694 13.6599 3.74014 13.6599H12.2601C13.0333 13.6599 13.6601 13.0331 13.6601 12.2599V5.86724H2.34014ZM13.6601 4.66724H2.34014V3.73989C2.34014 2.9667 2.96694 2.33989 3.74014 2.33989H12.2601C13.0333 2.33989 13.6601 2.96669 13.6601 3.73989V4.66724Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, we = _(function(e, t) {
|
|
74
|
+
return x(I, Object.assign({}, e, {
|
|
80
75
|
id: "custom-sort-single",
|
|
81
|
-
ref,
|
|
82
|
-
icon:
|
|
76
|
+
ref: t,
|
|
77
|
+
icon: Dt
|
|
83
78
|
}));
|
|
84
79
|
});
|
|
85
|
-
|
|
86
|
-
var
|
|
87
|
-
return
|
|
80
|
+
we.displayName = "CustomSortSingle";
|
|
81
|
+
var kt = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M5.3313 1.4667C5.3313 1.13533 5.59993.866699 5.9313.866699H10.069C10.4004.866699 10.669 1.13533 10.669 1.4667 10.669 1.79807 10.4004 2.0667 10.069 2.0667H5.9313C5.59993 2.0667 5.3313 1.79807 5.3313 1.4667zM1.09985 3.64443C1.09985 3.31306 1.36848 3.04443 1.69985 3.04443H14.2999C14.6312 3.04443 14.8999 3.31306 14.8999 3.64443 14.8999 3.9758 14.6312 4.24443 14.2999 4.24443H1.69985C1.36848 4.24443 1.09985 3.9758 1.09985 3.64443z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M4.75332 5.22217C3.86966 5.22217 3.15332 5.93851 3.15332 6.82217V13.1332C3.15332 14.2377 4.04875 15.1332 5.15332 15.1332H10.8465C11.9511 15.1332 12.8465 14.2377 12.8465 13.1331V6.82217C12.8465 5.93851 12.1302 5.22217 11.2465 5.22217H4.75332ZM4.35332 6.82217C4.35332 6.60125 4.53241 6.42217 4.75332 6.42217H11.2465C11.4674 6.42217 11.6465 6.60125 11.6465 6.82217V13.1331C11.6465 13.575 11.2884 13.9331 10.8465 13.9331H5.15332C4.71149 13.9331 4.35332 13.575 4.35332 13.1332V6.82217Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Ne = _(function(e, t) {
|
|
82
|
+
return x(I, Object.assign({}, e, {
|
|
88
83
|
id: "delete-empty-single",
|
|
89
|
-
ref,
|
|
90
|
-
icon:
|
|
84
|
+
ref: t,
|
|
85
|
+
icon: kt
|
|
91
86
|
}));
|
|
92
87
|
});
|
|
93
|
-
|
|
94
|
-
var
|
|
95
|
-
return
|
|
88
|
+
Ne.displayName = "DeleteEmptySingle";
|
|
89
|
+
var Ht = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M12.4208 1.53335C12.4208 1.20198 12.1522 0.93335 11.8208 0.93335C11.4895 0.93335 11.2208 1.20198 11.2208 1.53335V13.0181L9.97861 11.7758C9.7443 11.5415 9.3644 11.5415 9.13008 11.7758C8.89577 12.0101 8.89577 12.39 9.13008 12.6244L11.3967 14.891C11.6311 15.1253 12.011 15.1253 12.2453 14.891L14.5119 12.6244C14.7463 12.39 14.7463 12.0101 14.5119 11.7758C14.2776 11.5415 13.8977 11.5415 13.6634 11.7758L12.4208 13.0184V1.53335Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M1.98967 10.2798C1.6583 10.2798 1.38967 10.0112 1.38967 9.67983 1.38967 9.34846 1.6583 9.07983 1.98967 9.07983H6.50138C6.74406 9.07983 6.96284 9.22602 7.05571 9.45022 7.14858 9.67443 7.09725 9.9325 6.92565 10.1041L3.43819 13.5916H6.50138C6.83276 13.5916 7.10138 13.8602 7.10138 14.1916 7.10138 14.5229 6.83276 14.7916 6.50138 14.7916H1.98967C1.74699 14.7916 1.52821 14.6454 1.43534 14.4212 1.34247 14.197 1.3938 13.9389 1.5654 13.7673L5.05286 10.2798H1.98967zM5.1846 1.86439C4.8641.989866 3.62725.989866 3.30674 1.86439L1.34882 7.20672C1.23479 7.51786 1.39458 7.86252 1.70571 7.97655 2.01684 8.09058 2.3615 7.93079 2.47553 7.61966L3.06159 6.02055 3.06338 6.02056H5.42975L6.01581 7.61966C6.12984 7.93079 6.4745 8.09058 6.78563 7.97655 7.09677 7.86252 7.25655 7.51786 7.14252 7.20672L5.1846 1.86439zM4.98996 4.82056L4.24567 2.78971 3.50138 4.82056H4.98996z", fillRule: "evenodd", clipRule: "evenodd" } }] }, te = _(function(e, t) {
|
|
90
|
+
return x(I, Object.assign({}, e, {
|
|
96
91
|
id: "descending-single",
|
|
97
|
-
ref,
|
|
98
|
-
icon:
|
|
92
|
+
ref: t,
|
|
93
|
+
icon: Ht
|
|
99
94
|
}));
|
|
100
95
|
});
|
|
101
|
-
|
|
102
|
-
var
|
|
103
|
-
return
|
|
96
|
+
te.displayName = "DescendingSingle";
|
|
97
|
+
var $t = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M1.9064 3.20024C1.57503 3.20024 1.3064 2.93161 1.3064 2.60024C1.3064 2.26887 1.57503 2.00024 1.9064 2.00024H4.57306C4.90443 2.00024 5.17306 2.26887 5.17306 2.60024C5.17306 2.93161 4.90443 3.20024 4.57306 3.20024H1.9064ZM1.3064 6.19985C1.3064 6.53122 1.57503 6.79985 1.9064 6.79985H5.9064C6.23777 6.79985 6.5064 6.53122 6.5064 6.19985C6.5064 5.86848 6.23777 5.59985 5.9064 5.59985H1.9064C1.57503 5.59985 1.3064 5.86848 1.3064 6.19985ZM1.9064 10.3997C1.57503 10.3997 1.3064 10.1311 1.3064 9.79971C1.3064 9.46834 1.57503 9.19971 1.9064 9.19971H7.23973C7.5711 9.19971 7.83973 9.46834 7.83973 9.79971C7.83973 10.1311 7.5711 10.3997 7.23973 10.3997H1.9064ZM1.9064 13.9996C1.57503 13.9996 1.3064 13.7309 1.3064 13.3996C1.3064 13.0682 1.57503 12.7996 1.9064 12.7996H8.57306C8.90443 12.7996 9.17306 13.0682 9.17306 13.3996C9.17306 13.7309 8.90443 13.9996 8.57306 13.9996H1.9064Z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", 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" } }] }, Le = _(function(e, t) {
|
|
98
|
+
return x(I, Object.assign({}, e, {
|
|
104
99
|
id: "expand-ascending-single",
|
|
105
|
-
ref,
|
|
106
|
-
icon:
|
|
100
|
+
ref: t,
|
|
101
|
+
icon: $t
|
|
107
102
|
}));
|
|
108
103
|
});
|
|
109
|
-
|
|
110
|
-
var
|
|
111
|
-
return
|
|
104
|
+
Le.displayName = "ExpandAscendingSingle";
|
|
105
|
+
var Ut = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M1.9064 12.7998C1.57503 12.7998 1.3064 13.0684 1.3064 13.3998C1.3064 13.7311 1.57503 13.9998 1.9064 13.9998H4.57306C4.90443 13.9998 5.17306 13.7311 5.17306 13.3998C5.17306 13.0684 4.90443 12.7998 4.57306 12.7998H1.9064ZM1.3064 9.80015C1.3064 9.46878 1.57503 9.20015 1.9064 9.20015H5.9064C6.23777 9.20015 6.5064 9.46878 6.5064 9.80015C6.5064 10.1315 6.23777 10.4001 5.9064 10.4001H1.9064C1.57503 10.4001 1.3064 10.1315 1.3064 9.80015ZM1.9064 5.60029C1.57503 5.60029 1.3064 5.86892 1.3064 6.20029C1.3064 6.53166 1.57503 6.80029 1.9064 6.80029H7.23973C7.5711 6.80029 7.83973 6.53166 7.83973 6.20029C7.83973 5.86892 7.5711 5.60029 7.23973 5.60029H1.9064ZM1.9064 2.00044C1.57503 2.00044 1.3064 2.26907 1.3064 2.60044C1.3064 2.93181 1.57503 3.20044 1.9064 3.20044H8.57306C8.90443 3.20044 9.17306 2.93181 9.17306 2.60044C9.17306 2.26907 8.90443 2.00044 8.57306 2.00044H1.9064Z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", 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" } }] }, je = _(function(e, t) {
|
|
106
|
+
return x(I, Object.assign({}, e, {
|
|
112
107
|
id: "expand-descending-single",
|
|
113
|
-
ref,
|
|
114
|
-
icon:
|
|
108
|
+
ref: t,
|
|
109
|
+
icon: Ut
|
|
115
110
|
}));
|
|
116
111
|
});
|
|
117
|
-
|
|
118
|
-
var
|
|
119
|
-
return
|
|
112
|
+
je.displayName = "ExpandDescendingSingle";
|
|
113
|
+
var At = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", 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" } }] }, Q = _(function(e, t) {
|
|
114
|
+
return x(I, Object.assign({}, e, {
|
|
120
115
|
id: "increase-single",
|
|
121
|
-
ref,
|
|
122
|
-
icon:
|
|
116
|
+
ref: t,
|
|
117
|
+
icon: At
|
|
123
118
|
}));
|
|
124
119
|
});
|
|
125
|
-
|
|
126
|
-
var
|
|
127
|
-
return
|
|
120
|
+
Q.displayName = "IncreaseSingle";
|
|
121
|
+
var Bt = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M11.3536 6.14645C11.5488 6.34171 11.5488 6.65829 11.3536 6.85355L8.35355 9.85355C8.15829 10.0488 7.84171 10.0488 7.64645 9.85355L4.64645 6.85355C4.45118 6.65829 4.45118 6.34171 4.64645 6.14645C4.84171 5.95118 5.15829 5.95118 5.35355 6.14645L8 8.79289L10.6464 6.14645C10.8417 5.95118 11.1583 5.95118 11.3536 6.14645Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, De = _(function(e, t) {
|
|
122
|
+
return x(I, Object.assign({}, e, {
|
|
128
123
|
id: "more-down-single",
|
|
129
|
-
ref,
|
|
130
|
-
icon:
|
|
124
|
+
ref: t,
|
|
125
|
+
icon: Bt
|
|
131
126
|
}));
|
|
132
127
|
});
|
|
133
|
-
|
|
134
|
-
var
|
|
135
|
-
return
|
|
128
|
+
De.displayName = "MoreDownSingle";
|
|
129
|
+
var Ft = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "mask", attrs: { id: "mask0_622_8", style: { maskType: "alpha" }, width: 16, height: 16, x: 0, y: 0, maskUnits: "userSpaceOnUse" }, children: [{ tag: "path", attrs: { fill: "#D9D9D9", d: "M0 0H16V16H0z" } }] }, { tag: "g", attrs: { fill: "currentColor", mask: "url(#mask0_622_8)" }, children: [{ tag: "path", attrs: { d: "M6 5C6.55228 5 7 4.55228 7 4 7 3.44772 6.55228 3 6 3 5.44772 3 5 3.44772 5 4 5 4.55228 5.44772 5 6 5zM6 9C6.55228 9 7 8.55229 7 8 7 7.44772 6.55228 7 6 7 5.44772 7 5 7.44772 5 8 5 8.55229 5.44772 9 6 9zM7 12C7 12.5523 6.55228 13 6 13 5.44772 13 5 12.5523 5 12 5 11.4477 5.44772 11 6 11 6.55228 11 7 11.4477 7 12zM10 5C10.5523 5 11 4.55228 11 4 11 3.44772 10.5523 3 10 3 9.44771 3 9 3.44772 9 4 9 4.55228 9.44771 5 10 5zM11 8C11 8.55229 10.5523 9 10 9 9.44771 9 9 8.55229 9 8 9 7.44772 9.44771 7 10 7 10.5523 7 11 7.44772 11 8zM10 13C10.5523 13 11 12.5523 11 12 11 11.4477 10.5523 11 10 11 9.44771 11 9 11.4477 9 12 9 12.5523 9.44771 13 10 13z" } }] }] }, ke = _(function(e, t) {
|
|
130
|
+
return x(I, Object.assign({}, e, {
|
|
136
131
|
id: "sequence-single",
|
|
137
|
-
ref,
|
|
138
|
-
icon:
|
|
132
|
+
ref: t,
|
|
133
|
+
icon: Ft
|
|
139
134
|
}));
|
|
140
135
|
});
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
136
|
+
ke.displayName = "SequenceSingle";
|
|
137
|
+
var He = { exports: {} }, q = {};
|
|
138
|
+
/**
|
|
139
|
+
* @license React
|
|
140
|
+
* react-jsx-runtime.production.min.js
|
|
141
|
+
*
|
|
142
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
143
|
+
*
|
|
144
|
+
* This source code is licensed under the MIT license found in the
|
|
145
|
+
* LICENSE file in the root directory of this source tree.
|
|
146
|
+
*/
|
|
147
|
+
var Vt = pt, zt = Symbol.for("react.element"), Zt = Symbol.for("react.fragment"), Gt = Object.prototype.hasOwnProperty, Wt = Vt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, qt = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
148
|
+
function $e(e, t, n) {
|
|
149
|
+
var r, o = {}, s = null, c = null;
|
|
150
|
+
n !== void 0 && (s = "" + n), t.key !== void 0 && (s = "" + t.key), t.ref !== void 0 && (c = t.ref);
|
|
151
|
+
for (r in t) Gt.call(t, r) && !qt.hasOwnProperty(r) && (o[r] = t[r]);
|
|
152
|
+
if (e && e.defaultProps) for (r in t = e.defaultProps, t) o[r] === void 0 && (o[r] = t[r]);
|
|
153
|
+
return { $$typeof: zt, type: e, key: s, ref: c, props: o, _owner: Wt.current };
|
|
154
|
+
}
|
|
155
|
+
q.Fragment = Zt;
|
|
156
|
+
q.jsx = $e;
|
|
157
|
+
q.jsxs = $e;
|
|
158
|
+
He.exports = q;
|
|
159
|
+
var i = He.exports;
|
|
160
|
+
const Yt = "univer-extend-confirm-content", Xt = "univer-extend-confirm-radio-group", Kt = "univer-custom-sort-panel-container", Jt = "univer-custom-sort-panel-ext", Qt = "univer-add-condition", en = "univer-add-condition-text", tn = "univer-add-condition-disable", nn = "univer-custom-sort-panel-footer", rn = "univer-custom-sort-panel-footer-btn", on = "univer-custom-sort-panel-item", sn = "univer-custom-sort-panel-item-head", cn = "univer-custom-sort-panel-item-handler", an = "univer-custom-sort-panel-item-remove", ln = "univer-custom-sort-panel-item-column-input", dn = "univer-custom-sort-panel-item-column-input-dropdown", un = "univer-custom-sort-panel-item-column-input-text", mn = "univer-custom-sort-panel-item-order-radio", hn = "univer-custom-sort-panel-item-order-radio-cn", gn = "univer-condition-list", Cn = "univer-embed-sort-btn-container", Sn = "univer-embed-sort-btn", fn = "univer-embed-sort-btn-asc", vn = "univer-embed-sort-btn-desc", pn = "univer-embed-sort-btn-icon", _n = "univer-custom-sort-col-menu", xn = "univer-custom-sort-col-menu-item", In = "univer-custom-sort-col-menu-item-desc", a = {
|
|
161
|
+
extendConfirmContent: Yt,
|
|
162
|
+
extendConfirmRadioGroup: Xt,
|
|
163
|
+
customSortPanelContainer: Kt,
|
|
164
|
+
customSortPanelExt: Jt,
|
|
165
|
+
addCondition: Qt,
|
|
166
|
+
addConditionText: en,
|
|
167
|
+
addConditionDisable: tn,
|
|
168
|
+
customSortPanelFooter: nn,
|
|
169
|
+
customSortPanelFooterBtn: rn,
|
|
170
|
+
customSortPanelItem: on,
|
|
171
|
+
customSortPanelItemHead: sn,
|
|
172
|
+
customSortPanelItemHandler: cn,
|
|
173
|
+
customSortPanelItemRemove: an,
|
|
174
|
+
customSortPanelItemColumnInput: ln,
|
|
175
|
+
customSortPanelItemColumnInputDropdown: dn,
|
|
176
|
+
customSortPanelItemColumnInputText: un,
|
|
177
|
+
customSortPanelItemOrderRadio: mn,
|
|
178
|
+
customSortPanelItemOrderRadioCn: hn,
|
|
179
|
+
conditionList: gn,
|
|
180
|
+
embedSortBtnContainer: Cn,
|
|
181
|
+
embedSortBtn: Sn,
|
|
182
|
+
embedSortBtnAsc: fn,
|
|
183
|
+
embedSortBtnDesc: vn,
|
|
184
|
+
embedSortBtnIcon: pn,
|
|
185
|
+
customSortColMenu: _n,
|
|
186
|
+
customSortColMenuItem: xn,
|
|
187
|
+
customSortColMenuItemDesc: In
|
|
188
|
+
}, yn = (e) => {
|
|
189
|
+
const [t, n] = A("0"), r = O(H);
|
|
190
|
+
return /* @__PURE__ */ i.jsxs("div", { className: a.extendConfirmContent, children: [
|
|
191
|
+
/* @__PURE__ */ i.jsx("div", { className: "extend-confirm-desc", children: r.t("sheets-sort.dialog.sort-reminder-desc") }),
|
|
192
|
+
/* @__PURE__ */ i.jsxs(
|
|
193
|
+
Oe,
|
|
184
194
|
{
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
195
|
+
className: a.extendConfirmRadioGroup,
|
|
196
|
+
value: t,
|
|
197
|
+
direction: "vertical",
|
|
198
|
+
onChange: (o) => {
|
|
199
|
+
n(o), e.onChange(o);
|
|
200
|
+
},
|
|
201
|
+
children: [
|
|
202
|
+
/* @__PURE__ */ i.jsx(
|
|
203
|
+
z,
|
|
204
|
+
{
|
|
205
|
+
value: "0",
|
|
206
|
+
children: r.t("sheets-sort.dialog.sort-reminder-no")
|
|
207
|
+
}
|
|
208
|
+
),
|
|
209
|
+
/* @__PURE__ */ i.jsx(z, { value: "1", children: r.t("sheets-sort.dialog.sort-reminder-ext") })
|
|
210
|
+
]
|
|
211
|
+
}
|
|
212
|
+
)
|
|
213
|
+
] });
|
|
214
|
+
};
|
|
215
|
+
var Mn = Object.defineProperty, Rn = Object.getOwnPropertyDescriptor, bn = (e, t, n, r) => {
|
|
216
|
+
for (var o = r > 1 ? void 0 : r ? Rn(t, n) : t, s = e.length - 1, c; s >= 0; s--)
|
|
217
|
+
(c = e[s]) && (o = (r ? c(t, n, o) : c(o)) || o);
|
|
218
|
+
return r && o && Mn(t, n, o), o;
|
|
219
|
+
}, T = (e, t) => (n, r) => t(n, r, e);
|
|
220
|
+
const V = {
|
|
198
221
|
MERGE_ERROR: "sheets-sort.error.merge-size",
|
|
199
222
|
EMPTY_ERROR: "sheets-sort.error.empty",
|
|
200
223
|
SINGLE_ERROR: "sheets-sort.error.single",
|
|
201
224
|
FORMULA_ARRAY: "sheets-sort.error.formula-array"
|
|
202
225
|
};
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
constructor(_univerInstanceService, _confirmService, _logService, _selectionManagerService, _sheetsSortService, _localeService, _commandService) {
|
|
226
|
+
let g = class extends We {
|
|
227
|
+
constructor(t, n, r, o, s, c, l) {
|
|
206
228
|
super();
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
this._univerInstanceService =
|
|
229
|
+
K(this, "_customSortState$", new ft(null));
|
|
230
|
+
K(this, "customSortState$", this._customSortState$.asObservable());
|
|
231
|
+
this._univerInstanceService = t, this._confirmService = n, this._logService = r, this._selectionManagerService = o, this._sheetsSortService = s, this._localeService = c, this._commandService = l;
|
|
210
232
|
}
|
|
211
|
-
async triggerSortDirectly(
|
|
212
|
-
const
|
|
213
|
-
if (!
|
|
233
|
+
async triggerSortDirectly(t, n, r) {
|
|
234
|
+
const o = r || await this._detectSortLocation(n);
|
|
235
|
+
if (!o || !this._check(o))
|
|
214
236
|
return !1;
|
|
215
|
-
const
|
|
237
|
+
const c = {
|
|
216
238
|
orderRules: [{
|
|
217
|
-
type:
|
|
218
|
-
colIndex:
|
|
239
|
+
type: t ? k.ASC : k.DESC,
|
|
240
|
+
colIndex: o.colIndex
|
|
219
241
|
}],
|
|
220
|
-
range:
|
|
242
|
+
range: o.range
|
|
221
243
|
};
|
|
222
|
-
return this._sheetsSortService.applySort(
|
|
244
|
+
return this._sheetsSortService.applySort(c, o.unitId, o.subUnitId), !0;
|
|
223
245
|
}
|
|
224
246
|
async triggerSortCustomize() {
|
|
225
|
-
const
|
|
226
|
-
return !
|
|
247
|
+
const t = await this._detectSortLocation();
|
|
248
|
+
return !t || !this._check(t) ? !1 : (this.showCustomSortPanel(t), !0);
|
|
227
249
|
}
|
|
228
250
|
customSortState() {
|
|
229
251
|
return this._customSortState$.getValue();
|
|
230
252
|
}
|
|
231
|
-
getTitles(
|
|
232
|
-
var
|
|
233
|
-
const
|
|
234
|
-
if (!
|
|
253
|
+
getTitles(t) {
|
|
254
|
+
var u, m;
|
|
255
|
+
const n = (u = this.customSortState()) == null ? void 0 : u.location;
|
|
256
|
+
if (!n)
|
|
235
257
|
return [];
|
|
236
|
-
const { unitId, subUnitId, range } =
|
|
237
|
-
if (!
|
|
258
|
+
const { unitId: r, subUnitId: o, range: s } = n, c = (m = this._univerInstanceService.getUnit(r)) == null ? void 0 : m.getSheetBySheetId(o);
|
|
259
|
+
if (!c)
|
|
238
260
|
return [];
|
|
239
|
-
const
|
|
261
|
+
const l = En(this._localeService);
|
|
240
262
|
return Array.from(
|
|
241
|
-
{ length:
|
|
242
|
-
(
|
|
243
|
-
var
|
|
244
|
-
const
|
|
263
|
+
{ length: s.endColumn - s.startColumn + 1 },
|
|
264
|
+
(y, S) => {
|
|
265
|
+
var C;
|
|
266
|
+
const E = (C = c.getCell(s.startRow, S + s.startColumn)) == null ? void 0 : C.v;
|
|
245
267
|
return {
|
|
246
|
-
index:
|
|
247
|
-
label:
|
|
268
|
+
index: S + s.startColumn,
|
|
269
|
+
label: t ? `${E != null ? E : l(S + s.startColumn)}` : l(S + s.startColumn)
|
|
248
270
|
};
|
|
249
271
|
}
|
|
250
272
|
);
|
|
251
273
|
}
|
|
252
|
-
setSelection(
|
|
253
|
-
var
|
|
254
|
-
const
|
|
255
|
-
if (!
|
|
274
|
+
setSelection(t, n, r) {
|
|
275
|
+
var c;
|
|
276
|
+
const o = (c = this._univerInstanceService.getUnit(t)) == null ? void 0 : c.getSheetBySheetId(n);
|
|
277
|
+
if (!o)
|
|
256
278
|
return;
|
|
257
|
-
const
|
|
258
|
-
unitId,
|
|
259
|
-
subUnitId,
|
|
260
|
-
selections: [{ range, primary:
|
|
279
|
+
const s = {
|
|
280
|
+
unitId: t,
|
|
281
|
+
subUnitId: n,
|
|
282
|
+
selections: [{ range: r, primary: xt(r, o), style: null }]
|
|
261
283
|
};
|
|
262
|
-
this._commandService.executeCommand(
|
|
284
|
+
this._commandService.executeCommand(It.id, s);
|
|
263
285
|
}
|
|
264
|
-
async showCheckError(
|
|
286
|
+
async showCheckError(t) {
|
|
265
287
|
return await this._confirmService.confirm({
|
|
266
288
|
id: "sort-range-check-error",
|
|
267
289
|
title: {
|
|
268
290
|
title: this._localeService.t("info.tooltip")
|
|
269
291
|
},
|
|
270
292
|
children: {
|
|
271
|
-
title: /* @__PURE__ */
|
|
293
|
+
title: /* @__PURE__ */ i.jsx("div", { children: this._localeService.t(t) })
|
|
272
294
|
}
|
|
273
295
|
});
|
|
274
296
|
}
|
|
275
297
|
async showExtendConfirm() {
|
|
276
|
-
let
|
|
298
|
+
let t = !1;
|
|
277
299
|
return await this._confirmService.confirm({
|
|
278
300
|
id: "extend-sort-range-dialog",
|
|
279
301
|
title: {
|
|
280
302
|
title: this._localeService.t("sheets-sort.dialog.sort-reminder")
|
|
281
303
|
},
|
|
282
304
|
children: {
|
|
283
|
-
title: /* @__PURE__ */
|
|
284
|
-
|
|
305
|
+
title: /* @__PURE__ */ i.jsx(
|
|
306
|
+
yn,
|
|
285
307
|
{
|
|
286
|
-
onChange:
|
|
287
|
-
|
|
288
|
-
}
|
|
308
|
+
onChange: (r) => {
|
|
309
|
+
t = r === "1";
|
|
310
|
+
}
|
|
289
311
|
}
|
|
290
312
|
)
|
|
291
313
|
},
|
|
292
314
|
width: 400
|
|
293
|
-
}) ?
|
|
315
|
+
}) ? t ? "extend" : "keep" : "cancel";
|
|
294
316
|
}
|
|
295
|
-
showCustomSortPanel(
|
|
296
|
-
this._customSortState$.next({ location, show: !0 });
|
|
317
|
+
showCustomSortPanel(t) {
|
|
318
|
+
this._customSortState$.next({ location: t, show: !0 });
|
|
297
319
|
}
|
|
298
320
|
closeCustomSortPanel() {
|
|
299
321
|
this._customSortState$.next({ show: !1 });
|
|
300
322
|
}
|
|
301
|
-
_check(
|
|
302
|
-
return this._sheetsSortService.singleCheck(
|
|
323
|
+
_check(t) {
|
|
324
|
+
return this._sheetsSortService.singleCheck(t) ? this._sheetsSortService.mergeCheck(t) ? this._sheetsSortService.formulaCheck(t) ? this._sheetsSortService.emptyCheck(t) ? !0 : (this.showCheckError(V.EMPTY_ERROR), !1) : (this.showCheckError(V.FORMULA_ARRAY), !1) : (this.showCheckError(V.MERGE_ERROR), !1) : (this.showCheckError(V.SINGLE_ERROR), !1);
|
|
303
325
|
}
|
|
304
|
-
async _detectSortLocation(
|
|
305
|
-
const
|
|
306
|
-
if (!
|
|
326
|
+
async _detectSortLocation(t) {
|
|
327
|
+
const n = this._univerInstanceService.getCurrentUnitForType(W.UNIVER_SHEET), r = n.getActiveSheet(), o = n.getUnitId(), s = r.getSheetId(), c = this._selectionManagerService.getCurrentLastSelection();
|
|
328
|
+
if (!c)
|
|
307
329
|
return null;
|
|
308
|
-
let
|
|
309
|
-
if (
|
|
310
|
-
|
|
311
|
-
else if (
|
|
312
|
-
|
|
330
|
+
let l;
|
|
331
|
+
if (t === !0)
|
|
332
|
+
l = fe(c.range, { up: !0, down: !0, left: !0, right: !0 }, r), this.setSelection(o, s, l);
|
|
333
|
+
else if (t === !1)
|
|
334
|
+
l = c.range;
|
|
313
335
|
else {
|
|
314
|
-
const
|
|
315
|
-
if (
|
|
336
|
+
const u = await this.showExtendConfirm();
|
|
337
|
+
if (u === "cancel")
|
|
316
338
|
return null;
|
|
317
|
-
|
|
339
|
+
u === "keep" ? l = c.range : (l = fe(c.range, { up: !0, down: !0, left: !0, right: !0 }, r), this.setSelection(o, s, l));
|
|
318
340
|
}
|
|
319
341
|
return {
|
|
320
|
-
range,
|
|
321
|
-
unitId,
|
|
322
|
-
subUnitId,
|
|
323
|
-
colIndex:
|
|
342
|
+
range: l,
|
|
343
|
+
unitId: o,
|
|
344
|
+
subUnitId: s,
|
|
345
|
+
colIndex: c.primary.actualColumn
|
|
324
346
|
};
|
|
325
347
|
}
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
],
|
|
336
|
-
function
|
|
337
|
-
return (
|
|
338
|
-
const
|
|
339
|
-
switch (
|
|
340
|
-
case
|
|
341
|
-
return `"${
|
|
342
|
-
case
|
|
343
|
-
return `Column "${
|
|
348
|
+
};
|
|
349
|
+
g = bn([
|
|
350
|
+
T(0, xe),
|
|
351
|
+
T(1, at),
|
|
352
|
+
T(2, qe),
|
|
353
|
+
T(3, b(_t)),
|
|
354
|
+
T(4, b(Me)),
|
|
355
|
+
T(5, b(H)),
|
|
356
|
+
T(6, Ie)
|
|
357
|
+
], g);
|
|
358
|
+
function En(e) {
|
|
359
|
+
return (t) => {
|
|
360
|
+
const n = Ye.chatAtABC(t);
|
|
361
|
+
switch (e.getCurrentLocale()) {
|
|
362
|
+
case J.ZH_CN:
|
|
363
|
+
return `"${n}"列`;
|
|
364
|
+
case J.EN_US:
|
|
365
|
+
return `Column "${n}"`;
|
|
344
366
|
default:
|
|
345
|
-
return `Column "${
|
|
367
|
+
return `Column "${n}"`;
|
|
346
368
|
}
|
|
347
369
|
};
|
|
348
370
|
}
|
|
349
|
-
|
|
350
|
-
const SortRangeAscCommand = {
|
|
371
|
+
const ne = {
|
|
351
372
|
id: "sheet.command.sort-range-asc",
|
|
352
|
-
type:
|
|
353
|
-
handler:
|
|
354
|
-
},
|
|
373
|
+
type: R.COMMAND,
|
|
374
|
+
handler: async (e) => await e.get(g).triggerSortDirectly(!0, !1)
|
|
375
|
+
}, re = {
|
|
355
376
|
id: "sheet.command.sort-range-asc-ext",
|
|
356
|
-
type:
|
|
357
|
-
handler:
|
|
358
|
-
},
|
|
377
|
+
type: R.COMMAND,
|
|
378
|
+
handler: async (e) => await e.get(g).triggerSortDirectly(!0, !0)
|
|
379
|
+
}, oe = {
|
|
359
380
|
id: "sheet.command.sort-range-desc",
|
|
360
|
-
type:
|
|
361
|
-
handler:
|
|
362
|
-
},
|
|
381
|
+
type: R.COMMAND,
|
|
382
|
+
handler: async (e) => await e.get(g).triggerSortDirectly(!1, !1)
|
|
383
|
+
}, se = {
|
|
363
384
|
id: "sheet.command.sort-range-desc-ext",
|
|
364
|
-
type:
|
|
365
|
-
handler:
|
|
366
|
-
},
|
|
385
|
+
type: R.COMMAND,
|
|
386
|
+
handler: async (e) => await e.get(g).triggerSortDirectly(!1, !0)
|
|
387
|
+
}, ie = {
|
|
367
388
|
id: "sheet.command.sort-range-custom",
|
|
368
|
-
type:
|
|
369
|
-
handler:
|
|
370
|
-
},
|
|
389
|
+
type: R.COMMAND,
|
|
390
|
+
handler: async (e) => await e.get(g).triggerSortCustomize()
|
|
391
|
+
}, ce = {
|
|
371
392
|
id: "sheet.command.sort-range-asc-ctx",
|
|
372
|
-
type:
|
|
373
|
-
handler:
|
|
374
|
-
},
|
|
393
|
+
type: R.COMMAND,
|
|
394
|
+
handler: async (e) => await e.get(g).triggerSortDirectly(!0, !1)
|
|
395
|
+
}, ae = {
|
|
375
396
|
id: "sheet.command.sort-range-asc-ext-ctx",
|
|
376
|
-
type:
|
|
377
|
-
handler:
|
|
378
|
-
},
|
|
397
|
+
type: R.COMMAND,
|
|
398
|
+
handler: async (e) => await e.get(g).triggerSortDirectly(!0, !0)
|
|
399
|
+
}, le = {
|
|
379
400
|
id: "sheet.command.sort-range-desc-ctx",
|
|
380
|
-
type:
|
|
381
|
-
handler:
|
|
382
|
-
},
|
|
401
|
+
type: R.COMMAND,
|
|
402
|
+
handler: async (e) => await e.get(g).triggerSortDirectly(!1, !1)
|
|
403
|
+
}, de = {
|
|
383
404
|
id: "sheet.command.sort-range-desc-ext-ctx",
|
|
384
|
-
type:
|
|
385
|
-
handler:
|
|
386
|
-
},
|
|
405
|
+
type: R.COMMAND,
|
|
406
|
+
handler: async (e) => await e.get(g).triggerSortDirectly(!1, !0)
|
|
407
|
+
}, ue = {
|
|
387
408
|
id: "sheet.command.sort-range-custom-ctx",
|
|
388
|
-
type:
|
|
389
|
-
handler:
|
|
409
|
+
type: R.COMMAND,
|
|
410
|
+
handler: async (e) => await e.get(g).triggerSortCustomize()
|
|
390
411
|
};
|
|
391
|
-
function
|
|
392
|
-
const
|
|
393
|
-
if (!
|
|
412
|
+
function On() {
|
|
413
|
+
const e = O(g), t = O(Me), n = O(H), [r, o] = A(!1), [s, c] = A(0), l = be(null), u = e.customSortState();
|
|
414
|
+
if (!u || !u.location)
|
|
394
415
|
return null;
|
|
395
|
-
const { range, unitId, subUnitId } =
|
|
396
|
-
{ type:
|
|
397
|
-
]),
|
|
398
|
-
const
|
|
399
|
-
|
|
400
|
-
}, [
|
|
401
|
-
|
|
402
|
-
const
|
|
403
|
-
|
|
416
|
+
const { range: m, unitId: y, subUnitId: S } = u.location, E = e.getTitles(r), [C, $] = A([
|
|
417
|
+
{ type: k.ASC, colIndex: m.startColumn }
|
|
418
|
+
]), Y = P((d, p) => {
|
|
419
|
+
const U = [...C];
|
|
420
|
+
p === null ? U.splice(d, 1) : U[d] = p, $(U);
|
|
421
|
+
}, [C]), F = P(
|
|
422
|
+
Xe(() => {
|
|
423
|
+
const d = [...C], p = Pn(m, C);
|
|
424
|
+
p !== null && (d.push({ type: k.ASC, colIndex: p }), $(d));
|
|
404
425
|
}, 200),
|
|
405
|
-
[
|
|
406
|
-
),
|
|
407
|
-
|
|
408
|
-
}, [
|
|
409
|
-
|
|
410
|
-
}, [
|
|
411
|
-
|
|
412
|
-
}, [
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
}, [
|
|
416
|
-
const
|
|
417
|
-
return /* @__PURE__ */
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
426
|
+
[C, m]
|
|
427
|
+
), h = P((d, p) => {
|
|
428
|
+
t.applySort({ range: m, orderRules: d, hasTitle: p }), e.closeCustomSortPanel();
|
|
429
|
+
}, [t, e, m]), X = P(() => {
|
|
430
|
+
e.closeCustomSortPanel();
|
|
431
|
+
}, [e]), Ve = P((d) => {
|
|
432
|
+
o(d), d ? e.setSelection(y, S, { ...m, startRow: m.startRow + 1 }) : e.setSelection(y, S, m);
|
|
433
|
+
}, [e, m, S, y]);
|
|
434
|
+
Ee(() => {
|
|
435
|
+
l.current && C.length > 5 && (l.current.scrollTop = l.current.scrollHeight);
|
|
436
|
+
}, [C]);
|
|
437
|
+
const ze = C.length < E.length, Se = C.map((d) => ({ ...d, id: `${d.colIndex}` }));
|
|
438
|
+
return /* @__PURE__ */ i.jsxs("div", { className: a.customSortPanelContainer, children: [
|
|
439
|
+
/* @__PURE__ */ i.jsxs("div", { className: a.customSortPanelContent, onMouseDown: (d) => {
|
|
440
|
+
d.stopPropagation();
|
|
441
|
+
}, children: [
|
|
442
|
+
/* @__PURE__ */ i.jsxs("div", { className: a.customSortPanelExt, children: [
|
|
443
|
+
/* @__PURE__ */ i.jsx("div", { className: a.firstRowCheck, children: /* @__PURE__ */ i.jsx(Mt, { checked: r, onChange: (d) => Ve(!!d), children: n.t("sheets-sort.dialog.first-row-check") }) }),
|
|
444
|
+
ze ? /* @__PURE__ */ i.jsxs("div", { className: a.addCondition, onClick: F, children: [
|
|
445
|
+
/* @__PURE__ */ i.jsx(Q, {}),
|
|
446
|
+
/* @__PURE__ */ i.jsx("span", { className: a.addConditionText, children: n.t("sheets-sort.dialog.add-condition") })
|
|
447
|
+
] }) : /* @__PURE__ */ i.jsxs("div", { className: `${a.addCondition} ${a.addConditionDisable}`, children: [
|
|
448
|
+
/* @__PURE__ */ i.jsx(Q, {}),
|
|
449
|
+
/* @__PURE__ */ i.jsx("span", { className: a.addConditionText, children: n.t("sheets-sort.dialog.add-condition") })
|
|
450
|
+
] })
|
|
451
|
+
] }),
|
|
452
|
+
/* @__PURE__ */ i.jsx(
|
|
453
|
+
"div",
|
|
454
|
+
{
|
|
455
|
+
className: a.conditionList,
|
|
456
|
+
onScroll: (d) => {
|
|
457
|
+
const p = d.currentTarget.scrollTop;
|
|
458
|
+
c(p);
|
|
459
|
+
},
|
|
460
|
+
ref: l,
|
|
461
|
+
children: /* @__PURE__ */ i.jsx(
|
|
462
|
+
Rt,
|
|
463
|
+
{
|
|
464
|
+
list: Se,
|
|
465
|
+
onListChange: $,
|
|
466
|
+
idKey: "id",
|
|
467
|
+
draggableHandle: `.${a.customSortPanelItemHandler}`,
|
|
468
|
+
itemRender: (d) => /* @__PURE__ */ i.jsx(
|
|
469
|
+
Tn,
|
|
470
|
+
{
|
|
471
|
+
titles: E,
|
|
472
|
+
list: Se,
|
|
473
|
+
item: d,
|
|
474
|
+
onChange: (p, U) => Y(U, p),
|
|
475
|
+
scrollPosition: s
|
|
476
|
+
}
|
|
477
|
+
),
|
|
478
|
+
rowHeight: 32,
|
|
479
|
+
margin: [0, 12]
|
|
480
|
+
}
|
|
481
|
+
)
|
|
482
|
+
}
|
|
483
|
+
)
|
|
484
|
+
] }),
|
|
485
|
+
/* @__PURE__ */ i.jsxs("div", { className: a.customSortPanelFooter, children: [
|
|
486
|
+
/* @__PURE__ */ i.jsx(ve, { className: a.customSortPanelFooterBtn, type: "default", onClick: () => X(), children: n.t("sheets-sort.dialog.cancel") }),
|
|
487
|
+
/* @__PURE__ */ i.jsx(ve, { className: a.customSortPanelFooterBtn, type: "primary", onClick: () => h(C, r), children: n.t("sheets-sort.dialog.confirm") })
|
|
488
|
+
] })
|
|
489
|
+
] });
|
|
451
490
|
}
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
trigger: ["click"],
|
|
469
|
-
visible,
|
|
470
|
-
onVisibleChange,
|
|
471
|
-
overlay: /* @__PURE__ */ React.createElement("ul", { className: styles.customSortColMenu }, availableMenu.map((menuItem) => /* @__PURE__ */ React.createElement(
|
|
472
|
-
"li",
|
|
491
|
+
function Tn(e) {
|
|
492
|
+
var F;
|
|
493
|
+
const { list: t, item: n, titles: r, onChange: o, scrollPosition: s } = e, c = O(H), l = r.filter((h) => !t.some((X) => X.colIndex === h.index) || h.index === n.colIndex), u = t.findIndex((h) => h.colIndex === n.colIndex), m = P((h) => {
|
|
494
|
+
o({ ...n, colIndex: h.index }, u), S(!1);
|
|
495
|
+
}, [u, n, o]), [y, S] = A(!1), E = (h) => {
|
|
496
|
+
S(h);
|
|
497
|
+
};
|
|
498
|
+
Ee(() => {
|
|
499
|
+
S(!1);
|
|
500
|
+
}, [s]);
|
|
501
|
+
const C = t.length > 1, $ = (F = r.find((h) => h.index === n.colIndex)) == null ? void 0 : F.label, Y = c.getCurrentLocale() === J.ZH_CN ? a.customSortPanelItemOrderRadioCn : a.customSortPanelItemOrderRadio;
|
|
502
|
+
return /* @__PURE__ */ i.jsxs("div", { className: a.customSortPanelItem, children: [
|
|
503
|
+
/* @__PURE__ */ i.jsxs("div", { className: a.customSortPanelItemHead, children: [
|
|
504
|
+
/* @__PURE__ */ i.jsx("div", { className: a.customSortPanelItemHandler, children: /* @__PURE__ */ i.jsx(ke, {}) }),
|
|
505
|
+
/* @__PURE__ */ i.jsx("div", { className: a.customSortPanelItemColumn, children: /* @__PURE__ */ i.jsx(
|
|
506
|
+
bt,
|
|
473
507
|
{
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
508
|
+
placement: "bottomLeft",
|
|
509
|
+
trigger: ["click"],
|
|
510
|
+
visible: y,
|
|
511
|
+
onVisibleChange: E,
|
|
512
|
+
overlay: /* @__PURE__ */ i.jsx("ul", { className: a.customSortColMenu, children: l.map((h) => /* @__PURE__ */ i.jsxs(
|
|
513
|
+
"li",
|
|
514
|
+
{
|
|
515
|
+
onClick: () => m(h),
|
|
516
|
+
className: a.customSortColMenuItem,
|
|
517
|
+
children: [
|
|
518
|
+
/* @__PURE__ */ i.jsx("span", { className: a.customSortColMenuItemDesc, children: h.label }),
|
|
519
|
+
/* @__PURE__ */ i.jsx("span", { className: a.customSortColMenuItemCheck, children: h.index === n.colIndex && /* @__PURE__ */ i.jsx(Pe, {}) })
|
|
520
|
+
]
|
|
521
|
+
},
|
|
522
|
+
h.index
|
|
523
|
+
)) }),
|
|
524
|
+
children: /* @__PURE__ */ i.jsxs("div", { className: a.customSortPanelItemColumnInput, children: [
|
|
525
|
+
/* @__PURE__ */ i.jsx("span", { className: a.customSortPanelItemColumnInputText, children: $ }),
|
|
526
|
+
/* @__PURE__ */ i.jsx(De, { className: a.customSortPanelItemColumnInputDropdown })
|
|
527
|
+
] })
|
|
528
|
+
}
|
|
529
|
+
) })
|
|
530
|
+
] }),
|
|
531
|
+
/* @__PURE__ */ i.jsx("div", { className: a.customSortPanelItemOrder, children: /* @__PURE__ */ i.jsxs(
|
|
532
|
+
Oe,
|
|
533
|
+
{
|
|
534
|
+
className: Y,
|
|
535
|
+
value: n.type,
|
|
536
|
+
onChange: (h) => {
|
|
537
|
+
o({ ...n, type: h }, u);
|
|
477
538
|
},
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
className: radioClass,
|
|
487
|
-
value: item.type,
|
|
488
|
-
onChange: /* @__PURE__ */ __name((value) => {
|
|
489
|
-
onChange({ ...item, type: value }, currentIndex);
|
|
490
|
-
}, "onChange")
|
|
491
|
-
},
|
|
492
|
-
/* @__PURE__ */ React.createElement(Radio, { value: SortType.ASC }, localeService.t("sheets-sort.general.sort-asc")),
|
|
493
|
-
/* @__PURE__ */ React.createElement(Radio, { value: SortType.DESC }, localeService.t("sheets-sort.general.sort-desc"))
|
|
494
|
-
)), /* @__PURE__ */ React.createElement("div", { className: styles.customSortPanelItemRemove }, showDelete && /* @__PURE__ */ React.createElement(DeleteEmptySingle, { onClick: /* @__PURE__ */ __name(() => onChange(null, currentIndex), "onClick") })));
|
|
539
|
+
children: [
|
|
540
|
+
/* @__PURE__ */ i.jsx(z, { value: k.ASC, children: c.t("sheets-sort.general.sort-asc") }),
|
|
541
|
+
/* @__PURE__ */ i.jsx(z, { value: k.DESC, children: c.t("sheets-sort.general.sort-desc") })
|
|
542
|
+
]
|
|
543
|
+
}
|
|
544
|
+
) }),
|
|
545
|
+
/* @__PURE__ */ i.jsx("div", { className: a.customSortPanelItemRemove, children: C && /* @__PURE__ */ i.jsx(Ne, { onClick: () => o(null, u) }) })
|
|
546
|
+
] });
|
|
495
547
|
}
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
return i;
|
|
548
|
+
function Pn(e, t) {
|
|
549
|
+
const { startColumn: n, endColumn: r } = e, o = new Set(t.map((s) => s == null ? void 0 : s.colIndex));
|
|
550
|
+
for (let s = n; s <= r; s++)
|
|
551
|
+
if (!o.has(s))
|
|
552
|
+
return s;
|
|
502
553
|
return null;
|
|
503
554
|
}
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
sheetsSortUIService.triggerSortDirectly(asc, !1, { unitId, subUnitId, range: noTitleRange, colIndex });
|
|
555
|
+
function wn(e) {
|
|
556
|
+
const { range: t, colIndex: n, onClose: r } = e, o = O(g), s = O(xe), c = O(H), l = P((u) => {
|
|
557
|
+
const { unitId: m, subUnitId: y } = yt(s) || {};
|
|
558
|
+
if (t && m && y) {
|
|
559
|
+
const S = { ...t, startRow: t.startRow + 1 };
|
|
560
|
+
o.triggerSortDirectly(u, !1, { unitId: m, subUnitId: y, range: S, colIndex: n });
|
|
511
561
|
} else
|
|
512
|
-
console.warn(`Cannot find the target to sort. unitId: ${
|
|
513
|
-
|
|
514
|
-
}, [
|
|
515
|
-
return /* @__PURE__ */
|
|
562
|
+
console.warn(`Cannot find the target to sort. unitId: ${m}, subUnitId: ${y}, range: ${t}, colIndex: ${n}`);
|
|
563
|
+
r();
|
|
564
|
+
}, [t, n, o, s, r]);
|
|
565
|
+
return /* @__PURE__ */ i.jsxs("div", { className: a.embedSortBtnContainer, children: [
|
|
566
|
+
/* @__PURE__ */ i.jsxs("div", { className: `${a.embedSortBtn} ${a.embedSortBtnAsc}`, onClick: () => l(!0), children: [
|
|
567
|
+
/* @__PURE__ */ i.jsx(ee, { className: a.embedSortBtnIcon }),
|
|
568
|
+
c.t("sheets-sort.general.sort-asc")
|
|
569
|
+
] }),
|
|
570
|
+
/* @__PURE__ */ i.jsxs("div", { className: `${a.embedSortBtn} ${a.embedSortBtnDesc}`, onClick: () => l(!1), children: [
|
|
571
|
+
/* @__PURE__ */ i.jsx(te, { className: a.embedSortBtnIcon }),
|
|
572
|
+
c.t("sheets-sort.general.sort-desc")
|
|
573
|
+
] })
|
|
574
|
+
] });
|
|
516
575
|
}
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
function sortRangeMenuFactory(accessor) {
|
|
576
|
+
const Ue = "sheet.menu.sheets-sort", Ae = "sheet.menu.sheets-sort-ctx", B = "AscendingSingle", me = "ExpandAscendingSingle", he = "DescendingSingle", ge = "ExpandDescendingSingle", Ce = "CustomSortSingle";
|
|
577
|
+
function Nn(e) {
|
|
520
578
|
return {
|
|
521
|
-
id:
|
|
522
|
-
type:
|
|
523
|
-
icon:
|
|
579
|
+
id: Ue,
|
|
580
|
+
type: v.SUBITEMS,
|
|
581
|
+
icon: B,
|
|
524
582
|
tooltip: "sheets-sort.general.sort",
|
|
525
|
-
hidden$:
|
|
526
|
-
disabled$:
|
|
583
|
+
hidden$: Re(e, W.UNIVER_SHEET),
|
|
584
|
+
disabled$: w(e, { workbookTypes: [N], worksheetTypes: [L, j], rangeTypes: [D] })
|
|
527
585
|
};
|
|
528
586
|
}
|
|
529
|
-
|
|
530
|
-
function sortRangeAscMenuFactory(_accessor) {
|
|
587
|
+
function Ln(e) {
|
|
531
588
|
return {
|
|
532
|
-
id:
|
|
533
|
-
icon:
|
|
589
|
+
id: ne.id,
|
|
590
|
+
icon: B,
|
|
534
591
|
title: "sheets-sort.general.sort-asc-cur",
|
|
535
|
-
type:
|
|
536
|
-
hidden$:
|
|
592
|
+
type: v.BUTTON,
|
|
593
|
+
hidden$: st(e)
|
|
537
594
|
};
|
|
538
595
|
}
|
|
539
|
-
|
|
540
|
-
function sortRangeAscExtMenuFactory(_accessor) {
|
|
596
|
+
function jn(e) {
|
|
541
597
|
return {
|
|
542
|
-
id:
|
|
598
|
+
id: re.id,
|
|
543
599
|
title: "sheets-sort.general.sort-asc-ext",
|
|
544
|
-
icon:
|
|
545
|
-
type:
|
|
600
|
+
icon: me,
|
|
601
|
+
type: v.BUTTON
|
|
546
602
|
};
|
|
547
603
|
}
|
|
548
|
-
|
|
549
|
-
function sortRangeDescMenuFactory(_accessor) {
|
|
604
|
+
function Dn(e) {
|
|
550
605
|
return {
|
|
551
|
-
id:
|
|
606
|
+
id: oe.id,
|
|
552
607
|
title: "sheets-sort.general.sort-desc-cur",
|
|
553
|
-
icon:
|
|
554
|
-
type:
|
|
608
|
+
icon: he,
|
|
609
|
+
type: v.BUTTON
|
|
555
610
|
};
|
|
556
611
|
}
|
|
557
|
-
|
|
558
|
-
function sortRangeDescExtMenuFactory(_accessor) {
|
|
612
|
+
function kn(e) {
|
|
559
613
|
return {
|
|
560
|
-
id:
|
|
614
|
+
id: se.id,
|
|
561
615
|
title: "sheets-sort.general.sort-desc-ext",
|
|
562
|
-
icon:
|
|
563
|
-
type:
|
|
616
|
+
icon: ge,
|
|
617
|
+
type: v.BUTTON
|
|
564
618
|
};
|
|
565
619
|
}
|
|
566
|
-
|
|
567
|
-
function sortRangeCustomMenuFactory(_accessor) {
|
|
620
|
+
function Hn(e) {
|
|
568
621
|
return {
|
|
569
|
-
id:
|
|
622
|
+
id: ie.id,
|
|
570
623
|
title: "sheets-sort.general.sort-custom",
|
|
571
|
-
type:
|
|
572
|
-
icon:
|
|
624
|
+
type: v.BUTTON,
|
|
625
|
+
icon: Ce
|
|
573
626
|
};
|
|
574
627
|
}
|
|
575
|
-
|
|
576
|
-
function sortRangeCtxMenuFactory(accessor) {
|
|
628
|
+
function $n(e) {
|
|
577
629
|
return {
|
|
578
|
-
id:
|
|
630
|
+
id: Ae,
|
|
579
631
|
title: "sheets-sort.general.sort",
|
|
580
|
-
type:
|
|
581
|
-
icon:
|
|
582
|
-
hidden$:
|
|
583
|
-
disabled$:
|
|
584
|
-
workbookTypes: [
|
|
585
|
-
worksheetTypes: [
|
|
586
|
-
rangeTypes: [
|
|
632
|
+
type: v.SUBITEMS,
|
|
633
|
+
icon: B,
|
|
634
|
+
hidden$: Re(e, W.UNIVER_SHEET),
|
|
635
|
+
disabled$: w(e, {
|
|
636
|
+
workbookTypes: [N],
|
|
637
|
+
worksheetTypes: [L, j],
|
|
638
|
+
rangeTypes: [D]
|
|
587
639
|
})
|
|
588
640
|
};
|
|
589
641
|
}
|
|
590
|
-
|
|
591
|
-
function sortRangeAscCtxMenuFactory(_accessor) {
|
|
642
|
+
function Un(e) {
|
|
592
643
|
return {
|
|
593
|
-
id:
|
|
644
|
+
id: ce.id,
|
|
594
645
|
title: "sheets-sort.general.sort-asc-cur",
|
|
595
|
-
type:
|
|
596
|
-
icon:
|
|
597
|
-
disabled$:
|
|
646
|
+
type: v.BUTTON,
|
|
647
|
+
icon: B,
|
|
648
|
+
disabled$: w(e, { workbookTypes: [N], worksheetTypes: [L, j], rangeTypes: [D] })
|
|
598
649
|
};
|
|
599
650
|
}
|
|
600
|
-
|
|
601
|
-
function sortRangeAscExtCtxMenuFactory(_accessor) {
|
|
651
|
+
function An(e) {
|
|
602
652
|
return {
|
|
603
|
-
id:
|
|
653
|
+
id: ae.id,
|
|
604
654
|
title: "sheets-sort.general.sort-asc-ext",
|
|
605
|
-
type:
|
|
606
|
-
icon:
|
|
607
|
-
disabled$:
|
|
655
|
+
type: v.BUTTON,
|
|
656
|
+
icon: me,
|
|
657
|
+
disabled$: w(e, { workbookTypes: [N], worksheetTypes: [L, j], rangeTypes: [D] })
|
|
608
658
|
};
|
|
609
659
|
}
|
|
610
|
-
|
|
611
|
-
function sortRangeDescCtxMenuFactory(_accessor) {
|
|
660
|
+
function Bn(e) {
|
|
612
661
|
return {
|
|
613
|
-
id:
|
|
662
|
+
id: le.id,
|
|
614
663
|
title: "sheets-sort.general.sort-desc-cur",
|
|
615
|
-
type:
|
|
616
|
-
icon:
|
|
617
|
-
disabled$:
|
|
664
|
+
type: v.BUTTON,
|
|
665
|
+
icon: he,
|
|
666
|
+
disabled$: w(e, { workbookTypes: [N], worksheetTypes: [L, j], rangeTypes: [D] })
|
|
618
667
|
};
|
|
619
668
|
}
|
|
620
|
-
|
|
621
|
-
function sortRangeDescExtCtxMenuFactory(_accessor) {
|
|
669
|
+
function Fn(e) {
|
|
622
670
|
return {
|
|
623
|
-
id:
|
|
671
|
+
id: de.id,
|
|
624
672
|
title: "sheets-sort.general.sort-desc-ext",
|
|
625
|
-
type:
|
|
626
|
-
icon:
|
|
627
|
-
disabled$:
|
|
673
|
+
type: v.BUTTON,
|
|
674
|
+
icon: ge,
|
|
675
|
+
disabled$: w(e, { workbookTypes: [N], worksheetTypes: [L, j], rangeTypes: [D] })
|
|
628
676
|
};
|
|
629
677
|
}
|
|
630
|
-
|
|
631
|
-
function sortRangeCustomCtxMenuFactory(_accessor) {
|
|
678
|
+
function Vn(e) {
|
|
632
679
|
return {
|
|
633
|
-
id:
|
|
680
|
+
id: ue.id,
|
|
634
681
|
title: "sheets-sort.general.sort-custom",
|
|
635
|
-
type:
|
|
636
|
-
icon:
|
|
637
|
-
disabled$:
|
|
682
|
+
type: v.BUTTON,
|
|
683
|
+
icon: Ce,
|
|
684
|
+
disabled$: w(e, { workbookTypes: [N], worksheetTypes: [L, j], rangeTypes: [D] })
|
|
638
685
|
};
|
|
639
686
|
}
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
[SHEETS_SORT_MENU_ID]: {
|
|
687
|
+
const zn = {
|
|
688
|
+
[lt.FORMULAS_INSERT]: {
|
|
689
|
+
[Ue]: {
|
|
644
690
|
order: 2,
|
|
645
|
-
menuItemFactory:
|
|
646
|
-
[
|
|
691
|
+
menuItemFactory: Nn,
|
|
692
|
+
[ne.id]: {
|
|
647
693
|
order: 0,
|
|
648
|
-
menuItemFactory:
|
|
694
|
+
menuItemFactory: Ln
|
|
649
695
|
},
|
|
650
|
-
[
|
|
696
|
+
[re.id]: {
|
|
651
697
|
order: 1,
|
|
652
|
-
menuItemFactory:
|
|
698
|
+
menuItemFactory: jn
|
|
653
699
|
},
|
|
654
|
-
[
|
|
700
|
+
[oe.id]: {
|
|
655
701
|
order: 2,
|
|
656
|
-
menuItemFactory:
|
|
702
|
+
menuItemFactory: Dn
|
|
657
703
|
},
|
|
658
|
-
[
|
|
704
|
+
[se.id]: {
|
|
659
705
|
order: 3,
|
|
660
|
-
menuItemFactory:
|
|
706
|
+
menuItemFactory: kn
|
|
661
707
|
},
|
|
662
|
-
[
|
|
708
|
+
[ie.id]: {
|
|
663
709
|
order: 4,
|
|
664
|
-
menuItemFactory:
|
|
710
|
+
menuItemFactory: Hn
|
|
665
711
|
}
|
|
666
712
|
}
|
|
667
713
|
},
|
|
668
|
-
[
|
|
669
|
-
[
|
|
670
|
-
[
|
|
714
|
+
[dt.MAIN_AREA]: {
|
|
715
|
+
[ut.DATA]: {
|
|
716
|
+
[Ae]: {
|
|
671
717
|
order: 0,
|
|
672
|
-
menuItemFactory:
|
|
673
|
-
[
|
|
718
|
+
menuItemFactory: $n,
|
|
719
|
+
[ce.id]: {
|
|
674
720
|
order: 0,
|
|
675
|
-
menuItemFactory:
|
|
721
|
+
menuItemFactory: Un
|
|
676
722
|
},
|
|
677
|
-
[
|
|
723
|
+
[ae.id]: {
|
|
678
724
|
order: 1,
|
|
679
|
-
menuItemFactory:
|
|
725
|
+
menuItemFactory: An
|
|
680
726
|
},
|
|
681
|
-
[
|
|
727
|
+
[le.id]: {
|
|
682
728
|
order: 2,
|
|
683
|
-
menuItemFactory:
|
|
729
|
+
menuItemFactory: Bn
|
|
684
730
|
},
|
|
685
|
-
[
|
|
731
|
+
[de.id]: {
|
|
686
732
|
order: 3,
|
|
687
|
-
menuItemFactory:
|
|
733
|
+
menuItemFactory: Fn
|
|
688
734
|
},
|
|
689
|
-
[
|
|
735
|
+
[ue.id]: {
|
|
690
736
|
order: 4,
|
|
691
|
-
menuItemFactory:
|
|
737
|
+
menuItemFactory: Vn
|
|
692
738
|
}
|
|
693
739
|
}
|
|
694
740
|
}
|
|
695
741
|
}
|
|
696
742
|
};
|
|
697
|
-
var
|
|
698
|
-
for (var
|
|
699
|
-
(
|
|
700
|
-
return
|
|
701
|
-
},
|
|
702
|
-
const
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
super(), this._commandService = _commandService, this._menuManagerService = _menuManagerService, this._dialogService = _dialogService, this._layoutService = _layoutService, this._uiPartsService = _uiPartsService, this._sheetRenderService = _sheetRenderService, this._localeService = _localeService, this._sheetsSortUIService = _sheetsSortUIService, this._injector = _injector, this._componentManager = _componentManager, this._initCommands(), this._initMenu(), this._initUI();
|
|
743
|
+
var Zn = Object.defineProperty, Gn = Object.getOwnPropertyDescriptor, Wn = (e, t, n, r) => {
|
|
744
|
+
for (var o = r > 1 ? void 0 : r ? Gn(t, n) : t, s = e.length - 1, c; s >= 0; s--)
|
|
745
|
+
(c = e[s]) && (o = (r ? c(t, n, o) : c(o)) || o);
|
|
746
|
+
return r && o && Zn(t, n, o), o;
|
|
747
|
+
}, M = (e, t) => (n, r) => t(n, r, e);
|
|
748
|
+
const pe = "custom-sort-dialog", qn = 560;
|
|
749
|
+
let Z = class extends Ke {
|
|
750
|
+
constructor(e, t, n, r, o, s, c, l, u, m) {
|
|
751
|
+
super(), this._commandService = e, this._menuManagerService = t, this._dialogService = n, this._layoutService = r, this._uiPartsService = o, this._sheetRenderService = s, this._localeService = c, this._sheetsSortUIService = l, this._injector = u, this._componentManager = m, this._initCommands(), this._initMenu(), this._initUI();
|
|
707
752
|
}
|
|
708
753
|
_initMenu() {
|
|
709
|
-
this._menuManagerService.mergeMenu(
|
|
754
|
+
this._menuManagerService.mergeMenu(zn);
|
|
710
755
|
}
|
|
711
756
|
_initCommands() {
|
|
712
757
|
[
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
].forEach((
|
|
758
|
+
ne,
|
|
759
|
+
re,
|
|
760
|
+
oe,
|
|
761
|
+
se,
|
|
762
|
+
ie,
|
|
763
|
+
ce,
|
|
764
|
+
ae,
|
|
765
|
+
le,
|
|
766
|
+
de,
|
|
767
|
+
ue
|
|
768
|
+
].forEach((e) => this.disposeWithMe(this._commandService.registerCommand(e))), this.disposeWithMe(this._sheetRenderService.registerSkeletonChangingMutations(nt.id));
|
|
724
769
|
}
|
|
725
770
|
_initUI() {
|
|
726
|
-
this.disposeWithMe(this._componentManager.register("CustomSortPanel",
|
|
727
|
-
|
|
771
|
+
this.disposeWithMe(this._componentManager.register("CustomSortPanel", On)), this.disposeWithMe(this._uiPartsService.registerComponent(ct.FILTER_PANEL_EMBED_POINT, () => Je(wn, this._injector))), this.disposeWithMe(this._componentManager.register(B, ee)), this.disposeWithMe(this._componentManager.register(me, Le)), this.disposeWithMe(this._componentManager.register(he, te)), this.disposeWithMe(this._componentManager.register(ge, je)), this.disposeWithMe(this._componentManager.register(Ce, we)), this._sheetsSortUIService.customSortState$.pipe(vt(this.dispose$)).subscribe((e) => {
|
|
772
|
+
e && e.show && e.location ? this._openCustomSortPanel(e.location) : e && !(e != null && e.show) && this._closePanel();
|
|
728
773
|
});
|
|
729
774
|
}
|
|
730
|
-
_openCustomSortPanel(
|
|
775
|
+
_openCustomSortPanel(e) {
|
|
731
776
|
this._dialogService.open({
|
|
732
|
-
id:
|
|
777
|
+
id: pe,
|
|
733
778
|
draggable: !0,
|
|
734
|
-
width:
|
|
735
|
-
title: { title: `${this._localeService.t("sheets-sort.general.sort-custom")}: ${
|
|
779
|
+
width: qn,
|
|
780
|
+
title: { title: `${this._localeService.t("sheets-sort.general.sort-custom")}: ${ot(e.range)}` },
|
|
736
781
|
children: { label: "CustomSortPanel" },
|
|
737
782
|
destroyOnClose: !0,
|
|
738
|
-
defaultPosition:
|
|
783
|
+
defaultPosition: Yn(),
|
|
739
784
|
preservePositionOnDestroy: !1,
|
|
740
|
-
onClose:
|
|
785
|
+
onClose: () => this._closePanel(),
|
|
741
786
|
mask: !0
|
|
742
787
|
});
|
|
743
788
|
}
|
|
744
789
|
_closePanel() {
|
|
745
|
-
this._dialogService.close(
|
|
790
|
+
this._dialogService.close(pe), queueMicrotask(() => this._layoutService.focus());
|
|
746
791
|
}
|
|
747
|
-
}
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
],
|
|
760
|
-
function
|
|
792
|
+
};
|
|
793
|
+
Z = Wn([
|
|
794
|
+
M(0, Ie),
|
|
795
|
+
M(1, ht),
|
|
796
|
+
M(2, gt),
|
|
797
|
+
M(3, Ct),
|
|
798
|
+
M(4, St),
|
|
799
|
+
M(5, b(it)),
|
|
800
|
+
M(6, b(H)),
|
|
801
|
+
M(7, b(g)),
|
|
802
|
+
M(8, b(ye)),
|
|
803
|
+
M(9, b(mt))
|
|
804
|
+
], Z);
|
|
805
|
+
function Yn() {
|
|
761
806
|
return { x: 0, y: 0 };
|
|
762
807
|
}
|
|
763
|
-
|
|
764
|
-
var
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
const { ...rest } = this._config;
|
|
775
|
-
this._configService.setConfig(PLUGIN_CONFIG_KEY, rest);
|
|
808
|
+
var Be = Object.defineProperty, Xn = Object.getOwnPropertyDescriptor, Kn = (e, t, n) => t in e ? Be(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, Jn = (e, t, n, r) => {
|
|
809
|
+
for (var o = r > 1 ? void 0 : r ? Xn(t, n) : t, s = e.length - 1, c; s >= 0; s--)
|
|
810
|
+
(c = e[s]) && (o = (r ? c(t, n, o) : c(o)) || o);
|
|
811
|
+
return r && o && Be(t, n, o), o;
|
|
812
|
+
}, _e = (e, t) => (n, r) => t(n, r, e), Fe = (e, t, n) => Kn(e, typeof t != "symbol" ? t + "" : t, n);
|
|
813
|
+
const Qn = "SHEET_SORT_UI_PLUGIN";
|
|
814
|
+
let G = class extends et {
|
|
815
|
+
constructor(e = Ot, t, n) {
|
|
816
|
+
super(), this._config = e, this._injector = t, this._configService = n;
|
|
817
|
+
const { ...r } = this._config;
|
|
818
|
+
this._configService.setConfig(Et, r);
|
|
776
819
|
}
|
|
777
820
|
onStarting() {
|
|
778
821
|
[
|
|
779
|
-
[
|
|
780
|
-
[
|
|
781
|
-
].forEach((
|
|
822
|
+
[g],
|
|
823
|
+
[Z]
|
|
824
|
+
].forEach((e) => this._injector.add(e));
|
|
782
825
|
}
|
|
783
826
|
onRendered() {
|
|
784
|
-
this._injector.get(
|
|
827
|
+
this._injector.get(Z);
|
|
785
828
|
}
|
|
786
|
-
}
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
],
|
|
829
|
+
};
|
|
830
|
+
Fe(G, "type", W.UNIVER_SHEET);
|
|
831
|
+
Fe(G, "pluginName", Qn);
|
|
832
|
+
G = Jn([
|
|
833
|
+
Qe(rt),
|
|
834
|
+
_e(1, b(ye)),
|
|
835
|
+
_e(2, tt)
|
|
836
|
+
], G);
|
|
794
837
|
export {
|
|
795
|
-
SortRangeAscCommand,
|
|
796
|
-
SortRangeAscExtCommand,
|
|
797
|
-
SortRangeAscExtInCtxMenuCommand,
|
|
798
|
-
SortRangeAscInCtxMenuCommand,
|
|
799
|
-
SortRangeCustomCommand,
|
|
800
|
-
SortRangeCustomInCtxMenuCommand,
|
|
801
|
-
SortRangeDescCommand,
|
|
802
|
-
SortRangeDescExtCommand,
|
|
803
|
-
SortRangeDescExtInCtxMenuCommand,
|
|
804
|
-
SortRangeDescInCtxMenuCommand,
|
|
805
|
-
UniverSheetsSortUIPlugin
|
|
838
|
+
ne as SortRangeAscCommand,
|
|
839
|
+
re as SortRangeAscExtCommand,
|
|
840
|
+
ae as SortRangeAscExtInCtxMenuCommand,
|
|
841
|
+
ce as SortRangeAscInCtxMenuCommand,
|
|
842
|
+
ie as SortRangeCustomCommand,
|
|
843
|
+
ue as SortRangeCustomInCtxMenuCommand,
|
|
844
|
+
oe as SortRangeDescCommand,
|
|
845
|
+
se as SortRangeDescExtCommand,
|
|
846
|
+
de as SortRangeDescExtInCtxMenuCommand,
|
|
847
|
+
le as SortRangeDescInCtxMenuCommand,
|
|
848
|
+
G as UniverSheetsSortUIPlugin
|
|
806
849
|
};
|