@univerjs/sheets-sort-ui 0.6.7 → 0.6.9

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/index.js ADDED
@@ -0,0 +1,859 @@
1
+ var Ve = Object.defineProperty;
2
+ var ze = (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) => ze(e, typeof t != "symbol" ? t + "" : t, n);
4
+ import { LocaleService as A, IUniverInstanceService as ye, ILogService as Ze, Inject as E, ICommandService as xe, Disposable as Ge, UniverInstanceType as Y, Tools as We, LocaleType as J, CommandType as b, throttle as Ye, Injector as Me, RxDisposable as qe, DependentOn as Xe, IConfigService as Ke, Plugin as Je, merge as Qe } from "@univerjs/core";
5
+ import { SheetsSortService as Re, SortType as U, SortRangeCommand as et, UniverSheetsSortPlugin as tt } from "@univerjs/sheets-sort";
6
+ import { serializeRange as nt } from "@univerjs/engine-formula";
7
+ import { getCurrentRangeDisable$ as P, getCurrentExclusiveRangeInterest$ as rt, SheetsRenderService as ot, SheetsUIPart as st } from "@univerjs/sheets-ui";
8
+ import { useDependency as O, IConfirmService as it, MenuItemType as p, getMenuHiddenObservable as be, ContextMenuPosition as ct, ContextMenuGroup as at, RibbonStartGroup as lt, IMenuManagerService as dt, IDialogService as ut, ILayoutService as mt, IUIPartsService as ht, ComponentManager as gt, connectInjector as Ct } from "@univerjs/ui";
9
+ import { BehaviorSubject as St, takeUntil as ft } from "rxjs";
10
+ import { jsxs as g, jsx as a } from "react/jsx-runtime";
11
+ import { SheetsSelectionsService as vt, getPrimaryForRange as pt, SetSelectionsOperation as _t, expandToContinuousRange as fe, getSheetCommandTarget as It, RangeProtectionPermissionEditPoint as k, WorksheetSortPermission as D, WorksheetEditPermission as L, WorkbookEditablePermission as H } from "@univerjs/sheets";
12
+ import { RadioGroup as Ee, Radio as Z, Checkbox as yt, DraggableList as xt, Button as ve, Dropdown as Mt, clsx as Rt } from "@univerjs/design";
13
+ import { forwardRef as I, useRef as Te, createElement as y, useState as F, useCallback as N, useEffect as Oe } from "react";
14
+ const bt = "sheets-sort-ui.config", pe = {};
15
+ var v = function() {
16
+ return v = Object.assign || function(e) {
17
+ for (var t, n = 1, r = arguments.length; n < r; n++) {
18
+ t = arguments[n];
19
+ for (var o in t) Object.prototype.hasOwnProperty.call(t, o) && (e[o] = t[o]);
20
+ }
21
+ return e;
22
+ }, v.apply(this, arguments);
23
+ }, Et = function(e, t) {
24
+ var n = {};
25
+ for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
26
+ if (e != null && typeof Object.getOwnPropertySymbols == "function")
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
+ return n;
30
+ }, x = I(function(e, t) {
31
+ var n = e.icon, r = e.id, o = e.className, s = e.extend, i = Et(e, ["icon", "id", "className", "extend"]), l = "univerjs-icon univerjs-icon-".concat(r, " ").concat(o || "").trim(), u = Te("_".concat(wt()));
32
+ return we(n, "".concat(r), { defIds: n.defIds, idSuffix: u.current }, v({ ref: t, className: l }, i), s);
33
+ });
34
+ function we(e, t, n, r, o) {
35
+ return y(e.tag, v(v({ key: t }, Tt(e, n, o)), r), (Ot(e, n).children || []).map(function(s, i) {
36
+ return we(s, "".concat(t, "-").concat(e.tag, "-").concat(i), n, void 0, o);
37
+ }));
38
+ }
39
+ function Tt(e, t, n) {
40
+ var r = v({}, 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(s) {
42
+ var i = s[0], l = s[1];
43
+ i === "mask" && typeof l == "string" && (r[i] = l.replace(/url\(#(.*)\)/, "url(#$1".concat(t.idSuffix, ")")));
44
+ });
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(s) {
47
+ var i = s[0], l = s[1];
48
+ typeof l == "string" && (r[i] = l.replace(/url\(#(.*)\)/, "url(#$1".concat(t.idSuffix, ")")));
49
+ })), r;
50
+ }
51
+ function Ot(e, t) {
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) ? v(v({}, e), { children: e.children.map(function(o) {
54
+ return typeof o.attrs.id == "string" && r && r.indexOf(o.attrs.id) > -1 ? v(v({}, o), { attrs: v(v({}, o.attrs), { id: o.attrs.id + t.idSuffix }) }) : o;
55
+ }) }) : e;
56
+ }
57
+ function wt() {
58
+ return Math.random().toString(36).substring(2, 8);
59
+ }
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 = I(function(e, t) {
62
+ return y(x, Object.assign({}, e, {
63
+ id: "ascending- single",
64
+ ref: t,
65
+ icon: Nt
66
+ }));
67
+ });
68
+ ee.displayName = "AscendingSingle";
69
+ var Pt = { 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" } }] }, Ne = I(function(e, t) {
70
+ return y(x, Object.assign({}, e, {
71
+ id: "check-mark-single",
72
+ ref: t,
73
+ icon: Pt
74
+ }));
75
+ });
76
+ Ne.displayName = "CheckMarkSingle";
77
+ var kt = { 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" } }] }, Pe = I(function(e, t) {
78
+ return y(x, Object.assign({}, e, {
79
+ id: "custom-sort-single",
80
+ ref: t,
81
+ icon: kt
82
+ }));
83
+ });
84
+ Pe.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 = I(function(e, t) {
86
+ return y(x, Object.assign({}, e, {
87
+ id: "delete-empty-single",
88
+ ref: t,
89
+ icon: Dt
90
+ }));
91
+ });
92
+ ke.displayName = "DeleteEmptySingle";
93
+ var Lt = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M12.4208 1.53335C12.4208 1.20198 12.1522 0.93335 11.8208 0.93335C11.4895 0.93335 11.2208 1.20198 11.2208 1.53335V13.0181L9.97861 11.7758C9.7443 11.5415 9.3644 11.5415 9.13008 11.7758C8.89577 12.0101 8.89577 12.39 9.13008 12.6244L11.3967 14.891C11.6311 15.1253 12.011 15.1253 12.2453 14.891L14.5119 12.6244C14.7463 12.39 14.7463 12.0101 14.5119 11.7758C14.2776 11.5415 13.8977 11.5415 13.6634 11.7758L12.4208 13.0184V1.53335Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M1.98967 10.2798C1.6583 10.2798 1.38967 10.0112 1.38967 9.67983 1.38967 9.34846 1.6583 9.07983 1.98967 9.07983H6.50138C6.74406 9.07983 6.96284 9.22602 7.05571 9.45022 7.14858 9.67443 7.09725 9.9325 6.92565 10.1041L3.43819 13.5916H6.50138C6.83276 13.5916 7.10138 13.8602 7.10138 14.1916 7.10138 14.5229 6.83276 14.7916 6.50138 14.7916H1.98967C1.74699 14.7916 1.52821 14.6454 1.43534 14.4212 1.34247 14.197 1.3938 13.9389 1.5654 13.7673L5.05286 10.2798H1.98967zM5.1846 1.86439C4.8641.989866 3.62725.989866 3.30674 1.86439L1.34882 7.20672C1.23479 7.51786 1.39458 7.86252 1.70571 7.97655 2.01684 8.09058 2.3615 7.93079 2.47553 7.61966L3.06159 6.02055 3.06338 6.02056H5.42975L6.01581 7.61966C6.12984 7.93079 6.4745 8.09058 6.78563 7.97655 7.09677 7.86252 7.25655 7.51786 7.14252 7.20672L5.1846 1.86439zM4.98996 4.82056L4.24567 2.78971 3.50138 4.82056H4.98996z", fillRule: "evenodd", clipRule: "evenodd" } }] }, te = I(function(e, t) {
94
+ return y(x, Object.assign({}, e, {
95
+ id: "descending-single",
96
+ ref: t,
97
+ icon: Lt
98
+ }));
99
+ });
100
+ te.displayName = "DescendingSingle";
101
+ var Ht = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M1.9064 3.20024C1.57503 3.20024 1.3064 2.93161 1.3064 2.60024C1.3064 2.26887 1.57503 2.00024 1.9064 2.00024H4.57306C4.90443 2.00024 5.17306 2.26887 5.17306 2.60024C5.17306 2.93161 4.90443 3.20024 4.57306 3.20024H1.9064ZM1.3064 6.19985C1.3064 6.53122 1.57503 6.79985 1.9064 6.79985H5.9064C6.23777 6.79985 6.5064 6.53122 6.5064 6.19985C6.5064 5.86848 6.23777 5.59985 5.9064 5.59985H1.9064C1.57503 5.59985 1.3064 5.86848 1.3064 6.19985ZM1.9064 10.3997C1.57503 10.3997 1.3064 10.1311 1.3064 9.79971C1.3064 9.46834 1.57503 9.19971 1.9064 9.19971H7.23973C7.5711 9.19971 7.83973 9.46834 7.83973 9.79971C7.83973 10.1311 7.5711 10.3997 7.23973 10.3997H1.9064ZM1.9064 13.9996C1.57503 13.9996 1.3064 13.7309 1.3064 13.3996C1.3064 13.0682 1.57503 12.7996 1.9064 12.7996H8.57306C8.90443 12.7996 9.17306 13.0682 9.17306 13.3996C9.17306 13.7309 8.90443 13.9996 8.57306 13.9996H1.9064Z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", d: "M12.4267 14.2667C12.4267 14.5981 12.1581 14.8667 11.8267 14.8667C11.4953 14.8667 11.2267 14.5981 11.2267 14.2667V3.18198L9.98447 4.42422C9.75015 4.65853 9.37026 4.65853 9.13594 4.42422C8.90163 4.1899 8.90163 3.81 9.13594 3.57569L11.4026 1.30902C11.6369 1.07471 12.0168 1.07471 12.2511 1.30902L14.5178 3.57569C14.7521 3.81 14.7521 4.1899 14.5178 4.42422C14.2835 4.65853 13.9036 4.65853 13.6693 4.42422L12.4267 3.18165V14.2667Z" } }] }, De = I(function(e, t) {
102
+ return y(x, Object.assign({}, e, {
103
+ id: "expand-ascending-single",
104
+ ref: t,
105
+ icon: Ht
106
+ }));
107
+ });
108
+ De.displayName = "ExpandAscendingSingle";
109
+ var Ut = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M1.9064 12.7998C1.57503 12.7998 1.3064 13.0684 1.3064 13.3998C1.3064 13.7311 1.57503 13.9998 1.9064 13.9998H4.57306C4.90443 13.9998 5.17306 13.7311 5.17306 13.3998C5.17306 13.0684 4.90443 12.7998 4.57306 12.7998H1.9064ZM1.3064 9.80015C1.3064 9.46878 1.57503 9.20015 1.9064 9.20015H5.9064C6.23777 9.20015 6.5064 9.46878 6.5064 9.80015C6.5064 10.1315 6.23777 10.4001 5.9064 10.4001H1.9064C1.57503 10.4001 1.3064 10.1315 1.3064 9.80015ZM1.9064 5.60029C1.57503 5.60029 1.3064 5.86892 1.3064 6.20029C1.3064 6.53166 1.57503 6.80029 1.9064 6.80029H7.23973C7.5711 6.80029 7.83973 6.53166 7.83973 6.20029C7.83973 5.86892 7.5711 5.60029 7.23973 5.60029H1.9064ZM1.9064 2.00044C1.57503 2.00044 1.3064 2.26907 1.3064 2.60044C1.3064 2.93181 1.57503 3.20044 1.9064 3.20044H8.57306C8.90443 3.20044 9.17306 2.93181 9.17306 2.60044C9.17306 2.26907 8.90443 2.00044 8.57306 2.00044H1.9064Z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", d: "M12.4267 1.7333C12.4267 1.40193 12.1581 1.1333 11.8267 1.1333C11.4953 1.1333 11.2267 1.40193 11.2267 1.7333V12.818L9.98447 11.5758C9.75015 11.3415 9.37026 11.3415 9.13594 11.5758C8.90163 11.8101 8.90163 12.19 9.13594 12.4243L11.4026 14.691C11.6369 14.9253 12.0168 14.9253 12.2511 14.691L14.5178 12.4243C14.7521 12.19 14.7521 11.8101 14.5178 11.5758C14.2835 11.3415 13.9036 11.3415 13.6693 11.5758L12.4267 12.8183V1.7333Z" } }] }, Le = I(function(e, t) {
110
+ return y(x, Object.assign({}, e, {
111
+ id: "expand-descending-single",
112
+ ref: t,
113
+ icon: Ut
114
+ }));
115
+ });
116
+ Le.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 = I(function(e, t) {
118
+ return y(x, Object.assign({}, e, {
119
+ id: "increase-single",
120
+ ref: t,
121
+ icon: At
122
+ }));
123
+ });
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 = I(function(e, t) {
126
+ return y(x, Object.assign({}, e, {
127
+ id: "more-down-single",
128
+ ref: t,
129
+ icon: $t
130
+ }));
131
+ });
132
+ He.displayName = "MoreDownSingle";
133
+ var Bt = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "mask", attrs: { id: "mask0_622_8", style: { maskType: "alpha" }, width: 16, height: 16, x: 0, y: 0, maskUnits: "userSpaceOnUse" }, children: [{ tag: "path", attrs: { fill: "#D9D9D9", d: "M0 0H16V16H0z" } }] }, { tag: "g", attrs: { fill: "currentColor", mask: "url(#mask0_622_8)" }, children: [{ tag: "path", attrs: { d: "M6 5C6.55228 5 7 4.55228 7 4 7 3.44772 6.55228 3 6 3 5.44772 3 5 3.44772 5 4 5 4.55228 5.44772 5 6 5zM6 9C6.55228 9 7 8.55229 7 8 7 7.44772 6.55228 7 6 7 5.44772 7 5 7.44772 5 8 5 8.55229 5.44772 9 6 9zM7 12C7 12.5523 6.55228 13 6 13 5.44772 13 5 12.5523 5 12 5 11.4477 5.44772 11 6 11 6.55228 11 7 11.4477 7 12zM10 5C10.5523 5 11 4.55228 11 4 11 3.44772 10.5523 3 10 3 9.44771 3 9 3.44772 9 4 9 4.55228 9.44771 5 10 5zM11 8C11 8.55229 10.5523 9 10 9 9.44771 9 9 8.55229 9 8 9 7.44772 9.44771 7 10 7 10.5523 7 11 7.44772 11 8zM10 13C10.5523 13 11 12.5523 11 12 11 11.4477 10.5523 11 10 11 9.44771 11 9 11.4477 9 12 9 12.5523 9.44771 13 10 13z" } }] }] }, Ue = I(function(e, t) {
134
+ return y(x, Object.assign({}, e, {
135
+ id: "sequence-single",
136
+ ref: t,
137
+ icon: Bt
138
+ }));
139
+ });
140
+ Ue.displayName = "SequenceSingle";
141
+ const Ft = "univer-extend-confirm-content", jt = "univer-extend-confirm-radio-group", Vt = "univer-custom-sort-panel-container", zt = "univer-custom-sort-panel-ext", Zt = "univer-add-condition", Gt = "univer-add-condition-text", Wt = "univer-add-condition-disable", Yt = "univer-custom-sort-panel-footer", qt = "univer-custom-sort-panel-footer-btn", Xt = "univer-custom-sort-panel-item", Kt = "univer-custom-sort-panel-item-head", Jt = "univer-custom-sort-panel-item-handler", Qt = "univer-custom-sort-panel-item-remove", en = "univer-custom-sort-panel-item-column-input", tn = "univer-custom-sort-panel-item-column-input-dropdown", nn = "univer-custom-sort-panel-item-column-input-text", rn = "univer-custom-sort-panel-item-order-radio", on = "univer-custom-sort-panel-item-order-radio-cn", sn = "univer-condition-list", cn = "univer-embed-sort-btn-container", an = "univer-embed-sort-btn", ln = "univer-embed-sort-btn-asc", dn = "univer-embed-sort-btn-desc", un = "univer-embed-sort-btn-icon", mn = "univer-custom-sort-col-menu", hn = "univer-custom-sort-col-menu-item", gn = "univer-custom-sort-col-menu-item-desc", c = {
142
+ extendConfirmContent: Ft,
143
+ extendConfirmRadioGroup: jt,
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: [
172
+ /* @__PURE__ */ a("div", { className: "extend-confirm-desc", children: r.t("sheets-sort.dialog.sort-reminder-desc") }),
173
+ /* @__PURE__ */ g(
174
+ Ee,
175
+ {
176
+ className: c.extendConfirmRadioGroup,
177
+ value: t,
178
+ direction: "vertical",
179
+ onChange: (o) => {
180
+ n(o), e.onChange(o);
181
+ },
182
+ children: [
183
+ /* @__PURE__ */ a(
184
+ Z,
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") })
191
+ ]
192
+ }
193
+ )
194
+ ] });
195
+ };
196
+ var Sn = Object.getOwnPropertyDescriptor, fn = (e, t, n, r) => {
197
+ for (var o = r > 1 ? void 0 : r ? Sn(t, n) : t, s = e.length - 1, i; s >= 0; s--)
198
+ (i = e[s]) && (o = i(o) || o);
199
+ return o;
200
+ }, w = (e, t) => (n, r) => t(n, r, e);
201
+ const z = {
202
+ MERGE_ERROR: "sheets-sort.error.merge-size",
203
+ EMPTY_ERROR: "sheets-sort.error.empty",
204
+ SINGLE_ERROR: "sheets-sort.error.single",
205
+ FORMULA_ARRAY: "sheets-sort.error.formula-array"
206
+ };
207
+ let C = class extends Ge {
208
+ constructor(t, n, r, o, s, i, l) {
209
+ super();
210
+ K(this, "_customSortState$", new St(null));
211
+ K(this, "customSortState$", this._customSortState$.asObservable());
212
+ this._univerInstanceService = t, this._confirmService = n, this._logService = r, this._selectionManagerService = o, this._sheetsSortService = s, this._localeService = i, this._commandService = l;
213
+ }
214
+ async triggerSortDirectly(t, n, r) {
215
+ const o = r || await this._detectSortLocation(n);
216
+ if (!o || !this._check(o))
217
+ return !1;
218
+ const i = {
219
+ orderRules: [{
220
+ type: t ? U.ASC : U.DESC,
221
+ colIndex: o.colIndex
222
+ }],
223
+ range: o.range
224
+ };
225
+ return this._sheetsSortService.applySort(i, o.unitId, o.subUnitId), !0;
226
+ }
227
+ async triggerSortCustomize() {
228
+ const t = await this._detectSortLocation();
229
+ return !t || !this._check(t) ? !1 : (this.showCustomSortPanel(t), !0);
230
+ }
231
+ customSortState() {
232
+ return this._customSortState$.getValue();
233
+ }
234
+ getTitles(t) {
235
+ var u, m;
236
+ const n = (u = this.customSortState()) == null ? void 0 : u.location;
237
+ if (!n)
238
+ return [];
239
+ const { unitId: r, subUnitId: o, range: s } = n, i = (m = this._univerInstanceService.getUnit(r)) == null ? void 0 : m.getSheetBySheetId(o);
240
+ if (!i)
241
+ return [];
242
+ const l = vn(this._localeService);
243
+ return Array.from({ length: s.endColumn - s.startColumn + 1 }, (M, f) => {
244
+ var S;
245
+ const T = (S = i.getCell(s.startRow, f + s.startColumn)) == null ? void 0 : S.v;
246
+ return {
247
+ index: f + s.startColumn,
248
+ label: t ? `${T != null ? T : l(f + s.startColumn)}` : l(f + s.startColumn)
249
+ };
250
+ });
251
+ }
252
+ setSelection(t, n, r) {
253
+ var i;
254
+ const o = (i = this._univerInstanceService.getUnit(t)) == null ? void 0 : i.getSheetBySheetId(n);
255
+ if (!o)
256
+ return;
257
+ const s = {
258
+ unitId: t,
259
+ subUnitId: n,
260
+ selections: [{ range: r, primary: pt(r, o), style: null }]
261
+ };
262
+ this._commandService.executeCommand(_t.id, s);
263
+ }
264
+ async showCheckError(t) {
265
+ return await this._confirmService.confirm({
266
+ id: "sort-range-check-error",
267
+ title: {
268
+ title: this._localeService.t("info.tooltip")
269
+ },
270
+ children: {
271
+ title: /* @__PURE__ */ a("div", { children: this._localeService.t(t) })
272
+ }
273
+ });
274
+ }
275
+ async showExtendConfirm() {
276
+ let t = !1;
277
+ return await this._confirmService.confirm({
278
+ id: "extend-sort-range-dialog",
279
+ title: {
280
+ title: this._localeService.t("sheets-sort.dialog.sort-reminder")
281
+ },
282
+ children: {
283
+ title: /* @__PURE__ */ a(
284
+ Cn,
285
+ {
286
+ onChange: (r) => {
287
+ t = r === "1";
288
+ }
289
+ }
290
+ )
291
+ },
292
+ width: 400
293
+ }) ? t ? "extend" : "keep" : "cancel";
294
+ }
295
+ showCustomSortPanel(t) {
296
+ this._customSortState$.next({ location: t, show: !0 });
297
+ }
298
+ closeCustomSortPanel() {
299
+ this._customSortState$.next({ show: !1 });
300
+ }
301
+ _check(t) {
302
+ return this._sheetsSortService.singleCheck(t) ? this._sheetsSortService.mergeCheck(t) ? this._sheetsSortService.formulaCheck(t) ? this._sheetsSortService.emptyCheck(t) ? !0 : (this.showCheckError(z.EMPTY_ERROR), !1) : (this.showCheckError(z.FORMULA_ARRAY), !1) : (this.showCheckError(z.MERGE_ERROR), !1) : (this.showCheckError(z.SINGLE_ERROR), !1);
303
+ }
304
+ async _detectSortLocation(t) {
305
+ const n = this._univerInstanceService.getCurrentUnitForType(Y.UNIVER_SHEET), r = n.getActiveSheet(), o = n.getUnitId(), s = r.getSheetId(), i = this._selectionManagerService.getCurrentLastSelection();
306
+ if (!i)
307
+ return null;
308
+ let l;
309
+ if (t === !0)
310
+ l = fe(i.range, { up: !0, down: !0, left: !0, right: !0 }, r), this.setSelection(o, s, l);
311
+ else if (t === !1)
312
+ l = i.range;
313
+ else {
314
+ const u = await this.showExtendConfirm();
315
+ if (u === "cancel")
316
+ return null;
317
+ u === "keep" ? l = i.range : (l = fe(i.range, { up: !0, down: !0, left: !0, right: !0 }, r), this.setSelection(o, s, l));
318
+ }
319
+ return {
320
+ range: l,
321
+ unitId: o,
322
+ subUnitId: s,
323
+ colIndex: i.primary.actualColumn
324
+ };
325
+ }
326
+ };
327
+ C = fn([
328
+ w(0, ye),
329
+ w(1, it),
330
+ w(2, Ze),
331
+ w(3, E(vt)),
332
+ w(4, E(Re)),
333
+ w(5, E(A)),
334
+ w(6, xe)
335
+ ], C);
336
+ function vn(e) {
337
+ return (t) => {
338
+ const n = We.chatAtABC(t);
339
+ switch (e.getCurrentLocale()) {
340
+ case J.ZH_CN:
341
+ return `"${n}"列`;
342
+ case J.EN_US:
343
+ return `Column "${n}"`;
344
+ default:
345
+ return `Column "${n}"`;
346
+ }
347
+ };
348
+ }
349
+ const ne = {
350
+ id: "sheet.command.sort-range-asc",
351
+ type: b.COMMAND,
352
+ handler: async (e) => await e.get(C).triggerSortDirectly(!0, !1)
353
+ }, re = {
354
+ id: "sheet.command.sort-range-asc-ext",
355
+ type: b.COMMAND,
356
+ handler: async (e) => await e.get(C).triggerSortDirectly(!0, !0)
357
+ }, oe = {
358
+ id: "sheet.command.sort-range-desc",
359
+ type: b.COMMAND,
360
+ handler: async (e) => await e.get(C).triggerSortDirectly(!1, !1)
361
+ }, se = {
362
+ id: "sheet.command.sort-range-desc-ext",
363
+ type: b.COMMAND,
364
+ handler: async (e) => await e.get(C).triggerSortDirectly(!1, !0)
365
+ }, ie = {
366
+ id: "sheet.command.sort-range-custom",
367
+ type: b.COMMAND,
368
+ handler: async (e) => await e.get(C).triggerSortCustomize()
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)
373
+ }, ae = {
374
+ id: "sheet.command.sort-range-asc-ext-ctx",
375
+ type: b.COMMAND,
376
+ handler: async (e) => await e.get(C).triggerSortDirectly(!0, !0)
377
+ }, le = {
378
+ id: "sheet.command.sort-range-desc-ctx",
379
+ type: b.COMMAND,
380
+ handler: async (e) => await e.get(C).triggerSortDirectly(!1, !1)
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)
385
+ }, ue = {
386
+ id: "sheet.command.sort-range-custom-ctx",
387
+ type: b.COMMAND,
388
+ handler: async (e) => await e.get(C).triggerSortCustomize()
389
+ };
390
+ function pn() {
391
+ const e = O(C), t = O(Re), n = O(A), [r, o] = F(!1), [s, i] = F(0), l = Te(null), u = e.customSortState();
392
+ if (!u || !u.location)
393
+ return null;
394
+ const { range: m, unitId: M, subUnitId: f } = u.location, T = e.getTitles(r), [S, $] = F([
395
+ { type: U.ASC, colIndex: m.startColumn }
396
+ ]), q = N((d, _) => {
397
+ const B = [...S];
398
+ _ === null ? B.splice(d, 1) : B[d] = _, $(B);
399
+ }, [S]), V = N(
400
+ Ye(() => {
401
+ const d = [...S], _ = In(m, S);
402
+ _ !== null && (d.push({ type: U.ASC, colIndex: _ }), $(d));
403
+ }, 200),
404
+ [S, m]
405
+ ), h = N((d, _) => {
406
+ t.applySort({ range: m, orderRules: d, hasTitle: _ }), e.closeCustomSortPanel();
407
+ }, [t, e, m]), X = N(() => {
408
+ e.closeCustomSortPanel();
409
+ }, [e]), Fe = N((d) => {
410
+ o(d), d ? e.setSelection(M, f, { ...m, startRow: m.startRow + 1 }) : e.setSelection(M, f, m);
411
+ }, [e, m, f, M]);
412
+ Oe(() => {
413
+ l.current && S.length > 5 && (l.current.scrollTop = l.current.scrollHeight);
414
+ }, [S]);
415
+ const je = S.length < T.length, Se = S.map((d) => ({ ...d, id: `${d.colIndex}` }));
416
+ return /* @__PURE__ */ g("div", { className: c.customSortPanelContainer, children: [
417
+ /* @__PURE__ */ g("div", { className: c.customSortPanelContent, onMouseDown: (d) => {
418
+ d.stopPropagation();
419
+ }, children: [
420
+ /* @__PURE__ */ g("div", { className: c.customSortPanelExt, children: [
421
+ /* @__PURE__ */ a("div", { className: c.firstRowCheck, children: /* @__PURE__ */ a(yt, { checked: r, onChange: (d) => Fe(!!d), children: n.t("sheets-sort.dialog.first-row-check") }) }),
422
+ je ? /* @__PURE__ */ g("div", { className: c.addCondition, onClick: V, children: [
423
+ /* @__PURE__ */ a(Q, {}),
424
+ /* @__PURE__ */ a("span", { className: c.addConditionText, children: n.t("sheets-sort.dialog.add-condition") })
425
+ ] }) : /* @__PURE__ */ g(
426
+ "div",
427
+ {
428
+ className: `
429
+ ${c.addCondition}
430
+ ${c.addConditionDisable}
431
+ `,
432
+ children: [
433
+ /* @__PURE__ */ a(Q, {}),
434
+ /* @__PURE__ */ a("span", { className: c.addConditionText, children: n.t("sheets-sort.dialog.add-condition") })
435
+ ]
436
+ }
437
+ )
438
+ ] }),
439
+ /* @__PURE__ */ a(
440
+ "div",
441
+ {
442
+ className: c.conditionList,
443
+ onScroll: (d) => {
444
+ const _ = d.currentTarget.scrollTop;
445
+ i(_);
446
+ },
447
+ ref: l,
448
+ children: /* @__PURE__ */ a(
449
+ xt,
450
+ {
451
+ list: Se,
452
+ onListChange: $,
453
+ idKey: "id",
454
+ draggableHandle: `.${c.customSortPanelItemHandler}`,
455
+ itemRender: (d) => /* @__PURE__ */ a(
456
+ _n,
457
+ {
458
+ titles: T,
459
+ list: Se,
460
+ item: d,
461
+ onChange: (_, B) => q(B, _),
462
+ scrollPosition: s
463
+ }
464
+ ),
465
+ rowHeight: 32,
466
+ margin: [0, 12]
467
+ }
468
+ )
469
+ }
470
+ )
471
+ ] }),
472
+ /* @__PURE__ */ g("div", { className: c.customSortPanelFooter, children: [
473
+ /* @__PURE__ */ a(ve, { className: c.customSortPanelFooterBtn, type: "default", onClick: () => X(), children: n.t("sheets-sort.dialog.cancel") }),
474
+ /* @__PURE__ */ a(ve, { className: c.customSortPanelFooterBtn, type: "primary", onClick: () => h(S, r), children: n.t("sheets-sort.dialog.confirm") })
475
+ ] })
476
+ ] });
477
+ }
478
+ function _n(e) {
479
+ var V;
480
+ const { list: t, item: n, titles: r, onChange: o, scrollPosition: s } = e, i = O(A), l = r.filter((h) => !t.some((X) => X.colIndex === h.index) || h.index === n.colIndex), u = t.findIndex((h) => h.colIndex === n.colIndex), m = N((h) => {
481
+ o({ ...n, colIndex: h.index }, u), f(!1);
482
+ }, [u, n, o]), [M, f] = F(!1), T = (h) => {
483
+ f(h);
484
+ };
485
+ Oe(() => {
486
+ f(!1);
487
+ }, [s]);
488
+ const S = t.length > 1, $ = (V = r.find((h) => h.index === n.colIndex)) == null ? void 0 : V.label, q = i.getCurrentLocale() === J.ZH_CN ? c.customSortPanelItemOrderRadioCn : c.customSortPanelItemOrderRadio;
489
+ return /* @__PURE__ */ g("div", { className: c.customSortPanelItem, children: [
490
+ /* @__PURE__ */ g("div", { className: c.customSortPanelItemHead, children: [
491
+ /* @__PURE__ */ a("div", { className: c.customSortPanelItemHandler, children: /* @__PURE__ */ a(Ue, {}) }),
492
+ /* @__PURE__ */ a("div", { className: c.customSortPanelItemColumn, children: /* @__PURE__ */ a(
493
+ Mt,
494
+ {
495
+ align: "start",
496
+ overlay: /* @__PURE__ */ a("ul", { className: Rt(c.customSortColMenu, "univer-theme"), children: l.map((h) => /* @__PURE__ */ g(
497
+ "li",
498
+ {
499
+ onClick: () => m(h),
500
+ className: c.customSortColMenuItem,
501
+ children: [
502
+ /* @__PURE__ */ a("span", { className: c.customSortColMenuItemDesc, children: h.label }),
503
+ /* @__PURE__ */ a("span", { className: c.customSortColMenuItemCheck, children: h.index === n.colIndex && /* @__PURE__ */ a(Ne, {}) })
504
+ ]
505
+ },
506
+ h.index
507
+ )) }),
508
+ open: M,
509
+ onOpenChange: T,
510
+ children: /* @__PURE__ */ g("div", { className: c.customSortPanelItemColumnInput, children: [
511
+ /* @__PURE__ */ a("span", { className: c.customSortPanelItemColumnInputText, children: $ }),
512
+ /* @__PURE__ */ a(He, { className: c.customSortPanelItemColumnInputDropdown })
513
+ ] })
514
+ }
515
+ ) })
516
+ ] }),
517
+ /* @__PURE__ */ a("div", { className: c.customSortPanelItemOrder, children: /* @__PURE__ */ g(
518
+ Ee,
519
+ {
520
+ className: q,
521
+ value: n.type,
522
+ onChange: (h) => {
523
+ o({ ...n, type: h }, u);
524
+ },
525
+ children: [
526
+ /* @__PURE__ */ a(Z, { value: U.ASC, children: i.t("sheets-sort.general.sort-asc") }),
527
+ /* @__PURE__ */ a(Z, { value: U.DESC, children: i.t("sheets-sort.general.sort-desc") })
528
+ ]
529
+ }
530
+ ) }),
531
+ /* @__PURE__ */ a("div", { className: c.customSortPanelItemRemove, children: S && /* @__PURE__ */ a(ke, { onClick: () => o(null, u) }) })
532
+ ] });
533
+ }
534
+ function In(e, t) {
535
+ const { startColumn: n, endColumn: r } = e, o = new Set(t.map((s) => s == null ? void 0 : s.colIndex));
536
+ for (let s = n; s <= r; s++)
537
+ if (!o.has(s))
538
+ return s;
539
+ return null;
540
+ }
541
+ function yn(e) {
542
+ const { range: t, colIndex: n, onClose: r } = e, o = O(C), s = O(ye), i = O(A), l = N((u) => {
543
+ const { unitId: m, subUnitId: M } = It(s) || {};
544
+ if (t && m && M) {
545
+ const f = { ...t, startRow: t.startRow + 1 };
546
+ o.triggerSortDirectly(u, !1, { unitId: m, subUnitId: M, range: f, colIndex: n });
547
+ } else
548
+ console.warn(`Cannot find the target to sort. unitId: ${m}, subUnitId: ${M}, range: ${t}, colIndex: ${n}`);
549
+ r();
550
+ }, [t, n, o, s, r]);
551
+ return /* @__PURE__ */ g("div", { className: c.embedSortBtnContainer, children: [
552
+ /* @__PURE__ */ g(
553
+ "div",
554
+ {
555
+ className: `
556
+ ${c.embedSortBtn}
557
+ ${c.embedSortBtnAsc}
558
+ `,
559
+ onClick: () => l(!0),
560
+ children: [
561
+ /* @__PURE__ */ a(ee, { className: c.embedSortBtnIcon }),
562
+ i.t("sheets-sort.general.sort-asc")
563
+ ]
564
+ }
565
+ ),
566
+ /* @__PURE__ */ g(
567
+ "div",
568
+ {
569
+ className: `
570
+ ${c.embedSortBtn}
571
+ ${c.embedSortBtnDesc}
572
+ `,
573
+ onClick: () => l(!1),
574
+ children: [
575
+ /* @__PURE__ */ a(te, { className: c.embedSortBtnIcon }),
576
+ i.t("sheets-sort.general.sort-desc")
577
+ ]
578
+ }
579
+ )
580
+ ] });
581
+ }
582
+ const Ae = "sheet.menu.sheets-sort", $e = "sheet.menu.sheets-sort-ctx", j = "AscendingSingle", me = "ExpandAscendingSingle", he = "DescendingSingle", ge = "ExpandDescendingSingle", Ce = "CustomSortSingle";
583
+ function xn(e) {
584
+ return {
585
+ id: Ae,
586
+ type: p.SUBITEMS,
587
+ icon: j,
588
+ tooltip: "sheets-sort.general.sort",
589
+ hidden$: be(e, Y.UNIVER_SHEET),
590
+ disabled$: P(e, { workbookTypes: [H], worksheetTypes: [D, L], rangeTypes: [k] })
591
+ };
592
+ }
593
+ function Mn(e) {
594
+ return {
595
+ id: ne.id,
596
+ icon: j,
597
+ title: "sheets-sort.general.sort-asc-cur",
598
+ type: p.BUTTON,
599
+ hidden$: rt(e)
600
+ };
601
+ }
602
+ function Rn(e) {
603
+ return {
604
+ id: re.id,
605
+ title: "sheets-sort.general.sort-asc-ext",
606
+ icon: me,
607
+ type: p.BUTTON
608
+ };
609
+ }
610
+ function bn(e) {
611
+ return {
612
+ id: oe.id,
613
+ title: "sheets-sort.general.sort-desc-cur",
614
+ icon: he,
615
+ type: p.BUTTON
616
+ };
617
+ }
618
+ function En(e) {
619
+ return {
620
+ id: se.id,
621
+ title: "sheets-sort.general.sort-desc-ext",
622
+ icon: ge,
623
+ type: p.BUTTON
624
+ };
625
+ }
626
+ function Tn(e) {
627
+ return {
628
+ id: ie.id,
629
+ title: "sheets-sort.general.sort-custom",
630
+ type: p.BUTTON,
631
+ icon: Ce
632
+ };
633
+ }
634
+ function On(e) {
635
+ return {
636
+ id: $e,
637
+ title: "sheets-sort.general.sort",
638
+ type: p.SUBITEMS,
639
+ icon: j,
640
+ hidden$: be(e, Y.UNIVER_SHEET),
641
+ disabled$: P(e, {
642
+ workbookTypes: [H],
643
+ worksheetTypes: [D, L],
644
+ rangeTypes: [k]
645
+ })
646
+ };
647
+ }
648
+ function wn(e) {
649
+ return {
650
+ id: ce.id,
651
+ title: "sheets-sort.general.sort-asc-cur",
652
+ type: p.BUTTON,
653
+ icon: j,
654
+ disabled$: P(e, { workbookTypes: [H], worksheetTypes: [D, L], rangeTypes: [k] })
655
+ };
656
+ }
657
+ function Nn(e) {
658
+ return {
659
+ id: ae.id,
660
+ title: "sheets-sort.general.sort-asc-ext",
661
+ type: p.BUTTON,
662
+ icon: me,
663
+ disabled$: P(e, { workbookTypes: [H], worksheetTypes: [D, L], rangeTypes: [k] })
664
+ };
665
+ }
666
+ function Pn(e) {
667
+ return {
668
+ id: le.id,
669
+ title: "sheets-sort.general.sort-desc-cur",
670
+ type: p.BUTTON,
671
+ icon: he,
672
+ disabled$: P(e, { workbookTypes: [H], worksheetTypes: [D, L], rangeTypes: [k] })
673
+ };
674
+ }
675
+ function kn(e) {
676
+ return {
677
+ id: de.id,
678
+ title: "sheets-sort.general.sort-desc-ext",
679
+ type: p.BUTTON,
680
+ icon: ge,
681
+ disabled$: P(e, { workbookTypes: [H], worksheetTypes: [D, L], rangeTypes: [k] })
682
+ };
683
+ }
684
+ function Dn(e) {
685
+ return {
686
+ id: ue.id,
687
+ title: "sheets-sort.general.sort-custom",
688
+ type: p.BUTTON,
689
+ icon: Ce,
690
+ disabled$: P(e, { workbookTypes: [H], worksheetTypes: [D, L], rangeTypes: [k] })
691
+ };
692
+ }
693
+ const Ln = {
694
+ [lt.FORMULAS_INSERT]: {
695
+ [Ae]: {
696
+ order: 2,
697
+ menuItemFactory: xn,
698
+ [ne.id]: {
699
+ order: 0,
700
+ menuItemFactory: Mn
701
+ },
702
+ [re.id]: {
703
+ order: 1,
704
+ menuItemFactory: Rn
705
+ },
706
+ [oe.id]: {
707
+ order: 2,
708
+ menuItemFactory: bn
709
+ },
710
+ [se.id]: {
711
+ order: 3,
712
+ menuItemFactory: En
713
+ },
714
+ [ie.id]: {
715
+ order: 4,
716
+ menuItemFactory: Tn
717
+ }
718
+ }
719
+ },
720
+ [ct.MAIN_AREA]: {
721
+ [at.DATA]: {
722
+ [$e]: {
723
+ order: 0,
724
+ menuItemFactory: On,
725
+ [ce.id]: {
726
+ order: 0,
727
+ menuItemFactory: wn
728
+ },
729
+ [ae.id]: {
730
+ order: 1,
731
+ menuItemFactory: Nn
732
+ },
733
+ [le.id]: {
734
+ order: 2,
735
+ menuItemFactory: Pn
736
+ },
737
+ [de.id]: {
738
+ order: 3,
739
+ menuItemFactory: kn
740
+ },
741
+ [ue.id]: {
742
+ order: 4,
743
+ menuItemFactory: Dn
744
+ }
745
+ }
746
+ }
747
+ }
748
+ };
749
+ var Hn = Object.getOwnPropertyDescriptor, Un = (e, t, n, r) => {
750
+ for (var o = r > 1 ? void 0 : r ? Hn(t, n) : t, s = e.length - 1, i; s >= 0; s--)
751
+ (i = e[s]) && (o = i(o) || o);
752
+ return o;
753
+ }, R = (e, t) => (n, r) => t(n, r, e);
754
+ const _e = "custom-sort-dialog", An = 560;
755
+ let G = class extends qe {
756
+ constructor(e, t, n, r, o, s, i, l, u, m) {
757
+ super(), this._commandService = e, this._menuManagerService = t, this._dialogService = n, this._layoutService = r, this._uiPartsService = o, this._sheetRenderService = s, this._localeService = i, this._sheetsSortUIService = l, this._injector = u, this._componentManager = m, this._initCommands(), this._initMenu(), this._initUI();
758
+ }
759
+ _initMenu() {
760
+ this._menuManagerService.mergeMenu(Ln);
761
+ }
762
+ _initCommands() {
763
+ [
764
+ ne,
765
+ re,
766
+ oe,
767
+ se,
768
+ ie,
769
+ ce,
770
+ ae,
771
+ le,
772
+ de,
773
+ ue
774
+ ].forEach((e) => this.disposeWithMe(this._commandService.registerCommand(e))), this.disposeWithMe(this._sheetRenderService.registerSkeletonChangingMutations(et.id));
775
+ }
776
+ _initUI() {
777
+ this.disposeWithMe(this._componentManager.register("CustomSortPanel", pn)), this.disposeWithMe(this._uiPartsService.registerComponent(st.FILTER_PANEL_EMBED_POINT, () => Ct(yn, this._injector))), this.disposeWithMe(this._componentManager.register(j, ee)), this.disposeWithMe(this._componentManager.register(me, De)), this.disposeWithMe(this._componentManager.register(he, te)), this.disposeWithMe(this._componentManager.register(ge, Le)), this.disposeWithMe(this._componentManager.register(Ce, Pe)), this._sheetsSortUIService.customSortState$.pipe(ft(this.dispose$)).subscribe((e) => {
778
+ e && e.show && e.location ? this._openCustomSortPanel(e.location) : e && !(e != null && e.show) && this._closePanel();
779
+ });
780
+ }
781
+ _openCustomSortPanel(e) {
782
+ this._dialogService.open({
783
+ id: _e,
784
+ draggable: !0,
785
+ width: An,
786
+ title: { title: `${this._localeService.t("sheets-sort.general.sort-custom")}: ${nt(e.range)}` },
787
+ children: { label: "CustomSortPanel" },
788
+ destroyOnClose: !0,
789
+ defaultPosition: $n(),
790
+ preservePositionOnDestroy: !1,
791
+ onClose: () => this._closePanel(),
792
+ mask: !0
793
+ });
794
+ }
795
+ _closePanel() {
796
+ this._dialogService.close(_e), queueMicrotask(() => this._layoutService.focus());
797
+ }
798
+ };
799
+ G = Un([
800
+ R(0, xe),
801
+ R(1, dt),
802
+ R(2, ut),
803
+ R(3, mt),
804
+ R(4, ht),
805
+ R(5, E(ot)),
806
+ R(6, E(A)),
807
+ R(7, E(C)),
808
+ R(8, E(Me)),
809
+ R(9, E(gt))
810
+ ], G);
811
+ function $n() {
812
+ return { x: 0, y: 0 };
813
+ }
814
+ var Bn = Object.defineProperty, Fn = Object.getOwnPropertyDescriptor, jn = (e, t, n) => t in e ? Bn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, Vn = (e, t, n, r) => {
815
+ for (var o = r > 1 ? void 0 : r ? Fn(t, n) : t, s = e.length - 1, i; s >= 0; s--)
816
+ (i = e[s]) && (o = i(o) || o);
817
+ return o;
818
+ }, Ie = (e, t) => (n, r) => t(n, r, e), Be = (e, t, n) => jn(e, typeof t != "symbol" ? t + "" : t, n);
819
+ const zn = "SHEET_SORT_UI_PLUGIN";
820
+ let W = class extends Je {
821
+ constructor(e = pe, t, n) {
822
+ super(), this._config = e, this._injector = t, this._configService = n;
823
+ const { ...r } = Qe(
824
+ {},
825
+ pe,
826
+ this._config
827
+ );
828
+ this._configService.setConfig(bt, r);
829
+ }
830
+ onStarting() {
831
+ [
832
+ [C],
833
+ [G]
834
+ ].forEach((e) => this._injector.add(e));
835
+ }
836
+ onRendered() {
837
+ this._injector.get(G);
838
+ }
839
+ };
840
+ Be(W, "type", Y.UNIVER_SHEET);
841
+ Be(W, "pluginName", zn);
842
+ W = Vn([
843
+ Xe(tt),
844
+ Ie(1, E(Me)),
845
+ Ie(2, Ke)
846
+ ], W);
847
+ export {
848
+ ne as SortRangeAscCommand,
849
+ re as SortRangeAscExtCommand,
850
+ ae as SortRangeAscExtInCtxMenuCommand,
851
+ ce as SortRangeAscInCtxMenuCommand,
852
+ ie as SortRangeCustomCommand,
853
+ ue as SortRangeCustomInCtxMenuCommand,
854
+ oe as SortRangeDescCommand,
855
+ se as SortRangeDescExtCommand,
856
+ de as SortRangeDescExtInCtxMenuCommand,
857
+ le as SortRangeDescInCtxMenuCommand,
858
+ W as UniverSheetsSortUIPlugin
859
+ };
@@ -0,0 +1,33 @@
1
+ const e = {
2
+ "sheets-sort": {
3
+ general: {
4
+ sort: "Sort",
5
+ "sort-asc": "Ascending",
6
+ "sort-desc": "Descending",
7
+ "sort-custom": "Custom Sort",
8
+ "sort-asc-ext": "Expand Ascending",
9
+ "sort-desc-ext": "Expand Descending",
10
+ "sort-asc-cur": "Ascending",
11
+ "sort-desc-cur": "Descending"
12
+ },
13
+ error: {
14
+ "merge-size": "The selected range contains merged cells of different sizes, which cannot be sorted.",
15
+ empty: "The selected range has no content and cannot be sorted.",
16
+ single: "The selected range has only one row and cannot be sorted.",
17
+ "formula-array": "The selected range has array formulas and cannot be sorted."
18
+ },
19
+ dialog: {
20
+ "sort-reminder": "Sort Reminder",
21
+ "sort-reminder-desc": "Extend range sorting or keep range sorting?",
22
+ "sort-reminder-ext": "Extend range sorting",
23
+ "sort-reminder-no": "Keep range sorting",
24
+ "first-row-check": "First row does not participate in sorting",
25
+ "add-condition": "Add condition",
26
+ cancel: "Cancel",
27
+ confirm: "Confirm"
28
+ }
29
+ }
30
+ };
31
+ export {
32
+ e as default
33
+ };
@@ -0,0 +1,33 @@
1
+ const r = {
2
+ "sheets-sort": {
3
+ general: {
4
+ sort: "مرتب‌سازی",
5
+ "sort-asc": "صعودی",
6
+ "sort-desc": "نزولی",
7
+ "sort-custom": "مرتب‌سازی سفارشی",
8
+ "sort-asc-ext": "گسترش صعودی",
9
+ "sort-desc-ext": "گسترش نزولی",
10
+ "sort-asc-cur": "صعودی",
11
+ "sort-desc-cur": "نزولی"
12
+ },
13
+ error: {
14
+ "merge-size": "محدوده انتخاب شده حاوی سلول‌های ادغام شده با اندازه‌های مختلف است که نمی‌توان مرتب کرد.",
15
+ empty: "محدوده انتخاب شده هیچ محتوایی ندارد و نمی‌توان مرتب کرد.",
16
+ single: "محدوده انتخاب شده فقط یک ردیف دارد و نمی‌توان مرتب کرد.",
17
+ "formula-array": "محدوده انتخاب شده دارای فرمول‌های آرایه‌ای است و نمی‌توان مرتب کرد."
18
+ },
19
+ dialog: {
20
+ "sort-reminder": "یادآوری مرتب‌سازی",
21
+ "sort-reminder-desc": "گسترش مرتب‌سازی محدوده یا حفظ مرتب‌سازی محدوده؟",
22
+ "sort-reminder-ext": "گسترش مرتب‌سازی محدوده",
23
+ "sort-reminder-no": "حفظ مرتب‌سازی محدوده",
24
+ "first-row-check": "ردیف اول در مرتب‌سازی شرکت نمی‌کند",
25
+ "add-condition": "افزودن شرط",
26
+ cancel: "انصراف",
27
+ confirm: "تایید"
28
+ }
29
+ }
30
+ };
31
+ export {
32
+ r as default
33
+ };
@@ -0,0 +1,33 @@
1
+ const e = {
2
+ "sheets-sort": {
3
+ general: {
4
+ sort: "Trier",
5
+ "sort-asc": "Croissant",
6
+ "sort-desc": "Décroissant",
7
+ "sort-custom": "Tri personnalisé",
8
+ "sort-asc-ext": "Étendre croissant",
9
+ "sort-desc-ext": "Étendre décroissant",
10
+ "sort-asc-cur": "Croissant",
11
+ "sort-desc-cur": "Décroissant"
12
+ },
13
+ error: {
14
+ "merge-size": "La plage sélectionnée contient des cellules fusionnées de tailles différentes, qui ne peuvent pas être triées.",
15
+ empty: "La plage sélectionnée ne contient aucun contenu et ne peut pas être triée.",
16
+ single: "La plage sélectionnée ne contient qu'une seule ligne et ne peut pas être triée.",
17
+ "formula-array": "La plage sélectionnée contient des formules matricielles et ne peut pas être triée."
18
+ },
19
+ dialog: {
20
+ "sort-reminder": "Rappel de tri",
21
+ "sort-reminder-desc": "Étendre le tri de la plage ou conserver le tri de la plage?",
22
+ "sort-reminder-ext": "Étendre le tri de la plage",
23
+ "sort-reminder-no": "Conserver le tri de la plage",
24
+ "first-row-check": "La première ligne ne participe pas au tri",
25
+ "add-condition": "Ajouter une condition",
26
+ cancel: "Annuler",
27
+ confirm: "Confirmer"
28
+ }
29
+ }
30
+ };
31
+ export {
32
+ e as default
33
+ };
@@ -0,0 +1,33 @@
1
+ const r = {
2
+ "sheets-sort": {
3
+ general: {
4
+ sort: "Сортировка",
5
+ "sort-asc": "По возрастанию",
6
+ "sort-desc": "По убыванию",
7
+ "sort-custom": "Пользовательская сортировка",
8
+ "sort-asc-ext": "Расширенная сортировка по возрастанию",
9
+ "sort-desc-ext": "Расширенная сортировка по убыванию",
10
+ "sort-asc-cur": "По возрастанию",
11
+ "sort-desc-cur": "По убыванию"
12
+ },
13
+ error: {
14
+ "merge-size": "Выбранный диапазон содержит объединенные ячейки разного размера, которые нельзя отсортировать.",
15
+ empty: "Выбранный диапазон не содержит данных и не может быть отсортирован.",
16
+ single: "Выбранный диапазон содержит только одну строку и не может быть отсортирован.",
17
+ "formula-array": "Выбранный диапазон содержит массив формул и не может быть отсортирован."
18
+ },
19
+ dialog: {
20
+ "sort-reminder": "Напоминание о сортировке",
21
+ "sort-reminder-desc": "Расширить сортировку диапазона или оставить сортировку диапазона?",
22
+ "sort-reminder-ext": "Расширить сортировку диапазона",
23
+ "sort-reminder-no": "Оставить сортировку диапазона",
24
+ "first-row-check": "Первая строка контента не участвует в сортировке",
25
+ "add-condition": "Добавить условие",
26
+ cancel: "Отмена",
27
+ confirm: "Подтвердить"
28
+ }
29
+ }
30
+ };
31
+ export {
32
+ r as default
33
+ };
@@ -0,0 +1,33 @@
1
+ const n = {
2
+ "sheets-sort": {
3
+ general: {
4
+ sort: "Sắp xếp",
5
+ "sort-asc": "Tăng dần",
6
+ "sort-desc": "Giảm dần",
7
+ "sort-custom": "Tùy chỉnh sắp xếp",
8
+ "sort-asc-ext": "Tăng dần khu vực mở rộng",
9
+ "sort-desc-ext": "Giảm dần khu vực mở rộng",
10
+ "sort-asc-cur": "Tăng dần khu vực hiện tại",
11
+ "sort-desc-cur": "Giảm dần khu vực hiện tại"
12
+ },
13
+ error: {
14
+ "merge-size": "Kích thước của các ô đã hợp nhất trong vùng được chọn không đồng nhất, không thể sắp xếp.",
15
+ empty: "Vùng được chọn không có nội dung, không thể sắp xếp.",
16
+ single: "Vùng được chọn chỉ có một hàng, không thể sắp xếp.",
17
+ "formula-array": "Vùng được chọn chứa công thức mảng, không thể sắp xếp."
18
+ },
19
+ dialog: {
20
+ "sort-reminder": "Nhắc nhở sắp xếp",
21
+ "sort-reminder-desc": "Hiện tại chỉ sắp xếp vùng được chọn, có muốn mở rộng phạm vi sắp xếp không?",
22
+ "sort-reminder-ext": "Mở rộng phạm vi sắp xếp",
23
+ "sort-reminder-no": "Giữ nguyên phạm vi sắp xếp được chọn",
24
+ "first-row-check": "Hàng đầu tiên không tham gia sắp xếp",
25
+ "add-condition": "Thêm điều kiện sắp xếp",
26
+ cancel: "Hủy bỏ",
27
+ confirm: "Xác nhận"
28
+ }
29
+ }
30
+ };
31
+ export {
32
+ n as default
33
+ };
@@ -0,0 +1,33 @@
1
+ const r = {
2
+ "sheets-sort": {
3
+ general: {
4
+ sort: "排序",
5
+ "sort-asc": "升序",
6
+ "sort-desc": "降序",
7
+ "sort-custom": "自定义排序",
8
+ "sort-asc-ext": "拓展区域升序",
9
+ "sort-desc-ext": "拓展区域降序",
10
+ "sort-asc-cur": "当前区域升序",
11
+ "sort-desc-cur": "当前区域降序"
12
+ },
13
+ error: {
14
+ "merge-size": "所选区域的合并单元格的大小不一致,无法排序。",
15
+ empty: "所选区域无内容,无法排序。",
16
+ single: "所选区域仅有一行,无法排序。",
17
+ "formula-array": "所选区域含数组公式,无法排序。"
18
+ },
19
+ dialog: {
20
+ "sort-reminder": "排序提醒",
21
+ "sort-reminder-desc": "当前仅会对选中区域进行排序,是否拓展排序范围?",
22
+ "sort-reminder-ext": "拓展排序范围",
23
+ "sort-reminder-no": "保持所选排序范围",
24
+ "first-row-check": "标题不参与排序",
25
+ "add-condition": "添加排序条件",
26
+ cancel: "取消",
27
+ confirm: "确认"
28
+ }
29
+ }
30
+ };
31
+ export {
32
+ r as default
33
+ };
@@ -0,0 +1,33 @@
1
+ const r = {
2
+ "sheets-sort": {
3
+ general: {
4
+ sort: "排序",
5
+ "sort-asc": "升序",
6
+ "sort-desc": "降序",
7
+ "sort-custom": "自訂排序",
8
+ "sort-asc-ext": "拓展區域升序",
9
+ "sort-desc-ext": "拓展區域降序",
10
+ "sort-asc-cur": "目前區域升序",
11
+ "sort-desc-cur": "當前區域降序"
12
+ },
13
+ error: {
14
+ "merge-size": "所選區域的合併儲存格的大小不一致,無法排序。 ",
15
+ empty: "所選區域無內容,無法排序。 ",
16
+ single: "所選區域只有一行,無法排序。 ",
17
+ "formula-array": "所選區域含數組公式,無法排序。 "
18
+ },
19
+ dialog: {
20
+ "sort-reminder": "排序提醒",
21
+ "sort-reminder-desc": "目前只會對選取區域進行排序,是否拓展排序範圍? ",
22
+ "sort-reminder-ext": "拓展排序範圍",
23
+ "sort-reminder-no": "保持所選排序範圍",
24
+ "first-row-check": "標題不參與排序",
25
+ "add-condition": "新增排序條件",
26
+ cancel: "取消",
27
+ confirm: "確認"
28
+ }
29
+ }
30
+ };
31
+ export {
32
+ r as default
33
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@univerjs/sheets-sort-ui",
3
- "version": "0.6.7",
3
+ "version": "0.6.9",
4
4
  "private": false,
5
5
  "description": "Univer Sheets Sort UI",
6
6
  "author": "DreamNum <developer@univer.ai>",
@@ -48,18 +48,18 @@
48
48
  "lib"
49
49
  ],
