@k-table/sheet-core 0.0.1 → 0.1.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/dist/chunk-2Z7KMZEW.js +1 -0
- package/dist/chunk-FRYFH3X6.js +1 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.cts +2076 -0
- package/dist/index.d.ts +2076 -0
- package/dist/index.js +1 -0
- package/dist/migrate/index.cjs +1 -0
- package/dist/migrate/index.d.cts +9 -0
- package/dist/migrate/index.d.ts +9 -0
- package/dist/migrate/index.js +1 -0
- package/dist/sheet-template-model.cjs +1 -0
- package/dist/sheet-template-model.d.cts +132 -0
- package/dist/sheet-template-model.d.ts +132 -0
- package/dist/sheet-template-model.js +1 -0
- package/dist/types-9rRrxBdg.d.cts +435 -0
- package/dist/types-9rRrxBdg.d.ts +435 -0
- package/package.json +47 -9
- package/README.md +0 -5
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';const _0x3be433=_0x12ea;(function(_0x3e021a,_0x41ecb4){const _0x359519=_0x12ea,_0x383648=_0x3e021a();while(!![]){try{const _0x2139ca=-parseInt(_0x359519(0x95))/0x1+parseInt(_0x359519(0xa2))/0x2+-parseInt(_0x359519(0x8d))/0x3*(-parseInt(_0x359519(0x8e))/0x4)+-parseInt(_0x359519(0x9b))/0x5*(-parseInt(_0x359519(0xa3))/0x6)+parseInt(_0x359519(0x96))/0x7*(parseInt(_0x359519(0x9d))/0x8)+-parseInt(_0x359519(0xab))/0x9+-parseInt(_0x359519(0x8f))/0xa;if(_0x2139ca===_0x41ecb4)break;else _0x383648['push'](_0x383648['shift']());}catch(_0x5d55b5){_0x383648['push'](_0x383648['shift']());}}}(_0xe986,0x907e5));function _0xe986(){const _0x269bba=['mJm1nJyZnfn5we9JDW','mJiXmdC0ofPZBhDctW','BgvNywn5xW','BgvUz3rO','AxnbCNjHEq','Bwv0yq','ywn0AxzLu2HLzxrjza','A3ruzw1WBgf0zq','AgfZ','ntGWntCZofjWBgXZAW','BwLNCMf0zvDVCMTIB29R','v29YA2jVB2SGsLnptIdLV4xPOBVKUlRLR7NOSAe','nZG1mwrSzuPtEa','mtyYoezKrNv5ua','mJu4nJG1me9xs1DTrq','zxH0zw5ZAw9U','zMXVB3i','revgqvvmvf9st1DFsevjr0Hu','u2HLzxqX','BwfW','mte0nda1muDUAMzOBq','mJC3nJL0yK92vMi','revgqvvmvf9dt0XFv0LeveG','mdeYmZq1nJC4owfIy2rLzG','A2v5CW','revgqvvmvf9dt0XFq09vtLq','nvLkDvbtEG','revgqvvmvf9st1DFq09vtLq','ntzxEMPIzu8','BNvTyMvY','CMfUzg9T','C2HLzxrZ','D29YA2jVB2TwzxjZAw9U'];_0xe986=function(){return _0x269bba;};return _0xe986();}var SHEET_ENGINE_CONFIG={'DEFAULT_ROW_COUNT':0xc8,'DEFAULT_COL_COUNT':0x32,'DEFAULT_ROW_HEIGHT':0x18,'DEFAULT_COL_WIDTH':0x50};function randomSheetId(){const _0x3cfe06=_0x12ea,_0x364d5e=_0x3cfe06(0x98);let _0x5a769b='';for(let _0x545032=0x0;_0x545032<0x4;_0x545032+=0x1){_0x5a769b+=_0x364d5e[Math[_0x3cfe06(0x91)](Math[_0x3cfe06(0x9f)]()*_0x364d5e[_0x3cfe06(0xa5)])];}return _0x5a769b;}function createDefaultPage(){return{'paper':'A4','orientation':'portrait','marginMm':{'top':0xc,'right':0xc,'bottom':0xc,'left':0xc}};}function createEmptySheet(_0x2dff07,_0xfb7373=SHEET_ENGINE_CONFIG[_0x3be433(0x9c)],_0x38fab0=SHEET_ENGINE_CONFIG[_0x3be433(0x9a)]){const _0x1f3819=_0x3be433,_0x3e3888=randomSheetId(),_0x28579a={'rowCount':_0xfb7373,'colCount':_0x38fab0,'defaultRowHeight':SHEET_ENGINE_CONFIG[_0x1f3819(0x92)],'defaultColWidth':SHEET_ENGINE_CONFIG[_0x1f3819(0x97)],'cells':{},'merges':[],'page':createDefaultPage()};return{'id':_0x3e3888,'name':_0x2dff07,'sheet':_0x28579a};}function createEmptyWorkbook(){const _0x12927b=_0x3be433,_0x3d6325=createEmptySheet(_0x12927b(0x93));return{'workbookVersion':0x1,'sheets':[_0x3d6325],'activeSheetId':_0x3d6325['id'],'meta':{}};}function _0x12ea(_0x41bd9d,_0x3b25c0){_0x41bd9d=_0x41bd9d-0x8b;const _0xe98674=_0xe986();let _0x12ea21=_0xe98674[_0x41bd9d];if(_0x12ea['NAcnsA']===undefined){var _0x54da75=function(_0x1129e3){const _0x56ab38='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x3f04fb='',_0x364d5e='';for(let _0x5a769b=0x0,_0x545032,_0x2dff07,_0xfb7373=0x0;_0x2dff07=_0x1129e3['charAt'](_0xfb7373++);~_0x2dff07&&(_0x545032=_0x5a769b%0x4?_0x545032*0x40+_0x2dff07:_0x2dff07,_0x5a769b++%0x4)?_0x3f04fb+=String['fromCharCode'](0xff&_0x545032>>(-0x2*_0x5a769b&0x6)):0x0){_0x2dff07=_0x56ab38['indexOf'](_0x2dff07);}for(let _0x38fab0=0x0,_0x3e3888=_0x3f04fb['length'];_0x38fab0<_0x3e3888;_0x38fab0++){_0x364d5e+='%'+('00'+_0x3f04fb['charCodeAt'](_0x38fab0)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x364d5e);};_0x12ea['TcsvAX']=_0x54da75,_0x12ea['wBPPkp']={},_0x12ea['NAcnsA']=!![];}const _0x555ddc=_0xe98674[0x0];_0x12ea['wvoWtx']!==_0x555ddc&&(_0x12ea['wBPPkp']={},_0x12ea['wvoWtx']=_0x555ddc);const _0x1094fa=_0x12ea['wBPPkp'][_0x41bd9d];return _0x1094fa===undefined?(_0x12ea21=_0x12ea['TcsvAX'](_0x12ea21),_0x12ea['wBPPkp'][_0x41bd9d]=_0x12ea21):_0x12ea21=_0x1094fa,_0x12ea21;}function isObject(_0x253b59){return typeof _0x253b59==='object'&&_0x253b59!==null;}function migrateWorkbook(_0x29abcd){const _0x1ce210=_0x3be433;if(!isObject(_0x29abcd))throw new Error(_0x1ce210(0x8c));const _0x5c30dd=typeof _0x29abcd[_0x1ce210(0xa1)]===_0x1ce210(0x9e)?_0x29abcd[_0x1ce210(0xa1)]:0x0;if(_0x5c30dd>0x1)throw new Error('不支持的\x20workbookVersion:\x20'+_0x5c30dd);let _0x1b977f;if(_0x5c30dd===0x0){const _0x317d22={..._0x29abcd['extension']??{}},_0x51d434=new Set([_0x1ce210(0xa1),_0x1ce210(0xa0),'activeSheetId',_0x1ce210(0xa9),'meta',_0x1ce210(0x90)]);for(const _0x56031d of Object[_0x1ce210(0x99)](_0x29abcd)){!_0x51d434['has'](_0x56031d)&&(_0x317d22[_0x1ce210(0xa4)+_0x56031d]=_0x29abcd[_0x56031d]);}_0x1b977f={'workbookVersion':0x1,'sheets':_0x29abcd[_0x1ce210(0xa0)]??[],'activeSheetId':String(_0x29abcd['activeSheetId']??''),'ktTemplate':_0x29abcd['ktTemplate'],'meta':_0x29abcd[_0x1ce210(0xa7)]??{},'extension':_0x317d22};}else _0x1b977f={'workbookVersion':0x1,'sheets':_0x29abcd[_0x1ce210(0xa0)],'activeSheetId':String(_0x29abcd[_0x1ce210(0xa8)]),'ktTemplate':_0x29abcd[_0x1ce210(0xa9)],'meta':_0x29abcd[_0x1ce210(0xa7)],'extension':_0x29abcd['extension']};if(!Array[_0x1ce210(0xa6)](_0x1b977f['sheets'])||_0x1b977f['sheets'][_0x1ce210(0xa5)]===0x0)return createEmptyWorkbook();const _0x1cd8ca=new Set(_0x1b977f[_0x1ce210(0xa0)][_0x1ce210(0x94)](_0x5d75ea=>_0x5d75ea['id']));return!_0x1cd8ca[_0x1ce210(0xaa)](_0x1b977f[_0x1ce210(0xa8)])&&(_0x1b977f[_0x1ce210(0xa8)]=_0x1b977f[_0x1ce210(0xa0)][0x0]['id']),_0x1b977f;}exports[_0x3be433(0x8b)]=migrateWorkbook;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function _0x55a7(_0x1a5a9a,_0x1594ed){_0x1a5a9a=_0x1a5a9a-0x1eb;var _0xe7105e=_0xe710();var _0x55a735=_0xe7105e[_0x1a5a9a];if(_0x55a7['nbETve']===undefined){var _0x25786b=function(_0x535a6c){var _0x5502ae='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x46a82c='',_0x206cb1='';for(var _0x5d3410=0x0,_0x1c3c74,_0x48aba3,_0x229d76=0x0;_0x48aba3=_0x535a6c['charAt'](_0x229d76++);~_0x48aba3&&(_0x1c3c74=_0x5d3410%0x4?_0x1c3c74*0x40+_0x48aba3:_0x48aba3,_0x5d3410++%0x4)?_0x46a82c+=String['fromCharCode'](0xff&_0x1c3c74>>(-0x2*_0x5d3410&0x6)):0x0){_0x48aba3=_0x5502ae['indexOf'](_0x48aba3);}for(var _0x4ce0a2=0x0,_0x109dc4=_0x46a82c['length'];_0x4ce0a2<_0x109dc4;_0x4ce0a2++){_0x206cb1+='%'+('00'+_0x46a82c['charCodeAt'](_0x4ce0a2)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x206cb1);};_0x55a7['JXtxYm']=_0x25786b,_0x55a7['OZGwco']={},_0x55a7['nbETve']=!![];}var _0xba612d=_0xe7105e[0x0];_0x55a7['ZdAVAr']!==_0xba612d&&(_0x55a7['OZGwco']={},_0x55a7['ZdAVAr']=_0xba612d);var _0x6ae98e=_0x55a7['OZGwco'][_0x1a5a9a];return _0x6ae98e===undefined?(_0x55a735=_0x55a7['JXtxYm'](_0x55a735),_0x55a7['OZGwco'][_0x1a5a9a]=_0x55a735):_0x55a735=_0x6ae98e,_0x55a735;}(function(_0x1d8abd,_0x2cc802){var _0x759d3a=_0x55a7,_0x1b10fe=_0x1d8abd();while(!![]){try{var _0x344d6a=parseInt(_0x759d3a(0x1ed))/0x1+-parseInt(_0x759d3a(0x1ee))/0x2+parseInt(_0x759d3a(0x1ec))/0x3+parseInt(_0x759d3a(0x1f1))/0x4*(-parseInt(_0x759d3a(0x1f4))/0x5)+parseInt(_0x759d3a(0x1f3))/0x6+-parseInt(_0x759d3a(0x1f2))/0x7*(parseInt(_0x759d3a(0x1eb))/0x8)+parseInt(_0x759d3a(0x1f0))/0x9*(-parseInt(_0x759d3a(0x1ef))/0xa);if(_0x344d6a===_0x2cc802)break;else _0x1b10fe['push'](_0x1b10fe['shift']());}catch(_0x36c732){_0x1b10fe['push'](_0x1b10fe['shift']());}}}(_0xe710,0x631b1));export{migrateWorkbook}from'../chunk-FRYFH3X6.js';function _0xe710(){var _0x1f3409=['ndeWAvnkEMfK','ndu3odnbCfjxyKC','nejpwen3va','oti1ote4BNzKuurv','mJK4mJe3nfvJsg1bqq','mteXmZa2nvzPA3flwq','mZjhCKTQEKe','mti3nJe3nKTKAgX2qG','nZC1mdi1v1z6Bg1Q','nJyYndy2q3HuueHA'];_0xe710=function(){return _0x1f3409;};return _0xe710();}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var _0x3c8637=_0x381a;(function(_0x1c60ba,_0x5c1ccf){var _0x2b1e8e=_0x381a,_0x14a4a3=_0x1c60ba();while(!![]){try{var _0x5d5b48=parseInt(_0x2b1e8e(0xf1))/0x1+parseInt(_0x2b1e8e(0xf7))/0x2*(parseInt(_0x2b1e8e(0xf4))/0x3)+-parseInt(_0x2b1e8e(0xf5))/0x4*(-parseInt(_0x2b1e8e(0xfa))/0x5)+parseInt(_0x2b1e8e(0xef))/0x6*(-parseInt(_0x2b1e8e(0xf9))/0x7)+parseInt(_0x2b1e8e(0xfc))/0x8*(-parseInt(_0x2b1e8e(0xed))/0x9)+parseInt(_0x2b1e8e(0xf3))/0xa+-parseInt(_0x2b1e8e(0xf0))/0xb*(parseInt(_0x2b1e8e(0xfb))/0xc);if(_0x5d5b48===_0x5c1ccf)break;else _0x14a4a3['push'](_0x14a4a3['shift']());}catch(_0x1becf2){_0x14a4a3['push'](_0x14a4a3['shift']());}}}(_0x5798,0xba70c));var SHEET_TEMPLATE_JSON_VERSION=0x2,HEADER_ROW=0x0,HEADER_COL=0x0;function cellKey(_0x2785f7,_0x525677){return _0x2785f7+','+_0x525677;}function parseCellKey(_0x2832b4){var _0x2e24e1=_0x381a;const _0xb613a1=/^(\d+),(\d+)$/[_0x2e24e1(0xee)](_0x2832b4);if(!_0xb613a1)return null;return{'r':Number(_0xb613a1[0x1]),'c':Number(_0xb613a1[0x2])};}function _0x381a(_0x311b99,_0x2132b1){_0x311b99=_0x311b99-0xed;var _0x5798da=_0x5798();var _0x381aca=_0x5798da[_0x311b99];if(_0x381a['vOKeRU']===undefined){var _0x169265=function(_0x1efcf0){var _0x44cc48='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x1b90de='',_0x2785f7='';for(var _0x525677=0x0,_0x2832b4,_0xb613a1,_0x465393=0x0;_0xb613a1=_0x1efcf0['charAt'](_0x465393++);~_0xb613a1&&(_0x2832b4=_0x525677%0x4?_0x2832b4*0x40+_0xb613a1:_0xb613a1,_0x525677++%0x4)?_0x1b90de+=String['fromCharCode'](0xff&_0x2832b4>>(-0x2*_0x525677&0x6)):0x0){_0xb613a1=_0x44cc48['indexOf'](_0xb613a1);}for(var _0x47d39e=0x0,_0x533b70=_0x1b90de['length'];_0x47d39e<_0x533b70;_0x47d39e++){_0x2785f7+='%'+('00'+_0x1b90de['charCodeAt'](_0x47d39e)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x2785f7);};_0x381a['SkizYL']=_0x169265,_0x381a['FWiKMa']={},_0x381a['vOKeRU']=!![];}var _0x38f2b2=_0x5798da[0x0];_0x381a['vjBFRo']!==_0x38f2b2&&(_0x381a['FWiKMa']={},_0x381a['vjBFRo']=_0x38f2b2);var _0xaabc83=_0x381a['FWiKMa'][_0x311b99];return _0xaabc83===undefined?(_0x381aca=_0x381a['SkizYL'](_0x381aca),_0x381a['FWiKMa'][_0x311b99]=_0x381aca):_0x381aca=_0xaabc83,_0x381aca;}exports[_0x3c8637(0xf8)]=HEADER_COL,exports['HEADER_ROW']=HEADER_ROW,exports[_0x3c8637(0xf6)]=SHEET_TEMPLATE_JSON_VERSION,exports['cellKey']=cellKey,exports[_0x3c8637(0xf2)]=parseCellKey;function _0x5798(){var _0x2a82b4=['nJm4mZvOtg9ju2q','mtK1mduXnNfJsLfNDa','ofnNvhzHBa','mte2ntuYotDhthDNEuO','zxHLyW','mJmYmKDRtgnVDa','ndrPzvDczuO','nZCZmJi4rNP2tM9d','CgfYC2vdzwXSs2v5','nty5mZm5mhLWwLDyqG','mZiXB2nisuHr','mJmYwe1bBeX2','u0HfrvrFvevnueXbvevFsLnptL9wrvjtsu9o','mJeYodjyELfMB0q','sevbrevsx0npta','oti3nuXHEwDJAq'];_0x5798=function(){return _0x2a82b4;};return _0x5798();}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/** 模板 JSON 版本;v2 起 `fontSize` 为磅(pt),v1 为历史 px */
|
|
2
|
+
declare const SHEET_TEMPLATE_JSON_VERSION: 2;
|
|
3
|
+
type SheetPaperKind = "A4" | "A3" | "Letter" | "Custom";
|
|
4
|
+
type SheetOrientation = "portrait" | "landscape";
|
|
5
|
+
/** cm 单位页边距(内部换算时 ×10 为 mm) */
|
|
6
|
+
interface PageMarginsCm {
|
|
7
|
+
top: number;
|
|
8
|
+
right: number;
|
|
9
|
+
bottom: number;
|
|
10
|
+
left: number;
|
|
11
|
+
}
|
|
12
|
+
/** 报表页眉/页脚:每物理打印页重复渲染的模板行区间(1-based,含端点) */
|
|
13
|
+
interface PageRepeatRowsRange {
|
|
14
|
+
startRow: number;
|
|
15
|
+
endRow: number;
|
|
16
|
+
}
|
|
17
|
+
interface PageSettings {
|
|
18
|
+
paper: SheetPaperKind;
|
|
19
|
+
/** mm,仅 paper === "Custom" 时使用(如针式小卡 120×127);Custom 下 orientation 不参与尺寸换算 */
|
|
20
|
+
widthMm?: number;
|
|
21
|
+
heightMm?: number;
|
|
22
|
+
orientation: SheetOrientation;
|
|
23
|
+
/**
|
|
24
|
+
* 输出旋转(度,顺时针):版式不变,输出时物理纸张交换宽高、内容整体旋转,
|
|
25
|
+
* 适配打印机进纸方向(如针式标签横向进纸)。缺省 0。
|
|
26
|
+
*/
|
|
27
|
+
outputRotation?: 0 | 90 | 270;
|
|
28
|
+
marginsCm: PageMarginsCm;
|
|
29
|
+
/** 报表扩展:每物理页顶部重复的页眉行区间(KTL @pageHeader) */
|
|
30
|
+
pageHeaderRows?: PageRepeatRowsRange;
|
|
31
|
+
/** 报表扩展:每物理页底部重复的页脚行区间(KTL @pageFooter) */
|
|
32
|
+
pageFooterRows?: PageRepeatRowsRange;
|
|
33
|
+
}
|
|
34
|
+
type TextAlign = "left" | "center" | "right";
|
|
35
|
+
type VerticalAlign = "top" | "middle" | "bottom";
|
|
36
|
+
type BorderStyle = "none" | "thin" | "medium" | "thick";
|
|
37
|
+
type BorderLinePattern = "solid" | "dashed" | "dotted";
|
|
38
|
+
type TextRunStyle = {
|
|
39
|
+
bold?: boolean;
|
|
40
|
+
italic?: boolean;
|
|
41
|
+
underline?: boolean;
|
|
42
|
+
strikethrough?: boolean;
|
|
43
|
+
superscript?: boolean;
|
|
44
|
+
subscript?: boolean;
|
|
45
|
+
fontSize?: number;
|
|
46
|
+
fontFamily?: string;
|
|
47
|
+
textColor?: string;
|
|
48
|
+
};
|
|
49
|
+
interface TextRun {
|
|
50
|
+
t: string;
|
|
51
|
+
s?: TextRunStyle;
|
|
52
|
+
}
|
|
53
|
+
interface CellStyle {
|
|
54
|
+
bold?: boolean;
|
|
55
|
+
italic?: boolean;
|
|
56
|
+
underline?: boolean;
|
|
57
|
+
strikethrough?: boolean;
|
|
58
|
+
superscript?: boolean;
|
|
59
|
+
subscript?: boolean;
|
|
60
|
+
fontSize?: number;
|
|
61
|
+
fontFamily?: string;
|
|
62
|
+
textColor?: string;
|
|
63
|
+
bgColor?: string;
|
|
64
|
+
align?: TextAlign;
|
|
65
|
+
verticalAlign?: VerticalAlign;
|
|
66
|
+
wrapText?: boolean;
|
|
67
|
+
shrinkToFit?: boolean;
|
|
68
|
+
borderTop?: BorderStyle;
|
|
69
|
+
borderRight?: BorderStyle;
|
|
70
|
+
borderBottom?: BorderStyle;
|
|
71
|
+
borderLeft?: BorderStyle;
|
|
72
|
+
borderColor?: string;
|
|
73
|
+
borderTopColor?: string;
|
|
74
|
+
borderRightColor?: string;
|
|
75
|
+
borderBottomColor?: string;
|
|
76
|
+
borderLeftColor?: string;
|
|
77
|
+
borderLinePattern?: BorderLinePattern;
|
|
78
|
+
borderTopPattern?: BorderLinePattern;
|
|
79
|
+
borderRightPattern?: BorderLinePattern;
|
|
80
|
+
borderBottomPattern?: BorderLinePattern;
|
|
81
|
+
borderLeftPattern?: BorderLinePattern;
|
|
82
|
+
/** 竖排文本(如 writing-mode:vertical-rl) */
|
|
83
|
+
writingMode?: string;
|
|
84
|
+
}
|
|
85
|
+
type EmbedAnchorRole = "chart" | "signature" | "image" | "qrcode" | "barcode";
|
|
86
|
+
type BaseTemplateCellBinding = {
|
|
87
|
+
kind: "basicField" | "dict" | "systemParam" | "mainField" | "subField" | "embedAnchor";
|
|
88
|
+
key: string;
|
|
89
|
+
subSchemaId?: number;
|
|
90
|
+
subRowSlot?: number;
|
|
91
|
+
displayText?: string;
|
|
92
|
+
embedRole?: EmbedAnchorRole;
|
|
93
|
+
};
|
|
94
|
+
interface CellData {
|
|
95
|
+
value: string;
|
|
96
|
+
style?: CellStyle;
|
|
97
|
+
runs?: TextRun[];
|
|
98
|
+
f?: string;
|
|
99
|
+
baseTemplateBinding?: BaseTemplateCellBinding;
|
|
100
|
+
designFieldLine?: string;
|
|
101
|
+
instanceEditable?: boolean;
|
|
102
|
+
/** 报表渲染:base64 或 URL 图片(优先于 value 显示) */
|
|
103
|
+
imageSrc?: string;
|
|
104
|
+
}
|
|
105
|
+
/** 合并区域:含端点,与 Excel 一致为矩形 inclusive */
|
|
106
|
+
interface MergeRange {
|
|
107
|
+
r1: number;
|
|
108
|
+
c1: number;
|
|
109
|
+
r2: number;
|
|
110
|
+
c2: number;
|
|
111
|
+
}
|
|
112
|
+
interface SheetTemplateState {
|
|
113
|
+
version: typeof SHEET_TEMPLATE_JSON_VERSION;
|
|
114
|
+
rowCount: number;
|
|
115
|
+
colCount: number;
|
|
116
|
+
defaultRowHeight: number;
|
|
117
|
+
defaultColWidth: number;
|
|
118
|
+
rowHeights?: number[];
|
|
119
|
+
colWidths?: number[];
|
|
120
|
+
cells: Record<string, CellData>;
|
|
121
|
+
merges: MergeRange[];
|
|
122
|
+
page: PageSettings;
|
|
123
|
+
}
|
|
124
|
+
declare const HEADER_ROW = 0;
|
|
125
|
+
declare const HEADER_COL = 0;
|
|
126
|
+
declare function cellKey(r: number, c: number): string;
|
|
127
|
+
declare function parseCellKey(key: string): {
|
|
128
|
+
r: number;
|
|
129
|
+
c: number;
|
|
130
|
+
} | null;
|
|
131
|
+
|
|
132
|
+
export { type BaseTemplateCellBinding, type BorderLinePattern, type BorderStyle, type CellData, type CellStyle, type EmbedAnchorRole, HEADER_COL, HEADER_ROW, type MergeRange, type PageMarginsCm, type PageRepeatRowsRange, type PageSettings, SHEET_TEMPLATE_JSON_VERSION, type SheetOrientation, type SheetPaperKind, type SheetTemplateState, type TextAlign, type TextRun, type TextRunStyle, type VerticalAlign, cellKey, parseCellKey };
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/** 模板 JSON 版本;v2 起 `fontSize` 为磅(pt),v1 为历史 px */
|
|
2
|
+
declare const SHEET_TEMPLATE_JSON_VERSION: 2;
|
|
3
|
+
type SheetPaperKind = "A4" | "A3" | "Letter" | "Custom";
|
|
4
|
+
type SheetOrientation = "portrait" | "landscape";
|
|
5
|
+
/** cm 单位页边距(内部换算时 ×10 为 mm) */
|
|
6
|
+
interface PageMarginsCm {
|
|
7
|
+
top: number;
|
|
8
|
+
right: number;
|
|
9
|
+
bottom: number;
|
|
10
|
+
left: number;
|
|
11
|
+
}
|
|
12
|
+
/** 报表页眉/页脚:每物理打印页重复渲染的模板行区间(1-based,含端点) */
|
|
13
|
+
interface PageRepeatRowsRange {
|
|
14
|
+
startRow: number;
|
|
15
|
+
endRow: number;
|
|
16
|
+
}
|
|
17
|
+
interface PageSettings {
|
|
18
|
+
paper: SheetPaperKind;
|
|
19
|
+
/** mm,仅 paper === "Custom" 时使用(如针式小卡 120×127);Custom 下 orientation 不参与尺寸换算 */
|
|
20
|
+
widthMm?: number;
|
|
21
|
+
heightMm?: number;
|
|
22
|
+
orientation: SheetOrientation;
|
|
23
|
+
/**
|
|
24
|
+
* 输出旋转(度,顺时针):版式不变,输出时物理纸张交换宽高、内容整体旋转,
|
|
25
|
+
* 适配打印机进纸方向(如针式标签横向进纸)。缺省 0。
|
|
26
|
+
*/
|
|
27
|
+
outputRotation?: 0 | 90 | 270;
|
|
28
|
+
marginsCm: PageMarginsCm;
|
|
29
|
+
/** 报表扩展:每物理页顶部重复的页眉行区间(KTL @pageHeader) */
|
|
30
|
+
pageHeaderRows?: PageRepeatRowsRange;
|
|
31
|
+
/** 报表扩展:每物理页底部重复的页脚行区间(KTL @pageFooter) */
|
|
32
|
+
pageFooterRows?: PageRepeatRowsRange;
|
|
33
|
+
}
|
|
34
|
+
type TextAlign = "left" | "center" | "right";
|
|
35
|
+
type VerticalAlign = "top" | "middle" | "bottom";
|
|
36
|
+
type BorderStyle = "none" | "thin" | "medium" | "thick";
|
|
37
|
+
type BorderLinePattern = "solid" | "dashed" | "dotted";
|
|
38
|
+
type TextRunStyle = {
|
|
39
|
+
bold?: boolean;
|
|
40
|
+
italic?: boolean;
|
|
41
|
+
underline?: boolean;
|
|
42
|
+
strikethrough?: boolean;
|
|
43
|
+
superscript?: boolean;
|
|
44
|
+
subscript?: boolean;
|
|
45
|
+
fontSize?: number;
|
|
46
|
+
fontFamily?: string;
|
|
47
|
+
textColor?: string;
|
|
48
|
+
};
|
|
49
|
+
interface TextRun {
|
|
50
|
+
t: string;
|
|
51
|
+
s?: TextRunStyle;
|
|
52
|
+
}
|
|
53
|
+
interface CellStyle {
|
|
54
|
+
bold?: boolean;
|
|
55
|
+
italic?: boolean;
|
|
56
|
+
underline?: boolean;
|
|
57
|
+
strikethrough?: boolean;
|
|
58
|
+
superscript?: boolean;
|
|
59
|
+
subscript?: boolean;
|
|
60
|
+
fontSize?: number;
|
|
61
|
+
fontFamily?: string;
|
|
62
|
+
textColor?: string;
|
|
63
|
+
bgColor?: string;
|
|
64
|
+
align?: TextAlign;
|
|
65
|
+
verticalAlign?: VerticalAlign;
|
|
66
|
+
wrapText?: boolean;
|
|
67
|
+
shrinkToFit?: boolean;
|
|
68
|
+
borderTop?: BorderStyle;
|
|
69
|
+
borderRight?: BorderStyle;
|
|
70
|
+
borderBottom?: BorderStyle;
|
|
71
|
+
borderLeft?: BorderStyle;
|
|
72
|
+
borderColor?: string;
|
|
73
|
+
borderTopColor?: string;
|
|
74
|
+
borderRightColor?: string;
|
|
75
|
+
borderBottomColor?: string;
|
|
76
|
+
borderLeftColor?: string;
|
|
77
|
+
borderLinePattern?: BorderLinePattern;
|
|
78
|
+
borderTopPattern?: BorderLinePattern;
|
|
79
|
+
borderRightPattern?: BorderLinePattern;
|
|
80
|
+
borderBottomPattern?: BorderLinePattern;
|
|
81
|
+
borderLeftPattern?: BorderLinePattern;
|
|
82
|
+
/** 竖排文本(如 writing-mode:vertical-rl) */
|
|
83
|
+
writingMode?: string;
|
|
84
|
+
}
|
|
85
|
+
type EmbedAnchorRole = "chart" | "signature" | "image" | "qrcode" | "barcode";
|
|
86
|
+
type BaseTemplateCellBinding = {
|
|
87
|
+
kind: "basicField" | "dict" | "systemParam" | "mainField" | "subField" | "embedAnchor";
|
|
88
|
+
key: string;
|
|
89
|
+
subSchemaId?: number;
|
|
90
|
+
subRowSlot?: number;
|
|
91
|
+
displayText?: string;
|
|
92
|
+
embedRole?: EmbedAnchorRole;
|
|
93
|
+
};
|
|
94
|
+
interface CellData {
|
|
95
|
+
value: string;
|
|
96
|
+
style?: CellStyle;
|
|
97
|
+
runs?: TextRun[];
|
|
98
|
+
f?: string;
|
|
99
|
+
baseTemplateBinding?: BaseTemplateCellBinding;
|
|
100
|
+
designFieldLine?: string;
|
|
101
|
+
instanceEditable?: boolean;
|
|
102
|
+
/** 报表渲染:base64 或 URL 图片(优先于 value 显示) */
|
|
103
|
+
imageSrc?: string;
|
|
104
|
+
}
|
|
105
|
+
/** 合并区域:含端点,与 Excel 一致为矩形 inclusive */
|
|
106
|
+
interface MergeRange {
|
|
107
|
+
r1: number;
|
|
108
|
+
c1: number;
|
|
109
|
+
r2: number;
|
|
110
|
+
c2: number;
|
|
111
|
+
}
|
|
112
|
+
interface SheetTemplateState {
|
|
113
|
+
version: typeof SHEET_TEMPLATE_JSON_VERSION;
|
|
114
|
+
rowCount: number;
|
|
115
|
+
colCount: number;
|
|
116
|
+
defaultRowHeight: number;
|
|
117
|
+
defaultColWidth: number;
|
|
118
|
+
rowHeights?: number[];
|
|
119
|
+
colWidths?: number[];
|
|
120
|
+
cells: Record<string, CellData>;
|
|
121
|
+
merges: MergeRange[];
|
|
122
|
+
page: PageSettings;
|
|
123
|
+
}
|
|
124
|
+
declare const HEADER_ROW = 0;
|
|
125
|
+
declare const HEADER_COL = 0;
|
|
126
|
+
declare function cellKey(r: number, c: number): string;
|
|
127
|
+
declare function parseCellKey(key: string): {
|
|
128
|
+
r: number;
|
|
129
|
+
c: number;
|
|
130
|
+
} | null;
|
|
131
|
+
|
|
132
|
+
export { type BaseTemplateCellBinding, type BorderLinePattern, type BorderStyle, type CellData, type CellStyle, type EmbedAnchorRole, HEADER_COL, HEADER_ROW, type MergeRange, type PageMarginsCm, type PageRepeatRowsRange, type PageSettings, SHEET_TEMPLATE_JSON_VERSION, type SheetOrientation, type SheetPaperKind, type SheetTemplateState, type TextAlign, type TextRun, type TextRunStyle, type VerticalAlign, cellKey, parseCellKey };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(_0xef46c4,_0x4b4095){var _0x11de74=_0x2b05,_0x2ae0b6=_0xef46c4();while(!![]){try{var _0x388dc5=parseInt(_0x11de74(0x1e9))/0x1+-parseInt(_0x11de74(0x1e5))/0x2*(-parseInt(_0x11de74(0x1ec))/0x3)+parseInt(_0x11de74(0x1ed))/0x4*(-parseInt(_0x11de74(0x1eb))/0x5)+-parseInt(_0x11de74(0x1e2))/0x6+-parseInt(_0x11de74(0x1ea))/0x7*(parseInt(_0x11de74(0x1e8))/0x8)+parseInt(_0x11de74(0x1e6))/0x9*(-parseInt(_0x11de74(0x1e7))/0xa)+parseInt(_0x11de74(0x1e3))/0xb*(parseInt(_0x11de74(0x1e4))/0xc);if(_0x388dc5===_0x4b4095)break;else _0x2ae0b6['push'](_0x2ae0b6['shift']());}catch(_0xfbbe74){_0x2ae0b6['push'](_0x2ae0b6['shift']());}}}(_0x47c9,0x81223));function _0x47c9(){var _0x1d5d4c=['mti0mZHirervDK8','nZuYmfrvB1HwqW','mtzoCKr0rKu','mtG4mZG5BM9MtfbY','mZe2mZe3nenorwf4wa','nda0nZaYnxLoDxvREG','m1Hpy0XZvG','ngvZAKLHta','ndyZmtCWnLjdswHLta','mZq3ndC1n09bCerrDq','mta4uKXcAM53','mJa0mZG4nNzervruBa'];_0x47c9=function(){return _0x1d5d4c;};return _0x47c9();}function _0x2b05(_0x43bc01,_0x1c2586){_0x43bc01=_0x43bc01-0x1e2;var _0x47c99c=_0x47c9();var _0x2b05ec=_0x47c99c[_0x43bc01];if(_0x2b05['xlVvEa']===undefined){var _0x499a5d=function(_0x3d7fb9){var _0x47e3a6='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x4ee2c8='',_0x2d74c9='';for(var _0x382dea=0x0,_0x5dbf9c,_0xb352f5,_0xce557a=0x0;_0xb352f5=_0x3d7fb9['charAt'](_0xce557a++);~_0xb352f5&&(_0x5dbf9c=_0x382dea%0x4?_0x5dbf9c*0x40+_0xb352f5:_0xb352f5,_0x382dea++%0x4)?_0x4ee2c8+=String['fromCharCode'](0xff&_0x5dbf9c>>(-0x2*_0x382dea&0x6)):0x0){_0xb352f5=_0x47e3a6['indexOf'](_0xb352f5);}for(var _0x6f474c=0x0,_0xd9078=_0x4ee2c8['length'];_0x6f474c<_0xd9078;_0x6f474c++){_0x2d74c9+='%'+('00'+_0x4ee2c8['charCodeAt'](_0x6f474c)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x2d74c9);};_0x2b05['adzTOe']=_0x499a5d,_0x2b05['qccsRK']={},_0x2b05['xlVvEa']=!![];}var _0x285664=_0x47c99c[0x0];_0x2b05['YLGhnb']!==_0x285664&&(_0x2b05['qccsRK']={},_0x2b05['YLGhnb']=_0x285664);var _0xff6fa2=_0x2b05['qccsRK'][_0x43bc01];return _0xff6fa2===undefined?(_0x2b05ec=_0x2b05['adzTOe'](_0x2b05ec),_0x2b05['qccsRK'][_0x43bc01]=_0x2b05ec):_0x2b05ec=_0xff6fa2,_0x2b05ec;}export{HEADER_COL,HEADER_ROW,SHEET_TEMPLATE_JSON_VERSION,cellKey,parseCellKey}from'./chunk-2Z7KMZEW.js';
|