tao_ui 0.2.9 → 0.2.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/assets/javascripts/tao/ui/dialog/confirm.coffee +1 -1
- data/lib/assets/javascripts/tao/ui/dialog/element.coffee +11 -9
- data/lib/assets/javascripts/tao/ui/dialog/message.coffee +1 -1
- data/lib/assets/javascripts/tao/ui/popover/confirm.coffee +2 -2
- data/lib/assets/javascripts/tao/ui/popover/element.coffee +9 -9
- data/lib/assets/javascripts/tao/ui/shared/slide_box/element/base.coffee +12 -8
- data/lib/assets/javascripts/tao/ui/sortable.coffee +13 -6
- data/lib/assets/javascripts/tao/ui/table/expandable.coffee +2 -2
- data/lib/assets/javascripts/tao/ui/table/selectable.coffee +2 -2
- data/lib/assets/javascripts/tao/ui/tree/element.coffee +1 -1
- data/lib/assets/javascripts/tao/ui/tree/item.coffee +3 -1
- data/lib/assets/stylesheets/tao/ui/_variables.scss +1 -0
- data/lib/assets/stylesheets/tao/ui/dialog.scss +8 -3
- data/lib/assets/stylesheets/tao/ui/index.scss +1 -0
- data/lib/assets/stylesheets/tao/ui/mobile/slide_box.scss +44 -28
- data/lib/assets/stylesheets/tao/ui/shared/_slide_box.scss +2 -2
- data/lib/assets/stylesheets/tao/ui/slide_box.scss +10 -0
- data/lib/assets/stylesheets/tao/ui/tabs.scss +23 -0
- data/lib/assets/stylesheets/tao/ui/tree.scss +9 -7
- data/lib/assets/stylesheets/tao/ui/variables/_tree.scss +2 -0
- data/lib/generators/tao/icons/icons_generator.rb +1 -1
- data/lib/tao_ui/components/tree/item_component.rb +13 -19
- data/lib/tao_ui/components/tree/list_component.rb +11 -12
- data/lib/tao_ui/version.rb +1 -1
- metadata +22 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 07e08999a1fabcf4e08b534781281b66fa93db73
|
4
|
+
data.tar.gz: 5c6ef34f6cbb67b0aa4c5783345c49ad4d6b0106
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3d76266a43a9ddf7bc147e3cf42713d538885bc7b976b9ec67ef406ac0a01b08ac4142fc6989be7db27e5e5199b3e116bdc3febe9f7236e1f11c4d32d86ded4c
|
7
|
+
data.tar.gz: 208fa2fb87faef5aaa7be228763344b4534396692c778cb8715918b21481094a06bb0e7fafadaccdeb5b4e61f2a4795efdc0c192eafc202dc643bcb8e09c0f0c
|
@@ -36,9 +36,11 @@ class Tao.Dialog.Element extends TaoComponent
|
|
36
36
|
_bind: ->
|
37
37
|
@on 'click', (e) =>
|
38
38
|
@active = false if e.target == @
|
39
|
+
null
|
39
40
|
|
40
41
|
@on 'click', ".tao-dialog-wrapper > .link-close, #{@closeSelector}", =>
|
41
42
|
@active = false
|
43
|
+
null
|
42
44
|
|
43
45
|
if @triggerEl && @triggerEl.length > 0
|
44
46
|
@triggerEl.on "click.tao-slide-box-#{@taoId}", (e) =>
|
@@ -57,23 +59,23 @@ class Tao.Dialog.Element extends TaoComponent
|
|
57
59
|
else
|
58
60
|
@jq.hide()
|
59
61
|
|
60
|
-
# in case the dialog is hidden too fast
|
61
62
|
if @jq.is(':visible')
|
62
|
-
|
63
|
+
@on 'transitionend', (e) =>
|
64
|
+
return unless $(e.target).is('.tao-dialog-wrapper')
|
65
|
+
@off 'transitionend'
|
63
66
|
reset()
|
64
|
-
|
65
|
-
|
66
|
-
reset()
|
67
|
+
else
|
68
|
+
reset()
|
67
69
|
|
68
70
|
null
|
69
71
|
|
70
72
|
_activeChanged: ->
|
71
73
|
if @active
|
72
74
|
$('body').addClass('dialog-active')
|
73
|
-
@
|
75
|
+
@namespacedTrigger 'show'
|
74
76
|
else
|
75
77
|
$('body').removeClass('dialog-active')
|
76
|
-
@
|
78
|
+
@namespacedTrigger 'hide'
|
77
79
|
|
78
80
|
setContent: (content) ->
|
79
81
|
@jq.find('.tao-dialog-content').empty()
|
@@ -81,9 +83,9 @@ class Tao.Dialog.Element extends TaoComponent
|
|
81
83
|
@
|
82
84
|
|
83
85
|
remove: ->
|
84
|
-
@
|
86
|
+
@namespacedTrigger 'beforeRemove'
|
85
87
|
@jq.remove()
|
86
|
-
@
|
88
|
+
@namespacedTrigger 'remove'
|
87
89
|
@
|
88
90
|
|
89
91
|
beforeCache: ->
|
@@ -6,12 +6,12 @@ class Tao.Popover.Confirm extends Tao.Popover.Element
|
|
6
6
|
super
|
7
7
|
|
8
8
|
@on 'click', '.button-confirm', (e) =>
|
9
|
-
@
|
9
|
+
@namespacedTrigger 'confirm'
|
10
10
|
@active = false
|
11
11
|
null
|
12
12
|
|
13
13
|
@on 'click', '.button-cancel', (e) =>
|
14
|
-
@
|
14
|
+
@namespacedTrigger 'cancel'
|
15
15
|
@active = false
|
16
16
|
null
|
17
17
|
|
@@ -72,24 +72,24 @@ class Tao.Popover.Element extends TaoComponent
|
|
72
72
|
else
|
73
73
|
@jq.hide()
|
74
74
|
|
75
|
-
# in case the popover is hidden too fast
|
76
75
|
if @jq.is(':visible')
|
77
|
-
|
76
|
+
@on 'transitionend', (e) =>
|
77
|
+
return unless e.target == @
|
78
|
+
@off 'transitionend'
|
78
79
|
reset()
|
79
|
-
|
80
|
-
|
81
|
-
reset()
|
80
|
+
else
|
81
|
+
reset()
|
82
82
|
null
|
83
83
|
|
84
84
|
_activeChanged: ->
|
85
85
|
if @active
|
86
86
|
@target.addClass 'tao-popover-active'
|
87
87
|
@_enableAutoHide() if @autoHide
|
88
|
-
@
|
88
|
+
@namespacedTrigger 'show'
|
89
89
|
else
|
90
90
|
@target.removeClass 'tao-popover-active'
|
91
91
|
@_disableAutoHide() if @autoHide
|
92
|
-
@
|
92
|
+
@namespacedTrigger 'hide'
|
93
93
|
|
94
94
|
_enableAutoHide: ->
|
95
95
|
$(document).on "mousedown.tao-popover-#{@taoId}", (e) =>
|
@@ -153,10 +153,10 @@ class Tao.Popover.Element extends TaoComponent
|
|
153
153
|
@active = false
|
154
154
|
|
155
155
|
remove: ->
|
156
|
-
@
|
156
|
+
@namespacedTrigger 'beforeRemove'
|
157
157
|
@target.removeClass 'tao-popover-active'
|
158
158
|
@jq.remove()
|
159
|
-
@
|
159
|
+
@namespacedTrigger 'remove'
|
160
160
|
@
|
161
161
|
|
162
162
|
_disconnected: ->
|
@@ -48,22 +48,26 @@ class Tao.SlideBox.ElementBase extends TaoComponent
|
|
48
48
|
|
49
49
|
_beforeActiveChanged: (active) ->
|
50
50
|
if active
|
51
|
+
@namespacedTrigger 'beforeShow'
|
51
52
|
@jq.show()
|
52
53
|
@reflow()
|
53
54
|
else
|
55
|
+
@namespacedTrigger 'beforeHide'
|
54
56
|
reset = =>
|
55
57
|
if @autoDestroy
|
56
58
|
@remove()
|
57
59
|
else
|
58
60
|
@jq.hide()
|
61
|
+
@namespacedTrigger 'afterHide'
|
59
62
|
|
60
63
|
# in case the slide box is hidden too fast
|
61
64
|
if @jq.is(':visible')
|
62
|
-
|
65
|
+
@on 'transitionend', (e) =>
|
66
|
+
return unless $(e.target).is('.slide-box-wrapper')
|
67
|
+
@off 'transitionend'
|
63
68
|
reset()
|
64
|
-
|
65
|
-
|
66
|
-
reset()
|
69
|
+
else
|
70
|
+
reset()
|
67
71
|
null
|
68
72
|
|
69
73
|
_activeChanged: ->
|
@@ -71,10 +75,10 @@ class Tao.SlideBox.ElementBase extends TaoComponent
|
|
71
75
|
if @active
|
72
76
|
@_bindAutoHideEvent() if @autoHide
|
73
77
|
$('body').addClass('slide-box-active')
|
74
|
-
@
|
78
|
+
@namespacedTrigger 'show'
|
75
79
|
else
|
76
80
|
$('body').removeClass('slide-box-active')
|
77
|
-
@
|
81
|
+
@namespacedTrigger 'hide'
|
78
82
|
|
79
83
|
_autoHideEvent: ''
|
80
84
|
|
@@ -88,9 +92,9 @@ class Tao.SlideBox.ElementBase extends TaoComponent
|
|
88
92
|
@_unbindAutoHideEvent()
|
89
93
|
|
90
94
|
remove: ->
|
91
|
-
@
|
95
|
+
@namespacedTrigger 'beforeRemove'
|
92
96
|
@jq.remove()
|
93
|
-
@
|
97
|
+
@namespacedTrigger 'remove'
|
94
98
|
@
|
95
99
|
|
96
100
|
beforeCache: ->
|
@@ -29,10 +29,10 @@ class Tao.Sortable extends TaoComponent
|
|
29
29
|
$(document).off ".tao-sortable-#{@taoId}"
|
30
30
|
|
31
31
|
_startDragging: ($item) ->
|
32
|
-
@
|
32
|
+
@namespacedTrigger 'beforeSortStart', [$item]
|
33
33
|
@_sortingItem = $item
|
34
34
|
setTimeout -> $item.addClass('tao-sortable-sorting')
|
35
|
-
@
|
35
|
+
@namespacedTrigger 'sortStart', [@_sortingItem]
|
36
36
|
|
37
37
|
$(window).on "scroll.tao-sortable-#{@taoId}", _.throttle (e) =>
|
38
38
|
@_expireDimensionCache()
|
@@ -63,7 +63,7 @@ class Tao.Sortable extends TaoComponent
|
|
63
63
|
|
64
64
|
_stopDragging: ->
|
65
65
|
@_sortingItem.removeClass('tao-sortable-sorting')
|
66
|
-
@
|
66
|
+
@namespacedTrigger 'sortEnd', [@_sortingItem]
|
67
67
|
@_sortingItem = null
|
68
68
|
|
69
69
|
_findNearestItem: (mousePosition, dimensions = @_itemDimensions()) ->
|
@@ -84,6 +84,7 @@ class Tao.Sortable extends TaoComponent
|
|
84
84
|
|
85
85
|
_moveItem: (item, mousePosition) ->
|
86
86
|
if item.type == 'group'
|
87
|
+
return if @triggerHandler('tao:sorting', [@_sortingItem, item]) == false
|
87
88
|
item.el.append @_sortingItem
|
88
89
|
else
|
89
90
|
method = if (@axis == 'y' && mousePosition.y > item.center.y) ||
|
@@ -91,6 +92,7 @@ class Tao.Sortable extends TaoComponent
|
|
91
92
|
'after'
|
92
93
|
else
|
93
94
|
'before'
|
95
|
+
return if @triggerHandler('tao:sorting', [@_sortingItem, item, method]) == false
|
94
96
|
item.el[method] @_sortingItem
|
95
97
|
|
96
98
|
_itemDimensions: ->
|
@@ -130,9 +132,14 @@ class Tao.Sortable extends TaoComponent
|
|
130
132
|
y: dimension.top + (dimension.height / 2)
|
131
133
|
|
132
134
|
_getDistanceFromItem: (item, position) ->
|
133
|
-
|
134
|
-
|
135
|
-
|
135
|
+
rect = item.dimension
|
136
|
+
if position.x >= rect.left && position.x <= rect.right &&
|
137
|
+
position.y >= rect.top && position.y <= rect.bottom
|
138
|
+
0
|
139
|
+
else
|
140
|
+
deltaX = Math.min(Math.abs(position.x - rect.left), Math.abs(position.x - rect.right))
|
141
|
+
deltaY = Math.min(Math.abs(position.y - rect.top), Math.abs(position.y - rect.bottom))
|
142
|
+
Math.sqrt(Math.pow(deltaX, 2) + Math.pow(deltaY, 2))
|
136
143
|
|
137
144
|
_expireDimensionCache: ->
|
138
145
|
@_dimentions = null
|
@@ -8,10 +8,10 @@ Tao.Table.Expandable = ->
|
|
8
8
|
$row = $ e.currentTarget
|
9
9
|
if $row.hasClass 'expanded'
|
10
10
|
@collapseRow $row
|
11
|
-
@
|
11
|
+
@namespacedTrigger 'expandRow', $row
|
12
12
|
else
|
13
13
|
@expandRow $row
|
14
|
-
@
|
14
|
+
@namespacedTrigger 'collapseRow', $row
|
15
15
|
null
|
16
16
|
|
17
17
|
expandRow: (row) ->
|
@@ -10,7 +10,7 @@ Tao.Table.Selectable = ->
|
|
10
10
|
cb = e.currentTarget
|
11
11
|
$row = cb.jq.closest('tr')
|
12
12
|
@toggleSelectRow $row, cb.checked
|
13
|
-
@
|
13
|
+
@namespacedTrigger 'selectedChange', [@selectedRows]
|
14
14
|
|
15
15
|
@on 'tao:change', '.th-checkbox tao-check-box', (e) =>
|
16
16
|
cb = e.currentTarget
|
@@ -18,7 +18,7 @@ Tao.Table.Selectable = ->
|
|
18
18
|
@selectAllRows()
|
19
19
|
else
|
20
20
|
@unselectAllRows()
|
21
|
-
@
|
21
|
+
@namespacedTrigger 'selectedChange', [@selectedRows]
|
22
22
|
|
23
23
|
toggleSelectRow: (row, selected) ->
|
24
24
|
return @ unless @selectable
|
@@ -21,7 +21,7 @@ class Tao.Tree.Element extends TaoComponent
|
|
21
21
|
item = e.currentTarget
|
22
22
|
return unless item == e.target
|
23
23
|
@_refreshAssociatedItems(item) if @associatedSelect
|
24
|
-
@
|
24
|
+
@namespacedTrigger 'selectedChange', [@selectedItems]
|
25
25
|
null
|
26
26
|
|
27
27
|
_refreshAssociatedItems: (item) ->
|
@@ -25,7 +25,7 @@ class Tao.Tree.Item extends TaoComponent
|
|
25
25
|
|
26
26
|
@checkbox.on 'tao:change', (e) =>
|
27
27
|
@selected = e.currentTarget.checked
|
28
|
-
@
|
28
|
+
@namespacedTrigger 'selectedChange', [@selected]
|
29
29
|
null
|
30
30
|
|
31
31
|
_initExpandable: ->
|
@@ -79,6 +79,7 @@ class Tao.Tree.Item extends TaoComponent
|
|
79
79
|
url: @remote.url
|
80
80
|
type: 'get'
|
81
81
|
data: _.extend {}, @remote.params,
|
82
|
+
tree_item_id: @taoId
|
82
83
|
depth: @depth
|
83
84
|
selectable: @selectable || undefined
|
84
85
|
selected: @selected || undefined
|
@@ -87,5 +88,6 @@ class Tao.Tree.Item extends TaoComponent
|
|
87
88
|
updateList: ($newList) ->
|
88
89
|
@_afterTransition() if @jq.hasClass('expanding')
|
89
90
|
@jq.find('> .tao-tree-list').replaceWith($newList)
|
91
|
+
@namespacedTrigger 'listUpdate', [$newList]
|
90
92
|
|
91
93
|
TaoComponent.register Tao.Tree.Item
|
@@ -16,7 +16,7 @@ body.tao-dialog-active {
|
|
16
16
|
|
17
17
|
&[modal] {
|
18
18
|
background-color: rgba(0, 0, 0, 0);
|
19
|
-
transition: background-color
|
19
|
+
transition: background-color 300ms;
|
20
20
|
}
|
21
21
|
|
22
22
|
&[modal][active] {
|
@@ -37,11 +37,12 @@ body.tao-dialog-active {
|
|
37
37
|
background-color: $white-color;
|
38
38
|
box-shadow: 0 0 4px 4px rgba(0,0,0,0.1);
|
39
39
|
transform: translate(0, -30%);
|
40
|
-
transition: transform
|
40
|
+
transition: transform 300ms, opacity 300ms;
|
41
41
|
opacity: 0;
|
42
|
-
padding: 1rem 2rem;
|
43
42
|
|
44
43
|
.tao-dialog-content {
|
44
|
+
padding: 1rem 2rem;
|
45
|
+
|
45
46
|
h3:first-child,
|
46
47
|
.title:first-child {
|
47
48
|
margin-bottom: 2rem;
|
@@ -72,6 +73,10 @@ body.tao-dialog-active {
|
|
72
73
|
.tao-dialog-wrapper {
|
73
74
|
width: 32.5rem;
|
74
75
|
padding: 1.5rem 2rem;
|
76
|
+
|
77
|
+
.tao-dialog-content {
|
78
|
+
padding: 0;
|
79
|
+
}
|
75
80
|
}
|
76
81
|
}
|
77
82
|
|
@@ -1,39 +1,55 @@
|
|
1
1
|
@import 'tao/ui/mobile/globals';
|
2
2
|
@import 'tao/ui/shared/slide_box';
|
3
3
|
|
4
|
-
tao-slide-box {
|
5
|
-
.
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
width: 6rem;
|
15
|
-
flex: 1 1 auto;
|
16
|
-
text-align: left;
|
17
|
-
margin: 0 0 0 0.75rem;
|
18
|
-
}
|
4
|
+
.tao-slide-box {
|
5
|
+
.slide-box-content {
|
6
|
+
& > header,
|
7
|
+
& > .header {
|
8
|
+
height: 3rem;
|
9
|
+
background: $white-color;
|
10
|
+
display: flex;
|
11
|
+
align-items: center;
|
12
|
+
justify-content: space-between;
|
13
|
+
border-bottom: 1px solid $border-color;
|
19
14
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
15
|
+
.left {
|
16
|
+
width: 6rem;
|
17
|
+
flex: 1 1 auto;
|
18
|
+
text-align: left;
|
19
|
+
margin: 0 0 0 0.75rem;
|
20
|
+
}
|
21
|
+
|
22
|
+
.right {
|
23
|
+
width: 6rem;
|
24
|
+
flex: 1 1 auto;
|
25
|
+
text-align: right;
|
26
|
+
margin: 0 0.75rem 0 0;
|
27
|
+
}
|
26
28
|
|
27
|
-
|
28
|
-
|
29
|
-
|
29
|
+
.title {
|
30
|
+
flex: 0 0 auto;
|
31
|
+
text-align: center;
|
32
|
+
}
|
33
|
+
|
34
|
+
.link-close {
|
35
|
+
fill: $lighter-grey-color;
|
36
|
+
|
37
|
+
&:active {
|
38
|
+
fill: $grey-color;
|
39
|
+
}
|
40
|
+
}
|
30
41
|
}
|
31
42
|
|
32
|
-
.
|
33
|
-
|
43
|
+
& > .buttons {
|
44
|
+
border-top: 1px solid $border-color;
|
45
|
+
|
46
|
+
.button {
|
47
|
+
border-radius: 0;
|
48
|
+
border-width: 0 1px 0 0;
|
34
49
|
|
35
|
-
|
36
|
-
|
50
|
+
&:last-child {
|
51
|
+
border-right-width: 0;
|
52
|
+
}
|
37
53
|
}
|
38
54
|
}
|
39
55
|
}
|
@@ -15,7 +15,7 @@ tao-slide-box {
|
|
15
15
|
|
16
16
|
&[modal] {
|
17
17
|
background-color: rgba(0, 0, 0, 0);
|
18
|
-
transition: background-color
|
18
|
+
transition: background-color 300ms ease-in-out;
|
19
19
|
}
|
20
20
|
|
21
21
|
&[modal][active] {
|
@@ -27,7 +27,7 @@ tao-slide-box {
|
|
27
27
|
opacity: 0;
|
28
28
|
padding: 1.5rem;
|
29
29
|
border: 0px solid $light-border-color;
|
30
|
-
transition: opacity
|
30
|
+
transition: opacity 300ms ease-in-out, transform 300ms ease-in-out;
|
31
31
|
position: absolute;
|
32
32
|
|
33
33
|
.slide-box-content {
|
@@ -2,6 +2,16 @@
|
|
2
2
|
@import 'tao/ui/shared/slide_box';
|
3
3
|
|
4
4
|
.tao-slide-box {
|
5
|
+
.slide-box-content > header,
|
6
|
+
.slide-box-content > .header {
|
7
|
+
text-align: center;
|
8
|
+
font-size: 1rem;
|
9
|
+
color: $text-color;
|
10
|
+
line-height: 3rem;
|
11
|
+
border-bottom: 1px solid $border-color;
|
12
|
+
font-weight: bold;
|
13
|
+
}
|
14
|
+
|
5
15
|
& > .slide-box-wrapper > .link-close {
|
6
16
|
display: none;
|
7
17
|
justify-content: center;
|
@@ -0,0 +1,23 @@
|
|
1
|
+
@import 'tao/ui/globals';
|
2
|
+
|
3
|
+
.tabs {
|
4
|
+
display: flex;
|
5
|
+
align-items: flex-end;
|
6
|
+
|
7
|
+
.tab {
|
8
|
+
padding: 0.5rem 0.5rem 1rem 0.5rem;
|
9
|
+
font-size: 1rem;
|
10
|
+
color: $lightest-grey-color;
|
11
|
+
border-bottom: 3px solid $white-color;
|
12
|
+
margin: 0 1.5rem 0 0;
|
13
|
+
|
14
|
+
&:hover {
|
15
|
+
color: $grey-color;
|
16
|
+
}
|
17
|
+
|
18
|
+
&.active {
|
19
|
+
border-color: $ui-color;
|
20
|
+
color: $grey-color;
|
21
|
+
}
|
22
|
+
}
|
23
|
+
}
|
@@ -1,9 +1,7 @@
|
|
1
1
|
@import 'tao/ui/globals';
|
2
2
|
|
3
|
-
$tree-item-height: 2rem !default;
|
4
|
-
$tree-item-font-size: 0.875rem !default;
|
5
|
-
|
6
3
|
.tao-tree {
|
4
|
+
display: block;
|
7
5
|
|
8
6
|
.tao-tree-item {
|
9
7
|
display: block;
|
@@ -35,12 +33,16 @@ $tree-item-font-size: 0.875rem !default;
|
|
35
33
|
position: absolute;
|
36
34
|
left: 0.625rem;
|
37
35
|
top: 0;
|
38
|
-
right: 0.
|
36
|
+
right: 0.6rem;
|
39
37
|
bottom: 50%;
|
40
38
|
}
|
41
39
|
}
|
42
40
|
}
|
43
41
|
|
42
|
+
&:first-child[depth='0'] > .tao-tree-item-content .tao-tree-item-padding .padding-item:last-child:before {
|
43
|
+
top: 50%;
|
44
|
+
}
|
45
|
+
|
44
46
|
&:last-child > .tao-tree-item-content .tao-tree-item-padding .padding-item:last-child:before {
|
45
47
|
bottom: 50%;
|
46
48
|
}
|
@@ -49,7 +51,6 @@ $tree-item-font-size: 0.875rem !default;
|
|
49
51
|
display: flex;
|
50
52
|
align-items: center;
|
51
53
|
height: $tree-item-height;
|
52
|
-
line-height: $tree-item-height;
|
53
54
|
font-size: $tree-item-font-size;
|
54
55
|
|
55
56
|
.link-toggle-item {
|
@@ -61,9 +62,10 @@ $tree-item-font-size: 0.875rem !default;
|
|
61
62
|
transition: transform 200ms;
|
62
63
|
border: 1px solid $border-color;
|
63
64
|
border-radius: 50%;
|
64
|
-
margin: 0 0.75rem 0
|
65
|
+
margin: 0 0.75rem 0 -2rem;
|
65
66
|
cursor: pointer;
|
66
67
|
visibility: hidden;
|
68
|
+
position: relative;
|
67
69
|
|
68
70
|
.icon {
|
69
71
|
display: block;
|
@@ -111,7 +113,7 @@ $tree-item-font-size: 0.875rem !default;
|
|
111
113
|
}
|
112
114
|
}
|
113
115
|
|
114
|
-
&[expanded] {
|
116
|
+
&[expandable][expanded] {
|
115
117
|
& > .tao-tree-item-content .link-toggle-item {
|
116
118
|
transform: rotate(90deg);
|
117
119
|
}
|
@@ -5,7 +5,7 @@ module Tao
|
|
5
5
|
|
6
6
|
class_option :paths, type: :array, default: ['app/assets/icons', 'lib/assets/icons'], desc: 'Find svg files in specified paths.'
|
7
7
|
|
8
|
-
class_option :remove_color, type: :boolean, default:
|
8
|
+
class_option :remove_color, type: :boolean, default: true, desc: 'Remove all fill attributes in svg.'
|
9
9
|
|
10
10
|
attr_reader :icons_html
|
11
11
|
|
@@ -59,7 +59,7 @@ module TaoUi
|
|
59
59
|
end
|
60
60
|
|
61
61
|
def init_expanded
|
62
|
-
@expandable = !!remote ||
|
62
|
+
@expandable = !!remote || children.try(:any?)
|
63
63
|
html_options[:expandable] = @expandable ? '' : nil
|
64
64
|
|
65
65
|
@expanded = (html_options.delete(:expanded) || false) && expandable && !remote
|
@@ -68,12 +68,8 @@ module TaoUi
|
|
68
68
|
end
|
69
69
|
|
70
70
|
def render_padding(size = depth)
|
71
|
-
|
72
|
-
view.content_tag
|
73
|
-
(view.content_tag('div', nil, class: 'padding-item') * size).html_safe
|
74
|
-
end
|
75
|
-
else
|
76
|
-
''.html_safe
|
71
|
+
view.content_tag 'div', class: 'tao-tree-item-padding' do
|
72
|
+
(view.content_tag('div', nil, class: 'padding-item') * (size + 1)).html_safe
|
77
73
|
end
|
78
74
|
end
|
79
75
|
|
@@ -92,18 +88,16 @@ module TaoUi
|
|
92
88
|
end
|
93
89
|
|
94
90
|
def render_children &block
|
95
|
-
if
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
}, &block
|
106
|
-
end
|
91
|
+
if remote
|
92
|
+
render_children_placeholder
|
93
|
+
else
|
94
|
+
view.tao_tree_list children, {
|
95
|
+
selectable: selectable,
|
96
|
+
depth: depth + 1,
|
97
|
+
remote: options[:remote],
|
98
|
+
expanded: options[:expanded],
|
99
|
+
children_key: @children_key
|
100
|
+
}, &block
|
107
101
|
end
|
108
102
|
end
|
109
103
|
|
@@ -19,19 +19,18 @@ module TaoUi
|
|
19
19
|
|
20
20
|
def render &block
|
21
21
|
view.content_tag 'div', html_options do
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
22
|
+
if items && items.size > 0
|
23
|
+
items.each do |item|
|
24
|
+
view.concat view.tao_tree_item item, {
|
25
|
+
children_key: children_key,
|
26
|
+
selectable: selectable,
|
27
|
+
selected: selected,
|
28
|
+
depth: depth,
|
29
|
+
remote: remote,
|
30
|
+
expanded: expanded
|
31
|
+
}, &block
|
32
|
+
end
|
32
33
|
end
|
33
|
-
|
34
|
-
content
|
35
34
|
end
|
36
35
|
end
|
37
36
|
|
data/lib/tao_ui/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tao_ui
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- farthinker
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-07-
|
11
|
+
date: 2017-07-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tao_on_rails
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.9.
|
19
|
+
version: 0.9.3
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.9.
|
26
|
+
version: 0.9.3
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: autoprefixer-rails
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -86,14 +86,28 @@ dependencies:
|
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: 0.7.
|
89
|
+
version: 0.7.1
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: 0.7.
|
96
|
+
version: 0.7.1
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: selenium-webdriver
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: 3.2.0
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: 3.2.0
|
97
111
|
description: UI library based on tao
|
98
112
|
email:
|
99
113
|
- farthinker@gmail.com
|
@@ -181,9 +195,11 @@ files:
|
|
181
195
|
- lib/assets/stylesheets/tao/ui/slide_box.scss
|
182
196
|
- lib/assets/stylesheets/tao/ui/sortable.scss
|
183
197
|
- lib/assets/stylesheets/tao/ui/tables.scss
|
198
|
+
- lib/assets/stylesheets/tao/ui/tabs.scss
|
184
199
|
- lib/assets/stylesheets/tao/ui/tooltip.scss
|
185
200
|
- lib/assets/stylesheets/tao/ui/tree.scss
|
186
201
|
- lib/assets/stylesheets/tao/ui/variables/_base.scss
|
202
|
+
- lib/assets/stylesheets/tao/ui/variables/_tree.scss
|
187
203
|
- lib/generators/tao/icons/USAGE
|
188
204
|
- lib/generators/tao/icons/icons_generator.rb
|
189
205
|
- lib/generators/tao/icons/templates/icons.coffee.erb
|