material 0.6.1 → 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 (87) 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 -88
  12. package/src/control/button.new.js +25 -25
  13. package/src/control/datehour.js +4 -4
  14. package/src/control/dialog.js +12 -11
  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 +25 -35
  19. package/src/control/loading.js +10 -10
  20. package/src/control/menu.js +85 -0
  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 +91 -0
  25. package/src/control/switch.js +18 -18
  26. package/src/control/switcher.js +16 -16
  27. package/src/control/text.js +11 -7
  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/element.js +6 -31
  33. package/src/field/email.js +5 -5
  34. package/src/field/image.js +4 -4
  35. package/src/form/build.js +7 -7
  36. package/src/form.js +6 -6
  37. package/src/icon.js +8 -8
  38. package/src/image.js +14 -14
  39. package/src/item.js +7 -7
  40. package/src/layout.js +10 -10
  41. package/src/list/add.js +1 -1
  42. package/src/list/build.js +7 -7
  43. package/src/list/display.js +10 -10
  44. package/src/list/search.js +2 -2
  45. package/src/list.js +13 -13
  46. package/src/map/build.js +6 -6
  47. package/src/map/display.js +8 -8
  48. package/src/menu.js +15 -15
  49. package/src/{component → mixin}/control.js +10 -10
  50. package/src/{component → mixin}/create.js +1 -1
  51. package/src/mixin/display.js +76 -0
  52. package/src/mixin/emitter.js +23 -0
  53. package/src/{component → mixin}/events.js +2 -2
  54. package/src/{component → mixin}/focus.js +2 -3
  55. package/src/{component → mixin}/insert.js +1 -1
  56. package/src/module/build.js +44 -0
  57. package/src/{component → module}/classify.js +0 -13
  58. package/src/module/dataset.js +12 -0
  59. package/src/module/dom.js +1 -57
  60. package/src/module/events.js +57 -0
  61. package/src/module/jsontohtml.js +20 -0
  62. package/src/module/last.js +0 -0
  63. package/src/{component → module}/ripple.js +15 -42
  64. package/src/progress.js +7 -7
  65. package/src/select.js +16 -16
  66. package/src/selector.js +32 -32
  67. package/src/skin/material/control/menu.sass +29 -0
  68. package/src/skin/material/control/snackbar.sass +65 -0
  69. package/src/slider.js +32 -32
  70. package/src/snackbar.js +8 -8
  71. package/src/switch.js +9 -9
  72. package/src/tabs.js +8 -8
  73. package/src/tabview.js +8 -8
  74. package/src/text.js +5 -5
  75. package/src/textfield.js +16 -16
  76. package/src/toolbar.js +28 -28
  77. package/src/tooltip.js +11 -11
  78. package/src/tree.js +12 -16
  79. package/src/view/build.js +7 -7
  80. package/src/view/display.js +16 -16
  81. package/src/view.js +5 -5
  82. package/src/component/click.js +0 -17
  83. /package/src/{component → mixin}/controller.js +0 -0
  84. /package/src/{component → mixin}/icon.js +0 -0
  85. /package/src/{component → mixin}/init.js +0 -0
  86. /package/src/{component → mixin}/label.js +0 -0
  87. /package/src/{component → mixin}/settings.js +0 -0
package/src/image.js CHANGED
@@ -1,9 +1,9 @@
1
1
  'use strict'
2
2
 
3
- // import insert from './component/insert'
3
+ // import insert from './mixin/insert'
4
4
  import css from './module/css'
5
5
  import insert from './element/insert'
6
- import control from './component/control'
6
+ import control from './mixin/control'
7
7
 
