material 0.4.3 → 0.5.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/dist/tracks.svg +10 -0
- package/package.json +1 -1
- package/src/appbar.js +1 -2
- package/src/control/button.js +127 -44
- package/src/control/button.new.js +190 -0
- package/src/control/dialog.js +174 -0
- package/src/control/{upload.js → file.js} +33 -8
- package/src/control/link.js +61 -0
- package/src/control/list.js +77 -0
- package/src/control/loading.js +128 -0
- package/src/control/module/addclass.js +16 -0
- package/src/control/module/attributes.js +3 -1
- package/src/control/search.js +98 -0
- package/src/control/select.js +80 -22
- package/src/control/selecter.js +246 -0
- package/src/control/switch.js +272 -0
- package/src/control/switcher.js +245 -0
- package/src/control/text.js +18 -3
- package/src/control/textfield.js +89 -15
- package/src/field/image.js +9 -3
- package/src/form/build.js +28 -4
- package/src/form/cancel.js +7 -3
- package/src/form/controller.js +90 -0
- package/src/form/create.js +11 -7
- package/src/form/data.js +82 -0
- package/src/form/delete.js +2 -1
- package/src/form/fetch.js +5 -3
- package/src/form/render.js +11 -9
- package/src/form/set.js +27 -12
- package/src/form/submit.js +11 -37
- package/src/form/update.js +35 -16
- package/src/layout.js +25 -21
- package/src/list/add.js +34 -0
- package/src/list/build.js +96 -12
- package/src/list/click.js +10 -5
- package/src/list/collection.js +187 -0
- package/src/list/create.js +21 -11
- package/src/list/display.js +78 -0
- package/src/list/empty.js +4 -1
- package/src/list/filter.js +114 -0
- package/src/list/load.js +2 -2
- package/src/list/remove.js +17 -4
- package/src/list/render.js +32 -9
- package/src/list/request.js +182 -0
- package/src/list/search.js +118 -35
- package/src/list/select.js +151 -30
- package/src/list/status.js +10 -3
- package/src/list/update.js +49 -8
- package/src/list/virtual.js +195 -127
- package/src/map/build.js +103 -0
- package/src/map/countries.js +114 -0
- package/src/map/display.js +135 -0
- package/src/map/focus.js +39 -0
- package/src/map/init.js +24 -0
- package/src/map/label.js +0 -0
- package/src/map/mode.js +44 -0
- package/src/map/mouse.js +65 -0
- package/src/map/select.js +68 -0
- package/src/map/set.js +71 -0
- package/src/map/viewport.js +46 -0
- package/src/map.js +71 -0
- package/src/module/attach.js +9 -2
- package/src/module/mediator.js +56 -0
- package/src/module/object.js +17 -1
- package/src/module/observer.js +1 -1
- package/src/module/passive.js +17 -0
- package/src/module/remove.js +74 -0
- package/src/module/scrollbar.js +48 -0
- package/src/module/smoothscroll.js +20 -0
- package/src/module/viewport.js +20 -0
- package/src/selector.js +239 -0
- package/src/skin/material/base/body.sass +3 -0
- package/src/skin/material/button/file.sass +1 -1
- package/src/skin/material/container/container.sass +1 -1
- package/src/skin/material/container/dialog.sass +57 -1
- package/src/skin/material/container/drawer.sass +3 -3
- package/src/skin/material/control/button.sass +125 -0
- package/src/skin/material/control/dialog.sass +0 -0
- package/src/skin/material/control/progress.sass +136 -0
- package/src/skin/material/control/search.sass +40 -0
- package/src/skin/material/control/selecter.sass +131 -0
- package/src/skin/material/control/selector.sass +38 -0
- package/src/skin/material/control/slider.sass +2 -2
- package/src/skin/material/control/switch.sass +146 -3
- package/src/skin/material/control/switcher.sass +41 -0
- package/src/skin/material/control/textfield.sass +2 -1
- package/src/skin/material/icon/cancel.svg +1 -0
- package/src/skin/material/material.sass +3 -0
- package/src/skin/material/view/list.sass +81 -188
- package/src/skin/material/view/listview.sass +187 -96
- package/src/skin/material/view/tabview.sass +6 -4
- package/src/skin/material.bak/base/body.sass +52 -0
- package/src/skin/material.bak/base/elevation.sass +50 -0
- package/src/skin/material.bak/base/grid.sass +63 -0
- package/src/skin/material.bak/base/typo.sass +107 -0
- package/src/skin/material.bak/button/action.sass +89 -0
- package/src/skin/material.bak/button/button.sass +183 -0
- package/src/skin/material.bak/button/file.sass +24 -0
- package/src/skin/material.bak/button/floating.sass +113 -0
- package/src/skin/material.bak/button/raised.sass +101 -0
- package/src/skin/material.bak/button/stroked.sass +71 -0
- package/src/skin/material.bak/component/component.sass +7 -0
- package/src/skin/material.bak/component/divider.sass +17 -0
- package/src/skin/material.bak/component/image.sass +6 -0
- package/src/skin/material.bak/component/label.sass +2 -0
- package/src/skin/material.bak/component/progress.sass +138 -0
- package/src/skin/material.bak/component/subheader.sass +3 -0
- package/src/skin/material.bak/component/text.sass +85 -0
- package/src/skin/material.bak/container/appbar.sass +167 -0
- package/src/skin/material.bak/container/banner.sass +38 -0
- package/src/skin/material.bak/container/card.sass +18 -0
- package/src/skin/material.bak/container/container.sass +1 -0
- package/src/skin/material.bak/container/dialog.sass +184 -0
- package/src/skin/material.bak/container/drawer.sass +159 -0
- package/src/skin/material.bak/container/drawernew.sass +159 -0
- package/src/skin/material.bak/container/menu.sass +58 -0
- package/src/skin/material.bak/container/snackbar.sass +18 -0
- package/src/skin/material.bak/container/tabs.sass +75 -0
- package/src/skin/material.bak/container/toolbar.sass +161 -0
- package/src/skin/material.bak/control/button.sass +125 -0
- package/src/skin/material.bak/control/checkbox.sass +105 -0
- package/src/skin/material.bak/control/dialog.sass +0 -0
- package/src/skin/material.bak/control/search.sass +40 -0
- package/src/skin/material.bak/control/selecter.sass +128 -0
- package/src/skin/material.bak/control/slider.sass +181 -0
- package/src/skin/material.bak/control/switch.sass +284 -0
- package/src/skin/material.bak/control/switcher.sass +35 -0
- package/src/skin/material.bak/control/textfield.sass +126 -0
- package/src/skin/material.bak/control/tooltip.sass +36 -0
- package/src/skin/material.bak/icon/back.svg +5 -0
- package/src/skin/material.bak/icon/cancel.svg +1 -0
- package/src/skin/material.bak/icon/checkbox.svg +4 -0
- package/src/skin/material.bak/icon/forward.svg +5 -0
- package/src/skin/material.bak/icon/menu.svg +4 -0
- package/src/skin/material.bak/icon/pin.svg +4 -0
- package/src/skin/material.bak/layout/layout.sass +69 -0
- package/src/skin/material.bak/layout/resizer.sass +69 -0
- package/src/skin/material.bak/material.css +2042 -0
- package/src/skin/material.bak/material.css.map +7 -0
- package/src/skin/material.bak/material.sass +65 -0
- package/src/skin/material.bak/module/ripple.sass +9 -0
- package/src/skin/material.bak/theme/default.sass +50 -0
- package/src/skin/material.bak/theme/ocean.sass +29 -0
- package/src/skin/material.bak/theme/theme.sass +3 -0
- package/src/skin/material.bak/view/calendar.sass +193 -0
- package/src/skin/material.bak/view/form.sass +15 -0
- package/src/skin/material.bak/view/grid.sass +116 -0
- package/src/skin/material.bak/view/list.sass +89 -0
- package/src/skin/material.bak/view/listview.sass +195 -0
- package/src/skin/material.bak/view/map.sass +6 -0
- package/src/skin/material.bak/view/page.sass +4 -0
- package/src/skin/material.bak/view/tabview-bak.sass +40 -0
- package/src/skin/material.bak/view/tabview.sass +55 -0
- package/src/skin/material.bak/view/tree.sass +73 -0
- package/src/skin/material.bak/view/view.sass +7 -0
- package/src/switch.js +1 -1
- package/src/tabs/setup.js +0 -0
- package/src/tabview.js +64 -14
- package/src/tooltip.js +23 -5
- package/src/view/build.js +13 -1
- package/src/view/display.js +63 -2
- package/src/form/clean.js +0 -6
- package/src/form/controls.js +0 -56
- package/src/form/mode.js +0 -8
- package/src/form/setup.js +0 -5
- package/src/list/fetch.js +0 -66
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
|
|
2
|
+
function passive () {
|
|
3
|
+
var supportsPassive = false
|
|
4
|
+
try {
|
|
5
|
+
var opts = Object.defineProperty({}, 'passive', {
|
|
6
|
+
get: function () {
|
|
7
|
+
supportsPassive = true
|
|
8
|
+
}
|
|
9
|
+
})
|
|
10
|
+
window.addEventListener('testPassive', null, opts)
|
|
11
|
+
window.removeEventListener('testPassive', null, opts)
|
|
12
|
+
} catch (e) {}
|
|
13
|
+
|
|
14
|
+
return supportsPassive
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export default passive
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import extract from './extract'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* attach function to events
|
|
5
|
+
* @module module/attach
|
|
6
|
+
* @category module
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* [attach description]
|
|
11
|
+
* @param {object} component [description]
|
|
12
|
+
* @param {[type]} events [description]
|
|
13
|
+
* @return {[type]} [description]
|
|
14
|
+
*/
|
|
15
|
+
export default {
|
|
16
|
+
remove: function (events) {
|
|
17
|
+
// console.log('attach', events)
|
|
18
|
+
events = events || this.options.events
|
|
19
|
+
if (!events) return
|
|
20
|
+
|
|
21
|
+
// console.log('attach', events, this)
|
|
22
|
+
var instance = this
|
|
23
|
+
events.map((def) => {
|
|
24
|
+
var e = extract.e(instance, def[0])
|
|
25
|
+
var f = extract.f(instance, def[1])
|
|
26
|
+
var option = def[2]
|
|
27
|
+
|
|
28
|
+
var keys = def[1].split('.')
|
|
29
|
+
|
|
30
|
+
keys.pop()
|
|
31
|
+
var bound = this.last(keys.join('.'))
|
|
32
|
+
|
|
33
|
+
if (f && bound && e && e.element && e.element.addEventListener) {
|
|
34
|
+
if (!f) { console.log('error') }
|
|
35
|
+
|
|
36
|
+
if (option) {
|
|
37
|
+
e.element.removeEventListener(e.name, f.bind(bound), option)
|
|
38
|
+
} else {
|
|
39
|
+
console.log('removeEventListener', e.name, f.bind(bound))
|
|
40
|
+
e.element.removeEventListener(e.name, f.bind(bound), false)
|
|
41
|
+
}
|
|
42
|
+
} else if (e && e.element && e.element.off && f && bound) {
|
|
43
|
+
e.element.off(e.name, f.bind(bound))
|
|
44
|
+
} else {
|
|
45
|
+
console.trace('can\'t attach', def[0])
|
|
46
|
+
console.log('can\'t attach', def[0])
|
|
47
|
+
}
|
|
48
|
+
})
|
|
49
|
+
|
|
50
|
+
return this
|
|
51
|
+
},
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Return the last reference from an object
|
|
55
|
+
* @param {string} str Object path for example key1.key2.key3
|
|
56
|
+
* @return {value} The value of the last reference
|
|
57
|
+
*/
|
|
58
|
+
last: function (str) {
|
|
59
|
+
// console.log('_path', str)
|
|
60
|
+
if (!str) return this
|
|
61
|
+
else if (!str.match(/\./)) return this[str]
|
|
62
|
+
var last
|
|
63
|
+
|
|
64
|
+
var keys = str.split('.')
|
|
65
|
+
for (var i = 0, l = keys.length; i < l; i++) {
|
|
66
|
+
var key = keys[i]
|
|
67
|
+
|
|
68
|
+
last = last || this
|
|
69
|
+
last = last[key]
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
return last
|
|
73
|
+
}
|
|
74
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
|
|
2
|
+
window._scrollbar = {}
|
|
3
|
+
|
|
4
|
+
function scrollbar () {
|
|
5
|
+
// if (window._scrollbar.checked) return
|
|
6
|
+
|
|
7
|
+
var list = document.createElement('div')
|
|
8
|
+
list.classList.add('list')
|
|
9
|
+
list.style['z-index'] = '1000'
|
|
10
|
+
list.style.display = 'block'
|
|
11
|
+
list.style.width = '300px'
|
|
12
|
+
list.style['minWidth'] = '300px'
|
|
13
|
+
list.style.height = '20px'
|
|
14
|
+
list.style.position = 'absolute'
|
|
15
|
+
list.style.top = '-200px'
|
|
16
|
+
list.style.right = 'initial'
|
|
17
|
+
list.style.bottom = 'initial'
|
|
18
|
+
list.style.left = '200px'
|
|
19
|
+
list.style['overflowY'] = 'hidden'
|
|
20
|
+
document.body.appendChild(list)
|
|
21
|
+
|
|
22
|
+
var body = document.createElement('div')
|
|
23
|
+
body.classList.add('body')
|
|
24
|
+
body.style['overflowY'] = 'scroll'
|
|
25
|
+
list.appendChild(body)
|
|
26
|
+
|
|
27
|
+
var item = document.createElement('div')
|
|
28
|
+
item.classList.add('item')
|
|
29
|
+
item.style.height = '40px'
|
|
30
|
+
item.style.margin = '0'
|
|
31
|
+
item.style.padding = '0'
|
|
32
|
+
item.style.border = '0'
|
|
33
|
+
item.style['backgroundColor'] = 'green'
|
|
34
|
+
body.appendChild(item)
|
|
35
|
+
|
|
36
|
+
var info = item.getBoundingClientRect()
|
|
37
|
+
// console.log('width', 300 - info.width)
|
|
38
|
+
|
|
39
|
+
// console.log('list', list)
|
|
40
|
+
|
|
41
|
+
document.body.removeChild(list)
|
|
42
|
+
|
|
43
|
+
window._scrollbar.checked = true
|
|
44
|
+
|
|
45
|
+
return 300 - info.width
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export default scrollbar
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
function smoothscroll (e, top, time) {
|
|
2
|
+
// console.log('smoothscroll', top, e.scrollTop)
|
|
3
|
+
|
|
4
|
+
var start = top - e.scrollTop
|
|
5
|
+
|
|
6
|
+
time = time || 275
|
|
7
|
+
var step = start / 100
|
|
8
|
+
var current = 0
|
|
9
|
+
while (current <= time) {
|
|
10
|
+
window.setTimeout(scrolling, current, e, step)
|
|
11
|
+
current += time / 100
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function scrolling (e, step) {
|
|
16
|
+
// console.log('scrolling', step, e.scrollTop)
|
|
17
|
+
e.scrollBy(0, step)
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export default smoothscroll
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
|
|
2
|
+
function viewport (el) {
|
|
3
|
+
if (!el) return
|
|
4
|
+
|
|
5
|
+
var rect = el.getBoundingClientRect()
|
|
6
|
+
|
|
7
|
+
var top = rect.top
|
|
8
|
+
var left = rect.left
|
|
9
|
+
var width = rect.width
|
|
10
|
+
var height = rect.height
|
|
11
|
+
|
|
12
|
+
return (
|
|
13
|
+
top >= window.pageYOffset &&
|
|
14
|
+
left >= window.pageXOffset &&
|
|
15
|
+
(top + height) <= (window.pageYOffset + window.innerHeight) &&
|
|
16
|
+
(left + width) <= (window.pageXOffset + window.innerWidth)
|
|
17
|
+
)
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export default viewport
|
package/src/selector.js
ADDED
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
import emitter from './module/emitter'
|
|
2
|
+
import attach from './module/attach'
|
|
3
|
+
|
|
4
|
+
const defaults = {
|
|
5
|
+
class: 'selector',
|
|
6
|
+
tag: 'div',
|
|
7
|
+
styles: ['style', 'color'],
|
|
8
|
+
modules: ['border', 'label', 'resizer'],
|
|
9
|
+
resizer: {
|
|
10
|
+
keepRatio: true,
|
|
11
|
+
minWidth: 10,
|
|
12
|
+
minHeight: 10
|
|
13
|
+
},
|
|
14
|
+
events: [
|
|
15
|
+
['resizer.pointerdown', 'onPointerDown']
|
|
16
|
+
]
|
|
17
|
+
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
class Selector {
|
|
21
|
+
static isComponent () {
|
|
22
|
+
return true
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Constructor
|
|
27
|
+
* @param {Object} options - Component options
|
|
28
|
+
* @return {Object} Class instance
|
|
29
|
+
*/
|
|
30
|
+
constructor (options) {
|
|
31
|
+
// console.log('constructor')
|
|
32
|
+
this.options = Object.assign({}, defaults, options || {})
|
|
33
|
+
Object.assign(this, emitter, attach)
|
|
34
|
+
// console.log('options', options)
|
|
35
|
+
|
|
36
|
+
this.init()
|
|
37
|
+
|
|
38
|
+
return this
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
init () {
|
|
42
|
+
this.build()
|
|
43
|
+
this.setup()
|
|
44
|
+
this.attach()
|
|
45
|
+
|
|
46
|
+
if (this.options.container) {
|
|
47
|
+
this.options.container.appendChild(this.root)
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Build Method
|
|
53
|
+
* @return {Object} This class instance
|
|
54
|
+
*/
|
|
55
|
+
build () {
|
|
56
|
+
this.root = document.createElement(this.options.tag)
|
|
57
|
+
|
|
58
|
+
this.root.classList.add('selector')
|
|
59
|
+
|
|
60
|
+
if (this.options.class !== 'selector') {
|
|
61
|
+
this.root.setAttribute('class', this.options.class)
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
if (this.options.modules.indexOf('border') > -1) {
|
|
65
|
+
this.border = document.createElement('div')
|
|
66
|
+
this.border.classList.add('border')
|
|
67
|
+
this.root.appendChild(this.border)
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if (this.options.modules.indexOf('label') > -1) {
|
|
71
|
+
this.label = document.createElement('div')
|
|
72
|
+
this.label.classList.add('label')
|
|
73
|
+
this.root.appendChild(this.label)
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if (this.options.modules.indexOf('resizer') > -1) {
|
|
77
|
+
this.resizer = document.createElement('div')
|
|
78
|
+
this.resizer.classList.add('resizer')
|
|
79
|
+
this.root.appendChild(this.resizer)
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
return this
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
setup () {
|
|
86
|
+
if (!this.options.src) return
|
|
87
|
+
|
|
88
|
+
this.setTarget(this.options.element)
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Setter
|
|
93
|
+
* @param {string} prop
|
|
94
|
+
* @param {string} value
|
|
95
|
+
* @return {Object} The class instance
|
|
96
|
+
*/
|
|
97
|
+
set (prop, value) {
|
|
98
|
+
// console.log('set', this.root, prop, value)
|
|
99
|
+
switch (prop) {
|
|
100
|
+
case 'target':
|
|
101
|
+
this.setTarget(value)
|
|
102
|
+
break
|
|
103
|
+
default:
|
|
104
|
+
// console.log('prop', prop)
|
|
105
|
+
this.setTarget(prop)
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
return this
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
setTarget (target) {
|
|
112
|
+
this.target = target
|
|
113
|
+
|
|
114
|
+
this.update(this.target)
|
|
115
|
+
|
|
116
|
+
this.root.classList.remove('hide')
|
|
117
|
+
|
|
118
|
+
// console.log('target', this.root, this.target)
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
update (target) {
|
|
122
|
+
target = target || this.target
|
|
123
|
+
if (!target) return
|
|
124
|
+
var coords = target.getBoundingClientRect()
|
|
125
|
+
var pcoords = this.root.parentNode.getBoundingClientRect()
|
|
126
|
+
|
|
127
|
+
this.root.style.top = coords.top - pcoords.top + 'px'
|
|
128
|
+
this.root.style.left = coords.left - pcoords.left + 'px'
|
|
129
|
+
this.root.style.width = coords.width + 'px'
|
|
130
|
+
this.root.style.height = coords.height + 'px'
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Setter
|
|
135
|
+
* @param {string} prop
|
|
136
|
+
* @param {string} value
|
|
137
|
+
* @return {Object} The class instance
|
|
138
|
+
*/
|
|
139
|
+
get (prop, value) {
|
|
140
|
+
switch (prop) {
|
|
141
|
+
case 'value':
|
|
142
|
+
return this.root.value
|
|
143
|
+
case 'label':
|
|
144
|
+
return this.label.innerHTML
|
|
145
|
+
default:
|
|
146
|
+
return this.root.value
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
onPointerDown (ev) {
|
|
151
|
+
// console.log('pointerdown', ev.target)
|
|
152
|
+
ev = ev || window.event
|
|
153
|
+
|
|
154
|
+
let width = 0
|
|
155
|
+
let height = 0
|
|
156
|
+
|
|
157
|
+
const offsetX = this.root.getBoundingClientRect().x
|
|
158
|
+
const offsetY = this.root.getBoundingClientRect().y
|
|
159
|
+
const element = document.body
|
|
160
|
+
|
|
161
|
+
var ratio = parseInt(this.root.style.width, 10) / parseInt(this.root.style.height, 10)
|
|
162
|
+
|
|
163
|
+
this.border.setPointerCapture(ev.pointerId)
|
|
164
|
+
|
|
165
|
+
element.onpointermove = (e) => {
|
|
166
|
+
// console.log('pointermove')
|
|
167
|
+
|
|
168
|
+
e.stopPropagation()
|
|
169
|
+
|
|
170
|
+
e = e || window.event
|
|
171
|
+
|
|
172
|
+
if (e.pageX) width = e.pageX - offsetX
|
|
173
|
+
else if (e.clientX) width = e.clientX - offsetX
|
|
174
|
+
|
|
175
|
+
if (e.pageY) height = e.pageY - offsetY
|
|
176
|
+
else if (e.clientY) height = e.clientY - offsetY
|
|
177
|
+
|
|
178
|
+
if (width < this.options.resizer.minWidth) width = this.options.resizer.minWidth
|
|
179
|
+
|
|
180
|
+
if (this.options.resizer.keepRatio) {
|
|
181
|
+
// console.log('keepRatio', width, ratio)
|
|
182
|
+
height = width / ratio
|
|
183
|
+
} else {
|
|
184
|
+
if (height < this.options.resizer.minHeight) height = this.options.resizer.minHeight
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
this.root.style.width = width + 'px'
|
|
188
|
+
this.root.style.height = height + 'px'
|
|
189
|
+
|
|
190
|
+
this.emit('resize', width, height)
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
element.onpointerup = (e) => {
|
|
194
|
+
// console.log('pointerup', e.target)
|
|
195
|
+
|
|
196
|
+
element.onpointermove = null
|
|
197
|
+
element.onpointerup = null
|
|
198
|
+
this.root.releasePointerCapture(e.pointerId)
|
|
199
|
+
|
|
200
|
+
// if (e.target !== this.root) return
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
disable () {
|
|
205
|
+
this.root.disabled = true
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
enable () {
|
|
209
|
+
this.root.disabled = false
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
hide () {
|
|
213
|
+
this.root.classList.add('hide')
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
show () {
|
|
217
|
+
this.root.classList.remove('hide')
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
destroy () {
|
|
221
|
+
if (this.root && this.root.parentNode) {
|
|
222
|
+
this.root.parentNode.removeChild(this.root)
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
click (ev) {
|
|
227
|
+
this.emit('click', ev)
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
mousedown (ev) {
|
|
231
|
+
this.root.classList.add('pushed')
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
mouseup (ev) {
|
|
235
|
+
this.root.classList.remove('pushed')
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
export default Selector
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
@@ -1,3 +1,60 @@
|
|
|
1
|
+
.dialog
|
|
2
|
+
position: fixed
|
|
3
|
+
top: 0
|
|
4
|
+
left: 0
|
|
5
|
+
bottom: 0
|
|
6
|
+
right: 0
|
|
7
|
+
background-color: rgba(0, 0, 0, 0.5)
|
|
8
|
+
display: flex
|
|
9
|
+
align-items: center
|
|
10
|
+
justify-content: center
|
|
11
|
+
overflow: hidden
|
|
12
|
+
|
|
13
|
+
//display: none;
|
|
14
|
+
//visibility: hidden;
|
|
15
|
+
opacity: 0
|
|
16
|
+
|
|
17
|
+
//z-index: -1;
|
|
18
|
+
transition: .2s
|
|
19
|
+
|
|
20
|
+
&.show
|
|
21
|
+
// display: flex;
|
|
22
|
+
// width: 10;
|
|
23
|
+
// height: 0;
|
|
24
|
+
//transition: .2s;
|
|
25
|
+
transition: .1s
|
|
26
|
+
opacity: 1
|
|
27
|
+
|
|
28
|
+
.surface
|
|
29
|
+
transform: translateY(0) scale(1)
|
|
30
|
+
opacity: 1
|
|
31
|
+
margin-top: 0
|
|
32
|
+
transition: .1s
|
|
33
|
+
|
|
34
|
+
.surface
|
|
35
|
+
transition: .1s
|
|
36
|
+
max-height: 600px
|
|
37
|
+
display: flex
|
|
38
|
+
flex-direction: column
|
|
39
|
+
flex-wrap: nowrap
|
|
40
|
+
opacity: 0
|
|
41
|
+
border-radius: 2px
|
|
42
|
+
background-color: $background-color
|
|
43
|
+
box-shadow: 0px 11px 15px -7px rgba(0, 0, 0, 0.2), 0px 24px 38px 3px rgba(0, 0, 0, 0.14), 0px 9px 46px 8px rgba(0, 0, 0, 0.12)
|
|
44
|
+
transform: translateY(150px) scale(0.8)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
1
58
|
.material-dialog
|
|
2
59
|
position: fixed
|
|
3
60
|
top: 0
|
|
@@ -59,7 +116,6 @@
|
|
|
59
116
|
text-align: right
|
|
60
117
|
overflow: hidden
|
|
61
118
|
//padding: 8px
|
|
62
|
-
.material-button
|
|
63
119
|
|
|
64
120
|
.material-toolbar
|
|
65
121
|
position: relative
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
z-index: 15
|
|
72
72
|
flex: 1
|
|
73
73
|
position: relative
|
|
74
|
-
display:inline
|
|
74
|
+
display: inline
|
|
75
75
|
// right: 0
|
|
76
76
|
// top: 0
|
|
77
77
|
// bottom: 0
|
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
z-index: 15
|
|
117
117
|
flex: 1
|
|
118
118
|
position: relative
|
|
119
|
-
display:inline
|
|
119
|
+
display: inline
|
|
120
120
|
right: 0
|
|
121
121
|
top: 0
|
|
122
122
|
bottom: 0
|
|
@@ -129,7 +129,7 @@
|
|
|
129
129
|
position: fixed
|
|
130
130
|
|
|
131
131
|
.material-toolbar
|
|
132
|
-
position:relative
|
|
132
|
+
position: relative
|
|
133
133
|
|
|
134
134
|
.drawer-panel
|
|
135
135
|
position: relative
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
.button
|
|
2
|
+
user-select: none
|
|
3
|
+
font-size: 0.875rem
|
|
4
|
+
line-height: 1.5rem
|
|
5
|
+
text-transform: uppercase
|
|
6
|
+
flex: none
|
|
7
|
+
display: flex
|
|
8
|
+
-webkit-font-smoothing: antialiased
|
|
9
|
+
white-space: nowrap
|
|
10
|
+
position: relative
|
|
11
|
+
vertical-align: middle
|
|
12
|
+
cursor: default
|
|
13
|
+
height: 36px
|
|
14
|
+
padding: 6px 12px
|
|
15
|
+
margin: 0 8px
|
|
16
|
+
border: none
|
|
17
|
+
border-radius: 3px
|
|
18
|
+
overflow: hidden
|
|
19
|
+
background-color: transparent
|
|
20
|
+
background-repeat: no-repeat
|
|
21
|
+
|
|
22
|
+
i
|
|
23
|
+
pointer-events: none
|
|
24
|
+
height: 24px
|
|
25
|
+
width: 24px
|
|
26
|
+
padding: 0
|
|
27
|
+
|
|
28
|
+
&.hide
|
|
29
|
+
display: none
|
|
30
|
+
|
|
31
|
+
// pseudo class
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
&:focus
|
|
35
|
+
background-color: rgba(0, 0, 0, .1)
|
|
36
|
+
|
|
37
|
+
&:active
|
|
38
|
+
background-color: rgba(0, 0, 0, .1)
|
|
39
|
+
|
|
40
|
+
&:disabled
|
|
41
|
+
opacity: .5
|
|
42
|
+
background-color: transparent
|
|
43
|
+
&:hover
|
|
44
|
+
background-color: transparent
|
|
45
|
+
|
|
46
|
+
&[type="submit"]
|
|
47
|
+
font-weight: 600
|
|
48
|
+
padding: 6px 20px
|
|
49
|
+
|
|
50
|
+
// size
|
|
51
|
+
&.small-size
|
|
52
|
+
height: 36px
|
|
53
|
+
padding: 6px 12px
|
|
54
|
+
|
|
55
|
+
// styles
|
|
56
|
+
&.style-raised
|
|
57
|
+
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)
|
|
58
|
+
|
|
59
|
+
&.style-outline
|
|
60
|
+
border: 1px solid #E1E1E1
|
|
61
|
+
|
|
62
|
+
&.style-action
|
|
63
|
+
width: 40px
|
|
64
|
+
height: 40px
|
|
65
|
+
border-radius: 50%
|
|
66
|
+
padding: 8px
|
|
67
|
+
background-position: center
|
|
68
|
+
i
|
|
69
|
+
pointer-events: none
|
|
70
|
+
|
|
71
|
+
height: 24px
|
|
72
|
+
width: 24px
|
|
73
|
+
margin-left: 0
|
|
74
|
+
svg
|
|
75
|
+
fill: rgba(0, 0, 0, 0.67)
|
|
76
|
+
|
|
77
|
+
&:hover
|
|
78
|
+
background-color: rgba(0,0,0,.1)
|
|
79
|
+
|
|
80
|
+
&.small-size
|
|
81
|
+
width: 36px
|
|
82
|
+
height: 36px
|
|
83
|
+
padding: 6px
|
|
84
|
+
|
|
85
|
+
&.bold
|
|
86
|
+
font-weight: 600
|
|
87
|
+
|
|
88
|
+
&.normal-case
|
|
89
|
+
text-transform: none
|
|
90
|
+
|
|
91
|
+
&.color-secondary
|
|
92
|
+
color: $secondary-color-text
|
|
93
|
+
background-color: darken($secondary-color, 10%)
|
|
94
|
+
&:hover
|
|
95
|
+
background-color: darken($secondary-color, 5%)
|
|
96
|
+
&:focus
|
|
97
|
+
background-color: darken($secondary-color, 5%)
|
|
98
|
+
&:focus
|
|
99
|
+
background-color: darken($secondary-color, 10%)
|
|
100
|
+
&:disabled
|
|
101
|
+
background-color: darken($secondary-color, 10%)
|
|
102
|
+
&:hover
|
|
103
|
+
background-color: darken($secondary-color, 10%)
|
|
104
|
+
|
|
105
|
+
&.color-primary
|
|
106
|
+
color: $primary-color-text
|
|
107
|
+
background-color: darken($primary-color, 10%)
|
|
108
|
+
&:hover
|
|
109
|
+
background-color: darken($primary-color, 5%)
|
|
110
|
+
&:focus
|
|
111
|
+
background-color: darken($primary-color, 5%)
|
|
112
|
+
&:focus
|
|
113
|
+
background-color: darken($primary-color, 10%)
|
|
114
|
+
&:disabled
|
|
115
|
+
background-color: darken($primary-color, 10%)
|
|
116
|
+
&:hover
|
|
117
|
+
background-color: darken($primary-color, 10%)
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
@media only screen and (min-width: 640px)
|
|
121
|
+
.button
|
|
122
|
+
&:hover
|
|
123
|
+
background-color: rgba(0, 0, 0, .1)
|
|
124
|
+
&:focus
|
|
125
|
+
background-color: rgba(0, 0, 0, .1)
|
|
File without changes
|