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
@@ -42,11 +42,11 @@ class Text {
42
42
  build () {
43
43
  var tag = this.options.tag || 'div'
44
44
 
45
- this.root = document.createElement(tag)
46
- this.root.classList.add('textfield')
45
+ this.element = document.createElement(tag)
46
+ this.element.classList.add('textfield')
47
47
 
48
48
  if (this.options.class !== 'textfield') {
49
- this.root.classList.add(this.options.class)
49
+ this.element.classList.add(this.options.class)
50
50
  }
51
51
 
52
52
  this.buildLabel()
@@ -57,11 +57,11 @@ class Text {
57
57
  }
58
58
 
59
59
  if (this.options.data) {
60
- dataset(this.root, this.options.data)
60
+ dataset(this.element, this.options.data)
61
61
  }
62
62
 
63
63
  if (this.container) {
64
- this.container.appendChild(this.root)
64
+ this.container.appendChild(this.element)
65
65
  }
66
66
 
67
67
  return this
@@ -72,7 +72,7 @@ class Text {
72
72
  this.label = document.createElement('label')
73
73
  this.label.classList.add('label')
74
74
  this.label.innerHTML = this.options.label
75
- this.root.appendChild(this.label)
75
+ this.element.appendChild(this.label)
76
76
  }
77
77
  }
78
78
 
@@ -83,7 +83,7 @@ class Text {
83
83
  }
84
84
  this.input = document.createElement(tag)
85
85
  this.input.classList.add('input')
86
- this.root.appendChild(this.input)
86
+ this.element.appendChild(this.input)
87
87
 
88
88
  attributes(this.input, this.options)
89
89
 
@@ -99,12 +99,12 @@ class Text {
99
99
  }
100
100
 
101
101
  onFocus (ev) {
102
- this.root.classList.add('focused')
102
+ this.element.classList.add('focused')
103
103
  this.emit('focus', ev)
104
104
  }
105
105
 
106
106
  onBlur (ev) {
107
- this.root.classList.remove('focused')
107
+ this.element.classList.remove('focused')
108
108
  this.emit('blur', ev)
109
109
  }
110
110
 
@@ -120,7 +120,7 @@ class Text {
120
120
  * @return {Object} The class instance
121
121
  */
122
122
  set (prop, value) {
123
- // console.log('set', this.root, prop, value)
123
+ // console.log('set', this.element, prop, value)
124
124
  switch (prop) {
125
125
  case 'value':
126
126
  this.setValue(value)
@@ -162,11 +162,11 @@ class Text {
162
162
  }
163
163
 
164
164
  hide () {
165
- this.root.classList.add('hide')
165
+ this.element.classList.add('hide')
166
166
  }
167
167
 
168
168
  show () {
169
- this.root.classList.remove('hide')
169
+ this.element.classList.remove('hide')
170
170
  }
171
171
 
172
172
  get () {
package/src/dialog.js CHANGED
@@ -1,11 +1,11 @@
1
1
  'use strict'
2
2
 
3
3
  // dialog related modules
4
- import events from './component/events'
4
+ import events from './mixin/events'
5
5
  import emitter from './module/emitter'
6
- import controller from './component/controller'
6
+ import controller from './mixin/controller'
7
7
  import attach from './module/attach'
8
- import insert from './component/insert'
8
+ import insert from './mixin/insert'
9
9
  import event from './element/event.js'
10
10
  import css from './module/css'
11
11
 
@@ -34,7 +34,7 @@ class Dialog {
34
34
  this.build()
35
35
  this.attach()
36
36
 
37
- this.root.style.display = 'none'
37
+ this.element.style.display = 'none'
38
38
 
39
39
  return this
40
40
  }
@@ -65,27 +65,27 @@ class Dialog {
65
65
  * @return {Object} The class instance
66
66
  */
67
67
  build () {
68
- this.root = document.createElement('div')
68
+ this.element = document.createElement('div')
69
69
 
70
- css.add(this.root, 'material-dialog')
70
+ css.add(this.element, 'material-dialog')
71
71
 
72
72
  if (this.options.name) {
73
- css.add(this.root, 'dialog-' + this.options.name)
73
+ css.add(this.element, 'dialog-' + this.options.name)
74
74
  }
75
75
 
76
76
  if (this.options.css) {
77
- css.add(this.root, this.options.css)
77
+ css.add(this.element, this.options.css)
78
78
  }
79
79
 
80
80
  if (this.options.theme) {
81
- css.add(this.root, this.options.theme + '-theme')
81
+ css.add(this.element, this.options.theme + '-theme')
82
82
  }
83
83
 
84
84
  this.surface = document.createElement('div')
85
85
 
86
86
  css.add(this.surface, 'dialog-surface')
87
87
 
88
- this.insertElement(this.surface, this.root)
88
+ this.insertElement(this.surface, this.element)
89
89
 
90
90
  if (this.options.title) {
91
91
  this.buildTitle()
@@ -176,13 +176,13 @@ class Dialog {
176
176
  }
177
177
 
178
178
  close () {
179
- css.add(this.root, 'dialog-closing')
179
+ css.add(this.element, 'dialog-closing')
180
180
 
181
181
  var delayMillis = 200 // 1 second
182
182
  setTimeout(() => {
183
- this.root.style.display = 'none'
184
- css.remove(this.root, 'dialog-closing')
185
- css.remove(this.root, 'dialog-show')
183
+ this.element.style.display = 'none'
184
+ css.remove(this.element, 'dialog-closing')
185
+ css.remove(this.element, 'dialog-show')
186
186
  }, delayMillis)
187
187
 
188
188
  this.previousActive.focus()
@@ -193,19 +193,19 @@ class Dialog {
193
193
  show () {
194
194
  this.previousActive = document.activeElement
195
195
 
196
- this.root.style.display = 'flex'
197
- // css.add(this.root, 'dialog-showing');
196
+ this.element.style.display = 'flex'
197
+ // css.add(this.element, 'dialog-showing');
198
198
 
199
199
  var delayMillis = 100 // 1 second
200
200
 
201
201
  setTimeout(() => {
202
- css.add(this.root, 'dialog-show')
203
- // css.remove(this.root, 'dialog-showing');
202
+ css.add(this.element, 'dialog-show')
203
+ // css.remove(this.element, 'dialog-showing');
204
204
  }, delayMillis)
205
205
 
206
206
  return this
207
207
 
208
- // var button = this.root.querySelector('button')
208
+ // var button = this.element.querySelector('button')
209
209
 
210
210
  // if (button) button.focus()
211
211
  }
package/src/divider.js CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict'
2
2
 
3
- import create from './component/create'
4
- import insert from './component/insert'
3
+ import create from './mixin/create'
4
+ import insert from './mixin/insert'
5
5
 
6
6
  var defaults = {
7
7
  prefix: 'material',
@@ -45,10 +45,10 @@ class Divider {
45
45
  * @return {Object} This class instance
46
46
  */
47
47
  build () {
48
- this.root = create(this.options)
48
+ this.element = create(this.options)
49
49
 
50
50
  if (this.options.text) {
51
- this.root.textContent = this.options.text
51
+ this.element.textContent = this.options.text
52
52
  }
53
53
 
54
54
  if (this.options.container) {
package/src/drawer.js CHANGED
@@ -1,10 +1,10 @@
1
1
  'use strict'
2
2
 
3
- import init from './component/init'
3
+ import init from './mixin/init'
4
4
  import insert from './element/insert'
5
- import classify from './component/classify'
5
+ import classify from './module/classify'
6
6
  import css from './module/css'
7
- import events from './component/events'
7
+ import events from './mixin/events'
8
8
  import create from './element/create'
9
9
  import emitter from './module/emitter'
10
10
 
@@ -57,14 +57,14 @@ class Drawer {
57
57
 
58
58
  classify(this.wrapper, this.options)
59
59
 
60
- this.root = create('aside')
60
+ this.element = create('aside')
61
61
 
62
- css.add(this.root, 'drawer-panel')
62
+ css.add(this.element, 'drawer-panel')
63
63
 
64
- insert(this.root, this.wrapper)
64
+ insert(this.element, this.wrapper)
65
65
 
66
66
  if (this.options.position) {
67
- css.add(this.root, 'position-' + this.options.position)
67
+ css.add(this.element, 'position-' + this.options.position)
68
68
  }
69
69
 
70
70
  if (this.options.fixed) {
@@ -73,9 +73,9 @@ class Drawer {
73
73
 
74
74
  if (this.options.size) {
75
75
  if (this.options.position === 'top' || this.options.position === 'bottom') {
76
- this.root.style = 'height: ' + this.options.size + 'px;'
76
+ this.element.style = 'height: ' + this.options.size + 'px;'
77
77
  } else {
78
- this.root.style = 'width: ' + this.options.size + 'px;'
78
+ this.element.style = 'width: ' + this.options.size + 'px;'
79
79
  }
80
80
  }
81
81
 
@@ -85,7 +85,7 @@ class Drawer {
85
85
 
86
86
  if (this.options.container) { insert(this.wrapper, this.options.container) }
87
87
 
88
- this.emit('built', this.root)
88
+ this.emit('built', this.element)
89
89
 
90
90
  return this
91
91
  }
@@ -109,7 +109,7 @@ class Drawer {
109
109
  */
110
110
 
111
111
  toggle () {
112
- // console.log('toggle', this.root);
112
+ // console.log('toggle', this.element);
113
113
  if (this.wrapper.classList.contains('show')) {
114
114
  this.close()
115
115
  } else {
@@ -40,19 +40,19 @@ class EmailLink {
40
40
  * @return {Object} This class instance
41
41
  */
42
42
  build () {
43
- this.root = document.createElement('a')
44
- this.root.classList.add('email')
43
+ this.element = document.createElement('a')
44
+ this.element.classList.add('email')
45
45
 
46
46
  if (this.options.container) {
47
- this.options.container.appendChild(this.root)
47
+ this.options.container.appendChild(this.element)
48
48
  }
49
49
 
50
50
  return this
51
51
  }
52
52
 
53
53
  set (email) {
54
- this.root.innerHTML = email
55
- this.root.setAttribute('href', 'mailto:' + email)
54
+ this.element.innerHTML = email
55
+ this.element.setAttribute('href', 'mailto:' + email)
56
56
  }
57
57
  }
58
58
 
@@ -42,11 +42,11 @@ class Image {
42
42
  * @return {Object} This class instance
43
43
  */
44
44
  build () {
45
- this.root = document.createElement('div')
46
- this.root.classList.add(this.options.class)
45
+ this.element = document.createElement('div')
46
+ this.element.classList.add(this.options.class)
47
47
 
48
48
  if (this.options.container) {
49
- this.options.container.appendChild(this.root)
49
+ this.options.container.appendChild(this.element)
50
50
  }
51
51
 
52
52
  return this
@@ -76,7 +76,7 @@ class Image {
76
76
  url = url + format
77
77
  }
78
78
 
79
- this.root.style.backgroundImage = 'url(' + asset.url + src.path + 'thumb/' + src.filename + ')'
79
+ this.element.style.backgroundImage = 'url(' + asset.url + src.path + 'thumb/' + src.filename + ')'
80
80
  }
81
81
 
82
82
  sanitize (formats) {
package/src/form/build.js CHANGED
@@ -5,19 +5,19 @@ import Layout from '../layout'
5
5
  export default {
6
6
  build () {
7
7
  // console.log('build', this.options.layout)
8
- this.root = document.createElement('div')
9
- this.root.classList.add('form')
8
+ this.element = document.createElement('div')
9
+ this.element.classList.add('form')
10
10
 
11
11
  if (this.options.class !== 'form') {
12
- this.root.classList.add(this.options.class)
12
+ this.element.classList.add(this.options.class)
13
13
  }
14
14
 
15
15
  if (this.options.form) {
16
- this.root.classList.add(this.options.form)
16
+ this.element.classList.add(this.options.form)
17
17
  }
18
18
 
19
19
  if (this.options.data) {
20
- dataset(this.root, this.options.data)
20
+ dataset(this.element, this.options.data)
21
21
  }
22
22
 
23
23
  this.buildForm(this.options.form)
@@ -25,13 +25,13 @@ export default {
25
25
  this.buildLayout()
26
26
 
27
27
  if (this.options.container) {
28
- this.options.container.appendChild(this.root)
28
+ this.options.container.appendChild(this.element)
29
29
  }
30
30
  },
31
31
 
32
32
  buildForm (form) {
33
33
  this.form = document.createElement('form')
34
- this.root.appendChild(this.form)
34
+ this.element.appendChild(this.form)
35
35
 
36
36
  if (form && form.method) {
37
37
  this.form.setAttribute('method', form.method)
package/src/form.js CHANGED
@@ -4,7 +4,7 @@ import insert from './element/insert'
4
4
  import css from './module/css'
5
5
  import emitter from './module/emitter'
6
6
  import attach from './module/attach'
7
- import controller from './component/controller'
7
+ import controller from './mixin/controller'
8
8
 
9
9
  // import component
10
10
  import Layout from './layout'
@@ -72,13 +72,13 @@ class Form {
72
72
  build () {
73
73
  var tag = this.options.tag || 'div'
74
74
 
75
- this.root = document.createElement(tag)
76
- css.add(this.root, this.options.prefix + '-' + this.options.class)
75
+ this.element = document.createElement(tag)
76
+ css.add(this.element, this.options.prefix + '-' + this.options.class)
77
77
 
78
78
  // complete layout options
79
- this.options.root = this.root
79
+ this.options.root = this.element
80
80
 
81
- this.layout = new Layout(this.options.layout, this.root)
81
+ this.layout = new Layout(this.options.layout, this.element)
82
82
 
83
83
  this._initControls(this.layout.controls)
84
84
 
@@ -86,7 +86,7 @@ class Form {
86
86
  }
87
87
 
88
88
  insert (container, context) {
89
- insert(this.root, container, context)
89
+ insert(this.element, container, context)
90
90
 
91
91
  return this
92
92
  }
package/src/icon.js CHANGED
@@ -1,6 +1,6 @@
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
 
6
6
  var defaults = {
@@ -55,11 +55,11 @@ class Icon {
55
55
 
56
56
  this.element = this.element || {}
57
57
 
58
- this.root = document.createElement(tag)
59
- css.add(this.root, this.options.prefix + '-' + this.options.class)
58
+ this.element = document.createElement(tag)
59
+ css.add(this.element, this.options.prefix + '-' + this.options.class)
60
60
 
61
- if (options.css) { css.add(this.root, options.css) }
62
- // css.add(this.root, this.options.class + '-adjust');
61
+ if (options.css) { css.add(this.element, options.css) }
62
+ // css.add(this.element, this.options.class + '-adjust');
63
63
 
64
64
  if (this.options.container) {
65
65
  this.insert(this.options.container)
@@ -73,10 +73,10 @@ class Icon {
73
73
  */
74
74
  set (value) {
75
75
  if (value) {
76
- if (this.root.innerText) {
77
- this.root.innerText = value
76
+ if (this.element.innerText) {
77
+ this.element.innerText = value
78
78
  } else {
79
- this.root.textContent = value
79
+ this.element.textContent = value
80
80
  }
81
81
 
82
82
  return this
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