8
8
  var defaults = {
9
9
  prefix: 'material',
@@ -50,22 +50,22 @@ class Image {
50
50
 
51
51
  var tag = options.tag || 'div'
52
52
  var text = options.text || options.label
53
- this.root = document.createElement(tag)
53
+ this.element = document.createElement(tag)
54
54
 
55
55
  // if (options.src) {
56
- // this.root.setAttribute('style', 'background-image: url(' + options.src + ')')
56
+ // this.element.setAttribute('style', 'background-image: url(' + options.src + ')')
57
57
 
58
58
  if (options.src) {
59
59
  this.image = document.createElement('img')
60
60
  this.image.setAttribute('src', options.src)
61
61
  css.add(this.image, this.options.class + '-image')
62
- insert(this.image, this.root)
62
+ insert(this.image, this.element)
63
63
  }
64
64
 
65
65
  this.info = document.createElement('span')
66
66
  css.add(this.info, this.options.class + '-info')
67
67
 
68
- insert(this.info, this.root)
68
+ insert(this.info, this.element)
69
69
 
70
70
  this.label(text, this.info)
71
71
 
@@ -77,13 +77,13 @@ class Image {
77
77
  // this.label = document.createElement('span')
78
78
  // this.label.innerText = text
79
79
  // css.add(this.label, this.options.class + '-label')
80
- // insert(this.label, this.root)
80
+ // insert(this.label, this.element)
81
81
  // }
82
82
 
83
- css.add(this.root, this.options.prefix + '-' + this.options.class)
83
+ css.add(this.element, this.options.prefix + '-' + this.options.class)
84
84
 
85
- if (options.css) { css.add(this.root, options.css) }
86
- // css.add(this.root, this.options.class + '-adjust');
85
+ if (options.css) { css.add(this.element, options.css) }
86
+ // css.add(this.element, this.options.class + '-adjust');
87
87
 
88
88
  if (this.options.container) {
89
89
  this.insert(this.options.container)
@@ -97,7 +97,7 @@ class Image {
97
97
  * @return {?} [description]
98
98
  */
99
99
  insert (container, context) {
100
- insert(this.root, container, context)
100
+ insert(this.element, container, context)
101
101
 
102
102
  return this
103
103
  }
@@ -109,10 +109,10 @@ class Image {
109
109
  */
110
110
  set (value) {
111
111
  if (value) {
112
- if (this.root.innerText) {
113
- this.root.innerText = value
112
+ if (this.element.innerText) {
113
+ this.element.innerText = value
114
114
  } else {
115
- this.root.textContent = value
115
+ this.element.textContent = value
116
116
  }
117
117
 
118
118
  return this
package/src/item.js CHANGED
@@ -2,8 +2,8 @@
2
2
 
3
3
  import Layout from './layout'
4
4
 
5
- import create from './component/create'
6
- import insert from './component/insert'
5
+ import create from './mixin/create'
6
+ import insert from './mixin/insert'
7
7
 
8
8
  var defaults = {
9
9
  prefix: 'material',
@@ -70,14 +70,14 @@ class Item {
70
70
 
71
71
  this.options.tag = this.options.tag
72
72
 
73
- this.root = create(this.options)
73
+ this.element = create(this.options)
74
74
 
75
75
  if (this.options.text) {
76
76
  this.set(this.options.text)
77
77
  }
78
78
 
79
79
  if (this.options.layout) {
80
- this.layout = new Layout(this.options.layout, this.root)
80
+ this.layout = new Layout(this.options.layout, this.element)
81
81
  } else {
82
82
  if (this.options.container) {
83
83
  this.insert(this.options.container)
@@ -92,10 +92,10 @@ class Item {
92
92
  */
93
93
  set (value) {
94
94
  if (value) {
95
- if (this.root.innerText) {
96
- this.root.innerText = value
95
+ if (this.element.innerText) {
96
+ this.element.innerText = value
97
97
  } else {
98
- this.root.textContent = value
98
+ this.element.textContent = value
99
99
  }
100
100
 
101
101
  return this
package/src/layout.js CHANGED
@@ -37,10 +37,10 @@ class Layout {
37
37
  }
38
38
 
39
39
  component = new schema[i](options)
40
- var element = component.root || component
40
+ var element = component.element || component
41
41
 
42
42
  if (level === 1) {
43
- structure.root = element
43
+ structure.element = element
44
44
  }
45
45
 
46
46
  if (name) {
@@ -57,7 +57,7 @@ class Layout {
57
57
  if (component.insert) {
58
58
  component.insert(container)
59
59
  } else {
60
- var wrapper = container.root || container
60
+ var wrapper = container.element || container
61
61
 
62
62
  wrapper.appendChild(element)
63
63
 
@@ -98,30 +98,30 @@ class Layout {
98
98
  // console.log('component', component);
99
99
 
100
100
  if (options.flex) {
101
- css.add(component.root, 'flex-' + options.flex)
101
+ css.add(component.element, 'flex-' + options.flex)
102
102
  } else {
103
103
  var size = options.size
104
104
  if (options.size && options.width) {
105
- component.root.width = size + 'px'
105
+ component.element.width = size + 'px'
106
106
  } else if (options.size && options.height) {
107
- component.root.height = size + 'px'
107
+ component.element.height = size + 'px'
108
108
  }
109
109
  }
110
110
 
111
111
  if (options.position) {
112
- component.root.position = options.position
112
+ component.element.position = options.position
113
113
  }
114
114
 
115
115
  if (options.bottom) {
116
- component.root.bottom = options.bottom
116
+ component.element.bottom = options.bottom
117
117
  }
118
118
 
119
119
  if (options.hide) {
120
- component.root.display = 'none'
120
+ component.element.display = 'none'
121
121
  }
122
122
 
123
123
  if (options.theme) {
124
- css.add(component.root, 'theme' + '-' + options.theme)
124
+ css.add(component.element, 'theme' + '-' + options.theme)
125
125
  }
126
126
  }
127
127
 
package/src/list/add.js CHANGED
@@ -24,7 +24,7 @@ export default {
24
24
  this.dataStore[info[this.dataId]] = info
25
25
  // console.log('data', this.data.length, this.data)
26
26
 
27
- if (window.getComputedStyle(this.root, null).display === 'none') {
27
+ if (window.getComputedStyle(this.element, null).display === 'none') {
28
28
  this.virtual.items = this.data
29
29
  } else {
30
30
  this.virtual.update(this.data)
package/src/list/build.js CHANGED
@@ -11,14 +11,14 @@ export default {
11
11
 
12
12
  this.dataId = this.options.dataId || '_id'
13
13
 
14
- this.root = document.createElement('div')
15
- this.root.classList.add('list')
14
+ this.element = document.createElement('div')
15
+ this.element.classList.add('list')
16
16
 
17
17
  if (this.options.class) {
18
18
  this.addClass(this.options.class)
19
19
  }
20
20
 
21
- this.root.addEventListener('click', (e) => {
21
+ this.element.addEventListener('click', (e) => {
22
22
  e.stopPropagation()
23
23
  })
24
24
 
@@ -27,17 +27,17 @@ export default {
27
27
  }
28
28
 
29
29
  if (this.options.data) {
30
- dataset(this.root, this.options.data)
30
+ dataset(this.element, this.options.data)
31
31
  }
32
32
 
33
- this.layout = new Layout(this.options.layout.main, this.root)
33
+ this.layout = new Layout(this.options.layout.main, this.element)
34
34
  this.ui = this.layout.component
35
35
 
36
36
  // prepare loading
37
37
  // this.ui.loading = new Loading()
38
38
 
39
39
  if (this.options.container) {
40
- this.options.container.appendChild(this.root)
40
+ this.options.container.appendChild(this.element)
41
41
  }
42
42
 
43
43
  var scrollbarOffset = scrollbar()
@@ -56,7 +56,7 @@ export default {
56
56
  var list = c.split(' ')
57
57
 
58
58
  for (var i = 0; i < list.length; i++) {
59
- this.root.classList.add(list[i])
59
+ this.element.classList.add(list[i])
60
60
  }
61
61
  },
62
62
 
@@ -10,9 +10,9 @@ export default {
10
10
  show () {
11
11
  // console.log('show', this.visible)
12
12
 
13
- this.root.getBoundingClientRect()
13
+ this.element.getBoundingClientRect()
14
14
 
15
- this.root.classList.add('show')
15
+ this.element.classList.add('show')
16
16
  this.visible = true
17
17
 
18
18
  if (this.underlay) {
@@ -26,11 +26,11 @@ export default {
26
26
  },
27
27
 
28
28
  hide () {
29
- // console.log('hide', this.root.style.display)
29
+ // console.log('hide', this.element.style.display)
30
30
 
31
- if (!this.root) return
31
+ if (!this.element) return
32
32
 
33
- this.root.classList.remove('show')
33
+ this.element.classList.remove('show')
34
34
  this.visible = false
35
35
 
36
36
  if (this.underlay) {
@@ -43,8 +43,8 @@ export default {
43
43
 
44
44
  destroy () {
45
45
  // console.log('destroy', this.options.transition)
46
- if (this.options.transition && this.root) {
47
- this.root.classList.remove('show')
46
+ if (this.options.transition && this.element) {
47
+ this.element.classList.remove('show')
48
48
 
49
49
  if (this.underlay) {
50
50
  this.underlay.classList.remove('show')
@@ -63,9 +63,9 @@ export default {
63
63
  },
64
64
 
65
65
  removeChild () {
66
- if (this.root && this.root.parentNode) {
67
- this.root.parentNode.removeChild(this.root)
68
- this.root = null
66
+ if (this.element && this.element.parentNode) {
67
+ this.element.parentNode.removeChild(this.element)
68
+ this.element = null
69
69
  }
70
70
 
71
71
  if (this.underlay && this.underlay.parentNode) {
@@ -111,7 +111,7 @@ export default {
111
111
 
112
112
  // console.log('showSearch')
113
113
  this.mode = 'search'
114
- this.root.classList.add('search-mode')
114
+ this.element.classList.add('search-mode')
115
115
 
116
116
  if (this.ui.search) {
117
117
  this.ui.search.root.classList.add('selected')
@@ -136,7 +136,7 @@ export default {
136
136
  hideSearch (notfetch) {
137
137
  // console.log('hideSearch', notfetch)
138
138
  this.mode = 'standard'
139
- this.root.classList.remove('search-mode')
139
+ this.element.classList.remove('search-mode')
140
140
 
141
141
  if (this.ui.search) {
142
142
  this.ui.search.root.classList.remove('selected')
package/src/list.js CHANGED
@@ -3,7 +3,7 @@
3
3
  import Item from './item'
4
4
  import Divider from './divider'
5
5
 
6
- // import init from './component/init'
6
+ // import init from './mixin/init'
7
7
  import emitter from './module/emitter'
8
8
  import insert from './element/insert'
9
9
  import css from './module/css'
@@ -86,19 +86,19 @@ class List {
86
86
  // define main tag
87
87
  var tag = this.options.tag || 'ul'
88
88
 
89
- this.root = document.createElement(tag)
90
- css.add(this.root, 'material-' + this.options.class)
89
+ this.element = document.createElement(tag)
90
+ css.add(this.element, 'material-' + this.options.class)
91
91
 
92
92
  if (options.name) {
93
- css.add(this.root, options.class + '-' + options.name)
93
+ css.add(this.element, options.class + '-' + options.name)
94
94
  }
95
95
 
96
96
  if (options.type) {
97
- css.add(this.root, 'type-' + options.type)
97
+ css.add(this.element, 'type-' + options.type)
98
98
  }
99
99
 
100
100
  if (options.layout) {
101
- css.add(this.root, 'layout-' + options.layout)
101
+ css.add(this.element, 'layout-' + options.layout)
102
102
  }
103
103
 
104
104
  if (this.options.list) {
@@ -106,10 +106,10 @@ class List {
106
106
  }
107
107
 
108
108
  if (this.options.container) {
109
- insert(this.root, this.options.container)
109
+ insert(this.element, this.options.container)
110
110
  }
111
111
 
112
- // this.root.addEventListener("click", function(e) {
112
+ // this.element.addEventListener("click", function(e) {
113
113
  // // console.log("list", this, e);
114
114
  // // e.target was the clicked element
115
115
  // });
@@ -207,7 +207,7 @@ class List {
207
207
  }
208
208
 
209
209
  scrollToBottom () {
210
- this.root.scrollTop = this.root.scrollHeight - this.root.getBoundingClientRect().height
210
+ this.element.scrollTop = this.element.scrollHeight - this.element.getBoundingClientRect().height
211
211
  }
212
212
 
213
213
  /**
@@ -221,9 +221,9 @@ class List {
221
221
 
222
222
  var where = 'bottom'
223
223
  if (item.root) {
224
- insert(item.root, this.root, where)
224
+ insert(item.root, this.element, where)
225
225
  } else {
226
- insert(item, this.root, where)
226
+ insert(item, this.element, where)
227
227
  }
228
228
 
229
229
  this.items.push(item)
@@ -232,11 +232,11 @@ class List {
232
232
  }
233
233
 
234
234
  insert (container, context) {
235
- insert(this.root, container, context)
235
+ insert(this.element, container, context)
236
236
  }
237
237
 
238
238
  empty () {
239
- this.root.innerHTML = ''
239
+ this.element.innerHTML = ''
240
240
  this.items = []
241
241
  this.item = null
242
242
  }
package/src/map/build.js CHANGED
@@ -13,11 +13,11 @@ export default {
13
13
  * @return {void} This class instance
14
14
  */
15
15
  build () {
16
- this.root = document.createElement(this.options.tag)
17
- this.root.classList.add(this.options.class)
16
+ this.element = document.createElement(this.options.tag)
17
+ this.element.classList.add(this.options.class)
18
18
 
19
19
  if (this.options.container) {
20
- this.options.container.appendChild(this.root)
20
+ this.options.container.appendChild(this.element)
21
21
  }
22
22
 
23
23
  this.label = document.createElement('div')
@@ -27,7 +27,7 @@ export default {
27
27
  this.buildMap()
28
28
  this.screenSize()
29
29
 
30
- observer.insert(this.root, () => {
30
+ observer.insert(this.element, () => {
31
31
  // if (touch()) {
32
32
  // // console.log('pinchzoom', this.options.pichZoom)
33
33
  // this.draggable = new PinchZoom(this.slide, {
@@ -58,7 +58,7 @@ export default {
58
58
  })
59
59
  // }
60
60
 
61
- this.rect = this.root.getBoundingClientRect()
61
+ this.rect = this.element.getBoundingClientRect()
62
62
 
63
63
  this.screen = {
64
64
  y: window.pageYOffset,
@@ -84,7 +84,7 @@ export default {
84
84
  // console.log('buildmap')
85
85
  this.slide = document.createElement('div')
86
86
  this.slide.classList.add('slide')
87
- this.root.appendChild(this.slide)
87
+ this.element.appendChild(this.slide)
88
88
 
89
89
  this.map = document.createElement('div')
90
90
  this.map.classList.add('map')
@@ -82,24 +82,24 @@ export default {
82
82
  },
83
83
 
84
84
  updateRoot () {
85
- this.offsetX = this.screen.width - this.root.offsetWidth
86
- this.offsetY = this.screen.height - this.root.offsetHeight
85
+ this.offsetX = this.screen.width - this.element.offsetWidth
86
+ this.offsetY = this.screen.height - this.element.offsetHeight
87
87
 
88
88
  // console.log('--', this.offsetX / 2 + 'px')
89
89
 
90
- this.root.style.left = (this.offsetX / 2) + 'px'
91
- this.root.style.top = (this.offsetY / 2) + 'px'
90
+ this.element.style.left = (this.offsetX / 2) + 'px'
91
+ this.element.style.top = (this.offsetY / 2) + 'px'
92
92
 
93
93
  // if (isTouchScreen()) {
94
- // this.root.style.top = (this.offsetY / 2) + 70 + 'px'
94
+ // this.element.style.top = (this.offsetY / 2) + 70 + 'px'
95
95
  // } else {
96
- // this.root.style.top = -1200 + 'px'
96
+ // this.element.style.top = -1200 + 'px'
97
97
  // }
98
98
  },
99
99
 
100
100
  updateMap () {
101
- var offsetX = this.root.offsetWidth - this.map.offsetWidth
102
- // var offsetY = this.root.height - this.map.offsetHeight
101
+ var offsetX = this.element.offsetWidth - this.map.offsetWidth
102
+ // var offsetY = this.element.height - this.map.offsetHeight
103
103
 
104
104
  // console.log('--', this.offsetX / 2 + 'px')
105
105
 
package/src/menu.js CHANGED
@@ -1,8 +1,8 @@
1
1
  'use strict'
2
2
 
3
- import classify from './component/classify'
3
+ import classify from './module/classify'
4
4
  import css from './module/css'
5
- import events from './component/events'
5
+ import events from './mixin/events'
6
6
  import insert from './element/insert'
7
7
  import offset from './element/offset'
8
8
 
@@ -66,18 +66,18 @@ class Menu {
66
66
  * @return {Object} This class instance
67
67
  */
68
68
  build () {
69
- this.root = create(this.options.tag, this.options.css)
69
+ this.element = create(this.options.tag, this.options.css)
70
70
  this.mask = create(this.options.tag, this.options.class + '-mask')
71
71
 
72
72
  if (this.options.position) {
73
- this.root.style.position = this.options.position
73
+ this.element.style.position = this.options.position
74
74
  }
75
75
 
76
- classify(this.root, this.options)
76
+ classify(this.element, this.options)
77
77
 
78
78
  if (this.options.list) {
79
79
  this.list = new List({
80
- // root: this.root,
80
+ // root: this.element,
81
81
  list: this.options.list,
82
82
  target: '.material-item',
83
83
  height: 600,
@@ -86,17 +86,17 @@ class Menu {
86
86
  this.selected = item
87
87
  this.hide()
88
88
  }
89
- }).insert(this.root)
89
+ }).insert(this.element)
90
90
  }
91
91
 
92
- this.emit('built', this.root)
92
+ this.emit('built', this.element)
93
93
 
94
94
  return this
95
95
  }
96
96
 
97
97
  insert () {
98
98
  insert(this.mask, document.body)
99
- insert(this.root, document.body)
99
+ insert(this.element, document.body)
100
100
  }
101
101
 
102
102
  setup () {
@@ -113,7 +113,7 @@ class Menu {
113
113
 
114
114
  if (e) this.caller = e.target
115
115
 
116
- css.add(this.root, this.options.class + '-show')
116
+ css.add(this.element, this.options.class + '-show')
117
117
  this.position(this.caller)
118
118
  }
119
119
 
@@ -121,19 +121,19 @@ class Menu {
121
121
  if (!this.caller) return
122
122
  var offs = offset(this.caller)
123
123
 
124
- var offsw = this.offset = offset(this.root)
124
+ var offsw = this.offset = offset(this.element)
125
125
 
126
126
  // console.log('offset')
127
127
  // console.log('caller', this.caller, offs, screen.width)
128
128
 
129
- this.root.style.top = offs.top + 'px'
130
- this.root.style.left = offs.left - offsw.width + offs.width + 'px'
131
- // this.root.style.right = offs.right + offs.width + offsw.width + 'px'
129
+ this.element.style.top = offs.top + 'px'
130
+ this.element.style.left = offs.left - offsw.width + offs.width + 'px'
131
+ // this.element.style.right = offs.right + offs.width + offsw.width + 'px'
132
132
  }
133
133
 
134
134
  hide () {
135
135
  // console.log('hide')
136
- css.remove(this.root, this.options.class + '-show')
136
+ css.remove(this.element, this.options.class + '-show')
137
137
  css.remove(this.mask, 'mask-show')
138
138
  }
139
139
  }
@@ -32,12 +32,12 @@ var control = {
32
32
  */
33
33
  check (checked) {
34
34
  if (checked === true) {
35
- css.add(this.root, 'is-checked')
35
+ css.add(this.element, 'is-checked')
36
36
  this.element.input.checked = true
37
37
  this.checked = true
38
38
  this.emit('change', this.checked)
39
39
  } else {
40
- css.remove(this.root, 'is-checked')
40
+ css.remove(this.element, 'is-checked')
41
41
  this.element.input.checked = false
42
42
  this.checked = false
43
43
  this.emit('change', this.checked)
@@ -60,7 +60,7 @@ var control = {
60
60
 
61
61
  this.element.label.textContent = label
62
62
 
63
- container = container || this.root
63
+ container = container || this.element
64
64
 
65
65
  insert(this.element.label, container)
66
66
  },
@@ -73,7 +73,7 @@ var control = {
73
73
  icon (icon, container, position) {
74
74
  if (!icon) return
75
75
 
76
- container = container || this.root
76
+ container = container || this.element
77
77
 
78
78
  position = position || 'top'
79
79
  if (this.options.type === 'text-icon') {
@@ -104,14 +104,14 @@ var control = {
104
104
  this.element.error.textContent = text
105
105
  }
106
106
 
107
- insert(this.element.error, this.root, 'bottom')
107
+ insert(this.element.error, this.element, 'bottom')
108
108
  },
109
109
 
110
110
  disable () {
111
111
  this.disabled = true
112
112
 
113
113
  this.element.input.setAttribute('disabled', 'disabled')
114
- css.add(this.root, 'is-disabled')
114
+ css.add(this.element, 'is-disabled')
115
115
  return this
116
116
  },
117
117
 
@@ -119,7 +119,7 @@ var control = {
119
119
  this.disabled = false
120
120
 
121
121
  this.element.input.removeAttribute('disabled')
122
- css.remove(this.root, 'is-disabled')
122
+ css.remove(this.element, 'is-disabled')
123
123
  return this
124
124
  },
125
125
 
@@ -162,7 +162,7 @@ var control = {
162
162
  },
163
163
 
164
164
  getName () {
165
- return this.root.dataset.name
165
+ return this.element.dataset.name
166
166
  },
167
167
 
168
168
  /**
@@ -172,7 +172,7 @@ var control = {
172
172
  focus () {
173
173
  if (this.disabled === true) return this
174
174
 
175
- css.add(this.root, 'is-focused')
175
+ css.add(this.element, 'is-focused')
176
176
  if (this.element.input !== document.activeElement) { this.element.input.focus() }
177
177
  return this
178
178
  },
@@ -182,7 +182,7 @@ var control = {
182
182
  * @return {?} [description]
183
183
  */
184
184
  blur () {
185
- css.remove(this.root, 'is-focused')
185
+ css.remove(this.element, 'is-focused')
186
186
  return this
187
187
  }
188
188
  }
@@ -1,4 +1,4 @@
1
- import classify from './classify'
1
+ import classify from '../module/classify'
2
2
 
3
3
  function create (options) {
4
4
  var element = document.createElement(options.tag || 'div')