@univerjs-pro/sheets-pivot 0.4.2 → 0.5.0-alpha.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.
Files changed (77) hide show
  1. package/README.md +13 -15
  2. package/lib/cjs/facade.js +1 -0
  3. package/lib/cjs/index.js +1 -1
  4. package/lib/cjs/locale/en-US.js +1 -0
  5. package/lib/cjs/locale/fa-IR.js +1 -0
  6. package/lib/cjs/locale/ru-RU.js +1 -0
  7. package/lib/cjs/locale/vi-VN.js +1 -0
  8. package/lib/cjs/locale/zh-CN.js +1 -0
  9. package/lib/cjs/locale/zh-TW.js +1 -0
  10. package/lib/es/facade.js +1 -0
  11. package/lib/es/index.js +1 -1
  12. package/lib/es/locale/en-US.js +1 -0
  13. package/lib/es/locale/fa-IR.js +1 -0
  14. package/lib/es/locale/ru-RU.js +1 -0
  15. package/lib/es/locale/vi-VN.js +1 -0
  16. package/lib/es/locale/zh-CN.js +1 -0
  17. package/lib/es/locale/zh-TW.js +1 -0
  18. package/lib/types/index.d.ts +1158 -29
  19. package/lib/umd/facade.js +1 -0
  20. package/lib/umd/index.js +1 -1
  21. package/lib/umd/locale/en-US.js +1 -0
  22. package/lib/umd/locale/fa-IR.js +1 -0
  23. package/lib/umd/locale/ru-RU.js +1 -0
  24. package/lib/umd/locale/vi-VN.js +1 -0
  25. package/lib/umd/locale/zh-CN.js +1 -0
  26. package/lib/umd/locale/zh-TW.js +1 -0
  27. package/package.json +39 -20
  28. package/lib/locale/en-US.json +0 -30
  29. package/lib/locale/fa-IR.json +0 -30
  30. package/lib/locale/ru-RU.json +0 -30
  31. package/lib/locale/vi-VN.json +0 -30
  32. package/lib/locale/zh-CN.json +0 -30
  33. package/lib/locale/zh-TW.json +0 -30
  34. package/lib/types/commands/command/add-pivot-table-with-config.command.d.ts +0 -3
  35. package/lib/types/commands/command/util.d.ts +0 -12
  36. package/lib/types/commands/mutations/add-pivot-field.mutation.d.ts +0 -3
  37. package/lib/types/commands/mutations/add-pivot-table.mutation.d.ts +0 -3
  38. package/lib/types/commands/mutations/change-apply-util.d.ts +0 -15
  39. package/lib/types/commands/mutations/pivot-data-communication.mutation.d.ts +0 -7
  40. package/lib/types/commands/mutations/remove-pivot-field.mutation.d.ts +0 -3
  41. package/lib/types/commands/mutations/remove-pivot-table.mutation.d.ts +0 -3
  42. package/lib/types/commands/mutations/rename-pivot-field.mutation.d.ts +0 -3
  43. package/lib/types/commands/mutations/set-pivot-collapse.mutation.d.ts +0 -3
  44. package/lib/types/commands/mutations/set-pivot-field-format.mutation.d.ts +0 -3
  45. package/lib/types/commands/mutations/set-pivot-filter.mutation.d.ts +0 -3
  46. package/lib/types/commands/mutations/set-pivot-option.mutation.d.ts +0 -3
  47. package/lib/types/commands/mutations/set-pivot-position.mutation.d.ts +0 -3
  48. package/lib/types/commands/mutations/set-pivot-sort.mutation.d.ts +0 -3
  49. package/lib/types/commands/mutations/set-pivot-subtotal-type.mutation.d.ts +0 -3
  50. package/lib/types/commands/mutations/update-field-position.mutation.d.ts +0 -3
  51. package/lib/types/commands/mutations/update-pivot-field-source-info.mutation.d.ts +0 -3
  52. package/lib/types/commands/mutations/update-pivot-table-source.mutation.d.ts +0 -3
  53. package/lib/types/commands/mutations/update-value-position.mutation.d.ts +0 -3
  54. package/lib/types/commands/operations/pivot-table-dirty-view.operation.d.ts +0 -3
  55. package/lib/types/common/const.d.ts +0 -64
  56. package/lib/types/const/const.d.ts +0 -99
  57. package/lib/types/const/template.d.ts +0 -885
  58. package/lib/types/const/type.d.ts +0 -522
  59. package/lib/types/controllers/config.schema.d.ts +0 -6
  60. package/lib/types/controllers/const.d.ts +0 -1
  61. package/lib/types/controllers/sheets-pivot-caculate.controller.d.ts +0 -44
  62. package/lib/types/controllers/sheets-pivot-rpc.controller.d.ts +0 -20
  63. package/lib/types/locale/en-US.d.ts +0 -3
  64. package/lib/types/locale/fa-IR.d.ts +0 -3
  65. package/lib/types/locale/ru-RU.d.ts +0 -3
  66. package/lib/types/locale/vi-VN.d.ts +0 -3
  67. package/lib/types/locale/zh-CN.d.ts +0 -31
  68. package/lib/types/locale/zh-TW.d.ts +0 -3
  69. package/lib/types/models/sheets-pivot-config-model.d.ts +0 -58
  70. package/lib/types/models/sheets-pivot-data-field-manager.d.ts +0 -77
  71. package/lib/types/models/sheets-pivot-data-source-model.d.ts +0 -101
  72. package/lib/types/models/sheets-pivot-table-adaptor-model.d.ts +0 -54
  73. package/lib/types/models/view-util.d.ts +0 -16
  74. package/lib/types/plugin.d.ts +0 -17
  75. package/lib/types/services/sheets-pivot-rpc.service.d.ts +0 -11
  76. package/lib/types/services/sheets-pivot-table.service.d.ts +0 -10
  77. package/lib/types/util.d.ts +0 -52
