jaxs 0.4.4 → 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/jaxs.d.ts +50 -16
- package/dist/jaxs.js +210 -172
- package/dist/jaxs.umd.cjs +222 -191
- package/package.json +1 -1
package/dist/jaxs.umd.cjs
CHANGED
|
@@ -1,21 +1,24 @@
|
|
|
1
|
-
;(function (
|
|
1
|
+
;(function (p, f) {
|
|
2
2
|
typeof exports == 'object' && typeof module < 'u'
|
|
3
3
|
? f(exports)
|
|
4
4
|
: typeof define == 'function' && define.amd
|
|
5
5
|
? define(['exports'], f)
|
|
6
|
-
: ((
|
|
7
|
-
f((
|
|
8
|
-
})(this, function (
|
|
6
|
+
: ((p = typeof globalThis < 'u' ? globalThis : p || self),
|
|
7
|
+
f((p.jaxs = {})))
|
|
8
|
+
})(this, function (p) {
|
|
9
9
|
'use strict'
|
|
10
10
|
const f = (e, t) => t.createElement(e),
|
|
11
|
-
|
|
11
|
+
ot = (e, t) => {
|
|
12
12
|
for (const s in t) {
|
|
13
13
|
if (s === '__self') continue
|
|
14
14
|
const n = t[s].toString()
|
|
15
|
-
s === 'value'
|
|
15
|
+
if (s === 'value') {
|
|
16
|
+
const r = e
|
|
17
|
+
r.value !== n && (r.value = n)
|
|
18
|
+
} else e.setAttribute(s, n)
|
|
16
19
|
}
|
|
17
20
|
},
|
|
18
|
-
|
|
21
|
+
it = (e, t, s) => {
|
|
19
22
|
const n = {}
|
|
20
23
|
for (const r in t) {
|
|
21
24
|
const o = t[r],
|
|
@@ -25,12 +28,12 @@
|
|
|
25
28
|
}
|
|
26
29
|
e.eventMaps = n
|
|
27
30
|
},
|
|
28
|
-
|
|
31
|
+
ut = (e, t, s, n) => {
|
|
29
32
|
const r = f(e, n.document)
|
|
30
|
-
return
|
|
33
|
+
return ot(r, t), it(r, s, n.publish), r
|
|
31
34
|
},
|
|
32
35
|
y = 'http://www.w3.org/2000/svg',
|
|
33
|
-
|
|
36
|
+
at = {
|
|
34
37
|
animate: !0,
|
|
35
38
|
animateMotion: !0,
|
|
36
39
|
animateTransform: !0,
|
|
@@ -94,8 +97,8 @@
|
|
|
94
97
|
use: !0,
|
|
95
98
|
view: !0,
|
|
96
99
|
},
|
|
97
|
-
|
|
98
|
-
|
|
100
|
+
ct = (e, t) => !!(at[e] || (e === 'a' && t === y)),
|
|
101
|
+
ht = (e, t, s) => {
|
|
99
102
|
const n = s.createElementNS(y, e)
|
|
100
103
|
for (const r in t)
|
|
101
104
|
r === '__self' ||
|
|
@@ -103,24 +106,24 @@
|
|
|
103
106
|
n.setAttributeNS(null, r, t[r].toString())
|
|
104
107
|
return n
|
|
105
108
|
},
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
class
|
|
109
|
+
lt = (e) => e.namespaceURI === y,
|
|
110
|
+
dt = (e, t) => t.createTextNode(e)
|
|
111
|
+
class pt {
|
|
109
112
|
constructor(t) {
|
|
110
113
|
this.value = t.toString()
|
|
111
114
|
}
|
|
112
115
|
render(t) {
|
|
113
|
-
const s =
|
|
116
|
+
const s = dt(this.value, t.document)
|
|
114
117
|
return (s.__jsx = 'TextNode'), [s]
|
|
115
118
|
}
|
|
116
119
|
}
|
|
117
|
-
const
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
120
|
+
const mt = (e) => typeof e == 'string' || typeof e == 'number',
|
|
121
|
+
ft = (e) => new pt(e),
|
|
122
|
+
bt = (e) => (mt(e) ? ft(e) : e),
|
|
123
|
+
vt = (e) => gt(e).map(bt).flat(),
|
|
124
|
+
gt = (e) => (Array.isArray(e) ? e.flat() : e ? [e] : []),
|
|
122
125
|
N = (e, t = {}) => e || t.children || [],
|
|
123
|
-
|
|
126
|
+
yt = (e, t = '') => {
|
|
124
127
|
const s = {},
|
|
125
128
|
n = {}
|
|
126
129
|
for (const r in e) {
|
|
@@ -130,19 +133,19 @@
|
|
|
130
133
|
n[a] = o ? o.toString() : ''
|
|
131
134
|
} else {
|
|
132
135
|
if (o === !1) continue
|
|
133
|
-
r === '__source' ? (s.__source = e.__source) : (s[r] =
|
|
136
|
+
r === '__source' ? (s.__source = e.__source) : (s[r] = Et(r, o, t))
|
|
134
137
|
}
|
|
135
138
|
}
|
|
136
139
|
return { attributes: s, events: n }
|
|
137
140
|
},
|
|
138
|
-
|
|
139
|
-
|
|
141
|
+
Et = (e, t, s = '') => (t == null ? s : t.toString()),
|
|
142
|
+
xt = (e, t) => {
|
|
140
143
|
const s = e || {},
|
|
141
144
|
n = N(t, s)
|
|
142
145
|
return (s.children = s.children || n), s
|
|
143
146
|
},
|
|
144
|
-
j = (e, t, s, n = []) => e.reduce(
|
|
145
|
-
|
|
147
|
+
j = (e, t, s, n = []) => e.reduce(wt(t, s), n).flat(),
|
|
148
|
+
wt = (e, t) => (s, n) =>
|
|
146
149
|
n
|
|
147
150
|
? Array.isArray(n)
|
|
148
151
|
? j(n, e, t, s)
|
|
@@ -150,7 +153,7 @@
|
|
|
150
153
|
: s
|
|
151
154
|
class O {
|
|
152
155
|
constructor(t) {
|
|
153
|
-
this.collection =
|
|
156
|
+
this.collection = vt(t)
|
|
154
157
|
}
|
|
155
158
|
render(t, s) {
|
|
156
159
|
this.parentElement = s
|
|
@@ -166,7 +169,7 @@
|
|
|
166
169
|
t.forEach((n) => s.appendChild(n))
|
|
167
170
|
}
|
|
168
171
|
}
|
|
169
|
-
class
|
|
172
|
+
class At {
|
|
170
173
|
constructor(t, s) {
|
|
171
174
|
;(this.type = t), (this.attributes = s)
|
|
172
175
|
}
|
|
@@ -194,13 +197,13 @@
|
|
|
194
197
|
return `${this.type}${t}${s}${n}`
|
|
195
198
|
}
|
|
196
199
|
}
|
|
197
|
-
class
|
|
200
|
+
class St {
|
|
198
201
|
constructor(t, s, n = []) {
|
|
199
202
|
this.type = t
|
|
200
|
-
const { events: r, attributes: o } =
|
|
203
|
+
const { events: r, attributes: o } = yt(s)
|
|
201
204
|
;(this.events = r),
|
|
202
205
|
(this.attributes = o),
|
|
203
|
-
(this.isSvg =
|
|
206
|
+
(this.isSvg = ct(this.type, this.attributes.xmlns)),
|
|
204
207
|
(this.children = new O(n))
|
|
205
208
|
}
|
|
206
209
|
render(t) {
|
|
@@ -211,24 +214,24 @@
|
|
|
211
214
|
return this.isSvg ? this.generateSvgDom(t) : this.generateHtmlDom(t)
|
|
212
215
|
}
|
|
213
216
|
generateHtmlDom(t) {
|
|
214
|
-
const s =
|
|
217
|
+
const s = ut(this.type, this.attributes, this.events, t)
|
|
215
218
|
return (s.__jsx = this.jsxKey()), s
|
|
216
219
|
}
|
|
217
220
|
generateSvgDom(t) {
|
|
218
|
-
const s =
|
|
221
|
+
const s = ht(this.type, this.attributes, t.document)
|
|
219
222
|
return (s.__jsx = this.jsxKey()), s
|
|
220
223
|
}
|
|
221
224
|
jsxKey() {
|
|
222
|
-
return new
|
|
225
|
+
return new At(this.type, this.attributes).generate()
|
|
223
226
|
}
|
|
224
227
|
}
|
|
225
|
-
const
|
|
226
|
-
typeof e == 'string' ? new
|
|
227
|
-
|
|
228
|
+
const M = (e, t, ...s) =>
|
|
229
|
+
typeof e == 'string' ? new St(e, t, s) : e(xt(t, s))
|
|
230
|
+
M.fragment = (e, t) => {
|
|
228
231
|
const s = N(t, e)
|
|
229
232
|
return new O(s)
|
|
230
233
|
}
|
|
231
|
-
class
|
|
234
|
+
class _t {
|
|
232
235
|
constructor(t, s, n) {
|
|
233
236
|
;(this.template = t),
|
|
234
237
|
(this.selector = s),
|
|
@@ -253,42 +256,42 @@
|
|
|
253
256
|
return this.renderKit.document.querySelector(this.selector)
|
|
254
257
|
}
|
|
255
258
|
}
|
|
256
|
-
const
|
|
257
|
-
const n = new
|
|
259
|
+
const Nt = (e, t, s) => {
|
|
260
|
+
const n = new _t(e, t, s)
|
|
258
261
|
return n.renderAndAttach(s), n
|
|
259
262
|
},
|
|
260
|
-
|
|
263
|
+
T = 'go-to-href',
|
|
261
264
|
b = 'navigation:location-change',
|
|
262
|
-
|
|
263
|
-
|
|
265
|
+
k = 'navigation:route-change',
|
|
266
|
+
jt = Object.freeze(
|
|
264
267
|
Object.defineProperty(
|
|
265
268
|
{
|
|
266
269
|
__proto__: null,
|
|
267
|
-
linkNavigationEvent:
|
|
270
|
+
linkNavigationEvent: T,
|
|
268
271
|
locationChangeEvent: b,
|
|
269
|
-
routeChangeEvent:
|
|
272
|
+
routeChangeEvent: k,
|
|
270
273
|
},
|
|
271
274
|
Symbol.toStringTag,
|
|
272
275
|
{ value: 'Module' },
|
|
273
276
|
),
|
|
274
277
|
),
|
|
275
|
-
|
|
278
|
+
$ = (e) => {
|
|
276
279
|
e.createRecord('route', { host: '', path: '', query: {} })
|
|
277
280
|
},
|
|
278
281
|
F = (e) => {
|
|
279
282
|
const t = e.closest('[href]')
|
|
280
283
|
return (t && t.getAttribute('href')) || ''
|
|
281
284
|
},
|
|
282
|
-
|
|
285
|
+
P = (e, { publish: t, window: s }) => {
|
|
283
286
|
s.history.pushState(null, '', e), t(b, null)
|
|
284
287
|
},
|
|
285
|
-
|
|
288
|
+
D = (e, t) => {
|
|
286
289
|
if (!e || !e.target) return
|
|
287
290
|
e.preventDefault()
|
|
288
291
|
const s = F(e.target)
|
|
289
|
-
|
|
292
|
+
P(s, t)
|
|
290
293
|
},
|
|
291
|
-
|
|
294
|
+
L = (e) =>
|
|
292
295
|
e
|
|
293
296
|
.replace(/^\?/, '')
|
|
294
297
|
.split('&')
|
|
@@ -297,36 +300,36 @@
|
|
|
297
300
|
const n = s.split('=')
|
|
298
301
|
return (t[n[0]] = n[1]), t
|
|
299
302
|
}, {}),
|
|
300
|
-
|
|
303
|
+
z = (e, t) => {
|
|
301
304
|
const { state: s, publish: n, window: r } = t,
|
|
302
305
|
{ host: o, pathname: a, search: h } = r.location,
|
|
303
306
|
u = a,
|
|
304
|
-
d =
|
|
307
|
+
d = L(h),
|
|
305
308
|
c = { host: o, path: u, query: d }
|
|
306
|
-
s.store('route').update(c), n(
|
|
309
|
+
s.store('route').update(c), n(k, c)
|
|
307
310
|
},
|
|
308
|
-
|
|
311
|
+
B = (e) => {
|
|
309
312
|
const { subscribe: t } = e
|
|
310
|
-
t(
|
|
313
|
+
t(T, D)
|
|
311
314
|
},
|
|
312
|
-
|
|
315
|
+
U = (e) => {
|
|
313
316
|
const { publish: t, subscribe: s, state: n, window: r } = e
|
|
314
|
-
|
|
317
|
+
$(n), r.addEventListener('popstate', () => t(b, null)), s(b, z)
|
|
315
318
|
},
|
|
316
319
|
V = (e) => {
|
|
317
320
|
setTimeout(() => e.publish(b, null), 0)
|
|
318
321
|
},
|
|
319
322
|
K = (e) => {
|
|
320
|
-
|
|
323
|
+
U(e), B(e), V(e)
|
|
321
324
|
},
|
|
322
|
-
|
|
325
|
+
Ot = Object.freeze(
|
|
323
326
|
Object.defineProperty(
|
|
324
327
|
{
|
|
325
328
|
__proto__: null,
|
|
326
329
|
publishLocation: V,
|
|
327
330
|
startNavigation: K,
|
|
328
|
-
subscribeToHistoryChange:
|
|
329
|
-
subscribeToNavigation:
|
|
331
|
+
subscribeToHistoryChange: U,
|
|
332
|
+
subscribeToNavigation: B,
|
|
330
333
|
},
|
|
331
334
|
Symbol.toStringTag,
|
|
332
335
|
{ value: 'Module' },
|
|
@@ -352,14 +355,14 @@
|
|
|
352
355
|
(this.roots = [])
|
|
353
356
|
}
|
|
354
357
|
render(t, s) {
|
|
355
|
-
const n =
|
|
358
|
+
const n = Nt(t, s, this.renderKit)
|
|
356
359
|
return this.roots.push(n), n
|
|
357
360
|
}
|
|
358
361
|
startNavigation() {
|
|
359
362
|
K(this)
|
|
360
363
|
}
|
|
361
364
|
}
|
|
362
|
-
const
|
|
365
|
+
const Mt = Object.freeze(
|
|
363
366
|
Object.defineProperty({ __proto__: null, App: R }, Symbol.toStringTag, {
|
|
364
367
|
value: 'Module',
|
|
365
368
|
}),
|
|
@@ -443,7 +446,7 @@
|
|
|
443
446
|
subscribe: (n, r) => e.subscribe(n, r),
|
|
444
447
|
}
|
|
445
448
|
},
|
|
446
|
-
|
|
449
|
+
Tt = Object.freeze(
|
|
447
450
|
Object.defineProperty(
|
|
448
451
|
{
|
|
449
452
|
__proto__: null,
|
|
@@ -459,23 +462,23 @@
|
|
|
459
462
|
v = (e) => Array.isArray(e),
|
|
460
463
|
E = (e) => e !== null && !v(e) && typeof e == 'object',
|
|
461
464
|
kt = (e, t) => e === t,
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
!(E(e) && E(t)) ||
|
|
465
|
+
$t = (e, t) => Object.keys(e).length === Object.keys(t).length,
|
|
466
|
+
Ft = (e, t) =>
|
|
467
|
+
!(E(e) && E(t)) || !$t(e, t)
|
|
465
468
|
? !1
|
|
466
469
|
: Object.keys(e).every((s) => {
|
|
467
470
|
const n = e[s],
|
|
468
471
|
r = t[s]
|
|
469
472
|
return x(n, r)
|
|
470
473
|
}),
|
|
471
|
-
|
|
474
|
+
Pt = (e, t) =>
|
|
472
475
|
!(v(e) && v(t)) || e.length !== t.length
|
|
473
476
|
? !1
|
|
474
477
|
: e.every((s, n) => {
|
|
475
478
|
const r = t[n]
|
|
476
479
|
return x(s, r)
|
|
477
480
|
}),
|
|
478
|
-
x = (e, t) => (E(e) ?
|
|
481
|
+
x = (e, t) => (E(e) ? Ft(e, t) : v(e) ? Pt(e, t) : kt(e, t))
|
|
479
482
|
class g {
|
|
480
483
|
constructor(t) {
|
|
481
484
|
this.store = t
|
|
@@ -499,7 +502,7 @@
|
|
|
499
502
|
for (const s in t) this.addUpdaterFunction(s, t[s])
|
|
500
503
|
}
|
|
501
504
|
}
|
|
502
|
-
class
|
|
505
|
+
class w extends g {
|
|
503
506
|
addUpdaterFunction(t, s) {
|
|
504
507
|
this.constructor.prototype[t] = (...n) => {
|
|
505
508
|
const r = s(this.value, ...n)
|
|
@@ -538,7 +541,7 @@
|
|
|
538
541
|
n.splice(t, 0, s), this.update(n)
|
|
539
542
|
}
|
|
540
543
|
}
|
|
541
|
-
class
|
|
544
|
+
class A {
|
|
542
545
|
constructor(t) {
|
|
543
546
|
;(this.name = t.name),
|
|
544
547
|
(this.parent = t.parent),
|
|
@@ -571,7 +574,7 @@
|
|
|
571
574
|
this.updater.addUpdaterFunction(t, s)
|
|
572
575
|
}
|
|
573
576
|
addSorter(t, s) {
|
|
574
|
-
this.updater instanceof
|
|
577
|
+
this.updater instanceof w && this.updater.addSorter(t, s)
|
|
575
578
|
}
|
|
576
579
|
}
|
|
577
580
|
class G extends g {
|
|
@@ -614,7 +617,7 @@
|
|
|
614
617
|
(this.inTransaction = !1)
|
|
615
618
|
}
|
|
616
619
|
create(t, s) {
|
|
617
|
-
const n = new
|
|
620
|
+
const n = new A({ name: t, parent: this, value: s })
|
|
618
621
|
return (this.stores[t] = n), n
|
|
619
622
|
}
|
|
620
623
|
createBoolean(t, s) {
|
|
@@ -627,10 +630,10 @@
|
|
|
627
630
|
}
|
|
628
631
|
createList(t, s) {
|
|
629
632
|
const n = this.create(t, s)
|
|
630
|
-
return (n.updater = new
|
|
633
|
+
return (n.updater = new w(n)), n
|
|
631
634
|
}
|
|
632
635
|
store(t) {
|
|
633
|
-
return this.stores[t] || new
|
|
636
|
+
return this.stores[t] || new A({ name: t, parent: this, value: void 0 })
|
|
634
637
|
}
|
|
635
638
|
get(t) {
|
|
636
639
|
return this.store(t).value
|
|
@@ -664,14 +667,14 @@
|
|
|
664
667
|
}
|
|
665
668
|
}
|
|
666
669
|
const W = (e) => new Q(e),
|
|
667
|
-
|
|
670
|
+
Dt = Object.freeze(
|
|
668
671
|
Object.defineProperty(
|
|
669
672
|
{
|
|
670
673
|
__proto__: null,
|
|
671
674
|
State: Q,
|
|
672
|
-
Store:
|
|
675
|
+
Store: A,
|
|
673
676
|
StoreUpdaterBoolean: G,
|
|
674
|
-
StoreUpdaterList:
|
|
677
|
+
StoreUpdaterList: w,
|
|
675
678
|
StoreUpdaterObject: C,
|
|
676
679
|
createState: W,
|
|
677
680
|
eventName: S,
|
|
@@ -680,7 +683,7 @@
|
|
|
680
683
|
{ value: 'Module' },
|
|
681
684
|
),
|
|
682
685
|
)
|
|
683
|
-
class
|
|
686
|
+
class Lt {
|
|
684
687
|
constructor(t) {
|
|
685
688
|
this.setupDomEnvironment(t)
|
|
686
689
|
}
|
|
@@ -733,8 +736,8 @@
|
|
|
733
736
|
}
|
|
734
737
|
}
|
|
735
738
|
}
|
|
736
|
-
const
|
|
737
|
-
const s = new
|
|
739
|
+
const zt = (e = {}) => {
|
|
740
|
+
const s = new Lt(e).setup()
|
|
738
741
|
return s.startNavigation(), s
|
|
739
742
|
}
|
|
740
743
|
var i = ((e) => (
|
|
@@ -751,37 +754,37 @@
|
|
|
751
754
|
(e[(e.changeText = 10)] = 'changeText'),
|
|
752
755
|
e
|
|
753
756
|
))(i || {})
|
|
754
|
-
const
|
|
757
|
+
const Bt = Object.freeze(
|
|
755
758
|
Object.defineProperty(
|
|
756
759
|
{ __proto__: null, ChangeInstructionTypes: i },
|
|
757
760
|
Symbol.toStringTag,
|
|
758
761
|
{ value: 'Module' },
|
|
759
762
|
),
|
|
760
763
|
),
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
+
Ut = (e, t) => ({ source: e, target: t, type: i.changeText, data: {} }),
|
|
765
|
+
Vt = (e, t) => ({ source: e, target: t, type: i.replaceNode, data: {} }),
|
|
766
|
+
Kt = (e, t, s) => ({
|
|
764
767
|
source: e,
|
|
765
768
|
target: t,
|
|
766
769
|
data: s,
|
|
767
770
|
type: i.removeAttribute,
|
|
768
771
|
}),
|
|
769
|
-
|
|
770
|
-
|
|
772
|
+
Rt = (e, t, s) => ({ source: e, target: t, data: s, type: i.addAttribute }),
|
|
773
|
+
qt = (e, t, s) => ({
|
|
771
774
|
source: e,
|
|
772
775
|
target: t,
|
|
773
776
|
data: s,
|
|
774
777
|
type: i.updateAttribute,
|
|
775
778
|
}),
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
+
It = (e, t, s) => ({ source: e, target: t, data: s, type: i.removeEvent }),
|
|
780
|
+
Jt = (e, t, s) => ({ source: e, target: t, data: s, type: i.addEvent }),
|
|
781
|
+
Ht = (e, t, s) => ({ source: e, target: t, data: s, type: i.updateEvent }),
|
|
779
782
|
X = (e) => ({ source: e, target: e, type: i.removeNode, data: {} }),
|
|
780
783
|
_ = (e, t) => ({ target: e, source: e, type: i.insertNode, data: t }),
|
|
781
|
-
|
|
782
|
-
|
|
784
|
+
Gt = (e, t, s) => ({ source: e, target: t, type: i.changeValue, data: s }),
|
|
785
|
+
Ct = (e, t) => (e.type > t.type ? 1 : e.type < t.type ? -1 : 0),
|
|
783
786
|
Y = { index: -1 }
|
|
784
|
-
class
|
|
787
|
+
class Qt {
|
|
785
788
|
constructor() {
|
|
786
789
|
this.map = {}
|
|
787
790
|
}
|
|
@@ -814,7 +817,7 @@
|
|
|
814
817
|
}
|
|
815
818
|
}
|
|
816
819
|
const Z = (e) => {
|
|
817
|
-
const t = new
|
|
820
|
+
const t = new Qt()
|
|
818
821
|
return t.populate(e), t
|
|
819
822
|
},
|
|
820
823
|
tt = (e, t, s = !1) => {
|
|
@@ -829,16 +832,16 @@
|
|
|
829
832
|
const l = r.item(u)
|
|
830
833
|
if (l) {
|
|
831
834
|
for (d = 0; d < h; d++) {
|
|
832
|
-
const
|
|
833
|
-
if (
|
|
834
|
-
c =
|
|
835
|
+
const m = a.item(d)
|
|
836
|
+
if (m && l.name == m.name) {
|
|
837
|
+
c = m
|
|
835
838
|
break
|
|
836
839
|
}
|
|
837
840
|
}
|
|
838
841
|
c
|
|
839
842
|
? l.value !== c.value &&
|
|
840
|
-
n.push(
|
|
841
|
-
: n.push(
|
|
843
|
+
n.push(qt(e, t, { name: l.name, value: c.value, isSvg: s }))
|
|
844
|
+
: n.push(Kt(e, t, { name: l.name, isSvg: s }))
|
|
842
845
|
}
|
|
843
846
|
}
|
|
844
847
|
for (u = 0; u < h; u++) {
|
|
@@ -846,18 +849,18 @@
|
|
|
846
849
|
const l = a.item(u)
|
|
847
850
|
if (l) {
|
|
848
851
|
for (d = 0; d < o; d++) {
|
|
849
|
-
const
|
|
850
|
-
if (
|
|
851
|
-
c =
|
|
852
|
+
const m = r.item(d)
|
|
853
|
+
if (m && m.name == l.name) {
|
|
854
|
+
c = m
|
|
852
855
|
break
|
|
853
856
|
}
|
|
854
857
|
}
|
|
855
|
-
c || n.push(
|
|
858
|
+
c || n.push(Rt(e, t, { name: l.name, value: l.value, isSvg: s }))
|
|
856
859
|
}
|
|
857
860
|
}
|
|
858
861
|
return n
|
|
859
862
|
},
|
|
860
|
-
|
|
863
|
+
Wt = (e, t) => {
|
|
861
864
|
const s = [],
|
|
862
865
|
n = e.eventMaps,
|
|
863
866
|
r = t.eventMaps,
|
|
@@ -870,58 +873,58 @@
|
|
|
870
873
|
d
|
|
871
874
|
? d.busEvent !== u.busEvent &&
|
|
872
875
|
s.push(
|
|
873
|
-
|
|
876
|
+
Ht(e, t, {
|
|
874
877
|
name: h,
|
|
875
878
|
targetValue: d.listener,
|
|
876
879
|
sourceValue: u.listener,
|
|
877
880
|
}),
|
|
878
881
|
)
|
|
879
|
-
: s.push(
|
|
882
|
+
: s.push(It(e, t, { name: u.domEvent, value: u.listener }))
|
|
880
883
|
}),
|
|
881
884
|
a.forEach((h) => {
|
|
882
885
|
const u = n[h],
|
|
883
886
|
d = r[h]
|
|
884
|
-
u || s.push(
|
|
887
|
+
u || s.push(Jt(e, t, { name: d.domEvent, value: d.listener }))
|
|
885
888
|
}),
|
|
886
889
|
s
|
|
887
890
|
)
|
|
888
891
|
},
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
if (
|
|
892
|
+
Xt = (e) => e.tagName !== 'INPUT',
|
|
893
|
+
Yt = (e, t) => e.value === t.value,
|
|
894
|
+
Zt = (e, t) => {
|
|
895
|
+
if (Xt(e) || Yt(e, t)) return []
|
|
893
896
|
const s = e,
|
|
894
897
|
n = t
|
|
895
|
-
return [
|
|
898
|
+
return [Gt(s, n, { name: 'value', value: n.value })]
|
|
896
899
|
},
|
|
897
|
-
|
|
900
|
+
te = (e, t) => {
|
|
898
901
|
const s = tt(e, t),
|
|
899
|
-
n =
|
|
900
|
-
r =
|
|
902
|
+
n = Wt(e, t),
|
|
903
|
+
r = Zt(e, t)
|
|
901
904
|
return s.concat(n).concat(r)
|
|
902
905
|
},
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
+
ee = (e, t) => tt(e, t, !0),
|
|
907
|
+
se = (e, t) => (e.textContent !== t.textContent ? [Ut(e, t)] : []),
|
|
908
|
+
ne = (e, t, s) => {
|
|
906
909
|
let n = []
|
|
907
|
-
if (e.nodeType === 1 &&
|
|
910
|
+
if (e.nodeType === 1 && lt(e)) {
|
|
908
911
|
const r = e,
|
|
909
912
|
o = t,
|
|
910
|
-
a =
|
|
913
|
+
a = ee(r, o),
|
|
911
914
|
h = s(r.childNodes, o.childNodes, r)
|
|
912
915
|
n = a.concat(h)
|
|
913
916
|
} else if (e.nodeType === 1) {
|
|
914
917
|
const r = e,
|
|
915
918
|
o = t,
|
|
916
|
-
a =
|
|
919
|
+
a = te(r, o),
|
|
917
920
|
h = s(r.childNodes, o.childNodes, r)
|
|
918
921
|
n = a.concat(h)
|
|
919
|
-
} else e.nodeType === 3 && (n =
|
|
922
|
+
} else e.nodeType === 3 && (n = se(e, t))
|
|
920
923
|
return n
|
|
921
924
|
},
|
|
922
925
|
et = (e, t, s) => {
|
|
923
926
|
const n = [],
|
|
924
|
-
r =
|
|
927
|
+
r = re(e, t),
|
|
925
928
|
o = Z(e),
|
|
926
929
|
a = Z(t),
|
|
927
930
|
h = []
|
|
@@ -930,15 +933,15 @@
|
|
|
930
933
|
const c = e[u],
|
|
931
934
|
l = t[u]
|
|
932
935
|
if (l && a.check(l)) {
|
|
933
|
-
const
|
|
936
|
+
const m = o.pullMatch(l)
|
|
934
937
|
a.clear(l),
|
|
935
|
-
|
|
936
|
-
? (
|
|
937
|
-
h.push({ source:
|
|
938
|
+
m.element
|
|
939
|
+
? (m.index !== u && n.push(_(m.element, { parent: s, index: u })),
|
|
940
|
+
h.push({ source: m.element, target: l }))
|
|
938
941
|
: c
|
|
939
942
|
? a.check(c)
|
|
940
943
|
? n.push(_(l, { parent: s, index: u }))
|
|
941
|
-
: (o.clear(c), n.push(
|
|
944
|
+
: (o.clear(c), n.push(Vt(c, l)))
|
|
942
945
|
: n.push(_(l, { parent: s, index: u }))
|
|
943
946
|
} else c && o.pullMatch(c).element && n.push(X(c))
|
|
944
947
|
}
|
|
@@ -946,48 +949,48 @@
|
|
|
946
949
|
n.push(X(c))
|
|
947
950
|
})
|
|
948
951
|
const d = h.reduce(
|
|
949
|
-
(c, { source: l, target:
|
|
952
|
+
(c, { source: l, target: m }) => c.concat(ne(l, m, et)),
|
|
950
953
|
[],
|
|
951
954
|
)
|
|
952
|
-
return n.concat(d).sort(
|
|
955
|
+
return n.concat(d).sort(Ct)
|
|
953
956
|
},
|
|
954
|
-
|
|
957
|
+
re = (e, t) => {
|
|
955
958
|
const s = e.length,
|
|
956
959
|
n = t.length
|
|
957
960
|
return s > n ? s : n
|
|
958
961
|
},
|
|
959
|
-
|
|
962
|
+
oe = (e, t, s) => {
|
|
960
963
|
const n = et(e, t, s)
|
|
961
964
|
return (
|
|
962
965
|
n.forEach((r) => {
|
|
963
|
-
|
|
966
|
+
ie(r)
|
|
964
967
|
}),
|
|
965
968
|
n
|
|
966
969
|
)
|
|
967
970
|
},
|
|
968
|
-
re = (e) => {
|
|
969
|
-
;(be[e.type] || oe)(e)
|
|
970
|
-
},
|
|
971
|
-
oe = (e) => {},
|
|
972
971
|
ie = (e) => {
|
|
972
|
+
;(ge[e.type] || ue)(e)
|
|
973
|
+
},
|
|
974
|
+
ue = (e) => {},
|
|
975
|
+
ae = (e) => {
|
|
973
976
|
const { source: t, target: s } = e
|
|
974
977
|
t.nodeValue = s.textContent
|
|
975
978
|
},
|
|
976
|
-
|
|
979
|
+
ce = (e) => {
|
|
977
980
|
const { source: t } = e
|
|
978
981
|
t.remove()
|
|
979
982
|
},
|
|
980
|
-
|
|
983
|
+
he = (e) => {
|
|
981
984
|
const { target: t, data: s } = e,
|
|
982
985
|
{ parent: n, index: r } = s,
|
|
983
986
|
o = n.childNodes[r]
|
|
984
987
|
o ? o && o !== t && n.insertBefore(t, o) : n.appendChild(t)
|
|
985
988
|
},
|
|
986
|
-
|
|
989
|
+
le = (e) => {
|
|
987
990
|
const { source: t, target: s } = e
|
|
988
991
|
t.replaceWith(s)
|
|
989
992
|
},
|
|
990
|
-
|
|
993
|
+
de = (e) => {
|
|
991
994
|
const { source: t, data: s } = e,
|
|
992
995
|
{ name: n, isSvg: r } = s
|
|
993
996
|
r ? t.removeAttributeNS(null, n) : t.removeAttribute(n)
|
|
@@ -997,77 +1000,77 @@
|
|
|
997
1000
|
{ name: n, value: r, isSvg: o } = s
|
|
998
1001
|
o ? t.setAttributeNS(null, n, r) : t.setAttribute(n, r)
|
|
999
1002
|
},
|
|
1000
|
-
|
|
1003
|
+
pe = (e) => {
|
|
1001
1004
|
st(e)
|
|
1002
1005
|
},
|
|
1003
|
-
|
|
1006
|
+
me = (e) => {
|
|
1004
1007
|
const t = e.data,
|
|
1005
1008
|
s = e.source,
|
|
1006
1009
|
{ name: n, value: r } = t
|
|
1007
1010
|
s.removeEventListener(n, r)
|
|
1008
1011
|
},
|
|
1009
|
-
|
|
1012
|
+
fe = (e) => {
|
|
1010
1013
|
const t = e.data,
|
|
1011
1014
|
s = e.source,
|
|
1012
1015
|
{ name: n, value: r } = t
|
|
1013
1016
|
s.addEventListener(n, r)
|
|
1014
1017
|
},
|
|
1015
|
-
|
|
1018
|
+
be = (e) => {
|
|
1016
1019
|
const t = e.data,
|
|
1017
1020
|
s = e.source,
|
|
1018
1021
|
{ name: n, sourceValue: r, targetValue: o } = t
|
|
1019
1022
|
s.removeEventListener(n, r), s.addEventListener(n, o)
|
|
1020
1023
|
},
|
|
1021
|
-
|
|
1024
|
+
ve = (e) => {
|
|
1022
1025
|
const t = e.data,
|
|
1023
1026
|
s = e.source,
|
|
1024
1027
|
{ value: n } = t
|
|
1025
1028
|
s.value = n
|
|
1026
1029
|
},
|
|
1027
|
-
|
|
1028
|
-
[i.changeText]:
|
|
1029
|
-
[i.removeNode]:
|
|
1030
|
-
[i.insertNode]:
|
|
1031
|
-
[i.replaceNode]:
|
|
1032
|
-
[i.removeAttribute]:
|
|
1030
|
+
ge = {
|
|
1031
|
+
[i.changeText]: ae,
|
|
1032
|
+
[i.removeNode]: ce,
|
|
1033
|
+
[i.insertNode]: he,
|
|
1034
|
+
[i.replaceNode]: le,
|
|
1035
|
+
[i.removeAttribute]: de,
|
|
1033
1036
|
[i.addAttribute]: st,
|
|
1034
|
-
[i.updateAttribute]:
|
|
1035
|
-
[i.removeEvent]:
|
|
1036
|
-
[i.addEvent]:
|
|
1037
|
-
[i.updateEvent]:
|
|
1038
|
-
[i.changeValue]:
|
|
1037
|
+
[i.updateAttribute]: pe,
|
|
1038
|
+
[i.removeEvent]: me,
|
|
1039
|
+
[i.addEvent]: fe,
|
|
1040
|
+
[i.updateEvent]: be,
|
|
1041
|
+
[i.changeValue]: ve,
|
|
1039
1042
|
},
|
|
1040
|
-
|
|
1043
|
+
ye = (e, t, s) => {
|
|
1041
1044
|
const n = [...t]
|
|
1042
1045
|
return (
|
|
1043
1046
|
e.forEach((r) => {
|
|
1044
|
-
|
|
1047
|
+
Ee(r, n, s)
|
|
1045
1048
|
}),
|
|
1046
1049
|
n
|
|
1047
1050
|
)
|
|
1048
1051
|
},
|
|
1049
|
-
|
|
1050
|
-
const n =
|
|
1052
|
+
Ee = (e, t, s) => {
|
|
1053
|
+
const n = Se[e.type]
|
|
1051
1054
|
n && n(e, t, s)
|
|
1052
1055
|
},
|
|
1053
|
-
|
|
1056
|
+
xe = (e, t) => {
|
|
1054
1057
|
const { source: s } = e,
|
|
1055
1058
|
n = t.indexOf(s)
|
|
1056
1059
|
n >= 0 && t.splice(n, 1)
|
|
1057
1060
|
},
|
|
1058
|
-
|
|
1061
|
+
we = (e, t, s) => {
|
|
1059
1062
|
const { target: n } = e,
|
|
1060
1063
|
r = e.data,
|
|
1061
1064
|
{ index: o, parent: a } = r
|
|
1062
1065
|
s === a && t.splice(o, 0, n)
|
|
1063
1066
|
},
|
|
1064
|
-
|
|
1067
|
+
Ae = (e, t) => {
|
|
1065
1068
|
const { target: s, source: n } = e,
|
|
1066
1069
|
r = t.indexOf(n)
|
|
1067
1070
|
r >= 0 && (t[r] = s)
|
|
1068
1071
|
},
|
|
1069
|
-
|
|
1070
|
-
class
|
|
1072
|
+
Se = { [i.removeNode]: xe, [i.insertNode]: we, [i.replaceNode]: Ae }
|
|
1073
|
+
class _e {
|
|
1071
1074
|
constructor({
|
|
1072
1075
|
Template: t,
|
|
1073
1076
|
subscriptions: s,
|
|
@@ -1104,8 +1107,8 @@
|
|
|
1104
1107
|
this.parentElement = n
|
|
1105
1108
|
}
|
|
1106
1109
|
const t = this.generateDom(this.renderKit),
|
|
1107
|
-
s =
|
|
1108
|
-
this.dom =
|
|
1110
|
+
s = oe(this.dom, t, this.parentElement)
|
|
1111
|
+
this.dom = ye(s, this.dom, this.parentElement)
|
|
1109
1112
|
}
|
|
1110
1113
|
subscribeForRerender() {
|
|
1111
1114
|
const { subscribe: t } = this.renderKit
|
|
@@ -1117,37 +1120,65 @@
|
|
|
1117
1120
|
return `${S}:${t}`
|
|
1118
1121
|
}
|
|
1119
1122
|
}
|
|
1120
|
-
const
|
|
1121
|
-
|
|
1123
|
+
const Ne = (e) => e,
|
|
1124
|
+
nt = ({ Template: e, viewModel: t, subscriptions: s }) => (
|
|
1122
1125
|
(s = s || []),
|
|
1123
|
-
(t = t ||
|
|
1126
|
+
(t = t || Ne),
|
|
1124
1127
|
(n) =>
|
|
1125
|
-
new
|
|
1128
|
+
new _e({ Template: e, viewModel: t, subscriptions: s, attributes: n })
|
|
1126
1129
|
),
|
|
1127
|
-
|
|
1130
|
+
je = Object.freeze(
|
|
1128
1131
|
Object.defineProperty(
|
|
1129
1132
|
{
|
|
1130
1133
|
__proto__: null,
|
|
1131
|
-
createRouteState:
|
|
1132
|
-
events:
|
|
1133
|
-
extractQueryParams:
|
|
1134
|
+
createRouteState: $,
|
|
1135
|
+
events: jt,
|
|
1136
|
+
extractQueryParams: L,
|
|
1134
1137
|
findHref: F,
|
|
1135
|
-
navigate:
|
|
1136
|
-
onLinkClick:
|
|
1137
|
-
onLocationChange:
|
|
1138
|
-
start:
|
|
1138
|
+
navigate: P,
|
|
1139
|
+
onLinkClick: D,
|
|
1140
|
+
onLocationChange: z,
|
|
1141
|
+
start: Ot,
|
|
1139
1142
|
},
|
|
1140
1143
|
Symbol.toStringTag,
|
|
1141
1144
|
{ value: 'Module' },
|
|
1142
1145
|
),
|
|
1143
|
-
)
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1146
|
+
),
|
|
1147
|
+
Oe =
|
|
1148
|
+
(e) =>
|
|
1149
|
+
({ path: t }) =>
|
|
1150
|
+
t === e,
|
|
1151
|
+
Me = () => !0,
|
|
1152
|
+
rt =
|
|
1153
|
+
(e) =>
|
|
1154
|
+
({ route: t }) => {
|
|
1155
|
+
const s = e.find((n) => n.match(t))
|
|
1156
|
+
return s && s.Partial
|
|
1157
|
+
},
|
|
1158
|
+
Te = Object.freeze(
|
|
1159
|
+
Object.defineProperty(
|
|
1160
|
+
{ __proto__: null, buildRouter: rt, catchAll: Me, exactPathMatch: Oe },
|
|
1161
|
+
Symbol.toStringTag,
|
|
1162
|
+
{ value: 'Module' },
|
|
1163
|
+
),
|
|
1164
|
+
),
|
|
1165
|
+
ke = () => ({ render: (e, t) => [] }),
|
|
1166
|
+
$e = (e) => {
|
|
1167
|
+
const t = rt(e)
|
|
1168
|
+
return nt({
|
|
1169
|
+
Template: ({ route: n }) => (t({ route: n }) || ke)(),
|
|
1170
|
+
subscriptions: ['route'],
|
|
1171
|
+
})
|
|
1172
|
+
}
|
|
1173
|
+
;(p.JaxsTypes = Bt),
|
|
1174
|
+
(p.appBuilding = Mt),
|
|
1175
|
+
(p.bind = nt),
|
|
1176
|
+
(p.createApp = zt),
|
|
1177
|
+
(p.jsx = M),
|
|
1178
|
+
(p.messageBus = Tt),
|
|
1179
|
+
(p.navigation = je),
|
|
1180
|
+
(p.routedView = $e),
|
|
1181
|
+
(p.routing = Te),
|
|
1182
|
+
(p.state = Dt),
|
|
1183
|
+
Object.defineProperty(p, Symbol.toStringTag, { value: 'Module' })
|
|
1153
1184
|
})
|