@skf-design-system/ui-components 1.0.0-beta.5 → 1.0.1-beta.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/accordion/accordion-item.d.ts +1 -1
- package/dist/components/accordion/accordion.component.d.ts +4 -4
- package/dist/components/accordion/accordion.component.js +18 -17
- package/dist/components/accordion/accordion.styles.d.ts +1 -2
- package/dist/components/accordion/accordion.styles.js +5 -4
- package/dist/components/alert/alert.component.d.ts +5 -5
- package/dist/components/alert/alert.component.js +46 -35
- package/dist/components/alert/alert.styles.d.ts +1 -2
- package/dist/components/alert/alert.styles.js +29 -24
- package/dist/components/breadcrumb/breadcrumb.component.d.ts +29 -0
- package/dist/components/breadcrumb/breadcrumb.d.ts +8 -0
- package/dist/components/breadcrumb-item/breadcrumb-item.component.d.ts +25 -0
- package/dist/components/breadcrumb-item/breadcrumb-item.d.ts +8 -0
- package/dist/components/button/button.component.d.ts +29 -5
- package/dist/components/button/button.component.js +89 -52
- package/dist/components/button/button.styles.js +65 -45
- package/dist/components/card/card.component.d.ts +4 -4
- package/dist/components/card/card.component.js +35 -24
- package/dist/components/card/card.styles.d.ts +1 -2
- package/dist/components/card/card.styles.js +14 -12
- package/dist/components/checkbox/checkbox.component.d.ts +11 -12
- package/dist/components/checkbox/checkbox.component.js +96 -90
- package/dist/components/collapse/collapse.component.d.ts +8 -8
- package/dist/components/collapse/collapse.component.js +42 -34
- package/dist/components/collapse/collapse.styles.js +15 -14
- package/dist/components/dialog/dialog.component.d.ts +74 -0
- package/dist/components/dialog/dialog.component.js +187 -0
- package/dist/components/dialog/dialog.d.ts +8 -0
- package/dist/components/dialog/dialog.js +6 -0
- package/dist/components/dialog/dialog.styles.d.ts +1 -0
- package/dist/components/dialog/dialog.styles.js +91 -0
- package/dist/components/divider/divider.component.d.ts +3 -3
- package/dist/components/divider/divider.component.js +39 -27
- package/dist/components/divider/divider.styles.d.ts +1 -2
- package/dist/components/divider/divider.styles.js +26 -26
- package/dist/components/heading/heading.component.d.ts +2 -2
- package/dist/components/heading/heading.component.js +13 -13
- package/dist/components/icon/icon.component.d.ts +2 -5
- package/dist/components/icon/icon.component.js +32 -23
- package/dist/components/icon/icon.styles.js +53 -47
- package/dist/components/input/input.component.d.ts +12 -11
- package/dist/components/input/input.component.js +88 -89
- package/dist/components/link/link.component.d.ts +7 -6
- package/dist/components/link/link.component.js +49 -43
- package/dist/components/link/link.styles.js +36 -40
- package/dist/components/loader/loader.component.d.ts +2 -2
- package/dist/components/loader/loader.component.js +39 -32
- package/dist/components/loader/loader.styles.js +11 -10
- package/dist/components/logo/logo.component.d.ts +3 -3
- package/dist/components/logo/logo.component.js +28 -17
- package/dist/components/logo/logo.styles.d.ts +1 -2
- package/dist/components/logo/logo.styles.js +11 -9
- package/dist/components/menu/menu.component.d.ts +24 -0
- package/dist/components/menu/menu.component.js +18 -0
- package/dist/components/menu/menu.d.ts +8 -0
- package/dist/components/menu/menu.js +6 -0
- package/dist/components/menu/menu.styles.d.ts +1 -0
- package/dist/components/menu/menu.styles.js +11 -0
- package/dist/components/menu-item/menu-item.component.d.ts +25 -0
- package/dist/components/menu-item/menu-item.component.js +13 -0
- package/dist/components/menu-item/menu-item.d.ts +8 -0
- package/dist/components/menu-item/menu-item.js +6 -0
- package/dist/components/menu-item/menu-item.styles.d.ts +1 -0
- package/dist/components/menu-item/menu-item.styles.js +19 -0
- package/dist/components/popover/popover.component.d.ts +29 -0
- package/dist/components/popover/popover.component.js +37 -0
- package/dist/components/popover/popover.d.ts +8 -0
- package/dist/components/popover/popover.js +6 -0
- package/dist/components/popover/popover.styles.d.ts +1 -0
- package/dist/components/popover/popover.styles.js +12 -0
- package/dist/components/progress/progress.component.d.ts +22 -0
- package/dist/components/progress/progress.component.js +49 -0
- package/dist/components/progress/progress.d.ts +8 -0
- package/dist/components/progress/progress.js +6 -0
- package/dist/components/progress/progress.styles.d.ts +1 -0
- package/dist/components/progress/progress.styles.js +48 -0
- package/dist/components/radio/radio.component.d.ts +7 -9
- package/dist/components/radio/radio.component.js +95 -79
- package/dist/components/select/select.component.d.ts +10 -12
- package/dist/components/select/select.component.js +120 -120
- package/dist/components/select/select.controllers.d.ts +1 -26
- package/dist/components/select/select.controllers.js +35 -95
- package/dist/components/select-option/select-option.component.d.ts +1 -1
- package/dist/components/select-option/select-option.controllers.d.ts +1 -1
- package/dist/components/select-option-group/select-option-group.component.d.ts +1 -1
- package/dist/components/select-option-group/select-option-group.component.js +9 -9
- package/dist/components/stepper/stepper.component.d.ts +38 -0
- package/dist/components/stepper/stepper.component.js +91 -0
- package/dist/components/stepper/stepper.d.ts +8 -0
- package/dist/components/stepper/stepper.helpers.d.ts +16 -0
- package/dist/components/stepper/stepper.helpers.js +18 -0
- package/dist/components/stepper/stepper.js +6 -0
- package/dist/components/stepper/stepper.styles.d.ts +1 -0
- package/dist/components/stepper/stepper.styles.js +15 -0
- package/dist/components/stepper-item/stepper-item.component.d.ts +47 -0
- package/dist/components/stepper-item/stepper-item.component.js +113 -0
- package/dist/components/stepper-item/stepper-item.d.ts +8 -0
- package/dist/components/stepper-item/stepper-item.js +6 -0
- package/dist/components/stepper-item/stepper-item.styles.d.ts +1 -0
- package/dist/components/stepper-item/stepper-item.styles.js +98 -0
- package/dist/components/switch/switch.component.d.ts +2 -2
- package/dist/components/switch/switch.component.js +17 -7
- package/dist/components/switch/switch.styles.js +16 -13
- package/dist/components/tab/tab.component.d.ts +29 -0
- package/dist/components/tab/tab.component.js +57 -0
- package/dist/components/tab/tab.d.ts +8 -0
- package/dist/components/tab/tab.js +6 -0
- package/dist/components/tab/tab.styles.d.ts +1 -0
- package/dist/components/tab/tab.styles.js +123 -0
- package/dist/components/tab-group/tab-group.component.d.ts +43 -0
- package/dist/components/tab-group/tab-group.component.js +98 -0
- package/dist/components/tab-group/tab-group.d.ts +8 -0
- package/dist/components/tab-group/tab-group.js +6 -0
- package/dist/components/tab-group/tab-group.styles.d.ts +1 -0
- package/dist/components/tab-group/tab-group.styles.js +75 -0
- package/dist/components/tab-panel/tab-panel.component.d.ts +19 -0
- package/dist/components/tab-panel/tab-panel.component.js +36 -0
- package/dist/components/tab-panel/tab-panel.d.ts +8 -0
- package/dist/components/tab-panel/tab-panel.js +6 -0
- package/dist/components/tab-panel/tab-panel.styles.d.ts +1 -0
- package/dist/components/tab-panel/tab-panel.styles.js +13 -0
- package/dist/components/tag/tag.component.d.ts +2 -2
- package/dist/components/tag/tag.component.js +61 -45
- package/dist/components/tag/tag.styles.js +30 -28
- package/dist/components/textarea/textarea.component.d.ts +4 -4
- package/dist/components/textarea/textarea.component.js +2 -2
- package/dist/components/toast/toast.component.d.ts +8 -5
- package/dist/components/toast/toast.component.js +30 -26
- package/dist/components/toast/toast.singleton.d.ts +5 -10
- package/dist/components/toast/toast.singleton.js +25 -25
- package/dist/components/toast/toast.styles.d.ts +1 -0
- package/dist/components/toast-item/toast-item.component.d.ts +1 -1
- package/dist/components/toast-item/toast-item.component.js +15 -15
- package/dist/components/toast-item/toast-item.styles.js +18 -0
- package/dist/components/toast-wrapper/toast-wrapper.component.d.ts +2 -2
- package/dist/components/toast-wrapper/toast-wrapper.component.js +11 -11
- package/dist/components/toast-wrapper/toast-wrapper.styles.d.ts +1 -0
- package/dist/components/tooltip/tooltip.component.d.ts +24 -0
- package/dist/components/tooltip/tooltip.component.js +18 -0
- package/dist/components/tooltip/tooltip.d.ts +8 -0
- package/dist/components/tooltip/tooltip.js +6 -0
- package/dist/components/tooltip/tooltip.styles.d.ts +1 -0
- package/dist/components/tooltip/tooltip.styles.js +12 -0
- package/dist/custom-elements.json +2465 -629
- package/dist/index.d.ts +11 -0
- package/dist/index.js +77 -44
- package/dist/internal/base-classes/popover/popover.base.d.ts +29 -0
- package/dist/internal/base-classes/popover/popover.base.js +116 -0
- package/dist/internal/base-classes/popover/popover.styles.d.ts +1 -0
- package/dist/internal/base-classes/popover/popover.styles.js +29 -0
- package/dist/internal/components/formBase.d.ts +1 -0
- package/dist/internal/components/formBase.js +11 -11
- package/dist/internal/components/hint/hint.component.d.ts +2 -2
- package/dist/internal/components/hint/hint.component.js +13 -13
- package/dist/internal/components/skf-element.js +26 -25
- package/dist/internal/controllers/popover.controller.d.ts +16 -0
- package/dist/internal/controllers/popover.controller.js +44 -0
- package/dist/internal/helpers/hintSeverity.d.ts +2 -2
- package/dist/internal/helpers/watch.d.ts +27 -0
- package/dist/internal/helpers/watch.js +28 -0
- package/dist/internal/templates/asterisk.d.ts +1 -1
- package/dist/internal/templates/asterisk.js +7 -6
- package/dist/react/index.d.ts +13 -0
- package/dist/react/index.js +13 -0
- package/dist/react/skf-breadcrumb/index.d.ts +9 -0
- package/dist/react/skf-breadcrumb/index.js +17 -0
- package/dist/react/skf-breadcrumb-item/index.d.ts +3 -0
- package/dist/react/skf-breadcrumb-item/index.js +13 -0
- package/dist/react/skf-button/index.d.ts +7 -1
- package/dist/react/skf-button/index.js +5 -1
- package/dist/react/skf-dialog/index.d.ts +15 -0
- package/dist/react/skf-dialog/index.js +19 -0
- package/dist/react/skf-menu/index.d.ts +12 -0
- package/dist/react/skf-menu/index.js +18 -0
- package/dist/react/skf-menu-item/index.d.ts +27 -0
- package/dist/react/skf-menu-item/index.js +23 -0
- package/dist/react/skf-popover/index.d.ts +12 -0
- package/dist/react/skf-popover/index.js +18 -0
- package/dist/react/skf-progress/index.d.ts +3 -0
- package/dist/react/skf-progress/index.js +13 -0
- package/dist/react/skf-stepper/index.d.ts +9 -0
- package/dist/react/skf-stepper/index.js +17 -0
- package/dist/react/skf-stepper-item/index.d.ts +9 -0
- package/dist/react/skf-stepper-item/index.js +17 -0
- package/dist/react/skf-tab/index.d.ts +12 -0
- package/dist/react/skf-tab/index.js +18 -0
- package/dist/react/skf-tab-group/index.d.ts +3 -0
- package/dist/react/skf-tab-group/index.js +13 -0
- package/dist/react/skf-tab-panel/index.d.ts +3 -0
- package/dist/react/skf-tab-panel/index.js +13 -0
- package/dist/react/skf-tooltip/index.d.ts +12 -0
- package/dist/react/skf-tooltip/index.js +18 -0
- package/dist/styles/component.styles.js +15 -2
- package/dist/types/jsx/custom-element-jsx.d.ts +603 -27
- package/dist/types/vue/index.d.ts +413 -11
- package/dist/vscode.html-custom-data.json +462 -36
- package/dist/web-types.json +944 -90
- package/package.json +43 -42
- package/dist/components/toast-item/toast-item.style.js +0 -16
- /package/dist/components/{toast/toast.style.d.ts → breadcrumb/breadcrumb.styles.d.ts} +0 -0
- /package/dist/components/{toast-wrapper/toast-wrapper.style.d.ts → breadcrumb-item/breadcrumb-item.styles.d.ts} +0 -0
- /package/dist/components/toast/{toast.style.js → toast.styles.js} +0 -0
- /package/dist/components/toast-item/{toast-item.style.d.ts → toast-item.styles.d.ts} +0 -0
- /package/dist/components/toast-wrapper/{toast-wrapper.style.js → toast-wrapper.styles.js} +0 -0
@@ -1,78 +1,84 @@
|
|
1
1
|
import { css as o } from "lit";
|
2
|
-
const
|
2
|
+
const i = o`
|
3
|
+
/* stylelint-disable selector-class-pattern */
|
3
4
|
@layer components {
|
4
5
|
:host {
|
5
6
|
display: inline-flex;
|
6
7
|
}
|
7
8
|
|
8
|
-
|
9
|
-
|
9
|
+
:host-context(.skf-icon-host) {
|
10
|
+
color: inherit;
|
11
|
+
}
|
10
12
|
|
13
|
+
.icon {
|
11
14
|
block-size: var(--_skf-icon-size);
|
12
|
-
color: var(--_skf-icon-color, var(--skf-icon-color-primary));
|
13
15
|
display: inline-flex;
|
14
16
|
flex-shrink: 0; /* Prevents shrink when flex-child */
|
15
17
|
inline-size: var(--_skf-icon-size);
|
16
18
|
pointer-events: none;
|
17
19
|
user-select: none;
|
18
20
|
|
19
|
-
:host-context(.skf-icon-host) & {
|
20
|
-
color:
|
21
|
+
:not(:host-context(.skf-icon-host)) & {
|
22
|
+
color: var(--_skf-icon-color, var(--skf-icon-color-primary));
|
21
23
|
}
|
24
|
+
}
|
22
25
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
26
|
+
/**
|
27
|
+
* Colors
|
28
|
+
*/
|
29
|
+
.icon--color-secondary {
|
30
|
+
--_skf-icon-color: var(--skf-icon-color-secondary);
|
31
|
+
}
|
29
32
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
+
.icon--color-inverse {
|
34
|
+
--_skf-icon-color: var(--skf-icon-color-inverse);
|
35
|
+
}
|
33
36
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
+
.icon--color-emphasised {
|
38
|
+
--_skf-icon-color: var(--skf-icon-color-emphasised);
|
39
|
+
}
|
37
40
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
41
|
+
/* Severity */
|
42
|
+
.icon--color-alert {
|
43
|
+
--_skf-icon-color: var(--skf-severity-fg-color-alert);
|
44
|
+
}
|
42
45
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
+
.icon--color-error {
|
47
|
+
--_skf-icon-color: var(--skf-severity-fg-color-error);
|
48
|
+
}
|
46
49
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
+
.icon--color-info {
|
51
|
+
--_skf-icon-color: var(--skf-severity-fg-color-info);
|
52
|
+
}
|
50
53
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
+
.icon--color-success {
|
55
|
+
--_skf-icon-color: var(--skf-severity-fg-color-success);
|
56
|
+
}
|
54
57
|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
+
.icon--color-warning {
|
59
|
+
--_skf-icon-color: var(--skf-severity-fg-color-warning);
|
60
|
+
}
|
58
61
|
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
62
|
+
/**
|
63
|
+
* Sizes
|
64
|
+
*/
|
65
|
+
.icon--size-xs {
|
66
|
+
--_skf-icon-size: var(--skf-icon-size-xs);
|
67
|
+
}
|
65
68
|
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
+
.icon--size-sm {
|
70
|
+
--_skf-icon-size: var(--skf-icon-size-sm);
|
71
|
+
}
|
69
72
|
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
+
.icon--size-md {
|
74
|
+
--_skf-icon-size: var(--skf-icon-size-md);
|
75
|
+
}
|
76
|
+
|
77
|
+
.icon--size-lg {
|
78
|
+
--_skf-icon-size: var(--skf-icon-size-lg);
|
73
79
|
}
|
74
80
|
}
|
75
81
|
`;
|
76
82
|
export {
|
77
|
-
|
83
|
+
i as default
|
78
84
|
};
|
@@ -1,8 +1,9 @@
|
|
1
|
-
import '
|
2
|
-
import { FormBase } from '
|
3
|
-
import '
|
4
|
-
import type { FormFieldBaseProps } from '
|
1
|
+
import '../icon/icon.js';
|
2
|
+
import { FormBase } from '../../internal/components/formBase.js';
|
3
|
+
import '../../internal/components/hint/hint';
|
4
|
+
import type { FormFieldBaseProps } from '../../internal/types/formField.js';
|
5
5
|
import { type CSSResultGroup } from 'lit';
|
6
|
+
type AutocompleteValues = 'on' | 'off' | 'name' | 'honorific-prefix' | 'given-name' | 'additional-name' | 'family-name' | 'honorific-suffix' | 'nickname' | 'username' | 'new-password' | 'current-password' | 'one-time-code' | 'organization-title' | 'organization' | 'street-address' | 'address-line1' | 'address-line2' | 'address-line3' | 'address-level4' | 'address-level3' | 'address-level2' | 'address-level1' | 'country' | 'country-name' | 'postal-code' | 'cc-name' | 'cc-given-name' | 'cc-additional-name' | 'cc-family-name' | 'cc-number' | 'cc-exp' | 'cc-exp-month' | 'cc-exp-year' | 'cc-csc' | 'cc-type' | 'transaction-amount' | 'transaction-currency' | 'language' | 'bday' | 'bday-day' | 'bday-month' | 'bday-year' | 'sex' | 'url' | 'photo' | 'tel' | 'tel-country-code' | 'tel-national' | 'tel-area-code' | 'tel-local' | 'tel-extension' | 'email' | 'impp' | 'password' | 'webauthn' | 'work' | (string & {});
|
6
7
|
/**
|
7
8
|
* The skf-text-field is used to create a text input field. It can be used inside a form element or standalone.
|
8
9
|
*
|
@@ -24,6 +25,12 @@ import { type CSSResultGroup } from 'lit';
|
|
24
25
|
export declare class SkfInput extends FormBase implements FormFieldBaseProps {
|
25
26
|
static styles: CSSResultGroup;
|
26
27
|
private customError;
|
28
|
+
/**
|
29
|
+
* Specifies what permission the browser has to provide assistance in filling out form field values. Refer to
|
30
|
+
* [this page on MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete) for available values.
|
31
|
+
* @type { -m }
|
32
|
+
*/
|
33
|
+
autocomplete?: AutocompleteValues;
|
27
34
|
/** Custom aria-label for the clear button. **Notice!** Only applicable to type=search. */
|
28
35
|
buttonAriaLabelClear: string;
|
29
36
|
/** Custom aria-label for the visibility button. **Notice!** Only applicable to type=password. */
|
@@ -55,11 +62,6 @@ export declare class SkfInput extends FormBase implements FormFieldBaseProps {
|
|
55
62
|
minLength?: number;
|
56
63
|
/** If defined, adds name to the input-element */
|
57
64
|
name?: string;
|
58
|
-
/**
|
59
|
-
* @internal
|
60
|
-
* If true, hide empty label element
|
61
|
-
*/
|
62
|
-
protected _noLabel: boolean | undefined;
|
63
65
|
/** If defined, adds name to the input-element */
|
64
66
|
pattern?: string;
|
65
67
|
/** If defined, displays placeholder text */
|
@@ -131,7 +133,6 @@ export declare class SkfInput extends FormBase implements FormFieldBaseProps {
|
|
131
133
|
private _renderSearchButton;
|
132
134
|
/** @internal */
|
133
135
|
private _onBlur;
|
134
|
-
/** @internal */
|
135
|
-
_handleSlotChange: () => void;
|
136
136
|
render(): import("lit").TemplateResult<1>;
|
137
137
|
}
|
138
|
+
export {};
|
@@ -5,46 +5,46 @@ import { hintSeverity as v } from "../../internal/helpers/hintSeverity.js";
|
|
5
5
|
import { Asterisk as y } from "../../internal/templates/asterisk.js";
|
6
6
|
import f from "../../styles/component.styles.js";
|
7
7
|
import { html as h, nothing as d } from "lit";
|
8
|
-
import { property as
|
9
|
-
import { ifDefined as
|
8
|
+
import { property as e, state as c, query as _, queryAssignedNodes as $ } from "lit/decorators.js";
|
9
|
+
import { ifDefined as n } from "lit/directives/if-defined.js";
|
10
10
|
import { live as g } from "lit/directives/live.js";
|
11
11
|
import { InputNumberController as w, InputPasswordController as E } from "./input.controllers.js";
|
12
|
-
import
|
13
|
-
var
|
14
|
-
for (var o =
|
15
|
-
(u =
|
16
|
-
return
|
12
|
+
import A from "./input.styles.js";
|
13
|
+
var C = Object.defineProperty, S = Object.getOwnPropertyDescriptor, i = (m, s, r, a) => {
|
14
|
+
for (var o = a > 1 ? void 0 : a ? S(s, r) : s, l = m.length - 1, u; l >= 0; l--)
|
15
|
+
(u = m[l]) && (o = (a ? u(s, r, o) : u(o)) || o);
|
16
|
+
return a && o && C(s, r, o), o;
|
17
17
|
};
|
18
|
-
const
|
18
|
+
const p = class p extends b {
|
19
19
|
constructor() {
|
20
20
|
super(...arguments), this.buttonAriaLabelClear = "Clear input", this.buttonAriaLabelHide = "Hide password", this.buttonAriaLabelShow = "Show password", this.inputmode = "text", this.size = "md", this.type = "text", this.validateOn = "change", this.value = "", this.invalid = !1, this._buttonDown = !1, this._numberController = new w(this), this._passwordController = new E(this), this._handleInput = () => {
|
21
21
|
this.value = this.$input.value || "", this.validateOn === "input" && (this._pristine = !1, this.validateInput());
|
22
|
-
}, this._resetValue = (
|
22
|
+
}, this._resetValue = (s) => {
|
23
23
|
var r;
|
24
|
-
|
25
|
-
}, this._handlePressStart = (
|
26
|
-
this._buttonDown = !0, this.type === "number" && this._numberController.handleActionBtnLongPressStart(
|
24
|
+
s.stopPropagation(), this.value = ((r = this.getAttribute("value")) == null ? void 0 : r.trim()) ?? "", this._internals.setFormValue(this.value), this.$input.focus();
|
25
|
+
}, this._handlePressStart = (s) => {
|
26
|
+
this._buttonDown = !0, this.type === "number" && this._numberController.handleActionBtnLongPressStart(s);
|
27
27
|
}, this._handlePressEnd = () => {
|
28
28
|
this._buttonDown = !1, this.type === "number" && this._numberController.handleActionBtnLongPressEnd();
|
29
|
-
}, this._renderNumberButton = (
|
29
|
+
}, this._renderNumberButton = (s) => h`
|
30
30
|
<button
|
31
31
|
?disabled=${this.disabled}
|
32
32
|
@click=${(r) => {
|
33
|
-
this._numberController.handleActionBtnClick(r,
|
33
|
+
this._numberController.handleActionBtnClick(r, s);
|
34
34
|
}}
|
35
35
|
@mousedown=${this._handlePressStart}
|
36
36
|
@mouseup=${this._handlePressEnd}
|
37
37
|
@mouseleave=${this._handlePressEnd}
|
38
|
-
aria-label="${
|
38
|
+
aria-label="${s === "inc" ? "Increment" : "Decrement"}"
|
39
39
|
class="number skf-icon-host"
|
40
40
|
type="button"
|
41
41
|
>
|
42
|
-
<skf-icon name="${
|
42
|
+
<skf-icon name="${s === "inc" ? "chevronUp" : "chevronDown"}" size="sm"></skf-icon>
|
43
43
|
</button>
|
44
44
|
`, this._renderPasswordButton = () => h`
|
45
45
|
<button
|
46
46
|
@click=${this._passwordController.toggleVisibility}
|
47
|
-
aria-label=${
|
47
|
+
aria-label=${n(this._passwordController._buttonAriaLabel)}
|
48
48
|
class="password skf-icon-host"
|
49
49
|
type="button"
|
50
50
|
@mousedown="${this._handlePressStart}"
|
@@ -59,7 +59,7 @@ const m = class m extends b {
|
|
59
59
|
@mousedown=${this._handlePressStart}
|
60
60
|
@mouseup=${this._handlePressEnd}
|
61
61
|
@mouseleave=${this._handlePressEnd}
|
62
|
-
aria-label=${
|
62
|
+
aria-label=${n(this.buttonAriaLabelClear)}
|
63
63
|
class="search skf-icon-host"
|
64
64
|
type="button"
|
65
65
|
>
|
@@ -67,13 +67,10 @@ const m = class m extends b {
|
|
67
67
|
</button>
|
68
68
|
`, this._onBlur = () => {
|
69
69
|
this._buttonDown && this.$input.focus();
|
70
|
-
}, this._handleSlotChange = () => {
|
71
|
-
var e, r;
|
72
|
-
console.log("slot change"), this._noLabel = (this._defaultSlot.length === 0 || !((r = (e = this._defaultSlot[0]) == null ? void 0 : e.textContent) != null && r.trim())) && !this.label;
|
73
70
|
};
|
74
71
|
}
|
75
|
-
set customInvalid(
|
76
|
-
this.customError =
|
72
|
+
set customInvalid(s) {
|
73
|
+
this.customError = s || "";
|
77
74
|
}
|
78
75
|
get customInvalid() {
|
79
76
|
return this.customError;
|
@@ -81,12 +78,12 @@ const m = class m extends b {
|
|
81
78
|
firstUpdated() {
|
82
79
|
this.$input.addEventListener("change", () => {
|
83
80
|
this.validateOn === "change" && (this.validateOn = "input", this._pristine = !1), this._internals.setFormValue(this.$input.value || ""), this.emitEvent("change"), this.validateInput();
|
84
|
-
}), this.addEventListener("invalid", (
|
85
|
-
this._pristine = !1, this.invalid = !0, this.customErrorDisplay &&
|
86
|
-
}), this.addEventListener("reset", this._resetValue), this.
|
81
|
+
}), this.addEventListener("invalid", (s) => {
|
82
|
+
this._pristine = !1, this.invalid = !0, this.customErrorDisplay && s.preventDefault();
|
83
|
+
}), this.addEventListener("reset", this._resetValue), this.validateInput();
|
87
84
|
}
|
88
|
-
willUpdate(
|
89
|
-
if (
|
85
|
+
willUpdate(s) {
|
86
|
+
if (s.has("invalid"))
|
90
87
|
if (this.invalid) {
|
91
88
|
this.setAttribute("invalid", ""), this.showValid || this.removeAttribute("valid");
|
92
89
|
const r = this._internals.validationMessage;
|
@@ -94,10 +91,10 @@ const m = class m extends b {
|
|
94
91
|
} else
|
95
92
|
this.removeAttribute("invalid"), !this._pristine && this.showValid && this.setAttribute("valid", "true"), this.hint = this.getAttribute("hint") ?? "";
|
96
93
|
}
|
97
|
-
attributeChangedCallback(
|
98
|
-
if (super.attributeChangedCallback(
|
99
|
-
if (typeof
|
100
|
-
const l =
|
94
|
+
attributeChangedCallback(s, r, a) {
|
95
|
+
if (super.attributeChangedCallback(s, r, a), s === "value" && this._internals.setFormValue(a), s === "custom-invalid")
|
96
|
+
if (typeof a == "string") {
|
97
|
+
const l = this.withFallback(a);
|
101
98
|
this._pristine = !1, this._internals.setValidity({ customError: !0 }, l), this.invalid = !0, this.hint = l, this.checkValidity();
|
102
99
|
} else
|
103
100
|
this._internals.setValidity({}), this.validateInput();
|
@@ -110,36 +107,37 @@ const m = class m extends b {
|
|
110
107
|
this._internals.setValidity({ customError: this._internals.validity.customError });
|
111
108
|
else {
|
112
109
|
this.invalid = !this._pristine && !r.valid;
|
113
|
-
let
|
114
|
-
for (
|
115
|
-
const o = `data-${
|
116
|
-
if (r[
|
110
|
+
let a;
|
111
|
+
for (a in r) {
|
112
|
+
const o = `data-${a.toString()}`;
|
113
|
+
if (r[a] && !this.hasAttribute(o) && this.debug && console.log(
|
117
114
|
`Add custom message on ${this.localName} using attribute: ${o.toUpperCase()}="Your custom message"`
|
118
|
-
), r[
|
119
|
-
this.validationError =
|
115
|
+
), r[a]) {
|
116
|
+
this.validationError = a.toString();
|
120
117
|
const l = this.hasAttribute(o) ? this.getAttribute(o) : this.$input.validationMessage;
|
121
118
|
this._internals.setValidity(
|
122
119
|
{ [this.validationError]: !0, customError: this._internals.validity.customError },
|
123
|
-
l
|
120
|
+
this.withFallback(l)
|
124
121
|
), this.invalid && this.customErrorDisplay && this.checkValidity();
|
125
122
|
}
|
126
123
|
}
|
127
124
|
}
|
128
125
|
}
|
129
126
|
render() {
|
130
|
-
var
|
127
|
+
var r, a, o, l;
|
128
|
+
const s = (this._defaultSlot.length === 0 || !((a = (r = this._defaultSlot[0]) == null ? void 0 : r.textContent) != null && a.trim())) && !this.label;
|
131
129
|
return h`
|
132
130
|
<div id="root">
|
133
131
|
<label>
|
134
|
-
<div class=${this.hideLabel ? "visually-hidden" : ""} ?hidden=${
|
135
|
-
<slot
|
132
|
+
<div class=${this.hideLabel ? "visually-hidden" : ""} ?hidden=${s} id="label">
|
133
|
+
<slot>${this.label}</slot>
|
136
134
|
${this.required ? y(this.requiredLabel) : null}
|
137
135
|
</div>
|
138
136
|
<div id="input">
|
139
137
|
${this.type === "search" ? h`<skf-icon class="skf-icon-host" name="search" size="sm"></skf-icon>` : d}
|
140
138
|
<div
|
141
|
-
data-leading=${
|
142
|
-
data-trailing=${
|
139
|
+
data-leading=${n(this.leading)}
|
140
|
+
data-trailing=${n(this.trailing)}
|
143
141
|
id="affix"
|
144
142
|
>
|
145
143
|
<input
|
@@ -149,20 +147,21 @@ const m = class m extends b {
|
|
149
147
|
.value=${g(this.value)}
|
150
148
|
@blur=${this._onBlur}
|
151
149
|
@input=${this._handleInput}
|
152
|
-
|
153
|
-
aria-
|
150
|
+
autocomplete=${this.autocomplete}
|
151
|
+
aria-describedby=${n((o = this.hint) != null && o.trim() ? "hint" : d)}
|
152
|
+
aria-errormessage=${n((l = this.hint) != null && l.trim() ? "hint" : d)}
|
154
153
|
aria-invalid=${!!this.invalid}
|
155
154
|
autocomplete="off"
|
156
155
|
data-testid="field-input"
|
157
|
-
inputmode=${
|
158
|
-
max=${
|
159
|
-
maxlength=${
|
160
|
-
min=${
|
161
|
-
minlength=${
|
162
|
-
name=${
|
163
|
-
pattern=${
|
164
|
-
placeholder=${
|
165
|
-
type=${
|
156
|
+
inputmode=${n(this.inputMode)}
|
157
|
+
max=${n(this.max)}
|
158
|
+
maxlength=${n(this.maxLength)}
|
159
|
+
min=${n(this.min)}
|
160
|
+
minlength=${n(this.minLength)}
|
161
|
+
name=${n(this.name)}
|
162
|
+
pattern=${n(this.pattern)}
|
163
|
+
placeholder=${n(this.placeholder)}
|
164
|
+
type=${n(
|
166
165
|
this.type === "password" ? this._passwordController._type : this.type
|
167
166
|
)}
|
168
167
|
/>
|
@@ -180,7 +179,7 @@ const m = class m extends b {
|
|
180
179
|
<skf-hint
|
181
180
|
aria-live=${this.invalid ? "assertive" : "polite"}
|
182
181
|
id="hint"
|
183
|
-
severity=${
|
182
|
+
severity=${n(v(this.severity, this.invalid))}
|
184
183
|
>${this.customInvalid ? this.customInvalid : this.hint}
|
185
184
|
</skf-hint>
|
186
185
|
`}
|
@@ -188,94 +187,94 @@ const m = class m extends b {
|
|
188
187
|
`;
|
189
188
|
}
|
190
189
|
};
|
191
|
-
|
192
|
-
let t =
|
190
|
+
p.styles = [f, A];
|
191
|
+
let t = p;
|
193
192
|
i([
|
194
|
-
|
193
|
+
e({ type: String })
|
194
|
+
], t.prototype, "autocomplete", 2);
|
195
|
+
i([
|
196
|
+
e({ attribute: "button-aria-label-clear" })
|
195
197
|
], t.prototype, "buttonAriaLabelClear", 2);
|
196
198
|
i([
|
197
|
-
|
199
|
+
e({ attribute: "button-aria-label-hide" })
|
198
200
|
], t.prototype, "buttonAriaLabelHide", 2);
|
199
201
|
i([
|
200
|
-
|
202
|
+
e({ attribute: "button-aria-label-show" })
|
201
203
|
], t.prototype, "buttonAriaLabelShow", 2);
|
202
204
|
i([
|
203
|
-
|
205
|
+
e({ attribute: "custom-invalid", reflect: !0 })
|
204
206
|
], t.prototype, "customInvalid", 1);
|
205
207
|
i([
|
206
|
-
|
208
|
+
e({ type: Boolean })
|
207
209
|
], t.prototype, "debug", 2);
|
208
210
|
i([
|
209
|
-
|
211
|
+
e({ type: Boolean, attribute: "hide-label" })
|
210
212
|
], t.prototype, "hideLabel", 2);
|
211
213
|
i([
|
212
|
-
|
214
|
+
e()
|
213
215
|
], t.prototype, "hint", 2);
|
214
216
|
i([
|
215
|
-
|
217
|
+
e({ type: String })
|
216
218
|
], t.prototype, "inputmode", 2);
|
217
219
|
i([
|
218
|
-
|
220
|
+
e()
|
219
221
|
], t.prototype, "label", 2);
|
220
222
|
i([
|
221
|
-
|
223
|
+
e()
|
222
224
|
], t.prototype, "leading", 2);
|
223
225
|
i([
|
224
|
-
|
226
|
+
e()
|
225
227
|
], t.prototype, "max", 2);
|
226
228
|
i([
|
227
|
-
|
229
|
+
e({ type: Number, attribute: "maxlength" })
|
228
230
|
], t.prototype, "maxLength", 2);
|
229
231
|
i([
|
230
|
-
|
232
|
+
e()
|
231
233
|
], t.prototype, "min", 2);
|
232
234
|
i([
|
233
|
-
|
235
|
+
e({ type: Number, attribute: "minlength" })
|
234
236
|
], t.prototype, "minLength", 2);
|
235
237
|
i([
|
236
|
-
|
238
|
+
e()
|
237
239
|
], t.prototype, "name", 2);
|
238
240
|
i([
|
239
|
-
|
240
|
-
], t.prototype, "_noLabel", 2);
|
241
|
-
i([
|
242
|
-
s()
|
241
|
+
e()
|
243
242
|
], t.prototype, "pattern", 2);
|
244
243
|
i([
|
245
|
-
|
244
|
+
e()
|
246
245
|
], t.prototype, "placeholder", 2);
|
247
246
|
i([
|
248
|
-
|
247
|
+
e({ type: Boolean })
|
249
248
|
], t.prototype, "readonly", 2);
|
250
249
|
i([
|
251
|
-
|
250
|
+
e({ attribute: "required-label" })
|
252
251
|
], t.prototype, "requiredLabel", 2);
|
253
252
|
i([
|
254
|
-
|
253
|
+
e({ reflect: !0 })
|
255
254
|
], t.prototype, "severity", 2);
|
256
255
|
i([
|
257
|
-
|
256
|
+
e({ type: Boolean, attribute: "show-valid" })
|
258
257
|
], t.prototype, "showValid", 2);
|
259
258
|
i([
|
260
|
-
|
259
|
+
e({ reflect: !0 })
|
261
260
|
], t.prototype, "size", 2);
|
262
261
|
i([
|
263
|
-
|
262
|
+
e()
|
264
263
|
], t.prototype, "trailing", 2);
|
265
264
|
i([
|
266
|
-
|
265
|
+
e()
|
267
266
|
], t.prototype, "type", 2);
|
268
267
|
i([
|
269
|
-
|
268
|
+
e({ type: String, attribute: "validate-on" })
|
270
269
|
], t.prototype, "validateOn", 2);
|
271
270
|
i([
|
272
|
-
|
271
|
+
e()
|
273
272
|
], t.prototype, "value", 2);
|
274
273
|
i([
|
275
|
-
|
274
|
+
c()
|
276
275
|
], t.prototype, "invalid", 2);
|
277
276
|
i([
|
278
|
-
|
277
|
+
c()
|
279
278
|
], t.prototype, "_buttonDown", 2);
|
280
279
|
i([
|
281
280
|
_("input")
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import type { SkfIcon } from '
|
2
|
-
import '
|
3
|
-
import { SkfElement } from '
|
1
|
+
import type { SkfIcon } from '../icon/icon.component.js';
|
2
|
+
import '../icon/icon.js';
|
3
|
+
import { SkfElement } from '../../internal/components/skf-element.js';
|
4
4
|
import { type CSSResultGroup } from 'lit';
|
5
5
|
/**
|
6
6
|
* The `<skf-link>` can be used as either a regular link or a link styled semantic button
|
@@ -15,6 +15,7 @@ import { type CSSResultGroup } from 'lit';
|
|
15
15
|
*/
|
16
16
|
export declare class SkfLink extends SkfElement {
|
17
17
|
static styles: CSSResultGroup;
|
18
|
+
static classMap: {};
|
18
19
|
private _onClick?;
|
19
20
|
/** Defines the semantic element to render */
|
20
21
|
as: 'button' | 'a';
|
@@ -33,12 +34,12 @@ export declare class SkfLink extends SkfElement {
|
|
33
34
|
icon?: SkfIcon['name'];
|
34
35
|
/** Defines the position of the icon in relation to the text */
|
35
36
|
iconPlacement: 'left' | 'right';
|
36
|
-
/**
|
37
|
-
rel
|
37
|
+
/** If defined, describes the relationship between a linked resource and the current document */
|
38
|
+
rel?: string;
|
38
39
|
/** If defined, used on conjunction with onClick property, second argument */
|
39
40
|
route?: string;
|
40
41
|
/** If true, fills the parents horizontal axis */
|
41
|
-
stretch
|
42
|
+
stretch: boolean;
|
42
43
|
/** If defined, specifies where to open the linked document */
|
43
44
|
target?: '_blank' | '_parent' | '_self' | '_top';
|
44
45
|
/** Defines the type of button */
|