@univerjs-pro/sheets-pivot 1.1.0 → 1.3.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 (109) hide show
  1. package/lib/cjs/facade.js +1 -1
  2. package/lib/cjs/index.js +1 -1
  3. package/lib/cjs/locale/ar-SA.js +1 -1
  4. package/lib/cjs/locale/ca-ES.js +1 -1
  5. package/lib/cjs/locale/de-DE.js +1 -1
  6. package/lib/cjs/locale/en-US.js +1 -1
  7. package/lib/cjs/locale/es-ES.js +1 -1
  8. package/lib/cjs/locale/fa-IR.js +1 -1
  9. package/lib/cjs/locale/fr-FR.js +1 -1
  10. package/lib/cjs/locale/id-ID.js +1 -1
  11. package/lib/cjs/locale/it-IT.js +1 -1
  12. package/lib/cjs/locale/ja-JP.js +1 -1
  13. package/lib/cjs/locale/ko-KR.js +1 -1
  14. package/lib/cjs/locale/pl-PL.js +1 -1
  15. package/lib/cjs/locale/pt-BR.js +1 -1
  16. package/lib/cjs/locale/ru-RU.js +1 -1
  17. package/lib/cjs/locale/sk-SK.js +1 -1
  18. package/lib/cjs/locale/vi-VN.js +1 -1
  19. package/lib/cjs/locale/zh-CN.js +1 -1
  20. package/lib/cjs/locale/zh-HK.js +1 -1
  21. package/lib/cjs/locale/zh-TW.js +1 -1
  22. package/lib/es/facade.js +1 -1
  23. package/lib/es/index.js +1 -1
  24. package/lib/es/locale/ar-SA.js +1 -1
  25. package/lib/es/locale/ca-ES.js +1 -1
  26. package/lib/es/locale/de-DE.js +1 -1
  27. package/lib/es/locale/en-US.js +1 -1
  28. package/lib/es/locale/es-ES.js +1 -1
  29. package/lib/es/locale/fa-IR.js +1 -1
  30. package/lib/es/locale/fr-FR.js +1 -1
  31. package/lib/es/locale/id-ID.js +1 -1
  32. package/lib/es/locale/it-IT.js +1 -1
  33. package/lib/es/locale/ja-JP.js +1 -1
  34. package/lib/es/locale/ko-KR.js +1 -1
  35. package/lib/es/locale/pl-PL.js +1 -1
  36. package/lib/es/locale/pt-BR.js +1 -1
  37. package/lib/es/locale/ru-RU.js +1 -1
  38. package/lib/es/locale/sk-SK.js +1 -1
  39. package/lib/es/locale/vi-VN.js +1 -1
  40. package/lib/es/locale/zh-CN.js +1 -1
  41. package/lib/es/locale/zh-HK.js +1 -1
  42. package/lib/es/locale/zh-TW.js +1 -1
  43. package/lib/facade.js +1 -1
  44. package/lib/index.js +1 -1
  45. package/lib/locale/ar-SA.js +1 -1
  46. package/lib/locale/ca-ES.js +1 -1
  47. package/lib/locale/de-DE.js +1 -1
  48. package/lib/locale/en-US.js +1 -1
  49. package/lib/locale/es-ES.js +1 -1
  50. package/lib/locale/fa-IR.js +1 -1
  51. package/lib/locale/fr-FR.js +1 -1
  52. package/lib/locale/id-ID.js +1 -1
  53. package/lib/locale/it-IT.js +1 -1
  54. package/lib/locale/ja-JP.js +1 -1
  55. package/lib/locale/ko-KR.js +1 -1
  56. package/lib/locale/pl-PL.js +1 -1
  57. package/lib/locale/pt-BR.js +1 -1
  58. package/lib/locale/ru-RU.js +1 -1
  59. package/lib/locale/sk-SK.js +1 -1
  60. package/lib/locale/vi-VN.js +1 -1
  61. package/lib/locale/zh-CN.js +1 -1
  62. package/lib/locale/zh-HK.js +1 -1
  63. package/lib/locale/zh-TW.js +1 -1
  64. package/lib/types/commands/command/group-command-util.d.ts +12 -0
  65. package/lib/types/commands/command/set-pivot-excel-date-group.command.d.ts +10 -0
  66. package/lib/types/commands/command/set-pivot-filter.command.d.ts +2 -0
  67. package/lib/types/commands/command/set-pivot-manual-groups.command.d.ts +10 -0
  68. package/lib/types/commands/command/set-pivot-number-group.command.d.ts +10 -0
  69. package/lib/types/commands/command/util.d.ts +7 -1
  70. package/lib/types/commands/mutations/pivot-data-communication.mutation.d.ts +3 -1
  71. package/lib/types/config/config.d.ts +2 -2
  72. package/lib/types/const/const.d.ts +9 -2
  73. package/lib/types/const/type.d.ts +92 -1
  74. package/lib/types/controllers/sheets-pivot-ref-range.controller.d.ts +2 -0
  75. package/lib/types/controllers/sheets-pivot-rpc.controller.d.ts +9 -2
  76. package/lib/types/facade/f-enum.d.ts +12 -3
  77. package/lib/types/facade/f-generic-pivot-table.d.ts +2 -1
  78. package/lib/types/facade/f-pivot-table.d.ts +101 -1
  79. package/lib/types/index.d.ts +7 -2
  80. package/lib/types/locale/en-US.d.ts +9 -0
  81. package/lib/types/models/sheets-pivot-config-model.d.ts +55 -9
  82. package/lib/types/models/sheets-pivot-data-field-manager.d.ts +18 -7
  83. package/lib/types/models/sheets-pivot-data-source-model.d.ts +25 -3
  84. package/lib/types/record-filter-bridge.d.ts +9 -0
  85. package/lib/types/services/sheets-pivot-cache.service.d.ts +15 -3
  86. package/lib/types/services/sheets-pivot-table.service.d.ts +7 -0
  87. package/lib/types/util.d.ts +5 -11
  88. package/lib/umd/facade.js +1 -1
  89. package/lib/umd/index.js +1 -1
  90. package/lib/umd/locale/ar-SA.js +1 -1
  91. package/lib/umd/locale/ca-ES.js +1 -1
  92. package/lib/umd/locale/de-DE.js +1 -1
  93. package/lib/umd/locale/en-US.js +1 -1
  94. package/lib/umd/locale/es-ES.js +1 -1
  95. package/lib/umd/locale/fa-IR.js +1 -1
  96. package/lib/umd/locale/fr-FR.js +1 -1
  97. package/lib/umd/locale/id-ID.js +1 -1
  98. package/lib/umd/locale/it-IT.js +1 -1
  99. package/lib/umd/locale/ja-JP.js +1 -1
  100. package/lib/umd/locale/ko-KR.js +1 -1
  101. package/lib/umd/locale/pl-PL.js +1 -1
  102. package/lib/umd/locale/pt-BR.js +1 -1
  103. package/lib/umd/locale/ru-RU.js +1 -1
  104. package/lib/umd/locale/sk-SK.js +1 -1
  105. package/lib/umd/locale/vi-VN.js +1 -1
  106. package/lib/umd/locale/zh-CN.js +1 -1
  107. package/lib/umd/locale/zh-HK.js +1 -1
  108. package/lib/umd/locale/zh-TW.js +1 -1
  109. package/package.json +12 -11
