@trebco/treb 25.0.0-rc2 → 25.0.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/build/treb-spreadsheet.mjs +9 -9
- package/build/treb.d.ts +3 -11
- package/esbuild-custom-element.mjs +9 -3
- package/package.json +2 -1
- package/treb-base-types/src/area.ts +12 -8
- package/treb-base-types/src/theme.ts +11 -1
- package/treb-embed/markup/layout.html +3 -1
- package/treb-embed/markup/toolbar.html +10 -10
- package/treb-embed/src/custom-element/spreadsheet-constructor.ts +67 -10
- package/treb-embed/src/embedded-spreadsheet.ts +30 -34
- package/treb-embed/src/options.ts +2 -10
- package/treb-embed/style/autocomplete.scss +1 -1
- package/treb-embed/style/dialog.scss +4 -4
- package/treb-embed/style/dropdown-select.scss +1 -1
- package/treb-embed/style/formula-bar.scss +1 -1
- package/treb-embed/style/grid.scss +1 -1
- package/treb-embed/style/layout.scss +34 -63
- package/treb-embed/style/mouse-mask.scss +1 -1
- package/treb-embed/style/note.scss +1 -1
- package/treb-embed/style/overlay-editor.scss +1 -1
- package/treb-embed/style/spinner.scss +1 -1
- package/treb-embed/style/tab-bar.scss +1 -1
- package/treb-embed/style/table.scss +1 -1
- package/treb-embed/style/theme-defaults.scss +124 -82
- package/treb-embed/style/toolbar.scss +26 -25
- package/treb-embed/style/tooltip.scss +1 -1
- package/treb-grid/src/types/grid.ts +2 -25
|
@@ -15,11 +15,10 @@ $menu-item-hover-color: var(--treb-toolbar-hover-button-background, #f3f4f6);
|
|
|
15
15
|
$box-shadow: 0 4px 6px -4px rgba(0, 0, 0, .4);
|
|
16
16
|
$border-radius: 3px;
|
|
17
17
|
|
|
18
|
-
$font-size: 14px;
|
|
19
18
|
$split-font-size: 10px;
|
|
20
19
|
$swatch-size: 18px;
|
|
21
20
|
|
|
22
|
-
.treb-
|
|
21
|
+
.treb-main {
|
|
23
22
|
|
|
24
23
|
.treb-layout-header {
|
|
25
24
|
|
|
@@ -41,13 +40,13 @@ $swatch-size: 18px;
|
|
|
41
40
|
.treb-toolbar {
|
|
42
41
|
|
|
43
42
|
color: var(--treb-toolbar-color, var(--treb-ui-color, #333));
|
|
44
|
-
font-size:
|
|
43
|
+
font-size: var(--treb-toolbar-font-size, inherit);
|
|
45
44
|
|
|
46
45
|
// ----
|
|
47
46
|
|
|
48
47
|
display: flex;
|
|
49
48
|
flex-direction: row;
|
|
50
|
-
gap: .
|
|
49
|
+
gap: .5rem;
|
|
51
50
|
|
|
52
51
|
& > div {
|
|
53
52
|
display: flex;
|
|
@@ -105,11 +104,9 @@ $swatch-size: 18px;
|
|
|
105
104
|
justify-content: center;
|
|
106
105
|
position: relative;
|
|
107
106
|
|
|
108
|
-
//
|
|
109
|
-
// to separate items in sequence and we get kind of a wave
|
|
110
|
-
// or cascade effect. is it possible to synchronize them?
|
|
107
|
+
// removing this transition because it lags when toggling light/dark mode
|
|
111
108
|
|
|
112
|
-
transition: background-color .1s ease;
|
|
109
|
+
// transition: background-color .1s ease;
|
|
113
110
|
// border-radius: $border-radius;
|
|
114
111
|
|
|
115
112
|
&[dropdown] {
|
|
@@ -122,7 +119,7 @@ $swatch-size: 18px;
|
|
|
122
119
|
height: 0px;
|
|
123
120
|
border: 5px solid transparent;
|
|
124
121
|
border-top-color: currentColor;
|
|
125
|
-
top: 18px; // FIXME: specify in ems
|
|
122
|
+
top: 18px; // FIXME: specify in ems // NO
|
|
126
123
|
left: 50%;
|
|
127
124
|
transform: translate(-50%, -50%);
|
|
128
125
|
}
|
|
@@ -198,13 +195,21 @@ $swatch-size: 18px;
|
|
|
198
195
|
|
|
199
196
|
.treb-menu {
|
|
200
197
|
|
|
201
|
-
|
|
198
|
+
// on Safari, we need to make these menus focus targets, so we can
|
|
199
|
+
// use :focus-within. they will get a tabIndex. we will preferentially
|
|
200
|
+
// focus on buttons within the menus, but there will be flashes where
|
|
201
|
+
// focus is visible on the menu itself, so to reduce jitter we remove
|
|
202
|
+
// the outline.
|
|
203
|
+
|
|
204
|
+
outline: none;
|
|
205
|
+
|
|
206
|
+
// ---
|
|
202
207
|
|
|
203
208
|
& > div {
|
|
204
209
|
|
|
205
210
|
display: none;
|
|
206
211
|
|
|
207
|
-
margin-top: .
|
|
212
|
+
margin-top: .5rem;
|
|
208
213
|
|
|
209
214
|
flex-direction: column;
|
|
210
215
|
background: $menu-background;
|
|
@@ -220,7 +225,7 @@ $swatch-size: 18px;
|
|
|
220
225
|
background: transparent;
|
|
221
226
|
border: 0;
|
|
222
227
|
text-align: left;
|
|
223
|
-
padding: .
|
|
228
|
+
padding: .4rem 1rem;
|
|
224
229
|
margin: 3px 0;
|
|
225
230
|
transition: background-color .125s ease;
|
|
226
231
|
|
|
@@ -234,10 +239,6 @@ $swatch-size: 18px;
|
|
|
234
239
|
& > button, & > .treb-menu > button {
|
|
235
240
|
padding: 0;
|
|
236
241
|
}
|
|
237
|
-
/*
|
|
238
|
-
padding-left: .5em;
|
|
239
|
-
padding-right: .5em;
|
|
240
|
-
*/
|
|
241
242
|
}
|
|
242
243
|
|
|
243
244
|
& > [separator] {
|
|
@@ -320,7 +321,7 @@ $swatch-size: 18px;
|
|
|
320
321
|
}
|
|
321
322
|
|
|
322
323
|
& > div {
|
|
323
|
-
padding: .
|
|
324
|
+
padding: .75rem .75rem;
|
|
324
325
|
}
|
|
325
326
|
|
|
326
327
|
& > div + div {
|
|
@@ -331,12 +332,12 @@ $swatch-size: 18px;
|
|
|
331
332
|
|
|
332
333
|
display: flex;
|
|
333
334
|
flex-direction: row;
|
|
334
|
-
gap: .
|
|
335
|
+
gap: .5rem;
|
|
335
336
|
align-items: center;
|
|
336
337
|
|
|
337
338
|
input {
|
|
338
339
|
flex-grow: 1;
|
|
339
|
-
padding: 0 .
|
|
340
|
+
padding: 0 .5rem;
|
|
340
341
|
}
|
|
341
342
|
|
|
342
343
|
input, button {
|
|
@@ -351,7 +352,7 @@ $swatch-size: 18px;
|
|
|
351
352
|
|
|
352
353
|
display: grid;
|
|
353
354
|
grid-template-columns: repeat(10, 1fr);
|
|
354
|
-
gap: .
|
|
355
|
+
gap: .5rem;
|
|
355
356
|
|
|
356
357
|
button {
|
|
357
358
|
width: $swatch-size;
|
|
@@ -387,10 +388,10 @@ $swatch-size: 18px;
|
|
|
387
388
|
font: inherit;
|
|
388
389
|
resize: both;
|
|
389
390
|
border: 1px solid $border-color;
|
|
390
|
-
padding: .
|
|
391
|
+
padding: .25rem;
|
|
391
392
|
line-height: 1.5;
|
|
392
|
-
margin: .
|
|
393
|
-
height:
|
|
393
|
+
margin: .5rem;
|
|
394
|
+
height: 10rem;
|
|
394
395
|
}
|
|
395
396
|
|
|
396
397
|
textarea + div {
|
|
@@ -398,8 +399,8 @@ $swatch-size: 18px;
|
|
|
398
399
|
flex-direction: row;
|
|
399
400
|
align-items: center;
|
|
400
401
|
justify-content: center;
|
|
401
|
-
gap: .
|
|
402
|
-
padding: 0 0 .
|
|
402
|
+
gap: .5rem;
|
|
403
|
+
padding: 0 0 .5rem 0;
|
|
403
404
|
|
|
404
405
|
button {
|
|
405
406
|
border: 1px solid $border-color;
|
|
@@ -1609,31 +1609,8 @@ export class Grid extends GridBase {
|
|
|
1609
1609
|
|
|
1610
1610
|
// going to rename to clarify.
|
|
1611
1611
|
|
|
1612
|
-
|
|
1613
1612
|
this.view_node = view_node;
|
|
1614
1613
|
|
|
1615
|
-
// so here we want the class list to read
|
|
1616
|
-
//
|
|
1617
|
-
// ... treb-main [treb-ua-windows] treb-theme ...
|
|
1618
|
-
//
|
|
1619
|
-
// our internal styles will be scoped to `.treb-main` and optionally
|
|
1620
|
-
// `.treb-main.treb-ua-windows`; then you should be able to override
|
|
1621
|
-
// using `.treb-main.treb-theme`. we have some extra classes we still
|
|
1622
|
-
// need to clean up, though.
|
|
1623
|
-
|
|
1624
|
-
// grid_container.classList.add('treb-main');
|
|
1625
|
-
|
|
1626
|
-
/* MOVE
|
|
1627
|
-
|
|
1628
|
-
if (UA.is_windows) {
|
|
1629
|
-
grid_container.classList.add('treb-ua-windows');
|
|
1630
|
-
}
|
|
1631
|
-
else if (UA.is_mac) {
|
|
1632
|
-
grid_container.classList.add('treb-ua-osx');
|
|
1633
|
-
}
|
|
1634
|
-
|
|
1635
|
-
*/
|
|
1636
|
-
|
|
1637
1614
|
// MOVE
|
|
1638
1615
|
|
|
1639
1616
|
// this.ApplyTheme();
|
|
@@ -6696,15 +6673,15 @@ export class Grid extends GridBase {
|
|
|
6696
6673
|
if (this.tab_bar) {
|
|
6697
6674
|
let data: StatsEntry[] = [];
|
|
6698
6675
|
|
|
6676
|
+
// why does this get tested on every call? just set the function
|
|
6677
|
+
|
|
6699
6678
|
if (typeof this.options.stats === 'function') {
|
|
6700
6679
|
if (!this.primary_selection.empty) {
|
|
6701
|
-
// text = this.options.stats.call(undefined, this.GetRange(this.primary_selection.area));
|
|
6702
6680
|
data = this.options.stats.call(undefined, this.GetRange(this.primary_selection.area));
|
|
6703
6681
|
}
|
|
6704
6682
|
}
|
|
6705
6683
|
else {
|
|
6706
6684
|
if (!this.primary_selection.empty && this.primary_selection.area.count > 1) {
|
|
6707
|
-
// text = this.RenderStats(this.GetRange(this.primary_selection.area));
|
|
6708
6685
|
data = this.RenderStats(this.GetRange(this.primary_selection.area));
|
|
6709
6686
|
}
|
|
6710
6687
|
}
|