@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
@@ -8,51 +8,61 @@ import { stateMap as b } from "../../internal/helpers/stateMap.js";
8
8
  import { watch as _ } from "../../internal/helpers/watch.js";
9
9
  import { ICONS as S } from "@skf-design-system/ui-assets";
10
10
  import { componentStyles as C } from "../../styles/component.styles.js";
11
- import { html as O } from "lit";
11
+ import { html as z } from "lit";
12
12
  import { property as n } from "lit/decorators.js";
13
- import { styles as w } from "./icon.styles.js";
14
- var z = Object.defineProperty, P = Object.getOwnPropertyDescriptor, p = (t, e, r, o) => {
13
+ import { styles as O } from "./icon.styles.js";
14
+ var w = Object.defineProperty, P = Object.getOwnPropertyDescriptor, l = (t, e, r, o) => {
15
15
  for (var s = o > 1 ? void 0 : o ? P(e, r) : e, m = t.length - 1, h; m >= 0; m--)
16
16
  (h = t[m]) && (s = (o ? h(e, r, s) : h(s)) || s);
17
- return o && s && z(e, r, s), s;
17
+ return o && s && w(e, r, s), s;
18
18
  };
19
19
  const x = {
20
- color: ["emphasised", "error", "info", "inverse", "primary", "secondary", "success", "warning"],
20
+ color: [
21
+ "emphasized",
22
+ "error",
23
+ "info",
24
+ "inverse",
25
+ "primary",
26
+ "purple",
27
+ "secondary",
28
+ "success",
29
+ "warning"
30
+ ],
21
31
  size: ["lg", "md", "sm", "xs"]
22
32
  };
23
- var a, l;
33
+ var a, p;
24
34
  const f = class f extends v {
25
35
  constructor() {
26
36
  super(...arguments);
27
37
  y(this, a);
28
- y(this, l);
29
- d(this, a, this.attachInternals()), d(this, l, c(this, a).states), this.color = "primary", this.size = "md";
38
+ y(this, p);
39
+ d(this, a, this.attachInternals()), d(this, p, c(this, a).states), this.color = "primary", this.size = "md";
30
40
  }
31
41
  connectedCallback() {
32
42
  super.connectedCallback(), this.ariaHidden = this.label ? null : "true", this.ariaLabel = this.label ?? null, this.role = this.label ? "img" : null;
33
43
  }
34
44
  _handleStateChange(r, o, s) {
35
- b(c(this, l), x[r]).set(s);
45
+ b(c(this, p), x[r]).set(s);
36
46
  }
37
47
  render() {
38
- return O`<div id="root">${S[this.name]}</div>`;
48
+ return z`<div id="root">${S[this.name]}</div>`;
39
49
  }
40
50
  };
41
- a = new WeakMap(), l = new WeakMap(), f.styles = [C, w];
51
+ a = new WeakMap(), p = new WeakMap(), f.styles = [C, O];
42
52
  let i = f;
43
- p([
53
+ l([
44
54
  n({ type: String })
45
55
  ], i.prototype, "color", 2);
46
- p([
56
+ l([
47
57
  n({ type: String })
48
58
  ], i.prototype, "label", 2);
49
- p([
59
+ l([
50
60
  n({ type: String })
51
61
  ], i.prototype, "name", 2);
52
- p([
62
+ l([
53
63
  n({ type: String })
54
64
  ], i.prototype, "size", 2);
55
- p([
65
+ l([
56
66
  _(["color", "size"])
57
67
  ], i.prototype, "_handleStateChange", 1);
58
68
  export {
@@ -38,12 +38,12 @@ const r = o`
38
38
  --_skf-icon-color: var(--skf-icon-color-inverse);
39
39
  }
40
40
 
41
- :host(:state(emphasised)) #root {
42
- --_skf-icon-color: var(--skf-icon-color-emphasised);
41
+ :host(:state(emphasized)) #root {
42
+ --_skf-icon-color: var(--skf-icon-color-emphasized);
43
43
  }
44
44
 
45
- :host(:state(alert)) #root {
46
- --_skf-icon-color: var(--skf-severity-fg-color-alert);
45
+ :host(:state(purple)) #root {
46
+ --_skf-icon-color: var(--skf-icon-color-purple);
47
47
  }
48
48
 
49
49
  :host(:state(error)) #root {
@@ -3,6 +3,7 @@ import { FormBase } from '../../internal/components/formBase.js';
3
3
  import '../../internal/components/hint/hint';
4
4
  import type { FormFieldSeverity } from '../../internal/types.js';
5
5
  import type { FormFieldBaseProps } from '../../internal/types/formField.js';
6
+ import { type Language } from '../../utilities/localize.js';
6
7
  import { type CSSResultGroup } from 'lit';
7
8
  /**
8
9
  * The skf-text-field is used to create a text input field. It can be used inside a form element or standalone
@@ -23,6 +24,7 @@ import { type CSSResultGroup } from 'lit';
23
24
  * behaviour: validate-on-input, validate-on-submit and native-validation
24
25
  */
25
26
  export declare class SkfInput extends FormBase implements FormFieldBaseProps {
27
+ #private;
26
28
  static styles: CSSResultGroup;
27
29
  private customError;
28
30
  /** @internal intermediary value for reset to function, e.g value attribute act as default value */
@@ -32,12 +34,6 @@ export declare class SkfInput extends FormBase implements FormFieldBaseProps {
32
34
  * [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/autocomplete) for details.
33
35
  */
34
36
  autocomplete?: HTMLInputElement['autocomplete'];
35
- /** Custom aria-label for the clear button. **Notice!** Only applicable to type=search. */
36
- buttonAriaLabelClear: string;
37
- /** Custom aria-label for the visibility button. **Notice!** Only applicable to type=password. */
38
- buttonAriaLabelHide: string;
39
- /** Custom aria-label for the visibility button **Notice!** Only applicable to type=password. */
40
- buttonAriaLabelShow: string;
41
37
  /** If defined, forces component to invalid state until removed. Its value is used as hint text. */
42
38
  set customInvalid(value: string | undefined);
43
39
  get customInvalid(): string | undefined;
@@ -54,6 +50,8 @@ export declare class SkfInput extends FormBase implements FormFieldBaseProps {
54
50
  inputmode: HTMLInputElement['inputMode'];
55
51
  /** If defined, sets the input's label. Alternatively, you can use the `label` attribute. */
56
52
  label?: string;
53
+ /** Sets the internal language of the component */
54
+ lang: Language;
57
55
  /** If defined, displays a prefix/adornment before the input-element */
58
56
  leading?: string;
59
57
  /** If defined, sets the maximum value to accept for this input */
@@ -72,8 +70,6 @@ export declare class SkfInput extends FormBase implements FormFieldBaseProps {
72
70
  placeholder?: string;
73
71
  /** If true, makes the element not mutable, meaning the user can not edit the control */
74
72
  readonly: boolean;
75
- /** If defined, renders an alternative A11y text for the asterisk */
76
- requiredLabel?: string;
77
73
  /** If defined, displays provided severity state */
78
74
  severity?: FormFieldSeverity;
79
75
  /** If true, displays valid state after interaction */
@@ -1,38 +1,46 @@
1
+ var f = (n) => {
2
+ throw TypeError(n);
3
+ };
4
+ var b = (n, o, t) => o.has(n) || f("Cannot " + t);
5
+ var c = (n, o, t) => (b(n, o, "read from private field"), t ? t.call(n) : o.get(n)), _ = (n, o, t) => o.has(n) ? f("Cannot add the same private member more than once") : o instanceof WeakSet ? o.add(n) : o.set(n, t), $ = (n, o, t, e) => (b(n, o, "write to private field"), e ? e.call(n, t) : o.set(n, t), t);
1
6
  import "../icon/icon.js";
2
- import { FormBase as c } from "../../internal/components/formBase.js";
7
+ import { FormBase as g } from "../../internal/components/formBase.js";
3
8
  import "../../internal/components/hint/hint.js";
4
- import { hintSeverity as b } from "../../internal/helpers/hintSeverity.js";
5
- import { watch as y } from "../../internal/helpers/watch.js";
6
- import { Asterisk as f } from "../../internal/templates/asterisk.js";
7
- import { componentStyles as _ } from "../../styles/component.styles.js";
8
- import { html as h, nothing as u } from "lit";
9
- import { state as p, property as s, query as $, queryAssignedNodes as g } from "lit/decorators.js";
10
- import { ifDefined as n } from "lit/directives/if-defined.js";
11
- import { live as w } from "lit/directives/live.js";
12
- import { InputNumberController as E, InputPasswordController as C } from "./input.controllers.js";
13
- import A from "./input.styles.js";
14
- var L = Object.defineProperty, P = Object.getOwnPropertyDescriptor, e = (v, t, r, a) => {
15
- for (var o = a > 1 ? void 0 : a ? P(t, r) : t, l = v.length - 1, d; l >= 0; l--)
16
- (d = v[l]) && (o = (a ? d(t, r, o) : d(o)) || o);
17
- return a && o && L(t, r, o), o;
18
- };
19
- const m = class m extends c {
9
+ import { hintSeverity as w } from "../../internal/helpers/hintSeverity.js";
10
+ import { watch as E } from "../../internal/helpers/watch.js";
11
+ import { Asterisk as P } from "../../internal/templates/asterisk.js";
12
+ import { componentStyles as C } from "../../styles/component.styles.js";
13
+ import { LocalizeController as k } from "../../utilities/localize.js";
14
+ import { html as p, nothing as m } from "lit";
15
+ import { state as v, property as a, query as S, queryAssignedNodes as x } from "lit/decorators.js";
16
+ import { ifDefined as l } from "lit/directives/if-defined.js";
17
+ import { live as B } from "lit/directives/live.js";
18
+ import { InputNumberController as A, InputPasswordController as V } from "./input.controllers.js";
19
+ import I from "./input.styles.js";
20
+ var L = Object.defineProperty, D = Object.getOwnPropertyDescriptor, s = (n, o, t, e) => {
21
+ for (var r = e > 1 ? void 0 : e ? D(o, t) : o, h = n.length - 1, d; h >= 0; h--)
22
+ (d = n[h]) && (r = (e ? d(o, t, r) : d(r)) || r);
23
+ return e && r && L(o, t, r), r;
24
+ }, u;
25
+ const y = class y extends g {
20
26
  constructor() {
21
- super(...arguments), this._value = "", this.buttonAriaLabelClear = "Clear input", this.buttonAriaLabelHide = "Hide password", this.buttonAriaLabelShow = "Show password", this.debug = !1, this.hideLabel = !1, this.inputmode = "text", this.readonly = !1, this.showValid = !1, this.size = "md", this.type = "text", this.validateOn = "change", this.invalid = !1, this._buttonDown = !1, this._numberController = new E(this), this._passwordController = new C(this), this._handleInput = () => {
27
+ super(...arguments);
28
+ _(this, u);
29
+ $(this, u, new k(this)), this._value = "", this.debug = !1, this.hideLabel = !1, this.inputmode = "text", this.lang = "en", this.readonly = !1, this.showValid = !1, this.size = "md", this.type = "text", this.validateOn = "change", this.invalid = !1, this._buttonDown = !1, this._numberController = new A(this), this._passwordController = new V(this), this._handleInput = () => {
22
30
  var t;
23
31
  this._value = ((t = this.$input) == null ? void 0 : t.value) ?? "", this.validateOn === "input" && (this._pristine = !1, this.validateInput());
24
32
  }, this._resetValue = (t) => {
25
- var r, a;
26
- t.stopPropagation(), this.value = ((r = this.getAttribute("value")) == null ? void 0 : r.trim()) ?? "", this._value = this.value, this._internals.setFormValue(this.value), (a = this.$input) == null || a.focus();
33
+ var e, r;
34
+ t.stopPropagation(), this.value = ((e = this.getAttribute("value")) == null ? void 0 : e.trim()) ?? "", this._value = this.value, this._internals.setFormValue(this.value), (r = this.$input) == null || r.focus();
27
35
  }, this._handlePressStart = (t) => {
28
36
  this._buttonDown = !0, this.type === "number" && this._numberController.handleActionBtnLongPressStart(t);
29
37
  }, this._handlePressEnd = () => {
30
38
  this._buttonDown = !1, this.type === "number" && this._numberController.handleActionBtnLongPressEnd();
31
- }, this._renderNumberButton = (t) => h`
39
+ }, this._renderNumberButton = (t) => p`
32
40
  <button
33
41
  ?disabled=${this.disabled}
34
- @click=${(r) => {
35
- this._numberController.handleActionBtnClick(r, t);
42
+ @click=${(e) => {
43
+ this._numberController.handleActionBtnClick(e, t);
36
44
  }}
37
45
  @mousedown=${this._handlePressStart}
38
46
  @mouseup=${this._handlePressEnd}
@@ -43,10 +51,10 @@ const m = class m extends c {
43
51
  >
44
52
  <skf-icon name="${t === "inc" ? "chevronUp" : "chevronDown"}" size="sm"></skf-icon>
45
53
  </button>
46
- `, this._renderPasswordButton = () => h`
54
+ `, this._renderPasswordButton = () => p`
47
55
  <button
48
56
  @click=${this._passwordController.toggleVisibility}
49
- aria-label=${n(this._passwordController._buttonAriaLabel)}
57
+ aria-label=${this._passwordController._type === "password" ? c(this, u).term("showPassword") : c(this, u).term("hidePassword")}
50
58
  class="password skf-icon-host"
51
59
  type="button"
52
60
  @mousedown="${this._handlePressStart}"
@@ -55,13 +63,13 @@ const m = class m extends c {
55
63
  >
56
64
  <skf-icon name=${this._passwordController._icon} size="sm"></skf-icon>
57
65
  </button>
58
- `, this._renderSearchButton = () => h`
66
+ `, this._renderSearchButton = () => p`
59
67
  <button
60
68
  @click=${this._resetValue}
61
69
  @mousedown=${this._handlePressStart}
62
70
  @mouseup=${this._handlePressEnd}
63
71
  @mouseleave=${this._handlePressEnd}
64
- aria-label=${n(this.buttonAriaLabelClear)}
72
+ aria-label=${c(this, u).term("clearEntry")}
65
73
  class="search skf-icon-host"
66
74
  type="button"
67
75
  >
@@ -88,71 +96,71 @@ const m = class m extends c {
88
96
  firstUpdated() {
89
97
  var t;
90
98
  (t = this.$input) == null || t.addEventListener("change", () => {
91
- var r;
92
- this.validateOn === "change" && (this.validateOn = "input", this._pristine = !1), this._internals.setFormValue(((r = this.$input) == null ? void 0 : r.value) ?? ""), this.emitEvent("change"), this.validateInput();
93
- }), this.addEventListener("invalid", (r) => {
94
- this._pristine = !1, this.invalid = !0, this.customErrorDisplay && r.preventDefault();
99
+ var e;
100
+ this.validateOn === "change" && (this.validateOn = "input", this._pristine = !1), this._internals.setFormValue(((e = this.$input) == null ? void 0 : e.value) ?? ""), this.emitEvent("change"), this.validateInput();
101
+ }), this.addEventListener("invalid", (e) => {
102
+ this._pristine = !1, this.invalid = !0, this.customErrorDisplay && e.preventDefault();
95
103
  }), this.addEventListener("reset", this._resetValue), this.validateInput();
96
104
  }
97
105
  willUpdate(t) {
98
106
  if (t.has("invalid"))
99
107
  if (this.invalid) {
100
108
  this.setAttribute("invalid", ""), this.showValid || this.removeAttribute("valid");
101
- const r = this._internals.validationMessage;
102
- this.hint = r !== "" ? this._internals.validationMessage : "", this.checkValidity();
109
+ const e = this._internals.validationMessage;
110
+ this.hint = e !== "" ? this._internals.validationMessage : "", this.checkValidity();
103
111
  } else
104
112
  this.removeAttribute("invalid"), !this._pristine && this.showValid && this.setAttribute("valid", "true"), this.hint = this.getAttribute("hint") ?? "";
105
113
  }
106
114
  valueChanged() {
107
115
  this._internals.setFormValue(this.value), this.validateInput();
108
116
  }
109
- attributeChangedCallback(t, r, a) {
110
- if (super.attributeChangedCallback(t, r, a), t === "value" && this._internals.setFormValue(a), t === "custom-invalid")
111
- if (typeof a == "string") {
112
- const l = this.withFallback(a);
113
- this._pristine = !1, this._internals.setValidity({ customError: !0 }, l), this.invalid = !0, this.hint = l, this.checkValidity();
117
+ attributeChangedCallback(t, e, r) {
118
+ if (super.attributeChangedCallback(t, e, r), t === "value" && this._internals.setFormValue(r), t === "custom-invalid")
119
+ if (typeof r == "string") {
120
+ const d = this.withFallback(r);
121
+ this._pristine = !1, this._internals.setValidity({ customError: !0 }, d), this.invalid = !0, this.hint = d, this.checkValidity();
114
122
  } else
115
123
  this._internals.setValidity({}), this.validateInput();
116
124
  }
117
125
  /** @internal */
118
126
  validateInput() {
119
127
  if (this._internals.validity.customError || !this.$input) return;
120
- const r = this.$input.validity;
121
- if (this.invalid = !1, r.valid)
128
+ const e = this.$input.validity;
129
+ if (this.invalid = !1, e.valid)
122
130
  this._internals.setValidity({ customError: this._internals.validity.customError });
123
131
  else {
124
- this.invalid = !this._pristine && !r.valid;
125
- let a;
126
- for (a in r) {
127
- const o = `data-${a.toString()}`;
128
- if (r[a] && !this.hasAttribute(o) && this.debug && console.log(
129
- `Add custom message on ${this.localName} using attribute: ${o.toUpperCase()}="Your custom message"`
130
- ), r[a]) {
131
- this.validationError = a.toString();
132
- const l = this.hasAttribute(o) ? this.getAttribute(o) : this.$input.validationMessage;
132
+ this.invalid = !this._pristine && !e.valid;
133
+ let r;
134
+ for (r in e) {
135
+ const h = `data-${r.toString()}`;
136
+ if (e[r] && !this.hasAttribute(h) && this.debug && console.log(
137
+ `Add custom message on ${this.localName} using attribute: ${h.toUpperCase()}="Your custom message"`
138
+ ), e[r]) {
139
+ this.validationError = r.toString();
140
+ const d = this.hasAttribute(h) ? this.getAttribute(h) : this.$input.validationMessage;
133
141
  this._internals.setValidity(
134
142
  { [this.validationError]: !0, customError: this._internals.validity.customError },
135
- this.withFallback(l)
143
+ this.withFallback(d)
136
144
  ), this.invalid && this.customErrorDisplay && this.checkValidity();
137
145
  }
138
146
  }
139
147
  }
140
148
  }
141
149
  render() {
142
- var r, a, o, l;
143
- const t = (this._defaultSlot.length === 0 || !((a = (r = this._defaultSlot[0]) == null ? void 0 : r.textContent) != null && a.trim())) && !this.label;
144
- return h`
150
+ var e, r, h, d;
151
+ const t = (this._defaultSlot.length === 0 || !((r = (e = this._defaultSlot[0]) == null ? void 0 : e.textContent) != null && r.trim())) && !this.label;
152
+ return p`
145
153
  <div id="root">
146
154
  <label>
147
155
  <div class=${this.hideLabel ? "visually-hidden" : ""} ?hidden=${t} id="label">
148
156
  <slot>${this.label}</slot>
149
- ${this.required ? f(this.requiredLabel) : null}
157
+ ${this.required ? P(c(this, u).term("required")) : m}
150
158
  </div>
151
159
  <div id="input">
152
- ${this.type === "search" ? h`<skf-icon class="skf-icon-host" name="search" size="sm"></skf-icon>` : u}
160
+ ${this.type === "search" ? p`<skf-icon class="skf-icon-host" name="search" size="sm"></skf-icon>` : m}
153
161
  <div
154
- data-leading=${n(this.leading)}
155
- data-trailing=${n(this.trailing)}
162
+ data-leading=${l(this.leading)}
163
+ data-trailing=${l(this.trailing)}
156
164
  id="affix"
157
165
  >
158
166
  <input
@@ -160,41 +168,41 @@ const m = class m extends c {
160
168
  ?readonly=${this.readonly}
161
169
  ?required=${this.required}
162
170
  .autocomplete=${this.autocomplete ?? "off"}
163
- .value=${w(this.value)}
171
+ .value=${B(this.value)}
164
172
  @blur=${this._onBlur}
165
173
  @input=${this._handleInput}
166
- aria-describedby=${n((o = this.hint) != null && o.trim() ? "hint" : u)}
167
- aria-errormessage=${n((l = this.hint) != null && l.trim() ? "hint" : u)}
174
+ aria-describedby=${l((h = this.hint) != null && h.trim() ? "hint" : m)}
175
+ aria-errormessage=${l((d = this.hint) != null && d.trim() ? "hint" : m)}
168
176
  aria-invalid=${!!this.invalid}
169
177
  data-testid="field-input"
170
- inputmode=${n(this.inputMode)}
171
- max=${n(this.max)}
172
- maxlength=${n(this.maxLength)}
173
- min=${n(this.min)}
174
- minlength=${n(this.minLength)}
175
- name=${n(this.name)}
176
- pattern=${n(this.pattern)}
177
- placeholder=${n(this.placeholder)}
178
- type=${n(
178
+ inputmode=${l(this.inputMode)}
179
+ max=${l(this.max)}
180
+ maxlength=${l(this.maxLength)}
181
+ min=${l(this.min)}
182
+ minlength=${l(this.minLength)}
183
+ name=${l(this.name)}
184
+ pattern=${l(this.pattern)}
185
+ placeholder=${l(this.placeholder)}
186
+ type=${l(
179
187
  this.type === "password" ? this._passwordController._type : this.type
180
188
  )}
181
189
  />
182
190
  </div>
183
- ${this.type === "number" ? h`
191
+ ${this.type === "number" ? p`
184
192
  <div id="action">
185
193
  ${this._renderNumberButton("inc")} ${this._renderNumberButton("dec")}
186
194
  </div>
187
- ` : u}
188
- ${this.type === "password" ? this._renderPasswordButton() : u}
189
- ${this.type === "search" && this._value.length > 0 ? this._renderSearchButton() : u}
195
+ ` : m}
196
+ ${this.type === "password" ? this._renderPasswordButton() : m}
197
+ ${this.type === "search" && this._value.length > 0 ? this._renderSearchButton() : m}
190
198
  </div>
191
199
  </label>
192
- ${this.hint && h`
200
+ ${this.hint && p`
193
201
  <skf-hint
194
202
  ?disabled=${this.disabled}
195
203
  aria-live=${this.invalid ? "assertive" : "polite"}
196
204
  id="hint"
197
- severity=${n(b(this.invalid, this.severity))}
205
+ severity=${l(w(this.invalid, this.severity))}
198
206
  >${this.customInvalid ?? this.hint}
199
207
  </skf-hint>
200
208
  `}
@@ -202,106 +210,97 @@ const m = class m extends c {
202
210
  `;
203
211
  }
204
212
  };
205
- m.styles = [_, A];
206
- let i = m;
207
- e([
208
- p()
213
+ u = new WeakMap(), y.styles = [C, I];
214
+ let i = y;
215
+ s([
216
+ v()
209
217
  ], i.prototype, "_value", 2);
210
- e([
211
- s()
218
+ s([
219
+ a()
212
220
  ], i.prototype, "autocomplete", 2);
213
- e([
214
- s({ attribute: "button-aria-label-clear" })
215
- ], i.prototype, "buttonAriaLabelClear", 2);
216
- e([
217
- s({ attribute: "button-aria-label-hide" })
218
- ], i.prototype, "buttonAriaLabelHide", 2);
219
- e([
220
- s({ attribute: "button-aria-label-show" })
221
- ], i.prototype, "buttonAriaLabelShow", 2);
222
- e([
223
- s({ attribute: "custom-invalid", reflect: !0 })
221
+ s([
222
+ a({ attribute: "custom-invalid", reflect: !0 })
224
223
  ], i.prototype, "customInvalid", 1);
225
- e([
226
- s({ type: Boolean })
224
+ s([
225
+ a({ type: Boolean })
227
226
  ], i.prototype, "debug", 2);
228
- e([
229
- s({ type: Boolean, attribute: "hide-label" })
227
+ s([
228
+ a({ type: Boolean, attribute: "hide-label" })
230
229
  ], i.prototype, "hideLabel", 2);
231
- e([
232
- s()
230
+ s([
231
+ a()
233
232
  ], i.prototype, "hint", 2);
234
- e([
235
- s()
233
+ s([
234
+ a()
236
235
  ], i.prototype, "inputmode", 2);
237
- e([
238
- s()
236
+ s([
237
+ a()
239
238
  ], i.prototype, "label", 2);
240
- e([
241
- s()
239
+ s([
240
+ a({ type: String })
241
+ ], i.prototype, "lang", 2);
242
+ s([
243
+ a()
242
244
  ], i.prototype, "leading", 2);
243
- e([
244
- s()
245
+ s([
246
+ a()
245
247
  ], i.prototype, "max", 2);
246
- e([
247
- s({ type: Number, attribute: "maxlength" })
248
+ s([
249
+ a({ type: Number, attribute: "maxlength" })
248
250
  ], i.prototype, "maxLength", 2);
249
- e([
250
- s()
251
+ s([
252
+ a()
251
253
  ], i.prototype, "min", 2);
252
- e([
253
- s({ type: Number, attribute: "minlength" })
254
+ s([
255
+ a({ type: Number, attribute: "minlength" })
254
256
  ], i.prototype, "minLength", 2);
255
- e([
256
- s({ reflect: !0 })
257
+ s([
258
+ a({ reflect: !0 })
257
259
  ], i.prototype, "name", 2);
258
- e([
259
- s()
260
+ s([
261
+ a()
260
262
  ], i.prototype, "pattern", 2);
261
- e([
262
- s()
263
+ s([
264
+ a()
263
265
  ], i.prototype, "placeholder", 2);
264
- e([
265
- s({ type: Boolean })
266
+ s([
267
+ a({ type: Boolean })
266
268
  ], i.prototype, "readonly", 2);
267
- e([
268
- s({ attribute: "required-label" })
269
- ], i.prototype, "requiredLabel", 2);
270
- e([
271
- s({ reflect: !0 })
269
+ s([
270
+ a({ reflect: !0 })
272
271
  ], i.prototype, "severity", 2);
273
- e([
274
- s({ type: Boolean, attribute: "show-valid" })
272
+ s([
273
+ a({ type: Boolean, attribute: "show-valid" })
275
274
  ], i.prototype, "showValid", 2);
276
- e([
277
- s({ reflect: !0 })
275
+ s([
276
+ a({ reflect: !0 })
278
277
  ], i.prototype, "size", 2);
279
- e([
280
- s()
278
+ s([
279
+ a()
281
280
  ], i.prototype, "trailing", 2);
282
- e([
283
- s()
281
+ s([
282
+ a()
284
283
  ], i.prototype, "type", 2);
285
- e([
286
- s({ attribute: "validate-on" })
284
+ s([
285
+ a({ attribute: "validate-on" })
287
286
  ], i.prototype, "validateOn", 2);
288
- e([
289
- s({})
287
+ s([
288
+ a({})
290
289
  ], i.prototype, "value", 1);
291
- e([
292
- p()
290
+ s([
291
+ v()
293
292
  ], i.prototype, "invalid", 2);
294
- e([
295
- p()
293
+ s([
294
+ v()
296
295
  ], i.prototype, "_buttonDown", 2);
297
- e([
298
- $("input")
296
+ s([
297
+ S("input")
299
298
  ], i.prototype, "$input", 2);
300
- e([
301
- g({ flatten: !0 })
299
+ s([
300
+ x({ flatten: !0 })
302
301
  ], i.prototype, "_defaultSlot", 2);
303
- e([
304
- y("value", { waitUntilFirstUpdate: !0, afterUpdate: !0 })
302
+ s([
303
+ E("value", { waitUntilFirstUpdate: !0, afterUpdate: !0 })
305
304
  ], i.prototype, "valueChanged", 1);
306
305
  export {
307
306
  i as SkfInput
@@ -38,7 +38,6 @@ export declare class InputPasswordController implements ReactiveController {
38
38
  host?: ReactiveControllerHost & Partial<ControllerHostProps>;
39
39
  _inputElement?: HTMLInputElement;
40
40
  _icon: Extract<Icon, 'visibility' | 'visibilityOff'>;
41
- _buttonAriaLabel: string;
42
41
  _type: Extract<SkfInput['type'], 'password' | 'text'>;
43
42
  constructor(host: ReactiveControllerHost);
44
43
  hostUpdated(): void;
@@ -1,14 +1,14 @@
1
- class l {
1
+ class o {
2
2
  constructor(t) {
3
- this.handleActionBtnClick = (i, s) => {
3
+ this.handleActionBtnClick = (s, i) => {
4
4
  var h, n;
5
5
  const e = this._inputElement;
6
- !e || !this.host || (s === "inc" ? e.stepUp() : e.stepDown(), this.host.value = ((h = this._inputElement) == null ? void 0 : h.value) ?? "", (n = this.host._internals) == null || n.setFormValue(this.host.value), this.host.validateInput && this.host.validateInput());
7
- }, this.handleActionBtnLongPressStart = (i) => {
8
- const s = i.target.getAttribute("aria-label") === "Increment" ? "inc" : "dec";
6
+ !e || !this.host || (i === "inc" ? e.stepUp() : e.stepDown(), this.host.value = ((h = this._inputElement) == null ? void 0 : h.value) ?? "", (n = this.host._internals) == null || n.setFormValue(this.host.value), this.host.validateInput && this.host.validateInput());
7
+ }, this.handleActionBtnLongPressStart = (s) => {
8
+ const i = s.target.getAttribute("aria-label") === "Increment" ? "inc" : "dec";
9
9
  this._longPressId = setTimeout(() => {
10
10
  this._repeaterId = setInterval(() => {
11
- this.handleActionBtnClick(i, s);
11
+ this.handleActionBtnClick(s, i);
12
12
  }, 50);
13
13
  }, 400);
14
14
  }, this.handleActionBtnLongPressEnd = () => {
@@ -23,12 +23,12 @@ class l {
23
23
  class a {
24
24
  constructor(t) {
25
25
  this._icon = "visibility", this._type = "password", this.handleFieldLoaded = () => {
26
- var i;
27
- !this._inputElement || !((i = this.host) != null && i._handleInput) || (this.host.value = this._inputElement.value, this.host._handleInput());
26
+ var s;
27
+ !this._inputElement || !((s = this.host) != null && s._handleInput) || (this.host.value = this._inputElement.value, this.host._handleInput());
28
28
  }, this.toggleVisibility = () => {
29
- var i;
30
- !this._inputElement || !((i = this.host) != null && i._handleInput) || (this.host._handleInput(), this._type === "text" ? (this._buttonAriaLabel = this.host.buttonAriaLabelShow ?? "", this._icon = "visibility", this._type = "password") : (this._buttonAriaLabel = this.host.buttonAriaLabelHide ?? "", this._icon = "visibilityOff", this._type = "text"), this.host.requestUpdate(), this._inputElement.value = this.host.value ?? "");
31
- }, (this.host = t).addController(this), this._buttonAriaLabel = this.host.buttonAriaLabelShow ?? "";
29
+ var s;
30
+ !this._inputElement || !((s = this.host) != null && s._handleInput) || (this.host._handleInput(), this._type === "text" ? (this._icon = "visibility", this._type = "password") : (this._icon = "visibilityOff", this._type = "text"), this.host.requestUpdate(), this._inputElement.value = this.host.value ?? "");
31
+ }, (this.host = t).addController(this);
32
32
  }
33
33
  hostUpdated() {
34
34
  var t;
@@ -36,6 +36,6 @@ class a {
36
36
  }
37
37
  }
38
38
  export {
39
- l as InputNumberController,
39
+ o as InputNumberController,
40
40
  a as InputPasswordController
41
41
  };