@@ -1 +1 @@
1
- function _0x1759(_0x31c1d4,_0x473f1d){_0x31c1d4=_0x31c1d4-0x65;const _0x7b53ac=_0x7b53();let _0x1759e5=_0x7b53ac[_0x31c1d4];return _0x1759e5;}const _0x26ea74=_0x1759;function _0x7b53(){const _0x18603e=['{0}-{1}-{2}','(空白)','計數項:','母體標準差項:','最小值項:','{0}','{0}\x20{1}','年-季','小時-分鐘','5101yPdzdw','標準差項:','{0}-{1}','6785680QPCbWk','Q{0}','年-月','10654380chYfmd','變異數項:','最大值項:','2943000ccjJie','1274634nNQDcq','12DSIqsV','總和項:','1500114GRUAWt','(其他)','806516XHPIqa','平均值項:','506tETooE','列標籤','{0}-Q{1}'];_0x7b53=function(){return _0x18603e;};return _0x7b53();}(function(_0x38edc5,_0x104d7c){const _0x327d77=_0x1759,_0xfb4c7f=_0x38edc5();while(!![]){try{const _0x7e64d1=parseInt(_0x327d77(0x76))/0x1*(parseInt(_0x327d77(0x6a))/0x2)+-parseInt(_0x327d77(0x81))/0x3*(parseInt(_0x327d77(0x68))/0x4)+-parseInt(_0x327d77(0x79))/0x5+-parseInt(_0x327d77(0x80))/0x6+parseInt(_0x327d77(0x66))/0x7+parseInt(_0x327d77(0x7f))/0x8+parseInt(_0x327d77(0x7c))/0x9;if(_0x7e64d1===_0x104d7c)break;else _0xfb4c7f['push'](_0xfb4c7f['shift']());}catch(_0xbf830){_0xfb4c7f['push'](_0xfb4c7f['shift']());}}}(_0x7b53,0xa620b));const e={'sheets-pivot':{'sheet':'工作表','blankValue':_0x26ea74(0x6e),'otherValue':_0x26ea74(0x67),'columnName':'欄\x20','subTotalText':'小計','grandTotalText':'總計','valueText':'值','rowLabels':_0x26ea74(0x6b),'columnLabels':'欄標籤','averageName':_0x26ea74(0x69),'countName':_0x26ea74(0x6f),'countNumsName':'數值計數項:','maxName':_0x26ea74(0x7e),'minName':_0x26ea74(0x71),'productName':'乘積項:','stdDevName':_0x26ea74(0x77),'stdDevpName':_0x26ea74(0x70),'sumName':_0x26ea74(0x65),'varName':_0x26ea74(0x7d),'varpName':'母體變異數項:','subTotal':'小計','grandTotal':'總計','value':'值','blank':'空白','other':'其他','renderText':{'valueField':'{0}{1}','subtotal':'{0}\x20{1}','grandTotal':_0x26ea74(0x73),'multipleGrandTotal':_0x26ea74(0x72),'subtotalWithValue':_0x26ea74(0x73)},'emptyPivot':{'filter':'篩選','row':'列','column':'欄','values':'值'},'dateGroup':{'year':'年','month':'月','day':'日','date':'日','hour':'小時','minute':'分鐘','hourMinute':_0x26ea74(0x75),'quarter':'季','monthDate':'月-日','yearQuarter':_0x26ea74(0x74),'yearMonth':_0x26ea74(0x7b),'yearMonthDate':'年-月-日'},'cellDateGroupDisplay':{'minute':'{0}','hour':_0x26ea74(0x72),'hourMinute':'{0}:{1}','date':_0x26ea74(0x72),'month':_0x26ea74(0x72),'monthDate':_0x26ea74(0x78),'quarter':_0x26ea74(0x7a),'year':_0x26ea74(0x72),'yearMonth':_0x26ea74(0x78),'yearMonthDate':_0x26ea74(0x6d),'yearQuarter':_0x26ea74(0x6c)}}};export{e as default};
1
+ function _0x3d67(_0x4b438e,_0x506c61){_0x4b438e=_0x4b438e-0x16b;const _0x14cee2=_0x14ce();let _0x3d67ba=_0x14cee2[_0x4b438e];return _0x3d67ba;}const _0x397f8b=_0x3d67;(function(_0x590b1f,_0x5c2fc8){const _0x148a98=_0x3d67,_0x2f58a5=_0x590b1f();while(!![]){try{const _0x684d58=-parseInt(_0x148a98(0x18b))/0x1*(parseInt(_0x148a98(0x18c))/0x2)+-parseInt(_0x148a98(0x17a))/0x3*(parseInt(_0x148a98(0x16b))/0x4)+parseInt(_0x148a98(0x177))/0x5+-parseInt(_0x148a98(0x184))/0x6+-parseInt(_0x148a98(0x188))/0x7+-parseInt(_0x148a98(0x170))/0x8+parseInt(_0x148a98(0x16e))/0x9*(parseInt(_0x148a98(0x18a))/0xa);if(_0x684d58===_0x5c2fc8)break;else _0x2f58a5['push'](_0x2f58a5['shift']());}catch(_0x1890af){_0x2f58a5['push'](_0x2f58a5['shift']());}}}(_0x14ce,0xacbf1));const e={'sheets-pivot':{'sheet':'工作表','blankValue':_0x397f8b(0x178),'otherValue':'(其他)','columnName':'欄\x20','subTotalText':'小計','grandTotalText':'總計','valueText':'值','rowLabels':'列標籤','columnLabels':_0x397f8b(0x16d),'averageName':'平均值項:','countName':_0x397f8b(0x179),'countNumsName':_0x397f8b(0x16f),'maxName':_0x397f8b(0x17e),'minName':'最小值項:','productName':'乘積項:','stdDevName':'標準差項:','stdDevpName':_0x397f8b(0x171),'sumName':_0x397f8b(0x174),'varName':'變異數項:','varpName':_0x397f8b(0x17d),'subTotal':'小計','grandTotal':'總計','value':'值','blank':'空白','other':'其他','renderText':{'valueField':_0x397f8b(0x16c),'subtotal':'{0}\x20{1}','grandTotal':_0x397f8b(0x172),'multipleGrandTotal':_0x397f8b(0x182),'subtotalWithValue':_0x397f8b(0x172)},'emptyPivot':{'filter':'篩選','row':'列','column':'欄','values':'值'},'dateGroup':{'second':'秒','year':'年','month':'月','day':'日','date':'日','hour':'小時','minute':'分鐘','hourMinute':_0x397f8b(0x189),'quarter':'季','monthDate':_0x397f8b(0x175),'yearQuarter':'年-季','yearMonth':_0x397f8b(0x17f),'yearMonthDate':_0x397f8b(0x181)},'numberGroupRange':_0x397f8b(0x185),'numberGroupClosedRange':_0x397f8b(0x183),'numberGroupBefore':_0x397f8b(0x173),'numberGroupAfter':_0x397f8b(0x176),'cellDateGroupDisplay':{'second':_0x397f8b(0x182),'before':'之前','after':'之後','dayRange':_0x397f8b(0x180),'minute':_0x397f8b(0x182),'hour':_0x397f8b(0x182),'hourMinute':_0x397f8b(0x17b),'date':_0x397f8b(0x182),'month':_0x397f8b(0x182),'monthDate':_0x397f8b(0x17c),'quarter':'Q{0}','year':_0x397f8b(0x182),'yearMonth':'{0}-{1}','yearMonthDate':_0x397f8b(0x187),'yearQuarter':_0x397f8b(0x186)}}};function _0x14ce(){const _0x46718b=['年-月','{0}\x20–\x20{1}','年-月-日','{0}','{0}\x20–\x20≤{1}','6882798qDmQvf','{0}\x20–\x20<{1}','{0}-Q{1}','{0}-{1}-{2}','2453598pygNQF','小時-分鐘','10420lPpwEa','3rKZufc','713798zgBUZq','37788JZnQOp','{0}{1}','欄標籤','25938mKIMCu','數值計數項:','1918368EfYSjF','母體標準差項:','{0}\x20{1}','<{0}','總和項:','月-日','>{0}','5255720IFwkXD','(空白)','計數項:','171AQtzio','{0}:{1}','{0}-{1}','母體變異數項:','最大值項:'];_0x14ce=function(){return _0x46718b;};return _0x14ce();}export{e as default};
@@ -1 +1 @@
1
- function _0x21cd(){const _0x14f504=['{0}\x20{1}','271516vxcSxJ','3oLnrNw','列標籤','768620grWGtI','33QExNXv','總和項:','{0}','(空白)','1122669gvItgj','{0}-Q{1}','(其他)','工作表','786180dbZNGr','數值計數項:','7Cwuxce','最大值項:','平均值項:','年-季','20dTccue','欄標籤','年-月','Q{0}','3359632LMxUUL','{0}{1}','435159evXBlz','計數項:','變異數項:','{0}-{1}','{0}:{1}','小時-分鐘','484130yFSIQX','乘積項:'];_0x21cd=function(){return _0x14f504;};return _0x21cd();}const _0x222f70=_0x4dc4;function _0x4dc4(_0x37b4de,_0x1d5bd4){_0x37b4de=_0x37b4de-0x159;const _0x21cdc1=_0x21cd();let _0x4dc4d8=_0x21cdc1[_0x37b4de];return _0x4dc4d8;}(function(_0x1706fb,_0x3e9849){const _0x2059b8=_0x4dc4,_0x229b41=_0x1706fb();while(!![]){try{const _0x15dfbc=-parseInt(_0x2059b8(0x170))/0x1+-parseInt(_0x2059b8(0x179))/0x2+-parseInt(_0x2059b8(0x159))/0x3*(-parseInt(_0x2059b8(0x15b))/0x4)+-parseInt(_0x2059b8(0x16a))/0x5*(-parseInt(_0x2059b8(0x164))/0x6)+-parseInt(_0x2059b8(0x166))/0x7*(-parseInt(_0x2059b8(0x16e))/0x8)+-parseInt(_0x2059b8(0x160))/0x9+parseInt(_0x2059b8(0x176))/0xa*(-parseInt(_0x2059b8(0x15c))/0xb);if(_0x15dfbc===_0x3e9849)break;else _0x229b41['push'](_0x229b41['shift']());}catch(_0xe40732){_0x229b41['push'](_0x229b41['shift']());}}}(_0x21cd,0x481a4));const e={'sheets-pivot':{'sheet':_0x222f70(0x163),'blankValue':_0x222f70(0x15f),'otherValue':_0x222f70(0x162),'columnName':'欄\x20','subTotalText':'小計','grandTotalText':'總計','valueText':'值','rowLabels':_0x222f70(0x15a),'columnLabels':_0x222f70(0x16b),'averageName':_0x222f70(0x168),'countName':_0x222f70(0x171),'countNumsName':_0x222f70(0x165),'maxName':_0x222f70(0x167),'minName':'最小值項:','productName':_0x222f70(0x177),'stdDevName':'標準差項:','stdDevpName':'母體標準差項:','sumName':_0x222f70(0x15d),'varName':_0x222f70(0x172),'varpName':'母體變異數項:','subTotal':'小計','grandTotal':'總計','value':'值','blank':'空白','other':'其他','renderText':{'valueField':_0x222f70(0x16f),'subtotal':_0x222f70(0x178),'grandTotal':_0x222f70(0x178),'multipleGrandTotal':_0x222f70(0x15e),'subtotalWithValue':'{0}\x20{1}'},'emptyPivot':{'filter':'篩選','row':'列','column':'欄','values':'值'},'dateGroup':{'year':'年','month':'月','day':'日','date':'日','hour':'小時','minute':'分鐘','hourMinute':_0x222f70(0x175),'quarter':'季','monthDate':'月-日','yearQuarter':_0x222f70(0x169),'yearMonth':_0x222f70(0x16c),'yearMonthDate':'年-月-日'},'cellDateGroupDisplay':{'minute':_0x222f70(0x15e),'hour':_0x222f70(0x15e),'hourMinute':_0x222f70(0x174),'date':'{0}','month':'{0}','monthDate':_0x222f70(0x173),'quarter':_0x222f70(0x16d),'year':_0x222f70(0x15e),'yearMonth':_0x222f70(0x173),'yearMonthDate':'{0}-{1}-{2}','yearQuarter':_0x222f70(0x161)}}};export{e as default};
1
+ const _0x2e0ea1=_0xaa21;(function(_0x4f9d90,_0x33b24c){const _0x5b37e8=_0xaa21,_0x3192a4=_0x4f9d90();while(!![]){try{const _0x5e0482=-parseInt(_0x5b37e8(0x199))/0x1*(-parseInt(_0x5b37e8(0x181))/0x2)+-parseInt(_0x5b37e8(0x196))/0x3+parseInt(_0x5b37e8(0x193))/0x4*(parseInt(_0x5b37e8(0x188))/0x5)+-parseInt(_0x5b37e8(0x177))/0x6*(-parseInt(_0x5b37e8(0x186))/0x7)+parseInt(_0x5b37e8(0x18d))/0x8+parseInt(_0x5b37e8(0x197))/0x9*(-parseInt(_0x5b37e8(0x17e))/0xa)+parseInt(_0x5b37e8(0x180))/0xb*(parseInt(_0x5b37e8(0x194))/0xc);if(_0x5e0482===_0x33b24c)break;else _0x3192a4['push'](_0x3192a4['shift']());}catch(_0x2fe6b2){_0x3192a4['push'](_0x3192a4['shift']());}}}(_0x3d1e,0x417dc));const e={'sheets-pivot':{'sheet':_0x2e0ea1(0x183),'blankValue':_0x2e0ea1(0x182),'otherValue':_0x2e0ea1(0x19b),'columnName':'欄\x20','subTotalText':'小計','grandTotalText':'總計','valueText':'值','rowLabels':_0x2e0ea1(0x185),'columnLabels':_0x2e0ea1(0x178),'averageName':'平均值項:','countName':'計數項:','countNumsName':_0x2e0ea1(0x18c),'maxName':'最大值項:','minName':'最小值項:','productName':_0x2e0ea1(0x18b),'stdDevName':_0x2e0ea1(0x198),'stdDevpName':_0x2e0ea1(0x192),'sumName':_0x2e0ea1(0x190),'varName':_0x2e0ea1(0x17a),'varpName':'母體變異數項:','subTotal':'小計','grandTotal':'總計','value':'值','blank':'空白','other':'其他','renderText':{'valueField':'{0}{1}','subtotal':_0x2e0ea1(0x18e),'grandTotal':_0x2e0ea1(0x18e),'multipleGrandTotal':'{0}','subtotalWithValue':_0x2e0ea1(0x18e)},'emptyPivot':{'filter':'篩選','row':'列','column':'欄','values':'值'},'dateGroup':{'second':'秒','year':'年','month':'月','day':'日','date':'日','hour':'小時','minute':'分鐘','hourMinute':_0x2e0ea1(0x195),'quarter':'季','monthDate':_0x2e0ea1(0x17f),'yearQuarter':_0x2e0ea1(0x189),'yearMonth':_0x2e0ea1(0x18a),'yearMonthDate':_0x2e0ea1(0x179)},'numberGroupRange':_0x2e0ea1(0x187),'numberGroupClosedRange':_0x2e0ea1(0x17b),'numberGroupBefore':_0x2e0ea1(0x19a),'numberGroupAfter':_0x2e0ea1(0x17c),'cellDateGroupDisplay':{'second':'{0}','before':'之前','after':'之後','dayRange':_0x2e0ea1(0x184),'minute':'{0}','hour':_0x2e0ea1(0x176),'hourMinute':_0x2e0ea1(0x191),'date':'{0}','month':_0x2e0ea1(0x176),'monthDate':_0x2e0ea1(0x17d),'quarter':_0x2e0ea1(0x18f),'year':'{0}','yearMonth':_0x2e0ea1(0x17d),'yearMonthDate':'{0}-{1}-{2}','yearQuarter':'{0}-Q{1}'}}};function _0xaa21(_0x4d80a2,_0x273295){_0x4d80a2=_0x4d80a2-0x176;const _0x3d1e82=_0x3d1e();let _0xaa2126=_0x3d1e82[_0x4d80a2];return _0xaa2126;}function _0x3d1e(){const _0x275aa0=['{0}\x20{1}','Q{0}','總和項:','{0}:{1}','母體標準差項:','340ipqotX','108EaafDl','小時-分鐘','1102383rtPuNt','4692078godNtp','標準差項:','8725yjKDkN','<{0}','(其他)','{0}','6WNIOWW','欄標籤','年-月-日','變異數項:','{0}\x20–\x20≤{1}','>{0}','{0}-{1}','10uAIiDi','月-日','148126revKiF','82wVFfAw','(空白)','工作表','{0}\x20–\x20{1}','列標籤','536627CiQqTD','{0}\x20–\x20<{1}','28645QtQOrS','年-季','年-月','乘積項:','數值計數項:','916080LKFvYi'];_0x3d1e=function(){return _0x275aa0;};return _0x3d1e();}export{e as default};
@@ -0,0 +1,12 @@
1
+ import type { IFieldsCollectionJSON } from '@univerjs-pro/engine-pivot';
2
+ import type { IAccessor } from '@univerjs/core';
3
+ import type { IPivotDisplayBaseInfo, IPivotTableConfig } from '../../const/type';
4
+ interface IGroupCommandContext {
5
+ unitId: string;
6
+ subUnitId: string;
7
+ pivotTableId: string;
8
+ currentConfig: IPivotTableConfig;
9
+ currentCollection: IFieldsCollectionJSON;
10
+ }
11
+ export declare function applyPivotGroupPreview(accessor: IAccessor, context: IGroupCommandContext, preview: IPivotDisplayBaseInfo): Promise<boolean>;
12
+ export {};
@@ -0,0 +1,10 @@
1
+ import type { IExcelDateGrouping } from '@univerjs-pro/engine-pivot';
2
+ import type { ICommand } from '@univerjs/core';
3
+ export interface ISetPivotExcelDateGroupCommandParams {
4
+ unitId: string;
5
+ subUnitId: string;
6
+ pivotTableId: string;
7
+ tableFieldId: string;
8
+ grouping: IExcelDateGrouping;
9
+ }
10
+ export declare const SetPivotExcelDateGroupCommand: ICommand<ISetPivotExcelDateGroupCommandParams>;
@@ -20,6 +20,8 @@ export interface ISetPivotFilterCommandParams {
20
20
  * @property {string[]} items The items to set the filter. Those items will be checked in the pivot table.
21
21
  */
22
22
  items: string[];
23
+ /** Aggregate Pivot items that contain both selected and unselected typed source values. */
24
+ partialItems?: string[];
23
25
  /**
24
26
  * @property {boolean} isAll The flag to set all items. True means all items, false means only the items in the items array.
25
27
  */
@@ -0,0 +1,10 @@
1
+ import type { IManualGroup } from '@univerjs-pro/engine-pivot';
2
+ import type { ICommand } from '@univerjs/core';
3
+ export interface ISetPivotManualGroupsCommandParams {
4
+ unitId: string;
5
+ subUnitId: string;
6
+ pivotTableId: string;
7
+ sourceFieldId: string;
8
+ groups: IManualGroup[];
9
+ }
10
+ export declare const SetPivotManualGroupsCommand: ICommand<ISetPivotManualGroupsCommandParams>;
@@ -0,0 +1,10 @@
1
+ import type { INumberGrouping } from '@univerjs-pro/engine-pivot';
2
+ import type { ICommand } from '@univerjs/core';
3
+ export interface ISetPivotNumberGroupCommandParams {
4
+ unitId: string;
5
+ subUnitId: string;
6
+ pivotTableId: string;
7
+ tableFieldId: string;
8
+ grouping: INumberGrouping;
9
+ }
10
+ export declare const SetPivotNumberGroupCommand: ICommand<ISetPivotNumberGroupCommandParams>;
@@ -1,6 +1,12 @@
1
1
  import type { IPivotTableChangeSet } from '@univerjs-pro/engine-pivot';
2
- import type { IAccessor, ICommandService, IMutationInfo } from '@univerjs/core';
2
+ import type { IAccessor, ICommandInfo, ICommandService, IMutationInfo } from '@univerjs/core';
3
3
  import type { IPivotPerformCheckParams } from '../../const/type';
4
+ export interface IMutationPairGroup {
5
+ redos: ICommandInfo[];
6
+ undos: ICommandInfo[];
7
+ reverse: boolean;
8
+ }
9
+ export declare function executeWithRollback(groups: IMutationPairGroup[], commandService: ICommandService): boolean;
4
10
  interface IPivotHostInfo {
5
11
  pivotTableId: string;
6
12
  unitId: string;
@@ -1,5 +1,7 @@
1
1
  import type { IMutation } from '@univerjs/core';
2
- import type { IGetPivotDataLocalMutationParams, ISendInitPivotTextLocalMutationParams, ISendPivotConfigLocalMutationParams, ISendPivotDataLocalMutationParams, ISendPivotViewLocalMutationParams } from '../../const/type';
2
+ import type { IGetPivotDataLocalMutationParams, IInitializePivotRuntimeParams, IPivotRuntimeInitializedParams, ISendInitPivotTextLocalMutationParams, ISendPivotConfigLocalMutationParams, ISendPivotDataLocalMutationParams, ISendPivotViewLocalMutationParams } from '../../const/type';
3
+ export declare const InitializePivotRuntimeLocalMutation: IMutation<IInitializePivotRuntimeParams>;
4
+ export declare const PivotRuntimeInitializedLocalMutation: IMutation<IPivotRuntimeInitializedParams>;
3
5
  export declare const GetPivotDataLocalMutation: IMutation<IGetPivotDataLocalMutationParams>;
4
6
  export declare const SendPivotDataLocalMutation: IMutation<ISendPivotDataLocalMutationParams>;
5
7
  export declare const SendPivotViewLocalMutation: IMutation<ISendPivotViewLocalMutationParams>;
@@ -1,4 +1,4 @@
1
- import { PivotDateGroupFieldDateSystemEnum } from '@univerjs-pro/engine-pivot';
1
+ import { DateSystem } from '@univerjs/core';
2
2
  export declare const SHEETS_PIVOT_PLUGIN_CONFIG_KEY = "sheets-pivot.config";
3
3
  export declare const configSymbol: unique symbol;
4
4
  export interface IUniverSheetsPivotConfig {
@@ -16,6 +16,6 @@ export interface IUniverSheetsPivotConfig {
16
16
  /**
17
17
  * Define the date system used for pivot date grouping calculations. The default value is Date1900.
18
18
  */
19
- dateSystem?: PivotDateGroupFieldDateSystemEnum;
19
+ dateSystem?: DateSystem;
20
20
  }
21
21
  export declare const defaultPluginConfig: IUniverSheetsPivotConfig;
@@ -1,4 +1,4 @@
1
- import type { IPivotViewCellData, IPivotViewValueType, PivotView, PivotViewItem } from '@univerjs-pro/engine-pivot';
1
+ import type { IPivotTableDateGroupInfo, IPivotTableNumberGroupInfo, IPivotViewCellData, IPivotViewValueType, PivotView, PivotViewItem } from '@univerjs-pro/engine-pivot';
2
2
  import type { Injector, IRange } from '@univerjs/core';
3
3
  import type enUS from '../locale/en-US';
4
4
  import type { IAdjustPivotTableRes, IPivotTableConfig, IThemeStyle } from './type';
@@ -60,6 +60,8 @@ export declare const defaultEmptyPivotDataCellStyle: {
60
60
  };
61
61
  export declare const defaultThemeStyle: IThemeStyle;
62
62
  export declare function getDateGroupDisplayArgs(dateType: PivotDateGroupFieldDateTypeEnum, dateStr: string): string[] | undefined;
63
+ export declare function getExcelDateGroupStr(injector: Injector, group: IPivotTableDateGroupInfo, key: number, dateSystem: DateSystem): string;
64
+ export declare function getNumberGroupStr(injector: Injector, group: IPivotTableNumberGroupInfo, key: number | string): string;
63
65
  export declare const generatorAdjustPositionData: (injector: Injector, data: PivotView, pivotTableConfig: IPivotTableConfig, textInfo: Record<string, string>, direction?: "ltr" | "rtl", dateSystem?: DateSystem) => IAdjustPivotTableRes;
64
66
  export declare function transFromCellValue(cellData: IPivotViewCellData, isValue: boolean, format: string | undefined, textInfo: Record<string, string>, multipleGrandTotalLabel?: string, subtotalLabel?: string, dateSystem?: DateSystem): IPivotViewValueType;
65
67
  export declare function formatPivotRenderText(textInfo: Record<string, string>, templateKey: string, fallbackTemplate: string, ...args: unknown[]): string;
@@ -90,7 +92,12 @@ export declare enum PivotDisplayDataType {
90
92
  ResetPivotTable = "resetPivotTable",
91
93
  SetOption = "setOption",
92
94
  SetPivotLayout = "setPivotLayout",
93
- SetPivotDateGroup = "setPivotDateGroup"
95
+ SetPivotDateGroup = "setPivotDateGroup",
96
+ SetPivotExcelDateGroup = "setPivotExcelDateGroup",
97
+ SetPivotNumberGroup = "setPivotNumberGroup",
98
+ SetPivotManualGroups = "setPivotManualGroups",
99
+ ManualGroupMembers = "manualGroupMembers",
100
+ NumberGroupDefaults = "numberGroupDefaults"
94
101
  }
95
102
  export declare const defaultTextInfo: {
96
103
  'sheets-pivot.blankValue': string;
@@ -1,4 +1,4 @@
1
- import type { DataField, FieldsCollection, IBaseGroupFieldJSON, IDataFieldManagerBaseJSON, IFieldsCollectionJSON, ILabelViewHeaderMapItem, IPivotTableChangeSet, IPivotTableFilterInfo, IPivotTableLabelFieldJSON, IPivotTableOptions, IPivotTableShowDataAsInfo, IPivotTableSnapshot, IPivotTableSortInfo, IPivotTableValueFieldJSON, IPivotTableValueFilter, IPivotViewInfo, IPivotViewJSON, IPivotViewValueType, PivotCellStyleTypeEnum, PivotDataFieldDataTypeEnum, PivotDateGroupFieldDateTypeEnum, PivotLayoutTypeEnum, PivotSubtotalTypeEnum, PivotTableChangeTypeEnum, PivotTableFiledAreaEnum, PivotTableValuePositionEnum, PivotView } from '@univerjs-pro/engine-pivot';
1
+ import type { DataField, FieldsCollection, IBaseGroupFieldJSON, IDataFieldManagerBaseJSON, IExcelDateGrouping, IFieldsCollectionJSON, ILabelViewHeaderMapItem, IManualGroup, INumberGrouping, IPivotTableChangeSet, IPivotTableFilterInfo, IPivotTableLabelFieldJSON, IPivotTableOptions, IPivotTableShowDataAsInfo, IPivotTableSnapshot, IPivotTableSortInfo, IPivotTableValueFieldJSON, IPivotTableValueFilter, IPivotViewInfo, IPivotViewJSON, IPivotViewValueType, PivotCellStyleTypeEnum, PivotDataFieldDataTypeEnum, PivotDateGroupFieldDateTypeEnum, PivotLayoutTypeEnum, PivotSubtotalTypeEnum, PivotTableChangeTypeEnum, PivotTableFiledAreaEnum, PivotTableValuePositionEnum, PivotView } from '@univerjs-pro/engine-pivot';
2
2
  import type { CellValueType, ICellData, IRange, IStyleData, IUndoRedoCommandInfosByInterceptor, IUnitRangeName, Nullable, ObjectMatrix } from '@univerjs/core';
3
3
  import type { PivotDisplayDataType, PositionType } from './const';
4
4
  export interface IPivotPerformCheckParams {
@@ -6,8 +6,28 @@ export interface IPivotPerformCheckParams {
6
6
  view: PivotView;
7
7
  isEmpty: boolean;
8
8
  }
9
+ export interface IPivotManualFilterCoordinationParams {
10
+ unitId: string;
11
+ subUnitId: string;
12
+ pivotTableId: string;
13
+ tableFieldId: string;
14
+ items: string[];
15
+ partialItems?: string[];
16
+ isAll?: boolean;
17
+ }
18
+ export interface IPivotManualFilterCoordinationResult {
19
+ handled: boolean;
20
+ result: boolean;
21
+ }
9
22
  export declare const PIVOT_PERFORM_CHECK: import("@univerjs/core").IAsyncInterceptor<boolean, IPivotPerformCheckParams>;
23
+ export declare const PIVOT_MANUAL_FILTER_COORDINATION: import("@univerjs/core").IAsyncInterceptor<IPivotManualFilterCoordinationResult, IPivotManualFilterCoordinationParams>;
10
24
  export declare const PIVOT_MUTATION_GENERATE: import("@univerjs/core").IInterceptor<IUndoRedoCommandInfosByInterceptor, IPivotPerformCheckParams>;
25
+ export declare const PIVOT_FIELD_REMOVE_COORDINATION: import("@univerjs/core").IInterceptor<string[], {
26
+ unitId: string;
27
+ subUnitId: string;
28
+ pivotTableId: string;
29
+ fieldIds: string[];
30
+ }>;
11
31
  export interface IPivotTableConfigChangeInfo {
12
32
  unitId: string;
13
33
  subUnitId: string;
@@ -27,6 +47,11 @@ export interface IPivotReportScope {
27
47
  unitId: string;
28
48
  subUnitId: string;
29
49
  }
50
+ export interface IPivotCollectionChange {
51
+ /** Workbook owning the source collections, which can differ from the report's target workbook. */
52
+ unitId: string;
53
+ pivotTableIds: readonly string[];
54
+ }
30
55
  export interface ICollectionChangeInfo {
31
56
  token: string;
32
57
  type: CollectionChangeEnum;
@@ -42,6 +67,7 @@ export interface IAddPivotTableParams {
42
67
  export interface IUpdatePivotTableSourceRangeMutationParams {
43
68
  pivotTableId: string;
44
69
  pivotCacheId?: string;
70
+ preserveCacheId?: boolean;
45
71
  deleteIds: string[];
46
72
  collectionJSON: IFieldsCollectionJSON;
47
73
  dataRangeInfo: IUnitRangeNameWithSubUnitId;
@@ -109,6 +135,8 @@ export interface ISetPivotOptionMutationParams {
109
135
  subUnitId: string;
110
136
  pivotTableId: string;
111
137
  options: IPivotTableOptions;
138
+ /** Changeset options are complete snapshots; direct mutation callers still apply patches. */
139
+ replace?: boolean;
112
140
  }
113
141
  export interface ISetPivotLayoutMutationParams {
114
142
  unitId: string;
@@ -210,6 +238,8 @@ export interface IPivotCellPositionInfo {
210
238
  sheetName?: string;
211
239
  }
212
240
  export interface IPivotTableConfig {
241
+ /** User-facing report name. Missing legacy values are normalized to an empty string. */
242
+ name?: string;
213
243
  targetCellInfo: IPivotCellPositionInfo;
214
244
  sourceRangeInfo: IUnitRangeNameWithSubUnitId;
215
245
  pivotCacheId?: string;
@@ -269,6 +299,7 @@ export interface IDataFieldManagerJSON extends IDataFieldManagerBaseJSON {
269
299
  export interface ISheetsPivotCacheSnapshot {
270
300
  pivotCacheId: string;
271
301
  sourceRangeInfo: IUnitRangeNameWithSubUnitId;
302
+ retainedSource?: boolean;
272
303
  }
273
304
  export interface IPivotTableJson {
274
305
  dataFieldManagerConfig: Record<string, IDataFieldManagerJSON>;
@@ -359,6 +390,9 @@ export interface IPivotDisplayFilterInfo {
359
390
  pivotTableId: string;
360
391
  items: string[];
361
392
  itemTypes: PivotDataFieldDataTypeEnum[];
393
+ itemLabels?: Record<string, string>;
394
+ checkedItems?: string[];
395
+ partialItems?: string[];
362
396
  filterInfo: IPivotTableFilterInfo | undefined;
363
397
  sortInfo: IPivotTableSortInfo | undefined;
364
398
  format: string | undefined;
@@ -389,6 +423,7 @@ export interface IGetMovePivotFieldDataParams {
389
423
  }
390
424
  export interface IGetRemovePivotFieldDataParams {
391
425
  fieldIds: string[];
426
+ retainFilterFieldIds?: string[];
392
427
  }
393
428
  export type IGetPivotCollapseDataParams = {
394
429
  tableFieldId: string;
@@ -405,6 +440,7 @@ export type IGetPivotCollapseDataParams = {
405
440
  export interface IGetPivotFilterDataParams {
406
441
  tableFieldId: string;
407
442
  items: string[];
443
+ partialItems?: string[];
408
444
  isAll?: boolean;
409
445
  }
410
446
  export interface IGetPivotValueFilterDataParams {
@@ -435,6 +471,18 @@ export interface IGetPivotDateGroupParams {
435
471
  tableFieldId: string;
436
472
  dateType: PivotDateGroupFieldDateTypeEnum;
437
473
  }
474
+ export interface IGetPivotExcelDateGroupParams {
475
+ tableFieldId: string;
476
+ grouping: IExcelDateGrouping;
477
+ }
478
+ export interface IGetPivotNumberGroupParams {
479
+ tableFieldId: string;
480
+ grouping: INumberGrouping;
481
+ }
482
+ export interface IGetPivotManualGroupsParams {
483
+ sourceFieldId: string;
484
+ groups: IManualGroup[];
485
+ }
438
486
  export interface IGetPivotDrillDownDataParams {
439
487
  tuple: string[][];
440
488
  }
@@ -478,6 +526,20 @@ export interface IGetPivotDataLocalMutationParams extends IPivotLocalMutationBas
478
526
  setOptions?: IGetPivotOptionParams;
479
527
  setPivotLayout?: IGetPivotLayoutParams;
480
528
  setPivotDateGroup?: IGetPivotDateGroupParams;
529
+ setPivotExcelDateGroup?: IGetPivotExcelDateGroupParams;
530
+ setPivotNumberGroup?: IGetPivotNumberGroupParams;
531
+ setPivotManualGroups?: IGetPivotManualGroupsParams;
532
+ manualGroupMembers?: {
533
+ sourceFieldId: string;
534
+ paths: Array<{
535
+ path: string;
536
+ memberKey?: string;
537
+ tupleKey?: string;
538
+ }>;
539
+ };
540
+ numberGroupDefaults?: {
541
+ tableFieldId: string;
542
+ };
481
543
  };
482
544
  }
483
545
  export interface IPivotDisplayResult {
@@ -503,8 +565,17 @@ export interface IPivotDisplayResult {
503
565
  setPivotOption?: IPivotDisplayBaseInfo;
504
566
  setPivotLayout?: IPivotDisplayBaseInfo;
505
567
  setPivotDateGroup?: IPivotDisplayBaseInfo;
568
+ setPivotExcelDateGroup?: IPivotDisplayBaseInfo;
569
+ setPivotNumberGroup?: IPivotDisplayBaseInfo;
570
+ setPivotManualGroups?: IPivotDisplayBaseInfo;
571
+ manualGroupMembers?: {
572
+ members: IManualGroup['members'];
573
+ error?: 'invalidSelection' | 'ambiguousMember';
574
+ };
575
+ numberGroupDefaults?: INumberGrouping;
506
576
  }
507
577
  export interface IPivotUpdatePivotSourceInfo {
578
+ pivotCacheId: string;
508
579
  view: IPivotViewJSON;
509
580
  changesets: IPivotTableChangeSet[];
510
581
  isEmpty: boolean;
@@ -512,8 +583,10 @@ export interface IPivotUpdatePivotSourceInfo {
512
583
  collectionConfig: IFieldsCollectionJSON;
513
584
  oldCollectionConfig: IFieldsCollectionJSON;
514
585
  deleteIds?: string[];
586
+ createdFieldIds: string[];
515
587
  }
516
588
  export interface IPivotAddPivotTableInfo {
589
+ pivotCacheId: string;
517
590
  view: IPivotViewJSON;
518
591
  isEmpty: boolean;
519
592
  fieldsConfig: IPivotTableSnapshot;
@@ -532,29 +605,45 @@ export interface IPivotDisplayBaseInfo {
532
605
  isEmpty: boolean;
533
606
  pivotTableConfig: IPivotTableConfig;
534
607
  shouldBeAddedGroupJSON?: IBaseGroupFieldJSON;
608
+ addedGroupJSON?: IBaseGroupFieldJSON[];
609
+ removedGroupJSON?: IBaseGroupFieldJSON[];
535
610
  }
536
611
  export interface ISendPivotViewItemLocalParams extends IPivotLocalMutationBaseParams {
612
+ runtimeId?: string;
537
613
  view: IPivotViewJSON;
538
614
  pivotConfig: IPivotTableConfig;
539
615
  type: PivotTableOperationEnum;
540
616
  }
541
617
  export interface ISendPivotViewLocalMutationParams {
618
+ runtimeIds?: Record<string, string>;
542
619
  single?: ISendPivotViewItemLocalParams;
543
620
  batch?: ISendPivotViewItemLocalParams[];
544
621
  collectionConfig?: Record<string, IDataFieldManagerJSON>;
622
+ pivotCacheConfigs?: IPivotTableJson['pivotCacheConfigs'];
545
623
  }
546
624
  export interface ISendPivotConfigLocalMutationParams {
625
+ runtimeId?: string;
626
+ runtimeIds?: Record<string, string>;
547
627
  unitId: string;
548
628
  subUnitId: string;
549
629
  oldSubUnitId: string;
550
630
  pivotTableId: string;
551
631
  pivotTableConfig: IPivotTableConfig;
552
632
  collectionConfig: IDataFieldManagerJSON;
633
+ pivotCacheConfigs?: IPivotTableJson['pivotCacheConfigs'];
553
634
  }
554
635
  export interface ISendInitPivotTextLocalMutationParams {
555
636
  textInfo: Record<string, string>;
556
637
  direction: 'ltr' | 'rtl';
557
638
  }
639
+ export interface IInitializePivotRuntimeParams {
640
+ unitId: string;
641
+ runtimeId: string;
642
+ sequence: number;
643
+ }
644
+ export interface IPivotRuntimeInitializedParams extends IInitializePivotRuntimeParams {
645
+ error?: 'calculation-failed';
646
+ }
558
647
  export interface ISendPivotDataLocalMutationParams extends IPivotLocalMutationBaseParams {
559
648
  version: string;
560
649
  result: IPivotDisplayResult;
@@ -585,6 +674,7 @@ export interface IPivotPanelTableListItemBase {
585
674
  format?: string;
586
675
  subTotalType?: PivotSubtotalTypeEnum;
587
676
  showDataAs?: IPivotTableShowDataAsInfo;
677
+ filterInfo?: IPivotTableFilterInfo;
588
678
  }
589
679
  export interface IPivotPanelSourceList {
590
680
  id: string;
@@ -601,6 +691,7 @@ export interface IPivotPanelDataInfo {
601
691
  columnFields: IPivotPanelTableListItemBase[];
602
692
  valueFields: IPivotPanelTableListItemBase[];
603
693
  filterFields: IPivotPanelTableListItemBase[];
694
+ hiddenFields?: IPivotPanelTableListItemBase[];
604
695
  positionInfo: IPivotTableConfig['targetCellInfo'];
605
696
  }
606
697
  export interface ICurrentDataMatrix {
@@ -14,6 +14,8 @@ export declare class SheetsPivotRefRangeController extends Disposable {
14
14
  private readonly _sheetInterceptorService;
15
15
  disposableCollection: DisposableCollection;
16
16
  constructor(_injector: Injector, _refRangeService: RefRangeService, _commandService: ICommandService, _univerInstanceService: IUniverInstanceService, _sheetsPivotTableConfigModel: SheetsPivotTableConfigModel, _sheetsPivotTableAdaptorModel: SheetsPivotTableAdaptorModel, _sheetInterceptorService: SheetInterceptorService);
17
+ private _getStructureMutations;
18
+ private _getRemovedFieldMutations;
17
19
  private _onRefRangeChange;
18
20
  private _refRangeHandle;
19
21
  getRefRangeMutationsByMoveRange(params: IMoveRangeCommandParams, unitId: string, subUnitId: string): {
@@ -1,4 +1,4 @@
1
- import { Disposable, ICommandService } from '@univerjs/core';
1
+ import { Disposable, ICommandService, IConfigService, IUniverInstanceService } from '@univerjs/core';
2
2
  import { IActiveDirtyManagerService } from '@univerjs/engine-formula';
3
3
  import { SheetsPivotTableConfigModel } from '../models/sheets-pivot-config-model';
4
4
  import { SheetsPivotTableAdaptorModel } from '../models/sheets-pivot-table-adaptor-model';
@@ -9,7 +9,14 @@ export declare class SheetsPivotRPCController extends Disposable {
9
9
  private readonly _sheetsPivotTableAdaptorModel;
10
10
  private readonly _sheetsPivotTableConfigModel;
11
11
  readonly _activeDirtyManagerService: IActiveDirtyManagerService;
12
- constructor(_commandService: ICommandService, _sheetsPivotRpcService: SheetsPivotRPCService, _sheetsPivotTableAdaptorModel: SheetsPivotTableAdaptorModel, _sheetsPivotTableConfigModel: SheetsPivotTableConfigModel, _activeDirtyManagerService: IActiveDirtyManagerService);
12
+ private readonly _configService;
13
+ private readonly _univerInstanceService;
14
+ private readonly _initializations;
15
+ private _runtimeSequence;
16
+ constructor(_commandService: ICommandService, _sheetsPivotRpcService: SheetsPivotRPCService, _sheetsPivotTableAdaptorModel: SheetsPivotTableAdaptorModel, _sheetsPivotTableConfigModel: SheetsPivotTableConfigModel, _activeDirtyManagerService: IActiveDirtyManagerService, _configService: IConfigService, _univerInstanceService: IUniverInstanceService);
17
+ private _initRuntimeLifecycle;
18
+ private _initializeRuntime;
19
+ dispose(): void;
13
20
  private _initDataSendListener;
14
21
  /**
15
22
  * - register dirty service, used to mark the pivot table view dirty
@@ -1,5 +1,6 @@
1
- import { PivotCallbackEnum, PivotCellStyleTypeEnum, PivotDataFieldDataTypeEnum, PivotDataFieldSortOperatorEnum, PivotDataFieldSortTypeEnum, PivotDataFieldTypeEnum, PivotDateGroupFieldDateSystemEnum, PivotDateGroupFieldDateTypeEnum, PivotFilterTypeEnum, PivotLayoutTypeEnum, PivotShowAsBaseItemTypeEnum, PivotShowAsTypeEnum, PivotSubtotalPositionEnum, PivotSubtotalTypeEnum, PivotTableChangeTypeEnum, PivotTableFiledAreaEnum, PivotTableValuePositionEnum, PivotViewCellValueTypeEnum, ST_PivotFilterOperatorEnum } from '@univerjs-pro/engine-pivot';
1
+ import { PivotCallbackEnum, PivotCellStyleTypeEnum, PivotDataFieldDataTypeEnum, PivotDataFieldSortOperatorEnum, PivotDataFieldSortTypeEnum, PivotDataFieldTypeEnum, PivotDateGroupFieldDateTypeEnum, PivotDateGroupingMode, PivotExcelDateGroupUnit, PivotFilterTypeEnum, PivotLayoutTypeEnum, PivotShowAsBaseItemTypeEnum, PivotShowAsTypeEnum, PivotSubtotalPositionEnum, PivotSubtotalTypeEnum, PivotTableChangeTypeEnum, PivotTableFiledAreaEnum, PivotTableValuePositionEnum, PivotViewCellValueTypeEnum, ST_PivotFilterOperatorEnum } from '@univerjs-pro/engine-pivot';
2
2
  import { PositionType } from '@univerjs-pro/sheets-pivot';
3
+ import { DateSystem } from '@univerjs/core';
3
4
  /**
4
5
  * @ignore
5
6
  */
@@ -50,6 +51,14 @@ export interface IFSheetsPivotEnumMixin {
50
51
  * Represents the date type of the pivot date group field. {@link PivotDateGroupFieldDateTypeEnum}
51
52
  */
52
53
  PivotDateGroupFieldDateTypeEnum: typeof PivotDateGroupFieldDateTypeEnum;
54
+ /**
55
+ * Represents the pivot table date grouping mode. {@link PivotDateGroupingMode}
56
+ */
57
+ PivotDateGroupingMode: typeof PivotDateGroupingMode;
58
+ /**
59
+ * Represents a calendar unit for Excel-style date grouping. {@link PivotExcelDateGroupUnit}
60
+ */
61
+ PivotExcelDateGroupUnit: typeof PivotExcelDateGroupUnit;
53
62
  /**
54
63
  * Represents the show-as calculation type of a pivot value field. {@link PivotShowAsTypeEnum}
55
64
  */
@@ -75,9 +84,9 @@ export interface IFSheetsPivotEnumMixin {
75
84
  */
76
85
  PivotDataFieldTypeEnum: typeof PivotDataFieldTypeEnum;
77
86
  /**
78
- * Represents the date system used by pivot date group fields. {@link PivotDateGroupFieldDateSystemEnum}
87
+ * Represents the date system used by pivot date group fields. {@link DateSystem}
79
88
  */
80
- PivotDateGroupFieldDateSystemEnum: typeof PivotDateGroupFieldDateSystemEnum;
89
+ DateSystem: typeof DateSystem;
81
90
  /**
82
91
  * Represents the pivot cell style type generated by the pivot view. {@link PivotCellStyleTypeEnum}
83
92
  */
@@ -1,4 +1,4 @@
1
- import type { IDataFieldValue, IPivotTableOptions, IPivotViewValueType, PivotLayoutTypeEnum, PivotTable, PivotTableLabelField, PivotTableValueField } from '@univerjs-pro/engine-pivot';
1
+ import type { IDataFieldValue, IPivotTableOptions, IPivotTableRecordFilter, IPivotViewValueType, PivotLayoutTypeEnum, PivotTable, PivotTableLabelField, PivotTableValueField } from '@univerjs-pro/engine-pivot';
2
2
  import type { Injector } from '@univerjs/core';
3
3
  import type { IDataFieldDataArray, IDimensionInfo, IFGenericPivotFilterOptions, IPivotTableCubeConfig, IPivotTableValueOptions } from './type';
4
4
  import { DataFieldManager, PivotDataFieldDataTypeEnum, PivotTableFiledAreaEnum } from '@univerjs-pro/engine-pivot';
@@ -286,6 +286,7 @@ export declare class FGenericPivotTable {
286
286
  remove(): void;
287
287
  }
288
288
  export declare class DefaultDataFieldManager extends DataFieldManager {
289
+ compileRecordFilter(filter: IPivotTableRecordFilter): (value: IDataFieldValue) => boolean;
289
290
  getRangeData(data: IDataFieldDataArray): {
290
291
  header: string[];
291
292
  data: IDataFieldValue[][];
@@ -1,4 +1,4 @@
1
- import type { IPivotTableLabelFieldJSON, IPivotTableOptions, IPivotTableShowDataAsInfo, IPivotTableSortInfo, IPivotTableValueFieldJSON, IPivotTableValueFilter, IValueFilterInfoItem, PivotDataFieldDataTypeEnum, PivotDateGroupFieldDateTypeEnum, PivotSubtotalTypeEnum, PivotTableValuePositionEnum } from '@univerjs-pro/engine-pivot';
1
+ import type { IExcelDateGrouping, IManualGroup, INumberGrouping, IPivotTableLabelFieldJSON, IPivotTableOptions, IPivotTableShowDataAsInfo, IPivotTableSortInfo, IPivotTableValueFieldJSON, IPivotTableValueFilter, IValueFilterInfoItem, PivotDataFieldDataTypeEnum, PivotDateGroupFieldDateTypeEnum, PivotDateGroupingMode, PivotSubtotalTypeEnum, PivotTableValuePositionEnum } from '@univerjs-pro/engine-pivot';
2
2
  import type { IPivotTableConfig, IPivotTableMatrixInfo, IUnitRangeNameWithSubUnitId } from '@univerjs-pro/sheets-pivot';
3
3
  import type { Injector, IRange, Nullable } from '@univerjs/core';
4
4
  import { PivotLayoutTypeEnum, PivotTableFiledAreaEnum } from '@univerjs-pro/engine-pivot';
@@ -162,6 +162,21 @@ export declare class FPivotTable extends FBase {
162
162
  * ```
163
163
  */
164
164
  getOptions(): IPivotTableOptions | undefined;
165
+ /**
166
+ * @description Get the effective date grouping mode of the pivot table. The mode defaults to legacy when not configured.
167
+ * @returns {PivotDateGroupingMode|undefined} The date grouping mode, or undefined if the pivot table no longer exists.
168
+ *
169
+ * @example
170
+ * ```ts
171
+ * const fWorkbook = univerAPI.getActiveWorkbook();
172
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
173
+ * if (!fWorksheet) return;
174
+ * const fPivotTable = fWorkbook.getPivotTableByCell(fWorkbook.getId(), fWorksheet.getSheetId(), 0, 8);
175
+ * const mode = fPivotTable?.getDateGroupingMode();
176
+ * console.log(mode === univerAPI.Enum.PivotDateGroupingMode.ExcelLike);
177
+ * ```
178
+ */
179
+ getDateGroupingMode(): PivotDateGroupingMode | undefined;
165
180
  /**
166
181
  * @description Get the pivot table layout type.
167
182
  * @returns {PivotLayoutTypeEnum|undefined} The layout type, or undefined if the pivot table no longer exists.
@@ -236,6 +251,21 @@ export declare class FPivotTable extends FBase {
236
251
  * ```
237
252
  */
238
253
  setOptions(options: IPivotTableOptions): Promise<boolean>;
254
+ /**
255
+ * @description Set the pivot table date grouping mode through the option command. Switching modes clears existing date groups.
256
+ * @param {PivotDateGroupingMode} mode The date grouping mode to set.
257
+ * @returns {Promise<boolean>} Whether the date grouping mode was set successfully.
258
+ *
259
+ * @example
260
+ * ```ts
261
+ * const fWorkbook = univerAPI.getActiveWorkbook();
262
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
263
+ * if (!fWorksheet) return;
264
+ * const fPivotTable = fWorkbook.getPivotTableByCell(fWorkbook.getId(), fWorksheet.getSheetId(), 0, 8);
265
+ * await fPivotTable?.setDateGroupingMode(univerAPI.Enum.PivotDateGroupingMode.ExcelLike);
266
+ * ```
267
+ */
268
+ setDateGroupingMode(mode: PivotDateGroupingMode): Promise<boolean>;
239
269
  /**
240
270
  * @description Set the pivot table layout type through command. It keeps undo/redo, collaboration and render update paths consistent with panel operations.
241
271
  * @param {PivotLayoutTypeEnum} layout The layout type to set.
@@ -904,6 +934,76 @@ export declare class FPivotTable extends FBase {
904
934
  * ```
905
935
  */
906
936
  setDateGroupType(tableFieldId: string, dateType: PivotDateGroupFieldDateTypeEnum): Promise<boolean>;
937
+ /**
938
+ * @description Group a date label field by Excel-style calendar units. The pivot table must use Excel-like date grouping mode.
939
+ * @param {string} tableFieldId The source label field id.
940
+ * @param {IExcelDateGrouping} grouping The date units and range settings.
941
+ * @returns {Promise<boolean>} Whether the date group was set successfully.
942
+ *
943
+ * @example
944
+ * ```ts
945
+ * const fWorkbook = univerAPI.getActiveWorkbook();
946
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
947
+ * if (!fWorksheet) return;
948
+ * const fPivotTable = fWorkbook.getPivotTableByCell(fWorkbook.getId(), fWorksheet.getSheetId(), 0, 8);
949
+ * const rowIds = fPivotTable?.getFieldIdsByArea(univerAPI.Enum.PivotTableFiledAreaEnum.Row);
950
+ * if (rowIds?.length) {
951
+ * await fPivotTable?.setExcelDateGroup(rowIds[0], {
952
+ * units: [univerAPI.Enum.PivotExcelDateGroupUnit.Year, univerAPI.Enum.PivotExcelDateGroupUnit.Month],
953
+ * autoStart: true,
954
+ * autoEnd: true,
955
+ * });
956
+ * }
957
+ * ```
958
+ */
959
+ setExcelDateGroup(tableFieldId: string, grouping: IExcelDateGrouping): Promise<boolean>;
960
+ /**
961
+ * @description Group a numeric label field into intervals.
962
+ * @param {string} tableFieldId The source label field id.
963
+ * @param {INumberGrouping} grouping The numeric range and interval settings.
964
+ * @returns {Promise<boolean>} Whether the number group was set successfully.
965
+ *
966
+ * @example
967
+ * ```ts
968
+ * const fWorkbook = univerAPI.getActiveWorkbook();
969
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
970
+ * if (!fWorksheet) return;
971
+ * const fPivotTable = fWorkbook.getPivotTableByCell(fWorkbook.getId(), fWorksheet.getSheetId(), 0, 8);
972
+ * const rowIds = fPivotTable?.getFieldIdsByArea(univerAPI.Enum.PivotTableFiledAreaEnum.Row);
973
+ * if (rowIds?.length) {
974
+ * await fPivotTable?.setNumberGroup(rowIds[0], { autoStart: true, autoEnd: true, interval: 10 });
975
+ * }
976
+ * ```
977
+ */
978
+ setNumberGroup(tableFieldId: string, grouping: INumberGrouping): Promise<boolean>;
979
+ /**
980
+ * @description Replace the manual member groups of one source field. Pass an empty array to remove all manual groups.
981
+ * Each group keeps its stable `id` when renamed; members retain their value types even when displayed labels match.
982
+ * @param {string} sourceFieldId The original source field id, not the derived group or table field id.
983
+ * @param {IManualGroup[]} groups The complete next set of groups, each with an id, name, and at least two source members.
984
+ * @returns {Promise<boolean>} Whether the manual groups were updated successfully.
985
+ *
986
+ * @example
987
+ * ```ts
988
+ * import { RecordValueType } from '@univerjs/core';
989
+ * const fWorkbook = univerAPI.getActiveWorkbook();
990
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
991
+ * if (!fWorksheet) return;
992
+ * const fPivotTable = fWorkbook.getPivotTableByCell(fWorkbook.getId(), fWorksheet.getSheetId(), 0, 8);
993
+ * const sourceFieldId = fPivotTable?.getSourceFieldsInfo().find((field) => field.name === 'Region')?.id;
994
+ * if (sourceFieldId) {
995
+ * await fPivotTable?.setManualGroups(sourceFieldId, [{
996
+ * id: 'north',
997
+ * name: 'North',
998
+ * members: [
999
+ * { type: RecordValueType.String, value: 'East' },
1000
+ * { type: RecordValueType.String, value: 'West' },
1001
+ * ],
1002
+ * }]);
1003
+ * }
1004
+ * ```
1005
+ */
1006
+ setManualGroups(sourceFieldId: string, groups: IManualGroup[]): Promise<boolean>;
907
1007
  /**
908
1008
  * @description Collapse or expand a pivot table item by the cell position through command.
909
1009
  * @param {number} row - The row index of the pivot item cell.