package/README.md CHANGED
@@ -7,28 +7,26 @@
7
7
 
8
8
  ## Introduction
9
9
 
10
- `@univerjs/sheet-pivot` provides a user interface for filtering in sheets.
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 _0xa1e0be=_0x12f2;function _0x2dd6(){const _0x587e9b=['@univerjs/core','2JCLXfN','SetPivotSubtotalTypeMutation','7713503YAFlth','renameField','RenamePivotFieldMutation','FWorkbook','UpdatePivotValuePositionCommand','toStringTag','6GkaDHZ','symbol','Module','ICommandService','removeField','unitId','SetPivotFilterCommand','1477536JxoFvV','@univerjs-pro/engine-pivot','6515058dAtRKp','getConfig','executeCommand','SheetsPivotTableAdaptorModel','generateHexNumber','MovePivotFieldCommand','8MMrXBc','RemovePivotTableMutation','get','SheetsPivotTableConfigModel','_injector','number','setSubtotalType','getPivotTableConfig','@univerjs-pro/sheets-pivot','166513cEjMEn','setLabelSort','2742970VnCTAk','subUnitId','syncExecuteCommand','AddPivotFieldCommand','6264756HrUqIH','getPivotTableByCell','extend','remove','AddPivotTableCommand','updateFieldPosition','getCollection','1013271JjsCVm','pivotTableId','40dgwEin','addField','fieldIds','defineProperty'];_0x2dd6=function(){return _0x587e9b;};return _0x2dd6();}function _0x12f2(_0x191c49,_0x342fd8){const _0x2dd6d7=_0x2dd6();return _0x12f2=function(_0x12f2d0,_0x1554aa){_0x12f2d0=_0x12f2d0-0xb8;let _0x11dabe=_0x2dd6d7[_0x12f2d0];return _0x11dabe;},_0x12f2(_0x191c49,_0x342fd8);}(function(_0x35dd71,_0x23f67d){const _0x254eb8=_0x12f2,_0x3f2629=_0x35dd71();while(!![]){try{const _0x3b6006=-parseInt(_0x254eb8(0xdb))/0x1*(parseInt(_0x254eb8(0xbb))/0x2)+-parseInt(_0x254eb8(0xe8))/0x3*(-parseInt(_0x254eb8(0xd2))/0x4)+-parseInt(_0x254eb8(0xdd))/0x5+-parseInt(_0x254eb8(0xc3))/0x6*(parseInt(_0x254eb8(0xbd))/0x7)+parseInt(_0x254eb8(0xca))/0x8+-parseInt(_0x254eb8(0xe1))/0x9+parseInt(_0x254eb8(0xea))/0xa*(parseInt(_0x254eb8(0xcc))/0xb);if(_0x3b6006===_0x23f67d)break;else _0x3f2629['push'](_0x3f2629['shift']());}catch(_0x2c28c9){_0x3f2629['push'](_0x3f2629['shift']());}}}(_0x2dd6,0xaeda6));var C=Object[_0xa1e0be(0xb9)],g=(_0x1d9c02,_0x59090d,_0x4983d1)=>_0x59090d in _0x1d9c02?C(_0x1d9c02,_0x59090d,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x4983d1}):_0x1d9c02[_0x59090d]=_0x4983d1,l=(_0x154ffa,_0x2bd761,_0x3a19f6)=>g(_0x154ffa,typeof _0x2bd761!=_0xa1e0be(0xc4)?_0x2bd761+'':_0x2bd761,_0x3a19f6);Object[_0xa1e0be(0xb9)](exports,Symbol[_0xa1e0be(0xc2)],{'value':_0xa1e0be(0xc5)});const r=require(_0xa1e0be(0xba)),b=require('@univerjs/sheets/facade'),P=require(_0xa1e0be(0xcb)),a=require(_0xa1e0be(0xda));class I{constructor(_0x185758,_0x4fe7f5,_0x59ccd4,_0x2c49d9){const _0x47976a=_0xa1e0be;l(this,_0x47976a(0xc8)),l(this,_0x47976a(0xde)),l(this,'pivotTableId'),l(this,_0x47976a(0xd6)),(this[_0x47976a(0xc8)]=_0x185758,this[_0x47976a(0xde)]=_0x4fe7f5,this[_0x47976a(0xe9)]=_0x59ccd4,this[_0x47976a(0xd6)]=_0x2c49d9);}[_0xa1e0be(0xcd)](){const _0x325c19=_0xa1e0be;return this[_0x325c19(0xd6)][_0x325c19(0xd4)](a['SheetsPivotTableConfigModel'])[_0x325c19(0xd9)](this[_0x325c19(0xc8)],this[_0x325c19(0xde)],this['pivotTableId']);}async[_0xa1e0be(0xe4)](){const _0x4e4619=_0xa1e0be;return await this[_0x4e4619(0xd6)][_0x4e4619(0xd4)](r[_0x4e4619(0xc6)])[_0x4e4619(0xdf)](a[_0x4e4619(0xd3)]['id'],{'unitId':this[_0x4e4619(0xc8)],'subUnitId':this[_0x4e4619(0xde)],'pivotTableId':this[_0x4e4619(0xe9)]});}async[_0xa1e0be(0xeb)](_0x3921ce,_0x369ac,_0x1b96e2){const _0x41c551=_0xa1e0be,_0x1b2014=this[_0x41c551(0xd6)],_0x54cebe=this[_0x41c551(0xc8)],_0x357a9b=this[_0x41c551(0xde)],_0x159ecd=this[_0x41c551(0xe9)],_0x1a977c=_0x1b2014['get'](r[_0x41c551(0xc6)]),_0x372025=_0x1b2014['get'](a[_0x41c551(0xd5)]),_0x583cbd=_0x372025[_0x41c551(0xd9)](_0x54cebe,_0x357a9b,_0x159ecd),_0x2bae02=_0x372025[_0x41c551(0xe7)](_0x54cebe,_0x159ecd);if(!_0x583cbd||!_0x2bae02)return!0x1;let _0x3398c6=_0x3921ce;typeof _0x3398c6==_0x41c551(0xd7)&&(_0x3398c6=_0x372025[_0x41c551(0xe7)](_0x54cebe,_0x159ecd)[_0x41c551(0xb8)][_0x3921ce]);const _0x191b96={'unitId':_0x54cebe,'subUnitId':_0x357a9b,'pivotTableId':_0x159ecd,'dataFieldId':_0x3398c6,'fieldArea':_0x369ac,'index':_0x1b96e2};return _0x1a977c['executeCommand'](a[_0x41c551(0xe0)]['id'],_0x191b96);}async[_0xa1e0be(0xc7)](_0x5ab8a1){const _0x48aa20=_0xa1e0be,_0x46e1ca=this[_0x48aa20(0xd6)],_0x233459=this[_0x48aa20(0xc8)],_0x24832b=this[_0x48aa20(0xde)],_0x20ca49=this[_0x48aa20(0xe9)],_0x19f497=_0x46e1ca['get'](r['ICommandService']),_0xb4a156={'unitId':_0x233459,'subUnitId':_0x24832b,'pivotTableId':_0x20ca49,'fieldIds':_0x5ab8a1};return _0x19f497[_0x48aa20(0xce)](a['RemovePivotFieldCommand']['id'],_0xb4a156);}async[_0xa1e0be(0xe6)](_0x1fdb09,_0x23bb1b,_0x4e8a34){const _0x592164=_0xa1e0be,_0x30c697=this[_0x592164(0xd6)],_0x3032a2=this['unitId'],_0x4525a2=this[_0x592164(0xde)],_0x3deac1=this['pivotTableId'],_0x27ed50=_0x30c697['get'](r[_0x592164(0xc6)]),_0x4b22b5={'unitId':_0x3032a2,'subUnitId':_0x4525a2,'pivotTableId':_0x3deac1,'fieldId':_0x1fdb09,'area':_0x23bb1b,'index':_0x4e8a34};return _0x27ed50['executeCommand'](a[_0x592164(0xd1)]['id'],_0x4b22b5);}async['updateValuePosition'](_0x266562,_0xb0ea8a){const _0x2d2b04=_0xa1e0be,_0x50aab3=this['_injector'],_0xab53a1=this[_0x2d2b04(0xc8)],_0x469ff8=this[_0x2d2b04(0xde)],_0x2b2dbb=this['pivotTableId'],_0x306c7c=_0x50aab3[_0x2d2b04(0xd4)](r[_0x2d2b04(0xc6)]),_0x562395={'unitId':_0xab53a1,'subUnitId':_0x469ff8,'pivotTableId':_0x2b2dbb,'position':_0x266562,'index':_0xb0ea8a};return _0x306c7c[_0x2d2b04(0xce)](a[_0x2d2b04(0xc1)]['id'],_0x562395);}async[_0xa1e0be(0xd8)](_0x3f0485,_0x5d4d9f){const _0x5afe64=_0xa1e0be,_0x49a542=this[_0x5afe64(0xd6)],_0x555645=this[_0x5afe64(0xc8)],_0x306628=this['subUnitId'],_0x96e8eb=this[_0x5afe64(0xe9)],_0x269746=_0x49a542[_0x5afe64(0xd4)](r[_0x5afe64(0xc6)]),_0x37d2f1={'unitId':_0x555645,'subUnitId':_0x306628,'pivotTableId':_0x96e8eb,'fieldId':_0x3f0485,'subtotalType':_0x5d4d9f};return _0x269746['executeCommand'](a[_0x5afe64(0xbc)]['id'],_0x37d2f1);}async[_0xa1e0be(0xdc)](_0x4f2ead,_0x55ef66){const _0x3b2dc4=_0xa1e0be,_0x5b473f=this[_0x3b2dc4(0xd6)],_0x5ebc97=this['unitId'],_0x217623=this['subUnitId'],_0x4a821a=this[_0x3b2dc4(0xe9)],_0x53bc56=_0x5b473f[_0x3b2dc4(0xd4)](r['ICommandService']),_0x133634={'unitId':_0x5ebc97,'subUnitId':_0x217623,'tableFieldId':_0x4f2ead,'pivotTableId':_0x4a821a,'info':_0x55ef66};return _0x53bc56[_0x3b2dc4(0xce)](a['SetPivotSortCommand']['id'],_0x133634);}async['setLabelManualFilter'](_0x3a15e8,_0x555677,_0x256b38){const _0x28442f=_0xa1e0be,_0x3abac8=this[_0x28442f(0xd6)],_0x24e922=this['unitId'],_0x5af615=this[_0x28442f(0xde)],_0x528ac8=this[_0x28442f(0xe9)],_0x124cc4=_0x3abac8[_0x28442f(0xd4)](r[_0x28442f(0xc6)]),_0x1e59de={'unitId':_0x24e922,'subUnitId':_0x5af615,'pivotTableId':_0x528ac8,'tableFieldId':_0x3a15e8,'items':_0x555677,'isAll':_0x256b38};return _0x124cc4[_0x28442f(0xce)](a[_0x28442f(0xc9)]['id'],_0x1e59de);}async[_0xa1e0be(0xbe)](_0x469865,_0xa7d097){const _0xdbe481=_0xa1e0be,_0x339701=this[_0xdbe481(0xd6)],_0x56cce0=this[_0xdbe481(0xc8)],_0x301d7d=this[_0xdbe481(0xde)],_0x4699dd=this[_0xdbe481(0xe9)],_0x203b16=_0x339701[_0xdbe481(0xd4)](r[_0xdbe481(0xc6)]),_0xf1f010={'unitId':_0x56cce0,'subUnitId':_0x301d7d,'pivotTableId':_0x4699dd,'fieldId':_0x469865,'name':_0xa7d097};return _0x203b16[_0xdbe481(0xce)](a[_0xdbe481(0xbf)]['id'],_0xf1f010);}}class S extends b[_0xa1e0be(0xc0)]{async['addPivotTable'](_0x7719d1,_0x1834ed,_0x5566d1){const _0x4d1fe7=_0xa1e0be,_0x5c81fe=this[_0x4d1fe7(0xd6)],_0x330034=_0x5c81fe['get'](r[_0x4d1fe7(0xc6)]),_0x288807=P[_0x4d1fe7(0xd0)](0x8),_0x3fcfc5={'positionType':_0x1834ed,'pivotTableId':_0x288807,'pivotTableConfig':{'targetCellInfo':_0x5566d1,'sourceRangeInfo':_0x7719d1,'isEmpty':!0x0}};if(await _0x330034[_0x4d1fe7(0xce)](a[_0x4d1fe7(0xe5)]['id'],_0x3fcfc5))return new I(_0x5566d1['unitId'],_0x5566d1[_0x4d1fe7(0xde)],_0x288807,_0x5c81fe);}[_0xa1e0be(0xe2)](_0x3c3124,_0x28ce0e,_0x44f039,_0x9a3a63){const _0x1fa8cf=_0xa1e0be,_0x1169e4=this['_injector'],_0x2240bd=_0x1169e4[_0x1fa8cf(0xd4)](a[_0x1fa8cf(0xcf)])['getPivotTableIdByCell'](_0x3c3124,_0x28ce0e,_0x44f039,_0x9a3a63);if(_0x2240bd)return new I(_0x3c3124,_0x28ce0e,_0x2240bd,_0x1169e4);}}b[_0xa1e0be(0xc0)][_0xa1e0be(0xe3)](S),exports['FPivotTable']=I;