@florid-kit/components 3.1.9 → 3.1.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.
@@ -294,7 +294,8 @@ o.styles = u`
294
294
  fill: var(--color-content-disabled);
295
295
  }
296
296
 
297
- .icon-button:focus-visible {
297
+ .icon-button:focus-visible,
298
+ :host(.a--tabfocus) .icon-button {
298
299
  ${f}
299
300
  }
300
301
 
@@ -14,6 +14,7 @@ export declare class MiniTile extends MiniTile_base {
14
14
  outOfStock: boolean;
15
15
  onClickTile?: () => void;
16
16
  onClickIcon?: () => void;
17
+ productUrl: string;
17
18
  private onClick;
18
19
  private onClickIcons;
19
20
  get icons(): import('lit').TemplateResult<1>;
@@ -1,31 +1,31 @@
1
- import { m as f, a as d, x as o, i as g } from "../performance-mixin-D7YmSeqN.mjs";
2
- import { n as i } from "../property-S_Y9cb04.mjs";
1
+ import { m as d, a as f, x as t, i as g } from "../performance-mixin-D7YmSeqN.mjs";
2
+ import { n as e } from "../property-S_Y9cb04.mjs";
3
3
  import "./icon-button.mjs";
4
4
  import "./tag.mjs";
5
- var m = Object.defineProperty, e = (p, n, s, l) => {
6
- for (var a = void 0, r = p.length - 1, h; r >= 0; r--)
7
- (h = p[r]) && (a = h(n, s, a) || a);
8
- return a && m(n, s, a), a;
5
+ var u = Object.defineProperty, o = (p, r, s, l) => {
6
+ for (var a = void 0, n = p.length - 1, h; n >= 0; n--)
7
+ (h = p[n]) && (a = h(r, s, a) || a);
8
+ return a && u(r, s, a), a;
9
9
  };
10
- const c = class c extends f(d) {
10
+ const c = class c extends d(f) {
11
11
  constructor() {
12
- super(...arguments), this.type = "cart | chevron", this.titleProduct = "", this.volume = "", this.perLiter = "", this.mainPrice = "", this.imageUrl = "https://placehold.co/56x70", this.altImage = "", this.fullwidth = !1, this.tagText = "", this.outOfStock = !1;
12
+ super(...arguments), this.type = "cart | chevron", this.titleProduct = "", this.volume = "", this.perLiter = "", this.mainPrice = "", this.imageUrl = "https://placehold.co/56x70", this.altImage = "", this.fullwidth = !1, this.tagText = "", this.outOfStock = !1, this.productUrl = "";
13
13
  }
14
- onClick(n) {
15
- var l, a, r;
16
- const s = n.target;
17
- (l = s == null ? void 0 : s.classList) != null && l.contains("add-to-bag") || (a = s == null ? void 0 : s.classList) != null && a.contains("js-availability-notify-details-cart") || ((r = this.onClickTile) == null || r.call(this), this.dispatchEvent(
14
+ onClick(r) {
15
+ var l, a, n;
16
+ const s = r.target;
17
+ (l = s == null ? void 0 : s.classList) != null && l.contains("add-to-bag") || (a = s == null ? void 0 : s.classList) != null && a.contains("js-availability-notify-details-cart") || ((n = this.onClickTile) == null || n.call(this), this.dispatchEvent(
18
18
  new CustomEvent("tile-click", { bubbles: !0, composed: !0 })
19
19
  ));
20
20
  }
21
21
  onClickIcons() {
22
- var n;
23
- (n = this.onClickIcon) == null || n.call(this), this.dispatchEvent(
22
+ var r;
23
+ (r = this.onClickIcon) == null || r.call(this), this.dispatchEvent(
24
24
  new CustomEvent("tile-icon-click", { bubbles: !0, composed: !0 })
25
25
  );
26
26
  }
27
27
  get icons() {
28
- return this.type === "chevron" ? o`
28
+ return this.type === "chevron" ? t`
29
29
  <o-icon-button
30
30
  @click=${this.onClickIcons}
31
31
  icon="occ-chevron-right"
@@ -38,7 +38,7 @@ const c = class c extends f(d) {
38
38
  tabindex="-1"
39
39
  class="chevron-icon"
40
40
  ></o-icon-button>
41
- ` : o`
41
+ ` : t`
42
42
  <o-icon-button
43
43
  @click=${this.onClickIcons}
44
44
  icon=${this.outOfStock ? "notifyme" : "cart"}
@@ -48,26 +48,49 @@ const c = class c extends f(d) {
48
48
  status="empty"
49
49
  strokewidth="0"
50
50
  class=${this.outOfStock ? "js-availability-notify-details-cart" : "add-to-bag"}
51
+ title="${window.Resources[this.outOfStock ? "NOSTOCK" : "ADD_TO_CART"]} - ${this.titleProduct || ""} ${this.volume || ""}"
51
52
  ></o-icon-button>
52
53
  `;
