@univerjs/sheets-sort 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/facade.js +98 -0
- package/lib/index.js +246 -0
- package/lib/locale/en-US.js +18 -0
- package/lib/locale/fa-IR.js +18 -0
- package/lib/locale/fr-FR.js +18 -0
- package/lib/locale/ru-RU.js +18 -0
- package/lib/locale/vi-VN.js +18 -0
- package/lib/locale/zh-CN.js +18 -0
- package/lib/locale/zh-TW.js +18 -0
- package/package.json +5 -5
package/lib/facade.js
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { SortType as s, SortRangeCommand as h } from "@univerjs/sheets-sort";
|
|
2
|
+
import { FRange as u, FWorksheet as l, FSheetEventName as f } from "@univerjs/sheets/facade";
|
|
3
|
+
import { RANGE_TYPE as k, ICommandService as v } from "@univerjs/core";
|
|
4
|
+
import { FEventName as R, FUniver as C } from "@univerjs/core/facade";
|
|
5
|
+
class E extends u {
|
|
6
|
+
sort(o) {
|
|
7
|
+
const e = this._range.startColumn, r = (Array.isArray(o) ? o : [o]).map((n) => typeof n == "number" ? { colIndex: n + e, type: s.ASC } : {
|
|
8
|
+
colIndex: n.column + e,
|
|
9
|
+
type: n.ascending ? s.ASC : s.DESC
|
|
10
|
+
});
|
|
11
|
+
return this._commandService.syncExecuteCommand(h.id, {
|
|
12
|
+
orderRules: r,
|
|
13
|
+
range: this._range,
|
|
14
|
+
hasTitle: !1,
|
|
15
|
+
unitId: this._workbook.getUnitId(),
|
|
16
|
+
subUnitId: this._worksheet.getSheetId()
|
|
17
|
+
}), this;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
u.extend(E);
|
|
21
|
+
class w extends l {
|
|
22
|
+
sort(o, e = !0) {
|
|
23
|
+
const t = [{
|
|
24
|
+
colIndex: o,
|
|
25
|
+
type: e ? s.ASC : s.DESC
|
|
26
|
+
}], r = {
|
|
27
|
+
startRow: 0,
|
|
28
|
+
startColumn: 0,
|
|
29
|
+
endRow: this._worksheet.getRowCount() - 1,
|
|
30
|
+
endColumn: this._worksheet.getColumnCount() - 1,
|
|
31
|
+
rangeType: k.ALL
|
|
32
|
+
};
|
|
33
|
+
return this._commandService.syncExecuteCommand(h.id, {
|
|
34
|
+
orderRules: t,
|
|
35
|
+
range: r,
|
|
36
|
+
hasTitle: !1,
|
|
37
|
+
unitId: this._workbook.getUnitId(),
|
|
38
|
+
subUnitId: this._worksheet.getSheetId()
|
|
39
|
+
}), this;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
l.extend(w);
|
|
43
|
+
class p {
|
|
44
|
+
get SheetRangeSorted() {
|
|
45
|
+
return "SheetRangeSorted";
|
|
46
|
+
}
|
|
47
|
+
get SheetBeforeRangeSort() {
|
|
48
|
+
return "SheetBeforeRangeSort";
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
R.extend(f);
|
|
52
|
+
class x extends C {
|
|
53
|
+
/**
|
|
54
|
+
* @ignore
|
|
55
|
+
*/
|
|
56
|
+
_initialize(o) {
|
|
57
|
+
const e = o.get(v);
|
|
58
|
+
this.registerEventHandler(
|
|
59
|
+
this.Event.SheetBeforeRangeSort,
|
|
60
|
+
() => e.beforeCommandExecuted((t) => {
|
|
61
|
+
t.id === h.id && this._beforeRangeSort(t);
|
|
62
|
+
})
|
|
63
|
+
), this.registerEventHandler(
|
|
64
|
+
this.Event.SheetRangeSorted,
|
|
65
|
+
() => e.onCommandExecuted((t) => {
|
|
66
|
+
t.id === h.id && this._onRangeSorted(t);
|
|
67
|
+
})
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
_beforeRangeSort(o) {
|
|
71
|
+
const e = o.params, t = this.getUniverSheet(e.unitId), r = t.getSheetBySheetId(e.subUnitId), { startColumn: n, endColumn: g, startRow: a, endRow: S } = e.range, c = r.getRange(a, n, S - a + 1, g - n + 1), i = {
|
|
72
|
+
workbook: t,
|
|
73
|
+
worksheet: r,
|
|
74
|
+
range: c,
|
|
75
|
+
sortColumn: e.orderRules.map((d) => ({
|
|
76
|
+
column: d.colIndex - n,
|
|
77
|
+
ascending: d.type === s.ASC
|
|
78
|
+
}))
|
|
79
|
+
};
|
|
80
|
+
if (this.fireEvent(this.Event.SheetBeforeRangeSort, i), i.cancel)
|
|
81
|
+
throw new Error("SortRangeCommand canceled.");
|
|
82
|
+
}
|
|
83
|
+
_onRangeSorted(o) {
|
|
84
|
+
const e = o.params, t = this.getUniverSheet(e.unitId), r = t.getSheetBySheetId(e.subUnitId), { startColumn: n, endColumn: g, startRow: a, endRow: S } = e.range, c = r.getRange(a, n, S - a + 1, g - n + 1), i = {
|
|
85
|
+
workbook: t,
|
|
86
|
+
worksheet: r,
|
|
87
|
+
range: c,
|
|
88
|
+
sortColumn: e.orderRules.map((d) => ({
|
|
89
|
+
column: d.colIndex - n,
|
|
90
|
+
ascending: d.type === s.ASC
|
|
91
|
+
}))
|
|
92
|
+
};
|
|
93
|
+
if (this.fireEvent(this.Event.SheetRangeSorted, i), i.cancel)
|
|
94
|
+
throw new Error("SortRangeCommand canceled.");
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
C.extend(x);
|
|
98
|
+
R.extend(p);
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
var k = Object.defineProperty;
|
|
2
|
+
var H = (e, t, r) => t in e ? k(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
|
+
var h = (e, t, r) => H(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
|
+
import { IUniverInstanceService as U, ICommandService as w, Inject as I, Disposable as T, Rectangle as R, CommandType as q, sequenceExecute as K, CellValueType as C, Plugin as W, merge as Y, UniverInstanceType as z, Injector as J, IConfigService as Q } from "@univerjs/core";
|
|
5
|
+
import { getSheetCommandTarget as M, ReorderRangeCommand as X } from "@univerjs/sheets";
|
|
6
|
+
import { FormulaDataModel as Z } from "@univerjs/engine-formula";
|
|
7
|
+
const ee = "sheets-sort.config", N = {};
|
|
8
|
+
var m = /* @__PURE__ */ ((e) => (e.DESC = "desc", e.ASC = "asc", e))(m || {});
|
|
9
|
+
const D = (e) => e.replace(/-/gi, "").replace(/'/gi, ""), te = (e, t) => {
|
|
10
|
+
const r = e === null || e === "", n = t === null || t === "";
|
|
11
|
+
return r && n ? 0 : r ? 1 : n ? -1 : null;
|
|
12
|
+
}, re = (e, t, r) => {
|
|
13
|
+
const n = typeof e == "number", o = typeof t == "number";
|
|
14
|
+
return n && o ? e < t ? r === m.ASC ? -1 : 1 : e > t ? r === m.ASC ? 1 : -1 : 0 : n ? r === m.ASC ? 1 : -1 : o ? r === m.ASC ? -1 : 1 : null;
|
|
15
|
+
}, ne = (e, t, r) => {
|
|
16
|
+
const n = typeof e == "string", o = typeof t == "string";
|
|
17
|
+
if (n && (e = D(e.toLocaleLowerCase())), o && (t = D(t.toLocaleLowerCase())), !n && !o)
|
|
18
|
+
return null;
|
|
19
|
+
if (n && o) {
|
|
20
|
+
const s = e, i = t;
|
|
21
|
+
return s < i ? r === m.ASC ? -1 : 1 : s > i ? r === m.ASC ? 1 : -1 : 0;
|
|
22
|
+
}
|
|
23
|
+
return n ? r === m.ASC ? 1 : -1 : o ? r === m.ASC ? -1 : 1 : null;
|
|
24
|
+
}, P = (e) => !e || Object.keys(e).length === 0 || (e == null ? void 0 : e.v) == null && (e == null ? void 0 : e.p) == null;
|
|
25
|
+
var oe = Object.getOwnPropertyDescriptor, se = (e, t, r, n) => {
|
|
26
|
+
for (var o = n > 1 ? void 0 : n ? oe(t, r) : t, s = e.length - 1, i; s >= 0; s--)
|
|
27
|
+
(i = e[s]) && (o = i(o) || o);
|
|
28
|
+
return o;
|
|
29
|
+
}, p = (e, t) => (r, n) => t(r, n, e);
|
|
30
|
+
let g = class extends T {
|
|
31
|
+
constructor(t, r, n) {
|
|
32
|
+
super();
|
|
33
|
+
h(this, "_compareFns", []);
|
|
34
|
+
this._univerInstanceService = t, this._commandService = r, this._formulaDataModel = n;
|
|
35
|
+
}
|
|
36
|
+
mergeCheck(t) {
|
|
37
|
+
var c;
|
|
38
|
+
const { unitId: r, subUnitId: n, range: o } = t, s = (c = this._univerInstanceService.getUnit(r)) == null ? void 0 : c.getSheetBySheetId(n);
|
|
39
|
+
if (!s)
|
|
40
|
+
return !1;
|
|
41
|
+
const i = s.getMergeData().filter((u) => R.contains(o, u));
|
|
42
|
+
return i.length === 0 ? !0 : ie(o, i);
|
|
43
|
+
}
|
|
44
|
+
emptyCheck(t) {
|
|
45
|
+
var i;
|
|
46
|
+
const { unitId: r, subUnitId: n, range: o } = t, s = (i = this._univerInstanceService.getUnit(r)) == null ? void 0 : i.getSheetBySheetId(n);
|
|
47
|
+
if (!s)
|
|
48
|
+
return !1;
|
|
49
|
+
for (let c = o.startRow; c <= o.endRow; c++)
|
|
50
|
+
for (let u = o.startColumn; u <= o.endColumn; u++)
|
|
51
|
+
if (!P(s.getCellRaw(c, u)))
|
|
52
|
+
return !0;
|
|
53
|
+
return !1;
|
|
54
|
+
}
|
|
55
|
+
singleCheck(t) {
|
|
56
|
+
return t.range.startRow !== t.range.endRow;
|
|
57
|
+
}
|
|
58
|
+
formulaCheck(t) {
|
|
59
|
+
var i, c;
|
|
60
|
+
const { unitId: r, subUnitId: n, range: o } = t, s = (c = (i = this._formulaDataModel.getArrayFormulaRange()) == null ? void 0 : i[r]) == null ? void 0 : c[n];
|
|
61
|
+
for (const u in s) {
|
|
62
|
+
const a = s[Number(u)];
|
|
63
|
+
for (const f in a) {
|
|
64
|
+
const d = a[Number(f)];
|
|
65
|
+
if (d && R.intersects(o, d))
|
|
66
|
+
return !1;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return !0;
|
|
70
|
+
}
|
|
71
|
+
registerCompareFn(t) {
|
|
72
|
+
this._compareFns.unshift(t);
|
|
73
|
+
}
|
|
74
|
+
getAllCompareFns() {
|
|
75
|
+
return this._compareFns;
|
|
76
|
+
}
|
|
77
|
+
applySort(t, r, n) {
|
|
78
|
+
var i;
|
|
79
|
+
const { unitId: o, subUnitId: s } = M(this._univerInstanceService) || {};
|
|
80
|
+
this._commandService.executeCommand(x.id, {
|
|
81
|
+
orderRules: t.orderRules,
|
|
82
|
+
range: t.range,
|
|
83
|
+
hasTitle: (i = t.hasTitle) != null ? i : !1,
|
|
84
|
+
unitId: r || o,
|
|
85
|
+
subUnitId: n || s
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
g = se([
|
|
90
|
+
p(0, U),
|
|
91
|
+
p(1, w),
|
|
92
|
+
p(2, I(Z))
|
|
93
|
+
], g);
|
|
94
|
+
function ie(e, t) {
|
|
95
|
+
const r = e.endRow - e.startRow + 1, n = e.endColumn - e.startColumn + 1;
|
|
96
|
+
let o = null, s = null;
|
|
97
|
+
const i = r * n;
|
|
98
|
+
let c = 0;
|
|
99
|
+
for (const u of t)
|
|
100
|
+
if (u.startRow >= e.startRow && u.endRow <= e.endRow && u.startColumn >= e.startColumn && u.endColumn <= e.endColumn) {
|
|
101
|
+
const a = u.endRow - u.startRow + 1, f = u.endColumn - u.startColumn + 1;
|
|
102
|
+
if (o === null && s === null)
|
|
103
|
+
o = a, s = f;
|
|
104
|
+
else if (a !== o || f !== s)
|
|
105
|
+
return !1;
|
|
106
|
+
c += a * f;
|
|
107
|
+
}
|
|
108
|
+
return c === i;
|
|
109
|
+
}
|
|
110
|
+
const x = {
|
|
111
|
+
id: "sheet.command.sort-range",
|
|
112
|
+
type: q.COMMAND,
|
|
113
|
+
handler: (e, t) => {
|
|
114
|
+
const { range: r, orderRules: n, hasTitle: o, unitId: s, subUnitId: i } = t, c = e.get(g), u = e.get(U), { worksheet: a } = M(u, t) || {};
|
|
115
|
+
if (!a)
|
|
116
|
+
return !1;
|
|
117
|
+
const f = a.getMergeData().filter((l) => R.contains(r, l)), d = f.map((l) => l.startRow), { startRow: A, endRow: $ } = r, j = o ? A + 1 : A, _ = [], b = [];
|
|
118
|
+
for (let l = j; l <= $; l++)
|
|
119
|
+
a.getRowFiltered(l) || a.getRowRawVisible(l) !== !1 && (f.length && !d.includes(l) || (_.push({
|
|
120
|
+
index: l,
|
|
121
|
+
value: ue(a, l, n)
|
|
122
|
+
}), b.push(l)));
|
|
123
|
+
const V = c.getAllCompareFns();
|
|
124
|
+
_.sort(le(n, ce(V)));
|
|
125
|
+
const F = {};
|
|
126
|
+
_.forEach(({ index: l, value: Ce }, B) => {
|
|
127
|
+
F[b[B]] = l;
|
|
128
|
+
});
|
|
129
|
+
const L = {
|
|
130
|
+
id: X.id,
|
|
131
|
+
params: {
|
|
132
|
+
unitId: s,
|
|
133
|
+
subUnitId: i,
|
|
134
|
+
range: r,
|
|
135
|
+
order: F
|
|
136
|
+
}
|
|
137
|
+
}, G = e.get(w);
|
|
138
|
+
return K([L], G).result;
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
function ue(e, t, r) {
|
|
142
|
+
const n = [];
|
|
143
|
+
return r.forEach(({ colIndex: o }) => {
|
|
144
|
+
n.push(e.getCellRaw(t, o));
|
|
145
|
+
}), n;
|
|
146
|
+
}
|
|
147
|
+
function ce(e) {
|
|
148
|
+
return (t, r, n) => {
|
|
149
|
+
for (let o = 0; o < e.length; o++) {
|
|
150
|
+
const s = e[o](t, r, n);
|
|
151
|
+
if (s != null)
|
|
152
|
+
return s;
|
|
153
|
+
}
|
|
154
|
+
return 0;
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
function le(e, t) {
|
|
158
|
+
return function(r, n) {
|
|
159
|
+
let o = null;
|
|
160
|
+
for (let s = 0; s < e.length; s++) {
|
|
161
|
+
const i = r.value[s], c = n.value[s];
|
|
162
|
+
if (o = t(e[s].type, i, c), o !== 0 && o !== null && o !== void 0)
|
|
163
|
+
return o;
|
|
164
|
+
}
|
|
165
|
+
return 0;
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
var ae = Object.getOwnPropertyDescriptor, me = (e, t, r, n) => {
|
|
169
|
+
for (var o = n > 1 ? void 0 : n ? ae(t, r) : t, s = e.length - 1, i; s >= 0; s--)
|
|
170
|
+
(i = e[s]) && (o = i(o) || o);
|
|
171
|
+
return o;
|
|
172
|
+
}, y = (e, t) => (r, n) => t(r, n, e);
|
|
173
|
+
let S = class extends T {
|
|
174
|
+
constructor(e, t) {
|
|
175
|
+
super(), this._commandService = e, this._sortService = t, this._initCommands(), this._registerCompareFns();
|
|
176
|
+
}
|
|
177
|
+
_initCommands() {
|
|
178
|
+
[
|
|
179
|
+
x
|
|
180
|
+
].forEach((e) => this.disposeWithMe(this._commandService.registerCommand(e)));
|
|
181
|
+
}
|
|
182
|
+
_registerCompareFns() {
|
|
183
|
+
const e = (t, r, n) => {
|
|
184
|
+
const o = this._getCommonValue(r), s = this._getCommonValue(n), i = [
|
|
185
|
+
te,
|
|
186
|
+
ne,
|
|
187
|
+
re
|
|
188
|
+
];
|
|
189
|
+
for (let c = 0; c < i.length; c++) {
|
|
190
|
+
const u = i[c](o, s, t);
|
|
191
|
+
if (u !== null)
|
|
192
|
+
return u;
|
|
193
|
+
}
|
|
194
|
+
return null;
|
|
195
|
+
};
|
|
196
|
+
this._sortService.registerCompareFn(e);
|
|
197
|
+
}
|
|
198
|
+
_getCommonValue(e) {
|
|
199
|
+
var r, n;
|
|
200
|
+
if (P(e))
|
|
201
|
+
return null;
|
|
202
|
+
const t = (n = (r = e == null ? void 0 : e.p) == null ? void 0 : r.body) == null ? void 0 : n.dataStream;
|
|
203
|
+
return t || ((e == null ? void 0 : e.t) === C.NUMBER ? Number.parseFloat(`${e.v}`) : (e == null ? void 0 : e.t) === C.STRING ? typeof e.v == "number" ? e.v : `${e.v}` : (e == null ? void 0 : e.t) === C.BOOLEAN ? `${e.v}` : (e == null ? void 0 : e.t) === C.FORCE_STRING ? Number.parseFloat(`${e.v}`) : `${e == null ? void 0 : e.v}`);
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
S = me([
|
|
207
|
+
y(0, w),
|
|
208
|
+
y(1, I(g))
|
|
209
|
+
], S);
|
|
210
|
+
var fe = Object.getOwnPropertyDescriptor, ge = (e, t, r, n) => {
|
|
211
|
+
for (var o = n > 1 ? void 0 : n ? fe(t, r) : t, s = e.length - 1, i; s >= 0; s--)
|
|
212
|
+
(i = e[s]) && (o = i(o) || o);
|
|
213
|
+
return o;
|
|
214
|
+
}, E = (e, t) => (r, n) => t(r, n, e);
|
|
215
|
+
const de = "SHEET_SORT_PLUGIN";
|
|
216
|
+
var v;
|
|
217
|
+
let O = (v = class extends W {
|
|
218
|
+
constructor(e = N, t, r) {
|
|
219
|
+
super(), this._config = e, this._injector = t, this._configService = r;
|
|
220
|
+
const { ...n } = Y(
|
|
221
|
+
{},
|
|
222
|
+
N,
|
|
223
|
+
this._config
|
|
224
|
+
);
|
|
225
|
+
this._configService.setConfig(ee, n);
|
|
226
|
+
}
|
|
227
|
+
onStarting() {
|
|
228
|
+
[
|
|
229
|
+
[S],
|
|
230
|
+
[g]
|
|
231
|
+
].forEach((e) => this._injector.add(e));
|
|
232
|
+
}
|
|
233
|
+
onReady() {
|
|
234
|
+
this._injector.get(S);
|
|
235
|
+
}
|
|
236
|
+
}, h(v, "type", z.UNIVER_SHEET), h(v, "pluginName", de), v);
|
|
237
|
+
O = ge([
|
|
238
|
+
E(1, I(J)),
|
|
239
|
+
E(2, Q)
|
|
240
|
+
], O);
|
|
241
|
+
export {
|
|
242
|
+
g as SheetsSortService,
|
|
243
|
+
x as SortRangeCommand,
|
|
244
|
+
m as SortType,
|
|
245
|
+
O as UniverSheetsSortPlugin
|
|
246
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const o = {
|
|
2
|
+
sheetsSort: {
|
|
3
|
+
title: "Sort",
|
|
4
|
+
toolbar: {
|
|
5
|
+
"sort-asc": "ascending order",
|
|
6
|
+
"sort-desc": "descending order",
|
|
7
|
+
"sort-custom": "custom order"
|
|
8
|
+
},
|
|
9
|
+
"context-menu": {
|
|
10
|
+
"sort-asc": "ascending order",
|
|
11
|
+
"sort-desc": "descending order",
|
|
12
|
+
"sort-custom": "custom order"
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
o as default
|
|
18
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const t = {
|
|
2
|
+
sheetsSort: {
|
|
3
|
+
title: "مرتبسازی",
|
|
4
|
+
toolbar: {
|
|
5
|
+
"sort-asc": "ترتیب صعودی",
|
|
6
|
+
"sort-desc": "ترتیب نزولی",
|
|
7
|
+
"sort-custom": "ترتیب سفارشی"
|
|
8
|
+
},
|
|
9
|
+
"context-menu": {
|
|
10
|
+
"sort-asc": "ترتیب صعودی",
|
|
11
|
+
"sort-desc": "ترتیب نزولی",
|
|
12
|
+
"sort-custom": "ترتیب سفارشی"
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
t as default
|
|
18
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const r = {
|
|
2
|
+
sheetsSort: {
|
|
3
|
+
title: "Trier",
|
|
4
|
+
toolbar: {
|
|
5
|
+
"sort-asc": "ordre croissant",
|
|
6
|
+
"sort-desc": "ordre décroissant",
|
|
7
|
+
"sort-custom": "ordre personnalisé"
|
|
8
|
+
},
|
|
9
|
+
"context-menu": {
|
|
10
|
+
"sort-asc": "ordre croissant",
|
|
11
|
+
"sort-desc": "ordre décroissant",
|
|
12
|
+
"sort-custom": "ordre personnalisé"
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
r as default
|
|
18
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const o = {
|
|
2
|
+
sheetsSort: {
|
|
3
|
+
title: "Sort",
|
|
4
|
+
toolbar: {
|
|
5
|
+
"sort-asc": "ascending order",
|
|
6
|
+
"sort-desc": "descending order",
|
|
7
|
+
"sort-custom": "custom order"
|
|
8
|
+
},
|
|
9
|
+
"context-menu": {
|
|
10
|
+
"sort-asc": "ascending order",
|
|
11
|
+
"sort-desc": "descending order",
|
|
12
|
+
"sort-custom": "custom order"
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
o as default
|
|
18
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const o = {
|
|
2
|
+
sheetsSort: {
|
|
3
|
+
title: "Sort",
|
|
4
|
+
toolbar: {
|
|
5
|
+
"sort-asc": "ascending order",
|
|
6
|
+
"sort-desc": "descending order",
|
|
7
|
+
"sort-custom": "custom order"
|
|
8
|
+
},
|
|
9
|
+
"context-menu": {
|
|
10
|
+
"sort-asc": "ascending order",
|
|
11
|
+
"sort-desc": "descending order",
|
|
12
|
+
"sort-custom": "custom order"
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
o as default
|
|
18
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const t = {
|
|
2
|
+
sheetsSort: {
|
|
3
|
+
title: "排序",
|
|
4
|
+
toolbar: {
|
|
5
|
+
"sort-asc": "升序",
|
|
6
|
+
"sort-desc": "降序",
|
|
7
|
+
"sort-custom": "自定义排序"
|
|
8
|
+
},
|
|
9
|
+
"context-menu": {
|
|
10
|
+
"sort-asc": "升序",
|
|
11
|
+
"sort-desc": "降序",
|
|
12
|
+
"sort-custom": "自定义排序"
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
t as default
|
|
18
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const t = {
|
|
2
|
+
sheetsSort: {
|
|
3
|
+
title: "Sắp xếp",
|
|
4
|
+
toolbar: {
|
|
5
|
+
"sort-asc": "Tăng dần",
|
|
6
|
+
"sort-desc": "Giảm dần",
|
|
7
|
+
"sort-custom": "Sắp xếp tùy chỉnh"
|
|
8
|
+
},
|
|
9
|
+
"context-menu": {
|
|
10
|
+
"sort-asc": "Tăng dần",
|
|
11
|
+
"sort-desc": "Giảm dần",
|
|
12
|
+
"sort-custom": "Sắp xếp tùy chỉnh"
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
t as default
|
|
18
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@univerjs/sheets-sort",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.9",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A library for sorting data in Univer Sheet",
|
|
6
6
|
"author": "DreamNum <developer@univer.ai>",
|
|
@@ -53,15 +53,15 @@
|
|
|
53
53
|
"lib"
|
|
54
54
|
],
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@univerjs/core": "0.6.
|
|
57
|
-
"@univerjs/engine-formula": "0.6.
|
|
58
|
-
"@univerjs/sheets": "0.6.
|
|
56
|
+
"@univerjs/core": "0.6.9",
|
|
57
|
+
"@univerjs/engine-formula": "0.6.9",
|
|
58
|
+
"@univerjs/sheets": "0.6.9"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"typescript": "^5.8.2",
|
|
62
62
|
"vite": "^6.2.3",
|
|
63
63
|
"vitest": "^3.0.9",
|
|
64
|
-
"@univerjs-infra/shared": "0.6.
|
|
64
|
+
"@univerjs-infra/shared": "0.6.9"
|
|
65
65
|
},
|
|
66
66
|
"scripts": {
|
|
67
67
|
"test": "vitest run",
|