@skf-design-system/ui-components 1.0.2-beta.5 → 1.0.2-beta.7

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.
Files changed (124) hide show
  1. package/README.md +18 -0
  2. package/dist/components/accordion/accordion.component.d.ts +1 -1
  3. package/dist/components/accordion/accordion.component.js +2 -2
  4. package/dist/components/alert/alert.component.d.ts +3 -2
  5. package/dist/components/alert/alert.component.js +39 -33
  6. package/dist/components/button/button.styles.js +3 -3
  7. package/dist/components/checkbox/checkbox.component.d.ts +4 -2
  8. package/dist/components/checkbox/checkbox.component.js +73 -65
  9. package/dist/components/checkbox/checkbox.styles.js +1 -1
  10. package/dist/components/datepicker/datepicker-calendar.component.d.ts +4 -0
  11. package/dist/components/datepicker/datepicker-calendar.component.js +134 -127
  12. package/dist/components/datepicker/datepicker-popup.component.d.ts +4 -0
  13. package/dist/components/datepicker/datepicker-popup.component.js +100 -88
  14. package/dist/components/datepicker/datepicker.component.d.ts +4 -2
  15. package/dist/components/datepicker/datepicker.component.js +151 -140
  16. package/dist/components/dialog/dialog.component.d.ts +3 -2
  17. package/dist/components/dialog/dialog.component.js +39 -37
  18. package/dist/components/divider/divider.component.d.ts +3 -0
  19. package/dist/components/divider/divider.component.js +43 -22
  20. package/dist/components/divider/divider.styles.js +9 -9
  21. package/dist/components/drawer/drawer.component.d.ts +11 -4
  22. package/dist/components/drawer/drawer.component.js +77 -55
  23. package/dist/components/drawer/drawer.styles.js +47 -40
  24. package/dist/components/header/header.component.d.ts +4 -2
  25. package/dist/components/header/header.component.js +66 -57
  26. package/dist/components/header/header.styles.js +2 -2
  27. package/dist/components/icon/icon.component.js +7 -7
  28. package/dist/components/icon/icon.styles.js +2 -2
  29. package/dist/components/input/input.component.d.ts +4 -8
  30. package/dist/components/input/input.component.js +147 -147
  31. package/dist/components/input/input.controllers.d.ts +0 -1
  32. package/dist/components/input/input.controllers.js +12 -12
  33. package/dist/components/link/link.component.d.ts +15 -18
  34. package/dist/components/link/link.component.js +105 -107
  35. package/dist/components/link/link.styles.js +53 -45
  36. package/dist/components/loader/loader.component.d.ts +5 -3
  37. package/dist/components/loader/loader.component.js +39 -28
  38. package/dist/components/loader/loader.styles.js +6 -10
  39. package/dist/components/menu/menu-item.component.d.ts +1 -1
  40. package/dist/components/menu/menu-item.component.js +8 -8
  41. package/dist/components/menu/menu-item.styles.js +13 -9
  42. package/dist/components/menu/menu.component.d.ts +5 -2
  43. package/dist/components/menu/menu.component.js +8 -8
  44. package/dist/components/nav/nav-item.component.d.ts +4 -0
  45. package/dist/components/nav/nav-item.component.js +44 -25
  46. package/dist/components/nav/nav-item.styles.js +29 -25
  47. package/dist/components/nav/nav.component.d.ts +9 -0
  48. package/dist/components/nav/nav.component.js +47 -21
  49. package/dist/components/nav/nav.styles.js +15 -9
  50. package/dist/components/popover/popover.component.d.ts +10 -3
  51. package/dist/components/popover/popover.component.js +30 -22
  52. package/dist/components/progress/progress.component.d.ts +2 -0
  53. package/dist/components/progress/progress.component.js +38 -29
  54. package/dist/components/progress/progress.styles.js +4 -4
  55. package/dist/components/radio/radio.component.d.ts +4 -2
  56. package/dist/components/radio/radio.component.js +91 -83
  57. package/dist/components/radio/radio.styles.js +1 -1
  58. package/dist/components/segmented-button/segmented-button-item.component.js +1 -1
  59. package/dist/components/segmented-button/segmented-button-item.styles.js +1 -1
  60. package/dist/components/select/select-option-group.component.d.ts +4 -0
  61. package/dist/components/select/select-option-group.component.js +37 -18
  62. package/dist/components/select/select-option-group.style.js +12 -6
  63. package/dist/components/select/select-option.component.d.ts +7 -2
  64. package/dist/components/select/select-option.component.js +70 -53
  65. package/dist/components/select/select-option.styles.js +43 -31
  66. package/dist/components/select/select.component.d.ts +18 -10
  67. package/dist/components/select/select.component.js +175 -132
  68. package/dist/components/select/select.controllers.js +2 -1
  69. package/dist/components/select/select.styles.js +8 -2
  70. package/dist/components/stepper/stepper-item.component.d.ts +1 -1
  71. package/dist/components/stepper/stepper-item.component.js +26 -23
  72. package/dist/components/stepper/stepper-item.styles.js +4 -4
  73. package/dist/components/switch/switch.component.d.ts +4 -2
  74. package/dist/components/switch/switch.component.js +64 -56
  75. package/dist/components/switch/switch.styles.js +1 -1
  76. package/dist/components/tabs/tab-panel.component.d.ts +1 -1
  77. package/dist/components/tabs/tab-panel.component.js +19 -16
  78. package/dist/components/tabs/tab.component.d.ts +1 -1
  79. package/dist/components/tabs/tab.component.js +17 -14
  80. package/dist/components/tabs/tab.styles.js +2 -2
  81. package/dist/components/tag/tag.component.d.ts +3 -0
  82. package/dist/components/tag/tag.component.js +50 -41
  83. package/dist/components/textarea/textarea.component.d.ts +4 -2
  84. package/dist/components/textarea/textarea.component.js +127 -118
  85. package/dist/components/toast/toast-item.styles.js +13 -10
  86. package/dist/components/toast/toast.component.js +9 -9
  87. package/dist/components/toast/toast.singleton.d.ts +1 -1
  88. package/dist/components/toast/toast.singleton.js +18 -18
  89. package/dist/components/tooltip/tooltip.component.d.ts +9 -2
  90. package/dist/components/tooltip/tooltip.component.js +13 -7
  91. package/dist/custom-elements.json +1305 -946
  92. package/dist/index.d.ts +2 -2
  93. package/dist/index.js +20 -20
  94. package/dist/internal/base-classes/popover/popover.base.d.ts +24 -5
  95. package/dist/internal/base-classes/popover/popover.base.js +28 -29
  96. package/dist/internal/base-classes/popover/popover.styles.js +4 -5
  97. package/dist/internal/components/hint/hint.component.d.ts +4 -0
  98. package/dist/internal/components/hint/hint.component.js +47 -20
  99. package/dist/internal/components/hint/hint.styles.js +29 -25
  100. package/dist/internal/controllers/popover.controller.d.ts +2 -0
  101. package/dist/internal/helpers/uuid.d.ts +8 -10
  102. package/dist/internal/helpers/uuid.js +4 -11
  103. package/dist/internal/helpers/watch.d.ts +1 -1
  104. package/dist/internal/templates/asterisk.d.ts +1 -1
  105. package/dist/internal/templates/asterisk.js +4 -4
  106. package/dist/internal/types.d.ts +4 -0
  107. package/dist/styles/global-alt.css +1 -1
  108. package/dist/styles/global.css +1 -1
  109. package/dist/translations/en.d.ts +3 -0
  110. package/dist/translations/en.js +27 -0
  111. package/dist/translations/es.d.ts +3 -0
  112. package/dist/translations/es.js +27 -0
  113. package/dist/translations/index.d.ts +4 -0
  114. package/dist/translations/pt.d.ts +3 -0
  115. package/dist/translations/pt.js +27 -0
  116. package/dist/translations/sv.d.ts +3 -0
  117. package/dist/translations/sv.js +27 -0
  118. package/dist/types/jsx/custom-element-jsx.d.ts +243 -128
  119. package/dist/types/vue/index.d.ts +136 -127
  120. package/dist/utilities/localize.d.ts +28 -0
  121. package/dist/utilities/localize.js +13 -0
  122. package/dist/vscode.html-custom-data.json +168 -177
  123. package/dist/web-types.json +411 -381
  124. package/package.json +34 -41
