@univerjs/sheets-sort-ui 0.7.0 → 0.8.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 +1 -1
- package/lib/es/index.js +406 -393
- package/lib/index.css +1 -1
- package/lib/index.js +406 -393
- package/lib/types/controllers/sheets-sort.menu.d.ts +5 -5
- package/lib/types/locale/en-US.d.ts +45 -2
- package/lib/types/locale/fa-IR.d.ts +2 -2
- package/lib/types/locale/ru-RU.d.ts +2 -2
- package/lib/types/locale/vi-VN.d.ts +2 -2
- package/lib/types/locale/zh-CN.d.ts +2 -45
- package/lib/types/locale/zh-TW.d.ts +2 -2
- package/lib/umd/index.js +1 -1
- package/package.json +12 -12
package/lib/es/index.js
CHANGED
|
@@ -1,194 +1,194 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var K = (e, t, n) =>
|
|
4
|
-
import { LocaleService as P, IUniverInstanceService as
|
|
5
|
-
import { SheetsSortService as
|
|
6
|
-
import { serializeRange as
|
|
7
|
-
import { getCurrentRangeDisable$ as N, getCurrentExclusiveRangeInterest$ as
|
|
8
|
-
import { useDependency as E, IConfirmService as
|
|
9
|
-
import { BehaviorSubject as
|
|
10
|
-
import { jsxs as
|
|
11
|
-
import { SheetsSelectionsService as
|
|
12
|
-
import { RadioGroup as
|
|
13
|
-
import { forwardRef as y, useRef as
|
|
14
|
-
const
|
|
1
|
+
var Ve = Object.defineProperty;
|
|
2
|
+
var Ge = (e, t, n) => t in e ? Ve(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
+
var K = (e, t, n) => Ge(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
+
import { LocaleService as P, IUniverInstanceService as xe, ILogService as We, Inject as R, ICommandService as _e, Disposable as ze, UniverInstanceType as Y, Tools as Ye, LocaleType as J, CommandType as M, throttle as qe, Injector as Ie, RxDisposable as Xe, DependentOn as Ke, IConfigService as Je, Plugin as Qe, merge as et } from "@univerjs/core";
|
|
5
|
+
import { SheetsSortService as we, SortType as U, SortRangeCommand as tt, UniverSheetsSortPlugin as rt } from "@univerjs/sheets-sort";
|
|
6
|
+
import { serializeRange as nt } from "@univerjs/engine-formula";
|
|
7
|
+
import { getCurrentRangeDisable$ as N, getCurrentExclusiveRangeInterest$ as ot, SheetsRenderService as it, SheetsUIPart as st } from "@univerjs/sheets-ui";
|
|
8
|
+
import { useDependency as E, IConfirmService as ct, useObservable as at, MenuItemType as S, getMenuHiddenObservable as Me, ContextMenuPosition as lt, ContextMenuGroup as dt, RibbonDataGroup as ut, IMenuManagerService as ht, IDialogService as gt, ILayoutService as Ct, IUIPartsService as vt, ComponentManager as mt, connectInjector as ft } from "@univerjs/ui";
|
|
9
|
+
import { BehaviorSubject as St, takeUntil as pt } from "rxjs";
|
|
10
|
+
import { jsxs as C, jsx as c } from "react/jsx-runtime";
|
|
11
|
+
import { SheetsSelectionsService as yt, getPrimaryForRange as xt, SetSelectionsOperation as _t, expandToContinuousRange as fe, getSheetCommandTarget as It, RangeProtectionPermissionEditPoint as k, WorksheetSortPermission as L, WorksheetEditPermission as D, WorkbookEditablePermission as H } from "@univerjs/sheets";
|
|
12
|
+
import { RadioGroup as Re, Radio as V, Checkbox as wt, clsx as Ee, DraggableList as Mt, scrollbarClassName as be, Button as G, Dropdown as Rt, ButtonGroup as Et } from "@univerjs/design";
|
|
13
|
+
import { forwardRef as y, useRef as Te, createElement as x, useState as Z, useCallback as O, useEffect as Oe } from "react";
|
|
14
|
+
const bt = "sheets-sort-ui.config", Se = {};
|
|
15
15
|
var f = function() {
|
|
16
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 o in t) Object.prototype.hasOwnProperty.call(t, o) && (e[o] = t[o]);
|
|
20
20
|
}
|
|
21
21
|
return e;
|
|
22
22
|
}, f.apply(this, arguments);
|
|
23
|
-
},
|
|
23
|
+
}, Tt = 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 o = 0, r = Object.getOwnPropertySymbols(e); o < r.length; o++)
|
|
28
|
+
t.indexOf(r[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[o]) && (n[r[o]] = e[r[o]]);
|
|
29
29
|
return n;
|
|
30
|
-
},
|
|
31
|
-
var n = e.icon, r = e.id,
|
|
32
|
-
return
|
|
30
|
+
}, _ = y(function(e, t) {
|
|
31
|
+
var n = e.icon, r = e.id, o = e.className, i = e.extend, s = Tt(e, ["icon", "id", "className", "extend"]), a = "univerjs-icon univerjs-icon-".concat(r, " ").concat(o || "").trim(), l = Te("_".concat(kt()));
|
|
32
|
+
return Ne(n, "".concat(r), { defIds: n.defIds, idSuffix: l.current }, f({ ref: t, className: a }, s), i);
|
|
33
33
|
});
|
|
34
|
-
function
|
|
35
|
-
return
|
|
36
|
-
return
|
|
34
|
+
function Ne(e, t, n, r, o) {
|
|
35
|
+
return x(e.tag, f(f({ key: t }, Ot(e, n, o)), r), (Nt(e, n).children || []).map(function(i, s) {
|
|
36
|
+
return Ne(i, "".concat(t, "-").concat(e.tag, "-").concat(s), n, void 0, o);
|
|
37
37
|
}));
|
|
38
38
|
}
|
|
39
|
-
function
|
|
39
|
+
function Ot(e, t, n) {
|
|
40
40
|
var r = f({}, e.attrs);
|
|
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(
|
|
42
|
-
var
|
|
43
|
-
|
|
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(i) {
|
|
42
|
+
var s = i[0], a = i[1];
|
|
43
|
+
s === "mask" && typeof a == "string" && (r[s] = a.replace(/url\(#(.*)\)/, "url(#$1".concat(t.idSuffix, ")")));
|
|
44
44
|
});
|
|
45
|
-
var
|
|
46
|
-
return !
|
|
47
|
-
var
|
|
48
|
-
typeof
|
|
45
|
+
var o = t.defIds;
|
|
46
|
+
return !o || o.length === 0 || (e.tag === "use" && r["xlink:href"] && (r["xlink:href"] = r["xlink:href"] + t.idSuffix), Object.entries(r).forEach(function(i) {
|
|
47
|
+
var s = i[0], a = i[1];
|
|
48
|
+
typeof a == "string" && (r[s] = a.replace(/url\(#(.*)\)/, "url(#$1".concat(t.idSuffix, ")")));
|
|
49
49
|
})), r;
|
|
50
50
|
}
|
|
51
|
-
function
|
|
51
|
+
function Nt(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) ? f(f({}, e), { children: e.children.map(function(
|
|
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(o) {
|
|
54
|
+
return typeof o.attrs.id == "string" && r && r.includes(o.attrs.id) ? f(f({}, o), { attrs: f(f({}, o.attrs), { id: o.attrs.id + t.idSuffix }) }) : o;
|
|
55
55
|
}) }) : e;
|
|
56
56
|
}
|
|
57
|
-
function
|
|
57
|
+
function kt() {
|
|
58
58
|
return Math.random().toString(36).substring(2, 8);
|
|
59
59
|
}
|
|
60
|
-
|
|
61
|
-
var
|
|
62
|
-
return _
|
|
63
|
-
id: "ascending-
|
|
64
|
-
ref: t,
|
|
65
|
-
icon: Nt
|
|
66
|
-
}));
|
|
67
|
-
});
|
|
68
|
-
ee.displayName = "AscendingSingle";
|
|
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
|
-
id: "check-mark-single",
|
|
72
|
-
ref: t,
|
|
73
|
-
icon: kt
|
|
74
|
-
}));
|
|
75
|
-
});
|
|
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
|
-
id: "custom-sort-single",
|
|
60
|
+
_.displayName = "UniverIcon";
|
|
61
|
+
var Lt = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", 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.67983C1.38967 9.34846 1.6583 9.07983 1.98967 9.07983H6.50138C6.74406 9.07983 6.96284 9.22602 7.05571 9.45022C7.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.1916C7.10138 14.5229 6.83276 14.7916 6.50138 14.7916H1.98967C1.74699 14.7916 1.52821 14.6454 1.43534 14.4212C1.34247 14.197 1.3938 13.9389 1.5654 13.7673L5.05286 10.2798H1.98967Z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", d: "M5.1846 1.86439C4.8641 0.989866 3.62725 0.989866 3.30674 1.86439L1.34882 7.20672C1.23479 7.51786 1.39458 7.86252 1.70571 7.97655C2.01684 8.09058 2.3615 7.93079 2.47553 7.61966L3.06159 6.02055L3.06338 6.02056H5.42975L6.01581 7.61966C6.12984 7.93079 6.4745 8.09058 6.78563 7.97655C7.09677 7.86252 7.25655 7.51786 7.14252 7.20672L5.1846 1.86439ZM4.98996 4.82056L4.24567 2.78971L3.50138 4.82056H4.98996Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, ee = y(function(e, t) {
|
|
62
|
+
return x(_, Object.assign({}, e, {
|
|
63
|
+
id: "ascending-icon",
|
|
80
64
|
ref: t,
|
|
81
65
|
icon: Lt
|
|
82
66
|
}));
|
|
83
67
|
});
|
|
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: "
|
|
86
|
-
return _
|
|
87
|
-
id: "
|
|
68
|
+
ee.displayName = "AscendingIcon";
|
|
69
|
+
var Dt = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", 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" } }] }, ke = y(function(e, t) {
|
|
70
|
+
return x(_, Object.assign({}, e, {
|
|
71
|
+
id: "check-mark-icon",
|
|
88
72
|
ref: t,
|
|
89
73
|
icon: Dt
|
|
90
74
|
}));
|
|
91
75
|
});
|
|
92
|
-
ke.displayName = "
|
|
93
|
-
var Ht = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "
|
|
94
|
-
return _
|
|
95
|
-
id: "
|
|
76
|
+
ke.displayName = "CheckMarkIcon";
|
|
77
|
+
var Ht = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", 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.5574C8.84322 12.5574 8.57458 12.2888 8.57457 11.9574L8.57439 7.79509C8.57438 7.46372 8.84299 7.19508 9.17436 7.19507C9.3281 7.19493 9.48196 7.25351 9.59925 7.3708L11.3465 9.11808C11.5808 9.3524 11.5808 9.7323 11.3465 9.96661C11.1122 10.2009 10.7323 10.2009 10.498 9.96661L9.77445 9.24306Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M6.22584 10.5094L6.22572 7.79514C6.22571 7.46377 6.49433 7.19513 6.8257 7.19512C7.15707 7.1951 7.42571 7.46372 7.42572 7.79509L7.4259 11.9574C7.42592 12.2888 7.1573 12.5574 6.82593 12.5574C6.67228 12.5575 6.51828 12.4989 6.40104 12.3817L4.65376 10.6344C4.41945 10.4001 4.41945 10.0202 4.65376 9.78588C4.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" } }] }, Le = y(function(e, t) {
|
|
78
|
+
return x(_, Object.assign({}, e, {
|
|
79
|
+
id: "custom-sort-icon",
|
|
96
80
|
ref: t,
|
|
97
81
|
icon: Ht
|
|
98
82
|
}));
|
|
99
83
|
});
|
|
100
|
-
|
|
101
|
-
var Ut = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "
|
|
102
|
-
return _
|
|
103
|
-
id: "
|
|
84
|
+
Le.displayName = "CustomSortIcon";
|
|
85
|
+
var Ut = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", 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 0.866699 5.9313 0.866699H10.069C10.4004 0.866699 10.669 1.13533 10.669 1.4667C10.669 1.79807 10.4004 2.0667 10.069 2.0667H5.9313C5.59993 2.0667 5.3313 1.79807 5.3313 1.4667Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M1.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.64443C14.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" } }] }, De = y(function(e, t) {
|
|
86
|
+
return x(_, Object.assign({}, e, {
|
|
87
|
+
id: "delete-empty-icon",
|
|
104
88
|
ref: t,
|
|
105
89
|
icon: Ut
|
|
106
90
|
}));
|
|
107
91
|
});
|
|
108
|
-
|
|
109
|
-
var Pt = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "
|
|
110
|
-
return _
|
|
111
|
-
id: "
|
|
92
|
+
De.displayName = "DeleteEmptyIcon";
|
|
93
|
+
var Pt = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", 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.67983C1.38967 9.34846 1.6583 9.07983 1.98967 9.07983H6.50138C6.74406 9.07983 6.96284 9.22602 7.05571 9.45022C7.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.1916C7.10138 14.5229 6.83276 14.7916 6.50138 14.7916H1.98967C1.74699 14.7916 1.52821 14.6454 1.43534 14.4212C1.34247 14.197 1.3938 13.9389 1.5654 13.7673L5.05286 10.2798H1.98967Z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", d: "M5.1846 1.86439C4.8641 0.989866 3.62725 0.989866 3.30674 1.86439L1.34882 7.20672C1.23479 7.51786 1.39458 7.86252 1.70571 7.97655C2.01684 8.09058 2.3615 7.93079 2.47553 7.61966L3.06159 6.02055L3.06338 6.02056H5.42975L6.01581 7.61966C6.12984 7.93079 6.4745 8.09058 6.78563 7.97655C7.09677 7.86252 7.25655 7.51786 7.14252 7.20672L5.1846 1.86439ZM4.98996 4.82056L4.24567 2.78971L3.50138 4.82056H4.98996Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, te = y(function(e, t) {
|
|
94
|
+
return x(_, Object.assign({}, e, {
|
|
95
|
+
id: "descending-icon",
|
|
112
96
|
ref: t,
|
|
113
97
|
icon: Pt
|
|
114
98
|
}));
|
|
115
99
|
});
|
|
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: "
|
|
118
|
-
return _
|
|
119
|
-
id: "
|
|
100
|
+
te.displayName = "DescendingIcon";
|
|
101
|
+
var At = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", 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" } }] }, He = y(function(e, t) {
|
|
102
|
+
return x(_, Object.assign({}, e, {
|
|
103
|
+
id: "expand-ascending-icon",
|
|
120
104
|
ref: t,
|
|
121
105
|
icon: At
|
|
122
106
|
}));
|
|
123
107
|
});
|
|
124
|
-
|
|
125
|
-
var $t = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "
|
|
126
|
-
return _
|
|
127
|
-
id: "
|
|
108
|
+
He.displayName = "ExpandAscendingIcon";
|
|
109
|
+
var $t = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", 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" } }] }, Ue = y(function(e, t) {
|
|
110
|
+
return x(_, Object.assign({}, e, {
|
|
111
|
+
id: "expand-descending-icon",
|
|
128
112
|
ref: t,
|
|
129
113
|
icon: $t
|
|
130
114
|
}));
|
|
131
115
|
});
|
|
132
|
-
|
|
133
|
-
var
|
|
134
|
-
return _
|
|
135
|
-
id: "
|
|
116
|
+
Ue.displayName = "ExpandDescendingIcon";
|
|
117
|
+
var Zt = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", 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
|
+
id: "increase-icon",
|
|
120
|
+
ref: t,
|
|
121
|
+
icon: Zt
|
|
122
|
+
}));
|
|
123
|
+
});
|
|
124
|
+
Q.displayName = "IncreaseIcon";
|
|
125
|
+
var jt = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", 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" } }] }, Pe = y(function(e, t) {
|
|
126
|
+
return x(_, Object.assign({}, e, {
|
|
127
|
+
id: "more-down-icon",
|
|
136
128
|
ref: t,
|
|
137
129
|
icon: jt
|
|
138
130
|
}));
|
|
139
131
|
});
|
|
140
|
-
|
|
132
|
+
Pe.displayName = "MoreDownIcon";
|
|
133
|
+
var Bt = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "mask", attrs: { id: "mask0_622_8", 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 4C7 3.44772 6.55228 3 6 3C5.44772 3 5 3.44772 5 4C5 4.55228 5.44772 5 6 5Z" } }, { tag: "path", attrs: { d: "M6 9C6.55228 9 7 8.55229 7 8C7 7.44772 6.55228 7 6 7C5.44772 7 5 7.44772 5 8C5 8.55229 5.44772 9 6 9Z" } }, { tag: "path", attrs: { d: "M7 12C7 12.5523 6.55228 13 6 13C5.44772 13 5 12.5523 5 12C5 11.4477 5.44772 11 6 11C6.55228 11 7 11.4477 7 12Z" } }, { tag: "path", attrs: { d: "M10 5C10.5523 5 11 4.55228 11 4C11 3.44772 10.5523 3 10 3C9.44771 3 9 3.44772 9 4C9 4.55228 9.44771 5 10 5Z" } }, { tag: "path", attrs: { d: "M11 8C11 8.55229 10.5523 9 10 9C9.44771 9 9 8.55229 9 8C9 7.44772 9.44771 7 10 7C10.5523 7 11 7.44772 11 8Z" } }, { tag: "path", attrs: { d: "M10 13C10.5523 13 11 12.5523 11 12C11 11.4477 10.5523 11 10 11C9.44771 11 9 11.4477 9 12C9 12.5523 9.44771 13 10 13Z" } }] }] }, Ae = y(function(e, t) {
|
|
134
|
+
return x(_, Object.assign({}, e, {
|
|
135
|
+
id: "sequence-icon",
|
|
136
|
+
ref: t,
|
|
137
|
+
icon: Bt
|
|
138
|
+
}));
|
|
139
|
+
});
|
|
140
|
+
Ae.displayName = "SequenceIcon";
|
|
141
141
|
const Ft = (e) => {
|
|
142
|
-
const [t, n] =
|
|
143
|
-
return /* @__PURE__ */
|
|
144
|
-
/* @__PURE__ */
|
|
145
|
-
/* @__PURE__ */
|
|
146
|
-
|
|
142
|
+
const [t, n] = Z("0"), r = E(P);
|
|
143
|
+
return /* @__PURE__ */ C("div", { className: "univer-text-sm", children: [
|
|
144
|
+
/* @__PURE__ */ c("div", { className: "extend-confirm-desc", children: r.t("sheets-sort.dialog.sort-reminder-desc") }),
|
|
145
|
+
/* @__PURE__ */ C(
|
|
146
|
+
Re,
|
|
147
147
|
{
|
|
148
148
|
className: "univer-mt-4",
|
|
149
149
|
value: t,
|
|
150
150
|
direction: "vertical",
|
|
151
|
-
onChange: (
|
|
152
|
-
n(
|
|
151
|
+
onChange: (o) => {
|
|
152
|
+
n(o), e.onChange(o);
|
|
153
153
|
},
|
|
154
154
|
children: [
|
|
155
|
-
/* @__PURE__ */
|
|
156
|
-
/* @__PURE__ */
|
|
155
|
+
/* @__PURE__ */ c(V, { value: "0", children: r.t("sheets-sort.dialog.sort-reminder-no") }),
|
|
156
|
+
/* @__PURE__ */ c(V, { value: "1", children: r.t("sheets-sort.dialog.sort-reminder-ext") })
|
|
157
157
|
]
|
|
158
158
|
}
|
|
159
159
|
)
|
|
160
160
|
] });
|
|
161
161
|
};
|
|
162
|
-
var
|
|
163
|
-
for (var
|
|
164
|
-
(
|
|
165
|
-
return
|
|
166
|
-
},
|
|
167
|
-
const
|
|
162
|
+
var Vt = Object.getOwnPropertyDescriptor, Gt = (e, t, n, r) => {
|
|
163
|
+
for (var o = r > 1 ? void 0 : r ? Vt(t, n) : t, i = e.length - 1, s; i >= 0; i--)
|
|
164
|
+
(s = e[i]) && (o = s(o) || o);
|
|
165
|
+
return o;
|
|
166
|
+
}, T = (e, t) => (n, r) => t(n, r, e);
|
|
167
|
+
const F = {
|
|
168
168
|
MERGE_ERROR: "sheets-sort.error.merge-size",
|
|
169
169
|
EMPTY_ERROR: "sheets-sort.error.empty",
|
|
170
170
|
SINGLE_ERROR: "sheets-sort.error.single",
|
|
171
171
|
FORMULA_ARRAY: "sheets-sort.error.formula-array"
|
|
172
172
|
};
|
|
173
|
-
let g = class extends
|
|
174
|
-
constructor(t, n, r, i, s,
|
|
173
|
+
let g = class extends ze {
|
|
174
|
+
constructor(t, n, r, o, i, s, a) {
|
|
175
175
|
super();
|
|
176
|
-
K(this, "_customSortState$", new
|
|
176
|
+
K(this, "_customSortState$", new St(null));
|
|
177
177
|
K(this, "customSortState$", this._customSortState$.asObservable());
|
|
178
|
-
this._univerInstanceService = t, this._confirmService = n, this._logService = r, this._selectionManagerService =
|
|
178
|
+
this._univerInstanceService = t, this._confirmService = n, this._logService = r, this._selectionManagerService = o, this._sheetsSortService = i, this._localeService = s, this._commandService = a;
|
|
179
179
|
}
|
|
180
180
|
async triggerSortDirectly(t, n, r) {
|
|
181
|
-
const
|
|
182
|
-
if (!
|
|
181
|
+
const o = r || await this._detectSortLocation(n);
|
|
182
|
+
if (!o || !this._check(o))
|
|
183
183
|
return !1;
|
|
184
|
-
const
|
|
184
|
+
const s = {
|
|
185
185
|
orderRules: [{
|
|
186
186
|
type: t ? U.ASC : U.DESC,
|
|
187
|
-
colIndex:
|
|
187
|
+
colIndex: o.colIndex
|
|
188
188
|
}],
|
|
189
|
-
range:
|
|
189
|
+
range: o.range
|
|
190
190
|
};
|
|
191
|
-
return this._sheetsSortService.applySort(
|
|
191
|
+
return this._sheetsSortService.applySort(s, o.unitId, o.subUnitId), !0;
|
|
192
192
|
}
|
|
193
193
|
async triggerSortCustomize() {
|
|
194
194
|
const t = await this._detectSortLocation();
|
|
@@ -198,34 +198,34 @@ let g = class extends Ze {
|
|
|
198
198
|
return this._customSortState$.getValue();
|
|
199
199
|
}
|
|
200
200
|
getTitles(t) {
|
|
201
|
-
var l,
|
|
201
|
+
var l, u;
|
|
202
202
|
const n = (l = this.customSortState()) == null ? void 0 : l.location;
|
|
203
203
|
if (!n)
|
|
204
204
|
return [];
|
|
205
|
-
const { unitId: r, subUnitId:
|
|
206
|
-
if (!
|
|
205
|
+
const { unitId: r, subUnitId: o, range: i } = n, s = (u = this._univerInstanceService.getUnit(r)) == null ? void 0 : u.getSheetBySheetId(o);
|
|
206
|
+
if (!s)
|
|
207
207
|
return [];
|
|
208
|
-
const
|
|
209
|
-
return Array.from({ length:
|
|
208
|
+
const a = Wt(this._localeService);
|
|
209
|
+
return Array.from({ length: i.endColumn - i.startColumn + 1 }, (I, m) => {
|
|
210
210
|
var v;
|
|
211
|
-
const
|
|
211
|
+
const b = (v = s.getCell(i.startRow, m + i.startColumn)) == null ? void 0 : v.v;
|
|
212
212
|
return {
|
|
213
|
-
index:
|
|
214
|
-
label: t ? `${
|
|
213
|
+
index: m + i.startColumn,
|
|
214
|
+
label: t ? `${b != null ? b : a(m + i.startColumn)}` : a(m + i.startColumn)
|
|
215
215
|
};
|
|
216
216
|
});
|
|
217
217
|
}
|
|
218
218
|
setSelection(t, n, r) {
|
|
219
|
-
var
|
|
220
|
-
const
|
|
221
|
-
if (!
|
|
219
|
+
var s;
|
|
220
|
+
const o = (s = this._univerInstanceService.getUnit(t)) == null ? void 0 : s.getSheetBySheetId(n);
|
|
221
|
+
if (!o)
|
|
222
222
|
return;
|
|
223
|
-
const
|
|
223
|
+
const i = {
|
|
224
224
|
unitId: t,
|
|
225
225
|
subUnitId: n,
|
|
226
|
-
selections: [{ range: r, primary:
|
|
226
|
+
selections: [{ range: r, primary: xt(r, o), style: null }]
|
|
227
227
|
};
|
|
228
|
-
this._commandService.executeCommand(
|
|
228
|
+
this._commandService.executeCommand(_t.id, i);
|
|
229
229
|
}
|
|
230
230
|
async showCheckError(t) {
|
|
231
231
|
return await this._confirmService.confirm({
|
|
@@ -234,7 +234,7 @@ let g = class extends Ze {
|
|
|
234
234
|
title: this._localeService.t("info.tooltip")
|
|
235
235
|
},
|
|
236
236
|
children: {
|
|
237
|
-
title: /* @__PURE__ */
|
|
237
|
+
title: /* @__PURE__ */ c("div", { children: this._localeService.t(t) })
|
|
238
238
|
}
|
|
239
239
|
});
|
|
240
240
|
}
|
|
@@ -246,7 +246,7 @@ let g = class extends Ze {
|
|
|
246
246
|
title: this._localeService.t("sheets-sort.dialog.sort-reminder")
|
|
247
247
|
},
|
|
248
248
|
children: {
|
|
249
|
-
title: /* @__PURE__ */
|
|
249
|
+
title: /* @__PURE__ */ c(
|
|
250
250
|
Ft,
|
|
251
251
|
{
|
|
252
252
|
onChange: (r) => {
|
|
@@ -265,43 +265,43 @@ let g = class extends Ze {
|
|
|
265
265
|
this._customSortState$.next({ show: !1 });
|
|
266
266
|
}
|
|
267
267
|
_check(t) {
|
|
268
|
-
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(F.EMPTY_ERROR), !1) : (this.showCheckError(F.FORMULA_ARRAY), !1) : (this.showCheckError(F.MERGE_ERROR), !1) : (this.showCheckError(F.SINGLE_ERROR), !1);
|
|
269
269
|
}
|
|
270
270
|
async _detectSortLocation(t) {
|
|
271
|
-
const n = this._univerInstanceService.getCurrentUnitForType(Y.UNIVER_SHEET), r = n.getActiveSheet(),
|
|
272
|
-
if (!
|
|
271
|
+
const n = this._univerInstanceService.getCurrentUnitForType(Y.UNIVER_SHEET), r = n.getActiveSheet(), o = n.getUnitId(), i = r.getSheetId(), s = this._selectionManagerService.getCurrentLastSelection();
|
|
272
|
+
if (!s)
|
|
273
273
|
return null;
|
|
274
|
-
let
|
|
274
|
+
let a;
|
|
275
275
|
if (t === !0)
|
|
276
|
-
|
|
276
|
+
a = fe(s.range, { up: !0, down: !0, left: !0, right: !0 }, r), this.setSelection(o, i, a);
|
|
277
277
|
else if (t === !1)
|
|
278
|
-
|
|
278
|
+
a = s.range;
|
|
279
279
|
else {
|
|
280
280
|
const l = await this.showExtendConfirm();
|
|
281
281
|
if (l === "cancel")
|
|
282
282
|
return null;
|
|
283
|
-
l === "keep" ?
|
|
283
|
+
l === "keep" ? a = s.range : (a = fe(s.range, { up: !0, down: !0, left: !0, right: !0 }, r), this.setSelection(o, i, a));
|
|
284
284
|
}
|
|
285
285
|
return {
|
|
286
|
-
range:
|
|
287
|
-
unitId:
|
|
288
|
-
subUnitId:
|
|
289
|
-
colIndex:
|
|
286
|
+
range: a,
|
|
287
|
+
unitId: o,
|
|
288
|
+
subUnitId: i,
|
|
289
|
+
colIndex: s.primary.actualColumn
|
|
290
290
|
};
|
|
291
291
|
}
|
|
292
292
|
};
|
|
293
|
-
g =
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
293
|
+
g = Gt([
|
|
294
|
+
T(0, xe),
|
|
295
|
+
T(1, ct),
|
|
296
|
+
T(2, We),
|
|
297
|
+
T(3, R(yt)),
|
|
298
|
+
T(4, R(we)),
|
|
299
|
+
T(5, R(P)),
|
|
300
|
+
T(6, _e)
|
|
301
301
|
], g);
|
|
302
|
-
function
|
|
302
|
+
function Wt(e) {
|
|
303
303
|
return (t) => {
|
|
304
|
-
const n =
|
|
304
|
+
const n = Ye.chatAtABC(t);
|
|
305
305
|
switch (e.getCurrentLocale()) {
|
|
306
306
|
case J.ZH_CN:
|
|
307
307
|
return `"${n}"列`;
|
|
@@ -314,123 +314,123 @@ function zt(e) {
|
|
|
314
314
|
}
|
|
315
315
|
const re = {
|
|
316
316
|
id: "sheet.command.sort-range-asc",
|
|
317
|
-
type:
|
|
317
|
+
type: M.COMMAND,
|
|
318
318
|
handler: async (e) => await e.get(g).triggerSortDirectly(!0, !1)
|
|
319
319
|
}, ne = {
|
|
320
320
|
id: "sheet.command.sort-range-asc-ext",
|
|
321
|
-
type:
|
|
321
|
+
type: M.COMMAND,
|
|
322
322
|
handler: async (e) => await e.get(g).triggerSortDirectly(!0, !0)
|
|
323
|
-
},
|
|
323
|
+
}, oe = {
|
|
324
324
|
id: "sheet.command.sort-range-desc",
|
|
325
|
-
type:
|
|
325
|
+
type: M.COMMAND,
|
|
326
326
|
handler: async (e) => await e.get(g).triggerSortDirectly(!1, !1)
|
|
327
|
-
},
|
|
327
|
+
}, ie = {
|
|
328
328
|
id: "sheet.command.sort-range-desc-ext",
|
|
329
|
-
type:
|
|
329
|
+
type: M.COMMAND,
|
|
330
330
|
handler: async (e) => await e.get(g).triggerSortDirectly(!1, !0)
|
|
331
|
-
},
|
|
331
|
+
}, se = {
|
|
332
332
|
id: "sheet.command.sort-range-custom",
|
|
333
|
-
type:
|
|
333
|
+
type: M.COMMAND,
|
|
334
334
|
handler: async (e) => await e.get(g).triggerSortCustomize()
|
|
335
|
-
},
|
|
335
|
+
}, ce = {
|
|
336
336
|
id: "sheet.command.sort-range-asc-ctx",
|
|
337
|
-
type:
|
|
337
|
+
type: M.COMMAND,
|
|
338
338
|
handler: async (e) => await e.get(g).triggerSortDirectly(!0, !1)
|
|
339
|
-
},
|
|
339
|
+
}, ae = {
|
|
340
340
|
id: "sheet.command.sort-range-asc-ext-ctx",
|
|
341
|
-
type:
|
|
341
|
+
type: M.COMMAND,
|
|
342
342
|
handler: async (e) => await e.get(g).triggerSortDirectly(!0, !0)
|
|
343
343
|
}, le = {
|
|
344
344
|
id: "sheet.command.sort-range-desc-ctx",
|
|
345
|
-
type:
|
|
345
|
+
type: M.COMMAND,
|
|
346
346
|
handler: async (e) => await e.get(g).triggerSortDirectly(!1, !1)
|
|
347
|
-
},
|
|
347
|
+
}, de = {
|
|
348
348
|
id: "sheet.command.sort-range-desc-ext-ctx",
|
|
349
|
-
type:
|
|
349
|
+
type: M.COMMAND,
|
|
350
350
|
handler: async (e) => await e.get(g).triggerSortDirectly(!1, !0)
|
|
351
|
-
},
|
|
351
|
+
}, ue = {
|
|
352
352
|
id: "sheet.command.sort-range-custom-ctx",
|
|
353
|
-
type:
|
|
353
|
+
type: M.COMMAND,
|
|
354
354
|
handler: async (e) => await e.get(g).triggerSortCustomize()
|
|
355
355
|
};
|
|
356
|
-
function
|
|
357
|
-
const e = E(g), t =
|
|
358
|
-
return !t || !t.location ? null : /* @__PURE__ */
|
|
356
|
+
function zt() {
|
|
357
|
+
const e = E(g), t = at(e.customSortState$);
|
|
358
|
+
return !t || !t.location ? null : /* @__PURE__ */ c(Yt, { state: t });
|
|
359
359
|
}
|
|
360
|
-
function
|
|
361
|
-
const t = E(
|
|
362
|
-
{ type: U.ASC, colIndex:
|
|
363
|
-
]), q = O((
|
|
360
|
+
function Yt({ state: e }) {
|
|
361
|
+
const t = E(we), n = E(P), r = E(g), [o, i] = Z(!1), [s, a] = Z(0), l = Te(null), { range: u, unitId: I, subUnitId: m } = e.location, b = r.getTitles(o), [v, A] = Z([
|
|
362
|
+
{ type: U.ASC, colIndex: u.startColumn }
|
|
363
|
+
]), q = O((d, p) => {
|
|
364
364
|
const $ = [...v];
|
|
365
|
-
p === null ? $.splice(
|
|
365
|
+
p === null ? $.splice(d, 1) : $[d] = p, A($);
|
|
366
366
|
}, [v]), B = O(
|
|
367
|
-
|
|
368
|
-
const
|
|
369
|
-
p !== null && (
|
|
367
|
+
qe(() => {
|
|
368
|
+
const d = [...v], p = Xt(u, v);
|
|
369
|
+
p !== null && (d.push({ type: U.ASC, colIndex: p }), A(d));
|
|
370
370
|
}, 200),
|
|
371
|
-
[v,
|
|
372
|
-
), h = O((
|
|
373
|
-
t.applySort({ range:
|
|
374
|
-
}, [t, r,
|
|
371
|
+
[v, u]
|
|
372
|
+
), h = O((d, p) => {
|
|
373
|
+
t.applySort({ range: u, orderRules: d, hasTitle: p }), r.closeCustomSortPanel();
|
|
374
|
+
}, [t, r, u]), X = O(() => {
|
|
375
375
|
r.closeCustomSortPanel();
|
|
376
|
-
}, [r]),
|
|
377
|
-
|
|
378
|
-
}, [r,
|
|
379
|
-
|
|
376
|
+
}, [r]), Be = O((d) => {
|
|
377
|
+
i(d), d ? r.setSelection(I, m, { ...u, startRow: u.startRow + 1 }) : r.setSelection(I, m, u);
|
|
378
|
+
}, [r, u, m, I]);
|
|
379
|
+
Oe(() => {
|
|
380
380
|
l.current && v.length > 5 && (l.current.scrollTop = l.current.scrollHeight);
|
|
381
381
|
}, [v]);
|
|
382
|
-
const Fe = v.length <
|
|
383
|
-
return /* @__PURE__ */
|
|
384
|
-
/* @__PURE__ */
|
|
385
|
-
|
|
382
|
+
const Fe = v.length < b.length, me = v.map((d) => ({ ...d, id: `${d.colIndex}` }));
|
|
383
|
+
return /* @__PURE__ */ C("div", { children: [
|
|
384
|
+
/* @__PURE__ */ C("div", { onMouseDown: (d) => {
|
|
385
|
+
d.stopPropagation();
|
|
386
386
|
}, children: [
|
|
387
|
-
/* @__PURE__ */
|
|
388
|
-
/* @__PURE__ */
|
|
389
|
-
Fe ? /* @__PURE__ */
|
|
387
|
+
/* @__PURE__ */ C("div", { className: "univer-flex univer-items-center univer-justify-between", children: [
|
|
388
|
+
/* @__PURE__ */ c(wt, { checked: o, onChange: (d) => Be(!!d), children: n.t("sheets-sort.dialog.first-row-check") }),
|
|
389
|
+
Fe ? /* @__PURE__ */ C(
|
|
390
390
|
"div",
|
|
391
391
|
{
|
|
392
392
|
className: "univer-flex univer-cursor-pointer univer-select-none univer-items-center univer-text-base",
|
|
393
393
|
onClick: B,
|
|
394
394
|
children: [
|
|
395
|
-
/* @__PURE__ */
|
|
396
|
-
/* @__PURE__ */
|
|
395
|
+
/* @__PURE__ */ c(Q, {}),
|
|
396
|
+
/* @__PURE__ */ c("span", { className: "univer-ml-1.5", children: n.t("sheets-sort.dialog.add-condition") })
|
|
397
397
|
]
|
|
398
398
|
}
|
|
399
|
-
) : /* @__PURE__ */
|
|
399
|
+
) : /* @__PURE__ */ C(
|
|
400
400
|
"div",
|
|
401
401
|
{
|
|
402
402
|
className: "univer-flex univer-cursor-pointer univer-select-none univer-items-center univer-text-base univer-text-primary-500 disabled:univer-cursor-not-allowed disabled:univer-divide-opacity-30 disabled:univer-text-gray-800",
|
|
403
403
|
children: [
|
|
404
|
-
/* @__PURE__ */
|
|
405
|
-
/* @__PURE__ */
|
|
404
|
+
/* @__PURE__ */ c(Q, {}),
|
|
405
|
+
/* @__PURE__ */ c("span", { className: "univer-ml-1.5 univer-text-xs", children: n.t("sheets-sort.dialog.add-condition") })
|
|
406
406
|
]
|
|
407
407
|
}
|
|
408
408
|
)
|
|
409
409
|
] }),
|
|
410
|
-
/* @__PURE__ */
|
|
410
|
+
/* @__PURE__ */ c(
|
|
411
411
|
"div",
|
|
412
412
|
{
|
|
413
|
-
className: "univer-max-h-[310px] univer-overflow-y-auto univer-overflow-x-hidden",
|
|
414
|
-
onScroll: (u) => {
|
|
415
|
-
const p = u.currentTarget.scrollTop;
|
|
416
|
-
c(p);
|
|
417
|
-
},
|
|
418
413
|
ref: l,
|
|
419
|
-
|
|
414
|
+
className: Ee("univer-max-h-[310px] univer-overflow-y-auto univer-overflow-x-hidden", be),
|
|
415
|
+
onScroll: (d) => {
|
|
416
|
+
const p = d.currentTarget.scrollTop;
|
|
417
|
+
a(p);
|
|
418
|
+
},
|
|
419
|
+
children: /* @__PURE__ */ c(
|
|
420
420
|
Mt,
|
|
421
421
|
{
|
|
422
|
-
list:
|
|
422
|
+
list: me,
|
|
423
423
|
onListChange: A,
|
|
424
424
|
idKey: "id",
|
|
425
425
|
draggableHandle: "[data-u-comp=sort-panel-item-handler]",
|
|
426
|
-
itemRender: (
|
|
427
|
-
|
|
426
|
+
itemRender: (d) => /* @__PURE__ */ c(
|
|
427
|
+
qt,
|
|
428
428
|
{
|
|
429
|
-
titles:
|
|
430
|
-
list:
|
|
431
|
-
item:
|
|
429
|
+
titles: b,
|
|
430
|
+
list: me,
|
|
431
|
+
item: d,
|
|
432
432
|
onChange: (p, $) => q($, p),
|
|
433
|
-
scrollPosition:
|
|
433
|
+
scrollPosition: s
|
|
434
434
|
}
|
|
435
435
|
),
|
|
436
436
|
rowHeight: 32,
|
|
@@ -440,163 +440,163 @@ function Gt({ state: e }) {
|
|
|
440
440
|
}
|
|
441
441
|
)
|
|
442
442
|
] }),
|
|
443
|
-
/* @__PURE__ */
|
|
444
|
-
/* @__PURE__ */
|
|
445
|
-
|
|
443
|
+
/* @__PURE__ */ C("div", { className: "univer-mt-5 univer-flex univer-justify-end", children: [
|
|
444
|
+
/* @__PURE__ */ c(
|
|
445
|
+
G,
|
|
446
446
|
{
|
|
447
447
|
className: "univer-ml-3",
|
|
448
448
|
onClick: () => X(),
|
|
449
449
|
children: n.t("sheets-sort.dialog.cancel")
|
|
450
450
|
}
|
|
451
451
|
),
|
|
452
|
-
/* @__PURE__ */
|
|
453
|
-
|
|
452
|
+
/* @__PURE__ */ c(
|
|
453
|
+
G,
|
|
454
454
|
{
|
|
455
455
|
className: "univer-ml-3",
|
|
456
456
|
variant: "primary",
|
|
457
|
-
onClick: () => h(v,
|
|
457
|
+
onClick: () => h(v, o),
|
|
458
458
|
children: n.t("sheets-sort.dialog.confirm")
|
|
459
459
|
}
|
|
460
460
|
)
|
|
461
461
|
] })
|
|
462
462
|
] });
|
|
463
463
|
}
|
|
464
|
-
function
|
|
464
|
+
function qt(e) {
|
|
465
465
|
var B;
|
|
466
|
-
const { list: t, item: n, titles: r, onChange:
|
|
467
|
-
|
|
468
|
-
}, [l, n,
|
|
469
|
-
|
|
466
|
+
const { list: t, item: n, titles: r, onChange: o, scrollPosition: i } = e, s = E(P), a = r.filter((h) => !t.some((X) => X.colIndex === h.index) || h.index === n.colIndex), l = t.findIndex((h) => h.colIndex === n.colIndex), u = O((h) => {
|
|
467
|
+
o({ ...n, colIndex: h.index }, l), m(!1);
|
|
468
|
+
}, [l, n, o]), [I, m] = Z(!1), b = (h) => {
|
|
469
|
+
m(h);
|
|
470
470
|
};
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
}, [
|
|
474
|
-
const v = t.length > 1, A = (B = r.find((h) => h.index === n.colIndex)) == null ? void 0 : B.label, q =
|
|
475
|
-
return /* @__PURE__ */
|
|
476
|
-
/* @__PURE__ */
|
|
477
|
-
/* @__PURE__ */
|
|
471
|
+
Oe(() => {
|
|
472
|
+
m(!1);
|
|
473
|
+
}, [i]);
|
|
474
|
+
const v = t.length > 1, A = (B = r.find((h) => h.index === n.colIndex)) == null ? void 0 : B.label, q = s.getCurrentLocale() === J.ZH_CN ? "univer-flex univer-px-5" : "univer-flex univer-px-2.5";
|
|
475
|
+
return /* @__PURE__ */ C("div", { className: "univer-flex univer-items-center", children: [
|
|
476
|
+
/* @__PURE__ */ C("div", { className: "univer-flex univer-items-center", children: [
|
|
477
|
+
/* @__PURE__ */ c(
|
|
478
478
|
"div",
|
|
479
479
|
{
|
|
480
480
|
"data-u-comp": "sort-panel-item-handler",
|
|
481
481
|
className: "univer-flex univer-cursor-pointer univer-items-center univer-justify-center univer-text-base univer-text-gray-700",
|
|
482
|
-
children: /* @__PURE__ */
|
|
482
|
+
children: /* @__PURE__ */ c(Ae, {})
|
|
483
483
|
}
|
|
484
484
|
),
|
|
485
|
-
/* @__PURE__ */
|
|
486
|
-
|
|
485
|
+
/* @__PURE__ */ c("div", { children: /* @__PURE__ */ c(
|
|
486
|
+
Rt,
|
|
487
487
|
{
|
|
488
488
|
align: "start",
|
|
489
|
-
overlay: /* @__PURE__ */
|
|
489
|
+
overlay: /* @__PURE__ */ c(
|
|
490
490
|
"ul",
|
|
491
491
|
{
|
|
492
|
-
className: "univer-my-0 univer-box-border univer-grid univer-max-h-[310px] univer-items-center univer-gap-1 univer-overflow-y-auto univer-overflow-x-hidden univer-rounded-lg univer-border univer-bg-white univer-p-1 univer-text-base univer-shadow-lg",
|
|
493
|
-
children:
|
|
492
|
+
className: Ee("univer-my-0 univer-box-border univer-grid univer-max-h-[310px] univer-items-center univer-gap-1 univer-overflow-y-auto univer-overflow-x-hidden univer-rounded-lg univer-border univer-bg-white univer-p-1 univer-text-base univer-shadow-lg", be),
|
|
493
|
+
children: a.map((h) => /* @__PURE__ */ C(
|
|
494
494
|
"li",
|
|
495
495
|
{
|
|
496
|
-
onClick: () =>
|
|
497
|
-
className: "univer-relative univer-box-border univer-flex univer-h-7 univer-cursor-pointer univer-list-none univer-items-center univer-justify-between univer-rounded univer-px-2 univer-text-sm univer-transition-all hover:univer-bg-gray-100",
|
|
496
|
+
onClick: () => u(h),
|
|
497
|
+
className: "univer-relative univer-box-border univer-flex univer-h-7 univer-cursor-pointer univer-list-none univer-items-center univer-justify-between univer-rounded univer-px-2 univer-text-sm univer-transition-all dark:hover:!univer-bg-gray-700 hover:univer-bg-gray-100",
|
|
498
498
|
children: [
|
|
499
|
-
/* @__PURE__ */
|
|
500
|
-
|
|
501
|
-
{
|
|
502
|
-
className: "univer-max-w-[220px] univer-truncate",
|
|
503
|
-
children: h.label
|
|
504
|
-
}
|
|
505
|
-
),
|
|
506
|
-
/* @__PURE__ */ a("span", { children: h.index === n.colIndex && /* @__PURE__ */ a(Oe, {}) })
|
|
499
|
+
/* @__PURE__ */ c("span", { className: "univer-max-w-[220px] univer-truncate", children: h.label }),
|
|
500
|
+
/* @__PURE__ */ c("span", { children: h.index === n.colIndex && /* @__PURE__ */ c(ke, {}) })
|
|
507
501
|
]
|
|
508
502
|
},
|
|
509
503
|
h.index
|
|
510
504
|
))
|
|
511
505
|
}
|
|
512
506
|
),
|
|
513
|
-
open:
|
|
514
|
-
onOpenChange:
|
|
515
|
-
children: /* @__PURE__ */
|
|
507
|
+
open: I,
|
|
508
|
+
onOpenChange: b,
|
|
509
|
+
children: /* @__PURE__ */ C(
|
|
516
510
|
"div",
|
|
517
511
|
{
|
|
518
|
-
className: "univer-ml-2 univer-flex univer-w-[236px] univer-items-center univer-justify-between univer-overflow-hidden univer-rounded-md univer-border univer-border-gray-200 univer-px-2.5 univer-py-1.5 univer-text-sm univer-text-gray-900 dark
|
|
512
|
+
className: "univer-ml-2 univer-flex univer-w-[236px] univer-items-center univer-justify-between univer-overflow-hidden univer-rounded-md univer-border univer-border-gray-200 univer-px-2.5 univer-py-1.5 univer-text-sm univer-text-gray-900 dark:!univer-text-white",
|
|
519
513
|
children: [
|
|
520
|
-
/* @__PURE__ */
|
|
514
|
+
/* @__PURE__ */ c(
|
|
521
515
|
"span",
|
|
522
516
|
{
|
|
523
517
|
className: "univer-max-w-[220px] univer-truncate",
|
|
524
518
|
children: A
|
|
525
519
|
}
|
|
526
520
|
),
|
|
527
|
-
/* @__PURE__ */
|
|
521
|
+
/* @__PURE__ */ c(Pe, {})
|
|
528
522
|
]
|
|
529
523
|
}
|
|
530
524
|
)
|
|
531
525
|
}
|
|
532
526
|
) })
|
|
533
527
|
] }),
|
|
534
|
-
/* @__PURE__ */
|
|
535
|
-
|
|
528
|
+
/* @__PURE__ */ c("div", { children: /* @__PURE__ */ C(
|
|
529
|
+
Re,
|
|
536
530
|
{
|
|
537
531
|
className: q,
|
|
538
532
|
value: n.type,
|
|
539
533
|
onChange: (h) => {
|
|
540
|
-
|
|
534
|
+
o({ ...n, type: h }, l);
|
|
541
535
|
},
|
|
542
536
|
children: [
|
|
543
|
-
/* @__PURE__ */
|
|
544
|
-
/* @__PURE__ */
|
|
537
|
+
/* @__PURE__ */ c(V, { value: U.ASC, children: s.t("sheets-sort.general.sort-asc") }),
|
|
538
|
+
/* @__PURE__ */ c(V, { value: U.DESC, children: s.t("sheets-sort.general.sort-desc") })
|
|
545
539
|
]
|
|
546
540
|
}
|
|
547
541
|
) }),
|
|
548
|
-
/* @__PURE__ */
|
|
542
|
+
/* @__PURE__ */ c("div", { className: "univer-absolute univer-right-0 univer-cursor-pointer univer-text-sm univer-s-[14px]", children: v && /* @__PURE__ */ c(De, { onClick: () => o(null, l) }) })
|
|
549
543
|
] });
|
|
550
544
|
}
|
|
551
|
-
function
|
|
552
|
-
const { startColumn: n, endColumn: r } = e,
|
|
553
|
-
for (let
|
|
554
|
-
if (!
|
|
555
|
-
return
|
|
545
|
+
function Xt(e, t) {
|
|
546
|
+
const { startColumn: n, endColumn: r } = e, o = new Set(t.map((i) => i == null ? void 0 : i.colIndex));
|
|
547
|
+
for (let i = n; i <= r; i++)
|
|
548
|
+
if (!o.has(i))
|
|
549
|
+
return i;
|
|
556
550
|
return null;
|
|
557
551
|
}
|
|
558
|
-
function
|
|
559
|
-
const { range: t, colIndex: n, onClose: r } = e,
|
|
560
|
-
const { unitId:
|
|
561
|
-
if (t &&
|
|
562
|
-
const
|
|
563
|
-
|
|
552
|
+
function Kt(e) {
|
|
553
|
+
const { range: t, colIndex: n, onClose: r } = e, o = E(g), i = E(xe), s = E(P), a = O((l) => {
|
|
554
|
+
const { unitId: u, subUnitId: I } = It(i) || {};
|
|
555
|
+
if (t && u && I) {
|
|
556
|
+
const m = { ...t, startRow: t.startRow + 1 };
|
|
557
|
+
o.triggerSortDirectly(l, !1, { unitId: u, subUnitId: I, range: m, colIndex: n });
|
|
564
558
|
} else
|
|
565
|
-
throw new Error(`Cannot find the target to sort. unitId: ${
|
|
559
|
+
throw new Error(`Cannot find the target to sort. unitId: ${u}, subUnitId: ${I}, range: ${t}, colIndex: ${n}`);
|
|
566
560
|
r();
|
|
567
|
-
}, [t, n,
|
|
568
|
-
return /* @__PURE__ */
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
561
|
+
}, [t, n, o, i, r]);
|
|
562
|
+
return /* @__PURE__ */ C(
|
|
563
|
+
Et,
|
|
564
|
+
{
|
|
565
|
+
className: "univer-mb-3 univer-grid univer-w-full univer-grid-flow-col univer-grid-cols-2 univer-gap-2",
|
|
566
|
+
children: [
|
|
567
|
+
/* @__PURE__ */ C(G, { onClick: () => a(!0), children: [
|
|
568
|
+
/* @__PURE__ */ c(ee, {}),
|
|
569
|
+
s.t("sheets-sort.general.sort-asc")
|
|
570
|
+
] }),
|
|
571
|
+
/* @__PURE__ */ C(G, { onClick: () => a(!1), children: [
|
|
572
|
+
/* @__PURE__ */ c(te, {}),
|
|
573
|
+
s.t("sheets-sort.general.sort-desc")
|
|
574
|
+
] })
|
|
575
|
+
]
|
|
576
|
+
}
|
|
577
|
+
);
|
|
578
578
|
}
|
|
579
|
-
const
|
|
580
|
-
function
|
|
579
|
+
const $e = "sheet.menu.sheets-sort", Ze = "sheet.menu.sheets-sort-ctx", j = "AscendingIcon", he = "ExpandAscendingIcon", ge = "DescendingIcon", Ce = "ExpandDescendingIcon", ve = "CustomSortIcon";
|
|
580
|
+
function Jt(e) {
|
|
581
581
|
return {
|
|
582
|
-
id:
|
|
582
|
+
id: $e,
|
|
583
583
|
type: S.SUBITEMS,
|
|
584
|
-
icon:
|
|
584
|
+
icon: j,
|
|
585
585
|
tooltip: "sheets-sort.general.sort",
|
|
586
|
-
hidden$:
|
|
586
|
+
hidden$: Me(e, Y.UNIVER_SHEET),
|
|
587
587
|
disabled$: N(e, { workbookTypes: [H], worksheetTypes: [L, D], rangeTypes: [k] })
|
|
588
588
|
};
|
|
589
589
|
}
|
|
590
|
-
function
|
|
590
|
+
function Qt(e) {
|
|
591
591
|
return {
|
|
592
592
|
id: re.id,
|
|
593
|
-
icon:
|
|
593
|
+
icon: j,
|
|
594
594
|
title: "sheets-sort.general.sort-asc-cur",
|
|
595
595
|
type: S.BUTTON,
|
|
596
|
-
hidden$:
|
|
596
|
+
hidden$: ot(e)
|
|
597
597
|
};
|
|
598
598
|
}
|
|
599
|
-
function
|
|
599
|
+
function er(e) {
|
|
600
600
|
return {
|
|
601
601
|
id: ne.id,
|
|
602
602
|
title: "sheets-sort.general.sort-asc-ext",
|
|
@@ -604,37 +604,37 @@ function Jt(e) {
|
|
|
604
604
|
type: S.BUTTON
|
|
605
605
|
};
|
|
606
606
|
}
|
|
607
|
-
function
|
|
607
|
+
function tr(e) {
|
|
608
608
|
return {
|
|
609
|
-
id:
|
|
609
|
+
id: oe.id,
|
|
610
610
|
title: "sheets-sort.general.sort-desc-cur",
|
|
611
611
|
icon: ge,
|
|
612
612
|
type: S.BUTTON
|
|
613
613
|
};
|
|
614
614
|
}
|
|
615
|
-
function
|
|
615
|
+
function rr(e) {
|
|
616
616
|
return {
|
|
617
|
-
id:
|
|
617
|
+
id: ie.id,
|
|
618
618
|
title: "sheets-sort.general.sort-desc-ext",
|
|
619
|
-
icon:
|
|
619
|
+
icon: Ce,
|
|
620
620
|
type: S.BUTTON
|
|
621
621
|
};
|
|
622
622
|
}
|
|
623
|
-
function
|
|
623
|
+
function nr(e) {
|
|
624
624
|
return {
|
|
625
|
-
id:
|
|
625
|
+
id: se.id,
|
|
626
626
|
title: "sheets-sort.general.sort-custom",
|
|
627
627
|
type: S.BUTTON,
|
|
628
628
|
icon: ve
|
|
629
629
|
};
|
|
630
630
|
}
|
|
631
|
-
function
|
|
631
|
+
function or(e) {
|
|
632
632
|
return {
|
|
633
|
-
id:
|
|
633
|
+
id: Ze,
|
|
634
634
|
title: "sheets-sort.general.sort",
|
|
635
635
|
type: S.SUBITEMS,
|
|
636
|
-
icon:
|
|
637
|
-
hidden$:
|
|
636
|
+
icon: j,
|
|
637
|
+
hidden$: Me(e, Y.UNIVER_SHEET),
|
|
638
638
|
disabled$: N(e, {
|
|
639
639
|
workbookTypes: [H],
|
|
640
640
|
worksheetTypes: [L, D],
|
|
@@ -642,25 +642,25 @@ function rr(e) {
|
|
|
642
642
|
})
|
|
643
643
|
};
|
|
644
644
|
}
|
|
645
|
-
function
|
|
645
|
+
function ir(e) {
|
|
646
646
|
return {
|
|
647
|
-
id:
|
|
647
|
+
id: ce.id,
|
|
648
648
|
title: "sheets-sort.general.sort-asc-cur",
|
|
649
649
|
type: S.BUTTON,
|
|
650
|
-
icon:
|
|
650
|
+
icon: j,
|
|
651
651
|
disabled$: N(e, { workbookTypes: [H], worksheetTypes: [L, D], rangeTypes: [k] })
|
|
652
652
|
};
|
|
653
653
|
}
|
|
654
|
-
function
|
|
654
|
+
function sr(e) {
|
|
655
655
|
return {
|
|
656
|
-
id:
|
|
656
|
+
id: ae.id,
|
|
657
657
|
title: "sheets-sort.general.sort-asc-ext",
|
|
658
658
|
type: S.BUTTON,
|
|
659
659
|
icon: he,
|
|
660
660
|
disabled$: N(e, { workbookTypes: [H], worksheetTypes: [L, D], rangeTypes: [k] })
|
|
661
661
|
};
|
|
662
662
|
}
|
|
663
|
-
function
|
|
663
|
+
function cr(e) {
|
|
664
664
|
return {
|
|
665
665
|
id: le.id,
|
|
666
666
|
title: "sheets-sort.general.sort-desc-cur",
|
|
@@ -669,109 +669,122 @@ function sr(e) {
|
|
|
669
669
|
disabled$: N(e, { workbookTypes: [H], worksheetTypes: [L, D], rangeTypes: [k] })
|
|
670
670
|
};
|
|
671
671
|
}
|
|
672
|
-
function
|
|
672
|
+
function ar(e) {
|
|
673
673
|
return {
|
|
674
|
-
id:
|
|
674
|
+
id: de.id,
|
|
675
675
|
title: "sheets-sort.general.sort-desc-ext",
|
|
676
676
|
type: S.BUTTON,
|
|
677
|
-
icon:
|
|
677
|
+
icon: Ce,
|
|
678
678
|
disabled$: N(e, { workbookTypes: [H], worksheetTypes: [L, D], rangeTypes: [k] })
|
|
679
679
|
};
|
|
680
680
|
}
|
|
681
|
-
function
|
|
681
|
+
function lr(e) {
|
|
682
682
|
return {
|
|
683
|
-
id:
|
|
683
|
+
id: ue.id,
|
|
684
684
|
title: "sheets-sort.general.sort-custom",
|
|
685
685
|
type: S.BUTTON,
|
|
686
686
|
icon: ve,
|
|
687
687
|
disabled$: N(e, { workbookTypes: [H], worksheetTypes: [L, D], rangeTypes: [k] })
|
|
688
688
|
};
|
|
689
689
|
}
|
|
690
|
-
const
|
|
691
|
-
[
|
|
692
|
-
[
|
|
693
|
-
order:
|
|
694
|
-
menuItemFactory:
|
|
690
|
+
const dr = {
|
|
691
|
+
[ut.ORGANIZATION]: {
|
|
692
|
+
[$e]: {
|
|
693
|
+
order: 3,
|
|
694
|
+
menuItemFactory: Jt,
|
|
695
695
|
[re.id]: {
|
|
696
696
|
order: 0,
|
|
697
|
-
menuItemFactory:
|
|
697
|
+
menuItemFactory: Qt
|
|
698
698
|
},
|
|
699
699
|
[ne.id]: {
|
|
700
700
|
order: 1,
|
|
701
|
-
menuItemFactory:
|
|
701
|
+
menuItemFactory: er
|
|
702
702
|
},
|
|
703
|
-
[
|
|
703
|
+
[oe.id]: {
|
|
704
704
|
order: 2,
|
|
705
|
-
menuItemFactory:
|
|
705
|
+
menuItemFactory: tr
|
|
706
706
|
},
|
|
707
|
-
[
|
|
707
|
+
[ie.id]: {
|
|
708
708
|
order: 3,
|
|
709
|
-
menuItemFactory:
|
|
709
|
+
menuItemFactory: rr
|
|
710
710
|
},
|
|
711
|
-
[
|
|
711
|
+
[se.id]: {
|
|
712
712
|
order: 4,
|
|
713
|
-
menuItemFactory:
|
|
713
|
+
menuItemFactory: nr
|
|
714
714
|
}
|
|
715
715
|
}
|
|
716
716
|
},
|
|
717
|
-
[
|
|
718
|
-
[
|
|
719
|
-
[
|
|
717
|
+
[lt.MAIN_AREA]: {
|
|
718
|
+
[dt.DATA]: {
|
|
719
|
+
[Ze]: {
|
|
720
720
|
order: 0,
|
|
721
|
-
menuItemFactory:
|
|
722
|
-
[
|
|
721
|
+
menuItemFactory: or,
|
|
722
|
+
[ce.id]: {
|
|
723
723
|
order: 0,
|
|
724
|
-
menuItemFactory:
|
|
724
|
+
menuItemFactory: ir
|
|
725
725
|
},
|
|
726
|
-
[
|
|
726
|
+
[ae.id]: {
|
|
727
727
|
order: 1,
|
|
728
|
-
menuItemFactory:
|
|
728
|
+
menuItemFactory: sr
|
|
729
729
|
},
|
|
730
730
|
[le.id]: {
|
|
731
731
|
order: 2,
|
|
732
|
-
menuItemFactory:
|
|
732
|
+
menuItemFactory: cr
|
|
733
733
|
},
|
|
734
|
-
[
|
|
734
|
+
[de.id]: {
|
|
735
735
|
order: 3,
|
|
736
|
-
menuItemFactory:
|
|
736
|
+
menuItemFactory: ar
|
|
737
737
|
},
|
|
738
|
-
[
|
|
738
|
+
[ue.id]: {
|
|
739
739
|
order: 4,
|
|
740
|
-
menuItemFactory:
|
|
740
|
+
menuItemFactory: lr
|
|
741
741
|
}
|
|
742
742
|
}
|
|
743
743
|
}
|
|
744
744
|
}
|
|
745
745
|
};
|
|
746
|
-
var
|
|
747
|
-
for (var
|
|
748
|
-
(
|
|
749
|
-
return
|
|
750
|
-
},
|
|
751
|
-
const pe = "custom-sort-dialog",
|
|
752
|
-
let
|
|
753
|
-
constructor(e, t, n, r, i, s,
|
|
754
|
-
super(), this._commandService = e, this._menuManagerService = t, this._dialogService = n, this._layoutService = r, this._uiPartsService =
|
|
746
|
+
var ur = Object.getOwnPropertyDescriptor, hr = (e, t, n, r) => {
|
|
747
|
+
for (var o = r > 1 ? void 0 : r ? ur(t, n) : t, i = e.length - 1, s; i >= 0; i--)
|
|
748
|
+
(s = e[i]) && (o = s(o) || o);
|
|
749
|
+
return o;
|
|
750
|
+
}, w = (e, t) => (n, r) => t(n, r, e);
|
|
751
|
+
const pe = "custom-sort-dialog", gr = 560;
|
|
752
|
+
let W = class extends Xe {
|
|
753
|
+
constructor(e, t, n, r, o, i, s, a, l, u) {
|
|
754
|
+
super(), this._commandService = e, this._menuManagerService = t, this._dialogService = n, this._layoutService = r, this._uiPartsService = o, this._sheetRenderService = i, this._localeService = s, this._sheetsSortUIService = a, this._injector = l, this._componentManager = u, this._initCommands(), this._initMenu(), this._initUI();
|
|
755
755
|
}
|
|
756
756
|
_initMenu() {
|
|
757
|
-
this._menuManagerService.mergeMenu(
|
|
757
|
+
this._menuManagerService.mergeMenu(dr);
|
|
758
758
|
}
|
|
759
759
|
_initCommands() {
|
|
760
760
|
[
|
|
761
761
|
re,
|
|
762
762
|
ne,
|
|
763
|
+
oe,
|
|
763
764
|
ie,
|
|
764
765
|
se,
|
|
765
|
-
oe,
|
|
766
|
-
ae,
|
|
767
766
|
ce,
|
|
767
|
+
ae,
|
|
768
768
|
le,
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
].forEach((e) => this.disposeWithMe(this._commandService.registerCommand(e))), this.disposeWithMe(this._sheetRenderService.registerSkeletonChangingMutations(
|
|
769
|
+
de,
|
|
770
|
+
ue
|
|
771
|
+
].forEach((e) => this.disposeWithMe(this._commandService.registerCommand(e))), this.disposeWithMe(this._sheetRenderService.registerSkeletonChangingMutations(tt.id));
|
|
772
772
|
}
|
|
773
773
|
_initUI() {
|
|
774
|
-
this.disposeWithMe(
|
|
774
|
+
this.disposeWithMe(
|
|
775
|
+
this._uiPartsService.registerComponent(st.FILTER_PANEL_EMBED_POINT, () => ft(Kt, this._injector))
|
|
776
|
+
), [
|
|
777
|
+
["CustomSortPanel", zt],
|
|
778
|
+
[j, ee],
|
|
779
|
+
[he, He],
|
|
780
|
+
[ge, te],
|
|
781
|
+
[Ce, Ue],
|
|
782
|
+
[ve, Le]
|
|
783
|
+
].forEach(([e, t]) => {
|
|
784
|
+
this.disposeWithMe(
|
|
785
|
+
this._componentManager.register(e, t)
|
|
786
|
+
);
|
|
787
|
+
}), this._sheetsSortUIService.customSortState$.pipe(pt(this.dispose$)).subscribe((e) => {
|
|
775
788
|
e && e.show && e.location ? this._openCustomSortPanel(e.location) : e && !(e != null && e.show) && this._closePanel();
|
|
776
789
|
});
|
|
777
790
|
}
|
|
@@ -779,11 +792,11 @@ let G = class extends Ye {
|
|
|
779
792
|
this._dialogService.open({
|
|
780
793
|
id: pe,
|
|
781
794
|
draggable: !0,
|
|
782
|
-
width:
|
|
783
|
-
title: { title: `${this._localeService.t("sheets-sort.general.sort-custom")}: ${
|
|
795
|
+
width: gr,
|
|
796
|
+
title: { title: `${this._localeService.t("sheets-sort.general.sort-custom")}: ${nt(e.range)}` },
|
|
784
797
|
children: { label: "CustomSortPanel" },
|
|
785
798
|
destroyOnClose: !0,
|
|
786
|
-
defaultPosition:
|
|
799
|
+
defaultPosition: Cr(),
|
|
787
800
|
preservePositionOnDestroy: !1,
|
|
788
801
|
onClose: () => this._closePanel(),
|
|
789
802
|
mask: !0
|
|
@@ -793,64 +806,64 @@ let G = class extends Ye {
|
|
|
793
806
|
this._dialogService.close(pe), queueMicrotask(() => this._layoutService.focus());
|
|
794
807
|
}
|
|
795
808
|
};
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
],
|
|
808
|
-
function
|
|
809
|
+
W = hr([
|
|
810
|
+
w(0, _e),
|
|
811
|
+
w(1, ht),
|
|
812
|
+
w(2, gt),
|
|
813
|
+
w(3, Ct),
|
|
814
|
+
w(4, vt),
|
|
815
|
+
w(5, R(it)),
|
|
816
|
+
w(6, R(P)),
|
|
817
|
+
w(7, R(g)),
|
|
818
|
+
w(8, R(Ie)),
|
|
819
|
+
w(9, R(mt))
|
|
820
|
+
], W);
|
|
821
|
+
function Cr() {
|
|
809
822
|
return { x: 0, y: 0 };
|
|
810
823
|
}
|
|
811
|
-
var
|
|
812
|
-
for (var
|
|
813
|
-
(
|
|
814
|
-
return
|
|
815
|
-
}, ye = (e, t) => (n, r) => t(n, r, e),
|
|
816
|
-
const
|
|
817
|
-
let
|
|
824
|
+
var vr = Object.defineProperty, mr = Object.getOwnPropertyDescriptor, fr = (e, t, n) => t in e ? vr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, Sr = (e, t, n, r) => {
|
|
825
|
+
for (var o = r > 1 ? void 0 : r ? mr(t, n) : t, i = e.length - 1, s; i >= 0; i--)
|
|
826
|
+
(s = e[i]) && (o = s(o) || o);
|
|
827
|
+
return o;
|
|
828
|
+
}, ye = (e, t) => (n, r) => t(n, r, e), je = (e, t, n) => fr(e, typeof t != "symbol" ? t + "" : t, n);
|
|
829
|
+
const pr = "SHEET_SORT_UI_PLUGIN";
|
|
830
|
+
let z = class extends Qe {
|
|
818
831
|
constructor(e = Se, t, n) {
|
|
819
832
|
super(), this._config = e, this._injector = t, this._configService = n;
|
|
820
|
-
const { ...r } =
|
|
833
|
+
const { ...r } = et(
|
|
821
834
|
{},
|
|
822
835
|
Se,
|
|
823
836
|
this._config
|
|
824
837
|
);
|
|
825
|
-
this._configService.setConfig(
|
|
838
|
+
this._configService.setConfig(bt, r);
|
|
826
839
|
}
|
|
827
840
|
onStarting() {
|
|
828
841
|
[
|
|
829
842
|
[g],
|
|
830
|
-
[
|
|
843
|
+
[W]
|
|
831
844
|
].forEach((e) => this._injector.add(e));
|
|
832
845
|
}
|
|
833
846
|
onRendered() {
|
|
834
|
-
this._injector.get(
|
|
847
|
+
this._injector.get(W);
|
|
835
848
|
}
|
|
836
849
|
};
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
ye(1,
|
|
842
|
-
ye(2,
|
|
843
|
-
],
|
|
850
|
+
je(z, "type", Y.UNIVER_SHEET);
|
|
851
|
+
je(z, "pluginName", pr);
|
|
852
|
+
z = Sr([
|
|
853
|
+
Ke(rt),
|
|
854
|
+
ye(1, R(Ie)),
|
|
855
|
+
ye(2, Je)
|
|
856
|
+
], z);
|
|
844
857
|
export {
|
|
845
858
|
re as SortRangeAscCommand,
|
|
846
859
|
ne as SortRangeAscExtCommand,
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
860
|
+
ae as SortRangeAscExtInCtxMenuCommand,
|
|
861
|
+
ce as SortRangeAscInCtxMenuCommand,
|
|
862
|
+
se as SortRangeCustomCommand,
|
|
863
|
+
ue as SortRangeCustomInCtxMenuCommand,
|
|
864
|
+
oe as SortRangeDescCommand,
|
|
865
|
+
ie as SortRangeDescExtCommand,
|
|
866
|
+
de as SortRangeDescExtInCtxMenuCommand,
|
|
854
867
|
le as SortRangeDescInCtxMenuCommand,
|
|
855
|
-
|
|
868
|
+
z as UniverSheetsSortUIPlugin
|
|
856
869
|
};
|