@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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const _0xd2bd87=_0x181b;(function(_0x220795,_0x28a9c7){const _0x784880=_0x181b,_0x3e6796=_0x220795();while(!![]){try{const _0x2a595b=-parseInt(_0x784880(0x1bd))/0x1+-parseInt(_0x784880(0x1b8))/0x2*(parseInt(_0x784880(0x1ac))/0x3)+parseInt(_0x784880(0x1ab))/0x4*(parseInt(_0x784880(0x1a9))/0x5)+parseInt(_0x784880(0x1aa))/0x6+-parseInt(_0x784880(0x1b2))/0x7+-parseInt(_0x784880(0x1b3))/0x8+-parseInt(_0x784880(0x1bb))/0x9*(-parseInt(_0x784880(0x1ba))/0xa);if(_0x2a595b===_0x28a9c7)break;else _0x3e6796['push'](_0x3e6796['shift']());}catch(_0x174668){_0x3e6796['push'](_0x3e6796['shift']());}}}(_0x401e,0x50cc5));const a={'sheets-pivot':{'blankValue':_0xd2bd87(0x1b4),'columnName':_0xd2bd87(0x1ae),'subTotalText':_0xd2bd87(0x1b9),'grandTotalText':_0xd2bd87(0x1be),'valueText':'Value','averageName':_0xd2bd87(0x1b0),'countName':_0xd2bd87(0x1a6),'countNumsName':'Count\x20of\x20','maxName':_0xd2bd87(0x1bc),'minName':_0xd2bd87(0x1b5),'productName':_0xd2bd87(0x1b6),'stdDevName':'StdDev\x20of\x20','stdDevpName':_0xd2bd87(0x1ad),'sumName':_0xd2bd87(0x1a7),'varName':'Var\x20of\x20','varpName':_0xd2bd87(0x1a5),'subTotal':_0xd2bd87(0x1a8),'grandTotal':'Grand\x20Total','value':_0xd2bd87(0x1a4),'blank':_0xd2bd87(0x1b7),'emptyPivot':{'filter':_0xd2bd87(0x1b1),'row':'Row','column':_0xd2bd87(0x1af),'values':'Values'}}};function _0x181b(_0x382f55,_0x392405){const _0x401e6e=_0x401e();return _0x181b=function(_0x181b8a,_0x326ab3){_0x181b8a=_0x181b8a-0x1a4;let _0x409324=_0x401e6e[_0x181b8a];return _0x409324;},_0x181b(_0x382f55,_0x392405);}export{a as default};function _0x401e(){const _0x2efd2d=['Column\x20','Column','Average\x20of\x20','Filter','2658327hPgvRn','1563384tUdrcd','(Blank)','Min\x20of\x20','Product\x20of\x20','blank','2GydUsW','Total','10nfEDhG','7160877RdqyHu','Max\x20of\x20','18704XTqrYi','Grand\x20Total','value','Varp\x20of\x20','Count\x20of\x20','Sum\x20of\x20','Subtotal','5brvUDX','67806qhtIcY','2307088hQDiSB','1376667IlSfkx','StdDevp\x20of\x20'];_0x401e=function(){return _0x2efd2d;};return _0x401e();}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const _0x4546df=_0x21f4;function _0x3beb(){const _0x133287=['10pOBbcI','3628520qtIlvM','تعداد\x20اعداد\x20از\x20','واریانس\x20از\x20','1448097kTiycL','خالی','مقدار','19028ZivZBE','147jfTMdV','واریانس\x20کلی\x20از\x20','7xxTJsP','جمع\x20از\x20','کمترین\x20از\x20','3716256DnTjQU','3372115elmHTh','فیلتر','ضرب\x20از\x20','6164388nXHUjb','مقادیر','(خالی)','344356tvlGhK'];_0x3beb=function(){return _0x133287;};return _0x3beb();}(function(_0x2857b2,_0x49efff){const _0x298dd5=_0x21f4,_0x53c6c3=_0x2857b2();while(!![]){try{const _0x324cee=-parseInt(_0x298dd5(0x1ee))/0x1*(-parseInt(_0x298dd5(0x1e3))/0x2)+parseInt(_0x298dd5(0x1ec))/0x3*(-parseInt(_0x298dd5(0x1eb))/0x4)+-parseInt(_0x298dd5(0x1dd))/0x5+-parseInt(_0x298dd5(0x1dc))/0x6+-parseInt(_0x298dd5(0x1e8))/0x7+parseInt(_0x298dd5(0x1e5))/0x8+-parseInt(_0x298dd5(0x1e0))/0x9*(-parseInt(_0x298dd5(0x1e4))/0xa);if(_0x324cee===_0x49efff)break;else _0x53c6c3['push'](_0x53c6c3['shift']());}catch(_0x3486bd){_0x53c6c3['push'](_0x53c6c3['shift']());}}}(_0x3beb,0x94ebc));function _0x21f4(_0x5e1906,_0x353f65){const _0x3beb56=_0x3beb();return _0x21f4=function(_0x21f41c,_0x2ee7e4){_0x21f41c=_0x21f41c-0x1db;let _0x2c6c79=_0x3beb56[_0x21f41c];return _0x2c6c79;},_0x21f4(_0x5e1906,_0x353f65);}const a={'sheets-pivot':{'blankValue':_0x4546df(0x1e2),'columnName':'ستون\x20','subTotalText':'جمع','grandTotalText':'کل','valueText':_0x4546df(0x1ea),'averageName':'میانگین\x20از\x20','countName':'تعداد\x20از\x20','countNumsName':_0x4546df(0x1e6),'maxName':'بیشترین\x20از\x20','minName':_0x4546df(0x1db),'productName':_0x4546df(0x1df),'stdDevName':'انحراف\x20معیار\x20از\x20','stdDevpName':'انحراف\x20معیار\x20کلی\x20از\x20','sumName':_0x4546df(0x1ef),'varName':_0x4546df(0x1e7),'varpName':_0x4546df(0x1ed),'subTotal':'جمع','grandTotal':'کل','value':'مقدار','blank':_0x4546df(0x1e9),'emptyPivot':{'filter':_0x4546df(0x1de),'row':'سطر','column':'ستون','values':_0x4546df(0x1e1)}}};export{a as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const _0x51dea6=_0xc700;function _0xc700(_0x5330ad,_0x21cb6a){const _0x1590a5=_0x1590();return _0xc700=function(_0xc70050,_0x2c80be){_0xc70050=_0xc70050-0x66;let _0xf2a92=_0x1590a5[_0xc70050];return _0xf2a92;},_0xc700(_0x5330ad,_0x21cb6a);}(function(_0x2b348a,_0x45e5c7){const _0x464af6=_0xc700,_0x338583=_0x2b348a();while(!![]){try{const _0x6c72a4=-parseInt(_0x464af6(0x69))/0x1*(-parseInt(_0x464af6(0x70))/0x2)+parseInt(_0x464af6(0x75))/0x3+-parseInt(_0x464af6(0x79))/0x4+parseInt(_0x464af6(0x6f))/0x5*(-parseInt(_0x464af6(0x68))/0x6)+-parseInt(_0x464af6(0x7b))/0x7+-parseInt(_0x464af6(0x6c))/0x8+parseInt(_0x464af6(0x7a))/0x9*(parseInt(_0x464af6(0x73))/0xa);if(_0x6c72a4===_0x45e5c7)break;else _0x338583['push'](_0x338583['shift']());}catch(_0x17c6a0){_0x338583['push'](_0x338583['shift']());}}}(_0x1590,0x336f8));const a={'sheets-pivot':{'blankValue':_0x51dea6(0x67),'columnName':_0x51dea6(0x78),'subTotalText':_0x51dea6(0x72),'grandTotalText':_0x51dea6(0x7d),'valueText':'Значение','averageName':_0x51dea6(0x71),'countName':'Количество\x20по\x20','countNumsName':_0x51dea6(0x76),'maxName':_0x51dea6(0x6e),'minName':_0x51dea6(0x7c),'productName':'Произведение\x20по\x20','stdDevName':_0x51dea6(0x6d),'stdDevpName':'Общее\x20стандартное\x20отклонение\x20по\x20','sumName':_0x51dea6(0x77),'varName':'Дисперсия\x20по\x20','varpName':_0x51dea6(0x6a),'subTotal':_0x51dea6(0x72),'grandTotal':'Общий\x20итог','value':_0x51dea6(0x74),'blank':_0x51dea6(0x66),'emptyPivot':{'filter':'Фильтр','row':_0x51dea6(0x6b),'column':'Столбец','values':_0x51dea6(0x74)}}};function _0x1590(){const _0x27e894=['8KgKbcj','Среднее\x20по\x20','Промежуточный\x20итог','3282620cAfofz','Значение','346266jEywqW','Число\x20по\x20','Сумма\x20по\x20','Столбец\x20','1442880YqqYXg','18PctFfv','1060668eDHBhD','Минимум\x20по\x20','Общий\x20итог','Пусто','(Пусто)','42138PNllZq','2932gSIMut','Общая\x20дисперсия\x20по\x20','Строка','429816xCSURY','Стандартное\x20отклонение\x20по\x20','Максимум\x20по\x20','5YKqziG'];_0x1590=function(){return _0x27e894;};return _0x1590();}export{a as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function _0x5a69(_0x1d8b01,_0x343bf9){const _0x226d9e=_0x226d();return _0x5a69=function(_0x5a69cd,_0x4574e5){_0x5a69cd=_0x5a69cd-0x138;let _0x57c2ed=_0x226d9e[_0x5a69cd];return _0x57c2ed;},_0x5a69(_0x1d8b01,_0x343bf9);}function _0x226d(){const _0x581724=['1486029KlHxRq','Độ\x20lệch\x20chuẩn\x20toàn\x20phần:','5650950lLkzLZ','4883064JYsGnY','Phương\x20sai:','Tích:','27034909YRkHsi','Tổng\x20phụ','Số\x20lượng:','68xLZwWb','549iOMpTL','Phương\x20sai\x20toàn\x20phần:','50235EGCKgJ','212pEbAMw','21YiAZfu','Tổng:','Cột\x20','Giá\x20trị','Tổng\x20cộng','Hàng','Trống','Giá\x20trị\x20tối\x20thiểu:','51590bcrxbY','Lọc','372755eDZGex','Giá\x20trị\x20trung\x20bình:'];_0x226d=function(){return _0x581724;};return _0x226d();}const _0x2e929a=_0x5a69;(function(_0x263541,_0x45192a){const _0x31844e=_0x5a69,_0x1e0315=_0x263541();while(!![]){try{const _0x5b933d=-parseInt(_0x31844e(0x14c))/0x1+-parseInt(_0x31844e(0x13f))/0x2*(-parseInt(_0x31844e(0x13e))/0x3)+-parseInt(_0x31844e(0x13b))/0x4*(-parseInt(_0x31844e(0x14a))/0x5)+-parseInt(_0x31844e(0x14e))/0x6+parseInt(_0x31844e(0x140))/0x7*(-parseInt(_0x31844e(0x14f))/0x8)+parseInt(_0x31844e(0x13c))/0x9*(-parseInt(_0x31844e(0x148))/0xa)+parseInt(_0x31844e(0x138))/0xb;if(_0x5b933d===_0x45192a)break;else _0x1e0315['push'](_0x1e0315['shift']());}catch(_0x54c80b){_0x1e0315['push'](_0x1e0315['shift']());}}}(_0x226d,0xe2292));const a={'sheets-pivot':{'blankValue':'(Trống)','columnName':_0x2e929a(0x142),'subTotalText':_0x2e929a(0x139),'grandTotalText':_0x2e929a(0x144),'valueText':_0x2e929a(0x143),'averageName':_0x2e929a(0x14b),'countName':_0x2e929a(0x13a),'countNumsName':'Số\x20lượng\x20số:','maxName':'Giá\x20trị\x20tối\x20đa:','minName':_0x2e929a(0x147),'productName':_0x2e929a(0x151),'stdDevName':'Độ\x20lệch\x20chuẩn:','stdDevpName':_0x2e929a(0x14d),'sumName':_0x2e929a(0x141),'varName':_0x2e929a(0x150),'varpName':_0x2e929a(0x13d),'subTotal':_0x2e929a(0x139),'grandTotal':_0x2e929a(0x144),'value':_0x2e929a(0x143),'blank':_0x2e929a(0x146),'emptyPivot':{'filter':_0x2e929a(0x149),'row':_0x2e929a(0x145),'column':'Cột','values':_0x2e929a(0x143)}}};export{a as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const _0x1652c3=_0x4e7b;function _0x4e7b(_0x588b6d,_0x4075ee){const _0x171ea0=_0x171e();return _0x4e7b=function(_0x4e7b01,_0xbe1976){_0x4e7b01=_0x4e7b01-0x1df;let _0x438d27=_0x171ea0[_0x4e7b01];return _0x438d27;},_0x4e7b(_0x588b6d,_0x4075ee);}(function(_0x5bb87c,_0x237d47){const _0xbc06cf=_0x4e7b,_0x3cc11f=_0x5bb87c();while(!![]){try{const _0x2c8f32=parseInt(_0xbc06cf(0x1f3))/0x1+-parseInt(_0xbc06cf(0x1e8))/0x2+-parseInt(_0xbc06cf(0x1e2))/0x3+-parseInt(_0xbc06cf(0x1ee))/0x4*(parseInt(_0xbc06cf(0x1e3))/0x5)+parseInt(_0xbc06cf(0x1e1))/0x6*(parseInt(_0xbc06cf(0x1ef))/0x7)+-parseInt(_0xbc06cf(0x1eb))/0x8*(parseInt(_0xbc06cf(0x1e7))/0x9)+-parseInt(_0xbc06cf(0x1e9))/0xa*(-parseInt(_0xbc06cf(0x1df))/0xb);if(_0x2c8f32===_0x237d47)break;else _0x3cc11f['push'](_0x3cc11f['shift']());}catch(_0x1c7715){_0x3cc11f['push'](_0x3cc11f['shift']());}}}(_0x171e,0xbe224));function _0x171e(){const _0x308565=['252642WEZcbc','297525xBSJJD','计数项:','乘积项:','(空白)','19269cAylfd','2943396ZGkyXM','10KuBUpm','数值计数项:','104TXbngC','总体方差项:','最大值项:','100rlMllh','5240963iIyuFb','方差项:','求和项:','总体标准偏差项:','1380843IqLPUL','18926666crwDfU','标准偏差项:','6eIEoWl'];_0x171e=function(){return _0x308565;};return _0x171e();}const a={'sheets-pivot':{'blankValue':_0x1652c3(0x1e6),'columnName':'列\x20','subTotalText':'汇总','grandTotalText':'总计','valueText':'值','averageName':'平均值项:','countName':_0x1652c3(0x1e4),'countNumsName':_0x1652c3(0x1ea),'maxName':_0x1652c3(0x1ed),'minName':'最小值项:','productName':_0x1652c3(0x1e5),'stdDevName':_0x1652c3(0x1e0),'stdDevpName':_0x1652c3(0x1f2),'sumName':_0x1652c3(0x1f1),'varName':_0x1652c3(0x1f0),'varpName':_0x1652c3(0x1ec),'subTotal':'汇总','grandTotal':'总计','value':'值','blank':'空白','emptyPivot':{'filter':'筛选','row':'行','column':'列','values':'值'}}};export{a as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const _0x4627d2=_0x59dd;(function(_0x4c9eef,_0x1cac23){const _0x2ee13f=_0x59dd,_0x5338ae=_0x4c9eef();while(!![]){try{const _0x199282=-parseInt(_0x2ee13f(0xbd))/0x1*(-parseInt(_0x2ee13f(0xc6))/0x2)+parseInt(_0x2ee13f(0xb3))/0x3+parseInt(_0x2ee13f(0xb8))/0x4*(-parseInt(_0x2ee13f(0xb6))/0x5)+parseInt(_0x2ee13f(0xba))/0x6+parseInt(_0x2ee13f(0xc4))/0x7+-parseInt(_0x2ee13f(0xb1))/0x8*(parseInt(_0x2ee13f(0xc2))/0x9)+-parseInt(_0x2ee13f(0xbf))/0xa*(parseInt(_0x2ee13f(0xb2))/0xb);if(_0x199282===_0x1cac23)break;else _0x5338ae['push'](_0x5338ae['shift']());}catch(_0x4600c3){_0x5338ae['push'](_0x5338ae['shift']());}}}(_0x5155,0x92097));const a={'sheets-pivot':{'blankValue':_0x4627d2(0xc3),'columnName':'欄\x20','subTotalText':'小計','grandTotalText':'總計','valueText':'值','averageName':_0x4627d2(0xc5),'countName':_0x4627d2(0xc1),'countNumsName':_0x4627d2(0xc0),'maxName':_0x4627d2(0xb5),'minName':_0x4627d2(0xb4),'productName':_0x4627d2(0xbe),'stdDevName':_0x4627d2(0xb9),'stdDevpName':'總體標準差項:','sumName':_0x4627d2(0xbc),'varName':_0x4627d2(0xbb),'varpName':_0x4627d2(0xb7),'subTotal':'小計','grandTotal':'總計','value':'值','blank':'空白','emptyPivot':{'filter':'篩選','row':'行','column':'欄','values':'值'}}};export{a as default};function _0x59dd(_0x3a211e,_0x2b11c8){const _0x515528=_0x5155();return _0x59dd=function(_0x59dd4f,_0x2ece40){_0x59dd4f=_0x59dd4f-0xb1;let _0x3d5edf=_0x515528[_0x59dd4f];return _0x3d5edf;},_0x59dd(_0x3a211e,_0x2b11c8);}function _0x5155(){const _0x123149=['170MqaeMQ','數值計數項:','計數項:','9UyTCYJ','(空白)','2160067nXSyXN','平均值項:','1038142GtrFqY','4527728pDRgmn','496199ROWslU','2095413UxVKQu','最小值項:','最大值項:','5Wegjkc','總體方差項:','4429592hoLkGP','標準差項:','5959140xZkZgy','方差項:','求和項:','2hqcGdc','乘積項:'];_0x5155=function(){return _0x123149;};return _0x5155();}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ICommand } from '@univerjs/core';
|
|
2
|
+
import { PivotTableFiledAreaEnum } from '@univerjs-pro/engine-pivot';
|
|
3
|
+
export interface IAddPivotFieldCommandParams {
|
|
4
|
+
unitId: string;
|
|
5
|
+
subUnitId: string;
|
|
6
|
+
pivotTableId: string;
|
|
7
|
+
dataFieldId: string;
|
|
8
|
+
fieldArea: PivotTableFiledAreaEnum;
|
|
9
|
+
index: number;
|
|
10
|
+
}
|
|
11
|
+
export declare const AddPivotFieldCommand: ICommand<IAddPivotFieldCommandParams>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ICommand } from '@univerjs/core';
|
|
2
|
+
import { PositionType } from '../../const/const';
|
|
3
|
+
import { IPivotTableConfig } from '../../const/type';
|
|
4
|
+
export interface IAddPivotTableCommandParams {
|
|
5
|
+
positionType: PositionType;
|
|
6
|
+
pivotTableId?: string;
|
|
7
|
+
pivotTableConfig: Omit<IPivotTableConfig, 'fieldsConfig'>;
|
|
8
|
+
}
|
|
9
|
+
export declare const AddPivotTableCommand: ICommand<IAddPivotTableCommandParams>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ICommand } from '@univerjs/core';
|
|
2
|
+
import { PivotTableFiledAreaEnum } from '@univerjs-pro/engine-pivot';
|
|
3
|
+
export interface IMovePivotFieldCommandParams {
|
|
4
|
+
unitId: string;
|
|
5
|
+
subUnitId: string;
|
|
6
|
+
pivotTableId: string;
|
|
7
|
+
fieldId: string;
|
|
8
|
+
area: PivotTableFiledAreaEnum;
|
|
9
|
+
index: number;
|
|
10
|
+
}
|
|
11
|
+
export declare const MovePivotFieldCommand: ICommand<IMovePivotFieldCommandParams>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ICommand } from '@univerjs/core';
|
|
2
|
+
export interface IRemovePivotFieldCommandParams {
|
|
3
|
+
unitId: string;
|
|
4
|
+
subUnitId: string;
|
|
5
|
+
pivotTableId: string;
|
|
6
|
+
fieldIds: string[];
|
|
7
|
+
}
|
|
8
|
+
export declare const RemovePivotFieldCommand: ICommand<IRemovePivotFieldCommandParams>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ICommand } from '@univerjs/core';
|
|
2
|
+
export interface ISetPivotCollapseCommandParams {
|
|
3
|
+
unitId: string;
|
|
4
|
+
subUnitId: string;
|
|
5
|
+
row: number;
|
|
6
|
+
col: number;
|
|
7
|
+
collapse: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare const SetPivotCollapseCommand: ICommand<ISetPivotCollapseCommandParams>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ICommand } from '@univerjs/core';
|
|
2
|
+
export interface ISetPivotFilterCommandParams {
|
|
3
|
+
unitId: string;
|
|
4
|
+
subUnitId: string;
|
|
5
|
+
pivotTableId: string;
|
|
6
|
+
tableFieldId: string;
|
|
7
|
+
items: string[];
|
|
8
|
+
isAll?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare const SetPivotFilterCommand: ICommand<ISetPivotFilterCommandParams>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ICommand } from '@univerjs/core';
|
|
2
|
+
import { IPivotTableSortInfo } from '@univerjs-pro/engine-pivot';
|
|
3
|
+
export interface ISetPivotSortCommandParams {
|
|
4
|
+
unitId: string;
|
|
5
|
+
subUnitId: string;
|
|
6
|
+
tableFieldId: string;
|
|
7
|
+
pivotTableId: string;
|
|
8
|
+
info: IPivotTableSortInfo;
|
|
9
|
+
}
|
|
10
|
+
export declare const SetPivotSortCommand: ICommand<ISetPivotSortCommandParams>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ICommand } from '@univerjs/core';
|
|
2
|
+
import { PivotSubtotalTypeEnum } from '@univerjs-pro/engine-pivot';
|
|
3
|
+
import { IPivotPanelSourceList, IPivotPanelTableListItemBase } from '../../const/type';
|
|
4
|
+
export interface IUpdatePivotFieldSettingCommandParams {
|
|
5
|
+
unitId: string;
|
|
6
|
+
subUnitId: string;
|
|
7
|
+
tableFieldId: string;
|
|
8
|
+
pivotTableId: string;
|
|
9
|
+
displayName?: string;
|
|
10
|
+
format?: string;
|
|
11
|
+
subtotalType?: PivotSubtotalTypeEnum;
|
|
12
|
+
tableFieldInfo: IPivotPanelTableListItemBase;
|
|
13
|
+
dataFieldInfo: IPivotPanelSourceList;
|
|
14
|
+
}
|
|
15
|
+
export declare const UpdatePivotFieldSettingCommand: ICommand<IUpdatePivotFieldSettingCommandParams>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ICommand } from '@univerjs/core';
|
|
2
|
+
import { IUnitRangeNameWithSubUnitId } from '../../const/type';
|
|
3
|
+
export interface IUpdatePivotTableSourceRangeCommandParams {
|
|
4
|
+
unitId: string;
|
|
5
|
+
subUnitId: string;
|
|
6
|
+
token: string;
|
|
7
|
+
dataRangeInfo: IUnitRangeNameWithSubUnitId;
|
|
8
|
+
}
|
|
9
|
+
export declare const UpdatePivotTableSourceRangeCommand: ICommand<IUpdatePivotTableSourceRangeCommandParams>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ICommand } from '@univerjs/core';
|
|
2
|
+
import { PivotTableValuePositionEnum } from '@univerjs-pro/engine-pivot';
|
|
3
|
+
export interface IUpdatePivotValuePositionCommandParams {
|
|
4
|
+
pivotTableId: string;
|
|
5
|
+
position: PivotTableValuePositionEnum;
|
|
6
|
+
index: number;
|
|
7
|
+
}
|
|
8
|
+
export declare const UpdatePivotValuePositionCommand: ICommand<IUpdatePivotValuePositionCommandParams>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { ICommandService, IMutationInfo } from '@univerjs/core';
|
|
1
|
+
import { IAccessor, ICommandService, IMutationInfo } from '@univerjs/core';
|
|
2
2
|
import { IPivotTableChangeSet } from '@univerjs-pro/engine-pivot';
|
|
3
|
+
import { IPivotGeneratedMutationsParams } from '../../const/type';
|
|
3
4
|
interface IPivotHostInfo {
|
|
4
5
|
pivotTableId: string;
|
|
5
6
|
unitId: string;
|
|
@@ -9,4 +10,5 @@ export declare function applyChangeSet(_commandService: ICommandService, pivotIn
|
|
|
9
10
|
redos: IMutationInfo<object>[];
|
|
10
11
|
undos: IMutationInfo<object>[];
|
|
11
12
|
};
|
|
13
|
+
export declare function generateMutationsFromPivotCommand(accessor: IAccessor, params: IPivotGeneratedMutationsParams): import('@univerjs/core').IUndoRedoCommandInfosByInterceptor;
|
|
12
14
|
export {};
|
|
@@ -9,56 +9,56 @@ export declare const ReverseMap: {
|
|
|
9
9
|
"7": string;
|
|
10
10
|
"8": string;
|
|
11
11
|
"9": string;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
j: string;
|
|
16
|
-
p: string;
|
|
17
|
-
o: string;
|
|
18
|
-
W: string;
|
|
19
|
-
v: string;
|
|
12
|
+
k: string;
|
|
13
|
+
Y: string;
|
|
14
|
+
e: string;
|
|
20
15
|
q: string;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
Q: string;
|
|
24
|
-
O: string;
|
|
25
|
-
w: string;
|
|
26
|
-
D: string;
|
|
27
|
-
T: string;
|
|
28
|
-
z: string;
|
|
29
|
-
h: string;
|
|
30
|
-
n: string;
|
|
31
|
-
a: string;
|
|
32
|
-
x: string;
|
|
33
|
-
L: string;
|
|
34
|
-
K: string;
|
|
35
|
-
r: string;
|
|
16
|
+
G: string;
|
|
17
|
+
f: string;
|
|
36
18
|
J: string;
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
19
|
+
C: string;
|
|
20
|
+
h: string;
|
|
21
|
+
w: string;
|
|
40
22
|
P: string;
|
|
41
|
-
U: string;
|
|
42
23
|
H: string;
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
k: string;
|
|
47
|
-
A: string;
|
|
48
|
-
G: string;
|
|
49
|
-
S: string;
|
|
50
|
-
s: string;
|
|
51
|
-
m: string;
|
|
52
|
-
e: string;
|
|
53
|
-
b: string;
|
|
54
|
-
V: string;
|
|
55
|
-
E: string;
|
|
24
|
+
g: string;
|
|
25
|
+
I: string;
|
|
26
|
+
d: string;
|
|
56
27
|
X: string;
|
|
57
|
-
|
|
28
|
+
s: string;
|
|
58
29
|
t: string;
|
|
30
|
+
S: string;
|
|
31
|
+
L: string;
|
|
32
|
+
A: string;
|
|
59
33
|
c: string;
|
|
60
|
-
|
|
34
|
+
u: string;
|
|
35
|
+
U: string;
|
|
36
|
+
n: string;
|
|
37
|
+
B: string;
|
|
38
|
+
z: string;
|
|
39
|
+
O: string;
|
|
40
|
+
V: string;
|
|
41
|
+
F: string;
|
|
42
|
+
D: string;
|
|
43
|
+
y: string;
|
|
44
|
+
x: string;
|
|
45
|
+
R: string;
|
|
46
|
+
K: string;
|
|
61
47
|
i: string;
|
|
62
|
-
|
|
63
|
-
|
|
48
|
+
W: string;
|
|
49
|
+
m: string;
|
|
50
|
+
E: string;
|
|
51
|
+
v: string;
|
|
52
|
+
b: string;
|
|
53
|
+
Z: string;
|
|
54
|
+
Q: string;
|
|
55
|
+
l: string;
|
|
56
|
+
p: string;
|
|
57
|
+
r: string;
|
|
58
|
+
N: string;
|
|
59
|
+
a: string;
|
|
60
|
+
M: string;
|
|
61
|
+
o: string;
|
|
62
|
+
T: string;
|
|
63
|
+
j: string;
|
|
64
64
|
};
|
|
@@ -23,6 +23,8 @@ export declare const DEFAULT_PIVOT_COL_VIEW_BG = "#1d32e9";
|
|
|
23
23
|
export declare const DEFAULT_PIVOT_COL_VIEW_CL = "#FFFFFF";
|
|
24
24
|
export declare const DEFAULT_PIVOT_ROW_VIEW_BG = "#e6ebfb";
|
|
25
25
|
export declare const DEFAULT_PIVOT_DATA_VIEW_BG = "#e6ebfb";
|
|
26
|
+
export declare const DEFAULT_EMPTY_PIVOT_ROW_COUNT = 14;
|
|
27
|
+
export declare const DEFAULT_EMPTY_PIVOT_COL_COUNT = 6;
|
|
26
28
|
export declare enum PositionType {
|
|
27
29
|
Exiting = "exiting",
|
|
28
30
|
New = "new"
|
|
@@ -97,3 +99,9 @@ export declare const defaultTextInfo: {
|
|
|
97
99
|
'sheets-pivot.emptyPivot.column': string;
|
|
98
100
|
'sheets-pivot.emptyPivot.values': string;
|
|
99
101
|
};
|
|
102
|
+
export declare const defaultEmptyPivotGeneratedMutations: {
|
|
103
|
+
undos: never[];
|
|
104
|
+
redos: never[];
|
|
105
|
+
preUndos: never[];
|
|
106
|
+
preRedos: never[];
|
|
107
|
+
};
|
|
@@ -1,6 +1,14 @@
|
|
|
1
|
+
import { CellValueType, ICellData, IRange, IStyleData, IUndoRedoCommandInfosByInterceptor, IUnitRangeName, Nullable, ObjectMatrix } from '@univerjs/core';
|
|
1
2
|
import { DataField, FieldsCollection, IDataFieldManagerBaseJSON, IFieldsCollectionJSON, ILabelViewHeaderMapItem, IPivotTableChangeSet, IPivotTableFilterInfo, IPivotTableLabelFieldJSON, IPivotTableOptions, IPivotTableSnapshot, IPivotTableSortInfo, IPivotTableValueFieldJSON, IPivotViewInfo, IPivotViewJSON, IPivotViewValueType, PivotCellStyleTypeEnum, PivotDataFieldDataTypeEnum, PivotSubtotalTypeEnum, PivotTableFiledAreaEnum, PivotTableValuePositionEnum, PivotView } from '@univerjs-pro/engine-pivot';
|
|
2
|
-
import {
|
|
3
|
-
|
|
3
|
+
import { PivotDisplayDataType } from './const';
|
|
4
|
+
export interface IPivotPerformCheckParams {
|
|
5
|
+
cellInfo: IPivotCellPositionInfo;
|
|
6
|
+
view: PivotView;
|
|
7
|
+
isEmpty: boolean;
|
|
8
|
+
}
|
|
9
|
+
export type IPivotGeneratedMutationsParams = IPivotPerformCheckParams;
|
|
10
|
+
export declare const PIVOT_PERFORM_CHECK: import('@univerjs/core/common/interceptor.js').IAsyncInterceptor<boolean, IPivotPerformCheckParams>;
|
|
11
|
+
export declare const PIVOT_MUTATION_GENERATE: import('@univerjs/core').IInterceptor<IUndoRedoCommandInfosByInterceptor, IPivotPerformCheckParams>;
|
|
4
12
|
export interface IPivotTableConfigChangeInfo {
|
|
5
13
|
unitId: string;
|
|
6
14
|
subUnitId: string;
|
|
@@ -28,11 +36,6 @@ export interface ICollectionChangeInfo {
|
|
|
28
36
|
export interface IAddPivotTableParams {
|
|
29
37
|
pivotTableConfig: IPivotTableConfig;
|
|
30
38
|
}
|
|
31
|
-
export interface IAddPivotTableCommandParams {
|
|
32
|
-
positionType: PositionType;
|
|
33
|
-
pivotTableId?: string;
|
|
34
|
-
pivotTableConfig: Omit<IPivotTableConfig, 'fieldsConfig'>;
|
|
35
|
-
}
|
|
36
39
|
export interface IUpdatePivotTableSourceRangeMutationParams {
|
|
37
40
|
pivotTableId: string;
|
|
38
41
|
deleteIds: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const getLsInfoFuncStr = "
|
|
1
|
+
export declare const getLsInfoFuncStr = "IO7Pzsc7 HgPn2uzsc7(LsPg7Bg, uOwLsPbg2) { Pc7Bz LsPg7BgE7Iclhnzynnh2 = LsPg7Bg.BuLsz('-'); Pc7Bz cnsds7ZgBBhdg = v8Q4.uhnBg(hzcw(LsPg7BgE7Iclhnzynnh2[1])); sI (!cnsds7ZgBBhdg.OH) { cnsds7ZgBBhdg.OH = 4OAwgn(LsPg7BgE7Iclhnzynnh2[q]); } Pc7Bz sBMcnSgn = z2ugcI McnSgnWLcwhL8Pcug !== 'O7HgIs7gH' && BgLI s7Bzh7PgcI McnSgnWLcwhL8Pcug; Pc7Bz Pc7zgFz = sBMcnSgn ? BgLI : 6s7Hc6; Pc7Bz AgBBhdgMcnH = Pc7zgFz.__9hBgfq__.uhnBg(LsPg7BgE7Iclhnzynnh2[1]); Pc7Bz AgBBhdg = Pc7zgFz.__mgF__.Bzns7dsI2(AgBBhdgMcnH); Pc7Bz Bsd7hzOngMcnH = Pc7zgFz.__9hBgfq__.uhnBg(LsPg7BgE7Iclhnzynnh2[e]); Pc7Bz Bsd7hzOng = Pc7zgFz.__mgF__.Bzns7dsI2(Bsd7hzOngMcnH); Pc7Bz Bsd7ahLsH = Pc7zgFz.__VgnsI2__(Bsd7hzOng, AgBBhdg, uOwLsPbg2); Pc7Bz HcAhs7 = cnsds7ZgBBhdg.HA; IO7Pzsc7 sBRcAhs7ZhzPXs7d(clhzzgn7, cmcBz) { Pc7Bz uhzzgn7 = clhzzgn7.nguLhPg(/^.+/, ''); Pc7Bz XcBz = cmcBz.nguLhPg(/^.+/, ''); Pc7Bz uhzzgn7lhnzB = uhzzgn7.BuLsz('.'); Pc7Bz XcBzlhnzB = XcBz.BuLsz('.'); sI (!uhzzgn7.s7PLOHgB('*')) { ngzOn7 uhzzgn7 === XcBz; } sI (uhzzgn7lhnzB.Lg7dzX < 1 || uhzzgn7lhnzB[k] !== '*') { ngzOn7 IhLBg; } Pc7Bz uhzzgn78OIIsF = uhzzgn7lhnzB.BLsPg(Y).tcs7('.'); Pc7Bz XcBz8OIIsF = XcBzlhnzB.BLsPg(-uhzzgn7lhnzB.Lg7dzX + Y).tcs7('.'); ngzOn7 uhzzgn78OIIsF === XcBz8OIIsF; } Lgz HcAhs7ahLsH = HcAhs7?.Lg7dzX ? HcAhs7.BcAg((HAEzgA) => sBRcAhs7ZhzPXs7d(HAEzgA, LcPhzsc7.XcBz7hAg)) : znOg; sI (LcPhzsc7.XcBz7hAg === 'LcPhLXcBz') { HcAhs7ahLsH = znOg; } Pc7Bz VhLsH = Bsd7ahLsH && HcAhs7ahLsH; ngzOn7 { VhLsH, AgBBhdg: cnsds7ZgBBhdg, };}";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Disposable, DisposableCollection, IUniverInstanceService } from '@univerjs/core';
|
|
2
|
+
import { SheetInterceptorService, SheetsSelectionsService } from '@univerjs/sheets';
|
|
3
|
+
import { SheetsPivotTableConfigModel } from '../models/sheets-pivot-config-model';
|
|
4
|
+
export declare class SheetsPivotClearController extends Disposable {
|
|
5
|
+
private readonly _univerInstanceService;
|
|
6
|
+
private readonly _sheetInterceptorService;
|
|
7
|
+
private readonly _sheetsSelectionsService;
|
|
8
|
+
private readonly _sheetsPivotTableConfigModel;
|
|
9
|
+
disposableCollection: DisposableCollection;
|
|
10
|
+
constructor(_univerInstanceService: IUniverInstanceService, _sheetInterceptorService: SheetInterceptorService, _sheetsSelectionsService: SheetsSelectionsService, _sheetsPivotTableConfigModel: SheetsPivotTableConfigModel);
|
|
11
|
+
private _initClearSelectionCommandInterceptor;
|
|
12
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { IMutationInfo, Disposable, Injector, IUniverInstanceService, LocaleService } from '@univerjs/core';
|
|
2
|
+
import { PivotView } from '@univerjs-pro/engine-pivot';
|
|
3
|
+
import { IPivotCellPositionInfo } from '../const/type';
|
|
4
|
+
import { SheetInterceptorService } from '@univerjs/sheets';
|
|
5
|
+
import { SheetsPivotTableConfigModel } from '../models/sheets-pivot-config-model';
|
|
6
|
+
import { SheetsPivotTableService } from '../services/sheets-pivot-table.service';
|
|
7
|
+
export declare class SheetsPivotTableInterceptController extends Disposable {
|
|
8
|
+
private readonly _localeService;
|
|
9
|
+
private readonly _sheetInterceptorService;
|
|
10
|
+
private readonly _injector;
|
|
11
|
+
private readonly _univerInstanceService;
|
|
12
|
+
private readonly _sheetsPivotTableConfigModel;
|
|
13
|
+
private readonly _sheetsPivotTableService;
|
|
14
|
+
constructor(_localeService: LocaleService, _sheetInterceptorService: SheetInterceptorService, _injector: Injector, _univerInstanceService: IUniverInstanceService, _sheetsPivotTableConfigModel: SheetsPivotTableConfigModel, _sheetsPivotTableService: SheetsPivotTableService);
|
|
15
|
+
private _getPivotAppliedRanges;
|
|
16
|
+
private _initCommandInterceptListener;
|
|
17
|
+
getAutoFitColumnsMutations(view: PivotView, cellInfo: IPivotCellPositionInfo): {
|
|
18
|
+
undos: IMutationInfo<object>[];
|
|
19
|
+
redos: IMutationInfo<object>[];
|
|
20
|
+
};
|
|
21
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Disposable, ICommandService, IPermissionService } from '@univerjs/core';
|
|
2
|
+
export declare class SheetsPivotPrintController extends Disposable {
|
|
3
|
+
private readonly _permissionService;
|
|
4
|
+
private readonly _commandService;
|
|
5
|
+
constructor(_permissionService: IPermissionService, _commandService: ICommandService);
|
|
6
|
+
private _initPermissionWithPivot;
|
|
7
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { IMutationInfo, Disposable, DisposableCollection, ICommandService, Injector, IUniverInstanceService } from '@univerjs/core';
|
|
2
|
+
import { IMoveRangeCommandParams, RefRangeService, SheetInterceptorService } from '@univerjs/sheets';
|
|
3
|
+
import { SheetsPivotTableConfigModel } from '../models/sheets-pivot-config-model';
|
|
4
|
+
import { SheetsPivotTableAdaptorModel } from '../models/sheets-pivot-table-adaptor-model';
|
|
5
|
+
export declare class SheetsPivotRefRangeController extends Disposable {
|
|
6
|
+
private readonly _injector;
|
|
7
|
+
private readonly _refRangeService;
|
|
8
|
+
private readonly _commandService;
|
|
9
|
+
private readonly _univerInstanceService;
|
|
10
|
+
private readonly _sheetsPivotTableConfigModel;
|
|
11
|
+
private readonly _sheetsPivotTableAdaptorModel;
|
|
12
|
+
private readonly _sheetInterceptorService;
|
|
13
|
+
disposableCollection: DisposableCollection;
|
|
14
|
+
constructor(_injector: Injector, _refRangeService: RefRangeService, _commandService: ICommandService, _univerInstanceService: IUniverInstanceService, _sheetsPivotTableConfigModel: SheetsPivotTableConfigModel, _sheetsPivotTableAdaptorModel: SheetsPivotTableAdaptorModel, _sheetInterceptorService: SheetInterceptorService);
|
|
15
|
+
private _onRefRangeChange;
|
|
16
|
+
private _refRangeHandle;
|
|
17
|
+
getRefRangeMutationsByMoveRange(params: IMoveRangeCommandParams, unitId: string, subUnitId: string): {
|
|
18
|
+
redos: IMutationInfo[];
|
|
19
|
+
undos: IMutationInfo[];
|
|
20
|
+
};
|
|
21
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Disposable } from '@univerjs/core';
|
|
2
|
+
import { SheetInterceptorService } from '@univerjs/sheets';
|
|
3
|
+
import { SheetsPivotTableConfigModel } from '../models/sheets-pivot-config-model';
|
|
4
|
+
export declare class SheetsPivotRemoveSheetController extends Disposable {
|
|
5
|
+
private readonly _sheetInterceptorService;
|
|
6
|
+
private readonly _sheetsPivotTableConfigModel;
|
|
7
|
+
constructor(_sheetInterceptorService: SheetInterceptorService, _sheetsPivotTableConfigModel: SheetsPivotTableConfigModel);
|
|
8
|
+
private _initRemoveSheetCommandInterceptor;
|
|
9
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { Injector, Nullable } from '@univerjs/core';
|
|
2
|
+
import { IPivotTableSortInfo, PivotSubtotalTypeEnum, PivotTableFiledAreaEnum, PivotTableValuePositionEnum } from '@univerjs-pro/engine-pivot';
|
|
3
|
+
import { IPivotTableConfig } from '@univerjs-pro/sheets-pivot';
|
|
4
|
+
export declare class FPivotTable {
|
|
5
|
+
unitId: string;
|
|
6
|
+
subUnitId: string;
|
|
7
|
+
pivotTableId: string;
|
|
8
|
+
private _injector;
|
|
9
|
+
constructor(unitId: string, subUnitId: string, pivotTableId: string, injector: Injector);
|
|
10
|
+
/**
|
|
11
|
+
* @description Get the pivot table config by the pivot table id.
|
|
12
|
+
* @typedef NPivotTableConfig
|
|
13
|
+
* @property {TargetInfo} targetCellInfo The target cell info of the pivot table.
|
|
14
|
+
* @property {SourceInfo} sourceRangeInfo The source data range info of the pivot table.
|
|
15
|
+
* @property {boolean} isEmpty The pivot table is empty or not.
|
|
16
|
+
* @property {object} fieldsConfig The snapshot of the pivot table fields config.
|
|
17
|
+
* @returns {PivotTableConfig|undefined} The pivot table config or undefined.
|
|
18
|
+
*/
|
|
19
|
+
getConfig(): Nullable<IPivotTableConfig>;
|
|
20
|
+
/**
|
|
21
|
+
* @description Remove a pivot table from the workbook by pivot table id
|
|
22
|
+
*/
|
|
23
|
+
remove(): Promise<boolean>;
|
|
24
|
+
/**
|
|
25
|
+
*@description Add a pivot field to the pivot table.
|
|
26
|
+
* @param {string|number} dataFieldIdOrIndex The data field id.
|
|
27
|
+
* @param {PivotTableFiledAreaEnum} fieldArea The area of the field.
|
|
28
|
+
* @param {number} index The index of the field in the target area.
|
|
29
|
+
* @returns {boolean} Whether the pivot field is added successfully.
|
|
30
|
+
*/
|
|
31
|
+
addField(dataFieldIdOrIndex: string | number, fieldArea: PivotTableFiledAreaEnum, index: number): Promise<boolean>;
|
|
32
|
+
/**
|
|
33
|
+
* @description Remove a pivot field from the pivot table
|
|
34
|
+
* @param {string[]} fieldIds The deleted field ids.
|
|
35
|
+
* @returns {boolean} Whether the pivot field is removed successfully.
|
|
36
|
+
*/
|
|
37
|
+
removeField(fieldIds: string[]): Promise<boolean>;
|
|
38
|
+
/**
|
|
39
|
+
* @description Update the pivot table field position.
|
|
40
|
+
* @param {string} fieldId - The moved field id.
|
|
41
|
+
* @param {PivotTableFiledAreaEnum} area - The target area of the field.
|
|
42
|
+
* @param {number} index - The target index of the field, if the index is bigger than the field count in the target area, the field will be moved to the last, if the index is smaller than 0, the field will be moved to the first.
|
|
43
|
+
* @returns {boolean} Whether the pivot field is moved successfully.
|
|
44
|
+
*/
|
|
45
|
+
updateFieldPosition(fieldId: string, area: PivotTableFiledAreaEnum, index: number): Promise<boolean>;
|
|
46
|
+
/**
|
|
47
|
+
* @description If there are multiple value fields in the pivot table, you can update the position of the value field, which only can be position in row or column.
|
|
48
|
+
* @param {PivotTableValuePositionEnum} position - The position of the value field.
|
|
49
|
+
* @param {number} index - The index of the value field.
|
|
50
|
+
* @returns {boolean} Whether the pivot value field is moved successfully.
|
|
51
|
+
*/
|
|
52
|
+
updateValuePosition(position: PivotTableValuePositionEnum, index: number): Promise<boolean>;
|
|
53
|
+
/**
|
|
54
|
+
* @description Set the pivot table subtotal type for value field, it only works for the value field.
|
|
55
|
+
* @param {string} fieldId - The field id.
|
|
56
|
+
* @param {PivotSubtotalTypeEnum} subtotalType - The subtotal type of the field.
|
|
57
|
+
* @returns {boolean} Whether the pivot table subtotal type is set successfully.
|
|
58
|
+
*/
|
|
59
|
+
setSubtotalType(fieldId: string, subtotalType: PivotSubtotalTypeEnum): Promise<boolean>;
|
|
60
|
+
/**
|
|
61
|
+
* @description Set the pivot table sort info.
|
|
62
|
+
* @param {string} tableFieldId - The field id of the sort.
|
|
63
|
+
* @param {PivotTableSortInfo} info - The sort info.
|
|
64
|
+
* @typedef PivotTableSortInfo
|
|
65
|
+
* @property {PivotDataFieldSortOperatorEnum} type The sort operator of the field items.
|
|
66
|
+
* @returns {boolean} Whether the pivot table sort info is set successfully.
|
|
67
|
+
*/
|
|
68
|
+
setLabelSort(tableFieldId: string, info: IPivotTableSortInfo): Promise<boolean>;
|
|
69
|
+
/**
|
|
70
|
+
* @description Set the pivot table manual filter.
|
|
71
|
+
* @param {string} tableFieldId - The field id of the filter.
|
|
72
|
+
* @param {string[]} items - The items of the filter.
|
|
73
|
+
* @returns {boolean} Whether the pivot table filter is set successfully.
|
|
74
|
+
*/
|
|
75
|
+
setLabelManualFilter(tableFieldId: string, items: string[], isAll?: boolean): Promise<boolean>;
|
|
76
|
+
/**
|
|
77
|
+
* @description Rename the pivot table field.
|
|
78
|
+
* @param {string} fieldId - The field id.
|
|
79
|
+
* @param {string} name - The new name of the field.
|
|
80
|
+
* @returns {boolean} Whether the pivot table field is renamed successfully.
|
|
81
|
+
*/
|
|
82
|
+
renameField(fieldId: string, name: string): Promise<boolean>;
|
|
83
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { IUnitRangeName } from '@univerjs/core';
|
|
2
|
+
import { IPivotCellPositionInfo, PositionType } from '@univerjs-pro/sheets-pivot';
|
|
3
|
+
import { FPivotTable } from './f-pivot-table';
|
|
4
|
+
interface IFWorkbookSheetsPivotMixin {
|
|
5
|
+
/**
|
|
6
|
+
* @description Add a pivot table to the Workbook.
|
|
7
|
+
* @typedef SourceInfo
|
|
8
|
+
* @property {string} unitId - The unit id of the source data.
|
|
9
|
+
* @property {string} subUnitId - The sub unit id of the source data.
|
|
10
|
+
* @property {string} sheetName - The sheet name of the source data.
|
|
11
|
+
* @property {IRange} range - The range of the source data.
|
|
12
|
+
* @typedef AnchorCellInfo - The target cell info of the pivot table.
|
|
13
|
+
* @property {string} unitId - The unit id of the target data.
|
|
14
|
+
* @property {string} subUnitId - The sub unit id of the target data.
|
|
15
|
+
* @property {number} row - The range of the target data.
|
|
16
|
+
* @property {number} col - The range of the target data.
|
|
17
|
+
* @param {SourceInfo} sourceInfo The source data range info of the pivot table.
|
|
18
|
+
* @param {PositionType} positionType whether new a sheet or insert a pivot table to the existing sheet.
|
|
19
|
+
* @param {AnchorCellInfo} anchorCellInfo The target cell info of the pivot table.
|
|
20
|
+
* @returns {string|undefined} The added pivot table id.
|
|
21
|
+
* @example
|
|
22
|
+
* ```typescript
|
|
23
|
+
* // should ensure the sheet range {0,0,8,6} is not empty
|
|
24
|
+
* const fWorkbook = univerAPI.getActiveWorkbook()
|
|
25
|
+
* const unitId = fWorkbook.getId()
|
|
26
|
+
* const fSheet = fWorkbook.getActiveSheet();
|
|
27
|
+
* const subUnitId = fSheet.getSheetId()
|
|
28
|
+
* const sheetName = fSheet.getSheetName();
|
|
29
|
+
* const sourceInfo = {
|
|
30
|
+
* unitId,
|
|
31
|
+
* subUnitId,
|
|
32
|
+
* sheetName,
|
|
33
|
+
* range: {
|
|
34
|
+
* startRow: 0,
|
|
35
|
+
* endRow: 8,
|
|
36
|
+
* startColumn: 0,
|
|
37
|
+
* endColumn: 6
|
|
38
|
+
* }
|
|
39
|
+
* }
|
|
40
|
+
* const anchorCellInfo = {
|
|
41
|
+
* unitId,
|
|
42
|
+
* subUnitId,
|
|
43
|
+
* row: 0,
|
|
44
|
+
* col: 8
|
|
45
|
+
* }
|
|
46
|
+
* const fp = await fWorkbook.addPivotTable(sourceInfo, 'exiting', anchorCellInfo)
|
|
47
|
+
* // the addPivotTable is async, you can add pivot fields after the pivot table is added
|
|
48
|
+
* // in the future, we will support pivot table added event, you can add pivot fields in the event handler
|
|
49
|
+
* setTimeout(function() {
|
|
50
|
+
* fp.addField(1, 2)
|
|
51
|
+
* fp.addField(1, 3)
|
|
52
|
+
* }, 1000)
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
addPivotTable(sourceInfo: IUnitRangeName & {
|
|
56
|
+
subUnitId: string;
|
|
57
|
+
}, positionType: PositionType, anchorCellInfo: IPivotCellPositionInfo): Promise<FPivotTable | undefined>;
|
|
58
|
+
/**
|
|
59
|
+
* @description Get the pivot table id by the cell.
|
|
60
|
+
* @param {string} unitId The unit id of workbook.
|
|
61
|
+
* @param {string} subUnitId The sheet id, which pivot table belongs to.
|
|
62
|
+
* @param {number} row The checked row.
|
|
63
|
+
* @param {number} col The checked column.
|
|
64
|
+
* @returns {string|undefined} The pivot table id or undefined.
|
|
65
|
+
*/
|
|
66
|
+
getPivotTableByCell(unitId: string, subUnitId: string, row: number, col: number): FPivotTable | undefined;
|
|
67
|
+
}
|
|
68
|
+
declare module '@univerjs/sheets/facade' {
|
|
69
|
+
interface FWorkbook extends IFWorkbookSheetsPivotMixin {
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
export {};
|