@threadlabs/looma 0.33.1 → 0.34.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/components/shared/overlay.js +8 -2
- package/components/shared/surface-material.js +21 -0
- package/components/ui-button/ui-button.html +63 -47
- package/components/ui-card/ui-card.html +44 -2
- package/components/ui-curve-editor/curve.js +10 -0
- package/components/ui-curve-editor/ui-curve-editor.html +181 -0
- package/components/ui-curve-editor/ui-curve-editor.js +51 -0
- package/components/ui-dialog/ui-dialog.html +62 -1
- package/components/ui-dialog/ui-dialog.js +9 -1
- package/components/ui-icon-button/ui-icon-button.html +75 -23
- package/components/ui-menu/ui-menu.html +60 -0
- package/components/ui-menu/ui-menu.js +1 -1
- package/components/ui-number-input/arithmetic.js +47 -0
- package/components/ui-number-input/ui-number-input.html +62 -0
- package/components/ui-number-input/ui-number-input.js +44 -0
- package/components/ui-popover/ui-popover.html +64 -1
- package/components/ui-popover/ui-popover.js +1 -1
- package/components/ui-slider/ui-slider.html +84 -0
- package/components/ui-slider/ui-slider.js +29 -0
- package/components/ui-tabs/ui-tabs.html +6 -1
- package/components/ui-text/ui-text.html +31 -6
- package/components/ui-tooltip/ui-tooltip.html +60 -0
- package/components/ui-tooltip/ui-tooltip.js +1 -1
- package/dist/index.js +46 -43
- package/docs/README.md +34 -4
- package/docs/card.html +16 -2
- package/docs/card.js +17 -2
- package/docs/catalog.json +1154 -144
- package/docs/customizer-render.mjs +35 -9
- package/docs/customizer.js +83 -20
- package/docs/documentation.css +9 -1
- package/docs/index.d.ts +4 -2
- package/docs/index.mjs +1 -1
- package/docs/preview.js +2 -0
- package/docs/render.mjs +15 -6
- package/docs/site.mjs +50 -9
- package/docs/theme-session.mjs +51 -0
- package/docs/theme.mjs +134 -15
- package/docs/value-editors.mjs +33 -0
- package/package.json +2 -2
- package/styles/ui-button.css +45 -45
- package/styles/ui-card.css +47 -0
- package/styles/ui-curve-editor.css +109 -0
- package/styles/ui-dialog.css +132 -0
- package/styles/ui-icon-button.css +63 -20
- package/styles/ui-menu.css +72 -0
- package/styles/ui-number-input.css +34 -0
- package/styles/ui-popover.css +74 -0
- package/styles/ui-slider.css +53 -0
- package/styles/ui-tabs.css +6 -1
- package/styles/ui-text.css +23 -1
- package/styles/ui-tooltip.css +72 -0
- package/theme-system.css +26 -10
- package/tokens.css +8 -2
- package/vanilla/UiButton.d.ts +1 -0
- package/vanilla/UiButton.js +195 -130
- package/vanilla/UiCard.d.ts +1 -1
- package/vanilla/UiCard.js +1 -1
- package/vanilla/UiCurveEditor.d.ts +28 -0
- package/vanilla/UiCurveEditor.js +134 -0
- package/vanilla/UiIconButton.d.ts +2 -1
- package/vanilla/UiIconButton.js +58 -31
- package/vanilla/UiNumberInput.d.ts +33 -0
- package/vanilla/UiNumberInput.js +79 -0
- package/vanilla/UiSlider.d.ts +33 -0
- package/vanilla/UiSlider.js +125 -0
- package/vanilla/UiText.d.ts +2 -2
- package/vanilla/UiText.js +45 -11
- package/vanilla/index.js +3 -0
- package/vue/UiButton.d.ts +6 -0
- package/vue/UiButton.vue +155 -56
- package/vue/UiCard.d.ts +2 -2
- package/vue/UiCard.vue +55 -5
- package/vue/UiCurveEditor.d.ts +53 -0
- package/vue/UiCurveEditor.js +2 -0
- package/vue/UiCurveEditor.vue +427 -0
- package/vue/UiDialog.vue +177 -1
- package/vue/UiIconButton.d.ts +8 -2
- package/vue/UiIconButton.vue +164 -34
- package/vue/UiMenu.vue +89 -0
- package/vue/UiNumberInput.d.ts +83 -0
- package/vue/UiNumberInput.js +2 -0
- package/vue/UiNumberInput.vue +370 -0
- package/vue/UiPopover.vue +92 -1
- package/vue/UiSlider.d.ts +83 -0
- package/vue/UiSlider.js +2 -0
- package/vue/UiSlider.vue +412 -0
- package/vue/UiTabs.vue +6 -1
- package/vue/UiText.d.ts +7 -5
- package/vue/UiText.vue +104 -22
- package/vue/UiTooltip.vue +89 -0
- package/vue/chunks/UiActionBar.js +1 -1
- package/vue/chunks/UiAffordanceScope.js +2 -2
- package/vue/chunks/UiAvatar.js +2 -2
- package/vue/chunks/UiAvatarGroup.js +2 -2
- package/vue/chunks/UiBadge.js +2 -2
- package/vue/chunks/UiBreadcrumbItem.js +2 -2
- package/vue/chunks/UiBreadcrumbs.js +2 -2
- package/vue/chunks/UiButton.js +94 -11
- package/vue/chunks/UiCallout.js +2 -2
- package/vue/chunks/UiCard.js +6 -5
- package/vue/chunks/UiCheckbox.js +2 -2
- package/vue/chunks/UiCluster.js +2 -2
- package/vue/chunks/UiColorPicker.js +2 -2
- package/vue/chunks/UiCombobox.js +2 -2
- package/vue/chunks/UiContainer.js +2 -2
- package/vue/chunks/UiContextMenu.js +2 -2
- package/vue/chunks/UiCover.js +2 -2
- package/vue/chunks/UiCurveEditor.js +413 -0
- package/vue/chunks/UiDescriptionItem.js +2 -2
- package/vue/chunks/UiDescriptionList.js +2 -2
- package/vue/chunks/UiDialog.js +4 -4
- package/vue/chunks/UiDisclosure.js +2 -2
- package/vue/chunks/UiEditable.js +2 -2
- package/vue/chunks/UiEditorBlockActions.js +2 -2
- package/vue/chunks/UiEditorChipEditor.js +2 -2
- package/vue/chunks/UiEditorCodeLanguage.js +2 -2
- package/vue/chunks/UiEditorFootnoteEditor.js +2 -2
- package/vue/chunks/UiEditorImageToolbar.js +3 -3
- package/vue/chunks/UiEditorInsertTableGrid.js +2 -2
- package/vue/chunks/UiEditorLinkCard.js +3 -3
- package/vue/chunks/UiEditorLinkForm.js +3 -3
- package/vue/chunks/UiEditorMentionMenu.js +2 -2
- package/vue/chunks/UiEditorMentionMenuItem.js +2 -2
- package/vue/chunks/UiEditorSlashMenu.js +2 -2
- package/vue/chunks/UiEditorSlashMenuGroup.js +2 -2
- package/vue/chunks/UiEditorSlashMenuItem.js +2 -2
- package/vue/chunks/UiEditorSurface.js +2 -2
- package/vue/chunks/UiEditorTableContextMenu.js +2 -2
- package/vue/chunks/UiEditorTableOverlay.js +2 -2
- package/vue/chunks/UiEditorTableToolbar.js +2 -2
- package/vue/chunks/UiEditorToolbar.js +2 -2
- package/vue/chunks/UiFloatingActionButton.js +2 -2
- package/vue/chunks/UiFormField.js +2 -2
- package/vue/chunks/UiGrid.js +2 -2
- package/vue/chunks/UiIcon.js +2 -2
- package/vue/chunks/UiIconButton.js +77 -11
- package/vue/chunks/UiImage.js +2 -2
- package/vue/chunks/UiInput.js +2 -2
- package/vue/chunks/UiInputGroup.js +2 -2
- package/vue/chunks/UiList.js +2 -2
- package/vue/chunks/UiListItem.js +2 -2
- package/vue/chunks/UiListbox.js +2 -2
- package/vue/chunks/UiMenu.js +3 -3
- package/vue/chunks/UiMenuGroup.js +2 -2
- package/vue/chunks/UiMenuItem.js +2 -2
- package/vue/chunks/UiMeter.js +2 -2
- package/vue/chunks/UiNavItem.js +2 -2
- package/vue/chunks/UiNumberInput.js +390 -0
- package/vue/chunks/UiPageHeader.js +2 -2
- package/vue/chunks/UiPopover.js +4 -4
- package/vue/chunks/UiRadio.js +2 -2
- package/vue/chunks/UiRadioGroup.js +2 -2
- package/vue/chunks/UiReel.js +2 -2
- package/vue/chunks/UiScrollArea.js +2 -2
- package/vue/chunks/UiSearchResultRow.js +2 -2
- package/vue/chunks/UiSearchShell.js +2 -2
- package/vue/chunks/UiSection.js +2 -2
- package/vue/chunks/UiSelect.js +2 -2
- package/vue/chunks/UiSeparator.js +2 -2
- package/vue/chunks/UiSidebar.js +2 -2
- package/vue/chunks/UiSlider.js +396 -0
- package/vue/chunks/UiSpinner.js +2 -2
- package/vue/chunks/UiStack.js +2 -2
- package/vue/chunks/UiStatusMessage.js +2 -2
- package/vue/chunks/UiSwatch.js +2 -2
- package/vue/chunks/UiSwitch.js +2 -2
- package/vue/chunks/UiSwitcher.js +2 -2
- package/vue/chunks/UiTable.js +2 -2
- package/vue/chunks/UiTabs.js +3 -3
- package/vue/chunks/UiText.js +53 -12
- package/vue/chunks/UiTextarea.js +2 -2
- package/vue/chunks/UiToast.js +2 -2
- package/vue/chunks/UiToastRegion.js +2 -2
- package/vue/chunks/UiTooltip.js +3 -3
- package/vue/chunks/UiTopBar.js +1 -1
- package/vue/chunks/UiTree.js +2 -2
- package/vue/chunks/UiTreeItem.js +2 -2
- package/vue/chunks/_plugin-vue_export-helper.js +68 -2
- package/vue/chunks/props.js +24 -1
- package/vue/components.css +2215 -1203
- package/vue/editor/index.js +623 -211
- package/vue/index.d.ts +3 -0
- package/vue/index.js +5 -2
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
// Generated by HTML Next 1.0.0-alpha.69 for Vanilla DOM. Do not edit.
|
|
2
|
+
import { attachGeneratedController, buildTemplate, toAttribute, toText, writeAttribute, dispatchDeclared, detailCheck, formatOf, keywordFormat, acceptProps, manageProps, generatedInputs, checkBoolean, checkFormat, checkObject, checkString, defineComponent, activateModule } from "@nextwebwg/html-next/generated-runtime";
|
|
3
|
+
import * as controller from "../components/ui-curve-editor/ui-curve-editor.js";
|
|
4
|
+
import "../styles/ui-curve-editor.css";
|
|
5
|
+
|
|
6
|
+
const T0 = ["",[],"\n ",["span",["class","plot-frame","role","group"],["span",["class","plot"],"\n ",["svg",["viewBox","0 0 100 100","preserveAspectRatio","none","aria-hidden","true"],["path",["class","guide","d","M0 66.667 H100 M0 33.333 H100"]],["path",["class","guide","d","M0 66.667 L25 63.333"]],["path",["class","guide","d","M100 33.333 L25 33.333"]],["path",["d","M0 66.667 C25 63.333 25 33.333 100 33.333"]]],"\n ",["button",["class","handle","type","button","aria-label","First curve handle. Arrow keys adjust; Shift moves faster."],"\n "],"\n ",["button",["class","handle second","type","button","aria-label","Second curve handle. Arrow keys adjust; Shift moves faster."],"\n "],"\n "]],"\n ",["span",["class","coordinates"],"\n ",["span",["class","coordinate"],["span",[],"X1"],["ui-number-input",["data-curve-coordinate","0","min","0","max","1","step","0.01","label","First handle X"]]],"\n ",["span",["class","coordinate"],["span",[],"Y1"],["ui-number-input",["data-curve-coordinate","1","min","-1","max","2","step","0.01","label","First handle Y"]]],"\n ",["span",["class","coordinate"],["span",[],"X2"],["ui-number-input",["data-curve-coordinate","2","min","0","max","1","step","0.01","label","Second handle X"]]],"\n ",["span",["class","coordinate"],["span",[],"Y2"],["ui-number-input",["data-curve-coordinate","3","min","-1","max","2","step","0.01","label","Second handle Y"]]],"\n "],"\n ",["output",[],0],"\n "];
|
|
7
|
+
let P0;
|
|
8
|
+
const S = { n: ["point0","point1","point2","point3"], t: ["s","s","s","s"], f: import.meta.url, g: "ui-curve-editor", d: { "input": [detailCheck(checkObject([["value", checkString, false]], false)), true, true, false], "change": [detailCheck(checkObject([["value", checkString, false]], false)), true, true, false] }, x: dispatchDeclared, a: (host, I) => C(host, I), b: generatedInputs, i: ["0.25", "0.1", "0.25", "1"] };
|
|
9
|
+
const D = { g: "ui-curve-editor", props: { "disabled": { "required":false,"default":false, c: checkBoolean, t: "boolean", j: 0, m: "b" }, "label": { "required":false,"default":"Value", c: checkString, t: "string", j: 0, m: "s" }, "size": { "required":false,"values":["sm","md","lg"],"default":"md", c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat)] }, "value": { "required":false,"default":"cubic-bezier(0.25, 0.1, 0.25, 1)", c: checkString, t: "string", j: 0, m: "s" } } };
|
|
10
|
+
const C = (host) => activateModule(controller, host);
|
|
11
|
+
|
|
12
|
+
export function createUiCurveEditor(options = {}, html) {
|
|
13
|
+
const { attributes = {}, children = [], slots = {}, ...componentProps } = options;
|
|
14
|
+
const element = document.createElement("span");
|
|
15
|
+
for (const [name, value] of Object.entries(attributes)) {
|
|
16
|
+
if (value === null || value === undefined || value === false) continue;
|
|
17
|
+
element.setAttribute(name, value === true ? "" : String(value));
|
|
18
|
+
}
|
|
19
|
+
element.setAttribute("data-component", "ui-curve-editor");
|
|
20
|
+
element.append((P0 ??= buildTemplate(T0)).cloneNode(true));
|
|
21
|
+
const v = ["0.25", "0.1", "0.25", "1", null, null, null, null];
|
|
22
|
+
const B = acceptProps(element, D, S.n, v, componentProps, [], html);
|
|
23
|
+
const p0 = (r, c, d) => {
|
|
24
|
+
if (c & 32) {
|
|
25
|
+
const x0 = v[5];
|
|
26
|
+
const s0 = toAttribute(x0, "aria-label");
|
|
27
|
+
if (s0 !== r.v0) writeAttribute(r.a0, "aria-label", r.v0 = s0);
|
|
28
|
+
}
|
|
29
|
+
if (c & 16) {
|
|
30
|
+
const x1 = v[4];
|
|
31
|
+
const s1 = toAttribute(x1, "disabled");
|
|
32
|
+
if (s1 !== r.v1) writeAttribute(r.a5, "disabled", r.v1 = s1);
|
|
33
|
+
const s2 = toAttribute(x1, "disabled");
|
|
34
|
+
if (s2 !== r.v2) writeAttribute(r.a6, "disabled", r.v2 = s2);
|
|
35
|
+
}
|
|
36
|
+
if (c & 1) {
|
|
37
|
+
const x2 = v[0];
|
|
38
|
+
const s3 = toAttribute(x2, "value");
|
|
39
|
+
if (s3 !== r.v3) writeAttribute(r.a7, "value", r.v3 = s3);
|
|
40
|
+
}
|
|
41
|
+
if (c & 1073741888) {
|
|
42
|
+
const x3 = v[6];
|
|
43
|
+
const s4 = toAttribute(x3, "size");
|
|
44
|
+
if (s4 !== r.v4) writeAttribute(r.a7, "size", r.v4 = s4);
|
|
45
|
+
}
|
|
46
|
+
if (c & 16) {
|
|
47
|
+
const x4 = v[4];
|
|
48
|
+
const s5 = toAttribute(x4, "disabled");
|
|
49
|
+
if (s5 !== r.v5) writeAttribute(r.a7, "disabled", r.v5 = s5);
|
|
50
|
+
}
|
|
51
|
+
if (c & 2) {
|
|
52
|
+
const x5 = v[1];
|
|
53
|
+
const s6 = toAttribute(x5, "value");
|
|
54
|
+
if (s6 !== r.v6) writeAttribute(r.a8, "value", r.v6 = s6);
|
|
55
|
+
}
|
|
56
|
+
if (c & 1073741888) {
|
|
57
|
+
const x6 = v[6];
|
|
58
|
+
const s7 = toAttribute(x6, "size");
|
|
59
|
+
if (s7 !== r.v7) writeAttribute(r.a8, "size", r.v7 = s7);
|
|
60
|
+
}
|
|
61
|
+
if (c & 16) {
|
|
62
|
+
const x7 = v[4];
|
|
63
|
+
const s8 = toAttribute(x7, "disabled");
|
|
64
|
+
if (s8 !== r.v8) writeAttribute(r.a8, "disabled", r.v8 = s8);
|
|
65
|
+
}
|
|
66
|
+
if (c & 4) {
|
|
67
|
+
const x8 = v[2];
|
|
68
|
+
const s9 = toAttribute(x8, "value");
|
|
69
|
+
if (s9 !== r.v9) writeAttribute(r.a9, "value", r.v9 = s9);
|
|
70
|
+
}
|
|
71
|
+
if (c & 1073741888) {
|
|
72
|
+
const x9 = v[6];
|
|
73
|
+
const s10 = toAttribute(x9, "size");
|
|
74
|
+
if (s10 !== r.v10) writeAttribute(r.a9, "size", r.v10 = s10);
|
|
75
|
+
}
|
|
76
|
+
if (c & 16) {
|
|
77
|
+
const x10 = v[4];
|
|
78
|
+
const s11 = toAttribute(x10, "disabled");
|
|
79
|
+
if (s11 !== r.v11) writeAttribute(r.a9, "disabled", r.v11 = s11);
|
|
80
|
+
}
|
|
81
|
+
if (c & 8) {
|
|
82
|
+
const x11 = v[3];
|
|
83
|
+
const s12 = toAttribute(x11, "value");
|
|
84
|
+
if (s12 !== r.v12) writeAttribute(r.a10, "value", r.v12 = s12);
|
|
85
|
+
}
|
|
86
|
+
if (c & 1073741888) {
|
|
87
|
+
const x12 = v[6];
|
|
88
|
+
const s13 = toAttribute(x12, "size");
|
|
89
|
+
if (s13 !== r.v13) writeAttribute(r.a10, "size", r.v13 = s13);
|
|
90
|
+
}
|
|
91
|
+
if (c & 16) {
|
|
92
|
+
const x13 = v[4];
|
|
93
|
+
const s14 = toAttribute(x13, "disabled");
|
|
94
|
+
if (s14 !== r.v14) writeAttribute(r.a10, "disabled", r.v14 = s14);
|
|
95
|
+
}
|
|
96
|
+
if (c & 128) {
|
|
97
|
+
const x14 = v[7];
|
|
98
|
+
const s15 = toText(x14);
|
|
99
|
+
if (s15 !== r.v15) r.a12.data = r.v15 = s15;
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
const t0 = element.firstChild.nextSibling;
|
|
103
|
+
const t1 = t0.firstChild;
|
|
104
|
+
const t2 = t1.firstChild.nextSibling;
|
|
105
|
+
const t3 = t2.firstChild.nextSibling;
|
|
106
|
+
const t4 = t3.nextSibling;
|
|
107
|
+
const t5 = t4.nextSibling;
|
|
108
|
+
const t6 = t2.nextSibling.nextSibling;
|
|
109
|
+
const t7 = t6.nextSibling.nextSibling;
|
|
110
|
+
const t8 = t0.nextSibling.nextSibling;
|
|
111
|
+
const t9 = t8.firstChild.nextSibling;
|
|
112
|
+
const t10 = t9.firstChild.nextSibling;
|
|
113
|
+
const t11 = t9.nextSibling.nextSibling;
|
|
114
|
+
const t12 = t11.firstChild.nextSibling;
|
|
115
|
+
const t13 = t11.nextSibling.nextSibling;
|
|
116
|
+
const t14 = t13.firstChild.nextSibling;
|
|
117
|
+
const t15 = t13.nextSibling.nextSibling.firstChild.nextSibling;
|
|
118
|
+
const t16 = t8.nextSibling.nextSibling;
|
|
119
|
+
const t17 = t16.firstChild;
|
|
120
|
+
const R = { a0: t0, a5: t6, a6: t7, a7: t10, a8: t12, a9: t14, a10: t15, a12: t17, v0: null, v1: null, v2: null, v3: null, v4: null, v5: null, v6: null, v7: null, v8: null, v9: null, v10: null, v11: null, v12: null, v13: null, v14: null, v15: "" };
|
|
121
|
+
const I = { B };
|
|
122
|
+
I.R = new Set();
|
|
123
|
+
attachGeneratedController(element, S, v, (c, d) => { ((c, d) => p0(R, c, d))(c, d); for (const f of I.R) f(c, d); }, undefined, undefined, I);
|
|
124
|
+
manageProps(I);
|
|
125
|
+
I.r["plot"] = t1;
|
|
126
|
+
I.r["firstLine"] = t3;
|
|
127
|
+
I.r["secondLine"] = t4;
|
|
128
|
+
I.r["curve"] = t5;
|
|
129
|
+
I.r["first"] = t6;
|
|
130
|
+
I.r["second"] = t7;
|
|
131
|
+
I.r["result"] = t16;
|
|
132
|
+
return element;
|
|
133
|
+
}
|
|
134
|
+
defineComponent("ui-curve-editor", createUiCurveEditor, ["disabled","label","size","value"]);
|
|
@@ -17,10 +17,11 @@ export interface UiIconButtonProps {
|
|
|
17
17
|
loading?: boolean | null;
|
|
18
18
|
matchButton?: boolean | null;
|
|
19
19
|
pending?: boolean | null;
|
|
20
|
+
preset?: "none" | "primary" | "standard" | "quiet" | "destructive" | null;
|
|
20
21
|
revealed?: boolean | null;
|
|
21
22
|
round?: boolean | null;
|
|
22
23
|
size?: "sm" | "md" | "lg" | null;
|
|
23
|
-
tone?: "accent" | "neutral" | null;
|
|
24
|
+
tone?: "auto" | "accent" | "neutral" | "danger" | "success" | "warning" | "info" | null;
|
|
24
25
|
variant?: "ghost" | "outline" | "solid" | null;
|
|
25
26
|
attributes?: Readonly<Record<string, string | number | boolean | null | undefined>>;
|
|
26
27
|
children?: readonly (string | Node)[];
|
package/vanilla/UiIconButton.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Generated by HTML Next 1.0.0-alpha.69 for Vanilla DOM. Do not edit.
|
|
2
|
-
import { attachGeneratedController, buildTemplate, clearRegion, NONCONFORMING, readIndex, textCall, toAttribute, truthy, writeAttribute, dispose, formatOf, keywordFormat, hostState, acceptProps, manageProps, generatedInputs, project, fillSlot, checkBoolean, checkFormat, checkString, defineComponent, activateModule } from "@nextwebwg/html-next/generated-runtime";
|
|
2
|
+
import { attachGeneratedController, buildTemplate, clearRegion, NONCONFORMING, readIndex, textCall, toAttribute, truthy, writeAttribute, computedCycle, dispose, formatOf, keywordFormat, hostState, acceptProps, manageProps, generatedInputs, awaitInput, evaluateInput, inputRead, READY_INPUT, UNRESOLVED_INPUT, notifyPropertySet, project, fillSlot, readonlyView, checkBoolean, checkFormat, checkString, defineComponent, activateModule } from "@nextwebwg/html-next/generated-runtime";
|
|
3
3
|
import * as controller from "../components/ui-icon-button/ui-icon-button.js";
|
|
4
4
|
import "../styles/ui-icon-button.css";
|
|
5
5
|
|
|
@@ -7,8 +7,8 @@ const T0 = ["",[],"\n ",1,"\n ",["span",["class","content"],4],"\n "];
|
|
|
7
7
|
const T1 = ["ui-spinner",["size","sm"]];
|
|
8
8
|
const T2 = ["",[]];
|
|
9
9
|
let P0, P1, P2;
|
|
10
|
-
const S = { n: [], t: [], f: import.meta.url, g: "ui-icon-button", a: (host, I) => C(host, I), b: generatedInputs };
|
|
11
|
-
const D = { g: "ui-icon-button", props: { "anticipatory": { "required":false,"default":false, c: checkBoolean, t: "boolean", j: 0, m: "b" }, "disabled": { "required":false,"default":false, c: checkBoolean, t: "boolean", j: 0, m: "b" }, "guide": { "required":false,"values":["dot","bar"],"default":"dot", c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat)] }, "label": { "required":false, c: checkString, t: "string", j: 0, m: "s" }, "loading": { "required":false,"default":false, c: checkBoolean, t: "boolean", j: 0, m: "b" }, "matchButton": { "required":false,"default":false, c: checkBoolean, t: "boolean", j: 0, m: "b" }, "pending": { "required":false,"default":false, c: checkBoolean, t: "boolean", j: 0, m: "b" }, "revealed": { "required":false,"default":false, c: checkBoolean, t: "boolean", j: 0, m: "b" }, "round": { "required":false,"default":false, c: checkBoolean, t: "boolean", j: 0, m: "b" }, "size": { "required":false,"values":["sm","md","lg"],"default":"md", c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat)] }, "tone": { "required":false,"values":["accent","neutral"], c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat)] }, "variant": { "required":false,"values":["ghost","outline","solid"],"default":"ghost", c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat)] } } };
|
|
10
|
+
const S = { n: ["appearance","colorTone"], t: ["?","?"], f: import.meta.url, g: "ui-icon-button", k: 0, r: readonlyView, a: (host, I) => C(host, I), b: generatedInputs };
|
|
11
|
+
const D = { g: "ui-icon-button", props: { "anticipatory": { "required":false,"default":false, c: checkBoolean, t: "boolean", j: 0, m: "b" }, "disabled": { "required":false,"default":false, c: checkBoolean, t: "boolean", j: 0, m: "b" }, "guide": { "required":false,"values":["dot","bar"],"default":"dot", c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat)] }, "label": { "required":false, c: checkString, t: "string", j: 0, m: "s" }, "loading": { "required":false,"default":false, c: checkBoolean, t: "boolean", j: 0, m: "b" }, "matchButton": { "required":false,"default":false, c: checkBoolean, t: "boolean", j: 0, m: "b" }, "pending": { "required":false,"default":false, c: checkBoolean, t: "boolean", j: 0, m: "b" }, "preset": { "required":false,"values":["none","primary","standard","quiet","destructive"],"default":"none", c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat)] }, "revealed": { "required":false,"default":false, c: checkBoolean, t: "boolean", j: 0, m: "b" }, "round": { "required":false,"default":false, c: checkBoolean, t: "boolean", j: 0, m: "b" }, "size": { "required":false,"values":["sm","md","lg"],"default":"md", c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat)] }, "tone": { "required":false,"values":["auto","accent","neutral","danger","success","warning","info"],"default":"auto", c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat)] }, "variant": { "required":false,"values":["ghost","outline","solid"],"default":"ghost", c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat)] } } };
|
|
12
12
|
const C = (host) => activateModule(controller, host);
|
|
13
13
|
|
|
14
14
|
export function createUiIconButton(options = {}, html) {
|
|
@@ -21,8 +21,25 @@ export function createUiIconButton(options = {}, html) {
|
|
|
21
21
|
if (!element.hasAttribute("type")) element.setAttribute("type", "button");
|
|
22
22
|
element.setAttribute("data-component", "ui-icon-button");
|
|
23
23
|
element.append((P0 ??= buildTemplate(T0)).cloneNode(true));
|
|
24
|
-
const v = [null, null, null, null, null, null, null, null, null, null, null, null];
|
|
24
|
+
const v = [undefined, undefined, null, null, null, null, null, null, null, null, null, null, null, null, null];
|
|
25
25
|
const B = acceptProps(element, D, S.n, v, componentProps, [], html);
|
|
26
|
+
const CS = [];
|
|
27
|
+
const inputStatus = (j) => { if (j >= 0 && j < 2) { g(j); return CS[j] ?? UNRESOLVED_INPUT; } if (j === 2) return awaitInput(B, "anticipatory", true); if (j === 3) return awaitInput(B, "disabled", true); if (j === 4) return awaitInput(B, "guide", true); if (j === 5) return awaitInput(B, "label", true); if (j === 6) return awaitInput(B, "loading", true); if (j === 7) return awaitInput(B, "matchButton", true); if (j === 8) return awaitInput(B, "pending", true); if (j === 9) return awaitInput(B, "preset", true); if (j === 10) return awaitInput(B, "revealed", true); if (j === 11) return awaitInput(B, "round", true); if (j === 12) return awaitInput(B, "size", true); if (j === 13) return awaitInput(B, "tone", true); if (j === 14) return awaitInput(B, "variant", true); return v[j] === undefined ? UNRESOLVED_INPUT : READY_INPUT; };
|
|
28
|
+
const X = { e: 0, g: (j) => g(j), w: new Set(), a: CS, i: inputStatus };
|
|
29
|
+
const ke = [];
|
|
30
|
+
const K = [() => readIndex({ "none": inputRead(v[14], inputStatus(14)), "primary": "solid", "standard": "solid", "quiet": "ghost", "destructive": "solid" }, inputRead(v[9], inputStatus(9))), () => readIndex({ "none": inputRead(v[13], inputStatus(13)), "primary": "accent", "standard": "neutral", "quiet": "neutral", "destructive": "danger" }, inputRead(v[9], inputStatus(9)))];
|
|
31
|
+
const g = (j) => {
|
|
32
|
+
const i = j - 0;
|
|
33
|
+
if (ke[i] === X.e) return v[j];
|
|
34
|
+
if (ke[i] === -1) computedCycle();
|
|
35
|
+
ke[i] = -1;
|
|
36
|
+
let next;
|
|
37
|
+
try { const result = evaluateInput(K[i], CS[j], NONCONFORMING), previousStatus = CS[j]; CS[j] = result.status; notifyPropertySet(CS, j, previousStatus, result.status, undefined); next = !result.status.ready ? null : result.value === NONCONFORMING ? v[j] : result.value; } catch (error) { ke[i] = undefined; throw error; }
|
|
38
|
+
ke[i] = X.e;
|
|
39
|
+
const previous = v[j];
|
|
40
|
+
if (!Object.is(previous, next)) { v[j] = next; X.n?.(j, previous, next); }
|
|
41
|
+
return next;
|
|
42
|
+
};
|
|
26
43
|
const m1 = (d) => {
|
|
27
44
|
const n = (P1 ??= buildTemplate(T1)).cloneNode(true);
|
|
28
45
|
const r = { n };
|
|
@@ -40,39 +57,49 @@ export function createUiIconButton(options = {}, html) {
|
|
|
40
57
|
const p2 = (r, c, d) => {
|
|
41
58
|
};
|
|
42
59
|
const p0 = (r, c, d) => {
|
|
43
|
-
if (c &
|
|
44
|
-
const x0 =
|
|
45
|
-
const s0 = toAttribute(x0, "
|
|
46
|
-
if (s0 !== r.v0) writeAttribute(r.n, "
|
|
60
|
+
if (c & 1073758720) {
|
|
61
|
+
const x0 = g(0);
|
|
62
|
+
const s0 = toAttribute(x0, "data-appearance");
|
|
63
|
+
if (s0 !== r.v0) writeAttribute(r.n, "data-appearance", r.v0 = s0);
|
|
64
|
+
}
|
|
65
|
+
if (c & 1073750528) {
|
|
66
|
+
const x1 = g(1);
|
|
67
|
+
const s1 = toAttribute(x1, "data-tone");
|
|
68
|
+
if (s1 !== r.v1) writeAttribute(r.n, "data-tone", r.v1 = s1);
|
|
47
69
|
}
|
|
48
70
|
if (c & 8) {
|
|
49
|
-
const
|
|
50
|
-
const
|
|
51
|
-
if (
|
|
71
|
+
const x2 = v[3];
|
|
72
|
+
const s2 = toAttribute(x2, "disabled");
|
|
73
|
+
if (s2 !== r.v2) writeAttribute(r.n, "disabled", r.v2 = s2);
|
|
52
74
|
}
|
|
53
75
|
if (c & 32) {
|
|
54
|
-
const
|
|
55
|
-
const
|
|
56
|
-
if (
|
|
76
|
+
const x3 = v[5];
|
|
77
|
+
const s3 = toAttribute(x3, "aria-label");
|
|
78
|
+
if (s3 !== r.v3) writeAttribute(r.n, "aria-label", r.v3 = s3);
|
|
79
|
+
}
|
|
80
|
+
if (c & 128) {
|
|
81
|
+
const x4 = v[7];
|
|
82
|
+
const s4 = toAttribute(x4, "data-match-button");
|
|
83
|
+
if (s4 !== r.v4) writeAttribute(r.n, "data-match-button", r.v4 = s4);
|
|
57
84
|
}
|
|
58
|
-
if (c &
|
|
59
|
-
const
|
|
60
|
-
if (
|
|
61
|
-
const
|
|
62
|
-
if (
|
|
85
|
+
if (c & 1073742144) {
|
|
86
|
+
const x5 = readIndex({ "true": "true", "false": null }, textCall("concat", [(truthy(v[6]) || truthy(v[8]))]));
|
|
87
|
+
if (x5 !== NONCONFORMING) {
|
|
88
|
+
const s5 = toAttribute(x5, "aria-disabled");
|
|
89
|
+
if (s5 !== r.v5) writeAttribute(r.n, "aria-disabled", r.v5 = s5);
|
|
63
90
|
}
|
|
64
91
|
}
|
|
65
|
-
if (c &
|
|
66
|
-
const
|
|
67
|
-
const
|
|
68
|
-
if (
|
|
92
|
+
if (c & 320) {
|
|
93
|
+
const x6 = (truthy(v[6]) || truthy(v[8]));
|
|
94
|
+
const s6 = toAttribute(x6, "aria-busy");
|
|
95
|
+
if (s6 !== r.v6) writeAttribute(r.n, "aria-busy", r.v6 = s6);
|
|
69
96
|
}
|
|
70
|
-
if (c &
|
|
71
|
-
const
|
|
72
|
-
const
|
|
73
|
-
if (
|
|
97
|
+
if (c & 7636) {
|
|
98
|
+
const x7 = hostState(["anticipatory","guide","revealed","loading","pending","size","matchButton","round"], [v[2], v[4], v[10], v[6], v[8], v[12], v[7], v[11]]);
|
|
99
|
+
const s7 = x7;
|
|
100
|
+
if (s7 !== r.v7) writeAttribute(r.n, "data-ui-icon-button-state", (r.v7 = s7) === "" ? null : s7);
|
|
74
101
|
}
|
|
75
|
-
if (c &
|
|
102
|
+
if (c & 320 && !((truthy(v[6]) || truthy(v[8]))) !== !r.b0) {
|
|
76
103
|
if (r.b0) { r.b0 = undefined; clearRegion(r.a1, r.e0); }
|
|
77
104
|
else { r.b0 = m1(d); r.e0.before(r.b0.n); }
|
|
78
105
|
} else if (r.b0 !== undefined) p1(r.b0, c, d);
|
|
@@ -82,11 +109,11 @@ export function createUiIconButton(options = {}, html) {
|
|
|
82
109
|
};
|
|
83
110
|
const t0 = element.firstChild.nextSibling;
|
|
84
111
|
const t1 = t0.nextSibling.nextSibling.nextSibling.firstChild;
|
|
85
|
-
const R = { n: element, v0: undefined, v1: undefined, v2: undefined, v3: undefined, v4: undefined, v5: undefined, a1: t0, e0: t0.nextSibling, b0: undefined, a2: t1, e1: t1.nextSibling, b1: undefined, f1: undefined };
|
|
112
|
+
const R = { n: element, v0: undefined, v1: undefined, v2: undefined, v3: undefined, v4: undefined, v5: undefined, v6: undefined, v7: undefined, a1: t0, e0: t0.nextSibling, b0: undefined, a2: t1, e1: t1.nextSibling, b1: undefined, f1: undefined };
|
|
86
113
|
const I = { B };
|
|
87
114
|
const J = project(I, children, slots);
|
|
88
|
-
attachGeneratedController(element, S, v, ((c, d) => p0(R, c, d)), undefined,
|
|
115
|
+
attachGeneratedController(element, S, v, ((c, d) => p0(R, c, d)), undefined, X, I);
|
|
89
116
|
manageProps(I);
|
|
90
117
|
return element;
|
|
91
118
|
}
|
|
92
|
-
defineComponent("ui-icon-button", createUiIconButton, ["anticipatory","disabled","guide","label","loading","matchButton","pending","revealed","round","size","tone","variant"]);
|
|
119
|
+
defineComponent("ui-icon-button", createUiIconButton, ["anticipatory","disabled","guide","label","loading","matchButton","pending","preset","revealed","round","size","tone","variant"]);
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// Generated by HTML Next 1.0.0-alpha.69 for Vanilla DOM. Do not edit.
|
|
2
|
+
export interface UiNumberInputEventMap {
|
|
3
|
+
input: CustomEvent<{ readonly value: string }>;
|
|
4
|
+
change: CustomEvent<{ readonly value: string }>;
|
|
5
|
+
}
|
|
6
|
+
export interface UiNumberInputElement extends HTMLSpanElement {
|
|
7
|
+
addEventListener<K extends keyof UiNumberInputEventMap>(type: K, listener: (this: UiNumberInputElement, event: UiNumberInputEventMap[K]) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
8
|
+
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: UiNumberInputElement, event: HTMLElementEventMap[K]) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
9
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
10
|
+
removeEventListener<K extends keyof UiNumberInputEventMap>(type: K, listener: (this: UiNumberInputElement, event: UiNumberInputEventMap[K]) => unknown, options?: boolean | EventListenerOptions): void;
|
|
11
|
+
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: UiNumberInputElement, event: HTMLElementEventMap[K]) => unknown, options?: boolean | EventListenerOptions): void;
|
|
12
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
13
|
+
}
|
|
14
|
+
export interface UiNumberInputProps {
|
|
15
|
+
disabled?: boolean | null;
|
|
16
|
+
label?: string | null;
|
|
17
|
+
max?: number | null;
|
|
18
|
+
min?: number | null;
|
|
19
|
+
name?: string | null;
|
|
20
|
+
size?: "sm" | "md" | "lg" | null;
|
|
21
|
+
step?: number | null;
|
|
22
|
+
unit?: string | null;
|
|
23
|
+
value?: string | null;
|
|
24
|
+
attributes?: Readonly<Record<string, string | number | boolean | null | undefined>>;
|
|
25
|
+
children?: readonly (string | Node)[];
|
|
26
|
+
slots?: Readonly<Record<string, readonly (string | Node)[]>>;
|
|
27
|
+
}
|
|
28
|
+
export declare function createUiNumberInput(props?: UiNumberInputProps): UiNumberInputElement;
|
|
29
|
+
declare global {
|
|
30
|
+
interface ComponentTagMap {
|
|
31
|
+
"ui-number-input": { element: UiNumberInputElement; props: Omit<UiNumberInputProps, "attributes" | "children" | "slots"> };
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
// Generated by HTML Next 1.0.0-alpha.69 for Vanilla DOM. Do not edit.
|
|
2
|
+
import { attachGeneratedController, buildTemplate, NONCONFORMING, textCall, toAttribute, writeAttribute, dispatchDeclared, detailCheck, formatOf, keywordFormat, acceptProps, manageProps, generatedInputs, checkBoolean, checkFormat, checkNumber, checkObject, checkString, defineComponent, activateModule } from "@nextwebwg/html-next/generated-runtime";
|
|
3
|
+
import * as controller from "../components/ui-number-input/ui-number-input.js";
|
|
4
|
+
import "../styles/ui-number-input.css";
|
|
5
|
+
|
|
6
|
+
const T0 = ["",[],"\n ",["ui-icon-button",["data-number-step","decrease","match-button","","type","button"],["ui-icon",["name","minus"]]],"\n ",["ui-input",["data-ui-field-control","","inputmode","decimal","spellcheck","false","aria-description","Enter calculates arithmetic. Arrow keys step; Shift changes ten steps."]],"\n ",["ui-icon-button",["data-number-step","increase","match-button","","type","button"],["ui-icon",["name","plus"]]],"\n "];
|
|
7
|
+
let P0;
|
|
8
|
+
const S = { n: [], t: [], f: import.meta.url, g: "ui-number-input", d: { "input": [detailCheck(checkObject([["value", checkString, false]], false)), true, true, false], "change": [detailCheck(checkObject([["value", checkString, false]], false)), true, true, false] }, x: dispatchDeclared, a: (host, I) => C(host, I), b: generatedInputs };
|
|
9
|
+
const D = { g: "ui-number-input", props: { "disabled": { "required":false,"default":false, c: checkBoolean, t: "boolean", j: 0, m: "b" }, "label": { "required":false,"default":"Value", c: checkString, t: "string", j: 0, m: "s" }, "max": { "required":false,"default":1000000, c: checkNumber, t: "number", j: 0, m: "n" }, "min": { "required":false,"default":-1000000, c: checkNumber, t: "number", j: 0, m: "n" }, "name": { "required":false,"default":"", c: checkString, t: "string", j: 0, m: "s" }, "size": { "required":false,"values":["sm","md","lg"],"default":"md", c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat)] }, "step": { "required":false,"default":1, c: checkNumber, t: "number", j: 0, m: "n" }, "unit": { "required":false,"default":"", c: checkString, t: "string", j: 0, m: "s" }, "value": { "required":false,"default":"0", c: checkString, t: "string", j: 0, m: "s" } } };
|
|
10
|
+
const C = (host) => activateModule(controller, host);
|
|
11
|
+
|
|
12
|
+
export function createUiNumberInput(options = {}, html) {
|
|
13
|
+
const { attributes = {}, children = [], slots = {}, ...componentProps } = options;
|
|
14
|
+
const element = document.createElement("span");
|
|
15
|
+
for (const [name, value] of Object.entries(attributes)) {
|
|
16
|
+
if (value === null || value === undefined || value === false) continue;
|
|
17
|
+
element.setAttribute(name, value === true ? "" : String(value));
|
|
18
|
+
}
|
|
19
|
+
element.setAttribute("data-component", "ui-number-input");
|
|
20
|
+
element.append((P0 ??= buildTemplate(T0)).cloneNode(true));
|
|
21
|
+
const v = [null, null, null, null, null, null, null, null, null];
|
|
22
|
+
const B = acceptProps(element, D, S.n, v, componentProps, [], html);
|
|
23
|
+
const p0 = (r, c, d) => {
|
|
24
|
+
if (c & 1073741856) {
|
|
25
|
+
const x0 = v[5];
|
|
26
|
+
const s0 = toAttribute(x0, "size");
|
|
27
|
+
if (s0 !== r.v0) writeAttribute(r.a0, "size", r.v0 = s0);
|
|
28
|
+
const s3 = toAttribute(x0, "size");
|
|
29
|
+
if (s3 !== r.v3) writeAttribute(r.a1, "size", r.v3 = s3);
|
|
30
|
+
const s8 = toAttribute(x0, "size");
|
|
31
|
+
if (s8 !== r.v8) writeAttribute(r.a2, "size", r.v8 = s8);
|
|
32
|
+
}
|
|
33
|
+
if (c & 1) {
|
|
34
|
+
const x1 = v[0];
|
|
35
|
+
const s1 = toAttribute(x1, "disabled");
|
|
36
|
+
if (s1 !== r.v1) writeAttribute(r.a0, "disabled", r.v1 = s1);
|
|
37
|
+
const s4 = toAttribute(x1, "disabled");
|
|
38
|
+
if (s4 !== r.v4) writeAttribute(r.a1, "disabled", r.v4 = s4);
|
|
39
|
+
const s9 = toAttribute(x1, "disabled");
|
|
40
|
+
if (s9 !== r.v9) writeAttribute(r.a2, "disabled", r.v9 = s9);
|
|
41
|
+
}
|
|
42
|
+
if (c & 2) {
|
|
43
|
+
const x2 = textCall("concat", ["Decrease ", v[1]]);
|
|
44
|
+
if (x2 !== NONCONFORMING) {
|
|
45
|
+
const s2 = toAttribute(x2, "label");
|
|
46
|
+
if (s2 !== r.v2) writeAttribute(r.a0, "label", r.v2 = s2);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
if (c & 256) {
|
|
50
|
+
const x3 = v[8];
|
|
51
|
+
const s5 = toAttribute(x3, "value");
|
|
52
|
+
if (s5 !== r.v5) writeAttribute(r.a1, "value", r.v5 = s5);
|
|
53
|
+
}
|
|
54
|
+
if (c & 2) {
|
|
55
|
+
const x4 = v[1];
|
|
56
|
+
const s6 = toAttribute(x4, "aria-label");
|
|
57
|
+
if (s6 !== r.v6) writeAttribute(r.a1, "aria-label", r.v6 = s6);
|
|
58
|
+
const x5 = textCall("concat", ["Increase ", v[1]]);
|
|
59
|
+
if (x5 !== NONCONFORMING) {
|
|
60
|
+
const s10 = toAttribute(x5, "label");
|
|
61
|
+
if (s10 !== r.v10) writeAttribute(r.a2, "label", r.v10 = s10);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
if (c & 16) {
|
|
65
|
+
const x6 = v[4];
|
|
66
|
+
const s7 = toAttribute(x6, "name");
|
|
67
|
+
if (s7 !== r.v7) writeAttribute(r.a1, "name", r.v7 = s7);
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
const t0 = element.firstChild.nextSibling;
|
|
71
|
+
const t1 = t0.nextSibling.nextSibling;
|
|
72
|
+
const t2 = t1.nextSibling.nextSibling;
|
|
73
|
+
const R = { a0: t0, a1: t1, a2: t2, v0: null, v1: null, v2: null, v3: null, v4: null, v5: null, v6: null, v7: null, v8: null, v9: null, v10: null };
|
|
74
|
+
const I = { B };
|
|
75
|
+
attachGeneratedController(element, S, v, ((c, d) => p0(R, c, d)), undefined, undefined, I);
|
|
76
|
+
manageProps(I);
|
|
77
|
+
return element;
|
|
78
|
+
}
|
|
79
|
+
defineComponent("ui-number-input", createUiNumberInput, ["disabled","label","max","min","name","size","step","unit","value"]);
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// Generated by HTML Next 1.0.0-alpha.69 for Vanilla DOM. Do not edit.
|
|
2
|
+
export interface UiSliderEventMap {
|
|
3
|
+
input: CustomEvent<{ readonly value: number }>;
|
|
4
|
+
change: CustomEvent<{ readonly value: number }>;
|
|
5
|
+
}
|
|
6
|
+
export interface UiSliderElement extends HTMLSpanElement {
|
|
7
|
+
addEventListener<K extends keyof UiSliderEventMap>(type: K, listener: (this: UiSliderElement, event: UiSliderEventMap[K]) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
8
|
+
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: UiSliderElement, event: HTMLElementEventMap[K]) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
9
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
10
|
+
removeEventListener<K extends keyof UiSliderEventMap>(type: K, listener: (this: UiSliderElement, event: UiSliderEventMap[K]) => unknown, options?: boolean | EventListenerOptions): void;
|
|
11
|
+
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: UiSliderElement, event: HTMLElementEventMap[K]) => unknown, options?: boolean | EventListenerOptions): void;
|
|
12
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
13
|
+
}
|
|
14
|
+
export interface UiSliderProps {
|
|
15
|
+
disabled?: boolean | null;
|
|
16
|
+
label?: string | null;
|
|
17
|
+
max?: number | null;
|
|
18
|
+
min?: number | null;
|
|
19
|
+
name?: string | null;
|
|
20
|
+
size?: "sm" | "md" | "lg" | null;
|
|
21
|
+
step?: number | null;
|
|
22
|
+
unit?: string | null;
|
|
23
|
+
value?: number | null;
|
|
24
|
+
attributes?: Readonly<Record<string, string | number | boolean | null | undefined>>;
|
|
25
|
+
children?: readonly (string | Node)[];
|
|
26
|
+
slots?: Readonly<Record<string, readonly (string | Node)[]>>;
|
|
27
|
+
}
|
|
28
|
+
export declare function createUiSlider(props?: UiSliderProps): UiSliderElement;
|
|
29
|
+
declare global {
|
|
30
|
+
interface ComponentTagMap {
|
|
31
|
+
"ui-slider": { element: UiSliderElement; props: Omit<UiSliderProps, "attributes" | "children" | "slots"> };
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
// Generated by HTML Next 1.0.0-alpha.69 for Vanilla DOM. Do not edit.
|
|
2
|
+
import { attachGeneratedController, stateInitializers, buildTemplate, checkReference, NONCONFORMING, textCall, toAttribute, writeAttribute, dispatchDeclared, detailCheck, formatOf, keywordFormat, hostState, acceptProps, manageProps, generatedInputs, awaitInput, inputRead, READY_INPUT, UNRESOLVED_INPUT, checkBoolean, checkFormat, checkNumber, checkObject, checkString, defineComponent, activateModule } from "@nextwebwg/html-next/generated-runtime";
|
|
3
|
+
import * as controller from "../components/ui-slider/ui-slider.js";
|
|
4
|
+
import "../styles/ui-slider.css";
|
|
5
|
+
|
|
6
|
+
const T0 = ["",[],"\n ",["input",["type","range","data-ui-field-control",""]],"\n ",["ui-number-input",["data-slider-exact",""]],"\n "];
|
|
7
|
+
let P0;
|
|
8
|
+
const S = { n: ["current"], t: ["n"], f: import.meta.url, g: "ui-slider", d: { "input": [detailCheck(checkObject([["value", checkNumber, false]], false)), true, true, false], "change": [detailCheck(checkObject([["value", checkNumber, false]], false)), true, true, false] }, x: dispatchDeclared, a: (host, I) => C(host, I), b: generatedInputs };
|
|
9
|
+
const D = { g: "ui-slider", props: { "disabled": { "required":false,"default":false, c: checkBoolean, t: "boolean", j: 0, m: "b" }, "label": { "required":false,"default":"Value", c: checkString, t: "string", j: 0, m: "s" }, "max": { "required":false,"default":100, c: checkNumber, t: "number", j: 0, m: "n" }, "min": { "required":false,"default":0, c: checkNumber, t: "number", j: 0, m: "n" }, "name": { "required":false,"default":"", c: checkString, t: "string", j: 0, m: "s" }, "size": { "required":false,"values":["sm","md","lg"],"default":"md", c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat)] }, "step": { "required":false,"default":1, c: checkNumber, t: "number", j: 0, m: "n" }, "unit": { "required":false,"default":"", c: checkString, t: "string", j: 0, m: "s" }, "value": { "required":false,"default":0, c: checkNumber, t: "number", j: 0, m: "n" } } };
|
|
10
|
+
const C = (host) => activateModule(controller, host);
|
|
11
|
+
|
|
12
|
+
export function createUiSlider(options = {}, html) {
|
|
13
|
+
const { attributes = {}, children = [], slots = {}, ...componentProps } = options;
|
|
14
|
+
const element = document.createElement("span");
|
|
15
|
+
for (const [name, value] of Object.entries(attributes)) {
|
|
16
|
+
if (value === null || value === undefined || value === false) continue;
|
|
17
|
+
element.setAttribute(name, value === true ? "" : String(value));
|
|
18
|
+
}
|
|
19
|
+
element.setAttribute("data-component", "ui-slider");
|
|
20
|
+
element.append((P0 ??= buildTemplate(T0)).cloneNode(true));
|
|
21
|
+
const v = [null, null, null, null, null, null, null, null, null, null];
|
|
22
|
+
const B = acceptProps(element, D, S.n, v, componentProps, [], html);
|
|
23
|
+
const CS = [];
|
|
24
|
+
const inputStatus = (j) => { if (j === 0) return E.status(j); if (j === 1) return awaitInput(B, "disabled", true); if (j === 2) return awaitInput(B, "label", true); if (j === 3) return awaitInput(B, "max", true); if (j === 4) return awaitInput(B, "min", true); if (j === 5) return awaitInput(B, "name", true); if (j === 6) return awaitInput(B, "size", true); if (j === 7) return awaitInput(B, "step", true); if (j === 8) return awaitInput(B, "unit", true); if (j === 9) return awaitInput(B, "value", true); return v[j] === undefined ? UNRESOLVED_INPUT : READY_INPUT; };
|
|
25
|
+
const X = { e: 0, g: (j) => v[j], w: new Set(), a: CS, i: inputStatus };
|
|
26
|
+
const E = stateInitializers(S, v, X, { 0: () => inputRead(v[9], inputStatus(9)) });
|
|
27
|
+
const p0 = (r, c, d) => {
|
|
28
|
+
if (c & 4) {
|
|
29
|
+
const x0 = v[2];
|
|
30
|
+
const s0 = toAttribute(x0, "aria-label");
|
|
31
|
+
if (s0 !== r.v0) writeAttribute(r.a0, "aria-label", r.v0 = s0);
|
|
32
|
+
}
|
|
33
|
+
if (c & 257) {
|
|
34
|
+
const x1 = (checkReference(S, v[0], "n", "expression:concat($current, $unit):current", "Reference `current` must satisfy number.") ? textCall("concat", [E.read(0), v[8]]) : NONCONFORMING);
|
|
35
|
+
if (x1 !== NONCONFORMING) {
|
|
36
|
+
const s1 = toAttribute(x1, "aria-valuetext");
|
|
37
|
+
if (s1 !== r.v1) writeAttribute(r.a0, "aria-valuetext", r.v1 = s1);
|
|
38
|
+
}
|
|
39
|
+
if (x1 !== NONCONFORMING) {
|
|
40
|
+
const s8 = toAttribute(x1, "value");
|
|
41
|
+
if (s8 !== r.v8) writeAttribute(r.a1, "value", r.v8 = s8);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
if (c & 512) {
|
|
45
|
+
const x2 = v[9];
|
|
46
|
+
const s2 = toAttribute(x2, "value");
|
|
47
|
+
if (s2 !== r.v2) writeAttribute(r.a0, "value", r.v2 = s2);
|
|
48
|
+
}
|
|
49
|
+
if (c & 16) {
|
|
50
|
+
const x3 = v[4];
|
|
51
|
+
const s3 = toAttribute(x3, "min");
|
|
52
|
+
if (s3 !== r.v3) writeAttribute(r.a0, "min", r.v3 = s3);
|
|
53
|
+
}
|
|
54
|
+
if (c & 8) {
|
|
55
|
+
const x4 = v[3];
|
|
56
|
+
const s4 = toAttribute(x4, "max");
|
|
57
|
+
if (s4 !== r.v4) writeAttribute(r.a0, "max", r.v4 = s4);
|
|
58
|
+
}
|
|
59
|
+
if (c & 128) {
|
|
60
|
+
const x5 = v[7];
|
|
61
|
+
const s5 = toAttribute(x5, "step");
|
|
62
|
+
if (s5 !== r.v5) writeAttribute(r.a0, "step", r.v5 = s5);
|
|
63
|
+
}
|
|
64
|
+
if (c & 2) {
|
|
65
|
+
const x6 = v[1];
|
|
66
|
+
const s6 = toAttribute(x6, "disabled");
|
|
67
|
+
if (s6 !== r.v6) writeAttribute(r.a0, "disabled", r.v6 = s6);
|
|
68
|
+
}
|
|
69
|
+
if (c & 32) {
|
|
70
|
+
const x7 = v[5];
|
|
71
|
+
const s7 = toAttribute(x7, "name");
|
|
72
|
+
if (s7 !== r.v7) writeAttribute(r.a0, "name", r.v7 = s7);
|
|
73
|
+
}
|
|
74
|
+
if (c & 256) {
|
|
75
|
+
const x8 = v[8];
|
|
76
|
+
const s9 = toAttribute(x8, "unit");
|
|
77
|
+
if (s9 !== r.v9) writeAttribute(r.a1, "unit", r.v9 = s9);
|
|
78
|
+
}
|
|
79
|
+
if (c & 16) {
|
|
80
|
+
const x9 = v[4];
|
|
81
|
+
const s10 = toAttribute(x9, "min");
|
|
82
|
+
if (s10 !== r.v10) writeAttribute(r.a1, "min", r.v10 = s10);
|
|
83
|
+
}
|
|
84
|
+
if (c & 8) {
|
|
85
|
+
const x10 = v[3];
|
|
86
|
+
const s11 = toAttribute(x10, "max");
|
|
87
|
+
if (s11 !== r.v11) writeAttribute(r.a1, "max", r.v11 = s11);
|
|
88
|
+
}
|
|
89
|
+
if (c & 128) {
|
|
90
|
+
const x11 = v[7];
|
|
91
|
+
const s12 = toAttribute(x11, "step");
|
|
92
|
+
if (s12 !== r.v12) writeAttribute(r.a1, "step", r.v12 = s12);
|
|
93
|
+
}
|
|
94
|
+
if (c & 1073741888) {
|
|
95
|
+
const x12 = v[6];
|
|
96
|
+
const s13 = toAttribute(x12, "size");
|
|
97
|
+
if (s13 !== r.v13) writeAttribute(r.a1, "size", r.v13 = s13);
|
|
98
|
+
}
|
|
99
|
+
if (c & 2) {
|
|
100
|
+
const x13 = v[1];
|
|
101
|
+
const s14 = toAttribute(x13, "disabled");
|
|
102
|
+
if (s14 !== r.v14) writeAttribute(r.a1, "disabled", r.v14 = s14);
|
|
103
|
+
}
|
|
104
|
+
if (c & 4) {
|
|
105
|
+
const x14 = v[2];
|
|
106
|
+
const s15 = toAttribute(x14, "label");
|
|
107
|
+
if (s15 !== r.v15) writeAttribute(r.a1, "label", r.v15 = s15);
|
|
108
|
+
}
|
|
109
|
+
if (c & 64) {
|
|
110
|
+
const x15 = hostState(["size"], [v[6]]);
|
|
111
|
+
const s16 = x15;
|
|
112
|
+
if (s16 !== r.v16) writeAttribute(r.n, "data-ui-slider-state", (r.v16 = s16) === "" ? null : s16);
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
const t0 = element.firstChild.nextSibling;
|
|
116
|
+
const t1 = t0.nextSibling.nextSibling;
|
|
117
|
+
const R = { n: element, a0: t0, a1: t1, v0: null, v1: null, v2: null, v3: null, v4: null, v5: null, v6: null, v7: null, v8: null, v9: null, v10: null, v11: null, v12: null, v13: null, v14: null, v15: null, v16: undefined };
|
|
118
|
+
const I = { B, U: E };
|
|
119
|
+
I.R = new Set();
|
|
120
|
+
attachGeneratedController(element, S, v, (c, d) => { ((c, d) => p0(R, c, d))(c, d); for (const f of I.R) f(c, d); }, undefined, X, I);
|
|
121
|
+
manageProps(I);
|
|
122
|
+
I.r["range"] = t0;
|
|
123
|
+
return element;
|
|
124
|
+
}
|
|
125
|
+
defineComponent("ui-slider", createUiSlider, ["disabled","label","max","min","name","size","step","unit","value"]);
|
package/vanilla/UiText.d.ts
CHANGED
|
@@ -11,14 +11,14 @@ export interface UiTextElement extends HTMLElement {
|
|
|
11
11
|
}
|
|
12
12
|
export interface UiTextProps {
|
|
13
13
|
align?: "start" | "center" | null;
|
|
14
|
-
as?: "p" | "span" | "div" | "small" | "strong" | "label" | "h2" | "h3" | "h4" | "h5" | "h6" | null;
|
|
14
|
+
as?: "p" | "span" | "div" | "small" | "strong" | "label" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | null;
|
|
15
15
|
font?: "inherit" | "sans" | null;
|
|
16
16
|
grow?: boolean | null;
|
|
17
17
|
size?: "inherit" | "xs" | "sm" | "md" | "lg" | null;
|
|
18
18
|
tone?: "default" | "secondary" | "muted" | "accent" | "danger" | "success" | "info" | "warning" | null;
|
|
19
19
|
trim?: boolean | null;
|
|
20
20
|
truncate?: boolean | null;
|
|
21
|
-
variant?: "body" | "eyebrow" | "code" | null;
|
|
21
|
+
variant?: "body" | "display" | "heading" | "label" | "caption" | "eyebrow" | "code" | null;
|
|
22
22
|
weight?: "inherit" | "normal" | "medium" | "semibold" | null;
|
|
23
23
|
wrap?: "normal" | "anywhere" | null;
|
|
24
24
|
attributes?: Readonly<Record<string, string | number | boolean | null | undefined>>;
|