@proximus/lavender-breadcrumb 2.0.0-alpha.63 → 2.0.0-alpha.65

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.
@@ -1,5 +1,6 @@
1
1
  import { PxElement } from '@proximus/lavender-common';
2
2
  import type { Icon } from '@proximus/lavender-icon';
3
+ export declare const BREADCRUMB_ITEM_CONNECTED_EVENT = "px-breadcrumb-item-connected";
3
4
  export declare class BreadcrumbItem extends PxElement<HTMLElement> {
4
5
  static nativeName: string;
5
6
  private template;
@@ -1,5 +1,6 @@
1
1
  import { WithExtraAttributes } from '@proximus/lavender-common';
2
2
  export declare class Breadcrumb extends WithExtraAttributes {
3
+ #private;
3
4
  private template;
4
5
  constructor();
5
6
  connectedCallback(): void;
package/dist/index.es.js CHANGED
@@ -1,7 +1,67 @@
1
- import { WithExtraAttributes as o, PxElement as c } from "@proximus/lavender-common";
2
- const d = `:host{display:block}:host *{box-sizing:border-box}.breadcrumb{font-family:var(--px-font-family);color:var(--px-color-text-neutral-default);margin:calc(var(--px-spacing-s-mobile) * -1) 0 0 0;padding:0}.breadcrumb div[role=list]{display:flex;flex-wrap:wrap;align-items:center}.breadcrumb ::slotted(px-breadcrumb-item){margin-top:var(--px-spacing-s-mobile)}.breadcrumb ::slotted(px-breadcrumb-item:not(:last-child)){display:flex;align-items:center;margin-right:var(--px-spacing-xs-mobile)}.breadcrumb ::slotted(px-breadcrumb-item:not(:last-child)):after{display:inline-block;content:"";width:16px;height:16px;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:cover;mask-size:cover;-webkit-mask-position:50% 50%;mask-position:50% 50%;-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M5.90255 3.61987C5.6515 3.8749 5.6515 4.2884 5.90255 4.54343L9.30512 8.00002L5.90255 11.4566C5.6515 11.7116 5.6515 12.1251 5.90255 12.3802C6.1536 12.6352 6.56063 12.6352 6.81169 12.3802L10.6688 8.4618C10.9199 8.20677 10.9199 7.79327 10.6688 7.53823L6.81169 3.61987C6.56063 3.36483 6.1536 3.36483 5.90255 3.61987Z' fill='%23252525'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M5.90255 3.61987C5.6515 3.8749 5.6515 4.2884 5.90255 4.54343L9.30512 8.00002L5.90255 11.4566C5.6515 11.7116 5.6515 12.1251 5.90255 12.3802C6.1536 12.6352 6.56063 12.6352 6.81169 12.3802L10.6688 8.4618C10.9199 8.20677 10.9199 7.79327 10.6688 7.53823L6.81169 3.61987C6.56063 3.36483 6.1536 3.36483 5.90255 3.61987Z' fill='%23252525'/%3E%3C/svg%3E");background-color:currentColor;color:var(--px-color-icon-neutral-default);margin-left:var(--px-spacing-xs-mobile)}@media only screen and (min-width: 48em){.breadcrumb{margin:calc(var(--px-spacing-s-tablet) * -1) 0 0 0}.breadcrumb ::slotted(px-breadcrumb-item){margin-top:var(--px-spacing-s-tablet)}.breadcrumb ::slotted(px-breadcrumb-item:not(:last-child)){margin-right:var(--px-spacing-xs-tablet)}.breadcrumb ::slotted(px-breadcrumb-item:not(:last-child)):after{margin-left:var(--px-spacing-xs-tablet)}}@media only screen and (min-width: 64.0625em){.breadcrumb{margin:calc(var(--px-spacing-s-laptop) * -1) 0 0 0}.breadcrumb ::slotted(px-breadcrumb-item){margin-top:var(--px-spacing-s-laptop)}.breadcrumb ::slotted(px-breadcrumb-item:not(:last-child)){margin-right:var(--px-spacing-xs-laptop)}.breadcrumb ::slotted(px-breadcrumb-item:not(:last-child)):after{margin-left:var(--px-spacing-xs-laptop)}}@media only screen and (min-width: 90.0625em){.breadcrumb{margin:calc(var(--px-spacing-s-desktop) * -1) 0 0 0}.breadcrumb ::slotted(px-breadcrumb-item){margin-top:var(--px-spacing-s-desktop)}.breadcrumb ::slotted(px-breadcrumb-item:not(:last-child)){margin-right:var(--px-spacing-xs-desktop)}.breadcrumb ::slotted(px-breadcrumb-item:not(:last-child)):after{margin-left:var(--px-spacing-xs-desktop)}}:host([inverted]) .breadcrumb{color:var(--px-color-text-neutral-inverted)}:host([inverted]) .breadcrumb ::slotted(px-breadcrumb-item:not(:last-child)):after{color:var(--px-color-icon-neutral-inverted)}`, n = new CSSStyleSheet();
3
- n.replaceSync(d);
4
- class b extends o {
1
+ var d = (r) => {
2
+ throw TypeError(r);
3
+ };
4
+ var u = (r, t, e) => t.has(r) || d("Cannot " + e);
5
+ var b = (r, t, e) => t.has(r) ? d("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(r) : t.set(r, e);
6
+ var n = (r, t, e) => (u(r, t, "access private method"), e);
7
+ import { PxElement as v, WithExtraAttributes as x } from "@proximus/lavender-common";
8
+ const g = `:host{display:block}:host *{box-sizing:border-box}.breadcrumb{font-family:var(--px-font-family);color:var(--px-color-text-neutral-default);margin:calc(var(--px-spacing-s-mobile) * -1) 0 0 0;padding:0}.breadcrumb div[role=list]{display:flex;flex-wrap:wrap;align-items:center}.breadcrumb ::slotted(px-breadcrumb-item){margin-top:var(--px-spacing-s-mobile)}.breadcrumb ::slotted(px-breadcrumb-item:not(:last-child)){display:flex;align-items:center;margin-right:var(--px-spacing-xs-mobile)}.breadcrumb ::slotted(px-breadcrumb-item:not(:last-child)):after{display:inline-block;content:"";width:16px;height:16px;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:cover;mask-size:cover;-webkit-mask-position:50% 50%;mask-position:50% 50%;-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M5.90255 3.61987C5.6515 3.8749 5.6515 4.2884 5.90255 4.54343L9.30512 8.00002L5.90255 11.4566C5.6515 11.7116 5.6515 12.1251 5.90255 12.3802C6.1536 12.6352 6.56063 12.6352 6.81169 12.3802L10.6688 8.4618C10.9199 8.20677 10.9199 7.79327 10.6688 7.53823L6.81169 3.61987C6.56063 3.36483 6.1536 3.36483 5.90255 3.61987Z' fill='%23252525'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M5.90255 3.61987C5.6515 3.8749 5.6515 4.2884 5.90255 4.54343L9.30512 8.00002L5.90255 11.4566C5.6515 11.7116 5.6515 12.1251 5.90255 12.3802C6.1536 12.6352 6.56063 12.6352 6.81169 12.3802L10.6688 8.4618C10.9199 8.20677 10.9199 7.79327 10.6688 7.53823L6.81169 3.61987C6.56063 3.36483 6.1536 3.36483 5.90255 3.61987Z' fill='%23252525'/%3E%3C/svg%3E");background-color:currentColor;color:var(--px-color-icon-neutral-default);margin-left:var(--px-spacing-xs-mobile)}@media only screen and (min-width: 48em){.breadcrumb{margin:calc(var(--px-spacing-s-tablet) * -1) 0 0 0}.breadcrumb ::slotted(px-breadcrumb-item){margin-top:var(--px-spacing-s-tablet)}.breadcrumb ::slotted(px-breadcrumb-item:not(:last-child)){margin-right:var(--px-spacing-xs-tablet)}.breadcrumb ::slotted(px-breadcrumb-item:not(:last-child)):after{margin-left:var(--px-spacing-xs-tablet)}}@media only screen and (min-width: 64.0625em){.breadcrumb{margin:calc(var(--px-spacing-s-laptop) * -1) 0 0 0}.breadcrumb ::slotted(px-breadcrumb-item){margin-top:var(--px-spacing-s-laptop)}.breadcrumb ::slotted(px-breadcrumb-item:not(:last-child)){margin-right:var(--px-spacing-xs-laptop)}.breadcrumb ::slotted(px-breadcrumb-item:not(:last-child)):after{margin-left:var(--px-spacing-xs-laptop)}}@media only screen and (min-width: 90.0625em){.breadcrumb{margin:calc(var(--px-spacing-s-desktop) * -1) 0 0 0}.breadcrumb ::slotted(px-breadcrumb-item){margin-top:var(--px-spacing-s-desktop)}.breadcrumb ::slotted(px-breadcrumb-item:not(:last-child)){margin-right:var(--px-spacing-xs-desktop)}.breadcrumb ::slotted(px-breadcrumb-item:not(:last-child)):after{margin-left:var(--px-spacing-xs-desktop)}}:host([inverted]) .breadcrumb{color:var(--px-color-text-neutral-inverted)}:host([inverted]) .breadcrumb ::slotted(px-breadcrumb-item:not(:last-child)):after{color:var(--px-color-icon-neutral-inverted)}`, f = ":host{display:block}:host *{box-sizing:border-box}.breadcrumb-item{display:flex}:host:has(px-a[variant=icon-link][color=inherit]) .breadcrumb-item{color:var(--px-color-icon-accent-default)}:host:has(px-a[variant=icon-link][color=inherit]) .breadcrumb-item:hover{color:var(--px-color-text-state-hover-default)}:host:not(:has(px-a[variant=icon-link][color=inherit])) .breadcrumb-item{line-height:var(--px-font-line-height-s);font-size:var(--px-text-size-link-s-mobile)}@media only screen and (min-width: 48em){:host:not(:has(px-a[variant=icon-link][color=inherit])) .breadcrumb-item{font-size:var(--px-text-size-link-s-tablet)}}@media only screen and (min-width: 64.0625em){:host:not(:has(px-a[variant=icon-link][color=inherit])) .breadcrumb-item{font-size:var(--px-text-size-link-s-laptop)}}@media only screen and (min-width: 90.0625em){:host:not(:has(px-a[variant=icon-link][color=inherit])) .breadcrumb-item{font-size:var(--px-text-size-link-s-desktop)}}:host([inverted]):has(px-a[variant=icon-link][color=inherit]) .breadcrumb-item{color:var(--px-color-icon-accent-inverted)}:host([inverted]):has(px-a[variant=icon-link][color=inherit]) .breadcrumb-item:hover{color:var(--px-color-text-state-hover-inverted)}", m = new CSSStyleSheet();
9
+ m.replaceSync(f);
10
+ const h = "px-breadcrumb-item-connected", c = class c extends v {
11
+ constructor() {
12
+ super(m), this.template = () => '<div class="breadcrumb-item" role="listitem"><slot></slot></div>', this.shadowRoot && (this.shadowRoot.innerHTML = this.template());
13
+ }
14
+ static get observedAttributes() {
15
+ return [...super.observedAttributes, "inverted"];
16
+ }
17
+ connectedCallback() {
18
+ this.$icon && this.$icon.setAttribute("size", "s"), this.$link || this.$el.setAttribute("aria-current", "page"), this.dispatchEvent(
19
+ new CustomEvent(h, {
20
+ bubbles: !0,
21
+ composed: !0
22
+ })
23
+ );
24
+ }
25
+ attributeChangedCallback(t, e, i) {
26
+ if (e !== i)
27
+ switch (t) {
28
+ case "inverted":
29
+ for (let a = 0; a < this.$children.length; a++)
30
+ this.$children[a].hasAttribute("inverted") || this.$children[a].toggleAttribute("inverted");
31
+ break;
32
+ default:
33
+ super.attributeChangedCallback(t, e, i);
34
+ break;
35
+ }
36
+ }
37
+ get $link() {
38
+ return this.querySelector("px-a");
39
+ }
40
+ get $icon() {
41
+ return this.querySelector("px-icon");
42
+ }
43
+ get $children() {
44
+ return this.querySelectorAll("px-breadcrumb-item > *");
45
+ }
46
+ get inverted() {
47
+ return this.hasAttribute("inverted");
48
+ }
49
+ set inverted(t) {
50
+ t ? this.setAttribute("inverted", "") : this.removeAttribute("inverted");
51
+ }
52
+ };
53
+ c.nativeName = "div";
54
+ let o = c;
55
+ customElements.get("px-breadcrumb-item") || customElements.define("px-breadcrumb-item", o);
56
+ const p = new CSSStyleSheet();
57
+ p.replaceSync(g);
58
+ var s, l;
59
+ class k extends x {
60
+ constructor() {
61
+ super(p);
62
+ b(this, s);
63
+ this.shadowRoot.innerHTML = this.template();
64
+ }
5
65
  template() {
6
66
  return `
7
67
  <nav class="breadcrumb">
@@ -11,27 +71,25 @@ class b extends o {
11
71
  </nav>
12
72
  `;
13
73
  }
14
- constructor() {
15
- super(n), this.shadowRoot.innerHTML = this.template();
16
- }
17
74
  connectedCallback() {
18
- this.ariaLabel || (this.ariaLabel = "Breadcrumb");
75
+ this.ariaLabel || (this.ariaLabel = "Breadcrumb"), this.addEventListener(h, () => {
76
+ n(this, s, l).call(this);
77
+ }), n(this, s, l).call(this);
19
78
  }
20
79
  static get observedAttributes() {
21
80
  return [...super.observedAttributes, "inverted", "aria-label"];
22
81
  }
23
- attributeChangedCallback(e, r, i) {
24
- if (r !== i)
82
+ attributeChangedCallback(e, i, a) {
83
+ if (i !== a)
25
84
  switch (e) {
26
85
  case "aria-label":
27
86
  this.$el.setAttribute("aria-label", this.ariaLabel);
28
87
  break;
29
88
  case "inverted":
30
- for (let t = 0; t < this.$children.length; t++)
31
- this.$children[t].hasAttribute("inverted") || this.$children[t].toggleAttribute("inverted");
89
+ this.isConnected && n(this, s, l).call(this);
32
90
  break;
33
91
  default:
34
- super.attributeChangedCallback(e, r, i);
92
+ super.attributeChangedCallback(e, i, a);
35
93
  break;
36
94
  }
37
95
  }
@@ -54,51 +112,14 @@ class b extends o {
54
112
  e ? this.setAttribute("aria-label", e) : this.removeAttribute("aria-label");
55
113
  }
56
114
  }
57
- customElements.get("px-breadcrumb") || customElements.define("px-breadcrumb", b);
58
- const m = ":host{display:block}:host *{box-sizing:border-box}.breadcrumb-item{display:flex}:host:has(px-a[variant=icon-link][color=inherit]) .breadcrumb-item{color:var(--px-color-icon-accent-default)}:host:has(px-a[variant=icon-link][color=inherit]) .breadcrumb-item:hover{color:var(--px-color-text-state-hover-default)}:host:not(:has(px-a[variant=icon-link][color=inherit])) .breadcrumb-item{line-height:var(--px-font-line-height-s);font-size:var(--px-text-size-link-s-mobile)}@media only screen and (min-width: 48em){:host:not(:has(px-a[variant=icon-link][color=inherit])) .breadcrumb-item{font-size:var(--px-text-size-link-s-tablet)}}@media only screen and (min-width: 64.0625em){:host:not(:has(px-a[variant=icon-link][color=inherit])) .breadcrumb-item{font-size:var(--px-text-size-link-s-laptop)}}@media only screen and (min-width: 90.0625em){:host:not(:has(px-a[variant=icon-link][color=inherit])) .breadcrumb-item{font-size:var(--px-text-size-link-s-desktop)}}:host([inverted]):has(px-a[variant=icon-link][color=inherit]) .breadcrumb-item{color:var(--px-color-icon-accent-inverted)}:host([inverted]):has(px-a[variant=icon-link][color=inherit]) .breadcrumb-item:hover{color:var(--px-color-text-state-hover-inverted)}", l = new CSSStyleSheet();
59
- l.replaceSync(m);
60
- const s = class s extends c {
61
- constructor() {
62
- super(l), this.template = () => '<div class="breadcrumb-item" role="listitem"><slot></slot></div>', this.shadowRoot && (this.shadowRoot.innerHTML = this.template());
63
- }
64
- static get observedAttributes() {
65
- return [...super.observedAttributes, "inverted"];
66
- }
67
- connectedCallback() {
68
- this.$icon && this.$icon.setAttribute("size", "s"), this.$link || this.$el.setAttribute("aria-current", "page");
69
- }
70
- attributeChangedCallback(e, r, i) {
71
- if (r !== i)
72
- switch (e) {
73
- case "inverted":
74
- for (let t = 0; t < this.$children.length; t++)
75
- this.$children[t].hasAttribute("inverted") || this.$children[t].toggleAttribute("inverted");
76
- break;
77
- default:
78
- super.attributeChangedCallback(e, r, i);
79
- break;
80
- }
81
- }
82
- get $link() {
83
- return this.querySelector("px-a");
84
- }
85
- get $icon() {
86
- return this.querySelector("px-icon");
87
- }
88
- get $children() {
89
- return this.querySelectorAll("px-breadcrumb-item > *");
90
- }
91
- get inverted() {
92
- return this.hasAttribute("inverted");
93
- }
94
- set inverted(e) {
95
- e ? this.setAttribute("inverted", "") : this.removeAttribute("inverted");
96
- }
115
+ s = new WeakSet(), l = function() {
116
+ const e = this.hasAttribute("inverted");
117
+ for (let i = 0; i < this.$children.length; i++)
118
+ this.$children[i].toggleAttribute("inverted", e);
97
119
  };
98
- s.nativeName = "div";
99
- let a = s;
100
- customElements.get("px-breadcrumb-item") || customElements.define("px-breadcrumb-item", a);
120
+ customElements.get("px-breadcrumb") || customElements.define("px-breadcrumb", k);
101
121
  export {
102
- b as Breadcrumb,
103
- a as BreadcrumbItem
122
+ h as BREADCRUMB_ITEM_CONNECTED_EVENT,
123
+ k as Breadcrumb,
124
+ o as BreadcrumbItem
104
125
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proximus/lavender-breadcrumb",
3
- "version": "2.0.0-alpha.63",
3
+ "version": "2.0.0-alpha.65",
4
4
  "description": "",
5
5
  "main": "dist/index.es.js",
6
6
  "types": "dist/index.d.ts",