50
50
  "peerDependencies": {
51
- "react": ">=16.9.0",
51
+ "react": "^16.9.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc",
52
52
  "rxjs": ">=7.0.0"
53
53
  },
54
54
  "dependencies": {
55
- "@univerjs/icons": "^0.2.28",
56
- "@univerjs/core": "0.6.7",
57
- "@univerjs/design": "0.6.7",
58
- "@univerjs/engine-formula": "0.6.7",
59
- "@univerjs/sheets": "0.6.7",
60
- "@univerjs/sheets-ui": "0.6.7",
61
- "@univerjs/ui": "0.6.7",
62
- "@univerjs/sheets-sort": "0.6.7"
55
+ "@univerjs/icons": "^0.2.31",
56
+ "@univerjs/core": "0.6.9",
57
+ "@univerjs/engine-formula": "0.6.9",
58
+ "@univerjs/design": "0.6.9",
59
+ "@univerjs/sheets": "0.6.9",
60
+ "@univerjs/sheets-sort": "0.6.9",
61
+ "@univerjs/sheets-ui": "0.6.9",
62
+ "@univerjs/ui": "0.6.9"
63
63
  },
64
64
  "devDependencies": {
65
65
  "less": "^4.2.2",
@@ -70,7 +70,7 @@
70
70
  "typescript": "^5.8.2",
71
71
  "vite": "^6.2.3",
72
72
  "vitest": "^3.0.9",
73
- "@univerjs-infra/shared": "0.6.7"
73
+ "@univerjs-infra/shared": "0.6.9"
74
74
  },
75
75
  "scripts": {
76
76
  "test": "vitest run",