material 0.6.2 → 0.7.0

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.
Files changed (82) hide show
  1. package/index.js +11 -2
  2. package/package.json +1 -1
  3. package/src/appbar.js +28 -28
  4. package/src/banner.js +20 -20
  5. package/src/button.js +18 -19
  6. package/src/calendar.js +8 -8
  7. package/src/card.js +4 -4
  8. package/src/checkbox.js +8 -8
  9. package/src/component.js +4 -4
  10. package/src/container.js +4 -4
  11. package/src/control/button.js +64 -92
  12. package/src/control/button.new.js +25 -25
  13. package/src/control/datehour.js +4 -4
  14. package/src/control/dialog.js +10 -10
  15. package/src/control/file.js +8 -8
  16. package/src/control/image.js +6 -6
  17. package/src/control/link.js +9 -9
  18. package/src/control/list.js +3 -3
  19. package/src/control/loading.js +10 -10
  20. package/src/control/menu.js +2 -2
  21. package/src/control/search.js +9 -9
  22. package/src/control/select.js +6 -6
  23. package/src/control/selecter.js +15 -15
  24. package/src/control/snackbar.js +7 -5
  25. package/src/control/switch.js +18 -18
  26. package/src/control/switcher.js +16 -16
  27. package/src/control/text.js +8 -8
  28. package/src/control/textfield.js +12 -12
  29. package/src/dialog.js +19 -19
  30. package/src/divider.js +4 -4
  31. package/src/drawer.js +11 -11
  32. package/src/field/email.js +5 -5
  33. package/src/field/image.js +4 -4
  34. package/src/form/build.js +7 -7
  35. package/src/form.js +6 -6
  36. package/src/icon.js +8 -8
  37. package/src/image.js +14 -14
  38. package/src/item.js +7 -7
  39. package/src/layout.js +10 -10
  40. package/src/list/add.js +1 -1
  41. package/src/list/build.js +7 -7
  42. package/src/list/display.js +10 -10
  43. package/src/list/search.js +2 -2
  44. package/src/list.js +13 -13
  45. package/src/map/build.js +6 -6
  46. package/src/map/display.js +8 -8
  47. package/src/menu.js +15 -15
  48. package/src/{component → mixin}/control.js +10 -10
  49. package/src/{component → mixin}/create.js +1 -1
  50. package/src/{module → mixin}/display.js +10 -22
  51. package/src/{component → mixin}/events.js +2 -2
  52. package/src/{component → mixin}/focus.js +2 -3
  53. package/src/{component → mixin}/insert.js +1 -1
  54. package/src/module/build.js +4 -3
  55. package/src/{component → module}/classify.js +0 -13
  56. package/src/module/dom.js +1 -57
  57. package/src/module/events.js +4 -2
  58. package/src/module/last.js +0 -0
  59. package/src/{component → module}/ripple.js +15 -42
  60. package/src/progress.js +7 -7
  61. package/src/select.js +16 -16
  62. package/src/selector.js +32 -32
  63. package/src/slider.js +32 -32
  64. package/src/snackbar.js +8 -8
  65. package/src/switch.js +9 -9
  66. package/src/tabs.js +8 -8
  67. package/src/tabview.js +8 -8
  68. package/src/text.js +5 -5
  69. package/src/textfield.js +16 -16
  70. package/src/toolbar.js +28 -28
  71. package/src/tooltip.js +11 -11
  72. package/src/tree.js +12 -16
  73. package/src/view/build.js +6 -6
  74. package/src/view/display.js +16 -16
  75. package/src/view.js +5 -5
  76. package/src/component/click.js +0 -17
  77. /package/src/{component → mixin}/controller.js +0 -0
  78. /package/src/{component → mixin}/emitter.js +0 -0
  79. /package/src/{component → mixin}/icon.js +0 -0
  80. /package/src/{component → mixin}/init.js +0 -0
  81. /package/src/{component → mixin}/label.js +0 -0
  82. /package/src/{component → mixin}/settings.js +0 -0
