json-renderers 1.13.7 → 1.14.1
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 +293 -272
- package/docs/dist/min.js +728 -367
- package/docs/dist/v13/min.js +796 -702
- package/docs/dist/v14/min.js +1063 -0
- package/docs/index.html +730 -679
- package/docs/select.html +139 -0
- package/docs/table.html +172 -0
- package/package.json +2 -2
- package/src/index.js +2 -2
- package/src/v13/buildSpec/index.js +7 -6
- package/src/v13/index.js +42 -19
- package/src/v14/buildSpec/index.js +39 -0
- package/src/v14/common/deriveColumnsFromData.js +20 -0
- package/src/v14/index.js +81 -0
- package/src/v14/meta.js +6 -0
- package/src/v14/registerGlobal.js +14 -0
package/docs/dist/v13/min.js
CHANGED
|
@@ -1,702 +1,796 @@
|
|
|
1
|
-
const
|
|
2
|
-
version: "v13.1.0",
|
|
3
|
-
description: "build table from store data and render to DOM uses json-to-spec, json-to-dom under the hood"
|
|
4
|
-
},
|
|
5
|
-
var e;
|
|
6
|
-
typeof globalThis > "u" || !t || (globalThis.ks ?? (globalThis.ks = {}), (e = globalThis.ks).jsonRenderers ?? (e.jsonRenderers = {
|
|
7
|
-
meta:
|
|
8
|
-
renderToDom: t
|
|
9
|
-
}));
|
|
10
|
-
},
|
|
11
|
-
version: "
|
|
12
|
-
description: "build table from store data and render to DOM uses json-to-spec, json-to-dom under the hood"
|
|
13
|
-
},
|
|
14
|
-
var e;
|
|
15
|
-
typeof globalThis > "u" || !t || (globalThis.ks ?? (globalThis.ks = {}), (e = globalThis.ks).jsonRenderersBuild ?? (e.jsonRenderersBuild = {
|
|
16
|
-
meta:
|
|
17
|
-
renderToDom: t
|
|
18
|
-
}));
|
|
19
|
-
},
|
|
20
|
-
version: "v32",
|
|
21
|
-
description: "JSON-to-DOM engine with centralized traversal and responsibility-focused construction"
|
|
22
|
-
},
|
|
23
|
-
if (typeof globalThis > "u" || !t) return;
|
|
24
|
-
globalThis.ks ?? (globalThis.ks = {});
|
|
25
|
-
const e = {
|
|
26
|
-
meta:
|
|
27
|
-
buildSpecElement: t
|
|
28
|
-
};
|
|
29
|
-
globalThis.ks.jsonToSpec = e;
|
|
30
|
-
},
|
|
31
|
-
if ("source" in t && (t == null ? void 0 : t.source) in e) {
|
|
32
|
-
const
|
|
33
|
-
if (Array.isArray(
|
|
34
|
-
return
|
|
35
|
-
const
|
|
36
|
-
if (
|
|
37
|
-
return
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
let
|
|
42
|
-
for (const [
|
|
43
|
-
const
|
|
44
|
-
if (
|
|
45
|
-
const a =
|
|
46
|
-
key:
|
|
47
|
-
value:
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
return
|
|
53
|
-
},
|
|
54
|
-
if ("source" in t && (t == null ? void 0 : t.source) in e) {
|
|
55
|
-
const
|
|
56
|
-
if (Array.isArray(
|
|
57
|
-
return
|
|
58
|
-
const
|
|
59
|
-
if (
|
|
60
|
-
return
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
if ("operation" in t) {
|
|
65
|
-
if (t.operation === "loopArray")
|
|
66
|
-
return
|
|
67
|
-
if (t.operation === "loopObject")
|
|
68
|
-
return
|
|
69
|
-
if (t.operation === "loopCollection")
|
|
70
|
-
return
|
|
71
|
-
}
|
|
72
|
-
},
|
|
73
|
-
if (typeof e == "string") return e;
|
|
74
|
-
if (typeof t != "string") return t;
|
|
75
|
-
if (t === "${value}")
|
|
76
|
-
return e.value;
|
|
77
|
-
const
|
|
78
|
-
if (
|
|
79
|
-
const
|
|
80
|
-
return (e == null ? void 0 : e[
|
|
81
|
-
}
|
|
82
|
-
return t;
|
|
83
|
-
},
|
|
84
|
-
let
|
|
85
|
-
for (const [
|
|
86
|
-
const
|
|
87
|
-
l
|
|
88
|
-
}
|
|
89
|
-
return
|
|
90
|
-
},
|
|
91
|
-
if ("tagName" in t) {
|
|
92
|
-
if ("textContent" in t) {
|
|
93
|
-
const
|
|
94
|
-
t.textContent =
|
|
95
|
-
}
|
|
96
|
-
if ("attributes" in t) {
|
|
97
|
-
const
|
|
98
|
-
t.attributes =
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
},
|
|
102
|
-
if (!t || typeof t != "object" || Array.isArray(t)) return null;
|
|
103
|
-
const
|
|
104
|
-
if (!
|
|
105
|
-
if ("tagName" in
|
|
106
|
-
const
|
|
107
|
-
Array.isArray(
|
|
108
|
-
}
|
|
109
|
-
if (Array.isArray(
|
|
110
|
-
const
|
|
111
|
-
|
|
112
|
-
}
|
|
113
|
-
return
|
|
114
|
-
},
|
|
115
|
-
|
|
116
|
-
inFuncDefinition:
|
|
117
|
-
});
|
|
118
|
-
const
|
|
119
|
-
default: {
|
|
120
|
-
tagName: "table",
|
|
121
|
-
attributes: {
|
|
122
|
-
class: "table table-hover table-striped mb-0"
|
|
123
|
-
},
|
|
124
|
-
children: [
|
|
125
|
-
{
|
|
126
|
-
tagName: "thead",
|
|
127
|
-
children: [
|
|
128
|
-
{
|
|
129
|
-
tagName: "tr",
|
|
130
|
-
jsonToSpec: {
|
|
131
|
-
operation: "loopCollection",
|
|
132
|
-
source: "columns",
|
|
133
|
-
template: {
|
|
134
|
-
tagName: "th",
|
|
135
|
-
textContent: "${title}"
|
|
136
|
-
}
|
|
137
|
-
},
|
|
138
|
-
children: []
|
|
139
|
-
}
|
|
140
|
-
]
|
|
141
|
-
},
|
|
142
|
-
{
|
|
143
|
-
tagName: "tbody",
|
|
144
|
-
jsonToSpec: {
|
|
145
|
-
operation: "loopCollection",
|
|
146
|
-
source: "data",
|
|
147
|
-
template: {
|
|
148
|
-
tagName: "tr",
|
|
149
|
-
jsonToSpec: {
|
|
150
|
-
operation: "loopObject",
|
|
151
|
-
source: "data",
|
|
152
|
-
template: {
|
|
153
|
-
tagName: "td",
|
|
154
|
-
textContent: "${value}"
|
|
155
|
-
}
|
|
156
|
-
},
|
|
157
|
-
children: []
|
|
158
|
-
}
|
|
159
|
-
},
|
|
160
|
-
children: []
|
|
161
|
-
}
|
|
162
|
-
]
|
|
163
|
-
}
|
|
164
|
-
},
|
|
165
|
-
inColumns: t,
|
|
166
|
-
inData: e
|
|
167
|
-
} = {}) => {
|
|
168
|
-
const
|
|
169
|
-
return
|
|
170
|
-
columns:
|
|
171
|
-
data:
|
|
172
|
-
});
|
|
173
|
-
},
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
},
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
},
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
"
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
"
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
},
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
},
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
"
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
"
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
"
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
},
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
"
|
|
437
|
-
"
|
|
438
|
-
"
|
|
439
|
-
"
|
|
440
|
-
"
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
"
|
|
449
|
-
"
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
"
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
"
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
"
|
|
504
|
-
]
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
"
|
|
542
|
-
"
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
"
|
|
574
|
-
]
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
},
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
1
|
+
const O = {
|
|
2
|
+
version: "v13.1.0",
|
|
3
|
+
description: "build table from store data and render to DOM uses json-to-spec, json-to-dom under the hood"
|
|
4
|
+
}, F = (t) => {
|
|
5
|
+
var e;
|
|
6
|
+
typeof globalThis > "u" || !t || (globalThis.ks ?? (globalThis.ks = {}), (e = globalThis.ks).jsonRenderers ?? (e.jsonRenderers = {
|
|
7
|
+
meta: O,
|
|
8
|
+
renderToDom: t
|
|
9
|
+
}));
|
|
10
|
+
}, R = {
|
|
11
|
+
version: "v4.0.0",
|
|
12
|
+
description: "build table from store data and render to DOM uses json-to-spec, json-to-dom under the hood"
|
|
13
|
+
}, S = (t) => {
|
|
14
|
+
var e;
|
|
15
|
+
typeof globalThis > "u" || !t || (globalThis.ks ?? (globalThis.ks = {}), (e = globalThis.ks).jsonRenderersBuild ?? (e.jsonRenderersBuild = {
|
|
16
|
+
meta: R,
|
|
17
|
+
renderToDom: t
|
|
18
|
+
}));
|
|
19
|
+
}, D = {
|
|
20
|
+
version: "v32",
|
|
21
|
+
description: "JSON-to-DOM engine with centralized traversal and responsibility-focused construction"
|
|
22
|
+
}, V = ({ inFuncDefinition: t } = {}) => {
|
|
23
|
+
if (typeof globalThis > "u" || !t) return;
|
|
24
|
+
globalThis.ks ?? (globalThis.ks = {});
|
|
25
|
+
const e = {
|
|
26
|
+
meta: D,
|
|
27
|
+
buildSpecElement: t
|
|
28
|
+
};
|
|
29
|
+
globalThis.ks.jsonToSpec = e;
|
|
30
|
+
}, I = (t, e) => p(t, e), T = (t, e) => Array.isArray(t) ? t.map((r) => I(r, e)).flat(1 / 0).filter(Boolean) : [], G = (t, e) => {
|
|
31
|
+
if ("source" in t && (t == null ? void 0 : t.source) in e) {
|
|
32
|
+
const r = e[t == null ? void 0 : t.source];
|
|
33
|
+
if (Array.isArray(r))
|
|
34
|
+
return r.map((o) => {
|
|
35
|
+
const n = t == null ? void 0 : t.template;
|
|
36
|
+
if (n)
|
|
37
|
+
return p(n, o);
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
}, M = (t, e) => {
|
|
41
|
+
let r = [];
|
|
42
|
+
for (const [l, o] of Object.entries(e)) {
|
|
43
|
+
const n = t == null ? void 0 : t.template;
|
|
44
|
+
if (n) {
|
|
45
|
+
const a = p(n, {
|
|
46
|
+
key: l,
|
|
47
|
+
value: o
|
|
48
|
+
});
|
|
49
|
+
r.push(a);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return r;
|
|
53
|
+
}, z = (t, e) => {
|
|
54
|
+
if ("source" in t && (t == null ? void 0 : t.source) in e) {
|
|
55
|
+
const r = e[t == null ? void 0 : t.source];
|
|
56
|
+
if (Array.isArray(r))
|
|
57
|
+
return r.map((o) => {
|
|
58
|
+
const n = t == null ? void 0 : t.template;
|
|
59
|
+
if (n)
|
|
60
|
+
return p(n, o);
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
}, K = (t, e) => {
|
|
64
|
+
if ("operation" in t) {
|
|
65
|
+
if (t.operation === "loopArray")
|
|
66
|
+
return G(t, e);
|
|
67
|
+
if (t.operation === "loopObject")
|
|
68
|
+
return M(t, e);
|
|
69
|
+
if (t.operation === "loopCollection")
|
|
70
|
+
return z(t, e);
|
|
71
|
+
}
|
|
72
|
+
}, A = (t, e) => {
|
|
73
|
+
if (typeof e == "string") return e;
|
|
74
|
+
if (typeof t != "string") return t;
|
|
75
|
+
if (t === "${value}")
|
|
76
|
+
return e.value;
|
|
77
|
+
const r = t.match(/^\$\{(.+?)\}$/);
|
|
78
|
+
if (r) {
|
|
79
|
+
const l = r[1];
|
|
80
|
+
return (e == null ? void 0 : e[l]) ?? "";
|
|
81
|
+
}
|
|
82
|
+
return t;
|
|
83
|
+
}, L = (t, e) => {
|
|
84
|
+
let r = {};
|
|
85
|
+
for (const [l, o] of Object.entries(t)) {
|
|
86
|
+
const n = A(o, e);
|
|
87
|
+
r[l] = n;
|
|
88
|
+
}
|
|
89
|
+
return r;
|
|
90
|
+
}, q = (t, e) => {
|
|
91
|
+
if ("tagName" in t) {
|
|
92
|
+
if ("textContent" in t) {
|
|
93
|
+
const r = A(t.textContent, e);
|
|
94
|
+
t.textContent = r;
|
|
95
|
+
}
|
|
96
|
+
if ("attributes" in t) {
|
|
97
|
+
const r = L(t.attributes, e);
|
|
98
|
+
t.attributes = r;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}, B = (t, e) => {
|
|
102
|
+
if (!t || typeof t != "object" || Array.isArray(t)) return null;
|
|
103
|
+
const r = structuredClone(t);
|
|
104
|
+
if (!r) return null;
|
|
105
|
+
if ("tagName" in r && q(r, e), "jsonToSpec" in r) {
|
|
106
|
+
const l = r == null ? void 0 : r.jsonToSpec, o = K(l, e);
|
|
107
|
+
Array.isArray(o) ? r.children = o : r.children = [o], delete r.jsonToSpec;
|
|
108
|
+
}
|
|
109
|
+
if (Array.isArray(r == null ? void 0 : r.children)) {
|
|
110
|
+
const l = T(r == null ? void 0 : r.children, e);
|
|
111
|
+
r.children = l;
|
|
112
|
+
}
|
|
113
|
+
return r;
|
|
114
|
+
}, p = (t, e) => t == null ? null : typeof Node < "u" && t instanceof Node ? t : Array.isArray(t) ? T(t, e) : typeof t == "object" ? B(t, e) : typeof t == "string" || typeof t == "number" ? document.createTextNode(String(t)) : t, C = (t, e) => p(t, e);
|
|
115
|
+
V({
|
|
116
|
+
inFuncDefinition: C
|
|
117
|
+
});
|
|
118
|
+
const H = {
|
|
119
|
+
default: {
|
|
120
|
+
tagName: "table",
|
|
121
|
+
attributes: {
|
|
122
|
+
class: "table table-hover table-striped mb-0"
|
|
123
|
+
},
|
|
124
|
+
children: [
|
|
125
|
+
{
|
|
126
|
+
tagName: "thead",
|
|
127
|
+
children: [
|
|
128
|
+
{
|
|
129
|
+
tagName: "tr",
|
|
130
|
+
jsonToSpec: {
|
|
131
|
+
operation: "loopCollection",
|
|
132
|
+
source: "columns",
|
|
133
|
+
template: {
|
|
134
|
+
tagName: "th",
|
|
135
|
+
textContent: "${title}"
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
children: []
|
|
139
|
+
}
|
|
140
|
+
]
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
tagName: "tbody",
|
|
144
|
+
jsonToSpec: {
|
|
145
|
+
operation: "loopCollection",
|
|
146
|
+
source: "data",
|
|
147
|
+
template: {
|
|
148
|
+
tagName: "tr",
|
|
149
|
+
jsonToSpec: {
|
|
150
|
+
operation: "loopObject",
|
|
151
|
+
source: "data",
|
|
152
|
+
template: {
|
|
153
|
+
tagName: "td",
|
|
154
|
+
textContent: "${value}"
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
children: []
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
children: []
|
|
161
|
+
}
|
|
162
|
+
]
|
|
163
|
+
}
|
|
164
|
+
}, P = ({
|
|
165
|
+
inColumns: t,
|
|
166
|
+
inData: e
|
|
167
|
+
} = {}) => {
|
|
168
|
+
const r = e ?? [], l = t;
|
|
169
|
+
return C(H.default, {
|
|
170
|
+
columns: l,
|
|
171
|
+
data: r
|
|
172
|
+
});
|
|
173
|
+
}, x = ({ inItems: t, inRecipe: e, inExecute: r }) => {
|
|
174
|
+
const l = t, o = e, n = r;
|
|
175
|
+
return l.map((a) => b({
|
|
176
|
+
inSource: a,
|
|
177
|
+
inRecipe: o,
|
|
178
|
+
inExecute: n
|
|
179
|
+
})).flat(1 / 0).filter(Boolean);
|
|
180
|
+
}, _ = ({ inSource: t, inRecipe: e, inExecute: r }) => {
|
|
181
|
+
const l = t, o = e, n = r;
|
|
182
|
+
let a = l;
|
|
183
|
+
typeof n == "function" && (a = n({
|
|
184
|
+
inSource: l,
|
|
185
|
+
inRecipe: o
|
|
186
|
+
}));
|
|
187
|
+
for (const [s, d] of Object.entries(a))
|
|
188
|
+
Array.isArray(d) && o && s in o && (a[s] = x({
|
|
189
|
+
inItems: d,
|
|
190
|
+
inRecipe: o[s],
|
|
191
|
+
inExecute: n
|
|
192
|
+
}));
|
|
193
|
+
return a;
|
|
194
|
+
}, b = ({ inSource: t, inRecipe: e, inExecute: r }) => {
|
|
195
|
+
const l = t, o = e, n = r;
|
|
196
|
+
return Array.isArray(l) ? x({
|
|
197
|
+
inItems: l,
|
|
198
|
+
inRecipe: o,
|
|
199
|
+
inExecute: n
|
|
200
|
+
}) : typeof l == "object" && l !== null ? _({
|
|
201
|
+
inSource: l,
|
|
202
|
+
inRecipe: o,
|
|
203
|
+
inExecute: n
|
|
204
|
+
}) : l;
|
|
205
|
+
}, U = ({ inKey: t, inDirective: e }) => {
|
|
206
|
+
const r = t, l = e;
|
|
207
|
+
return (l == null ? void 0 : l.alterKey) || r;
|
|
208
|
+
}, X = ({ inValue: t, inDirective: e, inExecute: r }) => {
|
|
209
|
+
const l = t, o = e, n = r;
|
|
210
|
+
return o && "transform" in o ? b({
|
|
211
|
+
inSource: l,
|
|
212
|
+
inRecipe: o,
|
|
213
|
+
inExecute: n
|
|
214
|
+
}) : l;
|
|
215
|
+
}, Q = ({ inValue: t, inDirective: e }) => {
|
|
216
|
+
const r = t, l = e;
|
|
217
|
+
return (l == null ? void 0 : l.valueType) === "array" && !Array.isArray(r) ? [r] : r;
|
|
218
|
+
}, W = ({ inValue: t, inDirective: e }) => {
|
|
219
|
+
const r = t, l = e;
|
|
220
|
+
return l != null && l.valueKey && r && typeof r == "object" ? r[l.valueKey] : r;
|
|
221
|
+
}, Y = ({ inSource: t, inTransform: e, inExecute: r }) => {
|
|
222
|
+
const l = t, o = e, n = r, a = {};
|
|
223
|
+
for (const [s, d] of Object.entries(l)) {
|
|
224
|
+
if (!(s in o))
|
|
225
|
+
continue;
|
|
226
|
+
const u = o[s], i = U({ inKey: s, inDirective: u });
|
|
227
|
+
let c = d;
|
|
228
|
+
c = X({
|
|
229
|
+
inValue: c,
|
|
230
|
+
inDirective: u,
|
|
231
|
+
inExecute: n
|
|
232
|
+
}), c = Q({ inValue: c, inDirective: u }), c = W({ inValue: c, inDirective: u }), a[i] = c;
|
|
233
|
+
}
|
|
234
|
+
return a;
|
|
235
|
+
};
|
|
236
|
+
function $(t, e) {
|
|
237
|
+
for (const r in t)
|
|
238
|
+
typeof t[r] == "object" && t[r] !== null ? $(t[r], e) : typeof t[r] == "string" && t[r] === "${}" && (t[r] = e);
|
|
239
|
+
return t;
|
|
240
|
+
}
|
|
241
|
+
const Z = ({ inSource: t, inOperation: e, inExecute: r }) => {
|
|
242
|
+
const l = t, o = e;
|
|
243
|
+
for (const [n, a] of Object.entries(o))
|
|
244
|
+
if ("operationType" in a && a.operationType === "loopArray" && n in l) {
|
|
245
|
+
const s = l[n].map((d) => {
|
|
246
|
+
const u = { ...a == null ? void 0 : a.template };
|
|
247
|
+
return $(u, d), u;
|
|
248
|
+
});
|
|
249
|
+
l[n] = s;
|
|
250
|
+
}
|
|
251
|
+
return l;
|
|
252
|
+
}, g = ({ inSource: t, inRecipe: e }) => {
|
|
253
|
+
let r = t;
|
|
254
|
+
const l = e;
|
|
255
|
+
return l && typeof l == "object" && "transform" in l && (r = Y({
|
|
256
|
+
inSource: r,
|
|
257
|
+
inTransform: l.transform,
|
|
258
|
+
inExecute: g
|
|
259
|
+
})), l && typeof l == "object" && "operation" in l && (r = Z({
|
|
260
|
+
inSource: r,
|
|
261
|
+
inOperation: l.operation,
|
|
262
|
+
inExecute: g
|
|
263
|
+
})), r;
|
|
264
|
+
}, J = (t, e) => b({
|
|
265
|
+
inSource: t,
|
|
266
|
+
inRecipe: e,
|
|
267
|
+
inExecute: g
|
|
268
|
+
}), tt = {
|
|
269
|
+
children: ""
|
|
270
|
+
}, et = {
|
|
271
|
+
children: {
|
|
272
|
+
operationType: "loopArray",
|
|
273
|
+
template: {
|
|
274
|
+
tagName: "option",
|
|
275
|
+
attributes: {
|
|
276
|
+
value: "${}"
|
|
277
|
+
},
|
|
278
|
+
textContent: "${}"
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
}, rt = {
|
|
282
|
+
transform: tt,
|
|
283
|
+
operation: et
|
|
284
|
+
}, v = ({
|
|
285
|
+
inData: t
|
|
286
|
+
} = {}) => {
|
|
287
|
+
let r = J({
|
|
288
|
+
children: t ?? []
|
|
289
|
+
}, rt);
|
|
290
|
+
return r == null ? void 0 : r.children;
|
|
291
|
+
}, lt = "select", nt = {
|
|
292
|
+
id: "LedgerName"
|
|
293
|
+
}, ot = [], h = {
|
|
294
|
+
tagName: lt,
|
|
295
|
+
attributes: nt,
|
|
296
|
+
children: ot
|
|
297
|
+
}, at = ({
|
|
298
|
+
inData: t
|
|
299
|
+
} = {}) => {
|
|
300
|
+
let r = v({
|
|
301
|
+
inData: t ?? []
|
|
302
|
+
});
|
|
303
|
+
return h.children = r, console.log("skeletonJson: ", r, h), h;
|
|
304
|
+
}, w = {
|
|
305
|
+
table: P,
|
|
306
|
+
select: at,
|
|
307
|
+
selectOptionsOnly: v
|
|
308
|
+
}, j = ({
|
|
309
|
+
type: t = "table",
|
|
310
|
+
data: e,
|
|
311
|
+
columns: r
|
|
312
|
+
} = {}) => {
|
|
313
|
+
const l = t, o = w[l];
|
|
314
|
+
return o ? o({
|
|
315
|
+
inColumns: r,
|
|
316
|
+
inData: e
|
|
317
|
+
}) : (console.error(
|
|
318
|
+
`[Renderer] Unknown renderer type "${l}". Available types: ${Object.keys(w).join(", ")}`
|
|
319
|
+
), null);
|
|
320
|
+
};
|
|
321
|
+
S(j);
|
|
322
|
+
const st = {
|
|
323
|
+
version: "v9",
|
|
324
|
+
description: "JSON-to-DOM engine with SVG namespace support, mixed text content, and centralized traversal"
|
|
325
|
+
}, it = ({ inFuncDefinition: t, inReviewSpec: e } = {}) => {
|
|
326
|
+
if (typeof globalThis > "u" || !t) return;
|
|
327
|
+
globalThis.ks ?? (globalThis.ks = {});
|
|
328
|
+
const r = {
|
|
329
|
+
meta: st,
|
|
330
|
+
buildSpecElement: t,
|
|
331
|
+
reviewSpec: e
|
|
332
|
+
};
|
|
333
|
+
globalThis.ks["json-to-tag"] = r, globalThis.ks.jsonToTag = r;
|
|
334
|
+
}, ct = (t) => t == null ? null : typeof Node < "u" && t instanceof Node ? t : typeof t == "string" || typeof t == "number" ? document.createTextNode(String(t)) : typeof t == "object" && (t.nodeType === 3 || t.tagName === "#text" || !t.tagName && (t.textContent !== void 0 || t.text !== void 0)) ? document.createTextNode(t.textContent ?? t.text ?? "") : E(t), N = (t) => Array.isArray(t) ? t.map(ct).flat(1 / 0).filter(Boolean) : [], ut = (t) => (t == null, t), dt = "http://www.w3.org/2000/svg", ft = /* @__PURE__ */ new Set([
|
|
335
|
+
"svg",
|
|
336
|
+
"path",
|
|
337
|
+
"symbol",
|
|
338
|
+
"use",
|
|
339
|
+
"g",
|
|
340
|
+
"circle",
|
|
341
|
+
"ellipse",
|
|
342
|
+
"rect",
|
|
343
|
+
"line",
|
|
344
|
+
"polyline",
|
|
345
|
+
"polygon",
|
|
346
|
+
"text",
|
|
347
|
+
"tspan",
|
|
348
|
+
"defs",
|
|
349
|
+
"clippath",
|
|
350
|
+
"mask",
|
|
351
|
+
"pattern",
|
|
352
|
+
"marker",
|
|
353
|
+
"lineargradient",
|
|
354
|
+
"radialgradient",
|
|
355
|
+
"stop",
|
|
356
|
+
"image",
|
|
357
|
+
"filter",
|
|
358
|
+
"fegaussianblur",
|
|
359
|
+
"femerge",
|
|
360
|
+
"femergenode"
|
|
361
|
+
]), pt = ({ inTagName: t }) => {
|
|
362
|
+
const e = t == null ? void 0 : t.toLowerCase();
|
|
363
|
+
if (!e) return null;
|
|
364
|
+
if (e === "checkbox") {
|
|
365
|
+
const r = document.createElement("input");
|
|
366
|
+
return r.type = "checkbox", r;
|
|
367
|
+
}
|
|
368
|
+
return ft.has(e) ? document.createElementNS(dt, e) : document.createElement(e);
|
|
369
|
+
}, ht = ({ inElement: t, inTextContent: e }) => (!t || e === void 0 || e === null || (t.textContent = e), t), gt = ({ inElement: t, inProperties: e }) => (t && e && typeof e == "object" && Object.assign(t, e), t), mt = "http://www.w3.org/1999/xlink", bt = ({ inElement: t, inAttributes: e }) => {
|
|
370
|
+
const r = t, l = e;
|
|
371
|
+
if (!r || !l || typeof l != "object")
|
|
372
|
+
return r;
|
|
373
|
+
const o = typeof SVGElement < "u" ? r instanceof SVGElement : r.namespaceURI === "http://www.w3.org/2000/svg";
|
|
374
|
+
return Object.entries(l).forEach(([n, a]) => {
|
|
375
|
+
if (n === "class") {
|
|
376
|
+
o ? r.setAttribute("class", String(a)) : r.className = a;
|
|
377
|
+
return;
|
|
378
|
+
}
|
|
379
|
+
if (n === "xlink:href" || n === "href") {
|
|
380
|
+
if (a != null) {
|
|
381
|
+
const s = String(a);
|
|
382
|
+
if (o)
|
|
383
|
+
try {
|
|
384
|
+
r.setAttributeNS(mt, "href", s);
|
|
385
|
+
} catch {
|
|
386
|
+
}
|
|
387
|
+
r.setAttribute("href", s), r.setAttribute("xlink:href", s);
|
|
388
|
+
}
|
|
389
|
+
return;
|
|
390
|
+
}
|
|
391
|
+
if (typeof a == "boolean") {
|
|
392
|
+
a ? r.setAttribute(n, "") : r.removeAttribute(n);
|
|
393
|
+
return;
|
|
394
|
+
}
|
|
395
|
+
a != null && r.setAttribute(n, String(a));
|
|
396
|
+
}), r;
|
|
397
|
+
}, yt = ({ inElement: t, inClassList: e }) => {
|
|
398
|
+
if (!t || !e) return t;
|
|
399
|
+
const r = typeof e == "string" ? e.split(/\s+/).filter(Boolean) : Array.isArray(e) ? e.filter((l) => typeof l == "string" && l.trim()) : [];
|
|
400
|
+
return r.length && t.classList.add(...r), t;
|
|
401
|
+
}, wt = (t) => {
|
|
402
|
+
if (!t || typeof t != "object" || Array.isArray(t) || !t.tagName) return null;
|
|
403
|
+
const e = pt({ inTagName: t.tagName });
|
|
404
|
+
if (!e) return null;
|
|
405
|
+
if (ht({
|
|
406
|
+
inElement: e,
|
|
407
|
+
inTextContent: ut(t.textContent),
|
|
408
|
+
inTagName: t.tagName
|
|
409
|
+
}), gt({
|
|
410
|
+
inElement: e,
|
|
411
|
+
inProperties: t.properties
|
|
412
|
+
}), bt({
|
|
413
|
+
inElement: e,
|
|
414
|
+
inAttributes: t.attributes
|
|
415
|
+
}), yt({
|
|
416
|
+
inElement: e,
|
|
417
|
+
inClassList: t.classList
|
|
418
|
+
}), Array.isArray(t.children)) {
|
|
419
|
+
const r = N(t.children);
|
|
420
|
+
r.length && e.append(...r);
|
|
421
|
+
}
|
|
422
|
+
return e;
|
|
423
|
+
}, E = (t) => t == null ? null : typeof Node < "u" && t instanceof Node ? t : Array.isArray(t) ? N(t) : typeof t == "object" ? wt(t) : typeof t == "string" || typeof t == "number" ? document.createTextNode(String(t)) : null, Tt = "./tags.schema.json", At = {
|
|
424
|
+
allowsTextContent: !1,
|
|
425
|
+
allowsChildren: !0,
|
|
426
|
+
allowedAttributes: [
|
|
427
|
+
"title",
|
|
428
|
+
"role"
|
|
429
|
+
],
|
|
430
|
+
childTags: []
|
|
431
|
+
}, Ct = {
|
|
432
|
+
allowsTextContent: !1,
|
|
433
|
+
allowsChildren: !1,
|
|
434
|
+
allowedAttributes: [
|
|
435
|
+
"type",
|
|
436
|
+
"placeholder",
|
|
437
|
+
"value",
|
|
438
|
+
"name",
|
|
439
|
+
"disabled",
|
|
440
|
+
"readonly",
|
|
441
|
+
"required",
|
|
442
|
+
"list"
|
|
443
|
+
]
|
|
444
|
+
}, xt = {
|
|
445
|
+
allowsTextContent: !1,
|
|
446
|
+
allowsChildren: !1,
|
|
447
|
+
allowedAttributes: [
|
|
448
|
+
"type",
|
|
449
|
+
"checked",
|
|
450
|
+
"name",
|
|
451
|
+
"value",
|
|
452
|
+
"disabled",
|
|
453
|
+
"required"
|
|
454
|
+
]
|
|
455
|
+
}, $t = {
|
|
456
|
+
allowsTextContent: !1,
|
|
457
|
+
allowsChildren: !0,
|
|
458
|
+
allowedAttributes: [
|
|
459
|
+
"span"
|
|
460
|
+
],
|
|
461
|
+
childTags: [
|
|
462
|
+
"col"
|
|
463
|
+
]
|
|
464
|
+
}, vt = {
|
|
465
|
+
allowsTextContent: !1,
|
|
466
|
+
allowsChildren: !1,
|
|
467
|
+
allowedAttributes: [
|
|
468
|
+
"span",
|
|
469
|
+
"style",
|
|
470
|
+
"width"
|
|
471
|
+
]
|
|
472
|
+
}, jt = {
|
|
473
|
+
allowsTextContent: !0,
|
|
474
|
+
allowsChildren: !0,
|
|
475
|
+
allowedAttributes: [
|
|
476
|
+
"for"
|
|
477
|
+
],
|
|
478
|
+
childTags: []
|
|
479
|
+
}, Nt = {
|
|
480
|
+
allowsTextContent: !1,
|
|
481
|
+
allowsChildren: !0,
|
|
482
|
+
allowedAttributes: [
|
|
483
|
+
"action",
|
|
484
|
+
"method",
|
|
485
|
+
"autocomplete",
|
|
486
|
+
"enctype",
|
|
487
|
+
"name",
|
|
488
|
+
"novalidate",
|
|
489
|
+
"target"
|
|
490
|
+
],
|
|
491
|
+
childTags: []
|
|
492
|
+
}, Et = {
|
|
493
|
+
allowsTextContent: !1,
|
|
494
|
+
allowsChildren: !0,
|
|
495
|
+
allowedAttributes: [
|
|
496
|
+
"name",
|
|
497
|
+
"disabled",
|
|
498
|
+
"required",
|
|
499
|
+
"multiple",
|
|
500
|
+
"size"
|
|
501
|
+
],
|
|
502
|
+
childTags: [
|
|
503
|
+
"option"
|
|
504
|
+
]
|
|
505
|
+
}, kt = {
|
|
506
|
+
allowsTextContent: !0,
|
|
507
|
+
allowsChildren: !0,
|
|
508
|
+
allowedAttributes: [],
|
|
509
|
+
childTags: []
|
|
510
|
+
}, Ot = {
|
|
511
|
+
allowsTextContent: !0,
|
|
512
|
+
allowsChildren: !0,
|
|
513
|
+
allowedAttributes: [],
|
|
514
|
+
childTags: []
|
|
515
|
+
}, Ft = {
|
|
516
|
+
allowsTextContent: !0,
|
|
517
|
+
allowsChildren: !0,
|
|
518
|
+
allowedAttributes: [],
|
|
519
|
+
childTags: []
|
|
520
|
+
}, Rt = {
|
|
521
|
+
allowsTextContent: !0,
|
|
522
|
+
allowsChildren: !0,
|
|
523
|
+
allowedAttributes: [],
|
|
524
|
+
childTags: []
|
|
525
|
+
}, St = {
|
|
526
|
+
allowsTextContent: !1,
|
|
527
|
+
allowsChildren: !1,
|
|
528
|
+
allowedAttributes: [
|
|
529
|
+
"src",
|
|
530
|
+
"alt",
|
|
531
|
+
"width",
|
|
532
|
+
"height",
|
|
533
|
+
"loading"
|
|
534
|
+
]
|
|
535
|
+
}, Dt = {
|
|
536
|
+
allowsTextContent: !0,
|
|
537
|
+
allowsChildren: !0,
|
|
538
|
+
allowedAttributes: [
|
|
539
|
+
"type",
|
|
540
|
+
"disabled",
|
|
541
|
+
"name",
|
|
542
|
+
"value"
|
|
543
|
+
],
|
|
544
|
+
childTags: []
|
|
545
|
+
}, Vt = {
|
|
546
|
+
allowsTextContent: !1,
|
|
547
|
+
allowsChildren: !0,
|
|
548
|
+
allowedAttributes: [
|
|
549
|
+
"border",
|
|
550
|
+
"cellpadding",
|
|
551
|
+
"cellspacing"
|
|
552
|
+
],
|
|
553
|
+
childTags: [
|
|
554
|
+
"caption",
|
|
555
|
+
"colgroup",
|
|
556
|
+
"thead",
|
|
557
|
+
"tbody",
|
|
558
|
+
"tfoot",
|
|
559
|
+
"tr"
|
|
560
|
+
]
|
|
561
|
+
}, It = {
|
|
562
|
+
allowsTextContent: !1,
|
|
563
|
+
allowsChildren: !0,
|
|
564
|
+
allowedAttributes: [],
|
|
565
|
+
childTags: [
|
|
566
|
+
"tr"
|
|
567
|
+
]
|
|
568
|
+
}, Gt = {
|
|
569
|
+
allowsTextContent: !1,
|
|
570
|
+
allowsChildren: !0,
|
|
571
|
+
allowedAttributes: [],
|
|
572
|
+
childTags: [
|
|
573
|
+
"tr"
|
|
574
|
+
]
|
|
575
|
+
}, Mt = {
|
|
576
|
+
allowsTextContent: !1,
|
|
577
|
+
allowsChildren: !0,
|
|
578
|
+
allowedAttributes: [],
|
|
579
|
+
childTags: [
|
|
580
|
+
"tr"
|
|
581
|
+
]
|
|
582
|
+
}, zt = {
|
|
583
|
+
allowsTextContent: !1,
|
|
584
|
+
allowsChildren: !0,
|
|
585
|
+
allowedAttributes: [],
|
|
586
|
+
childTags: [
|
|
587
|
+
"td",
|
|
588
|
+
"th"
|
|
589
|
+
]
|
|
590
|
+
}, Kt = {
|
|
591
|
+
allowsTextContent: !0,
|
|
592
|
+
allowsChildren: !0,
|
|
593
|
+
allowedAttributes: [
|
|
594
|
+
"scope",
|
|
595
|
+
"colspan",
|
|
596
|
+
"rowspan"
|
|
597
|
+
],
|
|
598
|
+
childTags: []
|
|
599
|
+
}, Lt = {
|
|
600
|
+
allowsTextContent: !0,
|
|
601
|
+
allowsChildren: !0,
|
|
602
|
+
allowedAttributes: [
|
|
603
|
+
"colspan",
|
|
604
|
+
"rowspan"
|
|
605
|
+
],
|
|
606
|
+
childTags: []
|
|
607
|
+
}, qt = {
|
|
608
|
+
allowsTextContent: !1,
|
|
609
|
+
allowsChildren: !0,
|
|
610
|
+
allowedAttributes: [],
|
|
611
|
+
childTags: [
|
|
612
|
+
"option"
|
|
613
|
+
]
|
|
614
|
+
}, Bt = {
|
|
615
|
+
allowsTextContent: !0,
|
|
616
|
+
allowsChildren: !1,
|
|
617
|
+
allowedAttributes: [
|
|
618
|
+
"value",
|
|
619
|
+
"label",
|
|
620
|
+
"selected",
|
|
621
|
+
"disabled"
|
|
622
|
+
]
|
|
623
|
+
}, Ht = {
|
|
624
|
+
allowsTextContent: !1,
|
|
625
|
+
allowsChildren: !0,
|
|
626
|
+
allowedAttributes: [
|
|
627
|
+
"role"
|
|
628
|
+
],
|
|
629
|
+
childTags: []
|
|
630
|
+
}, Pt = {
|
|
631
|
+
allowsTextContent: !0,
|
|
632
|
+
allowsChildren: !0,
|
|
633
|
+
allowedAttributes: [
|
|
634
|
+
"href",
|
|
635
|
+
"target",
|
|
636
|
+
"rel",
|
|
637
|
+
"title",
|
|
638
|
+
"download"
|
|
639
|
+
],
|
|
640
|
+
childTags: []
|
|
641
|
+
}, _t = {
|
|
642
|
+
allowsTextContent: !0,
|
|
643
|
+
allowsChildren: !0,
|
|
644
|
+
allowedAttributes: [
|
|
645
|
+
"aria-hidden"
|
|
646
|
+
],
|
|
647
|
+
childTags: []
|
|
648
|
+
}, Ut = {
|
|
649
|
+
allowsTextContent: !0,
|
|
650
|
+
allowsChildren: !0,
|
|
651
|
+
allowedAttributes: [],
|
|
652
|
+
childTags: []
|
|
653
|
+
}, Xt = {
|
|
654
|
+
allowsTextContent: !1,
|
|
655
|
+
allowsChildren: !0,
|
|
656
|
+
allowedAttributes: [
|
|
657
|
+
"type"
|
|
658
|
+
],
|
|
659
|
+
childTags: [
|
|
660
|
+
"li"
|
|
661
|
+
]
|
|
662
|
+
}, Qt = {
|
|
663
|
+
allowsTextContent: !0,
|
|
664
|
+
allowsChildren: !0,
|
|
665
|
+
allowedAttributes: [
|
|
666
|
+
"value"
|
|
667
|
+
],
|
|
668
|
+
childTags: []
|
|
669
|
+
}, Wt = {
|
|
670
|
+
allowsTextContent: !1,
|
|
671
|
+
allowsChildren: !1,
|
|
672
|
+
allowedAttributes: []
|
|
673
|
+
}, Yt = {
|
|
674
|
+
$schema: Tt,
|
|
675
|
+
div: At,
|
|
676
|
+
input: Ct,
|
|
677
|
+
checkbox: xt,
|
|
678
|
+
colgroup: $t,
|
|
679
|
+
col: vt,
|
|
680
|
+
label: jt,
|
|
681
|
+
form: Nt,
|
|
682
|
+
select: Et,
|
|
683
|
+
p: kt,
|
|
684
|
+
h1: Ot,
|
|
685
|
+
h2: Ft,
|
|
686
|
+
span: Rt,
|
|
687
|
+
img: St,
|
|
688
|
+
button: Dt,
|
|
689
|
+
table: Vt,
|
|
690
|
+
thead: It,
|
|
691
|
+
tbody: Gt,
|
|
692
|
+
tfoot: Mt,
|
|
693
|
+
tr: zt,
|
|
694
|
+
th: Kt,
|
|
695
|
+
td: Lt,
|
|
696
|
+
datalist: qt,
|
|
697
|
+
option: Bt,
|
|
698
|
+
header: Ht,
|
|
699
|
+
a: Pt,
|
|
700
|
+
i: _t,
|
|
701
|
+
small: Ut,
|
|
702
|
+
ul: Xt,
|
|
703
|
+
li: Qt,
|
|
704
|
+
hr: Wt
|
|
705
|
+
}, m = ({ inSpec: t }) => {
|
|
706
|
+
const e = t;
|
|
707
|
+
if (!e) return [];
|
|
708
|
+
if (Array.isArray(e))
|
|
709
|
+
return e.flatMap((l) => m({ inSpec: l }));
|
|
710
|
+
if (typeof e != "object") return [];
|
|
711
|
+
const r = [];
|
|
712
|
+
return typeof e.tagName == "string" && e.tagName.trim().length > 0 && r.push(e.tagName.toLowerCase()), Array.isArray(e.children) && e.children.length > 0 && e.children.forEach((l) => {
|
|
713
|
+
const o = m({ inSpec: l });
|
|
714
|
+
r.push(...o);
|
|
715
|
+
}), r;
|
|
716
|
+
}, Zt = ({ inTagsFound: t, inAllowedTags: e }) => {
|
|
717
|
+
const r = t ?? [], l = e ?? {}, o = new Set(
|
|
718
|
+
Object.keys(l).filter((i) => i !== "$schema").map((i) => i.toLowerCase())
|
|
719
|
+
), n = {}, a = [], s = [];
|
|
720
|
+
r.forEach((i) => {
|
|
721
|
+
n[i] = (n[i] || 0) + 1, o.has(i) ? a.includes(i) || a.push(i) : s.includes(i) || s.push(i);
|
|
722
|
+
});
|
|
723
|
+
const d = r.length, u = s.length === 0;
|
|
724
|
+
return {
|
|
725
|
+
totalTags: d,
|
|
726
|
+
tagCounts: n,
|
|
727
|
+
uniqueTags: Object.keys(n),
|
|
728
|
+
recognizedTags: a,
|
|
729
|
+
unrecognizedTags: s,
|
|
730
|
+
areAllTagsPresent: u
|
|
731
|
+
};
|
|
732
|
+
}, Jt = ({ inSpec: t, inTags: e = Yt } = {}) => {
|
|
733
|
+
const r = t, l = e, o = m({ inSpec: r }), n = Zt({
|
|
734
|
+
inTagsFound: o,
|
|
735
|
+
inAllowedTags: l
|
|
736
|
+
});
|
|
737
|
+
return {
|
|
738
|
+
areAllTagsPresent: n.areAllTagsPresent,
|
|
739
|
+
totalTags: n.totalTags,
|
|
740
|
+
tagCounts: n.tagCounts,
|
|
741
|
+
uniqueTags: n.uniqueTags,
|
|
742
|
+
recognizedTags: n.recognizedTags,
|
|
743
|
+
unrecognizedTags: n.unrecognizedTags
|
|
744
|
+
};
|
|
745
|
+
}, k = (t = {}) => {
|
|
746
|
+
const e = (t == null ? void 0 : t.spec) ?? (t == null ? void 0 : t.inSpec) ?? t;
|
|
747
|
+
return E(e);
|
|
748
|
+
};
|
|
749
|
+
it({
|
|
750
|
+
inFuncDefinition: k,
|
|
751
|
+
inReviewSpec: Jt
|
|
752
|
+
});
|
|
753
|
+
const te = ({
|
|
754
|
+
inTargetHtmlId: t,
|
|
755
|
+
inColumns: e,
|
|
756
|
+
type: r,
|
|
757
|
+
inData: l,
|
|
758
|
+
showLog: o
|
|
759
|
+
} = {}) => {
|
|
760
|
+
const n = t, a = l ?? [], s = e;
|
|
761
|
+
o && console.log("buildSpec 1 :", n, a.localColumns);
|
|
762
|
+
let u = j({
|
|
763
|
+
type: r,
|
|
764
|
+
data: a,
|
|
765
|
+
columns: s
|
|
766
|
+
});
|
|
767
|
+
const i = k(u);
|
|
768
|
+
return console.log("buildSpec 2 :", u, i), o && console.log("buildSpec 3 :", i), i;
|
|
769
|
+
}, ee = ({
|
|
770
|
+
type: t = "table",
|
|
771
|
+
targetHtmlId: e,
|
|
772
|
+
data: r,
|
|
773
|
+
classToApply: l,
|
|
774
|
+
columns: o,
|
|
775
|
+
appendPosition: n,
|
|
776
|
+
showLog: a = !1
|
|
777
|
+
} = {}) => {
|
|
778
|
+
const s = t, d = e, u = r, i = o;
|
|
779
|
+
a && console.log("showLog 1 :", s, e, r, l, o, n);
|
|
780
|
+
const c = te({
|
|
781
|
+
inTargetHtmlId: d,
|
|
782
|
+
inColumns: i,
|
|
783
|
+
showLog: a,
|
|
784
|
+
inData: u,
|
|
785
|
+
type: s
|
|
786
|
+
});
|
|
787
|
+
a && console.log("showLog 2 :", c);
|
|
788
|
+
const f = document.getElementById(d);
|
|
789
|
+
a && console.log("showLog 3 :", f);
|
|
790
|
+
const y = Array.isArray(c) || c instanceof NodeList || c instanceof HTMLCollection;
|
|
791
|
+
return console.log("prepend ---------:", s, y, f, c, u), y ? n === "prepend" ? f.prepend(...c) : f.append(...c) : n === "prepend" ? f.prepend(c) : (f && (f.innerHTML = ""), f.append(c)), a && console.log("showLog 5 :", f), f;
|
|
792
|
+
};
|
|
793
|
+
F(ee);
|
|
794
|
+
export {
|
|
795
|
+
ee as default
|
|
796
|
+
};
|