@univerjs/sheets-sort-ui 0.5.5 → 0.6.0-experimental.20250125-1d060b9
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 +10 -18
- package/lib/es/index.js +433 -461
- package/lib/types/views/CustomSortPanel.d.ts +2 -3
- package/lib/types/views/EmbedSortBtn.d.ts +1 -2
- package/lib/types/views/ExtendConfirm.d.ts +16 -2
- package/lib/umd/index.js +4 -12
- package/package.json +12 -12
- package/LICENSE +0 -176
package/lib/es/index.js
CHANGED
|
@@ -1,253 +1,225 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { useDependency as O, LocaleService as
|
|
5
|
-
import { SheetsSortService as
|
|
6
|
-
import { serializeRange as
|
|
7
|
-
import { getCurrentRangeDisable$ as
|
|
8
|
-
import { IConfirmService as
|
|
9
|
-
import { BehaviorSubject as
|
|
10
|
-
import
|
|
11
|
-
import { SheetsSelectionsService as
|
|
12
|
-
import { RadioGroup as
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
var ze = Object.defineProperty;
|
|
2
|
+
var Ze = (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) => Ze(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
+
import { useDependency as O, LocaleService as A, Inject as T, Disposable as Ge, UniverInstanceType as Y, IUniverInstanceService as ye, ILogService as We, ICommandService as Me, Tools as Ye, LocaleType as J, CommandType as b, throttle as qe, Injector as xe, RxDisposable as Xe, connectInjector as Ke, DependentOn as Je, Plugin as Qe, merge as et, IConfigService as tt } from "@univerjs/core";
|
|
5
|
+
import { SheetsSortService as Re, SortType as U, SortRangeCommand as nt, UniverSheetsSortPlugin as rt } from "@univerjs/sheets-sort";
|
|
6
|
+
import { serializeRange as ot } from "@univerjs/engine-formula";
|
|
7
|
+
import { getCurrentRangeDisable$ as N, getCurrentExclusiveRangeInterest$ as st, SheetsRenderService as it, SheetsUIPart as ct } from "@univerjs/sheets-ui";
|
|
8
|
+
import { IConfirmService as at, MenuItemType as v, getMenuHiddenObservable as be, 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 pt } from "rxjs";
|
|
10
|
+
import { jsxs as g, jsx as a } from "react/jsx-runtime";
|
|
11
|
+
import { SheetsSelectionsService as vt, getPrimaryForRange as _t, SetSelectionsOperation as It, expandToContinuousRange as fe, getSheetCommandTarget as yt, WorkbookEditablePermission as L, WorksheetSortPermission as D, WorksheetEditPermission as H, RangeProtectionPermissionEditPoint as k } from "@univerjs/sheets";
|
|
12
|
+
import { RadioGroup as Te, Radio as Z, Checkbox as Mt, DraggableList as xt, Button as pe, DropdownLegacy as Rt } from "@univerjs/design";
|
|
13
|
+
import { forwardRef as I, useRef as Ee, createElement as y, useState as F, useCallback as w, useEffect as Oe } from "react";
|
|
14
|
+
const bt = "sheets-sort-ui.config", ve = {};
|
|
15
|
+
var p = function() {
|
|
16
|
+
return p = Object.assign || function(e) {
|
|
16
17
|
for (var t, n = 1, r = arguments.length; n < r; n++) {
|
|
17
18
|
t = arguments[n];
|
|
18
19
|
for (var o in t) Object.prototype.hasOwnProperty.call(t, o) && (e[o] = t[o]);
|
|
19
20
|
}
|
|
20
21
|
return e;
|
|
21
|
-
},
|
|
22
|
-
},
|
|
22
|
+
}, p.apply(this, arguments);
|
|
23
|
+
}, Tt = function(e, t) {
|
|
23
24
|
var n = {};
|
|
24
25
|
for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
|
|
25
26
|
if (e != null && typeof Object.getOwnPropertySymbols == "function")
|
|
26
27
|
for (var o = 0, r = Object.getOwnPropertySymbols(e); o < r.length; o++)
|
|
27
28
|
t.indexOf(r[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[o]) && (n[r[o]] = e[r[o]]);
|
|
28
29
|
return n;
|
|
29
|
-
},
|
|
30
|
-
var n = e.icon, r = e.id, o = e.className, s = e.extend,
|
|
31
|
-
return
|
|
30
|
+
}, M = I(function(e, t) {
|
|
31
|
+
var n = e.icon, r = e.id, o = e.className, s = e.extend, i = Tt(e, ["icon", "id", "className", "extend"]), l = "univerjs-icon univerjs-icon-".concat(r, " ").concat(o || "").trim(), u = Ee("_".concat(Pt()));
|
|
32
|
+
return Pe(n, "".concat(r), { defIds: n.defIds, idSuffix: u.current }, p({ ref: t, className: l }, i), s);
|
|
32
33
|
});
|
|
33
|
-
function
|
|
34
|
-
return y(e.tag,
|
|
35
|
-
return
|
|
34
|
+
function Pe(e, t, n, r, o) {
|
|
35
|
+
return y(e.tag, p(p({ key: t }, Et(e, n, o)), r), (Ot(e, n).children || []).map(function(s, i) {
|
|
36
|
+
return Pe(s, "".concat(t, "-").concat(e.tag, "-").concat(i), n, void 0, o);
|
|
36
37
|
}));
|
|
37
38
|
}
|
|
38
|
-
function
|
|
39
|
-
var r =
|
|
39
|
+
function Et(e, t, n) {
|
|
40
|
+
var r = p({}, e.attrs);
|
|
40
41
|
n != null && n.colorChannel1 && r.fill === "colorChannel1" && (r.fill = n.colorChannel1);
|
|
41
42
|
var o = t.defIds;
|
|
42
43
|
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
|
|
44
|
-
typeof l == "string" && (r[
|
|
44
|
+
var i = s[0], l = s[1];
|
|
45
|
+
typeof l == "string" && (r[i] = l.replace(/url\(#(.*)\)/, "url(#$1".concat(t.idSuffix, ")")));
|
|
45
46
|
})), r;
|
|
46
47
|
}
|
|
47
|
-
function
|
|
48
|
+
function Ot(e, t) {
|
|
48
49
|
var n, r = t.defIds;
|
|
49
|
-
return !r || r.length === 0 ? e : e.tag === "defs" && (!((n = e.children) === null || n === void 0) && n.length) ?
|
|
50
|
-
return typeof o.attrs.id == "string" && r && r.indexOf(o.attrs.id) > -1 ?
|
|
50
|
+
return !r || r.length === 0 ? e : e.tag === "defs" && (!((n = e.children) === null || n === void 0) && n.length) ? p(p({}, e), { children: e.children.map(function(o) {
|
|
51
|
+
return typeof o.attrs.id == "string" && r && r.indexOf(o.attrs.id) > -1 ? p(p({}, o), { attrs: p(p({}, o.attrs), { id: o.attrs.id + t.idSuffix }) }) : o;
|
|
51
52
|
}) }) : e;
|
|
52
53
|
}
|
|
53
|
-
function
|
|
54
|
+
function Pt() {
|
|
54
55
|
return Math.random().toString(36).substring(2, 8);
|
|
55
56
|
}
|
|
56
|
-
|
|
57
|
-
var
|
|
58
|
-
return y(
|
|
57
|
+
M.displayName = "UniverIcon";
|
|
58
|
+
var wt = { 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 = I(function(e, t) {
|
|
59
|
+
return y(M, Object.assign({}, e, {
|
|
59
60
|
id: "ascending- single",
|
|
60
61
|
ref: t,
|
|
61
|
-
icon:
|
|
62
|
+
icon: wt
|
|
62
63
|
}));
|
|
63
64
|
});
|
|
64
|
-
|
|
65
|
-
var
|
|
66
|
-
return y(
|
|
65
|
+
ee.displayName = "AscendingSingle";
|
|
66
|
+
var Nt = { 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" } }] }, we = I(function(e, t) {
|
|
67
|
+
return y(M, Object.assign({}, e, {
|
|
67
68
|
id: "check-mark-single",
|
|
68
69
|
ref: t,
|
|
69
|
-
icon:
|
|
70
|
+
icon: Nt
|
|
70
71
|
}));
|
|
71
72
|
});
|
|
72
|
-
|
|
73
|
-
var
|
|
74
|
-
return y(
|
|
73
|
+
we.displayName = "CheckMarkSingle";
|
|
74
|
+
var Lt = { 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" } }] }, Ne = I(function(e, t) {
|
|
75
|
+
return y(M, Object.assign({}, e, {
|
|
75
76
|
id: "custom-sort-single",
|
|
76
77
|
ref: t,
|
|
77
|
-
icon:
|
|
78
|
+
icon: Lt
|
|
78
79
|
}));
|
|
79
80
|
});
|
|
80
|
-
|
|
81
|
-
var
|
|
82
|
-
return y(
|
|
81
|
+
Ne.displayName = "CustomSortSingle";
|
|
82
|
+
var Dt = { 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" } }] }, Le = I(function(e, t) {
|
|
83
|
+
return y(M, Object.assign({}, e, {
|
|
83
84
|
id: "delete-empty-single",
|
|
84
85
|
ref: t,
|
|
85
|
-
icon:
|
|
86
|
+
icon: Dt
|
|
86
87
|
}));
|
|
87
88
|
});
|
|
88
|
-
|
|
89
|
-
var
|
|
90
|
-
return y(
|
|
89
|
+
Le.displayName = "DeleteEmptySingle";
|
|
90
|
+
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 = I(function(e, t) {
|
|
91
|
+
return y(M, Object.assign({}, e, {
|
|
91
92
|
id: "descending-single",
|
|
92
93
|
ref: t,
|
|
93
|
-
icon:
|
|
94
|
+
icon: Ht
|
|
94
95
|
}));
|
|
95
96
|
});
|
|
96
|
-
|
|
97
|
-
var
|
|
98
|
-
return y(
|
|
97
|
+
te.displayName = "DescendingSingle";
|
|
98
|
+
var kt = { 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" } }] }, De = I(function(e, t) {
|
|
99
|
+
return y(M, Object.assign({}, e, {
|
|
99
100
|
id: "expand-ascending-single",
|
|
100
101
|
ref: t,
|
|
101
|
-
icon:
|
|
102
|
+
icon: kt
|
|
102
103
|
}));
|
|
103
104
|
});
|
|
104
|
-
|
|
105
|
-
var
|
|
106
|
-
return y(
|
|
105
|
+
De.displayName = "ExpandAscendingSingle";
|
|
106
|
+
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" } }] }, He = I(function(e, t) {
|
|
107
|
+
return y(M, Object.assign({}, e, {
|
|
107
108
|
id: "expand-descending-single",
|
|
108
109
|
ref: t,
|
|
109
|
-
icon:
|
|
110
|
+
icon: Ut
|
|
110
111
|
}));
|
|
111
112
|
});
|
|
112
|
-
|
|
113
|
-
var
|
|
114
|
-
return y(
|
|
113
|
+
He.displayName = "ExpandDescendingSingle";
|
|
114
|
+
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 = I(function(e, t) {
|
|
115
|
+
return y(M, Object.assign({}, e, {
|
|
115
116
|
id: "increase-single",
|
|
116
117
|
ref: t,
|
|
117
|
-
icon:
|
|
118
|
+
icon: At
|
|
118
119
|
}));
|
|
119
120
|
});
|
|
120
|
-
|
|
121
|
-
var
|
|
122
|
-
return y(
|
|
121
|
+
Q.displayName = "IncreaseSingle";
|
|
122
|
+
var $t = { 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" } }] }, ke = I(function(e, t) {
|
|
123
|
+
return y(M, Object.assign({}, e, {
|
|
123
124
|
id: "more-down-single",
|
|
124
125
|
ref: t,
|
|
125
|
-
icon:
|
|
126
|
+
icon: $t
|
|
126
127
|
}));
|
|
127
128
|
});
|
|
128
|
-
|
|
129
|
-
var
|
|
130
|
-
return y(
|
|
129
|
+
ke.displayName = "MoreDownSingle";
|
|
130
|
+
var Bt = { 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" } }] }] }, Ue = I(function(e, t) {
|
|
131
|
+
return y(M, Object.assign({}, e, {
|
|
131
132
|
id: "sequence-single",
|
|
132
133
|
ref: t,
|
|
133
|
-
icon:
|
|
134
|
+
icon: Bt
|
|
134
135
|
}));
|
|
135
136
|
});
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
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
|
-
const
|
|
167
|
-
extendConfirmContent:
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
addCondition: Xt,
|
|
172
|
-
addConditionText: Kt,
|
|
173
|
-
addConditionDisable: Qt,
|
|
174
|
-
customSortPanelFooter: en,
|
|
175
|
-
customSortPanelFooterBtn: tn,
|
|
176
|
-
customSortPanelItem: nn,
|
|
177
|
-
customSortPanelItemHead: rn,
|
|
178
|
-
customSortPanelItemHandler: on,
|
|
179
|
-
customSortPanelItemRemove: sn,
|
|
180
|
-
customSortPanelItemColumnInput: cn,
|
|
181
|
-
customSortPanelItemColumnInputDropdown: an,
|
|
182
|
-
customSortPanelItemColumnInputText: ln,
|
|
183
|
-
customSortPanelItemOrderRadio: dn,
|
|
184
|
-
customSortPanelItemOrderRadioCn: un,
|
|
185
|
-
conditionList: mn,
|
|
186
|
-
embedSortBtnContainer: hn,
|
|
187
|
-
embedSortBtn: gn,
|
|
188
|
-
embedSortBtnAsc: Cn,
|
|
189
|
-
embedSortBtnDesc: Sn,
|
|
190
|
-
embedSortBtnIcon: fn,
|
|
191
|
-
customSortColMenu: pn,
|
|
192
|
-
customSortColMenuItem: vn,
|
|
193
|
-
customSortColMenuItemDesc: _n
|
|
194
|
-
}, xn = (e) => {
|
|
195
|
-
const [t, n] = B("0"), r = O(H);
|
|
196
|
-
return /* @__PURE__ */ i.jsxs("div", { className: a.extendConfirmContent, children: [
|
|
197
|
-
/* @__PURE__ */ i.jsx("div", { className: "extend-confirm-desc", children: r.t("sheets-sort.dialog.sort-reminder-desc") }),
|
|
198
|
-
/* @__PURE__ */ i.jsxs(
|
|
199
|
-
Ne,
|
|
137
|
+
Ue.displayName = "SequenceSingle";
|
|
138
|
+
const Ft = "univer-extend-confirm-content", jt = "univer-extend-confirm-radio-group", Vt = "univer-custom-sort-panel-container", zt = "univer-custom-sort-panel-ext", Zt = "univer-add-condition", Gt = "univer-add-condition-text", Wt = "univer-add-condition-disable", Yt = "univer-custom-sort-panel-footer", qt = "univer-custom-sort-panel-footer-btn", Xt = "univer-custom-sort-panel-item", Kt = "univer-custom-sort-panel-item-head", Jt = "univer-custom-sort-panel-item-handler", Qt = "univer-custom-sort-panel-item-remove", en = "univer-custom-sort-panel-item-column-input", tn = "univer-custom-sort-panel-item-column-input-dropdown", nn = "univer-custom-sort-panel-item-column-input-text", rn = "univer-custom-sort-panel-item-order-radio", on = "univer-custom-sort-panel-item-order-radio-cn", sn = "univer-condition-list", cn = "univer-embed-sort-btn-container", an = "univer-embed-sort-btn", ln = "univer-embed-sort-btn-asc", dn = "univer-embed-sort-btn-desc", un = "univer-embed-sort-btn-icon", mn = "univer-custom-sort-col-menu", hn = "univer-custom-sort-col-menu-item", gn = "univer-custom-sort-col-menu-item-desc", c = {
|
|
139
|
+
extendConfirmContent: Ft,
|
|
140
|
+
extendConfirmRadioGroup: jt,
|
|
141
|
+
customSortPanelContainer: Vt,
|
|
142
|
+
customSortPanelExt: zt,
|
|
143
|
+
addCondition: Zt,
|
|
144
|
+
addConditionText: Gt,
|
|
145
|
+
addConditionDisable: Wt,
|
|
146
|
+
customSortPanelFooter: Yt,
|
|
147
|
+
customSortPanelFooterBtn: qt,
|
|
148
|
+
customSortPanelItem: Xt,
|
|
149
|
+
customSortPanelItemHead: Kt,
|
|
150
|
+
customSortPanelItemHandler: Jt,
|
|
151
|
+
customSortPanelItemRemove: Qt,
|
|
152
|
+
customSortPanelItemColumnInput: en,
|
|
153
|
+
customSortPanelItemColumnInputDropdown: tn,
|
|
154
|
+
customSortPanelItemColumnInputText: nn,
|
|
155
|
+
customSortPanelItemOrderRadio: rn,
|
|
156
|
+
customSortPanelItemOrderRadioCn: on,
|
|
157
|
+
conditionList: sn,
|
|
158
|
+
embedSortBtnContainer: cn,
|
|
159
|
+
embedSortBtn: an,
|
|
160
|
+
embedSortBtnAsc: ln,
|
|
161
|
+
embedSortBtnDesc: dn,
|
|
162
|
+
embedSortBtnIcon: un,
|
|
163
|
+
customSortColMenu: mn,
|
|
164
|
+
customSortColMenuItem: hn,
|
|
165
|
+
customSortColMenuItemDesc: gn
|
|
166
|
+
}, Cn = (e) => {
|
|
167
|
+
const [t, n] = F("0"), r = O(A);
|
|
168
|
+
return /* @__PURE__ */ g("div", { className: c.extendConfirmContent, children: [
|
|
169
|
+
/* @__PURE__ */ a("div", { className: "extend-confirm-desc", children: r.t("sheets-sort.dialog.sort-reminder-desc") }),
|
|
170
|
+
/* @__PURE__ */ g(
|
|
171
|
+
Te,
|
|
200
172
|
{
|
|
201
|
-
className:
|
|
173
|
+
className: c.extendConfirmRadioGroup,
|
|
202
174
|
value: t,
|
|
203
175
|
direction: "vertical",
|
|
204
176
|
onChange: (o) => {
|
|
205
177
|
n(o), e.onChange(o);
|
|
206
178
|
},
|
|
207
179
|
children: [
|
|
208
|
-
/* @__PURE__ */
|
|
180
|
+
/* @__PURE__ */ a(
|
|
209
181
|
Z,
|
|
210
182
|
{
|
|
211
183
|
value: "0",
|
|
212
184
|
children: r.t("sheets-sort.dialog.sort-reminder-no")
|
|
213
185
|
}
|
|
214
186
|
),
|
|
215
|
-
/* @__PURE__ */
|
|
187
|
+
/* @__PURE__ */ a(Z, { value: "1", children: r.t("sheets-sort.dialog.sort-reminder-ext") })
|
|
216
188
|
]
|
|
217
189
|
}
|
|
218
190
|
)
|
|
219
191
|
] });
|
|
220
192
|
};
|
|
221
|
-
var
|
|
222
|
-
for (var o = r > 1 ? void 0 : r ?
|
|
223
|
-
(
|
|
224
|
-
return r && o &&
|
|
225
|
-
},
|
|
193
|
+
var Sn = Object.defineProperty, fn = Object.getOwnPropertyDescriptor, pn = (e, t, n, r) => {
|
|
194
|
+
for (var o = r > 1 ? void 0 : r ? fn(t, n) : t, s = e.length - 1, i; s >= 0; s--)
|
|
195
|
+
(i = e[s]) && (o = (r ? i(t, n, o) : i(o)) || o);
|
|
196
|
+
return r && o && Sn(t, n, o), o;
|
|
197
|
+
}, P = (e, t) => (n, r) => t(n, r, e);
|
|
226
198
|
const z = {
|
|
227
199
|
MERGE_ERROR: "sheets-sort.error.merge-size",
|
|
228
200
|
EMPTY_ERROR: "sheets-sort.error.empty",
|
|
229
201
|
SINGLE_ERROR: "sheets-sort.error.single",
|
|
230
202
|
FORMULA_ARRAY: "sheets-sort.error.formula-array"
|
|
231
203
|
};
|
|
232
|
-
let
|
|
233
|
-
constructor(t, n, r, o, s,
|
|
204
|
+
let C = class extends Ge {
|
|
205
|
+
constructor(t, n, r, o, s, i, l) {
|
|
234
206
|
super();
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
this._univerInstanceService = t, this._confirmService = n, this._logService = r, this._selectionManagerService = o, this._sheetsSortService = s, this._localeService =
|
|
207
|
+
K(this, "_customSortState$", new ft(null));
|
|
208
|
+
K(this, "customSortState$", this._customSortState$.asObservable());
|
|
209
|
+
this._univerInstanceService = t, this._confirmService = n, this._logService = r, this._selectionManagerService = o, this._sheetsSortService = s, this._localeService = i, this._commandService = l;
|
|
238
210
|
}
|
|
239
211
|
async triggerSortDirectly(t, n, r) {
|
|
240
212
|
const o = r || await this._detectSortLocation(n);
|
|
241
213
|
if (!o || !this._check(o))
|
|
242
214
|
return !1;
|
|
243
|
-
const
|
|
215
|
+
const i = {
|
|
244
216
|
orderRules: [{
|
|
245
|
-
type: t ?
|
|
217
|
+
type: t ? U.ASC : U.DESC,
|
|
246
218
|
colIndex: o.colIndex
|
|
247
219
|
}],
|
|
248
220
|
range: o.range
|
|
249
221
|
};
|
|
250
|
-
return this._sheetsSortService.applySort(
|
|
222
|
+
return this._sheetsSortService.applySort(i, o.unitId, o.subUnitId), !0;
|
|
251
223
|
}
|
|
252
224
|
async triggerSortCustomize() {
|
|
253
225
|
const t = await this._detectSortLocation();
|
|
@@ -257,37 +229,37 @@ let f = class extends Ye {
|
|
|
257
229
|
return this._customSortState$.getValue();
|
|
258
230
|
}
|
|
259
231
|
getTitles(t) {
|
|
260
|
-
var
|
|
261
|
-
const n = (
|
|
232
|
+
var u, m;
|
|
233
|
+
const n = (u = this.customSortState()) == null ? void 0 : u.location;
|
|
262
234
|
if (!n)
|
|
263
235
|
return [];
|
|
264
|
-
const { unitId: r, subUnitId: o, range: s } = n,
|
|
265
|
-
if (!
|
|
236
|
+
const { unitId: r, subUnitId: o, range: s } = n, i = (m = this._univerInstanceService.getUnit(r)) == null ? void 0 : m.getSheetBySheetId(o);
|
|
237
|
+
if (!i)
|
|
266
238
|
return [];
|
|
267
|
-
const l =
|
|
239
|
+
const l = vn(this._localeService);
|
|
268
240
|
return Array.from(
|
|
269
241
|
{ length: s.endColumn - s.startColumn + 1 },
|
|
270
|
-
(
|
|
242
|
+
(x, f) => {
|
|
271
243
|
var S;
|
|
272
|
-
const
|
|
244
|
+
const E = (S = i.getCell(s.startRow, f + s.startColumn)) == null ? void 0 : S.v;
|
|
273
245
|
return {
|
|
274
|
-
index:
|
|
275
|
-
label: t ? `${
|
|
246
|
+
index: f + s.startColumn,
|
|
247
|
+
label: t ? `${E != null ? E : l(f + s.startColumn)}` : l(f + s.startColumn)
|
|
276
248
|
};
|
|
277
249
|
}
|
|
278
250
|
);
|
|
279
251
|
}
|
|
280
252
|
setSelection(t, n, r) {
|
|
281
|
-
var
|
|
282
|
-
const o = (
|
|
253
|
+
var i;
|
|
254
|
+
const o = (i = this._univerInstanceService.getUnit(t)) == null ? void 0 : i.getSheetBySheetId(n);
|
|
283
255
|
if (!o)
|
|
284
256
|
return;
|
|
285
257
|
const s = {
|
|
286
258
|
unitId: t,
|
|
287
259
|
subUnitId: n,
|
|
288
|
-
selections: [{ range: r, primary:
|
|
260
|
+
selections: [{ range: r, primary: _t(r, o), style: null }]
|
|
289
261
|
};
|
|
290
|
-
this._commandService.executeCommand(
|
|
262
|
+
this._commandService.executeCommand(It.id, s);
|
|
291
263
|
}
|
|
292
264
|
async showCheckError(t) {
|
|
293
265
|
return await this._confirmService.confirm({
|
|
@@ -296,7 +268,7 @@ let f = class extends Ye {
|
|
|
296
268
|
title: this._localeService.t("info.tooltip")
|
|
297
269
|
},
|
|
298
270
|
children: {
|
|
299
|
-
title: /* @__PURE__ */
|
|
271
|
+
title: /* @__PURE__ */ a("div", { children: this._localeService.t(t) })
|
|
300
272
|
}
|
|
301
273
|
});
|
|
302
274
|
}
|
|
@@ -308,8 +280,8 @@ let f = class extends Ye {
|
|
|
308
280
|
title: this._localeService.t("sheets-sort.dialog.sort-reminder")
|
|
309
281
|
},
|
|
310
282
|
children: {
|
|
311
|
-
title: /* @__PURE__ */
|
|
312
|
-
|
|
283
|
+
title: /* @__PURE__ */ a(
|
|
284
|
+
Cn,
|
|
313
285
|
{
|
|
314
286
|
onChange: (r) => {
|
|
315
287
|
t = r === "1";
|
|
@@ -330,163 +302,163 @@ let f = class extends Ye {
|
|
|
330
302
|
return this._sheetsSortService.singleCheck(t) ? this._sheetsSortService.mergeCheck(t) ? this._sheetsSortService.formulaCheck(t) ? this._sheetsSortService.emptyCheck(t) ? !0 : (this.showCheckError(z.EMPTY_ERROR), !1) : (this.showCheckError(z.FORMULA_ARRAY), !1) : (this.showCheckError(z.MERGE_ERROR), !1) : (this.showCheckError(z.SINGLE_ERROR), !1);
|
|
331
303
|
}
|
|
332
304
|
async _detectSortLocation(t) {
|
|
333
|
-
const n = this._univerInstanceService.getCurrentUnitForType(
|
|
334
|
-
if (!
|
|
305
|
+
const n = this._univerInstanceService.getCurrentUnitForType(Y.UNIVER_SHEET), r = n.getActiveSheet(), o = n.getUnitId(), s = r.getSheetId(), i = this._selectionManagerService.getCurrentLastSelection();
|
|
306
|
+
if (!i)
|
|
335
307
|
return null;
|
|
336
308
|
let l;
|
|
337
309
|
if (t === !0)
|
|
338
|
-
l =
|
|
310
|
+
l = fe(i.range, { up: !0, down: !0, left: !0, right: !0 }, r), this.setSelection(o, s, l);
|
|
339
311
|
else if (t === !1)
|
|
340
|
-
l =
|
|
312
|
+
l = i.range;
|
|
341
313
|
else {
|
|
342
|
-
const
|
|
343
|
-
if (
|
|
314
|
+
const u = await this.showExtendConfirm();
|
|
315
|
+
if (u === "cancel")
|
|
344
316
|
return null;
|
|
345
|
-
|
|
317
|
+
u === "keep" ? l = i.range : (l = fe(i.range, { up: !0, down: !0, left: !0, right: !0 }, r), this.setSelection(o, s, l));
|
|
346
318
|
}
|
|
347
319
|
return {
|
|
348
320
|
range: l,
|
|
349
321
|
unitId: o,
|
|
350
322
|
subUnitId: s,
|
|
351
|
-
colIndex:
|
|
323
|
+
colIndex: i.primary.actualColumn
|
|
352
324
|
};
|
|
353
325
|
}
|
|
354
326
|
};
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
],
|
|
364
|
-
function
|
|
327
|
+
C = pn([
|
|
328
|
+
P(0, ye),
|
|
329
|
+
P(1, at),
|
|
330
|
+
P(2, We),
|
|
331
|
+
P(3, T(vt)),
|
|
332
|
+
P(4, T(Re)),
|
|
333
|
+
P(5, T(A)),
|
|
334
|
+
P(6, Me)
|
|
335
|
+
], C);
|
|
336
|
+
function vn(e) {
|
|
365
337
|
return (t) => {
|
|
366
|
-
const n =
|
|
338
|
+
const n = Ye.chatAtABC(t);
|
|
367
339
|
switch (e.getCurrentLocale()) {
|
|
368
|
-
case
|
|
340
|
+
case J.ZH_CN:
|
|
369
341
|
return `"${n}"列`;
|
|
370
|
-
case
|
|
342
|
+
case J.EN_US:
|
|
371
343
|
return `Column "${n}"`;
|
|
372
344
|
default:
|
|
373
345
|
return `Column "${n}"`;
|
|
374
346
|
}
|
|
375
347
|
};
|
|
376
348
|
}
|
|
377
|
-
const
|
|
349
|
+
const ne = {
|
|
378
350
|
id: "sheet.command.sort-range-asc",
|
|
379
351
|
type: b.COMMAND,
|
|
380
|
-
handler: async (e) => await e.get(
|
|
381
|
-
},
|
|
352
|
+
handler: async (e) => await e.get(C).triggerSortDirectly(!0, !1)
|
|
353
|
+
}, re = {
|
|
382
354
|
id: "sheet.command.sort-range-asc-ext",
|
|
383
355
|
type: b.COMMAND,
|
|
384
|
-
handler: async (e) => await e.get(
|
|
385
|
-
},
|
|
356
|
+
handler: async (e) => await e.get(C).triggerSortDirectly(!0, !0)
|
|
357
|
+
}, oe = {
|
|
386
358
|
id: "sheet.command.sort-range-desc",
|
|
387
359
|
type: b.COMMAND,
|
|
388
|
-
handler: async (e) => await e.get(
|
|
389
|
-
},
|
|
360
|
+
handler: async (e) => await e.get(C).triggerSortDirectly(!1, !1)
|
|
361
|
+
}, se = {
|
|
390
362
|
id: "sheet.command.sort-range-desc-ext",
|
|
391
363
|
type: b.COMMAND,
|
|
392
|
-
handler: async (e) => await e.get(
|
|
393
|
-
},
|
|
364
|
+
handler: async (e) => await e.get(C).triggerSortDirectly(!1, !0)
|
|
365
|
+
}, ie = {
|
|
394
366
|
id: "sheet.command.sort-range-custom",
|
|
395
367
|
type: b.COMMAND,
|
|
396
|
-
handler: async (e) => await e.get(
|
|
397
|
-
},
|
|
368
|
+
handler: async (e) => await e.get(C).triggerSortCustomize()
|
|
369
|
+
}, ce = {
|
|
398
370
|
id: "sheet.command.sort-range-asc-ctx",
|
|
399
371
|
type: b.COMMAND,
|
|
400
|
-
handler: async (e) => await e.get(
|
|
401
|
-
},
|
|
372
|
+
handler: async (e) => await e.get(C).triggerSortDirectly(!0, !1)
|
|
373
|
+
}, ae = {
|
|
402
374
|
id: "sheet.command.sort-range-asc-ext-ctx",
|
|
403
375
|
type: b.COMMAND,
|
|
404
|
-
handler: async (e) => await e.get(
|
|
405
|
-
},
|
|
376
|
+
handler: async (e) => await e.get(C).triggerSortDirectly(!0, !0)
|
|
377
|
+
}, le = {
|
|
406
378
|
id: "sheet.command.sort-range-desc-ctx",
|
|
407
379
|
type: b.COMMAND,
|
|
408
|
-
handler: async (e) => await e.get(
|
|
409
|
-
},
|
|
380
|
+
handler: async (e) => await e.get(C).triggerSortDirectly(!1, !1)
|
|
381
|
+
}, de = {
|
|
410
382
|
id: "sheet.command.sort-range-desc-ext-ctx",
|
|
411
383
|
type: b.COMMAND,
|
|
412
|
-
handler: async (e) => await e.get(
|
|
413
|
-
},
|
|
384
|
+
handler: async (e) => await e.get(C).triggerSortDirectly(!1, !0)
|
|
385
|
+
}, ue = {
|
|
414
386
|
id: "sheet.command.sort-range-custom-ctx",
|
|
415
387
|
type: b.COMMAND,
|
|
416
|
-
handler: async (e) => await e.get(
|
|
388
|
+
handler: async (e) => await e.get(C).triggerSortCustomize()
|
|
417
389
|
};
|
|
418
|
-
function
|
|
419
|
-
const e = O(
|
|
420
|
-
if (!
|
|
390
|
+
function _n() {
|
|
391
|
+
const e = O(C), t = O(Re), n = O(A), [r, o] = F(!1), [s, i] = F(0), l = Ee(null), u = e.customSortState();
|
|
392
|
+
if (!u || !u.location)
|
|
421
393
|
return null;
|
|
422
|
-
const { range:
|
|
423
|
-
{ type:
|
|
424
|
-
]),
|
|
425
|
-
const
|
|
426
|
-
|
|
427
|
-
}, [S]), V =
|
|
428
|
-
|
|
429
|
-
const
|
|
430
|
-
|
|
394
|
+
const { range: m, unitId: x, subUnitId: f } = u.location, E = e.getTitles(r), [S, $] = F([
|
|
395
|
+
{ type: U.ASC, colIndex: m.startColumn }
|
|
396
|
+
]), q = w((d, _) => {
|
|
397
|
+
const B = [...S];
|
|
398
|
+
_ === null ? B.splice(d, 1) : B[d] = _, $(B);
|
|
399
|
+
}, [S]), V = w(
|
|
400
|
+
qe(() => {
|
|
401
|
+
const d = [...S], _ = yn(m, S);
|
|
402
|
+
_ !== null && (d.push({ type: U.ASC, colIndex: _ }), $(d));
|
|
431
403
|
}, 200),
|
|
432
|
-
[S,
|
|
433
|
-
),
|
|
434
|
-
t.applySort({ range:
|
|
435
|
-
}, [t, e,
|
|
404
|
+
[S, m]
|
|
405
|
+
), h = w((d, _) => {
|
|
406
|
+
t.applySort({ range: m, orderRules: d, hasTitle: _ }), e.closeCustomSortPanel();
|
|
407
|
+
}, [t, e, m]), X = w(() => {
|
|
436
408
|
e.closeCustomSortPanel();
|
|
437
|
-
}, [e]),
|
|
438
|
-
o(
|
|
439
|
-
}, [e,
|
|
440
|
-
|
|
409
|
+
}, [e]), je = w((d) => {
|
|
410
|
+
o(d), d ? e.setSelection(x, f, { ...m, startRow: m.startRow + 1 }) : e.setSelection(x, f, m);
|
|
411
|
+
}, [e, m, f, x]);
|
|
412
|
+
Oe(() => {
|
|
441
413
|
l.current && S.length > 5 && (l.current.scrollTop = l.current.scrollHeight);
|
|
442
414
|
}, [S]);
|
|
443
|
-
const
|
|
444
|
-
return /* @__PURE__ */
|
|
445
|
-
/* @__PURE__ */
|
|
446
|
-
|
|
415
|
+
const Ve = S.length < E.length, Se = S.map((d) => ({ ...d, id: `${d.colIndex}` }));
|
|
416
|
+
return /* @__PURE__ */ g("div", { className: c.customSortPanelContainer, children: [
|
|
417
|
+
/* @__PURE__ */ g("div", { className: c.customSortPanelContent, onMouseDown: (d) => {
|
|
418
|
+
d.stopPropagation();
|
|
447
419
|
}, children: [
|
|
448
|
-
/* @__PURE__ */
|
|
449
|
-
/* @__PURE__ */
|
|
450
|
-
|
|
451
|
-
/* @__PURE__ */
|
|
452
|
-
/* @__PURE__ */
|
|
453
|
-
] }) : /* @__PURE__ */
|
|
420
|
+
/* @__PURE__ */ g("div", { className: c.customSortPanelExt, children: [
|
|
421
|
+
/* @__PURE__ */ a("div", { className: c.firstRowCheck, children: /* @__PURE__ */ a(Mt, { checked: r, onChange: (d) => je(!!d), children: n.t("sheets-sort.dialog.first-row-check") }) }),
|
|
422
|
+
Ve ? /* @__PURE__ */ g("div", { className: c.addCondition, onClick: V, children: [
|
|
423
|
+
/* @__PURE__ */ a(Q, {}),
|
|
424
|
+
/* @__PURE__ */ a("span", { className: c.addConditionText, children: n.t("sheets-sort.dialog.add-condition") })
|
|
425
|
+
] }) : /* @__PURE__ */ g(
|
|
454
426
|
"div",
|
|
455
427
|
{
|
|
456
428
|
className: `
|
|
457
|
-
${
|
|
458
|
-
${
|
|
429
|
+
${c.addCondition}
|
|
430
|
+
${c.addConditionDisable}
|
|
459
431
|
`,
|
|
460
432
|
children: [
|
|
461
|
-
/* @__PURE__ */
|
|
462
|
-
/* @__PURE__ */
|
|
433
|
+
/* @__PURE__ */ a(Q, {}),
|
|
434
|
+
/* @__PURE__ */ a("span", { className: c.addConditionText, children: n.t("sheets-sort.dialog.add-condition") })
|
|
463
435
|
]
|
|
464
436
|
}
|
|
465
437
|
)
|
|
466
438
|
] }),
|
|
467
|
-
/* @__PURE__ */
|
|
439
|
+
/* @__PURE__ */ a(
|
|
468
440
|
"div",
|
|
469
441
|
{
|
|
470
|
-
className:
|
|
471
|
-
onScroll: (
|
|
472
|
-
const
|
|
473
|
-
|
|
442
|
+
className: c.conditionList,
|
|
443
|
+
onScroll: (d) => {
|
|
444
|
+
const _ = d.currentTarget.scrollTop;
|
|
445
|
+
i(_);
|
|
474
446
|
},
|
|
475
447
|
ref: l,
|
|
476
|
-
children: /* @__PURE__ */
|
|
477
|
-
|
|
448
|
+
children: /* @__PURE__ */ a(
|
|
449
|
+
xt,
|
|
478
450
|
{
|
|
479
|
-
list:
|
|
480
|
-
onListChange:
|
|
451
|
+
list: Se,
|
|
452
|
+
onListChange: $,
|
|
481
453
|
idKey: "id",
|
|
482
|
-
draggableHandle: `.${
|
|
483
|
-
itemRender: (
|
|
484
|
-
|
|
454
|
+
draggableHandle: `.${c.customSortPanelItemHandler}`,
|
|
455
|
+
itemRender: (d) => /* @__PURE__ */ a(
|
|
456
|
+
In,
|
|
485
457
|
{
|
|
486
|
-
titles:
|
|
487
|
-
list:
|
|
488
|
-
item:
|
|
489
|
-
onChange: (
|
|
458
|
+
titles: E,
|
|
459
|
+
list: Se,
|
|
460
|
+
item: d,
|
|
461
|
+
onChange: (_, B) => q(B, _),
|
|
490
462
|
scrollPosition: s
|
|
491
463
|
}
|
|
492
464
|
),
|
|
@@ -497,299 +469,300 @@ function bn() {
|
|
|
497
469
|
}
|
|
498
470
|
)
|
|
499
471
|
] }),
|
|
500
|
-
/* @__PURE__ */
|
|
501
|
-
/* @__PURE__ */
|
|
502
|
-
/* @__PURE__ */
|
|
472
|
+
/* @__PURE__ */ g("div", { className: c.customSortPanelFooter, children: [
|
|
473
|
+
/* @__PURE__ */ a(pe, { className: c.customSortPanelFooterBtn, type: "default", onClick: () => X(), children: n.t("sheets-sort.dialog.cancel") }),
|
|
474
|
+
/* @__PURE__ */ a(pe, { className: c.customSortPanelFooterBtn, type: "primary", onClick: () => h(S, r), children: n.t("sheets-sort.dialog.confirm") })
|
|
503
475
|
] })
|
|
504
476
|
] });
|
|
505
477
|
}
|
|
506
|
-
function
|
|
478
|
+
function In(e) {
|
|
507
479
|
var V;
|
|
508
|
-
const { list: t, item: n, titles: r, onChange: o, scrollPosition: s } = e,
|
|
509
|
-
o({ ...n, colIndex:
|
|
510
|
-
}, [
|
|
511
|
-
|
|
480
|
+
const { list: t, item: n, titles: r, onChange: o, scrollPosition: s } = e, i = O(A), l = r.filter((h) => !t.some((X) => X.colIndex === h.index) || h.index === n.colIndex), u = t.findIndex((h) => h.colIndex === n.colIndex), m = w((h) => {
|
|
481
|
+
o({ ...n, colIndex: h.index }, u), f(!1);
|
|
482
|
+
}, [u, n, o]), [x, f] = F(!1), E = (h) => {
|
|
483
|
+
f(h);
|
|
512
484
|
};
|
|
513
|
-
|
|
514
|
-
|
|
485
|
+
Oe(() => {
|
|
486
|
+
f(!1);
|
|
515
487
|
}, [s]);
|
|
516
|
-
const S = t.length > 1,
|
|
517
|
-
return /* @__PURE__ */
|
|
518
|
-
/* @__PURE__ */
|
|
519
|
-
/* @__PURE__ */
|
|
520
|
-
/* @__PURE__ */
|
|
521
|
-
|
|
488
|
+
const S = t.length > 1, $ = (V = r.find((h) => h.index === n.colIndex)) == null ? void 0 : V.label, q = i.getCurrentLocale() === J.ZH_CN ? c.customSortPanelItemOrderRadioCn : c.customSortPanelItemOrderRadio;
|
|
489
|
+
return /* @__PURE__ */ g("div", { className: c.customSortPanelItem, children: [
|
|
490
|
+
/* @__PURE__ */ g("div", { className: c.customSortPanelItemHead, children: [
|
|
491
|
+
/* @__PURE__ */ a("div", { className: c.customSortPanelItemHandler, children: /* @__PURE__ */ a(Ue, {}) }),
|
|
492
|
+
/* @__PURE__ */ a("div", { className: c.customSortPanelItemColumn, children: /* @__PURE__ */ a(
|
|
493
|
+
Rt,
|
|
522
494
|
{
|
|
523
495
|
placement: "bottomLeft",
|
|
524
496
|
trigger: ["click"],
|
|
525
|
-
visible:
|
|
526
|
-
onVisibleChange:
|
|
527
|
-
overlay: /* @__PURE__ */
|
|
497
|
+
visible: x,
|
|
498
|
+
onVisibleChange: E,
|
|
499
|
+
overlay: /* @__PURE__ */ a("ul", { className: c.customSortColMenu, children: l.map((h) => /* @__PURE__ */ g(
|
|
528
500
|
"li",
|
|
529
501
|
{
|
|
530
|
-
onClick: () =>
|
|
531
|
-
className:
|
|
502
|
+
onClick: () => m(h),
|
|
503
|
+
className: c.customSortColMenuItem,
|
|
532
504
|
children: [
|
|
533
|
-
/* @__PURE__ */
|
|
534
|
-
/* @__PURE__ */
|
|
505
|
+
/* @__PURE__ */ a("span", { className: c.customSortColMenuItemDesc, children: h.label }),
|
|
506
|
+
/* @__PURE__ */ a("span", { className: c.customSortColMenuItemCheck, children: h.index === n.colIndex && /* @__PURE__ */ a(we, {}) })
|
|
535
507
|
]
|
|
536
508
|
},
|
|
537
|
-
|
|
509
|
+
h.index
|
|
538
510
|
)) }),
|
|
539
|
-
children: /* @__PURE__ */
|
|
540
|
-
/* @__PURE__ */
|
|
541
|
-
/* @__PURE__ */
|
|
511
|
+
children: /* @__PURE__ */ g("div", { className: c.customSortPanelItemColumnInput, children: [
|
|
512
|
+
/* @__PURE__ */ a("span", { className: c.customSortPanelItemColumnInputText, children: $ }),
|
|
513
|
+
/* @__PURE__ */ a(ke, { className: c.customSortPanelItemColumnInputDropdown })
|
|
542
514
|
] })
|
|
543
515
|
}
|
|
544
516
|
) })
|
|
545
517
|
] }),
|
|
546
|
-
/* @__PURE__ */
|
|
547
|
-
|
|
518
|
+
/* @__PURE__ */ a("div", { className: c.customSortPanelItemOrder, children: /* @__PURE__ */ g(
|
|
519
|
+
Te,
|
|
548
520
|
{
|
|
549
|
-
className:
|
|
521
|
+
className: q,
|
|
550
522
|
value: n.type,
|
|
551
|
-
onChange: (
|
|
552
|
-
o({ ...n, type:
|
|
523
|
+
onChange: (h) => {
|
|
524
|
+
o({ ...n, type: h }, u);
|
|
553
525
|
},
|
|
554
526
|
children: [
|
|
555
|
-
/* @__PURE__ */
|
|
556
|
-
/* @__PURE__ */
|
|
527
|
+
/* @__PURE__ */ a(Z, { value: U.ASC, children: i.t("sheets-sort.general.sort-asc") }),
|
|
528
|
+
/* @__PURE__ */ a(Z, { value: U.DESC, children: i.t("sheets-sort.general.sort-desc") })
|
|
557
529
|
]
|
|
558
530
|
}
|
|
559
531
|
) }),
|
|
560
|
-
/* @__PURE__ */
|
|
532
|
+
/* @__PURE__ */ a("div", { className: c.customSortPanelItemRemove, children: S && /* @__PURE__ */ a(Le, { onClick: () => o(null, u) }) })
|
|
561
533
|
] });
|
|
562
534
|
}
|
|
563
|
-
function
|
|
535
|
+
function yn(e, t) {
|
|
564
536
|
const { startColumn: n, endColumn: r } = e, o = new Set(t.map((s) => s == null ? void 0 : s.colIndex));
|
|
565
537
|
for (let s = n; s <= r; s++)
|
|
566
538
|
if (!o.has(s))
|
|
567
539
|
return s;
|
|
568
540
|
return null;
|
|
569
541
|
}
|
|
570
|
-
function
|
|
571
|
-
const { range: t, colIndex: n, onClose: r } = e, o = O(
|
|
572
|
-
const { unitId:
|
|
573
|
-
if (t &&
|
|
574
|
-
const
|
|
575
|
-
o.triggerSortDirectly(
|
|
542
|
+
function Mn(e) {
|
|
543
|
+
const { range: t, colIndex: n, onClose: r } = e, o = O(C), s = O(ye), i = O(A), l = w((u) => {
|
|
544
|
+
const { unitId: m, subUnitId: x } = yt(s) || {};
|
|
545
|
+
if (t && m && x) {
|
|
546
|
+
const f = { ...t, startRow: t.startRow + 1 };
|
|
547
|
+
o.triggerSortDirectly(u, !1, { unitId: m, subUnitId: x, range: f, colIndex: n });
|
|
576
548
|
} else
|
|
577
|
-
console.warn(`Cannot find the target to sort. unitId: ${
|
|
549
|
+
console.warn(`Cannot find the target to sort. unitId: ${m}, subUnitId: ${x}, range: ${t}, colIndex: ${n}`);
|
|
578
550
|
r();
|
|
579
551
|
}, [t, n, o, s, r]);
|
|
580
|
-
return /* @__PURE__ */
|
|
581
|
-
/* @__PURE__ */
|
|
552
|
+
return /* @__PURE__ */ g("div", { className: c.embedSortBtnContainer, children: [
|
|
553
|
+
/* @__PURE__ */ g(
|
|
582
554
|
"div",
|
|
583
555
|
{
|
|
584
556
|
className: `
|
|
585
|
-
${
|
|
586
|
-
${
|
|
557
|
+
${c.embedSortBtn}
|
|
558
|
+
${c.embedSortBtnAsc}
|
|
587
559
|
`,
|
|
588
560
|
onClick: () => l(!0),
|
|
589
561
|
children: [
|
|
590
|
-
/* @__PURE__ */
|
|
591
|
-
|
|
562
|
+
/* @__PURE__ */ a(ee, { className: c.embedSortBtnIcon }),
|
|
563
|
+
i.t("sheets-sort.general.sort-asc")
|
|
592
564
|
]
|
|
593
565
|
}
|
|
594
566
|
),
|
|
595
|
-
/* @__PURE__ */
|
|
567
|
+
/* @__PURE__ */ g(
|
|
596
568
|
"div",
|
|
597
569
|
{
|
|
598
570
|
className: `
|
|
599
|
-
${
|
|
600
|
-
${
|
|
571
|
+
${c.embedSortBtn}
|
|
572
|
+
${c.embedSortBtnDesc}
|
|
601
573
|
`,
|
|
602
574
|
onClick: () => l(!1),
|
|
603
575
|
children: [
|
|
604
|
-
/* @__PURE__ */
|
|
605
|
-
|
|
576
|
+
/* @__PURE__ */ a(te, { className: c.embedSortBtnIcon }),
|
|
577
|
+
i.t("sheets-sort.general.sort-desc")
|
|
606
578
|
]
|
|
607
579
|
}
|
|
608
580
|
)
|
|
609
581
|
] });
|
|
610
582
|
}
|
|
611
|
-
const
|
|
612
|
-
function
|
|
583
|
+
const Ae = "sheet.menu.sheets-sort", $e = "sheet.menu.sheets-sort-ctx", j = "AscendingSingle", me = "ExpandAscendingSingle", he = "DescendingSingle", ge = "ExpandDescendingSingle", Ce = "CustomSortSingle";
|
|
584
|
+
function xn(e) {
|
|
613
585
|
return {
|
|
614
|
-
id:
|
|
615
|
-
type:
|
|
616
|
-
icon:
|
|
586
|
+
id: Ae,
|
|
587
|
+
type: v.SUBITEMS,
|
|
588
|
+
icon: j,
|
|
617
589
|
tooltip: "sheets-sort.general.sort",
|
|
618
|
-
hidden$:
|
|
619
|
-
disabled$:
|
|
590
|
+
hidden$: be(e, Y.UNIVER_SHEET),
|
|
591
|
+
disabled$: N(e, { workbookTypes: [L], worksheetTypes: [D, H], rangeTypes: [k] })
|
|
620
592
|
};
|
|
621
593
|
}
|
|
622
|
-
function
|
|
594
|
+
function Rn(e) {
|
|
623
595
|
return {
|
|
624
|
-
id:
|
|
625
|
-
icon:
|
|
596
|
+
id: ne.id,
|
|
597
|
+
icon: j,
|
|
626
598
|
title: "sheets-sort.general.sort-asc-cur",
|
|
627
|
-
type:
|
|
628
|
-
hidden$:
|
|
599
|
+
type: v.BUTTON,
|
|
600
|
+
hidden$: st(e)
|
|
629
601
|
};
|
|
630
602
|
}
|
|
631
|
-
function
|
|
603
|
+
function bn(e) {
|
|
632
604
|
return {
|
|
633
|
-
id:
|
|
605
|
+
id: re.id,
|
|
634
606
|
title: "sheets-sort.general.sort-asc-ext",
|
|
635
|
-
icon:
|
|
636
|
-
type:
|
|
607
|
+
icon: me,
|
|
608
|
+
type: v.BUTTON
|
|
637
609
|
};
|
|
638
610
|
}
|
|
639
|
-
function
|
|
611
|
+
function Tn(e) {
|
|
640
612
|
return {
|
|
641
|
-
id:
|
|
613
|
+
id: oe.id,
|
|
642
614
|
title: "sheets-sort.general.sort-desc-cur",
|
|
643
|
-
icon:
|
|
644
|
-
type:
|
|
615
|
+
icon: he,
|
|
616
|
+
type: v.BUTTON
|
|
645
617
|
};
|
|
646
618
|
}
|
|
647
|
-
function
|
|
619
|
+
function En(e) {
|
|
648
620
|
return {
|
|
649
|
-
id:
|
|
621
|
+
id: se.id,
|
|
650
622
|
title: "sheets-sort.general.sort-desc-ext",
|
|
651
|
-
icon:
|
|
652
|
-
type:
|
|
623
|
+
icon: ge,
|
|
624
|
+
type: v.BUTTON
|
|
653
625
|
};
|
|
654
626
|
}
|
|
655
|
-
function
|
|
627
|
+
function On(e) {
|
|
656
628
|
return {
|
|
657
|
-
id:
|
|
629
|
+
id: ie.id,
|
|
658
630
|
title: "sheets-sort.general.sort-custom",
|
|
659
|
-
type:
|
|
660
|
-
icon:
|
|
631
|
+
type: v.BUTTON,
|
|
632
|
+
icon: Ce
|
|
661
633
|
};
|
|
662
634
|
}
|
|
663
|
-
function
|
|
635
|
+
function Pn(e) {
|
|
664
636
|
return {
|
|
665
|
-
id:
|
|
637
|
+
id: $e,
|
|
666
638
|
title: "sheets-sort.general.sort",
|
|
667
|
-
type:
|
|
668
|
-
icon:
|
|
669
|
-
hidden$:
|
|
670
|
-
disabled$:
|
|
671
|
-
workbookTypes: [
|
|
672
|
-
worksheetTypes: [
|
|
673
|
-
rangeTypes: [
|
|
639
|
+
type: v.SUBITEMS,
|
|
640
|
+
icon: j,
|
|
641
|
+
hidden$: be(e, Y.UNIVER_SHEET),
|
|
642
|
+
disabled$: N(e, {
|
|
643
|
+
workbookTypes: [L],
|
|
644
|
+
worksheetTypes: [D, H],
|
|
645
|
+
rangeTypes: [k]
|
|
674
646
|
})
|
|
675
647
|
};
|
|
676
648
|
}
|
|
677
|
-
function
|
|
649
|
+
function wn(e) {
|
|
678
650
|
return {
|
|
679
|
-
id:
|
|
651
|
+
id: ce.id,
|
|
680
652
|
title: "sheets-sort.general.sort-asc-cur",
|
|
681
|
-
type:
|
|
682
|
-
icon:
|
|
683
|
-
disabled$:
|
|
653
|
+
type: v.BUTTON,
|
|
654
|
+
icon: j,
|
|
655
|
+
disabled$: N(e, { workbookTypes: [L], worksheetTypes: [D, H], rangeTypes: [k] })
|
|
684
656
|
};
|
|
685
657
|
}
|
|
686
|
-
function
|
|
658
|
+
function Nn(e) {
|
|
687
659
|
return {
|
|
688
|
-
id:
|
|
660
|
+
id: ae.id,
|
|
689
661
|
title: "sheets-sort.general.sort-asc-ext",
|
|
690
|
-
type:
|
|
691
|
-
icon:
|
|
692
|
-
disabled$:
|
|
662
|
+
type: v.BUTTON,
|
|
663
|
+
icon: me,
|
|
664
|
+
disabled$: N(e, { workbookTypes: [L], worksheetTypes: [D, H], rangeTypes: [k] })
|
|
693
665
|
};
|
|
694
666
|
}
|
|
695
|
-
function
|
|
667
|
+
function Ln(e) {
|
|
696
668
|
return {
|
|
697
|
-
id:
|
|
669
|
+
id: le.id,
|
|
698
670
|
title: "sheets-sort.general.sort-desc-cur",
|
|
699
|
-
type:
|
|
700
|
-
icon:
|
|
701
|
-
disabled$:
|
|
671
|
+
type: v.BUTTON,
|
|
672
|
+
icon: he,
|
|
673
|
+
disabled$: N(e, { workbookTypes: [L], worksheetTypes: [D, H], rangeTypes: [k] })
|
|
702
674
|
};
|
|
703
675
|
}
|
|
704
|
-
function
|
|
676
|
+
function Dn(e) {
|
|
705
677
|
return {
|
|
706
|
-
id:
|
|
678
|
+
id: de.id,
|
|
707
679
|
title: "sheets-sort.general.sort-desc-ext",
|
|
708
|
-
type:
|
|
709
|
-
icon:
|
|
710
|
-
disabled$:
|
|
680
|
+
type: v.BUTTON,
|
|
681
|
+
icon: ge,
|
|
682
|
+
disabled$: N(e, { workbookTypes: [L], worksheetTypes: [D, H], rangeTypes: [k] })
|
|
711
683
|
};
|
|
712
684
|
}
|
|
713
|
-
function
|
|
685
|
+
function Hn(e) {
|
|
714
686
|
return {
|
|
715
|
-
id:
|
|
687
|
+
id: ue.id,
|
|
716
688
|
title: "sheets-sort.general.sort-custom",
|
|
717
|
-
type:
|
|
718
|
-
icon:
|
|
719
|
-
disabled$:
|
|
689
|
+
type: v.BUTTON,
|
|
690
|
+
icon: Ce,
|
|
691
|
+
disabled$: N(e, { workbookTypes: [L], worksheetTypes: [D, H], rangeTypes: [k] })
|
|
720
692
|
};
|
|
721
693
|
}
|
|
722
|
-
const
|
|
723
|
-
[
|
|
724
|
-
[
|
|
694
|
+
const kn = {
|
|
695
|
+
[lt.FORMULAS_INSERT]: {
|
|
696
|
+
[Ae]: {
|
|
725
697
|
order: 2,
|
|
726
|
-
menuItemFactory:
|
|
727
|
-
[
|
|
698
|
+
menuItemFactory: xn,
|
|
699
|
+
[ne.id]: {
|
|
728
700
|
order: 0,
|
|
729
|
-
menuItemFactory:
|
|
701
|
+
menuItemFactory: Rn
|
|
730
702
|
},
|
|
731
|
-
[
|
|
703
|
+
[re.id]: {
|
|
732
704
|
order: 1,
|
|
733
|
-
menuItemFactory:
|
|
705
|
+
menuItemFactory: bn
|
|
734
706
|
},
|
|
735
|
-
[
|
|
707
|
+
[oe.id]: {
|
|
736
708
|
order: 2,
|
|
737
|
-
menuItemFactory:
|
|
709
|
+
menuItemFactory: Tn
|
|
738
710
|
},
|
|
739
|
-
[
|
|
711
|
+
[se.id]: {
|
|
740
712
|
order: 3,
|
|
741
|
-
menuItemFactory:
|
|
713
|
+
menuItemFactory: En
|
|
742
714
|
},
|
|
743
|
-
[
|
|
715
|
+
[ie.id]: {
|
|
744
716
|
order: 4,
|
|
745
|
-
menuItemFactory:
|
|
717
|
+
menuItemFactory: On
|
|
746
718
|
}
|
|
747
719
|
}
|
|
748
720
|
},
|
|
749
|
-
[
|
|
750
|
-
[
|
|
751
|
-
[
|
|
721
|
+
[dt.MAIN_AREA]: {
|
|
722
|
+
[ut.DATA]: {
|
|
723
|
+
[$e]: {
|
|
752
724
|
order: 0,
|
|
753
|
-
menuItemFactory:
|
|
754
|
-
[
|
|
725
|
+
menuItemFactory: Pn,
|
|
726
|
+
[ce.id]: {
|
|
755
727
|
order: 0,
|
|
756
|
-
menuItemFactory:
|
|
728
|
+
menuItemFactory: wn
|
|
757
729
|
},
|
|
758
|
-
[
|
|
730
|
+
[ae.id]: {
|
|
759
731
|
order: 1,
|
|
760
|
-
menuItemFactory:
|
|
732
|
+
menuItemFactory: Nn
|
|
761
733
|
},
|
|
762
|
-
[
|
|
734
|
+
[le.id]: {
|
|
763
735
|
order: 2,
|
|
764
|
-
menuItemFactory:
|
|
736
|
+
menuItemFactory: Ln
|
|
765
737
|
},
|
|
766
|
-
[
|
|
738
|
+
[de.id]: {
|
|
767
739
|
order: 3,
|
|
768
|
-
menuItemFactory:
|
|
740
|
+
menuItemFactory: Dn
|
|
769
741
|
},
|
|
770
|
-
[
|
|
742
|
+
[ue.id]: {
|
|
771
743
|
order: 4,
|
|
772
|
-
menuItemFactory:
|
|
744
|
+
menuItemFactory: Hn
|
|
773
745
|
}
|
|
774
746
|
}
|
|
775
747
|
}
|
|
776
748
|
}
|
|
777
749
|
};
|
|
778
|
-
var
|
|
779
|
-
for (var o = r > 1 ? void 0 : r ?
|
|
780
|
-
(
|
|
781
|
-
return r && o &&
|
|
782
|
-
},
|
|
783
|
-
const
|
|
784
|
-
let G = class extends
|
|
785
|
-
constructor(e, t, n, r, o, s,
|
|
786
|
-
super(), this._commandService = e, this._menuManagerService = t, this._dialogService = n, this._layoutService = r, this._uiPartsService = o, this._sheetRenderService = s, this._localeService =
|
|
750
|
+
var Un = Object.defineProperty, An = Object.getOwnPropertyDescriptor, $n = (e, t, n, r) => {
|
|
751
|
+
for (var o = r > 1 ? void 0 : r ? An(t, n) : t, s = e.length - 1, i; s >= 0; s--)
|
|
752
|
+
(i = e[s]) && (o = (r ? i(t, n, o) : i(o)) || o);
|
|
753
|
+
return r && o && Un(t, n, o), o;
|
|
754
|
+
}, R = (e, t) => (n, r) => t(n, r, e);
|
|
755
|
+
const _e = "custom-sort-dialog", Bn = 560;
|
|
756
|
+
let G = class extends Xe {
|
|
757
|
+
constructor(e, t, n, r, o, s, i, l, u, m) {
|
|
758
|
+
super(), this._commandService = e, this._menuManagerService = t, this._dialogService = n, this._layoutService = r, this._uiPartsService = o, this._sheetRenderService = s, this._localeService = i, this._sheetsSortUIService = l, this._injector = u, this._componentManager = m, this._initCommands(), this._initMenu(), this._initUI();
|
|
787
759
|
}
|
|
788
760
|
_initMenu() {
|
|
789
|
-
this._menuManagerService.mergeMenu(
|
|
761
|
+
this._menuManagerService.mergeMenu(kn);
|
|
790
762
|
}
|
|
791
763
|
_initCommands() {
|
|
792
764
|
[
|
|
765
|
+
ne,
|
|
793
766
|
re,
|
|
794
767
|
oe,
|
|
795
768
|
se,
|
|
@@ -798,67 +771,66 @@ let G = class extends Qe {
|
|
|
798
771
|
ae,
|
|
799
772
|
le,
|
|
800
773
|
de,
|
|
801
|
-
ue
|
|
802
|
-
|
|
803
|
-
].forEach((e) => this.disposeWithMe(this._commandService.registerCommand(e))), this.disposeWithMe(this._sheetRenderService.registerSkeletonChangingMutations(st.id));
|
|
774
|
+
ue
|
|
775
|
+
].forEach((e) => this.disposeWithMe(this._commandService.registerCommand(e))), this.disposeWithMe(this._sheetRenderService.registerSkeletonChangingMutations(nt.id));
|
|
804
776
|
}
|
|
805
777
|
_initUI() {
|
|
806
|
-
this.disposeWithMe(this._componentManager.register("CustomSortPanel",
|
|
778
|
+
this.disposeWithMe(this._componentManager.register("CustomSortPanel", _n)), this.disposeWithMe(this._uiPartsService.registerComponent(ct.FILTER_PANEL_EMBED_POINT, () => Ke(Mn, this._injector))), this.disposeWithMe(this._componentManager.register(j, ee)), this.disposeWithMe(this._componentManager.register(me, De)), this.disposeWithMe(this._componentManager.register(he, te)), this.disposeWithMe(this._componentManager.register(ge, He)), this.disposeWithMe(this._componentManager.register(Ce, Ne)), this._sheetsSortUIService.customSortState$.pipe(pt(this.dispose$)).subscribe((e) => {
|
|
807
779
|
e && e.show && e.location ? this._openCustomSortPanel(e.location) : e && !(e != null && e.show) && this._closePanel();
|
|
808
780
|
});
|
|
809
781
|
}
|
|
810
782
|
_openCustomSortPanel(e) {
|
|
811
783
|
this._dialogService.open({
|
|
812
|
-
id:
|
|
784
|
+
id: _e,
|
|
813
785
|
draggable: !0,
|
|
814
|
-
width:
|
|
815
|
-
title: { title: `${this._localeService.t("sheets-sort.general.sort-custom")}: ${
|
|
786
|
+
width: Bn,
|
|
787
|
+
title: { title: `${this._localeService.t("sheets-sort.general.sort-custom")}: ${ot(e.range)}` },
|
|
816
788
|
children: { label: "CustomSortPanel" },
|
|
817
789
|
destroyOnClose: !0,
|
|
818
|
-
defaultPosition:
|
|
790
|
+
defaultPosition: Fn(),
|
|
819
791
|
preservePositionOnDestroy: !1,
|
|
820
792
|
onClose: () => this._closePanel(),
|
|
821
793
|
mask: !0
|
|
822
794
|
});
|
|
823
795
|
}
|
|
824
796
|
_closePanel() {
|
|
825
|
-
this._dialogService.close(
|
|
797
|
+
this._dialogService.close(_e), queueMicrotask(() => this._layoutService.focus());
|
|
826
798
|
}
|
|
827
799
|
};
|
|
828
|
-
G =
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
800
|
+
G = $n([
|
|
801
|
+
R(0, Me),
|
|
802
|
+
R(1, ht),
|
|
803
|
+
R(2, gt),
|
|
804
|
+
R(3, Ct),
|
|
805
|
+
R(4, St),
|
|
806
|
+
R(5, T(it)),
|
|
807
|
+
R(6, T(A)),
|
|
808
|
+
R(7, T(C)),
|
|
809
|
+
R(8, T(xe)),
|
|
810
|
+
R(9, T(mt))
|
|
839
811
|
], G);
|
|
840
|
-
function
|
|
812
|
+
function Fn() {
|
|
841
813
|
return { x: 0, y: 0 };
|
|
842
814
|
}
|
|
843
|
-
var
|
|
844
|
-
for (var o = r > 1 ? void 0 : r ?
|
|
845
|
-
(
|
|
846
|
-
return r && o &&
|
|
847
|
-
},
|
|
848
|
-
const
|
|
849
|
-
let W = class extends
|
|
850
|
-
constructor(e =
|
|
815
|
+
var Be = Object.defineProperty, jn = Object.getOwnPropertyDescriptor, Vn = (e, t, n) => t in e ? Be(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, zn = (e, t, n, r) => {
|
|
816
|
+
for (var o = r > 1 ? void 0 : r ? jn(t, n) : t, s = e.length - 1, i; s >= 0; s--)
|
|
817
|
+
(i = e[s]) && (o = (r ? i(t, n, o) : i(o)) || o);
|
|
818
|
+
return r && o && Be(t, n, o), o;
|
|
819
|
+
}, Ie = (e, t) => (n, r) => t(n, r, e), Fe = (e, t, n) => Vn(e, typeof t != "symbol" ? t + "" : t, n);
|
|
820
|
+
const Zn = "SHEET_SORT_UI_PLUGIN";
|
|
821
|
+
let W = class extends Qe {
|
|
822
|
+
constructor(e = ve, t, n) {
|
|
851
823
|
super(), this._config = e, this._injector = t, this._configService = n;
|
|
852
|
-
const { ...r } =
|
|
824
|
+
const { ...r } = et(
|
|
853
825
|
{},
|
|
854
|
-
|
|
826
|
+
ve,
|
|
855
827
|
this._config
|
|
856
828
|
);
|
|
857
|
-
this._configService.setConfig(
|
|
829
|
+
this._configService.setConfig(bt, r);
|
|
858
830
|
}
|
|
859
831
|
onStarting() {
|
|
860
832
|
[
|
|
861
|
-
[
|
|
833
|
+
[C],
|
|
862
834
|
[G]
|
|
863
835
|
].forEach((e) => this._injector.add(e));
|
|
864
836
|
}
|
|
@@ -866,23 +838,23 @@ let W = class extends nt {
|
|
|
866
838
|
this._injector.get(G);
|
|
867
839
|
}
|
|
868
840
|
};
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
W =
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
841
|
+
Fe(W, "type", Y.UNIVER_SHEET);
|
|
842
|
+
Fe(W, "pluginName", Zn);
|
|
843
|
+
W = zn([
|
|
844
|
+
Je(rt),
|
|
845
|
+
Ie(1, T(xe)),
|
|
846
|
+
Ie(2, tt)
|
|
875
847
|
], W);
|
|
876
848
|
export {
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
849
|
+
ne as SortRangeAscCommand,
|
|
850
|
+
re as SortRangeAscExtCommand,
|
|
851
|
+
ae as SortRangeAscExtInCtxMenuCommand,
|
|
852
|
+
ce as SortRangeAscInCtxMenuCommand,
|
|
853
|
+
ie as SortRangeCustomCommand,
|
|
854
|
+
ue as SortRangeCustomInCtxMenuCommand,
|
|
855
|
+
oe as SortRangeDescCommand,
|
|
856
|
+
se as SortRangeDescExtCommand,
|
|
857
|
+
de as SortRangeDescExtInCtxMenuCommand,
|
|
858
|
+
le as SortRangeDescInCtxMenuCommand,
|
|
887
859
|
W as UniverSheetsSortUIPlugin
|
|
888
860
|
};
|