@chromvoid/uikit 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +8 -0
- package/README.md +96 -0
- package/dist/components/cv-accordion-item.d.ts +69 -0
- package/dist/components/cv-accordion-item.js +176 -0
- package/dist/components/cv-accordion.d.ts +79 -0
- package/dist/components/cv-accordion.js +310 -0
- package/dist/components/cv-alert-dialog.d.ts +86 -0
- package/dist/components/cv-alert-dialog.js +393 -0
- package/dist/components/cv-alert.d.ts +48 -0
- package/dist/components/cv-alert.js +156 -0
- package/dist/components/cv-badge.d.ts +56 -0
- package/dist/components/cv-badge.js +280 -0
- package/dist/components/cv-breadcrumb-item.d.ts +35 -0
- package/dist/components/cv-breadcrumb-item.js +64 -0
- package/dist/components/cv-breadcrumb.d.ts +39 -0
- package/dist/components/cv-breadcrumb.js +160 -0
- package/dist/components/cv-button.d.ts +83 -0
- package/dist/components/cv-button.js +541 -0
- package/dist/components/cv-callout.d.ts +32 -0
- package/dist/components/cv-callout.js +221 -0
- package/dist/components/cv-card.d.ts +48 -0
- package/dist/components/cv-card.js +269 -0
- package/dist/components/cv-carousel-slide.d.ts +25 -0
- package/dist/components/cv-carousel-slide.js +51 -0
- package/dist/components/cv-carousel.d.ts +96 -0
- package/dist/components/cv-carousel.js +457 -0
- package/dist/components/cv-checkbox.d.ts +84 -0
- package/dist/components/cv-checkbox.js +274 -0
- package/dist/components/cv-combobox-group.d.ts +15 -0
- package/dist/components/cv-combobox-group.js +34 -0
- package/dist/components/cv-combobox-option.d.ts +30 -0
- package/dist/components/cv-combobox-option.js +66 -0
- package/dist/components/cv-combobox.d.ts +135 -0
- package/dist/components/cv-combobox.js +834 -0
- package/dist/components/cv-command-item.d.ts +30 -0
- package/dist/components/cv-command-item.js +68 -0
- package/dist/components/cv-command-palette.d.ts +105 -0
- package/dist/components/cv-command-palette.js +578 -0
- package/dist/components/cv-context-menu.d.ts +98 -0
- package/dist/components/cv-context-menu.js +515 -0
- package/dist/components/cv-copy-button.d.ts +61 -0
- package/dist/components/cv-copy-button.js +318 -0
- package/dist/components/cv-date-picker.d.ts +161 -0
- package/dist/components/cv-date-picker.js +803 -0
- package/dist/components/cv-dialog.d.ts +89 -0
- package/dist/components/cv-dialog.js +459 -0
- package/dist/components/cv-disclosure.d.ts +57 -0
- package/dist/components/cv-disclosure.js +241 -0
- package/dist/components/cv-drawer.d.ts +102 -0
- package/dist/components/cv-drawer.js +595 -0
- package/dist/components/cv-feed-article.d.ts +26 -0
- package/dist/components/cv-feed-article.js +52 -0
- package/dist/components/cv-feed.d.ts +62 -0
- package/dist/components/cv-feed.js +310 -0
- package/dist/components/cv-grid-cell.d.ts +30 -0
- package/dist/components/cv-grid-cell.js +57 -0
- package/dist/components/cv-grid-column.d.ts +30 -0
- package/dist/components/cv-grid-column.js +43 -0
- package/dist/components/cv-grid-row.d.ts +30 -0
- package/dist/components/cv-grid-row.js +42 -0
- package/dist/components/cv-grid.d.ts +119 -0
- package/dist/components/cv-grid.js +567 -0
- package/dist/components/cv-icon.d.ts +57 -0
- package/dist/components/cv-icon.js +352 -0
- package/dist/components/cv-input.d.ts +127 -0
- package/dist/components/cv-input.js +482 -0
- package/dist/components/cv-landmark.d.ts +32 -0
- package/dist/components/cv-landmark.js +62 -0
- package/dist/components/cv-link.d.ts +22 -0
- package/dist/components/cv-link.js +99 -0
- package/dist/components/cv-listbox-group.d.ts +15 -0
- package/dist/components/cv-listbox-group.js +42 -0
- package/dist/components/cv-listbox.d.ts +81 -0
- package/dist/components/cv-listbox.js +388 -0
- package/dist/components/cv-menu-button.d.ts +118 -0
- package/dist/components/cv-menu-button.js +822 -0
- package/dist/components/cv-menu-group.d.ts +20 -0
- package/dist/components/cv-menu-group.js +48 -0
- package/dist/components/cv-menu-item.d.ts +52 -0
- package/dist/components/cv-menu-item.js +105 -0
- package/dist/components/cv-menu.d.ts +62 -0
- package/dist/components/cv-menu.js +414 -0
- package/dist/components/cv-meter.d.ts +66 -0
- package/dist/components/cv-meter.js +154 -0
- package/dist/components/cv-number.d.ts +139 -0
- package/dist/components/cv-number.js +553 -0
- package/dist/components/cv-option.d.ts +30 -0
- package/dist/components/cv-option.js +84 -0
- package/dist/components/cv-popover.d.ts +87 -0
- package/dist/components/cv-popover.js +373 -0
- package/dist/components/cv-progress-ring.d.ts +45 -0
- package/dist/components/cv-progress-ring.js +169 -0
- package/dist/components/cv-progress.d.ts +45 -0
- package/dist/components/cv-progress.js +148 -0
- package/dist/components/cv-radio-group.d.ts +79 -0
- package/dist/components/cv-radio-group.js +398 -0
- package/dist/components/cv-radio.d.ts +36 -0
- package/dist/components/cv-radio.js +123 -0
- package/dist/components/cv-select-group.d.ts +15 -0
- package/dist/components/cv-select-group.js +44 -0
- package/dist/components/cv-select-option.d.ts +30 -0
- package/dist/components/cv-select-option.js +66 -0
- package/dist/components/cv-select.d.ts +128 -0
- package/dist/components/cv-select.js +666 -0
- package/dist/components/cv-sidebar-item.d.ts +26 -0
- package/dist/components/cv-sidebar-item.js +142 -0
- package/dist/components/cv-sidebar.d.ts +171 -0
- package/dist/components/cv-sidebar.js +767 -0
- package/dist/components/cv-slider-multi-thumb.d.ts +73 -0
- package/dist/components/cv-slider-multi-thumb.js +374 -0
- package/dist/components/cv-slider.d.ts +84 -0
- package/dist/components/cv-slider.js +328 -0
- package/dist/components/cv-spinbutton.d.ts +121 -0
- package/dist/components/cv-spinbutton.js +486 -0
- package/dist/components/cv-spinner.d.ts +18 -0
- package/dist/components/cv-spinner.js +95 -0
- package/dist/components/cv-switch.d.ts +81 -0
- package/dist/components/cv-switch.js +285 -0
- package/dist/components/cv-tab-panel.d.ts +20 -0
- package/dist/components/cv-tab-panel.js +37 -0
- package/dist/components/cv-tab.d.ts +40 -0
- package/dist/components/cv-tab.js +132 -0
- package/dist/components/cv-table-cell.d.ts +31 -0
- package/dist/components/cv-table-cell.js +49 -0
- package/dist/components/cv-table-column.d.ts +37 -0
- package/dist/components/cv-table-column.js +63 -0
- package/dist/components/cv-table-row.d.ts +30 -0
- package/dist/components/cv-table-row.js +45 -0
- package/dist/components/cv-table.d.ts +147 -0
- package/dist/components/cv-table.js +607 -0
- package/dist/components/cv-tabs.d.ts +70 -0
- package/dist/components/cv-tabs.js +524 -0
- package/dist/components/cv-textarea.d.ts +108 -0
- package/dist/components/cv-textarea.js +328 -0
- package/dist/components/cv-toast-region.d.ts +39 -0
- package/dist/components/cv-toast-region.js +162 -0
- package/dist/components/cv-toast.d.ts +67 -0
- package/dist/components/cv-toast.js +315 -0
- package/dist/components/cv-toolbar-item.d.ts +25 -0
- package/dist/components/cv-toolbar-item.js +72 -0
- package/dist/components/cv-toolbar-separator.d.ts +25 -0
- package/dist/components/cv-toolbar-separator.js +45 -0
- package/dist/components/cv-toolbar.d.ts +63 -0
- package/dist/components/cv-toolbar.js +295 -0
- package/dist/components/cv-tooltip.d.ts +83 -0
- package/dist/components/cv-tooltip.js +455 -0
- package/dist/components/cv-treegrid-cell.d.ts +30 -0
- package/dist/components/cv-treegrid-cell.js +57 -0
- package/dist/components/cv-treegrid-column.d.ts +37 -0
- package/dist/components/cv-treegrid-column.js +53 -0
- package/dist/components/cv-treegrid-row.d.ts +55 -0
- package/dist/components/cv-treegrid-row.js +90 -0
- package/dist/components/cv-treegrid.d.ts +96 -0
- package/dist/components/cv-treegrid.js +632 -0
- package/dist/components/cv-treeitem.d.ts +58 -0
- package/dist/components/cv-treeitem.js +144 -0
- package/dist/components/cv-treeview.d.ts +70 -0
- package/dist/components/cv-treeview.js +396 -0
- package/dist/components/cv-window-splitter.d.ts +79 -0
- package/dist/components/cv-window-splitter.js +316 -0
- package/dist/components/index.d.ts +94 -0
- package/dist/components/index.js +79 -0
- package/dist/dialog/create-dialog-controller.d.ts +31 -0
- package/dist/dialog/create-dialog-controller.js +320 -0
- package/dist/dialog/index.d.ts +2 -0
- package/dist/dialog/index.js +1 -0
- package/dist/form-associated/FormAssociatedReatomElement.d.ts +25 -0
- package/dist/form-associated/FormAssociatedReatomElement.js +70 -0
- package/dist/form-associated/withFormAssociated.d.ts +5 -0
- package/dist/form-associated/withFormAssociated.js +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +9 -0
- package/dist/reatom-lit/ReatomLitElement.d.ts +27 -0
- package/dist/reatom-lit/ReatomLitElement.js +118 -0
- package/dist/reatom-lit/html.d.ts +4 -0
- package/dist/reatom-lit/html.js +10 -0
- package/dist/reatom-lit/index.d.ts +4 -0
- package/dist/reatom-lit/index.js +4 -0
- package/dist/reatom-lit/watch.d.ts +15 -0
- package/dist/reatom-lit/watch.js +40 -0
- package/dist/reatom-lit/withReatomElement.d.ts +4 -0
- package/dist/reatom-lit/withReatomElement.js +57 -0
- package/dist/register.d.ts +1 -0
- package/dist/register.js +84 -0
- package/dist/styles/component-styles.d.ts +4 -0
- package/dist/styles/component-styles.js +78 -0
- package/dist/theme/cv-theme-provider.d.ts +32 -0
- package/dist/theme/cv-theme-provider.js +110 -0
- package/dist/theme/index.d.ts +4 -0
- package/dist/theme/index.js +2 -0
- package/dist/theme/theme-engine.d.ts +4 -0
- package/dist/theme/theme-engine.js +67 -0
- package/dist/theme/tokens.css +265 -0
- package/dist/theme/types.d.ts +7 -0
- package/dist/theme/types.js +1 -0
- package/dist/toast/create-toast-controller.d.ts +12 -0
- package/dist/toast/create-toast-controller.js +12 -0
- package/dist/toast/index.d.ts +2 -0
- package/dist/toast/index.js +1 -0
- package/package.json +146 -0
- package/specs/_template.md +110 -0
- package/specs/components/accordion.md +207 -0
- package/specs/components/alert.md +83 -0
- package/specs/components/badge.md +183 -0
- package/specs/components/breadcrumb.md +152 -0
- package/specs/components/button.md +227 -0
- package/specs/components/callout.md +153 -0
- package/specs/components/card.md +192 -0
- package/specs/components/carousel.md +232 -0
- package/specs/components/checkbox.md +141 -0
- package/specs/components/combobox.md +427 -0
- package/specs/components/context-menu.md +375 -0
- package/specs/components/copy-button.md +236 -0
- package/specs/components/date-picker.md +290 -0
- package/specs/components/dialog.md +184 -0
- package/specs/components/disclosure.md +151 -0
- package/specs/components/drawer.md +216 -0
- package/specs/components/feed.md +266 -0
- package/specs/components/grid.md +423 -0
- package/specs/components/input.md +237 -0
- package/specs/components/landmark.md +92 -0
- package/specs/components/link.md +117 -0
- package/specs/components/listbox.md +327 -0
- package/specs/components/menu.md +508 -0
- package/specs/components/meter.md +148 -0
- package/specs/components/number.md +268 -0
- package/specs/components/option.md +167 -0
- package/specs/components/popover.md +207 -0
- package/specs/components/progress-ring.md +134 -0
- package/specs/components/progress.md +110 -0
- package/specs/components/radio.md +208 -0
- package/specs/components/select.md +305 -0
- package/specs/components/sidebar.md +204 -0
- package/specs/components/spinbutton.md +157 -0
- package/specs/components/spinner.md +83 -0
- package/specs/components/switch.md +145 -0
- package/specs/components/table.md +372 -0
- package/specs/components/tabs.md +242 -0
- package/specs/components/textarea.md +166 -0
- package/specs/components/theme.md +364 -0
- package/specs/components/toast.md +198 -0
- package/specs/components/toolbar.md +258 -0
- package/specs/components/tooltip.md +152 -0
- package/specs/components/treegrid.md +363 -0
- package/specs/components/treeview.md +263 -0
- package/specs/components/window-splitter.md +225 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type { PropertyValues } from 'lit';
|
|
2
|
+
import { ReatomLitElement } from '../reatom-lit/ReatomLitElement.js';
|
|
3
|
+
export declare class CVMeter extends ReatomLitElement {
|
|
4
|
+
static elementName: string;
|
|
5
|
+
static get properties(): {
|
|
6
|
+
value: {
|
|
7
|
+
type: NumberConstructor;
|
|
8
|
+
reflect: boolean;
|
|
9
|
+
};
|
|
10
|
+
min: {
|
|
11
|
+
type: NumberConstructor;
|
|
12
|
+
reflect: boolean;
|
|
13
|
+
};
|
|
14
|
+
max: {
|
|
15
|
+
type: NumberConstructor;
|
|
16
|
+
reflect: boolean;
|
|
17
|
+
};
|
|
18
|
+
low: {
|
|
19
|
+
type: NumberConstructor;
|
|
20
|
+
reflect: boolean;
|
|
21
|
+
};
|
|
22
|
+
high: {
|
|
23
|
+
type: NumberConstructor;
|
|
24
|
+
reflect: boolean;
|
|
25
|
+
};
|
|
26
|
+
optimum: {
|
|
27
|
+
type: NumberConstructor;
|
|
28
|
+
reflect: boolean;
|
|
29
|
+
};
|
|
30
|
+
valueText: {
|
|
31
|
+
type: StringConstructor;
|
|
32
|
+
attribute: string;
|
|
33
|
+
};
|
|
34
|
+
ariaLabel: {
|
|
35
|
+
type: StringConstructor;
|
|
36
|
+
attribute: string;
|
|
37
|
+
};
|
|
38
|
+
ariaLabelledBy: {
|
|
39
|
+
type: StringConstructor;
|
|
40
|
+
attribute: string;
|
|
41
|
+
};
|
|
42
|
+
ariaDescribedBy: {
|
|
43
|
+
type: StringConstructor;
|
|
44
|
+
attribute: string;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
value: number;
|
|
48
|
+
min: number;
|
|
49
|
+
max: number;
|
|
50
|
+
low: number | null;
|
|
51
|
+
high: number | null;
|
|
52
|
+
optimum: number | null;
|
|
53
|
+
valueText: string;
|
|
54
|
+
ariaLabel: string;
|
|
55
|
+
ariaLabelledBy: string;
|
|
56
|
+
ariaDescribedBy: string;
|
|
57
|
+
private readonly idBase;
|
|
58
|
+
private model;
|
|
59
|
+
constructor();
|
|
60
|
+
static styles: import("lit").CSSResult[];
|
|
61
|
+
static define(): void;
|
|
62
|
+
willUpdate(changedProperties: PropertyValues): void;
|
|
63
|
+
private createModel;
|
|
64
|
+
private toFiniteOrUndefined;
|
|
65
|
+
protected render(): import("lit").TemplateResult<1>;
|
|
66
|
+
}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { createMeter } from '@chromvoid/headless-ui/meter';
|
|
2
|
+
import { css, html, nothing } from 'lit';
|
|
3
|
+
import { ReatomLitElement } from '../reatom-lit/ReatomLitElement.js';
|
|
4
|
+
let cvMeterNonce = 0;
|
|
5
|
+
export class CVMeter extends ReatomLitElement {
|
|
6
|
+
static elementName = 'cv-meter';
|
|
7
|
+
static get properties() {
|
|
8
|
+
return {
|
|
9
|
+
value: { type: Number, reflect: true },
|
|
10
|
+
min: { type: Number, reflect: true },
|
|
11
|
+
max: { type: Number, reflect: true },
|
|
12
|
+
low: { type: Number, reflect: true },
|
|
13
|
+
high: { type: Number, reflect: true },
|
|
14
|
+
optimum: { type: Number, reflect: true },
|
|
15
|
+
valueText: { type: String, attribute: 'value-text' },
|
|
16
|
+
ariaLabel: { type: String, attribute: 'aria-label' },
|
|
17
|
+
ariaLabelledBy: { type: String, attribute: 'aria-labelledby' },
|
|
18
|
+
ariaDescribedBy: { type: String, attribute: 'aria-describedby' },
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
idBase = `cv-meter-${++cvMeterNonce}`;
|
|
22
|
+
model;
|
|
23
|
+
constructor() {
|
|
24
|
+
super();
|
|
25
|
+
this.value = 0;
|
|
26
|
+
this.min = 0;
|
|
27
|
+
this.max = 100;
|
|
28
|
+
this.low = null;
|
|
29
|
+
this.high = null;
|
|
30
|
+
this.optimum = null;
|
|
31
|
+
this.valueText = '';
|
|
32
|
+
this.ariaLabel = '';
|
|
33
|
+
this.ariaLabelledBy = '';
|
|
34
|
+
this.ariaDescribedBy = '';
|
|
35
|
+
this.model = this.createModel();
|
|
36
|
+
}
|
|
37
|
+
static styles = [
|
|
38
|
+
css `
|
|
39
|
+
:host {
|
|
40
|
+
display: block;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
[part='base'] {
|
|
44
|
+
position: relative;
|
|
45
|
+
inline-size: 100%;
|
|
46
|
+
block-size: var(--cv-meter-height, 10px);
|
|
47
|
+
border-radius: var(--cv-meter-border-radius, 999px);
|
|
48
|
+
border: 1px solid var(--cv-color-border, #2a3245);
|
|
49
|
+
background: var(--cv-color-surface, #141923);
|
|
50
|
+
overflow: hidden;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
[part='indicator'] {
|
|
54
|
+
block-size: 100%;
|
|
55
|
+
inline-size: var(--cv-meter-width, 0%);
|
|
56
|
+
border-radius: inherit;
|
|
57
|
+
background: linear-gradient(
|
|
58
|
+
90deg,
|
|
59
|
+
var(--cv-color-primary, #65d7ff) 0%,
|
|
60
|
+
color-mix(in oklab, var(--cv-color-primary, #65d7ff) 70%, white) 100%
|
|
61
|
+
);
|
|
62
|
+
transition: inline-size var(--cv-meter-transition-duration, var(--cv-duration-normal, 220ms))
|
|
63
|
+
var(--cv-easing-standard, ease);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
[part='indicator'][data-status='low'] {
|
|
67
|
+
background: linear-gradient(
|
|
68
|
+
90deg,
|
|
69
|
+
var(--cv-meter-suboptimum-color, var(--cv-color-warning, #ffbe65)) 0%,
|
|
70
|
+
color-mix(in oklab, var(--cv-meter-suboptimum-color, var(--cv-color-warning, #ffbe65)) 72%, white)
|
|
71
|
+
100%
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
[part='indicator'][data-status='high'] {
|
|
76
|
+
background: linear-gradient(
|
|
77
|
+
90deg,
|
|
78
|
+
var(--cv-meter-danger-color, var(--cv-color-danger, #ff7a8a)) 0%,
|
|
79
|
+
color-mix(in oklab, var(--cv-meter-danger-color, var(--cv-color-danger, #ff7a8a)) 72%, white) 100%
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
[part='indicator'][data-status='optimum'] {
|
|
84
|
+
background: linear-gradient(
|
|
85
|
+
90deg,
|
|
86
|
+
var(--cv-meter-optimum-color, var(--cv-color-success, #6ef7c8)) 0%,
|
|
87
|
+
color-mix(in oklab, var(--cv-meter-optimum-color, var(--cv-color-success, #6ef7c8)) 72%, white) 100%
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
`,
|
|
91
|
+
];
|
|
92
|
+
static define() {
|
|
93
|
+
if (!customElements.get(this.elementName)) {
|
|
94
|
+
customElements.define(this.elementName, this);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
willUpdate(changedProperties) {
|
|
98
|
+
super.willUpdate(changedProperties);
|
|
99
|
+
if (changedProperties.has('min') ||
|
|
100
|
+
changedProperties.has('max') ||
|
|
101
|
+
changedProperties.has('low') ||
|
|
102
|
+
changedProperties.has('high') ||
|
|
103
|
+
changedProperties.has('optimum') ||
|
|
104
|
+
changedProperties.has('valueText') ||
|
|
105
|
+
changedProperties.has('ariaLabel') ||
|
|
106
|
+
changedProperties.has('ariaLabelledBy') ||
|
|
107
|
+
changedProperties.has('ariaDescribedBy')) {
|
|
108
|
+
this.model = this.createModel();
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
if (changedProperties.has('value') && this.model.state.value() !== this.value) {
|
|
112
|
+
this.model.actions.setValue(this.value);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
createModel() {
|
|
116
|
+
return createMeter({
|
|
117
|
+
idBase: this.idBase,
|
|
118
|
+
value: this.value,
|
|
119
|
+
min: this.min,
|
|
120
|
+
max: this.max,
|
|
121
|
+
low: this.toFiniteOrUndefined(this.low),
|
|
122
|
+
high: this.toFiniteOrUndefined(this.high),
|
|
123
|
+
optimum: this.toFiniteOrUndefined(this.optimum),
|
|
124
|
+
ariaLabel: this.ariaLabel || undefined,
|
|
125
|
+
ariaLabelledBy: this.ariaLabelledBy || undefined,
|
|
126
|
+
ariaDescribedBy: this.ariaDescribedBy || undefined,
|
|
127
|
+
formatValueText: this.valueText ? () => this.valueText : undefined,
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
toFiniteOrUndefined(value) {
|
|
131
|
+
return typeof value === 'number' && Number.isFinite(value) ? value : undefined;
|
|
132
|
+
}
|
|
133
|
+
render() {
|
|
134
|
+
const props = this.model.contracts.getMeterProps();
|
|
135
|
+
const percentage = Math.max(0, Math.min(100, this.model.state.percentage()));
|
|
136
|
+
const status = this.model.state.status();
|
|
137
|
+
return html `
|
|
138
|
+
<div
|
|
139
|
+
id=${props.id}
|
|
140
|
+
role=${props.role}
|
|
141
|
+
aria-valuenow=${props['aria-valuenow']}
|
|
142
|
+
aria-valuemin=${props['aria-valuemin']}
|
|
143
|
+
aria-valuemax=${props['aria-valuemax']}
|
|
144
|
+
aria-valuetext=${props['aria-valuetext'] ?? nothing}
|
|
145
|
+
aria-label=${props['aria-label'] ?? nothing}
|
|
146
|
+
aria-labelledby=${props['aria-labelledby'] ?? nothing}
|
|
147
|
+
aria-describedby=${props['aria-describedby'] ?? nothing}
|
|
148
|
+
part="base"
|
|
149
|
+
>
|
|
150
|
+
<div part="indicator" data-status=${status} style=${`--cv-meter-width:${percentage}%;`}><span part="label"><slot></slot></span></div>
|
|
151
|
+
</div>
|
|
152
|
+
`;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import type { PropertyValues } from 'lit';
|
|
2
|
+
import { FormAssociatedReatomElement } from '../form-associated/FormAssociatedReatomElement.js';
|
|
3
|
+
type CVNumberSize = 'small' | 'medium' | 'large';
|
|
4
|
+
type CVNumberVariant = 'outlined' | 'filled';
|
|
5
|
+
export interface CVNumberValueDetail {
|
|
6
|
+
value: number;
|
|
7
|
+
}
|
|
8
|
+
export type CVNumberChangeEvent = CustomEvent<CVNumberValueDetail>;
|
|
9
|
+
export type CVNumberClearEvent = CustomEvent<Record<string, never>>;
|
|
10
|
+
export type CVNumberFocusEvent = CustomEvent<Record<string, never>>;
|
|
11
|
+
export type CVNumberBlurEvent = CustomEvent<Record<string, never>>;
|
|
12
|
+
export interface CVNumberEventMap {
|
|
13
|
+
'cv-change': CVNumberChangeEvent;
|
|
14
|
+
'cv-clear': CVNumberClearEvent;
|
|
15
|
+
'cv-focus': CVNumberFocusEvent;
|
|
16
|
+
'cv-blur': CVNumberBlurEvent;
|
|
17
|
+
}
|
|
18
|
+
export declare class CVNumber extends FormAssociatedReatomElement {
|
|
19
|
+
static elementName: string;
|
|
20
|
+
static hostDisplay: "inline-block";
|
|
21
|
+
static get properties(): {
|
|
22
|
+
value: {
|
|
23
|
+
type: NumberConstructor;
|
|
24
|
+
};
|
|
25
|
+
defaultValue: {
|
|
26
|
+
type: NumberConstructor;
|
|
27
|
+
attribute: string;
|
|
28
|
+
};
|
|
29
|
+
min: {
|
|
30
|
+
type: NumberConstructor;
|
|
31
|
+
};
|
|
32
|
+
max: {
|
|
33
|
+
type: NumberConstructor;
|
|
34
|
+
};
|
|
35
|
+
step: {
|
|
36
|
+
type: NumberConstructor;
|
|
37
|
+
};
|
|
38
|
+
largeStep: {
|
|
39
|
+
type: NumberConstructor;
|
|
40
|
+
attribute: string;
|
|
41
|
+
};
|
|
42
|
+
name: {
|
|
43
|
+
type: StringConstructor;
|
|
44
|
+
};
|
|
45
|
+
disabled: {
|
|
46
|
+
type: BooleanConstructor;
|
|
47
|
+
reflect: boolean;
|
|
48
|
+
};
|
|
49
|
+
readOnly: {
|
|
50
|
+
type: BooleanConstructor;
|
|
51
|
+
attribute: string;
|
|
52
|
+
reflect: boolean;
|
|
53
|
+
};
|
|
54
|
+
required: {
|
|
55
|
+
type: BooleanConstructor;
|
|
56
|
+
reflect: boolean;
|
|
57
|
+
};
|
|
58
|
+
clearable: {
|
|
59
|
+
type: BooleanConstructor;
|
|
60
|
+
reflect: boolean;
|
|
61
|
+
};
|
|
62
|
+
stepper: {
|
|
63
|
+
type: BooleanConstructor;
|
|
64
|
+
reflect: boolean;
|
|
65
|
+
};
|
|
66
|
+
placeholder: {
|
|
67
|
+
type: StringConstructor;
|
|
68
|
+
};
|
|
69
|
+
size: {
|
|
70
|
+
type: StringConstructor;
|
|
71
|
+
reflect: boolean;
|
|
72
|
+
};
|
|
73
|
+
variant: {
|
|
74
|
+
type: StringConstructor;
|
|
75
|
+
reflect: boolean;
|
|
76
|
+
};
|
|
77
|
+
ariaLabel: {
|
|
78
|
+
type: StringConstructor;
|
|
79
|
+
attribute: string;
|
|
80
|
+
};
|
|
81
|
+
ariaLabelledBy: {
|
|
82
|
+
type: StringConstructor;
|
|
83
|
+
attribute: string;
|
|
84
|
+
};
|
|
85
|
+
ariaDescribedBy: {
|
|
86
|
+
type: StringConstructor;
|
|
87
|
+
attribute: string;
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
value: number;
|
|
91
|
+
defaultValue: number | undefined;
|
|
92
|
+
min: number | undefined;
|
|
93
|
+
max: number | undefined;
|
|
94
|
+
step: number;
|
|
95
|
+
largeStep: number;
|
|
96
|
+
name: string;
|
|
97
|
+
disabled: boolean;
|
|
98
|
+
readOnly: boolean;
|
|
99
|
+
required: boolean;
|
|
100
|
+
clearable: boolean;
|
|
101
|
+
stepper: boolean;
|
|
102
|
+
placeholder: string;
|
|
103
|
+
size: CVNumberSize;
|
|
104
|
+
variant: CVNumberVariant;
|
|
105
|
+
ariaLabel: string;
|
|
106
|
+
ariaLabelledBy: string;
|
|
107
|
+
ariaDescribedBy: string;
|
|
108
|
+
private readonly idBase;
|
|
109
|
+
private model;
|
|
110
|
+
private modelInitialized;
|
|
111
|
+
private _valueOnFocus;
|
|
112
|
+
constructor();
|
|
113
|
+
static styles: import("lit").CSSResult[];
|
|
114
|
+
static define(): void;
|
|
115
|
+
private isEffectivelyDisabled;
|
|
116
|
+
protected isFormAssociatedDisabled(): boolean;
|
|
117
|
+
protected getFormAssociatedValue(): string | File | FormData | null;
|
|
118
|
+
private toFiniteOrUndefined;
|
|
119
|
+
private createModel;
|
|
120
|
+
private ensureModel;
|
|
121
|
+
willUpdate(changedProperties: PropertyValues): void;
|
|
122
|
+
private reflectHostAttributes;
|
|
123
|
+
private syncValueFromModel;
|
|
124
|
+
protected onFormDisabledChanged(_disabled: boolean): void;
|
|
125
|
+
protected onFormReset(): void;
|
|
126
|
+
protected onFormStateRestore(state: string | File | FormData | null): void;
|
|
127
|
+
get type(): string;
|
|
128
|
+
focus(options?: FocusOptions): void;
|
|
129
|
+
select(): void;
|
|
130
|
+
private handleNativeInput;
|
|
131
|
+
private handleNativeFocus;
|
|
132
|
+
private handleNativeBlur;
|
|
133
|
+
private handleNativeKeyDown;
|
|
134
|
+
private handleIncrementClick;
|
|
135
|
+
private handleDecrementClick;
|
|
136
|
+
private handleClearClick;
|
|
137
|
+
protected render(): import("lit").TemplateResult<1>;
|
|
138
|
+
}
|
|
139
|
+
export {};
|