@veltra/sheet 2.1.1 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/report/binding-badge.js +100 -0
- package/dist/components/report/designer/cell-coords.js +46 -0
- package/dist/components/report/designer/col-widths.js +29 -0
- package/dist/components/report/designer/conditional-rules/helpers.js +139 -0
- package/dist/components/report/designer/drop-highlight-overlay.js +76 -0
- package/dist/components/report/designer/float-panel.js +422 -0
- package/dist/components/report/designer/role.js +17 -0
- package/dist/components/report/designer/rule-preview.js +33 -0
- package/dist/components/report/designer/rule-row.js +253 -0
- package/dist/components/report/designer/rules-dialog.js +118 -0
- package/dist/components/report/designer/topology-overlay.js +122 -0
- package/dist/components/report/designer/topology.js +64 -0
- package/dist/components/report/designer/use-grid-overlay.js +75 -0
- package/dist/components/report/designer-hub.js +177 -0
- package/dist/components/report/field-panel-helpers.js +33 -0
- package/dist/components/report/field-panel.js +132 -0
- package/dist/components/report/filter-bar.js +74 -0
- package/dist/components/report/hub-connection-form.js +145 -0
- package/dist/components/report/hub-dataset-editor.js +394 -0
- package/dist/components/report/preview-grid-size.js +32 -0
- package/dist/components/report/report-designer.js +393 -0
- package/dist/components/report/report-viewer.js +124 -0
- package/dist/components/report/style.d.ts +17 -0
- package/dist/components/report/style.js +18 -0
- package/dist/components/report/style2.css +874 -0
- package/dist/components/report/use-report-designer.js +382 -0
- package/dist/components/report/use-report-viewer.js +55 -0
- package/dist/{vue → components/sheet}/formula-bar.js +1 -1
- package/dist/{vue → components/sheet}/formula-suggest-list.js +1 -1
- package/dist/{vue → components/sheet}/import-file.js +1 -1
- package/dist/{vue → components/sheet}/insert-count-menu-item.js +1 -1
- package/dist/{vue → components/sheet}/insert-image.js +1 -1
- package/dist/{vue → components/sheet}/popup-helpers.js +1 -1
- package/dist/{vue → components/sheet}/popups/border-popup.js +31 -3
- package/dist/{vue → components/sheet}/popups/border-preset-glyph.js +1 -1
- package/dist/{vue → components/sheet}/popups/export-popup.js +2 -2
- package/dist/{vue → components/sheet}/popups/fill-color-popup.js +3 -3
- package/dist/{vue → components/sheet}/popups/find-popup.js +1 -1
- package/dist/{vue → components/sheet}/popups/font-color-popup.js +3 -3
- package/dist/{vue → components/sheet}/popups/font-size-popup.js +3 -3
- package/dist/{vue → components/sheet}/popups/import.worker.d.ts +1 -1
- package/dist/{vue → components/sheet}/popups/import.worker.js +1 -1
- package/dist/{vue → components/sheet}/popups/insert-image-popup.js +1 -1
- package/dist/{vue → components/sheet}/sheet-context-menu.js +7 -4
- package/dist/{vue → components/sheet}/sheet-tabs.js +1 -1
- package/dist/{vue → components/sheet}/sheet-toolbar.js +1 -1
- package/dist/{vue → components/sheet}/sheet.js +16 -1
- package/dist/{vue → components/sheet}/use-find-replace.js +1 -1
- package/dist/{vue → components/sheet}/use-formula-ref-select.js +1 -1
- package/dist/{vue → components/sheet}/use-sheet-grid.js +22 -4
- package/dist/{vue → components/sheet}/use-sheet-state.js +6 -5
- package/dist/{vue → components/sheet}/use-sheet-tabs-bar.js +1 -1
- package/dist/{vue → components/sheet}/use-tool-groups.js +2 -2
- package/dist/{vue → components/sheet}/use-tool-popup.js +2 -2
- package/dist/{vue → components/sheet}/use-toolbar-scroll.js +1 -1
- package/dist/index.d.ts +17 -3
- package/dist/index.js +13 -3
- package/dist/report/binding.d.ts +83 -0
- package/dist/report/binding.js +332 -0
- package/dist/report/connector.d.ts +66 -0
- package/dist/report/connector.js +159 -0
- package/dist/report/export-xlsx.d.ts +17 -0
- package/dist/report/export-xlsx.js +92 -0
- package/dist/report/filter-bar.d.ts +10 -0
- package/dist/report/filter-bar.js +31 -0
- package/dist/report/index.d.ts +12 -0
- package/dist/report/params.d.ts +13 -0
- package/dist/report/params.js +61 -0
- package/dist/report/render/aggregate.js +169 -0
- package/dist/report/render/builder.d.ts +12 -0
- package/dist/report/render/builder.js +139 -0
- package/dist/report/render/coordinate.d.ts +25 -0
- package/dist/report/render/coordinate.js +733 -0
- package/dist/report/render/index.d.ts +14 -0
- package/dist/report/render/index.js +21 -0
- package/dist/report/render/style-resolver.js +50 -0
- package/dist/report/render/template-index.d.ts +24 -0
- package/dist/report/render/template-index.js +137 -0
- package/dist/report/rules/evaluate.d.ts +25 -0
- package/dist/report/rules/evaluate.js +82 -0
- package/dist/report/rules/index.d.ts +2 -0
- package/dist/report/template.d.ts +63 -0
- package/dist/report/template.js +83 -0
- package/dist/report/types.d.ts +85 -0
- package/dist/tools/apply-style.js +29 -0
- package/dist/tools/builtin.js +17 -17
- package/dist/tools/context.d.ts +39 -6
- package/dist/tools/context.js +38 -1
- package/dist/types/index.d.ts +3 -2
- package/dist/types/report-designer.d.ts +38 -0
- package/dist/types/report-viewer.d.ts +38 -0
- package/dist/types/sheet.d.ts +21 -1
- package/package.json +6 -8
- package/src/components/report/__test__/conditional-rules-helpers.test.ts +88 -0
- package/src/components/report/__test__/field-panel-helpers.test.ts +65 -0
- package/src/components/report/__test__/float-panel-position.test.ts +45 -0
- package/src/components/report/__test__/preview-grid-size.test.ts +63 -0
- package/src/components/report/__test__/report-designer.test.ts +464 -0
- package/src/components/report/__test__/report-viewer.test.ts +357 -0
- package/src/components/report/__test__/topology.test.ts +143 -0
- package/src/components/report/__test__/use-report-designer.test.ts +697 -0
- package/src/components/report/binding-badge.ts +92 -0
- package/src/components/report/designer/cell-coords.ts +94 -0
- package/src/components/report/designer/col-widths.ts +56 -0
- package/src/components/report/designer/conditional-rules/helpers.ts +189 -0
- package/src/components/report/designer/drop-highlight-overlay.vue +74 -0
- package/src/components/report/designer/float-panel.vue +431 -0
- package/src/components/report/designer/role.ts +32 -0
- package/src/components/report/designer/rule-preview.vue +40 -0
- package/src/components/report/designer/rule-row.vue +252 -0
- package/src/components/report/designer/rules-dialog.vue +110 -0
- package/src/components/report/designer/topology-overlay.vue +127 -0
- package/src/components/report/designer/topology.ts +124 -0
- package/src/components/report/designer/use-grid-overlay.ts +113 -0
- package/src/components/report/designer-hub.vue +198 -0
- package/src/components/report/field-panel-helpers.ts +44 -0
- package/src/components/report/field-panel.vue +136 -0
- package/src/components/report/filter-bar.vue +77 -0
- package/src/components/report/hub-connection-form.vue +124 -0
- package/src/components/report/hub-dataset-editor.vue +369 -0
- package/src/components/report/index.ts +2 -0
- package/src/components/report/preview-grid-size.ts +33 -0
- package/src/components/report/report-designer.vue +420 -0
- package/src/components/report/report-viewer.vue +136 -0
- package/src/components/report/style-designer.scss +587 -0
- package/src/components/report/style-hub.scss +292 -0
- package/src/components/report/style-viewer.scss +104 -0
- package/src/components/report/style.scss +3 -0
- package/src/components/report/style.ts +20 -0
- package/src/components/report/use-report-designer.ts +596 -0
- package/src/components/report/use-report-viewer.ts +88 -0
- package/src/{vue → components/sheet}/__test__/formula-bar.test.ts +37 -18
- package/src/{vue → components/sheet}/__test__/insert-image-popup.test.ts +1 -1
- package/src/{vue → components/sheet}/__test__/insert-image.test.ts +1 -1
- package/src/{vue → components/sheet}/__test__/sheet-component.test.ts +77 -3
- package/src/{vue → components/sheet}/__test__/sheet-context-menu.test.ts +4 -3
- package/src/{vue → components/sheet}/formula-bar.vue +1 -1
- package/src/{vue → components/sheet}/insert-image.ts +1 -1
- package/src/{vue → components/sheet}/popup-helpers.ts +1 -1
- package/src/{vue → components/sheet}/popups/border-popup.vue +32 -4
- package/src/{vue → components/sheet}/popups/export-popup.vue +2 -2
- package/src/{vue → components/sheet}/popups/fill-color-popup.vue +3 -3
- package/src/{vue → components/sheet}/popups/find-popup.vue +1 -1
- package/src/{vue → components/sheet}/popups/font-color-popup.vue +3 -3
- package/src/{vue → components/sheet}/popups/font-size-popup.vue +3 -3
- package/src/{vue → components/sheet}/popups/insert-image-popup.vue +1 -1
- package/src/{vue → components/sheet}/sheet-context-menu.ts +10 -4
- package/src/{vue → components/sheet}/sheet-toolbar.vue +2 -2
- package/src/{vue → components/sheet}/sheet.vue +6 -3
- package/src/{vue → components/sheet}/use-find-replace.ts +1 -1
- package/src/{vue → components/sheet}/use-sheet-grid.ts +23 -5
- package/src/{vue → components/sheet}/use-sheet-state.ts +11 -6
- package/src/{vue → components/sheet}/use-tool-groups.ts +2 -2
- package/src/{vue → components/sheet}/use-tool-popup.ts +2 -2
- package/src/index.ts +24 -188
- package/src/report/__test__/binding.test.ts +320 -0
- package/src/report/__test__/connector.test.ts +239 -0
- package/src/report/__test__/export-xlsx.test.ts +118 -0
- package/src/report/__test__/filter-bar.test.ts +58 -0
- package/src/report/__test__/params.test.ts +156 -0
- package/src/report/__test__/render.test.ts +830 -0
- package/src/report/__test__/rules.test.ts +131 -0
- package/src/report/__test__/template.test.ts +366 -0
- package/src/report/binding.ts +474 -0
- package/src/report/connector.ts +206 -0
- package/src/report/export-xlsx.ts +113 -0
- package/src/report/filter-bar.ts +36 -0
- package/src/report/index.ts +13 -0
- package/src/report/params.ts +96 -0
- package/src/report/render/__test__/aggregate.test.ts +16 -0
- package/src/report/render/__test__/coordinate.test.ts +405 -0
- package/src/report/render/aggregate.ts +261 -0
- package/src/report/render/builder.ts +211 -0
- package/src/report/render/coordinate.ts +1239 -0
- package/src/report/render/index.ts +30 -0
- package/src/report/render/style-resolver.ts +68 -0
- package/src/report/render/template-index.ts +200 -0
- package/src/report/rules/evaluate.ts +113 -0
- package/src/report/rules/index.ts +7 -0
- package/src/report/template.ts +145 -0
- package/src/report/types.ts +96 -0
- package/src/tools/__test__/apply-style.test.ts +129 -0
- package/src/tools/apply-style.ts +41 -0
- package/src/tools/builtin.ts +20 -20
- package/src/tools/context.ts +67 -4
- package/src/tools/index.ts +1 -0
- package/src/types/index.ts +2 -6
- package/src/types/report-designer.ts +38 -0
- package/src/types/report-viewer.ts +37 -0
- package/src/types/sheet.ts +26 -1
- /package/dist/{vue → components/sheet}/style.d.ts +0 -0
- /package/dist/{vue → components/sheet}/style.js +0 -0
- /package/dist/{vue → components/sheet}/style2.css +0 -0
- /package/dist/{vue → components/sheet}/use-formula-suggest.js +0 -0
- /package/src/{vue → components/sheet}/__test__/import-file.test.ts +0 -0
- /package/src/{vue → components/sheet}/__test__/insert-count-menu-item.test.ts +0 -0
- /package/src/{vue → components/sheet}/__test__/use-formula-ref-select.test.ts +0 -0
- /package/src/{vue → components/sheet}/__test__/use-formula-suggest.test.ts +0 -0
- /package/src/{vue → components/sheet}/formula-suggest-list.vue +0 -0
- /package/src/{vue → components/sheet}/import-file.ts +0 -0
- /package/src/{vue → components/sheet}/index.ts +0 -0
- /package/src/{vue → components/sheet}/insert-count-menu-item.vue +0 -0
- /package/src/{vue → components/sheet}/parsing.ts +0 -0
- /package/src/{vue → components/sheet}/popups/border-preset-glyph.vue +0 -0
- /package/src/{vue → components/sheet}/popups/import.worker.ts +0 -0
- /package/src/{vue → components/sheet}/sheet-tabs.vue +0 -0
- /package/src/{vue → components/sheet}/style.scss +0 -0
- /package/src/{vue → components/sheet}/style.ts +0 -0
- /package/src/{vue → components/sheet}/use-formula-ref-select.ts +0 -0
- /package/src/{vue → components/sheet}/use-formula-suggest.ts +0 -0
- /package/src/{vue → components/sheet}/use-sheet-tabs-bar.ts +0 -0
- /package/src/{vue → components/sheet}/use-toolbar-scroll.ts +0 -0
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { createRange } from '@veltra/sheet-core/core/address'
|
|
2
|
+
import { Sheet } from '@veltra/sheet-core/core/sheet'
|
|
3
|
+
import { describe, expect, it } from 'vitest'
|
|
4
|
+
|
|
5
|
+
import { classifySelectionStyleTarget, type SelectionStyleTarget } from '../apply-style'
|
|
6
|
+
import { createSheetContext } from '../context'
|
|
7
|
+
|
|
8
|
+
describe('classifySelectionStyleTarget', () => {
|
|
9
|
+
const cases: Array<{
|
|
10
|
+
name: string
|
|
11
|
+
range: ReturnType<typeof createRange>
|
|
12
|
+
rows: number
|
|
13
|
+
cols: number
|
|
14
|
+
expected: SelectionStyleTarget
|
|
15
|
+
}> = [
|
|
16
|
+
{
|
|
17
|
+
name: '整行(行号选区)',
|
|
18
|
+
range: createRange({ row: 2, col: 0 }, { row: 2, col: 25 }),
|
|
19
|
+
rows: 100,
|
|
20
|
+
cols: 26,
|
|
21
|
+
expected: 'row'
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: '多行整行',
|
|
25
|
+
range: createRange({ row: 1, col: 0 }, { row: 3, col: 25 }),
|
|
26
|
+
rows: 100,
|
|
27
|
+
cols: 26,
|
|
28
|
+
expected: 'row'
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: '整列(列头选区)',
|
|
32
|
+
range: createRange({ row: 0, col: 4 }, { row: 99, col: 4 }),
|
|
33
|
+
rows: 100,
|
|
34
|
+
cols: 26,
|
|
35
|
+
expected: 'col'
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
name: '局部区域',
|
|
39
|
+
range: createRange({ row: 0, col: 0 }, { row: 2, col: 2 }),
|
|
40
|
+
rows: 100,
|
|
41
|
+
cols: 26,
|
|
42
|
+
expected: 'cell'
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: '全表(行列皆满)→ 格样式',
|
|
46
|
+
range: createRange({ row: 0, col: 0 }, { row: 99, col: 25 }),
|
|
47
|
+
rows: 100,
|
|
48
|
+
cols: 26,
|
|
49
|
+
expected: 'cell'
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
|
|
53
|
+
for (const c of cases) {
|
|
54
|
+
it(c.name, () => {
|
|
55
|
+
expect(classifySelectionStyleTarget(c.range, c.rows, c.cols)).toBe(c.expected)
|
|
56
|
+
})
|
|
57
|
+
}
|
|
58
|
+
})
|
|
59
|
+
|
|
60
|
+
describe('SheetContext.applyStyle', () => {
|
|
61
|
+
it('无 resolveGridSize:一律 setCellStyle', () => {
|
|
62
|
+
const sheet = new Sheet()
|
|
63
|
+
const ctx = createSheetContext(sheet)
|
|
64
|
+
const range = createRange({ row: 0, col: 0 }, { row: 0, col: 25 })
|
|
65
|
+
ctx.applyStyle(range, { fill: { color: '#FF0000' } })
|
|
66
|
+
expect(sheet.getRowStyle(0)).toBeUndefined()
|
|
67
|
+
expect(sheet.getCellStyle({ row: 0, col: 0 })).toEqual({ fill: { color: '#FF0000' } })
|
|
68
|
+
expect(sheet.getCellStyle({ row: 0, col: 25 })).toEqual({ fill: { color: '#FF0000' } })
|
|
69
|
+
})
|
|
70
|
+
|
|
71
|
+
it('整行选区 → setRowStyle;插列后新空格继承填充', () => {
|
|
72
|
+
const sheet = new Sheet()
|
|
73
|
+
const ctx = createSheetContext(sheet, undefined, {
|
|
74
|
+
resolveGridSize: () => ({ rows: 100, cols: 26 })
|
|
75
|
+
})
|
|
76
|
+
const range = createRange({ row: 1, col: 0 }, { row: 1, col: 25 })
|
|
77
|
+
ctx.applyStyle(range, { fill: { color: '#AABBCC' } })
|
|
78
|
+
|
|
79
|
+
expect(sheet.getRowStyle(1)).toEqual({ fill: { color: '#AABBCC' } })
|
|
80
|
+
// 不物化逐格样式
|
|
81
|
+
expect(sheet.getCellStyle({ row: 1, col: 0 })).toBeUndefined()
|
|
82
|
+
expect(sheet.getEffectiveStyle({ row: 1, col: 10 })).toEqual({ fill: { color: '#AABBCC' } })
|
|
83
|
+
|
|
84
|
+
sheet.insertCols(0, 1)
|
|
85
|
+
expect(sheet.getEffectiveStyle({ row: 1, col: 0 })).toEqual({ fill: { color: '#AABBCC' } })
|
|
86
|
+
expect(sheet.getEffectiveStyle({ row: 1, col: 26 })).toEqual({ fill: { color: '#AABBCC' } })
|
|
87
|
+
})
|
|
88
|
+
|
|
89
|
+
it('整列选区 → setColStyle;插行后新空格继承', () => {
|
|
90
|
+
const sheet = new Sheet()
|
|
91
|
+
const ctx = createSheetContext(sheet, undefined, {
|
|
92
|
+
resolveGridSize: () => ({ rows: 50, cols: 10 })
|
|
93
|
+
})
|
|
94
|
+
const range = createRange({ row: 0, col: 2 }, { row: 49, col: 2 })
|
|
95
|
+
ctx.applyStyle(range, { font: { bold: true } })
|
|
96
|
+
|
|
97
|
+
expect(sheet.getColStyle(2)).toEqual({ font: { bold: true } })
|
|
98
|
+
expect(sheet.getCellStyle({ row: 0, col: 2 })).toBeUndefined()
|
|
99
|
+
expect(sheet.getEffectiveStyle({ row: 20, col: 2 })).toEqual({ font: { bold: true } })
|
|
100
|
+
|
|
101
|
+
sheet.insertRows(0, 1)
|
|
102
|
+
expect(sheet.getEffectiveStyle({ row: 0, col: 2 })).toEqual({ font: { bold: true } })
|
|
103
|
+
})
|
|
104
|
+
|
|
105
|
+
it('局部选区仍走 setCellStyle', () => {
|
|
106
|
+
const sheet = new Sheet()
|
|
107
|
+
const ctx = createSheetContext(sheet, undefined, {
|
|
108
|
+
resolveGridSize: () => ({ rows: 100, cols: 26 })
|
|
109
|
+
})
|
|
110
|
+
const range = createRange({ row: 0, col: 0 }, { row: 0, col: 1 })
|
|
111
|
+
ctx.applyStyle(range, { fill: { color: '#112233' } })
|
|
112
|
+
expect(sheet.getRowStyle(0)).toBeUndefined()
|
|
113
|
+
expect(sheet.getCellStyle({ row: 0, col: 0 })).toEqual({ fill: { color: '#112233' } })
|
|
114
|
+
expect(sheet.getCellStyle({ row: 0, col: 1 })).toEqual({ fill: { color: '#112233' } })
|
|
115
|
+
})
|
|
116
|
+
|
|
117
|
+
it('applyStyle 整行写入进 undo', () => {
|
|
118
|
+
const sheet = new Sheet()
|
|
119
|
+
const ctx = createSheetContext(sheet, undefined, {
|
|
120
|
+
resolveGridSize: () => ({ rows: 100, cols: 26 })
|
|
121
|
+
})
|
|
122
|
+
ctx.applyStyle(createRange({ row: 0, col: 0 }, { row: 0, col: 25 }), {
|
|
123
|
+
fill: { color: '#00FF00' }
|
|
124
|
+
})
|
|
125
|
+
expect(sheet.getRowStyle(0)).toBeDefined()
|
|
126
|
+
expect(ctx.undo()).toBe(true)
|
|
127
|
+
expect(sheet.getRowStyle(0)).toBeUndefined()
|
|
128
|
+
})
|
|
129
|
+
})
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { CellRange } from '@veltra/sheet-core/core/address'
|
|
2
|
+
import type { SetAxisStyleItem } from '@veltra/sheet-core/core/command/set-axis-style'
|
|
3
|
+
import type { CellStylePatch } from '@veltra/sheet-core/core/style/types'
|
|
4
|
+
|
|
5
|
+
/** 样式写入目标:整行 / 整列默认样式,或逐格 */
|
|
6
|
+
export type SelectionStyleTarget = 'row' | 'col' | 'cell'
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* 按选区相对渲染网格的跨度判定样式写入目标(对齐 Excel):
|
|
10
|
+
* - 跨满全部列且未跨满全部行 → 行默认样式(rowStyles)
|
|
11
|
+
* - 跨满全部行且未跨满全部列 → 列默认样式(colStyles)
|
|
12
|
+
* - 其余(含全表 / 局部)→ 单元格样式
|
|
13
|
+
*/
|
|
14
|
+
export function classifySelectionStyleTarget(
|
|
15
|
+
range: CellRange,
|
|
16
|
+
renderRows: number,
|
|
17
|
+
renderCols: number
|
|
18
|
+
): SelectionStyleTarget {
|
|
19
|
+
const cols = Math.max(renderCols, 1)
|
|
20
|
+
const rows = Math.max(renderRows, 1)
|
|
21
|
+
const spansAllCols = range.start.col === 0 && range.end.col >= cols - 1
|
|
22
|
+
const spansAllRows = range.start.row === 0 && range.end.row >= rows - 1
|
|
23
|
+
if (spansAllCols && !spansAllRows) return 'row'
|
|
24
|
+
if (spansAllRows && !spansAllCols) return 'col'
|
|
25
|
+
return 'cell'
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** 整行/整列选区 → set-axis-style 写入项(partial)或清除项(clear) */
|
|
29
|
+
export function axisStyleItemsForRange(
|
|
30
|
+
range: CellRange,
|
|
31
|
+
axis: 'row' | 'col',
|
|
32
|
+
patch: { partial: CellStylePatch } | { clear: true }
|
|
33
|
+
): SetAxisStyleItem[] {
|
|
34
|
+
const start = axis === 'row' ? range.start.row : range.start.col
|
|
35
|
+
const end = axis === 'row' ? range.end.row : range.end.col
|
|
36
|
+
const items: SetAxisStyleItem[] = []
|
|
37
|
+
for (let index = start; index <= end; index++) {
|
|
38
|
+
items.push({ index, ...patch })
|
|
39
|
+
}
|
|
40
|
+
return items
|
|
41
|
+
}
|
package/src/tools/builtin.ts
CHANGED
|
@@ -44,8 +44,8 @@ function toggleFontFlag(
|
|
|
44
44
|
): void {
|
|
45
45
|
const sel = selectionRange(ctx)
|
|
46
46
|
if (!sel) return
|
|
47
|
-
const on = ctx.
|
|
48
|
-
ctx.
|
|
47
|
+
const on = ctx.getEffectiveStyle(sel.activeCell)?.font?.[field] === true
|
|
48
|
+
ctx.applyStyle(sel.range, { font: { [field]: on ? null : true } })
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
/** 对齐 toggle:点当前档 = 清除,点其它档 = 切换 */
|
|
@@ -56,11 +56,11 @@ function toggleAlign(
|
|
|
56
56
|
): void {
|
|
57
57
|
const sel = selectionRange(ctx)
|
|
58
58
|
if (!sel) return
|
|
59
|
-
const current = ctx.
|
|
59
|
+
const current = ctx.getEffectiveStyle(sel.activeCell)?.align?.[axis]
|
|
60
60
|
if (current === value) {
|
|
61
|
-
ctx.
|
|
61
|
+
ctx.applyStyle(sel.range, { align: { [axis]: null } })
|
|
62
62
|
} else {
|
|
63
|
-
ctx.
|
|
63
|
+
ctx.applyStyle(sel.range, { align: { [axis]: value } })
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
|
|
@@ -181,7 +181,7 @@ registerTool({
|
|
|
181
181
|
disabled: (ctx) => !ctx.getSelection().activeCell,
|
|
182
182
|
active: (ctx) => {
|
|
183
183
|
const active = ctx.getSelection().activeCell
|
|
184
|
-
return !!active && ctx.
|
|
184
|
+
return !!active && ctx.getEffectiveStyle(active)?.font?.bold === true
|
|
185
185
|
},
|
|
186
186
|
onClick: (ctx) => toggleFontFlag(ctx, 'bold')
|
|
187
187
|
})
|
|
@@ -196,7 +196,7 @@ registerTool({
|
|
|
196
196
|
disabled: (ctx) => !ctx.getSelection().activeCell,
|
|
197
197
|
active: (ctx) => {
|
|
198
198
|
const active = ctx.getSelection().activeCell
|
|
199
|
-
return !!active && ctx.
|
|
199
|
+
return !!active && ctx.getEffectiveStyle(active)?.font?.italic === true
|
|
200
200
|
},
|
|
201
201
|
onClick: (ctx) => toggleFontFlag(ctx, 'italic')
|
|
202
202
|
})
|
|
@@ -211,7 +211,7 @@ registerTool({
|
|
|
211
211
|
disabled: (ctx) => !ctx.getSelection().activeCell,
|
|
212
212
|
active: (ctx) => {
|
|
213
213
|
const active = ctx.getSelection().activeCell
|
|
214
|
-
return !!active && ctx.
|
|
214
|
+
return !!active && ctx.getEffectiveStyle(active)?.font?.underline === true
|
|
215
215
|
},
|
|
216
216
|
onClick: (ctx) => toggleFontFlag(ctx, 'underline')
|
|
217
217
|
})
|
|
@@ -226,7 +226,7 @@ registerTool({
|
|
|
226
226
|
disabled: (ctx) => !ctx.getSelection().activeCell,
|
|
227
227
|
active: (ctx) => {
|
|
228
228
|
const active = ctx.getSelection().activeCell
|
|
229
|
-
return !!active && ctx.
|
|
229
|
+
return !!active && ctx.getEffectiveStyle(active)?.font?.strikethrough === true
|
|
230
230
|
},
|
|
231
231
|
onClick: (ctx) => toggleFontFlag(ctx, 'strikethrough')
|
|
232
232
|
})
|
|
@@ -265,7 +265,7 @@ registerTool({
|
|
|
265
265
|
disabled: (ctx) => !ctx.getSelection().activeCell,
|
|
266
266
|
active: (ctx) => {
|
|
267
267
|
const active = ctx.getSelection().activeCell
|
|
268
|
-
return !!active && ctx.
|
|
268
|
+
return !!active && ctx.getEffectiveStyle(active)?.align?.horizontal === 'left'
|
|
269
269
|
},
|
|
270
270
|
onClick: (ctx) => toggleAlign(ctx, 'horizontal', 'left')
|
|
271
271
|
})
|
|
@@ -280,7 +280,7 @@ registerTool({
|
|
|
280
280
|
disabled: (ctx) => !ctx.getSelection().activeCell,
|
|
281
281
|
active: (ctx) => {
|
|
282
282
|
const active = ctx.getSelection().activeCell
|
|
283
|
-
return !!active && ctx.
|
|
283
|
+
return !!active && ctx.getEffectiveStyle(active)?.align?.horizontal === 'center'
|
|
284
284
|
},
|
|
285
285
|
onClick: (ctx) => toggleAlign(ctx, 'horizontal', 'center')
|
|
286
286
|
})
|
|
@@ -295,7 +295,7 @@ registerTool({
|
|
|
295
295
|
disabled: (ctx) => !ctx.getSelection().activeCell,
|
|
296
296
|
active: (ctx) => {
|
|
297
297
|
const active = ctx.getSelection().activeCell
|
|
298
|
-
return !!active && ctx.
|
|
298
|
+
return !!active && ctx.getEffectiveStyle(active)?.align?.horizontal === 'right'
|
|
299
299
|
},
|
|
300
300
|
onClick: (ctx) => toggleAlign(ctx, 'horizontal', 'right')
|
|
301
301
|
})
|
|
@@ -310,7 +310,7 @@ registerTool({
|
|
|
310
310
|
disabled: (ctx) => !ctx.getSelection().activeCell,
|
|
311
311
|
active: (ctx) => {
|
|
312
312
|
const active = ctx.getSelection().activeCell
|
|
313
|
-
return !!active && ctx.
|
|
313
|
+
return !!active && ctx.getEffectiveStyle(active)?.align?.vertical === 'top'
|
|
314
314
|
},
|
|
315
315
|
onClick: (ctx) => toggleAlign(ctx, 'vertical', 'top')
|
|
316
316
|
})
|
|
@@ -325,7 +325,7 @@ registerTool({
|
|
|
325
325
|
disabled: (ctx) => !ctx.getSelection().activeCell,
|
|
326
326
|
active: (ctx) => {
|
|
327
327
|
const active = ctx.getSelection().activeCell
|
|
328
|
-
return !!active && ctx.
|
|
328
|
+
return !!active && ctx.getEffectiveStyle(active)?.align?.vertical === 'middle'
|
|
329
329
|
},
|
|
330
330
|
onClick: (ctx) => toggleAlign(ctx, 'vertical', 'middle')
|
|
331
331
|
})
|
|
@@ -340,7 +340,7 @@ registerTool({
|
|
|
340
340
|
disabled: (ctx) => !ctx.getSelection().activeCell,
|
|
341
341
|
active: (ctx) => {
|
|
342
342
|
const active = ctx.getSelection().activeCell
|
|
343
|
-
return !!active && ctx.
|
|
343
|
+
return !!active && ctx.getEffectiveStyle(active)?.align?.vertical === 'bottom'
|
|
344
344
|
},
|
|
345
345
|
onClick: (ctx) => toggleAlign(ctx, 'vertical', 'bottom')
|
|
346
346
|
})
|
|
@@ -355,13 +355,13 @@ registerTool({
|
|
|
355
355
|
disabled: (ctx) => !ctx.getSelection().activeCell,
|
|
356
356
|
active: (ctx) => {
|
|
357
357
|
const active = ctx.getSelection().activeCell
|
|
358
|
-
return !!active && ctx.
|
|
358
|
+
return !!active && ctx.getEffectiveStyle(active)?.align?.wrap === true
|
|
359
359
|
},
|
|
360
360
|
onClick: (ctx) => {
|
|
361
361
|
const sel = selectionRange(ctx)
|
|
362
362
|
if (!sel) return
|
|
363
|
-
const on = ctx.
|
|
364
|
-
ctx.
|
|
363
|
+
const on = ctx.getEffectiveStyle(sel.activeCell)?.align?.wrap === true
|
|
364
|
+
ctx.applyStyle(sel.range, { align: { wrap: on ? null : true } })
|
|
365
365
|
}
|
|
366
366
|
})
|
|
367
367
|
|
|
@@ -393,8 +393,8 @@ registerTool({
|
|
|
393
393
|
})
|
|
394
394
|
|
|
395
395
|
// ─── file(导入 / 导出)────────────────────────────────────
|
|
396
|
-
// 导出 = 弹层选 xlsx / csv;导入 = 点击直接系统文件选择(
|
|
397
|
-
// sheet.vue 覆盖 onClick;tools 层不 import
|
|
396
|
+
// 导出 = 弹层选 xlsx / csv;导入 = 点击直接系统文件选择(components/sheet/import-file.ts,
|
|
397
|
+
// sheet.vue 覆盖 onClick;tools 层不 import 组件层)。
|
|
398
398
|
// 下载逻辑见 tools/download.ts(core/io 保持纯 TS 无头可测)。
|
|
399
399
|
|
|
400
400
|
registerTool({
|
package/src/tools/context.ts
CHANGED
|
@@ -10,6 +10,8 @@ import type { FrozenState, Sheet } from '@veltra/sheet-core/core/sheet'
|
|
|
10
10
|
import type { CellStyle, CellStylePatch } from '@veltra/sheet-core/core/style/types'
|
|
11
11
|
import type { Workbook } from '@veltra/sheet-core/core/workbook'
|
|
12
12
|
|
|
13
|
+
import { axisStyleItemsForRange, classifySelectionStyleTarget } from './apply-style'
|
|
14
|
+
|
|
13
15
|
/**
|
|
14
16
|
* SheetContext:工具的唯一操作门面。
|
|
15
17
|
*
|
|
@@ -43,12 +45,33 @@ export interface SheetContext {
|
|
|
43
45
|
getCellInfo(addr: CellAddress): CellInfo
|
|
44
46
|
|
|
45
47
|
// ─── 样式(写入经命令系统,可 undo) ───────────────────────
|
|
46
|
-
/**
|
|
48
|
+
/**
|
|
49
|
+
* 按选区形态写样式(Excel 语义):
|
|
50
|
+
* 整行选区 → rowStyles;整列选区 → colStyles;其余 → 逐格。
|
|
51
|
+
* 判定依赖 createSheetContext 注入的渲染尺寸;未注入时一律走 setCellStyle。
|
|
52
|
+
*/
|
|
53
|
+
applyStyle(range: CellRange, partial: CellStylePatch): void
|
|
54
|
+
/**
|
|
55
|
+
* 选区样式目标(与 applyStyle 同一判定);未注入渲染尺寸时恒为 'cell'。
|
|
56
|
+
*/
|
|
57
|
+
resolveStyleTarget(range: CellRange): 'row' | 'col' | 'cell'
|
|
58
|
+
/**
|
|
59
|
+
* 按选区形态清除样式:整行/整列清对应默认样式;其余清单元格 s。
|
|
60
|
+
* 未注入渲染尺寸时一律走 clearCellStyle。
|
|
61
|
+
*/
|
|
62
|
+
clearStyle(range: CellRange): void
|
|
63
|
+
/** 设置区域单元格样式(部分合并语义,见 CellStylePatch);空样式 = 删除 s 字段 */
|
|
47
64
|
setCellStyle(range: CellRange, partial: CellStylePatch): void
|
|
48
|
-
/**
|
|
65
|
+
/** 清除区域单元格样式(保留值 / 公式) */
|
|
49
66
|
clearCellStyle(range: CellRange): void
|
|
50
|
-
/**
|
|
67
|
+
/** 设置行默认样式(部分合并,进 undo) */
|
|
68
|
+
setRowStyle(row: number, partial: CellStylePatch): void
|
|
69
|
+
/** 设置列默认样式(部分合并,进 undo) */
|
|
70
|
+
setColStyle(col: number, partial: CellStylePatch): void
|
|
71
|
+
/** 读取单元格样式(原始存储语义:被覆盖格 → undefined;不含行列默认) */
|
|
51
72
|
getCellStyle(addr: CellAddress): CellStyle | undefined
|
|
73
|
+
/** 有效样式:列 → 行 → 格字段级叠加(空格可继承行列默认) */
|
|
74
|
+
getEffectiveStyle(addr: CellAddress): CellStyle | undefined
|
|
52
75
|
|
|
53
76
|
// ─── 写入(全部经命令系统,可 undo) ───────────────────────
|
|
54
77
|
setCellValue(addr: CellAddress, value: CellValue): void
|
|
@@ -105,6 +128,15 @@ export interface SheetContext {
|
|
|
105
128
|
onImageChange(handler: (payload: { id?: string }) => void): () => void
|
|
106
129
|
}
|
|
107
130
|
|
|
131
|
+
/** createSheetContext 可选配置 */
|
|
132
|
+
export interface SheetContextOptions {
|
|
133
|
+
/**
|
|
134
|
+
* 当前渲染网格尺寸(与 SheetGrid / resolveRenderSize 一致)。
|
|
135
|
+
* applyStyle / clearStyle 用其判定整行/整列;缺省时不走行列默认样式。
|
|
136
|
+
*/
|
|
137
|
+
resolveGridSize?: () => { rows: number; cols: number }
|
|
138
|
+
}
|
|
139
|
+
|
|
108
140
|
/**
|
|
109
141
|
* 创建工具上下文。
|
|
110
142
|
* @param resolveSheet 活动 sheet 解析器(USheet 传 `() => activeSheet`,
|
|
@@ -113,14 +145,21 @@ export interface SheetContext {
|
|
|
113
145
|
* 支持传解析函数 `() => Workbook`——USheet 在 props.workbook 动态切换后,
|
|
114
146
|
* 上下文始终解析到**当前**工作簿(#2:旧实现取构造时值快照,宿主切换
|
|
115
147
|
* workbook prop 后导出工具仍导出旧工作簿)
|
|
148
|
+
* @param options.resolveGridSize 渲染尺寸解析器(整行/整列样式路由)
|
|
116
149
|
*/
|
|
117
150
|
export function createSheetContext(
|
|
118
151
|
resolveSheet: Sheet | (() => Sheet),
|
|
119
|
-
workbook?: Workbook | (() => Workbook)
|
|
152
|
+
workbook?: Workbook | (() => Workbook),
|
|
153
|
+
options?: SheetContextOptions
|
|
120
154
|
): SheetContext {
|
|
121
155
|
const sheet = typeof resolveSheet === 'function' ? resolveSheet : () => resolveSheet
|
|
122
156
|
const resolveWorkbook =
|
|
123
157
|
typeof workbook === 'function' ? workbook : workbook != null ? () => workbook : undefined
|
|
158
|
+
const resolveGridSize = options?.resolveGridSize
|
|
159
|
+
const resolveTarget = (range: CellRange) => {
|
|
160
|
+
const size = resolveGridSize?.()
|
|
161
|
+
return size ? classifySelectionStyleTarget(range, size.rows, size.cols) : 'cell'
|
|
162
|
+
}
|
|
124
163
|
return {
|
|
125
164
|
get workbook() {
|
|
126
165
|
return resolveWorkbook?.()
|
|
@@ -143,9 +182,33 @@ export function createSheetContext(
|
|
|
143
182
|
mergeCells: (range) => sheet().mergeCells(range),
|
|
144
183
|
unmergeCells: (range) => sheet().unmergeCells(range),
|
|
145
184
|
|
|
185
|
+
applyStyle: (range, partial) => {
|
|
186
|
+
const target = resolveTarget(range)
|
|
187
|
+
if (target === 'row' || target === 'col') {
|
|
188
|
+
const items = axisStyleItemsForRange(range, target, { partial })
|
|
189
|
+
if (items.length === 0) return
|
|
190
|
+
sheet().executeCommand('sheet.command.set-axis-style', { axis: target, items })
|
|
191
|
+
return
|
|
192
|
+
}
|
|
193
|
+
sheet().setCellStyle(range, partial)
|
|
194
|
+
},
|
|
195
|
+
resolveStyleTarget: (range) => resolveTarget(range),
|
|
196
|
+
clearStyle: (range) => {
|
|
197
|
+
const target = resolveTarget(range)
|
|
198
|
+
if (target === 'row' || target === 'col') {
|
|
199
|
+
const items = axisStyleItemsForRange(range, target, { clear: true })
|
|
200
|
+
if (items.length === 0) return
|
|
201
|
+
sheet().executeCommand('sheet.command.set-axis-style', { axis: target, items })
|
|
202
|
+
return
|
|
203
|
+
}
|
|
204
|
+
sheet().clearCellStyle(range)
|
|
205
|
+
},
|
|
146
206
|
setCellStyle: (range, partial) => sheet().setCellStyle(range, partial),
|
|
147
207
|
clearCellStyle: (range) => sheet().clearCellStyle(range),
|
|
208
|
+
setRowStyle: (row, partial) => sheet().setRowStyle(row, partial),
|
|
209
|
+
setColStyle: (col, partial) => sheet().setColStyle(col, partial),
|
|
148
210
|
getCellStyle: (addr) => sheet().getCellStyle(addr),
|
|
211
|
+
getEffectiveStyle: (addr) => sheet().getEffectiveStyle(addr),
|
|
149
212
|
executeCommand: <R = void>(commandId: string, params: unknown): R | undefined =>
|
|
150
213
|
sheet().executeCommand<R>(commandId, params),
|
|
151
214
|
|
package/src/tools/index.ts
CHANGED
package/src/types/index.ts
CHANGED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { Workbook } from '@veltra/sheet-core/core/workbook'
|
|
2
|
+
import type { DeconstructValue } from '@veltra/utils'
|
|
3
|
+
|
|
4
|
+
import type { DataConnection, DataConnector, ReportTemplate } from '../report'
|
|
5
|
+
|
|
6
|
+
/** 报表设计器组件属性(ADR-0003 决策 2) */
|
|
7
|
+
export interface ReportDesignerProps {
|
|
8
|
+
/** 数据连接器(如 `createHttpConnector({ endpoint })`):数据中枢的测试连接 / 字段解析 / 记录预览均经它 */
|
|
9
|
+
connector: DataConnector
|
|
10
|
+
/**
|
|
11
|
+
* 数据连接列表(`v-model:connections`):纯序列化对象,仅驻留内存;
|
|
12
|
+
* 凭据的持久化与安全存储完全由宿主掌控(ADR-0003 决策 4)
|
|
13
|
+
*/
|
|
14
|
+
connections?: DataConnection[]
|
|
15
|
+
/**
|
|
16
|
+
* 载入既有 Report Template 继续设计:恢复网格绑定与设计态数据集;
|
|
17
|
+
* 内嵌连接按 id 合并进 `v-model:connections`(仅缺省时追加,宿主列表是单一事实源)
|
|
18
|
+
*/
|
|
19
|
+
template?: ReportTemplate
|
|
20
|
+
/** 承载设计态的工作簿(USheet 先例:缺省内部自建单 sheet 工作簿) */
|
|
21
|
+
workbook?: Workbook
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** 报表设计器组件定义的事件 */
|
|
25
|
+
export interface ReportDesignerEmits {
|
|
26
|
+
(e: 'update:connections', value: DataConnection[]): void
|
|
27
|
+
/** 数据集增删改或数据中枢关闭:宿主可立即持久化工作区 */
|
|
28
|
+
(e: 'datasets-change'): void
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** 在组件内部引用 */
|
|
32
|
+
export interface _ReportDesignerExposed {
|
|
33
|
+
/** 取回含 meta 绑定与内嵌数据集定义的可序列化 Report Template */
|
|
34
|
+
getTemplate: () => ReportTemplate
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** 报表设计器组件暴露的方法 */
|
|
38
|
+
export type ReportDesignerExposed = DeconstructValue<_ReportDesignerExposed>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { Workbook } from '@veltra/sheet-core/core/workbook'
|
|
2
|
+
import type { DeconstructValue } from '@veltra/utils'
|
|
3
|
+
|
|
4
|
+
import type { DataConnector, ReportTemplate } from '../report'
|
|
5
|
+
import type { ReportColWidthEntry } from '../report/export-xlsx'
|
|
6
|
+
|
|
7
|
+
/** 报表查看器组件属性(ADR-0003 决策 2) */
|
|
8
|
+
export interface ReportViewerProps {
|
|
9
|
+
/** 数据连接器(如 `createHttpConnector({ endpoint })`) */
|
|
10
|
+
connector: DataConnector
|
|
11
|
+
/**
|
|
12
|
+
* 自包含 Report Template(SheetSnapshot + 内嵌数据集定义,见 `ReportTemplate`):
|
|
13
|
+
* 查看器据此提取实际绑定数据集的查询参数并集生成 Filter Bar,并经连接器取数展开渲染
|
|
14
|
+
*/
|
|
15
|
+
template: ReportTemplate
|
|
16
|
+
/** 承载填充报表的工作簿(USheet 先例:缺省内部自建单 sheet 工作簿) */
|
|
17
|
+
workbook?: Workbook
|
|
18
|
+
/**
|
|
19
|
+
* 列宽显式覆盖(可选):优先于模板 `colWidths` / 展开映射结果写入模型与网格。
|
|
20
|
+
* 列宽已进 `SheetSnapshot.colWidths`,通常无需再传。
|
|
21
|
+
*/
|
|
22
|
+
colWidths?: ReadonlyArray<ReportColWidthEntry>
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** 在组件内部引用 */
|
|
26
|
+
export interface _ReportViewerExposed {
|
|
27
|
+
/** 重新取数并展开渲染(外部状态变化后主动刷新报表) */
|
|
28
|
+
refresh: () => Promise<void>
|
|
29
|
+
/**
|
|
30
|
+
* 导出填充报表为 XLSX(取数完成前拒绝;内部读取填充 sheet 与运行时列宽)。
|
|
31
|
+
* 不内置导出按钮,工具栏由下游决定。
|
|
32
|
+
*/
|
|
33
|
+
exportXlsx: () => Promise<void>
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** 报表查看器组件暴露的方法 */
|
|
37
|
+
export type ReportViewerExposed = DeconstructValue<_ReportViewerExposed>
|
package/src/types/sheet.ts
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import type { Sheet } from '@veltra/sheet-core/core/sheet'
|
|
2
2
|
import type { Workbook } from '@veltra/sheet-core/core/workbook'
|
|
3
|
-
import type {
|
|
3
|
+
import type {
|
|
4
|
+
ResolveCellRenderer,
|
|
5
|
+
ResolveCellStyleHook,
|
|
6
|
+
ResolveDisplayValue,
|
|
7
|
+
SheetGrid
|
|
8
|
+
} from '@veltra/sheet-core/grid/sheet-grid'
|
|
4
9
|
import type { DeconstructValue } from '@veltra/utils'
|
|
5
10
|
import type { ComputedRef } from 'vue'
|
|
6
11
|
|
|
@@ -14,12 +19,32 @@ export interface SheetProps {
|
|
|
14
19
|
rows?: number
|
|
15
20
|
/** 渲染列数,默认 26(A..Z) */
|
|
16
21
|
cols?: number
|
|
22
|
+
/**
|
|
23
|
+
* 显示值覆盖(设计态 Binding Placeholder 等):覆盖 VTable record,不写 CellData.v
|
|
24
|
+
*/
|
|
25
|
+
resolveDisplayValue?: ResolveDisplayValue
|
|
26
|
+
/**
|
|
27
|
+
* 动态单元格样式:视口渲染时叠加条件样式补丁,不写 CellData.s / StylePool
|
|
28
|
+
*/
|
|
29
|
+
resolveCellStyle?: ResolveCellStyleHook
|
|
30
|
+
/**
|
|
31
|
+
* 动态单元格渲染(ADR-0004):视口布局时按格自定义渲染形态(VTable
|
|
32
|
+
* customLayout,布局构建用 sheet-core 导出的 CustomLayout),返回 undefined
|
|
33
|
+
* 回落默认渲染;不写模型、不进快照
|
|
34
|
+
*/
|
|
35
|
+
resolveCellRenderer?: ResolveCellRenderer
|
|
17
36
|
/** 是否显示工具栏,默认 true */
|
|
18
37
|
showToolbar?: boolean
|
|
19
38
|
/** 是否显示顶部公式栏(名称框 + fx 输入栏),默认 true */
|
|
20
39
|
showFormulaBar?: boolean
|
|
21
40
|
/** 是否显示底部 sheet 标签栏,默认 true */
|
|
22
41
|
showTabs?: boolean
|
|
42
|
+
/** 是否显示行号列,默认 true */
|
|
43
|
+
showRowHeader?: boolean
|
|
44
|
+
/** 是否显示列字母表头,默认 true */
|
|
45
|
+
showColHeader?: boolean
|
|
46
|
+
/** 只读预览(关闭编辑回写、填充柄等写入口) */
|
|
47
|
+
readonly?: boolean
|
|
23
48
|
}
|
|
24
49
|
|
|
25
50
|
export interface SheetEmits {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|