@proximus/lavender-selectablebox 2.0.0-alpha.2 → 2.0.0-alpha.4

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.
@@ -3,7 +3,6 @@ import '@proximus/lavender-layout';
3
3
  export declare class SelectableBox extends WithExtraAttributes {
4
4
  protected template(): string;
5
5
  constructor();
6
- connectedCallback(): void;
7
6
  static get observedAttributes(): string[];
8
7
  attributeChangedCallback(attrName: string, oldValue: string, newValue: string): void;
9
8
  get $el(): HTMLElement;
package/dist/index.es.js CHANGED
@@ -617,8 +617,6 @@ class R extends n {
617
617
  constructor() {
618
618
  super(p), this.shadowRoot.innerHTML = this.template();
619
619
  }
620
- connectedCallback() {
621
- }
622
620
  static get observedAttributes() {
623
621
  return [...super.observedAttributes, "inverted", "hide-footer"];
624
622
  }
@@ -647,7 +645,7 @@ class R extends n {
647
645
  }
648
646
  }
649
647
  customElements.get("px-selectable-box") || customElements.define("px-selectable-box", R);
650
- const u = ':host{display:block;outline:none}:host *{box-sizing:border-box}.selectable-box-checkbox,.selectable-box-radio{box-sizing:border-box;height:100%;cursor:default;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 transparent;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(: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}: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 only screen and (min-width: 48em){.selectable-box-checkbox,.selectable-box-radio{outline-width:var(--px-focus-outline-tablet)}}@media only screen and (min-width: 64.0625em){.selectable-box-checkbox,.selectable-box-radio{outline-width:var(--px-focus-outline-laptop)}}@media only screen and (min-width: 90.0625em){.selectable-box-checkbox,.selectable-box-radio{outline-width:var(--px-focus-outline-desktop)}}:host([inverted]) .selectable-box-checkbox,:host([inverted]) .selectable-box-radio{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 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)}', g = new CSSStyleSheet();
648
+ const u = ':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(: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}: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 only screen and (min-width: 48em){.selectable-box-checkbox,.selectable-box-radio{outline-width:var(--px-focus-outline-tablet)}}@media only screen and (min-width: 64.0625em){.selectable-box-checkbox,.selectable-box-radio{outline-width:var(--px-focus-outline-laptop)}}@media only screen and (min-width: 90.0625em){.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 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)}', g = new CSSStyleSheet();
651
649
  g.replaceSync(u);
652
650
  class F extends n {
653
651
  template() {
@@ -675,17 +673,10 @@ class F extends n {
675
673
  super(g), this.shadowRoot.innerHTML = this.template(), this.internals = (t = this.attachInternals) == null ? void 0 : t.call(this), this.tabIndex = 0, this.internals && (this.internals.role = "checkbox", this.internals.ariaChecked = `${this.checked}`);
676
674
  }
677
675
  connectedCallback() {
678
- this.toggleFooterVisibility(), this.$slotFooter.addEventListener("slotchange", () => {
679
- this.toggleFooterVisibility();
680
- }), this.addEventListener("mouseover", () => {
681
- this.setHoverAttribute();
682
- }), this.addEventListener("mouseout", () => {
683
- this.removeHoverAttribute();
684
- }), this.addEventListener("keypress", (t) => {
685
- this.setKeypressEvent(t);
686
- }), this.addEventListener("click", (t) => {
687
- this.setClickEvent(t);
688
- }), this.hasAttribute("checked") && (this.checked = !0);
676
+ this.toggleFooterVisibility(), this.$slotFooter.addEventListener(
677
+ "slotchange",
678
+ this.toggleFooterVisibility
679
+ ), this.addEventListener("mouseover", this.setHoverAttribute), this.addEventListener("mouseout", this.removeHoverAttribute), this.addEventListener("keypress", this.setKeypressEvent), this.addEventListener("click", this.setClickEvent), this.hasAttribute("checked") && (this.checked = !0);
689
680
  }
690
681
  static get observedAttributes() {
691
682
  return [
@@ -722,15 +713,7 @@ class F extends n {
722
713
  this.$slotFooter.removeEventListener(
723
714
  "slotchange",
724
715
  this.toggleFooterVisibility
725
- ), this.removeEventListener("mouseover", () => {
726
- this.setHoverAttribute();
727
- }), this.removeEventListener("mouseout", () => {
728
- this.removeHoverAttribute();
729
- }), this.removeEventListener("keypress", (t) => {
730
- this.setKeypressEvent(t);
731
- }), this.removeEventListener("click", (t) => {
732
- this.setClickEvent(t);
733
- });
716
+ ), this.removeEventListener("mouseover", this.setHoverAttribute), this.removeEventListener("mouseout", this.removeHoverAttribute), this.removeEventListener("keypress", this.setKeypressEvent), this.removeEventListener("click", this.setClickEvent);
734
717
  }
735
718
  removeHoverAttribute() {
736
719
  this.$checkbox.removeAttribute("hover");
@@ -860,17 +843,10 @@ class H extends n {
860
843
  super(x), this.shadowRoot.innerHTML = this.template(), this.internals = (t = this.attachInternals) == null ? void 0 : t.call(this), this.tabIndex = ((e = this.parentElement) == null ? void 0 : e.firstElementChild) === this ? 0 : -1, this.internals && (this.internals.role = "radio", this.internals.ariaChecked = `${this.checked}`);
861
844
  }
862
845
  connectedCallback() {
863
- this.toggleFooterVisibility(), this.$slotFooter.addEventListener("slotchange", () => {
864
- this.toggleFooterVisibility();
865
- }), this.addEventListener("mouseover", () => {
866
- this.setHoverAttribute();
867
- }), this.addEventListener("mouseout", () => {
868
- this.removeHoverAttribute();
869
- }), this.addEventListener("keypress", (t) => {
870
- this.setKeypressEvent(t);
871
- }), this.addEventListener("click", (t) => {
872
- this.setClickEvent(t);
873
- }), this.hasAttribute("checked") && (this.checked = !0);
846
+ this.toggleFooterVisibility(), this.$slotFooter.addEventListener(
847
+ "slotchange",
848
+ this.toggleFooterVisibility
849
+ ), this.addEventListener("mouseover", this.setHoverAttribute), this.addEventListener("mouseout", this.removeHoverAttribute), this.addEventListener("keypress", this.setKeypressEvent), this.addEventListener("click", this.setClickEvent), this.hasAttribute("checked") && (this.checked = !0);
874
850
  }
875
851
  static get observedAttributes() {
876
852
  return [
@@ -907,15 +883,7 @@ class H extends n {
907
883
  this.$slotFooter.removeEventListener(
908
884
  "slotchange",
909
885
  this.toggleFooterVisibility
910
- ), this.removeEventListener("mouseover", () => {
911
- this.setHoverAttribute();
912
- }), this.removeEventListener("mouseout", () => {
913
- this.removeHoverAttribute();
914
- }), this.removeEventListener("keypress", (t) => {
915
- this.setKeypressEvent(t);
916
- }), this.removeEventListener("click", (t) => {
917
- this.setClickEvent(t);
918
- });
886
+ ), this.removeEventListener("mouseover", this.setHoverAttribute), this.removeEventListener("mouseout", this.removeHoverAttribute), this.removeEventListener("keypress", this.setKeypressEvent), this.removeEventListener("click", this.setClickEvent);
919
887
  }
920
888
  removeHoverAttribute() {
921
889
  this.$radio.removeAttribute("hover");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proximus/lavender-selectablebox",
3
- "version": "2.0.0-alpha.2",
3
+ "version": "2.0.0-alpha.4",
4
4
  "description": "",
5
5
  "main": "dist/index.es.js",
6
6
  "types": "dist/index.d.ts",