@univerjs-pro/sheets-pivot 0.4.2 → 0.5.0-beta.0
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 +13 -15
- package/lib/cjs/facade.js +1 -0
- package/lib/cjs/index.js +1 -1
- package/lib/cjs/locale/en-US.js +1 -0
- package/lib/cjs/locale/fa-IR.js +1 -0
- package/lib/cjs/locale/ru-RU.js +1 -0
- package/lib/cjs/locale/vi-VN.js +1 -0
- package/lib/cjs/locale/zh-CN.js +1 -0
- package/lib/cjs/locale/zh-TW.js +1 -0
- package/lib/es/facade.js +1 -0
- package/lib/es/index.js +1 -1
- package/lib/es/locale/en-US.js +1 -0
- package/lib/es/locale/fa-IR.js +1 -0
- package/lib/es/locale/ru-RU.js +1 -0
- package/lib/es/locale/vi-VN.js +1 -0
- package/lib/es/locale/zh-CN.js +1 -0
- package/lib/es/locale/zh-TW.js +1 -0
- package/lib/types/commands/command/add-pivot-field.command.d.ts +11 -0
- package/lib/types/commands/command/add-pivot-table.command.d.ts +9 -0
- package/lib/types/commands/command/move-pivot-field.command.d.ts +11 -0
- package/lib/types/commands/command/pivot-drill-down.command.d.ts +6 -0
- package/lib/types/commands/command/remove-pivot-field.command.d.ts +8 -0
- package/lib/types/commands/command/set-pivot-collapse.command.d.ts +9 -0
- package/lib/types/commands/command/set-pivot-filter.command.d.ts +10 -0
- package/lib/types/commands/command/set-pivot-sort.command.d.ts +10 -0
- package/lib/types/commands/command/update-pivot-setting.command.d.ts +15 -0
- package/lib/types/commands/command/update-pivot-source.command.d.ts +9 -0
- package/lib/types/commands/command/update-value-position.command.d.ts +8 -0
- package/lib/types/commands/command/util.d.ts +3 -1
- package/lib/types/common/const.d.ts +44 -44
- package/lib/types/const/const.d.ts +8 -0
- package/lib/types/const/type.d.ts +10 -7
- package/lib/types/controllers/const.d.ts +1 -1
- package/lib/types/controllers/sheets-pivot-clear.controller.d.ts +12 -0
- package/lib/types/controllers/sheets-pivot-interceptor.controller.d.ts +21 -0
- package/lib/types/controllers/sheets-pivot-permission.controller.d.ts +7 -0
- package/lib/types/controllers/sheets-pivot-ref-range.controller.d.ts +21 -0
- package/lib/types/controllers/sheets-pivot-remove-sheet.controller.d.ts +9 -0
- package/lib/types/facade/f-pivot-table.d.ts +83 -0
- package/lib/types/facade/f-workbook.d.ts +72 -0
- package/lib/types/facade/index.d.ts +2 -0
- package/lib/types/index.d.ts +25 -2
- package/lib/types/services/sheets-pivot-table.service.d.ts +9 -1
- package/lib/types/util.d.ts +35 -3
- package/lib/umd/facade.js +1 -0
- package/lib/umd/index.js +1 -1
- package/lib/umd/locale/en-US.js +1 -0
- package/lib/umd/locale/fa-IR.js +1 -0
- package/lib/umd/locale/ru-RU.js +1 -0
- package/lib/umd/locale/vi-VN.js +1 -0
- package/lib/umd/locale/zh-CN.js +1 -0
- package/lib/umd/locale/zh-TW.js +1 -0
- package/package.json +40 -21
- package/lib/locale/en-US.json +0 -30
- package/lib/locale/fa-IR.json +0 -30
- package/lib/locale/ru-RU.json +0 -30
- package/lib/locale/vi-VN.json +0 -30
- package/lib/locale/zh-CN.json +0 -30
- package/lib/locale/zh-TW.json +0 -30
package/README.md
CHANGED
|
@@ -7,28 +7,26 @@
|
|
|
7
7
|
|
|
8
8
|
## Introduction
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
A pivot table is a powerful data analysis tool used for quickly and dynamically summarizing and analyzing large volumes of data. It allows users to group, filter, sort, and aggregate raw data across different dimensions, revealing patterns and trends within the data. By dragging and dropping fields to define rows, columns, and values, users can create cross-tabulated tables for multi-level data summarization. Common functions include sum, count, average, maximum/minimum, and more, enabling users to derive valuable insights from complex data. Pivot tables are ideal for scenarios such as financial analysis, business monitoring, and sales data reporting.
|
|
11
11
|
|
|
12
12
|
## Usage
|
|
13
13
|
|
|
14
|
-
You should use this plugin with the `@univerjs/sheets-filter` package.
|
|
15
|
-
|
|
16
|
-
```ts
|
|
17
|
-
import '@univerjs/sheet-pivot/lib/index.css';
|
|
18
|
-
|
|
19
|
-
import { UniverSheetsFilterPlugin } from '@univerjs/sheets-filter';
|
|
20
|
-
import { UniverSheetsFilterUIPlugin } from '@univerjs/sheet-pivot';
|
|
21
|
-
|
|
22
|
-
univer.registerPlugin(UniverSheetsFilterPlugin);
|
|
23
|
-
univer.registerPlugin(UniverSheetsFilterUIPlugin);
|
|
24
|
-
```
|
|
25
|
-
|
|
26
14
|
### Installation
|
|
27
15
|
|
|
28
16
|
```shell
|
|
29
17
|
# Using npm
|
|
30
|
-
npm install @univerjs/sheet-pivot
|
|
18
|
+
npm install @univerjs/sheet-pivot-ui @univerjs/sheet-pivot
|
|
31
19
|
|
|
32
20
|
# Using pnpm
|
|
33
|
-
pnpm add @univerjs/sheet-pivot
|
|
21
|
+
pnpm add @univerjs/sheet-pivot-ui @univerjs/sheet-pivot
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### Import
|
|
25
|
+
|
|
26
|
+
```ts
|
|
27
|
+
import { UniverSheetsPivotTablePlugin } from '@univerjs-pro/sheets-pivot';
|
|
28
|
+
import { UniverSheetsPivotTableUIPlugin } from '@univerjs-pro/sheets-pivot-ui';
|
|
29
|
+
|
|
30
|
+
univer.registerPlugin(UniverSheetsPivotTablePlugin);
|
|
31
|
+
univer.registerPlugin(UniverSheetsPivotTableUIPlugin);
|
|
34
32
|
```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';const _0x742a36=_0x25fd;function _0x25fd(_0x553b6c,_0x3f62b3){const _0x9b12d3=_0x9b12();return _0x25fd=function(_0x25fd5b,_0x42f06d){_0x25fd5b=_0x25fd5b-0x15e;let _0x187a43=_0x9b12d3[_0x25fd5b];return _0x187a43;},_0x25fd(_0x553b6c,_0x3f62b3);}(function(_0xc700cc,_0x178cd1){const _0x243b31=_0x25fd,_0x8ca467=_0xc700cc();while(!![]){try{const _0x7085a3=-parseInt(_0x243b31(0x16b))/0x1+-parseInt(_0x243b31(0x169))/0x2+parseInt(_0x243b31(0x177))/0x3+parseInt(_0x243b31(0x17a))/0x4+-parseInt(_0x243b31(0x18a))/0x5*(parseInt(_0x243b31(0x15e))/0x6)+-parseInt(_0x243b31(0x160))/0x7*(parseInt(_0x243b31(0x15f))/0x8)+-parseInt(_0x243b31(0x16d))/0x9*(-parseInt(_0x243b31(0x17b))/0xa);if(_0x7085a3===_0x178cd1)break;else _0x8ca467['push'](_0x8ca467['shift']());}catch(_0x29c5ac){_0x8ca467['push'](_0x8ca467['shift']());}}}(_0x9b12,0x78f93));var C=Object[_0x742a36(0x176)],g=(_0x1fdf51,_0x529be5,_0x200e12)=>_0x529be5 in _0x1fdf51?C(_0x1fdf51,_0x529be5,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x200e12}):_0x1fdf51[_0x529be5]=_0x200e12,l=(_0x421671,_0x372a8c,_0x3d17e3)=>g(_0x421671,typeof _0x372a8c!='symbol'?_0x372a8c+'':_0x372a8c,_0x3d17e3);Object[_0x742a36(0x176)](exports,Symbol[_0x742a36(0x163)],{'value':_0x742a36(0x171)});function _0x9b12(){const _0x27a0cd=['number','getConfig','Module','_injector','subUnitId','getPivotTableConfig','getCollection','defineProperty','1212894LLoaKe','SheetsPivotTableAdaptorModel','@univerjs-pro/engine-pivot','409944MjOCnX','6620SsISmB','extend','AddPivotTableCommand','executeCommand','renameField','setLabelManualFilter','UpdatePivotValuePositionCommand','@univerjs/sheets/facade','RenamePivotFieldMutation','SheetsPivotTableConfigModel','pivotTableId','FPivotTable','@univerjs-pro/sheets-pivot','updateValuePosition','MovePivotFieldCommand','5yLWdLp','setLabelSort','addPivotTable','4842948Fpzqiv','344xmWPUZ','50946JAvRRO','RemovePivotFieldCommand','ICommandService','toStringTag','SetPivotSubtotalTypeMutation','unitId','FWorkbook','getPivotTableByCell','setSubtotalType','154492bPIcWl','fieldIds','501357afmavb','getPivotTableIdByCell','22941kJfHcu','get'];_0x9b12=function(){return _0x27a0cd;};return _0x9b12();}const r=require('@univerjs/core'),b=require(_0x742a36(0x182)),P=require(_0x742a36(0x179)),a=require(_0x742a36(0x187));class I{constructor(_0x5e262f,_0x402036,_0x473d1f,_0x30ad06){const _0x361a4b=_0x742a36;l(this,_0x361a4b(0x165)),l(this,_0x361a4b(0x173)),l(this,_0x361a4b(0x185)),l(this,_0x361a4b(0x172)),(this['unitId']=_0x5e262f,this[_0x361a4b(0x173)]=_0x402036,this['pivotTableId']=_0x473d1f,this['_injector']=_0x30ad06);}[_0x742a36(0x170)](){const _0x4ec052=_0x742a36;return this[_0x4ec052(0x172)][_0x4ec052(0x16e)](a['SheetsPivotTableConfigModel'])[_0x4ec052(0x174)](this[_0x4ec052(0x165)],this['subUnitId'],this['pivotTableId']);}async['remove'](){const _0x1c1d76=_0x742a36;return await this[_0x1c1d76(0x172)][_0x1c1d76(0x16e)](r[_0x1c1d76(0x162)])['syncExecuteCommand'](a['RemovePivotTableMutation']['id'],{'unitId':this['unitId'],'subUnitId':this['subUnitId'],'pivotTableId':this[_0x1c1d76(0x185)]});}async['addField'](_0xc7866b,_0x3ec7cd,_0x49dd00){const _0x42d420=_0x742a36,_0x41d80d=this[_0x42d420(0x172)],_0x3bf5db=this[_0x42d420(0x165)],_0x375a16=this[_0x42d420(0x173)],_0x32a009=this['pivotTableId'],_0x2d9586=_0x41d80d['get'](r[_0x42d420(0x162)]),_0x1845c6=_0x41d80d['get'](a[_0x42d420(0x184)]),_0x29c9b0=_0x1845c6[_0x42d420(0x174)](_0x3bf5db,_0x375a16,_0x32a009),_0x5ce54d=_0x1845c6[_0x42d420(0x175)](_0x3bf5db,_0x32a009);if(!_0x29c9b0||!_0x5ce54d)return!0x1;let _0x508895=_0xc7866b;typeof _0x508895==_0x42d420(0x16f)&&(_0x508895=_0x1845c6[_0x42d420(0x175)](_0x3bf5db,_0x32a009)[_0x42d420(0x16a)][_0xc7866b]);const _0x31767c={'unitId':_0x3bf5db,'subUnitId':_0x375a16,'pivotTableId':_0x32a009,'dataFieldId':_0x508895,'fieldArea':_0x3ec7cd,'index':_0x49dd00};return _0x2d9586[_0x42d420(0x17e)](a['AddPivotFieldCommand']['id'],_0x31767c);}async['removeField'](_0x3c2bb7){const _0x1806ae=_0x742a36,_0x7ea3cc=this[_0x1806ae(0x172)],_0x487cc1=this[_0x1806ae(0x165)],_0x51bc1a=this['subUnitId'],_0x4a0d03=this[_0x1806ae(0x185)],_0x589972=_0x7ea3cc[_0x1806ae(0x16e)](r[_0x1806ae(0x162)]),_0x17b2a5={'unitId':_0x487cc1,'subUnitId':_0x51bc1a,'pivotTableId':_0x4a0d03,'fieldIds':_0x3c2bb7};return _0x589972[_0x1806ae(0x17e)](a[_0x1806ae(0x161)]['id'],_0x17b2a5);}async['updateFieldPosition'](_0x26f79a,_0x2adb5c,_0xb1655e){const _0x160da2=_0x742a36,_0x55bb65=this[_0x160da2(0x172)],_0x17a151=this[_0x160da2(0x165)],_0x52f11a=this[_0x160da2(0x173)],_0xaadeca=this[_0x160da2(0x185)],_0x4baff2=_0x55bb65[_0x160da2(0x16e)](r['ICommandService']),_0x27c6c5={'unitId':_0x17a151,'subUnitId':_0x52f11a,'pivotTableId':_0xaadeca,'fieldId':_0x26f79a,'area':_0x2adb5c,'index':_0xb1655e};return _0x4baff2['executeCommand'](a[_0x160da2(0x189)]['id'],_0x27c6c5);}async[_0x742a36(0x188)](_0x45047c,_0x3a9401){const _0x5428fa=_0x742a36,_0x8c50e0=this[_0x5428fa(0x172)],_0x30cd19=this[_0x5428fa(0x165)],_0x54a530=this['subUnitId'],_0x441aad=this[_0x5428fa(0x185)],_0xce7cb3=_0x8c50e0[_0x5428fa(0x16e)](r[_0x5428fa(0x162)]),_0x3bf08e={'unitId':_0x30cd19,'subUnitId':_0x54a530,'pivotTableId':_0x441aad,'position':_0x45047c,'index':_0x3a9401};return _0xce7cb3[_0x5428fa(0x17e)](a[_0x5428fa(0x181)]['id'],_0x3bf08e);}async[_0x742a36(0x168)](_0x5198ba,_0x1ef910){const _0x9ad1a3=_0x742a36,_0x8f363b=this['_injector'],_0x50f033=this['unitId'],_0xf6e324=this[_0x9ad1a3(0x173)],_0x5993f4=this[_0x9ad1a3(0x185)],_0x454286=_0x8f363b[_0x9ad1a3(0x16e)](r[_0x9ad1a3(0x162)]),_0x9d7faa={'unitId':_0x50f033,'subUnitId':_0xf6e324,'pivotTableId':_0x5993f4,'fieldId':_0x5198ba,'subtotalType':_0x1ef910};return _0x454286[_0x9ad1a3(0x17e)](a[_0x9ad1a3(0x164)]['id'],_0x9d7faa);}async[_0x742a36(0x18b)](_0x3e0044,_0xda1d85){const _0x5e171a=_0x742a36,_0x160bca=this[_0x5e171a(0x172)],_0x269e5a=this[_0x5e171a(0x165)],_0x32befa=this[_0x5e171a(0x173)],_0x3c848e=this[_0x5e171a(0x185)],_0xaba720=_0x160bca[_0x5e171a(0x16e)](r[_0x5e171a(0x162)]),_0x432a72={'unitId':_0x269e5a,'subUnitId':_0x32befa,'tableFieldId':_0x3e0044,'pivotTableId':_0x3c848e,'info':_0xda1d85};return _0xaba720[_0x5e171a(0x17e)](a['SetPivotSortCommand']['id'],_0x432a72);}async[_0x742a36(0x180)](_0x133644,_0x5ae4c5,_0xd12a53){const _0x3dcc69=_0x742a36,_0x2fd14a=this[_0x3dcc69(0x172)],_0x2a2fc7=this['unitId'],_0x170cdb=this[_0x3dcc69(0x173)],_0x40c85c=this[_0x3dcc69(0x185)],_0x3faa5f=_0x2fd14a['get'](r[_0x3dcc69(0x162)]),_0x2fa23a={'unitId':_0x2a2fc7,'subUnitId':_0x170cdb,'pivotTableId':_0x40c85c,'tableFieldId':_0x133644,'items':_0x5ae4c5,'isAll':_0xd12a53};return _0x3faa5f[_0x3dcc69(0x17e)](a['SetPivotFilterCommand']['id'],_0x2fa23a);}async[_0x742a36(0x17f)](_0x343c73,_0x34a7b9){const _0x25f1e4=_0x742a36,_0x428c2f=this[_0x25f1e4(0x172)],_0x14aaf6=this[_0x25f1e4(0x165)],_0x36cfaf=this['subUnitId'],_0x31d4f7=this['pivotTableId'],_0x44e3be=_0x428c2f[_0x25f1e4(0x16e)](r[_0x25f1e4(0x162)]),_0x362106={'unitId':_0x14aaf6,'subUnitId':_0x36cfaf,'pivotTableId':_0x31d4f7,'fieldId':_0x343c73,'name':_0x34a7b9};return _0x44e3be[_0x25f1e4(0x17e)](a[_0x25f1e4(0x183)]['id'],_0x362106);}}class S extends b[_0x742a36(0x166)]{async[_0x742a36(0x18c)](_0x167de3,_0x52d305,_0x2f6789){const _0x221a04=_0x742a36,_0x3c7f86=this['_injector'],_0x5e5837=_0x3c7f86[_0x221a04(0x16e)](r[_0x221a04(0x162)]),_0x17d4bf=P['generateHexNumber'](0x8),_0x1c2bfe={'positionType':_0x52d305,'pivotTableId':_0x17d4bf,'pivotTableConfig':{'targetCellInfo':_0x2f6789,'sourceRangeInfo':_0x167de3,'isEmpty':!0x0}};if(await _0x5e5837[_0x221a04(0x17e)](a[_0x221a04(0x17d)]['id'],_0x1c2bfe))return new I(_0x2f6789[_0x221a04(0x165)],_0x2f6789[_0x221a04(0x173)],_0x17d4bf,_0x3c7f86);}[_0x742a36(0x167)](_0xfc4f7a,_0xad7abd,_0x14df99,_0x5480d8){const _0x1f9a13=_0x742a36,_0x8a4923=this['_injector'],_0x1d9219=_0x8a4923[_0x1f9a13(0x16e)](a[_0x1f9a13(0x178)])[_0x1f9a13(0x16c)](_0xfc4f7a,_0xad7abd,_0x14df99,_0x5480d8);if(_0x1d9219)return new I(_0xfc4f7a,_0xad7abd,_0x1d9219,_0x8a4923);}}b[_0x742a36(0x166)][_0x742a36(0x17c)](S),exports[_0x742a36(0x186)]=I;
|