material 0.7.0 → 0.7.2

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 (148) hide show
  1. package/README.md +1 -5
  2. package/dist/demo-bundle.js +2281 -2
  3. package/dist/demo-bundle.js.map +7 -1
  4. package/dist/demo.js +13 -13
  5. package/esbuild.js +22 -0
  6. package/esbuild.watch.js +25 -0
  7. package/form.js +27 -0
  8. package/index.js +59 -58
  9. package/list.js +35 -0
  10. package/package.json +8 -17
  11. package/src/appbar.js +7 -204
  12. package/src/badge.js +27 -0
  13. package/src/button.js +127 -177
  14. package/src/calendar.js +53 -55
  15. package/src/card.js +1 -3
  16. package/src/checkbox.js +5 -55
  17. package/src/component.js +0 -2
  18. package/src/container.js +0 -2
  19. package/src/datehour.js +38 -0
  20. package/src/dialog.js +104 -151
  21. package/src/divider.js +1 -3
  22. package/src/drawer.js +1 -19
  23. package/src/element/attribute.js +7 -10
  24. package/src/element/build.js +6 -7
  25. package/src/element/create.js +3 -6
  26. package/src/element/event.js +2 -2
  27. package/src/element/insert.js +6 -17
  28. package/src/element/observer.js +22 -0
  29. package/src/element/offset.js +2 -2
  30. package/src/element/style.js +12 -12
  31. package/src/element.js +2 -2
  32. package/src/field/email.js +9 -44
  33. package/src/field/image.js +17 -51
  34. package/src/{control/file.js → file.js} +15 -45
  35. package/src/form/build.js +7 -7
  36. package/src/form/controller.js +8 -8
  37. package/src/form/create.js +1 -1
  38. package/src/form/data.js +9 -9
  39. package/src/form/delete.js +1 -1
  40. package/src/form/render.js +9 -9
  41. package/src/form/set.js +1 -1
  42. package/src/form/submit.js +6 -6
  43. package/src/form/update.js +3 -3
  44. package/src/form/verify.js +6 -6
  45. package/src/form.js +9 -11
  46. package/src/icon.js +4 -6
  47. package/src/image.js +39 -106
  48. package/src/item.js +1 -3
  49. package/src/layout.js +14 -14
  50. package/src/{control/link.js → link.js} +13 -32
  51. package/src/list/build.js +10 -10
  52. package/src/list/click.js +3 -3
  53. package/src/list/collection.js +1 -1
  54. package/src/list/filter.js +11 -11
  55. package/src/list/image.js +3 -3
  56. package/src/list/render.js +15 -15
  57. package/src/list/request.js +8 -8
  58. package/src/list/search.js +12 -12
  59. package/src/list/select.js +18 -18
  60. package/src/list/status.js +1 -1
  61. package/src/list/update.js +6 -6
  62. package/src/list/virtual.js +20 -20
  63. package/src/list/virtual.new.js +5 -5
  64. package/src/list.js +29 -217
  65. package/src/loading.js +73 -0
  66. package/src/map/build.js +2 -2
  67. package/src/map/countries.js +8 -8
  68. package/src/map/display.js +13 -13
  69. package/src/map/focus.js +7 -7
  70. package/src/map/select.js +2 -2
  71. package/src/map/set.js +3 -3
  72. package/src/map/viewport.js +11 -11
  73. package/src/menu.js +59 -115
  74. package/src/mixin/control.js +3 -3
  75. package/src/mixin/controller.js +5 -5
  76. package/src/mixin/create.js +1 -1
  77. package/src/mixin/display.js +1 -2
  78. package/src/mixin/events.js +4 -16
  79. package/src/mixin/focus.js +1 -1
  80. package/src/mixin/icon.js +2 -2
  81. package/src/mixin/init.js +2 -2
  82. package/src/mixin/insert.js +7 -29
  83. package/src/mixin/label.js +2 -2
  84. package/src/mixin/settings.js +5 -5
  85. package/src/module/attach.js +35 -49
  86. package/src/{control/module → module}/attributes.js +4 -4
  87. package/src/module/build.js +12 -12
  88. package/src/module/classify.js +4 -4
  89. package/src/module/controller.js +5 -32
  90. package/src/module/css.js +12 -84
  91. package/src/module/dataset.js +1 -1
  92. package/src/module/dom.js +8 -3
  93. package/src/module/dot.js +4 -4
  94. package/src/module/emitter.js +1 -1
  95. package/src/module/event.js +2 -2
  96. package/src/module/events.js +29 -35
  97. package/src/module/extract.js +10 -10
  98. package/src/module/last.js +18 -0
  99. package/src/module/mediator.js +1 -13
  100. package/src/module/object.js +4 -4
  101. package/src/module/observer.js +43 -16
  102. package/src/module/remove.js +10 -10
  103. package/src/module/ripple.js +19 -24
  104. package/src/module/scrollbar.js +10 -14
  105. package/src/module/smoothscroll.js +5 -9
  106. package/src/module/utils.js +14 -23
  107. package/src/module/viewport.js +5 -5
  108. package/src/navigation.js +19 -0
  109. package/src/progress.js +1 -11
  110. package/src/search.js +66 -0
  111. package/src/select.js +58 -273
  112. package/src/{control/selecter.js → selecter.js} +42 -42
  113. package/src/selector.js +3 -3
  114. package/src/skin/material/component/navigation.sass +9 -0
  115. package/src/skin/material/control/button.sass +10 -0
  116. package/src/slider.js +1 -3
  117. package/src/snackbar.js +72 -50
  118. package/src/switch.js +111 -103
  119. package/src/{control/switcher.js → switcher.js} +28 -31
  120. package/src/tabs.js +4 -5
  121. package/src/tabview.js +26 -46
  122. package/src/text.js +25 -74
  123. package/src/textfield.js +97 -234
  124. package/src/toolbar.js +12 -12
  125. package/src/tooltip.js +7 -7
  126. package/src/tree.js +10 -66
  127. package/src/view/build.js +2 -2
  128. package/src/view/dataset.js +1 -1
  129. package/src/view.js +9 -74
  130. package/rollup.config.js +0 -34
  131. package/src/banner.js +0 -231
  132. package/src/control/button.js +0 -239
  133. package/src/control/button.new.js +0 -190
  134. package/src/control/datehour.js +0 -65
  135. package/src/control/dialog.js +0 -175
  136. package/src/control/image.js +0 -92
  137. package/src/control/list.js +0 -67
  138. package/src/control/loading.js +0 -128
  139. package/src/control/menu.js +0 -85
  140. package/src/control/module/addclass.js +0 -16
  141. package/src/control/search.js +0 -98
  142. package/src/control/select.js +0 -130
  143. package/src/control/snackbar.js +0 -91
  144. package/src/control/switch.js +0 -272
  145. package/src/control/text.js +0 -70
  146. package/src/control/textfield.js +0 -177
  147. package/src/element/ripple.js +0 -90
  148. package/src/tabs/setup.js +0 -0
