@skf-design-system/ui-components 1.0.2-beta.6 → 1.0.2-beta.9

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 (90) hide show
  1. package/README.md +18 -0
  2. package/dist/components/alert/alert.component.d.ts +3 -2
  3. package/dist/components/alert/alert.component.js +39 -33
  4. package/dist/components/button/button.styles.js +3 -3
  5. package/dist/components/checkbox/checkbox.component.d.ts +6 -5
  6. package/dist/components/checkbox/checkbox.component.js +77 -76
  7. package/dist/components/checkbox/checkbox.styles.js +1 -1
  8. package/dist/components/datepicker/datepicker-calendar.component.d.ts +4 -0
  9. package/dist/components/datepicker/datepicker-calendar.component.js +134 -127
  10. package/dist/components/datepicker/datepicker-popup.component.d.ts +4 -0
  11. package/dist/components/datepicker/datepicker-popup.component.js +100 -88
  12. package/dist/components/datepicker/datepicker.component.d.ts +4 -2
  13. package/dist/components/datepicker/datepicker.component.js +150 -140
  14. package/dist/components/dialog/dialog.component.d.ts +3 -2
  15. package/dist/components/dialog/dialog.component.js +39 -37
  16. package/dist/components/divider/divider.component.js +13 -13
  17. package/dist/components/divider/divider.styles.js +2 -2
  18. package/dist/components/drawer/drawer.component.d.ts +3 -2
  19. package/dist/components/drawer/drawer.component.js +37 -35
  20. package/dist/components/drawer/drawer.styles.js +1 -1
  21. package/dist/components/header/header.component.d.ts +4 -2
  22. package/dist/components/header/header.component.js +66 -57
  23. package/dist/components/header/header.styles.js +2 -2
  24. package/dist/components/icon/icon.component.js +26 -16
  25. package/dist/components/icon/icon.styles.js +4 -4
  26. package/dist/components/input/input.component.d.ts +4 -8
  27. package/dist/components/input/input.component.js +146 -147
  28. package/dist/components/input/input.controllers.d.ts +0 -1
  29. package/dist/components/input/input.controllers.js +12 -12
  30. package/dist/components/link/link.component.js +19 -12
  31. package/dist/components/link/link.styles.js +11 -3
  32. package/dist/components/loader/loader.component.d.ts +0 -2
  33. package/dist/components/loader/loader.component.js +27 -30
  34. package/dist/components/loader/loader.styles.js +1 -1
  35. package/dist/components/menu/menu-item.styles.js +8 -7
  36. package/dist/components/menu/menu.component.d.ts +4 -1
  37. package/dist/components/nav/nav.component.d.ts +3 -0
  38. package/dist/components/nav/nav.component.js +38 -33
  39. package/dist/components/popover/popover.component.d.ts +6 -3
  40. package/dist/components/progress/progress.styles.js +3 -3
  41. package/dist/components/radio/radio.component.d.ts +4 -2
  42. package/dist/components/radio/radio.component.js +91 -83
  43. package/dist/components/radio/radio.styles.js +1 -1
  44. package/dist/components/segmented-button/segmented-button-item.component.js +1 -1
  45. package/dist/components/segmented-button/segmented-button-item.styles.js +1 -1
  46. package/dist/components/select/select-option.component.d.ts +2 -2
  47. package/dist/components/select/select-option.component.js +16 -19
  48. package/dist/components/select/select.component.d.ts +13 -9
  49. package/dist/components/select/select.component.js +169 -144
  50. package/dist/components/stepper/stepper-item.styles.js +4 -4
  51. package/dist/components/switch/switch.component.d.ts +4 -2
  52. package/dist/components/switch/switch.component.js +64 -56
  53. package/dist/components/switch/switch.styles.js +1 -1
  54. package/dist/components/tabs/tab.styles.js +2 -2
  55. package/dist/components/tag/tag.component.d.ts +3 -0
  56. package/dist/components/tag/tag.component.js +50 -41
  57. package/dist/components/textarea/textarea.component.d.ts +4 -2
  58. package/dist/components/textarea/textarea.component.js +126 -118
  59. package/dist/components/tooltip/tooltip.component.d.ts +8 -2
  60. package/dist/components/tooltip/tooltip.component.js +3 -0
  61. package/dist/custom-elements.json +734 -372
  62. package/dist/internal/base-classes/popover/popover.base.d.ts +21 -2
  63. package/dist/internal/base-classes/popover/popover.base.js +10 -12
  64. package/dist/internal/components/formBase.d.ts +1 -0
  65. package/dist/internal/components/formBase.js +11 -19
  66. package/dist/internal/controllers/popover.controller.d.ts +2 -0
  67. package/dist/internal/helpers/uuid.d.ts +8 -10
  68. package/dist/internal/helpers/uuid.js +4 -11
  69. package/dist/internal/helpers/watch.d.ts +1 -1
  70. package/dist/internal/templates/asterisk.d.ts +1 -1
  71. package/dist/internal/templates/asterisk.js +4 -4
  72. package/dist/styles/global-alt.css +1 -1
  73. package/dist/styles/global.css +1 -1
  74. package/dist/translations/en.d.ts +3 -0
  75. package/dist/translations/en.js +27 -0
  76. package/dist/translations/es.d.ts +3 -0
  77. package/dist/translations/es.js +27 -0
  78. package/dist/translations/index.d.ts +4 -0
  79. package/dist/translations/pt.d.ts +3 -0
  80. package/dist/translations/pt.js +27 -0
  81. package/dist/translations/sv.d.ts +3 -0
  82. package/dist/translations/sv.js +27 -0
  83. package/dist/types/jsx/custom-element-jsx.d.ts +1823 -846
  84. package/dist/types/vue/index.d.ts +59 -47
  85. package/dist/utilities/localize.d.ts +28 -0
  86. package/dist/utilities/localize.js +13 -0
  87. package/dist/vscode.html-custom-data.json +75 -80
  88. package/dist/web-types.json +205 -169
  89. package/package.json +27 -34
  90. package/custom-elements.json +0 -25490
