material 0.7.1 → 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 (122) 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/package.json +7 -20
  8. package/src/badge.js +1 -1
  9. package/src/button.js +50 -100
  10. package/src/calendar.js +53 -53
  11. package/src/card.js +1 -1
  12. package/src/checkbox.js +5 -53
  13. package/src/datehour.js +7 -7
  14. package/src/dialog.js +5 -5
  15. package/src/divider.js +1 -1
  16. package/src/drawer.js +1 -17
  17. package/src/element/attribute.js +7 -10
  18. package/src/element/build.js +6 -7
  19. package/src/element/create.js +3 -6
  20. package/src/element/event.js +2 -2
  21. package/src/element/insert.js +6 -17
  22. package/src/element/observer.js +22 -0
  23. package/src/element/offset.js +2 -2
  24. package/src/element/style.js +12 -12
  25. package/src/element.js +2 -2
  26. package/src/field/email.js +9 -44
  27. package/src/field/image.js +17 -51
  28. package/src/file.js +1 -1
  29. package/src/form/build.js +7 -7
  30. package/src/form/controller.js +8 -8
  31. package/src/form/create.js +1 -1
  32. package/src/form/data.js +9 -9
  33. package/src/form/delete.js +1 -1
  34. package/src/form/render.js +9 -9
  35. package/src/form/set.js +1 -1
  36. package/src/form/submit.js +6 -6
  37. package/src/form/update.js +3 -3
  38. package/src/form/verify.js +4 -4
  39. package/src/form.js +9 -9
  40. package/src/icon.js +4 -4
  41. package/src/image.js +7 -7
  42. package/src/item.js +1 -1
  43. package/src/layout.js +14 -14
  44. package/src/link.js +1 -1
  45. package/src/list/build.js +8 -8
  46. package/src/list/click.js +3 -3
  47. package/src/list/filter.js +11 -11
  48. package/src/list/image.js +3 -3
  49. package/src/list/render.js +15 -15
  50. package/src/list/request.js +7 -7
  51. package/src/list/search.js +9 -9
  52. package/src/list/select.js +18 -18
  53. package/src/list/status.js +1 -1
  54. package/src/list/update.js +6 -6
  55. package/src/list/virtual.js +20 -20
  56. package/src/list/virtual.new.js +5 -5
  57. package/src/list.js +8 -8
  58. package/src/map/build.js +2 -2
  59. package/src/map/countries.js +8 -8
  60. package/src/map/display.js +13 -13
  61. package/src/map/focus.js +7 -7
  62. package/src/map/select.js +2 -2
  63. package/src/map/set.js +3 -3
  64. package/src/map/viewport.js +11 -11
  65. package/src/menu.js +12 -12
  66. package/src/mixin/control.js +3 -3
  67. package/src/mixin/controller.js +5 -5
  68. package/src/mixin/create.js +1 -1
  69. package/src/mixin/display.js +1 -1
  70. package/src/mixin/events.js +4 -16
  71. package/src/mixin/focus.js +1 -1
  72. package/src/mixin/icon.js +2 -2
  73. package/src/mixin/init.js +2 -2
  74. package/src/mixin/insert.js +5 -5
  75. package/src/mixin/label.js +2 -2
  76. package/src/mixin/settings.js +5 -5
  77. package/src/module/attach.js +35 -49
  78. package/src/module/attributes.js +2 -2
  79. package/src/module/build.js +7 -10
  80. package/src/module/classify.js +4 -4
  81. package/src/module/controller.js +5 -32
  82. package/src/module/css.js +12 -84
  83. package/src/module/dataset.js +1 -1
  84. package/src/module/dom.js +8 -3
  85. package/src/module/dot.js +4 -4
  86. package/src/module/emitter.js +1 -1
  87. package/src/module/event.js +2 -2
  88. package/src/module/events.js +29 -35
  89. package/src/module/extract.js +10 -10
  90. package/src/module/last.js +18 -0
  91. package/src/module/mediator.js +1 -13
  92. package/src/module/object.js +4 -4
  93. package/src/module/observer.js +43 -16
  94. package/src/module/remove.js +10 -10
  95. package/src/module/ripple.js +19 -24
  96. package/src/module/scrollbar.js +10 -14
  97. package/src/module/smoothscroll.js +5 -9
  98. package/src/module/utils.js +14 -23
  99. package/src/module/viewport.js +5 -5
  100. package/src/progress.js +1 -9
  101. package/src/search.js +24 -29
  102. package/src/select.js +6 -6
  103. package/src/selecter.js +39 -39
  104. package/src/selector.js +3 -3
  105. package/src/skin/material/component/navigation.sass +9 -1
  106. package/src/slider.js +1 -1
  107. package/src/snackbar.js +8 -7
  108. package/src/switch.js +1 -1
  109. package/src/switcher.js +15 -15
  110. package/src/tabs.js +4 -5
  111. package/src/tabview.js +26 -46
  112. package/src/text.js +1 -1
  113. package/src/textfield.js +1 -1
  114. package/src/toolbar.js +12 -12
  115. package/src/tooltip.js +7 -7
  116. package/src/tree.js +10 -66
  117. package/src/view/build.js +2 -2
  118. package/src/view/dataset.js +1 -1
  119. package/src/view.js +9 -74
  120. package/rollup.config.js +0 -34
  121. package/src/element/ripple.js +0 -90
  122. package/src/module/addclass.js +0 -16