53
54
  }
54
55
  render() {
55
- return o`
56
+ return "productUrl" in this.dataset && this.dataset.productUrl && (this.productUrl = this.dataset.productUrl), this.type !== "chevron" && this.productUrl !== "" ? t`
57
+ <div class="tile fullpointer ${this.fullwidth ? "fullwidth" : ""}">
58
+ <a href="${this.productUrl}"
59
+ @click=${this.onClick}
60
+ title="${window.Resources.VIEW_PRODUCT || ""} - ${this.titleProduct || ""} ${this.volume || ""} ${this.mainPrice ? " - " + this.mainPrice : ""}"
61
+ >
62
+ ${this.imageUrl ? t`<img src="${this.imageUrl}" alt="${this.altImage || ""}" />` : ""}
63
+ <span class="info">
64
+ ${this.outOfStock ? t`<o-tag type="nostock" role="status" aria-live="polite"
65
+ >${this.tagText}</o-tag
66
+ >` : this.tagText ? t`<o-tag bgstyle="background-emphasis">${this.tagText}</o-tag>` : ""}
67
+ ${this.titleProduct ? t`<span class="title">${this.titleProduct}</span>` : ""}
68
+ <span class="details">
69
+ ${this.volume ? t`<span class="volume-info">${this.volume}</span>` : ""}
70
+ ${this.type === "cart" && this.mainPrice ? t`<span class="main-price">${this.mainPrice}</span>` : ""}
71
+ ${this.type === "cart" && this.perLiter ? t`<span class="per-liter">${this.perLiter}</span>` : ""}
72
+ </span>
73
+ </span>
74
+ </a>
75
+ ${this.icons}
76
+ </div>
77
+ ` : t`
56
78
  <button
57
79
  type="button"
58
80
  class="tile fullpointer ${this.fullwidth ? "fullwidth" : ""}"
59
81
  @click=${this.onClick}
82
+ title="${window.Resources.VIEW_PRODUCT || ""} - ${this.titleProduct || ""} ${this.volume || ""} ${this.mainPrice ? " - " + this.mainPrice : ""}"
60
83
  >
61
- ${this.imageUrl ? o`<img src="${this.imageUrl}" alt="${this.altImage || ""}" />` : ""}
84
+ ${this.imageUrl ? t`<img src="${this.imageUrl}" alt="${this.altImage || ""}" />` : ""}
62
85
  <div class="info">
63
- ${this.outOfStock ? o`<o-tag type="nostock" role="status" aria-live="polite"
86
+ ${this.outOfStock ? t`<o-tag type="nostock" role="status" aria-live="polite"
64
87
  >${this.tagText}</o-tag
65
- >` : this.tagText ? o`<o-tag bgstyle="background-emphasis">${this.tagText}</o-tag>` : ""}
66
- ${this.titleProduct ? o`<div class="title">${this.titleProduct}</div>` : ""}
88
+ >` : this.tagText ? t`<o-tag bgstyle="background-emphasis">${this.tagText}</o-tag>` : ""}
89
+ ${this.titleProduct ? t`<div class="title">${this.titleProduct}</div>` : ""}
67
90
  <div class="details">
68
- ${this.volume ? o`<span class="volume-info">${this.volume}</span>` : ""}
69
- ${this.type === "cart" && this.mainPrice ? o`<span class="main-price">${this.mainPrice}</span>` : ""}
70
- ${this.type === "cart" && this.perLiter ? o`<span class="per-liter">${this.perLiter}</span>` : ""}
91
+ ${this.volume ? t`<span class="volume-info">${this.volume}</span>` : ""}
92
+ ${this.type === "cart" && this.mainPrice ? t`<span class="main-price">${this.mainPrice}</span>` : ""}
93
+ ${this.type === "cart" && this.perLiter ? t`<span class="per-liter">${this.perLiter}</span>` : ""}
71
94
  </div>
72
95
  </div>
73
96
  ${this.icons}
@@ -81,6 +104,13 @@ c.styles = g`
81
104
  max-width: 100%;
82
105
  }
83
106
 
107
+ .tile a {
108
+ display: flex;
109
+ flex-grow: 1;
110
+ align-items: center;
111
+ text-decoration: none;
112
+ }
113
+
84
114
  .tile {
85
115
  display: flex;
86
116
  align-items: center;
@@ -116,6 +146,7 @@ c.styles = g`
116
146
  }
