@univerjs/sheets-sort-ui 0.2.2 → 0.2.3
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/README.md +11 -4
- package/lib/cjs/index.js +1 -1
- package/lib/es/index.js +151 -152
- package/lib/locale/vi-VN.json +30 -0
- package/lib/locale/zh-TW.json +30 -0
- package/lib/types/locale/vi-VN.d.ts +4 -0
- package/lib/types/locale/zh-TW.d.ts +4 -0
- package/lib/types/services/sheets-sort-ui.service.d.ts +2 -2
- package/lib/umd/index.js +1 -1
- package/package.json +16 -16
package/lib/es/index.js
CHANGED
|
@@ -4,44 +4,44 @@ var K = (e, t, n) => Xe(e, typeof t != "symbol" ? t + "" : t, n);
|
|
|
4
4
|
import { LocaleService as P, Disposable as qe, UniverInstanceType as te, OnLifecycle as ge, LifecycleStages as Ce, Tools as Se, LocaleType as J, IUniverInstanceService as fe, ILogService as Ye, ICommandService as pe, CommandType as R, throttle as Ke, RxDisposable as Je, Plugin as Qe, DependentOn as et } from "@univerjs/core";
|
|
5
5
|
import { Inject as x, Injector as ve } from "@wendellhu/redi";
|
|
6
6
|
import { SortType as w, SheetsSortService as Q, SortRangeCommand as tt, UniverSheetsSortPlugin as nt } from "@univerjs/sheets-sort";
|
|
7
|
-
import {
|
|
8
|
-
import { expandToContinuousRange as le, getCurrentRangeDisable$ as U, SheetMenuPosition as de, SheetsUIPart as
|
|
9
|
-
import i, { useState as F, forwardRef as E, useRef as _e, createElement as I, useCallback as
|
|
10
|
-
import { IConfirmService as
|
|
11
|
-
import { BehaviorSubject as
|
|
12
|
-
import { RadioGroup as Me, Radio as G, Checkbox as
|
|
13
|
-
import { useDependency as
|
|
14
|
-
import { serializeRange as
|
|
15
|
-
const
|
|
16
|
-
extendConfirmContent:
|
|
17
|
-
extendConfirmRadioGroup:
|
|
18
|
-
customSortPanelContainer:
|
|
19
|
-
customSortPanelExt:
|
|
7
|
+
import { getPrimaryForRange as rt, SetSelectionsOperation as ot, SheetsSelectionsService as st, getSheetCommandTarget as it, WorkbookEditablePermission as L, WorksheetSortPermission as D, WorksheetEditPermission as H, RangeProtectionPermissionEditPoint as k } from "@univerjs/sheets";
|
|
8
|
+
import { expandToContinuousRange as le, getCurrentRangeDisable$ as U, SheetMenuPosition as de, SheetsUIPart as ct, SheetsRenderService as at } from "@univerjs/sheets-ui";
|
|
9
|
+
import i, { useState as F, forwardRef as E, useRef as _e, createElement as I, useCallback as N, useEffect as Ee } from "react";
|
|
10
|
+
import { IConfirmService as lt, MenuItemType as v, MenuPosition as Ie, MenuGroup as ye, getMenuHiddenObservable as dt, ComponentManager as ut, IMenuService as mt, IDialogService as ht, ILayoutService as gt, IUIPartsService as Ct } from "@univerjs/ui";
|
|
11
|
+
import { BehaviorSubject as St, takeUntil as ft } from "rxjs";
|
|
12
|
+
import { RadioGroup as Me, Radio as G, Checkbox as pt, DraggableList as vt, Button as ue, Dropdown as _t } from "@univerjs/design";
|
|
13
|
+
import { useDependency as O, connectInjector as Et } from "@wendellhu/redi/react-bindings";
|
|
14
|
+
import { serializeRange as It } from "@univerjs/engine-formula";
|
|
15
|
+
const yt = "univer-extend-confirm-content", Mt = "univer-extend-confirm-radio-group", xt = "univer-custom-sort-panel-container", Rt = "univer-custom-sort-panel-ext", Tt = "univer-add-condition", Ot = "univer-add-condition-text", bt = "univer-add-condition-disable", Nt = "univer-custom-sort-panel-footer", Pt = "univer-custom-sort-panel-footer-btn", wt = "univer-custom-sort-panel-item", Lt = "univer-custom-sort-panel-item-head", Dt = "univer-custom-sort-panel-item-handler", Ht = "univer-custom-sort-panel-item-remove", kt = "univer-custom-sort-panel-item-column-input", Ut = "univer-custom-sort-panel-item-column-input-dropdown", At = "univer-custom-sort-panel-item-column-input-text", Bt = "univer-custom-sort-panel-item-order-radio", $t = "univer-custom-sort-panel-item-order-radio-cn", jt = "univer-condition-list", Ft = "univer-embed-sort-btn-container", Vt = "univer-embed-sort-btn", zt = "univer-embed-sort-btn-asc", Zt = "univer-embed-sort-btn-desc", Wt = "univer-embed-sort-btn-icon", Gt = "univer-custom-sort-col-menu", Xt = "univer-custom-sort-col-menu-item", qt = "univer-custom-sort-col-menu-item-desc", a = {
|
|
16
|
+
extendConfirmContent: yt,
|
|
17
|
+
extendConfirmRadioGroup: Mt,
|
|
18
|
+
customSortPanelContainer: xt,
|
|
19
|
+
customSortPanelExt: Rt,
|
|
20
20
|
addCondition: Tt,
|
|
21
|
-
addConditionText:
|
|
21
|
+
addConditionText: Ot,
|
|
22
22
|
addConditionDisable: bt,
|
|
23
|
-
customSortPanelFooter:
|
|
24
|
-
customSortPanelFooterBtn:
|
|
25
|
-
customSortPanelItem:
|
|
26
|
-
customSortPanelItemHead:
|
|
27
|
-
customSortPanelItemHandler:
|
|
28
|
-
customSortPanelItemRemove:
|
|
29
|
-
customSortPanelItemColumnInput:
|
|
30
|
-
customSortPanelItemColumnInputDropdown:
|
|
31
|
-
customSortPanelItemColumnInputText:
|
|
32
|
-
customSortPanelItemOrderRadio:
|
|
33
|
-
customSortPanelItemOrderRadioCn:
|
|
34
|
-
conditionList:
|
|
35
|
-
embedSortBtnContainer:
|
|
36
|
-
embedSortBtn:
|
|
37
|
-
embedSortBtnAsc:
|
|
38
|
-
embedSortBtnDesc:
|
|
39
|
-
embedSortBtnIcon:
|
|
40
|
-
customSortColMenu:
|
|
41
|
-
customSortColMenuItem:
|
|
42
|
-
customSortColMenuItemDesc:
|
|
43
|
-
},
|
|
44
|
-
const [t, n] = F("0"), r =
|
|
23
|
+
customSortPanelFooter: Nt,
|
|
24
|
+
customSortPanelFooterBtn: Pt,
|
|
25
|
+
customSortPanelItem: wt,
|
|
26
|
+
customSortPanelItemHead: Lt,
|
|
27
|
+
customSortPanelItemHandler: Dt,
|
|
28
|
+
customSortPanelItemRemove: Ht,
|
|
29
|
+
customSortPanelItemColumnInput: kt,
|
|
30
|
+
customSortPanelItemColumnInputDropdown: Ut,
|
|
31
|
+
customSortPanelItemColumnInputText: At,
|
|
32
|
+
customSortPanelItemOrderRadio: Bt,
|
|
33
|
+
customSortPanelItemOrderRadioCn: $t,
|
|
34
|
+
conditionList: jt,
|
|
35
|
+
embedSortBtnContainer: Ft,
|
|
36
|
+
embedSortBtn: Vt,
|
|
37
|
+
embedSortBtnAsc: zt,
|
|
38
|
+
embedSortBtnDesc: Zt,
|
|
39
|
+
embedSortBtnIcon: Wt,
|
|
40
|
+
customSortColMenu: Gt,
|
|
41
|
+
customSortColMenuItem: Xt,
|
|
42
|
+
customSortColMenuItemDesc: qt
|
|
43
|
+
}, Yt = (e) => {
|
|
44
|
+
const [t, n] = F("0"), r = O(P);
|
|
45
45
|
return /* @__PURE__ */ i.createElement("div", { className: a.extendConfirmContent }, /* @__PURE__ */ i.createElement("div", { className: "extend-confirm-desc" }, r.t("sheets-sort.dialog.sort-reminder-desc")), /* @__PURE__ */ i.createElement(
|
|
46
46
|
Me,
|
|
47
47
|
{
|
|
@@ -62,11 +62,11 @@ const Mt = "univer-extend-confirm-content", xt = "univer-extend-confirm-radio-gr
|
|
|
62
62
|
/* @__PURE__ */ i.createElement(G, { value: "1" }, r.t("sheets-sort.dialog.sort-reminder-ext"))
|
|
63
63
|
));
|
|
64
64
|
};
|
|
65
|
-
var
|
|
66
|
-
for (var o = r > 1 ? void 0 : r ?
|
|
65
|
+
var Kt = Object.defineProperty, Jt = Object.getOwnPropertyDescriptor, Qt = (e, t, n, r) => {
|
|
66
|
+
for (var o = r > 1 ? void 0 : r ? Jt(t, n) : t, s = e.length - 1, c; s >= 0; s--)
|
|
67
67
|
(c = e[s]) && (o = (r ? c(t, n, o) : c(o)) || o);
|
|
68
|
-
return r && o &&
|
|
69
|
-
},
|
|
68
|
+
return r && o && Kt(t, n, o), o;
|
|
69
|
+
}, b = (e, t) => (n, r) => t(n, r, e);
|
|
70
70
|
const W = {
|
|
71
71
|
MERGE_ERROR: "sheets-sort.error.merge-size",
|
|
72
72
|
EMPTY_ERROR: "sheets-sort.error.empty",
|
|
@@ -76,7 +76,7 @@ const W = {
|
|
|
76
76
|
let g = class extends qe {
|
|
77
77
|
constructor(t, n, r, o, s, c, l) {
|
|
78
78
|
super();
|
|
79
|
-
K(this, "_customSortState$", new
|
|
79
|
+
K(this, "_customSortState$", new St(null));
|
|
80
80
|
K(this, "customSortState$", this._customSortState$.asObservable());
|
|
81
81
|
this._univerInstanceService = t, this._confirmService = n, this._logService = r, this._selectionManagerService = o, this._sheetsSortService = s, this._localeService = c, this._commandService = l;
|
|
82
82
|
}
|
|
@@ -108,15 +108,15 @@ let g = class extends qe {
|
|
|
108
108
|
const { unitId: r, subUnitId: o, range: s } = n, c = (d = this._univerInstanceService.getUnit(r)) == null ? void 0 : d.getSheetBySheetId(o);
|
|
109
109
|
if (!c)
|
|
110
110
|
return [];
|
|
111
|
-
const l =
|
|
111
|
+
const l = en(this._localeService);
|
|
112
112
|
return Array.from(
|
|
113
113
|
{ length: s.endColumn - s.startColumn + 1 },
|
|
114
114
|
(C, f) => {
|
|
115
115
|
var S;
|
|
116
|
-
const
|
|
116
|
+
const T = (S = c.getCell(s.startRow, f + s.startColumn)) == null ? void 0 : S.v;
|
|
117
117
|
return {
|
|
118
118
|
index: f + s.startColumn,
|
|
119
|
-
label: t ? `${
|
|
119
|
+
label: t ? `${T != null ? T : l(f + s.startColumn)}` : l(f + s.startColumn)
|
|
120
120
|
};
|
|
121
121
|
}
|
|
122
122
|
);
|
|
@@ -129,10 +129,9 @@ let g = class extends qe {
|
|
|
129
129
|
const s = {
|
|
130
130
|
unitId: t,
|
|
131
131
|
subUnitId: n,
|
|
132
|
-
|
|
133
|
-
selections: [{ range: r, primary: ot(r, o), style: null }]
|
|
132
|
+
selections: [{ range: r, primary: rt(r, o), style: null }]
|
|
134
133
|
};
|
|
135
|
-
this._commandService.executeCommand(
|
|
134
|
+
this._commandService.executeCommand(ot.id, s);
|
|
136
135
|
}
|
|
137
136
|
async showCheckError(t) {
|
|
138
137
|
return await this._confirmService.confirm({
|
|
@@ -154,7 +153,7 @@ let g = class extends qe {
|
|
|
154
153
|
},
|
|
155
154
|
children: {
|
|
156
155
|
title: /* @__PURE__ */ i.createElement(
|
|
157
|
-
|
|
156
|
+
Yt,
|
|
158
157
|
{
|
|
159
158
|
onChange: (r) => {
|
|
160
159
|
t = r === "1";
|
|
@@ -176,7 +175,7 @@ let g = class extends qe {
|
|
|
176
175
|
}
|
|
177
176
|
async _detectSortLocation(t) {
|
|
178
177
|
var d;
|
|
179
|
-
const n = this._univerInstanceService.getCurrentUnitForType(te.UNIVER_SHEET), r = n.getActiveSheet(), o = n.getUnitId(), s = r.getSheetId(), c = this._selectionManagerService.
|
|
178
|
+
const n = this._univerInstanceService.getCurrentUnitForType(te.UNIVER_SHEET), r = n.getActiveSheet(), o = n.getUnitId(), s = r.getSheetId(), c = this._selectionManagerService.getCurrentLastSelection();
|
|
180
179
|
if (!c)
|
|
181
180
|
return null;
|
|
182
181
|
let l;
|
|
@@ -190,7 +189,7 @@ let g = class extends qe {
|
|
|
190
189
|
return null;
|
|
191
190
|
C === "keep" ? l = c.range : (l = le(c.range, { up: !0, down: !0, left: !0, right: !0 }, r), this.setSelection(o, s, l));
|
|
192
191
|
}
|
|
193
|
-
const m = (d = this._selectionManagerService.
|
|
192
|
+
const m = (d = this._selectionManagerService.getCurrentLastSelection()) == null ? void 0 : d.primary;
|
|
194
193
|
return m ? {
|
|
195
194
|
range: l,
|
|
196
195
|
unitId: o,
|
|
@@ -199,17 +198,17 @@ let g = class extends qe {
|
|
|
199
198
|
} : null;
|
|
200
199
|
}
|
|
201
200
|
};
|
|
202
|
-
g =
|
|
201
|
+
g = Qt([
|
|
203
202
|
ge(Ce.Ready, Q),
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
203
|
+
b(0, fe),
|
|
204
|
+
b(1, lt),
|
|
205
|
+
b(2, Ye),
|
|
206
|
+
b(3, x(st)),
|
|
207
|
+
b(4, x(Q)),
|
|
208
|
+
b(5, x(P)),
|
|
209
|
+
b(6, pe)
|
|
211
210
|
], g);
|
|
212
|
-
function
|
|
211
|
+
function en(e) {
|
|
213
212
|
return (t) => {
|
|
214
213
|
const n = Se.chatAtABC(t);
|
|
215
214
|
switch (e.getCurrentLocale()) {
|
|
@@ -230,7 +229,7 @@ var p = function() {
|
|
|
230
229
|
}
|
|
231
230
|
return e;
|
|
232
231
|
}, p.apply(this, arguments);
|
|
233
|
-
},
|
|
232
|
+
}, tn = function(e, t) {
|
|
234
233
|
var n = {};
|
|
235
234
|
for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
|
|
236
235
|
if (e != null && typeof Object.getOwnPropertySymbols == "function")
|
|
@@ -238,15 +237,15 @@ var p = function() {
|
|
|
238
237
|
t.indexOf(r[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[o]) && (n[r[o]] = e[r[o]]);
|
|
239
238
|
return n;
|
|
240
239
|
}, y = E(function(e, t) {
|
|
241
|
-
var n = e.icon, r = e.id, o = e.className, s = e.extend, c =
|
|
240
|
+
var n = e.icon, r = e.id, o = e.className, s = e.extend, c = tn(e, ["icon", "id", "className", "extend"]), l = "univerjs-icon univerjs-icon-".concat(r, " ").concat(o || "").trim(), m = _e("_".concat(on()));
|
|
242
241
|
return xe(n, "".concat(r), { defIds: n.defIds, idSuffix: m.current }, p({ ref: t, className: l }, c), s);
|
|
243
242
|
});
|
|
244
243
|
function xe(e, t, n, r, o) {
|
|
245
|
-
return I(e.tag, p(p({ key: t },
|
|
244
|
+
return I(e.tag, p(p({ key: t }, nn(e, n, o)), r), (rn(e, n).children || []).map(function(s, c) {
|
|
246
245
|
return xe(s, "".concat(t, "-").concat(e.tag, "-").concat(c), n, void 0, o);
|
|
247
246
|
}));
|
|
248
247
|
}
|
|
249
|
-
function
|
|
248
|
+
function nn(e, t, n) {
|
|
250
249
|
var r = p({}, e.attrs);
|
|
251
250
|
n != null && n.colorChannel1 && r.fill === "colorChannel1" && (r.fill = n.colorChannel1);
|
|
252
251
|
var o = t.defIds;
|
|
@@ -255,93 +254,93 @@ function rn(e, t, n) {
|
|
|
255
254
|
typeof l == "string" && (r[c] = l.replace(/url\(#(.*)\)/, "url(#$1".concat(t.idSuffix, ")")));
|
|
256
255
|
})), r;
|
|
257
256
|
}
|
|
258
|
-
function
|
|
257
|
+
function rn(e, t) {
|
|
259
258
|
var n, r = t.defIds;
|
|
260
259
|
return !r || r.length === 0 ? e : e.tag === "defs" && (!((n = e.children) === null || n === void 0) && n.length) ? p(p({}, e), { children: e.children.map(function(o) {
|
|
261
260
|
return typeof o.attrs.id == "string" && r && r.indexOf(o.attrs.id) > -1 ? p(p({}, o), { attrs: p(p({}, o.attrs), { id: o.attrs.id + t.idSuffix }) }) : o;
|
|
262
261
|
}) }) : e;
|
|
263
262
|
}
|
|
264
|
-
function
|
|
263
|
+
function on() {
|
|
265
264
|
return Math.random().toString(36).substring(2, 8);
|
|
266
265
|
}
|
|
267
266
|
y.displayName = "UniverIcon";
|
|
268
|
-
var
|
|
267
|
+
var sn = { 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" } }] }, ne = E(function(e, t) {
|
|
269
268
|
return I(y, Object.assign({}, e, {
|
|
270
269
|
id: "ascending- single",
|
|
271
270
|
ref: t,
|
|
272
|
-
icon:
|
|
271
|
+
icon: sn
|
|
273
272
|
}));
|
|
274
273
|
});
|
|
275
274
|
ne.displayName = "AscendingSingle";
|
|
276
|
-
var
|
|
275
|
+
var cn = { 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" } }] }, Re = E(function(e, t) {
|
|
277
276
|
return I(y, Object.assign({}, e, {
|
|
278
277
|
id: "check-mark-single",
|
|
279
278
|
ref: t,
|
|
280
|
-
icon:
|
|
279
|
+
icon: cn
|
|
281
280
|
}));
|
|
282
281
|
});
|
|
283
282
|
Re.displayName = "CheckMarkSingle";
|
|
284
|
-
var
|
|
283
|
+
var an = { 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" } }] }, Te = E(function(e, t) {
|
|
285
284
|
return I(y, Object.assign({}, e, {
|
|
286
285
|
id: "custom-sort-single",
|
|
287
286
|
ref: t,
|
|
288
|
-
icon:
|
|
287
|
+
icon: an
|
|
289
288
|
}));
|
|
290
289
|
});
|
|
291
|
-
|
|
292
|
-
var
|
|
290
|
+
Te.displayName = "CustomSortSingle";
|
|
291
|
+
var ln = { 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" } }] }, Oe = E(function(e, t) {
|
|
293
292
|
return I(y, Object.assign({}, e, {
|
|
294
293
|
id: "delete-empty-single",
|
|
295
294
|
ref: t,
|
|
296
|
-
icon:
|
|
295
|
+
icon: ln
|
|
297
296
|
}));
|
|
298
297
|
});
|
|
299
|
-
|
|
300
|
-
var
|
|
298
|
+
Oe.displayName = "DeleteEmptySingle";
|
|
299
|
+
var dn = { 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" } }] }, re = E(function(e, t) {
|
|
301
300
|
return I(y, Object.assign({}, e, {
|
|
302
301
|
id: "descending-single",
|
|
303
302
|
ref: t,
|
|
304
|
-
icon:
|
|
303
|
+
icon: dn
|
|
305
304
|
}));
|
|
306
305
|
});
|
|
307
306
|
re.displayName = "DescendingSingle";
|
|
308
|
-
var
|
|
307
|
+
var un = { 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" } }] }, be = E(function(e, t) {
|
|
309
308
|
return I(y, Object.assign({}, e, {
|
|
310
309
|
id: "expand-ascending-single",
|
|
311
310
|
ref: t,
|
|
312
|
-
icon:
|
|
311
|
+
icon: un
|
|
313
312
|
}));
|
|
314
313
|
});
|
|
315
|
-
|
|
316
|
-
var
|
|
314
|
+
be.displayName = "ExpandAscendingSingle";
|
|
315
|
+
var mn = { 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" } }] }, Ne = E(function(e, t) {
|
|
317
316
|
return I(y, Object.assign({}, e, {
|
|
318
317
|
id: "expand-descending-single",
|
|
319
318
|
ref: t,
|
|
320
|
-
icon:
|
|
319
|
+
icon: mn
|
|
321
320
|
}));
|
|
322
321
|
});
|
|
323
|
-
|
|
324
|
-
var
|
|
322
|
+
Ne.displayName = "ExpandDescendingSingle";
|
|
323
|
+
var hn = { 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" } }] }, ee = E(function(e, t) {
|
|
325
324
|
return I(y, Object.assign({}, e, {
|
|
326
325
|
id: "increase-single",
|
|
327
326
|
ref: t,
|
|
328
|
-
icon:
|
|
327
|
+
icon: hn
|
|
329
328
|
}));
|
|
330
329
|
});
|
|
331
330
|
ee.displayName = "IncreaseSingle";
|
|
332
|
-
var
|
|
331
|
+
var gn = { 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" } }] }, Pe = E(function(e, t) {
|
|
333
332
|
return I(y, Object.assign({}, e, {
|
|
334
333
|
id: "more-down-single",
|
|
335
334
|
ref: t,
|
|
336
|
-
icon:
|
|
335
|
+
icon: gn
|
|
337
336
|
}));
|
|
338
337
|
});
|
|
339
338
|
Pe.displayName = "MoreDownSingle";
|
|
340
|
-
var
|
|
339
|
+
var Cn = { 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" } }] }] }, we = E(function(e, t) {
|
|
341
340
|
return I(y, Object.assign({}, e, {
|
|
342
341
|
id: "sequence-single",
|
|
343
342
|
ref: t,
|
|
344
|
-
icon:
|
|
343
|
+
icon: Cn
|
|
345
344
|
}));
|
|
346
345
|
});
|
|
347
346
|
we.displayName = "SequenceSingle";
|
|
@@ -386,35 +385,35 @@ const Le = {
|
|
|
386
385
|
type: R.COMMAND,
|
|
387
386
|
handler: async (e) => await e.get(g).triggerSortCustomize()
|
|
388
387
|
};
|
|
389
|
-
function
|
|
390
|
-
const e =
|
|
388
|
+
function Sn() {
|
|
389
|
+
const e = O(g), t = O(Q), n = O(P), [r, o] = F(!1), [s, c] = F(0), l = _e(null), m = e.customSortState();
|
|
391
390
|
if (!m || !m.location)
|
|
392
391
|
return null;
|
|
393
|
-
const { range: d, unitId: C, subUnitId: f } = m.location,
|
|
392
|
+
const { range: d, unitId: C, subUnitId: f } = m.location, T = e.getTitles(r), [S, $] = F([
|
|
394
393
|
{ type: w.ASC, colIndex: d.startColumn }
|
|
395
|
-
]), q =
|
|
394
|
+
]), q = N((u, _) => {
|
|
396
395
|
const j = [...S];
|
|
397
396
|
_ === null ? j.splice(u, 1) : j[u] = _, $(j);
|
|
398
|
-
}, [S]), Z =
|
|
397
|
+
}, [S]), Z = N(
|
|
399
398
|
Ke(() => {
|
|
400
|
-
const u = [...S], _ =
|
|
399
|
+
const u = [...S], _ = pn(d, S);
|
|
401
400
|
_ !== null && (u.push({ type: w.ASC, colIndex: _ }), $(u));
|
|
402
401
|
}, 200),
|
|
403
402
|
[S, d]
|
|
404
|
-
), h =
|
|
403
|
+
), h = N((u, _) => {
|
|
405
404
|
t.applySort({ range: d, orderRules: u, hasTitle: _ }), e.closeCustomSortPanel();
|
|
406
|
-
}, [t, e, d]), Y =
|
|
405
|
+
}, [t, e, d]), Y = N(() => {
|
|
407
406
|
e.closeCustomSortPanel();
|
|
408
|
-
}, [e]), Ze =
|
|
407
|
+
}, [e]), Ze = N((u) => {
|
|
409
408
|
o(u), u ? e.setSelection(C, f, { ...d, startRow: d.startRow + 1 }) : e.setSelection(C, f, d);
|
|
410
409
|
}, [e, d, f, C]);
|
|
411
410
|
Ee(() => {
|
|
412
411
|
l.current && S.length > 5 && (l.current.scrollTop = l.current.scrollHeight);
|
|
413
412
|
}, [S]);
|
|
414
|
-
const We = S.length <
|
|
413
|
+
const We = S.length < T.length, ae = S.map((u) => ({ ...u, id: `${u.colIndex}` }));
|
|
415
414
|
return /* @__PURE__ */ i.createElement("div", { className: a.customSortPanelContainer }, /* @__PURE__ */ i.createElement("div", { className: a.customSortPanelContent, onMouseDown: (u) => {
|
|
416
415
|
u.stopPropagation();
|
|
417
|
-
} }, /* @__PURE__ */ i.createElement("div", { className: a.customSortPanelExt }, /* @__PURE__ */ i.createElement("div", { className: a.firstRowCheck }, /* @__PURE__ */ i.createElement(
|
|
416
|
+
} }, /* @__PURE__ */ i.createElement("div", { className: a.customSortPanelExt }, /* @__PURE__ */ i.createElement("div", { className: a.firstRowCheck }, /* @__PURE__ */ i.createElement(pt, { checked: r, onChange: (u) => Ze(!!u) }, n.t("sheets-sort.dialog.first-row-check"))), We ? /* @__PURE__ */ i.createElement("div", { className: a.addCondition, onClick: Z }, /* @__PURE__ */ i.createElement(ee, null), /* @__PURE__ */ i.createElement("span", { className: a.addConditionText }, n.t("sheets-sort.dialog.add-condition"))) : /* @__PURE__ */ i.createElement("div", { className: `${a.addCondition} ${a.addConditionDisable}` }, /* @__PURE__ */ i.createElement(ee, null), /* @__PURE__ */ i.createElement("span", { className: a.addConditionText }, n.t("sheets-sort.dialog.add-condition")))), /* @__PURE__ */ i.createElement(
|
|
418
417
|
"div",
|
|
419
418
|
{
|
|
420
419
|
className: a.conditionList,
|
|
@@ -425,16 +424,16 @@ function fn() {
|
|
|
425
424
|
ref: l
|
|
426
425
|
},
|
|
427
426
|
/* @__PURE__ */ i.createElement(
|
|
428
|
-
|
|
427
|
+
vt,
|
|
429
428
|
{
|
|
430
429
|
list: ae,
|
|
431
430
|
onListChange: $,
|
|
432
431
|
idKey: "id",
|
|
433
432
|
draggableHandle: `.${a.customSortPanelItemHandler}`,
|
|
434
433
|
itemRender: (u) => /* @__PURE__ */ i.createElement(
|
|
435
|
-
|
|
434
|
+
fn,
|
|
436
435
|
{
|
|
437
|
-
titles:
|
|
436
|
+
titles: T,
|
|
438
437
|
list: ae,
|
|
439
438
|
item: u,
|
|
440
439
|
onChange: (_, j) => q(j, _),
|
|
@@ -447,11 +446,11 @@ function fn() {
|
|
|
447
446
|
)
|
|
448
447
|
)), /* @__PURE__ */ i.createElement("div", { className: a.customSortPanelFooter }, /* @__PURE__ */ i.createElement(ue, { className: a.customSortPanelFooterBtn, type: "default", onClick: () => Y() }, n.t("sheets-sort.dialog.cancel")), /* @__PURE__ */ i.createElement(ue, { className: a.customSortPanelFooterBtn, type: "primary", onClick: () => h(S, r) }, n.t("sheets-sort.dialog.confirm"))));
|
|
449
448
|
}
|
|
450
|
-
function
|
|
449
|
+
function fn(e) {
|
|
451
450
|
var Z;
|
|
452
|
-
const { list: t, item: n, titles: r, onChange: o, scrollPosition: s } = e, c =
|
|
451
|
+
const { list: t, item: n, titles: r, onChange: o, scrollPosition: s } = e, c = O(P), l = r.filter((h) => !t.some((Y) => Y.colIndex === h.index) || h.index === n.colIndex), m = t.findIndex((h) => h.colIndex === n.colIndex), d = N((h) => {
|
|
453
452
|
o({ ...n, colIndex: h.index }, m), f(!1);
|
|
454
|
-
}, [m, n, o]), [C, f] = F(!1),
|
|
453
|
+
}, [m, n, o]), [C, f] = F(!1), T = (h) => {
|
|
455
454
|
f(h);
|
|
456
455
|
};
|
|
457
456
|
Ee(() => {
|
|
@@ -459,12 +458,12 @@ function pn(e) {
|
|
|
459
458
|
}, [s]);
|
|
460
459
|
const S = t.length > 1, $ = (Z = r.find((h) => h.index === n.colIndex)) == null ? void 0 : Z.label, q = c.getCurrentLocale() === J.ZH_CN ? a.customSortPanelItemOrderRadioCn : a.customSortPanelItemOrderRadio;
|
|
461
460
|
return /* @__PURE__ */ i.createElement("div", { className: a.customSortPanelItem }, /* @__PURE__ */ i.createElement("div", { className: a.customSortPanelItemHead }, /* @__PURE__ */ i.createElement("div", { className: a.customSortPanelItemHandler }, /* @__PURE__ */ i.createElement(we, null)), /* @__PURE__ */ i.createElement("div", { className: a.customSortPanelItemColumn }, /* @__PURE__ */ i.createElement(
|
|
462
|
-
|
|
461
|
+
_t,
|
|
463
462
|
{
|
|
464
463
|
placement: "bottomLeft",
|
|
465
464
|
trigger: ["click"],
|
|
466
465
|
visible: C,
|
|
467
|
-
onVisibleChange:
|
|
466
|
+
onVisibleChange: T,
|
|
468
467
|
overlay: /* @__PURE__ */ i.createElement("ul", { className: a.customSortColMenu }, l.map((h) => /* @__PURE__ */ i.createElement(
|
|
469
468
|
"li",
|
|
470
469
|
{
|
|
@@ -488,18 +487,18 @@ function pn(e) {
|
|
|
488
487
|
},
|
|
489
488
|
/* @__PURE__ */ i.createElement(G, { value: w.ASC }, c.t("sheets-sort.general.sort-asc")),
|
|
490
489
|
/* @__PURE__ */ i.createElement(G, { value: w.DESC }, c.t("sheets-sort.general.sort-desc"))
|
|
491
|
-
)), /* @__PURE__ */ i.createElement("div", { className: a.customSortPanelItemRemove }, S && /* @__PURE__ */ i.createElement(
|
|
490
|
+
)), /* @__PURE__ */ i.createElement("div", { className: a.customSortPanelItemRemove }, S && /* @__PURE__ */ i.createElement(Oe, { onClick: () => o(null, m) })));
|
|
492
491
|
}
|
|
493
|
-
function
|
|
492
|
+
function pn(e, t) {
|
|
494
493
|
const { startColumn: n, endColumn: r } = e, o = new Set(t.map((s) => s == null ? void 0 : s.colIndex));
|
|
495
494
|
for (let s = n; s <= r; s++)
|
|
496
495
|
if (!o.has(s))
|
|
497
496
|
return s;
|
|
498
497
|
return null;
|
|
499
498
|
}
|
|
500
|
-
function
|
|
501
|
-
const { range: t, colIndex: n, onClose: r } = e, o =
|
|
502
|
-
const { unitId: d, subUnitId: C } =
|
|
499
|
+
function vn(e) {
|
|
500
|
+
const { range: t, colIndex: n, onClose: r } = e, o = O(g), s = O(fe), c = O(P), l = N((m) => {
|
|
501
|
+
const { unitId: d, subUnitId: C } = it(s) || {};
|
|
503
502
|
if (t && d && C) {
|
|
504
503
|
const f = { ...t, startRow: t.startRow + 1 };
|
|
505
504
|
o.triggerSortDirectly(m, !1, { unitId: d, subUnitId: C, range: f, colIndex: n });
|
|
@@ -510,7 +509,7 @@ function _n(e) {
|
|
|
510
509
|
return /* @__PURE__ */ i.createElement("div", { className: a.embedSortBtnContainer }, /* @__PURE__ */ i.createElement("div", { className: `${a.embedSortBtn} ${a.embedSortBtnAsc}`, onClick: () => l(!0) }, /* @__PURE__ */ i.createElement(ne, { className: a.embedSortBtnIcon }), c.t("sheets-sort.general.sort-asc")), /* @__PURE__ */ i.createElement("div", { className: `${a.embedSortBtn} ${a.embedSortBtnDesc}`, onClick: () => l(!1) }, /* @__PURE__ */ i.createElement(re, { className: a.embedSortBtnIcon }), c.t("sheets-sort.general.sort-desc")));
|
|
511
510
|
}
|
|
512
511
|
const A = "sheet.menu.sheets-sort", B = "sheet.menu.sheets-sort-ctx", z = "AscendingSingle", oe = "ExpandAscendingSingle", se = "DescendingSingle", ie = "ExpandDescendingSingle", ce = "CustomSortSingle";
|
|
513
|
-
function
|
|
512
|
+
function _n(e) {
|
|
514
513
|
return {
|
|
515
514
|
id: A,
|
|
516
515
|
type: v.SUBITEMS,
|
|
@@ -518,11 +517,11 @@ function En(e) {
|
|
|
518
517
|
group: ye.TOOLBAR_FORMULAS_INSERT,
|
|
519
518
|
icon: z,
|
|
520
519
|
tooltip: "sheets-sort.general.sort",
|
|
521
|
-
hidden$:
|
|
520
|
+
hidden$: dt(e, te.UNIVER_SHEET),
|
|
522
521
|
disabled$: U(e, { workbookTypes: [L], worksheetTypes: [D, H], rangeTypes: [k] })
|
|
523
522
|
};
|
|
524
523
|
}
|
|
525
|
-
function
|
|
524
|
+
function En(e) {
|
|
526
525
|
return {
|
|
527
526
|
id: Le.id,
|
|
528
527
|
icon: z,
|
|
@@ -531,7 +530,7 @@ function In(e) {
|
|
|
531
530
|
positions: [A]
|
|
532
531
|
};
|
|
533
532
|
}
|
|
534
|
-
function
|
|
533
|
+
function In(e) {
|
|
535
534
|
return {
|
|
536
535
|
id: De.id,
|
|
537
536
|
title: "sheets-sort.general.sort-asc-ext",
|
|
@@ -540,7 +539,7 @@ function yn(e) {
|
|
|
540
539
|
positions: [A]
|
|
541
540
|
};
|
|
542
541
|
}
|
|
543
|
-
function
|
|
542
|
+
function yn(e) {
|
|
544
543
|
return {
|
|
545
544
|
id: He.id,
|
|
546
545
|
title: "sheets-sort.general.sort-desc-cur",
|
|
@@ -549,7 +548,7 @@ function Mn(e) {
|
|
|
549
548
|
positions: [A]
|
|
550
549
|
};
|
|
551
550
|
}
|
|
552
|
-
function
|
|
551
|
+
function Mn(e) {
|
|
553
552
|
return {
|
|
554
553
|
id: ke.id,
|
|
555
554
|
title: "sheets-sort.general.sort-desc-ext",
|
|
@@ -558,7 +557,7 @@ function xn(e) {
|
|
|
558
557
|
positions: [A]
|
|
559
558
|
};
|
|
560
559
|
}
|
|
561
|
-
function
|
|
560
|
+
function xn(e) {
|
|
562
561
|
return {
|
|
563
562
|
id: Ue.id,
|
|
564
563
|
title: "sheets-sort.general.sort-custom",
|
|
@@ -567,7 +566,7 @@ function Rn(e) {
|
|
|
567
566
|
icon: ce
|
|
568
567
|
};
|
|
569
568
|
}
|
|
570
|
-
function
|
|
569
|
+
function Rn(e) {
|
|
571
570
|
return {
|
|
572
571
|
id: B,
|
|
573
572
|
title: "sheets-sort.general.sort",
|
|
@@ -591,7 +590,7 @@ function Tn(e) {
|
|
|
591
590
|
disabled$: U(e, { workbookTypes: [L], worksheetTypes: [D, H], rangeTypes: [k] })
|
|
592
591
|
};
|
|
593
592
|
}
|
|
594
|
-
function
|
|
593
|
+
function On(e) {
|
|
595
594
|
return {
|
|
596
595
|
id: Be.id,
|
|
597
596
|
title: "sheets-sort.general.sort-asc-ext",
|
|
@@ -611,7 +610,7 @@ function bn(e) {
|
|
|
611
610
|
disabled$: U(e, { workbookTypes: [L], worksheetTypes: [D, H], rangeTypes: [k] })
|
|
612
611
|
};
|
|
613
612
|
}
|
|
614
|
-
function
|
|
613
|
+
function Nn(e) {
|
|
615
614
|
return {
|
|
616
615
|
id: je.id,
|
|
617
616
|
title: "sheets-sort.general.sort-desc-ext",
|
|
@@ -621,7 +620,7 @@ function Pn(e) {
|
|
|
621
620
|
disabled$: U(e, { workbookTypes: [L], worksheetTypes: [D, H], rangeTypes: [k] })
|
|
622
621
|
};
|
|
623
622
|
}
|
|
624
|
-
function
|
|
623
|
+
function Pn(e) {
|
|
625
624
|
return {
|
|
626
625
|
id: Fe.id,
|
|
627
626
|
title: "sheets-sort.general.sort-custom",
|
|
@@ -631,14 +630,14 @@ function wn(e) {
|
|
|
631
630
|
disabled$: U(e, { workbookTypes: [L], worksheetTypes: [D, H], rangeTypes: [k] })
|
|
632
631
|
};
|
|
633
632
|
}
|
|
634
|
-
var
|
|
635
|
-
for (var o = r > 1 ? void 0 : r ?
|
|
633
|
+
var wn = Object.defineProperty, Ln = Object.getOwnPropertyDescriptor, Dn = (e, t, n, r) => {
|
|
634
|
+
for (var o = r > 1 ? void 0 : r ? Ln(t, n) : t, s = e.length - 1, c; s >= 0; s--)
|
|
636
635
|
(c = e[s]) && (o = (r ? c(t, n, o) : c(o)) || o);
|
|
637
|
-
return r && o &&
|
|
636
|
+
return r && o && wn(t, n, o), o;
|
|
638
637
|
}, M = (e, t) => (n, r) => t(n, r, e);
|
|
639
|
-
const
|
|
638
|
+
const Hn = {
|
|
640
639
|
menu: {}
|
|
641
|
-
}, me = "custom-sort-dialog",
|
|
640
|
+
}, me = "custom-sort-dialog", kn = 560;
|
|
642
641
|
let V = class extends Je {
|
|
643
642
|
constructor(e, t, n, r, o, s, c, l, m, d, C) {
|
|
644
643
|
super(), this._config = e, this._commandService = t, this._menuService = n, this._dialogService = r, this._layoutService = o, this._uiPartsService = s, this._sheetRenderService = c, this._localeService = l, this._sheetsSortUIService = m, this._injector = d, this._componentManager = C, this._initCommands(), this._initMenu(), this._initUI();
|
|
@@ -646,18 +645,18 @@ let V = class extends Je {
|
|
|
646
645
|
_initMenu() {
|
|
647
646
|
const { menu: e = {} } = this._config;
|
|
648
647
|
[
|
|
648
|
+
_n,
|
|
649
649
|
En,
|
|
650
|
+
yn,
|
|
650
651
|
In,
|
|
651
652
|
Mn,
|
|
652
|
-
yn,
|
|
653
653
|
xn,
|
|
654
654
|
Rn,
|
|
655
|
-
On,
|
|
656
655
|
Tn,
|
|
657
656
|
bn,
|
|
657
|
+
On,
|
|
658
658
|
Nn,
|
|
659
|
-
Pn
|
|
660
|
-
wn
|
|
659
|
+
Pn
|
|
661
660
|
].forEach((t) => {
|
|
662
661
|
this.disposeWithMe(
|
|
663
662
|
this._menuService.addMenuItem(
|
|
@@ -682,7 +681,7 @@ let V = class extends Je {
|
|
|
682
681
|
].forEach((e) => this.disposeWithMe(this._commandService.registerCommand(e))), this.disposeWithMe(this._sheetRenderService.registerSkeletonChangingMutations(tt.id));
|
|
683
682
|
}
|
|
684
683
|
_initUI() {
|
|
685
|
-
this.disposeWithMe(this._componentManager.register("CustomSortPanel",
|
|
684
|
+
this.disposeWithMe(this._componentManager.register("CustomSortPanel", Sn)), this.disposeWithMe(this._uiPartsService.registerComponent(ct.FILTER_PANEL_EMBED_POINT, () => Et(vn, this._injector))), this.disposeWithMe(this._componentManager.register(z, ne)), this.disposeWithMe(this._componentManager.register(oe, be)), this.disposeWithMe(this._componentManager.register(se, re)), this.disposeWithMe(this._componentManager.register(ie, Ne)), this.disposeWithMe(this._componentManager.register(ce, Te)), this._sheetsSortUIService.customSortState$.pipe(ft(this.dispose$)).subscribe((e) => {
|
|
686
685
|
e && e.show && e.location ? this._openCustomSortPanel(e.location) : e && !(e != null && e.show) && this._closePanel();
|
|
687
686
|
});
|
|
688
687
|
}
|
|
@@ -690,11 +689,11 @@ let V = class extends Je {
|
|
|
690
689
|
this._dialogService.open({
|
|
691
690
|
id: me,
|
|
692
691
|
draggable: !0,
|
|
693
|
-
width:
|
|
694
|
-
title: { title: `${this._localeService.t("sheets-sort.general.sort-custom")}: ${
|
|
692
|
+
width: kn,
|
|
693
|
+
title: { title: `${this._localeService.t("sheets-sort.general.sort-custom")}: ${It(e.range)}` },
|
|
695
694
|
children: { label: "CustomSortPanel" },
|
|
696
695
|
destroyOnClose: !0,
|
|
697
|
-
defaultPosition:
|
|
696
|
+
defaultPosition: Un(),
|
|
698
697
|
preservePositionOnDestroy: !1,
|
|
699
698
|
onClose: () => this._closePanel(),
|
|
700
699
|
mask: !0
|
|
@@ -704,31 +703,31 @@ let V = class extends Je {
|
|
|
704
703
|
this._dialogService.close(me), queueMicrotask(() => this._layoutService.focus());
|
|
705
704
|
}
|
|
706
705
|
};
|
|
707
|
-
V =
|
|
706
|
+
V = Dn([
|
|
708
707
|
ge(Ce.Ready, V),
|
|
709
708
|
M(1, pe),
|
|
710
|
-
M(2,
|
|
711
|
-
M(3,
|
|
712
|
-
M(4,
|
|
713
|
-
M(5,
|
|
714
|
-
M(6, x(
|
|
709
|
+
M(2, mt),
|
|
710
|
+
M(3, ht),
|
|
711
|
+
M(4, gt),
|
|
712
|
+
M(5, Ct),
|
|
713
|
+
M(6, x(at)),
|
|
715
714
|
M(7, x(P)),
|
|
716
715
|
M(8, x(g)),
|
|
717
716
|
M(9, x(ve)),
|
|
718
|
-
M(10, x(
|
|
717
|
+
M(10, x(ut))
|
|
719
718
|
], V);
|
|
720
|
-
function
|
|
719
|
+
function Un() {
|
|
721
720
|
return { x: 0, y: 0 };
|
|
722
721
|
}
|
|
723
|
-
var Ve = Object.defineProperty,
|
|
724
|
-
for (var o = r > 1 ? void 0 : r ?
|
|
722
|
+
var Ve = Object.defineProperty, An = Object.getOwnPropertyDescriptor, Bn = (e, t, n) => t in e ? Ve(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, $n = (e, t, n, r) => {
|
|
723
|
+
for (var o = r > 1 ? void 0 : r ? An(t, n) : t, s = e.length - 1, c; s >= 0; s--)
|
|
725
724
|
(c = e[s]) && (o = (r ? c(t, n, o) : c(o)) || o);
|
|
726
725
|
return r && o && Ve(t, n, o), o;
|
|
727
|
-
}, he = (e, t) => (n, r) => t(n, r, e), ze = (e, t, n) =>
|
|
728
|
-
const
|
|
726
|
+
}, he = (e, t) => (n, r) => t(n, r, e), ze = (e, t, n) => Bn(e, typeof t != "symbol" ? t + "" : t, n);
|
|
727
|
+
const jn = "UNIVER_SHEETS_SORT_UI_PLUGIN";
|
|
729
728
|
let X = class extends Qe {
|
|
730
729
|
constructor(e = {}, t, n) {
|
|
731
|
-
super(), this._config = e, this._injector = t, this._localeService = n, this._config = Se.deepMerge({},
|
|
730
|
+
super(), this._config = e, this._injector = t, this._localeService = n, this._config = Se.deepMerge({}, Hn, this._config);
|
|
732
731
|
}
|
|
733
732
|
onStarting(e) {
|
|
734
733
|
[
|
|
@@ -740,8 +739,8 @@ let X = class extends Qe {
|
|
|
740
739
|
}
|
|
741
740
|
};
|
|
742
741
|
ze(X, "type", te.UNIVER_SHEET);
|
|
743
|
-
ze(X, "pluginName",
|
|
744
|
-
X =
|
|
742
|
+
ze(X, "pluginName", jn);
|
|
743
|
+
X = $n([
|
|
745
744
|
et(nt),
|
|
746
745
|
he(1, x(ve)),
|
|
747
746
|
he(2, x(P))
|