@@ -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,75 +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
347
356
  ?disabled=${this.disabled}
348
357
  aria-live=${this.invalid ? "assertive" : "polite"}
349
358
  id="hint"
350
- severity=${u(O(this.invalid, this.severity))}
359
+ severity=${v(L(this.invalid, this.severity))}
351
360
  >${this.customInvalid ?? this.hint}
352
361
  </skf-hint>
353
362
  `}
@@ -357,99 +366,100 @@ const _ = class _ extends C {
357
366
  <skf-datepicker-popup
358
367
  ?range=${this.range}
359
368
  id=${this.id}
360
- invalid-dates=${u(this.invalidDates)}
361
- selectable-from=${u(this.selectableFrom)}
362
- 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)}
363
373
  ></skf-datepicker-popup>
364
374
  </div>
365
375
  `;
366
376
  }
367
377
  };
368
- _.styles = [B, A];
369
- let s = _;
378
+ b = new WeakMap(), F.styles = [q, W];
379
+ let s = F;
370
380
  r([
371
- h({ attribute: "custom-invalid", reflect: !0 })
381
+ p({ attribute: "custom-invalid", reflect: !0 })
372
382
  ], s.prototype, "customInvalid", 1);
373
383
  r([
374
- h({ type: String })
384
+ p({ type: String })
375
385
  ], s.prototype, "id", 2);
376
386
  r([
377
- h()
387
+ p()
378
388
  ], s.prototype, "label", 2);
379
389
  r([
380
- h({ type: Boolean, attribute: "hide-label" })
390
+ p({ type: String })
391
+ ], s.prototype, "lang", 2);
392
+ r([
393
+ p({ type: Boolean, attribute: "hide-label" })
381
394
  ], s.prototype, "hideLabel", 2);
382
395
  r([
383
- h()
396
+ p()
384
397
  ], s.prototype, "hint", 2);
385
398
  r([
386
- h({ attribute: "invalid-dates" })
399
+ p({ attribute: "invalid-dates" })
387
400
  ], s.prototype, "invalidDates", 2);
388
401
  r([
389
- h({ reflect: !0 })
402
+ p({ reflect: !0 })
390
403
  ], s.prototype, "name", 2);
391
404
  r([
392
- h()
405
+ p()
393
406
  ], s.prototype, "placeholder", 2);
394
407
  r([
395
- h({ type: Boolean })
408
+ p({ type: Boolean })
396
409
  ], s.prototype, "range", 2);
397
410
  r([
398
- h({ type: Boolean })
411
+ p({ type: Boolean })
399
412
  ], s.prototype, "readonly", 2);
400
413
  r([
401
- h({ attribute: "required-label" })
402
- ], s.prototype, "requiredLabel", 2);
403
- r([
404
- h({ attribute: "selectable-from" })
414
+ p({ attribute: "selectable-from" })
405
415
  ], s.prototype, "selectableFrom", 2);
406
416
  r([
407
- h({ attribute: "selectable-to" })
417
+ p({ attribute: "selectable-to" })
408
418
  ], s.prototype, "selectableTo", 2);
409
419
  r([
410
- h({ reflect: !0 })
420
+ p({ reflect: !0 })
411
421
  ], s.prototype, "severity", 2);
412
422
  r([
413
- h({ reflect: !0 })
423
+ p({ reflect: !0 })
414
424
  ], s.prototype, "size", 2);
415
425
  r([
416
- h({ type: String, attribute: "validate-on" })
426
+ p({ type: String, attribute: "validate-on" })
417
427
  ], s.prototype, "validateOn", 2);
418
428
  r([
419
- h()
429
+ p()
420
430
  ], s.prototype, "value", 2);
421
431
  r([
422
- $()
432
+ w()
423
433
  ], s.prototype, "_init_date", 2);
424
434
  r([
425
- h({ type: Boolean, reflect: !0 })
435
+ p({ type: Boolean, reflect: !0 })
426
436
  ], s.prototype, "invalid", 2);
427
437
  r([
428
- $()
438
+ w()
429
439
  ], s.prototype, "selectedRangeDates", 2);
430
440
  r([
431
- $()
441
+ w()
432
442
  ], s.prototype, "showClearbutton", 2);
433
443
  r([
434
- b("#popover")
444
+ D("#popover")
435
445
  ], s.prototype, "$popover", 2);
436
446
  r([
437
- b("#input")
447
+ D("#input")
438
448
  ], s.prototype, "$anchor", 2);
439
449
  r([
440
- b('input[data-testid="field-input"]')
450
+ D('input[data-testid="field-input"]')
441
451
  ], s.prototype, "$input", 2);
442
452
  r([
443
- b('input[data-testid="field-input-range-end"]')
453
+ D('input[data-testid="field-input-range-end"]')
444
454
  ], s.prototype, "$input_range_end", 2);
445
455
  r([
446
- b("skf-datepicker-popup")
456
+ D("skf-datepicker-popup")
447
457
  ], s.prototype, "$datepickerPopup", 2);
448
458
  r([
449
- x({ flatten: !0 })
459
+ N({ flatten: !0 })
450
460
  ], s.prototype, "_defaultSlot", 2);
451
461
  r([
452
- M("value", { waitUntilFirstUpdate: !0, afterUpdate: !0 })
462
+ j("value", { waitUntilFirstUpdate: !0, afterUpdate: !0 })
453
463
  ], s.prototype, "_handleValueChange", 1);
454
464
  export {
455
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 */