@@ -49,10 +49,10 @@ class List {
49
49
 
50
50
  var label = this.options.label || ''
51
51
 
52
- this.root.innerHTML = label + text
52
+ this.element.innerHTML = label + text
53
53
 
54
54
  if (this.options.spaceAfter) {
55
- this.root.innerHTML = this.root.innerHTML + ' '
55
+ this.element.innerHTML = this.element.innerHTML + ' '
56
56
  }
57
57
  }
58
58
 
@@ -60,7 +60,7 @@ class List {
60
60
 
61
61
  setText (text) {
62
62
  // console.log('setText', text)
63
- this.root.innerHTML = text
63
+ this.element.innerHTML = text
64
64
  }
65
65
  }
66
66
 
@@ -62,16 +62,16 @@ class Loading {
62
62
  * @return {Object} This class instance
63
63
  */
64
64
  build (options) {
65
- this.root = document.createElement(this.options.tag)
65
+ this.element = document.createElement(this.options.tag)
66
66
  this.classify()
67
67
 
68
68
  if (this.options.type === 'circular') {
69
- this.root.innerHTML = this.options.circular
69
+ this.element.innerHTML = this.options.circular
70
70
  } if (this.options.type === 'indeterminate') {
71
71
  this.bar = document.createElement(this.options.tag)
72
72
  this.bar.classList.add('bar')
73
- this.root.classList.add('type-indeterminate')
74
- this.root.appendChild(this.bar)
73
+ this.element.classList.add('type-indeterminate')
74
+ this.element.appendChild(this.bar)
75
75
  }
76
76
 
77
77
  return this
@@ -79,16 +79,16 @@ class Loading {
79
79
 
80
80
  classify () {
81
81
  if (this.options.class !== 'loading') {
82
- this.root.setAttribute('class', this.options.class + ' ' + this.options.class)
82
+ this.element.setAttribute('class', this.options.class + ' ' + this.options.class)
83
83
  } else {
84
- this.root.classList.add(this.options.class)
84
+ this.element.classList.add(this.options.class)
85
85
  }
86
86
  }
87
87
 
88
88
  append (container) {
89
89
  container = container || this.options.container
90
90
  if (this.options.container) {
91
- container.appendChild(this.root)
91
+ container.appendChild(this.element)
92
92
  }
93
93
  }
94
94
 
@@ -101,7 +101,7 @@ class Loading {
101
101
 
102
102
  clearTimeout(this.showTimeout)
103
103
  this.showTimeout = setTimeout(() => {
104
- this.root.classList.add('show')
104
+ this.element.classList.add('show')
105
105
  }, this.options.delay)
106
106
 
107
107
  this.visible = true
@@ -110,7 +110,7 @@ class Loading {
110
110
  }
111
111
 
112
112
  showNow () {
113
- this.root.classList.add('show')
113
+ this.element.classList.add('show')
114
114
 
115
115
  this.visible
116
116
 
@@ -119,7 +119,7 @@ class Loading {
119
119
 
120
120
  hide () {
121
121
  clearTimeout(this.showTimeout)
122
- this.root.classList.remove('show')
122
+ this.element.classList.remove('show')
123
123
  this.visible = false
124
124
  return this
125
125
  }
@@ -1,8 +1,8 @@
1
- import EventEmitter from '../component/emitter'
1
+ import EventEmitter from '../mixin/emitter'
2
2
  // menu related modules
3
3
  import build from '../module/build'
4
4
  import bindEvents from '../module/events'
5
- import display from '../module/display'
5
+ import display from '../mixin/display'
6
6
 
7
7
  import Element from '../element'
8
8
  import Button from './button'
@@ -40,32 +40,32 @@ class Search {
40
40
  * @return {Object} This class instance
41
41
  */
42
42
  build () {
43
- this.root = document.createElement('div')
44
- this.root.classList.add('search')
43
+ this.element = document.createElement('div')
44
+ this.element.classList.add('search')
45
45
 
46
46
  if (this.options.class !== 'search') {
47
- this.root.classList.add(this.options.class)
47
+ this.element.classList.add(this.options.class)
48
48
  }
49
49
 
50
50
  if (this.options.icon) {
51
51
  this.icon = document.createElement('i')
52
52
  this.icon.classList.add('icon')
53
53
  this.icon.innerHTML = this.options.icon
54
- this.root.appendChild(this.icon)
54
+ this.element.appendChild(this.icon)
55
55
  }
56
56
 
57
57
  this.input = document.createElement('input')
58
58
  this.input.classList.add('input')
59
- this.root.appendChild(this.input)
59
+ this.element.appendChild(this.input)
60
60
 
61
61
  this.cancel = new Button({
62
- container: this.root,
62
+ container: this.element,
63
63
  class: 'clear',
64
64
  icon: this.options.iconCancel
65
65
  })
66
66
 
67
67
  if (this.options.container) {
68
- this.options.container.appendChild(this.root)
68
+ this.options.container.appendChild(this.element)
69
69
  }
70
70
 
71
71
  return this
@@ -90,8 +90,8 @@ class Search {
90
90
  }
91
91
 
92
92
  set (email) {
93
- this.root.innerHTML = email
94
- this.root.setAttribute('href', 'mailto:' + email)
93
+ this.element.innerHTML = email
94
+ this.element.setAttribute('href', 'mailto:' + email)
95
95
  }
96
96
  }
97
97
 
@@ -32,18 +32,18 @@ class Select {
32
32
  */
33
33
  build () {
34
34
  var tag = this.options.tag || 'span'
35
- this.root = document.createElement(tag)
36
- this.root.classList.add('select')
35
+ this.element = document.createElement(tag)
36
+ this.element.classList.add('select')
37
37
 
38
38
  if (this.options.class !== 'select') {
39
- this.root.classList.add(this.options.class)
39
+ this.element.classList.add(this.options.class)
40
40
  }
41
41
 
42
42
  this.buildLabel()
43
43
  this.buildInput()
44
44
 
45
45
  if (this.container) {
46
- this.container.appendChild(this.root)
46
+ this.container.appendChild(this.element)
47
47
  }
48
48
 
49
49
  return this
@@ -54,14 +54,14 @@ class Select {
54
54
  this.label = document.createElement('span')
55
55
  this.label.classList.add('label')
56
56
  this.label.innerHTML = this.options.label
57
- this.root.appendChild(this.label)
57
+ this.element.appendChild(this.label)
58
58
  }
59
59
  }
60
60
 
61
61
  buildInput () {
62
62
  this.input = document.createElement('select')
63
63
  this.input.classList.add('input')
64
- this.root.appendChild(this.input)
64
+ this.element.appendChild(this.input)
65
65
 
66
66
  this.input.addEventListener('change', () => {
67
67
  // console.log('change', this.input[this.input.selectedIndex].value)
@@ -51,7 +51,7 @@ class Selecter {
51
51
 
52
52
  setup () {
53
53
  if (this.options.data) {
54
- dataset(this.root, this.options.data)
54
+ dataset(this.element, this.options.data)
55
55
  }
56
56
 
57
57
  // console.log('attribute', this.ui.input, this.options)
@@ -62,7 +62,7 @@ class Selecter {
62
62
  }
63
63
 
64
64
  if (this.options.tooltip) {
65
- this.root.setAttribute('data-tooltip', this.options.tooltip)
65
+ this.element.setAttribute('data-tooltip', this.options.tooltip)
66
66
  }
67
67
 
68
68
  if (this.options.label) {
@@ -72,7 +72,7 @@ class Selecter {
72
72
  this.ui.input.setAttribute('aria-label', this.options.name)
73
73
 
74
74
  if (this.options.case) {
75
- this.root.classList.add(this.options.case + '-case')
75
+ this.element.classList.add(this.options.case + '-case')
76
76
  }
77
77
  }
78
78
  /**
@@ -81,14 +81,14 @@ class Selecter {
81
81
  */
82
82
  build () {
83
83
  var tag = this.options.tag || 'span'
84
- this.root = document.createElement(tag)
85
- this.root.classList.add('selecter')
84
+ this.element = document.createElement(tag)
85
+ this.element.classList.add('selecter')
86
86
 
87
87
  if (this.options.class !== 'selecter') {
88
- addClass(this.root, this.options.class)
88
+ addClass(this.element, this.options.class)
89
89
  }
90
90
 
91
- this.layout = new Layout(this.options.layout, this.root)
91
+ this.layout = new Layout(this.options.layout, this.element)
92
92
  this.ui = this.layout.component
93
93
 
94
94
  // console.log('ui', this.ui)
@@ -99,7 +99,7 @@ class Selecter {
99
99
  this.setList(this.options.list)
100
100
 
101
101
  if (this.options.container) {
102
- this.options.container.appendChild(this.root)
102
+ this.options.container.appendChild(this.element)
103
103
  }
104
104
  }
105
105
 
@@ -110,13 +110,13 @@ class Selecter {
110
110
  this.ui.icon.classList.add('icon')
111
111
  this.ui.icon.innerHTML = this.options.icon
112
112
 
113
- this.root.insertBefore(this.ui.icon, this.ui.input)
113
+ this.element.insertBefore(this.ui.icon, this.ui.input)
114
114
  }
115
115
 
116
116
  buildInput () {
117
117
  this.input = document.createElement('select')
118
118
  this.input.classList.add('input')
119
- this.root.appendChild(this.input)
119
+ this.element.appendChild(this.input)
120
120
 
121
121
  this.input.addEventListener('change', () => {
122
122
  // console.log('change', this.input[this.input.selectedIndex].value)
@@ -154,19 +154,19 @@ class Selecter {
154
154
 
155
155
  styleAttributes () {
156
156
  if (this.options.style) {
157
- this.root.classList.add('style-' + this.options.style)
157
+ this.element.classList.add('style-' + this.options.style)
158
158
  }
159
159
 
160
160
  if (this.options.size) {
161
- this.root.classList.add(this.options.size + '-size')
161
+ this.element.classList.add(this.options.size + '-size')
162
162
  }
163
163
 
164
164
  if (this.options.color) {
165
- this.root.classList.add('color-' + this.options.color)
165
+ this.element.classList.add('color-' + this.options.color)
166
166
  }
167
167
 
168
168
  if (this.options.bold) {
169
- this.root.classList.add('bold')
169
+ this.element.classList.add('bold')
170
170
  }
171
171
  }
172
172
  showList () {
@@ -216,7 +216,7 @@ class Selecter {
216
216
  this.ui.value.innerHTML = this.values[value]
217
217
  }
218
218
 
219
- this.selected = this.root.querySelector('[data-value=' + value + ']')
219
+ this.selected = this.element.querySelector('[data-value=' + value + ']')
220
220
 
221
221
  // console.log('item', this.selected)
222
222
  if (this.selected) {
@@ -1,9 +1,9 @@
1
1
  // base class
2
- import EventEmitter from '../component/emitter'
2
+ import EventEmitter from '../mixin/emitter'
3
3
  // related modules
4
4
  import build from '../module/build'
5
5
  import bindEvents from '../module/events'
6
- import display from '../module/display'
6
+ import display from '../mixin/display'
7
7
  // ui element
8
8
  import Text from './text'
9
9
  import Button from './button'
@@ -27,7 +27,7 @@ class Snackbar extends EventEmitter {
27
27
 
28
28
  constructor (options) {
29
29
  super()
30
-
30
+
31
31
  this.init(options)
32
32
  this.build(this.constructor)
33
33
  this.render()
@@ -48,11 +48,11 @@ class Snackbar extends EventEmitter {
48
48
  }
49
49
 
50
50
  buildSnackbarContainer (container = document.body) {
51
- console.log('buildSnackbarContainer', container)
51
+ // console.log('buildSnackbarContainer', container)
52
52
 
53
53
  let snackbarContainer = container.querySelector('.snackbars')
54
54
 
55
- console.log('snackbarContainer', snackbarContainer)
55
+ // console.log('snackbarContainer', snackbarContainer)
56
56
 
57
57
  if (!snackbarContainer) {
58
58
  this.options.container = document.createElement('div')
@@ -65,6 +65,7 @@ class Snackbar extends EventEmitter {
65
65
 
66
66
  render () {
67
67
  this.ui.text.set(this.options.text)
68
+
68
69
  if (this.options.action) {
69
70
  this.ui.action.set(this.options.action)
70
71
  this.ui.action.element.classList.add('show')
@@ -76,6 +77,7 @@ class Snackbar extends EventEmitter {
76
77
  }
77
78
 
78
79
  action () {
80
+ // console.log('action')
79
81
  this.emit('action')
80
82
  this.destroy()
81
83
  }
@@ -50,14 +50,14 @@ class Switch {
50
50
  */
51
51
  build () {
52
52
  var tag = this.options.tag || 'span'
53
- this.root = document.createElement(tag)
54
- this.root.classList.add('switch')
53
+ this.element = document.createElement(tag)
54
+ this.element.classList.add('switch')
55
55
 
56
56
  if (this.options.class !== 'switch') {
57
- addClass(this.root, this.options.class)
57
+ addClass(this.element, this.options.class)
58
58
  }
59
59
 
60
- this.layout = new Layout(this.options.layout, this.root)
60
+ this.layout = new Layout(this.options.layout, this.element)
61
61
  this.ui = this.layout.component
62
62
 
63
63
  // console.log('ui', this.ui)
@@ -68,13 +68,13 @@ class Switch {
68
68
  this.buildLabel()
69
69
 
70
70
  if (this.options.container) {
71
- this.options.container.appendChild(this.root)
71
+ this.options.container.appendChild(this.element)
72
72
  }
73
73
  }
74
74
 
75
75
  setup () {
76
76
  if (this.options.data) {
77
- dataset(this.root, this.options.data)
77
+ dataset(this.element, this.options.data)
78
78
  }
79
79
 
80
80
  // console.log('attribute', this.ui.input, this.options)
@@ -89,13 +89,13 @@ class Switch {
89
89
  }
90
90
 
91
91
  if (this.options.tooltip) {
92
- this.root.setAttribute('data-tooltip', this.options.tooltip)
92
+ this.element.setAttribute('data-tooltip', this.options.tooltip)
93
93
  }
94
94
 
95
95
  this.ui.input.setAttribute('aria-label', this.options.name)
96
96
 
97
97
  if (this.options.case) {
98
- this.root.classList.add(this.options.case + '-case')
98
+ this.element.classList.add(this.options.case + '-case')
99
99
  }
100
100
  }
101
101
 
@@ -111,7 +111,7 @@ class Switch {
111
111
  this.ui.label.setAttribute('for', this.options.name)
112
112
  }
113
113
 
114
- this.root.insertBefore(this.ui.label, this.ui.input)
114
+ this.element.insertBefore(this.ui.label, this.ui.input)
115
115
  }
116
116
 
117
117
  buildIcon () {
@@ -121,24 +121,24 @@ class Switch {
121
121
  this.ui.icon.classList.add('icon')
122
122
  this.ui.icon.innerHTML = this.options.icon
123
123
 
124
- this.root.insertBefore(this.ui.icon, this.ui.input)
124
+ this.element.insertBefore(this.ui.icon, this.ui.input)
125
125
  }
126
126
 
127
127
  styleAttributes () {
128
128
  if (this.options.style) {
129
- this.root.classList.add('style-' + this.options.style)
129
+ this.element.classList.add('style-' + this.options.style)
130
130
  }
131
131
 
132
132
  if (this.options.size) {
133
- this.root.classList.add(this.options.size + '-size')
133
+ this.element.classList.add(this.options.size + '-size')
134
134
  }
135
135
 
136
136
  if (this.options.color) {
137
- this.root.classList.add('color-' + this.options.color)
137
+ this.element.classList.add('color-' + this.options.color)
138
138
  }
139
139
 
140
140
  if (this.options.bold) {
141
- this.root.classList.add('bold')
141
+ this.element.classList.add('bold')
142
142
  }
143
143
  }
144
144
 
@@ -228,7 +228,7 @@ class Switch {
228
228
  check (checked, silent) {
229
229
  // console.log('check', checked, silent)
230
230
  if (checked === true) {
231
- this.root.classList.add('is-checked')
231
+ this.element.classList.add('is-checked')
232
232
  this.ui.input.checked = true
233
233
  this.checked = true
234
234
  this.value = true
@@ -236,7 +236,7 @@ class Switch {
236
236
  this.emit('change', this.checked)
237
237
  }
238
238
  } else {
239
- this.root.classList.remove('is-checked')
239
+ this.element.classList.remove('is-checked')
240
240
  this.ui.input.checked = false
241
241
  this.checked = false
242
242
  this.value = false
@@ -254,7 +254,7 @@ class Switch {
254
254
  focus () {
255
255
  if (this.disabled === true) return this
256
256
 
257
- this.root.classList.add('is-focused')
257
+ this.element.classList.add('is-focused')
258
258
  if (this.ui.input !== document.activeElement) { this.ui.input.focus() }
259
259
  return this
260
260
  }
@@ -264,7 +264,7 @@ class Switch {
264
264
  * @return {?} [description]
265
265
  */
266
266
  blur () {
267
- this.root.classList.remove('is-focused')
267
+ this.element.classList.remove('is-focused')
268
268
  return this
269
269
  }
270
270
  }
@@ -30,26 +30,26 @@ class Switcher {
30
30
  }
31
31
 
32
32
  build () {
33
- this.root = document.createElement(this.options.tag)
33
+ this.element = document.createElement(this.options.tag)
34
34
 
35
35
  if (this.options.class !== 'button') {
36
- this.root.setAttribute('class', 'switcher ' + this.options.class)
36
+ this.element.setAttribute('class', 'switcher ' + this.options.class)
37
37
  } else {
38
- this.root.classList.add('switcher')
38
+ this.element.classList.add('switcher')
39
39
  }
40
40
 
41
41
  if (this.options.label) {
42
42
  this.label = document.createElement('label')
43
43
  this.label.innerHTML = this.options.label
44
- this.root.appendChild(this.label)
44
+ this.element.appendChild(this.label)
45
45
  }
46
46
 
47
47
  this.knob = document.createElement('span')
48
48
  this.knob.classList.add('knob')
49
- this.root.appendChild(this.knob)
49
+ this.element.appendChild(this.knob)
50
50
 
51
51
  if (this.options.size) {
52
- this.root.classList.add(this.options.size + '-size')
52
+ this.element.classList.add(this.options.size + '-size')
53
53
  }
54
54
 
55
55
  this.buildList(this.options.list)
@@ -59,17 +59,17 @@ class Switcher {
59
59
  }
60
60
 
61
61
  if (this.options.container) {
62
- this.options.container.appendChild(this.root)
62
+ this.options.container.appendChild(this.element)
63
63
  }
64
64
  }
65
65
 
66
66
  buildList (list) {
67
67
  this.list = document.createElement('ul')
68
- this.root.appendChild(this.list)
68
+ this.element.appendChild(this.list)
69
69
  }
70
70
 
71
71
  attach () {
72
- this.root.addEventListener('click', (event) => {
72
+ this.element.addEventListener('click', (event) => {
73
73
  if (!event.target.dataset.switcher) return
74
74
  this.select(event.target)
75
75
  })
@@ -97,7 +97,7 @@ class Switcher {
97
97
 
98
98
  selectByName (name) {
99
99
  // console.log('selectByName', name)
100
- var item = this.root.querySelector('[data-switcher="' + name + '"]')
100
+ var item = this.element.querySelector('[data-switcher="' + name + '"]')
101
101
  // console.log('item', item)
102
102
  if (item) {
103
103
  this.select(item)
@@ -106,7 +106,7 @@ class Switcher {
106
106
 
107
107
  preSelectByName (name) {
108
108
  // console.log('selectByName', name)
109
- var item = this.root.querySelector('[data-switcher="' + name + '"]')
109
+ var item = this.element.querySelector('[data-switcher="' + name + '"]')
110
110
  // console.log('item', item)
111
111
  this.preselect(item)
112
112
  }
@@ -165,24 +165,24 @@ class Switcher {
165
165
  }
166
166
 
167
167
  setValue (value) {
168
- // console.log('value', value, this.options.list, this.root)
168
+ // console.log('value', value, this.options.list, this.element)
169
169
  var list = this.options.list
170
170
  if (this.options.mode === 'unique') {
171
171
  for (var i = 0; i < list.length; i++) {
172
- this.root.querySelector('[data-switcher="' + list[i] + '"]').classList.remove('selected')
172
+ this.element.querySelector('[data-switcher="' + list[i] + '"]').classList.remove('selected')
173
173
  if (list[i] == value) {
174
174
  this.selected = [value]
175
- this.root.querySelector('[data-switcher="' + list[i] + '"]').classList.add('selected')
175
+ this.element.querySelector('[data-switcher="' + list[i] + '"]').classList.add('selected')
176
176
  }
177
177
  }
178
178
  } else {
179
179
  value = value || []
180
180
  this.selected = []
181
181
  for (var i = 0; i < list.length; i++) {
182
- this.root.querySelector('[data-switcher="' + list[i] + '"]').classList.remove('selected')
182
+ this.element.querySelector('[data-switcher="' + list[i] + '"]').classList.remove('selected')
183
183
  if (value.indexOf(list[i]) !== -1) {
184
184
  this.selected.push(list[i])
185
- this.root.querySelector('[data-switcher="' + list[i] + '"]').classList.add('selected')
185
+ this.element.querySelector('[data-switcher="' + list[i] + '"]').classList.add('selected')
186
186
  }
187
187
  }
188
188
  }
@@ -26,11 +26,11 @@ class Text {
26
26
  * @return {Object} This class instance
27
27
  */
28
28
  build () {
29
- this.root = document.createElement(this.options.tag)
30
- addClass(this.root, this.options.class)
29
+ this.element = document.createElement(this.options.tag)
30
+ addClass(this.element, this.options.class)
31
31
 
32
32
  if (this.options.class !== 'text') {
33
- this.root.classList.add('text')
33
+ this.element.classList.add('text')
34
34
  }
35
35
 
36
36
  if (this.options.text) {
@@ -38,7 +38,7 @@ class Text {
38
38
  }
39
39
 
40
40
  if (this.options.container) {
41
- this.options.container.appendChild(this.root)
41
+ this.options.container.appendChild(this.element)
42
42
  }
43
43
 
44
44
  return this
@@ -51,19 +51,19 @@ class Text {
51
51
  var label = this.options.label || ''
52
52
 
53
53
  if (this.options.textFirst) {
54
- this.root.innerHTML = text + label
54
+ this.element.innerHTML = text + label
55
55
  } else {
56
- this.root.innerHTML = label + text
56
+ this.element.innerHTML = label + text
57
57
  }
58
58
 
59
59
  if (this.options.spaceAfter) {
60
- this.root.innerHTML = this.root.innerHTML + ' '
60
+ this.element.innerHTML = this.element.innerHTML + ' '
61
61
  }
62
62
  }
63
63
 
64
64
  setText (text) {
65
65
  // console.log('setText', text)
66
- this.root.innerHTML = text
66
+ this.element.innerHTML = text
67
67
  }
68
68
  }
69
69