117
147
 
118
148
  .info {
149
+ display: block;
119
150
  flex: 1 1 auto;
120
151
  min-width: 0;
121
152
  margin-left: 10px;
@@ -191,44 +222,47 @@ c.styles = g`
191
222
  cursor: pointer;
192
223
  }
193
224
  `;
194
- let t = c;
195
- e([
196
- i({ type: String })
197
- ], t.prototype, "type");
198
- e([
199
- i({ type: String })
200
- ], t.prototype, "titleProduct");
201
- e([
202
- i({ type: String })
203
- ], t.prototype, "volume");
204
- e([
205
- i({ type: String })
206
- ], t.prototype, "perLiter");
207
- e([
208
- i({ type: String })
209
- ], t.prototype, "mainPrice");
210
- e([
211
- i({ type: String })
212
- ], t.prototype, "imageUrl");
213
- e([
214
- i({ type: String })
215
- ], t.prototype, "altImage");
216
- e([
217
- i({ type: Boolean })
218
- ], t.prototype, "fullwidth");
219
- e([
220
- i({ type: String })
221
- ], t.prototype, "tagText");
222
- e([
223
- i({ type: Boolean })
224
- ], t.prototype, "outOfStock");
225
- e([
226
- i({ attribute: !1 })
227
- ], t.prototype, "onClickTile");
228
- e([
229
- i({ attribute: !1 })
230
- ], t.prototype, "onClickIcon");
231
- customElements.define("mini-tile", t);
225
+ let i = c;
226
+ o([
227
+ e({ type: String })
228
+ ], i.prototype, "type");
229
+ o([
230
+ e({ type: String })
231
+ ], i.prototype, "titleProduct");
232
+ o([
233
+ e({ type: String })
234
+ ], i.prototype, "volume");
235
+ o([
236
+ e({ type: String })
237
+ ], i.prototype, "perLiter");
238
+ o([
239
+ e({ type: String })
240
+ ], i.prototype, "mainPrice");
241
+ o([
242
+ e({ type: String })
243
+ ], i.prototype, "imageUrl");
244
+ o([
245
+ e({ type: String })
246
+ ], i.prototype, "altImage");
247
+ o([
248
+ e({ type: Boolean })
249
+ ], i.prototype, "fullwidth");
250
+ o([
251
+ e({ type: String })
252
+ ], i.prototype, "tagText");
253
+ o([
254
+ e({ type: Boolean })
255
+ ], i.prototype, "outOfStock");
256
+ o([
257
+ e({ attribute: !1 })
258
+ ], i.prototype, "onClickTile");
259
+ o([
260
+ e({ attribute: !1 })
261
+ ], i.prototype, "onClickIcon");
262
+ o([
263
+ e({ type: String })
264
+ ], i.prototype, "productUrl");
265
+ customElements.define("mini-tile", i);
232
266
  export {
233
- t as MiniTile
267
+ i as MiniTile
234
268
  };
package/index.mjs CHANGED
@@ -37,4 +37,4 @@ import "./components/search-input.mjs";
37
37
  import "./components/search-input-dropdown.mjs";
38
38
  import "./components/option-tile.mjs";
39
39
  import "./components/option-tile-group.mjs";
40
- globalThis.__FLORID_KIT__ = "3.1.9";
40
+ globalThis.__FLORID_KIT__ = "3.1.10";
package/loader.mjs CHANGED
@@ -4,7 +4,7 @@ import "./components/link.mjs";
4
4
  import "./components/header-simplify.mjs";
5
5
  import "./components/breadcrumb.mjs";
6
6
  import "./components/breadcrumbs.mjs";
7
- globalThis.__FLORID_KIT__ = "3.1.9";
7
+ globalThis.__FLORID_KIT__ = "3.1.10";
8
8
  const i = {
9
9
  "o-accordion": () => import("./components/accordion.mjs"),
10
10
  "o-accordion-group": () => import("./components/accordion-group.mjs"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@florid-kit/components",
3
- "version": "3.1.9",
3
+ "version": "3.1.10",
4
4
  "main": "index.js",
5
5
  "module": "index.mjs",
6
6
  "typings": "index.d.ts",