@univerjs-pro/sheets-pivot 0.4.1 → 0.4.2-nightly.202410301606
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/es/facade.js +1 -0
- package/lib/es/index.js +1 -1
- package/lib/locale/en-US.js +1 -0
- package/lib/locale/fa-IR.js +1 -0
- package/lib/locale/ru-RU.js +1 -0
- package/lib/locale/vi-VN.js +1 -0
- package/lib/locale/zh-CN.js +1 -0
- package/lib/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 +41 -41
- 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 +19 -0
- package/lib/types/controllers/sheets-pivot-permission.controller.d.ts +7 -0
- package/lib/types/controllers/sheets-pivot-ref-range.controller.d.ts +20 -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 +73 -0
- package/lib/types/facade/index.d.ts +1 -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/lib/update-value-position.command-BHkeW7ez.mjs +3114 -0
- package/package.json +23 -21
- package/lib/cjs/index.js +0 -1
- 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
|
```
|
package/lib/es/facade.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const _0x2dde06=_0x5b92;(function(_0x4d6fe2,_0x151681){const _0x37ff54=_0x5b92,_0xe0dd5=_0x4d6fe2();while(!![]){try{const _0x3f1b1c=parseInt(_0x37ff54(0x1c9))/0x1+-parseInt(_0x37ff54(0x1d2))/0x2*(-parseInt(_0x37ff54(0x1d0))/0x3)+parseInt(_0x37ff54(0x1d9))/0x4*(-parseInt(_0x37ff54(0x1c2))/0x5)+-parseInt(_0x37ff54(0x1c3))/0x6*(-parseInt(_0x37ff54(0x1d8))/0x7)+parseInt(_0x37ff54(0x1c1))/0x8+-parseInt(_0x37ff54(0x1d3))/0x9+-parseInt(_0x37ff54(0x1cf))/0xa;if(_0x3f1b1c===_0x151681)break;else _0xe0dd5['push'](_0xe0dd5['shift']());}catch(_0x3d6ca1){_0xe0dd5['push'](_0xe0dd5['shift']());}}}(_0x23f4,0xaa0aa));function _0x23f4(){const _0x385857=['28dNGyPI','163624hWoQgu','addPivotTable','symbol','subUnitId','defineProperty','syncExecuteCommand','get','3506648auUIcV','140dHOqdN','1415706HapZdY','number','pivotTableId','setSubtotalType','unitId','fieldIds','531053NtmiDM','getConfig','renameField','getPivotTableConfig','_injector','getCollection','7929660bSErsT','606SEsWhw','getPivotTableByCell','7784yDuPgq','580932DesphH','addField','executeCommand','removeField','extend'];_0x23f4=function(){return _0x385857;};return _0x23f4();}var g=Object[_0x2dde06(0x1be)],C=(_0x3d31f9,_0x45b7b0,_0x4b8bac)=>_0x45b7b0 in _0x3d31f9?g(_0x3d31f9,_0x45b7b0,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x4b8bac}):_0x3d31f9[_0x45b7b0]=_0x4b8bac,l=(_0x2efe98,_0x1cc073,_0x8c7b05)=>C(_0x2efe98,typeof _0x1cc073!=_0x2dde06(0x1bc)?_0x1cc073+'':_0x1cc073,_0x8c7b05);import{ICommandService as _0xee74ec}from'@univerjs/core';import{FWorkbook as _0x8a2e57}from'@univerjs/sheets/facade';import{generateHexNumber as _0x56fadb}from'@univerjs-pro/engine-pivot';import{c as _0x43d8b6,D as _0x2caf28,y as _0x34dd66,R as _0x49141a,M as _0x188743,U as _0x4801e4,Q as _0x12c086,z as _0x4653e3,B as _0x49d1fd,I as _0x3ee476,x as _0x59e54b,b as _0x3ee004}from'../update-value-position.command-BHkeW7ez.mjs';class I{constructor(_0x5dbbe4,_0x39c9d0,_0x15cfc3,_0x3b5a65){const _0x21720c=_0x2dde06;l(this,_0x21720c(0x1c7)),l(this,_0x21720c(0x1bd)),l(this,_0x21720c(0x1c5)),l(this,'_injector'),(this[_0x21720c(0x1c7)]=_0x5dbbe4,this[_0x21720c(0x1bd)]=_0x39c9d0,this[_0x21720c(0x1c5)]=_0x15cfc3,this[_0x21720c(0x1cd)]=_0x3b5a65);}[_0x2dde06(0x1ca)](){const _0x24968d=_0x2dde06;return this[_0x24968d(0x1cd)][_0x24968d(0x1c0)](_0x43d8b6)['getPivotTableConfig'](this[_0x24968d(0x1c7)],this[_0x24968d(0x1bd)],this[_0x24968d(0x1c5)]);}async['remove'](){const _0x33e41c=_0x2dde06;return await this['_injector']['get'](_0xee74ec)[_0x33e41c(0x1bf)](_0x2caf28['id'],{'unitId':this[_0x33e41c(0x1c7)],'subUnitId':this[_0x33e41c(0x1bd)],'pivotTableId':this[_0x33e41c(0x1c5)]});}async[_0x2dde06(0x1d4)](_0x443633,_0x41db8a,_0x3b7b0e){const _0x132525=_0x2dde06,_0x514507=this[_0x132525(0x1cd)],_0x457230=this['unitId'],_0x4260d4=this[_0x132525(0x1bd)],_0x454d04=this[_0x132525(0x1c5)],_0x315262=_0x514507['get'](_0xee74ec),_0x598e34=_0x514507[_0x132525(0x1c0)](_0x43d8b6),_0x585e1e=_0x598e34[_0x132525(0x1cc)](_0x457230,_0x4260d4,_0x454d04),_0x3a2c9a=_0x598e34[_0x132525(0x1ce)](_0x457230,_0x454d04);if(!_0x585e1e||!_0x3a2c9a)return!0x1;let _0x1a7bfb=_0x443633;typeof _0x1a7bfb==_0x132525(0x1c4)&&(_0x1a7bfb=_0x598e34[_0x132525(0x1ce)](_0x457230,_0x454d04)[_0x132525(0x1c8)][_0x443633]);const _0x280e08={'unitId':_0x457230,'subUnitId':_0x4260d4,'pivotTableId':_0x454d04,'dataFieldId':_0x1a7bfb,'fieldArea':_0x41db8a,'index':_0x3b7b0e};return _0x315262[_0x132525(0x1d5)](_0x34dd66['id'],_0x280e08);}async[_0x2dde06(0x1d6)](_0x333ae4){const _0x1f1244=_0x2dde06,_0x9e42a2=this[_0x1f1244(0x1cd)],_0x2a4de3=this['unitId'],_0x17ef51=this[_0x1f1244(0x1bd)],_0x17b823=this['pivotTableId'],_0x4c05e6=_0x9e42a2[_0x1f1244(0x1c0)](_0xee74ec),_0x21932c={'unitId':_0x2a4de3,'subUnitId':_0x17ef51,'pivotTableId':_0x17b823,'fieldIds':_0x333ae4};return _0x4c05e6['executeCommand'](_0x49141a['id'],_0x21932c);}async['updateFieldPosition'](_0x5ae0de,_0x3b3cd4,_0xb8407c){const _0x3c2e05=_0x2dde06,_0x1a8247=this[_0x3c2e05(0x1cd)],_0x56c38a=this[_0x3c2e05(0x1c7)],_0x1dc7ac=this[_0x3c2e05(0x1bd)],_0x28fa5e=this[_0x3c2e05(0x1c5)],_0x115772=_0x1a8247[_0x3c2e05(0x1c0)](_0xee74ec),_0x50bbfe={'unitId':_0x56c38a,'subUnitId':_0x1dc7ac,'pivotTableId':_0x28fa5e,'fieldId':_0x5ae0de,'area':_0x3b3cd4,'index':_0xb8407c};return _0x115772[_0x3c2e05(0x1d5)](_0x188743['id'],_0x50bbfe);}async['updateValuePosition'](_0x5c4366,_0x5669fc){const _0x2e1874=_0x2dde06,_0x2f4efd=this[_0x2e1874(0x1cd)],_0x5e6efd=this[_0x2e1874(0x1c7)],_0x33b196=this[_0x2e1874(0x1bd)],_0x515a02=this[_0x2e1874(0x1c5)],_0x5dddfa=_0x2f4efd[_0x2e1874(0x1c0)](_0xee74ec),_0x1be4df={'unitId':_0x5e6efd,'subUnitId':_0x33b196,'pivotTableId':_0x515a02,'position':_0x5c4366,'index':_0x5669fc};return _0x5dddfa['executeCommand'](_0x4801e4['id'],_0x1be4df);}async[_0x2dde06(0x1c6)](_0x147640,_0x520917){const _0x6c27dc=_0x2dde06,_0x373538=this[_0x6c27dc(0x1cd)],_0x1c8327=this[_0x6c27dc(0x1c7)],_0x2a47e9=this['subUnitId'],_0x469dc7=this[_0x6c27dc(0x1c5)],_0x5cceec=_0x373538[_0x6c27dc(0x1c0)](_0xee74ec),_0x41aca4={'unitId':_0x1c8327,'subUnitId':_0x2a47e9,'pivotTableId':_0x469dc7,'fieldId':_0x147640,'subtotalType':_0x520917};return _0x5cceec['executeCommand'](_0x12c086['id'],_0x41aca4);}async['setLabelSort'](_0x572b4d,_0x22a5eb){const _0x5531e3=_0x2dde06,_0x404b5b=this[_0x5531e3(0x1cd)],_0x39478b=this[_0x5531e3(0x1c7)],_0x355a1c=this[_0x5531e3(0x1bd)],_0x317a1d=this[_0x5531e3(0x1c5)],_0x233c33=_0x404b5b[_0x5531e3(0x1c0)](_0xee74ec),_0x30906e={'unitId':_0x39478b,'subUnitId':_0x355a1c,'tableFieldId':_0x572b4d,'pivotTableId':_0x317a1d,'info':_0x22a5eb};return _0x233c33[_0x5531e3(0x1d5)](_0x4653e3['id'],_0x30906e);}async['setLabelManualFilter'](_0x41a7e7,_0x42239d,_0x52d716){const _0x5a7f87=_0x2dde06,_0x4e2684=this[_0x5a7f87(0x1cd)],_0x2807dc=this[_0x5a7f87(0x1c7)],_0x69c6f2=this[_0x5a7f87(0x1bd)],_0x573c4f=this[_0x5a7f87(0x1c5)],_0x221274=_0x4e2684[_0x5a7f87(0x1c0)](_0xee74ec),_0x3cd070={'unitId':_0x2807dc,'subUnitId':_0x69c6f2,'pivotTableId':_0x573c4f,'tableFieldId':_0x41a7e7,'items':_0x42239d,'isAll':_0x52d716};return _0x221274[_0x5a7f87(0x1d5)](_0x49d1fd['id'],_0x3cd070);}async[_0x2dde06(0x1cb)](_0x2a69a5,_0xd4024f){const _0x456731=_0x2dde06,_0x2d2bd0=this[_0x456731(0x1cd)],_0x43adca=this[_0x456731(0x1c7)],_0x7ea28e=this[_0x456731(0x1bd)],_0x1b9c06=this[_0x456731(0x1c5)],_0x443238=_0x2d2bd0[_0x456731(0x1c0)](_0xee74ec),_0x1ae29f={'unitId':_0x43adca,'subUnitId':_0x7ea28e,'pivotTableId':_0x1b9c06,'fieldId':_0x2a69a5,'name':_0xd4024f};return _0x443238['executeCommand'](_0x3ee476['id'],_0x1ae29f);}}class k extends _0x8a2e57{async[_0x2dde06(0x1da)](_0x548074,_0x4488f1,_0x73f496){const _0x36ee2e=_0x2dde06,_0x57e552=this[_0x36ee2e(0x1cd)],_0x4c0dcc=_0x57e552['get'](_0xee74ec),_0x554022=_0x56fadb(0x8),_0x3ced5f={'positionType':_0x4488f1,'pivotTableId':_0x554022,'pivotTableConfig':{'targetCellInfo':_0x73f496,'sourceRangeInfo':_0x548074,'isEmpty':!0x0}};if(await _0x4c0dcc[_0x36ee2e(0x1d5)](_0x59e54b['id'],_0x3ced5f))return new I(_0x73f496[_0x36ee2e(0x1c7)],_0x73f496['subUnitId'],_0x554022,_0x57e552);}[_0x2dde06(0x1d1)](_0x5a387c,_0x1e0ad8,_0x2a9715,_0x345f79){const _0x172588=this['_injector'],_0x4b4e79=_0x172588['get'](_0x3ee004)['getPivotTableIdByCell'](_0x5a387c,_0x1e0ad8,_0x2a9715,_0x345f79);if(_0x4b4e79)return new I(_0x5a387c,_0x1e0ad8,_0x4b4e79,_0x172588);}}function _0x5b92(_0x9cd62f,_0x281b19){const _0x23f477=_0x23f4();return _0x5b92=function(_0x5b921e,_0x4b1934){_0x5b921e=_0x5b921e-0x1bc;let _0x526bb1=_0x23f477[_0x5b921e];return _0x526bb1;},_0x5b92(_0x9cd62f,_0x281b19);}_0x8a2e57[_0x2dde06(0x1d7)](k);export{I as FPivotTable};
|