material 0.7.4 → 0.7.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/index.js +2 -1
- package/package.json +3 -3
- package/src/button.js +7 -33
- package/src/card.js +0 -5
- package/src/element/insert.js +3 -1
- package/src/file.js +0 -10
- package/src/item.js +28 -78
- package/src/loader.js +88 -0
- package/src/mixin/control.js +0 -35
- package/src/mixin/display.js +1 -16
- package/src/mixin/label.js +0 -4
- package/src/module/attach.js +3 -9
- package/src/module/attributes.js +7 -14
- package/src/module/build.js +25 -0
- package/src/module/cookie.js +24 -0
- package/src/module/last.js +6 -16
- package/src/module/numabbr.js +28 -0
- package/src/module/object.js +2 -2
- package/src/module/observer.js +2 -2
- package/src/module/passive.js +1 -1
- package/src/module/remove.js +3 -38
- package/src/module/request.js +0 -1
- package/src/module/ripple.js +2 -1
- package/src/module/touch.js +1 -1
- package/src/module/utils.js +0 -31
- package/src/module/viewport.js +4 -10
- package/src/navigation.js +55 -5
- package/src/skin/material/control/snackbar.sass +1 -1
- package/src/styles/M3/app/index.sass +19 -0
- package/src/styles/M3/base/body.sass +55 -0
- package/src/styles/M3/base/elevation.sass +50 -0
- package/src/styles/M3/base/grid.sass +63 -0
- package/src/styles/M3/base/typo.sass +107 -0
- package/src/styles/M3/components/button.sass +15 -2
- package/src/styles/M3/navigation/rail.sass +72 -0
- package/src/styles/M3/view/view.sass +2 -0
- package/src/switch.js +2 -37
- package/src/text.js +8 -0
- package/src/view.js +1 -2
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
.navigation.type-rail
|
|
2
|
+
flex: none
|
|
3
|
+
color: rgba(255, 255, 255, .87)
|
|
4
|
+
display: flex
|
|
5
|
+
overflow: hidden
|
|
6
|
+
flex-direction: column
|
|
7
|
+
width: 12px
|
|
8
|
+
padding-top: 56px
|
|
9
|
+
background-color: #2D2F31
|
|
10
|
+
margin: 0
|
|
11
|
+
transition: .1s linear width
|
|
12
|
+
&.show
|
|
13
|
+
width: 92px
|
|
14
|
+
.body
|
|
15
|
+
opacity: 1
|
|
16
|
+
transition: .1s opacity linear
|
|
17
|
+
.body
|
|
18
|
+
opacity: 0
|
|
19
|
+
flex: 1
|
|
20
|
+
flex-direction: column
|
|
21
|
+
width: 92px
|
|
22
|
+
padding: 0 0
|
|
23
|
+
margin: 0
|
|
24
|
+
transition: .1s opacity linear
|
|
25
|
+
.item
|
|
26
|
+
flex: none
|
|
27
|
+
display: flex
|
|
28
|
+
flex-direction: column
|
|
29
|
+
height: 64px
|
|
30
|
+
margin: 0
|
|
31
|
+
border-radius: 0
|
|
32
|
+
text-align: center
|
|
33
|
+
padding: 10px 0 6px
|
|
34
|
+
font-size: 0.8rem
|
|
35
|
+
text-transform: none
|
|
36
|
+
text-align: center
|
|
37
|
+
align-items: center
|
|
38
|
+
justify-content: center
|
|
39
|
+
&.selected, &.selected:hover
|
|
40
|
+
background-color: transparent
|
|
41
|
+
.icon
|
|
42
|
+
background-color: #004A77
|
|
43
|
+
svg
|
|
44
|
+
fill: #C2E8FF
|
|
45
|
+
.icon
|
|
46
|
+
width: 60px
|
|
47
|
+
pointer-events: none
|
|
48
|
+
padding: 0
|
|
49
|
+
border-radius: 21px
|
|
50
|
+
margin: 0
|
|
51
|
+
height: 32px
|
|
52
|
+
padding: 4px 0
|
|
53
|
+
align-items: center
|
|
54
|
+
justify-content: center
|
|
55
|
+
svg
|
|
56
|
+
fill: rgba(255,255,255,.7)
|
|
57
|
+
.label
|
|
58
|
+
pointer-events: none
|
|
59
|
+
align-items: center
|
|
60
|
+
justify-content: center
|
|
61
|
+
text-align: center
|
|
62
|
+
flex: 1
|
|
63
|
+
color: rgba(255, 255, 255, 1)
|
|
64
|
+
text-transform: capitalize
|
|
65
|
+
font-size: .9em
|
|
66
|
+
text-align: center
|
|
67
|
+
padding: 0
|
|
68
|
+
margin: 0
|
|
69
|
+
&:hover
|
|
70
|
+
background-color: transaprent
|
|
71
|
+
.icon
|
|
72
|
+
background-color: rgba(255,255,255,.05)
|
package/src/switch.js
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
|
+
// base
|
|
1
2
|
import EventEmitter from './mixin/emitter'
|
|
2
|
-
|
|
3
3
|
// module
|
|
4
4
|
import build from './module/build'
|
|
5
5
|
import dataset from './module/dataset'
|
|
6
6
|
import attach from './module/attach'
|
|
7
7
|
import attributes from './module/attributes'
|
|
8
|
-
|
|
9
8
|
// ui
|
|
10
|
-
import Layout from './layout'
|
|
11
9
|
import Element from './element'
|
|
12
10
|
|
|
13
11
|
class Switch extends EventEmitter {
|
|
@@ -33,6 +31,7 @@ class Switch extends EventEmitter {
|
|
|
33
31
|
}
|
|
34
32
|
|
|
35
33
|
constructor (options) {
|
|
34
|
+
// console.log('switch')
|
|
36
35
|
super()
|
|
37
36
|
|
|
38
37
|
this.init(options)
|
|
@@ -51,9 +50,6 @@ class Switch extends EventEmitter {
|
|
|
51
50
|
setup () {
|
|
52
51
|
this.styleAttributes()
|
|
53
52
|
|
|
54
|
-
this.buildIcon()
|
|
55
|
-
this.buildLabel()
|
|
56
|
-
|
|
57
53
|
if (this.options.data) {
|
|
58
54
|
dataset(this.element, this.options.data)
|
|
59
55
|
}
|
|
@@ -80,31 +76,6 @@ class Switch extends EventEmitter {
|
|
|
80
76
|
}
|
|
81
77
|
}
|
|
82
78
|
|
|
83
|
-
buildLabel () {
|
|
84
|
-
// console.log('buildLabel', this.options.label)
|
|
85
|
-
if (!this.options.label) return
|
|
86
|
-
|
|
87
|
-
this.ui.label = document.createElement('label')
|
|
88
|
-
this.ui.label.classList.add('label')
|
|
89
|
-
this.ui.label.innerHTML = this.options.label
|
|
90
|
-
|
|
91
|
-
if (this.options.name) {
|
|
92
|
-
this.ui.label.setAttribute('for', this.options.name)
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
this.element.insertBefore(this.ui.label, this.ui.input)
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
buildIcon () {
|
|
99
|
-
if (!this.options.icon) return
|
|
100
|
-
|
|
101
|
-
this.ui.icon = document.createElement('i')
|
|
102
|
-
this.ui.icon.classList.add('icon')
|
|
103
|
-
this.ui.icon.innerHTML = this.options.icon
|
|
104
|
-
|
|
105
|
-
this.element.insertBefore(this.ui.icon, this.ui.input)
|
|
106
|
-
}
|
|
107
|
-
|
|
108
79
|
styleAttributes () {
|
|
109
80
|
if (this.options.style) {
|
|
110
81
|
this.element.classList.add('style-' + this.options.style)
|
|
@@ -123,12 +94,6 @@ class Switch extends EventEmitter {
|
|
|
123
94
|
}
|
|
124
95
|
}
|
|
125
96
|
|
|
126
|
-
/**
|
|
127
|
-
* Setter
|
|
128
|
-
* @param {string} prop
|
|
129
|
-
* @param {string} value
|
|
130
|
-
* @return {Object} The class instance
|
|
131
|
-
*/
|
|
132
97
|
set (prop, value, silent) {
|
|
133
98
|
switch (prop) {
|
|
134
99
|
case 'value':
|
package/src/text.js
CHANGED
package/src/view.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import EventEmitter from './mixin/emitter'
|
|
2
|
-
|
|
3
2
|
import build from './module/build'
|
|
4
3
|
|
|
5
4
|
class View extends EventEmitter {
|
|
@@ -16,7 +15,7 @@ class View extends EventEmitter {
|
|
|
16
15
|
}
|
|
17
16
|
|
|
18
17
|
init (options) {
|
|
19
|
-
this.options = Object.assign({}, defaults, options || {})
|
|
18
|
+
this.options = Object.assign({}, View.defaults, options || {})
|
|
20
19
|
Object.assign(this, build)
|
|
21
20
|
}
|
|
22
21
|
}
|