material 0.9.8 → 0.9.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.9.8",
3
+ "version": "0.9.9",
4
4
  "description": "A lightweight implementation of Material Design Components for the web - ES6",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -10,12 +10,15 @@ import { is as isObject } from '../module/object'
10
10
  * @returns {Object} The structure containing all created components.
11
11
  */
12
12
  function create (schema, container, structure = {}, level = 0, components = []) {
13
- // console.log('layout create')
14
13
  level++
15
14
  let component
16
15
  const object = {}
17
16
  const fragment = document.createDocumentFragment()
18
17
 
18
+ if (!Array.isArray(schema)) {
19
+ console.trace('Schema is not an array!')
20
+ }
21
+
19
22
  for (let i = 0; i < schema.length; i++) {
20
23
  var name
21
24
  let options = {}
@@ -48,7 +51,11 @@ function create (schema, container, structure = {}, level = 0, components = [])
48
51
  if (component.insert) component.insert(fragment)
49
52
  else fragment.appendChild(element)
50
53
 
51
- if (component.onInserted) component.onInserted(fragment)
54
+ if (container) {
55
+ // console.log('container', container)
56
+ component._container = container
57
+ if (component.onInserted) component.onInserted(container)
58
+ }
52
59
  }
53
60
  } else if (Array.isArray(schema[i])) {
54
61
  if (!component) component = container
package/src/view/build.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import scrollbar from '../module/scrollbar'
2
2
  import dataset from '../module/dataset'
3
- import { create } from './module/layout'
3
+ import { create } from '../module/layout'
4
4
 
5
5
  export default {
6
6
  build () {