@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.
- package/components/icon-button.mjs +2 -1
- package/components/minitile.d.ts +1 -0
- package/components/minitile.mjs +97 -63
- package/index.mjs +1 -1
- package/loader.mjs +1 -1
- package/package.json +1 -1
package/components/minitile.d.ts
CHANGED
package/components/minitile.mjs
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { m as
|
|
2
|
-
import { n as
|
|
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
|
|
6
|
-
for (var a = void 0,
|
|
7
|
-
(h = p[
|
|
8
|
-
return 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
|
|
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(
|
|
15
|
-
var l, a,
|
|
16
|
-
const s =
|
|
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") || ((
|
|
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
|
|
23
|
-
(
|
|
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" ?
|
|
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
|
-
` :
|
|
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
|
|
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 ?
|
|
84
|
+
${this.imageUrl ? t`<img src="${this.imageUrl}" alt="${this.altImage || ""}" />` : ""}
|
|
62
85
|
<div class="info">
|
|
63
|
-
${this.outOfStock ?
|
|
86
|
+
${this.outOfStock ? t`<o-tag type="nostock" role="status" aria-live="polite"
|
|
64
87
|
>${this.tagText}</o-tag
|
|
65
|
-
>` : this.tagText ?
|
|
66
|
-
${this.titleProduct ?
|
|
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 ?
|
|
69
|
-
${this.type === "cart" && this.mainPrice ?
|
|
70
|
-
${this.type === "cart" && this.perLiter ?
|
|
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
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
],
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
],
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
],
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
],
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
],
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
],
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
],
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
],
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
],
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
],
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
],
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
],
|
|
231
|
-
|
|
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
|
-
|
|
267
|
+
i as MiniTile
|
|
234
268
|
};
|
package/index.mjs
CHANGED
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.
|
|
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"),
|