@@ -1,61 +1,69 @@
1
+ var P = (d) => {
2
+ throw TypeError(d);
3
+ };
4
+ var E = (d, h, e) => h.has(d) || P("Cannot " + e);
5
+ var k = (d, h, e) => (E(d, h, "read from private field"), e ? e.call(d) : h.get(d)), C = (d, h, e) => h.has(d) ? P("Cannot add the same private member more than once") : h instanceof WeakSet ? h.add(d) : h.set(d, e), I = (d, h, e, t) => (E(d, h, "write to private field"), t ? t.call(d, e) : h.set(d, e), e);
1
6
  import "../icon/icon.js";
2
- import { computePosition as P, flip as S, offset as E } from "@floating-ui/dom";
3
- import { FormBase as C } from "../../internal/components/formBase.js";
7
+ import { computePosition as T, flip as B, offset as x } from "@floating-ui/dom";
8
+ import { FormBase as R } from "../../internal/components/formBase.js";
4
9
  import "../../internal/components/hint/hint.js";
5
- import { PopoverController as I } from "../../internal/controllers/popover.controller.js";
6
- import { hintSeverity as O } from "../../internal/helpers/hintSeverity.js";
7
- import { watch as M } from "../../internal/helpers/watch.js";
8
- import { Asterisk as T } from "../../internal/templates/asterisk.js";
9
- import { Temporal as w } from "@js-temporal/polyfill";
10
- import { componentStyles as B } 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 x } from "lit/decorators.js";
13
- import { ifDefined as u } from "lit/directives/if-defined.js";
14
- import { live as F } from "lit/directives/live.js";
10
+ import { PopoverController as A } from "../../internal/controllers/popover.controller.js";
11
+ import { hintSeverity as L } from "../../internal/helpers/hintSeverity.js";
12
+ import { watch as j } from "../../internal/helpers/watch.js";
13
+ import { Asterisk as V } from "../../internal/templates/asterisk.js";
14
+ import { Temporal as O } from "@js-temporal/polyfill";
15
+ import { componentStyles as q } from "../../styles/component.styles.js";
16
+ import { LocalizeController as U } from "../../utilities/localize.js";
17
+ import { nothing as g, html as _ } from "lit";
18
+ import { property as p, state as w, query as D, queryAssignedNodes as N } from "lit/decorators.js";
19
+ import { ifDefined as v } from "lit/directives/if-defined.js";
20
+ import { live as M } from "lit/directives/live.js";
15
21
  import "./datepicker-popup.js";
