@sondor-technology/sondor-components 1.0.1-develop.13 → 1.0.1-develop.15
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/dist/components/alert/alert.constants.d.ts +3 -0
- package/dist/components/alert/alert.constants.d.ts.map +1 -0
- package/dist/components/alert/alert.constants.js +2 -0
- package/dist/components/alert/alert.constants.js.map +1 -0
- package/dist/components/alert/alert.d.ts +4 -3
- package/dist/components/alert/alert.d.ts.map +1 -1
- package/dist/components/alert/alert.js +21 -11
- package/dist/components/alert/alert.js.map +1 -0
- package/dist/components/badge/badge.constants.d.ts +3 -0
- package/dist/components/badge/badge.constants.d.ts.map +1 -0
- package/dist/components/badge/badge.constants.js +2 -0
- package/dist/components/badge/badge.constants.js.map +1 -0
- package/dist/components/badge/badge.d.ts +1 -1
- package/dist/components/badge/badge.d.ts.map +1 -1
- package/dist/components/badge/badge.js +3 -2
- package/dist/components/badge/badge.js.map +1 -0
- package/dist/components/breadcrumb/breadcrumb.d.ts.map +1 -1
- package/dist/components/breadcrumb/breadcrumb.js +2 -1
- package/dist/components/breadcrumb/breadcrumb.js.map +1 -0
- package/dist/components/button/button.constants.d.ts +7 -0
- package/dist/components/button/button.constants.d.ts.map +1 -0
- package/dist/components/button/button.constants.js +4 -0
- package/dist/components/button/button.constants.js.map +1 -0
- package/dist/components/button/button.d.ts +8 -4
- package/dist/components/button/button.d.ts.map +1 -1
- package/dist/components/button/button.js +181 -137
- package/dist/components/button/button.js.map +1 -0
- package/dist/components/button-group/button-group.d.ts +1 -0
- package/dist/components/button-group/button-group.d.ts.map +1 -1
- package/dist/components/button-group/button-group.js +17 -21
- package/dist/components/button-group/button-group.js.map +1 -0
- package/dist/components/calendar/calendar.d.ts +36 -0
- package/dist/components/calendar/calendar.d.ts.map +1 -0
- package/dist/components/calendar/calendar.js +439 -0
- package/dist/components/calendar/calendar.js.map +1 -0
- package/dist/components/checkbox/checkbox.constants.d.ts +3 -0
- package/dist/components/checkbox/checkbox.constants.d.ts.map +1 -0
- package/dist/components/checkbox/checkbox.constants.js +2 -0
- package/dist/components/checkbox/checkbox.constants.js.map +1 -0
- package/dist/components/checkbox/checkbox.d.ts +5 -1
- package/dist/components/checkbox/checkbox.d.ts.map +1 -1
- package/dist/components/checkbox/checkbox.js +21 -5
- package/dist/components/checkbox/checkbox.js.map +1 -0
- package/dist/components/code-block/code-block.d.ts +7 -7
- package/dist/components/code-block/code-block.d.ts.map +1 -1
- package/dist/components/code-block/code-block.js +130 -66
- package/dist/components/code-block/code-block.js.map +1 -0
- package/dist/components/content-card/content-card.d.ts.map +1 -1
- package/dist/components/content-card/content-card.js +10 -15
- package/dist/components/content-card/content-card.js.map +1 -0
- package/dist/components/cron-builder/cron-builder.d.ts +34 -0
- package/dist/components/cron-builder/cron-builder.d.ts.map +1 -0
- package/dist/components/cron-builder/cron-builder.js +456 -0
- package/dist/components/cron-builder/cron-builder.js.map +1 -0
- package/dist/components/divider/divider.constants.d.ts +5 -0
- package/dist/components/divider/divider.constants.d.ts.map +1 -0
- package/dist/components/divider/divider.constants.js +3 -0
- package/dist/components/divider/divider.constants.js.map +1 -0
- package/dist/components/divider/divider.d.ts +4 -2
- package/dist/components/divider/divider.d.ts.map +1 -1
- package/dist/components/divider/divider.js +18 -9
- package/dist/components/divider/divider.js.map +1 -0
- package/dist/components/drawer/drawer.d.ts +7 -4
- package/dist/components/drawer/drawer.d.ts.map +1 -1
- package/dist/components/drawer/drawer.js +73 -30
- package/dist/components/drawer/drawer.js.map +1 -0
- package/dist/components/field/field.d.ts +2 -2
- package/dist/components/field/field.d.ts.map +1 -1
- package/dist/components/field/field.js +8 -9
- package/dist/components/field/field.js.map +1 -0
- package/dist/components/footer/footer.d.ts +8 -1
- package/dist/components/footer/footer.d.ts.map +1 -1
- package/dist/components/footer/footer.js +42 -12
- package/dist/components/footer/footer.js.map +1 -0
- package/dist/components/form/form-step.js +1 -0
- package/dist/components/form/form-step.js.map +1 -0
- package/dist/components/form/form.d.ts +3 -0
- package/dist/components/form/form.d.ts.map +1 -1
- package/dist/components/form/form.js +109 -69
- package/dist/components/form/form.js.map +1 -0
- package/dist/components/grid/grid-row.d.ts +3 -3
- package/dist/components/grid/grid-row.d.ts.map +1 -1
- package/dist/components/grid/grid-row.js +36 -22
- package/dist/components/grid/grid-row.js.map +1 -0
- package/dist/components/grid/grid.d.ts +2 -2
- package/dist/components/grid/grid.d.ts.map +1 -1
- package/dist/components/grid/grid.js +5 -2
- package/dist/components/grid/grid.js.map +1 -0
- package/dist/components/icon/icon-paths.d.ts +161 -86
- package/dist/components/icon/icon-paths.d.ts.map +1 -1
- package/dist/components/icon/icon-paths.js +176 -106
- package/dist/components/icon/icon-paths.js.map +1 -0
- package/dist/components/icon/icon.d.ts +1 -1
- package/dist/components/icon/icon.d.ts.map +1 -1
- package/dist/components/icon/icon.js +6 -5
- package/dist/components/icon/icon.js.map +1 -0
- package/dist/components/input/input.d.ts +10 -0
- package/dist/components/input/input.d.ts.map +1 -1
- package/dist/components/input/input.js +59 -43
- package/dist/components/input/input.js.map +1 -0
- package/dist/components/link/link.d.ts +6 -6
- package/dist/components/link/link.d.ts.map +1 -1
- package/dist/components/link/link.js +42 -19
- package/dist/components/link/link.js.map +1 -0
- package/dist/components/metadata/metadata.d.ts +3 -3
- package/dist/components/metadata/metadata.d.ts.map +1 -1
- package/dist/components/metadata/metadata.js +23 -20
- package/dist/components/metadata/metadata.js.map +1 -0
- package/dist/components/modal/modal.d.ts +4 -16
- package/dist/components/modal/modal.d.ts.map +1 -1
- package/dist/components/modal/modal.js +99 -62
- package/dist/components/modal/modal.js.map +1 -0
- package/dist/components/page-layout/page-layout.d.ts +4 -3
- package/dist/components/page-layout/page-layout.d.ts.map +1 -1
- package/dist/components/page-layout/page-layout.js +95 -68
- package/dist/components/page-layout/page-layout.js.map +1 -0
- package/dist/components/pin-input/pin-input.d.ts +33 -0
- package/dist/components/pin-input/pin-input.d.ts.map +1 -0
- package/dist/components/pin-input/pin-input.js +253 -0
- package/dist/components/pin-input/pin-input.js.map +1 -0
- package/dist/components/popover/popover.d.ts +26 -0
- package/dist/components/popover/popover.d.ts.map +1 -0
- package/dist/components/popover/popover.js +196 -0
- package/dist/components/popover/popover.js.map +1 -0
- package/dist/components/radio/radio.d.ts +8 -0
- package/dist/components/radio/radio.d.ts.map +1 -1
- package/dist/components/radio/radio.js +8 -12
- package/dist/components/radio/radio.js.map +1 -0
- package/dist/components/radio-group/radio-group.d.ts +6 -1
- package/dist/components/radio-group/radio-group.d.ts.map +1 -1
- package/dist/components/radio-group/radio-group.js +44 -18
- package/dist/components/radio-group/radio-group.js.map +1 -0
- package/dist/components/router/router.d.ts +5 -7
- package/dist/components/router/router.d.ts.map +1 -1
- package/dist/components/router/router.js +54 -38
- package/dist/components/router/router.js.map +1 -0
- package/dist/components/select/select.d.ts +5 -4
- package/dist/components/select/select.d.ts.map +1 -1
- package/dist/components/select/select.js +40 -9
- package/dist/components/select/select.js.map +1 -0
- package/dist/components/skeleton/skeleton.d.ts +3 -2
- package/dist/components/skeleton/skeleton.d.ts.map +1 -1
- package/dist/components/skeleton/skeleton.js +10 -13
- package/dist/components/skeleton/skeleton.js.map +1 -0
- package/dist/components/switch/switch.d.ts +12 -0
- package/dist/components/switch/switch.d.ts.map +1 -1
- package/dist/components/switch/switch.js +28 -22
- package/dist/components/switch/switch.js.map +1 -0
- package/dist/components/table/data-table.d.ts +3 -25
- package/dist/components/table/data-table.d.ts.map +1 -1
- package/dist/components/table/data-table.js +211 -146
- package/dist/components/table/data-table.js.map +1 -0
- package/dist/components/table/table.d.ts +3 -3
- package/dist/components/table/table.d.ts.map +1 -1
- package/dist/components/table/table.js +39 -20
- package/dist/components/table/table.js.map +1 -0
- package/dist/components/tabs/tab-panel.d.ts +3 -1
- package/dist/components/tabs/tab-panel.d.ts.map +1 -1
- package/dist/components/tabs/tab-panel.js +21 -11
- package/dist/components/tabs/tab-panel.js.map +1 -0
- package/dist/components/tabs/tab.d.ts +5 -1
- package/dist/components/tabs/tab.d.ts.map +1 -1
- package/dist/components/tabs/tab.js +46 -28
- package/dist/components/tabs/tab.js.map +1 -0
- package/dist/components/tabs/tabs.d.ts +4 -0
- package/dist/components/tabs/tabs.d.ts.map +1 -1
- package/dist/components/tabs/tabs.js +76 -13
- package/dist/components/tabs/tabs.js.map +1 -0
- package/dist/components/textarea/textarea.d.ts +13 -0
- package/dist/components/textarea/textarea.d.ts.map +1 -1
- package/dist/components/textarea/textarea.js +59 -13
- package/dist/components/textarea/textarea.js.map +1 -0
- package/dist/components/theme-toggle/theme-toggle.constants.d.ts +3 -0
- package/dist/components/theme-toggle/theme-toggle.constants.d.ts.map +1 -0
- package/dist/components/theme-toggle/theme-toggle.constants.js +2 -0
- package/dist/components/theme-toggle/theme-toggle.constants.js.map +1 -0
- package/dist/components/theme-toggle/theme-toggle.d.ts +3 -2
- package/dist/components/theme-toggle/theme-toggle.d.ts.map +1 -1
- package/dist/components/theme-toggle/theme-toggle.js +46 -19
- package/dist/components/theme-toggle/theme-toggle.js.map +1 -0
- package/dist/components/time-picker/time-picker.d.ts +38 -0
- package/dist/components/time-picker/time-picker.d.ts.map +1 -0
- package/dist/components/time-picker/time-picker.js +280 -0
- package/dist/components/time-picker/time-picker.js.map +1 -0
- package/dist/components/toggle-group/toggle-button.d.ts +23 -0
- package/dist/components/toggle-group/toggle-button.d.ts.map +1 -0
- package/dist/components/toggle-group/toggle-button.js +115 -0
- package/dist/components/toggle-group/toggle-button.js.map +1 -0
- package/dist/components/toggle-group/toggle-group.d.ts +32 -0
- package/dist/components/toggle-group/toggle-group.d.ts.map +1 -0
- package/dist/components/toggle-group/toggle-group.js +150 -0
- package/dist/components/toggle-group/toggle-group.js.map +1 -0
- package/dist/components/tooltip/tooltip.d.ts +33 -0
- package/dist/components/tooltip/tooltip.d.ts.map +1 -0
- package/dist/components/tooltip/tooltip.js +293 -0
- package/dist/components/tooltip/tooltip.js.map +1 -0
- package/dist/components/vertical-nav/vertical-nav-group.d.ts +5 -2
- package/dist/components/vertical-nav/vertical-nav-group.d.ts.map +1 -1
- package/dist/components/vertical-nav/vertical-nav-group.js +50 -14
- package/dist/components/vertical-nav/vertical-nav-group.js.map +1 -0
- package/dist/components/vertical-nav/vertical-nav-item.d.ts +3 -2
- package/dist/components/vertical-nav/vertical-nav-item.d.ts.map +1 -1
- package/dist/components/vertical-nav/vertical-nav-item.js +30 -8
- package/dist/components/vertical-nav/vertical-nav-item.js.map +1 -0
- package/dist/styles/index.css +49 -17
- package/dist/styles/reset.js +1 -0
- package/dist/styles/reset.js.map +1 -0
- package/package.json +30 -1
- package/src/components/alert/alert.constants.ts +2 -0
- package/src/components/alert/alert.ts +24 -15
- package/src/components/badge/badge.constants.ts +2 -0
- package/src/components/badge/badge.ts +3 -4
- package/src/components/breadcrumb/breadcrumb.ts +2 -2
- package/src/components/button/button.constants.ts +8 -0
- package/src/components/button/button.ts +184 -144
- package/src/components/button-group/button-group.ts +18 -22
- package/src/components/calendar/calendar.ts +444 -0
- package/src/components/checkbox/checkbox.constants.ts +2 -0
- package/src/components/checkbox/checkbox.ts +33 -18
- package/src/components/code-block/code-block.ts +151 -84
- package/src/components/content-card/content-card.ts +10 -16
- package/src/components/cron-builder/cron-builder.ts +452 -0
- package/src/components/divider/divider.constants.ts +5 -0
- package/src/components/divider/divider.ts +22 -11
- package/src/components/drawer/drawer.ts +79 -34
- package/src/components/field/field.ts +9 -11
- package/src/components/footer/footer.ts +43 -12
- package/src/components/form/form.ts +121 -84
- package/src/components/grid/grid-row.ts +45 -32
- package/src/components/grid/grid.ts +7 -4
- package/src/components/icon/icon-paths.ts +175 -106
- package/src/components/icon/icon.ts +6 -6
- package/src/components/input/input.ts +59 -45
- package/src/components/link/link.ts +45 -21
- package/src/components/metadata/metadata.ts +26 -24
- package/src/components/modal/modal.ts +108 -74
- package/src/components/page-layout/page-layout.ts +97 -72
- package/src/components/pin-input/pin-input.ts +249 -0
- package/src/components/popover/popover.ts +192 -0
- package/src/components/radio/radio.ts +8 -13
- package/src/components/radio-group/radio-group.ts +45 -21
- package/src/components/router/router.ts +73 -50
- package/src/components/select/select.ts +41 -80
- package/src/components/skeleton/skeleton.ts +14 -14
- package/src/components/switch/switch.ts +31 -25
- package/src/components/table/data-table.ts +248 -177
- package/src/components/table/table.ts +52 -29
- package/src/components/tabs/tab-panel.ts +25 -13
- package/src/components/tabs/tab.ts +58 -33
- package/src/components/tabs/tabs.ts +77 -15
- package/src/components/textarea/textarea.ts +63 -15
- package/src/components/theme-toggle/theme-toggle.constants.ts +2 -0
- package/src/components/theme-toggle/theme-toggle.ts +47 -22
- package/src/components/time-picker/time-picker.ts +272 -0
- package/src/components/toggle-group/toggle-button.ts +104 -0
- package/src/components/toggle-group/toggle-group.ts +148 -0
- package/src/components/tooltip/tooltip.ts +286 -0
- package/src/components/vertical-nav/vertical-nav-group.ts +57 -18
- package/src/components/vertical-nav/vertical-nav-item.ts +35 -12
- package/src/styles/globals.css +27 -4
- package/src/styles/theme.css +40 -32
- package/tsconfig.json +2 -1
- package/dist/components/card/card.d.ts +0 -11
- package/dist/components/card/card.d.ts.map +0 -1
- package/dist/components/card/card.js +0 -54
- package/src/components/card/card.ts +0 -53
|
@@ -1,41 +1,44 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import {LitElement, html, css, PropertyValues} from "lit";
|
|
2
|
+
import {customElement, property, state} from "lit/decorators.js";
|
|
3
|
+
import {resetStyles} from "../../styles/reset.js";
|
|
4
4
|
|
|
5
|
-
export type LayoutVariant =
|
|
5
|
+
export type LayoutVariant = "app-shell" | "content-sidebar" | "single-column" | "three-column";
|
|
6
6
|
|
|
7
|
-
@customElement(
|
|
7
|
+
@customElement("st-page-layout")
|
|
8
8
|
export class StPageLayout extends LitElement {
|
|
9
9
|
/**
|
|
10
10
|
* Defines the structural layout variant to render.
|
|
11
11
|
*/
|
|
12
|
-
@property({
|
|
13
|
-
variant: LayoutVariant =
|
|
12
|
+
@property({type: String, reflect: true})
|
|
13
|
+
variant: LayoutVariant = "single-column";
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* Maximum width for the left sidebar section (e.g., '20rem', '300px').
|
|
17
17
|
*/
|
|
18
|
-
@property({
|
|
19
|
-
sidebarWidth =
|
|
18
|
+
@property({type: String, attribute: "sidebar-width"})
|
|
19
|
+
sidebarWidth = "";
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
22
|
* Maximum width for the right sidebar section (e.g., '16rem', '250px').
|
|
23
23
|
*/
|
|
24
|
-
@property({
|
|
25
|
-
rightSidebarWidth =
|
|
24
|
+
@property({type: String, attribute: "right-sidebar-width"})
|
|
25
|
+
rightSidebarWidth = "";
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
28
|
* Optional maximum width for the main content area (e.g., '48rem', '800px').
|
|
29
29
|
*/
|
|
30
|
-
@property({
|
|
31
|
-
mainMaxWidth =
|
|
30
|
+
@property({type: String, attribute: "main-max-width"})
|
|
31
|
+
mainMaxWidth = "";
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
34
|
* When true, expands the main content area to fill 100% of the available width between sidebars.
|
|
35
35
|
*/
|
|
36
|
-
@property({
|
|
36
|
+
@property({type: Boolean, attribute: "fill-main", reflect: true})
|
|
37
37
|
fillMain = false;
|
|
38
38
|
|
|
39
|
+
@property({type: Boolean, attribute: "clear-footer-padding", reflect: true})
|
|
40
|
+
clearFooterPadding = false;
|
|
41
|
+
|
|
39
42
|
@state()
|
|
40
43
|
private _mobileMenuOpen = false;
|
|
41
44
|
|
|
@@ -46,27 +49,27 @@ export class StPageLayout extends LitElement {
|
|
|
46
49
|
override updated(changedProperties: PropertyValues<this>) {
|
|
47
50
|
super.updated(changedProperties);
|
|
48
51
|
|
|
49
|
-
if (changedProperties.has(
|
|
52
|
+
if (changedProperties.has("sidebarWidth")) {
|
|
50
53
|
if (this.sidebarWidth) {
|
|
51
|
-
this.style.setProperty(
|
|
54
|
+
this.style.setProperty("--layout-sidebar-width", this.sidebarWidth);
|
|
52
55
|
} else {
|
|
53
|
-
this.style.removeProperty(
|
|
56
|
+
this.style.removeProperty("--layout-sidebar-width");
|
|
54
57
|
}
|
|
55
58
|
}
|
|
56
59
|
|
|
57
|
-
if (changedProperties.has(
|
|
60
|
+
if (changedProperties.has("rightSidebarWidth")) {
|
|
58
61
|
if (this.rightSidebarWidth) {
|
|
59
|
-
this.style.setProperty(
|
|
62
|
+
this.style.setProperty("--layout-right-sidebar-width", this.rightSidebarWidth);
|
|
60
63
|
} else {
|
|
61
|
-
this.style.removeProperty(
|
|
64
|
+
this.style.removeProperty("--layout-right-sidebar-width");
|
|
62
65
|
}
|
|
63
66
|
}
|
|
64
67
|
|
|
65
|
-
if (changedProperties.has(
|
|
68
|
+
if (changedProperties.has("mainMaxWidth")) {
|
|
66
69
|
if (this.mainMaxWidth) {
|
|
67
|
-
this.style.setProperty(
|
|
70
|
+
this.style.setProperty("--layout-main-max-width", this.mainMaxWidth);
|
|
68
71
|
} else {
|
|
69
|
-
this.style.removeProperty(
|
|
72
|
+
this.style.removeProperty("--layout-main-max-width");
|
|
70
73
|
}
|
|
71
74
|
}
|
|
72
75
|
}
|
|
@@ -82,9 +85,9 @@ export class StPageLayout extends LitElement {
|
|
|
82
85
|
// Only close if an actual navigation link/item was clicked
|
|
83
86
|
private _handleNavClick = (e: MouseEvent) => {
|
|
84
87
|
const path = e.composedPath();
|
|
85
|
-
const clickedLink = path.some(node => {
|
|
88
|
+
const clickedLink = path.some((node) => {
|
|
86
89
|
const el = node as HTMLElement;
|
|
87
|
-
return el.tagName ===
|
|
90
|
+
return el.tagName === "A" || el.tagName === "ST-VERTICAL-NAV-ITEM";
|
|
88
91
|
});
|
|
89
92
|
|
|
90
93
|
if (clickedLink) {
|
|
@@ -97,7 +100,7 @@ export class StPageLayout extends LitElement {
|
|
|
97
100
|
this._touchStartX = e.touches[0].clientX;
|
|
98
101
|
this._isDragging = true;
|
|
99
102
|
const sidebar = e.currentTarget as HTMLElement;
|
|
100
|
-
sidebar.style.transition =
|
|
103
|
+
sidebar.style.transition = "none";
|
|
101
104
|
};
|
|
102
105
|
|
|
103
106
|
private _handleTouchMove = (e: TouchEvent) => {
|
|
@@ -116,13 +119,13 @@ export class StPageLayout extends LitElement {
|
|
|
116
119
|
if (!this._isDragging || window.innerWidth >= 768) return;
|
|
117
120
|
this._isDragging = false;
|
|
118
121
|
const sidebar = e.currentTarget as HTMLElement;
|
|
119
|
-
sidebar.style.transition =
|
|
122
|
+
sidebar.style.transition = "";
|
|
120
123
|
|
|
121
124
|
if (this._currentTranslateX < -70) {
|
|
122
125
|
this._closeMobileMenu();
|
|
123
|
-
sidebar.style.transform =
|
|
126
|
+
sidebar.style.transform = "";
|
|
124
127
|
} else {
|
|
125
|
-
sidebar.style.transform =
|
|
128
|
+
sidebar.style.transform = "";
|
|
126
129
|
}
|
|
127
130
|
this._currentTranslateX = 0;
|
|
128
131
|
};
|
|
@@ -135,12 +138,12 @@ export class StPageLayout extends LitElement {
|
|
|
135
138
|
|
|
136
139
|
connectedCallback() {
|
|
137
140
|
super.connectedCallback();
|
|
138
|
-
window.addEventListener(
|
|
141
|
+
window.addEventListener("resize", this._resizeListener);
|
|
139
142
|
}
|
|
140
143
|
|
|
141
144
|
disconnectedCallback() {
|
|
142
145
|
super.disconnectedCallback();
|
|
143
|
-
window.removeEventListener(
|
|
146
|
+
window.removeEventListener("resize", this._resizeListener);
|
|
144
147
|
}
|
|
145
148
|
|
|
146
149
|
static styles = [
|
|
@@ -158,7 +161,9 @@ export class StPageLayout extends LitElement {
|
|
|
158
161
|
--layout-nav-height: 4rem;
|
|
159
162
|
}
|
|
160
163
|
|
|
161
|
-
*,
|
|
164
|
+
*,
|
|
165
|
+
*::before,
|
|
166
|
+
*::after {
|
|
162
167
|
box-sizing: inherit;
|
|
163
168
|
}
|
|
164
169
|
|
|
@@ -283,7 +288,7 @@ export class StPageLayout extends LitElement {
|
|
|
283
288
|
overflow: hidden;
|
|
284
289
|
background-color: var(--layout-surface-color);
|
|
285
290
|
}
|
|
286
|
-
|
|
291
|
+
|
|
287
292
|
.app-shell-sidebar {
|
|
288
293
|
display: none;
|
|
289
294
|
border-right: 1px solid var(--layout-border-color);
|
|
@@ -294,14 +299,14 @@ export class StPageLayout extends LitElement {
|
|
|
294
299
|
flex: 1;
|
|
295
300
|
overflow-y: auto;
|
|
296
301
|
}
|
|
297
|
-
|
|
302
|
+
|
|
298
303
|
.app-shell-content {
|
|
299
304
|
display: flex;
|
|
300
305
|
flex-direction: column;
|
|
301
306
|
flex: 1;
|
|
302
307
|
width: 100%;
|
|
303
308
|
}
|
|
304
|
-
|
|
309
|
+
|
|
305
310
|
.app-shell-nav {
|
|
306
311
|
height: var(--layout-nav-height);
|
|
307
312
|
border-bottom: 1px solid var(--layout-border-color);
|
|
@@ -310,13 +315,13 @@ export class StPageLayout extends LitElement {
|
|
|
310
315
|
align-items: center;
|
|
311
316
|
padding: 0 var(--st-spacing-md);
|
|
312
317
|
}
|
|
313
|
-
|
|
318
|
+
|
|
314
319
|
.app-shell-main {
|
|
315
320
|
flex: 1;
|
|
316
321
|
overflow-y: auto;
|
|
317
322
|
padding: var(--st-spacing-lg);
|
|
318
323
|
}
|
|
319
|
-
|
|
324
|
+
|
|
320
325
|
.app-shell-footer {
|
|
321
326
|
background: var(--layout-bg-color);
|
|
322
327
|
border-top: 1px solid var(--layout-border-color);
|
|
@@ -342,12 +347,12 @@ export class StPageLayout extends LitElement {
|
|
|
342
347
|
flex-direction: column;
|
|
343
348
|
background: var(--layout-bg-color);
|
|
344
349
|
}
|
|
345
|
-
|
|
350
|
+
|
|
346
351
|
.content-sidebar-nav {
|
|
347
352
|
border-bottom: 1px solid var(--layout-border-color);
|
|
348
353
|
background: var(--layout-bg-color);
|
|
349
354
|
}
|
|
350
|
-
|
|
355
|
+
|
|
351
356
|
.content-sidebar-container {
|
|
352
357
|
flex: 1;
|
|
353
358
|
width: 100%;
|
|
@@ -358,17 +363,17 @@ export class StPageLayout extends LitElement {
|
|
|
358
363
|
flex-direction: column;
|
|
359
364
|
gap: var(--st-spacing-xl);
|
|
360
365
|
}
|
|
361
|
-
|
|
366
|
+
|
|
362
367
|
.content-sidebar-main {
|
|
363
368
|
flex: 1;
|
|
364
369
|
max-width: 48rem;
|
|
365
370
|
}
|
|
366
|
-
|
|
371
|
+
|
|
367
372
|
.content-sidebar-aside {
|
|
368
373
|
width: 100%;
|
|
369
374
|
flex-shrink: 0;
|
|
370
375
|
}
|
|
371
|
-
|
|
376
|
+
|
|
372
377
|
.content-sidebar-footer {
|
|
373
378
|
margin-top: auto;
|
|
374
379
|
border-top: 1px solid var(--layout-border-color);
|
|
@@ -399,7 +404,7 @@ export class StPageLayout extends LitElement {
|
|
|
399
404
|
flex-direction: column;
|
|
400
405
|
background: var(--layout-bg-color);
|
|
401
406
|
}
|
|
402
|
-
|
|
407
|
+
|
|
403
408
|
.single-column-nav {
|
|
404
409
|
position: sticky;
|
|
405
410
|
top: 0;
|
|
@@ -408,13 +413,13 @@ export class StPageLayout extends LitElement {
|
|
|
408
413
|
background: var(--layout-bg-color);
|
|
409
414
|
border-bottom: 1px solid var(--layout-border-color);
|
|
410
415
|
}
|
|
411
|
-
|
|
416
|
+
|
|
412
417
|
.single-column-main {
|
|
413
418
|
flex: 1;
|
|
414
419
|
display: flex;
|
|
415
420
|
flex-direction: column;
|
|
416
421
|
}
|
|
417
|
-
|
|
422
|
+
|
|
418
423
|
.single-column-footer {
|
|
419
424
|
margin-top: auto;
|
|
420
425
|
}
|
|
@@ -502,6 +507,10 @@ export class StPageLayout extends LitElement {
|
|
|
502
507
|
padding: var(--st-spacing-lg);
|
|
503
508
|
}
|
|
504
509
|
|
|
510
|
+
:host([clear-footer-padding]) footer {
|
|
511
|
+
padding: 0;
|
|
512
|
+
}
|
|
513
|
+
|
|
505
514
|
@media (min-width: 768px) {
|
|
506
515
|
.three-column-sidebar-left {
|
|
507
516
|
display: block;
|
|
@@ -548,19 +557,23 @@ export class StPageLayout extends LitElement {
|
|
|
548
557
|
overflow-y: auto;
|
|
549
558
|
}
|
|
550
559
|
}
|
|
551
|
-
|
|
560
|
+
`,
|
|
552
561
|
];
|
|
553
562
|
|
|
554
563
|
render() {
|
|
555
564
|
const backdrop = html`
|
|
556
|
-
<div
|
|
557
|
-
class="mobile-backdrop ${this._mobileMenuOpen ?
|
|
565
|
+
<div
|
|
566
|
+
class="mobile-backdrop ${this._mobileMenuOpen ? "open" : ""}"
|
|
558
567
|
@click=${this._closeMobileMenu}
|
|
559
568
|
></div>
|
|
560
569
|
`;
|
|
561
570
|
|
|
562
571
|
const hamburgerBtn = html`
|
|
563
|
-
<button
|
|
572
|
+
<button
|
|
573
|
+
class="mobile-menu-btn"
|
|
574
|
+
@click=${this._toggleMobileMenu}
|
|
575
|
+
aria-label="Open Navigation Menu"
|
|
576
|
+
>
|
|
564
577
|
<svg viewBox="0 0 24 24"><path d="M3 12h18M3 6h18M3 18h18"></path></svg>
|
|
565
578
|
</button>
|
|
566
579
|
`;
|
|
@@ -568,18 +581,23 @@ export class StPageLayout extends LitElement {
|
|
|
568
581
|
const drawerHeader = html`
|
|
569
582
|
<div class="mobile-drawer-header">
|
|
570
583
|
<span class="mobile-drawer-title">Menu</span>
|
|
571
|
-
<button
|
|
584
|
+
<button
|
|
585
|
+
class="mobile-close-btn"
|
|
586
|
+
@click=${this._closeMobileMenu}
|
|
587
|
+
aria-label="Close Navigation Menu"
|
|
588
|
+
>
|
|
572
589
|
<svg viewBox="0 0 24 24"><path d="M18 6L6 18M6 6l12 12"></path></svg>
|
|
573
590
|
</button>
|
|
574
591
|
</div>
|
|
575
592
|
`;
|
|
576
593
|
|
|
577
|
-
if (this.variant ===
|
|
594
|
+
if (this.variant === "app-shell") {
|
|
578
595
|
return html`
|
|
579
596
|
${backdrop}
|
|
580
597
|
<div class="layout-app-shell">
|
|
581
|
-
<aside
|
|
582
|
-
class="app-shell-sidebar ${this._mobileMenuOpen ?
|
|
598
|
+
<aside
|
|
599
|
+
class="app-shell-sidebar ${this._mobileMenuOpen ? "open" : ""}"
|
|
600
|
+
aria-label="Primary Sidebar"
|
|
583
601
|
@click=${this._handleNavClick}
|
|
584
602
|
@touchstart=${this._handleTouchStart}
|
|
585
603
|
@touchmove=${this._handleTouchMove}
|
|
@@ -590,17 +608,17 @@ export class StPageLayout extends LitElement {
|
|
|
590
608
|
<slot name="sidebar"></slot>
|
|
591
609
|
</div>
|
|
592
610
|
</aside>
|
|
593
|
-
|
|
611
|
+
|
|
594
612
|
<div class="app-shell-content">
|
|
595
613
|
<header class="app-shell-nav">
|
|
596
614
|
${hamburgerBtn}
|
|
597
615
|
<slot name="nav"></slot>
|
|
598
616
|
</header>
|
|
599
|
-
|
|
617
|
+
|
|
600
618
|
<main class="app-shell-main">
|
|
601
619
|
<slot></slot>
|
|
602
620
|
</main>
|
|
603
|
-
|
|
621
|
+
|
|
604
622
|
<footer class="app-shell-footer">
|
|
605
623
|
<slot name="footer"></slot>
|
|
606
624
|
</footer>
|
|
@@ -609,27 +627,29 @@ export class StPageLayout extends LitElement {
|
|
|
609
627
|
`;
|
|
610
628
|
}
|
|
611
629
|
|
|
612
|
-
if (this.variant ===
|
|
630
|
+
if (this.variant === "content-sidebar") {
|
|
613
631
|
return html`
|
|
614
632
|
<div class="layout-content-sidebar">
|
|
615
633
|
<header class="content-sidebar-nav">
|
|
616
|
-
<div
|
|
634
|
+
<div
|
|
635
|
+
style="display: flex; align-items: center; padding: 0 var(--st-spacing-md); height: var(--layout-nav-height);"
|
|
636
|
+
>
|
|
617
637
|
<slot name="nav"></slot>
|
|
618
638
|
</div>
|
|
619
639
|
</header>
|
|
620
|
-
|
|
640
|
+
|
|
621
641
|
<div class="content-sidebar-container">
|
|
622
642
|
<main class="content-sidebar-main">
|
|
623
643
|
<slot></slot>
|
|
624
644
|
</main>
|
|
625
|
-
|
|
626
|
-
<aside class="content-sidebar-aside">
|
|
645
|
+
|
|
646
|
+
<aside class="content-sidebar-aside" aria-label="Related Content">
|
|
627
647
|
<div class="content-sidebar-aside-inner">
|
|
628
648
|
<slot name="aside"></slot>
|
|
629
649
|
</div>
|
|
630
650
|
</aside>
|
|
631
651
|
</div>
|
|
632
|
-
|
|
652
|
+
|
|
633
653
|
<footer class="content-sidebar-footer">
|
|
634
654
|
<slot name="footer"></slot>
|
|
635
655
|
</footer>
|
|
@@ -637,7 +657,7 @@ export class StPageLayout extends LitElement {
|
|
|
637
657
|
`;
|
|
638
658
|
}
|
|
639
659
|
|
|
640
|
-
if (this.variant ===
|
|
660
|
+
if (this.variant === "three-column") {
|
|
641
661
|
return html`
|
|
642
662
|
${backdrop}
|
|
643
663
|
<div class="layout-three-column">
|
|
@@ -647,8 +667,9 @@ export class StPageLayout extends LitElement {
|
|
|
647
667
|
</header>
|
|
648
668
|
|
|
649
669
|
<div class="three-column-body">
|
|
650
|
-
<aside
|
|
651
|
-
class="three-column-sidebar-left ${this._mobileMenuOpen ?
|
|
670
|
+
<aside
|
|
671
|
+
class="three-column-sidebar-left ${this._mobileMenuOpen ? "open" : ""}"
|
|
672
|
+
aria-label="Primary Sidebar"
|
|
652
673
|
@click=${this._handleNavClick}
|
|
653
674
|
@touchstart=${this._handleTouchStart}
|
|
654
675
|
@touchmove=${this._handleTouchMove}
|
|
@@ -664,7 +685,7 @@ export class StPageLayout extends LitElement {
|
|
|
664
685
|
<slot></slot>
|
|
665
686
|
</main>
|
|
666
687
|
|
|
667
|
-
<aside class="three-column-sidebar-right">
|
|
688
|
+
<aside class="three-column-sidebar-right" aria-label="Secondary Sidebar">
|
|
668
689
|
<div class="three-column-sidebar-right-inner">
|
|
669
690
|
<slot name="sidebar-right"></slot>
|
|
670
691
|
</div>
|
|
@@ -681,16 +702,20 @@ export class StPageLayout extends LitElement {
|
|
|
681
702
|
return html`
|
|
682
703
|
<div class="layout-single-column">
|
|
683
704
|
<header class="single-column-nav">
|
|
684
|
-
<div
|
|
705
|
+
<div
|
|
706
|
+
style="display: flex; align-items: center; padding: 0 var(--st-spacing-md); height: var(--layout-nav-height);"
|
|
707
|
+
>
|
|
685
708
|
<slot name="nav"></slot>
|
|
686
709
|
</div>
|
|
687
710
|
</header>
|
|
688
|
-
|
|
711
|
+
|
|
689
712
|
<main class="single-column-main">
|
|
690
713
|
<slot></slot>
|
|
691
714
|
</main>
|
|
692
|
-
|
|
693
|
-
<footer
|
|
715
|
+
|
|
716
|
+
<footer
|
|
717
|
+
class="single-column-footer ${this.clearFooterPadding ? "clear-footer-padding" : ""}"
|
|
718
|
+
>
|
|
694
719
|
<slot name="footer"></slot>
|
|
695
720
|
</footer>
|
|
696
721
|
</div>
|
|
@@ -700,6 +725,6 @@ export class StPageLayout extends LitElement {
|
|
|
700
725
|
|
|
701
726
|
declare global {
|
|
702
727
|
interface HTMLElementTagNameMap {
|
|
703
|
-
|
|
728
|
+
"st-page-layout": StPageLayout;
|
|
704
729
|
}
|
|
705
|
-
}
|
|
730
|
+
}
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
import {LitElement, html, css, PropertyValues} from "lit";
|
|
2
|
+
import {customElement, property, queryAll, state} from "lit/decorators.js";
|
|
3
|
+
import {classMap} from "lit/directives/class-map.js";
|
|
4
|
+
import {resetStyles} from "../../styles/reset.js";
|
|
5
|
+
|
|
6
|
+
@customElement("st-pin-input")
|
|
7
|
+
export class StPinInput extends LitElement {
|
|
8
|
+
static formAssociated = true;
|
|
9
|
+
private _internals: ElementInternals;
|
|
10
|
+
|
|
11
|
+
@property({type: String, reflect: true}) name = "";
|
|
12
|
+
@property({type: String}) label = "";
|
|
13
|
+
@property({type: Number}) length = 6;
|
|
14
|
+
@property({type: String}) value = "";
|
|
15
|
+
|
|
16
|
+
// Obscures the input for secure PINs
|
|
17
|
+
@property({type: Boolean}) mask = false;
|
|
18
|
+
|
|
19
|
+
@property({type: Boolean, reflect: true}) disabled = false;
|
|
20
|
+
@property({type: Boolean, reflect: true}) required = false;
|
|
21
|
+
@property({type: Boolean, reflect: true}) invalid = false;
|
|
22
|
+
@property({type: String}) error = "";
|
|
23
|
+
|
|
24
|
+
@queryAll(".pin-box") private _inputs!: NodeListOf<HTMLInputElement>;
|
|
25
|
+
|
|
26
|
+
@state() private _touched = false;
|
|
27
|
+
|
|
28
|
+
constructor() {
|
|
29
|
+
super();
|
|
30
|
+
this._internals = this.attachInternals();
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
static styles = [
|
|
34
|
+
resetStyles,
|
|
35
|
+
css`
|
|
36
|
+
:host {
|
|
37
|
+
display: block;
|
|
38
|
+
font-family: inherit;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
label {
|
|
42
|
+
display: block;
|
|
43
|
+
font-size: var(--st-font-size-sm);
|
|
44
|
+
font-weight: 500;
|
|
45
|
+
color: var(--st-color-text-muted);
|
|
46
|
+
margin-bottom: var(--st-spacing-xs);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.pin-container {
|
|
50
|
+
display: flex;
|
|
51
|
+
gap: var(--st-spacing-sm);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.pin-box {
|
|
55
|
+
width: 48px;
|
|
56
|
+
height: 56px;
|
|
57
|
+
text-align: center;
|
|
58
|
+
font-size: var(--st-font-size-xl);
|
|
59
|
+
font-weight: var(--st-font-weight-semibold);
|
|
60
|
+
color: var(--st-color-text);
|
|
61
|
+
background: var(--st-color-surface);
|
|
62
|
+
border: 1px solid var(--st-color-border);
|
|
63
|
+
border-radius: var(--st-radius-md);
|
|
64
|
+
box-sizing: border-box;
|
|
65
|
+
transition:
|
|
66
|
+
border-color 0.2s,
|
|
67
|
+
box-shadow 0.2s,
|
|
68
|
+
background-color 0.2s;
|
|
69
|
+
/* iOS optimization for numeric pads */
|
|
70
|
+
caret-color: var(--st-color-primary);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.pin-box:focus {
|
|
74
|
+
outline: none;
|
|
75
|
+
border-color: var(--st-color-primary);
|
|
76
|
+
box-shadow: 0 0 0 2px var(--st-color-primary-muted, rgba(59, 130, 246, 0.25));
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.pin-box:disabled {
|
|
80
|
+
background: var(--st-color-surface-muted, #f1f5f9);
|
|
81
|
+
color: var(--st-color-text-muted);
|
|
82
|
+
cursor: not-allowed;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.is-invalid .pin-box {
|
|
86
|
+
border-color: var(--st-color-danger, #dc2626);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.error-msg {
|
|
90
|
+
display: block;
|
|
91
|
+
margin-top: var(--st-spacing-xs);
|
|
92
|
+
font-size: var(--st-font-size-xs);
|
|
93
|
+
color: var(--st-color-danger, #dc2626);
|
|
94
|
+
}
|
|
95
|
+
`,
|
|
96
|
+
];
|
|
97
|
+
|
|
98
|
+
override updated(changedProperties: PropertyValues) {
|
|
99
|
+
super.updated(changedProperties);
|
|
100
|
+
if (
|
|
101
|
+
changedProperties.has("value") ||
|
|
102
|
+
changedProperties.has("required") ||
|
|
103
|
+
changedProperties.has("error")
|
|
104
|
+
) {
|
|
105
|
+
this._internals.setFormValue(this.value || null);
|
|
106
|
+
this._syncValidity();
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
private _syncValidity() {
|
|
111
|
+
this.invalid = false;
|
|
112
|
+
|
|
113
|
+
if (this.error) {
|
|
114
|
+
this._internals.setValidity({customError: true}, this.error);
|
|
115
|
+
this.invalid = true;
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
if (this.required && (this.value.length < this.length || this.value.includes(" "))) {
|
|
120
|
+
this._internals.setValidity({valueMissing: true}, `Please enter all ${this.length} digits.`);
|
|
121
|
+
if (this._touched) this.invalid = true;
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
this._internals.setValidity({});
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
public checkValidity() {
|
|
129
|
+
return this._internals.checkValidity();
|
|
130
|
+
}
|
|
131
|
+
public reportValidity() {
|
|
132
|
+
this._touched = true;
|
|
133
|
+
this._syncValidity();
|
|
134
|
+
return this._internals.reportValidity();
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
private _updateValue() {
|
|
138
|
+
const chars = Array.from(this._inputs).map((input) => input.value || " ");
|
|
139
|
+
this.value = chars.join("");
|
|
140
|
+
|
|
141
|
+
this.dispatchEvent(new Event("input", {bubbles: true, composed: true}));
|
|
142
|
+
|
|
143
|
+
// Only fire 'change' if the pin is completely filled
|
|
144
|
+
if (!this.value.includes(" ")) {
|
|
145
|
+
this.dispatchEvent(new Event("change", {bubbles: true, composed: true}));
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
// Handle typing and auto-advancing
|
|
150
|
+
private _handleInput(e: InputEvent, index: number) {
|
|
151
|
+
this._touched = true;
|
|
152
|
+
const input = e.target as HTMLInputElement;
|
|
153
|
+
|
|
154
|
+
// If the user typed a character, move to the next input
|
|
155
|
+
if (input.value && index < this.length - 1) {
|
|
156
|
+
this._inputs[index + 1].focus();
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
this._updateValue();
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
// Handle backspace rewinding and arrow keys
|
|
163
|
+
private _handleKeyDown(e: KeyboardEvent, index: number) {
|
|
164
|
+
const input = e.target as HTMLInputElement;
|
|
165
|
+
|
|
166
|
+
if (e.key === "Backspace") {
|
|
167
|
+
// If current box is empty, jump to previous box and clear it
|
|
168
|
+
if (!input.value && index > 0) {
|
|
169
|
+
e.preventDefault();
|
|
170
|
+
this._inputs[index - 1].value = "";
|
|
171
|
+
this._inputs[index - 1].focus();
|
|
172
|
+
this._updateValue();
|
|
173
|
+
}
|
|
174
|
+
} else if (e.key === "ArrowLeft" && index > 0) {
|
|
175
|
+
e.preventDefault();
|
|
176
|
+
this._inputs[index - 1].focus();
|
|
177
|
+
} else if (e.key === "ArrowRight" && index < this.length - 1) {
|
|
178
|
+
e.preventDefault();
|
|
179
|
+
this._inputs[index + 1].focus();
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
// Handle cross-field pasting (e.g. pasting "123456" into the first box)
|
|
184
|
+
private _handlePaste(e: ClipboardEvent, startIndex: number) {
|
|
185
|
+
e.preventDefault();
|
|
186
|
+
this._touched = true;
|
|
187
|
+
|
|
188
|
+
const pasteData = e.clipboardData?.getData("text") || "";
|
|
189
|
+
// Clean the string (optional: restrict to numbers if you want strict numeric PINs)
|
|
190
|
+
const chars = pasteData.replace(/\s/g, "").split("");
|
|
191
|
+
|
|
192
|
+
if (!chars.length) return;
|
|
193
|
+
|
|
194
|
+
let currentIndex = startIndex;
|
|
195
|
+
for (const char of chars) {
|
|
196
|
+
if (currentIndex < this.length) {
|
|
197
|
+
this._inputs[currentIndex].value = char;
|
|
198
|
+
currentIndex++;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
// Focus the last filled input (or the very last input if we filled them all)
|
|
203
|
+
const focusIndex = Math.min(currentIndex, this.length - 1);
|
|
204
|
+
this._inputs[focusIndex].focus();
|
|
205
|
+
|
|
206
|
+
this._updateValue();
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
render() {
|
|
210
|
+
// Break the current value into an array of characters for rendering
|
|
211
|
+
const values = this.value.padEnd(this.length, " ").split("");
|
|
212
|
+
|
|
213
|
+
const isInvalid = this.invalid || !!this.error;
|
|
214
|
+
|
|
215
|
+
return html`
|
|
216
|
+
${this.label ? html`<label>${this.label}</label>` : ""}
|
|
217
|
+
|
|
218
|
+
<div class=${classMap({"pin-container": true, "is-invalid": isInvalid})}>
|
|
219
|
+
${values
|
|
220
|
+
.slice(0, this.length)
|
|
221
|
+
.map(
|
|
222
|
+
(char, index) => html`
|
|
223
|
+
<input
|
|
224
|
+
class="pin-box"
|
|
225
|
+
aria-label="Digit ${index + 1}"
|
|
226
|
+
type=${this.mask ? "password" : "text"}
|
|
227
|
+
inputmode="numeric"
|
|
228
|
+
autocomplete="${"one-time-code" as any}"
|
|
229
|
+
maxlength="1"
|
|
230
|
+
.value=${char.trim()}
|
|
231
|
+
?disabled=${this.disabled}
|
|
232
|
+
@input=${(e: InputEvent) => this._handleInput(e, index)}
|
|
233
|
+
@keydown=${(e: KeyboardEvent) => this._handleKeyDown(e, index)}
|
|
234
|
+
@paste=${(e: ClipboardEvent) => this._handlePaste(e, index)}
|
|
235
|
+
/>
|
|
236
|
+
`,
|
|
237
|
+
)}
|
|
238
|
+
</div>
|
|
239
|
+
|
|
240
|
+
${isInvalid && this.error ? html`<span class="error-msg">${this.error}</span>` : ""}
|
|
241
|
+
`;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
declare global {
|
|
246
|
+
interface HTMLElementTagNameMap {
|
|
247
|
+
"st-pin-input": StPinInput;
|
|
248
|
+
}
|
|
249
|
+
}
|