@keenmate/svelte-treeview 0.2.0 → 0.2.1
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/TreeView.svelte +25 -27
- package/dist/tree-styles.sass +106 -0
- package/package.json +1 -1
package/dist/TreeView.svelte
CHANGED
|
@@ -449,28 +449,26 @@ let liElements = [];
|
|
|
449
449
|
</svelte:fragment>
|
|
450
450
|
</ContextMenu>
|
|
451
451
|
|
|
452
|
-
<style
|
|
453
|
-
margin: 0;
|
|
454
|
-
padding: 0;
|
|
455
|
-
list-style: none;
|
|
456
|
-
}
|
|
457
|
-
:global(.treeview.show-lines) :global(ul:before) {
|
|
452
|
+
<style>.treeview.show-lines ul:before {
|
|
458
453
|
border-left: solid black 1px;
|
|
459
454
|
}
|
|
460
|
-
|
|
455
|
+
.treeview.show-lines ul li:before {
|
|
461
456
|
border-top: solid black 1px;
|
|
457
|
+
margin: 0;
|
|
458
|
+
padding: 0;
|
|
459
|
+
list-style: none;
|
|
462
460
|
}
|
|
463
|
-
|
|
461
|
+
.treeview ul, .treeview li {
|
|
464
462
|
margin: 0;
|
|
465
463
|
padding: 0;
|
|
466
464
|
list-style: none;
|
|
467
465
|
}
|
|
468
|
-
|
|
466
|
+
.treeview ul {
|
|
469
467
|
margin-left: 0.4em;
|
|
470
468
|
position: relative;
|
|
471
469
|
margin-left: 0.3em;
|
|
472
470
|
}
|
|
473
|
-
|
|
471
|
+
.treeview ul:before {
|
|
474
472
|
content: "";
|
|
475
473
|
display: block;
|
|
476
474
|
width: 0;
|
|
@@ -479,7 +477,7 @@ let liElements = [];
|
|
|
479
477
|
bottom: 0;
|
|
480
478
|
left: 0;
|
|
481
479
|
}
|
|
482
|
-
|
|
480
|
+
.treeview ul li:before {
|
|
483
481
|
content: "";
|
|
484
482
|
display: block;
|
|
485
483
|
width: 10px;
|
|
@@ -489,51 +487,51 @@ let liElements = [];
|
|
|
489
487
|
top: 0.8em;
|
|
490
488
|
left: 0;
|
|
491
489
|
}
|
|
492
|
-
|
|
490
|
+
.treeview ul li:not(.has-children):before {
|
|
493
491
|
width: 26px;
|
|
494
492
|
}
|
|
495
|
-
|
|
493
|
+
.treeview ul li:last-child:before {
|
|
496
494
|
background: #fff;
|
|
497
495
|
height: auto;
|
|
498
496
|
top: 1em;
|
|
499
497
|
bottom: 0;
|
|
500
498
|
}
|
|
501
|
-
|
|
499
|
+
.treeview li {
|
|
502
500
|
margin: 0;
|
|
503
501
|
padding: 0 0.8em;
|
|
504
502
|
color: #555;
|
|
505
503
|
font-weight: 700;
|
|
506
504
|
position: relative;
|
|
507
505
|
}
|
|
508
|
-
|
|
506
|
+
.treeview li:not(.has-children) .tree-item {
|
|
509
507
|
margin-left: 14px;
|
|
510
508
|
}
|
|
511
|
-
|
|
509
|
+
.treeview .tree-item {
|
|
512
510
|
display: flex;
|
|
513
511
|
column-gap: 0.4em;
|
|
514
512
|
align-items: center;
|
|
515
513
|
padding: 4px 0;
|
|
516
514
|
}
|
|
517
|
-
|
|
515
|
+
.treeview .no-arrow {
|
|
518
516
|
padding-left: 0.5rem;
|
|
519
517
|
}
|
|
520
|
-
|
|
518
|
+
.treeview .arrow {
|
|
521
519
|
cursor: pointer;
|
|
522
520
|
display: inline-block;
|
|
523
521
|
}
|
|
524
|
-
|
|
522
|
+
.treeview .arrowDown {
|
|
525
523
|
transform: rotate(90deg);
|
|
526
524
|
}
|
|
527
|
-
|
|
525
|
+
.treeview .invisible {
|
|
528
526
|
visibility: hidden;
|
|
529
527
|
}
|
|
530
|
-
|
|
528
|
+
.treeview .inserting-highlighted {
|
|
531
529
|
color: red;
|
|
532
530
|
}
|
|
533
|
-
|
|
531
|
+
.treeview .hover {
|
|
534
532
|
font-weight: bold;
|
|
535
533
|
}
|
|
536
|
-
|
|
534
|
+
.treeview .insert-line {
|
|
537
535
|
position: absolute;
|
|
538
536
|
left: 0;
|
|
539
537
|
z-index: 99;
|
|
@@ -546,17 +544,17 @@ let liElements = [];
|
|
|
546
544
|
margin-bottom: -2px;
|
|
547
545
|
margin-top: -2px;
|
|
548
546
|
}
|
|
549
|
-
|
|
547
|
+
.treeview .insert-line-child {
|
|
550
548
|
margin-left: calc(28px + 5em);
|
|
551
549
|
background-color: red;
|
|
552
550
|
height: 6px;
|
|
553
551
|
}
|
|
554
|
-
|
|
552
|
+
.treeview .insert-line-wrapper {
|
|
555
553
|
position: relative;
|
|
556
554
|
}
|
|
557
|
-
|
|
555
|
+
.treeview .currently-dragged {
|
|
558
556
|
color: LightGray;
|
|
559
557
|
}
|
|
560
|
-
|
|
558
|
+
.treeview .pointer-cursor {
|
|
561
559
|
cursor: grab;
|
|
562
560
|
}</style>
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
|
|
2
|
+
$treeview-lines: solid black 1px
|
|
3
|
+
.treeview
|
|
4
|
+
//will show lines if you set show-lines to root element
|
|
5
|
+
&.show-lines
|
|
6
|
+
ul
|
|
7
|
+
&:before
|
|
8
|
+
border-left: $treeview-lines
|
|
9
|
+
li:before
|
|
10
|
+
border-top: $treeview-lines
|
|
11
|
+
margin: 0
|
|
12
|
+
padding: 0
|
|
13
|
+
list-style: none
|
|
14
|
+
ul, li
|
|
15
|
+
margin: 0
|
|
16
|
+
padding: 0
|
|
17
|
+
list-style: none
|
|
18
|
+
ul
|
|
19
|
+
margin-left: 0.4em
|
|
20
|
+
position: relative
|
|
21
|
+
margin-left: .3em
|
|
22
|
+
&:before
|
|
23
|
+
content: ""
|
|
24
|
+
display: block
|
|
25
|
+
width: 0
|
|
26
|
+
position: absolute
|
|
27
|
+
top: 0
|
|
28
|
+
bottom: 0
|
|
29
|
+
left: 0
|
|
30
|
+
li:before
|
|
31
|
+
content: ""
|
|
32
|
+
display: block
|
|
33
|
+
width: 10px
|
|
34
|
+
height: 0
|
|
35
|
+
margin-top: -1px
|
|
36
|
+
position: absolute
|
|
37
|
+
top: 0.8em
|
|
38
|
+
left: 0
|
|
39
|
+
li:not(.has-children):before
|
|
40
|
+
width: 26px
|
|
41
|
+
|
|
42
|
+
li:last-child:before
|
|
43
|
+
background: #fff
|
|
44
|
+
height: auto
|
|
45
|
+
top: 1em
|
|
46
|
+
bottom: 0
|
|
47
|
+
|
|
48
|
+
li
|
|
49
|
+
margin: 0
|
|
50
|
+
padding: 0 0.8em
|
|
51
|
+
color: #555
|
|
52
|
+
font-weight: 700
|
|
53
|
+
position: relative
|
|
54
|
+
&:not(.has-children)
|
|
55
|
+
.tree-item
|
|
56
|
+
margin-left: 14px
|
|
57
|
+
|
|
58
|
+
.tree-item
|
|
59
|
+
display: flex
|
|
60
|
+
column-gap: 0.4em
|
|
61
|
+
align-items: center
|
|
62
|
+
padding: 4px 0
|
|
63
|
+
|
|
64
|
+
.div-has-children
|
|
65
|
+
|
|
66
|
+
.no-arrow
|
|
67
|
+
padding-left: .5rem
|
|
68
|
+
|
|
69
|
+
.arrow
|
|
70
|
+
cursor: pointer
|
|
71
|
+
display: inline-block
|
|
72
|
+
|
|
73
|
+
.arrowDown
|
|
74
|
+
transform: rotate(90deg)
|
|
75
|
+
|
|
76
|
+
.invisible
|
|
77
|
+
visibility: hidden
|
|
78
|
+
|
|
79
|
+
.inserting-highlighted
|
|
80
|
+
color: red
|
|
81
|
+
.hover
|
|
82
|
+
font-weight: bold
|
|
83
|
+
.insert-line
|
|
84
|
+
position: absolute
|
|
85
|
+
left: 0
|
|
86
|
+
z-index: 99
|
|
87
|
+
height: 2px
|
|
88
|
+
width: 200px
|
|
89
|
+
background-color: blue
|
|
90
|
+
display: block
|
|
91
|
+
border-radius: 3px
|
|
92
|
+
margin-left: 28px
|
|
93
|
+
margin-bottom: -2px
|
|
94
|
+
margin-top: -2px
|
|
95
|
+
.insert-line-child
|
|
96
|
+
margin-left: calc( 28px + 5em )
|
|
97
|
+
background-color: red
|
|
98
|
+
height: 6px
|
|
99
|
+
|
|
100
|
+
.insert-line-wrapper
|
|
101
|
+
position: relative
|
|
102
|
+
|
|
103
|
+
.currently-dragged
|
|
104
|
+
color: LightGray
|
|
105
|
+
.pointer-cursor
|
|
106
|
+
cursor: grab
|