lightview 2.1.0 → 2.2.2
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/build-bundles.mjs +2 -6
- package/build.js +236 -46
- package/components/data-display/avatar.js +25 -1
- package/components/data-display/chart.js +22 -5
- package/components/data-display/countdown.js +3 -2
- package/components/data-input/checkbox.js +23 -1
- package/components/data-input/input.js +24 -1
- package/components/data-input/radio.js +37 -2
- package/components/data-input/select.js +24 -1
- package/components/data-input/toggle.js +21 -1
- package/components/navigation/breadcrumbs.js +42 -2
- package/docs/assets/js/examplify.js +1 -1
- package/docs/cdom-nav.html +32 -6
- package/docs/cdom.html +610 -180
- package/docs/components/avatar.html +24 -54
- package/docs/components/badge.html +14 -14
- package/docs/components/breadcrumbs.html +95 -29
- package/docs/components/chart-area.html +3 -3
- package/docs/components/chart-bar.html +4 -181
- package/docs/components/chart-column.html +4 -189
- package/docs/components/chart-line.html +3 -3
- package/docs/components/chart-pie.html +112 -166
- package/docs/components/chart.html +11 -13
- package/docs/components/checkbox.html +48 -28
- package/docs/components/collapse.html +6 -6
- package/docs/components/countdown.html +12 -12
- package/docs/components/dropdown.html +1 -1
- package/docs/components/file-input.html +4 -4
- package/docs/components/footer.html +11 -11
- package/docs/components/input.html +45 -29
- package/docs/components/join.html +4 -4
- package/docs/components/kbd.html +3 -3
- package/docs/components/loading.html +41 -53
- package/docs/components/pagination.html +4 -4
- package/docs/components/progress.html +6 -4
- package/docs/components/radio.html +42 -31
- package/docs/components/select.html +48 -59
- package/docs/components/toggle.html +44 -25
- package/docs/getting-started/index.html +4 -4
- package/jprx/LICENSE +21 -0
- package/jprx/README.md +130 -0
- package/{cdom → jprx}/helpers/array.js +9 -4
- package/{cdom → jprx}/helpers/state.js +6 -3
- package/jprx/index.js +69 -0
- package/jprx/package.json +24 -0
- package/jprx/parser.js +1517 -0
- package/lightview-all.js +3785 -1
- package/lightview-cdom.js +2128 -1
- package/lightview-router.js +179 -208
- package/lightview-x.js +1435 -1
- package/lightview.js +613 -1
- package/package.json +5 -2
- package/src/lightview-cdom.js +201 -49
- package/src/lightview-router.js +210 -0
- package/src/lightview-x.js +104 -55
- package/src/lightview.js +12 -1
- package/{watch.js → start-dev.js} +2 -1
- package/tests/cdom/parser.test.js +83 -12
- package/wrangler.toml +0 -3
- package/cdom/parser.js +0 -602
- package/test-text-tag.js +0 -6
- /package/{cdom → jprx}/helpers/compare.js +0 -0
- /package/{cdom → jprx}/helpers/conditional.js +0 -0
- /package/{cdom → jprx}/helpers/datetime.js +0 -0
- /package/{cdom → jprx}/helpers/format.js +0 -0
- /package/{cdom → jprx}/helpers/logic.js +0 -0
- /package/{cdom → jprx}/helpers/lookup.js +0 -0
- /package/{cdom → jprx}/helpers/math.js +0 -0
- /package/{cdom → jprx}/helpers/network.js +0 -0
- /package/{cdom → jprx}/helpers/stats.js +0 -0
- /package/{cdom → jprx}/helpers/string.js +0 -0
|
@@ -261,7 +261,7 @@ const chart = Chart({
|
|
|
261
261
|
multiple: true,
|
|
262
262
|
labels: true,
|
|
263
263
|
primaryAxis: true,
|
|
264
|
-
|
|
264
|
+
primaryAxis: true,
|
|
265
265
|
style: 'width: 100%; max-width: 600px; height: 280px; margin: 0 auto;'
|
|
266
266
|
},
|
|
267
267
|
Chart.Body({},
|
|
@@ -322,9 +322,7 @@ const chart = {
|
|
|
322
322
|
attributes: {
|
|
323
323
|
type: 'column',
|
|
324
324
|
multiple: true,
|
|
325
|
-
labels: true,
|
|
326
325
|
primaryAxis: true,
|
|
327
|
-
spacing: 5,
|
|
328
326
|
style: 'width: 100%; max-width: 600px; height: 280px; margin: 0 auto;'
|
|
329
327
|
},
|
|
330
328
|
children: [
|
|
@@ -366,7 +364,6 @@ const chart = {
|
|
|
366
364
|
multiple: true,
|
|
367
365
|
labels: true,
|
|
368
366
|
primaryAxis: true,
|
|
369
|
-
spacing: 5,
|
|
370
367
|
style: 'width: 100%; max-width: 600px; height: 280px; margin: 0 auto;',
|
|
371
368
|
children: [
|
|
372
369
|
{
|
|
@@ -441,7 +438,7 @@ const chart = Chart({
|
|
|
441
438
|
type: 'column',
|
|
442
439
|
labels: true,
|
|
443
440
|
primaryAxis: true,
|
|
444
|
-
|
|
441
|
+
secondaryAxesCount: 5,
|
|
445
442
|
style: 'width: 100%; max-width: 600px; height: 280px; margin: 0 auto;'
|
|
446
443
|
},
|
|
447
444
|
Chart.Body({},
|
|
@@ -484,7 +481,7 @@ const chart = {
|
|
|
484
481
|
type: 'column',
|
|
485
482
|
labels: true,
|
|
486
483
|
primaryAxis: true,
|
|
487
|
-
|
|
484
|
+
secondaryAxesCount: 5,
|
|
488
485
|
style: 'width: 100%; max-width: 600px; height: 280px; margin: 0 auto;'
|
|
489
486
|
},
|
|
490
487
|
children: [
|
|
@@ -522,7 +519,7 @@ const chart = {
|
|
|
522
519
|
type: 'column',
|
|
523
520
|
labels: true,
|
|
524
521
|
primaryAxis: true,
|
|
525
|
-
|
|
522
|
+
secondaryAxesCount: 5,
|
|
526
523
|
style: 'width: 100%; max-width: 600px; height: 280px; margin: 0 auto;',
|
|
527
524
|
children: [
|
|
528
525
|
{
|
|
@@ -545,188 +542,6 @@ $('#example').content(chart);</code></pre>
|
|
|
545
542
|
</div>
|
|
546
543
|
</div>
|
|
547
544
|
|
|
548
|
-
<!-- Spacing -->
|
|
549
|
-
<div class="card bg-base-200" style="margin-bottom: 2rem;">
|
|
550
|
-
<div class="card-body">
|
|
551
|
-
<h2 class="card-title">Spacing</h2>
|
|
552
|
-
<p class="text-sm" style="opacity: 0.7; margin-bottom: 1rem;">
|
|
553
|
-
Control the gap between columns with the <code>spacing</code> prop (1-20).
|
|
554
|
-
</p>
|
|
555
|
-
|
|
556
|
-
<!-- Tabs -->
|
|
557
|
-
<script>
|
|
558
|
-
globalThis.switchSpacingColumnTab = (tabId) => {
|
|
559
|
-
const tabs = ['tagged', 'vdom', 'object'];
|
|
560
|
-
tabs.forEach(t => {
|
|
561
|
-
const tabEl = document.getElementById(`spacing-column-tab-btn-${t}`);
|
|
562
|
-
const contentEl = document.getElementById(`spacing-column-syntax-${t}`);
|
|
563
|
-
if (t === tabId) {
|
|
564
|
-
tabEl.classList.add('syntax-tab-active');
|
|
565
|
-
contentEl.style.display = 'block';
|
|
566
|
-
} else {
|
|
567
|
-
tabEl.classList.remove('syntax-tab-active');
|
|
568
|
-
contentEl.style.display = 'none';
|
|
569
|
-
}
|
|
570
|
-
});
|
|
571
|
-
};
|
|
572
|
-
</script>
|
|
573
|
-
<div role="tablist" class="syntax-tabs" style="margin-bottom: 1rem;">
|
|
574
|
-
<button id="spacing-column-tab-btn-tagged" role="tab"
|
|
575
|
-
class="syntax-tab syntax-tab-active"
|
|
576
|
-
onclick="switchSpacingColumnTab('tagged')">Tagged</button>
|
|
577
|
-
<button id="spacing-column-tab-btn-vdom" role="tab" class="syntax-tab"
|
|
578
|
-
onclick="switchSpacingColumnTab('vdom')">vDOM</button>
|
|
579
|
-
<button id="spacing-column-tab-btn-object" role="tab" class="syntax-tab"
|
|
580
|
-
onclick="switchSpacingColumnTab('object')">Object DOM</button>
|
|
581
|
-
</div>
|
|
582
|
-
|
|
583
|
-
<!-- Tagged Syntax -->
|
|
584
|
-
<div id="spacing-column-syntax-tagged">
|
|
585
|
-
<pre><script>
|
|
586
|
-
examplify(document.currentScript.nextElementSibling, {
|
|
587
|
-
at: document.currentScript.parentElement,
|
|
588
|
-
scripts: ['/lightview.js', '/lightview-x.js'],
|
|
589
|
-
styles: ['https://cdn.jsdelivr.net/npm/daisyui@3.9.4/dist/full.min.css'],
|
|
590
|
-
type: 'module',
|
|
591
|
-
minHeight: 200,
|
|
592
|
-
autoRun: true
|
|
593
|
-
});
|
|
594
|
-
</script><code contenteditable="true">await import('/components/data-display/chart.js');
|
|
595
|
-
const { tags, $ } = Lightview;
|
|
596
|
-
const { Chart, div } = tags;
|
|
597
|
-
|
|
598
|
-
const charts = div({ style: 'display: flex; gap: 2rem; flex-wrap: wrap;' },
|
|
599
|
-
div({ style: 'flex: 1; min-width: 250px;' },
|
|
600
|
-
div({ style: 'font-weight: bold; margin-bottom: 0.5rem;' }, 'spacing: 2'),
|
|
601
|
-
Chart({ type: 'column', labels: true, spacing: 2, style: 'height: 180px;' },
|
|
602
|
-
Chart.Body({},
|
|
603
|
-
Chart.Row({}, Chart.Label({}, 'A'), Chart.Data({ value: 0.6 })),
|
|
604
|
-
Chart.Row({}, Chart.Label({}, 'B'), Chart.Data({ value: 0.8 })),
|
|
605
|
-
Chart.Row({}, Chart.Label({}, 'C'), Chart.Data({ value: 0.5 })),
|
|
606
|
-
Chart.Row({}, Chart.Label({}, 'D'), Chart.Data({ value: 0.9 }))
|
|
607
|
-
)
|
|
608
|
-
)
|
|
609
|
-
),
|
|
610
|
-
div({ style: 'flex: 1; min-width: 250px;' },
|
|
611
|
-
div({ style: 'font-weight: bold; margin-bottom: 0.5rem;' }, 'spacing: 15'),
|
|
612
|
-
Chart({ type: 'column', labels: true, spacing: 15, style: 'height: 180px;' },
|
|
613
|
-
Chart.Body({},
|
|
614
|
-
Chart.Row({}, Chart.Label({}, 'A'), Chart.Data({ value: 0.6 })),
|
|
615
|
-
Chart.Row({}, Chart.Label({}, 'B'), Chart.Data({ value: 0.8 })),
|
|
616
|
-
Chart.Row({}, Chart.Label({}, 'C'), Chart.Data({ value: 0.5 })),
|
|
617
|
-
Chart.Row({}, Chart.Label({}, 'D'), Chart.Data({ value: 0.9 }))
|
|
618
|
-
)
|
|
619
|
-
)
|
|
620
|
-
)
|
|
621
|
-
);
|
|
622
|
-
|
|
623
|
-
$('#example').content(charts);</code></pre>
|
|
624
|
-
</div>
|
|
625
|
-
|
|
626
|
-
<!-- vDOM Syntax -->
|
|
627
|
-
<div id="spacing-column-syntax-vdom" style="display: none;">
|
|
628
|
-
<pre><script>
|
|
629
|
-
examplify(document.currentScript.nextElementSibling, {
|
|
630
|
-
at: document.currentScript.parentElement,
|
|
631
|
-
scripts: ['/lightview.js', '/lightview-x.js'],
|
|
632
|
-
styles: ['https://cdn.jsdelivr.net/npm/daisyui@3.9.4/dist/full.min.css'],
|
|
633
|
-
type: 'module',
|
|
634
|
-
minHeight: 200
|
|
635
|
-
});
|
|
636
|
-
</script><code contenteditable="true">await import('/components/data-display/chart.js');
|
|
637
|
-
const { tags, $ } = Lightview;
|
|
638
|
-
const { Chart, div } = tags;
|
|
639
|
-
|
|
640
|
-
const data = [
|
|
641
|
-
{ label: 'A', value: 0.6 },
|
|
642
|
-
{ label: 'B', value: 0.8 },
|
|
643
|
-
{ label: 'C', value: 0.5 },
|
|
644
|
-
{ label: 'D', value: 0.9 }
|
|
645
|
-
];
|
|
646
|
-
|
|
647
|
-
const createChart = (spacing) => ({
|
|
648
|
-
tag: div,
|
|
649
|
-
attributes: { style: 'flex: 1; min-width: 250px;' },
|
|
650
|
-
children: [
|
|
651
|
-
{ tag: div, attributes: { style: 'font-weight: bold; margin-bottom: 0.5rem;' }, children: [`spacing: ${spacing}`] },
|
|
652
|
-
{
|
|
653
|
-
tag: Chart,
|
|
654
|
-
attributes: { type: 'column', labels: true, spacing, style: 'height: 180px;' },
|
|
655
|
-
children: [
|
|
656
|
-
{
|
|
657
|
-
tag: Chart.Body,
|
|
658
|
-
children: data.map(d => ({
|
|
659
|
-
tag: Chart.Row,
|
|
660
|
-
children: [
|
|
661
|
-
{ tag: Chart.Label, children: [d.label] },
|
|
662
|
-
{ tag: Chart.Data, attributes: { value: d.value } }
|
|
663
|
-
]
|
|
664
|
-
}))
|
|
665
|
-
}
|
|
666
|
-
]
|
|
667
|
-
}
|
|
668
|
-
]
|
|
669
|
-
});
|
|
670
|
-
|
|
671
|
-
const charts = {
|
|
672
|
-
tag: div,
|
|
673
|
-
attributes: { style: 'display: flex; gap: 2rem; flex-wrap: wrap;' },
|
|
674
|
-
children: [createChart(2), createChart(15)]
|
|
675
|
-
};
|
|
676
|
-
|
|
677
|
-
$('#example').content(charts);</code></pre>
|
|
678
|
-
</div>
|
|
679
|
-
|
|
680
|
-
<!-- Object DOM Syntax -->
|
|
681
|
-
<div id="spacing-column-syntax-object" style="display: none;">
|
|
682
|
-
<pre><script>
|
|
683
|
-
examplify(document.currentScript.nextElementSibling, {
|
|
684
|
-
at: document.currentScript.parentElement,
|
|
685
|
-
scripts: ['/lightview.js', '/lightview-x.js'],
|
|
686
|
-
styles: ['https://cdn.jsdelivr.net/npm/daisyui@3.9.4/dist/full.min.css'],
|
|
687
|
-
type: 'module',
|
|
688
|
-
minHeight: 200
|
|
689
|
-
});
|
|
690
|
-
</script><code contenteditable="true">await import('/components/data-display/chart.js');
|
|
691
|
-
const { $ } = Lightview;
|
|
692
|
-
|
|
693
|
-
const chartData = [
|
|
694
|
-
{ 'Chart.Row': { children: [{ 'Chart.Label': { children: ['A'] } }, { 'Chart.Data': { value: 0.6 } }] } },
|
|
695
|
-
{ 'Chart.Row': { children: [{ 'Chart.Label': { children: ['B'] } }, { 'Chart.Data': { value: 0.8 } }] } },
|
|
696
|
-
{ 'Chart.Row': { children: [{ 'Chart.Label': { children: ['C'] } }, { 'Chart.Data': { value: 0.5 } }] } },
|
|
697
|
-
{ 'Chart.Row': { children: [{ 'Chart.Label': { children: ['D'] } }, { 'Chart.Data': { value: 0.9 } }] } }
|
|
698
|
-
];
|
|
699
|
-
|
|
700
|
-
const charts = {
|
|
701
|
-
div: {
|
|
702
|
-
style: 'display: flex; gap: 2rem; flex-wrap: wrap;',
|
|
703
|
-
children: [
|
|
704
|
-
{
|
|
705
|
-
div: {
|
|
706
|
-
style: 'flex: 1; min-width: 250px;',
|
|
707
|
-
children: [
|
|
708
|
-
{ div: { style: 'font-weight: bold; margin-bottom: 0.5rem;', children: ['spacing: 2'] } },
|
|
709
|
-
{ Chart: { type: 'column', labels: true, spacing: 2, style: 'height: 180px;', children: [{ 'Chart.Body': { children: chartData } }] } }
|
|
710
|
-
]
|
|
711
|
-
}
|
|
712
|
-
},
|
|
713
|
-
{
|
|
714
|
-
div: {
|
|
715
|
-
style: 'flex: 1; min-width: 250px;',
|
|
716
|
-
children: [
|
|
717
|
-
{ div: { style: 'font-weight: bold; margin-bottom: 0.5rem;', children: ['spacing: 15'] } },
|
|
718
|
-
{ Chart: { type: 'column', labels: true, spacing: 15, style: 'height: 180px;', children: [{ 'Chart.Body': { children: chartData } }] } }
|
|
719
|
-
]
|
|
720
|
-
}
|
|
721
|
-
}
|
|
722
|
-
]
|
|
723
|
-
}
|
|
724
|
-
};
|
|
725
|
-
|
|
726
|
-
$('#example').content(charts);</code></pre>
|
|
727
|
-
</div>
|
|
728
|
-
</div>
|
|
729
|
-
</div>
|
|
730
545
|
|
|
731
546
|
</div>
|
|
732
547
|
</div>
|
|
@@ -538,7 +538,7 @@ const chart = Chart({
|
|
|
538
538
|
type: 'line',
|
|
539
539
|
labels: true,
|
|
540
540
|
primaryAxis: true,
|
|
541
|
-
|
|
541
|
+
secondaryAxesCount: 10,
|
|
542
542
|
style: 'width: 100%; max-width: 600px; height: 280px; margin: 0 auto;'
|
|
543
543
|
},
|
|
544
544
|
Chart.Body({},
|
|
@@ -579,7 +579,7 @@ const chart = {
|
|
|
579
579
|
type: 'line',
|
|
580
580
|
labels: true,
|
|
581
581
|
primaryAxis: true,
|
|
582
|
-
|
|
582
|
+
secondaryAxesCount: 10,
|
|
583
583
|
style: 'width: 100%; max-width: 600px; height: 280px; margin: 0 auto;'
|
|
584
584
|
},
|
|
585
585
|
children: [
|
|
@@ -617,7 +617,7 @@ const chart = {
|
|
|
617
617
|
type: 'line',
|
|
618
618
|
labels: true,
|
|
619
619
|
primaryAxis: true,
|
|
620
|
-
|
|
620
|
+
secondaryAxesCount: 10,
|
|
621
621
|
style: 'width: 100%; max-width: 600px; height: 280px; margin: 0 auto;',
|
|
622
622
|
children: [
|
|
623
623
|
{
|