@litejs/ui 24.0.0-rc.4 → 24.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/README.md +8 -11
- package/binding/persist.js +8 -18
- package/binding/sticky.js +2 -4
- package/binding/svg.js +2 -2
- package/binding/topfloat.js +1 -2
- package/css/base.css +11 -15
- package/css/form.css +168 -28
- package/css/grid.css +1 -1
- package/css/hr-label.css +21 -0
- package/css/smooth-scroll.css +8 -0
- package/el/Slider.tpl +19 -17
- package/el/crop.ui +49 -0
- package/el/{confirm.tpl → dialog.ui} +54 -42
- package/el/{form1.tpl → form.ui} +99 -99
- package/el/material.tpl +11 -11
- package/index.js +573 -571
- package/load.js +6 -9
- package/package.json +6 -21
- package/{polyfill → shim}/index.js +17 -17
- package/binding/_default.js +0 -165
- package/binding/list.js +0 -86
- package/css/form2.css +0 -142
- package/polyfill/base64.js +0 -43
- package/polyfill/blob.js +0 -5
- package/polyfill/promise.js +0 -141
- package/polyfill/string.js +0 -98
- package/polyfill/typed.js +0 -31
- package/stat.js +0 -205
package/load.js
CHANGED
|
@@ -44,7 +44,6 @@
|
|
|
44
44
|
// THANKS: Juriy Zaytsev - Global eval [http://perfectionkills.com/global-eval-what-are-the-options/]
|
|
45
45
|
// In case of local execution `e('eval')` returns undefined
|
|
46
46
|
Function("e,eval", "try{return e('eval')}catch(e){}")(eval) ||
|
|
47
|
-
/* ignore next */
|
|
48
47
|
Function("a", "var d=document,b=d.body,s=d.createElement('script');s.text=a;b.removeChild(b.insertBefore(s,b.firstChild))")
|
|
49
48
|
/*/
|
|
50
49
|
eval
|
|
@@ -179,25 +178,23 @@
|
|
|
179
178
|
function load(files, next, raw) {
|
|
180
179
|
files = [].concat(files)
|
|
181
180
|
var file
|
|
182
|
-
, i = 0
|
|
183
181
|
, pos = 0
|
|
184
182
|
, len = files.length
|
|
185
183
|
, res = []
|
|
186
184
|
|
|
187
|
-
for (;
|
|
188
|
-
if (loaded[file])
|
|
185
|
+
for (; pos < len; pos++) if ((file = files[pos])) {
|
|
186
|
+
if (loaded[file] === 2) files[pos] = 0
|
|
187
|
+
else if (loaded[file]) {
|
|
189
188
|
// Same file requested again before responce
|
|
190
|
-
;(loaded[file].x || (loaded[file].x = [])).push(exec, res,
|
|
189
|
+
;(loaded[file].x || (loaded[file].x = [])).push(exec, res, pos)
|
|
191
190
|
} else {
|
|
192
191
|
// FireFox 3 throws on `xhr.send()` without arguments
|
|
193
|
-
xhr("GET", file, loaded[file] = cb,
|
|
192
|
+
xhr("GET", file, loaded[file] = cb, pos).send(null)
|
|
194
193
|
}
|
|
195
|
-
pos++
|
|
196
194
|
}
|
|
197
195
|
exec(pos = 0)
|
|
198
196
|
|
|
199
197
|
function cb(err, str, fileName, filePos) {
|
|
200
|
-
;(xhr._l || (xhr._l = [])).push(fileName)
|
|
201
198
|
loaded[fileName] = 2
|
|
202
199
|
res[filePos] = err ? (onerror(err, fileName), "") : str
|
|
203
200
|
exec()
|
|
@@ -231,7 +228,7 @@
|
|
|
231
228
|
else {
|
|
232
229
|
if (next) next(res)
|
|
233
230
|
if ((next = cb.x)) {
|
|
234
|
-
for (
|
|
231
|
+
for (pos = 0; next[pos]; ) next[pos++](next[pos++][next[pos++]] = "")
|
|
235
232
|
}
|
|
236
233
|
}
|
|
237
234
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@litejs/ui",
|
|
3
|
-
"version": "24.
|
|
3
|
+
"version": "24.5.0",
|
|
4
4
|
"description": "UI engine for LiteJS full-stack framework",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Lauri Rooden <lauri@rooden.ee>",
|
|
@@ -19,29 +19,14 @@
|
|
|
19
19
|
"binding",
|
|
20
20
|
"css",
|
|
21
21
|
"el",
|
|
22
|
-
"
|
|
22
|
+
"shim"
|
|
23
23
|
],
|
|
24
24
|
"scripts": {
|
|
25
|
-
"
|
|
25
|
+
"lint": "jshint --config=.github/jshint.json *.js",
|
|
26
|
+
"test": "lj test test/index.js --tz='Europe/Tallinn' --brief --sources=load.js,require.js,index.js"
|
|
26
27
|
},
|
|
27
28
|
"devDependencies": {
|
|
28
|
-
"@litejs/cli": "
|
|
29
|
-
"
|
|
30
|
-
},
|
|
31
|
-
"litejs": {
|
|
32
|
-
"build": "lj b --out=test/index.html test/dev.html"
|
|
33
|
-
},
|
|
34
|
-
"jshintConfig": {
|
|
35
|
-
"esversion": 5,
|
|
36
|
-
"asi": true,
|
|
37
|
-
"evil": true,
|
|
38
|
-
"laxcomma": true,
|
|
39
|
-
"maxdepth": 6,
|
|
40
|
-
"node": true,
|
|
41
|
-
"nonbsp": true,
|
|
42
|
-
"undef": true,
|
|
43
|
-
"unused": true,
|
|
44
|
-
"shadow": "outer",
|
|
45
|
-
"quotmark": "double"
|
|
29
|
+
"@litejs/cli": "24.0.0-rc.3",
|
|
30
|
+
"@litejs/dom": "23.12.1"
|
|
46
31
|
}
|
|
47
32
|
}
|
|
@@ -32,10 +32,10 @@
|
|
|
32
32
|
, esc = escape
|
|
33
33
|
, _parseInt = parseInt
|
|
34
34
|
/*** debug ***/
|
|
35
|
+
, IS_NODE = !window.document
|
|
35
36
|
, document = patch("document", {body:{},documentElement:{}})
|
|
36
37
|
, location = patch("location", {href:""})
|
|
37
38
|
, navigator = patch("navigator")
|
|
38
|
-
, IS_NODE = !document.location
|
|
39
39
|
/*/
|
|
40
40
|
, document = window.document
|
|
41
41
|
, location = window.location
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
, Event = patch(
|
|
58
58
|
EV,
|
|
59
59
|
"c=F.createEventObject(event),b=c.buttons=c.button;c.button=b==1?0:b==4?1:b;c.preventDefault=X;c.stopPropagation=Y;c.target=c.srcElement;c.type=a;return c",
|
|
60
|
-
!
|
|
60
|
+
!isFn(O[EV]) && document,
|
|
61
61
|
Function("this.returnValue=!1"),
|
|
62
62
|
Function("this.cancelBubble=this.cancel=!0")
|
|
63
63
|
)
|
|
@@ -106,9 +106,9 @@
|
|
|
106
106
|
|
|
107
107
|
|
|
108
108
|
// Patch parameters support for setTimeout callback
|
|
109
|
-
patch("setTimeout", (a = "return O(X(a)&&A.length>2?a.apply.bind(a,null,S.call(A,2)):a,b)"), ie6789,
|
|
110
|
-
// b = setInterval
|
|
111
|
-
patch(b, a, ie6789,
|
|
109
|
+
patch("setTimeout", (a = "return O(X(a)&&A.length>2?a.apply.bind(a,null,S.call(A,2)):a,b)"), ie6789, isFn)
|
|
110
|
+
// b = "setInterval"
|
|
111
|
+
patch(b, a, ie6789, isFn)
|
|
112
112
|
|
|
113
113
|
// 20 fps is good enough
|
|
114
114
|
patch("request" + (a = "AnimationFrame"), "return setTimeout(a,50)")
|
|
@@ -122,7 +122,7 @@
|
|
|
122
122
|
patch(onhashchange, null)
|
|
123
123
|
setInterval(function() {
|
|
124
124
|
var cur = location.href.split("#")[1]
|
|
125
|
-
if (lastHash !== cur &&
|
|
125
|
+
if (lastHash !== cur && isFn(window[onhashchange])) {
|
|
126
126
|
window[onhashchange]()
|
|
127
127
|
}
|
|
128
128
|
}, 60)
|
|
@@ -262,15 +262,15 @@
|
|
|
262
262
|
|
|
263
263
|
patch("JSON", {
|
|
264
264
|
parse: function(t) {
|
|
265
|
-
return Function("return(" + t
|
|
265
|
+
return Function("return(" + t + ")")()
|
|
266
266
|
},
|
|
267
267
|
stringify: function stringify(o) {
|
|
268
268
|
// IE 8 serializes `undefined` as `"undefined"`
|
|
269
269
|
return (
|
|
270
|
-
|
|
270
|
+
isStr(o) ? "\"" + o.replace(jsonRe, jsonFn) + "\"" :
|
|
271
271
|
o !== o || o == null || o === Infinity || o === -Infinity ? "null" :
|
|
272
272
|
typeof o == "object" ? (
|
|
273
|
-
|
|
273
|
+
isFn(o.toJSON) ? stringify(o.toJSON()) :
|
|
274
274
|
isArray(o) ? "[" + o.map(stringify) + "]" :
|
|
275
275
|
"{" + oKeys(o).flatMap(function(key) {
|
|
276
276
|
return o[key] === void 0 ? [] : stringify(key) + ":" + stringify(o[key])
|
|
@@ -344,7 +344,7 @@
|
|
|
344
344
|
|
|
345
345
|
// TODO:2021-02-25:lauri:Accept iterable objects
|
|
346
346
|
//patch("from", "a=S.call(a);return b?a.map(b,c):a")
|
|
347
|
-
patch("from", "a=X(a)?a.split(''):b?a:S.call(a);return b?a.map(b,c):a", 0,
|
|
347
|
+
patch("from", "a=X(a)?a.split(''):b?a:S.call(a);return b?a.map(b,c):a", 0, isStr)
|
|
348
348
|
patch("of", "return S.call(A)")
|
|
349
349
|
|
|
350
350
|
O = O[P]
|
|
@@ -356,7 +356,7 @@
|
|
|
356
356
|
patch("lastIndexOf", a + "i=(b|0)||l;i>--l&&(i=l)||i<0&&(i+=l);++i;while(--i>-1)" + c)
|
|
357
357
|
|
|
358
358
|
b = a + "if(A.length<2)b=t"
|
|
359
|
-
c = "b=a
|
|
359
|
+
c = "b=a(b,t[i],i,t);return b"
|
|
360
360
|
patch("reduce", b + "[++i];while(++i<l)" + c)
|
|
361
361
|
patch("reduceRight", b + "[--l];i=l;while(i--)" + c)
|
|
362
362
|
|
|
@@ -402,7 +402,7 @@
|
|
|
402
402
|
// The HTML5 document.head DOM tree accessor
|
|
403
403
|
// patch("head", document.getElementsByTagName("head")[0])
|
|
404
404
|
// HTMLElement (IE9) -> Element (IE8)
|
|
405
|
-
O =
|
|
405
|
+
O = html
|
|
406
406
|
var selectorCache = {}
|
|
407
407
|
, selectorRe = /([.#:[])([-\w]+)(?:\(((?:[^()]|\([^)]+\))+?)\)|([~^$*|]?)=(("|')(?:\\.|[^\\])*?\6|[-\w]+))?]?/g
|
|
408
408
|
, selectorLastRe = /([\s>+~]*)(?:("|')(?:\\.|[^\\])*?\2|\((?:[^()]|\([^()]+\))+?\)|~=|[^'"()\s>+~])+$/
|
|
@@ -426,8 +426,8 @@
|
|
|
426
426
|
"++": "m(_.previousSibling,v)",
|
|
427
427
|
"": "c(_.parentNode,v)"
|
|
428
428
|
}
|
|
429
|
+
, closest = patch("closest", walk.bind(window, "parentNode", 1))
|
|
429
430
|
, matches = patch("matches", "return!!X(a)(t)", 0, selectorFn)
|
|
430
|
-
, closest = walk.bind(window, "parentNode", 1)
|
|
431
431
|
|
|
432
432
|
// The addEventListener is supported in Internet Explorer from version 9.
|
|
433
433
|
// https://developer.mozilla.org/en-US/docs/Web/Reference/Events/wheel
|
|
@@ -450,7 +450,7 @@
|
|
|
450
450
|
|
|
451
451
|
|
|
452
452
|
function selectorFn(str) {
|
|
453
|
-
if (str != null && !
|
|
453
|
+
if (str != null && !isStr(str)) throw Error("Invalid selector")
|
|
454
454
|
return selectorCache[str || ""] ||
|
|
455
455
|
(selectorCache[str] = Function("m,c", "return function(_,v,a,b){return " +
|
|
456
456
|
str.split(selectorSplitRe).map(function(sel) {
|
|
@@ -508,10 +508,10 @@
|
|
|
508
508
|
} catch(e){}
|
|
509
509
|
}
|
|
510
510
|
|
|
511
|
-
function
|
|
511
|
+
function isFn(value) {
|
|
512
512
|
return typeof value === "function"
|
|
513
513
|
}
|
|
514
|
-
function
|
|
514
|
+
function isStr(value) {
|
|
515
515
|
return typeof value === "string"
|
|
516
516
|
}
|
|
517
517
|
function nop() {}
|
|
@@ -519,7 +519,7 @@
|
|
|
519
519
|
function patch(key_, src, force, arg1, arg2) {
|
|
520
520
|
var key = key_.split(":").pop()
|
|
521
521
|
return !force && O[key] || (O[patched.push(key_), key] = (
|
|
522
|
-
|
|
522
|
+
isStr(src) ?
|
|
523
523
|
Function("o,O,P,S,F,X,Y", "return function(a,b,c){var t=this,A=arguments;" + src + "}")(hasOwn, O[key], P, patched.slice, force, arg1, arg2) :
|
|
524
524
|
src === UNDEF ? {} :
|
|
525
525
|
src
|
package/binding/_default.js
DELETED
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
/* litejs.com/MIT-LICENSE.txt */
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
/* global El, View, i18n */
|
|
6
|
-
!function(bindings) {
|
|
7
|
-
var hasOwn = Object.prototype.hasOwnProperty
|
|
8
|
-
, slice = Array.prototype.slice
|
|
9
|
-
|
|
10
|
-
bindingEvery.once =
|
|
11
|
-
emitForm.once =
|
|
12
|
-
bindingFn.once =
|
|
13
|
-
bindingsEach.raw = bindingsEach.once =
|
|
14
|
-
true
|
|
15
|
-
|
|
16
|
-
bindings.every = bindingEvery
|
|
17
|
-
function bindingEvery(el, list, attrName) {
|
|
18
|
-
var len = 0
|
|
19
|
-
, data = this
|
|
20
|
-
, parent = el.parentNode
|
|
21
|
-
, comm = document.createComment("every " + (list.name || list.length))
|
|
22
|
-
, nodes = []
|
|
23
|
-
|
|
24
|
-
parent.replaceChild(comm, el)
|
|
25
|
-
|
|
26
|
-
if (list) {
|
|
27
|
-
if (typeof list === "string") {
|
|
28
|
-
data.model.on("change:" + list, render)
|
|
29
|
-
El.on(parent, "kill", function() {
|
|
30
|
-
data.model.off("change:" + list, render)
|
|
31
|
-
})
|
|
32
|
-
render()
|
|
33
|
-
} else if (list.eachLive) {
|
|
34
|
-
list.eachLive(add, remove, list)
|
|
35
|
-
El.on(parent, "kill", function() {
|
|
36
|
-
list.off("add", add, list).off("remove", remove, list)
|
|
37
|
-
})
|
|
38
|
-
} else {
|
|
39
|
-
comm.render = render
|
|
40
|
-
render()
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
return true
|
|
44
|
-
|
|
45
|
-
function render() {
|
|
46
|
-
for (; len; len--) {
|
|
47
|
-
remove(len)
|
|
48
|
-
}
|
|
49
|
-
var _list = typeof list === "string" ? data.model.get(list, []) : list
|
|
50
|
-
if (typeof _list === "string") _list.split(",")
|
|
51
|
-
Object.each(_list, add, (
|
|
52
|
-
_list.constructor === Object ? Object.keys(_list) : _list
|
|
53
|
-
))
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
function add(item, i) {
|
|
57
|
-
len++
|
|
58
|
-
var up
|
|
59
|
-
, clone = el.cloneNode(true)
|
|
60
|
-
, scope = El.scope(clone, data)
|
|
61
|
-
, before = nodes[i] || comm
|
|
62
|
-
if (!before.parentNode) return
|
|
63
|
-
nodes.splice(i, 0, clone)
|
|
64
|
-
scope.i = i
|
|
65
|
-
scope._scope = scope
|
|
66
|
-
scope.len = this.length
|
|
67
|
-
scope[attrName || "item"] = item
|
|
68
|
-
El.append(before.parentNode, clone, before)
|
|
69
|
-
El.render(clone, scope)
|
|
70
|
-
if (typeof item.on === "function") {
|
|
71
|
-
item.on("change", up = El.render.bind(clone, clone))
|
|
72
|
-
El.on(clone, "kill", function() {
|
|
73
|
-
item.off("change", up)
|
|
74
|
-
})
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
function remove(item, i) {
|
|
79
|
-
El.kill(nodes.splice(i, 1)[0])
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
bindings.fn = bindingFn
|
|
84
|
-
function bindingFn(el, fn) {
|
|
85
|
-
return fn.apply(el, slice.call(arguments, 3))
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
bindings.is = function bindingIs(node, model, path, list, state, prefix) {
|
|
89
|
-
var match
|
|
90
|
-
, scope = this
|
|
91
|
-
if (typeof model === "string") {
|
|
92
|
-
prefix = state
|
|
93
|
-
state = list
|
|
94
|
-
list = path
|
|
95
|
-
path = model
|
|
96
|
-
model = scope.model
|
|
97
|
-
}
|
|
98
|
-
if (model && path) {
|
|
99
|
-
if (!prefix) prefix = "is-"
|
|
100
|
-
match = i18n.pick(state !== match ? state : model.get(path), list)
|
|
101
|
-
path += "-" + list
|
|
102
|
-
El.cls(node, node[prefix + path], 0)
|
|
103
|
-
El.cls(node, node[prefix + path] = match && prefix + match)
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
bindings.emitForm = emitForm
|
|
108
|
-
function emitForm(el, ev, a1, a2, a3, a4) {
|
|
109
|
-
El.on(el, "submit", function(e) {
|
|
110
|
-
var data = El.val(el)
|
|
111
|
-
View.emit(ev, e, data, a1, a2, a3, a4)
|
|
112
|
-
return Event.stop(e)
|
|
113
|
-
})
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
function getChilds(node) {
|
|
117
|
-
var child
|
|
118
|
-
, childs = node._childs
|
|
119
|
-
if (!childs) {
|
|
120
|
-
for (node._childs = childs = []; (child = node.firstChild); ) {
|
|
121
|
-
childs.push(child);
|
|
122
|
-
node.removeChild(child)
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
return childs
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
bindings.each = bindingsEach
|
|
129
|
-
|
|
130
|
-
function bindingsEach(el, expr) {
|
|
131
|
-
var node = el
|
|
132
|
-
, child = getChilds(node)[0]
|
|
133
|
-
, match = /^\s*(\w+) in (\w*)(.*)/.exec(expr)
|
|
134
|
-
, fn = "with(data){var out=[],loop={i:0,offset:0},_1,_2=" + match[2] +
|
|
135
|
-
match[3].replace(/ (limit|offset):\s*(\d+)/ig, ";loop.$1=$2") +
|
|
136
|
-
";if(_2)for(_1 in _2)if(hasOwn.call(_2,_1)&&!(loop.offset&&loop.offset--)){" +
|
|
137
|
-
"loop.i++;" +
|
|
138
|
-
"if(loop.limit&&loop.i-loop.offset>loop.limit)break;" +
|
|
139
|
-
"var clone=el.cloneNode(true)" +
|
|
140
|
-
",scope=El.scope(clone,data);" +
|
|
141
|
-
"scope.loopKey=loop.key=_1;" +
|
|
142
|
-
"scope.loop=loop;" +
|
|
143
|
-
"scope." + match[1] + "=_2[_1];" +
|
|
144
|
-
"out.push(clone);" +
|
|
145
|
-
"};return out}"
|
|
146
|
-
|
|
147
|
-
var childs = Function("hasOwn,el,data", fn)(hasOwn, child, this)
|
|
148
|
-
|
|
149
|
-
El.append(El.empty(node), childs)
|
|
150
|
-
El.render(node)
|
|
151
|
-
return node
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
bindings.focus = function(el) {
|
|
155
|
-
el.focus()
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
bindings.href = function(el, url) {
|
|
159
|
-
if (url) {
|
|
160
|
-
var chr = url.charAt(0)
|
|
161
|
-
El.attr(el, "href", chr === "+" || chr === "%" ? "#" + View.expand(url) : url)
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
}(El.bindings) // jshint ignore:line
|
|
165
|
-
|
package/binding/list.js
DELETED
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
/* litejs.com/MIT-LICENSE.txt */
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
/* global El */
|
|
7
|
-
El.bindings.list = function(node, list, extra, val) {
|
|
8
|
-
var child = node._child
|
|
9
|
-
, data = this
|
|
10
|
-
, extraLen = 0
|
|
11
|
-
|
|
12
|
-
if (!child) {
|
|
13
|
-
child = node._child = node.removeChild(node.firstChild)
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
if (!list || node._list == list) return
|
|
17
|
-
|
|
18
|
-
if (node._list) clear()
|
|
19
|
-
|
|
20
|
-
node._list = data.list = list
|
|
21
|
-
|
|
22
|
-
El.on(node, "kill", clear)
|
|
23
|
-
|
|
24
|
-
El.cls(node, "loading")
|
|
25
|
-
|
|
26
|
-
if (extra) {
|
|
27
|
-
extra.each(clone)
|
|
28
|
-
extraLen = extra.length
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
list
|
|
32
|
-
.each(clone)
|
|
33
|
-
.on("add", clone).on("remove", remove)
|
|
34
|
-
.on("startLoading", function(){
|
|
35
|
-
El.cls(node, "loading")
|
|
36
|
-
})
|
|
37
|
-
.on("endLoading", function(){
|
|
38
|
-
El.cls(node, "loading", 0)
|
|
39
|
-
})
|
|
40
|
-
.then(function() {
|
|
41
|
-
if (val !== void 0 && El.val(node) !== val) {
|
|
42
|
-
if (!this.get(val)) {
|
|
43
|
-
clone({id:val,name:val}, extraLen)
|
|
44
|
-
extraLen++
|
|
45
|
-
}
|
|
46
|
-
El.val(node, val)
|
|
47
|
-
}
|
|
48
|
-
El.cls(node, "loading", 0)
|
|
49
|
-
})
|
|
50
|
-
|
|
51
|
-
// Do not render childs when list initialized
|
|
52
|
-
return true
|
|
53
|
-
|
|
54
|
-
function clone(item, pos) {
|
|
55
|
-
var clone = child.cloneNode(true)
|
|
56
|
-
, scope = El.scope(clone, data)
|
|
57
|
-
scope.item = item.data || item || {id:item,name:item}
|
|
58
|
-
scope.model = item
|
|
59
|
-
scope.pos = pos
|
|
60
|
-
function up() {
|
|
61
|
-
El.render(clone, scope)
|
|
62
|
-
}
|
|
63
|
-
if (item.on) {
|
|
64
|
-
item.on("change", up)
|
|
65
|
-
El.on(clone, "kill", function(){
|
|
66
|
-
item.off("change", up)
|
|
67
|
-
})
|
|
68
|
-
}
|
|
69
|
-
El.append(node, clone, extraLen + pos)
|
|
70
|
-
return El.render(clone, scope)
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
function remove(item, pos) {
|
|
74
|
-
El.kill(node.childNodes[extraLen + pos])
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
function clear() {
|
|
78
|
-
var list = node._list
|
|
79
|
-
El.empty(node)
|
|
80
|
-
if (list) {
|
|
81
|
-
node._list = null
|
|
82
|
-
list.off("add", clone).off("remove", remove)
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
|
package/css/form2.css
DELETED
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
:focus {
|
|
4
|
-
outline: 0;
|
|
5
|
-
box-shadow:
|
|
6
|
-
0 0 0 .2rem #fff,
|
|
7
|
-
0 0 0 .35rem #069;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
/* Remove focus for non-keyboard navigation */
|
|
11
|
-
:focus:not(:focus-visible) {
|
|
12
|
-
box-shadow: none;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
fieldset {
|
|
18
|
-
position: relative;
|
|
19
|
-
}
|
|
20
|
-
label {
|
|
21
|
-
cursor: pointer;
|
|
22
|
-
line-height: 32px;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
input[type=checkbox].Toggle,
|
|
26
|
-
input[type=submit] {
|
|
27
|
-
-webkit-appearance: none;
|
|
28
|
-
-moz-appearance: none;
|
|
29
|
-
appearance: none;
|
|
30
|
-
position: relative;
|
|
31
|
-
text-align: center;
|
|
32
|
-
text-decoration: none;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
select[disabled],
|
|
36
|
-
input[disabled],
|
|
37
|
-
input[readonly] {
|
|
38
|
-
background: red;
|
|
39
|
-
color: #666;
|
|
40
|
-
font-style: italic;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
input, select, textarea {
|
|
44
|
-
color: #0F0D1B;
|
|
45
|
-
background: #c4c4c4;
|
|
46
|
-
}
|
|
47
|
-
body .btn:active, .btn:focus,
|
|
48
|
-
input:active, input:focus,
|
|
49
|
-
select:active, select:focus,
|
|
50
|
-
textarea:active, textarea:focus {
|
|
51
|
-
box-shadow:
|
|
52
|
-
0 2px 5px rgba(0, 0, 0, .5) inset,
|
|
53
|
-
0 0 3px 3px #029FE3;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
input {
|
|
57
|
-
vertical-align: middle;
|
|
58
|
-
margin: 1em;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
input.Toggle {
|
|
63
|
-
-webkit-appearance: none;
|
|
64
|
-
-moz-appearance: none;
|
|
65
|
-
appearance: none;
|
|
66
|
-
position: relative;
|
|
67
|
-
padding: 0;
|
|
68
|
-
outline: 0;
|
|
69
|
-
width: 36px;
|
|
70
|
-
height: 14px;
|
|
71
|
-
margin: 4px 0;
|
|
72
|
-
border-radius: 7px;
|
|
73
|
-
}
|
|
74
|
-
input.Toggle:after {
|
|
75
|
-
position: relative;
|
|
76
|
-
width: 20px;
|
|
77
|
-
height: 20px;
|
|
78
|
-
border-radius: 10px;
|
|
79
|
-
}
|
|
80
|
-
input.Toggle:after {
|
|
81
|
-
content: "";
|
|
82
|
-
display: block;
|
|
83
|
-
background-color: #666;
|
|
84
|
-
left: -3px;
|
|
85
|
-
top: -4px;
|
|
86
|
-
transition: all .25s cubic-bezier(0, 0, .2, 1) 0s;
|
|
87
|
-
box-shadow:
|
|
88
|
-
2px 2px 8px rgba(255, 255, 255, .3) inset,
|
|
89
|
-
0 1px 5px rgba(0, 0, 0, 1);
|
|
90
|
-
}
|
|
91
|
-
input.Toggle:focus:after {
|
|
92
|
-
box-shadow:
|
|
93
|
-
2px 2px 8px rgba(255, 255, 255, .3) inset,
|
|
94
|
-
0 1px 5px rgba(0, 0, 0, 1),
|
|
95
|
-
0 0 0 12px rgb(255, 255, 255, .2);
|
|
96
|
-
}
|
|
97
|
-
input.Toggle:checked:after {
|
|
98
|
-
background-color: #00a651;
|
|
99
|
-
left: 17px;
|
|
100
|
-
}
|
|
101
|
-
input.Toggle:active:after {
|
|
102
|
-
width: 30px;
|
|
103
|
-
}
|
|
104
|
-
input.Toggle:checked:active:after {
|
|
105
|
-
left: 7px;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
.group {
|
|
111
|
-
overflow: auto;
|
|
112
|
-
}
|
|
113
|
-
.group > .btn {
|
|
114
|
-
border-radius: 0;
|
|
115
|
-
float: left;
|
|
116
|
-
}
|
|
117
|
-
.group > .btn:first-child {
|
|
118
|
-
border-top-left-radius: 4px;
|
|
119
|
-
border-bottom-left-radius: 4px;
|
|
120
|
-
}
|
|
121
|
-
.group > .btn:last-child {
|
|
122
|
-
border-top-right-radius: 4px;
|
|
123
|
-
border-bottom-right-radius: 4px;
|
|
124
|
-
}
|
|
125
|
-
/* THEME */
|
|
126
|
-
|
|
127
|
-
input.Toggle:after {
|
|
128
|
-
background-color: #666;
|
|
129
|
-
box-shadow:
|
|
130
|
-
2px 2px 8px rgba(255, 255, 255, .3) inset,
|
|
131
|
-
0 1px 5px rgba(0, 0, 0, 1);
|
|
132
|
-
}
|
|
133
|
-
input.Toggle:focus:after {
|
|
134
|
-
box-shadow:
|
|
135
|
-
2px 2px 8px rgba(255, 255, 255, .3) inset,
|
|
136
|
-
0 1px 5px rgba(0, 0, 0, 1),
|
|
137
|
-
0 0 0 12px rgb(0, 0, 0, .2);
|
|
138
|
-
}
|
|
139
|
-
input.Toggle:checked:after {
|
|
140
|
-
background-color: #00a651;
|
|
141
|
-
}
|
|
142
|
-
|
package/polyfill/base64.js
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
/* litejs.com/MIT-LICENSE.txt */
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
!function(exports) {
|
|
7
|
-
// base64url in RFC 4648 replaces '+' and '/' with '-' and '_',
|
|
8
|
-
// so that using URL encoders/decoders is no longer needed
|
|
9
|
-
|
|
10
|
-
if (!exports.atob) {
|
|
11
|
-
// abcdefghijklmnopqrstuvwxyz234567
|
|
12
|
-
// ybndrfg8ejkmcpqxot1uwisza345h769
|
|
13
|
-
|
|
14
|
-
for (
|
|
15
|
-
var i = 64,
|
|
16
|
-
ba = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),
|
|
17
|
-
bm = {"=":0};
|
|
18
|
-
(bm[ba[--i]] = i);
|
|
19
|
-
);
|
|
20
|
-
|
|
21
|
-
// base64_encode
|
|
22
|
-
exports.btoa = function(s) {
|
|
23
|
-
for (var b, out=[], i=0, len=s.length; i < len; ) {
|
|
24
|
-
b = s.charCodeAt(i++)<<16 | s.charCodeAt(i++)<<8 | s.charCodeAt(i++)
|
|
25
|
-
out.push(ba[b>>18&0x3f], ba[b>>12&0x3f], ba[b>>6&0x3f], ba[b&0x3f])
|
|
26
|
-
}
|
|
27
|
-
if ((len %= 3)) out.splice((len - 3), 2, len == 1 ? "==" : "=")
|
|
28
|
-
return out.join("")
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
// base64_decode
|
|
32
|
-
exports.atob = function(s) {
|
|
33
|
-
s = s.split("")
|
|
34
|
-
for (var b, out=[], i=0, len=s.length; i < len; ) {
|
|
35
|
-
b = bm[s[i++]]<<18 | bm[s[i++]]<<12 | bm[s[i++]]<<6 | bm[s[i++]]
|
|
36
|
-
out.push(b>>16 & 0xff, b>>8 & 0xff, b & 0xff)
|
|
37
|
-
}
|
|
38
|
-
if (s[len-1] == "=") out.length -= s[len-2] == "=" ? 2 : 1
|
|
39
|
-
return String.fromCharCode.apply(null, out)
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}(this) /* jshint -W030 */
|
|
43
|
-
|