@skf-design-system/ui-components 1.0.2-beta.10 → 1.0.2-beta.11

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.
@@ -42,6 +42,7 @@ export declare class SkfLink extends SkfElement {
42
42
  target?: '_blank' | '_parent' | '_self' | '_top';
43
43
  connectedCallback(): void;
44
44
  _handleAsChange(): void;
45
+ _handleDisabledChange(): void;
45
46
  /** @internal */
46
47
  _handleStateChange(property: string, _prev: unknown, next: unknown): void;
47
48
  /** @internal */
@@ -1,34 +1,34 @@
1
- var b = (e) => {
1
+ var g = (e) => {
2
2
  throw TypeError(e);
3
3
  };
4
- var g = (e, i, t) => i.has(e) || b("Cannot " + t);
5
- var d = (e, i, t) => (g(e, i, "read from private field"), t ? t.call(e) : i.get(e)), f = (e, i, t) => i.has(e) ? b("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(e) : i.set(e, t), m = (e, i, t, s) => (g(e, i, "write to private field"), s ? s.call(e, t) : i.set(e, t), t);
4
+ var _ = (e, i, t) => i.has(e) || g("Cannot " + t);
5
+ var c = (e, i, t) => (_(e, i, "read from private field"), t ? t.call(e) : i.get(e)), f = (e, i, t) => i.has(e) ? g("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(e) : i.set(e, t), y = (e, i, t, h) => (_(e, i, "write to private field"), h ? h.call(e, t) : i.set(e, t), t);
6
6
  import "../icon/icon.js";
7
- import { SkfElement as C } from "../../internal/components/skf-element.js";
7
+ import { SkfElement as w } from "../../internal/components/skf-element.js";
8
8
  import { stateMap as k } from "../../internal/helpers/stateMap.js";
9
- import { watch as v } from "../../internal/helpers/watch.js";
9
+ import { watch as b } from "../../internal/helpers/watch.js";
10
10
  import { componentStyles as S } from "../../styles/component.styles.js";
11
- import { nothing as y } from "lit";
12
- import { property as n } from "lit/decorators.js";
13
- import { ifDefined as x } from "lit/directives/if-defined.js";
14
- import { html as _ } from "lit/static-html.js";
15
- import { styles as A } from "./link.styles.js";
16
- var D = Object.defineProperty, E = Object.getOwnPropertyDescriptor, r = (e, i, t, s) => {
17
- for (var h = s > 1 ? void 0 : s ? E(i, t) : i, p = e.length - 1, c; p >= 0; p--)
18
- (c = e[p]) && (h = (s ? c(i, t, h) : c(h)) || h);
19
- return s && h && D(i, t, h), h;
11
+ import { nothing as m } from "lit";
12
+ import { property as s } from "lit/decorators.js";
13
+ import { ifDefined as D } from "lit/directives/if-defined.js";
14
+ import { html as v } from "lit/static-html.js";
15
+ import { styles as x } from "./link.styles.js";
16
+ var A = Object.defineProperty, E = Object.getOwnPropertyDescriptor, r = (e, i, t, h) => {
17
+ for (var n = h > 1 ? void 0 : h ? E(i, t) : i, p = e.length - 1, d; p >= 0; p--)
18
+ (d = e[p]) && (n = (h ? d(i, t, n) : d(n)) || n);
19
+ return h && n && A(i, t, n), n;
20
20
  };
21
- const w = {
21
+ const C = {
22
22
  color: ["inverse", "primary"],
23
23
  stretch: "stretch"
24
24
  };
25
25
  var a, l;
26
- const u = class u extends C {
26
+ const u = class u extends w {
27
27
  constructor() {
28
28
  super(...arguments);
29
29
  f(this, a);
30
30
  f(this, l);
31
- m(this, a, this.attachInternals()), m(this, l, d(this, a).states), this.as = "link", this.color = "primary", this.disabled = !1, this.download = !1, this.iconRight = !1, this.stretch = !1, this._handleClick = () => {
31
+ y(this, a, this.attachInternals()), y(this, l, c(this, a).states), this.as = "link", this.color = "primary", this.disabled = !1, this.download = !1, this.iconRight = !1, this.stretch = !1, this._handleClick = () => {
32
32
  if (!(this.as === "button" && this.disabled) && (this.emit("skf-link-click", { detail: { href: this.href, route: this.route } }), this.as === "link" && !this.route && this.href?.trim()))
33
33
  if (this.target)
34
34
  window.open(this.href, this.target);
@@ -40,80 +40,86 @@ const u = class u extends C {
40
40
  };
41
41
  }
42
42
  connectedCallback() {
43
- super.connectedCallback(), this.ariaDisabled = this.as === "button" && this.disabled ? "true" : null, this.role = this.as;
44
- const t = this.hasAttribute("tabindex") ? Number(this.getAttribute("tabindex")) : 0;
45
- this.ariaDisabled !== "true" && (this.tabIndex = t), this.addEventListener("keydown", (s) => {
46
- (s.key === "Enter" || s.key === " ") && this._handleClick();
43
+ super.connectedCallback(), this.role = this.as, this.addEventListener("keydown", (t) => {
44
+ (t.key === "Enter" || t.key === " ") && this._handleClick();
47
45
  }), this.addEventListener("click", this._handleClick);
48
46
  }
49
47
  _handleAsChange() {
50
48
  this.as === "button" ? this.setAttribute("type", "button") : this.removeAttribute("type");
51
49
  }
52
- _handleStateChange(t, s, h) {
53
- k(d(this, l), w[t]).set(h);
50
+ _handleDisabledChange() {
51
+ this.ariaDisabled = this.as === "button" && this.disabled ? "true" : null;
52
+ const t = this.hasAttribute("tabindex") ? Number(this.getAttribute("tabindex")) : 0;
53
+ this.ariaDisabled !== "true" && (this.tabIndex = t);
54
+ }
55
+ _handleStateChange(t, h, n) {
56
+ k(c(this, l), C[t]).set(n);
54
57
  }
55
58
  /** @internal */
56
59
  _renderIcon() {
57
60
  const t = this.color === "inverse" ? "inverse" : "emphasized";
58
- return _`
61
+ return v`
59
62
  <skf-icon
60
63
  color=${t}
61
- data-color=${this.disabled ? "custom" : y}
62
- name=${x(this.icon)}
64
+ data-color=${this.disabled ? "custom" : m}
65
+ name=${D(this.icon)}
63
66
  size="sm"
64
67
  ></skf-icon>
65
68
  `;
66
69
  }
67
70
  render() {
68
- return _`
71
+ return v`
69
72
  <div id="root" part="root">
70
- ${this.icon && !this.iconRight ? this._renderIcon() : y}
73
+ ${this.icon && !this.iconRight ? this._renderIcon() : m}
71
74
  <slot></slot>
72
- ${this.icon && this.iconRight ? this._renderIcon() : y}
75
+ ${this.icon && this.iconRight ? this._renderIcon() : m}
73
76
  </div>
74
77
  `;
75
78
  }
76
79
  };
77
- a = new WeakMap(), l = new WeakMap(), u.styles = [S, A];
80
+ a = new WeakMap(), l = new WeakMap(), u.styles = [S, x];
78
81
  let o = u;
79
82
  r([
80
- n({ type: String })
83
+ s({ type: String })
81
84
  ], o.prototype, "as", 2);
82
85
  r([
83
- n({ type: String })
86
+ s({ type: String })
84
87
  ], o.prototype, "color", 2);
85
88
  r([
86
- n({ type: Boolean })
89
+ s({ type: Boolean })
87
90
  ], o.prototype, "disabled", 2);
88
91
  r([
89
- n({ type: Boolean })
92
+ s({ type: Boolean })
90
93
  ], o.prototype, "download", 2);
91
94
  r([
92
- n({ type: String })
95
+ s({ type: String })
93
96
  ], o.prototype, "href", 2);
94
97
  r([
95
- n({ type: String })
98
+ s({ type: String })
96
99
  ], o.prototype, "icon", 2);
97
100
  r([
98
- n({ type: Boolean, attribute: "icon-right" })
101
+ s({ type: Boolean, attribute: "icon-right" })
99
102
  ], o.prototype, "iconRight", 2);
100
103
  r([
101
- n({ type: String })
104
+ s({ type: String })
102
105
  ], o.prototype, "rel", 2);
103
106
  r([
104
- n({ type: String })
107
+ s({ type: String })
105
108
  ], o.prototype, "route", 2);
106
109
  r([
107
- n({ type: Boolean })
110
+ s({ type: Boolean })
108
111
  ], o.prototype, "stretch", 2);
109
112
  r([
110
- n({ type: String })
113
+ s({ type: String })
111
114
  ], o.prototype, "target", 2);
112
115
  r([
113
- v("as")
116
+ b("as")
114
117
  ], o.prototype, "_handleAsChange", 1);
115
118
  r([
116
- v(Object.keys(w))
119
+ b("disabled")
120
+ ], o.prototype, "_handleDisabledChange", 1);
121
+ r([
122
+ b(Object.keys(C))
117
123
  ], o.prototype, "_handleStateChange", 1);
118
124
  export {
119
125
  o as SkfLink
@@ -41,10 +41,6 @@ const e = o`
41
41
 
42
42
  cursor: not-allowed;
43
43
  }
44
-
45
- skf-icon {
46
- color: inherit;
47
- }
48
44
  }
49
45
 
50
46
  :host(:not([aria-disabled]):hover) #root {
@@ -3381,6 +3381,13 @@
3381
3381
  "type": {
3382
3382
  "text": "_handleAsChange() => void"
3383
3383
  }
3384
+ },
3385
+ {
3386
+ "kind": "method",
3387
+ "name": "_handleDisabledChange",
3388
+ "type": {
3389
+ "text": "_handleDisabledChange() => void"
3390
+ }
3384
3391
  }
3385
3392
  ],
3386
3393
  "events": [
@@ -4550,6 +4557,17 @@
4550
4557
  "type": {
4551
4558
  "text": "_handleAsChange() => void"
4552
4559
  }
4560
+ },
4561
+ {
4562
+ "kind": "method",
4563
+ "name": "_handleDisabledChange",
4564
+ "inheritedFrom": {
4565
+ "name": "SkfLink",
4566
+ "module": "src/components/link/link.component.ts"
4567
+ },
4568
+ "type": {
4569
+ "text": "_handleDisabledChange() => void"
4570
+ }
4553
4571
  }
4554
4572
  ],
4555
4573
  "superclass": {
@@ -1747,6 +1747,7 @@ export type SkfTooltipProps = {
1747
1747
  * Methods that can be called to access component functionality.
1748
1748
  *
1749
1749
  * - `_handleAsChange() => void`: undefined
1750
+ * - `_handleDisabledChange() => void`: undefined
1750
1751
  */
1751
1752
  "skf-link": Partial<SkfLinkProps & BaseProps<SkfLink> & BaseEvents>;
1752
1753
 
@@ -1901,6 +1902,7 @@ export type SkfTooltipProps = {
1901
1902
  * Methods that can be called to access component functionality.
1902
1903
  *
1903
1904
  * - `_handleAsChange() => void`: undefined
1905
+ * - `_handleDisabledChange() => void`: undefined
1904
1906
  */
1905
1907
  "skf-menu-item": Partial<SkfMenuItemProps & BaseProps<SkfMenuItem> & BaseEvents>;
1906
1908
 
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
3
3
  "name": "@skf-design-system/ui-components",
4
- "version": "1.0.2-beta.8",
4
+ "version": "1.0.2-beta",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
package/package.json CHANGED
@@ -35,7 +35,7 @@
35
35
  "sideEffects": true,
36
36
  "type": "module",
37
37
  "types": "./dist/index.d.ts",
38
- "version": "1.0.2-beta.10",
38
+ "version": "1.0.2-beta.11",
39
39
  "dependencies": {
40
40
  "@floating-ui/dom": "^1.7.1",
41
41
  "@js-temporal/polyfill": "^0.5.1",
@@ -44,6 +44,7 @@
44
44
  "lit": "^3.3.0"
45
45
  },
46
46
  "devDependencies": {
47
+ "@changesets/cli": "^2.29.5",
47
48
  "@chromatic-com/storybook": "^4.0.1",
48
49
  "@commitlint/cli": "^19.8.1",
49
50
  "@commitlint/config-conventional": "^19.8.1",