@@ -1,17 +1,17 @@
1
1
  export default {
2
2
  verify () {
3
- var list = this.options.require
3
+ const list = this.options.require
4
4
 
5
- var ok = true
5
+ let ok = true
6
6
 
7
- for (var i = 0; i < list.length; i++) {
8
- var field = this.ui['info.' + list[i]]
7
+ for (let i = 0; i < list.length; i++) {
8
+ const field = this.ui['info.' + list[i]]
9
9
 
10
10
  if (!this.layout.get(list[i]).get()) {
11
- field.root.classList.add('textfield-error')
11
+ field.element.classList.add('textfield-error')
12
12
  ok = false
13
13
  } else {
14
- field.root.classList.remove('textfield-error')
14
+ field.element.classList.remove('textfield-error')
15
15
  }
16
16
  }
17
17
 
package/src/form.js CHANGED
@@ -1,7 +1,5 @@
1
- 'use strict'
2
-
3
1
  import insert from './element/insert'
4
- import css from './module/css'
2
+ import * as css from './module/css'
5
3
  import emitter from './module/emitter'
6
4
  import attach from './module/attach'
7
5
  import controller from './mixin/controller'
@@ -70,7 +68,7 @@ class Form {
70
68
  * @return {Object} This class instance
71
69
  */
72
70
  build () {
73
- var tag = this.options.tag || 'div'
71
+ const tag = this.options.tag || 'div'
74
72
 
75
73
  this.element = document.createElement(tag)
76
74
  css.add(this.element, this.options.prefix + '-' + this.options.class)
@@ -101,8 +99,8 @@ class Form {
101
99
 
102
100
  this.key = this.key || {}
103
101
 
104
- for (var i = 0; i < controls.length; i++) {
105
- var control = controls[i]
102
+ for (let i = 0; i < controls.length; i++) {
103
+ const control = controls[i]
106
104
  // control.setAttribute('data-key', control.name);
107
105
 
108
106
  this.key[control.name] = control
@@ -128,9 +126,9 @@ class Form {
128
126
  * @return {?} [description]
129
127
  */
130
128
  initControl (key, section) {
131
- var name = key.name || 'undefined'
129
+ const name = key.name || 'undefined'
132
130
 
133
- var control = this.render(key)
131
+ const control = this.render(key)
134
132
 
135
133
  if (control) {
136
134
  this.key[name] = control
@@ -181,15 +179,15 @@ class Form {
181
179
  */
182
180
  parseInfo (obj, name, i) {
183
181
  // console.log('parseInfo', obj, name, 'level ' + i);
184
- var level = i || 0
182
+ let level = i || 0
185
183
  level = level + 1
186
- var key
184
+ let key
187
185
 
188
186
  if (obj instanceof Object) {
189
187
  for (key in obj) {
190
188
  if (obj.hasOwnProperty(key)) {
191
189
  // recursive call to scan property
192
- var n = null
190
+ let n = null
193
191
  if (name) {
194
192
  n = name + '.' + key
195
193
  } else {
package/src/icon.js CHANGED
@@ -1,7 +1,5 @@
1
- 'use strict'
2
-
3
1
  import insert from './mixin/insert'
4
- import css from './module/css'
2
+ import * as css from './module/css'
5
3
 
6
4
  var defaults = {
7
5
  prefix: 'material',
@@ -56,10 +54,10 @@ class Icon {
56
54
  this.element = this.element || {}
57
55
 
58
56
  this.element = document.createElement(tag)
59
- css.add(this.element, this.options.prefix + '-' + this.options.class)
57
+ { add }.add(this.element, this.options.prefix + '-' + this.options.class)
60
58
 
61
- if (options.css) { css.add(this.element, options.css) }
62
- // css.add(this.element, this.options.class + '-adjust');
59
+ if (options.{ add }) { { add }.add(this.element, options.{ add }) }
60
+ // { add }.add(this.element, this.options.class + '-adjust');
63
61
 
64
62
  if (this.options.container) {
65
63
  this.insert(this.options.container)
package/src/image.js CHANGED
@@ -1,124 +1,57 @@
1
- 'use strict'
1
+ import build from './module/build'
2
2
 
3
- // import insert from './mixin/insert'
4
- import css from './module/css'
5
- import insert from './element/insert'
6
- import control from './mixin/control'
7
-
8
- var defaults = {
9
- prefix: 'material',
10
- class: 'image',
11
- tag: 'div'
12
- }
13
-
14
- /**
15
- * The item class is used for example as item list
16
- *
17
- * @class
18
- * @extends {Component}
19
- * @return {Object} The class instance
20
- * @example new Item(object);
21
- */
22
3
  class Image {
23
- /**
24
- * init
25
- * @return {Object} The class options
26
- */
4
+ static defaults = {
5
+ class: 'image',
6
+ tag: 'div',
7
+ format: 'thumb'
8
+ }
9
+
27
10
  constructor (options) {
28
11
  this.init(options)
29
12
  this.build()
30
-
31
- return this
32
13
  }
33
14
 
34
- /**
35
- * [init description]
36
- * @param {?} options [description]
37
- * @return {?} [description]
38
- */
39
15
  init (options) {
40
- this.options = Object.assign({}, defaults, options || {})
41
- Object.assign(this, control)
16
+ this.options = { ...Image.defaults, ...options }
17
+ Object.assign(this, build)
42
18
  }
43
19
 
44
- /**
45
- * Build function for item
46
- * @return {Object} This class instance
47
- */
48
- build (options) {
49
- options = options || this.options
50
-
51
- var tag = options.tag || 'div'
52
- var text = options.text || options.label
53
- this.element = document.createElement(tag)
54
-
55
- // if (options.src) {
56
- // this.element.setAttribute('style', 'background-image: url(' + options.src + ')')
57
-
58
- if (options.src) {
59
- this.image = document.createElement('img')
60
- this.image.setAttribute('src', options.src)
61
- css.add(this.image, this.options.class + '-image')
62
- insert(this.image, this.element)
63
- }
64
-
65
- this.info = document.createElement('span')
66
- css.add(this.info, this.options.class + '-info')
67
-
68
- insert(this.info, this.element)
69
-
70
- this.label(text, this.info)
71
-
72
- // this.label = this.element.label
73
-
74
- this.icon(this.options.icon, this.info, 'bottom')
75
-
76
- // if (text) {
77
- // this.label = document.createElement('span')
78
- // this.label.innerText = text
79
- // css.add(this.label, this.options.class + '-label')
80
- // insert(this.label, this.element)
81
- // }
82
-
83
- css.add(this.element, this.options.prefix + '-' + this.options.class)
84
-
85
- if (options.css) { css.add(this.element, options.css) }
86
- // css.add(this.element, this.options.class + '-adjust');
87
-
88
- if (this.options.container) {
89
- this.insert(this.options.container)
90
- }
91
- }
92
-
93
- /**
94
- * [insert description]
95
- * @param {?} container [description]
96
- * @param {?} context [description]
97
- * @return {?} [description]
98
- */
99
- insert (container, context) {
100
- insert(this.element, container, context)
101
-
102
- return this
103
- }
104
-
105
- /**
106
- * Get or set text value of the element
107
- * @param {string} value The text to set
108
- * @returns {*}
109
- */
110
- set (value) {
111
- if (value) {
112
- if (this.element.innerText) {
113
- this.element.innerText = value
20
+ set (src) {
21
+ // console.log('set', src)
22
+ if (!src) {
23
+ this.element.style.backgroundImage = ''
24
+ } else {
25
+ let url = null
26
+
27
+ if (src.format) {
28
+ let format = this.sanitize(src.format)
29
+
30
+ if (format.length > 0) {
31
+ const index = format.indexOf(this.options.format)
32
+ if (index === -1) {
33
+ format = src.format[0] + '/'
34
+ } else {
35
+ format = this.options.format + '/'
36
+ }
37
+ }
38
+
39
+ url = src.url + format
114
40
  } else {
115
- this.element.textContent = value
41
+ url = src.url
116
42
  }
117
43
 
118
- return this
44
+ this.element.style.backgroundImage = 'url(' + url + src.filename + ')'
119
45
  }
46
+ }
120
47
 
121
- return this
48
+ sanitize (formats) {
49
+ const a = []
50
+ for (let i = 0; i < formats.length; i++) {
51
+ const format = formats[i].replace(/\/$/, '')
52
+ a.push(format)
53
+ }
54
+ return a
122
55
  }
123
56
  }
124
57
 
package/src/item.js CHANGED
@@ -1,11 +1,9 @@
1
- 'use strict'
2
-
3
1
  import Layout from './layout'
4
2
 
5
3
  import create from './mixin/create'
6
4
  import insert from './mixin/insert'
7
5
 
8
- var defaults = {
6
+ const defaults = {
9
7
  prefix: 'material',
10
8
  class: 'item',
11
9
  type: 'default',
package/src/layout.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { is as isObject } from './module/object'
2
- import css from './module/css'
2
+ import * as css from './module/css'
3
3
 
4
4
  class Layout {
5
5
  constructor (schema, container) {
@@ -16,10 +16,10 @@ class Layout {
16
16
  structure = structure || {}
17
17
  let component = null
18
18
 
19
- for (var i = 0; i < schema.length; i++) {
19
+ for (let i = 0; i < schema.length; i++) {
20
20
  // console.log('index', i, typeof schema[i])
21
21
  var name
22
- var options = {}
22
+ let options = {}
23
23
 
24
24
  if (schema[i] instanceof Object &&
25
25
  typeof schema[i] === 'function') {
@@ -37,7 +37,7 @@ class Layout {
37
37
  }
38
38
 
39
39
  component = new schema[i](options)
40
- var element = component.element || component
40
+ const element = component.element || component
41
41
 
42
42
  if (level === 1) {
43
43
  structure.element = element
@@ -49,7 +49,7 @@ class Layout {
49
49
  }
50
50
 
51
51
  // if (component) {
52
- // this.display(component.root, options)
52
+ // this.display(component.element, options)
53
53
  // this.style(component, options)
54
54
  // }
55
55
 
@@ -57,7 +57,7 @@ class Layout {
57
57
  if (component.insert) {
58
58
  component.insert(container)
59
59
  } else {
60
- var wrapper = container.element || container
60
+ const wrapper = container.element || container
61
61
 
62
62
  wrapper.appendChild(element)
63
63
 
@@ -68,7 +68,7 @@ class Layout {
68
68
  component._container = container
69
69
  }
70
70
  } else if (Array.isArray(schema[i])) {
71
- // console.log('------', schema[i])
71
+ // console.log('------', schema[i])
72
72
  if (component == null) {
73
73
  component = container
74
74
  }
@@ -80,8 +80,8 @@ class Layout {
80
80
  }
81
81
 
82
82
  display (element, options) {
83
- var display = options.display
84
- var direction = options.direction || 'horizontal'
83
+ const display = options.display
84
+ const direction = options.direction || 'horizontal'
85
85
 
86
86
  if (!element || !display) return
87
87
 
@@ -93,14 +93,14 @@ class Layout {
93
93
  }
94
94
 
95
95
  style (component) {
96
- var options = component.options || {}
96
+ const options = component.options || {}
97
97
 
98
98
  // console.log('component', component);
99
99
 
100
100
  if (options.flex) {
101
101
  css.add(component.element, 'flex-' + options.flex)
102
102
  } else {
103
- var size = options.size
103
+ const size = options.size
104
104
  if (options.size && options.width) {
105
105
  component.element.width = size + 'px'
106
106
  } else if (options.size && options.height) {
@@ -128,11 +128,11 @@ class Layout {
128
128
  extractInfo (object) {
129
129
  // console.log('extractField', object)
130
130
 
131
- var field = {}
131
+ const field = {}
132
132
 
133
- for (var property in object) {
133
+ for (const property in object) {
134
134
  if (object.hasOwnProperty(property)) {
135
- var infos = property.split(/\./)
135
+ const infos = property.split(/\./)
136
136
 
137
137
  if (infos[0] === 'info' && infos[1] !== undefined) {
138
138
  // console.log('field', infos[0], infos[1])
@@ -1,36 +1,23 @@
1
- 'use strict'
2
-
3
- const defaults = {
4
- class: 'link',
5
- tag: 'a'
6
- }
1
+ import build from './module/build'
7
2
 
8
3
  class Link {
9
- /**
10
- * Constructor
11
- * @param {Object} options - Component options
12
- * @return {Object} Class instance
13
- */
14
- constructor (options) {
15
- this.options = Object.assign({}, defaults, options || {})
4
+ static defaults = {
5
+ class: 'link',
6
+ tag: 'a'
7
+ }
16
8
 
9
+ constructor (options) {
10
+ this.init(options)
17
11
  this.build()
18
-
19
- return this
12
+ this.setup()
20
13
  }
21
14
 
22
- /**
23
- * Build Method
24
- * @return {Object} This class instance
25
- */
26
- build () {
27
- this.element = document.createElement(this.options.tag)
28
- this.element.classList.add(this.options.class)
29
-
30
- if (this.options.class !== 'link') {
31
- this.element.classList.add('link')
32
- }
15
+ init (options) {
16
+ this.options = { ...Link.defaults, ...options }
17
+ Object.assign(this, build)
18
+ }
33
19
 
20
+ setup () {
34
21
  if (this.options.link) {
35
22
  this.set(this.options.link)
36
23
  }
@@ -39,15 +26,9 @@ class Link {
39
26
  this.element.target = this.options.target
40
27
  }
41
28
 
42
- if (this.options.container) {
43
- this.options.container.appendChild(this.element)
44
- }
45
-
46
29
  if (this.options.text) {
47
30
  this.element.innerHTML = this.options.text
48
31
  }
49
-
50
- return this
51
32
  }
52
33
 
53
34
  set (link) {
package/src/list/build.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import scrollbar from '../module/scrollbar'
2
- import dataset from '../view/dataset'
2
+ import dataset from '../module/dataset'
3
3
 
4
4
  import Layout from '../layout'
5
5
  import Virtual from './virtual'
6
- import Loading from '../control/loading'
6
+ import Loading from '../loading'
7
7
 
8
8
  export default {
9
9
  build (data) {
@@ -40,12 +40,12 @@ export default {
40
40
  this.options.container.appendChild(this.element)
41
41
  }
42
42
 
43
- var scrollbarOffset = scrollbar()
43
+ const scrollbarOffset = scrollbar()
44
44
 
45
45
  // console.log('scrollbarOffset', scrollbarOffset)
46
46
  if (this.ui && this.ui.body) {
47
47
  // console.log('body padding', 11 - scrollbarOffset + 'px')
48
- this.ui.body.style['marginRight'] = 11 - scrollbarOffset + 'px'
48
+ this.ui.body.style.marginRight = 11 - scrollbarOffset + 'px'
49
49
  this.ui.body.classList.add('offset' + scrollbarOffset)
50
50
  }
51
51
 
@@ -53,16 +53,16 @@ export default {
53
53
  },
54
54
 
55
55
  addClass (c) {
56
- var list = c.split(' ')
56
+ const list = c.split(' ')
57
57
 
58
- for (var i = 0; i < list.length; i++) {
58
+ for (let i = 0; i < list.length; i++) {
59
59
  this.element.classList.add(list[i])
60
60
  }
61
61
  },
62
62
 
63
63
  buildVirtual () {
64
64
  // console.log('buildVirtual', this.options.class)
65
- var height = 80
65
+ let height = 80
66
66
  this.size = this.options.list.size
67
67
  this.stop = false
68
68
 
@@ -100,15 +100,15 @@ export default {
100
100
  // console.log('progress', progress, this.count)
101
101
 
102
102
  if (this.statusDisplay) {
103
- var percent = parseInt(progress / this.count * 100)
103
+ const percent = parseInt(progress / this.count * 100)
104
104
  this.statusDisplay('count', percent + '% | ' + progress + ' / ' + this.count)
105
105
  }
106
106
 
107
107
  this.onProgress(progress)
108
108
  })
109
109
  // .on('size', (size) => {
110
- // console.log('!!!!size', size)
111
- // this.size = size
110
+ // console.log('!!!!size', size)
111
+ // this.size = size
112
112
  // })
113
113
  //
114
114
  },
package/src/list/click.js CHANGED
@@ -8,9 +8,9 @@ export default {
8
8
  return
9
9
  }
10
10
 
11
- var target = '[data-id]'
12
- var item = e.target
13
- var i = 0
11
+ const target = '[data-id]'
12
+ let item = e.target
13
+ let i = 0
14
14
 
15
15
  while (item && !item.matches(target)) {
16
16
  // console.log('item', item)
@@ -150,7 +150,7 @@ class Collection {
150
150
  route = this.addParams(route, this.params())
151
151
  }
152
152
 
153
- if (this.ui.filter && this.ui.filter.root.classList.contains('selected')) {
153
+ if (this.ui.filter && this.ui.filter.element.classList.contains('selected')) {
154
154
  route = this.addParams(route, this.getFilter())
155
155
  }
156
156
 
@@ -3,7 +3,7 @@ export default {
3
3
  initFilter () {
4
4
  this.filter = this.extractFilter(this.ui)
5
5
 
6
- for (var name in this.filter) {
6
+ for (const name in this.filter) {
7
7
  if (this.filter.hasOwnProperty(name)) {
8
8
  this.filter[name].on('change', () => {
9
9
  this.request()
@@ -15,15 +15,15 @@ export default {
15
15
  this.clearFilter()
16
16
  })
17
17
 
18
- this.ui['filter'].on('click', () => {
18
+ this.ui.filter.on('click', () => {
19
19
  this.toggleFilter()
20
20
  })
21
21
  },
22
22
 
23
23
  getFilter () {
24
24
  console.log('getFilter')
25
- var filter = null
26
- for (var name in this.filter) {
25
+ let filter = null
26
+ for (const name in this.filter) {
27
27
  if (this.filter.hasOwnProperty(name)) {
28
28
  console.log('--', typeof this.filter[name].get(), this.filter[name].get())
29
29
  if (this.filter[name].get() !== ''/* && this.filter[name].get() !== [] */) {
@@ -61,7 +61,7 @@ export default {
61
61
  }
62
62
 
63
63
  // console.log('showSearch')
64
- this.ui['filter'].root.classList.add('selected')
64
+ this.ui.filter.element.classList.add('selected')
65
65
  this.ui['filter-input'].classList.add('show')
66
66
 
67
67
  // this.ui['search-list'].classList.add('show')
@@ -74,7 +74,7 @@ export default {
74
74
  */
75
75
  hideFilter () {
76
76
  // console.log('hideSearch')
77
- this.ui['filter'].root.classList.remove('selected')
77
+ this.ui.filter.element.classList.remove('selected')
78
78
  this.ui['filter-input'].classList.remove('show')
79
79
  // this.ui['search-list'].classList.remove('show')
80
80
  // this.ui.body.classList.remove('hide')
@@ -83,7 +83,7 @@ export default {
83
83
  },
84
84
 
85
85
  clearFilter () {
86
- for (var name in this.filter) {
86
+ for (const name in this.filter) {
87
87
  if (this.filter.hasOwnProperty(name)) {
88
88
  this.filter[name].set('')
89
89
  }
@@ -95,14 +95,14 @@ export default {
95
95
  extractFilter (object) {
96
96
  // console.log('extractField', object)
97
97
 
98
- var filter = {}
98
+ const filter = {}
99
99
 
100
- for (var property in object) {
100
+ for (const property in object) {
101
101
  if (object.hasOwnProperty(property)) {
102
- var str = property.split(/\./)
102
+ const str = property.split(/\./)
103
103
 
104
104
  if (str[0] === 'filter' && str[1] !== undefined) {
105
- var name = property.substr(7, property.length)
105
+ const name = property.substr(7, property.length)
106
106
 
107
107
  filter[name] = object[property]
108
108
  }
package/src/list/image.js CHANGED
@@ -1,17 +1,17 @@
1
1
  export default {
2
2
  image (info, layout) {
3
3
  if (info.image) {
4
- var format = 'thumb'
4
+ let format = 'thumb'
5
5
  if (this.options.image && this.options.image.format) {
6
6
  format = this.options.image.format || format + '/'
7
7
  } else {
8
8
  format = ''
9
9
  }
10
10
 
11
- var r = Math.floor(Math.random() * 100000) + 1
11
+ const r = Math.floor(Math.random() * 100000) + 1
12
12
 
13
13
  if (info.image.filename) {
14
- var image = info.image.url + format + info.image.filename
14
+ const image = info.image.url + format + info.image.filename
15
15
  layout.get('image').style.backgroundImage = 'url("' + image + '?' + r + '")'
16
16
  }
17
17
  }