@trebco/treb 25.2.0 → 25.5.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/{.eslintrc.js → .eslintrc.cjs} +4 -0
- package/api-generator/api-generator.ts +25 -55
- package/dist/treb-spreadsheet.mjs +9 -9
- package/dist/treb.d.ts +2 -2
- package/esbuild-custom-element.mjs +5 -264
- package/esbuild-utils.mjs +273 -0
- package/package.json +2 -2
- package/treb-base-types/src/cell.ts +23 -22
- package/treb-base-types/src/cells.ts +55 -2
- package/treb-base-types/src/theme.ts +0 -11
- package/treb-base-types/src/union.ts +2 -1
- package/treb-calculator/src/calculator.ts +8 -5
- package/treb-calculator/src/dag/array-vertex.ts +22 -22
- package/treb-calculator/src/dag/graph.ts +25 -23
- package/treb-calculator/src/dag/leaf_vertex.ts +23 -22
- package/treb-calculator/src/dag/spreadsheet_vertex.ts +25 -23
- package/treb-calculator/src/expression-calculator.ts +23 -22
- package/treb-calculator/src/function-error.ts +23 -22
- package/treb-calculator/src/functions/base-functions.ts +3 -2
- package/treb-calculator/src/functions/checkbox.ts +23 -22
- package/treb-calculator/src/functions/complex-functions.ts +2 -1
- package/treb-calculator/src/functions/finance-functions.ts +22 -22
- package/treb-calculator/src/functions/information-functions.ts +22 -22
- package/treb-calculator/src/functions/matrix-functions.ts +2 -1
- package/treb-calculator/src/functions/statistics-functions.ts +22 -22
- package/treb-calculator/src/functions/text-functions.ts +23 -22
- package/treb-calculator/src/primitives.ts +23 -22
- package/treb-calculator/src/utilities.ts +23 -24
- package/treb-charts/src/chart-functions.ts +22 -22
- package/treb-charts/src/chart.ts +6 -3
- package/treb-charts/src/renderer.ts +25 -23
- package/treb-charts/src/util.ts +23 -22
- package/treb-embed/modern.tsconfig.json +3 -2
- package/treb-embed/src/custom-element/spreadsheet-constructor.ts +57 -14
- package/treb-embed/src/embedded-spreadsheet.ts +81 -47
- package/treb-embed/src/options.ts +11 -0
- package/treb-embed/src/progress-dialog.ts +0 -3
- package/treb-embed/src/types.ts +14 -3
- package/treb-embed/style/layout.scss +32 -29
- package/treb-embed/style/theme-defaults.scss +5 -0
- package/treb-export/src/drawing2/chart2.ts +2 -2
- package/treb-export/src/drawing2/drawing2.ts +6 -4
- package/treb-export/src/export-worker/export-worker.ts +22 -24
- package/treb-export/src/export-worker/index-modern.ts +2 -1
- package/treb-export/src/export2.ts +15 -8
- package/treb-export/src/import2.ts +10 -5
- package/treb-export/src/workbook-sheet2.ts +2 -1
- package/treb-format/src/format.ts +23 -22
- package/treb-format/src/format_parser.ts +23 -22
- package/treb-format/src/value_parser.ts +23 -22
- package/treb-grid/src/editors/formula_bar.ts +2 -1
- package/treb-grid/src/editors/formula_editor_base.ts +4 -2
- package/treb-grid/src/editors/overlay_editor.ts +2 -1
- package/treb-grid/src/index.ts +12 -9
- package/treb-grid/src/layout/base_layout.ts +4 -2
- package/treb-grid/src/render/selection-renderer.ts +25 -23
- package/treb-grid/src/render/tile_renderer.ts +6 -4
- package/treb-grid/src/types/annotation.ts +33 -37
- package/treb-grid/src/types/data_model.ts +30 -22
- package/treb-grid/src/types/grid.ts +55 -584
- package/treb-grid/src/types/grid_base.ts +401 -7
- package/treb-grid/src/types/grid_events.ts +3 -0
- package/treb-grid/src/types/grid_selection.ts +22 -22
- package/treb-grid/src/types/named_range.ts +22 -22
- package/treb-grid/src/types/sheet.ts +8 -7
- package/treb-grid/src/types/sheet_types.ts +11 -7
- package/treb-grid/src/types/tab_bar.ts +1 -1
- package/treb-parser/src/parser.ts +5 -4
- package/tsproject.json +3 -4
- package/tsconfig.json +0 -10
- /package/treb-embed/src/{custom-element/content-types.d.ts → content-types.d.ts} +0 -0
|
@@ -22,6 +22,7 @@ module.exports = {
|
|
|
22
22
|
}
|
|
23
23
|
],
|
|
24
24
|
'camelcase': 'off',
|
|
25
|
+
'@typescript-eslint/no-unsafe-declaration-merging': 'error',
|
|
25
26
|
'@typescript-eslint/camelcase': 'off',
|
|
26
27
|
// '@typescript-eslint/explicit-function-return-type': 'off',
|
|
27
28
|
'@typescript-eslint/quotes': [
|
|
@@ -53,6 +54,9 @@ module.exports = {
|
|
|
53
54
|
|
|
54
55
|
'grouped-accessor-pairs': ['error', 'getBeforeSet'],
|
|
55
56
|
|
|
57
|
+
'@typescript-eslint/consistent-type-imports': 'error',
|
|
58
|
+
// '@typescript-eslint/consistent-type-exports': 'error',
|
|
59
|
+
|
|
56
60
|
}
|
|
57
61
|
|
|
58
62
|
/*
|
|
@@ -118,10 +118,13 @@ function CleanTransformer<T extends ts.Node>(): ts.TransformerFactory<T> {
|
|
|
118
118
|
*/
|
|
119
119
|
let exported_module = false;
|
|
120
120
|
|
|
121
|
-
return context => {
|
|
122
|
-
const visit: ts.Visitor = node => {
|
|
121
|
+
return (context: ts.TransformationContext) => {
|
|
123
122
|
|
|
124
|
-
|
|
123
|
+
const visit: ts.Visitor = (node: ts.Node): ts.Node|undefined => {
|
|
124
|
+
|
|
125
|
+
// FIXME: not sure what this was before
|
|
126
|
+
|
|
127
|
+
const modifiers = ((node as any).modifiers || []).map((member: ts.Node) => {
|
|
125
128
|
return ts.SyntaxKind[member.kind];
|
|
126
129
|
});
|
|
127
130
|
|
|
@@ -211,7 +214,7 @@ function CleanTransformer<T extends ts.Node>(): ts.TransformerFactory<T> {
|
|
|
211
214
|
})
|
|
212
215
|
));
|
|
213
216
|
|
|
214
|
-
if ((node as any).jsDoc) {
|
|
217
|
+
if ((node as any).jsDoc && (node as any).jsDoc[0]) {
|
|
215
218
|
|
|
216
219
|
const source_text = node.getSourceFile().text;
|
|
217
220
|
const jsDoc: ts.JSDoc[] = (node as any).jsDoc;
|
|
@@ -361,8 +364,10 @@ function CleanTransformer<T extends ts.Node>(): ts.TransformerFactory<T> {
|
|
|
361
364
|
}
|
|
362
365
|
|
|
363
366
|
return ts.visitEachChild(node, child => visit(child), context);
|
|
364
|
-
}
|
|
365
|
-
|
|
367
|
+
};
|
|
368
|
+
|
|
369
|
+
return (node: T) => ts.visitEachChild(node, visit, context);
|
|
370
|
+
|
|
366
371
|
};
|
|
367
372
|
|
|
368
373
|
}
|
|
@@ -430,23 +435,18 @@ function CollectDependencyTransformer<T extends ts.Node>(
|
|
|
430
435
|
|
|
431
436
|
};
|
|
432
437
|
|
|
433
|
-
return context => {
|
|
434
|
-
|
|
438
|
+
return (context: ts.TransformationContext) => {
|
|
439
|
+
|
|
440
|
+
const visitor: ts.Visitor = (node: ts.Node) => {
|
|
441
|
+
return node;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
const visit: ts.Visitor = (node: ts.Node) => {
|
|
435
445
|
|
|
436
446
|
const modifiers = ts.canHaveModifiers(node) ? (ts.getModifiers(node) || []).map(member => {
|
|
437
447
|
return ts.SyntaxKind[member.kind];
|
|
438
448
|
}) : [];
|
|
439
449
|
|
|
440
|
-
/*
|
|
441
|
-
const modifiers = (node.modifiers || []).map(member => {
|
|
442
|
-
return ts.SyntaxKind[member.kind];
|
|
443
|
-
});
|
|
444
|
-
|
|
445
|
-
if (modifiers.length) {
|
|
446
|
-
console.info({modifiers, modifiers2});
|
|
447
|
-
}
|
|
448
|
-
*/
|
|
449
|
-
|
|
450
450
|
const tags = GetDocTags(node);
|
|
451
451
|
|
|
452
452
|
const internal =
|
|
@@ -456,40 +456,6 @@ function CollectDependencyTransformer<T extends ts.Node>(
|
|
|
456
456
|
const declared = modifiers.includes('DeclareKeyword');
|
|
457
457
|
const is_public = !(modifiers.includes('ProtectedKeyword') || modifiers.includes('PrivateKeyword'));
|
|
458
458
|
|
|
459
|
-
/*
|
|
460
|
-
if ((node as any).name && ts.isIdentifier((node as any).name)) {
|
|
461
|
-
const name = (node as any).name.escapedText.toString();
|
|
462
|
-
if (/treb/i.test(name)) {
|
|
463
|
-
console.info(name, node.kind, ts.SyntaxKind[node.kind] );
|
|
464
|
-
}
|
|
465
|
-
}
|
|
466
|
-
*/
|
|
467
|
-
|
|
468
|
-
/*
|
|
469
|
-
if ((node as any).name && ts.isIdentifier((node as any).name)) {
|
|
470
|
-
const name = (node as any).name.escapedText.toString();
|
|
471
|
-
if (/trebglobal$/i.test(name)) {
|
|
472
|
-
console.info({name, exported, internal, modifiers});
|
|
473
|
-
console.info(node);
|
|
474
|
-
console.info('');
|
|
475
|
-
}
|
|
476
|
-
}
|
|
477
|
-
*/
|
|
478
|
-
|
|
479
|
-
/*
|
|
480
|
-
if (exported && declared) {
|
|
481
|
-
if ((node as any).name && ts.isIdentifier((node as any).name)) {
|
|
482
|
-
const name = (node as any).name.escapedText.toString();
|
|
483
|
-
//if (/treb$/i.test(name)) {
|
|
484
|
-
console.info({name, exported, internal, modifiers});
|
|
485
|
-
// console.info(node);
|
|
486
|
-
// console.info('');
|
|
487
|
-
//}
|
|
488
|
-
}
|
|
489
|
-
|
|
490
|
-
}
|
|
491
|
-
*/
|
|
492
|
-
|
|
493
459
|
if (ts.isModuleDeclaration(node)
|
|
494
460
|
|| ts.isClassDeclaration(node)
|
|
495
461
|
|| ts.isInterfaceDeclaration(node)
|
|
@@ -709,9 +675,12 @@ function CollectDependencyTransformer<T extends ts.Node>(
|
|
|
709
675
|
|
|
710
676
|
}
|
|
711
677
|
|
|
712
|
-
return ts.visitEachChild(node,
|
|
713
|
-
}
|
|
714
|
-
|
|
678
|
+
return ts.visitEachChild(node, visit, context);
|
|
679
|
+
};
|
|
680
|
+
|
|
681
|
+
return node => ts.visitEachChild(node, visit, context);
|
|
682
|
+
|
|
683
|
+
|
|
715
684
|
}
|
|
716
685
|
}
|
|
717
686
|
|
|
@@ -750,6 +719,7 @@ const ReadTypes = async (file: string, types?: string[], origination = 'C', dept
|
|
|
750
719
|
for (let i = 0; i < depth; i++) { depth_prefix += ' '; }
|
|
751
720
|
|
|
752
721
|
const RelativeFilePath = (key: string): string => {
|
|
722
|
+
|
|
753
723
|
for (const prefix of Object.keys(config.map)) {
|
|
754
724
|
if (key.startsWith(prefix)) { // should === ?
|
|
755
725
|
const replaced = key.replace(prefix, config.map[prefix]);
|