@@ -1,57 +1,51 @@
1
1
  import extract from './extract'
2
2
 
3
- function last (str) {}
4
-
5
- export default {
6
- bindEvents: function (events) {
7
- // console.log('bindEvents', events)
3
+ const attachModule = {
4
+ bindEvents (events) {
8
5
  events = events || this.options.events
9
6
  if (!events) return
10
7
 
11
- // console.log('attach', events, this)
12
- var instance = this
13
- events.map((def) => {
14
- var e = extract.e(instance, def[0])
15
- var f = extract.f(instance, def[1])
16
- var option = def[2]
17
-
18
- var keys = def[1].split('.')
19
-
8
+ events.map(([eventDef, funcDef, option]) => {
9
+ const e = extract.e(this, eventDef)
10
+ const isFunction = typeof funcDef === 'function'
11
+ const f = isFunction ? null : extract.f(this, funcDef)
12
+ const keys = funcDef.split('.')
20
13
  keys.pop()
21
- var bound = this.last(keys.join('.'))
14
+ const bound = this.last(keys.join('.'))
22
15
 
23
- if (f && bound && e && e.element && e.element.addEventListener) {
24
- if (!f) { console.log('error') }
16
+ let handler = null
25
17
 
18
+ if (isFunction && funcDef) {
19
+ handler = funcDef.bind(this)
20
+ } else if (f && bound) {
21
+ handler = f.bind(bound)
22
+ } else {
23
+ // console.error(`Can't bind function for ${eventDef}`)
24
+ return
25
+ }
26
+
27
+ if (handler && e && e.element && e.element.addEventListener) {
26
28
  if (option) {
27
- e.element.addEventListener(e.name, f.bind(bound), option)
29
+ e.element.addEventListener(e.name, handler, option)
28
30
  } else {
29
- e.element.addEventListener(e.name, f.bind(bound))
31
+ e.element.addEventListener(e.name, handler)
30
32
  }
31
- } else if (e && e.element && e.element.on && f && bound) {
32
- e.element.on(e.name, f.bind(bound))
33
+ } else if (e && e.element && e.element.on && handler) {
34
+ e.element.on(e.name, handler)
33
35
  } else {
34
- // console.log('can\'t attach', def[0])
36
+ // console.error(`Can't attach ${eventDef}`)
35
37
  }
36
38
  })
37
39
 
38
40
  return this
39
41
  },
40
42
 
41
- last: function (str) {
42
- // console.log('_path', str)
43
+ last (str) {
43
44
  if (!str) return this
44
- else if (!str.match(/\./)) return this[str]
45
- var last
46
-
47
- var keys = str.split('.')
48
- for (var i = 0, l = keys.length; i < l; i++) {
49
- var key = keys[i]
45
+ if (!str.includes('.')) return this[str]
50
46
 
51
- last = last || this
52
- last = last[key]
53
- }
54
-
55
- return last
47
+ return str.split('.').reduce((acc, key) => acc[key], this)
56
48
  }
57
49
  }
50
+
51
+ export default attachModule
@@ -13,14 +13,14 @@ function e (instance, ev) {
13
13
  }
14
14
  }
15
15
 
16
- var iteration
17
- var obj = {}
18
- var element
16
+ let iteration
17
+ const obj = {}
18
+ let element
19
19
 
20
- var keys = ev.split('.')
20
+ const keys = ev.split('.')
21
21
 
22
- for (var i = 0, l = keys.length; i <= l; i++) {
23
- var key = keys[i]
22
+ for (let i = 0, l = keys.length; i <= l; i++) {
23
+ const key = keys[i]
24
24
  iteration = iteration || instance
25
25
  iteration = iteration[key]
26
26
 
@@ -45,11 +45,11 @@ function f (instance, func) {
45
45
  if (typeof func === 'function') {
46
46
  return func
47
47
  } else if (!func.match(/\./)) return instance[func]
48
- var iteration
48
+ let iteration
49
49
 
50
- var keys = func.split('.')
51
- for (var i = 0, l = keys.length; i < l; i++) {
52
- var key = keys[i]
50
+ const keys = func.split('.')
51
+ for (let i = 0, l = keys.length; i < l; i++) {
52
+ const key = keys[i]
53
53
 
54
54
  iteration = iteration || instance
55
55
  iteration = iteration[key]
@@ -0,0 +1,18 @@
1
+ export default {
2
+ (str) => {
3
+ // console.log('_path', str)
4
+ if (!str) return this
5
+ else if (!str.match(/\./)) return this[str]
6
+ var last
7
+
8
+ var keys = str.split('.')
9
+ for (var i = 0, l = keys.length; i < l; i++) {
10
+ var key = keys[i]
11
+
12
+ last = last || this
13
+ last = last[key]
14
+ }
15
+
16
+ return last
17
+ }
18
+ }
@@ -1,10 +1,4 @@
1
1
  const mediator = ((() => {
2
- /**
3
- * @description Subscribe to an event, supply a callback to be executed when that event is broadcast
4
- * @param store {string}
5
- * @param fn {function}
6
- * @returns {subscribe} {object}
7
- */
8
2
  const subscribe = function (store, fn) {
9
3
  if (!mediator.stores[store]) {
10
4
  mediator.stores[store] = []
@@ -18,19 +12,13 @@ const mediator = ((() => {
18
12
  return this
19
13
  }
20
14
 
21
- /**
22
- * @description Publish/broadcast an event to the rest of the application
23
- * @param store {string}
24
- * @param args {object}
25
- * @returns {*||boolean}
26
- */
27
15
  const publish = function (store, ...args) {
28
16
  // console.log('publish', store, args)
29
17
  if (!mediator.stores[store]) {
30
18
  return false
31
19
  }
32
20
 
33
- for (let value of mediator.stores[store]) {
21
+ for (const value of mediator.stores[store]) {
34
22
  const subscription = value
35
23
  subscription.callback.apply(subscription.context, args)
36
24
  }
@@ -7,10 +7,10 @@ function is (object) {
7
7
 
8
8
  function byString (o, s) {
9
9
  s = s.replace(/\[(\w+)\]/g, '.$1') // convert indexes to properties
10
- s = s.replace(/^\./, '') // strip a leading dot
11
- var a = s.split('.')
12
- for (var i = 0, n = a.length; i < n; ++i) {
13
- var k = a[i]
10
+ s = s.replace(/^\./, '') // strip a leading dot
11
+ const a = s.split('.')
12
+ for (let i = 0, n = a.length; i < n; ++i) {
13
+ const k = a[i]
14
14
  if (k in o) {
15
15
  o = o[k]
16
16
  } else {
@@ -1,23 +1,50 @@
1
+ const observer = (() => {
2
+ const watch = function (event, fn, context = this) {
3
+ if (typeof event !== 'string' || typeof fn !== 'function') {
4
+ throw new Error('Invalid arguments. Event must be a string and callback must be a function.')
5
+ }
1
6
 
2
- const observer = {
3
- insert: (element, cb) => {
4
- var observer = new MutationObserver((mutations) => {
5
- if (document.contains(element)) {
6
- if (typeof cb === 'function' && !element.classList.contains('inserted')) {
7
- cb()
8
- }
7
+ if (!observer.events[event]) {
8
+ observer.events[event] = []
9
+ }
9
10
 
10
- observer.disconnect()
11
- }
11
+ observer.events[event].push({
12
+ context,
13
+ callback: fn
12
14
  })
13
15
 
14
- observer.observe(document, {
15
- attributes: false,
16
- childList: true,
17
- characterData: false,
18
- subtree: true
19
- })
16
+ return this
17
+ }
18
+
19
+ const unwatch = function (event, fn) {
20
+ if (!observer.events[event]) return this
21
+
22
+ observer.events[event] = observer.events[event].filter(subscriber => subscriber.callback !== fn)
23
+
24
+ return this
25
+ }
26
+
27
+ const notify = function (event, ...args) {
28
+ if (!observer.events[event]) return this
29
+
30
+ for (const { context, callback } of observer.events[event]) {
31
+ callback.apply(context, args)
32
+ }
33
+
34
+ return this
35
+ }
36
+
37
+ return {
38
+ events: {},
39
+ watch,
40
+ unwatch,
41
+ notify,
42
+ init: function (obj) {
43
+ obj.watch = watch
44
+ obj.unwatch = unwatch
45
+ obj.notify = notify
46
+ }
20
47
  }
21
- }
48
+ })()
22
49
 
23
50
  export default observer
@@ -19,16 +19,16 @@ export default {
19
19
  if (!events) return
20
20
 
21
21
  // console.log('attach', events, this)
22
- var instance = this
22
+ const instance = this
23
23
  events.map((def) => {
24
- var e = extract.e(instance, def[0])
25
- var f = extract.f(instance, def[1])
26
- var option = def[2]
24
+ const e = extract.e(instance, def[0])
25
+ const f = extract.f(instance, def[1])
26
+ const option = def[2]
27
27
 
28
- var keys = def[1].split('.')
28
+ const keys = def[1].split('.')
29
29
 
30
30
  keys.pop()
31
- var bound = this.last(keys.join('.'))
31
+ const bound = this.last(keys.join('.'))
32
32
 
33
33
  if (f && bound && e && e.element && e.element.addEventListener) {
34
34
  if (!f) { console.log('error') }
@@ -59,11 +59,11 @@ export default {
59
59
  // console.log('_path', str)
60
60
  if (!str) return this
61
61
  else if (!str.match(/\./)) return this[str]
62
- var last
62
+ let last
63
63
 
64
- var keys = str.split('.')
65
- for (var i = 0, l = keys.length; i < l; i++) {
66
- var key = keys[i]
64
+ const keys = str.split('.')
65
+ for (let i = 0, l = keys.length; i < l; i++) {
66
+ const key = keys[i]
67
67
 
68
68
  last = last || this
69
69
  last = last[key]
@@ -6,41 +6,36 @@ const defaults = {
6
6
  opacity: ['1', '.3']
7
7
  }
8
8
 
9
- function init (container) {
10
- console.log('set', container)
9
+ const init = (container) => {
11
10
  container.addEventListener('mousedown', (e) => {
12
- console.log('mousedown')
13
11
  show(e)
14
12
  })
15
13
  }
16
14
 
17
- function show (e) {
18
- console.log('show', e)
19
- var container = e.target
20
- var offs = offset(container)
15
+ const show = (e) => {
16
+ const container = e.target
17
+ const offs = offset(container)
21
18
 
22
- let ripple = document.createElement('div')
19
+ const ripple = document.createElement('div')
23
20
  ripple.classList.add('ripple')
24
- let end = coordinate(offs)
25
- let initial = {
26
- left: (e.offsetX || offs.width / 2) + 'px',
27
- top: (e.offsetY || offs.height / 2) + 'px'
21
+
22
+ const end = coordinate(offs)
23
+ const initial = {
24
+ left: `${e.offsetX || offs.width / 2}px`,
25
+ top: `${e.offsetY || offs.height / 2}px`
28
26
  }
29
27
 
30
28
  ripple.style.left = initial.left
31
29
  ripple.style.top = initial.top
32
- // ripple.style.opacity = defaults.opacity[1]
33
30
  ripple.style.transition = defaults.transition
34
31
 
35
32
  insert(ripple, container, 'top')
36
33
 
37
34
  setTimeout(() => {
38
- // console.log('style coord', end);
39
35
  ripple.style.left = end.left
40
36
  ripple.style.top = end.top
41
37
  ripple.style.width = end.size
42
38
  ripple.style.height = end.size
43
- // ripple.style.opacity = defaults.opacity[1]
44
39
  }, 1)
45
40
 
46
41
  document.body.onmouseup = () => {
@@ -48,9 +43,9 @@ function show (e) {
48
43
  }
49
44
  }
50
45
 
51
- function coordinate (o) {
52
- var size = o.height
53
- var top = -o.height / 2
46
+ const coordinate = (o) => {
47
+ let size = o.height
48
+ let top = -o.height / 2
54
49
 
55
50
  if (o.width > o.height) {
56
51
  top = -(o.width - o.height / 2)
@@ -58,19 +53,19 @@ function coordinate (o) {
58
53
  }
59
54
 
60
55
  return {
61
- size: (size * 2) + 'px',
62
- top: top + 'px',
63
- left: (size / -2) + 'px'
56
+ size: `${size * 2}px`,
57
+ top: `${top}px`,
58
+ left: `${size / -2}px`
64
59
  }
65
60
  }
66
61
 
67
- function destroy (ripple) {
68
- if (ripple.parentNode) { ripple.style.opacity = '0' }
62
+ const destroy = (ripple) => {
63
+ if (ripple.parentNode) ripple.style.opacity = '0'
69
64
 
70
65
  document.body.onmouseup = null
71
66
 
72
67
  setTimeout(() => {
73
- if (ripple.parentNode) { ripple.parentNode.removeChild(ripple) }
68
+ if (ripple.parentNode) ripple.parentNode.removeChild(ripple)
74
69
  }, 1000)
75
70
  }
76
71
 
@@ -1,42 +1,38 @@
1
-
2
1
  window._scrollbar = {}
3
2
 
4
- function scrollbar () {
3
+ const scrollbar = () => {
5
4
  // if (window._scrollbar.checked) return
6
5
 
7
- var list = document.createElement('div')
6
+ const list = document.createElement('div')
8
7
  list.classList.add('list')
9
- list.style['z-index'] = '1000'
8
+ list.style.zIndex = '1000'
10
9
  list.style.display = 'block'
11
10
  list.style.width = '300px'
12
- list.style['minWidth'] = '300px'
11
+ list.style.minWidth = '300px'
13
12
  list.style.height = '20px'
14
13
  list.style.position = 'absolute'
15
14
  list.style.top = '-200px'
16
15
  list.style.right = 'initial'
17
16
  list.style.bottom = 'initial'
18
17
  list.style.left = '200px'
19
- list.style['overflowY'] = 'hidden'
18
+ list.style.overflowY = 'hidden'
20
19
  document.body.appendChild(list)
21
20
 
22
- var body = document.createElement('div')
21
+ const body = document.createElement('div')
23
22
  body.classList.add('body')
24
- body.style['overflowY'] = 'scroll'
23
+ body.style.overflowY = 'scroll'
25
24
  list.appendChild(body)
26
25
 
27
- var item = document.createElement('div')
26
+ const item = document.createElement('div')
28
27
  item.classList.add('item')
29
28
  item.style.height = '40px'
30
29
  item.style.margin = '0'
31
30
  item.style.padding = '0'
32
31
  item.style.border = '0'
33
- item.style['backgroundColor'] = 'green'
32
+ item.style.backgroundColor = 'green'
34
33
  body.appendChild(item)
35
34
 
36
- var info = item.getBoundingClientRect()
37
- // console.log('width', 300 - info.width)
38
-
39
- // console.log('list', list)
35
+ const info = item.getBoundingClientRect()
40
36
 
41
37
  document.body.removeChild(list)
42
38
 
@@ -1,19 +1,15 @@
1
- function smoothscroll (e, top, time) {
2
- // console.log('smoothscroll', top, e.scrollTop)
1
+ const smoothscroll = (e, top, time = 275) => {
2
+ const start = top - e.scrollTop
3
+ const step = start / 100
4
+ let current = 0
3
5
 
4
- var start = top - e.scrollTop
5
-
6
- time = time || 275
7
- var step = start / 100
8
- var current = 0
9
6
  while (current <= time) {
10
7
  window.setTimeout(scrolling, current, e, step)
11
8
  current += time / 100
12
9
  }
13
10
  }
14
11
 
15
- function scrolling (e, step) {
16
- // console.log('scrolling', step, e.scrollTop)
12
+ const scrolling = (e, step) => {
17
13
  e.scrollBy(0, step)
18
14
  }
19
15
 
@@ -1,5 +1,3 @@
1
- 'use strict'
2
-
3
1
  /**
4
2
  * Utility functions
5
3
  * @module module/utils
@@ -9,19 +7,17 @@
9
7
  * Checks if given value is an array
10
8
  * @param {*} object
11
9
  * @returns {boolean}
12
- * @private
13
10
  */
14
- function _isArray (object) {
11
+ const isArray = (object) => {
15
12
  return Object.prototype.toString.call(object) === '[object Array]'
16
13
  }
17
14
 
18
15
  /**
19
- * Checks if javascript object is plain object
16
+ * Checks if JavaScript object is a plain object
20
17
  * @param {Object} object
21
18
  * @returns {*|boolean}
22
- * @private
23
19
  */
24
- function _isLiteralObject (object) {
20
+ const isLiteralObject = (object) => {
25
21
  return object && typeof object === 'object' && Object.getPrototypeOf(object) === Object.getPrototypeOf({})
26
22
  }
27
23
 
@@ -29,34 +25,30 @@ function _isLiteralObject (object) {
29
25
  * Checks if object is iterable
30
26
  * @param {Object} object
31
27
  * @returns {boolean}
32
- * @private
33
28
  */
34
- function _isIterable (object) {
35
- var r = _isLiteralObject(object) ||
36
- _isArray(object) ||
29
+ const isIterable = (object) => {
30
+ return isLiteralObject(object) ||
31
+ isArray(object) ||
37
32
  (typeof object === 'object' &&
38
33
  object !== null &&
39
34
  object.length !== undefined)
40
-
41
- return r
42
35
  }
43
36
 
44
37
  /**
45
38
  *
46
39
  * @param {Object} object
47
40
  * @param {Function} callback
48
- * @private
49
41
  */
50
- function _each (object, callback) {
51
- if (_isArray(object) || (typeof object === 'object' && object.length !== undefined)) {
52
- for (var i = 0, l = object.length; i < l; i++) {
42
+ const each = (object, callback) => {
43
+ if (isArray(object) || (typeof object === 'object' && object.length !== undefined)) {
44
+ for (let i = 0, l = object.length; i < l; i++) {
53
45
  callback.apply(object[i], [object[i], i])
54
46
  }
55
47
  return
56
48
  }
57
49
 
58
- if (_isLiteralObject(object)) {
59
- for (var key in object) {
50
+ if (isLiteralObject(object)) {
51
+ for (const key in object) {
60
52
  callback.apply(object[key], [object[key], key])
61
53
  }
62
54
  }
@@ -67,13 +59,12 @@ function _each (object, callback) {
67
59
  * @param {Array} array
68
60
  * @param {*} obj
69
61
  * @returns {number}
70
- * @private
71
62
  */
72
- function _indexOf (array, obj) {
63
+ const indexOf = (array, obj) => {
73
64
  if (Array.prototype.indexOf) {
74
65
  return Array.prototype.indexOf.call(array, obj)
75
66
  }
76
- for (var i = 0, j = array.length; i < j; i++) {
67
+ for (let i = 0, j = array.length; i < j; i++) {
77
68
  if (array[i] === obj) {
78
69
  return i
79
70
  }
@@ -81,4 +72,4 @@ function _indexOf (array, obj) {
81
72
  return -1
82
73
  }
83
74
 
84
- export { _isArray, _isIterable, _isLiteralObject, _each, _indexOf }
75
+ export { isArray, isIterable, isLiteralObject, each, indexOf }
@@ -2,12 +2,12 @@
2
2
  function viewport (el) {
3
3
  if (!el) return
4
4
 
5
- var rect = el.getBoundingClientRect()
5
+ const rect = el.getBoundingClientRect()
6
6
 
7
- var top = rect.top
8
- var left = rect.left
9
- var width = rect.width
10
- var height = rect.height
7
+ const top = rect.top
8
+ const left = rect.left
9
+ const width = rect.width
10
+ const height = rect.height
11
11
 
12
12
  return (
13
13
  top >= window.pageYOffset &&
package/src/progress.js CHANGED
@@ -1,10 +1,9 @@
1
1
  // import Component from './component';
2
2
  import create from './element/create'
3
3
  import classify from './module/classify'
4
- import css from './module/css'
5
4
  import insert from './element/insert'
6
5
 
7
- var defaults = {
6
+ const defaults = {
8
7
  prefix: 'material',
9
8
  class: 'progress',
10
9
  tag: 'div',
@@ -14,13 +13,6 @@ var defaults = {
14
13
  </svg>`
15
14
  }
16
15
 
17
- /**
18
- * The class represents an item ie for list
19
- *
20
- * @class
21
- * @return {Object} The class instance
22
- * @example new Item(object);
23
- */
24
16
  class Spinner {
25
17
  /**
26
18
  * init