@canvas-components/xlsx-table 0.1.8 → 0.1.10
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 +51 -11
- package/dist/cleaning/xlsx-cleaning.worker.js +4714 -857
- package/dist/{sheet-settings-D8pfrp_9.d.cts → conditional-format-write-Bc3OgsuC.d.cts} +22 -2
- package/dist/{sheet-settings-ClWkuEGB.d.ts → conditional-format-write-CG9PYZBP.d.ts} +22 -2
- package/dist/file/index.cjs +5058 -2834
- package/dist/file/index.d.cts +4 -2
- package/dist/file/index.d.ts +4 -2
- package/dist/file/index.js +5058 -2835
- package/dist/file/ooxml/index.cjs +6245 -3959
- package/dist/file/ooxml/index.d.cts +4 -4
- package/dist/file/ooxml/index.d.ts +4 -4
- package/dist/file/ooxml/index.js +6240 -3960
- package/dist/file/ooxml/node.cjs +6247 -3961
- package/dist/file/ooxml/node.d.cts +4 -4
- package/dist/file/ooxml/node.d.ts +4 -4
- package/dist/file/ooxml/node.js +6242 -3962
- package/dist/file/xlsx-file.worker.js +6598 -4079
- package/dist/{file-DZPF-DHF.d.cts → file-BDNu6-B9.d.cts} +1 -1
- package/dist/{file-DZPF-DHF.d.ts → file-BDNu6-B9.d.ts} +1 -1
- package/dist/index.cjs +15577 -9037
- package/dist/index.d.cts +471 -147
- package/dist/index.d.ts +471 -147
- package/dist/index.js +15573 -9039
- package/dist/native-parts/worker-loader.d.ts +101 -0
- package/dist/native-parts/xlsx-native-parts.worker.js +4600 -286
- package/dist/{sheet-settings-CRncG11p.d.ts → sheet-settings-BLc17bPK.d.ts} +164 -43
- package/dist/{sheet-settings-Bv1KD6XD.d.cts → sheet-settings-Dvi6PLD0.d.cts} +164 -43
- package/package.json +3 -2
|
@@ -1,6 +1,161 @@
|
|
|
1
|
-
import { b as XlsxSourceDiagnostics } from './file-
|
|
1
|
+
import { b as XlsxSourceDiagnostics } from './file-BDNu6-B9.js';
|
|
2
2
|
import { CellObject } from 'xlsx';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* 单元格地址,内部 0 基索引。
|
|
6
|
+
*/
|
|
7
|
+
interface XlsxCellAddress {
|
|
8
|
+
rowIndex: number;
|
|
9
|
+
columnIndex: number;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* 矩形选区,内部 0 基索引。
|
|
13
|
+
*/
|
|
14
|
+
interface XlsxCellRange {
|
|
15
|
+
startRowIndex: number;
|
|
16
|
+
startColumnIndex: number;
|
|
17
|
+
endRowIndex: number;
|
|
18
|
+
endColumnIndex: number;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* 列名工具:0 -> A, 25 -> Z, 26 -> AA。
|
|
22
|
+
*/
|
|
23
|
+
declare function columnIndexToName(columnIndex: number): string;
|
|
24
|
+
/**
|
|
25
|
+
* 列名转索引:A -> 0, Z -> 25, AA -> 26。
|
|
26
|
+
*/
|
|
27
|
+
declare function columnNameToIndex(name: string): number;
|
|
28
|
+
/**
|
|
29
|
+
* 生成内部 cell key。
|
|
30
|
+
*/
|
|
31
|
+
declare function getCellKey(rowIndex: number, columnIndex: number): string;
|
|
32
|
+
/**
|
|
33
|
+
* 解析 cell key。
|
|
34
|
+
*/
|
|
35
|
+
declare function parseCellKey(key: string): XlsxCellAddress | null;
|
|
36
|
+
/**
|
|
37
|
+
* 地址转 A1 文本。
|
|
38
|
+
*/
|
|
39
|
+
declare function addressToA1(address: XlsxCellAddress): string;
|
|
40
|
+
/**
|
|
41
|
+
* 归一化矩形选区。
|
|
42
|
+
*/
|
|
43
|
+
declare function normalizeRange(range: XlsxCellRange): XlsxCellRange;
|
|
44
|
+
|
|
45
|
+
/** 从源 XML 读取的差异样式,只含显式声明的样式属性。 */
|
|
46
|
+
interface XlsxConditionalDifferentialStyle {
|
|
47
|
+
font?: Record<string, unknown>;
|
|
48
|
+
fill?: Record<string, unknown>;
|
|
49
|
+
border?: Record<string, unknown>;
|
|
50
|
+
numFmt?: {
|
|
51
|
+
numFmtId: number;
|
|
52
|
+
formatCode?: string;
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
/** dxfId 是 entries 的零基下标。 */
|
|
56
|
+
interface XlsxDxfCatalog {
|
|
57
|
+
/** 自定义索引色盘;缺少此项时使用默认 Excel 色盘,null 保留无效槽位。 */
|
|
58
|
+
indexedColors?: (string | null)[];
|
|
59
|
+
entries: {
|
|
60
|
+
style: XlsxConditionalDifferentialStyle;
|
|
61
|
+
rawXml: string;
|
|
62
|
+
restrictions: string[];
|
|
63
|
+
}[];
|
|
64
|
+
}
|
|
65
|
+
declare const nativeConditionalRuleTypes: readonly ["cellIs", "expression", "containsText", "notContainsText", "beginsWith", "endsWith", "containsBlanks", "notContainsBlanks", "duplicateValues", "uniqueValues", "aboveAverage", "top10", "colorScale", "dataBar", "iconSet", "timePeriod", "containsErrors", "notContainsErrors"];
|
|
66
|
+
/** 标准 SpreadsheetML 图标集名称。 */
|
|
67
|
+
declare const nativeConditionalIconSets: readonly ["3Arrows", "3ArrowsGray", "3Flags", "3TrafficLights1", "3TrafficLights2", "3Signs", "3Symbols", "3Symbols2", "4Arrows", "4ArrowsGray", "4RedToBlack", "4Rating", "4TrafficLights", "5Arrows", "5ArrowsGray", "5Rating", "5Quarters"];
|
|
68
|
+
interface XlsxConditionalThreshold {
|
|
69
|
+
type: "min" | "max" | "num" | "percent" | "percentile" | "formula";
|
|
70
|
+
val?: string;
|
|
71
|
+
gte?: boolean;
|
|
72
|
+
}
|
|
73
|
+
interface XlsxConditionalColorScale {
|
|
74
|
+
thresholds: XlsxConditionalThreshold[];
|
|
75
|
+
colors: Record<string, unknown>[];
|
|
76
|
+
}
|
|
77
|
+
interface XlsxConditionalDataBar {
|
|
78
|
+
thresholds: XlsxConditionalThreshold[];
|
|
79
|
+
color: Record<string, unknown>;
|
|
80
|
+
showValue?: boolean;
|
|
81
|
+
minLength?: number;
|
|
82
|
+
maxLength?: number;
|
|
83
|
+
/** 已从关联 x14 节点验证的轴位置。 */
|
|
84
|
+
axisPosition?: "none";
|
|
85
|
+
}
|
|
86
|
+
interface XlsxConditionalIconSet {
|
|
87
|
+
thresholds: XlsxConditionalThreshold[];
|
|
88
|
+
iconSet: string;
|
|
89
|
+
showValue?: boolean;
|
|
90
|
+
reverse?: boolean;
|
|
91
|
+
percent?: boolean;
|
|
92
|
+
}
|
|
93
|
+
/** 条件规则投影保留原文;无效的优先级不分配替代值。 */
|
|
94
|
+
interface XlsxConditionalFormattingRule {
|
|
95
|
+
type: (typeof nativeConditionalRuleTypes)[number] | "unknown";
|
|
96
|
+
rawXml: string;
|
|
97
|
+
editRestriction?: string;
|
|
98
|
+
linkedExtension?: {
|
|
99
|
+
id: string;
|
|
100
|
+
rawXml: string;
|
|
101
|
+
};
|
|
102
|
+
priority?: number;
|
|
103
|
+
stopIfTrue?: boolean;
|
|
104
|
+
dxfId?: number;
|
|
105
|
+
aboveAverage?: boolean;
|
|
106
|
+
equalAverage?: boolean;
|
|
107
|
+
stdDev?: number;
|
|
108
|
+
rank?: number;
|
|
109
|
+
percent?: boolean;
|
|
110
|
+
bottom?: boolean;
|
|
111
|
+
timePeriod?: string;
|
|
112
|
+
colorScale?: XlsxConditionalColorScale;
|
|
113
|
+
dataBar?: XlsxConditionalDataBar;
|
|
114
|
+
iconSet?: XlsxConditionalIconSet;
|
|
115
|
+
operator?: string;
|
|
116
|
+
text?: string;
|
|
117
|
+
formula: string[];
|
|
118
|
+
unknownAttributes: string[];
|
|
119
|
+
restrictions: string[];
|
|
120
|
+
}
|
|
121
|
+
/** 区块编号仅用于当前工作表内定位。 */
|
|
122
|
+
interface XlsxConditionalFormattingBlock {
|
|
123
|
+
id: string;
|
|
124
|
+
rawSqref: string;
|
|
125
|
+
sqref: XlsxCellRange[];
|
|
126
|
+
rawXml: string;
|
|
127
|
+
rules: XlsxConditionalFormattingRule[];
|
|
128
|
+
unknownAttributes: string[];
|
|
129
|
+
restrictions: string[];
|
|
130
|
+
}
|
|
131
|
+
interface XlsxConditionalFormattingProjection {
|
|
132
|
+
sheetName: string;
|
|
133
|
+
restriction?: string;
|
|
134
|
+
blocks: XlsxConditionalFormattingBlock[];
|
|
135
|
+
warnings: string[];
|
|
136
|
+
}
|
|
137
|
+
/** 规则编辑参数;省略 priority 时沿用原优先级或追加在末尾。 */
|
|
138
|
+
interface XlsxConditionalRuleDraft extends Partial<Pick<XlsxConditionalFormattingRule, "operator" | "text" | "formula" | "priority" | "stopIfTrue" | "dxfId" | "aboveAverage" | "equalAverage" | "stdDev" | "rank" | "percent" | "bottom" | "timePeriod" | "colorScale" | "dataBar" | "iconSet">> {
|
|
139
|
+
type: Exclude<XlsxConditionalFormattingRule["type"], "unknown">;
|
|
140
|
+
range: XlsxCellRange[];
|
|
141
|
+
style?: XlsxConditionalDifferentialStyle;
|
|
142
|
+
}
|
|
143
|
+
/** ruleId 使用当前投影的区块序号/规则序号,与 stamp 一起定位。 */
|
|
144
|
+
type XlsxConditionalFormatPatch = {
|
|
145
|
+
kind: "insert";
|
|
146
|
+
draft: XlsxConditionalRuleDraft;
|
|
147
|
+
} | {
|
|
148
|
+
kind: "update";
|
|
149
|
+
ruleId: string;
|
|
150
|
+
draft: XlsxConditionalRuleDraft;
|
|
151
|
+
} | {
|
|
152
|
+
kind: "delete";
|
|
153
|
+
ruleId: string;
|
|
154
|
+
} | {
|
|
155
|
+
kind: "reorder";
|
|
156
|
+
ruleIds: string[];
|
|
157
|
+
};
|
|
158
|
+
|
|
4
159
|
/** 标准files条目的公开字节字段;其余原生元数据原样保留。 */
|
|
5
160
|
interface XlsxNativeFileEntry {
|
|
6
161
|
name: string;
|
|
@@ -17,6 +172,10 @@ interface XlsxNativePartChange {
|
|
|
17
172
|
}
|
|
18
173
|
interface XlsxNativeTransaction extends XlsxNativeCellTransaction {
|
|
19
174
|
parts: XlsxNativePartChange[];
|
|
175
|
+
conditionalFormatting?: {
|
|
176
|
+
sheetName: string;
|
|
177
|
+
patch: XlsxConditionalFormatPatch;
|
|
178
|
+
};
|
|
20
179
|
}
|
|
21
180
|
/** 只保存本次触及的标准部件,不复制其余原生包。 */
|
|
22
181
|
interface XlsxNativePartSnapshot {
|
|
@@ -25,6 +184,8 @@ interface XlsxNativePartSnapshot {
|
|
|
25
184
|
}
|
|
26
185
|
interface XlsxNativePartsHistoryEntry {
|
|
27
186
|
kind: "native-parts";
|
|
187
|
+
/** 当前协同协议无法重放规则与 dxf 的联合修改。 */
|
|
188
|
+
conditionalFormatting?: true;
|
|
28
189
|
before: XlsxNativeCellChange[];
|
|
29
190
|
after: XlsxNativeCellChange[];
|
|
30
191
|
beforeRefs: Record<string, string | undefined>;
|
|
@@ -60,6 +221,7 @@ interface XlsxNativeCellChange {
|
|
|
60
221
|
}
|
|
61
222
|
/** 原生多表单元格事务。 */
|
|
62
223
|
interface XlsxNativeCellTransaction {
|
|
224
|
+
acceptValidationWarnings?: boolean;
|
|
63
225
|
stamp: XlsxDocumentStamp;
|
|
64
226
|
changes: XlsxNativeCellChange[];
|
|
65
227
|
}
|
|
@@ -73,47 +235,6 @@ type XlsxNativeCommitResult = {
|
|
|
73
235
|
reason: string;
|
|
74
236
|
};
|
|
75
237
|
|
|
76
|
-
/**
|
|
77
|
-
* 单元格地址,内部 0 基索引。
|
|
78
|
-
*/
|
|
79
|
-
interface XlsxCellAddress {
|
|
80
|
-
rowIndex: number;
|
|
81
|
-
columnIndex: number;
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* 矩形选区,内部 0 基索引。
|
|
85
|
-
*/
|
|
86
|
-
interface XlsxCellRange {
|
|
87
|
-
startRowIndex: number;
|
|
88
|
-
startColumnIndex: number;
|
|
89
|
-
endRowIndex: number;
|
|
90
|
-
endColumnIndex: number;
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* 列名工具:0 -> A, 25 -> Z, 26 -> AA。
|
|
94
|
-
*/
|
|
95
|
-
declare function columnIndexToName(columnIndex: number): string;
|
|
96
|
-
/**
|
|
97
|
-
* 列名转索引:A -> 0, Z -> 25, AA -> 26。
|
|
98
|
-
*/
|
|
99
|
-
declare function columnNameToIndex(name: string): number;
|
|
100
|
-
/**
|
|
101
|
-
* 生成内部 cell key。
|
|
102
|
-
*/
|
|
103
|
-
declare function getCellKey(rowIndex: number, columnIndex: number): string;
|
|
104
|
-
/**
|
|
105
|
-
* 解析 cell key。
|
|
106
|
-
*/
|
|
107
|
-
declare function parseCellKey(key: string): XlsxCellAddress | null;
|
|
108
|
-
/**
|
|
109
|
-
* 地址转 A1 文本。
|
|
110
|
-
*/
|
|
111
|
-
declare function addressToA1(address: XlsxCellAddress): string;
|
|
112
|
-
/**
|
|
113
|
-
* 归一化矩形选区。
|
|
114
|
-
*/
|
|
115
|
-
declare function normalizeRange(range: XlsxCellRange): XlsxCellRange;
|
|
116
|
-
|
|
117
238
|
type XlsxCellValue = string | number | boolean | Date | null;
|
|
118
239
|
type XlsxCellType = "text" | "number" | "money" | "percent" | "date" | "datetime" | "boolean";
|
|
119
240
|
type XlsxCellBorderLineStyle = "solid" | "dashed" | "dotted";
|
|
@@ -298,4 +419,4 @@ interface XlsxNativeSheetSettingsPatch {
|
|
|
298
419
|
} | null;
|
|
299
420
|
}
|
|
300
421
|
|
|
301
|
-
export { type
|
|
422
|
+
export { columnIndexToName as $, type XlsxFilterCondition as A, type XlsxFilterConditionRelation as B, type XlsxSortDirection as C, type XlsxNativeTransactionResult as D, type XlsxNativeCommitResult as E, type XlsxPrintOptions as F, type XlsxPrintPlan as G, type XlsxNativeCellTransaction as H, type XlsxNamedRange as I, type XlsxCellStyle as J, type XlsxCellBorderPreset as K, type XlsxCellBorderLine as L, type XlsxCellBorderLineStyle as M, type XlsxCellBorders as N, type XlsxColumnFilterState as O, type XlsxConditionalColorScale as P, type XlsxConditionalDataBar as Q, type XlsxConditionalIconSet as R, type XlsxConditionalThreshold as S, type XlsxFilterConditionOperator as T, type XlsxNativePartChange as U, type XlsxNativePartSnapshot as V, type XlsxPrintCell as W, type XlsxConditionalDifferentialStyle as X, type XlsxPrintPage as Y, type XlsxResolvedPrintOptions as Z, addressToA1 as _, type XlsxConditionalFormatPatch as a, columnNameToIndex as a0, getCellKey as a1, nativeConditionalIconSets as a2, nativeConditionalRuleTypes as a3, normalizeRange as a4, parseCellKey as a5, type XlsxConditionalFormattingBlock as b, type XlsxConditionalFormattingProjection as c, type XlsxConditionalFormattingRule as d, type XlsxConditionalRuleDraft as e, type XlsxDxfCatalog as f, type XlsxNativeSheetSettings as g, type XlsxNativeSheetSettingsPatch as h, type XlsxSavedPrintOptions as i, type XlsxDocumentStamp as j, type XlsxNativeTransaction as k, type XlsxCellRange as l, type XlsxNativeCellChange as m, type XlsxCellAddress as n, type XlsxCellValue as o, type XlsxCellType as p, type XlsxNativePartsHistoryEntry as q, type XlsxRowConfig as r, type XlsxColumnConfig as s, type XlsxSheetFilterState as t, type XlsxFrozenPane as u, type XlsxMergedRange as v, type XlsxSheetSortState as w, type XlsxRemoteSelection as x, type XlsxCollaborator as y, type XlsxFilterValue as z };
|
|
@@ -1,6 +1,161 @@
|
|
|
1
|
-
import { b as XlsxSourceDiagnostics } from './file-
|
|
1
|
+
import { b as XlsxSourceDiagnostics } from './file-BDNu6-B9.cjs';
|
|
2
2
|
import { CellObject } from 'xlsx';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* 单元格地址,内部 0 基索引。
|
|
6
|
+
*/
|
|
7
|
+
interface XlsxCellAddress {
|
|
8
|
+
rowIndex: number;
|
|
9
|
+
columnIndex: number;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* 矩形选区,内部 0 基索引。
|
|
13
|
+
*/
|
|
14
|
+
interface XlsxCellRange {
|
|
15
|
+
startRowIndex: number;
|
|
16
|
+
startColumnIndex: number;
|
|
17
|
+
endRowIndex: number;
|
|
18
|
+
endColumnIndex: number;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* 列名工具:0 -> A, 25 -> Z, 26 -> AA。
|
|
22
|
+
*/
|
|
23
|
+
declare function columnIndexToName(columnIndex: number): string;
|
|
24
|
+
/**
|
|
25
|
+
* 列名转索引:A -> 0, Z -> 25, AA -> 26。
|
|
26
|
+
*/
|
|
27
|
+
declare function columnNameToIndex(name: string): number;
|
|
28
|
+
/**
|
|
29
|
+
* 生成内部 cell key。
|
|
30
|
+
*/
|
|
31
|
+
declare function getCellKey(rowIndex: number, columnIndex: number): string;
|
|
32
|
+
/**
|
|
33
|
+
* 解析 cell key。
|
|
34
|
+
*/
|
|
35
|
+
declare function parseCellKey(key: string): XlsxCellAddress | null;
|
|
36
|
+
/**
|
|
37
|
+
* 地址转 A1 文本。
|
|
38
|
+
*/
|
|
39
|
+
declare function addressToA1(address: XlsxCellAddress): string;
|
|
40
|
+
/**
|
|
41
|
+
* 归一化矩形选区。
|
|
42
|
+
*/
|
|
43
|
+
declare function normalizeRange(range: XlsxCellRange): XlsxCellRange;
|
|
44
|
+
|
|
45
|
+
/** 从源 XML 读取的差异样式,只含显式声明的样式属性。 */
|
|
46
|
+
interface XlsxConditionalDifferentialStyle {
|
|
47
|
+
font?: Record<string, unknown>;
|
|
48
|
+
fill?: Record<string, unknown>;
|
|
49
|
+
border?: Record<string, unknown>;
|
|
50
|
+
numFmt?: {
|
|
51
|
+
numFmtId: number;
|
|
52
|
+
formatCode?: string;
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
/** dxfId 是 entries 的零基下标。 */
|
|
56
|
+
interface XlsxDxfCatalog {
|
|
57
|
+
/** 自定义索引色盘;缺少此项时使用默认 Excel 色盘,null 保留无效槽位。 */
|
|
58
|
+
indexedColors?: (string | null)[];
|
|
59
|
+
entries: {
|
|
60
|
+
style: XlsxConditionalDifferentialStyle;
|
|
61
|
+
rawXml: string;
|
|
62
|
+
restrictions: string[];
|
|
63
|
+
}[];
|
|
64
|
+
}
|
|
65
|
+
declare const nativeConditionalRuleTypes: readonly ["cellIs", "expression", "containsText", "notContainsText", "beginsWith", "endsWith", "containsBlanks", "notContainsBlanks", "duplicateValues", "uniqueValues", "aboveAverage", "top10", "colorScale", "dataBar", "iconSet", "timePeriod", "containsErrors", "notContainsErrors"];
|
|
66
|
+
/** 标准 SpreadsheetML 图标集名称。 */
|
|
67
|
+
declare const nativeConditionalIconSets: readonly ["3Arrows", "3ArrowsGray", "3Flags", "3TrafficLights1", "3TrafficLights2", "3Signs", "3Symbols", "3Symbols2", "4Arrows", "4ArrowsGray", "4RedToBlack", "4Rating", "4TrafficLights", "5Arrows", "5ArrowsGray", "5Rating", "5Quarters"];
|
|
68
|
+
interface XlsxConditionalThreshold {
|
|
69
|
+
type: "min" | "max" | "num" | "percent" | "percentile" | "formula";
|
|
70
|
+
val?: string;
|
|
71
|
+
gte?: boolean;
|
|
72
|
+
}
|
|
73
|
+
interface XlsxConditionalColorScale {
|
|
74
|
+
thresholds: XlsxConditionalThreshold[];
|
|
75
|
+
colors: Record<string, unknown>[];
|
|
76
|
+
}
|
|
77
|
+
interface XlsxConditionalDataBar {
|
|
78
|
+
thresholds: XlsxConditionalThreshold[];
|
|
79
|
+
color: Record<string, unknown>;
|
|
80
|
+
showValue?: boolean;
|
|
81
|
+
minLength?: number;
|
|
82
|
+
maxLength?: number;
|
|
83
|
+
/** 已从关联 x14 节点验证的轴位置。 */
|
|
84
|
+
axisPosition?: "none";
|
|
85
|
+
}
|
|
86
|
+
interface XlsxConditionalIconSet {
|
|
87
|
+
thresholds: XlsxConditionalThreshold[];
|
|
88
|
+
iconSet: string;
|
|
89
|
+
showValue?: boolean;
|
|
90
|
+
reverse?: boolean;
|
|
91
|
+
percent?: boolean;
|
|
92
|
+
}
|
|
93
|
+
/** 条件规则投影保留原文;无效的优先级不分配替代值。 */
|
|
94
|
+
interface XlsxConditionalFormattingRule {
|
|
95
|
+
type: (typeof nativeConditionalRuleTypes)[number] | "unknown";
|
|
96
|
+
rawXml: string;
|
|
97
|
+
editRestriction?: string;
|
|
98
|
+
linkedExtension?: {
|
|
99
|
+
id: string;
|
|
100
|
+
rawXml: string;
|
|
101
|
+
};
|
|
102
|
+
priority?: number;
|
|
103
|
+
stopIfTrue?: boolean;
|
|
104
|
+
dxfId?: number;
|
|
105
|
+
aboveAverage?: boolean;
|
|
106
|
+
equalAverage?: boolean;
|
|
107
|
+
stdDev?: number;
|
|
108
|
+
rank?: number;
|
|
109
|
+
percent?: boolean;
|
|
110
|
+
bottom?: boolean;
|
|
111
|
+
timePeriod?: string;
|
|
112
|
+
colorScale?: XlsxConditionalColorScale;
|
|
113
|
+
dataBar?: XlsxConditionalDataBar;
|
|
114
|
+
iconSet?: XlsxConditionalIconSet;
|
|
115
|
+
operator?: string;
|
|
116
|
+
text?: string;
|
|
117
|
+
formula: string[];
|
|
118
|
+
unknownAttributes: string[];
|
|
119
|
+
restrictions: string[];
|
|
120
|
+
}
|
|
121
|
+
/** 区块编号仅用于当前工作表内定位。 */
|
|
122
|
+
interface XlsxConditionalFormattingBlock {
|
|
123
|
+
id: string;
|
|
124
|
+
rawSqref: string;
|
|
125
|
+
sqref: XlsxCellRange[];
|
|
126
|
+
rawXml: string;
|
|
127
|
+
rules: XlsxConditionalFormattingRule[];
|
|
128
|
+
unknownAttributes: string[];
|
|
129
|
+
restrictions: string[];
|
|
130
|
+
}
|
|
131
|
+
interface XlsxConditionalFormattingProjection {
|
|
132
|
+
sheetName: string;
|
|
133
|
+
restriction?: string;
|
|
134
|
+
blocks: XlsxConditionalFormattingBlock[];
|
|
135
|
+
warnings: string[];
|
|
136
|
+
}
|
|
137
|
+
/** 规则编辑参数;省略 priority 时沿用原优先级或追加在末尾。 */
|
|
138
|
+
interface XlsxConditionalRuleDraft extends Partial<Pick<XlsxConditionalFormattingRule, "operator" | "text" | "formula" | "priority" | "stopIfTrue" | "dxfId" | "aboveAverage" | "equalAverage" | "stdDev" | "rank" | "percent" | "bottom" | "timePeriod" | "colorScale" | "dataBar" | "iconSet">> {
|
|
139
|
+
type: Exclude<XlsxConditionalFormattingRule["type"], "unknown">;
|
|
140
|
+
range: XlsxCellRange[];
|
|
141
|
+
style?: XlsxConditionalDifferentialStyle;
|
|
142
|
+
}
|
|
143
|
+
/** ruleId 使用当前投影的区块序号/规则序号,与 stamp 一起定位。 */
|
|
144
|
+
type XlsxConditionalFormatPatch = {
|
|
145
|
+
kind: "insert";
|
|
146
|
+
draft: XlsxConditionalRuleDraft;
|
|
147
|
+
} | {
|
|
148
|
+
kind: "update";
|
|
149
|
+
ruleId: string;
|
|
150
|
+
draft: XlsxConditionalRuleDraft;
|
|
151
|
+
} | {
|
|
152
|
+
kind: "delete";
|
|
153
|
+
ruleId: string;
|
|
154
|
+
} | {
|
|
155
|
+
kind: "reorder";
|
|
156
|
+
ruleIds: string[];
|
|
157
|
+
};
|
|
158
|
+
|
|
4
159
|
/** 标准files条目的公开字节字段;其余原生元数据原样保留。 */
|
|
5
160
|
interface XlsxNativeFileEntry {
|
|
6
161
|
name: string;
|
|
@@ -17,6 +172,10 @@ interface XlsxNativePartChange {
|
|
|
17
172
|
}
|
|
18
173
|
interface XlsxNativeTransaction extends XlsxNativeCellTransaction {
|
|
19
174
|
parts: XlsxNativePartChange[];
|
|
175
|
+
conditionalFormatting?: {
|
|
176
|
+
sheetName: string;
|
|
177
|
+
patch: XlsxConditionalFormatPatch;
|
|
178
|
+
};
|
|
20
179
|
}
|
|
21
180
|
/** 只保存本次触及的标准部件,不复制其余原生包。 */
|
|
22
181
|
interface XlsxNativePartSnapshot {
|
|
@@ -25,6 +184,8 @@ interface XlsxNativePartSnapshot {
|
|
|
25
184
|
}
|
|
26
185
|
interface XlsxNativePartsHistoryEntry {
|
|
27
186
|
kind: "native-parts";
|
|
187
|
+
/** 当前协同协议无法重放规则与 dxf 的联合修改。 */
|
|
188
|
+
conditionalFormatting?: true;
|
|
28
189
|
before: XlsxNativeCellChange[];
|
|
29
190
|
after: XlsxNativeCellChange[];
|
|
30
191
|
beforeRefs: Record<string, string | undefined>;
|
|
@@ -60,6 +221,7 @@ interface XlsxNativeCellChange {
|
|
|
60
221
|
}
|
|
61
222
|
/** 原生多表单元格事务。 */
|
|
62
223
|
interface XlsxNativeCellTransaction {
|
|
224
|
+
acceptValidationWarnings?: boolean;
|
|
63
225
|
stamp: XlsxDocumentStamp;
|
|
64
226
|
changes: XlsxNativeCellChange[];
|
|
65
227
|
}
|
|
@@ -73,47 +235,6 @@ type XlsxNativeCommitResult = {
|
|
|
73
235
|
reason: string;
|
|
74
236
|
};
|
|
75
237
|
|
|
76
|
-
/**
|
|
77
|
-
* 单元格地址,内部 0 基索引。
|
|
78
|
-
*/
|
|
79
|
-
interface XlsxCellAddress {
|
|
80
|
-
rowIndex: number;
|
|
81
|
-
columnIndex: number;
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* 矩形选区,内部 0 基索引。
|
|
85
|
-
*/
|
|
86
|
-
interface XlsxCellRange {
|
|
87
|
-
startRowIndex: number;
|
|
88
|
-
startColumnIndex: number;
|
|
89
|
-
endRowIndex: number;
|
|
90
|
-
endColumnIndex: number;
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* 列名工具:0 -> A, 25 -> Z, 26 -> AA。
|
|
94
|
-
*/
|
|
95
|
-
declare function columnIndexToName(columnIndex: number): string;
|
|
96
|
-
/**
|
|
97
|
-
* 列名转索引:A -> 0, Z -> 25, AA -> 26。
|
|
98
|
-
*/
|
|
99
|
-
declare function columnNameToIndex(name: string): number;
|
|
100
|
-
/**
|
|
101
|
-
* 生成内部 cell key。
|
|
102
|
-
*/
|
|
103
|
-
declare function getCellKey(rowIndex: number, columnIndex: number): string;
|
|
104
|
-
/**
|
|
105
|
-
* 解析 cell key。
|
|
106
|
-
*/
|
|
107
|
-
declare function parseCellKey(key: string): XlsxCellAddress | null;
|
|
108
|
-
/**
|
|
109
|
-
* 地址转 A1 文本。
|
|
110
|
-
*/
|
|
111
|
-
declare function addressToA1(address: XlsxCellAddress): string;
|
|
112
|
-
/**
|
|
113
|
-
* 归一化矩形选区。
|
|
114
|
-
*/
|
|
115
|
-
declare function normalizeRange(range: XlsxCellRange): XlsxCellRange;
|
|
116
|
-
|
|
117
238
|
type XlsxCellValue = string | number | boolean | Date | null;
|
|
118
239
|
type XlsxCellType = "text" | "number" | "money" | "percent" | "date" | "datetime" | "boolean";
|
|
119
240
|
type XlsxCellBorderLineStyle = "solid" | "dashed" | "dotted";
|
|
@@ -298,4 +419,4 @@ interface XlsxNativeSheetSettingsPatch {
|
|
|
298
419
|
} | null;
|
|
299
420
|
}
|
|
300
421
|
|
|
301
|
-
export { type
|
|
422
|
+
export { columnIndexToName as $, type XlsxFilterCondition as A, type XlsxFilterConditionRelation as B, type XlsxSortDirection as C, type XlsxNativeTransactionResult as D, type XlsxNativeCommitResult as E, type XlsxPrintOptions as F, type XlsxPrintPlan as G, type XlsxNativeCellTransaction as H, type XlsxNamedRange as I, type XlsxCellStyle as J, type XlsxCellBorderPreset as K, type XlsxCellBorderLine as L, type XlsxCellBorderLineStyle as M, type XlsxCellBorders as N, type XlsxColumnFilterState as O, type XlsxConditionalColorScale as P, type XlsxConditionalDataBar as Q, type XlsxConditionalIconSet as R, type XlsxConditionalThreshold as S, type XlsxFilterConditionOperator as T, type XlsxNativePartChange as U, type XlsxNativePartSnapshot as V, type XlsxPrintCell as W, type XlsxConditionalDifferentialStyle as X, type XlsxPrintPage as Y, type XlsxResolvedPrintOptions as Z, addressToA1 as _, type XlsxConditionalFormatPatch as a, columnNameToIndex as a0, getCellKey as a1, nativeConditionalIconSets as a2, nativeConditionalRuleTypes as a3, normalizeRange as a4, parseCellKey as a5, type XlsxConditionalFormattingBlock as b, type XlsxConditionalFormattingProjection as c, type XlsxConditionalFormattingRule as d, type XlsxConditionalRuleDraft as e, type XlsxDxfCatalog as f, type XlsxNativeSheetSettings as g, type XlsxNativeSheetSettingsPatch as h, type XlsxSavedPrintOptions as i, type XlsxDocumentStamp as j, type XlsxNativeTransaction as k, type XlsxCellRange as l, type XlsxNativeCellChange as m, type XlsxCellAddress as n, type XlsxCellValue as o, type XlsxCellType as p, type XlsxNativePartsHistoryEntry as q, type XlsxRowConfig as r, type XlsxColumnConfig as s, type XlsxSheetFilterState as t, type XlsxFrozenPane as u, type XlsxMergedRange as v, type XlsxSheetSortState as w, type XlsxRemoteSelection as x, type XlsxCollaborator as y, type XlsxFilterValue as z };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@canvas-components/xlsx-table",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.10",
|
|
4
4
|
"description": "Framework-agnostic canvas spreadsheet core for xlsx-table.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -60,7 +60,8 @@
|
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
62
|
"xlsx": "^0.18.5",
|
|
63
|
-
"@canvas-components/
|
|
63
|
+
"@canvas-components/chart": "0.3.10",
|
|
64
|
+
"@canvas-components/utils": "0.2.12"
|
|
64
65
|
},
|
|
65
66
|
"scripts": {
|
|
66
67
|
"build": "tsup --config tsup.config.ts && tsup --config tsup.worker.config.ts"
|