@trebco/treb 29.4.1 → 29.5.1
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/treb-spreadsheet-light.mjs +11 -11
- package/dist/treb-spreadsheet.mjs +11 -11
- package/dist/treb.d.ts +34 -35
- package/package.json +1 -1
- package/treb-base-types/src/gradient.ts +2 -2
- package/treb-base-types/src/style.ts +89 -6
- package/treb-base-types/src/theme.ts +24 -15
- package/treb-calculator/src/functions/sparkline.ts +2 -2
- package/treb-data-model/src/conditional_format.ts +8 -1
- package/treb-data-model/src/sheet.ts +14 -15
- package/treb-embed/src/custom-element/spreadsheet-constructor.ts +7 -3
- package/treb-embed/src/embedded-spreadsheet.ts +29 -13
- package/treb-embed/src/types.ts +9 -0
- package/treb-export/src/drawing2/chart2.ts +20 -38
- package/treb-export/src/drawing2/drawing2.ts +2 -107
- package/treb-export/src/export-worker/export-worker.ts +1 -1
- package/treb-export/src/{export2.ts → export.ts} +426 -628
- package/treb-export/src/import2.ts +6 -15
- package/treb-export/src/workbook-style2.ts +16 -14
- package/treb-export/src/workbook2.ts +2 -18
- package/treb-export/src/xml-utils.ts +50 -2
- package/treb-export/src/zip-wrapper.ts +1 -1
- package/treb-grid/src/editors/overlay_editor.ts +3 -3
- package/treb-grid/src/layout/base_layout.ts +3 -3
- package/treb-grid/src/render/tile_renderer.ts +49 -48
- package/treb-grid/src/types/grid.ts +135 -8
- package/treb-grid/src/types/grid_base.ts +10 -1
- package/treb-parser/src/parser-types.ts +10 -0
- package/treb-parser/src/parser.ts +33 -13
|
@@ -19,8 +19,6 @@
|
|
|
19
19
|
*
|
|
20
20
|
*/
|
|
21
21
|
|
|
22
|
-
// import * as ElementTree from 'elementtree';
|
|
23
|
-
// import { Element, ElementTree as Tree } from 'elementtree';
|
|
24
22
|
import type { UnitAddress, UnitRange, UnitLiteral, ExpressionUnit } from 'treb-parser';
|
|
25
23
|
|
|
26
24
|
import { static_title, ref_title, chart_template } from './chart-template-components2';
|
|
@@ -29,18 +27,6 @@ import { donut_json } from './donut-chart-template2';
|
|
|
29
27
|
import { scatter_json, scatter_series } from './scatter-chart-template2';
|
|
30
28
|
import { bubble_json, bubble_series } from './bubble-chart-template';
|
|
31
29
|
|
|
32
|
-
import { XMLUtils } from '../xml-utils';
|
|
33
|
-
|
|
34
|
-
/*
|
|
35
|
-
import { donut_json } from './donut-chart-template';
|
|
36
|
-
import { static_title, ref_title, chart_template } from './chart-template-components';
|
|
37
|
-
import { column_json, column_series } from './column-chart-template';
|
|
38
|
-
import { scatter_json, scatter_series } from './scatter-chart-template';
|
|
39
|
-
import { scatter_series as scatter2_series } from './scatter2-chart-template';
|
|
40
|
-
*/
|
|
41
|
-
|
|
42
|
-
// import { v4 as uuidv4 } from 'uuid';
|
|
43
|
-
|
|
44
30
|
import { Localization } from 'treb-base-types';
|
|
45
31
|
import type { RelationshipMap } from '../relationship';
|
|
46
32
|
|
|
@@ -73,31 +59,27 @@ export class Chart {
|
|
|
73
59
|
type: 'literal', value: '',
|
|
74
60
|
};
|
|
75
61
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
'a:rPr': {
|
|
85
|
-
a$: {
|
|
86
|
-
lang: Localization.locale,
|
|
87
|
-
},
|
|
62
|
+
if (unit && unit.type === 'literal') {
|
|
63
|
+
const title = JSON.parse(JSON.stringify(static_title));
|
|
64
|
+
const AP = title['c:tx']['c:rich']['a:p'];
|
|
65
|
+
|
|
66
|
+
AP['a:r'] = {
|
|
67
|
+
'a:rPr': {
|
|
68
|
+
a$: {
|
|
69
|
+
lang: Localization.locale,
|
|
88
70
|
},
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
71
|
+
},
|
|
72
|
+
'a:t': unit.value,
|
|
73
|
+
};
|
|
74
|
+
chartnode['c:title'] = title;
|
|
75
|
+
}
|
|
76
|
+
else if (unit) {
|
|
77
|
+
const title = JSON.parse(JSON.stringify(ref_title));
|
|
78
|
+
//const CF = title['c:tx']['c:strRef']['c:f'];
|
|
79
|
+
//CF.t$ = unit.label;
|
|
80
|
+
title['c:tx']['c:strRef']['c:f'] = unit.label;
|
|
81
|
+
chartnode['c:title'] = title;
|
|
82
|
+
}
|
|
101
83
|
|
|
102
84
|
}
|
|
103
85
|
|
|
@@ -25,6 +25,7 @@ import type { ChartOptions} from './chart2';
|
|
|
25
25
|
import { Chart} from './chart2';
|
|
26
26
|
import type { RelationshipMap} from '../relationship';
|
|
27
27
|
import { AddRel } from '../relationship';
|
|
28
|
+
import type { DOMContent } from '../xml-utils';
|
|
28
29
|
|
|
29
30
|
const pixel_offset = 9525;
|
|
30
31
|
|
|
@@ -194,65 +195,6 @@ export class Drawing {
|
|
|
194
195
|
},
|
|
195
196
|
},
|
|
196
197
|
|
|
197
|
-
/*
|
|
198
|
-
<xdr:nvPicPr>
|
|
199
|
-
<xdr:cNvPr id="3" name="Graphic 2">
|
|
200
|
-
<a:extLst>
|
|
201
|
-
<a:ext uri="{FF2B5EF4-FFF2-40B4-BE49-F238E27FC236}">
|
|
202
|
-
<a16:creationId xmlns:a16="http://schemas.microsoft.com/office/drawing/2014/main" id="{9BA0B4E8-3DD4-4297-8733-48C3F5D063BA}"/>
|
|
203
|
-
</a:ext>
|
|
204
|
-
</a:extLst>
|
|
205
|
-
</xdr:cNvPr>
|
|
206
|
-
<xdr:cNvPicPr>
|
|
207
|
-
<a:picLocks noChangeAspect="1"/>
|
|
208
|
-
</xdr:cNvPicPr>
|
|
209
|
-
</xdr:nvPicPr>
|
|
210
|
-
|
|
211
|
-
<xdr:blipFill>
|
|
212
|
-
|
|
213
|
-
[ this one is svg]
|
|
214
|
-
|
|
215
|
-
<a:blip xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" r:embed="rId1">
|
|
216
|
-
<a:extLst>
|
|
217
|
-
<a:ext uri="{28A0092B-C50C-407E-A947-70E740481C1C}">
|
|
218
|
-
<a14:useLocalDpi xmlns:a14="http://schemas.microsoft.com/office/drawing/2010/main" val="0"/>
|
|
219
|
-
</a:ext>
|
|
220
|
-
<a:ext uri="{96DAC541-7B7A-43D3-8B79-37D633B846F1}">
|
|
221
|
-
<asvg:svgBlip xmlns:asvg="http://schemas.microsoft.com/office/drawing/2016/SVG/main" r:embed="rId2"/>
|
|
222
|
-
</a:ext>
|
|
223
|
-
</a:extLst>
|
|
224
|
-
</a:blip>
|
|
225
|
-
|
|
226
|
-
[alt]
|
|
227
|
-
|
|
228
|
-
<a:blip xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" r:embed="rId3">
|
|
229
|
-
<a:extLst>
|
|
230
|
-
<a:ext uri="{28A0092B-C50C-407E-A947-70E740481C1C}">
|
|
231
|
-
<a14:useLocalDpi xmlns:a14="http://schemas.microsoft.com/office/drawing/2010/main" val="0"/>
|
|
232
|
-
</a:ext>
|
|
233
|
-
</a:extLst>
|
|
234
|
-
</a:blip>
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
<a:stretch>
|
|
238
|
-
<a:fillRect/>
|
|
239
|
-
</a:stretch>
|
|
240
|
-
</xdr:blipFill>
|
|
241
|
-
|
|
242
|
-
<xdr:spPr>
|
|
243
|
-
<a:xfrm>
|
|
244
|
-
<a:off x="0" y="0"/>
|
|
245
|
-
<a:ext cx="4057650" cy="6172200"/>
|
|
246
|
-
</a:xfrm>
|
|
247
|
-
<a:prstGeom prst="rect">
|
|
248
|
-
<a:avLst/>
|
|
249
|
-
</a:prstGeom>
|
|
250
|
-
</xdr:spPr>
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
*/
|
|
254
|
-
|
|
255
|
-
|
|
256
198
|
},
|
|
257
199
|
'xdr:clientData': {},
|
|
258
200
|
};
|
|
@@ -268,16 +210,6 @@ export class Drawing {
|
|
|
268
210
|
'xdr:nvGraphicFramePr': {
|
|
269
211
|
'xdr:cNvPr': {
|
|
270
212
|
a$: { id: chart.chart.index + 1, name: `Chart ${chart.chart.index}`, },
|
|
271
|
-
/*
|
|
272
|
-
'a:extLst': {
|
|
273
|
-
'a:ext': {
|
|
274
|
-
a$: { uri: '{FF2B5EF4-FFF2-40B4-BE49-F238E27FC236}' },
|
|
275
|
-
'a16:creationId': {
|
|
276
|
-
a$: { 'xmlns:a16': 'http://schemas.microsoft.com/office/drawing/2014/main' },
|
|
277
|
-
},
|
|
278
|
-
},
|
|
279
|
-
},
|
|
280
|
-
*/
|
|
281
213
|
},
|
|
282
214
|
'xdr:cNvGraphicFramePr': {},
|
|
283
215
|
},
|
|
@@ -303,7 +235,7 @@ export class Drawing {
|
|
|
303
235
|
return block;
|
|
304
236
|
});
|
|
305
237
|
|
|
306
|
-
const dom:
|
|
238
|
+
const dom: DOMContent = {
|
|
307
239
|
'xdr:wsDr': {
|
|
308
240
|
a$: {
|
|
309
241
|
'xmlns:xdr': 'http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing',
|
|
@@ -317,41 +249,4 @@ export class Drawing {
|
|
|
317
249
|
|
|
318
250
|
}
|
|
319
251
|
|
|
320
|
-
/*
|
|
321
|
-
public GetDrawingXML() {
|
|
322
|
-
const components: string[] = [`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n<xdr:wsDr xmlns:xdr="http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main">`];
|
|
323
|
-
|
|
324
|
-
for (let i = 0; i < this.charts.length; i++) {
|
|
325
|
-
|
|
326
|
-
const index = i + 1;
|
|
327
|
-
const anchor = this.charts[i].anchor;
|
|
328
|
-
|
|
329
|
-
components.push(
|
|
330
|
-
`<xdr:twoCellAnchor><xdr:from><xdr:col>${anchor.from.column}</xdr:col><xdr:colOff>${(anchor.from.column_offset || 0) * pixel_offset}</xdr:colOff>`
|
|
331
|
-
+ `<xdr:row>${anchor.from.row}</xdr:row><xdr:rowOff>${(anchor.from.row_offset || 0) * pixel_offset}</xdr:rowOff></xdr:from>`
|
|
332
|
-
+ `<xdr:to><xdr:col>${anchor.to.column}</xdr:col><xdr:colOff>${(anchor.to.column_offset || 0) * pixel_offset}</xdr:colOff>`
|
|
333
|
-
+ `<xdr:row>${anchor.to.row}</xdr:row><xdr:rowOff>${(anchor.to.row_offset || 0) * pixel_offset}</xdr:rowOff></xdr:to>`
|
|
334
|
-
+ `<xdr:graphicFrame macro=""><xdr:nvGraphicFramePr><xdr:cNvPr id="${index + 1}" name="Chart ${index}"><a:extLst><a:ext uri="{FF2B5EF4-FFF2-40B4-BE49-F238E27FC236}"><a16:creationId xmlns:a16="http://schemas.microsoft.com/office/drawing/2014/main" id="{9948BDEE-44B2-4E72-83C8-2C9C56F04EAA}"/></a:ext></a:extLst></xdr:cNvPr><xdr:cNvGraphicFramePr/></xdr:nvGraphicFramePr><xdr:xfrm><a:off x="0" y="0"/><a:ext cx="0" cy="0"/></xdr:xfrm><a:graphic><a:graphicData uri="http://schemas.openxmlformats.org/drawingml/2006/chart"><c:chart xmlns:c="http://schemas.openxmlformats.org/drawingml/2006/chart" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" r:id="rId${index}"/></a:graphicData></a:graphic></xdr:graphicFrame><xdr:clientData/></xdr:twoCellAnchor>`
|
|
335
|
-
);
|
|
336
|
-
|
|
337
|
-
}
|
|
338
|
-
components.push(`</xdr:wsDr>`);
|
|
339
|
-
return components.join('');
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
public GetDrawingRels() {
|
|
343
|
-
const components: string[] = [ `<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">`];
|
|
344
|
-
|
|
345
|
-
for (let i = 0; i < this.charts.length; i++) {
|
|
346
|
-
const index = i + 1;
|
|
347
|
-
const chart = this.charts[i].chart;
|
|
348
|
-
components.push(
|
|
349
|
-
`<Relationship Id="rId${index}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart" Target="../charts/chart${chart.index}.xml"/>`);
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
components.push(`</Relationships>`);
|
|
353
|
-
return components.join('');
|
|
354
|
-
}
|
|
355
|
-
*/
|
|
356
|
-
|
|
357
252
|
}
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
import type { ImportedSheetData } from 'treb-base-types';
|
|
23
23
|
import type { SerializedModel } from 'treb-data-model';
|
|
24
24
|
|
|
25
|
-
import { Exporter } from '../
|
|
25
|
+
import { Exporter } from '../export';
|
|
26
26
|
import { Importer } from '../import2';
|
|
27
27
|
|
|
28
28
|
const ctx: Worker = self as unknown as Worker;
|