@proximus/lavender-breadcrumb 2.0.0-alpha.168 → 2.0.0-alpha.169
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.
- package/dist/Breadcrumb.d.ts +2 -2
- package/dist/index.es.js +103 -123
- package/package.json +1 -1
package/dist/Breadcrumb.d.ts
CHANGED
|
@@ -10,6 +10,6 @@ export declare class Breadcrumb extends WithExtraAttributes {
|
|
|
10
10
|
get $children(): NodeListOf<Element>;
|
|
11
11
|
get inverted(): boolean;
|
|
12
12
|
set inverted(value: boolean);
|
|
13
|
-
get ariaLabel(): string;
|
|
14
|
-
set ariaLabel(value: string);
|
|
13
|
+
get ariaLabel(): string | null;
|
|
14
|
+
set ariaLabel(value: string | null);
|
|
15
15
|
}
|
package/dist/index.es.js
CHANGED
|
@@ -1,125 +1,105 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { PxElement as e, WithExtraAttributes as t, booleanPropertyToAttributeSetter as n, propertyToAttributeSetter as r } from "@proximus/lavender-common";
|
|
2
|
+
//#region src/breadcrumb.css?inline
|
|
3
|
+
var i = ":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]{flex-wrap:wrap;align-items:center;display:flex}.breadcrumb ::slotted(px-breadcrumb-item){margin-top:var(--px-spacing-s-mobile)}.breadcrumb ::slotted(px-breadcrumb-item:not(:last-child)){margin-right:var(--px-spacing-xs-mobile);align-items:center;display:flex}.breadcrumb ::slotted(px-breadcrumb-item:not(:last-child)):after{content:\"\";width:16px;height:16px;color:var(--px-color-icon-neutral-default);margin-left:var(--px-spacing-xs-mobile);background-color:currentColor;display:inline-block;-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\");-webkit-mask-position:50%;mask-position:50%;-webkit-mask-size:cover;mask-size:cover;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat}@media screen and (width>=48rem){.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 screen and (width>=64.0625rem){.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 screen and (width>=90.0625rem){.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)}", a = ":host{display:block}:host *{box-sizing:border-box}.breadcrumb-item{line-height:var(--px-line-height-ratio-l);font-size:var(--px-text-size-label-m-mobile);display:flex}:host ::slotted(px-a[variant=icon-link][color=inherit]){color:var(--px-color-icon-accent-default)}:host ::slotted(px-a[variant=icon-link][color=inherit]):hover{color:var(--px-color-icon-accent-default)}@media screen and (width>=48rem){.breadcrumb-item{font-size:var(--px-text-size-label-m-tablet)}}@media screen and (width>=64.0625rem){.breadcrumb-item{font-size:var(--px-text-size-label-m-laptop)}}@media screen and (width>=90.0625rem){.breadcrumb-item{font-size:var(--px-text-size-label-m-desktop)}}:host([inverted]) ::slotted(px-a[variant=icon-link][color=inherit]){color:var(--px-color-icon-accent-inverted)}:host([inverted]) ::slotted(px-a[variant=icon-link][color=inherit]):hover{color:var(--px-color-icon-accent-inverted)}", o = new CSSStyleSheet();
|
|
4
|
+
o.replaceSync(a);
|
|
5
|
+
var s = "px-breadcrumb-item-connected", c = class extends e {
|
|
6
|
+
static {
|
|
7
|
+
this.nativeName = "div";
|
|
8
|
+
}
|
|
9
|
+
constructor() {
|
|
10
|
+
super(o), this.template = () => "<div class=\"breadcrumb-item\" role=\"listitem\"><slot></slot></div>", this.shadowRoot && (this.shadowRoot.innerHTML = this.template());
|
|
11
|
+
}
|
|
12
|
+
static get observedAttributes() {
|
|
13
|
+
return [...super.observedAttributes, "inverted"];
|
|
14
|
+
}
|
|
15
|
+
connectedCallback() {
|
|
16
|
+
this.$icon && this.$icon.setAttribute("size", "s"), this.$link || this.$el.setAttribute("aria-current", "page"), this.dispatchEvent(new CustomEvent(s, {
|
|
17
|
+
bubbles: !0,
|
|
18
|
+
composed: !0
|
|
19
|
+
}));
|
|
20
|
+
}
|
|
21
|
+
attributeChangedCallback(e, t, n) {
|
|
22
|
+
if (t !== n) switch (e) {
|
|
23
|
+
case "inverted":
|
|
24
|
+
for (let e = 0; e < this.$children.length; e++) this.$children[e].hasAttribute("inverted") || this.$children[e].toggleAttribute("inverted");
|
|
25
|
+
break;
|
|
26
|
+
default: super.attributeChangedCallback(e, t, n);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
get $link() {
|
|
30
|
+
return this.querySelector("px-a");
|
|
31
|
+
}
|
|
32
|
+
get $icon() {
|
|
33
|
+
return this.querySelector("px-icon");
|
|
34
|
+
}
|
|
35
|
+
get $children() {
|
|
36
|
+
return this.querySelectorAll("px-breadcrumb-item > *");
|
|
37
|
+
}
|
|
38
|
+
get inverted() {
|
|
39
|
+
return this.hasAttribute("inverted");
|
|
40
|
+
}
|
|
41
|
+
set inverted(e) {
|
|
42
|
+
e ? this.setAttribute("inverted", "") : this.removeAttribute("inverted");
|
|
43
|
+
}
|
|
3
44
|
};
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
super(u);
|
|
62
|
-
b(this, s);
|
|
63
|
-
this.shadowRoot.innerHTML = this.template();
|
|
64
|
-
}
|
|
65
|
-
template() {
|
|
66
|
-
return `
|
|
67
|
-
<nav class="breadcrumb">
|
|
68
|
-
<div role="list">
|
|
69
|
-
<slot></slot>
|
|
70
|
-
</div>
|
|
71
|
-
</nav>
|
|
72
|
-
`;
|
|
73
|
-
}
|
|
74
|
-
connectedCallback() {
|
|
75
|
-
this.ariaLabel || (this.ariaLabel = "Breadcrumb"), this.addEventListener(p, () => {
|
|
76
|
-
l(this, s, n).call(this);
|
|
77
|
-
}), l(this, s, n).call(this);
|
|
78
|
-
}
|
|
79
|
-
static get observedAttributes() {
|
|
80
|
-
return [...super.observedAttributes, "inverted", "aria-label"];
|
|
81
|
-
}
|
|
82
|
-
attributeChangedCallback(e, i, a) {
|
|
83
|
-
if (i !== a)
|
|
84
|
-
switch (e) {
|
|
85
|
-
case "aria-label":
|
|
86
|
-
this.$el.setAttribute("aria-label", this.ariaLabel);
|
|
87
|
-
break;
|
|
88
|
-
case "inverted":
|
|
89
|
-
this.isConnected && l(this, s, n).call(this);
|
|
90
|
-
break;
|
|
91
|
-
default:
|
|
92
|
-
super.attributeChangedCallback(e, i, a);
|
|
93
|
-
break;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
get $el() {
|
|
97
|
-
return this.shadowRoot.querySelector(".breadcrumb");
|
|
98
|
-
}
|
|
99
|
-
get $children() {
|
|
100
|
-
return this.querySelectorAll("px-breadcrumb > *");
|
|
101
|
-
}
|
|
102
|
-
get inverted() {
|
|
103
|
-
return this.hasAttribute("inverted");
|
|
104
|
-
}
|
|
105
|
-
set inverted(e) {
|
|
106
|
-
e ? this.setAttribute("inverted", "") : this.removeAttribute("inverted");
|
|
107
|
-
}
|
|
108
|
-
get ariaLabel() {
|
|
109
|
-
return this.getAttribute("aria-label");
|
|
110
|
-
}
|
|
111
|
-
set ariaLabel(e) {
|
|
112
|
-
e ? this.setAttribute("aria-label", e) : this.removeAttribute("aria-label");
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
s = new WeakSet(), n = function() {
|
|
116
|
-
const e = this.hasAttribute("inverted");
|
|
117
|
-
for (let i = 0; i < this.$children.length; i++)
|
|
118
|
-
this.$children[i].toggleAttribute("inverted", e);
|
|
119
|
-
};
|
|
120
|
-
customElements.get("px-breadcrumb") || customElements.define("px-breadcrumb", k);
|
|
121
|
-
export {
|
|
122
|
-
p as BREADCRUMB_ITEM_CONNECTED_EVENT,
|
|
123
|
-
k as Breadcrumb,
|
|
124
|
-
o as BreadcrumbItem
|
|
45
|
+
customElements.get("px-breadcrumb-item") || customElements.define("px-breadcrumb-item", c);
|
|
46
|
+
//#endregion
|
|
47
|
+
//#region src/Breadcrumb.ts
|
|
48
|
+
var l = new CSSStyleSheet();
|
|
49
|
+
l.replaceSync(i);
|
|
50
|
+
var u = class extends t {
|
|
51
|
+
template() {
|
|
52
|
+
return "\n <nav class=\"breadcrumb\">\n <div role=\"list\">\n <slot></slot>\n </div>\n </nav>\n ";
|
|
53
|
+
}
|
|
54
|
+
constructor() {
|
|
55
|
+
super(l), this.shadowRoot.innerHTML = this.template();
|
|
56
|
+
}
|
|
57
|
+
connectedCallback() {
|
|
58
|
+
this.ariaLabel ||= "Breadcrumb", this.addEventListener(s, () => {
|
|
59
|
+
this.#e();
|
|
60
|
+
}), this.#e();
|
|
61
|
+
}
|
|
62
|
+
#e() {
|
|
63
|
+
let e = this.hasAttribute("inverted");
|
|
64
|
+
for (let t = 0; t < this.$children.length; t++) this.$children[t].toggleAttribute("inverted", e);
|
|
65
|
+
}
|
|
66
|
+
static get observedAttributes() {
|
|
67
|
+
return [
|
|
68
|
+
...super.observedAttributes,
|
|
69
|
+
"inverted",
|
|
70
|
+
"aria-label"
|
|
71
|
+
];
|
|
72
|
+
}
|
|
73
|
+
attributeChangedCallback(e, t, n) {
|
|
74
|
+
if (t !== n) switch (e) {
|
|
75
|
+
case "aria-label":
|
|
76
|
+
r(this.$el, "aria-label", this.ariaLabel);
|
|
77
|
+
break;
|
|
78
|
+
case "inverted":
|
|
79
|
+
this.isConnected && this.#e();
|
|
80
|
+
break;
|
|
81
|
+
default: super.attributeChangedCallback(e, t, n);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
get $el() {
|
|
85
|
+
return this.shadowRoot.querySelector(".breadcrumb");
|
|
86
|
+
}
|
|
87
|
+
get $children() {
|
|
88
|
+
return this.querySelectorAll("px-breadcrumb > *");
|
|
89
|
+
}
|
|
90
|
+
get inverted() {
|
|
91
|
+
return this.hasAttribute("inverted");
|
|
92
|
+
}
|
|
93
|
+
set inverted(e) {
|
|
94
|
+
n(this, "inverted", e);
|
|
95
|
+
}
|
|
96
|
+
get ariaLabel() {
|
|
97
|
+
return this.getAttribute("aria-label");
|
|
98
|
+
}
|
|
99
|
+
set ariaLabel(e) {
|
|
100
|
+
r(this, "aria-label", e);
|
|
101
|
+
}
|
|
125
102
|
};
|
|
103
|
+
customElements.get("px-breadcrumb") || customElements.define("px-breadcrumb", u);
|
|
104
|
+
//#endregion
|
|
105
|
+
export { s as BREADCRUMB_ITEM_CONNECTED_EVENT, u as Breadcrumb, c as BreadcrumbItem };
|