@proximus/lavender-selectablebox 1.4.10-beta.4 → 1.4.10
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/SelectableBoxRadio.d.ts +0 -2
- package/dist/index.es.js +19 -31
- package/package.json +1 -1
|
@@ -2,8 +2,6 @@ import { WithExtraAttributes } from '@proximus/lavender-common';
|
|
|
2
2
|
import '@proximus/lavender-layout';
|
|
3
3
|
import { SelectableBox } from './SelectableBox';
|
|
4
4
|
import { type Radio } from '@proximus/lavender-radio-group';
|
|
5
|
-
export declare const SELECTABLE_BOX_RADIO_CONNECTED_EVENT = "px-selectable-box-radio-connected";
|
|
6
|
-
export declare const SELECTABLE_BOX_RADIO_DISCONNECTED_EVENT = "px-selectable-box-radio-disconnected";
|
|
7
5
|
export declare class SelectableBoxRadio extends WithExtraAttributes {
|
|
8
6
|
protected internals: ElementInternals;
|
|
9
7
|
protected template(): string;
|
package/dist/index.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { WithExtraAttributes as c, AttributeBreakpointHandlerDelegate as m, gapValues as k, checkName as
|
|
1
|
+
import { WithExtraAttributes as c, AttributeBreakpointHandlerDelegate as m, gapValues as k, checkName as y, log as h, backgroundColorValues as A } from "@proximus/lavender-common";
|
|
2
2
|
const w = ':host{display:block}:host ::slotted(px-h1[auto-spacing]),:host ::slotted(px-h2[auto-spacing]),:host ::slotted(px-h3[auto-spacing]),:host ::slotted(px-h4[auto-spacing]),:host ::slotted(px-h5[auto-spacing]),:host ::slotted(px-h6[auto-spacing]){margin-bottom:calc(var(--px-spacing-heading-to-content-mobile) - var(--host-gap--mobile))}:host([overflow-x="auto"]){margin:calc(calc(var(--px-focus-outline-mobile) + var(--px-focus-offset-mobile)) * -1)}:host([overflow-x="auto"]) .flex-container{padding:calc(var(--px-focus-outline-mobile) + var(--px-focus-offset-mobile))}.flex-container{display:flex;height:100%;width:100%;box-sizing:border-box;flex-direction:var(--flex-direction--mobile-value);gap:var(--flex-gap--mobile-value);flex-wrap:var(--flex-wrap--mobile-value);justify-content:var(--flex-justify-content--mobile-value);align-items:var(--flex-align-items--mobile-value);overflow-x:var(--overflow-x-all)}@media screen and (max-width: 47.938rem){.flex-container{overflow-x:var(--overflow-x-all-mobile, var(--overflow-x-all));scrollbar-width:none}.flex-container::-webkit-scrollbar{display:none}}@media screen and (min-width: 48rem){.flex-container{flex-direction:var(--flex-direction--tablet-value);gap:var(--flex-gap--tablet-value);flex-wrap:var(--flex-wrap--tablet-value);justify-content:var(--flex-justify-content--tablet-value);align-items:var(--flex-align-items--tablet-value)}:host ::slotted(px-h1[auto-spacing]),:host ::slotted(px-h2[auto-spacing]),:host ::slotted(px-h3[auto-spacing]),:host ::slotted(px-h4[auto-spacing]),:host ::slotted(px-h5[auto-spacing]),:host ::slotted(px-h6[auto-spacing]){margin-bottom:calc(var(--px-spacing-heading-to-content-tablet) - var(--host-gap--tablet))}:host([overflow-x="auto"]){margin:calc(calc(var(--px-focus-outline-tablet) + var(--px-focus-offset-tablet)) * -1)}:host([overflow-x="auto"]) .flex-container{padding:calc(var(--px-focus-outline-tablet) + var(--px-focus-offset-tablet))}}@media screen and (min-width: 48rem) and (max-width: 64rem){.flex-container{overflow-x:var(--overflow-x-all-tablet, var(--overflow-x-all));scrollbar-width:none}.flex-container::-webkit-scrollbar{display:none}}@media screen and (min-width: 64.0625rem){.flex-container{flex-direction:var(--flex-direction--laptop-value);gap:var(--flex-gap--laptop-value);flex-wrap:var(--flex-wrap--laptop-value);justify-content:var(--flex-justify-content--laptop-value);align-items:var(--flex-align-items--laptop-value)}:host ::slotted(px-h1[auto-spacing]),:host ::slotted(px-h2[auto-spacing]),:host ::slotted(px-h3[auto-spacing]),:host ::slotted(px-h4[auto-spacing]),:host ::slotted(px-h5[auto-spacing]),:host ::slotted(px-h6[auto-spacing]){margin-bottom:calc(var(--px-spacing-heading-to-content-laptop) - var(--host-gap--laptop))}:host([overflow-x="auto"]){margin:calc(calc(var(--px-focus-outline-laptop) + var(--px-focus-offset-laptop)) * -1)}:host([overflow-x="auto"]) .flex-container{padding:calc(var(--px-focus-outline-laptop) + var(--px-focus-offset-laptop))}}@media screen and (min-width: 64.0625rem) and (max-width: 90rem){.flex-container{overflow-x:var(--overflow-x-all-laptop, var(--overflow-x-all))}}@media screen and (min-width: 90.0625rem){.flex-container{flex-direction:var(--flex-direction--desktop-value);gap:var(--flex-gap--desktop-value);flex-wrap:var(--flex-wrap--desktop-value);justify-content:var(--flex-justify-content--desktop-value);align-items:var(--flex-align-items--desktop-value);overflow-x:var(--overflow-x-all-desktop, var(--overflow-x-all))}:host ::slotted(px-h1[auto-spacing]),:host ::slotted(px-h2[auto-spacing]),:host ::slotted(px-h3[auto-spacing]),:host ::slotted(px-h4[auto-spacing]),:host ::slotted(px-h5[auto-spacing]),:host ::slotted(px-h6[auto-spacing]){margin-bottom:calc(var(--px-spacing-heading-to-content-desktop) - var(--host-gap--desktop))}:host([overflow-x="auto"]){margin:calc(calc(var(--px-focus-outline-desktop) + var(--px-focus-offset-desktop)) * -1)}:host([overflow-x="auto"]) .flex-container{padding:calc(var(--px-focus-outline-desktop) + var(--px-focus-offset-desktop))}}', b = new CSSStyleSheet();
|
|
3
3
|
b.replaceSync(w);
|
|
4
4
|
const C = [
|
|
@@ -134,7 +134,7 @@ class d extends c {
|
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
136
|
updateOverflowX(t, e, i, o) {
|
|
137
|
-
if (!
|
|
137
|
+
if (!y(o, i)) {
|
|
138
138
|
h(
|
|
139
139
|
`"${i}" is not a valid ${t} value for ${this.tagName.toLowerCase()}. Allowed values are: "${o.join('", "')}".`
|
|
140
140
|
);
|
|
@@ -366,7 +366,7 @@ class L extends d {
|
|
|
366
366
|
}
|
|
367
367
|
}
|
|
368
368
|
customElements.get("px-vstack") || customElements.define("px-vstack", L);
|
|
369
|
-
class
|
|
369
|
+
class z extends d {
|
|
370
370
|
constructor() {
|
|
371
371
|
super();
|
|
372
372
|
}
|
|
@@ -374,8 +374,8 @@ class D extends d {
|
|
|
374
374
|
super.connectedCallback(), this.direction = "row", this.directionMobile = "row", this.directionTablet = "row", this.directionLaptop = "row", this.directionDesktop = "row";
|
|
375
375
|
}
|
|
376
376
|
}
|
|
377
|
-
customElements.get("px-hstack") || customElements.define("px-hstack",
|
|
378
|
-
class
|
|
377
|
+
customElements.get("px-hstack") || customElements.define("px-hstack", z);
|
|
378
|
+
class D extends HTMLElement {
|
|
379
379
|
constructor() {
|
|
380
380
|
super(), this.isZeroSized = !1, this.growValue = "1", this.isVertical = !1;
|
|
381
381
|
}
|
|
@@ -422,7 +422,7 @@ class z extends HTMLElement {
|
|
|
422
422
|
t ? this.setAttribute("nogap", "") : this.removeAttribute("nogap");
|
|
423
423
|
}
|
|
424
424
|
}
|
|
425
|
-
customElements.get("px-spacer") || customElements.define("px-spacer",
|
|
425
|
+
customElements.get("px-spacer") || customElements.define("px-spacer", D);
|
|
426
426
|
const j = ":host{display:block;box-sizing:border-box}slot[name=body-container]{min-height:100vh}#image-sticky-box{margin-top:-2.5rem}", p = new CSSStyleSheet();
|
|
427
427
|
p.replaceSync(j);
|
|
428
428
|
class R extends c {
|
|
@@ -604,7 +604,7 @@ class R extends c {
|
|
|
604
604
|
case "background-color":
|
|
605
605
|
this.$bodyContainer.setAttribute(
|
|
606
606
|
"background-color",
|
|
607
|
-
|
|
607
|
+
A.indexOf(i) > 0 ? i : "none"
|
|
608
608
|
);
|
|
609
609
|
break;
|
|
610
610
|
case "padding-vertical":
|
|
@@ -683,8 +683,8 @@ class H extends c {
|
|
|
683
683
|
}
|
|
684
684
|
}
|
|
685
685
|
customElements.get("px-selectable-box") || customElements.define("px-selectable-box", H);
|
|
686
|
-
const
|
|
687
|
-
function g(s, t, e =
|
|
686
|
+
const P = ["px-a", "px-button"];
|
|
687
|
+
function g(s, t, e = P) {
|
|
688
688
|
const i = new Set(e), o = s.composedPath();
|
|
689
689
|
for (const r of o) {
|
|
690
690
|
if (r === t)
|
|
@@ -696,7 +696,7 @@ function g(s, t, e = T) {
|
|
|
696
696
|
}
|
|
697
697
|
const x = ':host{display:block;outline:none}:host *{box-sizing:border-box}.selectable-box-checkbox,.selectable-box-radio{box-sizing:border-box;height:100%;cursor:pointer;border-radius:var(--px-radius-main);overflow:hidden;--btn-transition: all .2s ease-in-out 0s;transition:var(--btn-transition);border:var(--px-size-border-m) solid var(--px-color-border-main-default);outline-color:var(--px-color-border-focus-outline-default);outline-width:var(--px-focus-outline-mobile)}.selectable-box-checkbox px-selectable-box,.selectable-box-radio px-selectable-box{height:100%;background-color:var(--px-color-background-container-light-default)}:host([parent-has-anchor-full]) .selectable-box-checkbox,:host([parent-has-anchor-full]) .selectable-box-radio{border-radius:0 0 var(--px-radius-main) var(--px-radius-main)}:host(:not([disabled])):host(:hover) .selectable-box-checkbox,:host(:not([disabled])):host(:hover) .selectable-box-radio{border-color:var(--px-color-border-state-hover-default)}:host(:not([disabled])):host(:hover) .selectable-box-checkbox px-selectable-box,:host(:not([disabled])):host(:hover) .selectable-box-radio px-selectable-box{background-color:var( --px-color-background-state-hover-bordered-default )}:host(:not([disabled])):host(:focus-visible) .selectable-box-checkbox,:host(:not([disabled])):host(:focus-visible) .selectable-box-radio{outline-offset:var(--px-focus-offset-mobile);outline-style:solid}:host([checked]) .selectable-box-checkbox,:host([checked]) .selectable-box-radio{border-color:var(--px-color-border-state-active-default)}:host([disabled]) .selectable-box-checkbox,:host([disabled]) .selectable-box-radio{cursor:default;pointer-events:none;border-color:transparent}:host([disabled]) .selectable-box-checkbox px-selectable-box,:host([disabled]) .selectable-box-radio px-selectable-box{background-color:var(--px-color-background-state-disabled-default)}:host([disabled]) ::slotted([slot="title"]),:host([disabled]) ::slotted([slot="description"]),:host([disabled]) ::slotted([slot="content"]){color:var(--px-color-text-state-disabled-default)}@media screen and (min-width: 48rem){.selectable-box-checkbox,.selectable-box-radio{outline-width:var(--px-focus-outline-tablet)}}@media screen and (min-width: 64.0625rem){.selectable-box-checkbox,.selectable-box-radio{outline-width:var(--px-focus-outline-laptop)}}@media screen and (min-width: 90.0625rem){.selectable-box-checkbox,.selectable-box-radio{outline-width:var(--px-focus-outline-desktop)}}:host([inverted]) .selectable-box-checkbox,:host([inverted]) .selectable-box-radio{border-color:var(--px-color-border-main-inverted);outline-color:var(--px-color-border-focus-outline-inverted)}:host([inverted]) .selectable-box-checkbox px-selectable-box,:host([inverted]) .selectable-box-radio px-selectable-box{background-color:var(--px-color-background-container-light-inverted)}:host([inverted]):host(:not([disabled])):host(:hover) .selectable-box-checkbox,:host([inverted]):host(:not([disabled])):host(:hover) .selectable-box-radio{border-color:var(--px-color-border-state-hover-inverted)}:host([inverted]):host(:not([disabled])):host(:hover) .selectable-box-checkbox px-selectable-box,:host([inverted]):host(:not([disabled])):host(:hover) .selectable-box-radio px-selectable-box{background-color:var( --px-color-background-state-hover-bordered-inverted )}:host([inverted]):host([checked]) .selectable-box-checkbox,:host([inverted]):host([checked]) .selectable-box-radio{border-color:var(--px-color-border-state-active-inverted)}:host([inverted]):host([disabled]) .selectable-box-checkbox,:host([inverted]):host([disabled]) .selectable-box-radio{border-color:transparent}:host([inverted]):host([disabled]) .selectable-box-checkbox px-selectable-box,:host([inverted]):host([disabled]) .selectable-box-radio px-selectable-box{background-color:var(--px-color-background-state-disabled-inverted)}:host([inverted]):host([disabled]) ::slotted([slot="title"]),:host([inverted]):host([disabled]) ::slotted([slot="description"]),:host([inverted]):host([disabled]) ::slotted([slot="content"]){color:var(--px-color-text-state-disabled-inverted)}', f = new CSSStyleSheet();
|
|
698
698
|
f.replaceSync(x);
|
|
699
|
-
class
|
|
699
|
+
class q extends c {
|
|
700
700
|
template() {
|
|
701
701
|
return `
|
|
702
702
|
<div class="selectable-box-checkbox">
|
|
@@ -861,11 +861,10 @@ class I extends c {
|
|
|
861
861
|
t ? this.setAttribute("value", t) : this.removeAttribute("value");
|
|
862
862
|
}
|
|
863
863
|
}
|
|
864
|
-
customElements.get("px-selectable-box-checkbox") || customElements.define("px-selectable-box-checkbox",
|
|
864
|
+
customElements.get("px-selectable-box-checkbox") || customElements.define("px-selectable-box-checkbox", q);
|
|
865
865
|
const v = new CSSStyleSheet();
|
|
866
866
|
v.replaceSync(x);
|
|
867
|
-
|
|
868
|
-
class B extends c {
|
|
867
|
+
class I extends c {
|
|
869
868
|
template() {
|
|
870
869
|
return `
|
|
871
870
|
<div class="selectable-box-radio">
|
|
@@ -889,12 +888,8 @@ class B extends c {
|
|
|
889
888
|
super(v), this.shadowRoot.innerHTML = this.template(), this.internals = (t = this.attachInternals) == null ? void 0 : t.call(this);
|
|
890
889
|
}
|
|
891
890
|
connectedCallback() {
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
bubbles: !0,
|
|
895
|
-
composed: !0
|
|
896
|
-
})
|
|
897
|
-
), this.ariaChecked = "false", this.toggleFooterVisibility(), this.$slotFooter.addEventListener(
|
|
891
|
+
var t;
|
|
892
|
+
this.toggleFooterVisibility = this.toggleFooterVisibility.bind(this), this.role = "radio", this.internals && (this.internals.role = "radio"), this.tabIndex = ((t = this.parentElement) == null ? void 0 : t.querySelector("px-selectable-box-radio")) === this ? 0 : -1, this.ariaChecked = "false", this.toggleFooterVisibility(), this.$slotFooter.addEventListener(
|
|
898
893
|
"slotchange",
|
|
899
894
|
this.toggleFooterVisibility
|
|
900
895
|
), this.addEventListener("mouseover", this.setHoverAttribute), this.addEventListener("mouseout", this.removeHoverAttribute), this.addEventListener("keypress", this.setKeypressEvent), this.addEventListener("click", this.setClickEvent);
|
|
@@ -934,12 +929,7 @@ class B extends c {
|
|
|
934
929
|
this.$slotFooter.removeEventListener(
|
|
935
930
|
"slotchange",
|
|
936
931
|
this.toggleFooterVisibility
|
|
937
|
-
), this.removeEventListener("mouseover", this.setHoverAttribute), this.removeEventListener("mouseout", this.removeHoverAttribute), this.removeEventListener("keypress", this.setKeypressEvent), this.removeEventListener("click", this.setClickEvent)
|
|
938
|
-
new CustomEvent(q, {
|
|
939
|
-
bubbles: !0,
|
|
940
|
-
composed: !0
|
|
941
|
-
})
|
|
942
|
-
);
|
|
932
|
+
), this.removeEventListener("mouseover", this.setHoverAttribute), this.removeEventListener("mouseout", this.removeHoverAttribute), this.removeEventListener("keypress", this.setKeypressEvent), this.removeEventListener("click", this.setClickEvent);
|
|
943
933
|
}
|
|
944
934
|
removeHoverAttribute() {
|
|
945
935
|
this.$radio.removeAttribute("hover");
|
|
@@ -965,7 +955,7 @@ class B extends c {
|
|
|
965
955
|
}
|
|
966
956
|
handleCheckedAttributeChange(t) {
|
|
967
957
|
var e;
|
|
968
|
-
(e = this.internals) == null || e.setFormValue(this.formData()), t
|
|
958
|
+
(e = this.internals) == null || e.setFormValue(this.formData()), t === null ? (this.internals && (this.internals.ariaChecked = "false"), this.ariaChecked = "false", this.tabIndex = -1, this.checked = !1, this.$radio && this.$radio.removeAttribute("checked")) : (this.internals && (this.internals.ariaChecked = "true"), this.ariaChecked = "true", this.tabIndex = 0, this.checked = !0, this.$radio && this.$radio.setAttribute("checked", ""), this.dispatchEvent(
|
|
969
959
|
new Event("change", {
|
|
970
960
|
bubbles: !0,
|
|
971
961
|
composed: !0
|
|
@@ -1040,11 +1030,9 @@ class B extends c {
|
|
|
1040
1030
|
t ? this.setAttribute("value", t) : this.removeAttribute("value");
|
|
1041
1031
|
}
|
|
1042
1032
|
}
|
|
1043
|
-
customElements.get("px-selectable-box-radio") || customElements.define("px-selectable-box-radio",
|
|
1033
|
+
customElements.get("px-selectable-box-radio") || customElements.define("px-selectable-box-radio", I);
|
|
1044
1034
|
export {
|
|
1045
|
-
P as SELECTABLE_BOX_RADIO_CONNECTED_EVENT,
|
|
1046
|
-
q as SELECTABLE_BOX_RADIO_DISCONNECTED_EVENT,
|
|
1047
1035
|
H as SelectableBox,
|
|
1048
|
-
|
|
1049
|
-
|
|
1036
|
+
q as SelectableBoxCheckbox,
|
|
1037
|
+
I as SelectableBoxRadio
|
|
1050
1038
|
};
|