material 0.7.8 → 0.7.9

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "material",
3
- "version": "0.7.8",
3
+ "version": "0.7.9",
4
4
  "description": "A lightweight implementation of Material Design Components for the web - ES6",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -42,11 +42,11 @@ export default {
42
42
  },
43
43
 
44
44
  getInfoById (id) {
45
- return this.dataStore[id]
45
+ return JSON.parse(JSON.stringify(this.dataStore[id]))
46
46
  },
47
47
 
48
48
  getSelectedInfo () {
49
- return this.dataStore[this.id]
49
+ return JSON.parse(JSON.stringify(this.dataStore[this.id]))
50
50
  },
51
51
 
52
52
  getItemById (id, silent) {
@@ -12,6 +12,10 @@ export default {
12
12
  // console.log('show', this.visible)
13
13
  if (!this.element) return
14
14
 
15
+ if (this.options.display !== false) {
16
+ this.element.style.display = ''
17
+ }
18
+
15
19
  this.element.getBoundingClientRect()
16
20
 
17
21
  this.element.classList.add('show')
@@ -26,6 +30,7 @@ export default {
26
30
  },
27
31
 
28
32
  hide () {
33
+ // console.log('hide', this.element)
29
34
  if (!this.element) return
30
35
 
31
36
  this.element.classList.remove('show')
@@ -35,6 +40,14 @@ export default {
35
40
  this.underlay.classList.remove('show')
36
41
  }
37
42
 
43
+ if (this.options.transition && this.element) {
44
+ setTimeout(() => {
45
+ if (this.options.display !== false) {
46
+ this.element.style.display = 'none'
47
+ }
48
+ }, this.options.transition)
49
+ }
50
+
38
51
  this.emit?.('hide')
39
52
  return this
40
53
  },