@skf-design-system/ui-components 1.0.2-beta.0 → 1.0.2-beta.1
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/README.md +12 -8
- package/dist/components/accordion/accordion-item.component.d.ts +36 -0
- package/dist/components/accordion/accordion-item.component.js +87 -0
- package/dist/components/accordion/accordion-item.d.ts +3 -3
- package/dist/components/accordion/accordion-item.js +4 -5
- package/dist/components/accordion/accordion-item.styles.js +77 -0
- package/dist/components/accordion/accordion.component.d.ts +5 -9
- package/dist/components/accordion/accordion.component.js +4 -5
- package/dist/components/accordion/accordion.d.ts +0 -1
- package/dist/components/accordion/accordion.js +0 -2
- package/dist/components/alert/alert.component.d.ts +4 -7
- package/dist/components/alert/alert.component.js +8 -9
- package/dist/components/alert/alert.styles.js +0 -5
- package/dist/components/breadcrumb/breadcrumb-item.component.js +61 -0
- package/dist/components/breadcrumb/breadcrumb-item.js +6 -0
- package/dist/components/breadcrumb/breadcrumb-item.styles.js +62 -0
- package/dist/components/breadcrumb/breadcrumb.component.d.ts +1 -1
- package/dist/components/breadcrumb/breadcrumb.component.js +60 -0
- package/dist/components/breadcrumb/breadcrumb.js +6 -0
- package/dist/components/breadcrumb/breadcrumb.styles.js +22 -0
- package/dist/components/button/button.component.d.ts +13 -10
- package/dist/components/button/button.component.js +83 -76
- package/dist/components/button/button.styles.d.ts +1 -2
- package/dist/components/button/button.styles.js +1 -1
- package/dist/components/card/card.component.d.ts +1 -1
- package/dist/components/card/card.component.js +1 -1
- package/dist/components/checkbox/checkbox.component.d.ts +8 -6
- package/dist/components/checkbox/checkbox.component.js +2 -2
- package/dist/components/checkbox/checkbox.styles.d.ts +1 -2
- package/dist/components/checkbox/checkbox.styles.js +1 -5
- package/dist/components/date-picker/datepicker.calendar.component.js +1 -1
- package/dist/components/date-picker/datepicker.component.js +1 -1
- package/dist/components/date-picker-input/datepicker-input.component.d.ts +1 -0
- package/dist/components/date-picker-input/datepicker-input.component.js +3 -2
- package/dist/components/dialog/dialog.component.d.ts +5 -4
- package/dist/components/dialog/dialog.component.js +44 -44
- package/dist/components/dialog/dialog.styles.js +4 -4
- package/dist/components/divider/divider.component.js +1 -1
- package/dist/components/drawer/drawer.component.d.ts +12 -8
- package/dist/components/drawer/drawer.component.js +5 -4
- package/dist/components/header/header.component.d.ts +3 -2
- package/dist/components/header/header.component.js +34 -28
- package/dist/components/heading/heading.component.d.ts +3 -5
- package/dist/components/heading/heading.component.js +22 -21
- package/dist/components/icon/icon.component.d.ts +11 -17
- package/dist/components/icon/icon.component.js +2 -2
- package/dist/components/icon/icon.styles.d.ts +1 -2
- package/dist/components/icon/icon.styles.js +1 -1
- package/dist/components/input/input.component.d.ts +30 -31
- package/dist/components/input/input.component.js +136 -123
- package/dist/components/link/link.component.d.ts +12 -14
- package/dist/components/link/link.component.js +34 -34
- package/dist/components/link/link.styles.d.ts +1 -2
- package/dist/components/link/link.styles.js +2 -2
- package/dist/components/loader/loader.component.d.ts +1 -1
- package/dist/components/loader/loader.component.js +36 -40
- package/dist/components/loader/loader.styles.d.ts +1 -2
- package/dist/components/loader/loader.styles.js +40 -32
- package/dist/components/logo/logo.component.d.ts +4 -5
- package/dist/components/logo/logo.component.js +1 -1
- package/dist/components/menu/menu-item.component.d.ts +13 -0
- package/dist/components/{menu-item → menu}/menu-item.component.js +3 -3
- package/dist/components/menu/menu.component.d.ts +9 -6
- package/dist/components/menu/menu.component.js +8 -10
- package/dist/components/{nav-item → nav}/nav-item.component.d.ts +0 -2
- package/dist/components/{nav-item → nav}/nav-item.component.js +1 -1
- package/dist/components/nav/nav.component.js +1 -1
- package/dist/components/popover/popover.component.d.ts +10 -6
- package/dist/components/popover/popover.component.js +22 -24
- package/dist/components/progress/progress.component.d.ts +2 -2
- package/dist/components/progress/progress.component.js +31 -37
- package/dist/components/progress/progress.styles.js +40 -35
- package/dist/components/radio/radio.component.d.ts +9 -7
- package/dist/components/radio/radio.component.js +2 -2
- package/dist/components/{segmented-button-item → segmented-button}/segmented-button-item.component.d.ts +4 -4
- package/dist/components/segmented-button/segmented-button-item.component.js +56 -0
- package/dist/components/segmented-button/segmented-button-item.js +6 -0
- package/dist/components/segmented-button/segmented-button-item.styles.js +62 -0
- package/dist/components/segmented-button/segmented-button.component.d.ts +0 -2
- package/dist/components/segmented-button/segmented-button.component.js +73 -0
- package/dist/components/segmented-button/segmented-button.js +6 -0
- package/dist/components/segmented-button/segmented-button.styles.js +16 -0
- package/dist/components/{select-option-group → select}/select-option-group.component.js +1 -1
- package/dist/components/{select-option → select}/select-option.component.d.ts +7 -8
- package/dist/components/{select-option → select}/select-option.component.js +15 -15
- package/dist/components/select/select.component.d.ts +16 -15
- package/dist/components/select/select.component.js +17 -17
- package/dist/components/select/select.controllers.d.ts +1 -1
- package/dist/components/select/select.controllers.js +14 -11
- package/dist/components/select/select.stories.icons.d.ts +7 -0
- package/dist/components/{stepper-item → stepper}/stepper-item.component.js +8 -8
- package/dist/components/stepper/stepper.component.d.ts +2 -2
- package/dist/components/stepper/stepper.component.js +15 -15
- package/dist/components/stepper/stepper.helpers.d.ts +1 -1
- package/dist/components/switch/switch.component.js +15 -15
- package/dist/components/tab/tab.component.js +1 -1
- package/dist/components/tab-group/tab-group.component.js +1 -1
- package/dist/components/tab-panel/tab-panel.component.js +1 -1
- package/dist/components/tag/tag.component.d.ts +10 -14
- package/dist/components/tag/tag.component.js +32 -35
- package/dist/components/textarea/textarea.component.d.ts +10 -11
- package/dist/components/textarea/textarea.component.js +62 -64
- package/dist/components/{toast-item → toast}/toast-item.d.ts +2 -0
- package/dist/components/{toast-item → toast}/toast-item.js +4 -0
- package/dist/components/{toast-wrapper → toast}/toast-wrapper.component.js +1 -1
- package/dist/components/toast/toast-wrapper.styles.d.ts +1 -0
- package/dist/components/toast/toast.component.d.ts +5 -4
- package/dist/components/toast/toast.component.js +15 -15
- package/dist/components/toast/toast.singleton.d.ts +4 -4
- package/dist/components/toast/toast.singleton.js +12 -12
- package/dist/components/tooltip/tooltip.component.d.ts +2 -1
- package/dist/components/tooltip/tooltip.component.js +15 -10
- package/dist/custom-elements.json +733 -820
- package/dist/index.d.ts +13 -7
- package/dist/index.js +100 -84
- package/dist/internal/base-classes/popover/popover.base.d.ts +10 -5
- package/dist/internal/base-classes/popover/popover.base.js +77 -60
- package/dist/internal/components/hint/hint.component.d.ts +2 -2
- package/dist/internal/components/hint/hint.component.js +2 -2
- package/dist/internal/components/hint/hint.styles.d.ts +1 -2
- package/dist/internal/components/hint/hint.styles.js +1 -1
- package/dist/internal/constants/iconSeverity.d.ts +3 -2
- package/dist/internal/constants/iconSeverity.js +2 -3
- package/dist/internal/helpers/hintSeverity.d.ts +2 -2
- package/dist/internal/helpers/hintSeverity.js +1 -1
- package/dist/internal/types/formField.d.ts +1 -1
- package/dist/internal/types.d.ts +18 -0
- package/dist/styles/component.styles.d.ts +1 -2
- package/dist/styles/component.styles.js +1 -1
- package/dist/styles/global.css +1 -1
- package/dist/types/jsx/custom-element-jsx.d.ts +162 -180
- package/dist/types/vue/index.d.ts +162 -180
- package/dist/vscode.html-custom-data.json +133 -1091
- package/dist/web-types.json +368 -424
- package/package.json +24 -25
- package/dist/components/collapse/collapse.component.d.ts +0 -40
- package/dist/components/collapse/collapse.component.js +0 -86
- package/dist/components/collapse/collapse.d.ts +0 -8
- package/dist/components/collapse/collapse.js +0 -6
- package/dist/components/collapse/collapse.styles.d.ts +0 -2
- package/dist/components/collapse/collapse.styles.js +0 -77
- package/dist/components/menu-item/menu-item.component.d.ts +0 -25
- package/dist/internal/constants/heading.d.ts +0 -2
- /package/dist/components/{breadcrumb-item/breadcrumb-item.styles.d.ts → accordion/accordion-item.styles.d.ts} +0 -0
- /package/dist/components/{collapse/collapse.test.d.ts → accordion/accordion-item.test.d.ts} +0 -0
- /package/dist/components/{breadcrumb-item → breadcrumb}/breadcrumb-item.component.d.ts +0 -0
- /package/dist/components/{breadcrumb-item → breadcrumb}/breadcrumb-item.d.ts +0 -0
- /package/dist/components/{menu-item/menu-item.styles.d.ts → breadcrumb/breadcrumb-item.styles.d.ts} +0 -0
- /package/dist/components/{menu-item → menu}/menu-item.d.ts +0 -0
- /package/dist/components/{menu-item → menu}/menu-item.js +0 -0
- /package/dist/components/{nav-item/nav-item.styles.d.ts → menu/menu-item.styles.d.ts} +0 -0
- /package/dist/components/{menu-item → menu}/menu-item.styles.js +0 -0
- /package/dist/components/{nav-item → nav}/nav-item.d.ts +0 -0
- /package/dist/components/{nav-item → nav}/nav-item.js +0 -0
- /package/dist/components/{segmented-button-item/segmented-button-item.styles.d.ts → nav/nav-item.styles.d.ts} +0 -0
- /package/dist/components/{nav-item → nav}/nav-item.styles.js +0 -0
- /package/dist/components/{segmented-button-item → segmented-button}/segmented-button-item.d.ts +0 -0
- /package/dist/components/{select-option-group/select-option-group.style.d.ts → segmented-button/segmented-button-item.styles.d.ts} +0 -0
- /package/dist/components/{select-option-group → select}/select-option-group.component.d.ts +0 -0
- /package/dist/components/{select-option-group → select}/select-option-group.d.ts +0 -0
- /package/dist/components/{select-option-group → select}/select-option-group.js +0 -0
- /package/dist/components/{select-option/select-option.styles.d.ts → select/select-option-group.style.d.ts} +0 -0
- /package/dist/components/{select-option-group → select}/select-option-group.style.js +0 -0
- /package/dist/components/{select-option → select}/select-option.controllers.d.ts +0 -0
- /package/dist/components/{select-option → select}/select-option.d.ts +0 -0
- /package/dist/components/{select-option → select}/select-option.js +0 -0
- /package/dist/components/{stepper-item/stepper-item.styles.d.ts → select/select-option.styles.d.ts} +0 -0
- /package/dist/components/{select-option → select}/select-option.styles.js +0 -0
- /package/dist/components/{stepper-item → stepper}/stepper-item.component.d.ts +0 -0
- /package/dist/components/{stepper-item → stepper}/stepper-item.d.ts +0 -0
- /package/dist/components/{stepper-item → stepper}/stepper-item.js +0 -0
- /package/dist/components/{toast-wrapper/toast-wrapper.styles.d.ts → stepper/stepper-item.styles.d.ts} +0 -0
- /package/dist/components/{stepper-item → stepper}/stepper-item.styles.js +0 -0
- /package/dist/components/{toast-item → toast}/toast-item.component.d.ts +0 -0
- /package/dist/components/{toast-item → toast}/toast-item.component.js +0 -0
- /package/dist/components/{toast-item → toast}/toast-item.styles.d.ts +0 -0
- /package/dist/components/{toast-item → toast}/toast-item.styles.js +0 -0
- /package/dist/components/{toast-wrapper → toast}/toast-wrapper.component.d.ts +0 -0
- /package/dist/components/{toast-wrapper → toast}/toast-wrapper.d.ts +0 -0
- /package/dist/components/{toast-wrapper → toast}/toast-wrapper.js +0 -0
- /package/dist/components/{toast-wrapper → toast}/toast-wrapper.styles.js +0 -0
@@ -1,19 +1,19 @@
|
|
1
1
|
import '../icon/icon.js';
|
2
2
|
import { FormBase } from '../../internal/components/formBase.js';
|
3
3
|
import '../../internal/components/hint/hint';
|
4
|
+
import type { FormFieldSeverity } from '../../internal/types.js';
|
4
5
|
import type { FormFieldBaseProps } from '../../internal/types/formField.js';
|
5
6
|
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 & {});
|
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
|
+
* The skf-text-field is used to create a text input field. It can be used inside a form element or standalone
|
9
9
|
*
|
10
|
-
*
|
10
|
+
* See [zeroheight](https://zeroheight.com/853e936c9/p/9481fa-input-field) for design principles
|
11
11
|
*
|
12
|
-
* @attribute {boolean} disabled - If true, sets disabled state
|
13
|
-
* @attribute {boolean} required - If true, value is required or must be checked for the form to be submittable
|
12
|
+
* @attribute {boolean} [disabled=false] - If true, sets disabled state
|
13
|
+
* @attribute {boolean} [required=false] - If true, value is required or must be checked for the form to be submittable
|
14
14
|
*
|
15
|
-
* @event change - Fires when the value of the input changes
|
16
|
-
* @event invalid - Fires when the input is invalid
|
15
|
+
* @event {CustomEvent} change - Fires when the value of the input changes
|
16
|
+
* @event {CustomEvent} invalid - Fires when the input is invalid
|
17
17
|
*
|
18
18
|
* @slot - The Inputs label. Alternatively, you can use the `label` attribute.
|
19
19
|
*
|
@@ -25,12 +25,13 @@ type AutocompleteValues = 'on' | 'off' | 'name' | 'honorific-prefix' | 'given-na
|
|
25
25
|
export declare class SkfInput extends FormBase implements FormFieldBaseProps {
|
26
26
|
static styles: CSSResultGroup;
|
27
27
|
private customError;
|
28
|
+
/** @internal intermediary value for reset to function, e.g value attribute act as default value */
|
29
|
+
private _value;
|
28
30
|
/**
|
29
|
-
*
|
30
|
-
* [
|
31
|
-
* @type { '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 & {})}
|
31
|
+
* Indicates whether the value of the control can be automatically completed by the browser. See
|
32
|
+
* [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/autocomplete) for details.
|
32
33
|
*/
|
33
|
-
autocomplete?:
|
34
|
+
autocomplete?: HTMLInputElement['autocomplete'];
|
34
35
|
/** Custom aria-label for the clear button. **Notice!** Only applicable to type=search. */
|
35
36
|
buttonAriaLabelClear: string;
|
36
37
|
/** Custom aria-label for the visibility button. **Notice!** Only applicable to type=password. */
|
@@ -41,13 +42,16 @@ export declare class SkfInput extends FormBase implements FormFieldBaseProps {
|
|
41
42
|
set customInvalid(value: string | undefined);
|
42
43
|
get customInvalid(): string | undefined;
|
43
44
|
/** If true, outputs helping hints in console */
|
44
|
-
debug
|
45
|
+
debug: boolean;
|
45
46
|
/** If true, hides the label visually */
|
46
|
-
hideLabel
|
47
|
+
hideLabel: boolean;
|
47
48
|
/** If defined, displays informational text below the field */
|
48
49
|
hint?: string;
|
49
|
-
/**
|
50
|
-
|
50
|
+
/**
|
51
|
+
* Provides a hint about the type of data that might be entered by the user while editing the element or its contents. See
|
52
|
+
* [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inputMode) for details.
|
53
|
+
*/
|
54
|
+
inputmode: HTMLInputElement['inputMode'];
|
51
55
|
/** If defined, sets the input's label. Alternatively, you can use the `label` attribute. */
|
52
56
|
label?: string;
|
53
57
|
/** If defined, displays a prefix/adornment before the input-element */
|
@@ -67,44 +71,40 @@ export declare class SkfInput extends FormBase implements FormFieldBaseProps {
|
|
67
71
|
/** If defined, displays placeholder text */
|
68
72
|
placeholder?: string;
|
69
73
|
/** If true, makes the element not mutable, meaning the user can not edit the control */
|
70
|
-
readonly
|
74
|
+
readonly: boolean;
|
71
75
|
/** If defined, renders an alternative A11y text for the asterisk */
|
72
76
|
requiredLabel?: string;
|
73
|
-
/**
|
74
|
-
|
75
|
-
* @type { "success" | "info" | "warning" }
|
76
|
-
*/
|
77
|
-
severity?: FormFieldBaseProps['severity'];
|
77
|
+
/** If defined, displays provided severity state */
|
78
|
+
severity?: FormFieldSeverity;
|
78
79
|
/** If true, displays valid state after interaction */
|
79
|
-
showValid
|
80
|
+
showValid: boolean;
|
80
81
|
/** Size of the input */
|
81
82
|
size: 'sm' | 'md';
|
82
83
|
/** If defined, displays a suffix/adornment after the input-element */
|
83
84
|
trailing?: string;
|
84
|
-
/**
|
85
|
-
|
86
|
-
* @type { 'button' | 'color' | 'date' | 'datetime-local' | 'email' | 'file' | 'hidden' | 'image' | 'month' | 'number' | 'password' | 'range' | 'reset' | 'search' | 'submit' | 'tel' | 'text' | 'time' | 'url' | 'week' }
|
87
|
-
*/
|
88
|
-
type?: Exclude<FormFieldBaseProps['type'], 'checkbox' | 'radio'>;
|
85
|
+
/** Type of input */
|
86
|
+
type: 'email' | 'number' | 'password' | 'search' | 'tel' | 'text' | 'url';
|
89
87
|
/** Sets validation start */
|
90
88
|
validateOn: 'input' | 'change' | 'submit';
|
91
89
|
/** The current value of the input field */
|
92
|
-
value: string;
|
90
|
+
set value(newValue: string);
|
91
|
+
get value(): string;
|
93
92
|
/** @internal */
|
94
93
|
/** true if the internal state is invalid */
|
95
94
|
invalid: boolean;
|
96
95
|
/** @internal */
|
97
96
|
private _buttonDown;
|
98
97
|
/** @internal */
|
99
|
-
$input
|
98
|
+
$input?: HTMLInputElement;
|
100
99
|
/** @internal */
|
101
100
|
_defaultSlot: Node[];
|
102
101
|
/** @internal */
|
103
102
|
private _numberController;
|
104
103
|
/** @internal */
|
105
104
|
private _passwordController;
|
106
|
-
|
105
|
+
firstUpdated(): void;
|
107
106
|
willUpdate(changedProperties: Map<string | number | symbol, unknown>): void;
|
107
|
+
/** @internal */
|
108
108
|
valueChanged(): void;
|
109
109
|
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
110
110
|
/** @internal */
|
@@ -136,4 +136,3 @@ export declare class SkfInput extends FormBase implements FormFieldBaseProps {
|
|
136
136
|
private _onBlur;
|
137
137
|
render(): import("lit").TemplateResult<1>;
|
138
138
|
}
|
139
|
-
export {};
|
@@ -1,51 +1,52 @@
|
|
1
1
|
import "../icon/icon.js";
|
2
|
-
import { FormBase as
|
2
|
+
import { FormBase as c } from "../../internal/components/formBase.js";
|
3
3
|
import "../../internal/components/hint/hint.js";
|
4
|
-
import { hintSeverity as
|
4
|
+
import { hintSeverity as b } from "../../internal/helpers/hintSeverity.js";
|
5
5
|
import { watch as y } from "../../internal/helpers/watch.js";
|
6
6
|
import { Asterisk as f } from "../../internal/templates/asterisk.js";
|
7
|
-
import _ from "../../styles/component.styles.js";
|
7
|
+
import { componentStyles as _ } from "../../styles/component.styles.js";
|
8
8
|
import { html as h, nothing as u } from "lit";
|
9
|
-
import {
|
10
|
-
import { ifDefined as
|
9
|
+
import { state as p, property as s, query as $, queryAssignedNodes as g } from "lit/decorators.js";
|
10
|
+
import { ifDefined as o } from "lit/directives/if-defined.js";
|
11
11
|
import { live as w } from "lit/directives/live.js";
|
12
12
|
import { InputNumberController as E, InputPasswordController as C } from "./input.controllers.js";
|
13
13
|
import A from "./input.styles.js";
|
14
|
-
var
|
15
|
-
for (var
|
16
|
-
(d =
|
17
|
-
return a &&
|
14
|
+
var L = Object.defineProperty, P = Object.getOwnPropertyDescriptor, e = (v, t, r, a) => {
|
15
|
+
for (var n = a > 1 ? void 0 : a ? P(t, r) : t, l = v.length - 1, d; l >= 0; l--)
|
16
|
+
(d = v[l]) && (n = (a ? d(t, r, n) : d(n)) || n);
|
17
|
+
return a && n && L(t, r, n), n;
|
18
18
|
};
|
19
|
-
const
|
19
|
+
const m = class m extends c {
|
20
20
|
constructor() {
|
21
|
-
super(...arguments), this.buttonAriaLabelClear = "Clear input", this.buttonAriaLabelHide = "Hide password", this.buttonAriaLabelShow = "Show password", this.inputmode = "text", this.
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
21
|
+
super(...arguments), this._value = "", this.buttonAriaLabelClear = "Clear input", this.buttonAriaLabelHide = "Hide password", this.buttonAriaLabelShow = "Show password", this.debug = !1, this.hideLabel = !1, this.inputmode = "text", this.readonly = !1, this.showValid = !1, this.size = "md", this.type = "text", this.validateOn = "change", this.invalid = !1, this._buttonDown = !1, this._numberController = new E(this), this._passwordController = new C(this), this._handleInput = () => {
|
22
|
+
var t;
|
23
|
+
this._value = ((t = this.$input) == null ? void 0 : t.value) ?? "", this.validateOn === "input" && (this._pristine = !1, this.validateInput());
|
24
|
+
}, this._resetValue = (t) => {
|
25
|
+
var r, a;
|
26
|
+
t.stopPropagation(), this.value = ((r = this.getAttribute("value")) == null ? void 0 : r.trim()) ?? "", this._value = this.value, this._internals.setFormValue(this.value), (a = this.$input) == null || a.focus();
|
27
|
+
}, this._handlePressStart = (t) => {
|
28
|
+
this._buttonDown = !0, this.type === "number" && this._numberController.handleActionBtnLongPressStart(t);
|
28
29
|
}, this._handlePressEnd = () => {
|
29
30
|
this._buttonDown = !1, this.type === "number" && this._numberController.handleActionBtnLongPressEnd();
|
30
|
-
}, this._renderNumberButton = (
|
31
|
+
}, this._renderNumberButton = (t) => h`
|
31
32
|
<button
|
32
33
|
?disabled=${this.disabled}
|
33
34
|
@click=${(r) => {
|
34
|
-
this._numberController.handleActionBtnClick(r,
|
35
|
+
this._numberController.handleActionBtnClick(r, t);
|
35
36
|
}}
|
36
37
|
@mousedown=${this._handlePressStart}
|
37
38
|
@mouseup=${this._handlePressEnd}
|
38
39
|
@mouseleave=${this._handlePressEnd}
|
39
|
-
aria-label="${
|
40
|
+
aria-label="${t === "inc" ? "Increment" : "Decrement"}"
|
40
41
|
class="number skf-icon-host"
|
41
42
|
type="button"
|
42
43
|
>
|
43
|
-
<skf-icon name="${
|
44
|
+
<skf-icon name="${t === "inc" ? "chevronUp" : "chevronDown"}" size="sm"></skf-icon>
|
44
45
|
</button>
|
45
46
|
`, this._renderPasswordButton = () => h`
|
46
47
|
<button
|
47
48
|
@click=${this._passwordController.toggleVisibility}
|
48
|
-
aria-label=${
|
49
|
+
aria-label=${o(this._passwordController._buttonAriaLabel)}
|
49
50
|
class="password skf-icon-host"
|
50
51
|
type="button"
|
51
52
|
@mousedown="${this._handlePressStart}"
|
@@ -60,31 +61,41 @@ const p = class p extends b {
|
|
60
61
|
@mousedown=${this._handlePressStart}
|
61
62
|
@mouseup=${this._handlePressEnd}
|
62
63
|
@mouseleave=${this._handlePressEnd}
|
63
|
-
aria-label=${
|
64
|
+
aria-label=${o(this.buttonAriaLabelClear)}
|
64
65
|
class="search skf-icon-host"
|
65
66
|
type="button"
|
66
67
|
>
|
67
68
|
<skf-icon name="close" size="sm"></skf-icon>
|
68
69
|
</button>
|
69
70
|
`, this._onBlur = () => {
|
70
|
-
|
71
|
+
var t;
|
72
|
+
this._buttonDown && ((t = this.$input) == null || t.focus());
|
71
73
|
};
|
72
74
|
}
|
73
|
-
set customInvalid(
|
74
|
-
this.customError =
|
75
|
+
set customInvalid(t) {
|
76
|
+
this.customError = t ?? "";
|
75
77
|
}
|
76
78
|
get customInvalid() {
|
77
79
|
return this.customError;
|
78
80
|
}
|
81
|
+
set value(t) {
|
82
|
+
this.$input && (this.$input.value = t, this._value = t, this._internals.setFormValue(t), this.validateInput());
|
83
|
+
}
|
84
|
+
get value() {
|
85
|
+
var t;
|
86
|
+
return ((t = this.$input) == null ? void 0 : t.value) ?? "";
|
87
|
+
}
|
79
88
|
firstUpdated() {
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
this._pristine = !1, this.
|
89
|
+
var t;
|
90
|
+
(t = this.$input) == null || t.addEventListener("change", () => {
|
91
|
+
var r;
|
92
|
+
this.validateOn === "change" && (this.validateOn = "input", this._pristine = !1), this._internals.setFormValue(((r = this.$input) == null ? void 0 : r.value) ?? ""), this.emitEvent("change"), this.validateInput();
|
93
|
+
}), this.addEventListener("invalid", (r) => {
|
94
|
+
this._pristine = !1, this.invalid = !0, this.customErrorDisplay && r.preventDefault();
|
84
95
|
}), this.addEventListener("reset", this._resetValue), this.validateInput();
|
85
96
|
}
|
86
|
-
willUpdate(
|
87
|
-
if (
|
97
|
+
willUpdate(t) {
|
98
|
+
if (t.has("invalid"))
|
88
99
|
if (this.invalid) {
|
89
100
|
this.setAttribute("invalid", ""), this.showValid || this.removeAttribute("valid");
|
90
101
|
const r = this._internals.validationMessage;
|
@@ -95,8 +106,8 @@ const p = class p extends b {
|
|
95
106
|
valueChanged() {
|
96
107
|
this._internals.setFormValue(this.value), this.validateInput();
|
97
108
|
}
|
98
|
-
attributeChangedCallback(
|
99
|
-
if (super.attributeChangedCallback(
|
109
|
+
attributeChangedCallback(t, r, a) {
|
110
|
+
if (super.attributeChangedCallback(t, r, a), t === "value" && this._internals.setFormValue(a), t === "custom-invalid")
|
100
111
|
if (typeof a == "string") {
|
101
112
|
const l = this.withFallback(a);
|
102
113
|
this._pristine = !1, this._internals.setValidity({ customError: !0 }, l), this.invalid = !0, this.hint = l, this.checkValidity();
|
@@ -105,7 +116,7 @@ const p = class p extends b {
|
|
105
116
|
}
|
106
117
|
/** @internal */
|
107
118
|
validateInput() {
|
108
|
-
if (this._internals.validity.customError) return;
|
119
|
+
if (this._internals.validity.customError || !this.$input) return;
|
109
120
|
const r = this.$input.validity;
|
110
121
|
if (this.invalid = !1, r.valid)
|
111
122
|
this._internals.setValidity({ customError: this._internals.validity.customError });
|
@@ -113,12 +124,12 @@ const p = class p extends b {
|
|
113
124
|
this.invalid = !this._pristine && !r.valid;
|
114
125
|
let a;
|
115
126
|
for (a in r) {
|
116
|
-
const
|
117
|
-
if (r[a] && !this.hasAttribute(
|
118
|
-
`Add custom message on ${this.localName} using attribute: ${
|
127
|
+
const n = `data-${a.toString()}`;
|
128
|
+
if (r[a] && !this.hasAttribute(n) && this.debug && console.log(
|
129
|
+
`Add custom message on ${this.localName} using attribute: ${n.toUpperCase()}="Your custom message"`
|
119
130
|
), r[a]) {
|
120
131
|
this.validationError = a.toString();
|
121
|
-
const l = this.hasAttribute(
|
132
|
+
const l = this.hasAttribute(n) ? this.getAttribute(n) : this.$input.validationMessage;
|
122
133
|
this._internals.setValidity(
|
123
134
|
{ [this.validationError]: !0, customError: this._internals.validity.customError },
|
124
135
|
this.withFallback(l)
|
@@ -128,20 +139,20 @@ const p = class p extends b {
|
|
128
139
|
}
|
129
140
|
}
|
130
141
|
render() {
|
131
|
-
var r, a,
|
132
|
-
const
|
142
|
+
var r, a, n, l;
|
143
|
+
const t = (this._defaultSlot.length === 0 || !((a = (r = this._defaultSlot[0]) == null ? void 0 : r.textContent) != null && a.trim())) && !this.label;
|
133
144
|
return h`
|
134
145
|
<div id="root">
|
135
146
|
<label>
|
136
|
-
<div class=${this.hideLabel ? "visually-hidden" : ""} ?hidden=${
|
147
|
+
<div class=${this.hideLabel ? "visually-hidden" : ""} ?hidden=${t} id="label">
|
137
148
|
<slot>${this.label}</slot>
|
138
149
|
${this.required ? f(this.requiredLabel) : null}
|
139
150
|
</div>
|
140
151
|
<div id="input">
|
141
152
|
${this.type === "search" ? h`<skf-icon class="skf-icon-host" name="search" size="sm"></skf-icon>` : u}
|
142
153
|
<div
|
143
|
-
data-leading=${
|
144
|
-
data-trailing=${
|
154
|
+
data-leading=${o(this.leading)}
|
155
|
+
data-trailing=${o(this.trailing)}
|
145
156
|
id="affix"
|
146
157
|
>
|
147
158
|
<input
|
@@ -151,21 +162,20 @@ const p = class p extends b {
|
|
151
162
|
.value=${w(this.value)}
|
152
163
|
@blur=${this._onBlur}
|
153
164
|
@input=${this._handleInput}
|
154
|
-
autocomplete=${this.autocomplete}
|
155
|
-
aria-describedby=${
|
156
|
-
aria-errormessage=${
|
165
|
+
.autocomplete=${this.autocomplete}
|
166
|
+
aria-describedby=${o((n = this.hint) != null && n.trim() ? "hint" : u)}
|
167
|
+
aria-errormessage=${o((l = this.hint) != null && l.trim() ? "hint" : u)}
|
157
168
|
aria-invalid=${!!this.invalid}
|
158
|
-
autocomplete="off"
|
159
169
|
data-testid="field-input"
|
160
|
-
inputmode=${
|
161
|
-
max=${
|
162
|
-
maxlength=${
|
163
|
-
min=${
|
164
|
-
minlength=${
|
165
|
-
name=${
|
166
|
-
pattern=${
|
167
|
-
placeholder=${
|
168
|
-
type=${
|
170
|
+
inputmode=${o(this.inputMode)}
|
171
|
+
max=${o(this.max)}
|
172
|
+
maxlength=${o(this.maxLength)}
|
173
|
+
min=${o(this.min)}
|
174
|
+
minlength=${o(this.minLength)}
|
175
|
+
name=${o(this.name)}
|
176
|
+
pattern=${o(this.pattern)}
|
177
|
+
placeholder=${o(this.placeholder)}
|
178
|
+
type=${o(
|
169
179
|
this.type === "password" ? this._passwordController._type : this.type
|
170
180
|
)}
|
171
181
|
/>
|
@@ -176,14 +186,14 @@ const p = class p extends b {
|
|
176
186
|
</div>
|
177
187
|
` : u}
|
178
188
|
${this.type === "password" ? this._renderPasswordButton() : u}
|
179
|
-
${this.type === "search" && this.
|
189
|
+
${this.type === "search" && this._value.length > 0 ? this._renderSearchButton() : u}
|
180
190
|
</div>
|
181
191
|
</label>
|
182
192
|
${this.hint && h`
|
183
193
|
<skf-hint
|
184
194
|
aria-live=${this.invalid ? "assertive" : "polite"}
|
185
195
|
id="hint"
|
186
|
-
severity=${
|
196
|
+
severity=${o(b(this.invalid, this.severity))}
|
187
197
|
>${this.customInvalid ?? this.hint}
|
188
198
|
</skf-hint>
|
189
199
|
`}
|
@@ -191,104 +201,107 @@ const p = class p extends b {
|
|
191
201
|
`;
|
192
202
|
}
|
193
203
|
};
|
194
|
-
|
195
|
-
let
|
204
|
+
m.styles = [_, A];
|
205
|
+
let i = m;
|
206
|
+
e([
|
207
|
+
p()
|
208
|
+
], i.prototype, "_value", 2);
|
196
209
|
e([
|
197
|
-
|
198
|
-
],
|
210
|
+
s()
|
211
|
+
], i.prototype, "autocomplete", 2);
|
199
212
|
e([
|
200
|
-
|
201
|
-
],
|
213
|
+
s({ attribute: "button-aria-label-clear" })
|
214
|
+
], i.prototype, "buttonAriaLabelClear", 2);
|
202
215
|
e([
|
203
|
-
|
204
|
-
],
|
216
|
+
s({ attribute: "button-aria-label-hide" })
|
217
|
+
], i.prototype, "buttonAriaLabelHide", 2);
|
205
218
|
e([
|
206
|
-
|
207
|
-
],
|
219
|
+
s({ attribute: "button-aria-label-show" })
|
220
|
+
], i.prototype, "buttonAriaLabelShow", 2);
|
208
221
|
e([
|
209
|
-
|
210
|
-
],
|
222
|
+
s({ attribute: "custom-invalid", reflect: !0 })
|
223
|
+
], i.prototype, "customInvalid", 1);
|
211
224
|
e([
|
212
|
-
|
213
|
-
],
|
225
|
+
s({ type: Boolean })
|
226
|
+
], i.prototype, "debug", 2);
|
214
227
|
e([
|
215
|
-
|
216
|
-
],
|
228
|
+
s({ type: Boolean, attribute: "hide-label" })
|
229
|
+
], i.prototype, "hideLabel", 2);
|
217
230
|
e([
|
218
|
-
|
219
|
-
],
|
231
|
+
s()
|
232
|
+
], i.prototype, "hint", 2);
|
220
233
|
e([
|
221
|
-
|
222
|
-
],
|
234
|
+
s()
|
235
|
+
], i.prototype, "inputmode", 2);
|
223
236
|
e([
|
224
|
-
|
225
|
-
],
|
237
|
+
s()
|
238
|
+
], i.prototype, "label", 2);
|
226
239
|
e([
|
227
|
-
|
228
|
-
],
|
240
|
+
s()
|
241
|
+
], i.prototype, "leading", 2);
|
229
242
|
e([
|
230
|
-
|
231
|
-
],
|
243
|
+
s()
|
244
|
+
], i.prototype, "max", 2);
|
232
245
|
e([
|
233
|
-
|
234
|
-
],
|
246
|
+
s({ type: Number, attribute: "maxlength" })
|
247
|
+
], i.prototype, "maxLength", 2);
|
235
248
|
e([
|
236
|
-
|
237
|
-
],
|
249
|
+
s()
|
250
|
+
], i.prototype, "min", 2);
|
238
251
|
e([
|
239
|
-
|
240
|
-
],
|
252
|
+
s({ type: Number, attribute: "minlength" })
|
253
|
+
], i.prototype, "minLength", 2);
|
241
254
|
e([
|
242
|
-
|
243
|
-
],
|
255
|
+
s({ reflect: !0 })
|
256
|
+
], i.prototype, "name", 2);
|
244
257
|
e([
|
245
|
-
|
246
|
-
],
|
258
|
+
s()
|
259
|
+
], i.prototype, "pattern", 2);
|
247
260
|
e([
|
248
|
-
|
249
|
-
],
|
261
|
+
s()
|
262
|
+
], i.prototype, "placeholder", 2);
|
250
263
|
e([
|
251
|
-
|
252
|
-
],
|
264
|
+
s({ type: Boolean })
|
265
|
+
], i.prototype, "readonly", 2);
|
253
266
|
e([
|
254
|
-
|
255
|
-
],
|
267
|
+
s({ attribute: "required-label" })
|
268
|
+
], i.prototype, "requiredLabel", 2);
|
256
269
|
e([
|
257
|
-
|
258
|
-
],
|
270
|
+
s({ reflect: !0 })
|
271
|
+
], i.prototype, "severity", 2);
|
259
272
|
e([
|
260
|
-
|
261
|
-
],
|
273
|
+
s({ type: Boolean, attribute: "show-valid" })
|
274
|
+
], i.prototype, "showValid", 2);
|
262
275
|
e([
|
263
|
-
|
264
|
-
],
|
276
|
+
s({ reflect: !0 })
|
277
|
+
], i.prototype, "size", 2);
|
265
278
|
e([
|
266
|
-
|
267
|
-
],
|
279
|
+
s()
|
280
|
+
], i.prototype, "trailing", 2);
|
268
281
|
e([
|
269
|
-
|
270
|
-
],
|
282
|
+
s()
|
283
|
+
], i.prototype, "type", 2);
|
271
284
|
e([
|
272
|
-
|
273
|
-
],
|
285
|
+
s({ attribute: "validate-on" })
|
286
|
+
], i.prototype, "validateOn", 2);
|
274
287
|
e([
|
275
|
-
|
276
|
-
],
|
288
|
+
s({})
|
289
|
+
], i.prototype, "value", 1);
|
277
290
|
e([
|
278
|
-
|
279
|
-
],
|
291
|
+
p()
|
292
|
+
], i.prototype, "invalid", 2);
|
280
293
|
e([
|
281
|
-
|
282
|
-
],
|
294
|
+
p()
|
295
|
+
], i.prototype, "_buttonDown", 2);
|
283
296
|
e([
|
284
297
|
$("input")
|
285
|
-
],
|
298
|
+
], i.prototype, "$input", 2);
|
286
299
|
e([
|
287
300
|
g({ flatten: !0 })
|
288
|
-
],
|
301
|
+
], i.prototype, "_defaultSlot", 2);
|
289
302
|
e([
|
290
303
|
y("value", { waitUntilFirstUpdate: !0, afterUpdate: !0 })
|
291
|
-
],
|
304
|
+
], i.prototype, "valueChanged", 1);
|
292
305
|
export {
|
293
|
-
|
306
|
+
i as SkfInput
|
294
307
|
};
|
@@ -1,13 +1,12 @@
|
|
1
|
-
import type { SkfIcon } from '../icon/icon.component.js';
|
2
1
|
import '../icon/icon.js';
|
3
2
|
import { SkfElement } from '../../internal/components/skf-element.js';
|
3
|
+
import type { Icon } from '../../internal/types.js';
|
4
4
|
import { type CSSResultGroup } from 'lit';
|
5
|
+
type SkfLinkType = HTMLButtonElement['type'];
|
5
6
|
/**
|
6
7
|
* The `<skf-link>` can be used as either a regular link or a link styled semantic button
|
7
8
|
*
|
8
|
-
* @documentation See [
|
9
|
-
*
|
10
|
-
* @property {function} onClick - If provided, custom function triggered by click where the second return parameter enables custom routing.
|
9
|
+
* @documentation See [zeroheight](https://zeroheight.com/****) for design principles
|
11
10
|
*
|
12
11
|
* @slot - The links' main content
|
13
12
|
*
|
@@ -16,24 +15,25 @@ import { type CSSResultGroup } from 'lit';
|
|
16
15
|
export declare class SkfLink extends SkfElement {
|
17
16
|
static styles: CSSResultGroup;
|
18
17
|
static classMap: {};
|
18
|
+
/** @internal */
|
19
19
|
private _onClick?;
|
20
20
|
/** Defines the semantic element to render */
|
21
21
|
as: 'button' | 'a';
|
22
22
|
/** Defines the text-color */
|
23
23
|
color: 'primary' | 'inverse';
|
24
24
|
/** If true, disables the link */
|
25
|
-
disabled
|
25
|
+
disabled: boolean;
|
26
26
|
/** If defined, downloads the url */
|
27
27
|
download?: string;
|
28
28
|
/** If defined, loads url on click */
|
29
29
|
href?: string;
|
30
|
-
/**
|
31
|
-
|
32
|
-
* @type { "arrowDown" | "arrowDownUp" | "arrowLeft" | "arrowRight" | "arrowUp" | "article" | "artificialIntelligence" | "asset" | "attachment" | "bandCursor" | "bands" | "batteryEmpty" | "batteryFull" | "batteryLow" | "bearingFault" | "book" | "bulb" | "burger" | "cPM" | "calendar" | "calendarBooked" | "calendarEmpty" | "calendarNotBooked" | "calendarRecurring" | "caretDown" | "caretUp" | "caretUpDown" | "chat" | "check" | "checkCircle" | "checkSmall" | "chevronDown" | "chevronLeft" | "chevronRight" | "chevronUp" | "chevronUpDown" | "close" | "closeAllFaults" | "closeFault" | "closeSmall" | "columnGraph" | "comment" | "connection1" | "connection2" | "connection3" | "connection4" | "danger" | "defectFrequencies" | "defectFrequenciesAlternative" | "doubleChevronLeft" | "doubleChevronRight" | "download" | "draft" | "draftFilled" | "draftOutlined" | "dragNDrop" | "drop" | "duplicate" | "edit" | "emailFilled" | "emailOutlined" | "exclamation" | "eye" | "eyeHidden" | "eyeVisible" | "filter" | "forbidden" | "fullScreen" | "fullScreenExit" | "functionalLocation" | "harmonicCursor" | "heatmap" | "hierarchy" | "history" | "historyAlt" | "hourglassFramedFilled" | "hourglassFramedOutlined" | "hourglassOutlined" | "hz" | "iMX" | "image" | "infoCircleFilled" | "infoCircleOutlined" | "integration" | "kebab" | "link" | "listGroup" | "listItem" | "locationPin" | "lock" | "logOut" | "meatballs" | "microphone" | "minus" | "minusSmall" | "noData" | "o" | "openInNew" | "overlayBaseline" | "pDF" | "paper" | "pause" | "pieChart" | "pin" | "play" | "plus" | "powerOff" | "printer" | "proCollect" | "recAction" | "received" | "refresh" | "reorder" | "replace" | "reply" | "rewalkableRoute" | "routes" | "search" | "send" | "sensorA" | "sensorB" | "settings" | "sidebandCursor" | "singleCursor" | "spectrum" | "starFilled" | "starOutlined" | "statusCircle" | "stop" | "structuralVibration" | "sync" | "timewave" | "trash" | "trend" | "trendingUp" | "undo" | "unknownCircle" | "unknownDiamond" | "unlink" | "unlock" | "unscheduledAction" | "upload" | "user" | "viewFull" | "viewHorizontal" | "viewVertical" | "warning" | "warningCircle" | "warningDiamond" | "zoomIn" | "zoomOut" }
|
33
|
-
*/
|
34
|
-
icon?: SkfIcon['name'];
|
30
|
+
/** If defined, renders an icon before or after the text */
|
31
|
+
icon?: Icon;
|
35
32
|
/** Defines the position of the icon in relation to the text */
|
36
33
|
iconPlacement: 'left' | 'right';
|
34
|
+
/** If defined, accepts a function that runs on click. Forwards optional route as second argument. */
|
35
|
+
set onClick(onClickFn: ((event: Event, route?: string) => void) | undefined);
|
36
|
+
get onClick(): ((event: Event, route?: string) => void) | undefined;
|
37
37
|
/** If defined, describes the relationship between a linked resource and the current document */
|
38
38
|
rel?: string;
|
39
39
|
/** If defined, used on conjunction with onClick property, second argument */
|
@@ -43,10 +43,7 @@ export declare class SkfLink extends SkfElement {
|
|
43
43
|
/** If defined, specifies where to open the linked document */
|
44
44
|
target?: '_blank' | '_parent' | '_self' | '_top';
|
45
45
|
/** Defines the type of button */
|
46
|
-
type:
|
47
|
-
/** If defined, accepts a function that runs on click. Forwards optional route as second argument. */
|
48
|
-
set onClick(onClickFn: ((event: Event, route?: string) => void) | undefined);
|
49
|
-
get onClick(): ((event: Event, route?: string) => void) | undefined;
|
46
|
+
type: SkfLinkType;
|
50
47
|
connectedCallback(): void;
|
51
48
|
/** @internal */
|
52
49
|
private _assertValidOnClick;
|
@@ -57,3 +54,4 @@ export declare class SkfLink extends SkfElement {
|
|
57
54
|
private _renderIcon;
|
58
55
|
render(): import("lit").TemplateResult;
|
59
56
|
}
|
57
|
+
export {};
|