pixelize-design-library 2.2.105 → 2.2.106
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.
|
@@ -259,32 +259,39 @@ var FilterSidebar = function (_a) {
|
|
|
259
259
|
return (__assign(__assign({}, prev), (_a = {}, _a[section.id] = true, _a)));
|
|
260
260
|
});
|
|
261
261
|
} })),
|
|
262
|
-
section.id !== "rating" && (
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
262
|
+
section.id !== "rating" && (function () {
|
|
263
|
+
var filteredOptions = (expanded[section.id] ? (section.options || []) : (section.options || []).slice(0, maxVisible))
|
|
264
|
+
.filter(function (opt) { return !section.searchable || !(searchTerms[section.id]) || opt.label.toLowerCase().includes((searchTerms[section.id] || "").toLowerCase()); });
|
|
265
|
+
if (filteredOptions.length === 0 && searchTerms[section.id]) {
|
|
266
|
+
return (react_1.default.createElement(react_2.Box, { p: 2, w: "full", textAlign: "center" },
|
|
267
|
+
react_1.default.createElement(react_2.Text, { fontSize: "xs", color: theme.colors.gray[500] }, "No Data Found")));
|
|
268
|
+
}
|
|
269
|
+
return ((section.type === "radio") || section.radio) ? (react_1.default.createElement(react_2.RadioGroup, { w: "full", value: internalSelected[section.id] || "", onChange: function (val) {
|
|
270
|
+
setInternalSelected(function (prev) {
|
|
271
|
+
var _a;
|
|
272
|
+
var next = __assign(__assign({}, prev), (_a = {}, _a[section.id] = val, _a));
|
|
273
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(next);
|
|
274
|
+
return next;
|
|
275
|
+
});
|
|
276
|
+
} },
|
|
277
|
+
react_1.default.createElement(react_2.VStack, { align: "start", spacing: 1, w: "full" }, filteredOptions.map(function (opt) { return (react_1.default.createElement(react_2.Radio, { key: opt.id, value: opt.id, size: "sm", colorScheme: "red" },
|
|
278
|
+
react_1.default.createElement(react_2.Text, { fontSize: "xs", color: theme.colors.gray[700] }, opt.label))); })))) : (filteredOptions.map(function (opt) { return (react_1.default.createElement(react_2.Flex, { key: opt.id, align: "center", justify: "space-between", w: "full", _hover: { bg: theme.colors.gray[50], borderRadius: "md" }, p: 0 },
|
|
279
|
+
react_1.default.createElement(react_2.Flex, { align: "center", gap: 1 },
|
|
280
|
+
react_1.default.createElement(Checkbox_1.default, { isChecked: Array.isArray(internalSelected[section.id]) && (internalSelected[section.id] || []).includes(opt.id), onChange: function (e) {
|
|
281
|
+
toggleOption(section.id, opt.id, e.target.checked);
|
|
282
|
+
}, size: "sm", iconSize: "0.5rem", sx: {
|
|
283
|
+
'.chakra-checkbox__control': {
|
|
284
|
+
width: '12px',
|
|
285
|
+
height: '12px',
|
|
286
|
+
},
|
|
287
|
+
marginLeft: "2px",
|
|
288
|
+
}, color: "red" }),
|
|
289
|
+
react_1.default.createElement(react_2.Text, { fontSize: "xs", color: theme.colors.gray[700], cursor: "pointer", onClick: function () {
|
|
290
|
+
var isChecked = Array.isArray(internalSelected[section.id]) && (internalSelected[section.id] || []).includes(opt.id);
|
|
291
|
+
toggleOption(section.id, opt.id, !isChecked);
|
|
292
|
+
} }, opt.label)),
|
|
293
|
+
typeof opt.count === "number" && (react_1.default.createElement(react_2.Badge, { fontSize: "xs", colorScheme: "gray", borderRadius: "full", px: 2 }, opt.count)))); }));
|
|
294
|
+
})(),
|
|
288
295
|
(section.options && section.options.length > maxVisible) && (react_1.default.createElement(react_2.Text, { fontSize: "sm", fontWeight: "medium", color: theme.colors.blue[600], cursor: "pointer", _hover: { textDecoration: "underline" }, onClick: function () { return setExpanded(function (prev) {
|
|
289
296
|
var _a;
|
|
290
297
|
return (__assign(__assign({}, prev), (_a = {}, _a[section.id] = !prev[section.id], _a)));
|
|
@@ -151,7 +151,7 @@ function ProductImageSlider(_a) {
|
|
|
151
151
|
var yt = getYouTubeId(url);
|
|
152
152
|
var vimeo = getVimeoId(url);
|
|
153
153
|
var dm = getDailymotionId(url);
|
|
154
|
-
var thumb = getThumbForItem(url);
|
|
154
|
+
var thumb = (item === null || item === void 0 ? void 0 : item.thumb) || getThumbForItem(url);
|
|
155
155
|
if (isVideo) {
|
|
156
156
|
if (!isPlaying) {
|
|
157
157
|
return (react_2.default.createElement(react_1.Box, { position: "relative", w: "100%", h: "".concat(imageSize, "px") },
|
|
@@ -186,7 +186,7 @@ function ProductImageSlider(_a) {
|
|
|
186
186
|
var actualIndex = thumbStartIndex + index;
|
|
187
187
|
var url = src.imageUrl;
|
|
188
188
|
var isVideo = src.isImage !== undefined ? src.isImage === false : isVideoUrl(url);
|
|
189
|
-
var thumb = getThumbForItem(url);
|
|
189
|
+
var thumb = src.thumb || getThumbForItem(url);
|
|
190
190
|
return (react_2.default.createElement(react_1.Box, { key: actualIndex, w: "".concat(thumbHeight, "px"), h: "".concat(thumbHeight, "px"), borderRadius: "md", overflow: "hidden", cursor: "pointer", border: actualIndex === activeIndex
|
|
191
191
|
? "0.125rem solid ".concat(theme.colors.gray[500])
|
|
192
192
|
: "0.125rem solid transparent", opacity: actualIndex === activeIndex ? 1 : 0.5, onClick: function () { return setActiveIndex(actualIndex); }, _hover: { opacity: 1 }, transition: "all 0.2s", position: "relative" }, isVideo ? (thumb ? (react_2.default.createElement(react_2.default.Fragment, null,
|
|
@@ -204,7 +204,7 @@ function ProductImageSlider(_a) {
|
|
|
204
204
|
var actualIndex = thumbStartIndex + index;
|
|
205
205
|
var url = src.imageUrl;
|
|
206
206
|
var isVideo = src.isImage !== undefined ? src.isImage === false : isVideoUrl(url);
|
|
207
|
-
var thumb = getThumbForItem(url);
|
|
207
|
+
var thumb = src.thumb || getThumbForItem(url);
|
|
208
208
|
return (react_2.default.createElement(react_1.Box, { key: actualIndex, w: "".concat(thumbHeight, "px"), h: "".concat(thumbHeight, "px"), borderRadius: "md", overflow: "hidden", cursor: "pointer", border: actualIndex === activeIndex
|
|
209
209
|
? "0.125rem solid ".concat(theme.colors.gray[500])
|
|
210
210
|
: "0.125rem solid transparent", opacity: actualIndex === activeIndex ? 1 : 0.5, onClick: function () { return setActiveIndex(actualIndex); }, _hover: { opacity: 1 }, transition: "all 0.2s", position: "relative" }, isVideo ? (thumb ? (react_2.default.createElement(react_2.default.Fragment, null,
|
|
@@ -234,7 +234,7 @@ function ProductImageSlider(_a) {
|
|
|
234
234
|
var yt = getYouTubeId(url);
|
|
235
235
|
var vimeo = getVimeoId(url);
|
|
236
236
|
var dm = getDailymotionId(url);
|
|
237
|
-
var thumb = getThumbForItem(url);
|
|
237
|
+
var thumb = (item === null || item === void 0 ? void 0 : item.thumb) || getThumbForItem(url);
|
|
238
238
|
if (isVideo) {
|
|
239
239
|
if (!isPlaying) {
|
|
240
240
|
return (react_2.default.createElement(react_1.Box, { position: "relative", w: "100%", h: "".concat(imageSize, "px") },
|