wunderbaum 0.0.2 → 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.
@@ -11,8 +11,11 @@ $error-color: #b5373b;
11
11
  $node-text-color: #56534c;
12
12
  $bg-highlight-color: #26a0da;
13
13
  $header-color: #dedede;
14
- $alternate-row-color: #fcfcfc;
15
- $alternate-row-color-even: #f7fcfe;
14
+ $background-color: white;
15
+ $alternate-row-color: #f7f7f7; // #fcfcfc;
16
+ $alternate-row-color-hover: #f3f3f3; //#f7fcfe;
17
+ $focus-border-color: #275dc5;
18
+
16
19
  // derived
17
20
  $border-color: $node-text-color;
18
21
  $drop-source-color: adjust-color($node-text-color, $lightness: 50%);
@@ -22,14 +25,12 @@ $error-background-color: adjust-color($error-color, $lightness: 45%);
22
25
  // @debug $dim-color;
23
26
  $hover-color: adjust-color($bg-highlight-color, $lightness: 48%); // #f7f7f7;
24
27
  $hover-border-color: $hover-color;
25
- $focus-border-color: #969da3;
26
28
  $grid-color: #dedede;
27
29
  $active-color: #e5f3fb;
28
30
  $active-cell-color: $bg-highlight-color;
29
31
  $active-border-color: #70c0e7;
30
32
  $active-hover-color: #dceff8;
31
33
  $active-hover-border-color: $bg-highlight-color;
32
- $background-color: #fcfcfc;
33
34
  $active-column-color: $hover-color;
34
35
  $active-header-column-color: adjust-color($header-color, $lightness: -10%);
35
36
  // @debug $active-header-column-color;
