@univerjs/sheets-sort 0.21.1 → 0.22.0-insiders.20260513-09bbeca
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 +32 -18
- package/lib/cjs/index.js +20 -26
- package/lib/es/index.js +20 -26
- package/lib/index.js +20 -26
- package/lib/umd/index.js +1 -1
- package/package.json +16 -10
- package/LICENSE +0 -176
package/README.md
CHANGED
|
@@ -1,31 +1,45 @@
|
|
|
1
1
|
# @univerjs/sheets-sort
|
|
2
2
|
|
|
3
|
+
[](https://npmjs.com/package/@univerjs/sheets-sort)
|
|
4
|
+
[](https://npmjs.com/package/@univerjs/sheets-sort)
|
|
5
|
+
[](https://npmjs.com/package/@univerjs/sheets-sort)
|
|
6
|
+
|
|
7
|
+
`@univerjs/sheets-sort` adds the core sorting model, commands, and services for Univer Sheets.
|
|
8
|
+
|
|
3
9
|
## Package Overview
|
|
4
10
|
|
|
5
|
-
| Package
|
|
6
|
-
| --- | --- |
|
|
7
|
-
| `@univerjs/sheets-sort` | `UniverSheetsSort` |
|
|
11
|
+
| Package | UMD global | CSS | Locales | Facade entry |
|
|
12
|
+
| --- | --- | :---: | :---: | :---: |
|
|
13
|
+
| `@univerjs/sheets-sort` | `UniverSheetsSort` | No | Yes | Yes |
|
|
8
14
|
|
|
9
|
-
##
|
|
15
|
+
## Installation
|
|
10
16
|
|
|
11
|
-
|
|
17
|
+
```sh
|
|
18
|
+
pnpm add @univerjs/sheets-sort
|
|
19
|
+
# or
|
|
20
|
+
npm install @univerjs/sheets-sort
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Keep all `@univerjs/*` packages on the same version.
|
|
12
24
|
|
|
13
25
|
## Usage
|
|
14
26
|
|
|
15
|
-
|
|
27
|
+
```ts
|
|
28
|
+
import EnUS from '@univerjs/sheets-sort/locale/en-US';
|
|
29
|
+
import { UniverSheetsSortPlugin } from '@univerjs/sheets-sort';
|
|
16
30
|
|
|
17
|
-
|
|
31
|
+
univer.registerPlugin(UniverSheetsSortPlugin);
|
|
18
32
|
|
|
19
|
-
|
|
20
|
-
# Using npm
|
|
21
|
-
npm install @univerjs/sheets-sort
|
|
22
|
-
|
|
23
|
-
# Using pnpm
|
|
24
|
-
pnpm add @univerjs/sheets-sort
|
|
33
|
+
// Merge EnUS into your Univer locale map when this package contributes UI text.
|
|
25
34
|
```
|
|
26
35
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
36
|
+
## Integration Notes
|
|
37
|
+
|
|
38
|
+
Use this package with `@univerjs/sheets-sort-ui` when users need sorting menus and panels.
|
|
39
|
+
|
|
40
|
+
## Resources
|
|
41
|
+
|
|
42
|
+
- [Documentation](https://docs.univer.ai)
|
|
43
|
+
- [NPM package](https://npmjs.com/package/@univerjs/sheets-sort)
|
|
44
|
+
- [GitHub repository](https://github.com/dream-num/univer)
|
|
45
|
+
|
package/lib/cjs/index.js
CHANGED
|
@@ -12,33 +12,27 @@ let SortType = /* @__PURE__ */ function(SortType) {
|
|
|
12
12
|
|
|
13
13
|
//#endregion
|
|
14
14
|
//#region src/controllers/utils.ts
|
|
15
|
-
let ORDER = /* @__PURE__ */ function(ORDER) {
|
|
16
|
-
ORDER[ORDER["POSITIVE"] = 1] = "POSITIVE";
|
|
17
|
-
ORDER[ORDER["NEGATIVE"] = -1] = "NEGATIVE";
|
|
18
|
-
ORDER[ORDER["ZERO"] = 0] = "ZERO";
|
|
19
|
-
return ORDER;
|
|
20
|
-
}({});
|
|
21
15
|
const removeStringSymbol = (str) => {
|
|
22
16
|
return str.replace(/-/gi, "").replace(/'/gi, "");
|
|
23
17
|
};
|
|
24
18
|
const compareNull = (a1, a2) => {
|
|
25
19
|
const isA1Null = a1 === null || a1 === "";
|
|
26
20
|
const isA2Null = a2 === null || a2 === "";
|
|
27
|
-
if (isA1Null && isA2Null) return
|
|
28
|
-
if (isA1Null) return
|
|
29
|
-
if (isA2Null) return
|
|
21
|
+
if (isA1Null && isA2Null) return 0;
|
|
22
|
+
if (isA1Null) return 1;
|
|
23
|
+
if (isA2Null) return -1;
|
|
30
24
|
return null;
|
|
31
25
|
};
|
|
32
26
|
const compareNumber = (a1, a2, type) => {
|
|
33
27
|
const isA1Num = typeof a1 === "number";
|
|
34
28
|
const isA2Num = typeof a2 === "number";
|
|
35
29
|
if (isA1Num && isA2Num) {
|
|
36
|
-
if (a1 < a2) return type ===
|
|
37
|
-
if (a1 > a2) return type ===
|
|
38
|
-
return
|
|
30
|
+
if (a1 < a2) return type === "asc" ? -1 : 1;
|
|
31
|
+
if (a1 > a2) return type === "asc" ? 1 : -1;
|
|
32
|
+
return 0;
|
|
39
33
|
}
|
|
40
|
-
if (isA1Num) return type ===
|
|
41
|
-
if (isA2Num) return type ===
|
|
34
|
+
if (isA1Num) return type === "asc" ? 1 : -1;
|
|
35
|
+
if (isA2Num) return type === "asc" ? -1 : 1;
|
|
42
36
|
return null;
|
|
43
37
|
};
|
|
44
38
|
const compareString = (a1, a2, type) => {
|
|
@@ -50,12 +44,12 @@ const compareString = (a1, a2, type) => {
|
|
|
50
44
|
if (isA1Str && isA2Str) {
|
|
51
45
|
const a1AsString = a1;
|
|
52
46
|
const a2AsString = a2;
|
|
53
|
-
if (a1AsString < a2AsString) return type ===
|
|
54
|
-
if (a1AsString > a2AsString) return type ===
|
|
55
|
-
return
|
|
47
|
+
if (a1AsString < a2AsString) return type === "asc" ? -1 : 1;
|
|
48
|
+
if (a1AsString > a2AsString) return type === "asc" ? 1 : -1;
|
|
49
|
+
return 0;
|
|
56
50
|
}
|
|
57
|
-
if (isA1Str) return type ===
|
|
58
|
-
if (isA2Str) return type ===
|
|
51
|
+
if (isA1Str) return type === "asc" ? 1 : -1;
|
|
52
|
+
if (isA2Str) return type === "asc" ? -1 : 1;
|
|
59
53
|
return null;
|
|
60
54
|
};
|
|
61
55
|
const isNullValue = (cell) => {
|
|
@@ -66,7 +60,7 @@ const isNullValue = (cell) => {
|
|
|
66
60
|
};
|
|
67
61
|
|
|
68
62
|
//#endregion
|
|
69
|
-
//#region \0@oxc-project+runtime@0.
|
|
63
|
+
//#region \0@oxc-project+runtime@0.129.0/helpers/typeof.js
|
|
70
64
|
function _typeof(o) {
|
|
71
65
|
"@babel/helpers - typeof";
|
|
72
66
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -77,7 +71,7 @@ function _typeof(o) {
|
|
|
77
71
|
}
|
|
78
72
|
|
|
79
73
|
//#endregion
|
|
80
|
-
//#region \0@oxc-project+runtime@0.
|
|
74
|
+
//#region \0@oxc-project+runtime@0.129.0/helpers/toPrimitive.js
|
|
81
75
|
function toPrimitive(t, r) {
|
|
82
76
|
if ("object" != _typeof(t) || !t) return t;
|
|
83
77
|
var e = t[Symbol.toPrimitive];
|
|
@@ -90,14 +84,14 @@ function toPrimitive(t, r) {
|
|
|
90
84
|
}
|
|
91
85
|
|
|
92
86
|
//#endregion
|
|
93
|
-
//#region \0@oxc-project+runtime@0.
|
|
87
|
+
//#region \0@oxc-project+runtime@0.129.0/helpers/toPropertyKey.js
|
|
94
88
|
function toPropertyKey(t) {
|
|
95
89
|
var i = toPrimitive(t, "string");
|
|
96
90
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
97
91
|
}
|
|
98
92
|
|
|
99
93
|
//#endregion
|
|
100
|
-
//#region \0@oxc-project+runtime@0.
|
|
94
|
+
//#region \0@oxc-project+runtime@0.129.0/helpers/defineProperty.js
|
|
101
95
|
function _defineProperty(e, r, t) {
|
|
102
96
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
103
97
|
value: t,
|
|
@@ -108,7 +102,7 @@ function _defineProperty(e, r, t) {
|
|
|
108
102
|
}
|
|
109
103
|
|
|
110
104
|
//#endregion
|
|
111
|
-
//#region \0@oxc-project+runtime@0.
|
|
105
|
+
//#region \0@oxc-project+runtime@0.129.0/helpers/decorateParam.js
|
|
112
106
|
function __decorateParam(paramIndex, decorator) {
|
|
113
107
|
return function(target, key) {
|
|
114
108
|
decorator(target, key, paramIndex);
|
|
@@ -116,7 +110,7 @@ function __decorateParam(paramIndex, decorator) {
|
|
|
116
110
|
}
|
|
117
111
|
|
|
118
112
|
//#endregion
|
|
119
|
-
//#region \0@oxc-project+runtime@0.
|
|
113
|
+
//#region \0@oxc-project+runtime@0.129.0/helpers/decorate.js
|
|
120
114
|
function __decorate(decorators, target, key, desc) {
|
|
121
115
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
122
116
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -291,7 +285,7 @@ function reorderFnGenerator(orderRules, valueCompare) {
|
|
|
291
285
|
//#endregion
|
|
292
286
|
//#region package.json
|
|
293
287
|
var name = "@univerjs/sheets-sort";
|
|
294
|
-
var version = "0.
|
|
288
|
+
var version = "0.22.0-insiders.20260513-09bbeca";
|
|
295
289
|
|
|
296
290
|
//#endregion
|
|
297
291
|
//#region src/config/config.ts
|
package/lib/es/index.js
CHANGED
|
@@ -11,33 +11,27 @@ let SortType = /* @__PURE__ */ function(SortType) {
|
|
|
11
11
|
|
|
12
12
|
//#endregion
|
|
13
13
|
//#region src/controllers/utils.ts
|
|
14
|
-
let ORDER = /* @__PURE__ */ function(ORDER) {
|
|
15
|
-
ORDER[ORDER["POSITIVE"] = 1] = "POSITIVE";
|
|
16
|
-
ORDER[ORDER["NEGATIVE"] = -1] = "NEGATIVE";
|
|
17
|
-
ORDER[ORDER["ZERO"] = 0] = "ZERO";
|
|
18
|
-
return ORDER;
|
|
19
|
-
}({});
|
|
20
14
|
const removeStringSymbol = (str) => {
|
|
21
15
|
return str.replace(/-/gi, "").replace(/'/gi, "");
|
|
22
16
|
};
|
|
23
17
|
const compareNull = (a1, a2) => {
|
|
24
18
|
const isA1Null = a1 === null || a1 === "";
|
|
25
19
|
const isA2Null = a2 === null || a2 === "";
|
|
26
|
-
if (isA1Null && isA2Null) return
|
|
27
|
-
if (isA1Null) return
|
|
28
|
-
if (isA2Null) return
|
|
20
|
+
if (isA1Null && isA2Null) return 0;
|
|
21
|
+
if (isA1Null) return 1;
|
|
22
|
+
if (isA2Null) return -1;
|
|
29
23
|
return null;
|
|
30
24
|
};
|
|
31
25
|
const compareNumber = (a1, a2, type) => {
|
|
32
26
|
const isA1Num = typeof a1 === "number";
|
|
33
27
|
const isA2Num = typeof a2 === "number";
|
|
34
28
|
if (isA1Num && isA2Num) {
|
|
35
|
-
if (a1 < a2) return type ===
|
|
36
|
-
if (a1 > a2) return type ===
|
|
37
|
-
return
|
|
29
|
+
if (a1 < a2) return type === "asc" ? -1 : 1;
|
|
30
|
+
if (a1 > a2) return type === "asc" ? 1 : -1;
|
|
31
|
+
return 0;
|
|
38
32
|
}
|
|
39
|
-
if (isA1Num) return type ===
|
|
40
|
-
if (isA2Num) return type ===
|
|
33
|
+
if (isA1Num) return type === "asc" ? 1 : -1;
|
|
34
|
+
if (isA2Num) return type === "asc" ? -1 : 1;
|
|
41
35
|
return null;
|
|
42
36
|
};
|
|
43
37
|
const compareString = (a1, a2, type) => {
|
|
@@ -49,12 +43,12 @@ const compareString = (a1, a2, type) => {
|
|
|
49
43
|
if (isA1Str && isA2Str) {
|
|
50
44
|
const a1AsString = a1;
|
|
51
45
|
const a2AsString = a2;
|
|
52
|
-
if (a1AsString < a2AsString) return type ===
|
|
53
|
-
if (a1AsString > a2AsString) return type ===
|
|
54
|
-
return
|
|
46
|
+
if (a1AsString < a2AsString) return type === "asc" ? -1 : 1;
|
|
47
|
+
if (a1AsString > a2AsString) return type === "asc" ? 1 : -1;
|
|
48
|
+
return 0;
|
|
55
49
|
}
|
|
56
|
-
if (isA1Str) return type ===
|
|
57
|
-
if (isA2Str) return type ===
|
|
50
|
+
if (isA1Str) return type === "asc" ? 1 : -1;
|
|
51
|
+
if (isA2Str) return type === "asc" ? -1 : 1;
|
|
58
52
|
return null;
|
|
59
53
|
};
|
|
60
54
|
const isNullValue = (cell) => {
|
|
@@ -65,7 +59,7 @@ const isNullValue = (cell) => {
|
|
|
65
59
|
};
|
|
66
60
|
|
|
67
61
|
//#endregion
|
|
68
|
-
//#region \0@oxc-project+runtime@0.
|
|
62
|
+
//#region \0@oxc-project+runtime@0.129.0/helpers/typeof.js
|
|
69
63
|
function _typeof(o) {
|
|
70
64
|
"@babel/helpers - typeof";
|
|
71
65
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -76,7 +70,7 @@ function _typeof(o) {
|
|
|
76
70
|
}
|
|
77
71
|
|
|
78
72
|
//#endregion
|
|
79
|
-
//#region \0@oxc-project+runtime@0.
|
|
73
|
+
//#region \0@oxc-project+runtime@0.129.0/helpers/toPrimitive.js
|
|
80
74
|
function toPrimitive(t, r) {
|
|
81
75
|
if ("object" != _typeof(t) || !t) return t;
|
|
82
76
|
var e = t[Symbol.toPrimitive];
|
|
@@ -89,14 +83,14 @@ function toPrimitive(t, r) {
|
|
|
89
83
|
}
|
|
90
84
|
|
|
91
85
|
//#endregion
|
|
92
|
-
//#region \0@oxc-project+runtime@0.
|
|
86
|
+
//#region \0@oxc-project+runtime@0.129.0/helpers/toPropertyKey.js
|
|
93
87
|
function toPropertyKey(t) {
|
|
94
88
|
var i = toPrimitive(t, "string");
|
|
95
89
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
96
90
|
}
|
|
97
91
|
|
|
98
92
|
//#endregion
|
|
99
|
-
//#region \0@oxc-project+runtime@0.
|
|
93
|
+
//#region \0@oxc-project+runtime@0.129.0/helpers/defineProperty.js
|
|
100
94
|
function _defineProperty(e, r, t) {
|
|
101
95
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
102
96
|
value: t,
|
|
@@ -107,7 +101,7 @@ function _defineProperty(e, r, t) {
|
|
|
107
101
|
}
|
|
108
102
|
|
|
109
103
|
//#endregion
|
|
110
|
-
//#region \0@oxc-project+runtime@0.
|
|
104
|
+
//#region \0@oxc-project+runtime@0.129.0/helpers/decorateParam.js
|
|
111
105
|
function __decorateParam(paramIndex, decorator) {
|
|
112
106
|
return function(target, key) {
|
|
113
107
|
decorator(target, key, paramIndex);
|
|
@@ -115,7 +109,7 @@ function __decorateParam(paramIndex, decorator) {
|
|
|
115
109
|
}
|
|
116
110
|
|
|
117
111
|
//#endregion
|
|
118
|
-
//#region \0@oxc-project+runtime@0.
|
|
112
|
+
//#region \0@oxc-project+runtime@0.129.0/helpers/decorate.js
|
|
119
113
|
function __decorate(decorators, target, key, desc) {
|
|
120
114
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
121
115
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -290,7 +284,7 @@ function reorderFnGenerator(orderRules, valueCompare) {
|
|
|
290
284
|
//#endregion
|
|
291
285
|
//#region package.json
|
|
292
286
|
var name = "@univerjs/sheets-sort";
|
|
293
|
-
var version = "0.
|
|
287
|
+
var version = "0.22.0-insiders.20260513-09bbeca";
|
|
294
288
|
|
|
295
289
|
//#endregion
|
|
296
290
|
//#region src/config/config.ts
|
package/lib/index.js
CHANGED
|
@@ -11,33 +11,27 @@ let SortType = /* @__PURE__ */ function(SortType) {
|
|
|
11
11
|
|
|
12
12
|
//#endregion
|
|
13
13
|
//#region src/controllers/utils.ts
|
|
14
|
-
let ORDER = /* @__PURE__ */ function(ORDER) {
|
|
15
|
-
ORDER[ORDER["POSITIVE"] = 1] = "POSITIVE";
|
|
16
|
-
ORDER[ORDER["NEGATIVE"] = -1] = "NEGATIVE";
|
|
17
|
-
ORDER[ORDER["ZERO"] = 0] = "ZERO";
|
|
18
|
-
return ORDER;
|
|
19
|
-
}({});
|
|
20
14
|
const removeStringSymbol = (str) => {
|
|
21
15
|
return str.replace(/-/gi, "").replace(/'/gi, "");
|
|
22
16
|
};
|
|
23
17
|
const compareNull = (a1, a2) => {
|
|
24
18
|
const isA1Null = a1 === null || a1 === "";
|
|
25
19
|
const isA2Null = a2 === null || a2 === "";
|
|
26
|
-
if (isA1Null && isA2Null) return
|
|
27
|
-
if (isA1Null) return
|
|
28
|
-
if (isA2Null) return
|
|
20
|
+
if (isA1Null && isA2Null) return 0;
|
|
21
|
+
if (isA1Null) return 1;
|
|
22
|
+
if (isA2Null) return -1;
|
|
29
23
|
return null;
|
|
30
24
|
};
|
|
31
25
|
const compareNumber = (a1, a2, type) => {
|
|
32
26
|
const isA1Num = typeof a1 === "number";
|
|
33
27
|
const isA2Num = typeof a2 === "number";
|
|
34
28
|
if (isA1Num && isA2Num) {
|
|
35
|
-
if (a1 < a2) return type ===
|
|
36
|
-
if (a1 > a2) return type ===
|
|
37
|
-
return
|
|
29
|
+
if (a1 < a2) return type === "asc" ? -1 : 1;
|
|
30
|
+
if (a1 > a2) return type === "asc" ? 1 : -1;
|
|
31
|
+
return 0;
|
|
38
32
|
}
|
|
39
|
-
if (isA1Num) return type ===
|
|
40
|
-
if (isA2Num) return type ===
|
|
33
|
+
if (isA1Num) return type === "asc" ? 1 : -1;
|
|
34
|
+
if (isA2Num) return type === "asc" ? -1 : 1;
|
|
41
35
|
return null;
|
|
42
36
|
};
|
|
43
37
|
const compareString = (a1, a2, type) => {
|
|
@@ -49,12 +43,12 @@ const compareString = (a1, a2, type) => {
|
|
|
49
43
|
if (isA1Str && isA2Str) {
|
|
50
44
|
const a1AsString = a1;
|
|
51
45
|
const a2AsString = a2;
|
|
52
|
-
if (a1AsString < a2AsString) return type ===
|
|
53
|
-
if (a1AsString > a2AsString) return type ===
|
|
54
|
-
return
|
|
46
|
+
if (a1AsString < a2AsString) return type === "asc" ? -1 : 1;
|
|
47
|
+
if (a1AsString > a2AsString) return type === "asc" ? 1 : -1;
|
|
48
|
+
return 0;
|
|
55
49
|
}
|
|
56
|
-
if (isA1Str) return type ===
|
|
57
|
-
if (isA2Str) return type ===
|
|
50
|
+
if (isA1Str) return type === "asc" ? 1 : -1;
|
|
51
|
+
if (isA2Str) return type === "asc" ? -1 : 1;
|
|
58
52
|
return null;
|
|
59
53
|
};
|
|
60
54
|
const isNullValue = (cell) => {
|
|
@@ -65,7 +59,7 @@ const isNullValue = (cell) => {
|
|
|
65
59
|
};
|
|
66
60
|
|
|
67
61
|
//#endregion
|
|
68
|
-
//#region \0@oxc-project+runtime@0.
|
|
62
|
+
//#region \0@oxc-project+runtime@0.129.0/helpers/typeof.js
|
|
69
63
|
function _typeof(o) {
|
|
70
64
|
"@babel/helpers - typeof";
|
|
71
65
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -76,7 +70,7 @@ function _typeof(o) {
|
|
|
76
70
|
}
|
|
77
71
|
|
|
78
72
|
//#endregion
|
|
79
|
-
//#region \0@oxc-project+runtime@0.
|
|
73
|
+
//#region \0@oxc-project+runtime@0.129.0/helpers/toPrimitive.js
|
|
80
74
|
function toPrimitive(t, r) {
|
|
81
75
|
if ("object" != _typeof(t) || !t) return t;
|
|
82
76
|
var e = t[Symbol.toPrimitive];
|
|
@@ -89,14 +83,14 @@ function toPrimitive(t, r) {
|
|
|
89
83
|
}
|
|
90
84
|
|
|
91
85
|
//#endregion
|
|
92
|
-
//#region \0@oxc-project+runtime@0.
|
|
86
|
+
//#region \0@oxc-project+runtime@0.129.0/helpers/toPropertyKey.js
|
|
93
87
|
function toPropertyKey(t) {
|
|
94
88
|
var i = toPrimitive(t, "string");
|
|
95
89
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
96
90
|
}
|
|
97
91
|
|
|
98
92
|
//#endregion
|
|
99
|
-
//#region \0@oxc-project+runtime@0.
|
|
93
|
+
//#region \0@oxc-project+runtime@0.129.0/helpers/defineProperty.js
|
|
100
94
|
function _defineProperty(e, r, t) {
|
|
101
95
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
102
96
|
value: t,
|
|
@@ -107,7 +101,7 @@ function _defineProperty(e, r, t) {
|
|
|
107
101
|
}
|
|
108
102
|
|
|
109
103
|
//#endregion
|
|
110
|
-
//#region \0@oxc-project+runtime@0.
|
|
104
|
+
//#region \0@oxc-project+runtime@0.129.0/helpers/decorateParam.js
|
|
111
105
|
function __decorateParam(paramIndex, decorator) {
|
|
112
106
|
return function(target, key) {
|
|
113
107
|
decorator(target, key, paramIndex);
|
|
@@ -115,7 +109,7 @@ function __decorateParam(paramIndex, decorator) {
|
|
|
115
109
|
}
|
|
116
110
|
|
|
117
111
|
//#endregion
|
|
118
|
-
//#region \0@oxc-project+runtime@0.
|
|
112
|
+
//#region \0@oxc-project+runtime@0.129.0/helpers/decorate.js
|
|
119
113
|
function __decorate(decorators, target, key, desc) {
|
|
120
114
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
121
115
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -290,7 +284,7 @@ function reorderFnGenerator(orderRules, valueCompare) {
|
|
|
290
284
|
//#endregion
|
|
291
285
|
//#region package.json
|
|
292
286
|
var name = "@univerjs/sheets-sort";
|
|
293
|
-
var version = "0.
|
|
287
|
+
var version = "0.22.0-insiders.20260513-09bbeca";
|
|
294
288
|
|
|
295
289
|
//#endregion
|
|
296
290
|
//#region src/config/config.ts
|
package/lib/umd/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`@univerjs/core`),require(`@univerjs/sheets`),require(`@univerjs/engine-formula`)):typeof define==`function`&&define.amd?define([`exports`,`@univerjs/core`,`@univerjs/sheets`,`@univerjs/engine-formula`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.UniverSheetsSort={},e.UniverCore,e.UniverSheets,e.UniverEngineFormula))})(this,function(e,t,n,r){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});let i=function(e){return e.DESC=`desc`,e.ASC=`asc`,e}({}),a=
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`@univerjs/core`),require(`@univerjs/sheets`),require(`@univerjs/engine-formula`)):typeof define==`function`&&define.amd?define([`exports`,`@univerjs/core`,`@univerjs/sheets`,`@univerjs/engine-formula`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.UniverSheetsSort={},e.UniverCore,e.UniverSheets,e.UniverEngineFormula))})(this,function(e,t,n,r){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});let i=function(e){return e.DESC=`desc`,e.ASC=`asc`,e}({}),a=e=>e.replace(/-/gi,``).replace(/'/gi,``),o=(e,t)=>{let n=e===null||e===``,r=t===null||t===``;return n&&r?0:n?1:r?-1:null},s=(e,t,n)=>{let r=typeof e==`number`,i=typeof t==`number`;return r&&i?e<t?n===`asc`?-1:1:e>t?n===`asc`?1:-1:0:r?n===`asc`?1:-1:i?n===`asc`?-1:1:null},c=(e,t,n)=>{let r=typeof e==`string`,i=typeof t==`string`;if(r&&(e=a(e.toLocaleLowerCase())),i&&(t=a(t.toLocaleLowerCase())),!r&&!i)return null;if(r&&i){let r=e,i=t;return r<i?n===`asc`?-1:1:r>i?n===`asc`?1:-1:0}return r?n===`asc`?1:-1:i?n===`asc`?-1:1:null},l=e=>!e||Object.keys(e).length===0||(e==null?void 0:e.v)==null&&(e==null?void 0:e.p)==null;function u(e){"@babel/helpers - typeof";return u=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},u(e)}function d(e,t){if(u(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(u(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function f(e){var t=d(e,`string`);return u(t)==`symbol`?t:t+``}function p(e,t,n){return(t=f(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function m(e,t){return function(n,r){t(n,r,e)}}function h(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}let g=class extends t.Disposable{constructor(e,t,n){super(),this._univerInstanceService=e,this._commandService=t,this._formulaDataModel=n,p(this,`_compareFns`,[])}mergeCheck(e){var n;let{unitId:r,subUnitId:i,range:a}=e,o=(n=this._univerInstanceService.getUnit(r))==null?void 0:n.getSheetBySheetId(i);if(!o)return!1;let s=o.getMergeData().filter(e=>t.Rectangle.contains(a,e));return s.length===0?!0:_(a,s)}emptyCheck(e){var t;let{unitId:n,subUnitId:r,range:i}=e,a=(t=this._univerInstanceService.getUnit(n))==null?void 0:t.getSheetBySheetId(r);if(!a)return!1;for(let e=i.startRow;e<=i.endRow;e++)for(let t=i.startColumn;t<=i.endColumn;t++)if(!l(a.getCellRaw(e,t)))return!0;return!1}singleCheck(e){return e.range.startRow!==e.range.endRow}formulaCheck(e){var n;let{unitId:r,subUnitId:i,range:a}=e,o=(n=this._formulaDataModel.getArrayFormulaRange())==null||(n=n[r])==null?void 0:n[i];for(let e in o){let n=o[Number(e)];for(let e in n){let r=n[Number(e)];if(r&&t.Rectangle.intersects(a,r))return!1}}return!0}registerCompareFn(e){this._compareFns.unshift(e)}getAllCompareFns(){return this._compareFns}applySort(e,t,r){var i;let{unitId:a,subUnitId:o}=(0,n.getSheetCommandTarget)(this._univerInstanceService)||{};this._commandService.executeCommand(v.id,{orderRules:e.orderRules,range:e.range,hasTitle:(i=e.hasTitle)==null?!1:i,unitId:t||a,subUnitId:r||o})}};g=h([m(0,t.IUniverInstanceService),m(1,t.ICommandService),m(2,(0,t.Inject)(r.FormulaDataModel))],g);function _(e,t){let n=e.endRow-e.startRow+1,r=e.endColumn-e.startColumn+1,i=null,a=null,o=n*r,s=0;for(let n of t)if(n.startRow>=e.startRow&&n.endRow<=e.endRow&&n.startColumn>=e.startColumn&&n.endColumn<=e.endColumn){let e=n.endRow-n.startRow+1,t=n.endColumn-n.startColumn+1;if(i===null&&a===null)i=e,a=t;else if(e!==i||t!==a)return!1;s+=e*t}return s===o}let v={id:`sheet.command.sort-range`,type:t.CommandType.COMMAND,handler:(e,r)=>{let{range:i,orderRules:a,hasTitle:o,unitId:s,subUnitId:c}=r,l=e.get(g),{worksheet:u}=(0,n.getSheetCommandTarget)(e.get(t.IUniverInstanceService),r)||{};if(!u)return!1;let d=u.getMergeData().filter(e=>t.Rectangle.contains(i,e)),f=d.map(e=>e.startRow),{startRow:p,endRow:m}=i,h=o?p+1:p,_=[],v=[];for(let e=h;e<=m;e++)u.getRowFiltered(e)||u.getRowRawVisible(e)!==!1&&(d.length&&!f.includes(e)||(_.push({index:e,value:y(u,e,a)}),v.push(e)));let S=l.getAllCompareFns();_.sort(x(a,b(S)));let C={};_.forEach(({index:e,value:t},n)=>{C[v[n]]=e});let w={id:n.ReorderRangeCommand.id,params:{unitId:s,subUnitId:c,range:i,order:C}},T=e.get(t.ICommandService);return(0,t.sequenceExecute)([w],T).result}};function y(e,t,n){let r=[];return n.forEach(({colIndex:n})=>{r.push(e.getCellRaw(t,n))}),r}function b(e){return(t,n,r)=>{for(let i=0;i<e.length;i++){let a=e[i](t,n,r);if(a!=null)return a}return 0}}function x(e,t){return function(n,r){let i=null;for(let a=0;a<e.length;a++){let o=n.value[a],s=r.value[a];if(i=t(e[a].type,o,s),i!==0&&i!=null)return i}return 0}}var S=`@univerjs/sheets-sort`,C=`0.22.0-insiders.20260513-09bbeca`;let w=`sheets-sort.config`;Symbol(w);let T={},E=class extends t.Disposable{constructor(e,t){super(),this._commandService=e,this._sortService=t,this._initCommands(),this._registerCompareFns()}_initCommands(){[v].forEach(e=>this.disposeWithMe(this._commandService.registerCommand(e)))}_registerCompareFns(){this._sortService.registerCompareFn((e,t,n)=>{let r=this._getCommonValue(t),i=this._getCommonValue(n),a=[o,c,s];for(let t=0;t<a.length;t++){let n=a[t](r,i,e);if(n!==null)return n}return null})}_getCommonValue(e){var n;return l(e)?null:(e==null||(n=e.p)==null||(n=n.body)==null?void 0:n.dataStream)||((e==null?void 0:e.t)===t.CellValueType.NUMBER?Number.parseFloat(`${e.v}`):(e==null?void 0:e.t)===t.CellValueType.STRING?typeof e.v==`number`?e.v:`${e.v}`:(e==null?void 0:e.t)===t.CellValueType.BOOLEAN?`${e.v}`:(e==null?void 0:e.t)===t.CellValueType.FORCE_STRING?Number.parseFloat(`${e.v}`):`${e==null?void 0:e.v}`)}};E=h([m(0,t.ICommandService),m(1,(0,t.Inject)(g))],E);let D=class extends t.Plugin{constructor(e=T,n,r){super(),this._config=e,this._injector=n,this._configService=r;let{...i}=(0,t.merge)({},T,this._config);this._configService.setConfig(w,i)}onStarting(){[[E],[g]].forEach(e=>this._injector.add(e))}onReady(){this._injector.get(E)}};p(D,`type`,t.UniverInstanceType.UNIVER_SHEET),p(D,`pluginName`,`SHEET_SORT_PLUGIN`),p(D,`packageName`,S),p(D,`version`,C),D=h([(0,t.DependentOn)(n.UniverSheetsPlugin,r.UniverFormulaEnginePlugin),m(1,(0,t.Inject)(t.Injector)),m(2,t.IConfigService)],D),Object.defineProperty(e,`SheetsSortService`,{enumerable:!0,get:function(){return g}}),e.SortRangeCommand=v,e.SortType=i,Object.defineProperty(e,`UniverSheetsSortPlugin`,{enumerable:!0,get:function(){return D}})});
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@univerjs/sheets-sort",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.22.0-insiders.20260513-09bbeca",
|
|
4
4
|
"private": false,
|
|
5
|
-
"description": "
|
|
6
|
-
"author": "DreamNum <developer@univer.ai>",
|
|
5
|
+
"description": "Sorting model, commands, and services for Univer Sheets.",
|
|
6
|
+
"author": "DreamNum Co., Ltd. <developer@univer.ai>",
|
|
7
7
|
"license": "Apache-2.0",
|
|
8
8
|
"funding": {
|
|
9
9
|
"type": "opencollective",
|
|
@@ -17,7 +17,13 @@
|
|
|
17
17
|
"bugs": {
|
|
18
18
|
"url": "https://github.com/dream-num/univer/issues"
|
|
19
19
|
},
|
|
20
|
-
"keywords": [
|
|
20
|
+
"keywords": [
|
|
21
|
+
"univer",
|
|
22
|
+
"sheets",
|
|
23
|
+
"sort",
|
|
24
|
+
"spreadsheet",
|
|
25
|
+
"plugin"
|
|
26
|
+
],
|
|
21
27
|
"exports": {
|
|
22
28
|
".": {
|
|
23
29
|
"import": "./lib/es/index.js",
|
|
@@ -58,14 +64,14 @@
|
|
|
58
64
|
"lib"
|
|
59
65
|
],
|
|
60
66
|
"dependencies": {
|
|
61
|
-
"@univerjs/engine-formula": "0.
|
|
62
|
-
"@univerjs/sheets": "0.
|
|
63
|
-
"@univerjs/core": "0.
|
|
67
|
+
"@univerjs/engine-formula": "0.22.0-insiders.20260513-09bbeca",
|
|
68
|
+
"@univerjs/sheets": "0.22.0-insiders.20260513-09bbeca",
|
|
69
|
+
"@univerjs/core": "0.22.0-insiders.20260513-09bbeca"
|
|
64
70
|
},
|
|
65
71
|
"devDependencies": {
|
|
66
|
-
"typescript": "^6.0.
|
|
67
|
-
"vitest": "^4.1.
|
|
68
|
-
"@univerjs-infra/shared": "0.
|
|
72
|
+
"typescript": "^6.0.3",
|
|
73
|
+
"vitest": "^4.1.5",
|
|
74
|
+
"@univerjs-infra/shared": "0.22.0"
|
|
69
75
|
},
|
|
70
76
|
"scripts": {
|
|
71
77
|
"test": "vitest run",
|
package/LICENSE
DELETED
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
Apache License
|
|
2
|
-
Version 2.0, January 2004
|
|
3
|
-
http://www.apache.org/licenses/
|
|
4
|
-
|
|
5
|
-
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
-
|
|
7
|
-
1. Definitions.
|
|
8
|
-
|
|
9
|
-
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
-
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
-
|
|
12
|
-
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
-
the copyright owner that is granting the License.
|
|
14
|
-
|
|
15
|
-
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
-
other entities that control, are controlled by, or are under common
|
|
17
|
-
control with that entity. For the purposes of this definition,
|
|
18
|
-
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
-
direction or management of such entity, whether by contract or
|
|
20
|
-
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
-
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
-
|
|
23
|
-
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
-
exercising permissions granted by this License.
|
|
25
|
-
|
|
26
|
-
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
-
including but not limited to software source code, documentation
|
|
28
|
-
source, and configuration files.
|
|
29
|
-
|
|
30
|
-
"Object" form shall mean any form resulting from mechanical
|
|
31
|
-
transformation or translation of a Source form, including but
|
|
32
|
-
not limited to compiled object code, generated documentation,
|
|
33
|
-
and conversions to other media types.
|
|
34
|
-
|
|
35
|
-
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
-
Object form, made available under the License, as indicated by a
|
|
37
|
-
copyright notice that is included in or attached to the work
|
|
38
|
-
(an example is provided in the Appendix below).
|
|
39
|
-
|
|
40
|
-
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
-
form, that is based on (or derived from) the Work and for which the
|
|
42
|
-
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
-
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
-
of this License, Derivative Works shall not include works that remain
|
|
45
|
-
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
-
the Work and Derivative Works thereof.
|
|
47
|
-
|
|
48
|
-
"Contribution" shall mean any work of authorship, including
|
|
49
|
-
the original version of the Work and any modifications or additions
|
|
50
|
-
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
-
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
-
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
-
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
-
means any form of electronic, verbal, or written communication sent
|
|
55
|
-
to the Licensor or its representatives, including but not limited to
|
|
56
|
-
communication on electronic mailing lists, source code control systems,
|
|
57
|
-
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
-
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
-
excluding communication that is conspicuously marked or otherwise
|
|
60
|
-
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
-
|
|
62
|
-
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
-
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
-
subsequently incorporated within the Work.
|
|
65
|
-
|
|
66
|
-
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
-
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
-
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
-
Work and such Derivative Works in Source or Object form.
|
|
72
|
-
|
|
73
|
-
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
-
(except as stated in this section) patent license to make, have made,
|
|
77
|
-
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
-
where such license applies only to those patent claims licensable
|
|
79
|
-
by such Contributor that are necessarily infringed by their
|
|
80
|
-
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
-
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
-
institute patent litigation against any entity (including a
|
|
83
|
-
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
-
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
-
or contributory patent infringement, then any patent licenses
|
|
86
|
-
granted to You under this License for that Work shall terminate
|
|
87
|
-
as of the date such litigation is filed.
|
|
88
|
-
|
|
89
|
-
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
-
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
-
modifications, and in Source or Object form, provided that You
|
|
92
|
-
meet the following conditions:
|
|
93
|
-
|
|
94
|
-
(a) You must give any other recipients of the Work or
|
|
95
|
-
Derivative Works a copy of this License; and
|
|
96
|
-
|
|
97
|
-
(b) You must cause any modified files to carry prominent notices
|
|
98
|
-
stating that You changed the files; and
|
|
99
|
-
|
|
100
|
-
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
-
that You distribute, all copyright, patent, trademark, and
|
|
102
|
-
attribution notices from the Source form of the Work,
|
|
103
|
-
excluding those notices that do not pertain to any part of
|
|
104
|
-
the Derivative Works; and
|
|
105
|
-
|
|
106
|
-
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
-
distribution, then any Derivative Works that You distribute must
|
|
108
|
-
include a readable copy of the attribution notices contained
|
|
109
|
-
within such NOTICE file, excluding those notices that do not
|
|
110
|
-
pertain to any part of the Derivative Works, in at least one
|
|
111
|
-
of the following places: within a NOTICE text file distributed
|
|
112
|
-
as part of the Derivative Works; within the Source form or
|
|
113
|
-
documentation, if provided along with the Derivative Works; or,
|
|
114
|
-
within a display generated by the Derivative Works, if and
|
|
115
|
-
wherever such third-party notices normally appear. The contents
|
|
116
|
-
of the NOTICE file are for informational purposes only and
|
|
117
|
-
do not modify the License. You may add Your own attribution
|
|
118
|
-
notices within Derivative Works that You distribute, alongside
|
|
119
|
-
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
-
that such additional attribution notices cannot be construed
|
|
121
|
-
as modifying the License.
|
|
122
|
-
|
|
123
|
-
You may add Your own copyright statement to Your modifications and
|
|
124
|
-
may provide additional or different license terms and conditions
|
|
125
|
-
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
-
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
-
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
-
the conditions stated in this License.
|
|
129
|
-
|
|
130
|
-
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
-
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
-
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
-
this License, without any additional terms or conditions.
|
|
134
|
-
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
-
the terms of any separate license agreement you may have executed
|
|
136
|
-
with Licensor regarding such Contributions.
|
|
137
|
-
|
|
138
|
-
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
-
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
-
except as required for reasonable and customary use in describing the
|
|
141
|
-
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
-
|
|
143
|
-
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
-
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
-
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
-
implied, including, without limitation, any warranties or conditions
|
|
148
|
-
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
-
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
-
appropriateness of using or redistributing the Work and assume any
|
|
151
|
-
risks associated with Your exercise of permissions under this License.
|
|
152
|
-
|
|
153
|
-
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
-
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
-
unless required by applicable law (such as deliberate and grossly
|
|
156
|
-
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
-
liable to You for damages, including any direct, indirect, special,
|
|
158
|
-
incidental, or consequential damages of any character arising as a
|
|
159
|
-
result of this License or out of the use or inability to use the
|
|
160
|
-
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
-
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
-
other commercial damages or losses), even if such Contributor
|
|
163
|
-
has been advised of the possibility of such damages.
|
|
164
|
-
|
|
165
|
-
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
-
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
-
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
-
or other liability obligations and/or rights consistent with this
|
|
169
|
-
License. However, in accepting such obligations, You may act only
|
|
170
|
-
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
-
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
-
defend, and hold each Contributor harmless for any liability
|
|
173
|
-
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
-
of your accepting any such warranty or additional liability.
|
|
175
|
-
|
|
176
|
-
END OF TERMS AND CONDITIONS
|