@univerjs/sheets-filter-ui 1.4.0 → 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -7
- package/lib/cjs/{worker-CME9bDM7.js → config-CuFgx0Xn.js} +14 -43
- package/lib/cjs/index.js +188 -130
- package/lib/cjs/worker.js +32 -2
- package/lib/{es/worker-VROMWls7.js → config-YTXWTUKa.js} +14 -43
- package/lib/{worker-VROMWls7.js → es/config-YTXWTUKa.js} +14 -43
- package/lib/es/index.js +80 -16
- package/lib/es/worker.js +31 -1
- package/lib/index.js +80 -16
- package/lib/types/index.d.ts +0 -3
- package/lib/umd/index.js +5 -5
- package/lib/worker.js +31 -1
- package/package.json +12 -12
package/README.md
CHANGED
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
|
|
9
9
|
## Package Overview
|
|
10
10
|
|
|
11
|
-
| Package | UMD global | CSS | Locales | Facade entry |
|
|
12
|
-
| --- | --- | :---: | :---: | :---: |
|
|
13
|
-
| `@univerjs/sheets-filter-ui` | `UniverSheetsFilterUi` | Yes | Yes | No |
|
|
11
|
+
| Package | UMD global | CSS | Locales | Facade entry | Worker entry |
|
|
12
|
+
| --- | --- | :---: | :---: | :---: | :---: |
|
|
13
|
+
| `@univerjs/sheets-filter-ui` | `UniverSheetsFilterUi` | Yes | Yes | No | Yes |
|
|
14
14
|
|
|
15
15
|
## Installation
|
|
16
16
|
|
|
@@ -20,10 +20,10 @@ pnpm add @univerjs/sheets-filter-ui
|
|
|
20
20
|
npm install @univerjs/sheets-filter-ui
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
-
Keep all `@univerjs/*` packages on the same version.
|
|
24
|
-
|
|
25
23
|
## Usage
|
|
26
24
|
|
|
25
|
+
Start with the [integration setup](https://docs.univer.ai/) for your document type, including its required plugins, styles, and locale resources. The snippet below assumes that setup is complete.
|
|
26
|
+
|
|
27
27
|
```ts
|
|
28
28
|
import '@univerjs/sheets-filter-ui/lib/index.css';
|
|
29
29
|
import EnUS from '@univerjs/sheets-filter-ui/locale/en-US';
|
|
@@ -34,11 +34,22 @@ univer.registerPlugin(UniverSheetsFilterUIPlugin);
|
|
|
34
34
|
// Merge EnUS into your Univer locale map when this package contributes UI text.
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
Main-thread plugin classes:
|
|
38
38
|
|
|
39
39
|
- `UniverSheetsFilterUIPlugin`
|
|
40
40
|
- `UniverSheetsFilterMobileUIPlugin`
|
|
41
|
-
|
|
41
|
+
|
|
42
|
+
### Worker usage
|
|
43
|
+
|
|
44
|
+
On the main thread, import `UniverSheetsFilterUIPlugin` from `@univerjs/sheets-filter-ui`.
|
|
45
|
+
|
|
46
|
+
In the worker entry, import `UniverSheetsFilterUIWorkerPlugin` from `@univerjs/sheets-filter-ui/worker`:
|
|
47
|
+
|
|
48
|
+
```ts
|
|
49
|
+
import { UniverSheetsFilterUIWorkerPlugin } from '@univerjs/sheets-filter-ui/worker';
|
|
50
|
+
|
|
51
|
+
univer.registerPlugin(UniverSheetsFilterUIWorkerPlugin);
|
|
52
|
+
```
|
|
42
53
|
|
|
43
54
|
## Resources
|
|
44
55
|
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
let _univerjs_core = require("@univerjs/core");
|
|
2
2
|
let _univerjs_sheets_filter = require("@univerjs/sheets-filter");
|
|
3
|
-
let _univerjs_rpc = require("@univerjs/rpc");
|
|
4
3
|
|
|
5
|
-
// \0@oxc-project+runtime@0.
|
|
4
|
+
// \0@oxc-project+runtime@0.157.0/helpers/esm/decorateParam.js
|
|
6
5
|
function __decorateParam(paramIndex, decorator) {
|
|
7
6
|
return function(target, key) {
|
|
8
7
|
decorator(target, key, paramIndex);
|
|
9
8
|
};
|
|
10
9
|
}
|
|
11
10
|
|
|
12
|
-
// \0@oxc-project+runtime@0.
|
|
11
|
+
// \0@oxc-project+runtime@0.157.0/helpers/esm/decorate.js
|
|
13
12
|
function __decorate(decorators, target, key, desc) {
|
|
14
13
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
15
14
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -195,7 +194,7 @@ function compare(strA, strB) {
|
|
|
195
194
|
else return strA.localeCompare(strB);
|
|
196
195
|
}
|
|
197
196
|
|
|
198
|
-
// \0@oxc-project+runtime@0.
|
|
197
|
+
// \0@oxc-project+runtime@0.157.0/helpers/esm/typeof.js
|
|
199
198
|
function _typeof(o) {
|
|
200
199
|
"@babel/helpers - typeof";
|
|
201
200
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -205,25 +204,25 @@ function _typeof(o) {
|
|
|
205
204
|
}, _typeof(o);
|
|
206
205
|
}
|
|
207
206
|
|
|
208
|
-
// \0@oxc-project+runtime@0.
|
|
209
|
-
function toPrimitive(t,
|
|
207
|
+
// \0@oxc-project+runtime@0.157.0/helpers/esm/toPrimitive.js
|
|
208
|
+
function toPrimitive(t, e) {
|
|
210
209
|
if ("object" != _typeof(t) || !t) return t;
|
|
211
|
-
var
|
|
212
|
-
if (void 0 !==
|
|
213
|
-
var i =
|
|
210
|
+
var r;
|
|
211
|
+
if ("undefined" != typeof Symbol && void 0 !== (r = t[Symbol.toPrimitive])) {
|
|
212
|
+
var i = r.call(t, e || "default");
|
|
214
213
|
if ("object" != _typeof(i)) return i;
|
|
215
214
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
216
215
|
}
|
|
217
|
-
return ("string" ===
|
|
216
|
+
return ("string" === e ? String : Number)(t);
|
|
218
217
|
}
|
|
219
218
|
|
|
220
|
-
// \0@oxc-project+runtime@0.
|
|
219
|
+
// \0@oxc-project+runtime@0.157.0/helpers/esm/toPropertyKey.js
|
|
221
220
|
function toPropertyKey(t) {
|
|
222
221
|
var i = toPrimitive(t, "string");
|
|
223
222
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
224
223
|
}
|
|
225
224
|
|
|
226
|
-
// \0@oxc-project+runtime@0.
|
|
225
|
+
// \0@oxc-project+runtime@0.157.0/helpers/esm/defineProperty.js
|
|
227
226
|
function _defineProperty(e, r, t) {
|
|
228
227
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
229
228
|
value: t,
|
|
@@ -235,41 +234,13 @@ function _defineProperty(e, r, t) {
|
|
|
235
234
|
|
|
236
235
|
// package.json
|
|
237
236
|
var name = "@univerjs/sheets-filter-ui";
|
|
238
|
-
var version = "1.
|
|
237
|
+
var version = "1.5.1";
|
|
239
238
|
|
|
240
239
|
// src/config/config.ts
|
|
241
240
|
const SHEETS_FILTER_UI_PLUGIN_CONFIG_KEY = "sheets-filter-ui.config";
|
|
242
241
|
const configSymbol = Symbol(SHEETS_FILTER_UI_PLUGIN_CONFIG_KEY);
|
|
243
242
|
const defaultPluginConfig = {};
|
|
244
243
|
|
|
245
|
-
// src/worker/plugin.ts
|
|
246
|
-
let UniverSheetsFilterUIWorkerPlugin = class UniverSheetsFilterUIWorkerPlugin extends _univerjs_core.Plugin {
|
|
247
|
-
constructor(_config = defaultPluginConfig, _injector, _configService, _rpcChannelService) {
|
|
248
|
-
super();
|
|
249
|
-
this._config = _config;
|
|
250
|
-
this._injector = _injector;
|
|
251
|
-
this._configService = _configService;
|
|
252
|
-
this._rpcChannelService = _rpcChannelService;
|
|
253
|
-
const { ...rest } = (0, _univerjs_core.merge)({}, defaultPluginConfig, this._config);
|
|
254
|
-
this._configService.setConfig(SHEETS_FILTER_UI_PLUGIN_CONFIG_KEY, rest);
|
|
255
|
-
}
|
|
256
|
-
onStarting() {
|
|
257
|
-
[[ISheetsGenerateFilterValuesService, { useClass: SheetsGenerateFilterValuesService }]].forEach((d) => this._injector.add(d));
|
|
258
|
-
}
|
|
259
|
-
onReady() {
|
|
260
|
-
this._rpcChannelService.registerChannel(SHEETS_GENERATE_FILTER_VALUES_SERVICE_NAME, (0, _univerjs_rpc.fromModule)(this._injector.get(ISheetsGenerateFilterValuesService)));
|
|
261
|
-
}
|
|
262
|
-
};
|
|
263
|
-
_defineProperty(UniverSheetsFilterUIWorkerPlugin, "type", _univerjs_core.UniverInstanceType.UNIVER_SHEET);
|
|
264
|
-
_defineProperty(UniverSheetsFilterUIWorkerPlugin, "pluginName", "SHEET_FILTER_UI_WORKER_PLUGIN");
|
|
265
|
-
_defineProperty(UniverSheetsFilterUIWorkerPlugin, "packageName", name);
|
|
266
|
-
_defineProperty(UniverSheetsFilterUIWorkerPlugin, "version", version);
|
|
267
|
-
UniverSheetsFilterUIWorkerPlugin = __decorate([
|
|
268
|
-
__decorateParam(1, (0, _univerjs_core.Inject)(_univerjs_core.Injector)),
|
|
269
|
-
__decorateParam(2, _univerjs_core.IConfigService),
|
|
270
|
-
__decorateParam(3, _univerjs_rpc.IRPCChannelService)
|
|
271
|
-
], UniverSheetsFilterUIWorkerPlugin);
|
|
272
|
-
|
|
273
244
|
Object.defineProperty(exports, "ISheetsGenerateFilterValuesService", {
|
|
274
245
|
enumerable: true,
|
|
275
246
|
get: function () {
|
|
@@ -288,10 +259,10 @@ Object.defineProperty(exports, "SHEETS_GENERATE_FILTER_VALUES_SERVICE_NAME", {
|
|
|
288
259
|
return SHEETS_GENERATE_FILTER_VALUES_SERVICE_NAME;
|
|
289
260
|
}
|
|
290
261
|
});
|
|
291
|
-
Object.defineProperty(exports, "
|
|
262
|
+
Object.defineProperty(exports, "SheetsGenerateFilterValuesService", {
|
|
292
263
|
enumerable: true,
|
|
293
264
|
get: function () {
|
|
294
|
-
return
|
|
265
|
+
return SheetsGenerateFilterValuesService;
|
|
295
266
|
}
|
|
296
267
|
});
|
|
297
268
|
Object.defineProperty(exports, "__decorate", {
|