@florid-kit/components 0.3.11 → 0.3.12

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.
@@ -7,6 +7,7 @@ export declare class OccitaneWishlistButton extends LitElement {
7
7
  ariaDescribedBy: string;
8
8
  label: string;
9
9
  protected render(): import('lit').TemplateResult<1>;
10
+ private handleClick;
10
11
  private toggleStatus;
11
12
  setStatus(status: Status): void;
12
13
  setAriaDescribedBy(ariaDescribedBy: string): void;
package/index.js CHANGED
@@ -181,16 +181,14 @@
181
181
  `,ct={wishlist:oe,playerv:ne,chevronRight:ae,chevronLeft:le,"star-0":he,"star-25":ce,"star-50":de,"star-75":pe,"star-100":ue};var ge=Object.defineProperty,fe=Object.getOwnPropertyDescriptor,X=(i,t,e,s)=>{for(var r=s>1?void 0:s?fe(t,e):t,n=i.length-1,o;n>=0;n--)(o=i[n])&&(r=(s?o(t,e,r):o(r))||r);return s&&r&&ge(t,e,r),r};let U=class extends ${constructor(){super(...arguments),this.status="empty",this.ariaDescribedBy="a-product-name",this.label="Add to wishlist"}render(){const i=ct.wishlist.replace("<svg",'<svg aria-hidden="true" focusable="false" part="svg"');return g`
182
182
  <button
183
183
  type="button"
184
- aria-label="${this.label}"
185
184
  aria-describedby="${this.ariaDescribedBy}"
186
- aria-pressed="${this.status=="filled"?"true":"false"}"
187
185
  class="wishlist-button"
188
- @click="${this.toggleStatus}"
186
+ @click="${this.handleClick}"
189
187
  >
190
188
  <span class="sr-only">${this.label}</span>
191
189
  ${K(i)}
192
190
  </button>
193
- `}toggleStatus(){this.status=this.status=="empty"?"filled":"empty"}setStatus(i){this.status=i,this.requestUpdate()}setAriaDescribedBy(i){this.ariaDescribedBy=i,this.requestUpdate()}setLabel(i){this.label=i,this.requestUpdate()}};U.styles=O`
191
+ `}handleClick(i){this.toggleStatus(),this.dispatchEvent(new MouseEvent("click",{bubbles:!0,composed:!0}))}toggleStatus(){this.status=this.status=="empty"?"filled":"empty"}setStatus(i){this.status=i,this.requestUpdate()}setAriaDescribedBy(i){this.ariaDescribedBy=i,this.requestUpdate()}setLabel(i){this.label=i,this.requestUpdate()}};U.styles=O`
194
192
  :host {
195
193
  display: inline-flex;
196
194
  justify-content: center;
package/index.mjs CHANGED
@@ -931,17 +931,21 @@ let U = class extends $ {
931
931
  return g`
932
932
  <button
933
933
  type="button"
934
- aria-label="${this.label}"
935
934
  aria-describedby="${this.ariaDescribedBy}"
936
- aria-pressed="${this.status == "filled" ? "true" : "false"}"
937
935
  class="wishlist-button"
938
- @click="${this.toggleStatus}"
936
+ @click="${this.handleClick}"
939
937
  >
940
938
  <span class="sr-only">${this.label}</span>
941
939
  ${K(i)}
942
940
  </button>
943
941
  `;
944
942
  }
943
+ handleClick(i) {
944
+ this.toggleStatus(), this.dispatchEvent(new MouseEvent("click", {
945
+ bubbles: !0,
946
+ composed: !0
947
+ }));
948
+ }
945
949
  toggleStatus() {
946
950
  this.status = this.status == "empty" ? "filled" : "empty";
947
951
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@florid-kit/components",
3
- "version": "0.3.11",
3
+ "version": "0.3.12",
4
4
  "main": "index.js",
5
5
  "module": "index.mjs",
6
6
  "typings": "index.d.ts",