@@ -60,6 +61,7 @@ $level-rainbow: rgba(255, 255, 232, 1), rgba(240, 255, 240, 1),
60
61
  div.wunderbaum {
61
62
  box-sizing: border-box;
62
63
  height: 100%; // fill parent container
64
+ background-color: $background-color;
63
65
  margin: 0;
64
66
  padding: 0;
65
67
 
@@ -67,23 +69,64 @@ div.wunderbaum {
67
69
  font-size: 14px;
68
70
 
69
71
  color: $node-text-color;
70
- border: 1px solid $border-color;
71
- overflow: hidden; // avoid unwanted effects when auto-resizing
72
+ border: 2px solid $border-color;
73
+ border-radius: 4px;
74
+ background-clip: content-box; // Keep color outside rounded borders?
75
+ // overflow: hidden; // avoid unwanted effects when auto-resizing
76
+ overflow-x: auto;
77
+ overflow-y: scroll;
72
78
 
73
79
  // Focus border is generated by the browsers per default:
74
- // &:focus,
75
- // &:focus-within {
76
- // border-color: $active-border-color;
77
- // }
80
+ &:focus,
81
+ &:focus-within {
82
+ border-color: $focus-border-color;
83
+ // outline-style: none;
84
+ }
85
+
86
+ &.wb-disabled {
87
+ opacity: 0.7;
88
+ pointer-events: none;
89
+ }
78
90
 
79
91
  div.wb-scroll-container {
80
92
  position: relative;
81
- overflow: auto;
93
+ // overflow: auto;
82
94
  // scroll-behavior: smooth;
83
95
  min-height: 4px;
84
96
  // height: calc(100% - #{$header-height}); // didn't work. Using JS instead
85
97
  }
86
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
+
87
130
  // --- Header and node list ---
88
131
  div.wb-row {
89
132
  position: absolute;
@@ -95,7 +138,7 @@ div.wunderbaum {
95
138
 
96
139
  // --- Node List Only ---
97
140
 
98
- // Dimm some colors if tree has no focus
141
+ // Dim some colors if tree has no focus
99
142
  &:not(:focus-within),
100
143
  &:not(:focus) {
101
144
  div.wb-node-list div.wb-row {
@@ -103,54 +146,89 @@ div.wunderbaum {
103
146
  &.wb-selected {
104
147
  background-color: grayscale($active-color);
105
148
  border-color: grayscale($active-border-color);
149
+
106
150
  &:hover {
107
151
  background-color: grayscale($active-hover-color);
108
152
  }
109
153
  }
110
154
  }
111
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
+ }
165
+
112
166
  div.wb-node-list {
113
167
  div.wb-row {
114
168
  &:hover {
115
169
  background-color: $hover-color;
116
170
  }
171
+
117
172
  &.wb-active,
118
173
  &.wb-selected {
119
174
  background-color: $active-color;
175
+
120
176
  // border-color: $active-border-color;
121
177
  &:hover {
122
178
  background-color: $active-hover-color;
123
179
  // border-color: $active-hover-border-color;
124
180
  }
125
181
  }
182
+
126
183
  &.wb-focus:not(.wb-active) {
127
184
  border-style: dotted;
128
185
  border-color: $active-border-color;
129
186
  }
187
+
130
188
  &.wb-active {
131
189
  // background-color: $active-hover-color;
132
190
  border-style: solid;
133
191
  border-color: $active-border-color;
192
+
134
193
  &:hover {
135
194
  // background-color: $active-hover-color;
136
195
  border-color: $active-hover-border-color;
137
196
  }
138
197
  }
198
+
139
199
  &.wb-loading {
140
200
  font-style: italic;
141
201
  }
142
- &.wb-dirty,
143
- .wb-col.wb-dirty {
202
+
203
+ &.wb-busy,
204
+ i.wb-busy,
205
+ .wb-col.wb-busy {
144
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
145
220
  background: repeating-linear-gradient(
146
221
  45deg,
147
- $hover-color,
148
- $hover-color 5px,
149
- $grid-color 5px,
150
- $grid-color 10px
222
+ // $hover-color,
223
+ // $hover-color 3.88px,
224
+ transparent,
225
+ transparent 3.88px,
226
+ $grid-color 3.88px,
227
+ $grid-color 7.78px
151
228
  );
152
- animation: wb-dirty-animation 2s linear infinite;
229
+ animation: wb-busy-animation 2s linear infinite;
153
230
  }
231
+
154
232
  &.wb-error,
155
233
  &.wb-status-error {
156
234
  color: $error-color;
@@ -161,11 +239,12 @@ div.wunderbaum {
161
239
  // --- HEADER ---
162
240
 
163
241
  div.wb-header {
164
- position: relative;
242
+ position: sticky;
165
243
  height: $header-height;
166
244
  border-bottom: 1px solid $border-color;
167
245
  padding: 0;
168
246
  background-color: $header-color;
247
+
169
248
  span.wb-col {
170
249
  font-weight: bold;
171
250
  // &::after {
@@ -182,9 +261,11 @@ div.wunderbaum {
182
261
  line-height: $row-inner-height;
183
262
  padding: 0 $col-padding-x;
184
263
  border-right: 1px solid $grid-color;
264
+
185
265
  &:last-of-type {
186
266
  border-right: none;
187
267
  }
268
+
188
269
  overflow: visible; // allow resizer to overlap next col
189
270
 
190
271
  span.wb-col-title {
@@ -192,6 +273,7 @@ div.wunderbaum {
192
273
  overflow: hidden;
193
274
  text-overflow: ellipsis;
194
275
  }
276
+
195
277
  span.wb-col-resizer {
196
278
  position: absolute;
197
279
  top: 0;
@@ -227,18 +309,21 @@ div.wunderbaum {
227
309
  i.bi::before {
228
310
  vertical-align: baseline;
229
311
  }
312
+
230
313
  img.wb-icon {
231
314
  width: $icon-width;
232
315
  height: $icon-height;
233
316
  padding: $icon-padding-y $icon-padding-x;
234
317
  // margin-top: $icon-padding-y;
235
318
  }
319
+
236
320
  i.wb-indent {
237
321
  // border-left: 1px solid gray;
238
322
  &::before {
239
323
  content: "\00a0";
240
324
  }
241
325
  }
326
+
242
327
  i.wb-expander.wb-spin,
243
328
  i.wb-icon.wb-spin {
244
329
  height: unset; // Prevent wobble
@@ -249,7 +334,7 @@ div.wunderbaum {
249
334
 
250
335
  span.wb-title {
251
336
  min-width: 1em;
252
- display: inline-block; // fix vertical offset on Chrome?
337
+ // display: inline-block; // fix vertical offset on Chrome?
253
338
  vertical-align: top;
254
339
  overflow-x: hidden;
255
340
  white-space: nowrap;
@@ -267,69 +352,83 @@ div.wunderbaum {
267
352
  }
268
353
  }
269
354
  }
355
+
270
356
  &.wb-cell-mode div.wb-header div.wb-row span.wb-col {
271
357
  &.wb-active {
272
358
  background-color: $active-hover-color;
273
359
  }
274
360
  }
361
+
275
362
  div.wb-node-list div.wb-row {
276
363
  border-bottom-color: $grid-color;
364
+
277
365
  &:hover:not(.wb-active):not(.wb-selected) {
278
366
  background-color: $hover-color;
279
367
  // border-color: $hover-border-color;
280
368
  }
369
+
281
370
  &.wb-active {
282
371
  border-bottom-color: $active-border-color;
283
372
  }
373
+
284
374
  span.wb-col {
285
375
  border-right: 1px solid $grid-color;
286
376
 
287
377
  input.wb-input-edit,
288
- >input[type=color],
289
- >input[type=date],
290
- >input[type=datetime], // deprecated
291
- >input[type=datetime-local],
292
- >input[type=email],
293
- >input[type=month],
294
- >input[type=number],
295
- >input[type=password],
296
- >input[type=search],
297
- >input[type=tel],
298
- >input[type=text],
299
- >input[type=time],
300
- >input[type=url],
301
- >input[type=week],
302
- >select {
378
+ > input[type="color"],
379
+ > input[type="date"],
380
+ > input[type="datetime"],
381
+ > input[type="datetime-local"],
382
+ > input[type="email"],
383
+ > input[type="month"],
384
+ > input[type="number"],
385
+ > input[type="password"],
386
+ > input[type="search"],
387
+ > input[type="tel"],
388
+ > input[type="text"],
389
+ > input[type="time"],
390
+ > input[type="url"],
391
+ > input[type="week"],
392
+ > select {
303
393
  width: 100%;
394
+ max-height: $row-inner-height;
304
395
  }
305
396
  }
306
397
  }
398
+
307
399
  &.wb-cell-mode {
308
400
  div.wb-row {
309
401
  background-color: $background-color;
402
+
310
403
  span.wb-col.wb-active {
311
404
  background-color: $active-column-color;
312
405
  }
406
+
313
407
  &.wb-active {
314
408
  background-color: $active-column-color;
409
+
315
410
  span.wb-col.wb-active {
316
411
  background-color: $active-cell-color;
317
412
  }
318
413
  }
319
414
  }
415
+
320
416
  &.wb-cell-edit-mode div.wb-row.wb-active span.wb-col.wb-active {
321
417
  background-color: $error-color;
322
418
  }
323
419
  }
420
+
324
421
  &.wb-alternate div.wb-node-list {
325
422
  div.wb-row:nth-of-type(even):not(.wb-active):not(.wb-selected) {
326
423
  background-color: $alternate-row-color;
424
+
327
425
  &:hover {
328
- background-color: $alternate-row-color-even;
426
+ background-color: $alternate-row-color-hover;
329
427
  }
330
428
  }
331
429
  }
332
- // Dimm some colors if tree has no focus
430
+
431
+ // Dim some colors if tree has no focus
333
432
  &:not(:focus-within),
334
433
  &:not(:focus) {
335
434
  div.wb-node-list div.wb-row {
@@ -343,30 +442,38 @@ div.wunderbaum {
343
442
  &.wb-ext-filter-hide {
344
443
  div.wb-node-list div.wb-row {
345
444
  color: $filter-dim-color;
445
+
346
446
  &.wb-submatch {
347
447
  color: $filter-submatch-color;
348
448
  }
449
+
349
450
  &.wb-match {
350
451
  color: $node-text-color;
351
452
  }
352
453
  }
353
454
  }
455
+
354
456
  /* --- DND --- */
355
457
  div.wb-row.wb-drag-source {
356
458
  opacity: 0.5;
459
+
357
460
  .wb-node {
358
461
  background-color: $drop-source-color;
359
462
  }
360
463
  }
464
+
361
465
  div.wb-row.wb-drop-target {
362
466
  overflow: visible;
467
+
363
468
  .wb-node {
364
469
  background-color: $drop-target-color;
365
470
  overflow: visible;
471
+
366
472
  // z-index: 1000;
367
473
  .wb-icon {
368
474
  position: relative;
369
475
  overflow: visible;
476
+
370
477
  &::after {
371
478
  // use ::after, because ::before is used by icon fonts
372
479
  // vertical-align: baseline;
@@ -379,11 +486,13 @@ div.wunderbaum {
379
486
  }
380
487
  }
381
488
  }
489
+
382
490
  div.wb-row.wb-drop-target.wb-drop-before .wb-node .wb-icon::after {
383
491
  content: url(../docs/assets/drop_marker_insert_16x64.png);
384
492
  left: 0; // $icon-outer-width * 1.5;
385
493
  top: ($row-outer-height - 16) / 2 - $row-outer-height / 2;
386
494
  }
495
+
387
496
  div.wb-row.wb-drop-target.wb-drop-after .wb-node .wb-icon::after {
388
497
  content: url(../docs/assets/drop_marker_insert_16x64.png);
389
498
  left: 0; //$icon-outer-width * 1.5;
@@ -392,6 +501,7 @@ div.wunderbaum {
392
501
 
393
502
  &.wb-rainbow {
394
503
  @for $i from 1 through length($level-rainbow) {
504
+ i.wb-expander:nth-child(#{length($level-rainbow)}n + #{$i}),
395
505
  i.wb-indent:nth-child(#{length($level-rainbow)}n + #{$i}) {
396
506
  background: nth($level-rainbow, $i);
397
507
  }
@@ -401,16 +511,20 @@ div.wunderbaum {
401
511
  /* Fade out expanders, when container is not hovered or active */
402
512
  &.wb-fade-expander {
403
513
  i.wb-expander {
404
- transition: opacity 1.5s;
405
- opacity: 0;
514
+ // only text-alpha is animated, since we want to keep the background color
515
+ // transition: opacity 1.5s;
516
+ // opacity: 0;
517
+ transition: color 1.5s;
518
+ color: rgba($node-text-color, 0);
406
519
  }
520
+
407
521
  div.wb-row.wb-loading i.wb-expander,
408
522
  &:hover i.wb-expander,
409
523
  &:focus i.wb-expander,
410
524
  &:focus-within i.wb-expander,
411
525
  [class*="wb-statusnode-"] i.wb-expander {
412
- transition: opacity 0.6s;
413
- opacity: 1;
526
+ transition: color 0.6s;
527
+ color: $node-text-color;
414
528
  }
415
529
  }
416
530
 
@@ -431,10 +545,12 @@ div.wunderbaum {
431
545
  i.wb-checkbox {
432
546
  visibility: hidden;
433
547
  }
548
+
434
549
  .wb-row:hover i.wb-checkbox,
435
550
  .wb-row.wb-selected i.wb-checkbox {
436
551
  visibility: unset;
437
552
  }
553
+
438
554
  &:focus,
439
555
  &:focus-within {
440
556
  .wb-row.wb-active i.wb-checkbox {
@@ -442,47 +558,63 @@ div.wunderbaum {
442
558
  }
443
559
  }
444
560
  }
445
- } // div.wunderbaum
561
+ }
562
+
563
+ // div.wunderbaum
446
564
 
447
565
  /* --- TOOL CLASSES --- */
448
566
 
449
567
  .wb-helper-center {
450
568
  text-align: center;
451
569
  }
570
+
452
571
  .wb-helper-disabled {
453
572
  color: $dim-color;
454
573
  }
574
+
455
575
  .wb-helper-hidden {
456
576
  display: none;
457
577
  }
578
+
458
579
  .wb-helper-invalid {
459
580
  color: $error-color;
460
581
  }
582
+
461
583
  .wb-helper-lazy-expander {
462
584
  color: $bg-highlight-color;
463
585
  }
586
+
464
587
  .wb-helper-link {
465
588
  cursor: pointer;
466
589
  }
590
+
467
591
  // .wb-helper-edit-text {
468
592
  // // content-editable: true;
469
593
  // }
470
594
 
471
595
  /* RTL support */
472
- .wb-helper-start {
596
+ .wb-helper-start,
597
+ .wb-helper-start > input {
473
598
  text-align: left;
474
599
  }
475
- .wb-helper-end {
600
+
601
+ .wb-helper-end,
602
+ .wb-helper-end > input {
476
603
  text-align: right;
477
604
  }
605
+
478
606
  .wb-rtl {
479
- .wb-helper-start {
607
+ .wb-helper-start,
608
+ .wb-helper-start > input {
480
609
  text-align: right;
481
610
  }
482
- .wb-helper-end {
611
+
612
+ .wb-helper-end,
613
+ .wb-helper-end > input {
483
614
  text-align: left;
484
615
  }
485
616
  }
617
+
486
618
  /* Class 'wb-tristate' is used to mark checkboxes that should toggle like
487
619
  * indeterminate -> checked -> unchecked -> indeterminate ...
488
620
  */
@@ -504,6 +636,7 @@ div.wunderbaum {
504
636
  0% {
505
637
  transform: rotate(0deg);
506
638
  }
639
+
507
640
  to {
508
641
  transform: rotate(1turn);
509
642
  }
@@ -513,16 +646,18 @@ div.wunderbaum {
513
646
  0% {
514
647
  background-color: hsl(200, 20%, 70%);
515
648
  }
649
+
516
650
  100% {
517
651
  background-color: hsl(200, 20%, 95%);
518
652
  }
519
653
  }
520
654
 
521
- @keyframes wb-dirty-animation {
655
+ @keyframes wb-busy-animation {
522
656
  0% {
523
657
  background-position: 0 0;
524
658
  }
659
+
525
660
  100% {
526
- background-position: -70px 0;
661
+ background-position: 0 $row-outer-height;
527
662
  }
528
663
  }