aeico-components 0.1.6 → 0.1.7
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 +0 -0
- package/dist/chunks/action-button.cjs +2 -2
- package/dist/chunks/action-button.js +2 -2
- package/dist/chunks/alert.cjs +22 -28
- package/dist/chunks/alert.cjs.map +1 -1
- package/dist/chunks/alert.js +22 -28
- package/dist/chunks/alert.js.map +1 -1
- package/dist/chunks/badge.cjs +1 -1
- package/dist/chunks/badge.js +1 -1
- package/dist/chunks/breadcrumb-item.cjs +7 -7
- package/dist/chunks/breadcrumb-item.js +7 -7
- package/dist/chunks/button.cjs +39 -50
- package/dist/chunks/button.cjs.map +1 -1
- package/dist/chunks/button.js +39 -50
- package/dist/chunks/button.js.map +1 -1
- package/dist/chunks/card.cjs +1 -1
- package/dist/chunks/card.js +1 -1
- package/dist/chunks/checkbox.cjs +1 -1
- package/dist/chunks/checkbox.js +1 -1
- package/dist/chunks/color.cjs +1 -1
- package/dist/chunks/color.js +1 -1
- package/dist/chunks/copy-button.cjs +7 -4
- package/dist/chunks/copy-button.cjs.map +1 -1
- package/dist/chunks/copy-button.js +7 -4
- package/dist/chunks/copy-button.js.map +1 -1
- package/dist/chunks/detail-group.cjs +65 -0
- package/dist/chunks/detail-group.cjs.map +1 -0
- package/dist/chunks/detail-group.js +66 -0
- package/dist/chunks/detail-group.js.map +1 -0
- package/dist/chunks/detail.cjs +1 -1
- package/dist/chunks/detail.js +1 -1
- package/dist/chunks/dialog.cjs +1 -1
- package/dist/chunks/dialog.js +1 -1
- package/dist/chunks/divider.cjs +1 -1
- package/dist/chunks/divider.js +1 -1
- package/dist/chunks/drawer.cjs +1 -1
- package/dist/chunks/drawer.js +1 -1
- package/dist/chunks/dropdown-button.cjs +8 -9
- package/dist/chunks/dropdown-button.cjs.map +1 -1
- package/dist/chunks/dropdown-button.js +11 -12
- package/dist/chunks/dropdown-button.js.map +1 -1
- package/dist/chunks/icon.cjs +27 -11
- package/dist/chunks/icon.cjs.map +1 -1
- package/dist/chunks/icon.js +27 -11
- package/dist/chunks/icon.js.map +1 -1
- package/dist/chunks/menu.cjs +1 -1
- package/dist/chunks/menu.js +1 -1
- package/dist/chunks/navbar.cjs +1 -1
- package/dist/chunks/navbar.js +1 -1
- package/dist/chunks/number-input.cjs +110 -0
- package/dist/chunks/number-input.cjs.map +1 -0
- package/dist/chunks/number-input.js +111 -0
- package/dist/chunks/number-input.js.map +1 -0
- package/dist/chunks/pagination.cjs +31 -31
- package/dist/chunks/pagination.js +31 -31
- package/dist/chunks/progress-bar.cjs +1 -1
- package/dist/chunks/progress-bar.js +1 -1
- package/dist/chunks/radio.cjs +1 -1
- package/dist/chunks/radio.js +1 -1
- package/dist/chunks/select.cjs +1 -1
- package/dist/chunks/select.js +1 -1
- package/dist/chunks/size.cjs +1 -1
- package/dist/chunks/size.js +1 -1
- package/dist/chunks/slider.cjs +26 -29
- package/dist/chunks/slider.cjs.map +1 -1
- package/dist/chunks/slider.js +26 -29
- package/dist/chunks/slider.js.map +1 -1
- package/dist/chunks/spinner.cjs +1 -1
- package/dist/chunks/spinner.js +1 -1
- package/dist/chunks/switch.cjs +1 -1
- package/dist/chunks/switch.js +1 -1
- package/dist/chunks/tab-panel.cjs +12 -3
- package/dist/chunks/tab-panel.cjs.map +1 -1
- package/dist/chunks/tab-panel.js +12 -3
- package/dist/chunks/tab-panel.js.map +1 -1
- package/dist/chunks/tag.cjs +1 -1
- package/dist/chunks/tag.js +1 -1
- package/dist/chunks/text-input.cjs +1 -1
- package/dist/chunks/text-input.js +1 -1
- package/dist/chunks/textarea.cjs +1 -1
- package/dist/chunks/textarea.js +1 -1
- package/dist/chunks/tooltip.cjs +4 -5
- package/dist/chunks/tooltip.cjs.map +1 -1
- package/dist/chunks/tooltip.js +4 -5
- package/dist/chunks/tooltip.js.map +1 -1
- package/dist/chunks/tree.cjs +1 -1
- package/dist/chunks/tree.js +1 -1
- package/dist/chunks/variables.cjs +271 -247
- package/dist/chunks/variables.cjs.map +1 -1
- package/dist/chunks/variables.js +271 -247
- package/dist/chunks/variables.js.map +1 -1
- package/dist/detail-group.cjs +6 -0
- package/dist/detail-group.cjs.map +1 -0
- package/dist/detail-group.js +6 -0
- package/dist/detail-group.js.map +1 -0
- package/dist/dropdown.js +4 -4
- package/dist/index.cjs +4 -166
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +10 -172
- package/dist/index.js.map +1 -1
- package/dist/number-input.cjs +6 -0
- package/dist/number-input.cjs.map +1 -0
- package/dist/number-input.js +6 -0
- package/dist/number-input.js.map +1 -0
- package/dist/select.cjs +1 -1
- package/dist/select.js +1 -1
- package/dist/types/card/defines.d.ts +1 -1
- package/dist/types/detail/defines.d.ts +1 -1
- package/dist/types/icon/defines.d.ts +5 -1
- package/dist/types/icon/index.d.ts +1 -1
- package/dist/types/tabs/defines.d.ts +1 -0
- package/dist/types/tabs/tabs.d.ts +3 -0
- package/package.json +1 -1
- package/src/card/defines.ts +1 -1
- package/src/copy-button/copy-button.ts +9 -5
- package/src/detail/defines.ts +1 -1
- package/src/icon/defines.ts +6 -1
- package/src/icon/icon.ts +28 -10
- package/src/icon/index.ts +1 -1
- package/src/icon/registry.ts +2 -2
- package/src/styles/color.css +91 -91
- package/src/styles/components/action-button.css +12 -12
- package/src/styles/components/alert.css +22 -28
- package/src/styles/components/badge.css +13 -20
- package/src/styles/components/breadcrumb-item.css +7 -7
- package/src/styles/components/button.css +39 -50
- package/src/styles/components/card.css +45 -30
- package/src/styles/components/checkbox.css +6 -11
- package/src/styles/components/copy-button.css +22 -33
- package/src/styles/components/detail.css +51 -39
- package/src/styles/components/dialog.css +11 -11
- package/src/styles/components/divider.css +3 -3
- package/src/styles/components/drawer.css +14 -23
- package/src/styles/components/dropdown-item.css +7 -8
- package/src/styles/components/dropdown.css +3 -4
- package/src/styles/components/field-label.css +12 -12
- package/src/styles/components/icon-button.css +25 -36
- package/src/styles/components/icon.css +1 -1
- package/src/styles/components/menu-item.css +7 -8
- package/src/styles/components/navbar.css +16 -16
- package/src/styles/components/number-input.css +27 -36
- package/src/styles/components/pagination.css +31 -31
- package/src/styles/components/progress-bar.css +2 -3
- package/src/styles/components/radio-group.css +69 -83
- package/src/styles/components/select-option.css +5 -5
- package/src/styles/components/select.css +21 -33
- package/src/styles/components/slider.css +26 -29
- package/src/styles/components/spinner.css +7 -9
- package/src/styles/components/switch.css +5 -17
- package/src/styles/components/tab.css +4 -5
- package/src/styles/components/tabs.css +48 -1
- package/src/styles/components/tag.css +14 -21
- package/src/styles/components/text-input.css +13 -22
- package/src/styles/components/textarea.css +12 -21
- package/src/styles/components/tooltip.css +4 -5
- package/src/styles/components/tree-item.css +12 -12
- package/src/styles/radius.css +10 -0
- package/src/styles/size.css +7 -7
- package/src/styles/variables.css +271 -247
- package/src/tabs/defines.ts +1 -0
- package/src/tabs/tabs.ts +12 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detail-group.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
package/dist/dropdown.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a, b, D } from "./chunks/dropdown-button.js";
|
|
2
2
|
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
a as DropdownButton,
|
|
4
|
+
b as DropdownItem,
|
|
5
|
+
D as default
|
|
6
6
|
};
|
|
7
7
|
//# sourceMappingURL=dropdown.js.map
|
package/dist/index.cjs
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4
|
-
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
6
3
|
const textInput = require("./chunks/text-input.cjs");
|
|
4
|
+
const numberInput = require("./chunks/number-input.cjs");
|
|
7
5
|
const textarea = require("./chunks/textarea.cjs");
|
|
8
6
|
const select = require("./chunks/select.cjs");
|
|
9
7
|
const slider = require("./chunks/slider.cjs");
|
|
@@ -28,173 +26,14 @@ const card = require("./chunks/card.cjs");
|
|
|
28
26
|
const navbar = require("./chunks/navbar.cjs");
|
|
29
27
|
const spinner = require("./chunks/spinner.cjs");
|
|
30
28
|
const detail = require("./chunks/detail.cjs");
|
|
29
|
+
const detailGroup = require("./chunks/detail-group.cjs");
|
|
31
30
|
const progressBar = require("./chunks/progress-bar.cjs");
|
|
32
31
|
const menu = require("./chunks/menu.cjs");
|
|
33
32
|
const tooltip = require("./chunks/tooltip.cjs");
|
|
34
33
|
const pagination = require("./chunks/pagination.cjs");
|
|
35
34
|
const tree = require("./chunks/tree.cjs");
|
|
36
|
-
const variables = require("./chunks/variables.cjs");
|
|
37
|
-
const aeicoComponent = require("./chunks/aeico-component.cjs");
|
|
38
|
-
const aeico = require("aeico");
|
|
39
|
-
const actionButton = require("./chunks/action-button.cjs");
|
|
40
|
-
const size = require("./chunks/size.cjs");
|
|
41
|
-
const style = ":host {\n display: block;\n flex: 1;\n min-width: 0;\n font-size: var(--size-base);\n\n /* Layout variables */\n --input-field-gap: 4px;\n \n /* Input element variables */\n --input-font-size: 1em;\n --input-padding: 0.333em 0.583em;\n --input-border-width: 1px;\n --input-border-radius: 2px;\n --input-border-color: var(--border-subtle);\n --input-border-color-hover: var(--border-default);\n --input-border-color-focus: var(--border-focus);\n --input-bg: var(--surface-base);\n --input-bg-hover: var(--surface-raised);\n --input-bg-focus: var(--surface-raised);\n --input-color: var(--color-text-muted);\n --input-placeholder-color: var(--color-text-disabled);\n --input-transition: border-color 0.12s, background 0.12s;\n}\n\n.input-container {\n display: flex;\n align-items: center;\n gap: var(--input-field-gap);\n width: 100%;\n}\n\ninput {\n flex: 1;\n min-width: 0;\n font-size: var(--input-font-size);\n padding: var(--input-padding);\n border: var(--input-border-width) solid var(--input-border-color);\n border-radius: var(--input-border-radius);\n background: var(--input-bg);\n color: var(--input-color);\n transition: var(--input-transition);\n -moz-appearance: textfield;\n appearance: textfield;\n}\n\n/* Hide number spinner arrows in WebKit browsers */\ninput::-webkit-outer-spin-button,\ninput::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n}\n\ninput::placeholder {\n color: var(--input-placeholder-color);\n}\n\ninput:focus {\n outline: none;\n border-color: var(--input-border-color-focus);\n background: var(--input-bg-focus);\n}\n\ninput:hover:not(:focus) {\n border-color: var(--input-border-color-hover);\n background: var(--input-bg-hover);\n}\n\ninput:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n/* Number stepper controls (right side, integrated, horizontal) */\n.number-controls {\n display: flex;\n flex-direction: row;\n align-items: stretch;\n margin-left: calc(-1 * var(--input-field-gap) - 1px);\n border: var(--input-border-width) solid var(--input-border-color);\n border-radius: 0 var(--input-border-radius) var(--input-border-radius) 0;\n overflow: hidden;\n flex-shrink: 0;\n transition: var(--input-transition);\n background: var(--input-bg);\n position: relative;\n z-index: 1;\n align-self: stretch;\n}\n\n.number-btn {\n border: none;\n background: transparent;\n color: var(--input-color);\n font-size: 0.875em;\n line-height: 1;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0 0.5em;\n transition: background 0.12s;\n}\n\n.number-btn:hover:not(:disabled) {\n background: var(--input-bg-hover);\n}\n\n.number-btn:active:not(:disabled) {\n background: var(--input-bg-focus);\n}\n\n.number-btn:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n.number-btn-increment {\n border-right: var(--input-border-width) solid var(--input-border-color);\n}\n\n.input-container:has(input:focus) .number-controls {\n border-color: var(--input-border-color-focus);\n}\n\n.input-container:has(input:hover:not(:focus)) .number-controls {\n border-color: var(--input-border-color-hover);\n}\n\n:host(:has(.number-controls)) input {\n border-radius: var(--input-border-radius) 0 0 var(--input-border-radius);\n}\n\n:host(:has(.action-controls)) input {\n border-radius: var(--input-border-radius) 0 0 var(--input-border-radius);\n}\n\n.number-controls ~ .action-controls {\n margin-left: calc(-1 * var(--input-field-gap) - 1px);\n}\n\n.input-container:has(.number-controls):has(.action-controls) .number-controls {\n border-right: none;\n border-radius: 0;\n}\n\n.input-container:has(.number-controls) ~ .action-controls,\n.input-container:has(.action-controls) .number-controls {\n border-radius: 0;\n}\n\n.input-container:has(.number-controls) input {\n border-radius: var(--input-border-radius) 0 0 var(--input-border-radius);\n}\n\n.input-container:has(.action-controls) input {\n border-radius: var(--input-border-radius) 0 0 var(--input-border-radius);\n}\n\n:host([error]) input {\n border-color: var(--field-error-color, var(--red));\n}\n\n:host([error]) input:hover:not(:focus),\n:host([error]) input:focus {\n border-color: var(--field-error-color, var(--red));\n}\n";
|
|
42
|
-
class NumberInput extends actionButton.AeicoField {
|
|
43
|
-
constructor() {
|
|
44
|
-
super(...arguments);
|
|
45
|
-
__publicField(this, "fieldElement", null);
|
|
46
|
-
__publicField(this, "boundOnIncrement", () => {
|
|
47
|
-
const current = this.getValue() || 0;
|
|
48
|
-
const step = this.step ?? 1;
|
|
49
|
-
let next = current + step;
|
|
50
|
-
if (this.max != null && next > this.max) {
|
|
51
|
-
next = this.max;
|
|
52
|
-
}
|
|
53
|
-
this.setValue(next, { silent: false, action: "change" });
|
|
54
|
-
});
|
|
55
|
-
__publicField(this, "boundOnDecrement", () => {
|
|
56
|
-
const current = this.getValue() || 0;
|
|
57
|
-
const step = this.step ?? 1;
|
|
58
|
-
let next = current - step;
|
|
59
|
-
if (this.min != null && next < this.min) {
|
|
60
|
-
next = this.min;
|
|
61
|
-
}
|
|
62
|
-
this.setValue(next, { silent: false, action: "change" });
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
render() {
|
|
66
|
-
return aeico.html(({ div, input, button: button2 }) => {
|
|
67
|
-
const id = this.getFieldId();
|
|
68
|
-
this.renderLabel(id);
|
|
69
|
-
div({ className: "input-container field-body" }, () => {
|
|
70
|
-
this.fieldElement = input({
|
|
71
|
-
id,
|
|
72
|
-
type: "number",
|
|
73
|
-
placeholder: this.placeholder || "",
|
|
74
|
-
required: Boolean(this.required),
|
|
75
|
-
disabled: Boolean(this.disabled),
|
|
76
|
-
min: this.min != null ? String(this.min) : void 0,
|
|
77
|
-
max: this.max != null ? String(this.max) : void 0,
|
|
78
|
-
step: this.step != null ? String(this.step) : void 0,
|
|
79
|
-
"@input": this.boundOnChange
|
|
80
|
-
});
|
|
81
|
-
if (this.controls) {
|
|
82
|
-
div({ className: "number-controls" }, () => {
|
|
83
|
-
button2({
|
|
84
|
-
className: "number-btn number-btn-increment",
|
|
85
|
-
textContent: "+",
|
|
86
|
-
disabled: Boolean(this.disabled),
|
|
87
|
-
"@click": this.boundOnIncrement
|
|
88
|
-
});
|
|
89
|
-
button2({
|
|
90
|
-
className: "number-btn number-btn-decrement",
|
|
91
|
-
textContent: "-",
|
|
92
|
-
disabled: Boolean(this.disabled),
|
|
93
|
-
"@click": this.boundOnDecrement
|
|
94
|
-
});
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
this.renderActionButtons();
|
|
98
|
-
});
|
|
99
|
-
this.renderHelperText();
|
|
100
|
-
this.renderError();
|
|
101
|
-
if (this.fieldElement && this.value != null) {
|
|
102
|
-
this.fieldElement.value = String(this.value);
|
|
103
|
-
}
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
/**
|
|
107
|
-
* Get current value as number
|
|
108
|
-
*/
|
|
109
|
-
getValue() {
|
|
110
|
-
if (!this.fieldElement) return 0;
|
|
111
|
-
const val = this.fieldElement.value;
|
|
112
|
-
if (val === "") return 0;
|
|
113
|
-
const num = parseFloat(val);
|
|
114
|
-
return isNaN(num) ? 0 : num;
|
|
115
|
-
}
|
|
116
|
-
/**
|
|
117
|
-
* Write value to the input element (DOM only)
|
|
118
|
-
*/
|
|
119
|
-
writeValue(value) {
|
|
120
|
-
if (this.fieldElement) {
|
|
121
|
-
this.fieldElement.value = value != null ? String(value) : "";
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
/**
|
|
125
|
-
* Get event payload for change events
|
|
126
|
-
*/
|
|
127
|
-
getEventPayload(value, oldValue, action) {
|
|
128
|
-
return { value, oldValue, action };
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
__publicField(NumberInput, "tagName", "number-input");
|
|
132
|
-
__publicField(NumberInput, "props", {
|
|
133
|
-
placeholder: { type: String },
|
|
134
|
-
min: { type: Number },
|
|
135
|
-
max: { type: Number },
|
|
136
|
-
step: { type: Number },
|
|
137
|
-
controls: { type: Boolean }
|
|
138
|
-
});
|
|
139
|
-
__publicField(NumberInput, "styles", [variables.variables, size.sizeCSS, actionButton.fieldLabelCSS, actionButton.actionButtonCSS, style]);
|
|
140
|
-
NumberInput.register();
|
|
141
|
-
const detailGroupStyle = ":host {\n display: block;\n}\n\n/* Raise hovered/focused item so its border shows above neighbours */\n::slotted(ae-detail:hover),\n::slotted(ae-detail:focus-within) {\n position: relative;\n z-index: 1;\n}\n";
|
|
142
|
-
class DetailGroup extends aeicoComponent.AeicoComponent {
|
|
143
|
-
constructor() {
|
|
144
|
-
super(...arguments);
|
|
145
|
-
__publicField(this, "slotEl", null);
|
|
146
|
-
__publicField(this, "DETAIL_RADIUS", 6);
|
|
147
|
-
__publicField(this, "_handleOpen", (event) => {
|
|
148
|
-
if (this.multiple) return;
|
|
149
|
-
const opened = event.target;
|
|
150
|
-
this._getDetails().forEach((detail2) => {
|
|
151
|
-
if (detail2 !== opened) detail2.close();
|
|
152
|
-
});
|
|
153
|
-
});
|
|
154
|
-
}
|
|
155
|
-
connectedCallback() {
|
|
156
|
-
super.connectedCallback();
|
|
157
|
-
this.listen("open", this._handleOpen);
|
|
158
|
-
}
|
|
159
|
-
_getDetails() {
|
|
160
|
-
if (!this.slotEl) return [];
|
|
161
|
-
return this.slotEl.assignedElements({ flatten: true }).filter(
|
|
162
|
-
(el) => el.tagName.toLowerCase() === "ae-detail"
|
|
163
|
-
);
|
|
164
|
-
}
|
|
165
|
-
_syncChildren() {
|
|
166
|
-
const details = this._getDetails();
|
|
167
|
-
const r = this.DETAIL_RADIUS;
|
|
168
|
-
details.forEach((detail2, i) => {
|
|
169
|
-
const isFirst = i === 0;
|
|
170
|
-
const isLast = i === details.length - 1;
|
|
171
|
-
detail2.style.marginTop = isFirst ? "" : "-1px";
|
|
172
|
-
detail2.style.setProperty("--detail-r-tl", isFirst ? `${r}px` : "0");
|
|
173
|
-
detail2.style.setProperty("--detail-r-tr", isFirst ? `${r}px` : "0");
|
|
174
|
-
detail2.style.setProperty("--detail-r-br", isLast ? `${r}px` : "0");
|
|
175
|
-
detail2.style.setProperty("--detail-r-bl", isLast ? `${r}px` : "0");
|
|
176
|
-
if (this.variant !== void 0) detail2.variant = this.variant;
|
|
177
|
-
if (this.color !== void 0) detail2.color = this.color;
|
|
178
|
-
});
|
|
179
|
-
}
|
|
180
|
-
render() {
|
|
181
|
-
return aeico.html(({ slot }) => {
|
|
182
|
-
this.slotEl = slot({
|
|
183
|
-
"@slotchange": () => this._syncChildren()
|
|
184
|
-
});
|
|
185
|
-
this._syncChildren();
|
|
186
|
-
});
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
__publicField(DetailGroup, "tagName", "detail-group");
|
|
190
|
-
__publicField(DetailGroup, "props", {
|
|
191
|
-
multiple: { type: Boolean },
|
|
192
|
-
variant: { type: String },
|
|
193
|
-
color: { type: String }
|
|
194
|
-
});
|
|
195
|
-
__publicField(DetailGroup, "styles", [variables.variables, detailGroupStyle]);
|
|
196
|
-
DetailGroup.register();
|
|
197
35
|
exports.TextInput = textInput.TextInput;
|
|
36
|
+
exports.NumberInput = numberInput.NumberInput;
|
|
198
37
|
exports.Textarea = textarea.Textarea;
|
|
199
38
|
exports.Select = select.Select;
|
|
200
39
|
exports.Slider = slider.Slider;
|
|
@@ -226,6 +65,7 @@ exports.Card = card.Card;
|
|
|
226
65
|
exports.Navbar = navbar.Navbar;
|
|
227
66
|
exports.Spinner = spinner.Spinner;
|
|
228
67
|
exports.Detail = detail.Detail;
|
|
68
|
+
exports.DetailGroup = detailGroup.DetailGroup;
|
|
229
69
|
exports.ProgressBar = progressBar.ProgressBar;
|
|
230
70
|
exports.Menu = menu.Menu;
|
|
231
71
|
exports.MenuItem = menu.MenuItem;
|
|
@@ -233,6 +73,4 @@ exports.Tooltip = tooltip.Tooltip;
|
|
|
233
73
|
exports.Pagination = pagination.Pagination;
|
|
234
74
|
exports.Tree = tree.Tree;
|
|
235
75
|
exports.TreeItem = tree.TreeItem;
|
|
236
|
-
exports.DetailGroup = DetailGroup;
|
|
237
|
-
exports.NumberInput = NumberInput;
|
|
238
76
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../src/number-input/number-input.ts","../src/detail-group/detail-group.ts"],"sourcesContent":["import AeicoField from '../aeico-field';\nimport type { InferProps, Props } from 'aeico';\nimport { html } from 'aeico';\nimport variables from '../styles/variables.css?inline';\nimport sizeCSS from '../styles/size.css?inline';\nimport fieldLabelCSS from '../styles/components/field-label.css?inline';\nimport actionButtonCSS from '../styles/components/action-button.css?inline';\nimport style from '../styles/components/number-input.css?inline';\n\nclass NumberInput extends AeicoField<number> {\n protected fieldElement: HTMLInputElement | null = null;\n\n static tagName = 'number-input';\n\n static props: Props = {\n placeholder: { type: String },\n min: { type: Number },\n max: { type: Number },\n step: { type: Number },\n controls: { type: Boolean },\n };\n\n declare placeholder?: string;\n declare min?: number;\n declare max?: number;\n declare step?: number;\n declare controls?: boolean;\n\n protected static styles = [variables, sizeCSS, fieldLabelCSS, actionButtonCSS, style];\n\n render() {\n return html(({ div, input, button }) => {\n const id = this.getFieldId();\n this.renderLabel(id);\n div({ className: 'input-container field-body' }, () => {\n this.fieldElement = input({\n id,\n type: 'number',\n placeholder: this.placeholder || '',\n required: Boolean(this.required),\n disabled: Boolean(this.disabled),\n min: this.min != null ? String(this.min) : undefined,\n max: this.max != null ? String(this.max) : undefined,\n step: this.step != null ? String(this.step) : undefined,\n '@input': this.boundOnChange,\n });\n\n if (this.controls) {\n div({ className: 'number-controls' }, () => {\n button({\n className: 'number-btn number-btn-increment',\n textContent: '+',\n disabled: Boolean(this.disabled),\n '@click': this.boundOnIncrement,\n });\n button({\n className: 'number-btn number-btn-decrement',\n textContent: '-',\n disabled: Boolean(this.disabled),\n '@click': this.boundOnDecrement,\n });\n });\n }\n\n this.renderActionButtons();\n });\n this.renderHelperText();\n this.renderError();\n\n if (this.fieldElement && this.value != null) {\n this.fieldElement.value = String(this.value);\n }\n });\n }\n\n protected readonly boundOnIncrement = () => {\n const current = this.getValue() || 0;\n const step = this.step ?? 1;\n let next = current + step;\n if (this.max != null && next > this.max) {\n next = this.max;\n }\n this.setValue(next, { silent: false, action: 'change' });\n };\n\n protected readonly boundOnDecrement = () => {\n const current = this.getValue() || 0;\n const step = this.step ?? 1;\n let next = current - step;\n if (this.min != null && next < this.min) {\n next = this.min;\n }\n this.setValue(next, { silent: false, action: 'change' });\n };\n\n /**\n * Get current value as number\n */\n protected getValue(): number {\n if (!this.fieldElement) return 0;\n const val = this.fieldElement.value;\n if (val === '') return 0;\n const num = parseFloat(val);\n return isNaN(num) ? 0 : num;\n }\n\n /**\n * Write value to the input element (DOM only)\n */\n protected writeValue(value: number): void {\n if (this.fieldElement) {\n this.fieldElement.value = value != null ? String(value) : '';\n }\n }\n\n /**\n * Get event payload for change events\n */\n protected getEventPayload(\n value: number,\n oldValue: number,\n action: import('../aeico-field').FieldAction,\n ): Record<string, unknown> {\n return { value, oldValue, action };\n }\n}\n\nNumberInput.register();\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'ae-number-input': NumberInput;\n }\n}\n\nexport default NumberInput;\nexport type NumberInputProps = InferProps<typeof NumberInput>;\n","import type { InferProps, Props } from 'aeico';\nimport styleVariables from '../styles/variables.css?inline';\nimport detailGroupStyle from '../styles/components/detail-group.css?inline';\nimport AeicoComponent from '../aeico-component';\nimport { html } from 'aeico';\nimport type Detail from '../detail/detail';\nimport type { DetailColor, DetailVariant } from '../detail/defines';\n\n/**\n * DetailGroup component — wraps multiple `ae-detail` elements into an\n * accordion-style group. By default only one item can be open at a time;\n * set `multiple` to allow several items open simultaneously.\n *\n * @example\n * ```html\n * <ae-detail-group>\n * <ae-detail summary=\"Section 1\">Content 1</ae-detail>\n * <ae-detail summary=\"Section 2\">Content 2</ae-detail>\n * <ae-detail summary=\"Section 3\">Content 3</ae-detail>\n * </ae-detail-group>\n * ```\n */\nclass DetailGroup extends AeicoComponent {\n static tagName = 'detail-group';\n\n static props: Props = {\n multiple: { type: Boolean },\n variant: { type: String },\n color: { type: String },\n };\n\n protected static styles = [styleVariables, detailGroupStyle];\n\n declare multiple?: boolean;\n declare variant?: DetailVariant;\n declare color?: DetailColor;\n\n private slotEl: HTMLSlotElement | null = null;\n\n private readonly DETAIL_RADIUS = 6;\n\n connectedCallback() {\n super.connectedCallback();\n this.listen('open', this._handleOpen);\n }\n\n private _getDetails(): Detail[] {\n if (!this.slotEl) return [];\n return (this.slotEl.assignedElements({ flatten: true }) as Detail[]).filter(\n (el) => el.tagName.toLowerCase() === 'ae-detail',\n );\n }\n\n private _syncChildren(): void {\n const details = this._getDetails();\n const r = this.DETAIL_RADIUS;\n\n details.forEach((detail, i) => {\n const isFirst = i === 0;\n const isLast = i === details.length - 1;\n\n // Collapse borders between adjacent items\n detail.style.marginTop = isFirst ? '' : '-1px';\n\n // Adjust per-corner radius so only the outer edges of the group keep it\n detail.style.setProperty('--detail-r-tl', isFirst ? `${r}px` : '0');\n detail.style.setProperty('--detail-r-tr', isFirst ? `${r}px` : '0');\n detail.style.setProperty('--detail-r-br', isLast ? `${r}px` : '0');\n detail.style.setProperty('--detail-r-bl', isLast ? `${r}px` : '0');\n\n // Propagate variant / color only when explicitly set on the group\n if (this.variant !== undefined) detail.variant = this.variant;\n if (this.color !== undefined) detail.color = this.color;\n });\n }\n\n private _handleOpen = (event: Event): void => {\n if (this.multiple) return;\n const opened = event.target as Element;\n this._getDetails().forEach((detail) => {\n if (detail !== opened) detail.close();\n });\n };\n\n protected render() {\n return html(({ slot }) => {\n this.slotEl = slot({\n '@slotchange': () => this._syncChildren(),\n });\n this._syncChildren();\n });\n }\n}\n\nDetailGroup.register();\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'ae-detail-group': DetailGroup;\n }\n}\n\nexport default DetailGroup;\nexport type DetailGroupProps = InferProps<typeof DetailGroup>;\n"],"names":["AeicoField","html","button","variables","sizeCSS","fieldLabelCSS","actionButtonCSS","AeicoComponent","detail","styleVariables"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,MAAM,oBAAoBA,aAAAA,WAAmB;AAAA,EAA7C;AAAA;AACY,wCAAwC;AAiE/B,4CAAmB,MAAM;AAC1C,YAAM,UAAU,KAAK,SAAA,KAAc;AACnC,YAAM,OAAO,KAAK,QAAQ;AAC1B,UAAI,OAAO,UAAU;AACrB,UAAI,KAAK,OAAO,QAAQ,OAAO,KAAK,KAAK;AACvC,eAAO,KAAK;AAAA,MACd;AACA,WAAK,SAAS,MAAM,EAAE,QAAQ,OAAO,QAAQ,UAAU;AAAA,IACzD;AAEmB,4CAAmB,MAAM;AAC1C,YAAM,UAAU,KAAK,SAAA,KAAc;AACnC,YAAM,OAAO,KAAK,QAAQ;AAC1B,UAAI,OAAO,UAAU;AACrB,UAAI,KAAK,OAAO,QAAQ,OAAO,KAAK,KAAK;AACvC,eAAO,KAAK;AAAA,MACd;AACA,WAAK,SAAS,MAAM,EAAE,QAAQ,OAAO,QAAQ,UAAU;AAAA,IACzD;AAAA;AAAA,EA/DA,SAAS;AACP,WAAOC,MAAAA,KAAK,CAAC,EAAE,KAAK,OAAO,QAAAC,cAAa;AACtC,YAAM,KAAK,KAAK,WAAA;AAChB,WAAK,YAAY,EAAE;AACnB,UAA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,7 +1,5 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
|
-
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
1
|
import { T } from "./chunks/text-input.js";
|
|
2
|
+
import { N } from "./chunks/number-input.js";
|
|
5
3
|
import { T as T2 } from "./chunks/textarea.js";
|
|
6
4
|
import { S } from "./chunks/select.js";
|
|
7
5
|
import { S as S2 } from "./chunks/slider.js";
|
|
@@ -11,7 +9,7 @@ import { S as S3 } from "./chunks/switch.js";
|
|
|
11
9
|
import { B, a as a2 } from "./chunks/breadcrumb-item.js";
|
|
12
10
|
import { B as B2 } from "./chunks/button.js";
|
|
13
11
|
import { C as C2 } from "./chunks/copy-button.js";
|
|
14
|
-
import {
|
|
12
|
+
import { D, a as a3, b } from "./chunks/dropdown-button.js";
|
|
15
13
|
import { B as B3 } from "./chunks/button-group.js";
|
|
16
14
|
import { B as B4 } from "./chunks/badge.js";
|
|
17
15
|
import { T as T3 } from "./chunks/tag.js";
|
|
@@ -23,175 +21,15 @@ import { I as I2 } from "./chunks/icon-button.js";
|
|
|
23
21
|
import { T as T4, a as a5, b as b2 } from "./chunks/tab-panel.js";
|
|
24
22
|
import { D as D4 } from "./chunks/divider.js";
|
|
25
23
|
import { C as C3 } from "./chunks/card.js";
|
|
26
|
-
import { N } from "./chunks/navbar.js";
|
|
24
|
+
import { N as N2 } from "./chunks/navbar.js";
|
|
27
25
|
import { S as S4 } from "./chunks/spinner.js";
|
|
28
26
|
import { D as D5 } from "./chunks/detail.js";
|
|
27
|
+
import { D as D6 } from "./chunks/detail-group.js";
|
|
29
28
|
import { P } from "./chunks/progress-bar.js";
|
|
30
29
|
import { M, a as a6 } from "./chunks/menu.js";
|
|
31
30
|
import { T as T5 } from "./chunks/tooltip.js";
|
|
32
31
|
import { P as P2 } from "./chunks/pagination.js";
|
|
33
32
|
import { T as T6, a as a7 } from "./chunks/tree.js";
|
|
34
|
-
import { v as variables } from "./chunks/variables.js";
|
|
35
|
-
import { A as AeicoComponent } from "./chunks/aeico-component.js";
|
|
36
|
-
import { html } from "aeico";
|
|
37
|
-
import { A as AeicoField, f as fieldLabelCSS, a as actionButtonCSS } from "./chunks/action-button.js";
|
|
38
|
-
import { s as sizeCSS } from "./chunks/size.js";
|
|
39
|
-
const style = ":host {\n display: block;\n flex: 1;\n min-width: 0;\n font-size: var(--size-base);\n\n /* Layout variables */\n --input-field-gap: 4px;\n \n /* Input element variables */\n --input-font-size: 1em;\n --input-padding: 0.333em 0.583em;\n --input-border-width: 1px;\n --input-border-radius: 2px;\n --input-border-color: var(--border-subtle);\n --input-border-color-hover: var(--border-default);\n --input-border-color-focus: var(--border-focus);\n --input-bg: var(--surface-base);\n --input-bg-hover: var(--surface-raised);\n --input-bg-focus: var(--surface-raised);\n --input-color: var(--color-text-muted);\n --input-placeholder-color: var(--color-text-disabled);\n --input-transition: border-color 0.12s, background 0.12s;\n}\n\n.input-container {\n display: flex;\n align-items: center;\n gap: var(--input-field-gap);\n width: 100%;\n}\n\ninput {\n flex: 1;\n min-width: 0;\n font-size: var(--input-font-size);\n padding: var(--input-padding);\n border: var(--input-border-width) solid var(--input-border-color);\n border-radius: var(--input-border-radius);\n background: var(--input-bg);\n color: var(--input-color);\n transition: var(--input-transition);\n -moz-appearance: textfield;\n appearance: textfield;\n}\n\n/* Hide number spinner arrows in WebKit browsers */\ninput::-webkit-outer-spin-button,\ninput::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n}\n\ninput::placeholder {\n color: var(--input-placeholder-color);\n}\n\ninput:focus {\n outline: none;\n border-color: var(--input-border-color-focus);\n background: var(--input-bg-focus);\n}\n\ninput:hover:not(:focus) {\n border-color: var(--input-border-color-hover);\n background: var(--input-bg-hover);\n}\n\ninput:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n/* Number stepper controls (right side, integrated, horizontal) */\n.number-controls {\n display: flex;\n flex-direction: row;\n align-items: stretch;\n margin-left: calc(-1 * var(--input-field-gap) - 1px);\n border: var(--input-border-width) solid var(--input-border-color);\n border-radius: 0 var(--input-border-radius) var(--input-border-radius) 0;\n overflow: hidden;\n flex-shrink: 0;\n transition: var(--input-transition);\n background: var(--input-bg);\n position: relative;\n z-index: 1;\n align-self: stretch;\n}\n\n.number-btn {\n border: none;\n background: transparent;\n color: var(--input-color);\n font-size: 0.875em;\n line-height: 1;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0 0.5em;\n transition: background 0.12s;\n}\n\n.number-btn:hover:not(:disabled) {\n background: var(--input-bg-hover);\n}\n\n.number-btn:active:not(:disabled) {\n background: var(--input-bg-focus);\n}\n\n.number-btn:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n.number-btn-increment {\n border-right: var(--input-border-width) solid var(--input-border-color);\n}\n\n.input-container:has(input:focus) .number-controls {\n border-color: var(--input-border-color-focus);\n}\n\n.input-container:has(input:hover:not(:focus)) .number-controls {\n border-color: var(--input-border-color-hover);\n}\n\n:host(:has(.number-controls)) input {\n border-radius: var(--input-border-radius) 0 0 var(--input-border-radius);\n}\n\n:host(:has(.action-controls)) input {\n border-radius: var(--input-border-radius) 0 0 var(--input-border-radius);\n}\n\n.number-controls ~ .action-controls {\n margin-left: calc(-1 * var(--input-field-gap) - 1px);\n}\n\n.input-container:has(.number-controls):has(.action-controls) .number-controls {\n border-right: none;\n border-radius: 0;\n}\n\n.input-container:has(.number-controls) ~ .action-controls,\n.input-container:has(.action-controls) .number-controls {\n border-radius: 0;\n}\n\n.input-container:has(.number-controls) input {\n border-radius: var(--input-border-radius) 0 0 var(--input-border-radius);\n}\n\n.input-container:has(.action-controls) input {\n border-radius: var(--input-border-radius) 0 0 var(--input-border-radius);\n}\n\n:host([error]) input {\n border-color: var(--field-error-color, var(--red));\n}\n\n:host([error]) input:hover:not(:focus),\n:host([error]) input:focus {\n border-color: var(--field-error-color, var(--red));\n}\n";
|
|
40
|
-
class NumberInput extends AeicoField {
|
|
41
|
-
constructor() {
|
|
42
|
-
super(...arguments);
|
|
43
|
-
__publicField(this, "fieldElement", null);
|
|
44
|
-
__publicField(this, "boundOnIncrement", () => {
|
|
45
|
-
const current = this.getValue() || 0;
|
|
46
|
-
const step = this.step ?? 1;
|
|
47
|
-
let next = current + step;
|
|
48
|
-
if (this.max != null && next > this.max) {
|
|
49
|
-
next = this.max;
|
|
50
|
-
}
|
|
51
|
-
this.setValue(next, { silent: false, action: "change" });
|
|
52
|
-
});
|
|
53
|
-
__publicField(this, "boundOnDecrement", () => {
|
|
54
|
-
const current = this.getValue() || 0;
|
|
55
|
-
const step = this.step ?? 1;
|
|
56
|
-
let next = current - step;
|
|
57
|
-
if (this.min != null && next < this.min) {
|
|
58
|
-
next = this.min;
|
|
59
|
-
}
|
|
60
|
-
this.setValue(next, { silent: false, action: "change" });
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
render() {
|
|
64
|
-
return html(({ div, input, button }) => {
|
|
65
|
-
const id = this.getFieldId();
|
|
66
|
-
this.renderLabel(id);
|
|
67
|
-
div({ className: "input-container field-body" }, () => {
|
|
68
|
-
this.fieldElement = input({
|
|
69
|
-
id,
|
|
70
|
-
type: "number",
|
|
71
|
-
placeholder: this.placeholder || "",
|
|
72
|
-
required: Boolean(this.required),
|
|
73
|
-
disabled: Boolean(this.disabled),
|
|
74
|
-
min: this.min != null ? String(this.min) : void 0,
|
|
75
|
-
max: this.max != null ? String(this.max) : void 0,
|
|
76
|
-
step: this.step != null ? String(this.step) : void 0,
|
|
77
|
-
"@input": this.boundOnChange
|
|
78
|
-
});
|
|
79
|
-
if (this.controls) {
|
|
80
|
-
div({ className: "number-controls" }, () => {
|
|
81
|
-
button({
|
|
82
|
-
className: "number-btn number-btn-increment",
|
|
83
|
-
textContent: "+",
|
|
84
|
-
disabled: Boolean(this.disabled),
|
|
85
|
-
"@click": this.boundOnIncrement
|
|
86
|
-
});
|
|
87
|
-
button({
|
|
88
|
-
className: "number-btn number-btn-decrement",
|
|
89
|
-
textContent: "-",
|
|
90
|
-
disabled: Boolean(this.disabled),
|
|
91
|
-
"@click": this.boundOnDecrement
|
|
92
|
-
});
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
this.renderActionButtons();
|
|
96
|
-
});
|
|
97
|
-
this.renderHelperText();
|
|
98
|
-
this.renderError();
|
|
99
|
-
if (this.fieldElement && this.value != null) {
|
|
100
|
-
this.fieldElement.value = String(this.value);
|
|
101
|
-
}
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* Get current value as number
|
|
106
|
-
*/
|
|
107
|
-
getValue() {
|
|
108
|
-
if (!this.fieldElement) return 0;
|
|
109
|
-
const val = this.fieldElement.value;
|
|
110
|
-
if (val === "") return 0;
|
|
111
|
-
const num = parseFloat(val);
|
|
112
|
-
return isNaN(num) ? 0 : num;
|
|
113
|
-
}
|
|
114
|
-
/**
|
|
115
|
-
* Write value to the input element (DOM only)
|
|
116
|
-
*/
|
|
117
|
-
writeValue(value) {
|
|
118
|
-
if (this.fieldElement) {
|
|
119
|
-
this.fieldElement.value = value != null ? String(value) : "";
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* Get event payload for change events
|
|
124
|
-
*/
|
|
125
|
-
getEventPayload(value, oldValue, action) {
|
|
126
|
-
return { value, oldValue, action };
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
__publicField(NumberInput, "tagName", "number-input");
|
|
130
|
-
__publicField(NumberInput, "props", {
|
|
131
|
-
placeholder: { type: String },
|
|
132
|
-
min: { type: Number },
|
|
133
|
-
max: { type: Number },
|
|
134
|
-
step: { type: Number },
|
|
135
|
-
controls: { type: Boolean }
|
|
136
|
-
});
|
|
137
|
-
__publicField(NumberInput, "styles", [variables, sizeCSS, fieldLabelCSS, actionButtonCSS, style]);
|
|
138
|
-
NumberInput.register();
|
|
139
|
-
const detailGroupStyle = ":host {\n display: block;\n}\n\n/* Raise hovered/focused item so its border shows above neighbours */\n::slotted(ae-detail:hover),\n::slotted(ae-detail:focus-within) {\n position: relative;\n z-index: 1;\n}\n";
|
|
140
|
-
class DetailGroup extends AeicoComponent {
|
|
141
|
-
constructor() {
|
|
142
|
-
super(...arguments);
|
|
143
|
-
__publicField(this, "slotEl", null);
|
|
144
|
-
__publicField(this, "DETAIL_RADIUS", 6);
|
|
145
|
-
__publicField(this, "_handleOpen", (event) => {
|
|
146
|
-
if (this.multiple) return;
|
|
147
|
-
const opened = event.target;
|
|
148
|
-
this._getDetails().forEach((detail) => {
|
|
149
|
-
if (detail !== opened) detail.close();
|
|
150
|
-
});
|
|
151
|
-
});
|
|
152
|
-
}
|
|
153
|
-
connectedCallback() {
|
|
154
|
-
super.connectedCallback();
|
|
155
|
-
this.listen("open", this._handleOpen);
|
|
156
|
-
}
|
|
157
|
-
_getDetails() {
|
|
158
|
-
if (!this.slotEl) return [];
|
|
159
|
-
return this.slotEl.assignedElements({ flatten: true }).filter(
|
|
160
|
-
(el) => el.tagName.toLowerCase() === "ae-detail"
|
|
161
|
-
);
|
|
162
|
-
}
|
|
163
|
-
_syncChildren() {
|
|
164
|
-
const details = this._getDetails();
|
|
165
|
-
const r = this.DETAIL_RADIUS;
|
|
166
|
-
details.forEach((detail, i) => {
|
|
167
|
-
const isFirst = i === 0;
|
|
168
|
-
const isLast = i === details.length - 1;
|
|
169
|
-
detail.style.marginTop = isFirst ? "" : "-1px";
|
|
170
|
-
detail.style.setProperty("--detail-r-tl", isFirst ? `${r}px` : "0");
|
|
171
|
-
detail.style.setProperty("--detail-r-tr", isFirst ? `${r}px` : "0");
|
|
172
|
-
detail.style.setProperty("--detail-r-br", isLast ? `${r}px` : "0");
|
|
173
|
-
detail.style.setProperty("--detail-r-bl", isLast ? `${r}px` : "0");
|
|
174
|
-
if (this.variant !== void 0) detail.variant = this.variant;
|
|
175
|
-
if (this.color !== void 0) detail.color = this.color;
|
|
176
|
-
});
|
|
177
|
-
}
|
|
178
|
-
render() {
|
|
179
|
-
return html(({ slot }) => {
|
|
180
|
-
this.slotEl = slot({
|
|
181
|
-
"@slotchange": () => this._syncChildren()
|
|
182
|
-
});
|
|
183
|
-
this._syncChildren();
|
|
184
|
-
});
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
__publicField(DetailGroup, "tagName", "detail-group");
|
|
188
|
-
__publicField(DetailGroup, "props", {
|
|
189
|
-
multiple: { type: Boolean },
|
|
190
|
-
variant: { type: String },
|
|
191
|
-
color: { type: String }
|
|
192
|
-
});
|
|
193
|
-
__publicField(DetailGroup, "styles", [variables, detailGroupStyle]);
|
|
194
|
-
DetailGroup.register();
|
|
195
33
|
export {
|
|
196
34
|
A as Alert,
|
|
197
35
|
B4 as Badge,
|
|
@@ -203,20 +41,20 @@ export {
|
|
|
203
41
|
C as Checkbox,
|
|
204
42
|
C2 as CopyButton,
|
|
205
43
|
D5 as Detail,
|
|
206
|
-
DetailGroup,
|
|
44
|
+
D6 as DetailGroup,
|
|
207
45
|
D2 as Dialog,
|
|
208
46
|
D4 as Divider,
|
|
209
47
|
D3 as Drawer,
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
48
|
+
D as Dropdown,
|
|
49
|
+
a3 as DropdownButton,
|
|
50
|
+
b as DropdownItem,
|
|
213
51
|
I as Icon,
|
|
214
52
|
I2 as IconButton,
|
|
215
53
|
a4 as IconRegistry,
|
|
216
54
|
M as Menu,
|
|
217
55
|
a6 as MenuItem,
|
|
218
|
-
|
|
219
|
-
NumberInput,
|
|
56
|
+
N2 as Navbar,
|
|
57
|
+
N as NumberInput,
|
|
220
58
|
P2 as Pagination,
|
|
221
59
|
P as ProgressBar,
|
|
222
60
|
R as Radio,
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/number-input/number-input.ts","../src/detail-group/detail-group.ts"],"sourcesContent":["import AeicoField from '../aeico-field';\nimport type { InferProps, Props } from 'aeico';\nimport { html } from 'aeico';\nimport variables from '../styles/variables.css?inline';\nimport sizeCSS from '../styles/size.css?inline';\nimport fieldLabelCSS from '../styles/components/field-label.css?inline';\nimport actionButtonCSS from '../styles/components/action-button.css?inline';\nimport style from '../styles/components/number-input.css?inline';\n\nclass NumberInput extends AeicoField<number> {\n protected fieldElement: HTMLInputElement | null = null;\n\n static tagName = 'number-input';\n\n static props: Props = {\n placeholder: { type: String },\n min: { type: Number },\n max: { type: Number },\n step: { type: Number },\n controls: { type: Boolean },\n };\n\n declare placeholder?: string;\n declare min?: number;\n declare max?: number;\n declare step?: number;\n declare controls?: boolean;\n\n protected static styles = [variables, sizeCSS, fieldLabelCSS, actionButtonCSS, style];\n\n render() {\n return html(({ div, input, button }) => {\n const id = this.getFieldId();\n this.renderLabel(id);\n div({ className: 'input-container field-body' }, () => {\n this.fieldElement = input({\n id,\n type: 'number',\n placeholder: this.placeholder || '',\n required: Boolean(this.required),\n disabled: Boolean(this.disabled),\n min: this.min != null ? String(this.min) : undefined,\n max: this.max != null ? String(this.max) : undefined,\n step: this.step != null ? String(this.step) : undefined,\n '@input': this.boundOnChange,\n });\n\n if (this.controls) {\n div({ className: 'number-controls' }, () => {\n button({\n className: 'number-btn number-btn-increment',\n textContent: '+',\n disabled: Boolean(this.disabled),\n '@click': this.boundOnIncrement,\n });\n button({\n className: 'number-btn number-btn-decrement',\n textContent: '-',\n disabled: Boolean(this.disabled),\n '@click': this.boundOnDecrement,\n });\n });\n }\n\n this.renderActionButtons();\n });\n this.renderHelperText();\n this.renderError();\n\n if (this.fieldElement && this.value != null) {\n this.fieldElement.value = String(this.value);\n }\n });\n }\n\n protected readonly boundOnIncrement = () => {\n const current = this.getValue() || 0;\n const step = this.step ?? 1;\n let next = current + step;\n if (this.max != null && next > this.max) {\n next = this.max;\n }\n this.setValue(next, { silent: false, action: 'change' });\n };\n\n protected readonly boundOnDecrement = () => {\n const current = this.getValue() || 0;\n const step = this.step ?? 1;\n let next = current - step;\n if (this.min != null && next < this.min) {\n next = this.min;\n }\n this.setValue(next, { silent: false, action: 'change' });\n };\n\n /**\n * Get current value as number\n */\n protected getValue(): number {\n if (!this.fieldElement) return 0;\n const val = this.fieldElement.value;\n if (val === '') return 0;\n const num = parseFloat(val);\n return isNaN(num) ? 0 : num;\n }\n\n /**\n * Write value to the input element (DOM only)\n */\n protected writeValue(value: number): void {\n if (this.fieldElement) {\n this.fieldElement.value = value != null ? String(value) : '';\n }\n }\n\n /**\n * Get event payload for change events\n */\n protected getEventPayload(\n value: number,\n oldValue: number,\n action: import('../aeico-field').FieldAction,\n ): Record<string, unknown> {\n return { value, oldValue, action };\n }\n}\n\nNumberInput.register();\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'ae-number-input': NumberInput;\n }\n}\n\nexport default NumberInput;\nexport type NumberInputProps = InferProps<typeof NumberInput>;\n","import type { InferProps, Props } from 'aeico';\nimport styleVariables from '../styles/variables.css?inline';\nimport detailGroupStyle from '../styles/components/detail-group.css?inline';\nimport AeicoComponent from '../aeico-component';\nimport { html } from 'aeico';\nimport type Detail from '../detail/detail';\nimport type { DetailColor, DetailVariant } from '../detail/defines';\n\n/**\n * DetailGroup component — wraps multiple `ae-detail` elements into an\n * accordion-style group. By default only one item can be open at a time;\n * set `multiple` to allow several items open simultaneously.\n *\n * @example\n * ```html\n * <ae-detail-group>\n * <ae-detail summary=\"Section 1\">Content 1</ae-detail>\n * <ae-detail summary=\"Section 2\">Content 2</ae-detail>\n * <ae-detail summary=\"Section 3\">Content 3</ae-detail>\n * </ae-detail-group>\n * ```\n */\nclass DetailGroup extends AeicoComponent {\n static tagName = 'detail-group';\n\n static props: Props = {\n multiple: { type: Boolean },\n variant: { type: String },\n color: { type: String },\n };\n\n protected static styles = [styleVariables, detailGroupStyle];\n\n declare multiple?: boolean;\n declare variant?: DetailVariant;\n declare color?: DetailColor;\n\n private slotEl: HTMLSlotElement | null = null;\n\n private readonly DETAIL_RADIUS = 6;\n\n connectedCallback() {\n super.connectedCallback();\n this.listen('open', this._handleOpen);\n }\n\n private _getDetails(): Detail[] {\n if (!this.slotEl) return [];\n return (this.slotEl.assignedElements({ flatten: true }) as Detail[]).filter(\n (el) => el.tagName.toLowerCase() === 'ae-detail',\n );\n }\n\n private _syncChildren(): void {\n const details = this._getDetails();\n const r = this.DETAIL_RADIUS;\n\n details.forEach((detail, i) => {\n const isFirst = i === 0;\n const isLast = i === details.length - 1;\n\n // Collapse borders between adjacent items\n detail.style.marginTop = isFirst ? '' : '-1px';\n\n // Adjust per-corner radius so only the outer edges of the group keep it\n detail.style.setProperty('--detail-r-tl', isFirst ? `${r}px` : '0');\n detail.style.setProperty('--detail-r-tr', isFirst ? `${r}px` : '0');\n detail.style.setProperty('--detail-r-br', isLast ? `${r}px` : '0');\n detail.style.setProperty('--detail-r-bl', isLast ? `${r}px` : '0');\n\n // Propagate variant / color only when explicitly set on the group\n if (this.variant !== undefined) detail.variant = this.variant;\n if (this.color !== undefined) detail.color = this.color;\n });\n }\n\n private _handleOpen = (event: Event): void => {\n if (this.multiple) return;\n const opened = event.target as Element;\n this._getDetails().forEach((detail) => {\n if (detail !== opened) detail.close();\n });\n };\n\n protected render() {\n return html(({ slot }) => {\n this.slotEl = slot({\n '@slotchange': () => this._syncChildren(),\n });\n this._syncChildren();\n });\n }\n}\n\nDetailGroup.register();\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'ae-detail-group': DetailGroup;\n }\n}\n\nexport default DetailGroup;\nexport type DetailGroupProps = InferProps<typeof DetailGroup>;\n"],"names":["styleVariables"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,MAAM,oBAAoB,WAAmB;AAAA,EAA7C;AAAA;AACY,wCAAwC;AAiE/B,4CAAmB,MAAM;AAC1C,YAAM,UAAU,KAAK,SAAA,KAAc;AACnC,YAAM,OAAO,KAAK,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WAAU;AAEjB,cAHI,aAGG,SAAe;AAAA,EACpB,UAAU,EAAE,MAAM,QAAA;AAAA,EAClB,SAAS,EAAE,MAAM,OAAA;AAAA,EACjB,OAAO,EAAE,MAAM,OAAA;AAAO;AAGxB,cATI,aASa,UAAS,CAACA,WAAgB,gBAAgB;AA+D7D,YAAY,SAAA;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
+
const numberInput = require("./chunks/number-input.cjs");
|
|
4
|
+
exports.NumberInput = numberInput.NumberInput;
|
|
5
|
+
exports.default = numberInput.NumberInput;
|
|
6
|
+
//# sourceMappingURL=number-input.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"number-input.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"number-input.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
package/dist/select.cjs
CHANGED
|
@@ -4,7 +4,7 @@ const select = require("./chunks/select.cjs");
|
|
|
4
4
|
const aeicoComponent = require("./chunks/aeico-component.cjs");
|
|
5
5
|
const aeico = require("aeico");
|
|
6
6
|
const variables = require("./chunks/variables.cjs");
|
|
7
|
-
const style = ":host {\n display: block;\n\n --option-padding: 0.417em 0.667em;\n --option-bg: transparent;\n --option-bg-hover: var(--surface-raised);\n --option-bg-selected: color-mix(in srgb, var(--color-primary) 12%, transparent);\n --option-color: var(--color-text-main);\n --option-color-disabled: var(--color-text-disabled);\n --option-color-selected: var(--color-primary);\n --option-font-size: 1em;\n --option-transition: background 0.1s;\n}\n\n.option-item {\n padding: var(--option-padding);\n font-size: var(--option-font-size);\n color: var(--option-color);\n background: var(--option-bg);\n cursor: pointer;\n transition: var(--option-transition);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n user-select: none;\n}\n\n:host(:hover:not([disabled])) .option-item {\n background: var(--option-bg-hover);\n}\n\n:host([selected]) .option-item {\n background: var(--option-bg-selected);\n color: var(--option-color-selected);\n}\n\n:host([disabled]) .option-item {\n color: var(--option-color-disabled);\n cursor: default;\n pointer-events: none;\n}\n\n\n";
|
|
7
|
+
const style = ":host {\n display: block;\n\n --option-padding: 0.417em 0.667em;\n --option-bg: transparent;\n --option-bg-hover: var(--ae-surface-raised);\n --option-bg-selected: color-mix(in srgb, var(--ae-color-primary) 12%, transparent);\n --option-color: var(--ae-color-text-main);\n --option-color-disabled: var(--ae-color-text-disabled);\n --option-color-selected: var(--ae-color-primary);\n --option-font-size: 1em;\n --option-transition: background 0.1s;\n}\n\n.option-item {\n padding: var(--option-padding);\n font-size: var(--option-font-size);\n color: var(--option-color);\n background: var(--option-bg);\n cursor: pointer;\n transition: var(--option-transition);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n user-select: none;\n}\n\n:host(:hover:not([disabled])) .option-item {\n background: var(--option-bg-hover);\n}\n\n:host([selected]) .option-item {\n background: var(--option-bg-selected);\n color: var(--option-color-selected);\n}\n\n:host([disabled]) .option-item {\n color: var(--option-color-disabled);\n cursor: default;\n pointer-events: none;\n}\n\n\n";
|
|
8
8
|
var __create = Object.create;
|
|
9
9
|
var __defProp = Object.defineProperty;
|
|
10
10
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
package/dist/select.js
CHANGED
|
@@ -2,7 +2,7 @@ import { S, S as S2 } from "./chunks/select.js";
|
|
|
2
2
|
import { A as AeicoComponent } from "./chunks/aeico-component.js";
|
|
3
3
|
import { prop, html } from "aeico";
|
|
4
4
|
import { v as variables } from "./chunks/variables.js";
|
|
5
|
-
const style = ":host {\n display: block;\n\n --option-padding: 0.417em 0.667em;\n --option-bg: transparent;\n --option-bg-hover: var(--surface-raised);\n --option-bg-selected: color-mix(in srgb, var(--color-primary) 12%, transparent);\n --option-color: var(--color-text-main);\n --option-color-disabled: var(--color-text-disabled);\n --option-color-selected: var(--color-primary);\n --option-font-size: 1em;\n --option-transition: background 0.1s;\n}\n\n.option-item {\n padding: var(--option-padding);\n font-size: var(--option-font-size);\n color: var(--option-color);\n background: var(--option-bg);\n cursor: pointer;\n transition: var(--option-transition);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n user-select: none;\n}\n\n:host(:hover:not([disabled])) .option-item {\n background: var(--option-bg-hover);\n}\n\n:host([selected]) .option-item {\n background: var(--option-bg-selected);\n color: var(--option-color-selected);\n}\n\n:host([disabled]) .option-item {\n color: var(--option-color-disabled);\n cursor: default;\n pointer-events: none;\n}\n\n\n";
|
|
5
|
+
const style = ":host {\n display: block;\n\n --option-padding: 0.417em 0.667em;\n --option-bg: transparent;\n --option-bg-hover: var(--ae-surface-raised);\n --option-bg-selected: color-mix(in srgb, var(--ae-color-primary) 12%, transparent);\n --option-color: var(--ae-color-text-main);\n --option-color-disabled: var(--ae-color-text-disabled);\n --option-color-selected: var(--ae-color-primary);\n --option-font-size: 1em;\n --option-transition: background 0.1s;\n}\n\n.option-item {\n padding: var(--option-padding);\n font-size: var(--option-font-size);\n color: var(--option-color);\n background: var(--option-bg);\n cursor: pointer;\n transition: var(--option-transition);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n user-select: none;\n}\n\n:host(:hover:not([disabled])) .option-item {\n background: var(--option-bg-hover);\n}\n\n:host([selected]) .option-item {\n background: var(--option-bg-selected);\n color: var(--option-color-selected);\n}\n\n:host([disabled]) .option-item {\n color: var(--option-color-disabled);\n cursor: default;\n pointer-events: none;\n}\n\n\n";
|
|
6
6
|
var __create = Object.create;
|
|
7
7
|
var __defProp = Object.defineProperty;
|
|
8
8
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type CardVariant = 'subtle' | 'faint' | 'filled' | 'outlined';
|
|
1
|
+
export type CardVariant = 'subtle' | 'faint' | 'filled' | 'outlined' | 'text';
|
|
2
2
|
export type CardColor = 'default' | 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'light' | 'dark';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export type DetailVariant = 'subtle' | 'faint' | 'filled' | 'outlined';
|
|
1
|
+
export type DetailVariant = 'subtle' | 'faint' | 'filled' | 'outlined' | 'text';
|
|
2
2
|
export type DetailIconPlacement = 'start' | 'end';
|
|
3
3
|
export type DetailColor = 'default' | 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'light' | 'dark';
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
export type IconSize = '3xs' | '2xs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | number;
|
|
2
2
|
export type IconColor = 'default' | 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info';
|
|
3
|
+
export interface IconPathDef {
|
|
4
|
+
d: string;
|
|
5
|
+
fill?: string;
|
|
6
|
+
}
|
|
3
7
|
export interface IconDefinition {
|
|
4
|
-
|
|
8
|
+
paths: string | IconPathDef[];
|
|
5
9
|
viewBox?: string;
|
|
6
10
|
stroke?: boolean;
|
|
7
11
|
strokeWidth?: number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { default as Icon } from './icon';
|
|
2
2
|
export type { IconProps } from './icon';
|
|
3
3
|
export { default as IconRegistry } from './registry';
|
|
4
|
-
export type { IconSize, IconColor, IconDefinition, IconRegistryData } from './defines';
|
|
4
|
+
export type { IconSize, IconColor, IconDefinition, IconPathDef, IconRegistryData } from './defines';
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { Props } from 'aeico';
|
|
2
2
|
import AeicoComponent from '../aeico-component';
|
|
3
|
+
import type { TabVariant } from './defines';
|
|
3
4
|
declare class Tabs extends AeicoComponent {
|
|
4
5
|
static props: Props;
|
|
5
6
|
activeIndex?: number;
|
|
7
|
+
variant?: TabVariant;
|
|
6
8
|
protected static styles: string[];
|
|
7
9
|
private _observer;
|
|
8
10
|
private get _tabs();
|
|
@@ -11,6 +13,7 @@ declare class Tabs extends AeicoComponent {
|
|
|
11
13
|
connectedCallback(): void;
|
|
12
14
|
disconnectedCallback(): void;
|
|
13
15
|
protected onUpdated(): void;
|
|
16
|
+
private _syncVariant;
|
|
14
17
|
private _handleTabClick;
|
|
15
18
|
private _syncActive;
|
|
16
19
|
selectTab(index: number): void;
|
package/package.json
CHANGED
package/src/card/defines.ts
CHANGED