@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,76 +0,0 @@
|
|
1
|
-
import { is as c } from "../date-picker-input/datepicker-input.helpers.js";
|
2
|
-
import { Temporal as e } from "@js-temporal/polyfill";
|
3
|
-
function I(t, n, s) {
|
4
|
-
const o = (r) => Array.isArray(r) ? r : [r], f = o(t);
|
5
|
-
n = o(n);
|
6
|
-
const a = [];
|
7
|
-
for (const r of f) {
|
8
|
-
const { promise: i, resolve: m, reject: p } = Promise.withResolvers(), l = r.animate(n, {
|
9
|
-
fill: "forwards",
|
10
|
-
duration: 300,
|
11
|
-
iterations: 1,
|
12
|
-
...s
|
13
|
-
});
|
14
|
-
l.onfinish = () => m("finished"), l.oncancel = () => p("canceled"), a.push(i);
|
15
|
-
}
|
16
|
-
return Promise.allSettled(a);
|
17
|
-
}
|
18
|
-
function P(t = e.Now.plainDateISO()) {
|
19
|
-
return t ?? (t = e.Now.plainDateISO()), t instanceof Date && (t = e.PlainDate.from(t.toISOString())), typeof t == "string" && (t = e.PlainDate.from(S(t, !0))), {
|
20
|
-
year: t.year,
|
21
|
-
month: t.month - 1,
|
22
|
-
// new Date is 0 based
|
23
|
-
day: t.day
|
24
|
-
};
|
25
|
-
}
|
26
|
-
function v(t, n, s = "days") {
|
27
|
-
console.assert(c(t, n).plainISO(), "Invalid dates passed to compareDates()"), typeof t == "string" && (t = e.PlainDate.from(t)), typeof n == "string" && (n = e.PlainDate.from(n)), console.assert(
|
28
|
-
c(t, n).plain(),
|
29
|
-
`Invalid date was sent to helper function compareDates(). Got ${JSON.stringify(t)} and ${JSON.stringify(n)} passed in`
|
30
|
-
);
|
31
|
-
const o = D(t, n, s);
|
32
|
-
return f(o);
|
33
|
-
function f(a) {
|
34
|
-
return Math.max(-1, Math.min(a, 1));
|
35
|
-
}
|
36
|
-
}
|
37
|
-
function D(t, n, s = "days") {
|
38
|
-
return typeof t == "string" && (t = e.PlainDate.from(t)), typeof n == "string" && (n = e.PlainDate.from(n)), console.assert(
|
39
|
-
t instanceof e.PlainDate && n instanceof e.PlainDate,
|
40
|
-
`Invalid date was sent to helper function timeBetween(). Got ${JSON.stringify(t)} and ${JSON.stringify(n)} passed in`
|
41
|
-
), s === "months" ? n.until(t, { largestUnit: "months" }).months : s === "years" ? n.until(t, { largestUnit: "years" }).years : n.until(t, { largestUnit: "days" }).days;
|
42
|
-
}
|
43
|
-
function u(...t) {
|
44
|
-
if (t.length === 0)
|
45
|
-
throw new Error("At least one date must be provided");
|
46
|
-
const n = (i) => i instanceof Date, s = t.map((i) => n(i) ? i : new Date(i));
|
47
|
-
if (s.length === 1)
|
48
|
-
return s[0].toISOString().split("T")[0];
|
49
|
-
const [o, ...f] = s, a = u(...f), r = new Date(a);
|
50
|
-
return o < r ? o.toISOString().split("T")[0] : r.toISOString().split("T")[0];
|
51
|
-
}
|
52
|
-
function g(...t) {
|
53
|
-
if (t.length === 0)
|
54
|
-
throw new Error("At least one date must be provided");
|
55
|
-
const n = (i) => i instanceof Date, s = t.map((i) => n(i) ? i : new Date(i));
|
56
|
-
if (s.length === 1)
|
57
|
-
return s[0].toISOString().split("T")[0];
|
58
|
-
const [o, ...f] = s, a = g(...f), r = new Date(a);
|
59
|
-
return o > r ? o.toISOString().split("T")[0] : r.toISOString().split("T")[0];
|
60
|
-
}
|
61
|
-
function S(t, n = !1) {
|
62
|
-
t instanceof Date && (t = e.PlainDate.from(t.toISOString())), typeof t != "string" && (t = t.toString());
|
63
|
-
const s = /^\d{4}-\d{2}-\d{2}$/;
|
64
|
-
if (!s.test(t) && n)
|
65
|
-
throw new Error(`Invalid date format. Got ${t} passed in.`);
|
66
|
-
return s.test(t) ? t : "";
|
67
|
-
}
|
68
|
-
export {
|
69
|
-
S as assertISODate,
|
70
|
-
v as compareDates,
|
71
|
-
I as doAnimate,
|
72
|
-
u as earliestDate,
|
73
|
-
P as getDateParts,
|
74
|
-
g as latestDate,
|
75
|
-
D as timeBetween
|
76
|
-
};
|
@@ -1,8 +0,0 @@
|
|
1
|
-
import { SkfDatePickerCalendar as e } from "./datepicker.calendar.component.js";
|
2
|
-
import { SkfDatePicker as r } from "./datepicker.component.js";
|
3
|
-
r.define("skf-datepicker");
|
4
|
-
e.define("skf-datepicker-calendar");
|
5
|
-
export {
|
6
|
-
r as SkfDatePicker,
|
7
|
-
r as default
|
8
|
-
};
|
@@ -1,441 +0,0 @@
|
|
1
|
-
import { dateFormatter as v, is as f, isPopoverOpen as S, debounce as E } from "./datepicker-input.helpers.js";
|
2
|
-
import "../icon/icon.js";
|
3
|
-
import { computePosition as C, flip as I, offset as O } from "@floating-ui/dom";
|
4
|
-
import { FormBase as M } from "../../internal/components/formBase.js";
|
5
|
-
import { PopoverController as P } from "../../internal/controllers/popover.controller.js";
|
6
|
-
import { hintSeverity as T } from "../../internal/helpers/hintSeverity.js";
|
7
|
-
import { watch as B } from "../../internal/helpers/watch.js";
|
8
|
-
import { Asterisk as x } from "../../internal/templates/asterisk.js";
|
9
|
-
import { Temporal as w } from "@js-temporal/polyfill";
|
10
|
-
import L from "../../styles/component.styles.js";
|
11
|
-
import { nothing as g, html as y } from "lit";
|
12
|
-
import { property as h, state as $, query as b, queryAssignedNodes as R } from "lit/decorators.js";
|
13
|
-
import { ifDefined as p } from "lit/directives/if-defined.js";
|
14
|
-
import { live as F } from "lit/directives/live.js";
|
15
|
-
import "../date-picker/datepicker.js";
|
16
|
-
import { styles as A } from "./datepicker-input.styles.js";
|
17
|
-
var j = Object.defineProperty, q = Object.getOwnPropertyDescriptor, r = (D, e, t, a) => {
|
18
|
-
for (var l = a > 1 ? void 0 : a ? q(e, t) : e, n = D.length - 1, d; n >= 0; n--)
|
19
|
-
(d = D[n]) && (l = (a ? d(e, t, l) : d(l)) || l);
|
20
|
-
return a && l && j(e, t, l), l;
|
21
|
-
};
|
22
|
-
const _ = class _ extends M {
|
23
|
-
constructor() {
|
24
|
-
super(), this.popoverController = new P(this), this.id = "skf-datepicker-input", this.placeholder = "YYYY-MM-DD", this.range = !1, this.size = "md", this.validateOn = "change", this.invalid = !1, this.selectedRangeDates = { start: null, end: null }, this.showClearbutton = !1, this.abortController = new AbortController(), this.abortSignal = this.abortController.signal, this._handleSelectedDate = () => {
|
25
|
-
this.pristine = !1, this._internals.setFormValue(this.value ?? ""), this.validateInput();
|
26
|
-
}, this._handleDateSelected = (e) => {
|
27
|
-
if (this.range && "start" in e.detail.date && "end" in e.detail.date) {
|
28
|
-
const t = e.detail.date.start, a = e.detail.date.end;
|
29
|
-
this.value = `${v(t)},${v(a)}`, this.selectedRangeDates = { start: t, end: a };
|
30
|
-
} else !this.range && e.detail.date instanceof Date && (this.value = v(e.detail.date), this._animatePopover({ el: this.$popover, show: !1 }).then(() => {
|
31
|
-
this.$popover.hidePopover();
|
32
|
-
}));
|
33
|
-
}, this._handleKeyboardEvents = (e) => {
|
34
|
-
var a, l;
|
35
|
-
const t = e.target.closest("input");
|
36
|
-
if (t) {
|
37
|
-
if ((t.selectionStart ?? 0) < t.value.length && /[[0-9-]/.test(e.key)) {
|
38
|
-
const n = t.selectionStart ?? 0, u = t.value.split("").slice(0, n);
|
39
|
-
t.value = u.join("");
|
40
|
-
}
|
41
|
-
if (t.name.endsWith("-end") && (e.key === "Backspace" && t.value.length === 0 || t.selectionStart === 0 && e.key === "ArrowLeft") && (e.preventDefault(), this.$input.focus()), e.key === "Tab" && !e.shiftKey && t.name.endsWith("-end")) {
|
42
|
-
e.preventDefault();
|
43
|
-
const d = (a = this.$popover.childNodes[1].shadowRoot) == null ? void 0 : a.querySelector("skf-datepicker-calendar"), u = (l = d == null ? void 0 : d.shadowRoot) == null ? void 0 : l.querySelector("button");
|
44
|
-
u == null || u.focus();
|
45
|
-
}
|
46
|
-
if ((t.value.length === 4 || t.value.length === 7) && /[[0-9]/.test(e.key) && (t.value = `${t.value}-${e.key}`, e.preventDefault()), e.key === "Escape")
|
47
|
-
if (t.blur(), this.$popover.hidePopover(), this.range) {
|
48
|
-
const n = this.$input.value, d = this.$input_range_end.value;
|
49
|
-
if (!f(n, d).date()) return;
|
50
|
-
this.$datepicker.selectedDateRange = {
|
51
|
-
start: new Date(n),
|
52
|
-
end: new Date(d)
|
53
|
-
}, this.$datepicker.emit("selected-date-changed", {
|
54
|
-
detail: { date: new Date(n) }
|
55
|
-
});
|
56
|
-
} else {
|
57
|
-
if (!t.value || !f(t.value).date()) return;
|
58
|
-
this.$datepicker.emit("selected-date-changed", {
|
59
|
-
detail: { date: new Date(t.value) }
|
60
|
-
});
|
61
|
-
}
|
62
|
-
e.key === "Enter" && (t.blur(), this.$popover.hidePopover());
|
63
|
-
}
|
64
|
-
}, this._handleFocus = () => {
|
65
|
-
this.showPopover();
|
66
|
-
}, this.showPopover = () => {
|
67
|
-
if (S(this.$popover)) return;
|
68
|
-
E(() => {
|
69
|
-
this.$popover.showPopover(), this._animatePopover({ show: !0 });
|
70
|
-
}, 200)(), this.addEventListener("focusout", this.hidePopover, { once: !0, signal: this.abortSignal });
|
71
|
-
}, this.hidePopover = () => {
|
72
|
-
var t;
|
73
|
-
this.removeEventListener("focusout", this.hidePopover), ((t = document.activeElement) == null ? void 0 : t.closest("skf-datepicker-input")) !== this && this.$popover.hidePopover();
|
74
|
-
}, this._handleBlur = (e) => {
|
75
|
-
!e.target.name.endsWith("-end") && this.range;
|
76
|
-
}, this._handleClose = () => {
|
77
|
-
this.$anchor.blur();
|
78
|
-
}, this.clearInput = () => {
|
79
|
-
this.value = "", this.$datepicker.clearSelection();
|
80
|
-
}, this.clear = () => {
|
81
|
-
this.clearInput(), this._toggleClearButton(!1);
|
82
|
-
}, this._handleInput = (e) => {
|
83
|
-
const t = e.target, a = String(t.value).replace(/[^0-9-]/g, "");
|
84
|
-
if (t.value = a, t.setCustomValidity(this.customError ?? ""), !!f(t.value).ISO()) {
|
85
|
-
if (this.focusTimeoutId && clearTimeout(this.focusTimeoutId), this.$datepicker.date = t.value, this.range) {
|
86
|
-
this.$datepicker.selectedDateRange = {
|
87
|
-
start: f(this.$input.value).ISO() ? new Date(this.$input.value) : null,
|
88
|
-
end: f(this.$input_range_end.value).ISO() ? new Date(this.$input_range_end.value) : null
|
89
|
-
};
|
90
|
-
const l = Object.values(this.$datepicker.selectedDateRange).filter(Boolean).map((n) => new Date(n).toLocaleDateString("en-CA")).join();
|
91
|
-
this.value = l, f(this.$input.value).ISO() && (this.focusTimeoutId = setTimeout(() => {
|
92
|
-
this.$input_range_end.focus();
|
93
|
-
}, 200));
|
94
|
-
} else
|
95
|
-
this.$datepicker.selectedDate = new Date(t.value), this.$datepicker.emit("selected-date-changed", {
|
96
|
-
detail: { date: new Date(t.value) }
|
97
|
-
});
|
98
|
-
this.validateOn === "input" && (this._pristine = !1, this.validateInput());
|
99
|
-
}
|
100
|
-
}, this._toggleClearButton = (e = !1) => {
|
101
|
-
this.showClearbutton = e;
|
102
|
-
}, this.reposition = async () => {
|
103
|
-
const { x: e, y: t } = await C(this.$anchor, this.$popover, {
|
104
|
-
placement: "bottom-start",
|
105
|
-
middleware: [I(), O(0)],
|
106
|
-
strategy: "fixed"
|
107
|
-
});
|
108
|
-
Object.assign(this.$popover.style, {
|
109
|
-
left: `${String(e)}px`,
|
110
|
-
top: `${String(t)}px`
|
111
|
-
});
|
112
|
-
}, this.addEventListener("skf-datepicker-selected", this._handleDateSelected), this.addEventListener("reset", () => {
|
113
|
-
this.clearInput(), this.validateInput();
|
114
|
-
});
|
115
|
-
}
|
116
|
-
set customInvalid(e) {
|
117
|
-
this.customError = e ?? "";
|
118
|
-
}
|
119
|
-
get customInvalid() {
|
120
|
-
return this.customError;
|
121
|
-
}
|
122
|
-
connectedCallback() {
|
123
|
-
var e;
|
124
|
-
super.connectedCallback(), this._init_date = (e = this.value) == null ? void 0 : e.split(",")[0], this.addEventListener("selected-date-changed", this._handleSelectedDate);
|
125
|
-
}
|
126
|
-
disconnectedCallback() {
|
127
|
-
super.disconnectedCallback(), this.abortController.abort();
|
128
|
-
}
|
129
|
-
firstUpdated() {
|
130
|
-
var e;
|
131
|
-
this.$datepicker.date = this._init_date ? w.PlainDate.from(this._init_date).toString() : w.Now.plainDateISO().toString(), this.range ? this.$datepicker.selectedDateRange = {
|
132
|
-
start: this._init_date ? new Date(this._init_date) : null,
|
133
|
-
end: (e = this.value) != null && e.split(",")[1] ? new Date(this.value.split(",")[1]) : null
|
134
|
-
} : this.$datepicker.selectedDate = this._init_date ? new Date(this._init_date) : void 0, this.hint && !this.hasAttribute("hint") && this.setAttribute("hint", this.hint), this.validateInput();
|
135
|
-
}
|
136
|
-
attributeChangedCallback(e, t, a) {
|
137
|
-
if (super.attributeChangedCallback(e, t, a), e === "custom-invalid")
|
138
|
-
if (typeof a == "string") {
|
139
|
-
const n = this.withFallback(a);
|
140
|
-
this._pristine = !1, this._internals.setValidity({ customError: !0 }, n), this.invalid = !0, this.hint = n, this.checkValidity();
|
141
|
-
} else
|
142
|
-
this._internals.setValidity({}), this.validateInput();
|
143
|
-
}
|
144
|
-
_handleValueChange() {
|
145
|
-
var e, t, a, l, n, d, u, i;
|
146
|
-
(e = this.value) != null && e.trim() || this.$datepicker.clearSelection(), this._internals.setFormValue(this.value ?? ""), this.validateInput(), this._pristine = !1, this.$input.value = v((t = this.value) == null ? void 0 : t.split(",")[0]), this.range ? (this.$datepicker.selectedDateRange = {
|
147
|
-
start: (n = this.value) != null && n.split(",")[0] ? new Date(this.value.split(",")[0]) : null,
|
148
|
-
end: (d = this.value) != null && d.split(",")[1] ? new Date(this.value.split(",")[1]) : null
|
149
|
-
}, this.$input_range_end.value = v((u = this.value) == null ? void 0 : u.split(",")[1]), this.$datepicker.date = ((i = this.value) == null ? void 0 : i.split(",")[0]) ?? "") : (this.$datepicker.selectedDate = (a = this.value) != null && a.split(",")[0] ? new Date(this.value.split(",")[0]) : void 0, this.$datepicker.date = ((l = this.value) == null ? void 0 : l.split(",")[0]) ?? ""), this.validateInput();
|
150
|
-
}
|
151
|
-
/** @internal */
|
152
|
-
async _animatePopover({ el: e = this.$popover, show: t }) {
|
153
|
-
return t && (e.style.opacity = "0", e.style.transform = "scaleY(0.5)"), new Promise((a) => {
|
154
|
-
const l = [
|
155
|
-
{ opacity: 0, transform: "scaleY(0.5)" },
|
156
|
-
{ opacity: 1, transform: "scaleY(1)" }
|
157
|
-
], n = t ? l : l.reverse();
|
158
|
-
setTimeout(
|
159
|
-
() => {
|
160
|
-
e.style.transformOrigin = "top";
|
161
|
-
const d = this.$popover.animate(n, {
|
162
|
-
duration: 100,
|
163
|
-
easing: "linear",
|
164
|
-
fill: "both"
|
165
|
-
});
|
166
|
-
d.onfinish = () => {
|
167
|
-
a();
|
168
|
-
};
|
169
|
-
},
|
170
|
-
t ? 0 : 50
|
171
|
-
);
|
172
|
-
});
|
173
|
-
}
|
174
|
-
/** @internal consider sharing this functionality with input */
|
175
|
-
validateInput() {
|
176
|
-
if (this._internals.validity.customError) return;
|
177
|
-
let t = JSON.parse(JSON.stringify(this._internals.validity)), a = {};
|
178
|
-
if (this.selectableFrom) {
|
179
|
-
const { validityFragment: i, errorMessageFragment: o } = l(this);
|
180
|
-
t = { ...t, ...i }, a = { ...a, ...o };
|
181
|
-
}
|
182
|
-
if (this.selectableTo) {
|
183
|
-
const { validityFragment: i, errorMessageFragment: o } = n(this);
|
184
|
-
t = { ...t, ...i }, a = { ...a, ...o };
|
185
|
-
}
|
186
|
-
if (this.range) {
|
187
|
-
const { validityFragment: i, errorMessageFragment: o } = d(this);
|
188
|
-
t = { ...t, ...i }, a = { ...a, ...o };
|
189
|
-
}
|
190
|
-
if (this.required) {
|
191
|
-
const { validityFragment: i, errorMessageFragment: o } = u(this);
|
192
|
-
t = { ...t, ...i }, a = { ...a, ...o };
|
193
|
-
}
|
194
|
-
if (t.valid = !Object.values(t).some((i) => i), this.invalid = !1, t.valid)
|
195
|
-
this._internals.setValidity({ customError: this._internals.validity.customError }), this.hint = this.getAttribute("hint") ?? "";
|
196
|
-
else {
|
197
|
-
this.invalid = !this._pristine && !t.valid;
|
198
|
-
let i;
|
199
|
-
for (i in t) {
|
200
|
-
const o = `data-${i.toString()}`;
|
201
|
-
if (t[i]) {
|
202
|
-
this.validationError = i.toString();
|
203
|
-
const c = this.hasAttribute(o) ? this.getAttribute(o) : a[i];
|
204
|
-
this._internals.setValidity(
|
205
|
-
{ [this.validationError]: !0, customError: this._internals.validity.customError },
|
206
|
-
this.withFallback(c)
|
207
|
-
), c && !this._pristine && (this.hint = c), this.invalid && this.customErrorDisplay && this.checkValidity();
|
208
|
-
}
|
209
|
-
}
|
210
|
-
}
|
211
|
-
function l(i) {
|
212
|
-
const o = { validityFragment: {}, errorMessageFragment: {} };
|
213
|
-
if (!i.selectableFrom) return o;
|
214
|
-
const c = new Date(i.selectableFrom);
|
215
|
-
if (new Date(i.$input.value) < c) {
|
216
|
-
const m = i.getAttribute("data-rangeunderflow") ?? `Date is out of range. Earliest selectable date is ${i.selectableFrom}.`;
|
217
|
-
return {
|
218
|
-
validityFragment: { rangeUnderflow: !0, valid: !1 },
|
219
|
-
errorMessageFragment: { rangeUnderflow: m }
|
220
|
-
};
|
221
|
-
}
|
222
|
-
return o;
|
223
|
-
}
|
224
|
-
function n(i) {
|
225
|
-
const o = { validityFragment: {}, errorMessageFragment: {} };
|
226
|
-
if (!i.selectableTo) return o;
|
227
|
-
const c = new Date(i.selectableTo);
|
228
|
-
if (new Date(i.$input.value) > c) {
|
229
|
-
const m = i.getAttribute("data-rangeoverflow") ?? `Date is out of range. Latest selectable date is ${i.selectableTo}.`;
|
230
|
-
return {
|
231
|
-
validityFragment: { rangeOverflow: !0, valid: !1 },
|
232
|
-
errorMessageFragment: { rangeOverflow: m }
|
233
|
-
};
|
234
|
-
}
|
235
|
-
return o;
|
236
|
-
}
|
237
|
-
function d(i) {
|
238
|
-
const o = { validityFragment: {}, errorMessageFragment: {} }, c = new Date(i.$input.value);
|
239
|
-
if (new Date(i.$input_range_end.value) < c) {
|
240
|
-
const m = i.getAttribute("data-rangeunderflow") ?? "End date cannot be before start date";
|
241
|
-
return {
|
242
|
-
validityFragment: { rangeUnderflow: !0, valid: !1 },
|
243
|
-
errorMessageFragment: { rangeUnderflow: m }
|
244
|
-
};
|
245
|
-
}
|
246
|
-
return o;
|
247
|
-
}
|
248
|
-
function u(i) {
|
249
|
-
const o = { validityFragment: {}, errorMessageFragment: {} };
|
250
|
-
return !i.$input.value || i.range && !i.$input_range_end.value ? {
|
251
|
-
validityFragment: { valueMissing: !0, valid: !1 },
|
252
|
-
errorMessageFragment: { valueMissing: "This field is required" }
|
253
|
-
} : o;
|
254
|
-
}
|
255
|
-
}
|
256
|
-
render() {
|
257
|
-
var t, a, l, n, d, u, i, o;
|
258
|
-
const e = (this._defaultSlot.length === 0 || !((a = (t = this._defaultSlot[0]) == null ? void 0 : t.textContent) != null && a.trim())) && !this.label;
|
259
|
-
return y`
|
260
|
-
<div
|
261
|
-
id="root"
|
262
|
-
@mouseenter=${() => {
|
263
|
-
this.value && this._toggleClearButton(!0);
|
264
|
-
}}
|
265
|
-
@mouseleave=${() => {
|
266
|
-
this._toggleClearButton(!1);
|
267
|
-
}}
|
268
|
-
>
|
269
|
-
<label>
|
270
|
-
<div class=${this.hideLabel ? "visually-hidden" : ""} ?hidden=${e} id="label">
|
271
|
-
<slot>${this.label}</slot>
|
272
|
-
${this.required ? x(this.requiredLabel) : null}
|
273
|
-
</div>
|
274
|
-
<div id="input">
|
275
|
-
<input
|
276
|
-
?disabled=${this.disabled}
|
277
|
-
?readonly=${this.readonly}
|
278
|
-
.value=${F(
|
279
|
-
this.range ? v((l = this.value) == null ? void 0 : l.split(",")[0]) : v(this.value)
|
280
|
-
)}
|
281
|
-
@blur=${this._handleBlur}
|
282
|
-
@click=${this._handleFocus}
|
283
|
-
@focus=${this._handleFocus}
|
284
|
-
@input=${this._handleInput}
|
285
|
-
@keydown=${this._handleKeyboardEvents}
|
286
|
-
aria-describedby=${p((n = this.hint) != null && n.trim() ? "hint" : g)}
|
287
|
-
aria-errormessage=${p((d = this.hint) != null && d.trim() ? "hint" : g)}
|
288
|
-
aria-invalid=${!!this.invalid}
|
289
|
-
autocomplete="off"
|
290
|
-
data-testid="field-input"
|
291
|
-
inputmode=${p(this.inputMode)}
|
292
|
-
maxlength="10"
|
293
|
-
name=${this.name ?? "calendar"}
|
294
|
-
placeholder=${p(this.placeholder)}
|
295
|
-
type="text"
|
296
|
-
/>
|
297
|
-
${this.range ? y`
|
298
|
-
<skf-icon name="arrowRight"></skf-icon>
|
299
|
-
<input
|
300
|
-
?disabled=${this.disabled}
|
301
|
-
?readonly=${this.readonly}
|
302
|
-
.value=${F(v((u = this.value) == null ? void 0 : u.split(",")[1]))}
|
303
|
-
@blur=${this._handleBlur}
|
304
|
-
@click=${this._handleFocus}
|
305
|
-
@focus=${this._handleFocus}
|
306
|
-
@input=${this._handleInput}
|
307
|
-
@keydown=${this._handleKeyboardEvents}
|
308
|
-
aria-describedby=${p((i = this.hint) != null && i.trim() ? "hint" : g)}
|
309
|
-
aria-errormessage=${p((o = this.hint) != null && o.trim() ? "hint" : g)}
|
310
|
-
aria-invalid=${!!this.invalid}
|
311
|
-
autocomplete="off"
|
312
|
-
data-testid="field-input-range-end"
|
313
|
-
inputmode=${p(this.inputMode)}
|
314
|
-
maxlength="10"
|
315
|
-
name=${(this.name ?? "calendar") + "-end"}
|
316
|
-
placeholder=${p(this.placeholder)}
|
317
|
-
type="text"
|
318
|
-
/>
|
319
|
-
` : g}
|
320
|
-
${this.showClearbutton ? y`
|
321
|
-
<button class="password skf-icon-host" type="button" @click=${this.clear}>
|
322
|
-
<skf-icon name="close" size="sm"></skf-icon>
|
323
|
-
</button>
|
324
|
-
` : y`
|
325
|
-
<button class="password skf-icon-host" type="button">
|
326
|
-
<skf-icon name="calendarMonth" size="sm"></skf-icon>
|
327
|
-
</button>
|
328
|
-
`}
|
329
|
-
</div>
|
330
|
-
</label>
|
331
|
-
${this.hint && y`
|
332
|
-
<skf-hint
|
333
|
-
aria-live=${this.invalid ? "assertive" : "polite"}
|
334
|
-
id="hint"
|
335
|
-
severity=${p(T(this.severity, this.invalid))}
|
336
|
-
>${this.customInvalid ?? this.hint}
|
337
|
-
</skf-hint>
|
338
|
-
`}
|
339
|
-
</div>
|
340
|
-
|
341
|
-
<div id="popover" popover @close=${this._handleClose}>
|
342
|
-
<skf-datepicker
|
343
|
-
?range=${this.range}
|
344
|
-
id=${this.id}
|
345
|
-
invalid-dates=${p(this.invalidDates)}
|
346
|
-
selectable-from=${p(this.selectableFrom)}
|
347
|
-
selectable-to=${p(this.selectableTo)}
|
348
|
-
></skf-datepicker>
|
349
|
-
</div>
|
350
|
-
`;
|
351
|
-
}
|
352
|
-
};
|
353
|
-
_.styles = [L, A];
|
354
|
-
let s = _;
|
355
|
-
r([
|
356
|
-
h({ attribute: "custom-invalid", reflect: !0 })
|
357
|
-
], s.prototype, "customInvalid", 1);
|
358
|
-
r([
|
359
|
-
h({ type: String })
|
360
|
-
], s.prototype, "id", 2);
|
361
|
-
r([
|
362
|
-
h()
|
363
|
-
], s.prototype, "label", 2);
|
364
|
-
r([
|
365
|
-
h({ type: Boolean, attribute: "hide-label" })
|
366
|
-
], s.prototype, "hideLabel", 2);
|
367
|
-
r([
|
368
|
-
h()
|
369
|
-
], s.prototype, "hint", 2);
|
370
|
-
r([
|
371
|
-
h({ attribute: "invalid-dates" })
|
372
|
-
], s.prototype, "invalidDates", 2);
|
373
|
-
r([
|
374
|
-
h({ reflect: !0 })
|
375
|
-
], s.prototype, "name", 2);
|
376
|
-
r([
|
377
|
-
h()
|
378
|
-
], s.prototype, "placeholder", 2);
|
379
|
-
r([
|
380
|
-
h({ type: Boolean })
|
381
|
-
], s.prototype, "range", 2);
|
382
|
-
r([
|
383
|
-
h({ type: Boolean })
|
384
|
-
], s.prototype, "readonly", 2);
|
385
|
-
r([
|
386
|
-
h({ attribute: "required-label" })
|
387
|
-
], s.prototype, "requiredLabel", 2);
|
388
|
-
r([
|
389
|
-
h({ attribute: "selectable-from" })
|
390
|
-
], s.prototype, "selectableFrom", 2);
|
391
|
-
r([
|
392
|
-
h({ attribute: "selectable-to" })
|
393
|
-
], s.prototype, "selectableTo", 2);
|
394
|
-
r([
|
395
|
-
h({ reflect: !0 })
|
396
|
-
], s.prototype, "severity", 2);
|
397
|
-
r([
|
398
|
-
h({ reflect: !0 })
|
399
|
-
], s.prototype, "size", 2);
|
400
|
-
r([
|
401
|
-
h({ type: String, attribute: "validate-on" })
|
402
|
-
], s.prototype, "validateOn", 2);
|
403
|
-
r([
|
404
|
-
h()
|
405
|
-
], s.prototype, "value", 2);
|
406
|
-
r([
|
407
|
-
$()
|
408
|
-
], s.prototype, "_init_date", 2);
|
409
|
-
r([
|
410
|
-
h({ type: Boolean, reflect: !0 })
|
411
|
-
], s.prototype, "invalid", 2);
|
412
|
-
r([
|
413
|
-
$()
|
414
|
-
], s.prototype, "selectedRangeDates", 2);
|
415
|
-
r([
|
416
|
-
$()
|
417
|
-
], s.prototype, "showClearbutton", 2);
|
418
|
-
r([
|
419
|
-
b("#popover")
|
420
|
-
], s.prototype, "$popover", 2);
|
421
|
-
r([
|
422
|
-
b("#input")
|
423
|
-
], s.prototype, "$anchor", 2);
|
424
|
-
r([
|
425
|
-
b('input[data-testid="field-input"]')
|
426
|
-
], s.prototype, "$input", 2);
|
427
|
-
r([
|
428
|
-
b('input[data-testid="field-input-range-end"]')
|
429
|
-
], s.prototype, "$input_range_end", 2);
|
430
|
-
r([
|
431
|
-
b("skf-datepicker")
|
432
|
-
], s.prototype, "$datepicker", 2);
|
433
|
-
r([
|
434
|
-
R({ flatten: !0 })
|
435
|
-
], s.prototype, "_defaultSlot", 2);
|
436
|
-
r([
|
437
|
-
B("value", { waitUntilFirstUpdate: !0, afterUpdate: !0 })
|
438
|
-
], s.prototype, "_handleValueChange", 1);
|
439
|
-
export {
|
440
|
-
s as SkfDatePickerInput
|
441
|
-
};
|
@@ -1,8 +0,0 @@
|
|
1
|
-
import { SkfDatePickerInput } from './datepicker-input.component.js';
|
2
|
-
export * from './datepicker-input.component.js';
|
3
|
-
export default SkfDatePickerInput;
|
4
|
-
declare global {
|
5
|
-
interface HTMLElementTagNameMap {
|
6
|
-
'skf-datepicker-input': SkfDatePickerInput;
|
7
|
-
}
|
8
|
-
}
|
@@ -1 +0,0 @@
|
|
1
|
-
export {};
|
@@ -1,25 +0,0 @@
|
|
1
|
-
import { SkfLink } from '../link/link.component.js';
|
2
|
-
import { type CSSResultGroup } from 'lit';
|
3
|
-
/**
|
4
|
-
* The `<skf-menu-item>` is a component that displays a list of actions or options.
|
5
|
-
*
|
6
|
-
* @documentation See [zeroheight](https://zeroheight.com/****) for design principles
|
7
|
-
*
|
8
|
-
* @event {CustomEvent} my-tag-my-event - Fired when something happens
|
9
|
-
*
|
10
|
-
* @event click - Fired when the component is clicked
|
11
|
-
* @event mouseover - Fired when the mouse is over the component
|
12
|
-
* @event mouseout - Fired when the mouse is out of the component
|
13
|
-
* @event focus - Fired when the component is focused
|
14
|
-
* @event blur - Fired when the component is blurred
|
15
|
-
* @event change - Fired when the component's value changes
|
16
|
-
*
|
17
|
-
* @slot - The component's main content
|
18
|
-
* @slot my-named-slot - A named slot of the component
|
19
|
-
*
|
20
|
-
* @tagname skf-menu-item
|
21
|
-
*/
|
22
|
-
export declare class SkfMenuItem extends SkfLink {
|
23
|
-
static styles: CSSResultGroup;
|
24
|
-
constructor();
|
25
|
-
}
|
@@ -1,13 +0,0 @@
|
|
1
|
-
import { SkfLink as s } from "../link/link.component.js";
|
2
|
-
import "lit";
|
3
|
-
import { styles as o } from "./menu-item.styles.js";
|
4
|
-
const t = class t extends s {
|
5
|
-
constructor() {
|
6
|
-
super(), s.classMap = { "menu-item": !0 };
|
7
|
-
}
|
8
|
-
};
|
9
|
-
t.styles = [s.styles, o];
|
10
|
-
let r = t;
|
11
|
-
export {
|
12
|
-
r as SkfMenuItem
|
13
|
-
};
|
@@ -1,19 +0,0 @@
|
|
1
|
-
import { css as e } from "lit";
|
2
|
-
const s = e`
|
3
|
-
@layer components {
|
4
|
-
.menu-item {
|
5
|
-
block-size: var(--skf-size-44);
|
6
|
-
display: flex;
|
7
|
-
padding-inline: var(--skf-spacing-75);
|
8
|
-
|
9
|
-
@media screen and (any-hover: hover) {
|
10
|
-
&:hover {
|
11
|
-
background-color: var(--skf-color-blue-lighest);
|
12
|
-
}
|
13
|
-
}
|
14
|
-
}
|
15
|
-
}
|
16
|
-
`;
|
17
|
-
export {
|
18
|
-
s as styles
|
19
|
-
};
|
@@ -1,38 +0,0 @@
|
|
1
|
-
import "../link/link.js";
|
2
|
-
import { SkfElement as m } from "../../internal/components/skf-element.js";
|
3
|
-
import c from "../../styles/component.styles.js";
|
4
|
-
import { html as h } from "lit";
|
5
|
-
import { property as f } from "lit/decorators.js";
|
6
|
-
import { ifDefined as u } from "lit/directives/if-defined.js";
|
7
|
-
import { styles as a } from "./nav-item.styles.js";
|
8
|
-
var d = Object.defineProperty, p = (i, s, n, y) => {
|
9
|
-
for (var r = void 0, t = i.length - 1, l; t >= 0; t--)
|
10
|
-
(l = i[t]) && (r = l(s, n, r) || r);
|
11
|
-
return r && d(s, n, r), r;
|
12
|
-
};
|
13
|
-
const o = class o extends m {
|
14
|
-
constructor() {
|
15
|
-
super(...arguments), this.href = "#";
|
16
|
-
}
|
17
|
-
connectedCallback() {
|
18
|
-
super.connectedCallback(), this.role = "menuitem";
|
19
|
-
}
|
20
|
-
render() {
|
21
|
-
return h`
|
22
|
-
<skf-link color="inverse" href=${this.href} icon=${u(this.icon)}>
|
23
|
-
<slot></slot>
|
24
|
-
</skf-link>
|
25
|
-
`;
|
26
|
-
}
|
27
|
-
};
|
28
|
-
o.styles = [c, a];
|
29
|
-
let e = o;
|
30
|
-
p([
|
31
|
-
f({ reflect: !0 })
|
32
|
-
], e.prototype, "href");
|
33
|
-
p([
|
34
|
-
f()
|
35
|
-
], e.prototype, "icon");
|
36
|
-
export {
|
37
|
-
e as SkfNavItem
|
38
|
-
};
|
@@ -1,39 +0,0 @@
|
|
1
|
-
import { css as t } from "lit";
|
2
|
-
const s = t`
|
3
|
-
@layer components {
|
4
|
-
skf-link::part(root) {
|
5
|
-
block-size: var(--skf-header-height);
|
6
|
-
display: flex;
|
7
|
-
padding-inline: var(--skf-spacing-100);
|
8
|
-
position: relative;
|
9
|
-
}
|
10
|
-
|
11
|
-
skf-link::part(root)::after {
|
12
|
-
content: '';
|
13
|
-
position: absolute;
|
14
|
-
transition: translate calc(var(--skf-motion-duration-fast) * 1ms)
|
15
|
-
var(--skf-motion-easing-ease-in);
|
16
|
-
}
|
17
|
-
|
18
|
-
skf-link::part(root):hover::after {
|
19
|
-
--_skf-nav-link-translate: 0;
|
20
|
-
}
|
21
|
-
|
22
|
-
:host-context(skf-nav:not([vertical])) skf-link::part(root)::after {
|
23
|
-
border-bottom: var(--skf-size-4) solid var(--skf-border-color-inverse);
|
24
|
-
inset-block-end: 0;
|
25
|
-
inset-inline: 0;
|
26
|
-
translate: 0 var(--_skf-nav-link-translate, 100%);
|
27
|
-
}
|
28
|
-
|
29
|
-
:host-context(skf-nav[vertical]) skf-link::part(root)::after {
|
30
|
-
border-left: var(--skf-size-4) solid var(--skf-border-color-inverse);
|
31
|
-
inset-block: 0;
|
32
|
-
inset-inline-start: 0;
|
33
|
-
translate: var(--_skf-nav-link-translate, -100%) 0;
|
34
|
-
}
|
35
|
-
}
|
36
|
-
`;
|
37
|
-
export {
|
38
|
-
s as styles
|
39
|
-
};
|