@trebco/treb 25.6.1 → 25.6.3
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.mjs +6 -6
- package/dist/treb.d.ts +11 -4
- package/package.json +1 -1
- package/treb-embed/src/embedded-spreadsheet.ts +17 -6
- package/treb-embed/style/dark-theme.scss +67 -76
- package/treb-embed/style/layout.scss +6 -0
- package/treb-embed/style/tab-bar.scss +4 -0
- package/treb-grid/src/layout/base_layout.ts +4 -1
- package/treb-grid/src/types/tab_bar.ts +22 -0
package/dist/treb.d.ts
CHANGED
|
@@ -603,14 +603,21 @@ export declare class EmbeddedSpreadsheet {
|
|
|
603
603
|
ExportDelimited(options?: ExportOptions): string;
|
|
604
604
|
|
|
605
605
|
/**
|
|
606
|
-
*
|
|
606
|
+
* @deprecated - use SaveToDesktop
|
|
607
607
|
*
|
|
608
|
-
* @param filename
|
|
609
|
-
*
|
|
610
|
-
* @public
|
|
608
|
+
* @param filename
|
|
609
|
+
* @param additional_options
|
|
611
610
|
*/
|
|
612
611
|
SaveLocalFile(filename?: string, additional_options?: SaveOptions): void;
|
|
613
612
|
|
|
613
|
+
/**
|
|
614
|
+
* Save the current document to a desktop file. This is the new version
|
|
615
|
+
* of the method, renamed from SaveLocalFile.
|
|
616
|
+
*
|
|
617
|
+
* @param filename Filename or extension to use the document name.
|
|
618
|
+
*/
|
|
619
|
+
SaveToDesktop(filename?: string, additional_options?: SaveOptions): void;
|
|
620
|
+
|
|
614
621
|
/**
|
|
615
622
|
* Load CSV from string. This is used internally when loading network
|
|
616
623
|
* documents and local files, but you can call it directly if you have
|
package/package.json
CHANGED
|
@@ -1513,11 +1513,11 @@ export class EmbeddedSpreadsheet {
|
|
|
1513
1513
|
break;
|
|
1514
1514
|
|
|
1515
1515
|
case 'save-json':
|
|
1516
|
-
this.
|
|
1516
|
+
this.SaveToDesktop();
|
|
1517
1517
|
break;
|
|
1518
1518
|
|
|
1519
1519
|
case 'save-csv': // FIXME: should be export
|
|
1520
|
-
this.
|
|
1520
|
+
this.SaveToDesktop(SaveFileType.csv);
|
|
1521
1521
|
break;
|
|
1522
1522
|
|
|
1523
1523
|
case 'export-xlsx':
|
|
@@ -2723,14 +2723,25 @@ export class EmbeddedSpreadsheet {
|
|
|
2723
2723
|
|
|
2724
2724
|
}
|
|
2725
2725
|
|
|
2726
|
+
/**
|
|
2727
|
+
* @deprecated - use SaveToDesktop
|
|
2728
|
+
*
|
|
2729
|
+
* @param filename
|
|
2730
|
+
* @param additional_options
|
|
2731
|
+
*/
|
|
2732
|
+
public SaveLocalFile(
|
|
2733
|
+
filename: string = SaveFileType.trebjson,
|
|
2734
|
+
additional_options: SaveOptions = {}): void {
|
|
2735
|
+
this.SaveToDesktop(filename, additional_options);
|
|
2736
|
+
}
|
|
2737
|
+
|
|
2726
2738
|
/**
|
|
2727
|
-
* Save the current document to a desktop file.
|
|
2739
|
+
* Save the current document to a desktop file. This is the new version
|
|
2740
|
+
* of the method, renamed from SaveLocalFile.
|
|
2728
2741
|
*
|
|
2729
2742
|
* @param filename Filename or extension to use the document name.
|
|
2730
|
-
*
|
|
2731
|
-
* @public
|
|
2732
2743
|
*/
|
|
2733
|
-
public
|
|
2744
|
+
public SaveToDesktop(
|
|
2734
2745
|
filename: string = SaveFileType.trebjson,
|
|
2735
2746
|
additional_options: SaveOptions = {}): void {
|
|
2736
2747
|
|
|
@@ -24,83 +24,74 @@
|
|
|
24
24
|
*/
|
|
25
25
|
|
|
26
26
|
@mixin dark {
|
|
27
|
-
|
|
28
27
|
--treb-autocomplete-background: #333;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
28
|
+
--treb-autocomplete-border-color: #fff;
|
|
29
|
+
--treb-autocomplete-entry-color: #fff;
|
|
30
|
+
--treb-autocomplete-selected-entry-background: darkred;
|
|
31
|
+
--treb-autocomplete-tooltip-background: darkred;
|
|
32
|
+
--treb-autocomplete-tooltip-border-color: #fff;
|
|
33
|
+
--treb-autocomplete-tooltip-color: #fff;
|
|
34
|
+
--treb-chart-background: #000;
|
|
35
|
+
--treb-chart-grid-color: #976;
|
|
36
|
+
--treb-chart-text-color: #fff;
|
|
37
|
+
--treb-dialog-background: #000;
|
|
38
|
+
--treb-dialog-border-color: #fff;
|
|
39
|
+
--treb-dialog-color: #fff;
|
|
40
|
+
--treb-dropdown-background: #000;
|
|
41
|
+
--treb-dropdown-border-color: #fff;
|
|
42
|
+
--treb-dropdown-caret-active-background: darkred;
|
|
43
|
+
--treb-dropdown-caret-background: #444;
|
|
44
|
+
--treb-dropdown-caret-border-color: #fff;
|
|
45
|
+
--treb-dropdown-caret-color: #fff;
|
|
46
|
+
--treb-dropdown-color: #fff;
|
|
47
|
+
--treb-dropdown-selected-background: darkred;
|
|
48
|
+
--treb-grid-background: #000;
|
|
49
|
+
--treb-grid-default-color: #fff;
|
|
50
|
+
--treb-grid-grid-color: #444;
|
|
51
|
+
--treb-grid-header-background: #444;
|
|
52
|
+
--treb-grid-header-grid-color: #000;
|
|
53
|
+
--treb-note-background: #333;
|
|
54
|
+
--treb-note-border-color: #fff;
|
|
55
|
+
--treb-note-color: #fff;
|
|
56
|
+
--treb-note-marker-color: pink;
|
|
57
|
+
--treb-resize-tooltip-background: #fff;
|
|
58
|
+
--treb-resize-tooltip-color: #000;
|
|
59
|
+
--treb-scale-slider-accent-color: #fff;
|
|
60
|
+
--treb-scale-slider-background: #333;
|
|
61
|
+
--treb-scale-slider-border-color: #fff;
|
|
62
|
+
--treb-selection-color: yellow;
|
|
63
|
+
--treb-selection-fill-opacity: .2;
|
|
64
|
+
--treb-sidebar-button-background: #000;
|
|
65
|
+
--treb-sidebar-button-border-color: #888;
|
|
66
|
+
--treb-stats-value-background: #223;
|
|
67
|
+
--treb-tab-bar-active-tab-background: #444;
|
|
68
|
+
--treb-tab-bar-tab-background: #000;
|
|
69
|
+
--treb-tab-bar-tab-color: #fff;
|
|
71
70
|
--treb-theme-color-1: #222;
|
|
72
71
|
--treb-theme-color-2: #ddd;
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
// ---
|
|
98
|
-
|
|
99
|
-
--treb-color-scheme: dark;
|
|
100
|
-
--treb-resize-handle-color: lightblue;
|
|
101
|
-
--treb-resize-frame-color: lightblue;
|
|
102
|
-
--treb-formula-bar-locked-background: #234;
|
|
103
|
-
|
|
72
|
+
--treb-toolbar-active-button-background: #555;
|
|
73
|
+
--treb-toolbar-button-background: #000;
|
|
74
|
+
--treb-toolbar-hover-button-background: #444;
|
|
75
|
+
--treb-ui-border-color: #666;
|
|
76
|
+
--treb-ui-color: #fff;
|
|
77
|
+
--treb-table-header-background: #334; // DarkSlateGray;
|
|
78
|
+
--treb-table-odd-background: #122;
|
|
79
|
+
--treb-table-header-font-weight: 700;
|
|
80
|
+
--treb-table-header-border-top: #889;
|
|
81
|
+
--treb-table-header-border-bottom: #889;
|
|
82
|
+
--treb-table-footer-border-bottom: #889;
|
|
83
|
+
--treb-table-odd-border-top: #889;
|
|
84
|
+
--treb-table-odd-border-bottom: #889;
|
|
85
|
+
--treb-table-even-border-top: #889;
|
|
86
|
+
--treb-table-even-border-bottom: #889;
|
|
87
|
+
--treb-table-total-border-top: #889;
|
|
88
|
+
--treb-table-total-border-bottom: #889;
|
|
89
|
+
--treb-table-total-background: #334;
|
|
90
|
+
--treb-table-total-font-weight: 700;
|
|
91
|
+
--treb-color-scheme: dark;
|
|
92
|
+
--treb-resize-handle-color: lightblue;
|
|
93
|
+
--treb-resize-frame-color: lightblue;
|
|
94
|
+
--treb-formula-bar-locked-background: #234;
|
|
104
95
|
}
|
|
105
96
|
|
|
106
97
|
.treb-dark-theme {
|
|
@@ -108,7 +99,7 @@
|
|
|
108
99
|
}
|
|
109
100
|
|
|
110
101
|
@media (prefers-color-scheme: dark) {
|
|
111
|
-
.treb-light-dark-theme {
|
|
102
|
+
.treb-light-dark-theme {
|
|
112
103
|
@include dark;
|
|
113
104
|
}
|
|
114
|
-
}
|
|
105
|
+
}
|
|
@@ -47,6 +47,12 @@
|
|
|
47
47
|
all: revert;
|
|
48
48
|
box-sizing: border-box;
|
|
49
49
|
|
|
50
|
+
// text-align does not revert? it should be covered by all...
|
|
51
|
+
// or is the problem that there's no initial value? (although
|
|
52
|
+
// unset does not work either)
|
|
53
|
+
|
|
54
|
+
text-align: start;
|
|
55
|
+
|
|
50
56
|
div, button, input, ul, ol, li, a, textarea {
|
|
51
57
|
|
|
52
58
|
// maybe this is being too aggressive. we could be a little
|
|
@@ -1069,8 +1069,11 @@ export abstract class BaseLayout {
|
|
|
1069
1069
|
// focus_callback: () => void,
|
|
1070
1070
|
scroll = true): void {
|
|
1071
1071
|
|
|
1072
|
+
// this is getting stuck under the toolbar... we need better z-stacking
|
|
1073
|
+
// and this needs to be higher up in the node list
|
|
1074
|
+
|
|
1072
1075
|
if (!this.mask.parentElement) {
|
|
1073
|
-
container.appendChild(this.mask);
|
|
1076
|
+
container.parentElement?.parentElement?.appendChild(this.mask);
|
|
1074
1077
|
}
|
|
1075
1078
|
|
|
1076
1079
|
//if (!this.error_highlight.parentElement) {
|
|
@@ -326,9 +326,27 @@ export class TabBar extends EventSource<TabEvent> {
|
|
|
326
326
|
|
|
327
327
|
this.dragging = true;
|
|
328
328
|
|
|
329
|
+
// ghost is a good idea but we need to delay it, because
|
|
330
|
+
// it starts to flicker if you just click a tab to select
|
|
331
|
+
// it (or double click to rename)
|
|
332
|
+
|
|
333
|
+
/*
|
|
334
|
+
const ghost = document.createElement('div');
|
|
335
|
+
ghost.classList.add('ghost-tab');
|
|
336
|
+
ghost.appendChild(tab.cloneNode(true));
|
|
337
|
+
ghost.style.top = '-1000px';
|
|
338
|
+
this.layout.mask.appendChild(ghost);
|
|
339
|
+
*/
|
|
340
|
+
|
|
329
341
|
MouseDrag(this.layout.mask, [], (move_event) => {
|
|
330
342
|
|
|
331
343
|
const [x, y] = [move_event.clientX, move_event.clientY];
|
|
344
|
+
|
|
345
|
+
/*
|
|
346
|
+
ghost.style.top = `${y}px`;
|
|
347
|
+
ghost.style.left = `${x}px`;
|
|
348
|
+
*/
|
|
349
|
+
|
|
332
350
|
if (y > top && y < bottom) {
|
|
333
351
|
let new_order = order;
|
|
334
352
|
if (x < left) { new_order = min; }
|
|
@@ -360,6 +378,10 @@ export class TabBar extends EventSource<TabEvent> {
|
|
|
360
378
|
let current = index;
|
|
361
379
|
let move_before = (order + 1) / 2;
|
|
362
380
|
|
|
381
|
+
/*
|
|
382
|
+
this.layout.mask.removeChild(ghost);
|
|
383
|
+
*/
|
|
384
|
+
|
|
363
385
|
// console.info('set false')
|
|
364
386
|
this.dragging = false;
|
|
365
387
|
|