xiaodao-spreader 0.1.32 → 0.1.34
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.ZH.md +52 -1
- package/README.md +52 -1
- package/dist/style.css +1 -1
- package/dist/types/components/spreader/components/conditional-format-manager.vue.d.ts +25 -0
- package/dist/types/components/spreader/components/conditional-format-menu.vue.d.ts +25 -0
- package/dist/types/components/spreader/components/conditional-format-rule-editor.vue.d.ts +23 -0
- package/dist/types/components/spreader/components/dropdown.vue.d.ts +3 -0
- package/dist/types/components/spreader/components/find-replace-bar.vue.d.ts +1 -0
- package/dist/types/components/spreader/components/spreader.vue.d.ts +263 -1
- package/dist/types/components/spreader/components/toolbar.vue.d.ts +14 -1
- package/dist/types/components/spreader/composables/core-state.d.ts +9 -1
- package/dist/types/components/spreader/core/conditional-formatting.d.ts +61 -0
- package/dist/types/components/spreader/core/constants.d.ts +2 -0
- package/dist/types/components/spreader/core/formula.d.ts +9 -0
- package/dist/types/components/spreader/core/types.d.ts +76 -0
- package/dist/xiaodao-spreader.es.js +7772 -6031
- package/dist/xiaodao-spreader.umd.js +9 -9
- package/package.json +1 -1
|
@@ -19,5 +19,267 @@ declare const _default: import("vue").DefineComponent<__VLS_PublicProps, {}, {},
|
|
|
19
19
|
rowCount: number;
|
|
20
20
|
colCount: number;
|
|
21
21
|
theme: "light" | "dark";
|
|
22
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {
|
|
22
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {
|
|
23
|
+
toolbarRef: import("vue").CreateComponentPublicInstanceWithMixins<Readonly<{
|
|
24
|
+
locale: string;
|
|
25
|
+
canUndo: boolean;
|
|
26
|
+
canRedo: boolean;
|
|
27
|
+
paintFmtActive: boolean;
|
|
28
|
+
hasSelection: boolean;
|
|
29
|
+
fontFamilyOptions: import("../core/constants").FontOption[];
|
|
30
|
+
fontSizeOptions: import("../core/constants").FontOption[];
|
|
31
|
+
selFontFamily: string | number;
|
|
32
|
+
selFontSize: number;
|
|
33
|
+
fontSizeInput: string;
|
|
34
|
+
fontSizeMenuOpen: boolean;
|
|
35
|
+
selFontWeight: boolean;
|
|
36
|
+
selFontStyle: boolean;
|
|
37
|
+
selUnderline: boolean;
|
|
38
|
+
selStrikethrough: boolean;
|
|
39
|
+
selTextColor: string;
|
|
40
|
+
textColorMenuOpen: boolean;
|
|
41
|
+
selFillColor: string;
|
|
42
|
+
fillColorMenuOpen: boolean;
|
|
43
|
+
cachedTextColor: string;
|
|
44
|
+
cachedFillColor: string;
|
|
45
|
+
borderMenuOpen: boolean;
|
|
46
|
+
cachedBorder: import("@/components/spreader/components/pickers/borderPicker.vue").BorderType;
|
|
47
|
+
sortMenuOpen: boolean;
|
|
48
|
+
cachedSortOrder: import("@/components/spreader/core/sort-core.ts").SortOrder;
|
|
49
|
+
canSort: boolean;
|
|
50
|
+
canFilter: boolean;
|
|
51
|
+
filterActive: boolean;
|
|
52
|
+
selHAlign: string;
|
|
53
|
+
selVAlign: string;
|
|
54
|
+
selWrap: boolean;
|
|
55
|
+
hAlignOptions: import("../core/constants").FontOption[];
|
|
56
|
+
vAlignOptions: import("../core/constants").FontOption[];
|
|
57
|
+
mergeMenuOpen: boolean;
|
|
58
|
+
calcMenuOpen: boolean;
|
|
59
|
+
isSingleCell: boolean;
|
|
60
|
+
hasFreeze: boolean;
|
|
61
|
+
freezePanesDisabled: boolean;
|
|
62
|
+
themeVars?: Record<string, string> | undefined;
|
|
63
|
+
selNumberFormat: string;
|
|
64
|
+
nfOptions: import("../core/number-format").NFOption[];
|
|
65
|
+
canIncreaseDecimals: boolean;
|
|
66
|
+
canDecreaseDecimals: boolean;
|
|
67
|
+
}> & Readonly<{
|
|
68
|
+
onUndo?: (() => any) | undefined;
|
|
69
|
+
onRedo?: (() => any) | undefined;
|
|
70
|
+
onFind?: (() => any) | undefined;
|
|
71
|
+
"onPaint-format"?: (() => any) | undefined;
|
|
72
|
+
"onClear-format"?: (() => any) | undefined;
|
|
73
|
+
"onFont-size-blur"?: (() => any) | undefined;
|
|
74
|
+
"onFont-size-toggle"?: (() => any) | undefined;
|
|
75
|
+
"onFont-size-step-up"?: (() => any) | undefined;
|
|
76
|
+
"onFont-size-step-down"?: (() => any) | undefined;
|
|
77
|
+
"onBold-toggle"?: (() => any) | undefined;
|
|
78
|
+
"onItalic-toggle"?: (() => any) | undefined;
|
|
79
|
+
"onUnderline-toggle"?: (() => any) | undefined;
|
|
80
|
+
"onStrikethrough-toggle"?: (() => any) | undefined;
|
|
81
|
+
"onApply-text-color"?: (() => any) | undefined;
|
|
82
|
+
"onApply-fill-color"?: (() => any) | undefined;
|
|
83
|
+
"onApply-border"?: (() => any) | undefined;
|
|
84
|
+
"onApply-sort"?: (() => any) | undefined;
|
|
85
|
+
"onWrap-toggle"?: (() => any) | undefined;
|
|
86
|
+
"onApply-merge"?: (() => any) | undefined;
|
|
87
|
+
"onCalc-sum"?: (() => any) | undefined;
|
|
88
|
+
"onCalc-avg"?: (() => any) | undefined;
|
|
89
|
+
"onCalc-count"?: (() => any) | undefined;
|
|
90
|
+
"onIncrease-decimals"?: (() => any) | undefined;
|
|
91
|
+
"onDecrease-decimals"?: (() => any) | undefined;
|
|
92
|
+
"onToggle-filter"?: (() => any) | undefined;
|
|
93
|
+
"onCf-new-rule"?: (() => any) | undefined;
|
|
94
|
+
"onCf-manage"?: (() => any) | undefined;
|
|
95
|
+
"onFont-family-change"?: ((v: string | number) => any) | undefined;
|
|
96
|
+
"onFont-size-change"?: ((v: string | number) => any) | undefined;
|
|
97
|
+
"onH-align-change"?: ((v: string | number) => any) | undefined;
|
|
98
|
+
"onV-align-change"?: ((v: string | number) => any) | undefined;
|
|
99
|
+
"onFont-size-input"?: ((v: string) => any) | undefined;
|
|
100
|
+
"onText-color-change"?: ((v: string) => any) | undefined;
|
|
101
|
+
"onFill-color-change"?: ((v: string) => any) | undefined;
|
|
102
|
+
"onNumber-format-change"?: ((v: string) => any) | undefined;
|
|
103
|
+
"onFreeze-change"?: ((v: string) => any) | undefined;
|
|
104
|
+
"onCf-preset"?: ((v: string) => any) | undefined;
|
|
105
|
+
"onFont-size-keydown"?: ((ev: KeyboardEvent) => any) | undefined;
|
|
106
|
+
"onUpdate:font-size-menu-open"?: ((v: boolean) => any) | undefined;
|
|
107
|
+
"onUpdate:text-color-menu-open"?: ((v: boolean) => any) | undefined;
|
|
108
|
+
"onUpdate:fill-color-menu-open"?: ((v: boolean) => any) | undefined;
|
|
109
|
+
"onUpdate:border-menu-open"?: ((v: boolean) => any) | undefined;
|
|
110
|
+
"onUpdate:sort-menu-open"?: ((v: boolean) => any) | undefined;
|
|
111
|
+
"onUpdate:merge-menu-open"?: ((v: boolean) => any) | undefined;
|
|
112
|
+
"onUpdate:calc-menu-open"?: ((v: boolean) => any) | undefined;
|
|
113
|
+
"onBorder-change"?: ((v: import("@/components/spreader/components/pickers/borderPicker.vue").BorderType) => any) | undefined;
|
|
114
|
+
"onSort-change"?: ((v: import("@/components/spreader/core/sort-core.ts").SortOrder) => any) | undefined;
|
|
115
|
+
"onMerge-change"?: ((v: import("../core/constants").MergeType) => any) | undefined;
|
|
116
|
+
"onCf-clear"?: ((scope: "sheet" | "selection") => any) | undefined;
|
|
117
|
+
}>, {
|
|
118
|
+
closeOverflow: () => void;
|
|
119
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
120
|
+
undo: () => void;
|
|
121
|
+
redo: () => void;
|
|
122
|
+
find: () => void;
|
|
123
|
+
"paint-format": () => void;
|
|
124
|
+
"clear-format": () => void;
|
|
125
|
+
"font-size-blur": () => void;
|
|
126
|
+
"font-size-toggle": () => void;
|
|
127
|
+
"font-size-step-up": () => void;
|
|
128
|
+
"font-size-step-down": () => void;
|
|
129
|
+
"bold-toggle": () => void;
|
|
130
|
+
"italic-toggle": () => void;
|
|
131
|
+
"underline-toggle": () => void;
|
|
132
|
+
"strikethrough-toggle": () => void;
|
|
133
|
+
"apply-text-color": () => void;
|
|
134
|
+
"apply-fill-color": () => void;
|
|
135
|
+
"apply-border": () => void;
|
|
136
|
+
"apply-sort": () => void;
|
|
137
|
+
"wrap-toggle": () => void;
|
|
138
|
+
"apply-merge": () => void;
|
|
139
|
+
"calc-sum": () => void;
|
|
140
|
+
"calc-avg": () => void;
|
|
141
|
+
"calc-count": () => void;
|
|
142
|
+
"increase-decimals": () => void;
|
|
143
|
+
"decrease-decimals": () => void;
|
|
144
|
+
"toggle-filter": () => void;
|
|
145
|
+
"cf-new-rule": () => void;
|
|
146
|
+
"cf-manage": () => void;
|
|
147
|
+
"font-family-change": (v: string | number) => void;
|
|
148
|
+
"font-size-change": (v: string | number) => void;
|
|
149
|
+
"h-align-change": (v: string | number) => void;
|
|
150
|
+
"v-align-change": (v: string | number) => void;
|
|
151
|
+
"font-size-input": (v: string) => void;
|
|
152
|
+
"text-color-change": (v: string) => void;
|
|
153
|
+
"fill-color-change": (v: string) => void;
|
|
154
|
+
"number-format-change": (v: string) => void;
|
|
155
|
+
"freeze-change": (v: string) => void;
|
|
156
|
+
"cf-preset": (v: string) => void;
|
|
157
|
+
"font-size-keydown": (ev: KeyboardEvent) => void;
|
|
158
|
+
"update:font-size-menu-open": (v: boolean) => void;
|
|
159
|
+
"update:text-color-menu-open": (v: boolean) => void;
|
|
160
|
+
"update:fill-color-menu-open": (v: boolean) => void;
|
|
161
|
+
"update:border-menu-open": (v: boolean) => void;
|
|
162
|
+
"update:sort-menu-open": (v: boolean) => void;
|
|
163
|
+
"update:merge-menu-open": (v: boolean) => void;
|
|
164
|
+
"update:calc-menu-open": (v: boolean) => void;
|
|
165
|
+
"border-change": (v: import("@/components/spreader/components/pickers/borderPicker.vue").BorderType) => void;
|
|
166
|
+
"sort-change": (v: import("@/components/spreader/core/sort-core.ts").SortOrder) => void;
|
|
167
|
+
"merge-change": (v: import("../core/constants").MergeType) => void;
|
|
168
|
+
"cf-clear": (scope: "sheet" | "selection") => void;
|
|
169
|
+
}, import("vue").PublicProps, {}, false, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {
|
|
170
|
+
rootEl: HTMLDivElement;
|
|
171
|
+
fontSizeArrowRef: HTMLButtonElement;
|
|
172
|
+
textColorArrowRef: HTMLButtonElement;
|
|
173
|
+
fillColorArrowRef: HTMLButtonElement;
|
|
174
|
+
borderArrowRef: HTMLButtonElement;
|
|
175
|
+
mergeArrowRef: HTMLButtonElement;
|
|
176
|
+
calcArrowRef: HTMLButtonElement;
|
|
177
|
+
sortArrowRef: HTMLButtonElement;
|
|
178
|
+
moreBtnEl: HTMLButtonElement;
|
|
179
|
+
overflowMenuEl: HTMLDivElement;
|
|
180
|
+
}, any, import("vue").ComponentProvideOptions, {
|
|
181
|
+
P: {};
|
|
182
|
+
B: {};
|
|
183
|
+
D: {};
|
|
184
|
+
C: {};
|
|
185
|
+
M: {};
|
|
186
|
+
Defaults: {};
|
|
187
|
+
}, Readonly<{
|
|
188
|
+
locale: string;
|
|
189
|
+
canUndo: boolean;
|
|
190
|
+
canRedo: boolean;
|
|
191
|
+
paintFmtActive: boolean;
|
|
192
|
+
hasSelection: boolean;
|
|
193
|
+
fontFamilyOptions: import("../core/constants").FontOption[];
|
|
194
|
+
fontSizeOptions: import("../core/constants").FontOption[];
|
|
195
|
+
selFontFamily: string | number;
|
|
196
|
+
selFontSize: number;
|
|
197
|
+
fontSizeInput: string;
|
|
198
|
+
fontSizeMenuOpen: boolean;
|
|
199
|
+
selFontWeight: boolean;
|
|
200
|
+
selFontStyle: boolean;
|
|
201
|
+
selUnderline: boolean;
|
|
202
|
+
selStrikethrough: boolean;
|
|
203
|
+
selTextColor: string;
|
|
204
|
+
textColorMenuOpen: boolean;
|
|
205
|
+
selFillColor: string;
|
|
206
|
+
fillColorMenuOpen: boolean;
|
|
207
|
+
cachedTextColor: string;
|
|
208
|
+
cachedFillColor: string;
|
|
209
|
+
borderMenuOpen: boolean;
|
|
210
|
+
cachedBorder: import("@/components/spreader/components/pickers/borderPicker.vue").BorderType;
|
|
211
|
+
sortMenuOpen: boolean;
|
|
212
|
+
cachedSortOrder: import("@/components/spreader/core/sort-core.ts").SortOrder;
|
|
213
|
+
canSort: boolean;
|
|
214
|
+
canFilter: boolean;
|
|
215
|
+
filterActive: boolean;
|
|
216
|
+
selHAlign: string;
|
|
217
|
+
selVAlign: string;
|
|
218
|
+
selWrap: boolean;
|
|
219
|
+
hAlignOptions: import("../core/constants").FontOption[];
|
|
220
|
+
vAlignOptions: import("../core/constants").FontOption[];
|
|
221
|
+
mergeMenuOpen: boolean;
|
|
222
|
+
calcMenuOpen: boolean;
|
|
223
|
+
isSingleCell: boolean;
|
|
224
|
+
hasFreeze: boolean;
|
|
225
|
+
freezePanesDisabled: boolean;
|
|
226
|
+
themeVars?: Record<string, string> | undefined;
|
|
227
|
+
selNumberFormat: string;
|
|
228
|
+
nfOptions: import("../core/number-format").NFOption[];
|
|
229
|
+
canIncreaseDecimals: boolean;
|
|
230
|
+
canDecreaseDecimals: boolean;
|
|
231
|
+
}> & Readonly<{
|
|
232
|
+
onUndo?: (() => any) | undefined;
|
|
233
|
+
onRedo?: (() => any) | undefined;
|
|
234
|
+
onFind?: (() => any) | undefined;
|
|
235
|
+
"onPaint-format"?: (() => any) | undefined;
|
|
236
|
+
"onClear-format"?: (() => any) | undefined;
|
|
237
|
+
"onFont-size-blur"?: (() => any) | undefined;
|
|
238
|
+
"onFont-size-toggle"?: (() => any) | undefined;
|
|
239
|
+
"onFont-size-step-up"?: (() => any) | undefined;
|
|
240
|
+
"onFont-size-step-down"?: (() => any) | undefined;
|
|
241
|
+
"onBold-toggle"?: (() => any) | undefined;
|
|
242
|
+
"onItalic-toggle"?: (() => any) | undefined;
|
|
243
|
+
"onUnderline-toggle"?: (() => any) | undefined;
|
|
244
|
+
"onStrikethrough-toggle"?: (() => any) | undefined;
|
|
245
|
+
"onApply-text-color"?: (() => any) | undefined;
|
|
246
|
+
"onApply-fill-color"?: (() => any) | undefined;
|
|
247
|
+
"onApply-border"?: (() => any) | undefined;
|
|
248
|
+
"onApply-sort"?: (() => any) | undefined;
|
|
249
|
+
"onWrap-toggle"?: (() => any) | undefined;
|
|
250
|
+
"onApply-merge"?: (() => any) | undefined;
|
|
251
|
+
"onCalc-sum"?: (() => any) | undefined;
|
|
252
|
+
"onCalc-avg"?: (() => any) | undefined;
|
|
253
|
+
"onCalc-count"?: (() => any) | undefined;
|
|
254
|
+
"onIncrease-decimals"?: (() => any) | undefined;
|
|
255
|
+
"onDecrease-decimals"?: (() => any) | undefined;
|
|
256
|
+
"onToggle-filter"?: (() => any) | undefined;
|
|
257
|
+
"onCf-new-rule"?: (() => any) | undefined;
|
|
258
|
+
"onCf-manage"?: (() => any) | undefined;
|
|
259
|
+
"onFont-family-change"?: ((v: string | number) => any) | undefined;
|
|
260
|
+
"onFont-size-change"?: ((v: string | number) => any) | undefined;
|
|
261
|
+
"onH-align-change"?: ((v: string | number) => any) | undefined;
|
|
262
|
+
"onV-align-change"?: ((v: string | number) => any) | undefined;
|
|
263
|
+
"onFont-size-input"?: ((v: string) => any) | undefined;
|
|
264
|
+
"onText-color-change"?: ((v: string) => any) | undefined;
|
|
265
|
+
"onFill-color-change"?: ((v: string) => any) | undefined;
|
|
266
|
+
"onNumber-format-change"?: ((v: string) => any) | undefined;
|
|
267
|
+
"onFreeze-change"?: ((v: string) => any) | undefined;
|
|
268
|
+
"onCf-preset"?: ((v: string) => any) | undefined;
|
|
269
|
+
"onFont-size-keydown"?: ((ev: KeyboardEvent) => any) | undefined;
|
|
270
|
+
"onUpdate:font-size-menu-open"?: ((v: boolean) => any) | undefined;
|
|
271
|
+
"onUpdate:text-color-menu-open"?: ((v: boolean) => any) | undefined;
|
|
272
|
+
"onUpdate:fill-color-menu-open"?: ((v: boolean) => any) | undefined;
|
|
273
|
+
"onUpdate:border-menu-open"?: ((v: boolean) => any) | undefined;
|
|
274
|
+
"onUpdate:sort-menu-open"?: ((v: boolean) => any) | undefined;
|
|
275
|
+
"onUpdate:merge-menu-open"?: ((v: boolean) => any) | undefined;
|
|
276
|
+
"onUpdate:calc-menu-open"?: ((v: boolean) => any) | undefined;
|
|
277
|
+
"onBorder-change"?: ((v: import("@/components/spreader/components/pickers/borderPicker.vue").BorderType) => any) | undefined;
|
|
278
|
+
"onSort-change"?: ((v: import("@/components/spreader/core/sort-core.ts").SortOrder) => any) | undefined;
|
|
279
|
+
"onMerge-change"?: ((v: import("../core/constants").MergeType) => any) | undefined;
|
|
280
|
+
"onCf-clear"?: ((scope: "sheet" | "selection") => any) | undefined;
|
|
281
|
+
}>, {
|
|
282
|
+
closeOverflow: () => void;
|
|
283
|
+
}, {}, {}, {}, {}> | null;
|
|
284
|
+
}, HTMLDivElement>;
|
|
23
285
|
export default _default;
|
|
@@ -2,6 +2,7 @@ import type { FontOption, MergeType } from '../core/constants';
|
|
|
2
2
|
import { type NFOption } from '../core/number-format';
|
|
3
3
|
import { type BorderType } from './pickers/borderPicker.vue';
|
|
4
4
|
import type { SortOrder } from '../core/sort-core';
|
|
5
|
+
declare function closeOverflow(): void;
|
|
5
6
|
type __VLS_Props = {
|
|
6
7
|
locale: string;
|
|
7
8
|
canUndo: boolean;
|
|
@@ -43,13 +44,17 @@ type __VLS_Props = {
|
|
|
43
44
|
isSingleCell: boolean;
|
|
44
45
|
/** 当前 worksheet 是否已有冻结行或列 */
|
|
45
46
|
hasFreeze: boolean;
|
|
47
|
+
/** 冻结窗格的冻结点是否位于 A1(无上方/左侧可冻结),此时禁用「冻结窗格」项 */
|
|
48
|
+
freezePanesDisabled: boolean;
|
|
46
49
|
themeVars?: Record<string, string>;
|
|
47
50
|
selNumberFormat: string;
|
|
48
51
|
nfOptions: NFOption[];
|
|
49
52
|
canIncreaseDecimals: boolean;
|
|
50
53
|
canDecreaseDecimals: boolean;
|
|
51
54
|
};
|
|
52
|
-
declare const _default: import("vue").DefineComponent<__VLS_Props, {
|
|
55
|
+
declare const _default: import("vue").DefineComponent<__VLS_Props, {
|
|
56
|
+
closeOverflow: typeof closeOverflow;
|
|
57
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
53
58
|
undo: () => void;
|
|
54
59
|
redo: () => void;
|
|
55
60
|
find: () => void;
|
|
@@ -75,6 +80,8 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
75
80
|
"increase-decimals": () => void;
|
|
76
81
|
"decrease-decimals": () => void;
|
|
77
82
|
"toggle-filter": () => void;
|
|
83
|
+
"cf-new-rule": () => void;
|
|
84
|
+
"cf-manage": () => void;
|
|
78
85
|
"font-family-change": (v: string | number) => void;
|
|
79
86
|
"font-size-change": (v: string | number) => void;
|
|
80
87
|
"h-align-change": (v: string | number) => void;
|
|
@@ -84,6 +91,7 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
84
91
|
"fill-color-change": (v: string) => void;
|
|
85
92
|
"number-format-change": (v: string) => void;
|
|
86
93
|
"freeze-change": (v: string) => void;
|
|
94
|
+
"cf-preset": (v: string) => void;
|
|
87
95
|
"font-size-keydown": (ev: KeyboardEvent) => void;
|
|
88
96
|
"update:font-size-menu-open": (v: boolean) => void;
|
|
89
97
|
"update:text-color-menu-open": (v: boolean) => void;
|
|
@@ -95,6 +103,7 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
95
103
|
"border-change": (v: BorderType) => void;
|
|
96
104
|
"sort-change": (v: SortOrder) => void;
|
|
97
105
|
"merge-change": (v: MergeType) => void;
|
|
106
|
+
"cf-clear": (scope: "sheet" | "selection") => void;
|
|
98
107
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
99
108
|
onUndo?: (() => any) | undefined;
|
|
100
109
|
onRedo?: (() => any) | undefined;
|
|
@@ -121,6 +130,8 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
121
130
|
"onIncrease-decimals"?: (() => any) | undefined;
|
|
122
131
|
"onDecrease-decimals"?: (() => any) | undefined;
|
|
123
132
|
"onToggle-filter"?: (() => any) | undefined;
|
|
133
|
+
"onCf-new-rule"?: (() => any) | undefined;
|
|
134
|
+
"onCf-manage"?: (() => any) | undefined;
|
|
124
135
|
"onFont-family-change"?: ((v: string | number) => any) | undefined;
|
|
125
136
|
"onFont-size-change"?: ((v: string | number) => any) | undefined;
|
|
126
137
|
"onH-align-change"?: ((v: string | number) => any) | undefined;
|
|
@@ -130,6 +141,7 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
130
141
|
"onFill-color-change"?: ((v: string) => any) | undefined;
|
|
131
142
|
"onNumber-format-change"?: ((v: string) => any) | undefined;
|
|
132
143
|
"onFreeze-change"?: ((v: string) => any) | undefined;
|
|
144
|
+
"onCf-preset"?: ((v: string) => any) | undefined;
|
|
133
145
|
"onFont-size-keydown"?: ((ev: KeyboardEvent) => any) | undefined;
|
|
134
146
|
"onUpdate:font-size-menu-open"?: ((v: boolean) => any) | undefined;
|
|
135
147
|
"onUpdate:text-color-menu-open"?: ((v: boolean) => any) | undefined;
|
|
@@ -141,6 +153,7 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
141
153
|
"onBorder-change"?: ((v: BorderType) => any) | undefined;
|
|
142
154
|
"onSort-change"?: ((v: SortOrder) => any) | undefined;
|
|
143
155
|
"onMerge-change"?: ((v: MergeType) => any) | undefined;
|
|
156
|
+
"onCf-clear"?: ((scope: "sheet" | "selection") => any) | undefined;
|
|
144
157
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {
|
|
145
158
|
rootEl: HTMLDivElement;
|
|
146
159
|
fontSizeArrowRef: HTMLButtonElement;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ComputedRef, type Ref } from 'vue';
|
|
2
2
|
import { FormulaDeps } from '../core/formula';
|
|
3
|
-
import type { CellCoord, CellData, CellStyle, SelectionRange, BorderStyle, BorderSide, FreezePane, ViewportRegion, SheetFilter, FilterColumn } from '../core/types';
|
|
3
|
+
import type { CellCoord, CellData, CellStyle, SelectionRange, BorderStyle, BorderSide, FreezePane, ViewportRegion, SheetFilter, FilterColumn, ConditionalFormattingRule, ConditionalFormattingFormat } from '../core/types';
|
|
4
4
|
import { type FilterCandidates } from '../core/filter-core';
|
|
5
5
|
/** 选区触发方式,影响「合并单元格是否扩大选区」。
|
|
6
6
|
* - 'cell':单元格点击/拖动(默认)→ 保持现有 expandSelectionForMerges 行为
|
|
@@ -192,6 +192,14 @@ export interface CoreState {
|
|
|
192
192
|
w: number;
|
|
193
193
|
h: number;
|
|
194
194
|
};
|
|
195
|
+
conditionalFormats: ConditionalFormattingRule[];
|
|
196
|
+
resolveConditionalFormat: (col: number, row: number) => ConditionalFormattingFormat | null;
|
|
197
|
+
addConditionalFormatRule: (rule: ConditionalFormattingRule) => void;
|
|
198
|
+
updateConditionalFormatRule: (id: string, patch: Partial<ConditionalFormattingRule>) => void;
|
|
199
|
+
removeConditionalFormatRule: (id: string) => void;
|
|
200
|
+
moveConditionalFormatRule: (id: string, dir: 'up' | 'down') => void;
|
|
201
|
+
clearConditionalFormats: (scope: 'selection' | 'sheet') => void;
|
|
202
|
+
invalidateConditionalFormatCache: () => void;
|
|
195
203
|
clampScroll?: (sx: number | null, sy: number | null) => void;
|
|
196
204
|
/** 查找高亮钩子:返回某单元格当前的高亮类型(由 find-replace 模块注入) */
|
|
197
205
|
findHighlight?: (col: number, row: number) => 'active' | 'match' | null;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { ConditionalFormattingRule, ConditionalFormattingCondition, ConditionalFormattingFormat, SelectionRange, CellData } from './types';
|
|
2
|
+
/** 条件格式求值上下文(由 core-state 注入,引擎本身保持纯净) */
|
|
3
|
+
export interface CFContext {
|
|
4
|
+
/** 原始单元格数据(供公式引擎引用) */
|
|
5
|
+
cells: Record<string, CellData>;
|
|
6
|
+
colCount: number;
|
|
7
|
+
rowCount: number;
|
|
8
|
+
locale?: string;
|
|
9
|
+
/** 取单元格计算后的显示值(公式已求值);用于数值/文本/重复值比较 */
|
|
10
|
+
getCellValue: (col: number, row: number) => string;
|
|
11
|
+
}
|
|
12
|
+
/** 规则范围左上角(所有 ranges 的最小 startCol/startRow) */
|
|
13
|
+
export declare function ruleAnchor(rule: ConditionalFormattingRule): {
|
|
14
|
+
col: number;
|
|
15
|
+
row: number;
|
|
16
|
+
};
|
|
17
|
+
/** 单元格是否落在任一应用范围之内(含边界) */
|
|
18
|
+
export declare function cellInRanges(ranges: SelectionRange[], col: number, row: number): boolean;
|
|
19
|
+
/** 计算规则 Range 内各单元格显示值的出现次数(空白不计入重复统计,与 Excel 一致) */
|
|
20
|
+
export declare function computeRuleValueStats(rule: ConditionalFormattingRule, ctx: CFContext): Map<string, number>;
|
|
21
|
+
interface RuleStatsCache {
|
|
22
|
+
get(ruleId: string): Map<string, number> | undefined;
|
|
23
|
+
set(ruleId: string, stats: Map<string, number>): void;
|
|
24
|
+
invalidate(ruleId?: string): void;
|
|
25
|
+
}
|
|
26
|
+
/** 轻量统计缓存:cell / 规则变化时失效,避免每个 repaint 重算重复值统计 */
|
|
27
|
+
export declare class CfValueCache implements RuleStatsCache {
|
|
28
|
+
private map;
|
|
29
|
+
get(ruleId: string): Map<string, number> | undefined;
|
|
30
|
+
set(ruleId: string, stats: Map<string, number>): void;
|
|
31
|
+
invalidate(ruleId?: string): void;
|
|
32
|
+
}
|
|
33
|
+
/** 单条件评估:返回 true 表示该单元格命中该规则 */
|
|
34
|
+
export declare function evaluateCondition(cond: ConditionalFormattingCondition, col: number, row: number, ctx: CFContext, anchor: {
|
|
35
|
+
col: number;
|
|
36
|
+
row: number;
|
|
37
|
+
}, stats?: Map<string, number>): boolean;
|
|
38
|
+
/**
|
|
39
|
+
* 按优先级合并命中规则,返回最终合成格式;无命中返回 null。
|
|
40
|
+
* priority 越小优先级越高;命中 stopIfTrue 后停止后续规则。
|
|
41
|
+
*/
|
|
42
|
+
export declare function resolveConditionalFormatting(col: number, row: number, rules: ConditionalFormattingRule[], ctx: CFContext, cache?: RuleStatsCache): ConditionalFormattingFormat | null;
|
|
43
|
+
/** 将条件格式合成到基础样式上,返回用于渲染的样式片段(仅包含会被覆盖的属性) */
|
|
44
|
+
export declare function applyCfFormat(base: {
|
|
45
|
+
backgroundColor?: string;
|
|
46
|
+
color?: string;
|
|
47
|
+
fontWeight?: string;
|
|
48
|
+
fontStyle?: string;
|
|
49
|
+
underline?: string;
|
|
50
|
+
strikethrough?: string;
|
|
51
|
+
}, cf: ConditionalFormattingFormat | null): {
|
|
52
|
+
backgroundColor?: string;
|
|
53
|
+
color?: string;
|
|
54
|
+
fontWeight?: string;
|
|
55
|
+
fontStyle?: string;
|
|
56
|
+
underline?: string;
|
|
57
|
+
strikethrough?: string;
|
|
58
|
+
};
|
|
59
|
+
/** 生成稳定唯一 ID(供新建规则使用,禁止依赖数组 index) */
|
|
60
|
+
export declare function genRuleId(): string;
|
|
61
|
+
export {};
|
|
@@ -22,6 +22,8 @@ export interface FontOption {
|
|
|
22
22
|
value: string | number;
|
|
23
23
|
/** 触发器/菜单项图标,提供时以图标取代文本标签展示在触发器上 */
|
|
24
24
|
icon?: string;
|
|
25
|
+
/** 是否为禁用项(菜单项置灰且不可点击) */
|
|
26
|
+
disabled?: boolean;
|
|
25
27
|
}
|
|
26
28
|
export declare const FONT_FAMILIES: FontOption[];
|
|
27
29
|
export declare const FONT_SIZES: FontOption[];
|
|
@@ -40,6 +40,15 @@ export declare function evalFormula(key: string, cells: Record<string, CellData>
|
|
|
40
40
|
export declare function parseFormulaRefs(formula: string, colCount: number, rowCount: number): string[];
|
|
41
41
|
/** 计算单元格显示值(公式则求值,否则返回原值) */
|
|
42
42
|
export declare function computeCellValue(col: number, row: number, cells: Record<string, CellData>, colCount: number, rowCount: number): string;
|
|
43
|
+
/** 独立求值一段公式表达式(不含前导 '='),返回 FormulaValue。
|
|
44
|
+
* 与 evalFormula 不同,本函数不绑定具体单元格身份,适合条件格式等「以任意基准单元格求值」的场景。 */
|
|
45
|
+
export declare function evalFormulaText(formula: string, cells: Record<string, CellData>, colCount: number, rowCount: number): FormulaValue;
|
|
46
|
+
/** 求一段「条件表达式」的布尔值(条件格式等场景):
|
|
47
|
+
* - 剥离可能的前导 '='(Excel 习惯输入 "=A1>100")
|
|
48
|
+
* - 含顶层比较运算符(< <= > >= = <>)按比较结果返回
|
|
49
|
+
* - 否则按标量真值(数字非 0、非空字符串为真)
|
|
50
|
+
* 与 evalExpr 不同,本函数能正确处理 "A1>100" 这类比较表达式。 */
|
|
51
|
+
export declare function evalFormulaCondition(formula: string, cells: Record<string, CellData>, colCount: number, rowCount: number): boolean;
|
|
43
52
|
/** 将公式中所有单元格引用偏移 dCol, dRow(支持 $ 绝对引用) */
|
|
44
53
|
export declare function shiftFormulaRefs(formula: string, dCol: number, dRow: number, colCount: number, rowCount: number, colToLabelFn: (col: number) => string): string;
|
|
45
54
|
/**
|
|
@@ -118,6 +118,78 @@ export interface SheetFilter {
|
|
|
118
118
|
/** 按列索引(0-based)存储的列筛选;缺失的列表示不过滤 */
|
|
119
119
|
columns: Record<number, FilterColumn>;
|
|
120
120
|
}
|
|
121
|
+
/** 条件类型:第一阶段完整实现前 8 种;后几种为第二阶段预留(数据模型保留,暂不完整实现 UI/Renderer) */
|
|
122
|
+
export type CFConditionType = 'cellIs' | 'textContains' | 'textNotContains' | 'blank' | 'notBlank' | 'duplicate' | 'unique' | 'formula' | 'colorScale' | 'dataBar' | 'iconSet' | 'topBottom' | 'aboveBelowAverage';
|
|
123
|
+
/** 单元格值比较算子 */
|
|
124
|
+
export type CellIsOperator = 'equal' | 'notEqual' | 'greaterThan' | 'greaterThanOrEqual' | 'lessThan' | 'lessThanOrEqual' | 'between' | 'notBetween';
|
|
125
|
+
export interface CFCellIsCondition {
|
|
126
|
+
type: 'cellIs';
|
|
127
|
+
operator: CellIsOperator;
|
|
128
|
+
/** 比较值(文本/数字原始文本)。between / notBetween 需要 value2 */
|
|
129
|
+
value: string;
|
|
130
|
+
/** between / notBetween 的第二个值 */
|
|
131
|
+
value2?: string;
|
|
132
|
+
}
|
|
133
|
+
export interface CFTextCondition {
|
|
134
|
+
type: 'textContains' | 'textNotContains';
|
|
135
|
+
value: string;
|
|
136
|
+
}
|
|
137
|
+
export interface CFBlankCondition {
|
|
138
|
+
type: 'blank' | 'notBlank';
|
|
139
|
+
}
|
|
140
|
+
export interface CFDuplicateCondition {
|
|
141
|
+
type: 'duplicate' | 'unique';
|
|
142
|
+
}
|
|
143
|
+
export interface CFFormulaCondition {
|
|
144
|
+
type: 'formula';
|
|
145
|
+
/** 公式(不含前导 '=');相对/绝对引用以规则范围左上角为基准 */
|
|
146
|
+
formula: string;
|
|
147
|
+
}
|
|
148
|
+
/** 第二阶段可视类型占位(暂不完整实现 UI/Renderer,仅保留数据模型) */
|
|
149
|
+
export interface CFColorScaleCondition {
|
|
150
|
+
type: 'colorScale';
|
|
151
|
+
}
|
|
152
|
+
export interface CFDataBarCondition {
|
|
153
|
+
type: 'dataBar';
|
|
154
|
+
}
|
|
155
|
+
export interface CFIconSetCondition {
|
|
156
|
+
type: 'iconSet';
|
|
157
|
+
}
|
|
158
|
+
export interface CFTopBottomCondition {
|
|
159
|
+
type: 'topBottom';
|
|
160
|
+
top: boolean;
|
|
161
|
+
percent: boolean;
|
|
162
|
+
n: number;
|
|
163
|
+
}
|
|
164
|
+
export interface CFAboveBelowAverageCondition {
|
|
165
|
+
type: 'aboveBelowAverage';
|
|
166
|
+
above: boolean;
|
|
167
|
+
}
|
|
168
|
+
export type ConditionalFormattingCondition = CFCellIsCondition | CFTextCondition | CFBlankCondition | CFDuplicateCondition | CFFormulaCondition | CFColorScaleCondition | CFDataBarCondition | CFIconSetCondition | CFTopBottomCondition | CFAboveBelowAverageCondition;
|
|
169
|
+
/** 条件格式要设置的格式(仅格式属性,不持久化选中状态)。渲染时与基础样式临时合成,不写回 cell.style */
|
|
170
|
+
export interface ConditionalFormattingFormat {
|
|
171
|
+
backgroundColor?: string;
|
|
172
|
+
color?: string;
|
|
173
|
+
fontWeight?: 'bold' | '';
|
|
174
|
+
fontStyle?: 'italic' | '';
|
|
175
|
+
underline?: 'underline' | '';
|
|
176
|
+
strikethrough?: 'line-through' | '';
|
|
177
|
+
}
|
|
178
|
+
/** 单条条件格式规则:属于 Sheet,而非 Cell */
|
|
179
|
+
export interface ConditionalFormattingRule {
|
|
180
|
+
/** 稳定唯一 ID(禁止数组 index) */
|
|
181
|
+
id: string;
|
|
182
|
+
condition: ConditionalFormattingCondition;
|
|
183
|
+
format: ConditionalFormattingFormat;
|
|
184
|
+
/** 应用范围(支持多区域) */
|
|
185
|
+
ranges: SelectionRange[];
|
|
186
|
+
/** 优先级:越小越高(Excel 风格) */
|
|
187
|
+
priority: number;
|
|
188
|
+
/** 命中后停止后续规则 */
|
|
189
|
+
stopIfTrue: boolean;
|
|
190
|
+
/** 是否启用 */
|
|
191
|
+
enabled: boolean;
|
|
192
|
+
}
|
|
121
193
|
export interface SheetModelData {
|
|
122
194
|
name: string;
|
|
123
195
|
/** 表格级样式池:styles[0] 始终为默认空样式 {} */
|
|
@@ -140,6 +212,8 @@ export interface SheetModelData {
|
|
|
140
212
|
freeze?: FreezePane;
|
|
141
213
|
/** 数据筛选状态;缺省视为未启用筛选 */
|
|
142
214
|
filter?: SheetFilter;
|
|
215
|
+
/** 条件格式规则集合;缺省视为无规则 */
|
|
216
|
+
conditionalFormats?: ConditionalFormattingRule[];
|
|
143
217
|
}
|
|
144
218
|
export interface SheetState {
|
|
145
219
|
id: string;
|
|
@@ -164,6 +238,8 @@ export interface SheetState {
|
|
|
164
238
|
freeze: FreezePane;
|
|
165
239
|
/** 数据筛选状态;缺省为 null 表示未启用筛选 */
|
|
166
240
|
filter: SheetFilter | null;
|
|
241
|
+
/** 条件格式规则集合;缺省为空数组 */
|
|
242
|
+
conditionalFormats: ConditionalFormattingRule[];
|
|
167
243
|
}
|
|
168
244
|
/** 视口区域:冻结窗格将画布划分为四个独立滚动区域 */
|
|
169
245
|
export interface ViewportRegion {
|