lightview 2.0.8 → 2.1.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 +47 -1283
- package/build-bundles.mjs +109 -0
- package/cdom/helpers/array.js +70 -0
- package/cdom/helpers/compare.js +26 -0
- package/cdom/helpers/conditional.js +34 -0
- package/cdom/helpers/datetime.js +54 -0
- package/cdom/helpers/format.js +20 -0
- package/cdom/helpers/logic.js +24 -0
- package/cdom/helpers/lookup.js +25 -0
- package/cdom/helpers/math.js +34 -0
- package/cdom/helpers/network.js +41 -0
- package/cdom/helpers/state.js +77 -0
- package/cdom/helpers/stats.js +39 -0
- package/cdom/helpers/string.js +49 -0
- package/cdom/parser.js +602 -0
- package/components/actions/button.js +19 -6
- package/components/actions/dropdown.js +6 -6
- package/components/actions/modal.js +9 -9
- package/components/actions/swap.js +31 -8
- package/components/daisyui.js +1 -1
- package/components/data-display/accordion.js +6 -6
- package/components/data-display/alert.js +17 -7
- package/components/data-display/avatar.js +7 -7
- package/components/data-display/badge.js +14 -6
- package/components/data-display/card.js +7 -7
- package/components/data-display/carousel.js +4 -4
- package/components/data-display/chart.js +8 -8
- package/components/data-display/chat.js +7 -7
- package/components/data-display/collapse.js +5 -5
- package/components/data-display/countdown.js +3 -3
- package/components/data-display/diff.js +6 -6
- package/components/data-display/kbd.js +12 -6
- package/components/data-display/loading.js +14 -6
- package/components/data-display/progress.js +14 -6
- package/components/data-display/radial-progress.js +15 -6
- package/components/data-display/stats.js +9 -9
- package/components/data-display/table.js +9 -9
- package/components/data-display/timeline.js +8 -8
- package/components/data-display/toast.js +3 -3
- package/components/data-display/tooltip.js +20 -3
- package/components/data-input/checkbox.js +5 -5
- package/components/data-input/file-input.js +3 -3
- package/components/data-input/input.js +5 -5
- package/components/data-input/radio.js +9 -9
- package/components/data-input/range.js +3 -3
- package/components/data-input/rating.js +3 -3
- package/components/data-input/select.js +5 -5
- package/components/data-input/textarea.js +3 -3
- package/components/data-input/toggle.js +5 -5
- package/components/layout/divider.js +24 -4
- package/components/layout/drawer.js +7 -7
- package/components/layout/footer.js +5 -5
- package/components/layout/hero.js +5 -5
- package/components/layout/indicator.js +18 -4
- package/components/layout/join.js +4 -4
- package/components/layout/navbar.js +6 -6
- package/components/navigation/breadcrumbs.js +4 -4
- package/components/navigation/dock.js +5 -5
- package/components/navigation/menu.js +6 -6
- package/components/navigation/pagination.js +3 -3
- package/components/navigation/steps.js +4 -4
- package/components/navigation/tabs.js +296 -21
- package/components/theme/theme-switch.js +30 -30
- package/docs/about.html +141 -7
- package/docs/api/computed.html +1 -6
- package/docs/api/effects.html +1 -7
- package/docs/api/elements.html +130 -58
- package/docs/api/enhance.html +1 -6
- package/docs/api/hypermedia.html +182 -23
- package/docs/api/index.html +11 -12
- package/docs/api/nav.html +35 -4
- package/docs/api/signals.html +1 -6
- package/docs/api/state.html +1 -6
- package/docs/assets/js/examplify-sandbox.html +2 -2
- package/docs/assets/js/examplify.js +15 -15
- package/docs/cdom-nav.html +29 -0
- package/docs/cdom.html +362 -0
- package/docs/components/accordion.html +4 -4
- package/docs/components/alert.html +12 -12
- package/docs/components/avatar.html +4 -4
- package/docs/components/badge.html +59 -4
- package/docs/components/breadcrumbs.html +3 -3
- package/docs/components/button.html +83 -97
- package/docs/components/card.html +4 -4
- package/docs/components/carousel.html +3 -3
- package/docs/components/chart-area.html +6 -6
- package/docs/components/chart-bar.html +6 -6
- package/docs/components/chart-column.html +6 -6
- package/docs/components/chart-line.html +6 -6
- package/docs/components/chart-pie.html +6 -6
- package/docs/components/chart.html +2 -2
- package/docs/components/chat.html +4 -4
- package/docs/components/checkbox.html +4 -4
- package/docs/components/collapse.html +4 -4
- package/docs/components/component-nav.html +1 -1
- package/docs/components/countdown.html +4 -4
- package/docs/components/diff.html +3 -3
- package/docs/components/divider.html +68 -24
- package/docs/components/dock.html +3 -3
- package/docs/components/drawer.html +4 -4
- package/docs/components/dropdown.html +4 -4
- package/docs/components/file-input.html +4 -4
- package/docs/components/footer.html +3 -3
- package/docs/components/gallery.html +2 -2
- package/docs/components/hero.html +3 -3
- package/docs/components/index.css +5 -3
- package/docs/components/index.html +4 -4
- package/docs/components/indicator.html +88 -34
- package/docs/components/input.html +4 -4
- package/docs/components/join.html +3 -3
- package/docs/components/kbd.html +67 -28
- package/docs/components/loading.html +59 -43
- package/docs/components/menu.html +4 -4
- package/docs/components/modal.html +4 -4
- package/docs/components/navbar.html +3 -3
- package/docs/components/pagination.html +3 -3
- package/docs/components/progress.html +48 -7
- package/docs/components/radial-progress.html +35 -15
- package/docs/components/radio.html +4 -4
- package/docs/components/range.html +4 -4
- package/docs/components/rating.html +4 -4
- package/docs/components/select.html +4 -4
- package/docs/components/sidebar-setup.js +1 -1
- package/docs/components/spinner.html +4 -4
- package/docs/components/stats.html +4 -4
- package/docs/components/steps.html +3 -3
- package/docs/components/swap.html +187 -104
- package/docs/components/switch.html +4 -4
- package/docs/components/table.html +4 -4
- package/docs/components/tabs.html +147 -279
- package/docs/components/text-input.html +4 -4
- package/docs/components/textarea.html +4 -4
- package/docs/components/timeline.html +4 -4
- package/docs/components/toast.html +4 -4
- package/docs/components/toggle.html +4 -4
- package/docs/components/tooltip.html +75 -35
- package/docs/examples/getting-started-example.html +1 -1
- package/docs/examples/index.html +1 -2
- package/docs/getting-started/index.html +112 -19
- package/docs/index.html +1 -6
- package/docs/router-nav.html +13 -0
- package/docs/router.html +60 -17
- package/docs/styles/index.html +2 -7
- package/docs/syntax-nav.html +10 -0
- package/docs/syntax.html +146 -0
- package/functions/_middleware.js +17 -10
- package/functions/processServerScripts.js +127 -0
- package/index.html +8 -8
- package/lightview-all.js +1 -0
- package/lightview-cdom.js +1 -0
- package/lightview-router.js +71 -22
- package/lightview-x.js +1 -1247
- package/lightview.js +1 -760
- package/lightview.js.bak +1 -0
- package/package.json +37 -26
- package/scripts/analysis/README.md +2 -0
- package/scripts/analysis/analyze.js +266 -0
- package/scripts/analysis/latest_metrics.md +185 -0
- package/src/lightview-all.js +10 -0
- package/src/lightview-cdom.js +305 -0
- package/src/lightview-x.js +1581 -0
- package/src/lightview.js +694 -0
- package/src/reactivity/signal.js +133 -0
- package/src/reactivity/state.js +217 -0
- package/test-text-tag.js +6 -0
- package/tests/cdom/fixtures/helpers.cdomc +62 -0
- package/tests/cdom/fixtures/user.cdom +14 -0
- package/tests/cdom/fixtures/user.cdomc +12 -0
- package/tests/cdom/fixtures/user.odom +18 -0
- package/tests/cdom/fixtures/user.vdom +11 -0
- package/tests/cdom/helpers.test.js +121 -0
- package/tests/cdom/loader.test.js +125 -0
- package/tests/cdom/parser.test.js +108 -0
- package/tests/cdom/reactivity.test.js +186 -0
- package/tests/text-tag.test.js +77 -0
- package/vite.config.mjs +52 -0
- package/wrangler.toml +6 -0
- package/components/data-display/skeleton.js +0 -66
- package/docs/components/skeleton.html +0 -447
- package/docs/playground.html +0 -416
|
@@ -15,8 +15,8 @@ import '../daisyui.js';
|
|
|
15
15
|
* @param {boolean} props.useShadow - Render in Shadow DOM with isolated DaisyUI styles
|
|
16
16
|
*/
|
|
17
17
|
const Modal = (props = {}, ...children) => {
|
|
18
|
-
const { tags } =
|
|
19
|
-
const LVX =
|
|
18
|
+
const { tags } = globalThis.Lightview || {};
|
|
19
|
+
const LVX = globalThis.LightviewX || {};
|
|
20
20
|
|
|
21
21
|
if (!tags) return null;
|
|
22
22
|
|
|
@@ -86,7 +86,7 @@ const Modal = (props = {}, ...children) => {
|
|
|
86
86
|
* Modal Box - the content container
|
|
87
87
|
*/
|
|
88
88
|
Modal.Box = (props = {}, ...children) => {
|
|
89
|
-
const { tags } =
|
|
89
|
+
const { tags } = globalThis.Lightview || {};
|
|
90
90
|
if (!tags) return null;
|
|
91
91
|
|
|
92
92
|
const { class: className = '', ...rest } = props;
|
|
@@ -101,7 +101,7 @@ Modal.Box = (props = {}, ...children) => {
|
|
|
101
101
|
* Modal Action - container for action buttons
|
|
102
102
|
*/
|
|
103
103
|
Modal.Action = (props = {}, ...children) => {
|
|
104
|
-
const { tags } =
|
|
104
|
+
const { tags } = globalThis.Lightview || {};
|
|
105
105
|
if (!tags) return null;
|
|
106
106
|
|
|
107
107
|
const { class: className = '', ...rest } = props;
|
|
@@ -116,7 +116,7 @@ Modal.Action = (props = {}, ...children) => {
|
|
|
116
116
|
* Modal Backdrop - click to close
|
|
117
117
|
*/
|
|
118
118
|
Modal.Backdrop = (props = {}) => {
|
|
119
|
-
const { tags } =
|
|
119
|
+
const { tags } = globalThis.Lightview || {};
|
|
120
120
|
if (!tags) return null;
|
|
121
121
|
|
|
122
122
|
return tags.form({ method: 'dialog', class: 'modal-backdrop' },
|
|
@@ -138,9 +138,9 @@ Modal.close = (id) => {
|
|
|
138
138
|
document.getElementById(id)?.close?.();
|
|
139
139
|
};
|
|
140
140
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
141
|
+
globalThis.Lightview.tags.Modal = Modal;
|
|
142
|
+
globalThis.Lightview.tags['Modal.Box'] = Modal.Box;
|
|
143
|
+
globalThis.Lightview.tags['Modal.Action'] = Modal.Action;
|
|
144
|
+
globalThis.Lightview.tags['Modal.Backdrop'] = Modal.Backdrop;
|
|
145
145
|
|
|
146
146
|
export default Modal;
|
|
@@ -13,8 +13,8 @@ import '../daisyui.js';
|
|
|
13
13
|
* @param {boolean} props.useShadow - Render in Shadow DOM with isolated DaisyUI styles
|
|
14
14
|
*/
|
|
15
15
|
const Swap = (props = {}, ...children) => {
|
|
16
|
-
const { tags, signal } =
|
|
17
|
-
const LVX =
|
|
16
|
+
const { tags, signal } = globalThis.Lightview || {};
|
|
17
|
+
const LVX = globalThis.LightviewX || {};
|
|
18
18
|
|
|
19
19
|
if (!tags) return null;
|
|
20
20
|
|
|
@@ -34,8 +34,9 @@ const Swap = (props = {}, ...children) => {
|
|
|
34
34
|
else if (effect === 'flip') classes.push('swap-flip');
|
|
35
35
|
if (className) classes.push(className);
|
|
36
36
|
|
|
37
|
-
// Handle reactive
|
|
38
|
-
const
|
|
37
|
+
// Handle internal state for non-reactive/uncontrolled usage
|
|
38
|
+
const internalActive = signal(active);
|
|
39
|
+
const isActive = typeof active === 'function' ? active : () => internalActive.value;
|
|
39
40
|
|
|
40
41
|
const swapEl = label({
|
|
41
42
|
class: () => {
|
|
@@ -49,7 +50,11 @@ const Swap = (props = {}, ...children) => {
|
|
|
49
50
|
type: 'checkbox',
|
|
50
51
|
checked: isActive,
|
|
51
52
|
onchange: (e) => {
|
|
52
|
-
|
|
53
|
+
const checked = e.target.checked;
|
|
54
|
+
if (typeof active !== 'function') {
|
|
55
|
+
internalActive.value = checked;
|
|
56
|
+
}
|
|
57
|
+
if (onChange) onChange(checked);
|
|
53
58
|
}
|
|
54
59
|
}),
|
|
55
60
|
...children
|
|
@@ -84,7 +89,7 @@ const Swap = (props = {}, ...children) => {
|
|
|
84
89
|
* Swap On - visible when active
|
|
85
90
|
*/
|
|
86
91
|
Swap.On = (props = {}, ...children) => {
|
|
87
|
-
const { tags } =
|
|
92
|
+
const { tags } = globalThis.Lightview || {};
|
|
88
93
|
if (!tags) return null;
|
|
89
94
|
|
|
90
95
|
const { class: className = '', ...rest } = props;
|
|
@@ -99,7 +104,7 @@ Swap.On = (props = {}, ...children) => {
|
|
|
99
104
|
* Swap Off - visible when inactive
|
|
100
105
|
*/
|
|
101
106
|
Swap.Off = (props = {}, ...children) => {
|
|
102
|
-
const { tags } =
|
|
107
|
+
const { tags } = globalThis.Lightview || {};
|
|
103
108
|
if (!tags) return null;
|
|
104
109
|
|
|
105
110
|
const { class: className = '', ...rest } = props;
|
|
@@ -110,9 +115,27 @@ Swap.Off = (props = {}, ...children) => {
|
|
|
110
115
|
}, ...children);
|
|
111
116
|
};
|
|
112
117
|
|
|
113
|
-
const tags =
|
|
118
|
+
const tags = globalThis.Lightview.tags;
|
|
114
119
|
tags.Swap = Swap;
|
|
115
120
|
tags['Swap.On'] = Swap.On;
|
|
116
121
|
tags['Swap.Off'] = Swap.Off;
|
|
117
122
|
|
|
123
|
+
// Register as Custom Element using customElementWrapper
|
|
124
|
+
if (globalThis.LightviewX && typeof customElements !== 'undefined') {
|
|
125
|
+
const SwapElement = globalThis.LightviewX.customElementWrapper(Swap, {
|
|
126
|
+
attributeMap: {
|
|
127
|
+
active: Boolean,
|
|
128
|
+
effect: String
|
|
129
|
+
},
|
|
130
|
+
childElements: {
|
|
131
|
+
'on': Swap.On,
|
|
132
|
+
'off': Swap.Off
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
if (!customElements.get('lv-swap')) {
|
|
137
|
+
customElements.define('lv-swap', SwapElement);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
118
141
|
export default Swap;
|
package/components/daisyui.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* This module ensures DaisyUI CSS is loaded and provides utilities for components
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
const DAISYUI_CDN = 'https://cdn.jsdelivr.net/npm/daisyui@
|
|
6
|
+
const DAISYUI_CDN = 'https://cdn.jsdelivr.net/npm/daisyui@5.5.14/daisyui.min.css';
|
|
7
7
|
const TAILWIND_CDN = 'https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4';
|
|
8
8
|
|
|
9
9
|
let daisyLoaded = false;
|
|
@@ -13,8 +13,8 @@ import '../daisyui.js';
|
|
|
13
13
|
* @param {boolean} props.useShadow - Render in Shadow DOM with isolated DaisyUI styles
|
|
14
14
|
*/
|
|
15
15
|
const Accordion = (props = {}, ...children) => {
|
|
16
|
-
const { tags } =
|
|
17
|
-
const LVX =
|
|
16
|
+
const { tags } = globalThis.Lightview || {};
|
|
17
|
+
const LVX = globalThis.LightviewX || {};
|
|
18
18
|
|
|
19
19
|
if (!tags) return null;
|
|
20
20
|
|
|
@@ -61,7 +61,7 @@ const Accordion = (props = {}, ...children) => {
|
|
|
61
61
|
* Accordion Item
|
|
62
62
|
*/
|
|
63
63
|
Accordion.Item = (props = {}, ...children) => {
|
|
64
|
-
const { tags } =
|
|
64
|
+
const { tags } = globalThis.Lightview || {};
|
|
65
65
|
if (!tags) return null;
|
|
66
66
|
|
|
67
67
|
const { div, input } = tags;
|
|
@@ -93,7 +93,7 @@ Accordion.Item = (props = {}, ...children) => {
|
|
|
93
93
|
* Accordion Title
|
|
94
94
|
*/
|
|
95
95
|
Accordion.Title = (props = {}, ...children) => {
|
|
96
|
-
const { tags } =
|
|
96
|
+
const { tags } = globalThis.Lightview || {};
|
|
97
97
|
if (!tags) return null;
|
|
98
98
|
|
|
99
99
|
const { class: className = '', ...rest } = props;
|
|
@@ -108,7 +108,7 @@ Accordion.Title = (props = {}, ...children) => {
|
|
|
108
108
|
* Accordion Content
|
|
109
109
|
*/
|
|
110
110
|
Accordion.Content = (props = {}, ...children) => {
|
|
111
|
-
const { tags } =
|
|
111
|
+
const { tags } = globalThis.Lightview || {};
|
|
112
112
|
if (!tags) return null;
|
|
113
113
|
|
|
114
114
|
const { class: className = '', ...rest } = props;
|
|
@@ -119,7 +119,7 @@ Accordion.Content = (props = {}, ...children) => {
|
|
|
119
119
|
}, ...children);
|
|
120
120
|
};
|
|
121
121
|
|
|
122
|
-
const tags =
|
|
122
|
+
const tags = globalThis.Lightview.tags;
|
|
123
123
|
tags.Accordion = Accordion;
|
|
124
124
|
tags['Accordion.Item'] = Accordion.Item;
|
|
125
125
|
tags['Accordion.Title'] = Accordion.Title;
|
|
@@ -15,8 +15,8 @@ import '../daisyui.js';
|
|
|
15
15
|
* @param {boolean} props.useShadow - Render in Shadow DOM with isolated DaisyUI styles
|
|
16
16
|
*/
|
|
17
17
|
const Alert = (props = {}, ...children) => {
|
|
18
|
-
const { tags } =
|
|
19
|
-
const LVX =
|
|
18
|
+
const { tags } = globalThis.Lightview || {};
|
|
19
|
+
const LVX = globalThis.LightviewX || {};
|
|
20
20
|
|
|
21
21
|
if (!tags) return null;
|
|
22
22
|
|
|
@@ -78,7 +78,7 @@ const Alert = (props = {}, ...children) => {
|
|
|
78
78
|
};
|
|
79
79
|
|
|
80
80
|
function getAlertIcon(type) {
|
|
81
|
-
const { tags } =
|
|
81
|
+
const { tags } = globalThis.Lightview || {};
|
|
82
82
|
if (!tags) return null;
|
|
83
83
|
|
|
84
84
|
const icons = {
|
|
@@ -99,11 +99,21 @@ function getAlertIcon(type) {
|
|
|
99
99
|
});
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
-
|
|
102
|
+
globalThis.Lightview.tags.Alert = Alert;
|
|
103
|
+
|
|
104
|
+
// Register as Custom Element using customElementWrapper
|
|
105
|
+
if (globalThis.LightviewX && typeof customElements !== 'undefined') {
|
|
106
|
+
const AlertElement = globalThis.LightviewX.customElementWrapper(Alert, {
|
|
107
|
+
attributeMap: {
|
|
108
|
+
color: String,
|
|
109
|
+
soft: Boolean,
|
|
110
|
+
dash: Boolean,
|
|
111
|
+
outline: Boolean,
|
|
112
|
+
icon: String
|
|
113
|
+
},
|
|
114
|
+
childElements: {} // No child components for Alert
|
|
115
|
+
});
|
|
103
116
|
|
|
104
|
-
// Register as Custom Element
|
|
105
|
-
if (window.LightviewX?.createCustomElement) {
|
|
106
|
-
const AlertElement = window.LightviewX.createCustomElement(Alert);
|
|
107
117
|
if (!customElements.get('lv-alert')) {
|
|
108
118
|
customElements.define('lv-alert', AlertElement);
|
|
109
119
|
}
|
|
@@ -20,8 +20,8 @@ import '../daisyui.js';
|
|
|
20
20
|
* @param {boolean} props.useShadow - Render in Shadow DOM with isolated DaisyUI styles
|
|
21
21
|
*/
|
|
22
22
|
const Avatar = (props = {}, ...children) => {
|
|
23
|
-
const { tags } =
|
|
24
|
-
const LVX =
|
|
23
|
+
const { tags } = globalThis.Lightview || {};
|
|
24
|
+
const LVX = globalThis.LightviewX || {};
|
|
25
25
|
|
|
26
26
|
if (!tags) return null;
|
|
27
27
|
|
|
@@ -142,7 +142,7 @@ const Avatar = (props = {}, ...children) => {
|
|
|
142
142
|
* Avatar Group
|
|
143
143
|
*/
|
|
144
144
|
Avatar.Group = (props = {}, ...children) => {
|
|
145
|
-
const { tags } =
|
|
145
|
+
const { tags } = globalThis.Lightview || {};
|
|
146
146
|
if (!tags) return null;
|
|
147
147
|
|
|
148
148
|
const { class: className = '', ...rest } = props;
|
|
@@ -153,17 +153,17 @@ Avatar.Group = (props = {}, ...children) => {
|
|
|
153
153
|
}, ...children);
|
|
154
154
|
};
|
|
155
155
|
|
|
156
|
-
const tags =
|
|
156
|
+
const tags = globalThis.Lightview.tags;
|
|
157
157
|
tags.Avatar = Avatar;
|
|
158
158
|
tags['Avatar.Group'] = Avatar.Group;
|
|
159
159
|
|
|
160
160
|
// Register as Custom Elements
|
|
161
|
-
if (
|
|
161
|
+
if (globalThis.LightviewX?.createCustomElement) {
|
|
162
162
|
if (!customElements.get('lv-avatar')) {
|
|
163
|
-
customElements.define('lv-avatar',
|
|
163
|
+
customElements.define('lv-avatar', globalThis.LightviewX.createCustomElement(Avatar));
|
|
164
164
|
}
|
|
165
165
|
if (!customElements.get('lv-avatar-group')) {
|
|
166
|
-
customElements.define('lv-avatar-group',
|
|
166
|
+
customElements.define('lv-avatar-group', globalThis.LightviewX.createCustomElement(Avatar.Group));
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
169
|
|
|
@@ -14,8 +14,8 @@ import '../daisyui.js';
|
|
|
14
14
|
* @param {boolean} props.useShadow - Render in Shadow DOM with isolated DaisyUI styles
|
|
15
15
|
*/
|
|
16
16
|
const Badge = (props = {}, ...children) => {
|
|
17
|
-
const { tags } =
|
|
18
|
-
const LVX =
|
|
17
|
+
const { tags } = globalThis.Lightview || {};
|
|
18
|
+
const LVX = globalThis.LightviewX || {};
|
|
19
19
|
|
|
20
20
|
if (!tags) return null;
|
|
21
21
|
|
|
@@ -69,11 +69,19 @@ const Badge = (props = {}, ...children) => {
|
|
|
69
69
|
return badgeEl;
|
|
70
70
|
};
|
|
71
71
|
|
|
72
|
-
|
|
72
|
+
globalThis.Lightview.tags.Badge = Badge;
|
|
73
|
+
|
|
74
|
+
// Register as Custom Element using customElementWrapper
|
|
75
|
+
if (globalThis.LightviewX && typeof customElements !== 'undefined') {
|
|
76
|
+
const BadgeElement = globalThis.LightviewX.customElementWrapper(Badge, {
|
|
77
|
+
attributeMap: {
|
|
78
|
+
color: String,
|
|
79
|
+
size: String,
|
|
80
|
+
variant: String
|
|
81
|
+
},
|
|
82
|
+
childElements: {} // No child components for Badge, uses slot
|
|
83
|
+
});
|
|
73
84
|
|
|
74
|
-
// Register as Custom Element
|
|
75
|
-
if (window.LightviewX?.createCustomElement) {
|
|
76
|
-
const BadgeElement = window.LightviewX.createCustomElement(Badge);
|
|
77
85
|
if (!customElements.get('lv-badge')) {
|
|
78
86
|
customElements.define('lv-badge', BadgeElement);
|
|
79
87
|
}
|
|
@@ -15,8 +15,8 @@ import '../daisyui.js';
|
|
|
15
15
|
* @param {boolean} props.useShadow - Render in Shadow DOM with isolated DaisyUI styles
|
|
16
16
|
*/
|
|
17
17
|
const Card = (props = {}, ...children) => {
|
|
18
|
-
const { tags } =
|
|
19
|
-
const LVX =
|
|
18
|
+
const { tags } = globalThis.Lightview || {};
|
|
19
|
+
const LVX = globalThis.LightviewX || {};
|
|
20
20
|
|
|
21
21
|
if (!tags) return null;
|
|
22
22
|
|
|
@@ -78,7 +78,7 @@ const Card = (props = {}, ...children) => {
|
|
|
78
78
|
* Card Body
|
|
79
79
|
*/
|
|
80
80
|
Card.Body = (props = {}, ...children) => {
|
|
81
|
-
const { tags } =
|
|
81
|
+
const { tags } = globalThis.Lightview || {};
|
|
82
82
|
if (!tags) return null;
|
|
83
83
|
|
|
84
84
|
const { class: className = '', ...rest } = props;
|
|
@@ -93,7 +93,7 @@ Card.Body = (props = {}, ...children) => {
|
|
|
93
93
|
* Card Title
|
|
94
94
|
*/
|
|
95
95
|
Card.Title = (props = {}, ...children) => {
|
|
96
|
-
const { tags } =
|
|
96
|
+
const { tags } = globalThis.Lightview || {};
|
|
97
97
|
if (!tags) return null;
|
|
98
98
|
|
|
99
99
|
const { class: className = '', ...rest } = props;
|
|
@@ -108,7 +108,7 @@ Card.Title = (props = {}, ...children) => {
|
|
|
108
108
|
* Card Actions
|
|
109
109
|
*/
|
|
110
110
|
Card.Actions = (props = {}, ...children) => {
|
|
111
|
-
const { tags } =
|
|
111
|
+
const { tags } = globalThis.Lightview || {};
|
|
112
112
|
if (!tags) return null;
|
|
113
113
|
|
|
114
114
|
const {
|
|
@@ -127,7 +127,7 @@ Card.Actions = (props = {}, ...children) => {
|
|
|
127
127
|
* Card Figure (for images)
|
|
128
128
|
*/
|
|
129
129
|
Card.Figure = (props = {}, ...children) => {
|
|
130
|
-
const { tags } =
|
|
130
|
+
const { tags } = globalThis.Lightview || {};
|
|
131
131
|
if (!tags) return null;
|
|
132
132
|
|
|
133
133
|
const { src, alt = '', class: className = '', ...rest } = props;
|
|
@@ -141,7 +141,7 @@ Card.Figure = (props = {}, ...children) => {
|
|
|
141
141
|
return tags.figure({ class: className, ...rest }, ...children);
|
|
142
142
|
};
|
|
143
143
|
|
|
144
|
-
const tags =
|
|
144
|
+
const tags = globalThis.Lightview.tags;
|
|
145
145
|
tags.Card = Card;
|
|
146
146
|
tags['Card.Body'] = Card.Body;
|
|
147
147
|
tags['Card.Title'] = Card.Title;
|
|
@@ -14,8 +14,8 @@ import '../daisyui.js';
|
|
|
14
14
|
* @param {boolean} props.useShadow - Render in Shadow DOM with isolated DaisyUI styles
|
|
15
15
|
*/
|
|
16
16
|
const Carousel = (props = {}, ...children) => {
|
|
17
|
-
const { tags } =
|
|
18
|
-
const LVX =
|
|
17
|
+
const { tags } = globalThis.Lightview || {};
|
|
18
|
+
const LVX = globalThis.LightviewX || {};
|
|
19
19
|
|
|
20
20
|
if (!tags) return null;
|
|
21
21
|
|
|
@@ -70,7 +70,7 @@ const Carousel = (props = {}, ...children) => {
|
|
|
70
70
|
* Carousel Item
|
|
71
71
|
*/
|
|
72
72
|
Carousel.Item = (props = {}, ...children) => {
|
|
73
|
-
const { tags } =
|
|
73
|
+
const { tags } = globalThis.Lightview || {};
|
|
74
74
|
if (!tags) return null;
|
|
75
75
|
|
|
76
76
|
const { id, src, alt = '', class: className = '', ...rest } = props;
|
|
@@ -87,7 +87,7 @@ Carousel.Item = (props = {}, ...children) => {
|
|
|
87
87
|
return tags.div({ id, class: classes.join(' '), ...rest }, ...children);
|
|
88
88
|
};
|
|
89
89
|
|
|
90
|
-
const tags =
|
|
90
|
+
const tags = globalThis.Lightview.tags;
|
|
91
91
|
tags.Carousel = Carousel;
|
|
92
92
|
tags['Carousel.Item'] = Carousel.Item;
|
|
93
93
|
|
|
@@ -35,8 +35,8 @@ if (typeof document !== 'undefined') {
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
const Chart = (props = {}, ...children) => {
|
|
38
|
-
const { tags } =
|
|
39
|
-
const LVX =
|
|
38
|
+
const { tags } = globalThis.Lightview || {};
|
|
39
|
+
const LVX = globalThis.LightviewX || {};
|
|
40
40
|
|
|
41
41
|
if (!tags) return null;
|
|
42
42
|
|
|
@@ -115,7 +115,7 @@ const Chart = (props = {}, ...children) => {
|
|
|
115
115
|
* Chart Head (thead)
|
|
116
116
|
*/
|
|
117
117
|
Chart.Head = (props = {}, ...children) => {
|
|
118
|
-
const { tags } =
|
|
118
|
+
const { tags } = globalThis.Lightview || {};
|
|
119
119
|
if (!tags) return null;
|
|
120
120
|
return tags.thead(props, ...children);
|
|
121
121
|
};
|
|
@@ -124,7 +124,7 @@ Chart.Head = (props = {}, ...children) => {
|
|
|
124
124
|
* Chart Body (tbody)
|
|
125
125
|
*/
|
|
126
126
|
Chart.Body = (props = {}, ...children) => {
|
|
127
|
-
const { tags } =
|
|
127
|
+
const { tags } = globalThis.Lightview || {};
|
|
128
128
|
if (!tags) return null;
|
|
129
129
|
return tags.tbody(props, ...children);
|
|
130
130
|
};
|
|
@@ -133,7 +133,7 @@ Chart.Body = (props = {}, ...children) => {
|
|
|
133
133
|
* Chart Row (tr)
|
|
134
134
|
*/
|
|
135
135
|
Chart.Row = (props = {}, ...children) => {
|
|
136
|
-
const { tags } =
|
|
136
|
+
const { tags } = globalThis.Lightview || {};
|
|
137
137
|
if (!tags) return null;
|
|
138
138
|
return tags.tr(props, ...children);
|
|
139
139
|
};
|
|
@@ -142,7 +142,7 @@ Chart.Row = (props = {}, ...children) => {
|
|
|
142
142
|
* Chart Label (th scope="row")
|
|
143
143
|
*/
|
|
144
144
|
Chart.Label = (props = {}, ...children) => {
|
|
145
|
-
const { tags } =
|
|
145
|
+
const { tags } = globalThis.Lightview || {};
|
|
146
146
|
if (!tags) return null;
|
|
147
147
|
|
|
148
148
|
const { scope = 'row', ...rest } = props;
|
|
@@ -159,7 +159,7 @@ Chart.Label = (props = {}, ...children) => {
|
|
|
159
159
|
* @param {string} props.tooltip - Tooltip text
|
|
160
160
|
*/
|
|
161
161
|
Chart.Data = (props = {}, ...children) => {
|
|
162
|
-
const { tags } =
|
|
162
|
+
const { tags } = globalThis.Lightview || {};
|
|
163
163
|
if (!tags) return null;
|
|
164
164
|
|
|
165
165
|
const {
|
|
@@ -208,7 +208,7 @@ Chart.Data = (props = {}, ...children) => {
|
|
|
208
208
|
}, ...content);
|
|
209
209
|
};
|
|
210
210
|
|
|
211
|
-
const tags =
|
|
211
|
+
const tags = globalThis.Lightview.tags;
|
|
212
212
|
|
|
213
213
|
tags.Chart = Chart;
|
|
214
214
|
tags['Chart.Head'] = Chart.Head;
|
|
@@ -12,8 +12,8 @@ import '../daisyui.js';
|
|
|
12
12
|
* @param {boolean} props.useShadow - Render in Shadow DOM with isolated DaisyUI styles
|
|
13
13
|
*/
|
|
14
14
|
const Chat = (props = {}, ...children) => {
|
|
15
|
-
const { tags } =
|
|
16
|
-
const LVX =
|
|
15
|
+
const { tags } = globalThis.Lightview || {};
|
|
16
|
+
const LVX = globalThis.LightviewX || {};
|
|
17
17
|
|
|
18
18
|
if (!tags) return null;
|
|
19
19
|
|
|
@@ -60,7 +60,7 @@ const Chat = (props = {}, ...children) => {
|
|
|
60
60
|
* Chat Image
|
|
61
61
|
*/
|
|
62
62
|
Chat.Image = (props = {}) => {
|
|
63
|
-
const { tags } =
|
|
63
|
+
const { tags } = globalThis.Lightview || {};
|
|
64
64
|
if (!tags) return null;
|
|
65
65
|
|
|
66
66
|
const { src, alt = 'Avatar', class: className = '', ...rest } = props;
|
|
@@ -76,7 +76,7 @@ Chat.Image = (props = {}) => {
|
|
|
76
76
|
* Chat Header
|
|
77
77
|
*/
|
|
78
78
|
Chat.Header = (props = {}, ...children) => {
|
|
79
|
-
const { tags } =
|
|
79
|
+
const { tags } = globalThis.Lightview || {};
|
|
80
80
|
if (!tags) return null;
|
|
81
81
|
|
|
82
82
|
const { class: className = '', ...rest } = props;
|
|
@@ -91,7 +91,7 @@ Chat.Header = (props = {}, ...children) => {
|
|
|
91
91
|
* Chat Bubble
|
|
92
92
|
*/
|
|
93
93
|
Chat.Bubble = (props = {}, ...children) => {
|
|
94
|
-
const { tags } =
|
|
94
|
+
const { tags } = globalThis.Lightview || {};
|
|
95
95
|
if (!tags) return null;
|
|
96
96
|
|
|
97
97
|
const { color, class: className = '', ...rest } = props;
|
|
@@ -107,7 +107,7 @@ Chat.Bubble = (props = {}, ...children) => {
|
|
|
107
107
|
* Chat Footer
|
|
108
108
|
*/
|
|
109
109
|
Chat.Footer = (props = {}, ...children) => {
|
|
110
|
-
const { tags } =
|
|
110
|
+
const { tags } = globalThis.Lightview || {};
|
|
111
111
|
if (!tags) return null;
|
|
112
112
|
|
|
113
113
|
const { class: className = '', ...rest } = props;
|
|
@@ -118,7 +118,7 @@ Chat.Footer = (props = {}, ...children) => {
|
|
|
118
118
|
}, ...children);
|
|
119
119
|
};
|
|
120
120
|
|
|
121
|
-
const tags =
|
|
121
|
+
const tags = globalThis.Lightview.tags;
|
|
122
122
|
tags.Chat = Chat;
|
|
123
123
|
tags['Chat.Image'] = Chat.Image;
|
|
124
124
|
tags['Chat.Header'] = Chat.Header;
|
|
@@ -14,8 +14,8 @@ import '../daisyui.js';
|
|
|
14
14
|
* @param {boolean} props.useShadow - Render in Shadow DOM with isolated DaisyUI styles
|
|
15
15
|
*/
|
|
16
16
|
const Collapse = (props = {}, ...children) => {
|
|
17
|
-
const { tags } =
|
|
18
|
-
const LVX =
|
|
17
|
+
const { tags } = globalThis.Lightview || {};
|
|
18
|
+
const LVX = globalThis.LightviewX || {};
|
|
19
19
|
|
|
20
20
|
if (!tags) return null;
|
|
21
21
|
|
|
@@ -69,7 +69,7 @@ const Collapse = (props = {}, ...children) => {
|
|
|
69
69
|
* Collapse Title
|
|
70
70
|
*/
|
|
71
71
|
Collapse.Title = (props = {}, ...children) => {
|
|
72
|
-
const { tags } =
|
|
72
|
+
const { tags } = globalThis.Lightview || {};
|
|
73
73
|
if (!tags) return null;
|
|
74
74
|
|
|
75
75
|
const { class: className = '', ...rest } = props;
|
|
@@ -84,7 +84,7 @@ Collapse.Title = (props = {}, ...children) => {
|
|
|
84
84
|
* Collapse Content
|
|
85
85
|
*/
|
|
86
86
|
Collapse.Content = (props = {}, ...children) => {
|
|
87
|
-
const { tags } =
|
|
87
|
+
const { tags } = globalThis.Lightview || {};
|
|
88
88
|
if (!tags) return null;
|
|
89
89
|
|
|
90
90
|
const { class: className = '', ...rest } = props;
|
|
@@ -95,7 +95,7 @@ Collapse.Content = (props = {}, ...children) => {
|
|
|
95
95
|
}, ...children);
|
|
96
96
|
};
|
|
97
97
|
|
|
98
|
-
const tags =
|
|
98
|
+
const tags = globalThis.Lightview.tags;
|
|
99
99
|
tags.Collapse = Collapse;
|
|
100
100
|
tags['Collapse.Title'] = Collapse.Title;
|
|
101
101
|
tags['Collapse.Content'] = Collapse.Content;
|
|
@@ -12,8 +12,8 @@ import '../daisyui.js';
|
|
|
12
12
|
* @param {boolean} props.useShadow - Render in Shadow DOM with isolated DaisyUI styles
|
|
13
13
|
*/
|
|
14
14
|
const Countdown = (props = {}, ...children) => {
|
|
15
|
-
const { tags } =
|
|
16
|
-
const LVX =
|
|
15
|
+
const { tags } = globalThis.Lightview || {};
|
|
16
|
+
const LVX = globalThis.LightviewX || {};
|
|
17
17
|
|
|
18
18
|
if (!tags) return null;
|
|
19
19
|
|
|
@@ -64,6 +64,6 @@ const Countdown = (props = {}, ...children) => {
|
|
|
64
64
|
return countdownEl;
|
|
65
65
|
};
|
|
66
66
|
|
|
67
|
-
|
|
67
|
+
globalThis.Lightview.tags.Countdown = Countdown;
|
|
68
68
|
|
|
69
69
|
export default Countdown;
|
|
@@ -12,8 +12,8 @@ import '../daisyui.js';
|
|
|
12
12
|
* @param {boolean} props.useShadow - Render in Shadow DOM with isolated DaisyUI styles
|
|
13
13
|
*/
|
|
14
14
|
const Diff = (props = {}, ...children) => {
|
|
15
|
-
const { tags } =
|
|
16
|
-
const LVX =
|
|
15
|
+
const { tags } = globalThis.Lightview || {};
|
|
16
|
+
const LVX = globalThis.LightviewX || {};
|
|
17
17
|
|
|
18
18
|
if (!tags) return null;
|
|
19
19
|
|
|
@@ -60,7 +60,7 @@ const Diff = (props = {}, ...children) => {
|
|
|
60
60
|
* Diff Item 1
|
|
61
61
|
*/
|
|
62
62
|
Diff.Item1 = (props = {}, ...children) => {
|
|
63
|
-
const { tags } =
|
|
63
|
+
const { tags } = globalThis.Lightview || {};
|
|
64
64
|
if (!tags) return null;
|
|
65
65
|
|
|
66
66
|
const { src, alt = '', class: className = '', ...rest } = props;
|
|
@@ -78,7 +78,7 @@ Diff.Item1 = (props = {}, ...children) => {
|
|
|
78
78
|
* Diff Item 2
|
|
79
79
|
*/
|
|
80
80
|
Diff.Item2 = (props = {}, ...children) => {
|
|
81
|
-
const { tags } =
|
|
81
|
+
const { tags } = globalThis.Lightview || {};
|
|
82
82
|
if (!tags) return null;
|
|
83
83
|
|
|
84
84
|
const { src, alt = '', class: className = '', ...rest } = props;
|
|
@@ -96,13 +96,13 @@ Diff.Item2 = (props = {}, ...children) => {
|
|
|
96
96
|
* Diff Resizer
|
|
97
97
|
*/
|
|
98
98
|
Diff.Resizer = (props = {}) => {
|
|
99
|
-
const { tags } =
|
|
99
|
+
const { tags } = globalThis.Lightview || {};
|
|
100
100
|
if (!tags) return null;
|
|
101
101
|
|
|
102
102
|
return tags.div({ class: 'diff-resizer', ...props });
|
|
103
103
|
};
|
|
104
104
|
|
|
105
|
-
const tags =
|
|
105
|
+
const tags = globalThis.Lightview.tags;
|
|
106
106
|
tags.Diff = Diff;
|
|
107
107
|
tags['Diff.Item1'] = Diff.Item1;
|
|
108
108
|
tags['Diff.Item2'] = Diff.Item2;
|
|
@@ -12,8 +12,8 @@ import '../daisyui.js';
|
|
|
12
12
|
* @param {boolean} props.useShadow - Render in Shadow DOM with isolated DaisyUI styles
|
|
13
13
|
*/
|
|
14
14
|
const Kbd = (props = {}, ...children) => {
|
|
15
|
-
const { tags } =
|
|
16
|
-
const LVX =
|
|
15
|
+
const { tags } = globalThis.Lightview || {};
|
|
16
|
+
const LVX = globalThis.LightviewX || {};
|
|
17
17
|
|
|
18
18
|
if (!tags) return null;
|
|
19
19
|
|
|
@@ -52,11 +52,17 @@ const Kbd = (props = {}, ...children) => {
|
|
|
52
52
|
return kbdEl;
|
|
53
53
|
};
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
globalThis.Lightview.tags.Kbd = Kbd;
|
|
56
|
+
|
|
57
|
+
// Register as Custom Element using customElementWrapper
|
|
58
|
+
if (globalThis.LightviewX && typeof customElements !== 'undefined') {
|
|
59
|
+
const KbdElement = globalThis.LightviewX.customElementWrapper(Kbd, {
|
|
60
|
+
attributeMap: {
|
|
61
|
+
size: String
|
|
62
|
+
},
|
|
63
|
+
childElements: {} // No child components, uses slot for key text
|
|
64
|
+
});
|
|
56
65
|
|
|
57
|
-
// Register as Custom Element
|
|
58
|
-
if (window.LightviewX?.createCustomElement) {
|
|
59
|
-
const KbdElement = window.LightviewX.createCustomElement(Kbd);
|
|
60
66
|
if (!customElements.get('lv-kbd')) {
|
|
61
67
|
customElements.define('lv-kbd', KbdElement);
|
|
62
68
|
}
|