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