material 0.9.4 → 0.9.6
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 +1 -1
- package/src/badge.js +2 -8
- package/src/list/add.js +4 -0
- package/src/list/request.js +4 -0
- package/src/module/build.js +14 -5
package/package.json
CHANGED
package/src/badge.js
CHANGED
|
@@ -1,17 +1,11 @@
|
|
|
1
|
-
import { Component,
|
|
1
|
+
import { Component, display } from '../index'
|
|
2
2
|
|
|
3
3
|
const isStringNumber = (str) => !isNaN(parseFloat(str)) && isFinite(str)
|
|
4
4
|
|
|
5
5
|
class Badge extends Component {
|
|
6
6
|
static defaults = {
|
|
7
7
|
class: 'badge',
|
|
8
|
-
mixins: [
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
constructor (options) {
|
|
12
|
-
super(options)
|
|
13
|
-
|
|
14
|
-
this.build()
|
|
8
|
+
mixins: [display]
|
|
15
9
|
}
|
|
16
10
|
|
|
17
11
|
set (text) {
|
package/src/list/add.js
CHANGED
package/src/list/request.js
CHANGED
package/src/module/build.js
CHANGED
|
@@ -7,9 +7,14 @@ import { create } from '../module/layout'
|
|
|
7
7
|
* @param {object} instance - The component instance to build.
|
|
8
8
|
*/
|
|
9
9
|
const build = (instance) => {
|
|
10
|
-
|
|
10
|
+
// console.log('name', instance.constructor.defaults)
|
|
11
|
+
const { tag = 'div', class: customClass, data, base, container, layout, icon, label, show } = instance.options
|
|
11
12
|
const { defaults = {} } = instance.constructor
|
|
12
13
|
|
|
14
|
+
if (instance.constructor?.defaults.class === 'length') {
|
|
15
|
+
console.log('---', instance.constructor.defaults)
|
|
16
|
+
}
|
|
17
|
+
|
|
13
18
|
instance.element = document.createElement(tag)
|
|
14
19
|
|
|
15
20
|
if (defaults.base) css.add(instance.element, defaults.base)
|
|
@@ -25,8 +30,8 @@ const build = (instance) => {
|
|
|
25
30
|
|
|
26
31
|
setupContainer(instance, base, container)
|
|
27
32
|
|
|
28
|
-
if (
|
|
29
|
-
setupLayout(instance,
|
|
33
|
+
if (layout) {
|
|
34
|
+
setupLayout(instance, layout)
|
|
30
35
|
}
|
|
31
36
|
|
|
32
37
|
instance.ui = instance.ui || {}
|
|
@@ -42,9 +47,13 @@ const setupContainer = (instance, base, container) => {
|
|
|
42
47
|
if (instance.container) instance.container.appendChild(instance.element)
|
|
43
48
|
}
|
|
44
49
|
|
|
45
|
-
const setupLayout = (instance,
|
|
46
|
-
instance.layout = create(
|
|
50
|
+
const setupLayout = (instance, layout) => {
|
|
51
|
+
instance.layout = create(layout, instance.element)
|
|
47
52
|
instance.ui = instance.layout.component
|
|
53
|
+
|
|
54
|
+
if (instance.constructor.name === 'Length') {
|
|
55
|
+
console.log(instance.ui)
|
|
56
|
+
}
|
|
48
57
|
}
|
|
49
58
|
|
|
50
59
|
function buildLabel ({ ui, options, element }) {
|