@solid-design-system/components 1.23.0 → 1.24.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/dist/components/es/checkbox.js +1 -11
- package/dist/components/es/input.js +1 -0
- package/dist/components/es/live.js +11 -0
- package/dist/components/es/solid-components2.js +1 -1
- package/dist/components/es/solid-element.js +1 -1
- package/dist/components/umd/solid-components.js +21 -21
- package/dist/custom-elements.json +1 -1
- package/dist/package/components/icon/library.system.d.ts +8 -1
- package/dist/package/components/icon/library.system.js +52 -10
- package/dist/package/components/input/input.d.ts +76 -0
- package/dist/package/components/input/input.js +390 -0
- package/dist/package/solid-components.d.ts +1 -0
- package/dist/package/solid-components.js +22 -20
- package/dist/package/styles/form-control.styles.d.ts +2 -0
- package/dist/package/styles/form-control.styles.js +5 -0
- package/dist/package/styles/tailwind.css.js +1 -1
- package/dist/versioned-components/es/accordion-group.js +1 -1
- package/dist/versioned-components/es/accordion.js +1 -1
- package/dist/versioned-components/es/badge.js +1 -1
- package/dist/versioned-components/es/brandshape.js +1 -1
- package/dist/versioned-components/es/button.js +1 -1
- package/dist/versioned-components/es/carousel-item.js +1 -1
- package/dist/versioned-components/es/carousel.js +3 -3
- package/dist/versioned-components/es/checkbox-group.js +1 -1
- package/dist/versioned-components/es/checkbox.js +1 -11
- package/dist/versioned-components/es/divider.js +1 -1
- package/dist/versioned-components/es/drawer.js +1 -1
- package/dist/versioned-components/es/dropdown.js +1 -1
- package/dist/versioned-components/es/form.js +1 -1
- package/dist/versioned-components/es/icon.js +1 -1
- package/dist/versioned-components/es/include.js +1 -1
- package/dist/versioned-components/es/input.js +1 -0
- package/dist/versioned-components/es/link.js +1 -1
- package/dist/versioned-components/es/live.js +11 -0
- package/dist/versioned-components/es/navigation-item.js +1 -1
- package/dist/versioned-components/es/popup.js +1 -1
- package/dist/versioned-components/es/radio-group.js +1 -1
- package/dist/versioned-components/es/radio.js +1 -1
- package/dist/versioned-components/es/solid-components2.js +1 -1
- package/dist/versioned-components/es/solid-element.js +1 -1
- package/dist/versioned-components/es/spinner.js +1 -1
- package/dist/versioned-components/es/tag.js +1 -1
- package/dist/versioned-components/es/teaser.js +1 -1
- package/dist/versioned-components/es/tooltip.js +2 -2
- package/dist/versioned-components/es/video.js +1 -1
- package/dist/versioned-package/_components/button-group/button-group.d.ts +1 -1
- package/dist/versioned-package/_components/button-group/button-group.js +11 -11
- package/dist/versioned-package/components/accordion/accordion.d.ts +1 -1
- package/dist/versioned-package/components/accordion/accordion.js +2 -2
- package/dist/versioned-package/components/accordion-group/accordion-group.d.ts +1 -1
- package/dist/versioned-package/components/accordion-group/accordion-group.js +3 -3
- package/dist/versioned-package/components/badge/badge.d.ts +1 -1
- package/dist/versioned-package/components/badge/badge.js +1 -1
- package/dist/versioned-package/components/brandshape/brandshape.d.ts +1 -1
- package/dist/versioned-package/components/brandshape/brandshape.js +1 -1
- package/dist/versioned-package/components/button/button.d.ts +1 -1
- package/dist/versioned-package/components/button/button.js +4 -4
- package/dist/versioned-package/components/carousel/carousel.d.ts +1 -1
- package/dist/versioned-package/components/carousel/carousel.js +6 -6
- package/dist/versioned-package/components/carousel-item/carousel-item.d.ts +1 -1
- package/dist/versioned-package/components/carousel-item/carousel-item.js +1 -1
- package/dist/versioned-package/components/checkbox/checkbox.d.ts +1 -1
- package/dist/versioned-package/components/checkbox/checkbox.js +4 -4
- package/dist/versioned-package/components/checkbox-group/checkbox-group.d.ts +1 -1
- package/dist/versioned-package/components/checkbox-group/checkbox-group.js +5 -5
- package/dist/versioned-package/components/divider/divider.d.ts +1 -1
- package/dist/versioned-package/components/divider/divider.js +2 -2
- package/dist/versioned-package/components/drawer/drawer.d.ts +1 -1
- package/dist/versioned-package/components/drawer/drawer.js +2 -2
- package/dist/versioned-package/components/dropdown/dropdown.d.ts +1 -1
- package/dist/versioned-package/components/dropdown/dropdown.js +6 -6
- package/dist/versioned-package/components/icon/icon.d.ts +1 -1
- package/dist/versioned-package/components/icon/icon.js +1 -1
- package/dist/versioned-package/components/icon/library.system.d.ts +8 -1
- package/dist/versioned-package/components/icon/library.system.js +52 -10
- package/dist/versioned-package/components/include/include.d.ts +1 -1
- package/dist/versioned-package/components/include/include.js +1 -1
- package/dist/versioned-package/components/input/input.d.ts +76 -0
- package/dist/versioned-package/components/input/input.js +390 -0
- package/dist/versioned-package/components/link/link.d.ts +1 -1
- package/dist/versioned-package/components/link/link.js +2 -2
- package/dist/versioned-package/components/navigation-item/navigation-item.d.ts +1 -1
- package/dist/versioned-package/components/navigation-item/navigation-item.js +3 -3
- package/dist/versioned-package/components/popup/popup.d.ts +1 -1
- package/dist/versioned-package/components/popup/popup.js +1 -1
- package/dist/versioned-package/components/radio/radio.d.ts +1 -1
- package/dist/versioned-package/components/radio/radio.js +2 -2
- package/dist/versioned-package/components/radio-group/radio-group.d.ts +2 -2
- package/dist/versioned-package/components/radio-group/radio-group.js +14 -14
- package/dist/versioned-package/components/spinner/spinner.d.ts +1 -1
- package/dist/versioned-package/components/spinner/spinner.js +1 -1
- package/dist/versioned-package/components/tag/tag.d.ts +1 -1
- package/dist/versioned-package/components/tag/tag.js +2 -2
- package/dist/versioned-package/components/teaser/teaser.js +1 -1
- package/dist/versioned-package/components/tooltip/tooltip.d.ts +1 -1
- package/dist/versioned-package/components/tooltip/tooltip.js +5 -5
- package/dist/versioned-package/components/video/video.d.ts +1 -1
- package/dist/versioned-package/components/video/video.js +2 -2
- package/dist/versioned-package/internal/form.js +2 -2
- package/dist/versioned-package/solid-components.d.ts +1 -0
- package/dist/versioned-package/solid-components.js +22 -20
- package/dist/versioned-package/styles/form-control.styles.d.ts +2 -0
- package/dist/versioned-package/styles/form-control.styles.js +5 -0
- package/dist/versioned-package/styles/tailwind.css.js +1 -1
- package/dist/versioned-styles/solid-styles.css +1 -1
- package/dist/vscode.html-custom-data.json +570 -24
- package/dist/web-types.json +579 -1
- package/package.json +5 -5
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
import type { IconLibrary } from './library';
|
|
2
2
|
export declare const icons: {
|
|
3
|
+
calendar: string;
|
|
3
4
|
'chevron-down': string;
|
|
4
5
|
'chevron-up': string;
|
|
6
|
+
clock: string;
|
|
5
7
|
close: string;
|
|
8
|
+
'closing-round': string;
|
|
9
|
+
confirm: string;
|
|
10
|
+
eye: string;
|
|
11
|
+
'eye-crossed-out': string;
|
|
6
12
|
'info-circle': string;
|
|
7
13
|
'status-hook': string;
|
|
8
14
|
'status-minus': string;
|
|
9
|
-
start: string;
|
|
10
15
|
pause: string;
|
|
16
|
+
risk: string;
|
|
17
|
+
start: string;
|
|
11
18
|
};
|
|
12
19
|
declare const systemLibrary: IconLibrary;
|
|
13
20
|
export default systemLibrary;
|
|
@@ -1,19 +1,54 @@
|
|
|
1
1
|
const icons = {
|
|
2
|
+
calendar: `
|
|
3
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
|
4
|
+
<path d="M21 2H3a1 1 0 0 0-1 1v18a1 1 0 0 0 1 1h18a1 1 0 0 0 1-1V3a1 1 0 0 0-1-1ZM6 4v1.667a1 1 0 0 0 2 0V4h8v1.667a1 1 0 0 0 2 0V4h2v4H4V4h2ZM4 20V10h16v10H4Z"/>
|
|
5
|
+
<path d="m7.603 13.263.597.81.31-.25c.31-.25.593-.49.733-.63h.017c-.017.333-.033 1.14-.033 1.647V18h1.223v-6.03H9.353l-1.75 1.293ZM14.667 11.867c-1.543 0-2.26 1-2.26 3.163 0 1.9.667 3.063 2.217 3.063s2.193-1.18 2.193-3.13c-.017-2.063-.743-3.097-2.15-3.097v.001Zm-.044 5.333c-.647 0-1-.76-1-2.28 0-1.44.353-2.173 1-2.173s1 .743 1 2.233c0 1.49-.387 2.227-1.017 2.227l.017-.007Z"/>
|
|
6
|
+
</svg>
|
|
7
|
+
`,
|
|
2
8
|
"chevron-down": `
|
|
3
|
-
<svg
|
|
9
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
|
4
10
|
<path d="M20.257 6.333l-8.257 9.173-8.257-9.173c-0.181-0.181-0.431-0.292-0.707-0.292-0.552 0-1 0.448-1 1 0 0.238 0.083 0.456 0.222 0.628l-0.001-0.002 9 10c0.184 0.204 0.449 0.331 0.743 0.331s0.56-0.127 0.743-0.33l0.001-0.001 9-10c0.137-0.17 0.22-0.388 0.22-0.626 0-0.552-0.448-1-1-1-0.276 0-0.526 0.112-0.707 0.293v0z"></path>
|
|
5
11
|
</svg>
|
|
6
12
|
`,
|
|
7
13
|
"chevron-up": `
|
|
8
|
-
<svg
|
|
14
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
|
9
15
|
<path d="M12.743 6.333c-0.188-0.195-0.452-0.316-0.743-0.316s-0.555 0.121-0.743 0.315l-0 0-9 10c-0.137 0.17-0.22 0.388-0.22 0.626 0 0.552 0.448 1 1 1 0.276 0 0.526-0.112 0.707-0.293v0l8.257-9.173 8.257 9.173c0.181 0.181 0.431 0.292 0.707 0.292 0.552 0 1-0.448 1-1 0-0.238-0.083-0.456-0.222-0.628l0.001 0.002z"></path>
|
|
10
16
|
</svg>
|
|
11
17
|
`,
|
|
18
|
+
clock: `
|
|
19
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
|
20
|
+
<path d="M13 11.587V8a1 1 0 0 0-2 0v4c0 .07.007.138.021.203l-.001-.006a.855.855 0 0 0 .029.093l-.002-.006c0 .033 0 .067.03.1a.709.709 0 0 0 .055.103l-.002-.003.037.07c.04.057.081.107.127.153l2.827 2.83a1.002 1.002 0 0 0 1.417-1.417L13 11.587Z"/>
|
|
21
|
+
<path d="M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2Zm0 18a8 8 0 1 1 0-16 8 8 0 0 1 0 16Z"/>
|
|
22
|
+
</svg>
|
|
23
|
+
`,
|
|
12
24
|
close: `
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
`,
|
|
25
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
|
26
|
+
<path d="M21.707 2.293a1 1 0 0 0-1.414 0L12 10.586 3.707 2.293a1 1 0 0 0-1.413 1.414l-.001-.001 8.293 8.293-8.293 8.293a1 1 0 0 0 0 1.414 1 1 0 0 0 1.414 0L12 13.413l8.293 8.293a1 1 0 0 0 1.414 0 1 1 0 0 0 0-1.414l-8.293-8.293 8.293-8.293a1 1 0 0 0 0-1.414z"/></svg>
|
|
27
|
+
</svg>
|
|
28
|
+
`,
|
|
29
|
+
"closing-round": `
|
|
30
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
|
31
|
+
<path d="M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2Zm0 18a8 8 0 1 1 0-16 8 8 0 0 1 0 16Z"/>
|
|
32
|
+
<path d="M16.373 7.627a1 1 0 0 0-1.414 0l-2.96 2.96-2.96-2.96a1 1 0 0 0-1.413 1.414l-.001-.001 2.96 2.96-2.96 2.96a1 1 0 0 0 1.414 1.414l2.96-2.96 2.96 2.96a1 1 0 0 0 1.414-1.414L13.413 12l2.96-2.96a1 1 0 0 0 0-1.414v.001Z"/>
|
|
33
|
+
</svg>`,
|
|
34
|
+
confirm: `
|
|
35
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
|
36
|
+
<path d="M21.528 2.167a1 1 0 0 0-1.384.277l-.002.004-11.333 17-5.127-5.153a1 1 0 0 0-1.413 1.414l-.001-.001 6 6a.997.997 0 0 0 .707.293h.1c.307-.032.57-.199.731-.44l.002-.004 12-18a1 1 0 0 0-.276-1.388l-.004-.002Z"/>
|
|
37
|
+
</svg>
|
|
38
|
+
`,
|
|
39
|
+
eye: `
|
|
40
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
|
41
|
+
<path d="M12 18.96c-5.263 0-10-5.68-10-6.96 0-1.28 4.737-6.96 10-6.96S22 10.72 22 12c0 1.28-4.737 6.96-10 6.96ZM4.1 12c.76 1.197 4.07 4.96 7.9 4.96s7.14-3.767 7.9-4.96c-.76-1.197-4.07-4.96-7.9-4.96S4.86 10.807 4.1 12Z"/>
|
|
42
|
+
<path d="M12 16.107A4.11 4.11 0 0 1 7.893 12 4.11 4.11 0 0 1 12 7.893 4.11 4.11 0 0 1 16.107 12 4.11 4.11 0 0 1 12 16.107Zm0-6.21a2.107 2.107 0 1 0 0 4.213 2.107 2.107 0 0 0 0-4.213Z"/>
|
|
43
|
+
</svg>
|
|
44
|
+
`,
|
|
45
|
+
"eye-crossed-out": `
|
|
46
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
|
47
|
+
<path d="M12 16.107A4.11 4.11 0 0 1 7.893 12 4.11 4.11 0 0 1 12 7.893 4.11 4.11 0 0 1 16.107 12 4.11 4.11 0 0 1 12 16.107Zm0-6.21a2.107 2.107 0 1 0 0 4.213 2.107 2.107 0 0 0 0-4.213Z"/>
|
|
48
|
+
<path d="M12 18.96c-5.263 0-10-5.68-10-6.96 0-1.28 4.737-6.96 10-6.96S22 10.72 22 12c0 1.28-4.737 6.96-10 6.96ZM4.1 12c.76 1.197 4.07 4.96 7.9 4.96s7.14-3.767 7.9-4.96c-.76-1.197-4.07-4.96-7.9-4.96S4.86 10.807 4.1 12Z"/>
|
|
49
|
+
<path d="M3 22a1 1 0 0 1-.707-1.707l18-18a1 1 0 0 1 1.414 1.414l-18 18A.991.991 0 0 1 3 22Z"/>
|
|
50
|
+
</svg>
|
|
51
|
+
`,
|
|
17
52
|
"info-circle": `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2Zm0 18a8 8 0 1 1 0-16 8 8 0 0 1 0 16Z"/><path d="M13.333 7.833a1.5 1.5 0 1 1-3.001-.001 1.5 1.5 0 0 1 3.001.001ZM13 11.667a1 1 0 0 0-1-1h-1a1 1 0 0 0 0 2v2.667h2v-3.667Z"/><path d="M11 16.333v-1h-1a1 1 0 0 0 0 2h2a1 1 0 0 1-1-1Zm3-1h-1v1a1 1 0 0 1-1 1h2a1 1 0 0 0 0-2Z"/><path d="M13 16.333v-1h-2v1a1 1 0 0 0 2 0Z"/></svg>`,
|
|
18
53
|
"status-hook": `
|
|
19
54
|
<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none">
|
|
@@ -25,14 +60,21 @@ const icons = {
|
|
|
25
60
|
<path d="M10 5.375H2C1.65496 5.375 1.375 5.65496 1.375 6C1.375 6.34504 1.65496 6.625 2 6.625H10C10.345 6.625 10.625 6.34504 10.625 6C10.625 5.65496 10.345 5.375 10 5.375Z" fill="currentColor"/>
|
|
26
61
|
</svg>
|
|
27
62
|
`,
|
|
28
|
-
start: `
|
|
29
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
|
|
30
|
-
<path d="m57.44 29.76-37.333-24A2.667 2.667 0 0 0 16 8v48a2.668 2.668 0 0 0 2.667 2.666 2.672 2.672 0 0 0 1.45-.431l-.01.005 37.333-24a2.67 2.67 0 0 0 1.192-2.221c0-.923-.47-1.74-1.184-2.216l-.01-.006.002-.037ZM21.333 51.112V12.89l29.734 19.112-29.734 19.11Z"/>
|
|
31
|
-
</svg>`,
|
|
32
63
|
pause: `
|
|
33
64
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
|
34
65
|
<path d="M9 22a.99997.99997 0 0 0 1-1V3a1.00003 1.00003 0 0 0-1-1H5a1.00003 1.00003 0 0 0-1 1v18a.99997.99997 0 0 0 1 1h4ZM6 4h2v16H6V4ZM19 22c.2652 0 .5196-.1054.7071-.2929A1.0001 1.0001 0 0 0 20 21V3a.99997.99997 0 0 0-1-1h-4a.99997.99997 0 0 0-1 1v18c0 .2652.1054.5196.2929.7071S14.7348 22 15 22h4ZM16 4h2v16h-2V4Z"/>
|
|
35
66
|
</svg>
|
|
67
|
+
`,
|
|
68
|
+
risk: `
|
|
69
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
|
70
|
+
<path d="M12.893 2.553a1.002 1.002 0 0 0-1.784-.006L2.106 20.553A1 1 0 0 0 3 22h18a1 1 0 0 0 .891-1.452l.003.006-9.001-18.001ZM4.617 20 12 5.237 19.383 20H4.617Z"/>
|
|
71
|
+
<path d="M11 10.667V15a1 1 0 0 0 2 0v-4.333a1 1 0 0 0-2 0ZM13 18a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"/>
|
|
72
|
+
</svg>
|
|
73
|
+
`,
|
|
74
|
+
start: `
|
|
75
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
|
|
76
|
+
<path d="m57.44 29.76-37.333-24A2.667 2.667 0 0 0 16 8v48a2.668 2.668 0 0 0 2.667 2.666 2.672 2.672 0 0 0 1.45-.431l-.01.005 37.333-24a2.67 2.67 0 0 0 1.192-2.221c0-.923-.47-1.74-1.184-2.216l-.01-.006.002-.037ZM21.333 51.112V12.89l29.734 19.112-29.734 19.11Z"/>
|
|
77
|
+
</svg>
|
|
36
78
|
`
|
|
37
79
|
};
|
|
38
80
|
const systemLibrary = {
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import '../icon/icon';
|
|
2
|
+
import { FormControlController } from '../../internal/form';
|
|
3
|
+
import SolidElement from '../../internal/solid-element';
|
|
4
|
+
import type { SolidFormControl } from '../../internal/solid-element';
|
|
5
|
+
export default class SdInput extends SolidElement implements SolidFormControl {
|
|
6
|
+
protected readonly formControlController: FormControlController;
|
|
7
|
+
private readonly hasSlotController;
|
|
8
|
+
private readonly localize;
|
|
9
|
+
input: HTMLInputElement;
|
|
10
|
+
private hasFocus;
|
|
11
|
+
type: 'date' | 'datetime-local' | 'email' | 'number' | 'password' | 'search' | 'tel' | 'text' | 'time' | 'url';
|
|
12
|
+
size: 'lg' | 'md' | 'sm';
|
|
13
|
+
inputmode: 'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url';
|
|
14
|
+
value: string;
|
|
15
|
+
defaultValue: string;
|
|
16
|
+
placeholder: string;
|
|
17
|
+
label: string;
|
|
18
|
+
helpText: string;
|
|
19
|
+
clearable: boolean;
|
|
20
|
+
disabled: boolean;
|
|
21
|
+
readonly: boolean;
|
|
22
|
+
passwordToggle: boolean;
|
|
23
|
+
passwordVisible: boolean;
|
|
24
|
+
noSpinButtons: boolean;
|
|
25
|
+
minlength: number;
|
|
26
|
+
maxlength: number;
|
|
27
|
+
min: number;
|
|
28
|
+
max: number;
|
|
29
|
+
form: string;
|
|
30
|
+
name: string;
|
|
31
|
+
title: string;
|
|
32
|
+
required: boolean;
|
|
33
|
+
pattern: string;
|
|
34
|
+
step: number | 'any';
|
|
35
|
+
autocapitalize: 'off' | 'none' | 'on' | 'sentences' | 'words' | 'characters';
|
|
36
|
+
autocorrect: 'off' | 'on';
|
|
37
|
+
autocomplete: string;
|
|
38
|
+
autofocus: boolean;
|
|
39
|
+
enterkeyhint: 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send';
|
|
40
|
+
spellcheck: boolean;
|
|
41
|
+
get valueAsDate(): Date | null;
|
|
42
|
+
set valueAsDate(newValue: Date | null);
|
|
43
|
+
get valueAsNumber(): number;
|
|
44
|
+
set valueAsNumber(newValue: number);
|
|
45
|
+
get validity(): ValidityState;
|
|
46
|
+
firstUpdated(): void;
|
|
47
|
+
private handleBlur;
|
|
48
|
+
private handleChange;
|
|
49
|
+
private handleClearClick;
|
|
50
|
+
private handleFocus;
|
|
51
|
+
private handleInput;
|
|
52
|
+
private handleInvalid;
|
|
53
|
+
private handleKeyDown;
|
|
54
|
+
private handlePasswordToggle;
|
|
55
|
+
handleDisabledChange(): void;
|
|
56
|
+
handleStepChange(): void;
|
|
57
|
+
handleValueChange(): Promise<void>;
|
|
58
|
+
focus(options?: FocusOptions): void;
|
|
59
|
+
blur(): void;
|
|
60
|
+
select(): void;
|
|
61
|
+
setSelectionRange(selectionStart: number, selectionEnd: number, selectionDirection?: 'forward' | 'backward' | 'none'): void;
|
|
62
|
+
setRangeText(replacement: string, start?: number, end?: number, selectMode?: 'select' | 'start' | 'end' | 'preserve'): void;
|
|
63
|
+
showPicker(): void;
|
|
64
|
+
stepUp(): void;
|
|
65
|
+
stepDown(): void;
|
|
66
|
+
checkValidity(): boolean;
|
|
67
|
+
reportValidity(): boolean;
|
|
68
|
+
setCustomValidity(message: string): void;
|
|
69
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
70
|
+
static styles: import("lit").CSSResultGroup[];
|
|
71
|
+
}
|
|
72
|
+
declare global {
|
|
73
|
+
interface HTMLElementTagNameMap {
|
|
74
|
+
'sd-input': SdInput;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
@@ -0,0 +1,390 @@
|
|
|
1
|
+
var _a;
|
|
2
|
+
import "../icon/icon.js";
|
|
3
|
+
import { css, html } from "lit";
|
|
4
|
+
import { customElement } from "../../internal/register-custom-element.js";
|
|
5
|
+
import { defaultValue } from "../../internal/default-value.js";
|
|
6
|
+
import { FormControlController } from "../../internal/form.js";
|
|
7
|
+
import { HasSlotController } from "../../internal/slot.js";
|
|
8
|
+
import { ifDefined } from "lit/directives/if-defined.js";
|
|
9
|
+
import { live } from "lit/directives/live.js";
|
|
10
|
+
import { LocalizeController } from "../../utilities/localize.js";
|
|
11
|
+
import { query, state, property } from "lit/decorators.js";
|
|
12
|
+
import { watch } from "../../internal/watch.js";
|
|
13
|
+
import componentStyles from "../../styles/component.styles.js";
|
|
14
|
+
import cx from "classix";
|
|
15
|
+
import formControlStyles from "../../styles/form-control.styles.js";
|
|
16
|
+
import SolidElement from "../../internal/solid-element.js";
|
|
17
|
+
var __defProp = Object.defineProperty;
|
|
18
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
19
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
20
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
21
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
22
|
+
if (decorator = decorators[i])
|
|
23
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
24
|
+
if (kind && result)
|
|
25
|
+
__defProp(target, key, result);
|
|
26
|
+
return result;
|
|
27
|
+
};
|
|
28
|
+
const isChromium = (_a = navigator.userAgentData) == null ? void 0 : _a.brands.some((b) => b.brand.includes("Chromium"));
|
|
29
|
+
const isFirefox = isChromium ? false : navigator.userAgent.includes("Firefox");
|
|
30
|
+
let SdInput = class extends SolidElement {
|
|
31
|
+
constructor() {
|
|
32
|
+
super(...arguments);
|
|
33
|
+
this.formControlController = new FormControlController(this);
|
|
34
|
+
this.hasSlotController = new HasSlotController(
|
|
35
|
+
this,
|
|
36
|
+
"help-text",
|
|
37
|
+
"label",
|
|
38
|
+
"left",
|
|
39
|
+
"right",
|
|
40
|
+
"message",
|
|
41
|
+
"placeholder"
|
|
42
|
+
);
|
|
43
|
+
this.localize = new LocalizeController(this);
|
|
44
|
+
this.hasFocus = false;
|
|
45
|
+
this.type = "text";
|
|
46
|
+
this.size = "lg";
|
|
47
|
+
this.value = "";
|
|
48
|
+
this.defaultValue = "";
|
|
49
|
+
this.placeholder = "";
|
|
50
|
+
this.label = "";
|
|
51
|
+
this.helpText = "";
|
|
52
|
+
this.clearable = false;
|
|
53
|
+
this.disabled = false;
|
|
54
|
+
this.readonly = false;
|
|
55
|
+
this.passwordToggle = false;
|
|
56
|
+
this.passwordVisible = false;
|
|
57
|
+
this.noSpinButtons = false;
|
|
58
|
+
this.form = "";
|
|
59
|
+
this.name = "";
|
|
60
|
+
this.title = "";
|
|
61
|
+
this.required = false;
|
|
62
|
+
this.spellcheck = true;
|
|
63
|
+
}
|
|
64
|
+
/** Gets or sets the current value as a `Date` object. Returns `null` if the value can't be converted. */
|
|
65
|
+
get valueAsDate() {
|
|
66
|
+
var _a2;
|
|
67
|
+
return ((_a2 = this.input) == null ? void 0 : _a2.valueAsDate) ?? null;
|
|
68
|
+
}
|
|
69
|
+
set valueAsDate(newValue) {
|
|
70
|
+
const input = document.createElement("input");
|
|
71
|
+
input.type = "date";
|
|
72
|
+
input.valueAsDate = newValue;
|
|
73
|
+
this.value = input.value;
|
|
74
|
+
}
|
|
75
|
+
/** Gets or sets the current value as a number. Returns `NaN` if the value can't be converted. */
|
|
76
|
+
get valueAsNumber() {
|
|
77
|
+
var _a2;
|
|
78
|
+
return ((_a2 = this.input) == null ? void 0 : _a2.valueAsNumber) ?? parseFloat(this.value);
|
|
79
|
+
}
|
|
80
|
+
set valueAsNumber(newValue) {
|
|
81
|
+
const input = document.createElement("input");
|
|
82
|
+
input.type = "number";
|
|
83
|
+
input.valueAsNumber = newValue;
|
|
84
|
+
this.value = input.value;
|
|
85
|
+
}
|
|
86
|
+
/** Gets the validity state object */
|
|
87
|
+
get validity() {
|
|
88
|
+
return this.input.validity;
|
|
89
|
+
}
|
|
90
|
+
firstUpdated() {
|
|
91
|
+
this.formControlController.updateValidity();
|
|
92
|
+
}
|
|
93
|
+
handleBlur() {
|
|
94
|
+
this.hasFocus = false;
|
|
95
|
+
this.emit("sd-blur");
|
|
96
|
+
}
|
|
97
|
+
handleChange() {
|
|
98
|
+
this.value = this.input.value;
|
|
99
|
+
this.emit("sd-change");
|
|
100
|
+
}
|
|
101
|
+
handleClearClick(event) {
|
|
102
|
+
this.value = "";
|
|
103
|
+
this.emit("sd-clear");
|
|
104
|
+
this.emit("sd-input");
|
|
105
|
+
this.emit("sd-change");
|
|
106
|
+
this.input.focus();
|
|
107
|
+
event.stopPropagation();
|
|
108
|
+
}
|
|
109
|
+
handleFocus() {
|
|
110
|
+
this.hasFocus = true;
|
|
111
|
+
this.emit("sd-focus");
|
|
112
|
+
}
|
|
113
|
+
handleInput() {
|
|
114
|
+
this.value = this.input.value;
|
|
115
|
+
this.formControlController.updateValidity();
|
|
116
|
+
this.emit("sd-input");
|
|
117
|
+
}
|
|
118
|
+
handleInvalid() {
|
|
119
|
+
this.formControlController.setValidity(false);
|
|
120
|
+
}
|
|
121
|
+
handleKeyDown(event) {
|
|
122
|
+
const hasModifier = event.metaKey || event.ctrlKey || event.shiftKey || event.altKey;
|
|
123
|
+
if (event.key === "Enter" && !hasModifier) {
|
|
124
|
+
setTimeout(() => {
|
|
125
|
+
if (!event.defaultPrevented && !event.isComposing) {
|
|
126
|
+
this.formControlController.submit();
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
handlePasswordToggle() {
|
|
132
|
+
this.passwordVisible = !this.passwordVisible;
|
|
133
|
+
}
|
|
134
|
+
handleDisabledChange() {
|
|
135
|
+
this.formControlController.setValidity(this.disabled);
|
|
136
|
+
}
|
|
137
|
+
handleStepChange() {
|
|
138
|
+
this.input.step = String(this.step);
|
|
139
|
+
this.formControlController.updateValidity();
|
|
140
|
+
}
|
|
141
|
+
async handleValueChange() {
|
|
142
|
+
await this.updateComplete;
|
|
143
|
+
this.formControlController.updateValidity();
|
|
144
|
+
}
|
|
145
|
+
/** Sets focus on the input. */
|
|
146
|
+
focus(options) {
|
|
147
|
+
this.input.focus(options);
|
|
148
|
+
}
|
|
149
|
+
/** Removes focus from the input. */
|
|
150
|
+
blur() {
|
|
151
|
+
this.input.blur();
|
|
152
|
+
}
|
|
153
|
+
/** Selects all the text in the input. */
|
|
154
|
+
select() {
|
|
155
|
+
this.input.select();
|
|
156
|
+
}
|
|
157
|
+
/** Sets the start and end positions of the text selection (0-based). */
|
|
158
|
+
setSelectionRange(selectionStart, selectionEnd, selectionDirection = "none") {
|
|
159
|
+
this.input.setSelectionRange(selectionStart, selectionEnd, selectionDirection);
|
|
160
|
+
}
|
|
161
|
+
/** Replaces a range of text with a new string. */
|
|
162
|
+
setRangeText(replacement, start, end, selectMode) {
|
|
163
|
+
this.input.setRangeText(replacement, start, end, selectMode);
|
|
164
|
+
if (this.value !== this.input.value) {
|
|
165
|
+
this.value = this.input.value;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
/** Displays the browser picker for an input element (only works if the browser supports it for the input type). */
|
|
169
|
+
showPicker() {
|
|
170
|
+
if ("showPicker" in HTMLInputElement.prototype) {
|
|
171
|
+
this.input.showPicker();
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
/** Increments the value of a numeric input type by the value of the step attribute. */
|
|
175
|
+
stepUp() {
|
|
176
|
+
this.input.stepUp();
|
|
177
|
+
if (this.value !== this.input.value) {
|
|
178
|
+
this.value = this.input.value;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
/** Decrements the value of a numeric input type by the value of the step attribute. */
|
|
182
|
+
stepDown() {
|
|
183
|
+
this.input.stepDown();
|
|
184
|
+
if (this.value !== this.input.value) {
|
|
185
|
+
this.value = this.input.value;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
/** Checks for validity but does not show the browser's validation message. */
|
|
189
|
+
checkValidity() {
|
|
190
|
+
var _a2;
|
|
191
|
+
return (_a2 = this.input) == null ? void 0 : _a2.checkValidity();
|
|
192
|
+
}
|
|
193
|
+
/** Checks for validity and shows the browser's validation message if the control is invalid. */
|
|
194
|
+
reportValidity() {
|
|
195
|
+
return this.input.reportValidity();
|
|
196
|
+
}
|
|
197
|
+
/** Sets a custom validation message. Pass an empty string to restore validity. */
|
|
198
|
+
setCustomValidity(message) {
|
|
199
|
+
this.input.setCustomValidity(message);
|
|
200
|
+
this.formControlController.updateValidity();
|
|
201
|
+
}
|
|
202
|
+
render() {
|
|
203
|
+
const slots = {
|
|
204
|
+
label: this.hasSlotController.test("label"),
|
|
205
|
+
helpText: this.hasSlotController.test("help-text"),
|
|
206
|
+
description: this.hasSlotController.test("description"),
|
|
207
|
+
left: this.hasSlotController.test("left"),
|
|
208
|
+
right: this.hasSlotController.test("right")
|
|
209
|
+
};
|
|
210
|
+
const hasLabel = this.label ? true : !!slots["label"];
|
|
211
|
+
const hasHelpText = this.helpText ? true : !!slots["helpText"];
|
|
212
|
+
const hasClearIcon = this.clearable && !this.readonly && (typeof this.value === "number" || this.value.length > 0);
|
|
213
|
+
const hasValidationAttr = this.required || !!this.pattern || !!this.minlength || !!this.maxlength;
|
|
214
|
+
const isInvalid = hasValidationAttr && !this.checkValidity();
|
|
215
|
+
const isValid = hasValidationAttr && this.checkValidity();
|
|
216
|
+
const inputState = this.disabled ? "disabled" : this.readonly ? "readonly" : this.hasFocus && isInvalid ? "activeInvalid" : this.hasFocus && isValid ? "activeValid" : this.hasFocus ? "active" : isInvalid ? "invalid" : isValid ? "valid" : "default";
|
|
217
|
+
const textSize = this.size === "sm" ? "text-sm" : "text-base";
|
|
218
|
+
const textColor = {
|
|
219
|
+
disabled: "text-neutral-500",
|
|
220
|
+
readonly: "text-black",
|
|
221
|
+
activeInvalid: "text-error",
|
|
222
|
+
activeValid: "text-success",
|
|
223
|
+
active: "text-black",
|
|
224
|
+
invalid: "text-error",
|
|
225
|
+
valid: "text-success",
|
|
226
|
+
default: "text-black"
|
|
227
|
+
}[inputState];
|
|
228
|
+
const borderColor = {
|
|
229
|
+
disabled: "border-neutral-500",
|
|
230
|
+
readonly: "border-neutral-800",
|
|
231
|
+
activeInvalid: "border-error border-2",
|
|
232
|
+
activeValid: "border-success border-2",
|
|
233
|
+
active: "border-primary border-2",
|
|
234
|
+
invalid: "border-error",
|
|
235
|
+
valid: "border-success",
|
|
236
|
+
default: "border-neutral-800"
|
|
237
|
+
}[inputState];
|
|
238
|
+
const iconColor = this.disabled ? "text-neutral-500" : "text-primary";
|
|
239
|
+
const iconMarginLeft = { sm: "ml-1", md: "ml-2", lg: "ml-2" }[this.size];
|
|
240
|
+
const iconSize = {
|
|
241
|
+
sm: "text-base",
|
|
242
|
+
md: "text-lg",
|
|
243
|
+
lg: "text-xl"
|
|
244
|
+
}[this.size];
|
|
245
|
+
return html`<div part="form-control" class="${cx("form-control", hasLabel && "form-control--has-label", this.disabled && "pointer-events-none")}"><label part="form-control-label" class="${cx("form-control-label mb-2", hasLabel ? "inline-block" : "hidden", textSize)}" for="input" aria-hidden="${hasLabel ? "false" : "true"}"><slot name="label">${this.label}${this.required ? "*" : ""}</slot></label><div part="form-control-input" class="form-control-input relative w-full"><div part="border" class="${cx(
|
|
246
|
+
"absolute w-full h-full pointer-events-none border rounded-default transition-all",
|
|
247
|
+
borderColor
|
|
248
|
+
)}"></div><div part="base" class="${cx(
|
|
249
|
+
"px-4 flex flex-row items-center rounded-default transition-all",
|
|
250
|
+
// Vertical Padding
|
|
251
|
+
this.size === "lg" ? "py-2" : "py-1",
|
|
252
|
+
// States
|
|
253
|
+
!this.disabled && !this.readonly ? "hover:bg-neutral-200" : "",
|
|
254
|
+
this.readonly && "bg-neutral-100",
|
|
255
|
+
isInvalid && "form-control-input--invalid",
|
|
256
|
+
textColor,
|
|
257
|
+
!this.value && "input--empty",
|
|
258
|
+
this.noSpinButtons && "input--no-spin-buttons",
|
|
259
|
+
isFirefox && "input--is-firefox"
|
|
260
|
+
)}">${slots["left"] ? html`<slot name="left" part="left" class="${cx("inline-flex", this.size === "sm" ? "mr-1" : "mr-2", iconColor, iconSize)}"></slot>` : ""} <input part="input" id="input" class="${cx(
|
|
261
|
+
"min-w-0 flex-grow focus:outline-none bg-transparent placeholder-neutral-700",
|
|
262
|
+
this.size === "sm" ? "h-6" : "h-8",
|
|
263
|
+
textSize
|
|
264
|
+
)}" type="${this.type === "password" && this.passwordVisible ? "text" : this.type}" title="${this.title}" name="${ifDefined(this.name)}" ?disabled="${this.disabled}" ?readonly="${this.readonly}" ?required="${this.required}" placeholder="${ifDefined(this.placeholder)}" minlength="${ifDefined(this.minlength)}" maxlength="${ifDefined(this.maxlength)}" min="${ifDefined(this.min)}" max="${ifDefined(this.max)}" step="${ifDefined(this.step)}" .value="${live(this.value)}" autocapitalize="${ifDefined(this.type === "password" ? "off" : this.autocapitalize)}" autocomplete="${ifDefined(this.type === "password" ? "off" : this.autocomplete)}" autocorrect="${ifDefined(this.type === "password" ? "off" : this.autocorrect)}" ?autofocus="${this.autofocus}" spellcheck="${this.spellcheck}" pattern="${ifDefined(this.pattern)}" enterkeyhint="${ifDefined(this.enterkeyhint)}" inputmode="${ifDefined(this.inputmode)}" aria-describedby="help-text" @change="${this.handleChange}" @input="${this.handleInput}" @invalid="${this.handleInvalid}" @keydown="${this.handleKeyDown}" @focus="${this.handleFocus}" @blur="${this.handleBlur}"> ${hasClearIcon ? html`<button part="clear-button" class="${cx("flex justify-center ", iconMarginLeft)}" type="button" aria-label="${this.localize.term("clearEntry")}" @click="${this.handleClearClick}" tabindex="-1"><slot name="clear-icon"><sd-icon class="${cx("text-neutral-500", iconSize)}" library="system" name="closing-round"></sd-icon></slot></button>` : ""} ${this.passwordToggle && this.type === "password" ? html`<button aria-label="${this.localize.term(this.passwordVisible ? "hidePassword" : "showPassword")}" part="password-toggle-button" class="flex items-center" type="button" @click="${this.handlePasswordToggle}" tabindex="-1">${this.passwordVisible ? html`<slot name="show-password-icon"><sd-icon class="${cx(iconColor, iconMarginLeft, iconSize)}" library="system" name="eye"></sd-icon></slot>` : html`<slot name="hide-password-icon"><sd-icon class="${cx(iconColor, iconMarginLeft, iconSize)}" library="system" name="eye-crossed-out"></sd-icon></slot>`}</button>` : ""} ${(this.type === "date" || this.type === "datetime-local") && !isFirefox ? html`<sd-icon class="${cx(iconColor, iconMarginLeft, iconSize)}" library="system" name="calendar"></sd-icon>` : ""} ${this.type === "time" ? html`<sd-icon class="${cx(iconColor, iconMarginLeft, iconSize)}" library="system" name="clock"></sd-icon>` : ""} ${isInvalid ? html`<sd-icon class="${cx("text-error", iconMarginLeft, iconSize)}" library="system" name="risk"></sd-icon>` : ""} ${isValid ? html`<sd-icon class="${cx("text-success", iconMarginLeft, iconSize)}" library="system" name="confirm"></sd-icon>` : ""} ${slots["right"] ? html`<slot name="right" part="right" class="${cx("inline-flex", iconColor, iconMarginLeft, iconSize)}"></slot>` : ""}</div></div><slot name="help-text" part="form-control-help-text" id="help-text" class="${cx("text-sm text-neutral-700", hasHelpText ? "block" : "hidden")}" aria-hidden="${hasHelpText ? "false" : "true"}">${this.helpText}</slot></div>`;
|
|
265
|
+
}
|
|
266
|
+
};
|
|
267
|
+
SdInput.styles = [
|
|
268
|
+
componentStyles,
|
|
269
|
+
formControlStyles,
|
|
270
|
+
SolidElement.styles,
|
|
271
|
+
css`:host{box-sizing:border-box;position:relative;display:inline-block;text-align:left;width:100%}:host([vertical]){display:block}details summary::-webkit-details-marker{display:none}input::-webkit-inner-spin-button,input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}input[type=number]{-moz-appearance:textfield}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration,input[type=search]::-webkit-search-results-button,input[type=search]::-webkit-search-results-decoration{display:none}input[type=time]::-webkit-calendar-picker-indicator{background:0 0}input[type=date]::-webkit-calendar-picker-indicator{display:none}input[type=datetime-local]::-webkit-calendar-picker-indicator{display:none}`
|
|
272
|
+
];
|
|
273
|
+
__decorateClass([
|
|
274
|
+
query("#input")
|
|
275
|
+
], SdInput.prototype, "input", 2);
|
|
276
|
+
__decorateClass([
|
|
277
|
+
state()
|
|
278
|
+
], SdInput.prototype, "hasFocus", 2);
|
|
279
|
+
__decorateClass([
|
|
280
|
+
property({ reflect: true })
|
|
281
|
+
], SdInput.prototype, "type", 2);
|
|
282
|
+
__decorateClass([
|
|
283
|
+
property({ reflect: true })
|
|
284
|
+
], SdInput.prototype, "size", 2);
|
|
285
|
+
__decorateClass([
|
|
286
|
+
property()
|
|
287
|
+
], SdInput.prototype, "inputmode", 2);
|
|
288
|
+
__decorateClass([
|
|
289
|
+
property()
|
|
290
|
+
], SdInput.prototype, "value", 2);
|
|
291
|
+
__decorateClass([
|
|
292
|
+
defaultValue()
|
|
293
|
+
], SdInput.prototype, "defaultValue", 2);
|
|
294
|
+
__decorateClass([
|
|
295
|
+
property()
|
|
296
|
+
], SdInput.prototype, "placeholder", 2);
|
|
297
|
+
__decorateClass([
|
|
298
|
+
property()
|
|
299
|
+
], SdInput.prototype, "label", 2);
|
|
300
|
+
__decorateClass([
|
|
301
|
+
property({ attribute: "help-text" })
|
|
302
|
+
], SdInput.prototype, "helpText", 2);
|
|
303
|
+
__decorateClass([
|
|
304
|
+
property({ type: Boolean })
|
|
305
|
+
], SdInput.prototype, "clearable", 2);
|
|
306
|
+
__decorateClass([
|
|
307
|
+
property({ type: Boolean, reflect: true })
|
|
308
|
+
], SdInput.prototype, "disabled", 2);
|
|
309
|
+
__decorateClass([
|
|
310
|
+
property({ type: Boolean, reflect: true })
|
|
311
|
+
], SdInput.prototype, "readonly", 2);
|
|
312
|
+
__decorateClass([
|
|
313
|
+
property({ attribute: "password-toggle", type: Boolean })
|
|
314
|
+
], SdInput.prototype, "passwordToggle", 2);
|
|
315
|
+
__decorateClass([
|
|
316
|
+
property({ attribute: "password-visible", type: Boolean })
|
|
317
|
+
], SdInput.prototype, "passwordVisible", 2);
|
|
318
|
+
__decorateClass([
|
|
319
|
+
property({ attribute: "no-spin-buttons", type: Boolean })
|
|
320
|
+
], SdInput.prototype, "noSpinButtons", 2);
|
|
321
|
+
__decorateClass([
|
|
322
|
+
property({ type: Number })
|
|
323
|
+
], SdInput.prototype, "minlength", 2);
|
|
324
|
+
__decorateClass([
|
|
325
|
+
property({ type: Number })
|
|
326
|
+
], SdInput.prototype, "maxlength", 2);
|
|
327
|
+
__decorateClass([
|
|
328
|
+
property({ type: Number })
|
|
329
|
+
], SdInput.prototype, "min", 2);
|
|
330
|
+
__decorateClass([
|
|
331
|
+
property({ type: Number })
|
|
332
|
+
], SdInput.prototype, "max", 2);
|
|
333
|
+
__decorateClass([
|
|
334
|
+
property({ reflect: true })
|
|
335
|
+
], SdInput.prototype, "form", 2);
|
|
336
|
+
__decorateClass([
|
|
337
|
+
property()
|
|
338
|
+
], SdInput.prototype, "name", 2);
|
|
339
|
+
__decorateClass([
|
|
340
|
+
property()
|
|
341
|
+
], SdInput.prototype, "title", 2);
|
|
342
|
+
__decorateClass([
|
|
343
|
+
property({ type: Boolean, reflect: true })
|
|
344
|
+
], SdInput.prototype, "required", 2);
|
|
345
|
+
__decorateClass([
|
|
346
|
+
property()
|
|
347
|
+
], SdInput.prototype, "pattern", 2);
|
|
348
|
+
__decorateClass([
|
|
349
|
+
property()
|
|
350
|
+
], SdInput.prototype, "step", 2);
|
|
351
|
+
__decorateClass([
|
|
352
|
+
property()
|
|
353
|
+
], SdInput.prototype, "autocapitalize", 2);
|
|
354
|
+
__decorateClass([
|
|
355
|
+
property()
|
|
356
|
+
], SdInput.prototype, "autocorrect", 2);
|
|
357
|
+
__decorateClass([
|
|
358
|
+
property()
|
|
359
|
+
], SdInput.prototype, "autocomplete", 2);
|
|
360
|
+
__decorateClass([
|
|
361
|
+
property({ type: Boolean })
|
|
362
|
+
], SdInput.prototype, "autofocus", 2);
|
|
363
|
+
__decorateClass([
|
|
364
|
+
property()
|
|
365
|
+
], SdInput.prototype, "enterkeyhint", 2);
|
|
366
|
+
__decorateClass([
|
|
367
|
+
property({
|
|
368
|
+
type: Boolean,
|
|
369
|
+
converter: {
|
|
370
|
+
// Allow "true|false" attribute values but keep the property boolean
|
|
371
|
+
fromAttribute: (value) => !value || value === "false" ? false : true,
|
|
372
|
+
toAttribute: (value) => value ? "true" : "false"
|
|
373
|
+
}
|
|
374
|
+
})
|
|
375
|
+
], SdInput.prototype, "spellcheck", 2);
|
|
376
|
+
__decorateClass([
|
|
377
|
+
watch("disabled", { waitUntilFirstUpdate: true })
|
|
378
|
+
], SdInput.prototype, "handleDisabledChange", 1);
|
|
379
|
+
__decorateClass([
|
|
380
|
+
watch("step", { waitUntilFirstUpdate: true })
|
|
381
|
+
], SdInput.prototype, "handleStepChange", 1);
|
|
382
|
+
__decorateClass([
|
|
383
|
+
watch("value", { waitUntilFirstUpdate: true })
|
|
384
|
+
], SdInput.prototype, "handleValueChange", 1);
|
|
385
|
+
SdInput = __decorateClass([
|
|
386
|
+
customElement("sd-input")
|
|
387
|
+
], SdInput);
|
|
388
|
+
export {
|
|
389
|
+
SdInput as default
|
|
390
|
+
};
|
|
@@ -12,6 +12,7 @@ export { default as SdDrawer } from './components/drawer/drawer';
|
|
|
12
12
|
export { default as SdDropdown } from './components/dropdown/dropdown';
|
|
13
13
|
export { default as SdIcon } from './components/icon/icon';
|
|
14
14
|
export { default as SdInclude } from './components/include/include';
|
|
15
|
+
export { default as SdInput } from './components/input/input';
|
|
15
16
|
export { default as SdLink } from './components/link/link';
|
|
16
17
|
export { default as SdNavigationItem } from './components/navigation-item/navigation-item';
|
|
17
18
|
export { default as SdPopup } from './components/popup/popup';
|
|
@@ -12,16 +12,17 @@ import { default as default12 } from "./components/drawer/drawer.js";
|
|
|
12
12
|
import { default as default13 } from "./components/dropdown/dropdown.js";
|
|
13
13
|
import { default as default14 } from "./components/icon/icon.js";
|
|
14
14
|
import { default as default15 } from "./components/include/include.js";
|
|
15
|
-
import { default as default16 } from "./components/
|
|
16
|
-
import { default as default17 } from "./components/
|
|
17
|
-
import { default as default18 } from "./components/
|
|
18
|
-
import { default as default19 } from "./components/
|
|
19
|
-
import { default as default20 } from "./components/radio
|
|
20
|
-
import { default as default21 } from "./components/
|
|
21
|
-
import { default as default22 } from "./components/
|
|
22
|
-
import { default as default23 } from "./components/
|
|
23
|
-
import { default as default24 } from "./components/
|
|
24
|
-
import { default as default25 } from "./components/
|
|
15
|
+
import { default as default16 } from "./components/input/input.js";
|
|
16
|
+
import { default as default17 } from "./components/link/link.js";
|
|
17
|
+
import { default as default18 } from "./components/navigation-item/navigation-item.js";
|
|
18
|
+
import { default as default19 } from "./components/popup/popup.js";
|
|
19
|
+
import { default as default20 } from "./components/radio/radio.js";
|
|
20
|
+
import { default as default21 } from "./components/radio-group/radio-group.js";
|
|
21
|
+
import { default as default22 } from "./components/spinner/spinner.js";
|
|
22
|
+
import { default as default23 } from "./components/tag/tag.js";
|
|
23
|
+
import { default as default24 } from "./components/teaser/teaser.js";
|
|
24
|
+
import { default as default25 } from "./components/tooltip/tooltip.js";
|
|
25
|
+
import { default as default26 } from "./components/video/video.js";
|
|
25
26
|
import { registerIconLibrary, unregisterIconLibrary } from "./components/icon/library.js";
|
|
26
27
|
import { LocalizeController } from "./utilities/localize.js";
|
|
27
28
|
export {
|
|
@@ -40,16 +41,17 @@ export {
|
|
|
40
41
|
default13 as SdDropdown,
|
|
41
42
|
default14 as SdIcon,
|
|
42
43
|
default15 as SdInclude,
|
|
43
|
-
default16 as
|
|
44
|
-
default17 as
|
|
45
|
-
default18 as
|
|
46
|
-
default19 as
|
|
47
|
-
default20 as
|
|
48
|
-
default21 as
|
|
49
|
-
default22 as
|
|
50
|
-
default23 as
|
|
51
|
-
default24 as
|
|
52
|
-
default25 as
|
|
44
|
+
default16 as SdInput,
|
|
45
|
+
default17 as SdLink,
|
|
46
|
+
default18 as SdNavigationItem,
|
|
47
|
+
default19 as SdPopup,
|
|
48
|
+
default20 as SdRadio,
|
|
49
|
+
default21 as SdRadioGroup,
|
|
50
|
+
default22 as SdSpinner,
|
|
51
|
+
default23 as SdTag,
|
|
52
|
+
default24 as SdTeaser,
|
|
53
|
+
default25 as SdTooltip,
|
|
54
|
+
default26 as SdVideo,
|
|
53
55
|
registerIconLibrary,
|
|
54
56
|
unregisterIconLibrary
|
|
55
57
|
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
const formControlStyles = css`.form-control .form-control__label{display:none}.form-control .form-control__help-text{display:none}.form-control--has-label .form-control__label{display:inline-block;color:var(--sd-input-label-color);margin-bottom:var(--sd-spacing-3x-small)}.form-control--has-label.form-control--small .form-control__label{font-size:var(--sd-input-label-font-size-small)}.form-control--has-label.form-control--medium .form-control__label{font-size:var(--sd-input-label-font-size-medium)}.form-control--has-label.form-control--large .form-control_label{font-size:var(--sd-input-label-font-size-large)}:host([required]) .form-control--has-label .form-control__label::after{content:var(--sd-input-required-content);margin-inline-start:var(--sd-input-required-content-offset);color:var(--sd-input-required-content-color)}.form-control--has-help-text .form-control__help-text{display:block;color:var(--sd-input-help-text-color);margin-top:var(--sd-spacing-3x-small)}.form-control--has-help-text.form-control--small .form-control__help-text{font-size:var(--sd-input-help-text-font-size-small)}.form-control--has-help-text.form-control--medium .form-control__help-text{font-size:var(--sd-input-help-text-font-size-medium)}.form-control--has-help-text.form-control--large .form-control__help-text{font-size:var(--sd-input-help-text-font-size-large)}.form-control--has-help-text.form-control--radio-group .form-control__help-text{margin-top:var(--sd-spacing-2x-small)}`;
|
|
3
|
+
export {
|
|
4
|
+
formControlStyles as default
|
|
5
|
+
};
|