wunderbaum 0.0.4 → 0.0.5
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/README.md +2 -0
- package/dist/wunderbaum.css +1 -1
- package/dist/wunderbaum.d.ts +141 -45
- package/dist/wunderbaum.esm.js +439 -184
- package/dist/wunderbaum.esm.min.js +25 -24
- package/dist/wunderbaum.esm.min.js.map +1 -1
- package/dist/wunderbaum.umd.js +439 -184
- package/dist/wunderbaum.umd.min.js +30 -29
- package/dist/wunderbaum.umd.min.js.map +1 -1
- package/package.json +2 -2
- package/src/common.ts +35 -27
- package/src/util.ts +11 -9
- package/src/wb_ext_dnd.ts +10 -9
- package/src/wb_ext_edit.ts +9 -10
- package/src/wb_ext_filter.ts +14 -2
- package/src/wb_ext_keynav.ts +80 -13
- package/src/wb_node.ts +53 -35
- package/src/wb_options.ts +59 -5
- package/src/wunderbaum.scss +91 -23
- package/src/wunderbaum.ts +276 -100
package/src/wunderbaum.scss
CHANGED
|
@@ -12,8 +12,8 @@ $node-text-color: #56534c;
|
|
|
12
12
|
$bg-highlight-color: #26a0da;
|
|
13
13
|
$header-color: #dedede;
|
|
14
14
|
$background-color: white;
|
|
15
|
-
$alternate-row-color: #fcfcfc;
|
|
16
|
-
$alternate-row-color-
|
|
15
|
+
$alternate-row-color: #f7f7f7; // #fcfcfc;
|
|
16
|
+
$alternate-row-color-hover: #f3f3f3; //#f7fcfe;
|
|
17
17
|
$focus-border-color: #275dc5;
|
|
18
18
|
|
|
19
19
|
// derived
|
|
@@ -72,23 +72,61 @@ div.wunderbaum {
|
|
|
72
72
|
border: 2px solid $border-color;
|
|
73
73
|
border-radius: 4px;
|
|
74
74
|
background-clip: content-box; // Keep color outside rounded borders?
|
|
75
|
-
overflow: hidden; // avoid unwanted effects when auto-resizing
|
|
75
|
+
// overflow: hidden; // avoid unwanted effects when auto-resizing
|
|
76
|
+
overflow-x: auto;
|
|
77
|
+
overflow-y: scroll;
|
|
76
78
|
|
|
77
79
|
// Focus border is generated by the browsers per default:
|
|
78
80
|
&:focus,
|
|
79
81
|
&:focus-within {
|
|
80
82
|
border-color: $focus-border-color;
|
|
81
|
-
//
|
|
83
|
+
// outline-style: none;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
&.wb-disabled {
|
|
87
|
+
opacity: 0.7;
|
|
88
|
+
pointer-events: none;
|
|
82
89
|
}
|
|
83
90
|
|
|
84
91
|
div.wb-scroll-container {
|
|
85
92
|
position: relative;
|
|
86
|
-
overflow: auto;
|
|
93
|
+
// overflow: auto;
|
|
87
94
|
// scroll-behavior: smooth;
|
|
88
95
|
min-height: 4px;
|
|
89
96
|
// height: calc(100% - #{$header-height}); // didn't work. Using JS instead
|
|
90
97
|
}
|
|
91
98
|
|
|
99
|
+
/* --- FIXED-COLUMN --- */
|
|
100
|
+
|
|
101
|
+
div.wb-header {
|
|
102
|
+
position: sticky;
|
|
103
|
+
top: 0;
|
|
104
|
+
z-index: 2;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
div.wb-header,
|
|
108
|
+
div.wb-scroll-container {
|
|
109
|
+
overflow: unset;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// }
|
|
113
|
+
|
|
114
|
+
/* Fixed column must be opaque, i.e. have the bg color set.*/
|
|
115
|
+
&.wb-fixed-col {
|
|
116
|
+
div.wb-header {
|
|
117
|
+
span.wb-col:first-of-type {
|
|
118
|
+
background-color: $header-color;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
span.wb-col:first-of-type {
|
|
123
|
+
position: sticky;
|
|
124
|
+
left: 0;
|
|
125
|
+
z-index: 1;
|
|
126
|
+
background-color: $background-color;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
92
130
|
// --- Header and node list ---
|
|
93
131
|
div.wb-row {
|
|
94
132
|
position: absolute;
|
|
@@ -100,7 +138,7 @@ div.wunderbaum {
|
|
|
100
138
|
|
|
101
139
|
// --- Node List Only ---
|
|
102
140
|
|
|
103
|
-
//
|
|
141
|
+
// Dim some colors if tree has no focus
|
|
104
142
|
&:not(:focus-within),
|
|
105
143
|
&:not(:focus) {
|
|
106
144
|
div.wb-node-list div.wb-row {
|
|
@@ -115,6 +153,15 @@ div.wunderbaum {
|
|
|
115
153
|
}
|
|
116
154
|
}
|
|
117
155
|
}
|
|
156
|
+
&.wb-alternate div.wb-node-list {
|
|
157
|
+
div.wb-row:nth-of-type(even):not(.wb-active):not(.wb-selected) {
|
|
158
|
+
background-color: $alternate-row-color;
|
|
159
|
+
|
|
160
|
+
&:hover {
|
|
161
|
+
background-color: $alternate-row-color-hover;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
118
165
|
|
|
119
166
|
div.wb-node-list {
|
|
120
167
|
div.wb-row {
|
|
@@ -153,17 +200,33 @@ div.wunderbaum {
|
|
|
153
200
|
font-style: italic;
|
|
154
201
|
}
|
|
155
202
|
|
|
156
|
-
&.wb-
|
|
157
|
-
.wb-
|
|
203
|
+
&.wb-busy,
|
|
204
|
+
i.wb-busy,
|
|
205
|
+
.wb-col.wb-busy {
|
|
158
206
|
font-style: italic;
|
|
207
|
+
|
|
208
|
+
// For our stripe pattern, we want a frictionless transition at
|
|
209
|
+
// the bottom, when repeating in y-direction:
|
|
210
|
+
// h: height of row = 22px
|
|
211
|
+
// d: spacing between stripe pairs (white + gray)
|
|
212
|
+
// Calculate the spacing that will lead to a minimal quadratic
|
|
213
|
+
// pattern with a height of h pixels:
|
|
214
|
+
//
|
|
215
|
+
// (2 * d)^2 = 2 * h^2
|
|
216
|
+
// => d = sqrt(2 * h^2) / 2
|
|
217
|
+
// = 15.56px
|
|
218
|
+
// We use the half distance to get a finer stripe pattern:
|
|
219
|
+
// d/2 = 7.78
|
|
159
220
|
background: repeating-linear-gradient(
|
|
160
221
|
45deg,
|
|
161
|
-
$hover-color,
|
|
162
|
-
$hover-color
|
|
163
|
-
|
|
164
|
-
|
|
222
|
+
// $hover-color,
|
|
223
|
+
// $hover-color 3.88px,
|
|
224
|
+
transparent,
|
|
225
|
+
transparent 3.88px,
|
|
226
|
+
$grid-color 3.88px,
|
|
227
|
+
$grid-color 7.78px
|
|
165
228
|
);
|
|
166
|
-
animation: wb-
|
|
229
|
+
animation: wb-busy-animation 2s linear infinite;
|
|
167
230
|
}
|
|
168
231
|
|
|
169
232
|
&.wb-error,
|
|
@@ -176,7 +239,7 @@ div.wunderbaum {
|
|
|
176
239
|
// --- HEADER ---
|
|
177
240
|
|
|
178
241
|
div.wb-header {
|
|
179
|
-
position:
|
|
242
|
+
position: sticky;
|
|
180
243
|
height: $header-height;
|
|
181
244
|
border-bottom: 1px solid $border-color;
|
|
182
245
|
padding: 0;
|
|
@@ -271,7 +334,7 @@ div.wunderbaum {
|
|
|
271
334
|
|
|
272
335
|
span.wb-title {
|
|
273
336
|
min-width: 1em;
|
|
274
|
-
display: inline-block; // fix vertical offset on Chrome?
|
|
337
|
+
// display: inline-block; // fix vertical offset on Chrome?
|
|
275
338
|
vertical-align: top;
|
|
276
339
|
overflow-x: hidden;
|
|
277
340
|
white-space: nowrap;
|
|
@@ -328,6 +391,7 @@ div.wunderbaum {
|
|
|
328
391
|
> input[type="week"],
|
|
329
392
|
> select {
|
|
330
393
|
width: 100%;
|
|
394
|
+
max-height: $row-inner-height;
|
|
331
395
|
}
|
|
332
396
|
}
|
|
333
397
|
}
|
|
@@ -359,12 +423,12 @@ div.wunderbaum {
|
|
|
359
423
|
background-color: $alternate-row-color;
|
|
360
424
|
|
|
361
425
|
&:hover {
|
|
362
|
-
background-color: $alternate-row-color-
|
|
426
|
+
background-color: $alternate-row-color-hover;
|
|
363
427
|
}
|
|
364
428
|
}
|
|
365
429
|
}
|
|
366
430
|
|
|
367
|
-
//
|
|
431
|
+
// Dim some colors if tree has no focus
|
|
368
432
|
&:not(:focus-within),
|
|
369
433
|
&:not(:focus) {
|
|
370
434
|
div.wb-node-list div.wb-row {
|
|
@@ -529,20 +593,24 @@ div.wunderbaum {
|
|
|
529
593
|
// }
|
|
530
594
|
|
|
531
595
|
/* RTL support */
|
|
532
|
-
.wb-helper-start
|
|
596
|
+
.wb-helper-start,
|
|
597
|
+
.wb-helper-start > input {
|
|
533
598
|
text-align: left;
|
|
534
599
|
}
|
|
535
600
|
|
|
536
|
-
.wb-helper-end
|
|
601
|
+
.wb-helper-end,
|
|
602
|
+
.wb-helper-end > input {
|
|
537
603
|
text-align: right;
|
|
538
604
|
}
|
|
539
605
|
|
|
540
606
|
.wb-rtl {
|
|
541
|
-
.wb-helper-start
|
|
607
|
+
.wb-helper-start,
|
|
608
|
+
.wb-helper-start > input {
|
|
542
609
|
text-align: right;
|
|
543
610
|
}
|
|
544
611
|
|
|
545
|
-
.wb-helper-end
|
|
612
|
+
.wb-helper-end,
|
|
613
|
+
.wb-helper-end > input {
|
|
546
614
|
text-align: left;
|
|
547
615
|
}
|
|
548
616
|
}
|
|
@@ -584,12 +652,12 @@ div.wunderbaum {
|
|
|
584
652
|
}
|
|
585
653
|
}
|
|
586
654
|
|
|
587
|
-
@keyframes wb-
|
|
655
|
+
@keyframes wb-busy-animation {
|
|
588
656
|
0% {
|
|
589
657
|
background-position: 0 0;
|
|
590
658
|
}
|
|
591
659
|
|
|
592
660
|
100% {
|
|
593
|
-
background-position: -
|
|
661
|
+
background-position: 0 $row-outer-height;
|
|
594
662
|
}
|
|
595
663
|
}
|