@litejs/ui 26.2.0 → 26.3.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/css/base.css +4 -0
- package/el/dialog.ui +85 -96
- package/el/material.ui +154 -0
- package/el/menu.ui +213 -0
- package/el/ripple.ui +56 -0
- package/el/{Slider.ui → slider.ui} +81 -69
- package/load.js +2 -2
- package/package.json +2 -2
- package/ui.js +97 -91
- package/el/material.tpl +0 -428
- /package/el/{Pie.tpl → Pie.ui} +0 -0
- /package/el/{Segment7.tpl → Segment7.ui} +0 -0
package/el/material.tpl
DELETED
|
@@ -1,428 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
%css
|
|
3
|
-
.mat-Menu,
|
|
4
|
-
.tooltip {
|
|
5
|
-
border-radius: 2px;
|
|
6
|
-
position: absolute;
|
|
7
|
-
margin: 0;
|
|
8
|
-
opacity: 0;
|
|
9
|
-
transform: scale(0);
|
|
10
|
-
transition: opacity .4s cubic-bezier(0, 0, .2, 1) 0s, transform .2s cubic-bezier(0, 0, .2, 1) 0s;
|
|
11
|
-
}
|
|
12
|
-
.tooltip {
|
|
13
|
-
padding: 8px;
|
|
14
|
-
color: #fff;
|
|
15
|
-
background: #666;
|
|
16
|
-
font-weight: 500;
|
|
17
|
-
max-width: 90%;
|
|
18
|
-
text-align: center;
|
|
19
|
-
pointer-events: none;
|
|
20
|
-
z-index: 8;
|
|
21
|
-
}
|
|
22
|
-
.tooltip[data-pos]:before {
|
|
23
|
-
content: "";
|
|
24
|
-
position: absolute;
|
|
25
|
-
display: block;
|
|
26
|
-
width: .4em;
|
|
27
|
-
height: .4em;
|
|
28
|
-
border: .4em solid transparent;
|
|
29
|
-
border-left-color: #666;
|
|
30
|
-
border-top-color: #666;
|
|
31
|
-
}
|
|
32
|
-
.tooltip[data-pos=top]:before {
|
|
33
|
-
bottom: -.3em;
|
|
34
|
-
left: -.3em;
|
|
35
|
-
margin-left: 50%;
|
|
36
|
-
transform: rotate(225deg);
|
|
37
|
-
}
|
|
38
|
-
.tooltip[data-pos=bottom]:before {
|
|
39
|
-
top: -.3em;
|
|
40
|
-
left: -.3em;
|
|
41
|
-
margin-left: 50%;
|
|
42
|
-
transform: rotate(45deg);
|
|
43
|
-
}
|
|
44
|
-
.tooltip[data-pos=right]:before {
|
|
45
|
-
top: 50%;
|
|
46
|
-
left: -.3em;
|
|
47
|
-
margin-top: -.4em;
|
|
48
|
-
transform: rotate(315deg);
|
|
49
|
-
}
|
|
50
|
-
.tooltip[data-pos=left]:before {
|
|
51
|
-
top: -.3em;
|
|
52
|
-
right: -.3em;
|
|
53
|
-
margin-top: 50%;
|
|
54
|
-
transform: rotate(135deg);
|
|
55
|
-
}
|
|
56
|
-
.mat-Menu {
|
|
57
|
-
padding: 8px 0;
|
|
58
|
-
color: #000;
|
|
59
|
-
background: #fff;
|
|
60
|
-
min-width: 124px;
|
|
61
|
-
max-width: 100%;
|
|
62
|
-
z-index: 7;
|
|
63
|
-
}
|
|
64
|
-
.mat-Menu-item {
|
|
65
|
-
display: block;
|
|
66
|
-
padding: 12px 16px;
|
|
67
|
-
text-decoration: none;
|
|
68
|
-
line-height: 24px;
|
|
69
|
-
cursor: pointer;
|
|
70
|
-
overflow: hidden;
|
|
71
|
-
text-overflow: ellipsis;
|
|
72
|
-
white-space: nowrap;
|
|
73
|
-
}
|
|
74
|
-
.mat-Menu-item:hover {
|
|
75
|
-
background-color: #eee;
|
|
76
|
-
}
|
|
77
|
-
.mat-Menu-item[disabled] {
|
|
78
|
-
color: #bdbdbd;
|
|
79
|
-
background-color: transparent;
|
|
80
|
-
cursor: auto;
|
|
81
|
-
}
|
|
82
|
-
.mat-Menu-item.is-divider {
|
|
83
|
-
border-bottom: 1px solid #ddd;
|
|
84
|
-
}
|
|
85
|
-
.mat-Menu.is-visible,
|
|
86
|
-
.tooltip.is-visible {
|
|
87
|
-
transform: scale(1);
|
|
88
|
-
opacity: 1;
|
|
89
|
-
}
|
|
90
|
-
.waves {
|
|
91
|
-
position: relative;
|
|
92
|
-
overflow: hidden;
|
|
93
|
-
}
|
|
94
|
-
.waves-ripple {
|
|
95
|
-
position: absolute;
|
|
96
|
-
border-radius: 50%;
|
|
97
|
-
background-color: #000;
|
|
98
|
-
opacity: 0;
|
|
99
|
-
transform: scale(0);
|
|
100
|
-
transition: opacity .6s cubic-bezier(0, 0, .2, 1) 0s, transform 0s cubic-bezier(0, 0, .2, 1) .6s;
|
|
101
|
-
pointer-events: none;
|
|
102
|
-
}
|
|
103
|
-
.waves.is-active > .waves-ripple,
|
|
104
|
-
.waves-ripple--play {
|
|
105
|
-
opacity: .4;
|
|
106
|
-
transform: scale(1);
|
|
107
|
-
transition: opacity 1s cubic-bezier(0, 0, .2, 1) 0ms, transform .4s cubic-bezier(0, 0, .2, 1) 0ms;
|
|
108
|
-
}
|
|
109
|
-
.shadow-1 {
|
|
110
|
-
box-shadow: 0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12);
|
|
111
|
-
}
|
|
112
|
-
/**
|
|
113
|
-
* 1. Fix Webkit border-radius cropping for children.
|
|
114
|
-
*/
|
|
115
|
-
.Button,
|
|
116
|
-
.Checkbox,
|
|
117
|
-
.Fab,
|
|
118
|
-
.material {
|
|
119
|
-
font-size: 14px;
|
|
120
|
-
font-weight: 500;
|
|
121
|
-
position: relative;
|
|
122
|
-
text-transform: uppercase;
|
|
123
|
-
transition: all .2s cubic-bezier(.4,0,.2,1);
|
|
124
|
-
perspective: 1px; /* 1 */
|
|
125
|
-
}
|
|
126
|
-
.Button:focus,
|
|
127
|
-
.Fab:focus {
|
|
128
|
-
outline: none;
|
|
129
|
-
}
|
|
130
|
-
.Button,
|
|
131
|
-
.Button:disabled:hover {
|
|
132
|
-
background: transparent;
|
|
133
|
-
border: none;
|
|
134
|
-
min-width: 64px;
|
|
135
|
-
height: 36px;
|
|
136
|
-
line-height: 36px;
|
|
137
|
-
border-radius: 2px;
|
|
138
|
-
padding: 0 16px;
|
|
139
|
-
letter-spacing: 0;
|
|
140
|
-
text-align: center;
|
|
141
|
-
}
|
|
142
|
-
.Button.raised,
|
|
143
|
-
.Button:hover {
|
|
144
|
-
background-color: rgba(158,158,158, 0.20);
|
|
145
|
-
}
|
|
146
|
-
.Button:focus {
|
|
147
|
-
background-color: #ddd;
|
|
148
|
-
}
|
|
149
|
-
.raised:focus:not(:active) {
|
|
150
|
-
box-shadow: 0 0 8px rgba(0,0,0,.18),0 8px 16px rgba(0,0,0,.36);
|
|
151
|
-
}
|
|
152
|
-
.Button:disabled {
|
|
153
|
-
color: #aaa;
|
|
154
|
-
background: transparent;
|
|
155
|
-
}
|
|
156
|
-
.Fab {
|
|
157
|
-
border: none;
|
|
158
|
-
border-radius: 50%;
|
|
159
|
-
font-size: 24px;
|
|
160
|
-
height: 56px;
|
|
161
|
-
line-height: 56px;
|
|
162
|
-
width: 56px;
|
|
163
|
-
padding: 0;
|
|
164
|
-
background: rgba(158,158,158,.2);
|
|
165
|
-
}
|
|
166
|
-
.Button.is-warning,
|
|
167
|
-
.Fab--red {
|
|
168
|
-
color: #fff;
|
|
169
|
-
background-color: #f40;
|
|
170
|
-
}
|
|
171
|
-
.Button.is-warning>.waves-ripple,
|
|
172
|
-
.Fab--red>.waves-ripple {
|
|
173
|
-
background-color: #fff;
|
|
174
|
-
}
|
|
175
|
-
.Fab--red>.waves-ripple--play {
|
|
176
|
-
opacity: .6;
|
|
177
|
-
}
|
|
178
|
-
.raised {
|
|
179
|
-
box-shadow: 0 1px 1.5px 0 rgba(0,0,0,.12),0 1px 1px 0 rgba(0,0,0,.24);
|
|
180
|
-
}
|
|
181
|
-
.Checkbox {
|
|
182
|
-
display: block;
|
|
183
|
-
height: 56px;
|
|
184
|
-
line-height: 56px;
|
|
185
|
-
width: 56px;
|
|
186
|
-
}
|
|
187
|
-
.Checkbox-icon {
|
|
188
|
-
overflow: visible;
|
|
189
|
-
display: block;
|
|
190
|
-
height: 50%;
|
|
191
|
-
width: 50%;
|
|
192
|
-
top: 25%;
|
|
193
|
-
left: 25%;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
%js
|
|
197
|
-
!function($ui) {
|
|
198
|
-
var menuTarget, menuEl, tipTarget, tipEl, tick, wait
|
|
199
|
-
, ripple = El(".waves-ripple")
|
|
200
|
-
, html = document.documentElement
|
|
201
|
-
El.near = near
|
|
202
|
-
function near(source, target, x, y, margin) {
|
|
203
|
-
var rect = target.getBoundingClientRect()
|
|
204
|
-
, top = rect.top + El.scrollTop()
|
|
205
|
-
, left = rect.left + El.scrollLeft()
|
|
206
|
-
// svg elements dont have offsetWidth, IE8 does not have rect.width
|
|
207
|
-
, width = rect.width || target.offsetWidth || 0
|
|
208
|
-
, height = rect.height || target.offsetHeight || 0
|
|
209
|
-
if (x == "left") {
|
|
210
|
-
left -= source.offsetWidth + margin
|
|
211
|
-
x = "150%"
|
|
212
|
-
} else if (x == "left-start") {
|
|
213
|
-
left -= margin
|
|
214
|
-
x = "0%"
|
|
215
|
-
} else if (x == "right") {
|
|
216
|
-
left += width + margin
|
|
217
|
-
x = "-50%"
|
|
218
|
-
} else if (x == "right-end") {
|
|
219
|
-
left += width + margin - source.offsetWidth
|
|
220
|
-
x = "100%"
|
|
221
|
-
} else {
|
|
222
|
-
left += (width / 2) - (source.offsetWidth/2)
|
|
223
|
-
x = "50%"
|
|
224
|
-
}
|
|
225
|
-
if (y == "top") {
|
|
226
|
-
top -= margin + source.offsetHeight
|
|
227
|
-
y = " 150%"
|
|
228
|
-
} else if (y == "bottom") {
|
|
229
|
-
top += height + margin
|
|
230
|
-
y = " -50%"
|
|
231
|
-
setTimeout(function(){
|
|
232
|
-
//document.scrollingElement.scrollHeight
|
|
233
|
-
var overflow = top + source.offsetHeight - El.scrollTop() - document.documentElement.offsetHeight
|
|
234
|
-
if (overflow > 0) scrollBy({ top: overflow, left: 0, behavior: "smooth" })
|
|
235
|
-
}, 400)
|
|
236
|
-
} else {
|
|
237
|
-
top += (height / 2) - (source.offsetHeight/2)
|
|
238
|
-
y = " 50%"
|
|
239
|
-
}
|
|
240
|
-
El.css(source, {
|
|
241
|
-
"transform-origin": x + y,
|
|
242
|
-
top: (top < 0 ? 0 : top) + "px",
|
|
243
|
-
left: (left < 0 ? 0 : left) + "px"
|
|
244
|
-
})
|
|
245
|
-
}
|
|
246
|
-
El.on(html, "mouseover", onOver)
|
|
247
|
-
El.on(window, "focusin", onOver)
|
|
248
|
-
$ui.on("show", closeTooltip)
|
|
249
|
-
function onOver(e) {
|
|
250
|
-
var x, y, pos
|
|
251
|
-
, target = e.target
|
|
252
|
-
, text = El.get(target, "data-tooltip")
|
|
253
|
-
, relTarg = e.relatedTarget || e.fromElement
|
|
254
|
-
// without relTarg is event on click
|
|
255
|
-
if (!relTarg && e.type !== "focusin" || target === tipTarget) return
|
|
256
|
-
if (!text && tipTarget) {
|
|
257
|
-
for (; target = target.parentNode; ) {
|
|
258
|
-
if (target === tipTarget) return
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
closeTooltip()
|
|
262
|
-
if (!text) return
|
|
263
|
-
tipEl = openVisible("pre.tooltip", tipTarget = target)
|
|
264
|
-
pos = El.get(target, "data-tooltip-pos") || "top"
|
|
265
|
-
El.txt(tipEl, text)
|
|
266
|
-
if (pos === "left" || pos === "right") {
|
|
267
|
-
x = pos
|
|
268
|
-
} else {
|
|
269
|
-
y = pos
|
|
270
|
-
}
|
|
271
|
-
El.set(tipEl, "data-pos", pos)
|
|
272
|
-
near(tipEl, target, x, y, 6)
|
|
273
|
-
}
|
|
274
|
-
function openVisible(tag, target) {
|
|
275
|
-
var el = typeof tag == "string" ? El(tag) : tag
|
|
276
|
-
, scope = El.scope(el, target)
|
|
277
|
-
scope.openTarget = target
|
|
278
|
-
El.render(el)
|
|
279
|
-
El.append(document.body, el)
|
|
280
|
-
El.cls(el, "is-visible", 1, 5)
|
|
281
|
-
return el
|
|
282
|
-
}
|
|
283
|
-
function closeVisible(el, delay) {
|
|
284
|
-
if (el) {
|
|
285
|
-
setTimeout(el.closeFn || El.kill.bind(El, el), 999)
|
|
286
|
-
El.cls(el, "is-visible", 0, delay)
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
function closeTooltip() {
|
|
290
|
-
if (tipEl) {
|
|
291
|
-
closeVisible(tipEl)
|
|
292
|
-
tipTarget = tipEl = null
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
function closeMenu(e) {
|
|
296
|
-
if (e && e.target == menuTarget) return
|
|
297
|
-
if (menuEl) {
|
|
298
|
-
closeVisible(menuEl, 200)
|
|
299
|
-
El.cls(menuTarget, "is-active", menuEl = menuTarget = null)
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
$ui.on("ping", closeMenu)
|
|
303
|
-
$ui.on("closeMenu", closeMenu)
|
|
304
|
-
$ui.on("showMenu", function(e, target, menu, x, y, margin) {
|
|
305
|
-
El.stop(e)
|
|
306
|
-
var close = menuEl && menuTarget == target
|
|
307
|
-
closeMenu()
|
|
308
|
-
if (close) return
|
|
309
|
-
menuEl = openVisible(menu, target)
|
|
310
|
-
if (x == "mouse") {
|
|
311
|
-
El.css(menuEl, {
|
|
312
|
-
top: e.pageY + "px",
|
|
313
|
-
left: e.pageX + "px"
|
|
314
|
-
})
|
|
315
|
-
} else {
|
|
316
|
-
El.cls(menuTarget = target, "is-active")
|
|
317
|
-
near(menuEl, target, x, y, margin)
|
|
318
|
-
}
|
|
319
|
-
if (menuEl.style.transform !== void 0) {
|
|
320
|
-
El.cls(menuEl, "no-events")
|
|
321
|
-
El.on(menuEl, "transitionend", function(e) {
|
|
322
|
-
if (e.propertyName === "transform") El.cls(menuEl, "no-events", 0)
|
|
323
|
-
})
|
|
324
|
-
}
|
|
325
|
-
})
|
|
326
|
-
El.on(html, "click", closeMenu)
|
|
327
|
-
El.on(html, "pointerdown", pointerdown)
|
|
328
|
-
function pointerdown(e) {
|
|
329
|
-
var target = e.target
|
|
330
|
-
if (!El.hasClass(target, "waves") || target.disabled) return
|
|
331
|
-
var rect = target.getBoundingClientRect()
|
|
332
|
-
, fromMouse = !El.hasClass(target, "Checkbox-icon")
|
|
333
|
-
, top = fromMouse ? e.clientY - rect.top : rect.height
|
|
334
|
-
, left = fromMouse ? e.clientX - rect.left : rect.width
|
|
335
|
-
, maxH = Math.max(top, target.offsetHeight - top)
|
|
336
|
-
, maxW = Math.max(left, target.offsetWidth - left)
|
|
337
|
-
, max = Math.sqrt(maxH * maxH + maxW * maxW)
|
|
338
|
-
, size = (fromMouse ? 2 * max : max) + "px"
|
|
339
|
-
El.css(ripple, {
|
|
340
|
-
top: (top - max) + "px",
|
|
341
|
-
left: (left - max) + "px",
|
|
342
|
-
width: size,
|
|
343
|
-
height: size
|
|
344
|
-
})
|
|
345
|
-
El.append(target, ripple)
|
|
346
|
-
clearTimeout(tick)
|
|
347
|
-
end()
|
|
348
|
-
wait = 1
|
|
349
|
-
tick = setTimeout(end, 800)
|
|
350
|
-
El.one(html, "pointerup", end)
|
|
351
|
-
ripple.offsetTop // force repaint
|
|
352
|
-
El.cls(ripple, "waves-ripple--play")
|
|
353
|
-
}
|
|
354
|
-
function end() {
|
|
355
|
-
if (!(wait--)) {
|
|
356
|
-
El.cls(ripple, "waves-ripple--play", 0)
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
}($ui)
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
%el Checkbox
|
|
363
|
-
label.Checkbox
|
|
364
|
-
input[type=checkbox].hide
|
|
365
|
-
i.Checkbox-icon.waves
|
|
366
|
-
|
|
367
|
-
%el Button
|
|
368
|
-
button[type=button].Button.waves Button
|
|
369
|
-
|
|
370
|
-
%el Fab
|
|
371
|
-
button[type=button].Fab.waves.raised
|
|
372
|
-
|
|
373
|
-
%el Radio
|
|
374
|
-
button[type=button].Radio.waves
|
|
375
|
-
|
|
376
|
-
%css
|
|
377
|
-
.MenuBtn {
|
|
378
|
-
position: relative;
|
|
379
|
-
width: 30px;
|
|
380
|
-
height: 30px;
|
|
381
|
-
background: transparent;
|
|
382
|
-
color: #fff;
|
|
383
|
-
}
|
|
384
|
-
.MenuBtn-x,
|
|
385
|
-
.MenuBtn-x:before,
|
|
386
|
-
.MenuBtn-x:after {
|
|
387
|
-
display: block;
|
|
388
|
-
content: "";
|
|
389
|
-
background-color: currentColor;
|
|
390
|
-
position: absolute;
|
|
391
|
-
width: 100%;
|
|
392
|
-
height: .3em;
|
|
393
|
-
border-radius: .3em;
|
|
394
|
-
pointer-events: none;
|
|
395
|
-
transition-property: transform;
|
|
396
|
-
}
|
|
397
|
-
.MenuBtn-x:before {
|
|
398
|
-
transform: translate(0, -.6em);
|
|
399
|
-
}
|
|
400
|
-
.MenuBtn-x:after {
|
|
401
|
-
transform: translate(0, .6em);
|
|
402
|
-
}
|
|
403
|
-
.MenuBtn--back > .MenuBtn-x,
|
|
404
|
-
.MenuBtn--close > .MenuBtn-x {
|
|
405
|
-
color: #666;
|
|
406
|
-
transform: rotateZ(-180deg);
|
|
407
|
-
}
|
|
408
|
-
.MenuBtn--back > .MenuBtn-x:before {
|
|
409
|
-
transform: rotateZ(45deg) scaleX(.75) translate(0, -230%);
|
|
410
|
-
}
|
|
411
|
-
.MenuBtn--back > .MenuBtn-x:after {
|
|
412
|
-
transform: rotateZ(-45deg) scaleX(.75) translate(0, 230%)
|
|
413
|
-
}
|
|
414
|
-
.MenuBtn--close > .MenuBtn-x {
|
|
415
|
-
background-color: transparent;
|
|
416
|
-
}
|
|
417
|
-
.MenuBtn--close > .MenuBtn-x:before {
|
|
418
|
-
transform: rotateZ(45deg) translate(0, 0);
|
|
419
|
-
}
|
|
420
|
-
.MenuBtn--close > .MenuBtn-x:after {
|
|
421
|
-
transform: rotateZ(-45deg) translate(0, 0);
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
%el MenuBtn
|
|
425
|
-
button[type=button].MenuBtn.reset.noselect
|
|
426
|
-
.MenuBtn-x.anim
|
|
427
|
-
|
|
428
|
-
|
/package/el/{Pie.tpl → Pie.ui}
RENAMED
|
File without changes
|
|
File without changes
|