material 0.6.2 → 0.7.0
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/index.js +11 -2
- package/package.json +1 -1
- package/src/appbar.js +28 -28
- package/src/banner.js +20 -20
- package/src/button.js +18 -19
- package/src/calendar.js +8 -8
- package/src/card.js +4 -4
- package/src/checkbox.js +8 -8
- package/src/component.js +4 -4
- package/src/container.js +4 -4
- package/src/control/button.js +64 -92
- package/src/control/button.new.js +25 -25
- package/src/control/datehour.js +4 -4
- package/src/control/dialog.js +10 -10
- package/src/control/file.js +8 -8
- package/src/control/image.js +6 -6
- package/src/control/link.js +9 -9
- package/src/control/list.js +3 -3
- package/src/control/loading.js +10 -10
- package/src/control/menu.js +2 -2
- package/src/control/search.js +9 -9
- package/src/control/select.js +6 -6
- package/src/control/selecter.js +15 -15
- package/src/control/snackbar.js +7 -5
- package/src/control/switch.js +18 -18
- package/src/control/switcher.js +16 -16
- package/src/control/text.js +8 -8
- package/src/control/textfield.js +12 -12
- package/src/dialog.js +19 -19
- package/src/divider.js +4 -4
- package/src/drawer.js +11 -11
- package/src/field/email.js +5 -5
- package/src/field/image.js +4 -4
- package/src/form/build.js +7 -7
- package/src/form.js +6 -6
- package/src/icon.js +8 -8
- package/src/image.js +14 -14
- package/src/item.js +7 -7
- package/src/layout.js +10 -10
- package/src/list/add.js +1 -1
- package/src/list/build.js +7 -7
- package/src/list/display.js +10 -10
- package/src/list/search.js +2 -2
- package/src/list.js +13 -13
- package/src/map/build.js +6 -6
- package/src/map/display.js +8 -8
- package/src/menu.js +15 -15
- package/src/{component → mixin}/control.js +10 -10
- package/src/{component → mixin}/create.js +1 -1
- package/src/{module → mixin}/display.js +10 -22
- package/src/{component → mixin}/events.js +2 -2
- package/src/{component → mixin}/focus.js +2 -3
- package/src/{component → mixin}/insert.js +1 -1
- package/src/module/build.js +4 -3
- package/src/{component → module}/classify.js +0 -13
- package/src/module/dom.js +1 -57
- package/src/module/events.js +4 -2
- package/src/module/last.js +0 -0
- package/src/{component → module}/ripple.js +15 -42
- package/src/progress.js +7 -7
- package/src/select.js +16 -16
- package/src/selector.js +32 -32
- package/src/slider.js +32 -32
- package/src/snackbar.js +8 -8
- package/src/switch.js +9 -9
- package/src/tabs.js +8 -8
- package/src/tabview.js +8 -8
- package/src/text.js +5 -5
- package/src/textfield.js +16 -16
- package/src/toolbar.js +28 -28
- package/src/tooltip.js +11 -11
- package/src/tree.js +12 -16
- package/src/view/build.js +6 -6
- package/src/view/display.js +16 -16
- package/src/view.js +5 -5
- package/src/component/click.js +0 -17
- /package/src/{component → mixin}/controller.js +0 -0
- /package/src/{component → mixin}/emitter.js +0 -0
- /package/src/{component → mixin}/icon.js +0 -0
- /package/src/{component → mixin}/init.js +0 -0
- /package/src/{component → mixin}/label.js +0 -0
- /package/src/{component → mixin}/settings.js +0 -0
package/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import AppBar from 'material/src/appbar'
|
|
2
|
-
import Button from 'material/src/button'
|
|
2
|
+
import Button from 'material/src/control/button'
|
|
3
3
|
import Banner from 'material/src/banner'
|
|
4
4
|
import Calendar from 'material/src/calendar'
|
|
5
5
|
import Card from 'material/src/card'
|
|
@@ -27,7 +27,12 @@ import Textfield from 'material/src/textfield'
|
|
|
27
27
|
import Toolbar from 'material/src/toolbar'
|
|
28
28
|
import View from 'material/src/view'
|
|
29
29
|
import Tree from 'material/src/tree'
|
|
30
|
+
|
|
30
31
|
import emitter from 'material/src/module/emitter'
|
|
32
|
+
import mediator from 'material/src/module/mediator'
|
|
33
|
+
import display from 'material/src/mixin/display'
|
|
34
|
+
import build from 'material/src/module/build'
|
|
35
|
+
import jsontohtml from 'material/src/module/jsontohtml'
|
|
31
36
|
|
|
32
37
|
export {
|
|
33
38
|
AppBar,
|
|
@@ -59,5 +64,9 @@ export {
|
|
|
59
64
|
View,
|
|
60
65
|
Snackbar,
|
|
61
66
|
Progress,
|
|
62
|
-
emitter
|
|
67
|
+
emitter,
|
|
68
|
+
display,
|
|
69
|
+
build,
|
|
70
|
+
emitter,
|
|
71
|
+
mediator
|
|
63
72
|
}
|
package/package.json
CHANGED
package/src/appbar.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import passiveEvents from './module/passive'
|
|
2
|
-
import create from './
|
|
3
|
-
import insert from './
|
|
2
|
+
import create from './mixin/create'
|
|
3
|
+
import insert from './mixin/insert'
|
|
4
4
|
import offset from './element/offset'
|
|
5
5
|
|
|
6
6
|
const defaults = {
|
|
@@ -36,21 +36,21 @@ class AppBar {
|
|
|
36
36
|
* @return {Object} This class instance
|
|
37
37
|
*/
|
|
38
38
|
build () {
|
|
39
|
-
this.
|
|
39
|
+
this.element = create(this.options)
|
|
40
40
|
|
|
41
41
|
// console.log(this.options.height, this.options.fixed)
|
|
42
42
|
|
|
43
43
|
if (this.options.height) {
|
|
44
|
-
this.
|
|
44
|
+
this.element.style.height = this.options.height + 'px'
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
if (this.options.fixed) {
|
|
48
48
|
// console.log('is-fixed')
|
|
49
|
-
this.
|
|
49
|
+
this.element.classList.add('is-fixed')
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
if (this.options.flexible) {
|
|
53
|
-
this.
|
|
53
|
+
this.element.classList.add('is-flexible')
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
// if (this.options.container) {
|
|
@@ -61,13 +61,13 @@ class AppBar {
|
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
attach () {
|
|
64
|
-
this.
|
|
64
|
+
this.element.addEventListener('DOMNodeInserted', (e) => {
|
|
65
65
|
var textNode = e.target
|
|
66
|
-
if (textNode !== this.
|
|
66
|
+
if (textNode !== this.element) return
|
|
67
67
|
|
|
68
|
-
var size = this.size = offset(this.
|
|
68
|
+
var size = this.size = offset(this.element, 'height')
|
|
69
69
|
|
|
70
|
-
var view = this.view = this.
|
|
70
|
+
var view = this.view = this.element.parentNode
|
|
71
71
|
|
|
72
72
|
// console.log('view', view)
|
|
73
73
|
|
|
@@ -77,7 +77,7 @@ class AppBar {
|
|
|
77
77
|
|
|
78
78
|
var padding = window.getComputedStyle(view)['padding-' + p]
|
|
79
79
|
// console.log('paddingTop', padding)
|
|
80
|
-
// if (!padding) padding = window.getComputedStyle(this.
|
|
80
|
+
// if (!padding) padding = window.getComputedStyle(this.element.parentNode, 'padding')
|
|
81
81
|
// console.log('padding', padding)
|
|
82
82
|
|
|
83
83
|
padding = parseInt(padding, 10)
|
|
@@ -92,7 +92,7 @@ class AppBar {
|
|
|
92
92
|
|
|
93
93
|
if (document.body == view) {
|
|
94
94
|
// console.log('toolbar container body')
|
|
95
|
-
this.
|
|
95
|
+
this.element.classList.add('toolbar-body')
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
// console.log('p', p)
|
|
@@ -111,7 +111,7 @@ class AppBar {
|
|
|
111
111
|
set (prop, value) {
|
|
112
112
|
switch (prop) {
|
|
113
113
|
case 'minimize':
|
|
114
|
-
this.
|
|
114
|
+
this.element.setAttribute('style', 'height: 64px')
|
|
115
115
|
break
|
|
116
116
|
case 'value':
|
|
117
117
|
this.setValue(value)
|
|
@@ -154,9 +154,9 @@ class AppBar {
|
|
|
154
154
|
}
|
|
155
155
|
|
|
156
156
|
if (scrollTop > 0) {
|
|
157
|
-
this.
|
|
157
|
+
this.element.classList.add('is-scrolled')
|
|
158
158
|
} else {
|
|
159
|
-
this.
|
|
159
|
+
this.element.classList.remove('is-scrolled')
|
|
160
160
|
}
|
|
161
161
|
|
|
162
162
|
// console.log('scroll', scrollTop)
|
|
@@ -171,42 +171,42 @@ class AppBar {
|
|
|
171
171
|
}
|
|
172
172
|
|
|
173
173
|
flexible (e, scrollTop) {
|
|
174
|
-
var size = offset(this.
|
|
175
|
-
// console.log('flexible', size, this.
|
|
174
|
+
var size = offset(this.element, 'height')
|
|
175
|
+
// console.log('flexible', size, this.element.offsetHeight, scrollTop)
|
|
176
176
|
// if (scrollTop < this.size) {
|
|
177
177
|
//
|
|
178
178
|
var height = '64'
|
|
179
179
|
if (size < height) {
|
|
180
|
-
this.
|
|
180
|
+
this.element.style.height = height + 'px'
|
|
181
181
|
} else {
|
|
182
182
|
height = this.size - scrollTop
|
|
183
183
|
if (height < 64) height = 64
|
|
184
|
-
this.
|
|
184
|
+
this.element.style.height = height + 'px'
|
|
185
185
|
}
|
|
186
186
|
|
|
187
|
-
// console.log('scroll', this.
|
|
187
|
+
// console.log('scroll', this.element.style.top, scrollTop)
|
|
188
188
|
|
|
189
189
|
// if (scrollTop > 50) {
|
|
190
|
-
// this.
|
|
190
|
+
// this.element.style.trans = scrollTop + 'px'
|
|
191
191
|
// } else {
|
|
192
|
-
// this.
|
|
192
|
+
// this.element.style.top = scrollTop + 'px'
|
|
193
193
|
// }
|
|
194
194
|
// }
|
|
195
|
-
// this.
|
|
196
|
-
// this.
|
|
195
|
+
// this.element.style.top = scrollTop + 'px'
|
|
196
|
+
// this.element.style.height = this.size - scrollTop
|
|
197
197
|
// } else {
|
|
198
198
|
// console.log('size scroll', this.size, scrollTop)
|
|
199
199
|
|
|
200
|
-
// this.
|
|
201
|
-
// // this.
|
|
200
|
+
// this.element.style.height = this.size - scrollTop + 'px'
|
|
201
|
+
// // this.element.style.top = scrollTop + 'px'
|
|
202
202
|
// }
|
|
203
203
|
}
|
|
204
204
|
|
|
205
205
|
fixed (e, scrollTop) {
|
|
206
206
|
if (scrollTop > 0) {
|
|
207
|
-
this.
|
|
207
|
+
this.element.style.transform = 'translateY(' + scrollTop + 'px)'
|
|
208
208
|
} else {
|
|
209
|
-
this.
|
|
209
|
+
this.element.style.transform = 'translateY(' + scrollTop + 'px)'
|
|
210
210
|
}
|
|
211
211
|
}
|
|
212
212
|
|
package/src/banner.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
import create from './
|
|
3
|
+
import create from './mixin/create'
|
|
4
4
|
import insert from './element/insert'
|
|
5
5
|
import event from './element/event'
|
|
6
6
|
import offset from './element/offset'
|
|
@@ -53,17 +53,17 @@ class Banner {
|
|
|
53
53
|
* @return {Object} This class instance
|
|
54
54
|
*/
|
|
55
55
|
build () {
|
|
56
|
-
this.
|
|
56
|
+
this.element = create(this.options)
|
|
57
57
|
|
|
58
58
|
if (this.options.container) {
|
|
59
|
-
insert(this.
|
|
59
|
+
insert(this.element, this.options.container)
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
return this
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
attach () {
|
|
66
|
-
event.add(this.
|
|
66
|
+
event.add(this.element, 'click', (ev) => {
|
|
67
67
|
// console.log('click', ev.target)
|
|
68
68
|
|
|
69
69
|
if (ev.target && ev.target.classList.contains('material-button')) {
|
|
@@ -76,18 +76,18 @@ class Banner {
|
|
|
76
76
|
ev.stopPropagation()
|
|
77
77
|
})
|
|
78
78
|
|
|
79
|
-
this.
|
|
79
|
+
this.element.addEventListener('DOMNodeInserted', (e) => {
|
|
80
80
|
// console.log('DOMNodeInserted', e.target)
|
|
81
81
|
var textNode = e.target
|
|
82
82
|
|
|
83
|
-
if (textNode == this.
|
|
83
|
+
if (textNode == this.element) {
|
|
84
84
|
// console.log('banner root inserted', e.target)
|
|
85
85
|
if (!this.wrapper) { this.wrap() }
|
|
86
86
|
this.scroll(this.view)
|
|
87
87
|
}
|
|
88
88
|
this.updatePaddingView()
|
|
89
89
|
|
|
90
|
-
// if (textNode !== this.
|
|
90
|
+
// if (textNode !== this.element) return
|
|
91
91
|
})
|
|
92
92
|
}
|
|
93
93
|
|
|
@@ -106,34 +106,34 @@ class Banner {
|
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
wrap () {
|
|
109
|
-
this.view = this.
|
|
109
|
+
this.view = this.element.parentNode
|
|
110
110
|
|
|
111
|
-
// console.log('wrap', this.
|
|
111
|
+
// console.log('wrap', this.element, this.view)
|
|
112
112
|
this.wrapper = document.createElement('div')
|
|
113
113
|
|
|
114
114
|
this.wrapper.classList.add('banner-wrapper')
|
|
115
115
|
|
|
116
|
-
this.view.insertBefore(this.wrapper, this.
|
|
116
|
+
this.view.insertBefore(this.wrapper, this.element)
|
|
117
117
|
|
|
118
|
-
this.wrapper.appendChild(this.
|
|
118
|
+
this.wrapper.appendChild(this.element)
|
|
119
119
|
|
|
120
|
-
// insert(this.wrapper, this.
|
|
120
|
+
// insert(this.wrapper, this.element, 'before')
|
|
121
121
|
|
|
122
|
-
// insert(this.
|
|
122
|
+
// insert(this.element, this.wrapper)
|
|
123
123
|
}
|
|
124
124
|
|
|
125
125
|
updatePaddingView () {
|
|
126
126
|
// console.log('updatePaddingView', this.view)
|
|
127
127
|
|
|
128
|
-
this.height = offset(this.
|
|
128
|
+
this.height = offset(this.element, 'height')
|
|
129
129
|
if (!this.paddingview) {
|
|
130
130
|
this.paddingview = window.getComputedStyle(this.view)['padding-top']
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
-
// this.
|
|
133
|
+
// this.element.style.top = 'top: ' + this.paddingview
|
|
134
134
|
|
|
135
135
|
// console.log('paddingTop', padding)
|
|
136
|
-
// if (!padding) padding = window.getComputedStyle(this.
|
|
136
|
+
// if (!padding) padding = window.getComputedStyle(this.element.parentNode, 'padding')
|
|
137
137
|
// console.log('padding', padding)
|
|
138
138
|
|
|
139
139
|
var padding = parseInt(this.paddingview, 10)
|
|
@@ -155,7 +155,7 @@ class Banner {
|
|
|
155
155
|
}
|
|
156
156
|
|
|
157
157
|
scroll (view) {
|
|
158
|
-
// console.log('initScroll', offset(this.
|
|
158
|
+
// console.log('initScroll', offset(this.element, 'top'), offset(view, 'top'))
|
|
159
159
|
|
|
160
160
|
var isBody = false
|
|
161
161
|
|
|
@@ -188,8 +188,8 @@ class Banner {
|
|
|
188
188
|
scrollTop = view.scrollTop
|
|
189
189
|
}
|
|
190
190
|
|
|
191
|
-
// var o = offset(this.
|
|
192
|
-
// console.log('o', this.
|
|
191
|
+
// var o = offset(this.element, 'top') - offset(view, 'top')
|
|
192
|
+
// console.log('o', this.element.offsetTop)
|
|
193
193
|
|
|
194
194
|
var padding = this.paddingview
|
|
195
195
|
padding = parseInt(padding, 10)
|
|
@@ -222,7 +222,7 @@ class Banner {
|
|
|
222
222
|
}
|
|
223
223
|
|
|
224
224
|
insert (container, context) {
|
|
225
|
-
insert(this.
|
|
225
|
+
insert(this.element, container, context)
|
|
226
226
|
|
|
227
227
|
return this
|
|
228
228
|
}
|
package/src/button.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
import create from './
|
|
4
|
-
import control from './
|
|
5
|
-
import ripple from './
|
|
3
|
+
import create from './mixin/create'
|
|
4
|
+
import control from './mixin/control'
|
|
5
|
+
import ripple from './module/ripple'
|
|
6
6
|
|
|
7
7
|
import insert from './element/insert'
|
|
8
8
|
|
|
@@ -13,7 +13,7 @@ const defaults = {
|
|
|
13
13
|
prefix: 'material',
|
|
14
14
|
class: 'button',
|
|
15
15
|
tag: 'button',
|
|
16
|
-
ripple:
|
|
16
|
+
ripple: true,
|
|
17
17
|
events: [
|
|
18
18
|
['root.click', 'handleClick'],
|
|
19
19
|
['root.mouseover', 'handleMouseOver']
|
|
@@ -63,9 +63,6 @@ class Button {
|
|
|
63
63
|
this.element = this.element || {}
|
|
64
64
|
|
|
65
65
|
// init module$
|
|
66
|
-
if (this.options.ripple) {
|
|
67
|
-
ripple(this)
|
|
68
|
-
}
|
|
69
66
|
|
|
70
67
|
this.emit('init')
|
|
71
68
|
}
|
|
@@ -78,21 +75,21 @@ class Button {
|
|
|
78
75
|
build () {
|
|
79
76
|
this.element = {}
|
|
80
77
|
|
|
81
|
-
this.
|
|
78
|
+
this.element = create(this.options)
|
|
82
79
|
|
|
83
80
|
this.options.label = this.options.label || this.options.text
|
|
84
81
|
|
|
85
|
-
this.
|
|
82
|
+
this.element.setAttribute('aria-label', this.options.label || this.options.name)
|
|
86
83
|
|
|
87
84
|
if (this.options.title) {
|
|
88
|
-
this.
|
|
85
|
+
this.element.setAttribute('title', this.options.title)
|
|
89
86
|
}
|
|
90
87
|
|
|
91
88
|
this.label(this.options.label)
|
|
92
89
|
this.icon(this.options.icon)
|
|
93
90
|
|
|
94
91
|
if (this.options.tooltip) {
|
|
95
|
-
this.
|
|
92
|
+
this.element.dataset.tooltip = this.options.tooltip
|
|
96
93
|
}
|
|
97
94
|
|
|
98
95
|
if (this.options.container) {
|
|
@@ -101,10 +98,12 @@ class Button {
|
|
|
101
98
|
} else {
|
|
102
99
|
this.container = this.options.container
|
|
103
100
|
}
|
|
104
|
-
insert(this.
|
|
101
|
+
insert(this.element, this.options.container)
|
|
105
102
|
}
|
|
106
103
|
|
|
107
|
-
|
|
104
|
+
if (this.options.ripple) {
|
|
105
|
+
ripple(this.element)
|
|
106
|
+
}
|
|
108
107
|
|
|
109
108
|
return this
|
|
110
109
|
}
|
|
@@ -116,7 +115,7 @@ class Button {
|
|
|
116
115
|
* @return {?} [description]
|
|
117
116
|
*/
|
|
118
117
|
insert (container, context) {
|
|
119
|
-
insert(this.
|
|
118
|
+
insert(this.element, container, context)
|
|
120
119
|
|
|
121
120
|
return this
|
|
122
121
|
}
|
|
@@ -126,18 +125,18 @@ class Button {
|
|
|
126
125
|
* @return {?} [description]
|
|
127
126
|
*/
|
|
128
127
|
setup () {
|
|
129
|
-
this.element.input = this.
|
|
128
|
+
this.element.input = this.element
|
|
130
129
|
|
|
131
130
|
if (this.options.name) {
|
|
132
|
-
this.
|
|
131
|
+
this.element.dataset.name = this.options.name
|
|
133
132
|
}
|
|
134
133
|
|
|
135
134
|
// if (this.options.label) {
|
|
136
|
-
// this.
|
|
135
|
+
// this.element.title = this.options.label
|
|
137
136
|
// }
|
|
138
137
|
|
|
139
138
|
if (this.options.content) {
|
|
140
|
-
this.
|
|
139
|
+
this.element.innerHTML = this.options.content
|
|
141
140
|
}
|
|
142
141
|
|
|
143
142
|
if (this.options.disabled === true) {
|
|
@@ -195,7 +194,7 @@ class Button {
|
|
|
195
194
|
}
|
|
196
195
|
|
|
197
196
|
destroy () {
|
|
198
|
-
this.container.removeChild(this.
|
|
197
|
+
this.container.removeChild(this.element)
|
|
199
198
|
}
|
|
200
199
|
|
|
201
200
|
/**
|
package/src/calendar.js
CHANGED
|
@@ -112,12 +112,12 @@ class Calendar {
|
|
|
112
112
|
// define main tag
|
|
113
113
|
var tag = this.options.tag || 'div'
|
|
114
114
|
|
|
115
|
-
this.
|
|
115
|
+
this.element = create(tag, this.options.prefix + '-' + this.options.class)
|
|
116
116
|
|
|
117
117
|
this.buildWeek()
|
|
118
118
|
|
|
119
119
|
if (this.options.container) {
|
|
120
|
-
insert(this.
|
|
120
|
+
insert(this.element, this.options.container)
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
return this
|
|
@@ -143,7 +143,7 @@ class Calendar {
|
|
|
143
143
|
*/
|
|
144
144
|
buildHeader () {
|
|
145
145
|
this.header = create('header')
|
|
146
|
-
insert(this.header, this.
|
|
146
|
+
insert(this.header, this.element)
|
|
147
147
|
|
|
148
148
|
this.buildHeadline()
|
|
149
149
|
|
|
@@ -266,7 +266,7 @@ class Calendar {
|
|
|
266
266
|
|
|
267
267
|
this.body = create('div')
|
|
268
268
|
css.add(this.body, this.options.class + '-body')
|
|
269
|
-
insert(this.body, this.
|
|
269
|
+
insert(this.body, this.element)
|
|
270
270
|
|
|
271
271
|
var hours = create('div')
|
|
272
272
|
css.add(hours, 'hours')
|
|
@@ -422,7 +422,7 @@ class Calendar {
|
|
|
422
422
|
next () {
|
|
423
423
|
this.firstDay.setDate(this.firstDay.getDate() + this.options.rangedays)
|
|
424
424
|
|
|
425
|
-
this.
|
|
425
|
+
this.element.innerHTML = ''
|
|
426
426
|
|
|
427
427
|
this.buildWeek()
|
|
428
428
|
}
|
|
@@ -434,7 +434,7 @@ class Calendar {
|
|
|
434
434
|
back () {
|
|
435
435
|
this.firstDay.setDate(this.firstDay.getDate() - this.options.rangedays)
|
|
436
436
|
|
|
437
|
-
this.
|
|
437
|
+
this.element.innerHTML = ''
|
|
438
438
|
|
|
439
439
|
this.buildWeek()
|
|
440
440
|
}
|
|
@@ -448,7 +448,7 @@ class Calendar {
|
|
|
448
448
|
date = date || new Date()
|
|
449
449
|
|
|
450
450
|
this.firstDay = this.getFirstDayOfWeek(this.date)
|
|
451
|
-
this.
|
|
451
|
+
this.element.innerHTML = ''
|
|
452
452
|
|
|
453
453
|
this.buildWeek()
|
|
454
454
|
}
|
|
@@ -459,7 +459,7 @@ class Calendar {
|
|
|
459
459
|
|
|
460
460
|
empty () {
|
|
461
461
|
console.log('empty')
|
|
462
|
-
this.
|
|
462
|
+
this.element.innerHTML = ''
|
|
463
463
|
}
|
|
464
464
|
}
|
|
465
465
|
|
package/src/card.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
3
|
// import modules
|
|
4
|
-
import create from './
|
|
5
|
-
import insert from './
|
|
4
|
+
import create from './mixin/create'
|
|
5
|
+
import insert from './mixin/insert'
|
|
6
6
|
// import components
|
|
7
7
|
import Layout from './layout'
|
|
8
8
|
|
|
@@ -33,10 +33,10 @@ class Card {
|
|
|
33
33
|
* @return {Object} The class instance
|
|
34
34
|
*/
|
|
35
35
|
build () {
|
|
36
|
-
this.
|
|
36
|
+
this.element = create(this.options)
|
|
37
37
|
|
|
38
38
|
if (this.options.layout) {
|
|
39
|
-
this.layout = new Layout(this.options.layout, this.
|
|
39
|
+
this.layout = new Layout(this.options.layout, this.element)
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
}
|
package/src/checkbox.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
import events from './
|
|
4
|
-
import control from './
|
|
5
|
-
import label from './
|
|
3
|
+
import events from './mixin/events'
|
|
4
|
+
import control from './mixin/control'
|
|
5
|
+
import label from './mixin/label'
|
|
6
6
|
|
|
7
7
|
import insert from './element/insert'
|
|
8
8
|
import build from './element/build'
|
|
@@ -79,13 +79,13 @@ class Checkbox {
|
|
|
79
79
|
*/
|
|
80
80
|
build () {
|
|
81
81
|
this.element = build(this.options.build)
|
|
82
|
-
this.
|
|
82
|
+
this.element = this.element.root
|
|
83
83
|
|
|
84
84
|
this.element.control.innerHTML = icon
|
|
85
85
|
|
|
86
86
|
var text = this.options.text || this.options.label
|
|
87
87
|
|
|
88
|
-
this.element.label = label(this.
|
|
88
|
+
this.element.label = label(this.element, text, this.options)
|
|
89
89
|
|
|
90
90
|
this.element.input.setAttribute('type', 'checkbox')
|
|
91
91
|
this.element.input.setAttribute('name', this.options.name)
|
|
@@ -98,7 +98,7 @@ class Checkbox {
|
|
|
98
98
|
if (this.options.disabled) {
|
|
99
99
|
this.disabled = this.options.disabled
|
|
100
100
|
this.element.input.setAttribute('disabled', 'disabled')
|
|
101
|
-
css.add(this.
|
|
101
|
+
css.add(this.element, 'is-disabled')
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
if (this.options.checked) {
|
|
@@ -111,7 +111,7 @@ class Checkbox {
|
|
|
111
111
|
|
|
112
112
|
// insert if container options is given
|
|
113
113
|
if (this.options.container) {
|
|
114
|
-
insert(this.
|
|
114
|
+
insert(this.element, this.options.container)
|
|
115
115
|
}
|
|
116
116
|
|
|
117
117
|
return this
|
|
@@ -148,7 +148,7 @@ class Checkbox {
|
|
|
148
148
|
* @return {?} [description]
|
|
149
149
|
*/
|
|
150
150
|
insert (container, context) {
|
|
151
|
-
insert(this.
|
|
151
|
+
insert(this.element, container, context)
|
|
152
152
|
|
|
153
153
|
return this
|
|
154
154
|
}
|
package/src/component.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
import create from './
|
|
4
|
-
import events from './
|
|
5
|
-
import insert from './
|
|
3
|
+
import create from './mixin/create'
|
|
4
|
+
import events from './mixin/events'
|
|
5
|
+
import insert from './mixin/insert'
|
|
6
6
|
|
|
7
7
|
import emitter from './module/emitter'
|
|
8
8
|
|
|
@@ -59,7 +59,7 @@ class Component {
|
|
|
59
59
|
* @return {Object} This class instance
|
|
60
60
|
*/
|
|
61
61
|
build () {
|
|
62
|
-
this.
|
|
62
|
+
this.element = create(this.options)
|
|
63
63
|
|
|
64
64
|
if (this.options.container) {
|
|
65
65
|
this.insert(this.options.container)
|
package/src/container.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
import create from './
|
|
3
|
+
import create from './mixin/create'
|
|
4
4
|
import insert from './element/insert'
|
|
5
5
|
import emitter from './module/emitter'
|
|
6
6
|
|
|
@@ -50,17 +50,17 @@ class Container {
|
|
|
50
50
|
* @return {Object} This class instance
|
|
51
51
|
*/
|
|
52
52
|
build () {
|
|
53
|
-
this.
|
|
53
|
+
this.element = create(this.options)
|
|
54
54
|
|
|
55
55
|
if (this.options.container) {
|
|
56
|
-
insert(this.
|
|
56
|
+
insert(this.element, this.options.container)
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
return this
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
insert (container, context) {
|
|
63
|
-
insert(this.
|
|
63
|
+
insert(this.element, container, context)
|
|
64
64
|
return this
|
|
65
65
|
}
|
|
66
66
|
}
|