aeico-components 0.1.4 → 0.1.6
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/LICENSE +21 -0
- package/README.md +0 -0
- package/dist/chunks/action-button.cjs +296 -0
- package/dist/chunks/action-button.cjs.map +1 -0
- package/dist/chunks/action-button.js +297 -0
- package/dist/chunks/action-button.js.map +1 -0
- package/dist/chunks/alert.cjs +4 -4
- package/dist/chunks/alert.cjs.map +1 -1
- package/dist/chunks/alert.js +5 -5
- package/dist/chunks/alert.js.map +1 -1
- package/dist/chunks/badge.cjs +1 -1
- package/dist/chunks/badge.cjs.map +1 -1
- package/dist/chunks/badge.js +2 -2
- package/dist/chunks/badge.js.map +1 -1
- package/dist/chunks/breadcrumb-item.cjs +2 -2
- package/dist/chunks/breadcrumb-item.cjs.map +1 -1
- package/dist/chunks/breadcrumb-item.js +3 -3
- package/dist/chunks/breadcrumb-item.js.map +1 -1
- package/dist/chunks/button-group.cjs +1 -1
- package/dist/chunks/button-group.cjs.map +1 -1
- package/dist/chunks/button-group.js +2 -2
- package/dist/chunks/button-group.js.map +1 -1
- package/dist/chunks/button.cjs +12 -15
- package/dist/chunks/button.cjs.map +1 -1
- package/dist/chunks/button.js +13 -16
- package/dist/chunks/button.js.map +1 -1
- package/dist/chunks/card.cjs +1 -1
- package/dist/chunks/card.cjs.map +1 -1
- package/dist/chunks/card.js +2 -2
- package/dist/chunks/card.js.map +1 -1
- package/dist/chunks/checkbox.cjs +18 -5
- package/dist/chunks/checkbox.cjs.map +1 -1
- package/dist/chunks/checkbox.js +18 -5
- package/dist/chunks/checkbox.js.map +1 -1
- package/dist/chunks/copy-button.cjs +168 -0
- package/dist/chunks/copy-button.cjs.map +1 -0
- package/dist/chunks/copy-button.js +169 -0
- package/dist/chunks/copy-button.js.map +1 -0
- package/dist/chunks/detail.cjs +7 -4
- package/dist/chunks/detail.cjs.map +1 -1
- package/dist/chunks/detail.js +8 -5
- package/dist/chunks/detail.js.map +1 -1
- package/dist/chunks/dialog.cjs +1 -1
- package/dist/chunks/dialog.cjs.map +1 -1
- package/dist/chunks/dialog.js +2 -2
- package/dist/chunks/dialog.js.map +1 -1
- package/dist/chunks/divider.cjs +1 -1
- package/dist/chunks/divider.cjs.map +1 -1
- package/dist/chunks/divider.js +2 -2
- package/dist/chunks/divider.js.map +1 -1
- package/dist/chunks/drawer.cjs +180 -0
- package/dist/chunks/drawer.cjs.map +1 -0
- package/dist/chunks/drawer.js +181 -0
- package/dist/chunks/drawer.js.map +1 -0
- package/dist/chunks/dropdown-button.cjs +2 -2
- package/dist/chunks/dropdown-button.cjs.map +1 -1
- package/dist/chunks/dropdown-button.js +6 -6
- package/dist/chunks/dropdown-button.js.map +1 -1
- package/dist/chunks/icon.cjs +31 -1
- package/dist/chunks/icon.cjs.map +1 -1
- package/dist/chunks/icon.js +32 -2
- package/dist/chunks/icon.js.map +1 -1
- package/dist/chunks/menu.cjs +396 -0
- package/dist/chunks/menu.cjs.map +1 -0
- package/dist/chunks/menu.js +397 -0
- package/dist/chunks/menu.js.map +1 -0
- package/dist/chunks/navbar.cjs +2 -3
- package/dist/chunks/navbar.cjs.map +1 -1
- package/dist/chunks/navbar.js +3 -4
- package/dist/chunks/navbar.js.map +1 -1
- package/dist/chunks/pagination.cjs +475 -0
- package/dist/chunks/pagination.cjs.map +1 -0
- package/dist/chunks/pagination.js +476 -0
- package/dist/chunks/pagination.js.map +1 -0
- package/dist/chunks/progress-bar.cjs +101 -0
- package/dist/chunks/progress-bar.cjs.map +1 -0
- package/dist/chunks/progress-bar.js +102 -0
- package/dist/chunks/progress-bar.js.map +1 -0
- package/dist/chunks/radio.cjs +11 -7
- package/dist/chunks/radio.cjs.map +1 -1
- package/dist/chunks/radio.js +11 -7
- package/dist/chunks/radio.js.map +1 -1
- package/dist/chunks/select.cjs +97 -66
- package/dist/chunks/select.cjs.map +1 -1
- package/dist/chunks/select.js +97 -66
- package/dist/chunks/select.js.map +1 -1
- package/dist/chunks/slider.cjs +9 -46
- package/dist/chunks/slider.cjs.map +1 -1
- package/dist/chunks/slider.js +9 -46
- package/dist/chunks/slider.js.map +1 -1
- package/dist/chunks/spinner.cjs +102 -0
- package/dist/chunks/spinner.cjs.map +1 -0
- package/dist/chunks/spinner.js +103 -0
- package/dist/chunks/spinner.js.map +1 -0
- package/dist/chunks/switch.cjs +110 -16
- package/dist/chunks/switch.cjs.map +1 -1
- package/dist/chunks/switch.js +111 -17
- package/dist/chunks/switch.js.map +1 -1
- package/dist/chunks/tab-panel.cjs +6 -7
- package/dist/chunks/tab-panel.cjs.map +1 -1
- package/dist/chunks/tab-panel.js +7 -8
- package/dist/chunks/tab-panel.js.map +1 -1
- package/dist/chunks/tag.cjs +1 -1
- package/dist/chunks/tag.cjs.map +1 -1
- package/dist/chunks/tag.js +2 -2
- package/dist/chunks/tag.js.map +1 -1
- package/dist/chunks/text-input.cjs +11 -16
- package/dist/chunks/text-input.cjs.map +1 -1
- package/dist/chunks/text-input.js +11 -16
- package/dist/chunks/text-input.js.map +1 -1
- package/dist/chunks/textarea.cjs +137 -0
- package/dist/chunks/textarea.cjs.map +1 -0
- package/dist/chunks/textarea.js +138 -0
- package/dist/chunks/textarea.js.map +1 -0
- package/dist/chunks/tooltip.cjs +293 -0
- package/dist/chunks/tooltip.cjs.map +1 -0
- package/dist/chunks/tooltip.js +294 -0
- package/dist/chunks/tooltip.js.map +1 -0
- package/dist/chunks/tree.cjs +468 -0
- package/dist/chunks/tree.cjs.map +1 -0
- package/dist/chunks/tree.js +469 -0
- package/dist/chunks/tree.js.map +1 -0
- package/dist/chunks/variables.cjs +2 -2
- package/dist/chunks/variables.js +2 -2
- package/dist/copy-button.cjs +6 -0
- package/dist/copy-button.cjs.map +1 -0
- package/dist/copy-button.js +6 -0
- package/dist/copy-button.js.map +1 -0
- package/dist/drawer.cjs +6 -0
- package/dist/drawer.cjs.map +1 -0
- package/dist/drawer.js +6 -0
- package/dist/drawer.js.map +1 -0
- package/dist/dropdown.js +4 -4
- package/dist/index.cjs +186 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +201 -15
- package/dist/index.js.map +1 -1
- package/dist/menu.cjs +6 -0
- package/dist/menu.cjs.map +1 -0
- package/dist/menu.js +6 -0
- package/dist/menu.js.map +1 -0
- package/dist/pagination.cjs +6 -0
- package/dist/pagination.cjs.map +1 -0
- package/dist/pagination.js +6 -0
- package/dist/pagination.js.map +1 -0
- package/dist/progress-bar.cjs +6 -0
- package/dist/progress-bar.cjs.map +1 -0
- package/dist/progress-bar.js +6 -0
- package/dist/progress-bar.js.map +1 -0
- package/dist/select.cjs +1 -1
- package/dist/select.cjs.map +1 -1
- package/dist/select.js +2 -2
- package/dist/select.js.map +1 -1
- package/dist/spinner.cjs +6 -0
- package/dist/spinner.cjs.map +1 -0
- package/dist/spinner.js +6 -0
- package/dist/spinner.js.map +1 -0
- package/dist/textarea.cjs +5 -0
- package/dist/textarea.cjs.map +1 -0
- package/dist/textarea.js +5 -0
- package/dist/textarea.js.map +1 -0
- package/dist/tooltip.cjs +6 -0
- package/dist/tooltip.cjs.map +1 -0
- package/dist/tooltip.js +6 -0
- package/dist/tooltip.js.map +1 -0
- package/dist/tree.cjs +6 -0
- package/dist/tree.cjs.map +1 -0
- package/dist/tree.js +6 -0
- package/dist/tree.js.map +1 -0
- package/dist/types/aeico-field.d.ts +57 -5
- package/dist/types/alert/alert.d.ts +1 -0
- package/dist/types/button/button.d.ts +2 -1
- package/dist/types/checkbox/checkbox.d.ts +5 -5
- package/dist/types/copy-button/copy-button.d.ts +32 -0
- package/dist/types/copy-button/defines.d.ts +1 -0
- package/dist/types/copy-button/index.d.ts +3 -0
- package/dist/types/detail/defines.d.ts +1 -0
- package/dist/types/detail/detail.d.ts +3 -1
- package/dist/types/detail/index.d.ts +1 -1
- package/dist/types/detail-group/detail-group.d.ts +39 -0
- package/dist/types/detail-group/index.d.ts +2 -0
- package/dist/types/drawer/defines.d.ts +1 -0
- package/dist/types/drawer/drawer.d.ts +31 -0
- package/dist/types/drawer/index.d.ts +3 -0
- package/dist/types/icon/built-in-icons.d.ts +1 -0
- package/dist/types/icon/icon.d.ts +1 -0
- package/dist/types/icon/registry.d.ts +8 -0
- package/dist/types/index.d.ts +19 -0
- package/dist/types/menu/defines.d.ts +15 -0
- package/dist/types/menu/index.d.ts +5 -0
- package/dist/types/menu/menu-item.d.ts +63 -0
- package/dist/types/menu/menu.d.ts +34 -0
- package/dist/types/number-input/index.d.ts +2 -0
- package/dist/types/number-input/number-input.d.ts +35 -0
- package/dist/types/pagination/defines.d.ts +2 -0
- package/dist/types/pagination/index.d.ts +3 -0
- package/dist/types/pagination/pagination.d.ts +77 -0
- package/dist/types/progress-bar/defines.d.ts +1 -0
- package/dist/types/progress-bar/index.d.ts +3 -0
- package/dist/types/progress-bar/progress-bar.d.ts +37 -0
- package/dist/types/radio-group/radio-group.d.ts +1 -1
- package/dist/types/select/select.d.ts +3 -3
- package/dist/types/spinner/defines.d.ts +3 -0
- package/dist/types/spinner/index.d.ts +3 -0
- package/dist/types/spinner/spinner.d.ts +35 -0
- package/dist/types/switch/defines.d.ts +1 -0
- package/dist/types/switch/switch.d.ts +13 -9
- package/dist/types/text-input/text-input.d.ts +0 -4
- package/dist/types/textarea/index.d.ts +1 -0
- package/dist/types/textarea/textarea.d.ts +26 -0
- package/dist/types/tooltip/defines.d.ts +2 -0
- package/dist/types/tooltip/index.d.ts +4 -0
- package/dist/types/tooltip/tooltip.d.ts +48 -0
- package/dist/types/tree/defines.d.ts +23 -0
- package/dist/types/tree/index.d.ts +5 -0
- package/dist/types/tree/tree-item.d.ts +54 -0
- package/dist/types/tree/tree.d.ts +64 -0
- package/package.json +6 -6
- package/src/aeico-field.ts +154 -15
- package/src/alert/alert.ts +3 -2
- package/src/button/button.ts +11 -13
- package/src/checkbox/checkbox.ts +21 -6
- package/src/copy-button/copy-button.ts +146 -0
- package/src/copy-button/defines.ts +5 -0
- package/src/copy-button/index.ts +3 -0
- package/src/detail/defines.ts +1 -0
- package/src/detail/detail.ts +5 -1
- package/src/detail/index.ts +1 -1
- package/src/detail-group/detail-group.ts +104 -0
- package/src/detail-group/index.ts +2 -0
- package/src/drawer/defines.ts +1 -0
- package/src/drawer/drawer.ts +157 -0
- package/src/drawer/index.ts +3 -0
- package/src/icon/built-in-icons.ts +21 -0
- package/src/icon/icon.ts +1 -0
- package/src/icon/registry.ts +22 -0
- package/src/index.ts +32 -0
- package/src/menu/defines.ts +17 -0
- package/src/menu/index.ts +5 -0
- package/src/menu/menu-item.ts +315 -0
- package/src/menu/menu.ts +81 -0
- package/src/navbar/navbar.ts +1 -3
- package/src/number-input/index.ts +2 -0
- package/src/number-input/number-input.ts +137 -0
- package/src/pagination/defines.ts +2 -0
- package/src/pagination/index.ts +3 -0
- package/src/pagination/pagination.ts +310 -0
- package/src/progress-bar/defines.ts +8 -0
- package/src/progress-bar/index.ts +3 -0
- package/src/progress-bar/progress-bar.ts +80 -0
- package/src/radio-group/radio-group.ts +12 -5
- package/src/select/select.ts +112 -71
- package/src/slider/slider.ts +9 -2
- package/src/spinner/defines.ts +12 -0
- package/src/spinner/index.ts +3 -0
- package/src/spinner/spinner.ts +81 -0
- package/src/styles/components/action-button.css +37 -0
- package/src/styles/components/checkbox.css +4 -26
- package/src/styles/components/copy-button.css +119 -0
- package/src/styles/components/detail-group.css +10 -0
- package/src/styles/components/detail.css +10 -1
- package/src/styles/components/drawer.css +161 -0
- package/src/styles/components/field-label.css +120 -0
- package/src/styles/components/menu-item.css +168 -0
- package/src/styles/components/menu.css +17 -0
- package/src/styles/components/number-input.css +167 -0
- package/src/styles/components/pagination.css +205 -0
- package/src/styles/components/progress-bar.css +44 -0
- package/src/styles/components/radio-group.css +0 -23
- package/src/styles/components/select.css +12 -39
- package/src/styles/components/slider.css +0 -42
- package/src/styles/components/spinner.css +80 -0
- package/src/styles/components/switch.css +68 -19
- package/src/styles/components/tab-panel.css +1 -1
- package/src/styles/components/tabs.css +1 -0
- package/src/styles/components/text-input.css +7 -45
- package/src/styles/components/textarea.css +75 -0
- package/src/styles/components/tooltip.css +103 -0
- package/src/styles/components/tree-item.css +152 -0
- package/src/styles/components/tree.css +10 -0
- package/src/styles/layout.css +457 -25
- package/src/switch/defines.ts +1 -0
- package/src/switch/switch.ts +65 -16
- package/src/tabs/tab.ts +1 -1
- package/src/tabs/tabs.ts +1 -2
- package/src/text-input/text-input.ts +10 -15
- package/src/textarea/index.ts +1 -0
- package/src/textarea/textarea.ts +107 -0
- package/src/tooltip/defines.ts +11 -0
- package/src/tooltip/index.ts +4 -0
- package/src/tooltip/tooltip.ts +183 -0
- package/src/tree/defines.ts +26 -0
- package/src/tree/index.ts +5 -0
- package/src/tree/tree-item.ts +258 -0
- package/src/tree/tree.ts +237 -0
- package/dist/chunks/aeico-field.cjs +0 -179
- package/dist/chunks/aeico-field.cjs.map +0 -1
- package/dist/chunks/aeico-field.js +0 -180
- package/dist/chunks/aeico-field.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
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);
|
|
2
5
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
6
|
const textInput = require("./chunks/text-input.cjs");
|
|
7
|
+
const textarea = require("./chunks/textarea.cjs");
|
|
4
8
|
const select = require("./chunks/select.cjs");
|
|
5
9
|
const slider = require("./chunks/slider.cjs");
|
|
6
10
|
const checkbox = require("./chunks/checkbox.cjs");
|
|
@@ -8,20 +12,190 @@ const radio = require("./chunks/radio.cjs");
|
|
|
8
12
|
const _switch = require("./chunks/switch.cjs");
|
|
9
13
|
const breadcrumbItem = require("./chunks/breadcrumb-item.cjs");
|
|
10
14
|
const button = require("./chunks/button.cjs");
|
|
15
|
+
const copyButton = require("./chunks/copy-button.cjs");
|
|
11
16
|
const dropdownButton = require("./chunks/dropdown-button.cjs");
|
|
12
17
|
const buttonGroup = require("./chunks/button-group.cjs");
|
|
13
18
|
const badge = require("./chunks/badge.cjs");
|
|
14
19
|
const tag = require("./chunks/tag.cjs");
|
|
15
20
|
const alert = require("./chunks/alert.cjs");
|
|
16
21
|
const dialog = require("./chunks/dialog.cjs");
|
|
22
|
+
const drawer = require("./chunks/drawer.cjs");
|
|
17
23
|
const icon = require("./chunks/icon.cjs");
|
|
18
24
|
const iconButton = require("./chunks/icon-button.cjs");
|
|
19
25
|
const tabPanel = require("./chunks/tab-panel.cjs");
|
|
20
26
|
const divider = require("./chunks/divider.cjs");
|
|
21
27
|
const card = require("./chunks/card.cjs");
|
|
22
28
|
const navbar = require("./chunks/navbar.cjs");
|
|
29
|
+
const spinner = require("./chunks/spinner.cjs");
|
|
23
30
|
const detail = require("./chunks/detail.cjs");
|
|
31
|
+
const progressBar = require("./chunks/progress-bar.cjs");
|
|
32
|
+
const menu = require("./chunks/menu.cjs");
|
|
33
|
+
const tooltip = require("./chunks/tooltip.cjs");
|
|
34
|
+
const pagination = require("./chunks/pagination.cjs");
|
|
35
|
+
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();
|
|
24
197
|
exports.TextInput = textInput.TextInput;
|
|
198
|
+
exports.Textarea = textarea.Textarea;
|
|
25
199
|
exports.Select = select.Select;
|
|
26
200
|
exports.Slider = slider.Slider;
|
|
27
201
|
exports.Checkbox = checkbox.Checkbox;
|
|
@@ -31,6 +205,7 @@ exports.Switch = _switch.Switch;
|
|
|
31
205
|
exports.Breadcrumb = breadcrumbItem.Breadcrumb;
|
|
32
206
|
exports.BreadcrumbItem = breadcrumbItem.BreadcrumbItem;
|
|
33
207
|
exports.Button = button.Button;
|
|
208
|
+
exports.CopyButton = copyButton.CopyButton;
|
|
34
209
|
exports.Dropdown = dropdownButton.Dropdown;
|
|
35
210
|
exports.DropdownButton = dropdownButton.DropdownButton;
|
|
36
211
|
exports.DropdownItem = dropdownButton.DropdownItem;
|
|
@@ -39,6 +214,7 @@ exports.Badge = badge.Badge;
|
|
|
39
214
|
exports.Tag = tag.Tag;
|
|
40
215
|
exports.Alert = alert.Alert;
|
|
41
216
|
exports.Dialog = dialog.Dialog;
|
|
217
|
+
exports.Drawer = drawer.Drawer;
|
|
42
218
|
exports.Icon = icon.Icon;
|
|
43
219
|
exports.IconRegistry = icon.IconRegistry;
|
|
44
220
|
exports.IconButton = iconButton.IconButton;
|
|
@@ -48,5 +224,15 @@ exports.Tabs = tabPanel.Tabs;
|
|
|
48
224
|
exports.Divider = divider.Divider;
|
|
49
225
|
exports.Card = card.Card;
|
|
50
226
|
exports.Navbar = navbar.Navbar;
|
|
227
|
+
exports.Spinner = spinner.Spinner;
|
|
51
228
|
exports.Detail = detail.Detail;
|
|
229
|
+
exports.ProgressBar = progressBar.ProgressBar;
|
|
230
|
+
exports.Menu = menu.Menu;
|
|
231
|
+
exports.MenuItem = menu.MenuItem;
|
|
232
|
+
exports.Tooltip = tooltip.Tooltip;
|
|
233
|
+
exports.Pagination = pagination.Pagination;
|
|
234
|
+
exports.Tree = tree.Tree;
|
|
235
|
+
exports.TreeItem = tree.TreeItem;
|
|
236
|
+
exports.DetailGroup = DetailGroup;
|
|
237
|
+
exports.NumberInput = NumberInput;
|
|
52
238
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
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,UAAI,EAAE,WAAW,6BAAA,GAAgC,MAAM;AACrD,aAAK,eAAe,MAAM;AAAA,UACxB;AAAA,UACA,MAAM;AAAA,UACN,aAAa,KAAK,eAAe;AAAA,UACjC,UAAU,QAAQ,KAAK,QAAQ;AAAA,UAC/B,UAAU,QAAQ,KAAK,QAAQ;AAAA,UAC/B,KAAK,KAAK,OAAO,OAAO,OAAO,KAAK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,YAAY,iBAAiB,UAAU,GAAG,CAAC,OAAO,GAAG;AAClE,MAAAA,QAAO,MAAM,YAAY,iBAAiB,SAAS,GAAG,CAAC,OAAO,GAAG;AACjE,MAAAA,QAAO,MAAM,YAAY,iBAAiB,SAAS,GAAG,CAAC,OAAO,GAAG;AAGjE,UAAI,KAAK,YAAY,OAAW,CAAAA,QAAO,UAAU,KAAK;AACtD,UAAI,KAAK,UAAU,OAAW,CAAAA,QAAO,QAAQ,KAAK;AAAA,IACpD,CAAC;AAAA,EACH;AAAA,EAUU,SAAS;AACjB,WAAOP,MAAAA,KAAK,CAAC,EAAE,WAAW;AACxB,WAAK,SAAS,KAAK;AAAA,QACjB,eAAe,MAAM,KAAK,cAAA;AAAA,MAAc,CACzC;AACD,WAAK,cAAA;AAAA,IACP,CAAC;AAAA,EACH;AACF;AArEE,cADI,aACG,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,CAACQ,UAAAA,WAAgB,gBAAgB;AA+D7D,YAAY,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
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);
|
|
1
4
|
import { T } from "./chunks/text-input.js";
|
|
5
|
+
import { T as T2 } from "./chunks/textarea.js";
|
|
2
6
|
import { S } from "./chunks/select.js";
|
|
3
7
|
import { S as S2 } from "./chunks/slider.js";
|
|
4
8
|
import { C } from "./chunks/checkbox.js";
|
|
@@ -6,19 +10,188 @@ import { R, a } from "./chunks/radio.js";
|
|
|
6
10
|
import { S as S3 } from "./chunks/switch.js";
|
|
7
11
|
import { B, a as a2 } from "./chunks/breadcrumb-item.js";
|
|
8
12
|
import { B as B2 } from "./chunks/button.js";
|
|
9
|
-
import {
|
|
13
|
+
import { C as C2 } from "./chunks/copy-button.js";
|
|
14
|
+
import { b, D, a as a3 } from "./chunks/dropdown-button.js";
|
|
10
15
|
import { B as B3 } from "./chunks/button-group.js";
|
|
11
16
|
import { B as B4 } from "./chunks/badge.js";
|
|
12
|
-
import { T as
|
|
17
|
+
import { T as T3 } from "./chunks/tag.js";
|
|
13
18
|
import { A } from "./chunks/alert.js";
|
|
14
19
|
import { D as D2 } from "./chunks/dialog.js";
|
|
20
|
+
import { D as D3 } from "./chunks/drawer.js";
|
|
15
21
|
import { I, a as a4 } from "./chunks/icon.js";
|
|
16
22
|
import { I as I2 } from "./chunks/icon-button.js";
|
|
17
|
-
import { T as
|
|
18
|
-
import { D as
|
|
19
|
-
import { C as
|
|
23
|
+
import { T as T4, a as a5, b as b2 } from "./chunks/tab-panel.js";
|
|
24
|
+
import { D as D4 } from "./chunks/divider.js";
|
|
25
|
+
import { C as C3 } from "./chunks/card.js";
|
|
20
26
|
import { N } from "./chunks/navbar.js";
|
|
21
|
-
import {
|
|
27
|
+
import { S as S4 } from "./chunks/spinner.js";
|
|
28
|
+
import { D as D5 } from "./chunks/detail.js";
|
|
29
|
+
import { P } from "./chunks/progress-bar.js";
|
|
30
|
+
import { M, a as a6 } from "./chunks/menu.js";
|
|
31
|
+
import { T as T5 } from "./chunks/tooltip.js";
|
|
32
|
+
import { P as P2 } from "./chunks/pagination.js";
|
|
33
|
+
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();
|
|
22
195
|
export {
|
|
23
196
|
A as Alert,
|
|
24
197
|
B4 as Badge,
|
|
@@ -26,27 +199,40 @@ export {
|
|
|
26
199
|
a2 as BreadcrumbItem,
|
|
27
200
|
B2 as Button,
|
|
28
201
|
B3 as ButtonGroup,
|
|
29
|
-
|
|
202
|
+
C3 as Card,
|
|
30
203
|
C as Checkbox,
|
|
31
|
-
|
|
204
|
+
C2 as CopyButton,
|
|
205
|
+
D5 as Detail,
|
|
206
|
+
DetailGroup,
|
|
32
207
|
D2 as Dialog,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
208
|
+
D4 as Divider,
|
|
209
|
+
D3 as Drawer,
|
|
210
|
+
b as Dropdown,
|
|
211
|
+
D as DropdownButton,
|
|
212
|
+
a3 as DropdownItem,
|
|
37
213
|
I as Icon,
|
|
38
214
|
I2 as IconButton,
|
|
39
215
|
a4 as IconRegistry,
|
|
216
|
+
M as Menu,
|
|
217
|
+
a6 as MenuItem,
|
|
40
218
|
N as Navbar,
|
|
219
|
+
NumberInput,
|
|
220
|
+
P2 as Pagination,
|
|
221
|
+
P as ProgressBar,
|
|
41
222
|
R as Radio,
|
|
42
223
|
a as RadioGroup,
|
|
43
224
|
S as Select,
|
|
44
225
|
S2 as Slider,
|
|
226
|
+
S4 as Spinner,
|
|
45
227
|
S3 as Switch,
|
|
46
|
-
|
|
228
|
+
T4 as Tab,
|
|
47
229
|
a5 as TabPanel,
|
|
48
230
|
b2 as Tabs,
|
|
49
|
-
|
|
50
|
-
T as TextInput
|
|
231
|
+
T3 as Tag,
|
|
232
|
+
T as TextInput,
|
|
233
|
+
T2 as Textarea,
|
|
234
|
+
T5 as Tooltip,
|
|
235
|
+
T6 as Tree,
|
|
236
|
+
a7 as TreeItem
|
|
51
237
|
};
|
|
52
238
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;"}
|
|
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,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,WAAO,KAAK,CAAC,EAAE,KAAK,OAAO,aAAa;AACtC,YAAM,KAAK,KAAK,WAAA;AAChB,WAAK,YAAY,EAAE;AACnB,UAAI,EAAE,WAAW,6BAAA,GAAgC,MAAM;AACrD,aAAK,eAAe,MAAM;AAAA,UACxB;AAAA,UACA,MAAM;AAAA,UACN,aAAa,KAAK,eAAe;AAAA,UACjC,UAAU,QAAQ,KAAK,QAAQ;AAAA,UAC/B,UAAU,QAAQ,KAAK,QAAQ;AAAA,UAC/B,KAAK,KAAK,OAAO,OAAO,OAAO,KAAK,GAAG,IAAI;AAAA,UAC3C,KAAK,KAAK,OAAO,OAAO,O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BAAiB,SAAS,GAAG,CAAC,OAAO,GAAG;AAGjE,UAAI,KAAK,YAAY,OAAW,QAAO,UAAU,KAAK;AACtD,UAAI,KAAK,UAAU,OAAW,QAAO,QAAQ,KAAK;AAAA,IACpD,CAAC;AAAA,EACH;AAAA,EAUU,SAAS;AACjB,WAAO,KAAK,CAAC,EAAE,WAAW;AACxB,WAAK,SAAS,KAAK;AAAA,QACjB,eAAe,MAAM,KAAK,cAAA;AAAA,MAAc,CACzC;AACD,WAAK,cAAA;AAAA,IACP,CAAC;AAAA,EACH;AACF;AArEE,cADI,aACG,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;"}
|
package/dist/menu.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menu.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
package/dist/menu.js
ADDED
package/dist/menu.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menu.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 pagination = require("./chunks/pagination.cjs");
|
|
4
|
+
exports.Pagination = pagination.Pagination;
|
|
5
|
+
exports.default = pagination.Pagination;
|
|
6
|
+
//# sourceMappingURL=pagination.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagination.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagination.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 progressBar = require("./chunks/progress-bar.cjs");
|
|
4
|
+
exports.ProgressBar = progressBar.ProgressBar;
|
|
5
|
+
exports.default = progressBar.ProgressBar;
|
|
6
|
+
//# sourceMappingURL=progress-bar.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progress-bar.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progress-bar.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
package/dist/select.cjs
CHANGED
|
@@ -91,7 +91,7 @@ __decorateElement(_init, 4, "disabled", _disabled_dec, SelectOption, _disabled);
|
|
|
91
91
|
__decorateElement(_init, 4, "selected", _selected_dec, SelectOption, _selected);
|
|
92
92
|
__decoratorMetadata(_init, SelectOption);
|
|
93
93
|
__publicField(SelectOption, "tagName", "select-option");
|
|
94
|
-
__publicField(SelectOption, "styles", [variables.
|
|
94
|
+
__publicField(SelectOption, "styles", [variables.variables, style]);
|
|
95
95
|
SelectOption.register();
|
|
96
96
|
exports.Select = select.Select;
|
|
97
97
|
exports.default = select.Select;
|