material 0.7.1 → 0.7.4
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/LICENSE +9 -18
- package/README.md +1 -5
- package/index.js +25 -48
- package/package.json +3 -24
- package/src/badge.js +1 -1
- package/src/button.js +50 -100
- package/src/calendar.js +53 -53
- package/src/card.js +1 -1
- package/src/checkbox.js +52 -104
- package/src/datehour.js +7 -7
- package/src/dialog.js +5 -5
- package/src/divider.js +1 -1
- package/src/drawer.js +1 -17
- package/src/element/attribute.js +7 -10
- package/src/element/build.js +6 -7
- package/src/element/create.js +3 -6
- package/src/element/event.js +2 -2
- package/src/element/insert.js +9 -20
- package/src/element/observer.js +22 -0
- package/src/element/offset.js +2 -2
- package/src/element/style.js +12 -12
- package/src/element.js +2 -2
- package/src/file.js +1 -1
- package/src/form/build.js +7 -7
- package/src/form/controller.js +8 -8
- package/src/form/create.js +1 -1
- package/src/form/data.js +9 -9
- package/src/form/delete.js +1 -1
- package/src/form/render.js +9 -9
- package/src/form/set.js +1 -1
- package/src/form/submit.js +6 -6
- package/src/form/update.js +3 -3
- package/src/form/verify.js +4 -4
- package/src/form.js +9 -9
- package/src/icon.js +4 -4
- package/src/image.js +7 -7
- package/src/item.js +1 -1
- package/src/layout.js +14 -14
- package/src/link.js +1 -1
- package/src/list/build.js +8 -8
- package/src/list/click.js +3 -3
- package/src/list/filter.js +11 -11
- package/src/list/image.js +3 -3
- package/src/list/render.js +15 -15
- package/src/list/request.js +7 -7
- package/src/list/search.js +9 -9
- package/src/list/select.js +18 -18
- package/src/list/status.js +1 -1
- package/src/list/update.js +6 -6
- package/src/list/virtual.js +20 -20
- package/src/list/virtual.new.js +5 -5
- package/src/list.js +8 -10
- package/src/map/build.js +2 -2
- package/src/map/countries.js +8 -8
- package/src/map/display.js +13 -13
- package/src/map/focus.js +7 -7
- package/src/map/select.js +2 -2
- package/src/map/set.js +3 -3
- package/src/map/viewport.js +11 -11
- package/src/menu.js +12 -12
- package/src/mixin/control.js +3 -3
- package/src/mixin/controller.js +5 -5
- package/src/mixin/create.js +1 -1
- package/src/mixin/display.js +1 -1
- package/src/mixin/events.js +4 -16
- package/src/mixin/focus.js +1 -1
- package/src/mixin/icon.js +2 -2
- package/src/mixin/init.js +2 -2
- package/src/mixin/insert.js +5 -5
- package/src/mixin/label.js +2 -2
- package/src/mixin/settings.js +5 -5
- package/src/module/attach.js +35 -49
- package/src/module/attributes.js +2 -2
- package/src/module/build.js +6 -11
- package/src/module/classify.js +4 -4
- package/src/module/controller.js +5 -32
- package/src/module/css.js +12 -84
- package/src/module/dataset.js +1 -1
- package/src/module/dom.js +9 -3
- package/src/module/dot.js +4 -4
- package/src/module/emitter.js +1 -1
- package/src/module/event.js +2 -2
- package/src/module/events.js +29 -35
- package/src/module/extract.js +10 -10
- package/src/module/last.js +18 -0
- package/src/module/mediator.js +1 -13
- package/src/module/object.js +4 -4
- package/src/module/observer.js +43 -16
- package/src/module/remove.js +10 -10
- package/src/module/request.js +33 -0
- package/src/module/ripple.js +19 -24
- package/src/module/scrollbar.js +10 -14
- package/src/module/smoothscroll.js +5 -9
- package/src/module/utils.js +14 -23
- package/src/module/viewport.js +5 -5
- package/src/navigation.js +7 -1
- package/src/progress.js +1 -9
- package/src/search.js +24 -29
- package/src/select.js +6 -6
- package/src/selecter.js +39 -39
- package/src/selector.js +3 -3
- package/src/skin/material/button/action.sass +6 -6
- package/src/skin/material/button/button.sass +6 -6
- package/src/skin/material/button/file.sass +1 -1
- package/src/skin/material/button/floating.sass +5 -5
- package/src/skin/material/button/raised.sass +5 -5
- package/src/skin/material/button/stroked.sass +5 -5
- package/src/skin/material/component/navigation.sass +13 -1
- package/src/skin/material/control/checkbox.sass +21 -21
- package/src/skin/material/module/ripple.sass +1 -1
- package/src/slider.js +1 -1
- package/src/snackbar.js +12 -9
- package/src/styles/M3/abstracts/variables.sass +44 -0
- package/src/styles/M3/components/button.sass +26 -0
- package/src/styles/M3/modules/ripple.sass +9 -0
- package/src/styles/M3/themes/classic.sass +2 -0
- package/src/switch.js +1 -1
- package/src/switcher.js +15 -15
- package/src/tabs.js +6 -8
- package/src/tabview.js +26 -46
- package/src/text.js +1 -1
- package/src/textfield.js +1 -1
- package/src/toolbar.js +12 -12
- package/src/tooltip.js +7 -7
- package/src/tree.js +10 -66
- package/src/view/build.js +2 -2
- package/src/view/dataset.js +1 -1
- package/src/view.js +9 -74
- package/dist/demo-bundle.js +0 -2
- package/dist/demo-bundle.js.map +0 -1
- package/dist/demo.css +0 -93
- package/dist/demo.css.map +0 -7
- package/dist/demo.html +0 -24
- package/dist/demo.js +0 -159
- package/dist/icon/accessibility.svg +0 -5
- package/dist/icon/apps.svg +0 -5
- package/dist/icon/happy.svg +0 -6
- package/dist/icon/link.svg +0 -5
- package/dist/icon/more.svg +0 -5
- package/dist/icon/navi.svg +0 -5
- package/dist/icon/phone.svg +0 -6
- package/dist/icon/share.svg +0 -6
- package/dist/icon/side.svg +0 -5
- package/dist/icon/star.svg +0 -7
- package/dist/icon/star_border.svg +0 -6
- package/dist/material.css +0 -2429
- package/dist/material.css.map +0 -7
- package/dist/styles/demo.sass +0 -110
- package/dist/styles.css +0 -23
- package/rollup.config.js +0 -34
- package/src/container.js +0 -66
- package/src/element/ripple.js +0 -90
- package/src/field/email.js +0 -59
- package/src/field/image.js +0 -93
- package/src/module/addclass.js +0 -16
package/src/select.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import EventEmitter from './mixin/emitter'
|
|
2
|
-
|
|
2
|
+
// modules
|
|
3
3
|
import build from './module/build'
|
|
4
4
|
import attach from './module/attach'
|
|
5
5
|
import attributes from './module/attributes'
|
|
6
|
-
import dataset from './
|
|
6
|
+
import dataset from './module/dataset'
|
|
7
7
|
|
|
8
8
|
class Select extends EventEmitter {
|
|
9
9
|
static defaults = {
|
|
@@ -23,7 +23,7 @@ class Select extends EventEmitter {
|
|
|
23
23
|
this.attach()
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
init(options) {
|
|
26
|
+
init (options) {
|
|
27
27
|
this.options = Object.assign({}, Select.defaults, options || {})
|
|
28
28
|
Object.assign(this, build, attach, dataset)
|
|
29
29
|
}
|
|
@@ -61,13 +61,13 @@ class Select extends EventEmitter {
|
|
|
61
61
|
setOptions (options) {
|
|
62
62
|
// console.log('buildCountry', this.input)
|
|
63
63
|
|
|
64
|
-
|
|
64
|
+
const first = this.options.first
|
|
65
65
|
|
|
66
66
|
if (first && first[0] && first[1]) {
|
|
67
67
|
this.input.options[0] = new Option(first[1], first[0])
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
for (
|
|
70
|
+
for (let i = 0; i < options.length; i++) {
|
|
71
71
|
this.addOption(options[i][1], options[i][0])
|
|
72
72
|
}
|
|
73
73
|
}
|
|
@@ -96,7 +96,7 @@ class Select extends EventEmitter {
|
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
get () {
|
|
99
|
-
|
|
99
|
+
let value = null
|
|
100
100
|
|
|
101
101
|
if (this.input[this.input.selectedIndex]) {
|
|
102
102
|
value = this.input[this.input.selectedIndex].value
|
package/src/selecter.js
CHANGED
|
@@ -1,52 +1,50 @@
|
|
|
1
|
-
import
|
|
1
|
+
import EventEmitter from './mixin/emitter'
|
|
2
|
+
// modules
|
|
2
3
|
import attach from './module/attach'
|
|
3
|
-
import dataset from './
|
|
4
|
+
import dataset from './module/dataset'
|
|
4
5
|
import attributes from './module/attributes'
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
// ui
|
|
6
|
+
import * as css from './module/css'
|
|
7
|
+
// components
|
|
8
8
|
import Layout from './layout'
|
|
9
9
|
import Element from './element'
|
|
10
10
|
import Button from './button'
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
[Element, '
|
|
22
|
-
[Element, '
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
12
|
+
class Selecter extends EventEmitter {
|
|
13
|
+
static defaults = {
|
|
14
|
+
class: 'selecter',
|
|
15
|
+
first: null,
|
|
16
|
+
attributes: ['type', 'name', 'autocomplete', 'required'],
|
|
17
|
+
layout: [
|
|
18
|
+
[Element, 'label', { tag: 'label', class: 'label' }],
|
|
19
|
+
[Element, 'value', { tag: 'value', class: 'value' }],
|
|
20
|
+
[Element, 'input', { tag: 'input', type: 'text', class: 'input' }],
|
|
21
|
+
[Element, 'list', { class: 'list' },
|
|
22
|
+
[Element, 'head', { class: 'head' },
|
|
23
|
+
[Element, 'title', { class: 'title' }],
|
|
24
|
+
[Button, 'close', { class: 'close' }]
|
|
25
|
+
],
|
|
26
|
+
[Element, 'body', { class: 'body' }]
|
|
27
|
+
]
|
|
28
|
+
],
|
|
29
|
+
events: [
|
|
30
|
+
['ui.value.click', 'showList'],
|
|
31
|
+
['ui.list.click', 'select'],
|
|
32
|
+
['ui.close.click', 'hideList']
|
|
26
33
|
]
|
|
27
|
-
|
|
28
|
-
events: [
|
|
29
|
-
['ui.value.click', 'showList'],
|
|
30
|
-
['ui.list.click', 'select'],
|
|
31
|
-
['ui.close.click', 'hideList']
|
|
32
|
-
]
|
|
33
|
-
}
|
|
34
|
+
}
|
|
34
35
|
|
|
35
|
-
class Selecter {
|
|
36
|
-
/**
|
|
37
|
-
* Constructor
|
|
38
|
-
* @param {Object} options - Component options
|
|
39
|
-
* @return {Object} Class instance
|
|
40
|
-
*/
|
|
41
36
|
constructor (options) {
|
|
42
|
-
|
|
43
|
-
Object.assign(this, emitter, attach, dataset)
|
|
37
|
+
super()
|
|
44
38
|
|
|
39
|
+
this.init(options)
|
|
45
40
|
this.build()
|
|
46
41
|
this.setup()
|
|
47
42
|
this.attach()
|
|
43
|
+
}
|
|
48
44
|
|
|
49
|
-
|
|
45
|
+
init (options) {
|
|
46
|
+
this.options = Object.assign({}, Selecter.defaults, options || {})
|
|
47
|
+
Object.assign(this, attach, dataset)
|
|
50
48
|
}
|
|
51
49
|
|
|
52
50
|
setup () {
|
|
@@ -75,17 +73,18 @@ class Selecter {
|
|
|
75
73
|
this.element.classList.add(this.options.case + '-case')
|
|
76
74
|
}
|
|
77
75
|
}
|
|
76
|
+
|
|
78
77
|
/**
|
|
79
78
|
* build method
|
|
80
79
|
* @return {Object} The class instance
|
|
81
80
|
*/
|
|
82
81
|
build () {
|
|
83
|
-
|
|
82
|
+
const tag = this.options.tag || 'span'
|
|
84
83
|
this.element = document.createElement(tag)
|
|
85
84
|
this.element.classList.add('selecter')
|
|
86
85
|
|
|
87
86
|
if (this.options.class !== 'selecter') {
|
|
88
|
-
|
|
87
|
+
css.add(this.element, this.options.class)
|
|
89
88
|
}
|
|
90
89
|
|
|
91
90
|
this.layout = new Layout(this.options.layout, this.element)
|
|
@@ -138,9 +137,9 @@ class Selecter {
|
|
|
138
137
|
|
|
139
138
|
// console.log('list', list)
|
|
140
139
|
|
|
141
|
-
for (
|
|
140
|
+
for (let i = 0; i < list.length; i++) {
|
|
142
141
|
// if (list.indexOf(list[i][0]) > -1) {
|
|
143
|
-
|
|
142
|
+
const item = document.createElement('div')
|
|
144
143
|
item.classList.add('item')
|
|
145
144
|
item.innerHTML = list[i][1]
|
|
146
145
|
item.dataset.value = list[i][0]
|
|
@@ -169,6 +168,7 @@ class Selecter {
|
|
|
169
168
|
this.element.classList.add('bold')
|
|
170
169
|
}
|
|
171
170
|
}
|
|
171
|
+
|
|
172
172
|
showList () {
|
|
173
173
|
// console.log('showList')
|
|
174
174
|
|
package/src/selector.js
CHANGED
|
@@ -121,8 +121,8 @@ class Selector {
|
|
|
121
121
|
update (target) {
|
|
122
122
|
target = target || this.target
|
|
123
123
|
if (!target) return
|
|
124
|
-
|
|
125
|
-
|
|
124
|
+
const coords = target.getBoundingClientRect()
|
|
125
|
+
const pcoords = this.element.parentNode.getBoundingClientRect()
|
|
126
126
|
|
|
127
127
|
this.element.style.top = coords.top - pcoords.top + 'px'
|
|
128
128
|
this.element.style.left = coords.left - pcoords.left + 'px'
|
|
@@ -158,7 +158,7 @@ class Selector {
|
|
|
158
158
|
const offsetY = this.element.getBoundingClientRect().y
|
|
159
159
|
const element = document.body
|
|
160
160
|
|
|
161
|
-
|
|
161
|
+
const ratio = parseInt(this.element.style.width, 10) / parseInt(this.element.style.height, 10)
|
|
162
162
|
|
|
163
163
|
this.border.setPointerCapture(ev.pointerId)
|
|
164
164
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
// type action
|
|
3
|
-
.
|
|
3
|
+
.button.type-action
|
|
4
4
|
min-width: 36px
|
|
5
5
|
transition: box-shadow .2s
|
|
6
6
|
box-shadow: none
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
fill: $default-color-text
|
|
16
16
|
|
|
17
17
|
// styles
|
|
18
|
-
.
|
|
18
|
+
.button.type-action
|
|
19
19
|
&.style-dense,
|
|
20
20
|
&.style-compact
|
|
21
21
|
height: 32px
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
// states
|
|
35
|
-
.
|
|
35
|
+
.button.type-action
|
|
36
36
|
&:hover
|
|
37
37
|
//background-color: #E0E0E0;
|
|
38
38
|
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
//background-color: rgba(255, 255, 255, 1)
|
|
44
44
|
|
|
45
45
|
// color
|
|
46
|
-
.
|
|
46
|
+
.button.type-action
|
|
47
47
|
&.primary-color
|
|
48
48
|
background-color: $primary-color
|
|
49
49
|
color: $primary-color-text
|
|
@@ -65,8 +65,8 @@
|
|
|
65
65
|
|
|
66
66
|
|
|
67
67
|
// theme
|
|
68
|
-
.dark-mode .
|
|
69
|
-
.
|
|
68
|
+
.dark-mode .button.type-action,
|
|
69
|
+
.button.type-action.dark-mode
|
|
70
70
|
|
|
71
71
|
//background-color: rgba(255, 255, 255, 0.95)
|
|
72
72
|
color: $primary-color-text-dark
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.
|
|
1
|
+
.button
|
|
2
2
|
display: flex
|
|
3
3
|
-webkit-font-smoothing: antialiased
|
|
4
4
|
white-space: nowrap
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
order: 1
|
|
61
61
|
|
|
62
62
|
// states
|
|
63
|
-
.
|
|
63
|
+
.button
|
|
64
64
|
&.is-disabled
|
|
65
65
|
pointer-events: none
|
|
66
66
|
opacity: .3
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
opacity: .3
|
|
87
87
|
|
|
88
88
|
// styles
|
|
89
|
-
.
|
|
89
|
+
.button
|
|
90
90
|
&.style-compact
|
|
91
91
|
> .button-label
|
|
92
92
|
padding-left: 0
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
padding-bottom: 2px
|
|
101
101
|
|
|
102
102
|
// color
|
|
103
|
-
.
|
|
103
|
+
.button
|
|
104
104
|
&.primary-color
|
|
105
105
|
color: $primary-color
|
|
106
106
|
&:focus
|
|
@@ -134,8 +134,8 @@
|
|
|
134
134
|
background-color: rgba($secondary-color, .05)
|
|
135
135
|
|
|
136
136
|
// theme
|
|
137
|
-
.dark-mode .
|
|
138
|
-
.
|
|
137
|
+
.dark-mode .button,
|
|
138
|
+
.button.dark-mode
|
|
139
139
|
color: $default-color-text-dark
|
|
140
140
|
.button-icon
|
|
141
141
|
svg
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
// type floating
|
|
3
|
-
.
|
|
3
|
+
.button.type-floating
|
|
4
4
|
min-width: 56px
|
|
5
5
|
min-height: 56px
|
|
6
6
|
transition: box-shadow .2s
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
background-color: rgba(0, 0, 0, 1)
|
|
22
22
|
|
|
23
23
|
// states
|
|
24
|
-
.
|
|
24
|
+
.button.type-floating
|
|
25
25
|
background-color: rgba(0, 0, 0, 0.05)
|
|
26
26
|
&:focus
|
|
27
27
|
background-color: rgba(0, 0, 0, 0.15)
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
box-shadow: 0px 7px 8px -4px rgba(0, 0, 0, 0.2), 0px 12px 17px 2px rgba(0, 0, 0, 0.14), 0px 5px 22px 4px rgba(0, 0, 0, 0.12)
|
|
34
34
|
|
|
35
35
|
// color
|
|
36
|
-
.
|
|
36
|
+
.button.type-floating
|
|
37
37
|
&.primary-color
|
|
38
38
|
background-color: $primary-color
|
|
39
39
|
color: $primary-color-text
|
|
@@ -68,8 +68,8 @@
|
|
|
68
68
|
background-color: lighten($secondary-color, 5%)
|
|
69
69
|
|
|
70
70
|
// theme
|
|
71
|
-
.dark-mode .
|
|
72
|
-
.
|
|
71
|
+
.dark-mode .button.type-floating,
|
|
72
|
+
.button.type-floating.dark-mode
|
|
73
73
|
.material-ripple
|
|
74
74
|
opacity: .1
|
|
75
75
|
background-color: rgba(255, 255, 255, 1)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
// type raised
|
|
3
|
-
.
|
|
3
|
+
.button.type-raised
|
|
4
4
|
min-width: 36px
|
|
5
5
|
transition: box-shadow .2s
|
|
6
6
|
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12)
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
background-color: rgba(0, 0, 0, 1)
|
|
10
10
|
|
|
11
11
|
// states
|
|
12
|
-
.
|
|
12
|
+
.button.type-raised
|
|
13
13
|
background-color: rgba(0, 0, 0, 0.05)
|
|
14
14
|
&:focus
|
|
15
15
|
background-color: rgba(0, 0, 0, 0.15)
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
box-shadow: 0px 4px 4px -3px rgba(0, 0, 0, 0.2), 0px 6px 8px 1px rgba(0, 0, 0, 0.14), 0px 3px 14px 2px rgba(0, 0, 0, 0.12)
|
|
22
22
|
|
|
23
23
|
// color
|
|
24
|
-
.
|
|
24
|
+
.button.type-raised
|
|
25
25
|
&.primary-color
|
|
26
26
|
background-color: $primary-color
|
|
27
27
|
color: $primary-color-text
|
|
@@ -56,8 +56,8 @@
|
|
|
56
56
|
background-color: lighten($secondary-color, 5%)
|
|
57
57
|
|
|
58
58
|
// theme
|
|
59
|
-
.dark-mode .
|
|
60
|
-
.
|
|
59
|
+
.dark-mode .button.type-raised,
|
|
60
|
+
.button.type-raised.dark-mode
|
|
61
61
|
.material-ripple
|
|
62
62
|
opacity: .1
|
|
63
63
|
background-color: rgba(255, 255, 255, 1)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
// type stroked
|
|
3
|
-
.
|
|
3
|
+
.button.type-stroked
|
|
4
4
|
min-width: 36px
|
|
5
5
|
transition: box-shadow .2s
|
|
6
6
|
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12)
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
background-color: rgba(255, 255, 255, .3)
|
|
9
9
|
|
|
10
10
|
// states
|
|
11
|
-
.
|
|
11
|
+
.button.type-stroked
|
|
12
12
|
&:hover
|
|
13
13
|
//background-color: #E0E0E0;
|
|
14
14
|
&:focus
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
box-shadow: 0px 4px 4px -3px rgba(0, 0, 0, 0.2), 0px 6px 8px 1px rgba(0, 0, 0, 0.14), 0px 3px 14px 2px rgba(0, 0, 0, 0.12)
|
|
20
20
|
|
|
21
21
|
// color
|
|
22
|
-
.
|
|
22
|
+
.button.type-stroked
|
|
23
23
|
&.primary-color
|
|
24
24
|
background-color: $primary-color
|
|
25
25
|
color: $primary-color-text
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
background-color: $secondary-color
|
|
47
47
|
|
|
48
48
|
// theme
|
|
49
|
-
.dark-mode .
|
|
50
|
-
.
|
|
49
|
+
.dark-mode .button.type-stroked,
|
|
50
|
+
.button.type-stroked.dark-mode
|
|
51
51
|
|
|
52
52
|
//background-color: rgba(255, 255, 255, 0.95)
|
|
53
53
|
color: $primary-color-text-dark
|
|
@@ -1 +1,13 @@
|
|
|
1
|
-
.navigation
|
|
1
|
+
.navigation
|
|
2
|
+
flex: none
|
|
3
|
+
display: flex
|
|
4
|
+
flex-direction: column
|
|
5
|
+
width: 12px
|
|
6
|
+
margin: 0
|
|
7
|
+
overflow: hidden
|
|
8
|
+
background-color: #3a3a3a
|
|
9
|
+
transition: 0.1s linear width
|
|
10
|
+
&.type-rail
|
|
11
|
+
display: flex
|
|
12
|
+
flex-direction: column
|
|
13
|
+
width: 80px
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.
|
|
1
|
+
.checkbox
|
|
2
2
|
display: block
|
|
3
3
|
position: relative
|
|
4
4
|
margin-left: 4px
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
left: -10000px
|
|
18
18
|
order: 2
|
|
19
19
|
|
|
20
|
-
.
|
|
20
|
+
.control
|
|
21
21
|
//flex: none;
|
|
22
22
|
order: 1
|
|
23
23
|
cursor: pointer
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
border-radius: 50%
|
|
30
30
|
|
|
31
31
|
//margin: 10px 10px 10px 4px;
|
|
32
|
-
.
|
|
32
|
+
.icon
|
|
33
33
|
position: absolute
|
|
34
34
|
top: 11px
|
|
35
35
|
left: 11px
|
|
@@ -38,14 +38,14 @@
|
|
|
38
38
|
transition: .3s
|
|
39
39
|
|
|
40
40
|
//stroke: rgba(0, 0, 0, 0.5);
|
|
41
|
-
.
|
|
41
|
+
.check
|
|
42
42
|
opacity: 0
|
|
43
43
|
position: absolute
|
|
44
44
|
fill: rgba(255, 255, 255, 0.95)
|
|
45
45
|
top: 8px
|
|
46
46
|
left: 8px
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
label
|
|
49
49
|
flex: 1
|
|
50
50
|
order: 3
|
|
51
51
|
font-size: 1rem
|
|
@@ -56,13 +56,13 @@
|
|
|
56
56
|
overflow: hidden
|
|
57
57
|
|
|
58
58
|
&.is-checked
|
|
59
|
-
.
|
|
60
|
-
.
|
|
59
|
+
.control
|
|
60
|
+
.icon
|
|
61
61
|
transition: .3s
|
|
62
62
|
border-color: $secondary-color
|
|
63
63
|
background-color: $secondary-color
|
|
64
64
|
|
|
65
|
-
.
|
|
65
|
+
.check
|
|
66
66
|
opacity: 1
|
|
67
67
|
position: absolute
|
|
68
68
|
fill: rgba(255, 255, 255, 0.95)
|
|
@@ -70,36 +70,36 @@
|
|
|
70
70
|
left: 8px
|
|
71
71
|
|
|
72
72
|
&.is-disabled
|
|
73
|
-
|
|
73
|
+
label
|
|
74
74
|
opacity: .4
|
|
75
75
|
|
|
76
|
-
.
|
|
76
|
+
.icon
|
|
77
77
|
background-color: rgba(0, 0, 0, 0.26)
|
|
78
78
|
border-color: rgba(0, 0, 0, 0.26)
|
|
79
79
|
//opacity: .4
|
|
80
80
|
|
|
81
|
-
.
|
|
82
|
-
.
|
|
81
|
+
.control
|
|
82
|
+
.icon
|
|
83
83
|
opacity: .4
|
|
84
84
|
|
|
85
85
|
&.is-focused
|
|
86
|
-
.
|
|
86
|
+
.control
|
|
87
87
|
background-color: rgba(34, 31, 31, 0.05)
|
|
88
88
|
|
|
89
89
|
&:active
|
|
90
|
-
.
|
|
91
|
-
|
|
90
|
+
.control
|
|
91
|
+
background-color: transparent
|
|
92
92
|
|
|
93
|
-
.dark-mode .
|
|
94
|
-
.
|
|
95
|
-
|
|
96
|
-
|
|
93
|
+
.dark-mode .checkbox,
|
|
94
|
+
.checkbox.dark-mode
|
|
95
|
+
.control
|
|
96
|
+
.icon
|
|
97
97
|
border: 2px solid rgba(255, 255, 255, 0.5)
|
|
98
98
|
|
|
99
99
|
&.is-focused
|
|
100
|
-
.
|
|
100
|
+
.control
|
|
101
101
|
background-color: rgba(255, 255, 255, 0.05)
|
|
102
102
|
|
|
103
103
|
&.is-checked
|
|
104
|
-
.
|
|
104
|
+
.control
|
|
105
105
|
background-color: rgba(255, 255, 255, 0.5)
|
package/src/slider.js
CHANGED
|
@@ -8,7 +8,7 @@ import offset from './element/offset'
|
|
|
8
8
|
import classify from './module/classify'
|
|
9
9
|
// import control from './control';
|
|
10
10
|
import attach from './module/attach'
|
|
11
|
-
import css from './module/css'
|
|
11
|
+
import * as css from './module/css'
|
|
12
12
|
import emitter from './module/emitter'
|
|
13
13
|
|
|
14
14
|
import icon from './skin/material/icon/pin.svg'
|
package/src/snackbar.js
CHANGED
|
@@ -13,9 +13,10 @@ class Snackbar extends EventEmitter {
|
|
|
13
13
|
class: 'snackbar',
|
|
14
14
|
transition: 225,
|
|
15
15
|
duration: 4000,
|
|
16
|
+
stack: false,
|
|
16
17
|
close: false,
|
|
17
18
|
layout: [
|
|
18
|
-
[Text, '
|
|
19
|
+
[Text, 'message', { tag: 'span', class: 'message' }],
|
|
19
20
|
[Button, 'action', { class: 'action', type: 'link' }],
|
|
20
21
|
[Button, 'close', { class: 'close', type: 'action' }]
|
|
21
22
|
],
|
|
@@ -23,24 +24,25 @@ class Snackbar extends EventEmitter {
|
|
|
23
24
|
['ui.action.click', 'action'],
|
|
24
25
|
['ui.close.click', 'destroy']
|
|
25
26
|
]
|
|
26
|
-
}
|
|
27
|
+
}
|
|
27
28
|
|
|
28
29
|
constructor (options) {
|
|
29
30
|
super()
|
|
30
31
|
|
|
31
32
|
this.init(options)
|
|
32
33
|
this.build(this.constructor)
|
|
33
|
-
this.render()
|
|
34
|
+
this.render()
|
|
34
35
|
this.bindEvents()
|
|
35
36
|
this.show()
|
|
36
37
|
|
|
37
|
-
if (this.options.duration)
|
|
38
|
-
setTimeout(()=>{
|
|
38
|
+
if (this.options.duration) {
|
|
39
|
+
setTimeout(() => {
|
|
39
40
|
this.destroy()
|
|
40
41
|
}, this.options.duration)
|
|
42
|
+
}
|
|
41
43
|
}
|
|
42
44
|
|
|
43
|
-
init(options) {
|
|
45
|
+
init (options) {
|
|
44
46
|
this.options = Object.assign({}, Snackbar.defaults, options || {})
|
|
45
47
|
Object.assign(this, build, bindEvents, display)
|
|
46
48
|
|
|
@@ -50,7 +52,7 @@ class Snackbar extends EventEmitter {
|
|
|
50
52
|
buildSnackbarContainer (container = document.body) {
|
|
51
53
|
// console.log('buildSnackbarContainer', container)
|
|
52
54
|
|
|
53
|
-
|
|
55
|
+
const snackbarContainer = container.querySelector('.snackbars')
|
|
54
56
|
|
|
55
57
|
// console.log('snackbarContainer', snackbarContainer)
|
|
56
58
|
|
|
@@ -59,12 +61,13 @@ class Snackbar extends EventEmitter {
|
|
|
59
61
|
this.options.container.classList.add('snackbars')
|
|
60
62
|
container.appendChild(this.options.container)
|
|
61
63
|
} else {
|
|
64
|
+
if (this.options.stack === false) snackbarContainer.innerHTML = ''
|
|
62
65
|
this.options.container = snackbarContainer
|
|
63
66
|
}
|
|
64
67
|
}
|
|
65
68
|
|
|
66
69
|
render () {
|
|
67
|
-
this.ui.
|
|
70
|
+
this.ui.message.set(this.options.message)
|
|
68
71
|
|
|
69
72
|
if (this.options.action) {
|
|
70
73
|
this.ui.action.set(this.options.action)
|
|
@@ -82,7 +85,7 @@ class Snackbar extends EventEmitter {
|
|
|
82
85
|
this.destroy()
|
|
83
86
|
}
|
|
84
87
|
|
|
85
|
-
close() {
|
|
88
|
+
close () {
|
|
86
89
|
// console.log('close')
|
|
87
90
|
this.destroy()
|
|
88
91
|
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// Color Palette
|
|
2
|
+
$color-primary: #3498db
|
|
3
|
+
$color-secondary: #2ecc71
|
|
4
|
+
$color-tertiary: #9b59b6
|
|
5
|
+
$color-tonal: #d9e7cc
|
|
6
|
+
$color-success: #2ecc71
|
|
7
|
+
$color-warning: #f1c40f
|
|
8
|
+
$color-danger: #e74c3c
|
|
9
|
+
$color-light: #ecf0f1
|
|
10
|
+
$color-dark: #34495e
|
|
11
|
+
|
|
12
|
+
$text-on-primary: #ffffff
|
|
13
|
+
$text-primary-on-dark: #ffffff
|
|
14
|
+
$text-primary-on-light: #333333
|
|
15
|
+
$text-on-tonal: #131F0D
|
|
16
|
+
|
|
17
|
+
// Typography
|
|
18
|
+
$font-primary: 'Helvetica Neue', Arial, sans-serif
|
|
19
|
+
$font-secondary: 'Georgia', serif
|
|
20
|
+
$font-size-base: 1rem // 16px
|
|
21
|
+
$font-size-large: 1.25rem // 20px
|
|
22
|
+
$font-size-small: 0.875rem // 14px
|
|
23
|
+
|
|
24
|
+
// Spacing
|
|
25
|
+
$spacing-unit: 10px
|
|
26
|
+
|
|
27
|
+
// Breakpoints for Responsive Design
|
|
28
|
+
$breakpoint-xs: 480px
|
|
29
|
+
$breakpoint-sm: 768px
|
|
30
|
+
$breakpoint-md: 992px
|
|
31
|
+
$breakpoint-lg: 1200px
|
|
32
|
+
|
|
33
|
+
// Z-index Layers
|
|
34
|
+
$zindex-dropdown: 1000
|
|
35
|
+
$zindex-sticky: 1020
|
|
36
|
+
$zindex-fixed: 1030
|
|
37
|
+
$zindex-modal-backdrop: 1040
|
|
38
|
+
$zindex-modal: 1050
|
|
39
|
+
$zindex-popover: 1060
|
|
40
|
+
$zindex-tooltip: 1070
|
|
41
|
+
|
|
42
|
+
// Other Variables
|
|
43
|
+
$border-radius: 4px
|
|
44
|
+
$box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1)
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
.button
|
|
2
|
+
font-size: 0.875rem
|
|
3
|
+
font-weight: 500
|
|
4
|
+
color: $text-on-primary
|
|
5
|
+
height: 40px
|
|
6
|
+
background-color: $color-primary
|
|
7
|
+
padding-left: 24px
|
|
8
|
+
padding-right: 24px
|
|
9
|
+
border-radius: 20px
|
|
10
|
+
border: none
|
|
11
|
+
overflow: hidden
|
|
12
|
+
&.style-filled
|
|
13
|
+
color: $text-on-primary
|
|
14
|
+
background-color: $color-primary
|
|
15
|
+
&.style-tonal
|
|
16
|
+
color: $text-on-tonal
|
|
17
|
+
background-color: $color-tonal
|
|
18
|
+
&.style-elevated
|
|
19
|
+
background-color: $color-primary
|
|
20
|
+
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12)
|
|
21
|
+
&.style-outlined
|
|
22
|
+
color: $color-primary
|
|
23
|
+
background-color: transparent
|
|
24
|
+
border-color: 2px solid #72776C
|
|
25
|
+
&.style-text
|
|
26
|
+
color: $color-primary
|