@skf-design-system/ui-components 1.0.2-beta.0 → 1.0.2-beta.10
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 +37 -9
- package/dist/components/accordion/accordion-item.component.d.ts +36 -0
- package/dist/components/accordion/accordion-item.component.js +98 -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 +6 -10
- package/dist/components/accordion/accordion.component.js +9 -10
- 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 +12 -10
- package/dist/components/alert/alert.component.js +59 -51
- package/dist/components/alert/alert.styles.js +50 -51
- package/dist/components/breadcrumb/breadcrumb-item.component.js +59 -0
- package/dist/components/{breadcrumb-item → breadcrumb}/breadcrumb-item.d.ts +2 -2
- package/dist/components/breadcrumb/breadcrumb-item.js +6 -0
- package/dist/components/breadcrumb/breadcrumb-item.styles.js +63 -0
- package/dist/components/breadcrumb/breadcrumb.component.d.ts +6 -3
- package/dist/components/breadcrumb/breadcrumb.component.js +65 -0
- package/dist/components/breadcrumb/breadcrumb.d.ts +2 -2
- package/dist/components/breadcrumb/breadcrumb.js +6 -0
- package/dist/components/breadcrumb/breadcrumb.styles.js +25 -0
- package/dist/components/button/button.component.d.ts +13 -10
- package/dist/components/button/button.component.js +69 -66
- package/dist/components/button/button.styles.d.ts +1 -2
- package/dist/components/button/button.styles.js +6 -5
- package/dist/components/card/card.component.d.ts +6 -1
- package/dist/components/card/card.component.js +46 -24
- package/dist/components/card/card.styles.js +31 -14
- package/dist/components/checkbox/checkbox.component.d.ts +14 -11
- package/dist/components/checkbox/checkbox.component.js +67 -69
- package/dist/components/checkbox/checkbox.styles.d.ts +1 -2
- package/dist/components/checkbox/checkbox.styles.js +2 -6
- package/dist/components/{date-picker/datepicker.calendar.component.d.ts → datepicker/datepicker-calendar.component.d.ts} +8 -1
- package/dist/components/{date-picker/datepicker.calendar.component.js → datepicker/datepicker-calendar.component.js} +109 -115
- package/dist/components/datepicker/datepicker-calendar.d.ts +8 -0
- package/dist/components/datepicker/datepicker-calendar.js +6 -0
- package/dist/components/{date-picker/datepicker.component.d.ts → datepicker/datepicker-popup.component.d.ts} +9 -20
- package/dist/components/datepicker/datepicker-popup.component.js +272 -0
- package/dist/components/datepicker/datepicker-popup.d.ts +8 -0
- package/dist/components/{date-picker/datepicker.helpers.d.ts → datepicker/datepicker-popup.helpers.d.ts} +3 -3
- package/dist/components/datepicker/datepicker-popup.helpers.js +83 -0
- package/dist/components/datepicker/datepicker-popup.js +6 -0
- package/dist/components/{date-picker/datepicker.styles.js → datepicker/datepicker-popup.styles.js} +3 -3
- package/dist/components/{date-picker-input/datepicker-input.component.d.ts → datepicker/datepicker.component.d.ts} +22 -14
- package/dist/components/datepicker/datepicker.component.js +455 -0
- package/dist/components/datepicker/datepicker.d.ts +8 -0
- package/dist/components/datepicker/datepicker.js +6 -0
- package/dist/components/dialog/dialog.component.d.ts +8 -6
- package/dist/components/dialog/dialog.component.js +67 -67
- package/dist/components/dialog/dialog.d.ts +2 -2
- package/dist/components/dialog/dialog.styles.js +4 -4
- package/dist/components/divider/divider.component.d.ts +3 -0
- package/dist/components/divider/divider.component.js +43 -22
- package/dist/components/divider/divider.styles.js +9 -9
- package/dist/components/drawer/drawer.component.d.ts +24 -12
- package/dist/components/drawer/drawer.component.js +87 -63
- package/dist/components/drawer/drawer.d.ts +2 -2
- package/dist/components/drawer/drawer.styles.js +47 -40
- package/dist/components/header/header.component.d.ts +7 -4
- package/dist/components/header/header.component.js +68 -55
- package/dist/components/header/header.d.ts +2 -2
- package/dist/components/header/header.styles.js +2 -2
- package/dist/components/heading/heading.component.d.ts +8 -6
- package/dist/components/heading/heading.component.js +52 -24
- package/dist/components/heading/heading.styles.js +34 -36
- package/dist/components/icon/icon.component.d.ts +15 -17
- package/dist/components/icon/icon.component.js +62 -43
- package/dist/components/icon/icon.styles.d.ts +1 -2
- package/dist/components/icon/icon.styles.js +60 -60
- package/dist/components/input/input.component.d.ts +34 -39
- package/dist/components/input/input.component.js +159 -153
- package/dist/components/input/input.controllers.d.ts +0 -1
- package/dist/components/input/input.controllers.js +14 -19
- package/dist/components/link/link.component.d.ts +20 -25
- package/dist/components/link/link.component.js +104 -107
- package/dist/components/link/link.styles.d.ts +1 -2
- package/dist/components/link/link.styles.js +54 -46
- package/dist/components/loader/loader.component.d.ts +6 -4
- package/dist/components/loader/loader.component.js +49 -42
- package/dist/components/loader/loader.styles.d.ts +1 -2
- package/dist/components/loader/loader.styles.js +34 -30
- package/dist/components/logo/logo.component.d.ts +8 -6
- package/dist/components/logo/logo.component.js +55 -51
- package/dist/components/logo/logo.styles.js +26 -16
- package/dist/components/menu/menu-item.component.d.ts +13 -0
- package/dist/components/menu/menu-item.component.js +13 -0
- package/dist/components/{menu-item → menu}/menu-item.d.ts +2 -2
- package/dist/components/menu/menu-item.styles.js +23 -0
- package/dist/components/menu/menu.component.d.ts +14 -8
- package/dist/components/menu/menu.component.js +10 -12
- package/dist/components/menu/menu.d.ts +2 -2
- package/dist/components/{nav-item → nav}/nav-item.component.d.ts +6 -4
- package/dist/components/nav/nav-item.component.js +57 -0
- package/dist/components/nav/nav-item.styles.js +43 -0
- package/dist/components/nav/nav.component.d.ts +9 -0
- package/dist/components/nav/nav.component.js +47 -21
- package/dist/components/nav/nav.d.ts +2 -2
- package/dist/components/nav/nav.styles.js +15 -9
- package/dist/components/popover/popover.component.d.ts +17 -6
- package/dist/components/popover/popover.component.js +22 -16
- package/dist/components/popover/popover.d.ts +2 -2
- package/dist/components/progress/progress.component.d.ts +4 -2
- package/dist/components/progress/progress.component.js +38 -35
- package/dist/components/progress/progress.d.ts +2 -2
- package/dist/components/progress/progress.styles.js +42 -35
- package/dist/components/radio/radio.component.d.ts +13 -9
- package/dist/components/radio/radio.component.js +96 -91
- package/dist/components/radio/radio.styles.js +1 -1
- 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-item → segmented-button}/segmented-button-item.d.ts +2 -2
- 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 +71 -0
- package/dist/components/segmented-button/segmented-button.d.ts +2 -2
- 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.d.ts +4 -0
- package/dist/components/select/select-option-group.component.js +50 -0
- package/dist/components/{select-option-group → select}/select-option-group.d.ts +2 -2
- package/dist/components/select/select-option-group.style.js +24 -0
- package/dist/components/{select-option → select}/select-option.component.d.ts +16 -12
- package/dist/components/select/select-option.component.js +135 -0
- package/dist/components/select/select-option.styles.js +65 -0
- package/dist/components/select/select.component.d.ts +35 -25
- package/dist/components/select/select.component.js +126 -88
- package/dist/components/select/select.controllers.d.ts +1 -1
- package/dist/components/select/select.controllers.js +16 -18
- package/dist/components/select/select.styles.js +8 -2
- package/dist/components/select/stories/select.stories.icons.d.ts +7 -0
- package/dist/components/{stepper-item → stepper}/stepper-item.component.d.ts +1 -1
- package/dist/components/stepper/stepper-item.component.js +116 -0
- package/dist/components/{stepper-item → stepper}/stepper-item.d.ts +2 -2
- package/dist/components/{stepper-item → stepper}/stepper-item.styles.js +4 -4
- package/dist/components/stepper/stepper.component.d.ts +2 -2
- package/dist/components/stepper/stepper.component.js +17 -18
- package/dist/components/stepper/stepper.d.ts +2 -2
- package/dist/components/stepper/stepper.helpers.d.ts +1 -1
- package/dist/components/stepper/stepper.helpers.js +6 -7
- package/dist/components/switch/switch.component.d.ts +4 -2
- package/dist/components/switch/switch.component.js +64 -58
- package/dist/components/switch/switch.d.ts +2 -2
- package/dist/components/switch/switch.styles.js +1 -1
- package/dist/components/{tab-panel → tabs}/tab-panel.component.d.ts +1 -1
- package/dist/components/tabs/tab-panel.component.js +39 -0
- package/dist/components/{tab-panel → tabs}/tab-panel.d.ts +2 -2
- package/dist/components/{tab → tabs}/tab.component.d.ts +3 -3
- package/dist/components/{tab → tabs}/tab.component.js +18 -15
- package/dist/components/{tab → tabs}/tab.d.ts +2 -2
- package/dist/components/{tab → tabs}/tab.styles.js +2 -2
- package/dist/components/{tab-group/tab-group.component.d.ts → tabs/tabs.component.d.ts} +3 -4
- package/dist/components/{tab-group/tab-group.component.js → tabs/tabs.component.js} +36 -37
- package/dist/components/tabs/tabs.d.ts +8 -0
- package/dist/components/tabs/tabs.js +6 -0
- package/dist/components/{tab-group/tab-group.styles.js → tabs/tabs.styles.js} +16 -16
- package/dist/components/tag/tag.component.d.ts +20 -16
- package/dist/components/tag/tag.component.js +74 -65
- package/dist/components/tag/tag.d.ts +2 -2
- package/dist/components/tag/tag.styles.js +63 -50
- package/dist/components/textarea/textarea.component.d.ts +14 -13
- package/dist/components/textarea/textarea.component.js +77 -72
- 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/toast-item.styles.js +21 -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 +16 -16
- package/dist/components/toast/toast.singleton.d.ts +5 -5
- package/dist/components/toast/toast.singleton.js +28 -29
- package/dist/components/tooltip/tooltip.component.d.ts +11 -3
- package/dist/components/tooltip/tooltip.component.js +18 -9
- package/dist/components/tooltip/tooltip.d.ts +2 -2
- package/dist/custom-elements.json +2202 -1720
- package/dist/index.d.ts +19 -12
- package/dist/index.js +108 -89
- package/dist/internal/base-classes/popover/popover.base.d.ts +30 -6
- package/dist/internal/base-classes/popover/popover.base.js +83 -69
- package/dist/internal/base-classes/popover/popover.styles.js +4 -5
- package/dist/internal/components/formBase.d.ts +1 -0
- package/dist/internal/components/formBase.js +11 -19
- package/dist/internal/components/hint/hint.component.d.ts +6 -2
- package/dist/internal/components/hint/hint.component.js +47 -20
- package/dist/internal/components/hint/hint.styles.d.ts +1 -2
- package/dist/internal/components/hint/hint.styles.js +30 -26
- package/dist/internal/components/skf-element.d.ts +1 -3
- package/dist/internal/components/skf-element.js +4 -9
- package/dist/internal/constants/iconSeverity.d.ts +3 -2
- package/dist/internal/constants/iconSeverity.js +2 -3
- package/dist/internal/controllers/popover.controller.d.ts +2 -0
- package/dist/internal/controllers/popover.controller.js +11 -14
- package/dist/internal/helpers/hintSeverity.d.ts +2 -2
- package/dist/internal/helpers/hintSeverity.js +1 -1
- package/dist/internal/helpers/stateMap.d.ts +14 -0
- package/dist/internal/helpers/stateMap.js +68 -0
- package/dist/internal/helpers/uuid.d.ts +8 -10
- package/dist/internal/helpers/uuid.js +4 -11
- package/dist/internal/helpers/watch.d.ts +1 -1
- package/dist/internal/helpers/watch.js +12 -12
- package/dist/internal/templates/asterisk.d.ts +1 -1
- package/dist/internal/templates/asterisk.js +4 -4
- package/dist/internal/types/formField.d.ts +1 -1
- package/dist/internal/types.d.ts +22 -0
- package/dist/styles/component.styles.d.ts +1 -2
- package/dist/styles/component.styles.js +38 -37
- package/dist/styles/global-alt.css +1 -0
- package/dist/styles/global.css +1 -1
- package/dist/translations/en.d.ts +3 -0
- package/dist/translations/en.js +27 -0
- package/dist/translations/es.d.ts +3 -0
- package/dist/translations/es.js +27 -0
- package/dist/translations/index.d.ts +4 -0
- package/dist/translations/pt.d.ts +3 -0
- package/dist/translations/pt.js +27 -0
- package/dist/translations/sv.d.ts +3 -0
- package/dist/translations/sv.js +27 -0
- package/dist/types/jsx/custom-element-jsx.d.ts +2031 -927
- package/dist/types/vue/index.d.ts +357 -324
- package/dist/utilities/localize.d.ts +28 -0
- package/dist/utilities/localize.js +13 -0
- package/dist/vscode.html-custom-data.json +360 -1241
- package/dist/web-types.json +932 -805
- package/package.json +38 -52
- package/dist/components/accordion/accordion.test.d.ts +0 -1
- package/dist/components/checkbox/checkbox.test.d.ts +0 -1
- 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/collapse/collapse.test.d.ts +0 -1
- package/dist/components/date-picker/datepicker.component.js +0 -261
- package/dist/components/date-picker/datepicker.d.ts +0 -10
- package/dist/components/date-picker/datepicker.helpers.js +0 -76
- package/dist/components/date-picker/datepicker.js +0 -8
- package/dist/components/date-picker-input/datepicker-input.component.js +0 -441
- package/dist/components/date-picker-input/datepicker-input.d.ts +0 -8
- package/dist/components/date-picker-input/datepicker-input.js +0 -6
- package/dist/components/input/input.test.d.ts +0 -1
- package/dist/components/menu-item/menu-item.component.d.ts +0 -25
- package/dist/components/menu-item/menu-item.component.js +0 -13
- package/dist/components/menu-item/menu-item.styles.js +0 -19
- package/dist/components/nav-item/nav-item.component.js +0 -38
- package/dist/components/nav-item/nav-item.styles.js +0 -39
- package/dist/components/radio/radio.test.d.ts +0 -1
- package/dist/components/select-option/select-option.component.js +0 -123
- package/dist/components/select-option/select-option.styles.js +0 -53
- package/dist/components/select-option-group/select-option-group.component.js +0 -31
- package/dist/components/select-option-group/select-option-group.style.js +0 -18
- package/dist/components/stepper-item/stepper-item.component.js +0 -113
- package/dist/components/switch/switch.test.d.ts +0 -1
- package/dist/components/tab-group/tab-group.d.ts +0 -8
- package/dist/components/tab-group/tab-group.js +0 -6
- package/dist/components/tab-panel/tab-panel.component.js +0 -36
- package/dist/components/toast-item/toast-item.styles.js +0 -18
- package/dist/internal/constants/heading.d.ts +0 -2
- package/dist/internal/playwright/index.d.ts +0 -1
- /package/dist/components/{breadcrumb-item/breadcrumb-item.styles.d.ts → accordion/accordion-item.styles.d.ts} +0 -0
- /package/dist/components/{breadcrumb-item → breadcrumb}/breadcrumb-item.component.d.ts +0 -0
- /package/dist/components/{date-picker/datepicker.calendar.styles.d.ts → breadcrumb/breadcrumb-item.styles.d.ts} +0 -0
- /package/dist/components/{date-picker/datepicker.styles.d.ts → datepicker/datepicker-calendar.styles.d.ts} +0 -0
- /package/dist/components/{date-picker/datepicker.calendar.styles.js → datepicker/datepicker-calendar.styles.js} +0 -0
- /package/dist/components/{menu-item/menu-item.styles.d.ts → datepicker/datepicker-popup.styles.d.ts} +0 -0
- /package/dist/components/{date-picker-input/datepicker-input.helpers.d.ts → datepicker/datepicker.helpers.d.ts} +0 -0
- /package/dist/components/{date-picker-input/datepicker-input.helpers.js → datepicker/datepicker.helpers.js} +0 -0
- /package/dist/components/{date-picker-input/datepicker-input.styles.d.ts → datepicker/datepicker.styles.d.ts} +0 -0
- /package/dist/components/{date-picker-input/datepicker-input.styles.js → datepicker/datepicker.styles.js} +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/{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/{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.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 → 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/{stepper-item → stepper}/stepper-item.js +0 -0
- /package/dist/components/{tab-group/tab-group.styles.d.ts → stepper/stepper-item.styles.d.ts} +0 -0
- /package/dist/components/{tab-panel → tabs}/tab-panel.js +0 -0
- /package/dist/components/{tab-panel → tabs}/tab-panel.styles.d.ts +0 -0
- /package/dist/components/{tab-panel → tabs}/tab-panel.styles.js +0 -0
- /package/dist/components/{tab → tabs}/tab.js +0 -0
- /package/dist/components/{tab → tabs}/tab.styles.d.ts +0 -0
- /package/dist/components/{toast-wrapper/toast-wrapper.styles.d.ts → tabs/tabs.styles.d.ts} +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-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,7 +1,9 @@
|
|
1
1
|
import '../icon/icon.js';
|
2
2
|
import { FormBase } from '../../internal/components/formBase.js';
|
3
3
|
import '../../internal/components/hint/hint.js';
|
4
|
+
import type { FormFieldSeverity } from '../../internal/types.js';
|
4
5
|
import type { FormFieldBaseProps } from '../../internal/types/formField.js';
|
6
|
+
import { type Language } from '../../utilities/localize.js';
|
5
7
|
import { type CSSResultGroup } from 'lit';
|
6
8
|
interface SkfTextAreaProps extends Omit<FormFieldBaseProps, 'type'> {
|
7
9
|
cols?: number;
|
@@ -14,8 +16,8 @@ interface SkfTextAreaProps extends Omit<FormFieldBaseProps, 'type'> {
|
|
14
16
|
*
|
15
17
|
* @documentation See [zeroheight](https://zeroheight.com/853e936c9/p/143f9d-text-area) for design principles.
|
16
18
|
*
|
17
|
-
* @attribute {boolean} disabled - If true, sets disabled state
|
18
|
-
* @attribute {boolean} required - If true, value is required or must be checked for the form to be submittable
|
19
|
+
* @attribute {boolean} [disabled=false] - If true, sets disabled state
|
20
|
+
* @attribute {boolean} [required=false] - If true, value is required or must be checked for the form to be submittable
|
19
21
|
*
|
20
22
|
* @event change - Fires when the value of the input changes
|
21
23
|
* @event invalid - Fires when the input is invalid
|
@@ -25,7 +27,9 @@ interface SkfTextAreaProps extends Omit<FormFieldBaseProps, 'type'> {
|
|
25
27
|
* @tagname skf-textarea
|
26
28
|
*/
|
27
29
|
export declare class SkfTextArea extends FormBase implements SkfTextAreaProps {
|
30
|
+
#private;
|
28
31
|
static styles: CSSResultGroup;
|
32
|
+
/** @internal */
|
29
33
|
private customError;
|
30
34
|
/** If defined, sets the cols of the textarea */
|
31
35
|
cols?: number;
|
@@ -33,13 +37,15 @@ export declare class SkfTextArea extends FormBase implements SkfTextAreaProps {
|
|
33
37
|
set customInvalid(value: string | undefined);
|
34
38
|
get customInvalid(): string | undefined;
|
35
39
|
/** If true, outputs helping hints in console */
|
36
|
-
debug
|
40
|
+
debug: boolean;
|
37
41
|
/** If true, hides the label visually */
|
38
|
-
hideLabel
|
42
|
+
hideLabel: boolean;
|
39
43
|
/** If defined, displays informational text below the field */
|
40
44
|
hint?: string;
|
41
45
|
/** If defined, sets the input's label unless the default slot is used. Alternatively, you can use the `label` attribute. */
|
42
46
|
label?: string;
|
47
|
+
/** Sets the internal language of the component */
|
48
|
+
lang: Language;
|
43
49
|
/** If defined, adds name to the input-element */
|
44
50
|
name?: string;
|
45
51
|
/** If defined, sets the maximum character length to accept for this input */
|
@@ -49,18 +55,13 @@ export declare class SkfTextArea extends FormBase implements SkfTextAreaProps {
|
|
49
55
|
/** If defined, displays placeholder text */
|
50
56
|
placeholder?: string;
|
51
57
|
/** If true, makes the element not mutable, meaning the user can not edit the control */
|
52
|
-
readonly
|
53
|
-
/** If defined, renders an alternative A11y text for the asterisk */
|
54
|
-
requiredLabel?: string;
|
58
|
+
readonly: boolean;
|
55
59
|
/** If defined, sets the rows of the textarea */
|
56
60
|
rows?: number;
|
57
|
-
/**
|
58
|
-
|
59
|
-
* @type {"success" | "info" | "warning" | "alert"}
|
60
|
-
*/
|
61
|
-
severity?: SkfTextAreaProps['severity'];
|
61
|
+
/** If defined, displays provided severity state */
|
62
|
+
severity?: FormFieldSeverity;
|
62
63
|
/** If true, displays valid state after interaction */
|
63
|
-
showValid
|
64
|
+
showValid: boolean;
|
64
65
|
/** Size of the Textarea */
|
65
66
|
size?: 'sm' | 'md';
|
66
67
|
/** Sets validation start */
|
@@ -1,22 +1,30 @@
|
|
1
|
+
var m = (s) => {
|
2
|
+
throw TypeError(s);
|
3
|
+
};
|
4
|
+
var c = (s, r, t) => r.has(s) || m("Cannot " + t);
|
5
|
+
var y = (s, r, t) => (c(s, r, "read from private field"), t ? t.call(s) : r.get(s)), f = (s, r, t) => r.has(s) ? m("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(s) : r.set(s, t), b = (s, r, t, o) => (c(s, r, "write to private field"), o ? o.call(s, t) : r.set(s, t), t);
|
1
6
|
import "../icon/icon.js";
|
2
|
-
import { FormBase as
|
7
|
+
import { FormBase as $ } from "../../internal/components/formBase.js";
|
3
8
|
import "../../internal/components/hint/hint.js";
|
4
|
-
import {
|
5
|
-
import
|
6
|
-
import {
|
7
|
-
import {
|
8
|
-
import {
|
9
|
-
import
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
9
|
+
import { hintSeverity as E } from "../../internal/helpers/hintSeverity.js";
|
10
|
+
import { Asterisk as _ } from "../../internal/templates/asterisk.js";
|
11
|
+
import { componentStyles as V } from "../../styles/component.styles.js";
|
12
|
+
import { LocalizeController as w } from "../../utilities/localize.js";
|
13
|
+
import { nothing as u, html as g } from "lit";
|
14
|
+
import { property as l, state as x, query as I } from "lit/decorators.js";
|
15
|
+
import { ifDefined as h } from "lit/directives/if-defined.js";
|
16
|
+
import L from "./textarea.styles.js";
|
17
|
+
var A = Object.defineProperty, O = Object.getOwnPropertyDescriptor, e = (s, r, t, o) => {
|
18
|
+
for (var a = o > 1 ? void 0 : o ? O(r, t) : r, n = s.length - 1, d; n >= 0; n--)
|
19
|
+
(d = s[n]) && (a = (o ? d(r, t, a) : d(a)) || a);
|
20
|
+
return o && a && A(r, t, a), a;
|
21
|
+
}, p;
|
22
|
+
const v = class v extends $ {
|
16
23
|
constructor() {
|
17
|
-
super(...arguments)
|
18
|
-
|
19
|
-
|
24
|
+
super(...arguments);
|
25
|
+
f(this, p);
|
26
|
+
b(this, p, new w(this)), this.debug = !1, this.hideLabel = !1, this.lang = "en", this.readonly = !1, this.showValid = !1, this.size = "md", this.validateOn = "change", this.value = "", this.invalid = !1, this._resetValue = (t) => {
|
27
|
+
t.stopPropagation(), this.value = this.getAttribute("value")?.trim() ?? "", this._internals.setFormValue(this.value), this.$input.focus();
|
20
28
|
}, this._handleInput = () => {
|
21
29
|
this.value = this.$input.value || "", this.validateOn === "input" && (this.pristine = !1, this.validateInput());
|
22
30
|
};
|
@@ -38,50 +46,49 @@ const u = class u extends m {
|
|
38
46
|
if (t.has("invalid"))
|
39
47
|
if (this.invalid) {
|
40
48
|
this.setAttribute("invalid", ""), this.showValid || this.removeAttribute("valid");
|
41
|
-
const
|
42
|
-
this.hint =
|
49
|
+
const o = this._internals.validationMessage;
|
50
|
+
this.hint = o !== "" ? this._internals.validationMessage : "unspecified error", this.checkValidity();
|
43
51
|
} else
|
44
52
|
this.removeAttribute("invalid"), !this.pristine && this.showValid && this.setAttribute("valid", "true"), this.hint = this.getAttribute("hint") ?? "";
|
45
53
|
}
|
46
|
-
attributeChangedCallback(t,
|
47
|
-
if (super.attributeChangedCallback(t,
|
54
|
+
attributeChangedCallback(t, o, a) {
|
55
|
+
if (super.attributeChangedCallback(t, o, a), t === "value" && this._internals.setFormValue(a), t === "custom-invalid")
|
48
56
|
if (typeof a == "string") {
|
49
|
-
const
|
50
|
-
this.pristine = !1, this._internals.setValidity({ customError: !0 },
|
57
|
+
const d = this.withFallback(a);
|
58
|
+
this.pristine = !1, this._internals.setValidity({ customError: !0 }, d), this.invalid = !0, this.hint = d, this.checkValidity();
|
51
59
|
} else
|
52
60
|
this._internals.setValidity({}), this.validateInput();
|
53
61
|
}
|
54
62
|
/** @internal */
|
55
63
|
validateInput() {
|
56
64
|
if (this._internals.validity.customError) return;
|
57
|
-
const
|
58
|
-
if (this.invalid = !1,
|
65
|
+
const o = this.$input.validity;
|
66
|
+
if (this.invalid = !1, o.valid)
|
59
67
|
this._internals.setValidity({ customError: this._internals.validity.customError });
|
60
68
|
else {
|
61
|
-
this.invalid = !this.pristine && !
|
69
|
+
this.invalid = !this.pristine && !o.valid;
|
62
70
|
let a;
|
63
|
-
for (a in
|
64
|
-
const
|
65
|
-
if (
|
66
|
-
`Add custom message on ${this.localName} using attribute: ${
|
67
|
-
),
|
71
|
+
for (a in o) {
|
72
|
+
const n = `data-${a.toString()}`;
|
73
|
+
if (o[a] && !this.hasAttribute(n) && this.debug && console.log(
|
74
|
+
`Add custom message on ${this.localName} using attribute: ${n.toUpperCase()}="Your custom message"`
|
75
|
+
), o[a]) {
|
68
76
|
this.validationError = a.toString();
|
69
|
-
const
|
77
|
+
const d = this.hasAttribute(n) ? this.getAttribute(n) : this.$input.validationMessage;
|
70
78
|
this._internals.setValidity(
|
71
79
|
{ [this.validationError]: !0, customError: this._internals.validity.customError },
|
72
|
-
this.withFallback(
|
80
|
+
this.withFallback(d)
|
73
81
|
), this.invalid && this.customErrorDisplay && this.checkValidity();
|
74
82
|
}
|
75
83
|
}
|
76
84
|
}
|
77
85
|
}
|
78
86
|
render() {
|
79
|
-
|
80
|
-
return v`
|
87
|
+
return g`
|
81
88
|
<div id="root">
|
82
89
|
<label>
|
83
90
|
<div class=${this.hideLabel ? "visually-hidden" : ""} id="label">
|
84
|
-
<slot>${this.label}</slot> ${this.required ?
|
91
|
+
<slot>${this.label}</slot> ${this.required ? _(y(this, p).term("required")) : u}
|
85
92
|
</div>
|
86
93
|
<div id="input">
|
87
94
|
<textarea
|
@@ -90,24 +97,25 @@ const u = class u extends m {
|
|
90
97
|
?required=${this.required}
|
91
98
|
.value=${this.value}
|
92
99
|
@input=${this._handleInput}
|
93
|
-
aria-describedby=${
|
94
|
-
aria-errormessage=${
|
100
|
+
aria-describedby=${h(this.hint?.trim() ? "hint" : u)}
|
101
|
+
aria-errormessage=${h(this.hint?.trim() ? "hint" : u)}
|
95
102
|
aria-invalid=${!!this.invalid}
|
96
|
-
cols=${
|
97
|
-
maxlength=${
|
98
|
-
minlength=${
|
99
|
-
name=${
|
100
|
-
placeholder=${
|
101
|
-
rows=${
|
103
|
+
cols=${h(this.cols)}
|
104
|
+
maxlength=${h(this.maxLength)}
|
105
|
+
minlength=${h(this.minLength)}
|
106
|
+
name=${h(this.name)}
|
107
|
+
placeholder=${h(this.placeholder)}
|
108
|
+
rows=${h(this.rows)}
|
102
109
|
>
|
103
110
|
</textarea>
|
104
111
|
</div>
|
105
112
|
</label>
|
106
|
-
${this.hint &&
|
113
|
+
${this.hint && g`
|
107
114
|
<skf-hint
|
115
|
+
?disabled=${this.disabled}
|
108
116
|
aria-live=${this.invalid ? "assertive" : "polite"}
|
109
117
|
id="hint"
|
110
|
-
severity=${
|
118
|
+
severity=${h(E(this.invalid, this.severity))}
|
111
119
|
>
|
112
120
|
${this.customInvalid ?? this.hint}
|
113
121
|
</skf-hint>
|
@@ -116,71 +124,68 @@ const u = class u extends m {
|
|
116
124
|
`;
|
117
125
|
}
|
118
126
|
};
|
119
|
-
|
120
|
-
let i =
|
127
|
+
p = new WeakMap(), v.styles = [V, L];
|
128
|
+
let i = v;
|
121
129
|
e([
|
122
|
-
|
130
|
+
l({ type: Number })
|
123
131
|
], i.prototype, "cols", 2);
|
124
132
|
e([
|
125
|
-
|
133
|
+
l({ attribute: "custom-invalid", reflect: !0 })
|
126
134
|
], i.prototype, "customInvalid", 1);
|
127
135
|
e([
|
128
|
-
|
136
|
+
l({ type: Boolean })
|
129
137
|
], i.prototype, "debug", 2);
|
130
138
|
e([
|
131
|
-
|
139
|
+
l({ type: Boolean, attribute: "hide-label" })
|
132
140
|
], i.prototype, "hideLabel", 2);
|
133
141
|
e([
|
134
|
-
|
142
|
+
l()
|
135
143
|
], i.prototype, "hint", 2);
|
136
144
|
e([
|
137
|
-
|
145
|
+
l()
|
138
146
|
], i.prototype, "label", 2);
|
139
147
|
e([
|
140
|
-
|
148
|
+
l({ type: String })
|
149
|
+
], i.prototype, "lang", 2);
|
150
|
+
e([
|
151
|
+
l()
|
141
152
|
], i.prototype, "name", 2);
|
142
153
|
e([
|
143
|
-
|
154
|
+
l({ type: Number, attribute: "maxlength" })
|
144
155
|
], i.prototype, "maxLength", 2);
|
145
156
|
e([
|
146
|
-
|
157
|
+
l({ type: Number, attribute: "minlength" })
|
147
158
|
], i.prototype, "minLength", 2);
|
148
159
|
e([
|
149
|
-
|
160
|
+
l()
|
150
161
|
], i.prototype, "placeholder", 2);
|
151
162
|
e([
|
152
|
-
|
163
|
+
l({ type: Boolean })
|
153
164
|
], i.prototype, "readonly", 2);
|
154
165
|
e([
|
155
|
-
|
156
|
-
], i.prototype, "requiredLabel", 2);
|
157
|
-
e([
|
158
|
-
r({ type: Number })
|
166
|
+
l({ type: Number })
|
159
167
|
], i.prototype, "rows", 2);
|
160
168
|
e([
|
161
|
-
|
169
|
+
l()
|
162
170
|
], i.prototype, "severity", 2);
|
163
171
|
e([
|
164
|
-
|
172
|
+
l({ type: Boolean, attribute: "show-valid" })
|
165
173
|
], i.prototype, "showValid", 2);
|
166
174
|
e([
|
167
|
-
|
175
|
+
l({ reflect: !0 })
|
168
176
|
], i.prototype, "size", 2);
|
169
177
|
e([
|
170
|
-
|
178
|
+
l({ attribute: "validate-on" })
|
171
179
|
], i.prototype, "validateOn", 2);
|
172
180
|
e([
|
173
|
-
|
181
|
+
l()
|
174
182
|
], i.prototype, "value", 2);
|
175
183
|
e([
|
176
|
-
|
184
|
+
x()
|
177
185
|
], i.prototype, "invalid", 2);
|
178
186
|
e([
|
179
|
-
|
187
|
+
I("textarea")
|
180
188
|
], i.prototype, "$input", 2);
|
181
|
-
function _(h, t) {
|
182
|
-
return t ? "error" : h;
|
183
|
-
}
|
184
189
|
export {
|
185
190
|
i as SkfTextArea
|
186
191
|
};
|
@@ -0,0 +1,21 @@
|
|
1
|
+
import { css as o } from "lit";
|
2
|
+
const e = o`
|
3
|
+
@layer components {
|
4
|
+
@layer overrides {
|
5
|
+
:host {
|
6
|
+
overflow: hidden; /* Enable mask transition */
|
7
|
+
padding-block-end: 3px; /* Make room for box-shadow */
|
8
|
+
}
|
9
|
+
|
10
|
+
#root {
|
11
|
+
--_skf-alert-bg-color: var(--skf-bg-color-neutral-1);
|
12
|
+
|
13
|
+
/* stylelint-disable-next-line csstools/value-no-unknown-custom-properties */
|
14
|
+
border-inline-start: var(--skf-size-8) solid var(--_skf-alert-border-color);
|
15
|
+
}
|
16
|
+
}
|
17
|
+
}
|
18
|
+
`;
|
19
|
+
export {
|
20
|
+
e as default
|
21
|
+
};
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { SkfElement as h } from "../../internal/components/skf-element.js";
|
2
|
-
import d from "../../styles/component.styles.js";
|
2
|
+
import { componentStyles as d } from "../../styles/component.styles.js";
|
3
3
|
import { html as m } from "lit";
|
4
4
|
import { property as p, queryAssignedElements as a } from "lit/decorators.js";
|
5
5
|
import { styles as u } from "./toast-wrapper.styles.js";
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare const styles: import("lit").CSSResult;
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import type { SkfAlert } from '../alert/alert.component.js';
|
2
1
|
import { SkfElement } from '../../internal/components/skf-element';
|
2
|
+
import type { Icon, Severity } from '../../internal/types.js';
|
3
3
|
import { type CSSResultGroup } from 'lit';
|
4
4
|
/**
|
5
5
|
* SkfToast is the only component a user (developer) interacts with to create a toast notification. Once rendered it will invoke a singleton instance to manage the toast notifications.
|
@@ -18,14 +18,15 @@ import { type CSSResultGroup } from 'lit';
|
|
18
18
|
*/
|
19
19
|
export declare class SkfToast extends SkfElement {
|
20
20
|
static styles: CSSResultGroup;
|
21
|
+
/** @internal */
|
21
22
|
private _singleton?;
|
22
23
|
debug: boolean;
|
23
24
|
/** If defined, displays leading icon */
|
24
|
-
icon?:
|
25
|
+
icon?: Icon;
|
25
26
|
/** If true, renders with an close button and sets aria-role to `status` */
|
26
|
-
persistent:
|
27
|
+
persistent: boolean;
|
27
28
|
/** If defined, gives the supplied appearance */
|
28
|
-
severity:
|
29
|
+
severity: Severity;
|
29
30
|
/** Time in seconds before the toast disappears. */
|
30
31
|
timer: number;
|
31
32
|
/** offsets where toasts emerge vertically */
|
@@ -1,25 +1,25 @@
|
|
1
|
-
import {
|
2
|
-
import { SkfElement as d } from "../../internal/components/skf-element.js";
|
1
|
+
import { SkfElement as l } from "../../internal/components/skf-element.js";
|
3
2
|
import { html as f } from "lit";
|
4
|
-
import { property as
|
3
|
+
import { property as i, queryAssignedNodes as y } from "lit/decorators.js";
|
4
|
+
import { SkfToastSingleton as d } from "./toast.singleton.js";
|
5
5
|
import { styles as a } from "./toast.styles.js";
|
6
|
-
var u = Object.defineProperty, e = (n,
|
7
|
-
for (var
|
8
|
-
(
|
9
|
-
return
|
6
|
+
var u = Object.defineProperty, e = (n, r, m, g) => {
|
7
|
+
for (var s = void 0, o = n.length - 1, h; o >= 0; o--)
|
8
|
+
(h = n[o]) && (s = h(r, m, s) || s);
|
9
|
+
return s && u(r, m, s), s;
|
10
10
|
};
|
11
|
-
const p = class p extends
|
11
|
+
const p = class p extends l {
|
12
12
|
constructor() {
|
13
13
|
super(), this.debug = !1, this.persistent = !1, this.severity = "info", this.timer = 5, this._singleton = void 0;
|
14
14
|
}
|
15
15
|
firstUpdated() {
|
16
|
-
this._singleton = new
|
16
|
+
this._singleton = new d(), this._singleton.addData({
|
17
17
|
debug: this.debug,
|
18
18
|
icon: this.icon,
|
19
19
|
originEl: this,
|
20
20
|
persistent: this.persistent,
|
21
21
|
severity: this.severity,
|
22
|
-
text: this._slottedText.map((
|
22
|
+
text: this._slottedText.map((r) => r.textContent).join(),
|
23
23
|
timer: this.timer = this.timer && this.timer < 5 ? 5 : this.timer,
|
24
24
|
topOffset: this.topOffset
|
25
25
|
});
|
@@ -31,22 +31,22 @@ const p = class p extends d {
|
|
31
31
|
p.styles = [a];
|
32
32
|
let t = p;
|
33
33
|
e([
|
34
|
-
|
34
|
+
i({ type: Boolean })
|
35
35
|
], t.prototype, "debug");
|
36
36
|
e([
|
37
|
-
|
37
|
+
i()
|
38
38
|
], t.prototype, "icon");
|
39
39
|
e([
|
40
|
-
|
40
|
+
i({ type: Boolean })
|
41
41
|
], t.prototype, "persistent");
|
42
42
|
e([
|
43
|
-
|
43
|
+
i()
|
44
44
|
], t.prototype, "severity");
|
45
45
|
e([
|
46
|
-
|
46
|
+
i({ type: Number })
|
47
47
|
], t.prototype, "timer");
|
48
48
|
e([
|
49
|
-
|
49
|
+
i({ type: Number })
|
50
50
|
], t.prototype, "topOffset");
|
51
51
|
e([
|
52
52
|
y()
|
@@ -1,16 +1,16 @@
|
|
1
|
-
import '
|
2
|
-
import '
|
3
|
-
import type { SkfToast } from '
|
1
|
+
import './toast-item.js';
|
2
|
+
import './toast-wrapper.js';
|
3
|
+
import type { SkfToast } from './toast.component.js';
|
4
4
|
interface ToastData extends Pick<SkfToast, 'debug' | 'icon' | 'persistent' | 'severity' | 'timer' | 'topOffset'> {
|
5
5
|
originEl: SkfToast;
|
6
6
|
text: string;
|
7
7
|
}
|
8
|
-
export declare class
|
8
|
+
export declare class SkfToastSingleton {
|
9
9
|
private static instance?;
|
10
10
|
data: ToastData[];
|
11
11
|
root: Document;
|
12
12
|
usePopover: boolean;
|
13
|
-
constructor(
|
13
|
+
constructor();
|
14
14
|
hasToasts(): boolean;
|
15
15
|
popToast(): ToastData | undefined;
|
16
16
|
getData(): ToastData[];
|
@@ -1,10 +1,10 @@
|
|
1
|
-
import "
|
2
|
-
import "
|
3
|
-
class
|
4
|
-
constructor(
|
5
|
-
if (this.data = [], this.root =
|
1
|
+
import "./toast-item.js";
|
2
|
+
import "./toast-wrapper.js";
|
3
|
+
class s {
|
4
|
+
constructor() {
|
5
|
+
if (this.data = [], this.root = globalThis.document, this.usePopover = !0, this.root.nodeType !== Node.DOCUMENT_NODE)
|
6
6
|
throw new Error("Root node must be a document node");
|
7
|
-
return
|
7
|
+
return s.instance || (s.instance = this), s.instance;
|
8
8
|
}
|
9
9
|
hasToasts() {
|
10
10
|
return this.data.length > 0;
|
@@ -15,39 +15,38 @@ class r {
|
|
15
15
|
getData() {
|
16
16
|
return this.data;
|
17
17
|
}
|
18
|
-
setData(
|
19
|
-
this.data =
|
18
|
+
setData(o) {
|
19
|
+
this.data = o;
|
20
20
|
}
|
21
|
-
addData(
|
22
|
-
this.data = [...this.data,
|
21
|
+
addData(o) {
|
22
|
+
this.data = [...this.data, o], this.udpateUI();
|
23
23
|
}
|
24
24
|
udpateUI() {
|
25
|
-
const
|
26
|
-
this.usePopover &&
|
27
|
-
function
|
28
|
-
const
|
29
|
-
for (;
|
30
|
-
const t =
|
25
|
+
const o = p(this.root, this.usePopover);
|
26
|
+
this.usePopover && o.showPopover(), n();
|
27
|
+
function n() {
|
28
|
+
const i = new s();
|
29
|
+
for (; i.hasToasts(); ) {
|
30
|
+
const t = i.popToast();
|
31
31
|
if (!t) return;
|
32
|
-
t.debug && (
|
33
|
-
const
|
34
|
-
|
32
|
+
t.debug && (o.debug = !0);
|
33
|
+
const e = document.createElement("skf-toast-item");
|
34
|
+
e.className = "toast-item", e.timer = t.timer, e.severity = t.severity, e.icon = t.icon, t.persistent && e.setAttribute("persistent", "true"), e.originEl = t.originEl, e.innerText = String(t.text);
|
35
35
|
const a = document.createElement("div");
|
36
|
-
a.classList.add("toast-item-wrapper"), a.appendChild(
|
36
|
+
a.classList.add("toast-item-wrapper"), a.appendChild(e), o.prepend(a);
|
37
37
|
}
|
38
38
|
}
|
39
|
-
function
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
t && s.setAttribute("popover", "auto"), a && s.setAttribute("top-offset", a.toString()), document.body.appendChild(s);
|
39
|
+
function p(i, t) {
|
40
|
+
const a = new s().getData()[0]?.topOffset ?? null;
|
41
|
+
let r = i.querySelector("body")?.querySelector("skf-toast-wrapper");
|
42
|
+
if (!r) {
|
43
|
+
if (r = document.createElement("skf-toast-wrapper"), !r) throw new Error("Could not create toast wrapper element");
|
44
|
+
t && r.setAttribute("popover", "auto"), a && r.setAttribute("top-offset", a.toString()), document.body.appendChild(r);
|
46
45
|
}
|
47
|
-
return
|
46
|
+
return r;
|
48
47
|
}
|
49
48
|
}
|
50
49
|
}
|
51
50
|
export {
|
52
|
-
|
51
|
+
s as SkfToastSingleton
|
53
52
|
};
|
@@ -8,8 +8,11 @@ import type { CSSResultGroup } from 'lit';
|
|
8
8
|
* @attribute {"top" | "right" | "bottom" | "left" | "top-start" | "top-end" | "right-start" | "right-end" | "bottom-start" | "bottom-end" | "left-start" | "left-end"} [placement='bottom-start'] - The placement of the dropdown
|
9
9
|
* @attribute {string} [anchor] - The id of the element the dropdown will be anchored to
|
10
10
|
*
|
11
|
-
* @
|
12
|
-
* @
|
11
|
+
* @property {(void) => void} open() - Method that opens the tooltip
|
12
|
+
* @property {(void) => void} close() - Method that closes the tooltip
|
13
|
+
*
|
14
|
+
* @event {CustomEvent} skf-opened - Fired when the tooltip is opened
|
15
|
+
* @event {CustomEvent} skf-closed - Fired when the tooltip is closed
|
13
16
|
*
|
14
17
|
* @slot - The tooltip popover content
|
15
18
|
*
|
@@ -18,6 +21,11 @@ import type { CSSResultGroup } from 'lit';
|
|
18
21
|
export declare class SkfTooltip extends SkfPopoverBase {
|
19
22
|
static styles: CSSResultGroup;
|
20
23
|
constructor();
|
24
|
+
connectedCallback(): void;
|
25
|
+
/** @internal */
|
26
|
+
openExtended(): void;
|
27
|
+
/** @internal */
|
28
|
+
closeExtended(): void;
|
29
|
+
/** @internal */
|
21
30
|
addEventListeners($element: HTMLElement | Element): void;
|
22
|
-
removeEventListeners($element: HTMLElement | Element): void;
|
23
31
|
}
|
@@ -1,18 +1,27 @@
|
|
1
|
-
import { styles as
|
2
|
-
import { SkfPopoverBase as
|
3
|
-
const
|
1
|
+
import { styles as a } from "./tooltip.styles.js";
|
2
|
+
import { SkfPopoverBase as t } from "../../internal/base-classes/popover/popover.base.js";
|
3
|
+
const e = class e extends t {
|
4
4
|
constructor() {
|
5
|
-
super(), this.arrow = !0, this.offset = 8, this.placement = "top",
|
5
|
+
super(), this.arrow = !0, this.offset = 8, this.placement = "top", this.variant = "tooltip", t.classMap = { tooltip: !0 };
|
6
6
|
}
|
7
|
+
connectedCallback() {
|
8
|
+
super.connectedCallback(), this.role = "tooltip";
|
9
|
+
}
|
10
|
+
/** @internal */
|
11
|
+
openExtended() {
|
12
|
+
this.$anchor?.setAttribute("aria-describedby", this.id);
|
13
|
+
}
|
14
|
+
/** @internal */
|
15
|
+
closeExtended() {
|
16
|
+
this.$anchor?.removeAttribute("aria-describedby");
|
17
|
+
}
|
18
|
+
/** @internal */
|
7
19
|
addEventListeners(s) {
|
8
20
|
s.addEventListener("blur", this.close, { signal: this.signal }), s.addEventListener("focus", this.open, { signal: this.signal }), s.addEventListener("mouseenter", this.open, { signal: this.signal }), s.addEventListener("mouseleave", this.close, { signal: this.signal });
|
9
21
|
}
|
10
|
-
removeEventListeners(s) {
|
11
|
-
s.addEventListener("blur", this.close), s.addEventListener("focus", this.open), s.removeEventListener("mouseenter", this.open), s.removeEventListener("mouseleave", this.close);
|
12
|
-
}
|
13
22
|
};
|
14
|
-
|
15
|
-
let i =
|
23
|
+
e.styles = [t.styles, a];
|
24
|
+
let i = e;
|
16
25
|
export {
|
17
26
|
i as SkfTooltip
|
18
27
|
};
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import { SkfTooltip } from './tooltip.component';
|
2
|
-
export * from './tooltip.component';
|
1
|
+
import { SkfTooltip } from './tooltip.component.js';
|
2
|
+
export * from './tooltip.component.js';
|
3
3
|
export default SkfTooltip;
|
4
4
|
declare global {
|
5
5
|
interface HTMLElementTagNameMap {
|