16
- import { dateFormatter as v, is as f, isPopoverOpen as L, debounce as R } from "./datepicker.helpers.js";
17
- import { styles as A } from "./datepicker.styles.js";
18
- var j = Object.defineProperty, q = Object.getOwnPropertyDescriptor, r = (D, e, t, a) => {
19
- for (var o = a > 1 ? void 0 : a ? q(e, t) : e, n = D.length - 1, d; n >= 0; n--)
20
- (d = D[n]) && (o = (a ? d(e, t, o) : d(o)) || o);
21
- return a && o && j(e, t, o), o;
22
- };
23
- const _ = class _ extends C {
22
+ import { dateFormatter as m, is as y, isPopoverOpen as Y, debounce as z } from "./datepicker.helpers.js";
23
+ import { styles as W } from "./datepicker.styles.js";
24
+ var H = Object.defineProperty, K = Object.getOwnPropertyDescriptor, r = (d, h, e, t) => {
25
+ for (var a = t > 1 ? void 0 : t ? K(h, e) : h, l = d.length - 1, n; l >= 0; l--)
26
+ (n = d[l]) && (a = (t ? n(h, e, a) : n(a)) || a);
27
+ return t && a && H(h, e, a), a;
28
+ }, b;
29
+ const F = class F extends R {
24
30
  constructor() {
25
- super(), this.popoverController = new I(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 = () => {
31
+ super();
32
+ C(this, b);
33
+ I(this, b, new U(this)), this.popoverController = new A(this), this.id = "skf-datepicker-input", this.lang = "en", 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 = () => {
26
34
  this.pristine = !1, this._internals.setFormValue(this.value ?? ""), this.validateInput();
27
35
  }, this._handleDateSelected = (e) => {
28
36
  if (this.range && "start" in e.detail.date && "end" in e.detail.date) {
29
37
  const t = e.detail.date.start, a = e.detail.date.end;
30
- this.value = `${v(t)},${v(a)}`, this.selectedRangeDates = { start: t, end: a };
31
- } else !this.range && e.detail.date instanceof Date && (this.value = v(e.detail.date), this._animatePopover({ el: this.$popover, show: !1 }).then(() => {
38
+ this.value = `${m(t)},${m(a)}`, this.selectedRangeDates = { start: t, end: a };
39
+ } else !this.range && e.detail.date instanceof Date && (this.value = m(e.detail.date), this._animatePopover({ el: this.$popover, show: !1 }).then(() => {
32
40
  this.$popover.hidePopover();
33
41
  }));
34
42
  }, this._handleKeyboardEvents = (e) => {
35
- var a, o;
43
+ var a, l;
36
44
  const t = e.target.closest("input");
37
45
  if (t) {
38
46
  if ((t.selectionStart ?? 0) < t.value.length && /[[0-9-]/.test(e.key)) {
39
- const n = t.selectionStart ?? 0, p = t.value.split("").slice(0, n);
40
- t.value = p.join("");
47
+ const n = t.selectionStart ?? 0, c = t.value.split("").slice(0, n);
48
+ t.value = c.join("");
41
49
  }
42
50
  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")) {
43
51
  e.preventDefault();
44
- const d = (a = this.$popover.childNodes[1].shadowRoot) == null ? void 0 : a.querySelector("skf-datepicker-calendar"), p = (o = d == null ? void 0 : d.shadowRoot) == null ? void 0 : o.querySelector("button");
45
- p == null || p.focus();
52
+ const u = (a = this.$popover.childNodes[1].shadowRoot) == null ? void 0 : a.querySelector("skf-datepicker-calendar"), c = (l = u == null ? void 0 : u.shadowRoot) == null ? void 0 : l.querySelector("button");
53
+ c == null || c.focus();
46
54
  }
47
55
  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")
48
56
  if (t.blur(), this.$popover.hidePopover(), this.range) {
49
- const n = this.$input.value, d = this.$input_range_end.value;
50
- if (!f(n, d).date()) return;
57
+ const n = this.$input.value, u = this.$input_range_end.value;
58
+ if (!y(n, u).date()) return;
51
59
  this.$datepickerPopup.selectedDateRange = {
52
60
  start: new Date(n),
53
- end: new Date(d)
61
+ end: new Date(u)
54
62
  }, this.$datepickerPopup.emit("selected-date-changed", {
55
63
  detail: { date: new Date(n) }
56
64
  });
57
65
  } else {
58
- if (!t.value || !f(t.value).date()) return;
66
+ if (!t.value || !y(t.value).date()) return;
59
67
  this.$datepickerPopup.emit("selected-date-changed", {
60
68
  detail: { date: new Date(t.value) }
61
69
  });
@@ -72,14 +80,14 @@ const _ = class _ extends C {
72
80
  this.value = "", this.$datepickerPopup.clearSelection();
73
81
  }, this._handleInput = (e) => {
74
82
  const t = e.target, a = String(t.value).replace(/[^0-9-]/g, "");
75
- if (t.value = a, t.setCustomValidity(this.customError ?? ""), !!f(t.value).ISO()) {
83
+ if (t.value = a, t.setCustomValidity(this.customError ?? ""), !!y(t.value).ISO()) {
76
84
  if (this.focusTimeoutId && clearTimeout(this.focusTimeoutId), this.$datepickerPopup.date = t.value, this.range) {
77
85
  this.$datepickerPopup.selectedDateRange = {
78
- start: f(this.$input.value).ISO() ? new Date(this.$input.value) : null,
79
- end: f(this.$input_range_end.value).ISO() ? new Date(this.$input_range_end.value) : null
86
+ start: y(this.$input.value).ISO() ? new Date(this.$input.value) : null,
87
+ end: y(this.$input_range_end.value).ISO() ? new Date(this.$input_range_end.value) : null
80
88
  };
81
- const o = Object.values(this.$datepickerPopup.selectedDateRange).filter(Boolean).map((n) => new Date(n).toLocaleDateString("en-CA")).join();
82
- this.value = o, f(this.$input.value).ISO() && (this.focusTimeoutId = setTimeout(() => {
89
+ const l = Object.values(this.$datepickerPopup.selectedDateRange).filter(Boolean).map((n) => new Date(n).toLocaleDateString("en-CA")).join();
90
+ this.value = l, y(this.$input.value).ISO() && (this.focusTimeoutId = setTimeout(() => {
83
91
  this.$input_range_end.focus();
84
92
  }, 200));
85
93
  } else
@@ -91,9 +99,9 @@ const _ = class _ extends C {
91
99
  }, this._toggleClearButton = (e = !1) => {
92
100
  this.showClearbutton = e;
93
101
  }, this.reposition = async () => {
94
- const { x: e, y: t } = await P(this.$anchor, this.$popover, {
102
+ const { x: e, y: t } = await T(this.$anchor, this.$popover, {
95
103
  placement: "bottom-start",
96
- middleware: [S(), E(0)],
104
+ middleware: [B(), x(0)],
97
105
  strategy: "fixed"
98
106
  });
99
107
  Object.assign(this.$popover.style, {
@@ -119,7 +127,7 @@ const _ = class _ extends C {
119
127
  }
120
128
  firstUpdated() {
121
129
  var e;
122
- this.$datepickerPopup.date = this._init_date ? w.PlainDate.from(this._init_date).toString() : w.Now.plainDateISO().toString(), this.range ? this.$datepickerPopup.selectedDateRange = {
130
+ this.$datepickerPopup.date = this._init_date ? O.PlainDate.from(this._init_date).toString() : O.Now.plainDateISO().toString(), this.range ? this.$datepickerPopup.selectedDateRange = {
123
131
  start: this._init_date ? new Date(this._init_date) : null,
124
132
  end: (e = this.value) != null && e.split(",")[1] ? new Date(this.value.split(",")[1]) : null
125
133
  } : this.$datepickerPopup.selectedDate = this._init_date ? new Date(this._init_date) : void 0, this.hint && !this.hasAttribute("hint") && this.setAttribute("hint", this.hint), this.validateInput();
@@ -133,15 +141,15 @@ const _ = class _ extends C {
133
141
  this._internals.setValidity({}), this.validateInput();
134
142
  }
135
143
  _handleValueChange() {
136
- var e, t, a, o, n, d, p, i;
137
- (e = this.value) != null && e.trim() || this.$datepickerPopup.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.$datepickerPopup.selectedDateRange = {
144
+ var e, t, a, l, n, u, c, i;
145
+ (e = this.value) != null && e.trim() || this.$datepickerPopup.clearSelection(), this._internals.setFormValue(this.value ?? ""), this.validateInput(), this._pristine = !1, this.$input.value = m((t = this.value) == null ? void 0 : t.split(",")[0]), this.range ? (this.$datepickerPopup.selectedDateRange = {
138
146
  start: (n = this.value) != null && n.split(",")[0] ? new Date(this.value.split(",")[0]) : null,
139
- end: (d = this.value) != null && d.split(",")[1] ? new Date(this.value.split(",")[1]) : null
140
- }, this.$input_range_end.value = v((p = this.value) == null ? void 0 : p.split(",")[1]), this.$datepickerPopup.date = ((i = this.value) == null ? void 0 : i.split(",")[0]) ?? "") : (this.$datepickerPopup.selectedDate = (a = this.value) != null && a.split(",")[0] ? new Date(this.value.split(",")[0]) : void 0, this.$datepickerPopup.date = ((o = this.value) == null ? void 0 : o.split(",")[0]) ?? ""), this.validateInput();
147
+ end: (u = this.value) != null && u.split(",")[1] ? new Date(this.value.split(",")[1]) : null
148
+ }, this.$input_range_end.value = m((c = this.value) == null ? void 0 : c.split(",")[1]), this.$datepickerPopup.date = ((i = this.value) == null ? void 0 : i.split(",")[0]) ?? "") : (this.$datepickerPopup.selectedDate = (a = this.value) != null && a.split(",")[0] ? new Date(this.value.split(",")[0]) : void 0, this.$datepickerPopup.date = ((l = this.value) == null ? void 0 : l.split(",")[0]) ?? ""), this.validateInput();
141
149
  }
142
150
  showPopover() {
143
- if (L(this.$popover)) return;
144
- R(() => {
151
+ if (Y(this.$popover)) return;
152
+ z(() => {
145
153
  this.$popover.showPopover(), this._animatePopover({ show: !0 });
146
154
  }, 200)(), this.addEventListener("focusout", this.hidePopover.bind(this), {
147
155
  once: !0,
@@ -161,19 +169,19 @@ const _ = class _ extends C {
161
169
  /** @internal */
162
170
  async _animatePopover({ el: e = this.$popover, show: t }) {
163
171
  return t && (e.style.opacity = "0", e.style.transform = "scaleY(0.5)"), new Promise((a) => {
164
- const o = [
172
+ const l = [
165
173
  { opacity: 0, transform: "scaleY(0.5)" },
166
174
  { opacity: 1, transform: "scaleY(1)" }
167
- ], n = t ? o : o.reverse();
175
+ ], n = t ? l : l.reverse();
168
176
  setTimeout(
169
177
  () => {
170
178
  e.style.transformOrigin = "top";
171
- const d = this.$popover.animate(n, {
179
+ const u = this.$popover.animate(n, {
172
180
  duration: 100,
173
181
  easing: "linear",
174
182
  fill: "both"
175
183
  });
176
- d.onfinish = () => {
184
+ u.onfinish = () => {
177
185
  a();
178
186
  };
179
187
  },
@@ -186,20 +194,20 @@ const _ = class _ extends C {
186
194
  if (this._internals.validity.customError) return;
187
195
  let t = JSON.parse(JSON.stringify(this._internals.validity)), a = {};
188
196
  if (this.selectableFrom) {
189
- const { validityFragment: i, errorMessageFragment: l } = o(this);
190
- t = { ...t, ...i }, a = { ...a, ...l };
197
+ const { validityFragment: i, errorMessageFragment: o } = l(this);
198
+ t = { ...t, ...i }, a = { ...a, ...o };
191
199
  }
192
200
  if (this.selectableTo) {
193
- const { validityFragment: i, errorMessageFragment: l } = n(this);
194
- t = { ...t, ...i }, a = { ...a, ...l };
201
+ const { validityFragment: i, errorMessageFragment: o } = n(this);
202
+ t = { ...t, ...i }, a = { ...a, ...o };
195
203
  }
196
204
  if (this.range) {
197
- const { validityFragment: i, errorMessageFragment: l } = d(this);
198
- t = { ...t, ...i }, a = { ...a, ...l };
205
+ const { validityFragment: i, errorMessageFragment: o } = u(this);
206
+ t = { ...t, ...i }, a = { ...a, ...o };
199
207
  }
200
208
  if (this.required) {
201
- const { validityFragment: i, errorMessageFragment: l } = p(this);
202
- t = { ...t, ...i }, a = { ...a, ...l };
209
+ const { validityFragment: i, errorMessageFragment: o } = c(this);
210
+ t = { ...t, ...i }, a = { ...a, ...o };
203
211
  }
204
212
  if (t.valid = !Object.values(t).some((i) => i), this.invalid = !1, t.valid)
205
213
  this._internals.setValidity({ customError: this._internals.validity.customError }), this.hint = this.getAttribute("hint") ?? "";
@@ -207,66 +215,66 @@ const _ = class _ extends C {
207
215
  this.invalid = !this._pristine && !t.valid;
208
216
  let i;
209
217
  for (i in t) {
210
- const l = `data-${i.toString()}`;
218
+ const o = `data-${i.toString()}`;
211
219
  if (t[i]) {
212
220
  this.validationError = i.toString();
213
- const c = this.hasAttribute(l) ? this.getAttribute(l) : a[i];
221
+ const f = this.hasAttribute(o) ? this.getAttribute(o) : a[i];
214
222
  this._internals.setValidity(
215
223
  { [this.validationError]: !0, customError: this._internals.validity.customError },
216
- this.withFallback(c)
217
- ), c && !this._pristine && (this.hint = c), this.invalid && this.customErrorDisplay && this.checkValidity();
224
+ this.withFallback(f)
225
+ ), f && !this._pristine && (this.hint = f), this.invalid && this.customErrorDisplay && this.checkValidity();
218
226
  }
219
227
  }
220
228
  }
221
- function o(i) {
222
- const l = { validityFragment: {}, errorMessageFragment: {} };
223
- if (!i.selectableFrom) return l;
224
- const c = new Date(i.selectableFrom);
225
- if (new Date(i.$input.value) < c) {
226
- const m = i.getAttribute("data-rangeunderflow") ?? `Date is out of range. Earliest selectable date is ${i.selectableFrom}.`;
229
+ function l(i) {
230
+ const o = { validityFragment: {}, errorMessageFragment: {} };
231
+ if (!i.selectableFrom) return o;
232
+ const f = new Date(i.selectableFrom);
233
+ if (new Date(i.$input.value) < f) {
234
+ const $ = i.getAttribute("data-rangeunderflow") ?? `Date is out of range. Earliest selectable date is ${i.selectableFrom}.`;
227
235
  return {
228
236
  validityFragment: { rangeUnderflow: !0, valid: !1 },
229
- errorMessageFragment: { rangeUnderflow: m }
237
+ errorMessageFragment: { rangeUnderflow: $ }
230
238
  };
231
239
  }
232
- return l;
240
+ return o;
233
241
  }
234
242
  function n(i) {
235
- const l = { validityFragment: {}, errorMessageFragment: {} };
236
- if (!i.selectableTo) return l;
237
- const c = new Date(i.selectableTo);
238
- if (new Date(i.$input.value) > c) {
239
- const m = i.getAttribute("data-rangeoverflow") ?? `Date is out of range. Latest selectable date is ${i.selectableTo}.`;
243
+ const o = { validityFragment: {}, errorMessageFragment: {} };
244
+ if (!i.selectableTo) return o;
245
+ const f = new Date(i.selectableTo);
246
+ if (new Date(i.$input.value) > f) {
247
+ const $ = i.getAttribute("data-rangeoverflow") ?? `Date is out of range. Latest selectable date is ${i.selectableTo}.`;
240
248
  return {
241
249
  validityFragment: { rangeOverflow: !0, valid: !1 },
242
- errorMessageFragment: { rangeOverflow: m }
250
+ errorMessageFragment: { rangeOverflow: $ }
243
251
  };
244
252
  }
245
- return l;
253
+ return o;
246
254
  }
247
- function d(i) {
248
- const l = { validityFragment: {}, errorMessageFragment: {} }, c = new Date(i.$input.value);
249
- if (new Date(i.$input_range_end.value) < c) {
250
- const m = i.getAttribute("data-rangeunderflow") ?? "End date cannot be before start date";
255
+ function u(i) {
256
+ const o = { validityFragment: {}, errorMessageFragment: {} }, f = new Date(i.$input.value);
257
+ if (new Date(i.$input_range_end.value) < f) {
258
+ const $ = i.getAttribute("data-rangeunderflow") ?? "End date cannot be before start date";
251
259
  return {
252
260
  validityFragment: { rangeUnderflow: !0, valid: !1 },
253
- errorMessageFragment: { rangeUnderflow: m }
261
+ errorMessageFragment: { rangeUnderflow: $ }
254
262
  };
255
263
  }
256
- return l;
264
+ return o;
257
265
  }
258
- function p(i) {
259
- const l = { validityFragment: {}, errorMessageFragment: {} };
266
+ function c(i) {
267
+ const o = { validityFragment: {}, errorMessageFragment: {} };
260
268
  return !i.$input.value || i.range && !i.$input_range_end.value ? {
261
269
  validityFragment: { valueMissing: !0, valid: !1 },
262
270
  errorMessageFragment: { valueMissing: "This field is required" }
263
- } : l;
271
+ } : o;
264
272
  }
265
273
  }
266
274
  render() {
267
- var t, a, o, n, d, p, i, l;
275
+ var t, a, l, n, u, c, i, o;
268
276
  const e = (this._defaultSlot.length === 0 || !((a = (t = this._defaultSlot[0]) == null ? void 0 : t.textContent) != null && a.trim())) && !this.label;
269
- return y`
277
+ return _`
270
278
  <div
271
279
  id="root"
272
280
  @mouseenter=${() => {
@@ -279,74 +287,76 @@ const _ = class _ extends C {
279
287
  <label>
280
288
  <div class=${this.hideLabel ? "visually-hidden" : ""} ?hidden=${e} id="label">
281
289
  <slot>${this.label}</slot>
282
- ${this.required ? T(this.requiredLabel) : null}
290
+ ${this.required ? V(k(this, b).term("required")) : g}
283
291
  </div>
284
292
  <div id="input">
285
293
  <input
286
294
  ?disabled=${this.disabled}
287
295
  ?readonly=${this.readonly}
288
- .value=${F(
289
- this.range ? v((o = this.value) == null ? void 0 : o.split(",")[0]) : v(this.value)
296
+ .value=${M(
297
+ this.range ? m((l = this.value) == null ? void 0 : l.split(",")[0]) : m(this.value)
290
298
  )}
291
299
  @blur=${this._handleBlur}
292
300
  @click=${this._handleFocus}
293
301
  @focus=${this._handleFocus}
294
302
  @input=${this._handleInput}
295
303
  @keydown=${this._handleKeyboardEvents}
296
- aria-describedby=${u((n = this.hint) != null && n.trim() ? "hint" : g)}
297
- aria-errormessage=${u((d = this.hint) != null && d.trim() ? "hint" : g)}
304
+ aria-describedby=${v((n = this.hint) != null && n.trim() ? "hint" : g)}
305
+ aria-errormessage=${v((u = this.hint) != null && u.trim() ? "hint" : g)}
298
306
  aria-invalid=${!!this.invalid}
299
307
  autocomplete="off"
300
308
  data-testid="field-input"
301
- inputmode=${u(this.inputMode)}
309
+ inputmode=${v(this.inputMode)}
302
310
  maxlength="10"
303
311
  name=${this.name ?? "calendar"}
304
- placeholder=${u(this.placeholder)}
312
+ placeholder=${v(this.placeholder)}
305
313
  type="text"
306
314
  />
307
- ${this.range ? y`
315
+ ${this.range ? _`
308
316
  <skf-icon name="arrowRight"></skf-icon>
309
317
  <input
310
318
  ?disabled=${this.disabled}
311
319
  ?readonly=${this.readonly}
312
- .value=${F(v((p = this.value) == null ? void 0 : p.split(",")[1]))}
320
+ .value=${M(m((c = this.value) == null ? void 0 : c.split(",")[1]))}
313
321
  @blur=${this._handleBlur}
314
322
  @click=${this._handleFocus}
315
323
  @focus=${this._handleFocus}
316
324
  @input=${this._handleInput}
317
325
  @keydown=${this._handleKeyboardEvents}
318
- aria-describedby=${u((i = this.hint) != null && i.trim() ? "hint" : g)}
319
- aria-errormessage=${u((l = this.hint) != null && l.trim() ? "hint" : g)}
326
+ aria-describedby=${v((i = this.hint) != null && i.trim() ? "hint" : g)}
327
+ aria-errormessage=${v((o = this.hint) != null && o.trim() ? "hint" : g)}
320
328
  aria-invalid=${!!this.invalid}
321
329
  autocomplete="off"
322
330
  data-testid="field-input-range-end"
323
- inputmode=${u(this.inputMode)}
331
+ inputmode=${v(this.inputMode)}
324
332
  maxlength="10"
325
333
  name=${(this.name ?? "calendar") + "-end"}
326
- placeholder=${u(this.placeholder)}
334
+ placeholder=${v(this.placeholder)}
327
335
  type="text"
328
336
  />
329
337
  ` : g}
330
- ${this.showClearbutton ? y`
338
+ ${this.showClearbutton ? _`
331
339
  <button
340
+ aria-label=${k(this, b).term("close")}
332
341
  class="password skf-icon-host"
333
342
  type="button"
334
343
  @click=${this.clear.bind(this)}
335
344
  >
336
345
  <skf-icon name="close" size="sm"></skf-icon>
337
346
  </button>
338
- ` : y`
347
+ ` : _`
339
348
  <button class="password skf-icon-host" type="button">
340
349
  <skf-icon name="calendarMonth" size="sm"></skf-icon>
341
350
  </button>
342
351
  `}
343
352
  </div>
344
353
  </label>
345
- ${this.hint && y`
354
+ ${this.hint && _`
346
355
  <skf-hint
356
+ ?disabled=${this.disabled}
347
357
  aria-live=${this.invalid ? "assertive" : "polite"}
348
358
  id="hint"
349
- severity=${u(O(this.invalid, this.severity))}
359
+ severity=${v(L(this.invalid, this.severity))}
350
360
  >${this.customInvalid ?? this.hint}
351
361
  </skf-hint>
352
362
  `}
@@ -356,99 +366,100 @@ const _ = class _ extends C {
356
366
  <skf-datepicker-popup
357
367
  ?range=${this.range}
358
368
  id=${this.id}
359
- invalid-dates=${u(this.invalidDates)}
360
- selectable-from=${u(this.selectableFrom)}
361
- selectable-to=${u(this.selectableTo)}
369
+ invalid-dates=${v(this.invalidDates)}
370
+ lang=${this.lang}
371
+ selectable-from=${v(this.selectableFrom)}
372
+ selectable-to=${v(this.selectableTo)}
362
373
  ></skf-datepicker-popup>
363
374
  </div>
364
375
  `;
365
376
  }
366
377
  };
367
- _.styles = [B, A];
368
- let s = _;
378
+ b = new WeakMap(), F.styles = [q, W];
379
+ let s = F;
369
380
  r([
370
- h({ attribute: "custom-invalid", reflect: !0 })
381
+ p({ attribute: "custom-invalid", reflect: !0 })
371
382
  ], s.prototype, "customInvalid", 1);
372
383
  r([
373
- h({ type: String })
384
+ p({ type: String })
374
385
  ], s.prototype, "id", 2);
375
386
  r([
376
- h()
387
+ p()
377
388
  ], s.prototype, "label", 2);
378
389
  r([
379
- h({ type: Boolean, attribute: "hide-label" })
390
+ p({ type: String })
391
+ ], s.prototype, "lang", 2);
392
+ r([
393
+ p({ type: Boolean, attribute: "hide-label" })
380
394
  ], s.prototype, "hideLabel", 2);
381
395
  r([
382
- h()
396
+ p()
383
397
  ], s.prototype, "hint", 2);
384
398
  r([
385
- h({ attribute: "invalid-dates" })
399
+ p({ attribute: "invalid-dates" })
386
400
  ], s.prototype, "invalidDates", 2);
387
401
  r([
388
- h({ reflect: !0 })
402
+ p({ reflect: !0 })
389
403
  ], s.prototype, "name", 2);
390
404
  r([
391
- h()
405
+ p()
392
406
  ], s.prototype, "placeholder", 2);
393
407
  r([
394
- h({ type: Boolean })
408
+ p({ type: Boolean })
395
409
  ], s.prototype, "range", 2);
396
410
  r([
397
- h({ type: Boolean })
411
+ p({ type: Boolean })
398
412
  ], s.prototype, "readonly", 2);
399
413
  r([
400
- h({ attribute: "required-label" })
401
- ], s.prototype, "requiredLabel", 2);
402
- r([
403
- h({ attribute: "selectable-from" })
414
+ p({ attribute: "selectable-from" })
404
415
  ], s.prototype, "selectableFrom", 2);
405
416
  r([
406
- h({ attribute: "selectable-to" })
417
+ p({ attribute: "selectable-to" })
407
418
  ], s.prototype, "selectableTo", 2);
408
419
  r([
409
- h({ reflect: !0 })
420
+ p({ reflect: !0 })
410
421
  ], s.prototype, "severity", 2);
411
422
  r([
412
- h({ reflect: !0 })
423
+ p({ reflect: !0 })
413
424
  ], s.prototype, "size", 2);
414
425
  r([
415
- h({ type: String, attribute: "validate-on" })
426
+ p({ type: String, attribute: "validate-on" })
416
427
  ], s.prototype, "validateOn", 2);
417
428
  r([
418
- h()
429
+ p()
419
430
  ], s.prototype, "value", 2);
420
431
  r([
421
- $()
432
+ w()
422
433
  ], s.prototype, "_init_date", 2);
423
434
  r([
424
- h({ type: Boolean, reflect: !0 })
435
+ p({ type: Boolean, reflect: !0 })
425
436
  ], s.prototype, "invalid", 2);
426
437
  r([
427
- $()
438
+ w()
428
439
  ], s.prototype, "selectedRangeDates", 2);
429
440
  r([
430
- $()
441
+ w()
431
442
  ], s.prototype, "showClearbutton", 2);
432
443
  r([
433
- b("#popover")
444
+ D("#popover")
434
445
  ], s.prototype, "$popover", 2);
435
446
  r([
436
- b("#input")
447
+ D("#input")
437
448
  ], s.prototype, "$anchor", 2);
438
449
  r([
439
- b('input[data-testid="field-input"]')
450
+ D('input[data-testid="field-input"]')
440
451
  ], s.prototype, "$input", 2);
441
452
  r([
442
- b('input[data-testid="field-input-range-end"]')
453
+ D('input[data-testid="field-input-range-end"]')
443
454
  ], s.prototype, "$input_range_end", 2);
444
455
  r([
445
- b("skf-datepicker-popup")
456
+ D("skf-datepicker-popup")
446
457
  ], s.prototype, "$datepickerPopup", 2);
447
458
  r([
448
- x({ flatten: !0 })
459
+ N({ flatten: !0 })
449
460
  ], s.prototype, "_defaultSlot", 2);
450
461
  r([
451
- M("value", { waitUntilFirstUpdate: !0, afterUpdate: !0 })
462
+ j("value", { waitUntilFirstUpdate: !0, afterUpdate: !0 })
452
463
  ], s.prototype, "_handleValueChange", 1);
453
464
  export {
454
465
  s as SkfDatepicker
@@ -2,6 +2,7 @@ import '../button/button.js';
2
2
  import '../heading/heading.js';
3
3
  import '../icon/icon.js';
4
4
  import { SkfElement } from '../../internal/components/skf-element';
5
+ import { type Language } from '../../utilities/localize.js';
5
6
  import { type CSSResultGroup } from 'lit';
6
7
  /**
7
8
  * The `<skf-dialog>` is a component that open up a dialog of type modal with the content provided. (MDN refrains from opening the dialog using the `open` attribute, however skf-dialog does not have that limitation)
@@ -23,12 +24,12 @@ import { type CSSResultGroup } from 'lit';
23
24
  export declare class SkfDialog extends SkfElement {
24
25
  #private;
25
26
  static styles: CSSResultGroup;
26
- /** If defined, sets the aria-label for the close button */
27
- closeButtonAriaLabel?: string;
28
27
  /** Title for the modal/dialog */
29
28
  heading?: string;
30
29
  /** If true, makes the dialog stretch edge to edge on screen */
31
30
  fullscreen: boolean;
31
+ /** Sets the internal language of the component */
32
+ lang: Language;
32
33
  /** If true, removes the close button */
33
34
  noCloseButton?: boolean | undefined;
34
35
  /** If defined, removes the inner padding */