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/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import AppBar from 'material/src/appbar'
2
- import Button from 'material/src/button'
2
+ import Button from 'material/src/control/button'
3
3
  import Banner from 'material/src/banner'
4
4
  import Calendar from 'material/src/calendar'
5
5
  import Card from 'material/src/card'
@@ -27,7 +27,12 @@ import Textfield from 'material/src/textfield'
27
27
  import Toolbar from 'material/src/toolbar'
28
28
  import View from 'material/src/view'
29
29
  import Tree from 'material/src/tree'
30
+
30
31
  import emitter from 'material/src/module/emitter'
32
+ import mediator from 'material/src/module/mediator'
33
+ import display from 'material/src/mixin/display'
34
+ import build from 'material/src/module/build'
35
+ import jsontohtml from 'material/src/module/jsontohtml'
31
36
 
32
37
  export {
33
38
  AppBar,
@@ -59,5 +64,9 @@ export {
59
64
  View,
60
65
  Snackbar,
61
66
  Progress,
62
- emitter
67
+ emitter,
68
+ display,
69
+ build,
70
+ emitter,
71
+ mediator
63
72
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "material",
3
- "version": "0.6.1",
3
+ "version": "0.7.0",
4
4
  "description": "A lightweight implementation of Material Design Components - ES6",
5
5
  "main": "index.js",
6
6
  "repository": {
package/src/appbar.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import passiveEvents from './module/passive'
2
- import create from './component/create'
3
- import insert from './component/insert'
2
+ import create from './mixin/create'
3
+ import insert from './mixin/insert'
4
4
  import offset from './element/offset'
5
5
 
6
6
  const defaults = {
@@ -36,21 +36,21 @@ class AppBar {
36
36
  * @return {Object} This class instance
37
37
  */
38
38
  build () {
39
- this.root = create(this.options)
39
+ this.element = create(this.options)
40
40
 
41
41
  // console.log(this.options.height, this.options.fixed)
42
42
 
43
43
  if (this.options.height) {
44
- this.root.style.height = this.options.height + 'px'
44
+ this.element.style.height = this.options.height + 'px'
45
45
  }
46
46
 
47
47
  if (this.options.fixed) {
48
48
  // console.log('is-fixed')
49
- this.root.classList.add('is-fixed')
49
+ this.element.classList.add('is-fixed')
50
50
  }
51
51
 
52
52
  if (this.options.flexible) {
53
- this.root.classList.add('is-flexible')
53
+ this.element.classList.add('is-flexible')
54
54
  }
55
55
 
56
56
  // if (this.options.container) {
@@ -61,13 +61,13 @@ class AppBar {
61
61
  }
62
62
 
63
63
  attach () {
64
- this.root.addEventListener('DOMNodeInserted', (e) => {
64
+ this.element.addEventListener('DOMNodeInserted', (e) => {
65
65
  var textNode = e.target
66
- if (textNode !== this.root) return
66
+ if (textNode !== this.element) return
67
67
 
68
- var size = this.size = offset(this.root, 'height')
68
+ var size = this.size = offset(this.element, 'height')
69
69
 
70
- var view = this.view = this.root.parentNode
70
+ var view = this.view = this.element.parentNode
71
71
 
72
72
  // console.log('view', view)
73
73
 
@@ -77,7 +77,7 @@ class AppBar {
77
77
 
78
78
  var padding = window.getComputedStyle(view)['padding-' + p]
79
79
  // console.log('paddingTop', padding)
80
- // if (!padding) padding = window.getComputedStyle(this.root.parentNode, 'padding')
80
+ // if (!padding) padding = window.getComputedStyle(this.element.parentNode, 'padding')
81
81
  // console.log('padding', padding)
82
82
 
83
83
  padding = parseInt(padding, 10)
@@ -92,7 +92,7 @@ class AppBar {
92
92
 
93
93
  if (document.body == view) {
94
94
  // console.log('toolbar container body')
95
- this.root.classList.add('toolbar-body')
95
+ this.element.classList.add('toolbar-body')
96
96
  }
97
97
 
98
98
  // console.log('p', p)
@@ -111,7 +111,7 @@ class AppBar {
111
111
  set (prop, value) {
112
112
  switch (prop) {
113
113
  case 'minimize':
114
- this.root.setAttribute('style', 'height: 64px')
114
+ this.element.setAttribute('style', 'height: 64px')
115
115
  break
116
116
  case 'value':
117
117
  this.setValue(value)
@@ -154,9 +154,9 @@ class AppBar {
154
154
  }
155
155
 
156
156
  if (scrollTop > 0) {
157
- this.root.classList.add('is-scrolled')
157
+ this.element.classList.add('is-scrolled')
158
158
  } else {
159
- this.root.classList.remove('is-scrolled')
159
+ this.element.classList.remove('is-scrolled')
160
160
  }
161
161
 
162
162
  // console.log('scroll', scrollTop)
@@ -171,42 +171,42 @@ class AppBar {
171
171
  }
172
172
 
173
173
  flexible (e, scrollTop) {
174
- var size = offset(this.root, 'height')
175
- // console.log('flexible', size, this.root.offsetHeight, scrollTop)
174
+ var size = offset(this.element, 'height')
175
+ // console.log('flexible', size, this.element.offsetHeight, scrollTop)
176
176
  // if (scrollTop < this.size) {
177
177
  //
178
178
  var height = '64'
179
179
  if (size < height) {
180
- this.root.style.height = height + 'px'
180
+ this.element.style.height = height + 'px'
181
181
  } else {
182
182
  height = this.size - scrollTop
183
183
  if (height < 64) height = 64
184
- this.root.style.height = height + 'px'
184
+ this.element.style.height = height + 'px'
185
185
  }
186
186
 
187
- // console.log('scroll', this.root.style.top, scrollTop)
187
+ // console.log('scroll', this.element.style.top, scrollTop)
188
188
 
189
189
  // if (scrollTop > 50) {
190
- // this.root.style.trans = scrollTop + 'px'
190
+ // this.element.style.trans = scrollTop + 'px'
191
191
  // } else {
192
- // this.root.style.top = scrollTop + 'px'
192
+ // this.element.style.top = scrollTop + 'px'
193
193
  // }
194
194
  // }
195
- // this.root.style.top = scrollTop + 'px'
196
- // this.root.style.height = this.size - scrollTop
195
+ // this.element.style.top = scrollTop + 'px'
196
+ // this.element.style.height = this.size - scrollTop
197
197
  // } else {
198
198
  // console.log('size scroll', this.size, scrollTop)
199
199
 
200
- // this.root.style.height = this.size - scrollTop + 'px'
201
- // // this.root.style.top = scrollTop + 'px'
200
+ // this.element.style.height = this.size - scrollTop + 'px'
201
+ // // this.element.style.top = scrollTop + 'px'
202
202
  // }
203
203
  }
204
204
 
205
205
  fixed (e, scrollTop) {
206
206
  if (scrollTop > 0) {
207
- this.root.style.transform = 'translateY(' + scrollTop + 'px)'
207
+ this.element.style.transform = 'translateY(' + scrollTop + 'px)'
208
208
  } else {
209
- this.root.style.transform = 'translateY(' + scrollTop + 'px)'
209
+ this.element.style.transform = 'translateY(' + scrollTop + 'px)'
210
210
  }
211
211
  }
212
212
 
package/src/banner.js CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict'
2
2
 
3
- import create from './component/create'
3
+ import create from './mixin/create'
4
4
  import insert from './element/insert'
5
5
  import event from './element/event'
6
6
  import offset from './element/offset'
@@ -53,17 +53,17 @@ class Banner {
53
53
  * @return {Object} This class instance
54
54
  */
55
55
  build () {
56
- this.root = create(this.options)
56
+ this.element = create(this.options)
57
57
 
58
58
  if (this.options.container) {
59
- insert(this.root, this.options.container)
59
+ insert(this.element, this.options.container)
60
60
  }
61
61
 
62
62
  return this
63
63
  }
64
64
 
65
65
  attach () {
66
- event.add(this.root, 'click', (ev) => {
66
+ event.add(this.element, 'click', (ev) => {
67
67
  // console.log('click', ev.target)
68
68
 
69
69
  if (ev.target && ev.target.classList.contains('material-button')) {
@@ -76,18 +76,18 @@ class Banner {
76
76
  ev.stopPropagation()
77
77
  })
78
78
 
79
- this.root.addEventListener('DOMNodeInserted', (e) => {
79
+ this.element.addEventListener('DOMNodeInserted', (e) => {
80
80
  // console.log('DOMNodeInserted', e.target)
81
81
  var textNode = e.target
82
82
 
83
- if (textNode == this.root) {
83
+ if (textNode == this.element) {
84
84
  // console.log('banner root inserted', e.target)
85
85
  if (!this.wrapper) { this.wrap() }
86
86
  this.scroll(this.view)
87
87
  }
88
88
  this.updatePaddingView()
89
89
 
90
- // if (textNode !== this.root) return
90
+ // if (textNode !== this.element) return
91
91
  })
92
92
  }
93
93
 
@@ -106,34 +106,34 @@ class Banner {
106
106
  }
107
107
 
108
108
  wrap () {
109
- this.view = this.root.parentNode
109
+ this.view = this.element.parentNode
110
110
 
111
- // console.log('wrap', this.root, this.view)
111
+ // console.log('wrap', this.element, this.view)
112
112
  this.wrapper = document.createElement('div')
113
113
 
114
114
  this.wrapper.classList.add('banner-wrapper')
115
115
 
116
- this.view.insertBefore(this.wrapper, this.root)
116
+ this.view.insertBefore(this.wrapper, this.element)
117
117
 
118
- this.wrapper.appendChild(this.root)
118
+ this.wrapper.appendChild(this.element)
119
119
 
120
- // insert(this.wrapper, this.root, 'before')
120
+ // insert(this.wrapper, this.element, 'before')
121
121
 
122
- // insert(this.root, this.wrapper)
122
+ // insert(this.element, this.wrapper)
123
123
  }
124
124
 
125
125
  updatePaddingView () {
126
126
  // console.log('updatePaddingView', this.view)
127
127
 
128
- this.height = offset(this.root, 'height')
128
+ this.height = offset(this.element, 'height')
129
129
  if (!this.paddingview) {
130
130
  this.paddingview = window.getComputedStyle(this.view)['padding-top']
131
131
  }
132
132
 
133
- // this.root.style.top = 'top: ' + this.paddingview
133
+ // this.element.style.top = 'top: ' + this.paddingview
134
134
 
135
135
  // console.log('paddingTop', padding)
136
- // if (!padding) padding = window.getComputedStyle(this.root.parentNode, 'padding')
136
+ // if (!padding) padding = window.getComputedStyle(this.element.parentNode, 'padding')
137
137
  // console.log('padding', padding)
138
138
 
139
139
  var padding = parseInt(this.paddingview, 10)
@@ -155,7 +155,7 @@ class Banner {
155
155
  }
156
156
 
157
157
  scroll (view) {
158
- // console.log('initScroll', offset(this.root, 'top'), offset(view, 'top'))
158
+ // console.log('initScroll', offset(this.element, 'top'), offset(view, 'top'))
159
159
 
160
160
  var isBody = false
161
161
 
@@ -188,8 +188,8 @@ class Banner {
188
188
  scrollTop = view.scrollTop
189
189
  }
190
190
 
191
- // var o = offset(this.root, 'top') - offset(view, 'top')
192
- // console.log('o', this.root.offsetTop)
191
+ // var o = offset(this.element, 'top') - offset(view, 'top')
192
+ // console.log('o', this.element.offsetTop)
193
193
 
194
194
  var padding = this.paddingview
195
195
  padding = parseInt(padding, 10)
@@ -222,7 +222,7 @@ class Banner {
222
222
  }
223
223
 
224
224
  insert (container, context) {
225
- insert(this.root, container, context)
225
+ insert(this.element, container, context)
226
226
 
227
227
  return this
228
228
  }
package/src/button.js CHANGED
@@ -1,8 +1,8 @@
1
1
  'use strict'
2
2
 
3
- import create from './component/create'
4
- import control from './component/control'
5
- import ripple from './component/ripple'
3
+ import create from './mixin/create'
4
+ import control from './mixin/control'
5
+ import ripple from './module/ripple'
6
6
 
7
7
  import insert from './element/insert'
8
8
 
@@ -13,7 +13,7 @@ const defaults = {
13
13
  prefix: 'material',
14
14
  class: 'button',
15
15
  tag: 'button',
16
- ripple: false,
16
+ ripple: true,
17
17
  events: [
18
18
  ['root.click', 'handleClick'],
19
19
  ['root.mouseover', 'handleMouseOver']
@@ -63,9 +63,6 @@ class Button {
63
63
  this.element = this.element || {}
64
64
 
65
65
  // init module$
66
- if (this.options.ripple) {
67
- ripple(this)
68
- }
69
66
 
70
67
  this.emit('init')
71
68
  }
@@ -78,21 +75,21 @@ class Button {
78
75
  build () {
79
76
  this.element = {}
80
77
 
81
- this.root = create(this.options)
78
+ this.element = create(this.options)
82
79
 
83
80
  this.options.label = this.options.label || this.options.text
84
81
 
85
- this.root.setAttribute('aria-label', this.options.label || this.options.name)
82
+ this.element.setAttribute('aria-label', this.options.label || this.options.name)
86
83
 
87
84
  if (this.options.title) {
88
- this.root.setAttribute('title', this.options.title)
85
+ this.element.setAttribute('title', this.options.title)
89
86
  }
90
87
 
91
88
  this.label(this.options.label)
92
89
  this.icon(this.options.icon)
93
90
 
94
91
  if (this.options.tooltip) {
95
- this.root.dataset.tooltip = this.options.tooltip
92
+ this.element.dataset.tooltip = this.options.tooltip
96
93
  }
97
94
 
98
95
  if (this.options.container) {
@@ -101,10 +98,12 @@ class Button {
101
98
  } else {
102
99
  this.container = this.options.container
103
100
  }
104
- insert(this.root, this.options.container)
101
+ insert(this.element, this.options.container)
105
102
  }
106
103
 
107
- this.emit('built', this.root)
104
+ if (this.options.ripple) {
105
+ ripple(this.element)
106
+ }
108
107
 
109
108
  return this
110
109
  }
@@ -116,7 +115,7 @@ class Button {
116
115
  * @return {?} [description]
117
116
  */
118
117
  insert (container, context) {
119
- insert(this.root, container, context)
118
+ insert(this.element, container, context)
120
119
 
121
120
  return this
122
121
  }
@@ -126,18 +125,18 @@ class Button {
126
125
  * @return {?} [description]
127
126
  */
128
127
  setup () {
129
- this.element.input = this.root
128
+ this.element.input = this.element
130
129
 
131
130
  if (this.options.name) {
132
- this.root.dataset.name = this.options.name
131
+ this.element.dataset.name = this.options.name
133
132
  }
134
133
 
135
134
  // if (this.options.label) {
136
- // this.root.title = this.options.label
135
+ // this.element.title = this.options.label
137
136
  // }
138
137
 
139
138
  if (this.options.content) {
140
- this.root.innerHTML = this.options.content
139
+ this.element.innerHTML = this.options.content
141
140
  }
142
141
 
143
142
  if (this.options.disabled === true) {
@@ -195,7 +194,7 @@ class Button {
195
194
  }
196
195
 
197
196
  destroy () {
198
- this.container.removeChild(this.root)
197
+ this.container.removeChild(this.element)
199
198
  }
200
199
 
201
200
  /**
package/src/calendar.js CHANGED
@@ -112,12 +112,12 @@ class Calendar {
112
112
  // define main tag
113
113
  var tag = this.options.tag || 'div'
114
114
 
115
- this.root = create(tag, this.options.prefix + '-' + this.options.class)
115
+ this.element = create(tag, this.options.prefix + '-' + this.options.class)
116
116
 
117
117
  this.buildWeek()
118
118
 
119
119
  if (this.options.container) {
120
- insert(this.root, this.options.container)
120
+ insert(this.element, this.options.container)
121
121
  }
122
122
 
123
123
  return this
@@ -143,7 +143,7 @@ class Calendar {
143
143
  */
144
144
  buildHeader () {
145
145
  this.header = create('header')
146
- insert(this.header, this.root)
146
+ insert(this.header, this.element)
147
147
 
148
148
  this.buildHeadline()
149
149
 
@@ -266,7 +266,7 @@ class Calendar {
266
266
 
267
267
  this.body = create('div')
268
268
  css.add(this.body, this.options.class + '-body')
269
- insert(this.body, this.root)
269
+ insert(this.body, this.element)
270
270
 
271
271
  var hours = create('div')
272
272
  css.add(hours, 'hours')
@@ -422,7 +422,7 @@ class Calendar {
422
422
  next () {
423
423
  this.firstDay.setDate(this.firstDay.getDate() + this.options.rangedays)
424
424
 
425
- this.root.innerHTML = ''
425
+ this.element.innerHTML = ''
426
426
 
427
427
  this.buildWeek()
428
428
  }
@@ -434,7 +434,7 @@ class Calendar {
434
434
  back () {
435
435
  this.firstDay.setDate(this.firstDay.getDate() - this.options.rangedays)
436
436
 
437
- this.root.innerHTML = ''
437
+ this.element.innerHTML = ''
438
438
 
439
439
  this.buildWeek()
440
440
  }
@@ -448,7 +448,7 @@ class Calendar {
448
448
  date = date || new Date()
449
449
 
450
450
  this.firstDay = this.getFirstDayOfWeek(this.date)
451
- this.root.innerHTML = ''
451
+ this.element.innerHTML = ''
452
452
 
453
453
  this.buildWeek()
454
454
  }
@@ -459,7 +459,7 @@ class Calendar {
459
459
 
460
460
  empty () {
461
461
  console.log('empty')
462
- this.root.innerHTML = ''
462
+ this.element.innerHTML = ''
463
463
  }
464
464
  }
465
465
 
package/src/card.js CHANGED
@@ -1,8 +1,8 @@
1
1
  'use strict'
2
2
 
3
3
  // import modules
4
- import create from './component/create'
5
- import insert from './component/insert'
4
+ import create from './mixin/create'
5
+ import insert from './mixin/insert'
6
6
  // import components
7
7
  import Layout from './layout'
8
8
 
@@ -33,10 +33,10 @@ class Card {
33
33
  * @return {Object} The class instance
34
34
  */
35
35
  build () {
36
- this.root = create(this.options)
36
+ this.element = create(this.options)
37
37
 
38
38
  if (this.options.layout) {
39
- this.layout = new Layout(this.options.layout, this.root)
39
+ this.layout = new Layout(this.options.layout, this.element)
40
40
  }
41
41
  }
42
42
  }
package/src/checkbox.js CHANGED
@@ -1,8 +1,8 @@
1
1
  'use strict'
2
2
 
3
- import events from './component/events'
4
- import control from './component/control'
5
- import label from './component/label'
3
+ import events from './mixin/events'
4
+ import control from './mixin/control'
5
+ import label from './mixin/label'
6
6
 
7
7
  import insert from './element/insert'
8
8
  import build from './element/build'
@@ -79,13 +79,13 @@ class Checkbox {
79
79
  */
80
80
  build () {
81
81
  this.element = build(this.options.build)
82
- this.root = this.element.root
82
+ this.element = this.element.root
83
83
 
84
84
  this.element.control.innerHTML = icon
85
85
 
86
86
  var text = this.options.text || this.options.label
87
87
 
88
- this.element.label = label(this.root, text, this.options)
88
+ this.element.label = label(this.element, text, this.options)
89
89
 
90
90
  this.element.input.setAttribute('type', 'checkbox')
91
91
  this.element.input.setAttribute('name', this.options.name)
@@ -98,7 +98,7 @@ class Checkbox {
98
98
  if (this.options.disabled) {
99
99
  this.disabled = this.options.disabled
100
100
  this.element.input.setAttribute('disabled', 'disabled')
101
- css.add(this.root, 'is-disabled')
101
+ css.add(this.element, 'is-disabled')
102
102
  }
103
103
 
104
104
  if (this.options.checked) {
@@ -111,7 +111,7 @@ class Checkbox {
111
111
 
112
112
  // insert if container options is given
113
113
  if (this.options.container) {
114
- insert(this.root, this.options.container)
114
+ insert(this.element, this.options.container)
115
115
  }
116
116
 
117
117
  return this
@@ -148,7 +148,7 @@ class Checkbox {
148
148
  * @return {?} [description]
149
149
  */
150
150
  insert (container, context) {
151
- insert(this.root, container, context)
151
+ insert(this.element, container, context)
152
152
 
153
153
  return this
154
154
  }
package/src/component.js CHANGED
@@ -1,8 +1,8 @@
1
1
  'use strict'
2
2
 
3
- import create from './component/create'
4
- import events from './component/events'
5
- import insert from './component/insert'
3
+ import create from './mixin/create'
4
+ import events from './mixin/events'
5
+ import insert from './mixin/insert'
6
6
 
7
7
  import emitter from './module/emitter'
8
8
 
@@ -59,7 +59,7 @@ class Component {
59
59
  * @return {Object} This class instance
60
60
  */
61
61
  build () {
62
- this.root = create(this.options)
62
+ this.element = create(this.options)
63
63
 
64
64
  if (this.options.container) {
65
65
  this.insert(this.options.container)
package/src/container.js CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict'
2
2
 
3
- import create from './component/create'
3
+ import create from './mixin/create'
4
4
  import insert from './element/insert'
5
5
  import emitter from './module/emitter'
6
6
 
@@ -50,17 +50,17 @@ class Container {
50
50
  * @return {Object} This class instance
51
51
  */
52
52
  build () {
53
- this.root = create(this.options)
53
+ this.element = create(this.options)
54
54
 
55
55
  if (this.options.container) {
56
- insert(this.root, this.options.container)
56
+ insert(this.element, this.options.container)
57
57
  }
58
58
 
59
59
  return this
60
60
  }
61
61
 
62
62
  insert (container, context) {
63
- insert(this.root, container, context)
63
+ insert(this.element, container, context)
64
64
  return this
65
65
  }
66
66
  }