material 0.7.4 → 0.7.6

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.
@@ -0,0 +1,72 @@
1
+ .navigation.type-rail
2
+ flex: none
3
+ color: rgba(255, 255, 255, .87)
4
+ display: flex
5
+ overflow: hidden
6
+ flex-direction: column
7
+ width: 12px
8
+ padding-top: 56px
9
+ background-color: #2D2F31
10
+ margin: 0
11
+ transition: .1s linear width
12
+ &.show
13
+ width: 92px
14
+ .body
15
+ opacity: 1
16
+ transition: .1s opacity linear
17
+ .body
18
+ opacity: 0
19
+ flex: 1
20
+ flex-direction: column
21
+ width: 92px
22
+ padding: 0 0
23
+ margin: 0
24
+ transition: .1s opacity linear
25
+ .item
26
+ flex: none
27
+ display: flex
28
+ flex-direction: column
29
+ height: 64px
30
+ margin: 0
31
+ border-radius: 0
32
+ text-align: center
33
+ padding: 10px 0 6px
34
+ font-size: 0.8rem
35
+ text-transform: none
36
+ text-align: center
37
+ align-items: center
38
+ justify-content: center
39
+ &.selected, &.selected:hover
40
+ background-color: transparent
41
+ .icon
42
+ background-color: #004A77
43
+ svg
44
+ fill: #C2E8FF
45
+ .icon
46
+ width: 60px
47
+ pointer-events: none
48
+ padding: 0
49
+ border-radius: 21px
50
+ margin: 0
51
+ height: 32px
52
+ padding: 4px 0
53
+ align-items: center
54
+ justify-content: center
55
+ svg
56
+ fill: rgba(255,255,255,.7)
57
+ .label
58
+ pointer-events: none
59
+ align-items: center
60
+ justify-content: center
61
+ text-align: center
62
+ flex: 1
63
+ color: rgba(255, 255, 255, 1)
64
+ text-transform: capitalize
65
+ font-size: .9em
66
+ text-align: center
67
+ padding: 0
68
+ margin: 0
69
+ &:hover
70
+ background-color: transaprent
71
+ .icon
72
+ background-color: rgba(255,255,255,.05)
@@ -0,0 +1,2 @@
1
+ .view
2
+ pointer-events: none
package/src/switch.js CHANGED
@@ -1,13 +1,11 @@
1
+ // base
1
2
  import EventEmitter from './mixin/emitter'
2
-
3
3
  // module
4
4
  import build from './module/build'
5
5
  import dataset from './module/dataset'
6
6
  import attach from './module/attach'
7
7
  import attributes from './module/attributes'
8
-
9
8
  // ui
10
- import Layout from './layout'
11
9
  import Element from './element'
12
10
 
13
11
  class Switch extends EventEmitter {
@@ -33,6 +31,7 @@ class Switch extends EventEmitter {
33
31
  }
34
32
 
35
33
  constructor (options) {
34
+ // console.log('switch')
36
35
  super()
37
36
 
38
37
  this.init(options)
@@ -51,9 +50,6 @@ class Switch extends EventEmitter {
51
50
  setup () {
52
51
  this.styleAttributes()
53
52
 
54
- this.buildIcon()
55
- this.buildLabel()
56
-
57
53
  if (this.options.data) {
58
54
  dataset(this.element, this.options.data)
59
55
  }
@@ -80,31 +76,6 @@ class Switch extends EventEmitter {
80
76
  }
81
77
  }
82
78
 
83
- buildLabel () {
84
- // console.log('buildLabel', this.options.label)
85
- if (!this.options.label) return
86
-
87
- this.ui.label = document.createElement('label')
88
- this.ui.label.classList.add('label')
89
- this.ui.label.innerHTML = this.options.label
90
-
91
- if (this.options.name) {
92
- this.ui.label.setAttribute('for', this.options.name)
93
- }
94
-
95
- this.element.insertBefore(this.ui.label, this.ui.input)
96
- }
97
-
98
- buildIcon () {
99
- if (!this.options.icon) return
100
-
101
- this.ui.icon = document.createElement('i')
102
- this.ui.icon.classList.add('icon')
103
- this.ui.icon.innerHTML = this.options.icon
104
-
105
- this.element.insertBefore(this.ui.icon, this.ui.input)
106
- }
107
-
108
79
  styleAttributes () {
109
80
  if (this.options.style) {
110
81
  this.element.classList.add('style-' + this.options.style)
@@ -123,12 +94,6 @@ class Switch extends EventEmitter {
123
94
  }
124
95
  }
125
96
 
126
- /**
127
- * Setter
128
- * @param {string} prop
129
- * @param {string} value
130
- * @return {Object} The class instance
131
- */
132
97
  set (prop, value, silent) {
133
98
  switch (prop) {
134
99
  case 'value':
package/src/text.js CHANGED
@@ -43,6 +43,14 @@ class Text {
43
43
  setText (text) {
44
44
  this.element.innerHTML = text
45
45
  }
46
+
47
+ get () {
48
+ if (this.element.innerHTML) {
49
+ return this.element.innerHTML
50
+ } else {
51
+ return ''
52
+ }
53
+ }
46
54
  }
47
55
 
48
56
  export default Text
package/src/view.js CHANGED
@@ -1,5 +1,4 @@
1
1
  import EventEmitter from './mixin/emitter'
2
-
3
2
  import build from './module/build'
4
3
 
5
4
  class View extends EventEmitter {
@@ -16,7 +15,7 @@ class View extends EventEmitter {
16
15
  }
17
16
 
18
17
  init (options) {
19
- this.options = Object.assign({}, defaults, options || {})
18
+ this.options = Object.assign({}, View.defaults, options || {})
20
19
  Object.assign(this, build)
21
20
  }
22
21
  }