ekm-ui 0.3.74 → 0.3.78
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/.turbo/turbo-build.log +128 -128
- package/CHANGELOG.md +12 -0
- package/dist/accordion.d.ts +28 -21
- package/dist/accordion.mjs +1 -1
- package/dist/alert-banner.mjs +1 -1
- package/dist/avatar.mjs +1 -1
- package/dist/badge.mjs +1 -1
- package/dist/breadcrumb.mjs +1 -1
- package/dist/card-payment-block.css +1 -1
- package/dist/card-payment-block.css.map +1 -1
- package/dist/card-payment-block.mjs +46 -46
- package/dist/checkbox.mjs +1 -1
- package/dist/chunk-2OTVEVU7.mjs +11 -0
- package/dist/chunk-2OTVEVU7.mjs.map +1 -0
- package/dist/{chunk-47S6AX7M.mjs → chunk-2PW7KHXJ.mjs} +1 -1
- package/dist/chunk-2PW7KHXJ.mjs.map +1 -0
- package/dist/{chunk-CMA7TSQG.mjs → chunk-35VEFUPA.mjs} +4 -4
- package/dist/chunk-35VEFUPA.mjs.map +1 -0
- package/dist/{chunk-ZWJSMASL.mjs → chunk-3AGRJPPN.mjs} +3 -3
- package/dist/chunk-3AGRJPPN.mjs.map +1 -0
- package/dist/{chunk-MRJOYGDD.mjs → chunk-3TAXDPV6.mjs} +2 -2
- package/dist/{chunk-MRJOYGDD.mjs.map → chunk-3TAXDPV6.mjs.map} +1 -1
- package/dist/{chunk-5DQUZENZ.mjs → chunk-6F3XKP3G.mjs} +2 -2
- package/dist/chunk-6F3XKP3G.mjs.map +1 -0
- package/dist/{chunk-HEKVJKLH.mjs → chunk-6UK5Y6KZ.mjs} +2 -2
- package/dist/{chunk-HEKVJKLH.mjs.map → chunk-6UK5Y6KZ.mjs.map} +1 -1
- package/dist/{chunk-EWNPNF2B.mjs → chunk-76V2THLN.mjs} +3 -3
- package/dist/chunk-76V2THLN.mjs.map +1 -0
- package/dist/chunk-7GLTVVKS.mjs +12 -0
- package/dist/chunk-7GLTVVKS.mjs.map +1 -0
- package/dist/{chunk-UUWBHZKH.mjs → chunk-7MH2LXFV.mjs} +4 -4
- package/dist/{chunk-UUWBHZKH.mjs.map → chunk-7MH2LXFV.mjs.map} +1 -1
- package/dist/{chunk-7YKZ7D7U.mjs → chunk-ATNP3Z6G.mjs} +2 -2
- package/dist/{chunk-25FJ277C.mjs → chunk-AYH56CFA.mjs} +3 -3
- package/dist/chunk-AYH56CFA.mjs.map +1 -0
- package/dist/{chunk-NEJOZRKV.mjs → chunk-BK5RX7N5.mjs} +2 -2
- package/dist/chunk-BK5RX7N5.mjs.map +1 -0
- package/dist/{chunk-F6ZWBNIM.mjs → chunk-CIUW5YZ7.mjs} +2 -2
- package/dist/chunk-CIUW5YZ7.mjs.map +1 -0
- package/dist/{chunk-WMFTYTMD.mjs → chunk-CZC4EJOD.mjs} +3 -3
- package/dist/chunk-CZC4EJOD.mjs.map +1 -0
- package/dist/{chunk-CEK5K5TU.mjs → chunk-D3VRYN5H.mjs} +4 -4
- package/dist/chunk-D3VRYN5H.mjs.map +1 -0
- package/dist/{chunk-W3DRXKTC.mjs → chunk-DBTYTFGU.mjs} +2 -2
- package/dist/chunk-DBTYTFGU.mjs.map +1 -0
- package/dist/{chunk-JCWSMIVA.mjs → chunk-E6KQBM7F.mjs} +2 -2
- package/dist/chunk-E6KQBM7F.mjs.map +1 -0
- package/dist/{chunk-5FPVCRAI.mjs → chunk-ECOC3JRK.mjs} +1 -1
- package/dist/{chunk-5FPVCRAI.mjs.map → chunk-ECOC3JRK.mjs.map} +1 -1
- package/dist/{chunk-3LINEESX.mjs → chunk-EH3ZVEVT.mjs} +1 -1
- package/dist/chunk-EH3ZVEVT.mjs.map +1 -0
- package/dist/{chunk-YJKULMWM.mjs → chunk-EX5FMSQL.mjs} +2 -2
- package/dist/chunk-EX5FMSQL.mjs.map +1 -0
- package/dist/{chunk-ASCPOK5F.mjs → chunk-FVUORQJX.mjs} +4 -4
- package/dist/chunk-FVUORQJX.mjs.map +1 -0
- package/dist/{chunk-WFRV27QA.mjs → chunk-G5A3E5IG.mjs} +3 -3
- package/dist/chunk-G5A3E5IG.mjs.map +1 -0
- package/dist/{chunk-2IL2LP47.mjs → chunk-HOCKBMTF.mjs} +3 -3
- package/dist/chunk-HOCKBMTF.mjs.map +1 -0
- package/dist/{chunk-FRIXS4BL.mjs → chunk-JPF3K5TD.mjs} +1 -1
- package/dist/chunk-JPF3K5TD.mjs.map +1 -0
- package/dist/{chunk-AYXC2DCM.mjs → chunk-K2G6O2LX.mjs} +3 -3
- package/dist/chunk-K2G6O2LX.mjs.map +1 -0
- package/dist/chunk-LVJYP46A.mjs +9 -0
- package/dist/chunk-LVJYP46A.mjs.map +1 -0
- package/dist/{chunk-VQ3MZS4J.mjs → chunk-MPIWXVKP.mjs} +2 -2
- package/dist/chunk-MPIWXVKP.mjs.map +1 -0
- package/dist/{chunk-DZABAR36.mjs → chunk-NJC2WLYK.mjs} +2 -2
- package/dist/chunk-NJC2WLYK.mjs.map +1 -0
- package/dist/{chunk-5CGIKL2Y.mjs → chunk-OG6UBKMG.mjs} +2 -2
- package/dist/chunk-OG6UBKMG.mjs.map +1 -0
- package/dist/chunk-PEODF7PL.mjs +34 -0
- package/dist/chunk-PEODF7PL.mjs.map +1 -0
- package/dist/{chunk-FAFXVD4P.mjs → chunk-PJZVMYPN.mjs} +4 -4
- package/dist/chunk-PJZVMYPN.mjs.map +1 -0
- package/dist/{chunk-KEIDXVZB.mjs → chunk-PT4IH2KW.mjs} +2 -2
- package/dist/chunk-PT4IH2KW.mjs.map +1 -0
- package/dist/{chunk-MXH3TZWM.mjs → chunk-QFECX4D6.mjs} +1 -1
- package/dist/chunk-QFECX4D6.mjs.map +1 -0
- package/dist/{chunk-5VH26DHQ.mjs → chunk-QMFUWXJJ.mjs} +1 -1
- package/dist/chunk-QMFUWXJJ.mjs.map +1 -0
- package/dist/chunk-R4A5DO7E.mjs +12 -0
- package/dist/chunk-R4A5DO7E.mjs.map +1 -0
- package/dist/{chunk-LQQDRIZN.mjs → chunk-RGCO6BCU.mjs} +3 -3
- package/dist/chunk-RGCO6BCU.mjs.map +1 -0
- package/dist/{chunk-PPMW7YAZ.mjs → chunk-SFSA2WUE.mjs} +28 -28
- package/dist/chunk-SFSA2WUE.mjs.map +1 -0
- package/dist/{chunk-XUXHB434.mjs → chunk-SM4TG5VI.mjs} +1 -1
- package/dist/chunk-SM4TG5VI.mjs.map +1 -0
- package/dist/{chunk-D6H235SZ.mjs → chunk-UPAA75QA.mjs} +1 -1
- package/dist/chunk-UPAA75QA.mjs.map +1 -0
- package/dist/{chunk-256SAVHD.mjs → chunk-W3XYS7M3.mjs} +1 -1
- package/dist/{chunk-256SAVHD.mjs.map → chunk-W3XYS7M3.mjs.map} +1 -1
- package/dist/chunk-X2JENUDV.mjs +16 -0
- package/dist/chunk-X2JENUDV.mjs.map +1 -0
- package/dist/chunk-XBWUYKZW.mjs +10 -0
- package/dist/chunk-XBWUYKZW.mjs.map +1 -0
- package/dist/{chunk-Q365BFES.mjs → chunk-YJINOUZ7.mjs} +1 -1
- package/dist/chunk-YJINOUZ7.mjs.map +1 -0
- package/dist/{chunk-4IKXV4FQ.mjs → chunk-Z5YZVKS5.mjs} +2 -2
- package/dist/{chunk-ZHCGY4YB.mjs → chunk-ZO5NWKNY.mjs} +2 -2
- package/dist/{chunk-ZHCGY4YB.mjs.map → chunk-ZO5NWKNY.mjs.map} +1 -1
- package/dist/color-picker.mjs +1 -1
- package/dist/dashboard-notification.mjs +1 -1
- package/dist/date-range-picker.mjs +4 -4
- package/dist/drag-and-drop.css +1 -1
- package/dist/drag-and-drop.css.map +1 -1
- package/dist/drag-and-drop.mjs +46 -46
- package/dist/draggable-stacked-list-item.mjs +2 -2
- package/dist/drawer.mjs +1 -1
- package/dist/dropdown.mjs +1 -1
- package/dist/feature-cards/feature-card.mjs +2 -2
- package/dist/featurePageComponents/feature-page-group.mjs +1 -1
- package/dist/file-picker/file-listing.d.ts +1 -1
- package/dist/file-picker/file-listing.mjs +2 -2
- package/dist/file-picker/file-picker.css +1 -1
- package/dist/file-picker/file-picker.css.map +1 -1
- package/dist/file-picker/file-picker.d.ts +2 -2
- package/dist/file-picker/file-picker.mjs +46 -46
- package/dist/fixed-alert.mjs +1 -1
- package/dist/footer-heart-icon.mjs +1 -1
- package/dist/form-row.mjs +2 -2
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.mjs +46 -46
- package/dist/input-copy.mjs +2 -2
- package/dist/label.mjs +1 -1
- package/dist/layout/layout.css +1 -1
- package/dist/layout/layout.css.map +1 -1
- package/dist/layout/layout.mjs +46 -46
- package/dist/loading-button.mjs +1 -1
- package/dist/love-footer.mjs +2 -2
- package/dist/mini-feature-block.mjs +2 -2
- package/dist/modal.mjs +1 -1
- package/dist/navbar/navbar.mjs +1 -1
- package/dist/no-results-block.d.ts +1 -1
- package/dist/no-results-block.mjs +1 -1
- package/dist/page-header.mjs +2 -2
- package/dist/pagination/pagination.mjs +1 -1
- package/dist/product-picker/product-drawer.css +1 -1
- package/dist/product-picker/product-drawer.css.map +1 -1
- package/dist/product-picker/product-drawer.mjs +46 -46
- package/dist/product-picker/product-listing.d.ts +1 -1
- package/dist/product-picker/product-listing.mjs +2 -2
- package/dist/progress-bar.mjs +1 -1
- package/dist/radio.mjs +1 -1
- package/dist/rich-text-editor/index.mjs +1 -1
- package/dist/search/search.mjs +1 -1
- package/dist/select.mjs +1 -1
- package/dist/sort/sort.mjs +1 -1
- package/dist/spinner.mjs +1 -1
- package/dist/stacked-list-item.css +1 -1
- package/dist/stacked-list-item.css.map +1 -1
- package/dist/stacked-list-item.mjs +46 -46
- package/dist/table-header/table-header.mjs +3 -3
- package/dist/table-result-block.css +1 -1
- package/dist/table-result-block.css.map +1 -1
- package/dist/table-result-block.mjs +46 -46
- package/dist/text-row.mjs +1 -1
- package/dist/textarea.mjs +1 -1
- package/dist/textinput.mjs +1 -1
- package/dist/toast/index.mjs +1 -1
- package/dist/toggleswitch.mjs +1 -1
- package/dist/tooltip/tooltip.mjs +1 -1
- package/dist/video-dashboard-notification.mjs +1 -1
- package/dist/video-modal.mjs +1 -1
- package/package.json +4 -2
- package/src/accordion.tsx +120 -58
- package/src/alert-banner.tsx +78 -56
- package/src/avatar.tsx +71 -49
- package/src/badge.tsx +38 -30
- package/src/breadcrumb.tsx +28 -21
- package/src/checkbox.tsx +28 -20
- package/src/color-picker.tsx +2 -4
- package/src/dashboard-notification.tsx +1 -2
- package/src/date-range-picker.tsx +208 -139
- package/src/drag-and-drop.tsx +4 -4
- package/src/draggable-stacked-list-item.tsx +2 -2
- package/src/drawer.tsx +2 -2
- package/src/dropdown.tsx +91 -73
- package/src/featurePageComponents/feature-page-group.tsx +0 -1
- package/src/file-picker/file-listing.tsx +86 -38
- package/src/file-picker/file-picker.tsx +296 -212
- package/src/fixed-alert.tsx +2 -5
- package/src/footer-heart-icon.tsx +31 -7
- package/src/form-row.tsx +1 -1
- package/src/index.tsx +1 -1
- package/src/input-copy.tsx +1 -1
- package/src/label.tsx +12 -6
- package/src/layout/layout.tsx +2 -2
- package/src/loading-button.tsx +21 -21
- package/src/mini-feature-block.tsx +2 -6
- package/src/modal.tsx +46 -34
- package/src/navbar/navbar.tsx +1 -1
- package/src/no-results-block.tsx +7 -3
- package/src/page-header.tsx +13 -8
- package/src/pagination/pagination.tsx +1 -1
- package/src/product-picker/product-drawer.tsx +226 -144
- package/src/product-picker/product-listing.tsx +84 -45
- package/src/progress-bar.tsx +39 -25
- package/src/radio.tsx +11 -11
- package/src/rich-text-editor/headless-editor.ts +5 -5
- package/src/search/search.tsx +4 -4
- package/src/select.tsx +2 -3
- package/src/sort/sort.tsx +33 -31
- package/src/spinner.tsx +3 -3
- package/src/stacked-list-item.tsx +1 -1
- package/src/table-header/table-header.tsx +114 -90
- package/src/table-result-block.tsx +12 -10
- package/src/text-row.tsx +1 -1
- package/src/textarea.tsx +27 -24
- package/src/textinput.tsx +31 -28
- package/src/toast/index.tsx +4 -4
- package/src/toggleswitch.tsx +3 -1
- package/src/tooltip/tooltip.tsx +1 -1
- package/src/video-dashboard-notification.tsx +0 -2
- package/src/video-modal.tsx +2 -5
- package/dist/chunk-25FJ277C.mjs.map +0 -1
- package/dist/chunk-2IL2LP47.mjs.map +0 -1
- package/dist/chunk-3LINEESX.mjs.map +0 -1
- package/dist/chunk-47S6AX7M.mjs.map +0 -1
- package/dist/chunk-5CGIKL2Y.mjs.map +0 -1
- package/dist/chunk-5DQUZENZ.mjs.map +0 -1
- package/dist/chunk-5VH26DHQ.mjs.map +0 -1
- package/dist/chunk-ASCPOK5F.mjs.map +0 -1
- package/dist/chunk-AYXC2DCM.mjs.map +0 -1
- package/dist/chunk-CEK5K5TU.mjs.map +0 -1
- package/dist/chunk-CMA7TSQG.mjs.map +0 -1
- package/dist/chunk-CZNQ24DQ.mjs +0 -16
- package/dist/chunk-CZNQ24DQ.mjs.map +0 -1
- package/dist/chunk-D6H235SZ.mjs.map +0 -1
- package/dist/chunk-DZABAR36.mjs.map +0 -1
- package/dist/chunk-EWNPNF2B.mjs.map +0 -1
- package/dist/chunk-F6ZWBNIM.mjs.map +0 -1
- package/dist/chunk-FAFXVD4P.mjs.map +0 -1
- package/dist/chunk-FRIXS4BL.mjs.map +0 -1
- package/dist/chunk-HZTQAUGX.mjs +0 -34
- package/dist/chunk-HZTQAUGX.mjs.map +0 -1
- package/dist/chunk-JACXLYPD.mjs +0 -12
- package/dist/chunk-JACXLYPD.mjs.map +0 -1
- package/dist/chunk-JCWSMIVA.mjs.map +0 -1
- package/dist/chunk-KEIDXVZB.mjs.map +0 -1
- package/dist/chunk-LQQDRIZN.mjs.map +0 -1
- package/dist/chunk-MXH3TZWM.mjs.map +0 -1
- package/dist/chunk-NEJOZRKV.mjs.map +0 -1
- package/dist/chunk-PPMW7YAZ.mjs.map +0 -1
- package/dist/chunk-Q365BFES.mjs.map +0 -1
- package/dist/chunk-REFCK56T.mjs +0 -12
- package/dist/chunk-REFCK56T.mjs.map +0 -1
- package/dist/chunk-VPLCWU7T.mjs +0 -9
- package/dist/chunk-VPLCWU7T.mjs.map +0 -1
- package/dist/chunk-VQ3MZS4J.mjs.map +0 -1
- package/dist/chunk-W3DRXKTC.mjs.map +0 -1
- package/dist/chunk-WFRV27QA.mjs.map +0 -1
- package/dist/chunk-WLJEFSES.mjs +0 -10
- package/dist/chunk-WLJEFSES.mjs.map +0 -1
- package/dist/chunk-WMFTYTMD.mjs.map +0 -1
- package/dist/chunk-XUXHB434.mjs.map +0 -1
- package/dist/chunk-YJKULMWM.mjs.map +0 -1
- package/dist/chunk-ZJATBQ3X.mjs +0 -10
- package/dist/chunk-ZJATBQ3X.mjs.map +0 -1
- package/dist/chunk-ZWJSMASL.mjs.map +0 -1
- /package/dist/{chunk-7YKZ7D7U.mjs.map → chunk-ATNP3Z6G.mjs.map} +0 -0
- /package/dist/{chunk-4IKXV4FQ.mjs.map → chunk-Z5YZVKS5.mjs.map} +0 -0
|
@@ -1,98 +1,137 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
2
|
+
import pluralize from "pluralize";
|
|
3
|
+
import PropTypes from "prop-types";
|
|
4
|
+
import { useEffect, useRef, useState } from "react";
|
|
5
|
+
import { Checkbox } from "../checkbox";
|
|
6
6
|
// FOR USE WITH THE PRODUCT PICKER COMPONENT - ONLY
|
|
7
7
|
|
|
8
8
|
function BuildImageUrl(imageUrl) {
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
return `${window.resourceSettings.imageBasePath}${imageUrl}?v=${window.resourceSettings.version}`;
|
|
10
|
+
}
|
|
11
11
|
|
|
12
|
-
export function Listing({
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
export function Listing({
|
|
13
|
+
border,
|
|
14
|
+
products,
|
|
15
|
+
isMore,
|
|
16
|
+
selected,
|
|
17
|
+
page,
|
|
18
|
+
pages,
|
|
19
|
+
callback,
|
|
20
|
+
}) {
|
|
21
|
+
const scrollRef = useRef();
|
|
22
|
+
const [showLoader, setShowLoader] = useState(false);
|
|
15
23
|
|
|
16
24
|
useEffect(() => {
|
|
17
|
-
const element = document.querySelector(
|
|
18
|
-
if (element && !element.hasAttribute(
|
|
19
|
-
|
|
25
|
+
const element = document.querySelector("#product-list");
|
|
26
|
+
if (element && !element.hasAttribute("scroll"))
|
|
27
|
+
scrollRef.current.addEventListener("scroll", handleScroll);
|
|
28
|
+
if (scrollRef.current != null) scrollRef.current.scrollTop = 0;
|
|
20
29
|
return () => {
|
|
21
|
-
const element = document.querySelector(
|
|
22
|
-
if (element && element.hasAttribute(
|
|
23
|
-
|
|
24
|
-
|
|
30
|
+
const element = document.querySelector("#product-list");
|
|
31
|
+
if (element && element.hasAttribute("scroll"))
|
|
32
|
+
scrollRef.current.removeEventListener("scroll", handleScroll);
|
|
33
|
+
};
|
|
34
|
+
}, []);
|
|
25
35
|
|
|
26
36
|
const handleScroll = () => {
|
|
27
|
-
if (!isMore) return
|
|
28
|
-
const offset =
|
|
29
|
-
|
|
37
|
+
if (!isMore) return;
|
|
38
|
+
const offset =
|
|
39
|
+
scrollRef.current.scrollHeight - scrollRef.current.offsetHeight;
|
|
40
|
+
const scroll = Math.floor(scrollRef.current.scrollTop);
|
|
30
41
|
// the '-2 & +2' is used as a buffer, otherwise '==' positioning of the scroll becomes too accurate.
|
|
31
42
|
if (scroll == offset || scroll + 2 == offset || scroll - 2 == offset) {
|
|
32
|
-
setShowLoader(true)
|
|
33
|
-
callback({ type:
|
|
43
|
+
setShowLoader(true);
|
|
44
|
+
callback({ type: "FETCH_DATA", payload: true });
|
|
34
45
|
}
|
|
35
|
-
}
|
|
46
|
+
};
|
|
36
47
|
|
|
37
48
|
const handleProductSelection = (id) => {
|
|
38
|
-
callback({ type:
|
|
39
|
-
}
|
|
49
|
+
callback({ type: "SELECTION", payload: id });
|
|
50
|
+
};
|
|
40
51
|
|
|
41
52
|
return (
|
|
42
|
-
<div
|
|
53
|
+
<div
|
|
54
|
+
id="product-list"
|
|
55
|
+
ref={scrollRef}
|
|
56
|
+
className={`${border} overflow-y-auto rounded-md border`}
|
|
57
|
+
>
|
|
43
58
|
{(products || []).map((p) => {
|
|
44
|
-
return
|
|
59
|
+
return (
|
|
60
|
+
<ProductRow
|
|
61
|
+
key={`product-row-${p.Name}`}
|
|
62
|
+
product={p}
|
|
63
|
+
selected={selected.includes(p.ProductId)}
|
|
64
|
+
callback={handleProductSelection}
|
|
65
|
+
/>
|
|
66
|
+
);
|
|
45
67
|
})}
|
|
46
68
|
{isMore && page < pages && showLoader && <InfiniteLoader />}
|
|
47
69
|
</div>
|
|
48
|
-
)
|
|
70
|
+
);
|
|
49
71
|
}
|
|
50
72
|
|
|
51
73
|
function ProductRow({ product, selected = false, callback }) {
|
|
52
74
|
const handleProductSelection = (e) => {
|
|
53
|
-
callback(product.ProductId)
|
|
54
|
-
}
|
|
75
|
+
callback(product.ProductId);
|
|
76
|
+
};
|
|
55
77
|
return (
|
|
56
78
|
<div
|
|
57
|
-
className={`flex items-center
|
|
79
|
+
className={`mb-1 mt-1 flex items-center pb-4 pt-4 ${
|
|
80
|
+
selected && "bg-blue-50"
|
|
81
|
+
} cursor-pointer justify-between border-b border-gray-100`}
|
|
58
82
|
onClick={handleProductSelection}
|
|
59
83
|
>
|
|
60
|
-
<div className="flex items-center
|
|
84
|
+
<div className="ml-3 flex items-center">
|
|
61
85
|
<div className="flex-shrink-0">
|
|
62
|
-
<Checkbox
|
|
86
|
+
<Checkbox
|
|
87
|
+
id={`cb-prod-${product.Id}`}
|
|
88
|
+
name={product.Name}
|
|
89
|
+
checked={selected}
|
|
90
|
+
onChange={() => {}}
|
|
91
|
+
/>
|
|
63
92
|
</div>
|
|
64
93
|
<div className="ml-4">
|
|
65
|
-
{product.Image && product.IamgeName !==
|
|
94
|
+
{product.Image && product.IamgeName !== "[URL-DownloadRequested]" ? (
|
|
66
95
|
<img
|
|
67
96
|
className="h-10 w-10 rounded-md"
|
|
68
97
|
src={product.Image}
|
|
69
98
|
alt={product.Name}
|
|
70
99
|
onError={(e) => {
|
|
71
|
-
e.target.onerror = null
|
|
72
|
-
e.target.src = `${BuildImageUrl(
|
|
100
|
+
e.target.onerror = null;
|
|
101
|
+
e.target.src = `${BuildImageUrl(
|
|
102
|
+
"/admin/Content/images/no-image-discount.png"
|
|
103
|
+
)}`;
|
|
73
104
|
}}
|
|
74
105
|
className="h-10 w-10 rounded-sm"
|
|
75
106
|
/>
|
|
76
107
|
) : (
|
|
77
|
-
<img
|
|
108
|
+
<img
|
|
109
|
+
src={BuildImageUrl("/admin/Content/images/no-image-discount.png")}
|
|
110
|
+
alt={product.Name}
|
|
111
|
+
className="h-10 w-10 rounded-sm"
|
|
112
|
+
/>
|
|
78
113
|
)}
|
|
79
114
|
</div>
|
|
80
115
|
<div className="ml-4">
|
|
81
116
|
<div className=" font-medium text-gray-900">{product.Name}</div>
|
|
82
117
|
{product.Categories.length > 0 ? (
|
|
83
|
-
<div className="text-xs text-gray-500">{`${
|
|
118
|
+
<div className="text-xs text-gray-500">{`${
|
|
119
|
+
product.CategoryName
|
|
120
|
+
} & ${pluralize("other", product.Categories.length, true)}`}</div>
|
|
84
121
|
) : (
|
|
85
122
|
<div className="text-xs text-gray-500">{product.CategoryName}</div>
|
|
86
123
|
)}
|
|
87
124
|
</div>
|
|
88
125
|
</div>
|
|
89
126
|
<div className="ml-4 flex-shrink-0">
|
|
90
|
-
<span className="
|
|
91
|
-
globalThis.globalSettings.
|
|
127
|
+
<span className="mr-3 text-sm text-gray-500">{`${
|
|
128
|
+
globalThis.globalSettings.CurrencySymbol
|
|
129
|
+
}${product.Price.toFixed(
|
|
130
|
+
globalThis.globalSettings.CurrencyExponent ?? 2
|
|
92
131
|
)}`}</span>
|
|
93
132
|
</div>
|
|
94
133
|
</div>
|
|
95
|
-
)
|
|
134
|
+
);
|
|
96
135
|
}
|
|
97
136
|
|
|
98
137
|
Listing.propTypes = {
|
|
@@ -110,7 +149,7 @@ Listing.propTypes = {
|
|
|
110
149
|
pages: PropTypes.number,
|
|
111
150
|
/** Callback function to handle events */
|
|
112
151
|
callback: PropTypes.func,
|
|
113
|
-
}
|
|
152
|
+
};
|
|
114
153
|
|
|
115
154
|
ProductRow.propTypes = {
|
|
116
155
|
/** Product object to display */
|
|
@@ -119,15 +158,15 @@ ProductRow.propTypes = {
|
|
|
119
158
|
selected: PropTypes.bool,
|
|
120
159
|
/** Callback function to handle events */
|
|
121
160
|
callback: PropTypes.func,
|
|
122
|
-
}
|
|
161
|
+
};
|
|
123
162
|
|
|
124
163
|
function InfiniteLoader() {
|
|
125
164
|
return (
|
|
126
|
-
<div className="flex justify-center
|
|
165
|
+
<div className="mb-1 mt-1 flex justify-center pb-4 pt-4">
|
|
127
166
|
<div role="status">
|
|
128
167
|
<svg
|
|
129
168
|
aria-hidden="true"
|
|
130
|
-
className="inline-block
|
|
169
|
+
className="inline-block h-8 w-8 animate-spin fill-gray-600 text-gray-200 dark:fill-gray-300 dark:text-gray-600"
|
|
131
170
|
viewBox="0 0 100 101"
|
|
132
171
|
fill="none"
|
|
133
172
|
xmlns="http://www.w3.org/2000/svg"
|
|
@@ -143,5 +182,5 @@ function InfiniteLoader() {
|
|
|
143
182
|
</svg>
|
|
144
183
|
</div>
|
|
145
184
|
</div>
|
|
146
|
-
)
|
|
185
|
+
);
|
|
147
186
|
}
|
package/src/progress-bar.tsx
CHANGED
|
@@ -1,37 +1,51 @@
|
|
|
1
1
|
//@ts-nocheck
|
|
2
|
-
import PropTypes from
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
3
|
|
|
4
4
|
const colors = Object.freeze({
|
|
5
|
-
primary:
|
|
6
|
-
secondary:
|
|
7
|
-
success:
|
|
8
|
-
danger:
|
|
9
|
-
warning:
|
|
10
|
-
info:
|
|
11
|
-
light:
|
|
12
|
-
dark:
|
|
13
|
-
})
|
|
5
|
+
primary: "bg-blue-600 dark:bg-blue-500",
|
|
6
|
+
secondary: "bg-gray-600 dark:bg-gray-500",
|
|
7
|
+
success: "bg-green-600 dark:bg-green-500",
|
|
8
|
+
danger: "bg-red-600 dark:bg-red-500",
|
|
9
|
+
warning: "bg-yellow-600 dark:bg-yellow-500",
|
|
10
|
+
info: "bg-blue-600 dark:bg-blue-500",
|
|
11
|
+
light: "bg-gray-100 dark:bg-gray-900",
|
|
12
|
+
dark: "bg-gray-800 dark:bg-gray-200",
|
|
13
|
+
});
|
|
14
14
|
|
|
15
15
|
const sizes = Object.freeze({
|
|
16
|
-
sm:
|
|
17
|
-
md:
|
|
18
|
-
lg:
|
|
19
|
-
xl:
|
|
20
|
-
})
|
|
16
|
+
sm: "h-1.5 mb-4",
|
|
17
|
+
md: "h-2.5 mb-4",
|
|
18
|
+
lg: "h-4 mb-4",
|
|
19
|
+
xl: "h-6",
|
|
20
|
+
});
|
|
21
21
|
|
|
22
|
-
export function ProgressBar({ progress, size =
|
|
22
|
+
export function ProgressBar({ progress, size = "md", color = "primary" }) {
|
|
23
23
|
return (
|
|
24
|
-
<div
|
|
25
|
-
|
|
24
|
+
<div
|
|
25
|
+
className={`w-full rounded-full bg-gray-200 ${sizes[size]} mb-4 dark:bg-gray-700`}
|
|
26
|
+
>
|
|
27
|
+
<div
|
|
28
|
+
className={`${sizes[size]} rounded-full ${colors[color]}`}
|
|
29
|
+
style={{ width: `${progress}%` }}
|
|
30
|
+
></div>
|
|
26
31
|
</div>
|
|
27
|
-
)
|
|
32
|
+
);
|
|
28
33
|
}
|
|
29
34
|
|
|
30
35
|
ProgressBar.propTypes = {
|
|
31
36
|
/** Current progress to be shown (defaults to 0) */
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
color: PropTypes.oneOf([
|
|
37
|
-
|
|
37
|
+
progress: PropTypes.number.isRequired,
|
|
38
|
+
/** Size of the progress bar (defaults to md) */
|
|
39
|
+
size: PropTypes.oneOf(["sm", "md", "lg", "xl"]),
|
|
40
|
+
/** Color of the progress bar (defaults to primary) */
|
|
41
|
+
color: PropTypes.oneOf([
|
|
42
|
+
"primary",
|
|
43
|
+
"secondary",
|
|
44
|
+
"success",
|
|
45
|
+
"danger",
|
|
46
|
+
"warning",
|
|
47
|
+
"info",
|
|
48
|
+
"light",
|
|
49
|
+
"dark",
|
|
50
|
+
]),
|
|
51
|
+
};
|
package/src/radio.tsx
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
//@ts-nocheck
|
|
2
|
-
import { forwardRef } from "react";
|
|
3
2
|
import PropTypes from "prop-types";
|
|
3
|
+
import { forwardRef } from "react";
|
|
4
4
|
|
|
5
5
|
export const Radio = forwardRef(function Radio(props, ref) {
|
|
6
6
|
return (
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
7
|
+
<input
|
|
8
|
+
id={props.id}
|
|
9
|
+
ref={ref}
|
|
10
|
+
type="radio"
|
|
11
|
+
className={`h-4 w-4 rounded-full border-gray-300 bg-gray-100 text-blue-600 focus:ring-2 focus:ring-blue-500 dark:border-gray-600 dark:bg-gray-700 dark:ring-offset-gray-800 dark:focus:ring-blue-600 ${
|
|
12
|
+
props.disabled && "opacity-50"
|
|
13
|
+
}`}
|
|
14
|
+
{...props}
|
|
15
|
+
/>
|
|
16
16
|
);
|
|
17
17
|
});
|
|
18
18
|
|
|
19
19
|
Radio.propTypes = {
|
|
20
|
-
/** Id for Radio */
|
|
20
|
+
/** Id for Radio */
|
|
21
21
|
id: PropTypes.string.isRequired,
|
|
22
22
|
/** Bool to determine if radio has been checked */
|
|
23
23
|
checked: PropTypes.bool,
|
|
@@ -4,9 +4,12 @@ import DecoupledEditorBase from "@ckeditor/ckeditor5-editor-decoupled/src/decoup
|
|
|
4
4
|
|
|
5
5
|
import Alignment from "@ckeditor/ckeditor5-alignment/src/alignment";
|
|
6
6
|
import Autoformat from "@ckeditor/ckeditor5-autoformat/src/autoformat";
|
|
7
|
-
import BlockQuote from "@ckeditor/ckeditor5-block-quote/src/blockquote";
|
|
8
7
|
import Bold from "@ckeditor/ckeditor5-basic-styles/src/bold";
|
|
9
8
|
import Code from "@ckeditor/ckeditor5-basic-styles/src/code";
|
|
9
|
+
import Italic from "@ckeditor/ckeditor5-basic-styles/src/italic";
|
|
10
|
+
import Strikethrough from "@ckeditor/ckeditor5-basic-styles/src/strikethrough";
|
|
11
|
+
import Underline from "@ckeditor/ckeditor5-basic-styles/src/underline";
|
|
12
|
+
import BlockQuote from "@ckeditor/ckeditor5-block-quote/src/blockquote";
|
|
10
13
|
import CodeBlock from "@ckeditor/ckeditor5-code-block/src/codeblock";
|
|
11
14
|
import Essentials from "@ckeditor/ckeditor5-essentials/src/essentials";
|
|
12
15
|
import Heading from "@ckeditor/ckeditor5-heading/src/heading";
|
|
@@ -15,21 +18,18 @@ import ImageCaption from "@ckeditor/ckeditor5-image/src/imagecaption";
|
|
|
15
18
|
import ImageResize from "@ckeditor/ckeditor5-image/src/imageresize";
|
|
16
19
|
import ImageStyle from "@ckeditor/ckeditor5-image/src/imagestyle";
|
|
17
20
|
import ImageToolbar from "@ckeditor/ckeditor5-image/src/imagetoolbar";
|
|
21
|
+
import PictureEditing from "@ckeditor/ckeditor5-image/src/pictureediting";
|
|
18
22
|
import Indent from "@ckeditor/ckeditor5-indent/src/indent";
|
|
19
23
|
import IndentBlock from "@ckeditor/ckeditor5-indent/src/indentblock";
|
|
20
|
-
import Italic from "@ckeditor/ckeditor5-basic-styles/src/italic";
|
|
21
24
|
import Link from "@ckeditor/ckeditor5-link/src/link";
|
|
22
25
|
import List from "@ckeditor/ckeditor5-list/src/list";
|
|
23
26
|
import ListProperties from "@ckeditor/ckeditor5-list/src/listproperties";
|
|
24
27
|
import Paragraph from "@ckeditor/ckeditor5-paragraph/src/paragraph";
|
|
25
28
|
import PasteFromOffice from "@ckeditor/ckeditor5-paste-from-office/src/pastefromoffice";
|
|
26
|
-
import PictureEditing from "@ckeditor/ckeditor5-image/src/pictureediting";
|
|
27
29
|
import RemoveFormat from "@ckeditor/ckeditor5-remove-format/src/removeformat";
|
|
28
|
-
import Strikethrough from "@ckeditor/ckeditor5-basic-styles/src/strikethrough";
|
|
29
30
|
import Table from "@ckeditor/ckeditor5-table/src/table";
|
|
30
31
|
import TableToolbar from "@ckeditor/ckeditor5-table/src/tabletoolbar";
|
|
31
32
|
import TextTransformation from "@ckeditor/ckeditor5-typing/src/texttransformation";
|
|
32
|
-
import Underline from "@ckeditor/ckeditor5-basic-styles/src/underline";
|
|
33
33
|
|
|
34
34
|
class HeadlessEditor extends DecoupledEditorBase {}
|
|
35
35
|
|
package/src/search/search.tsx
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
//@ts-nocheck
|
|
2
|
+
import PropTypes from "prop-types";
|
|
2
3
|
import {
|
|
3
|
-
|
|
4
|
-
useRef,
|
|
4
|
+
forwardRef,
|
|
5
5
|
useCallback,
|
|
6
6
|
useEffect,
|
|
7
|
-
forwardRef,
|
|
8
7
|
useImperativeHandle,
|
|
8
|
+
useRef,
|
|
9
|
+
useState,
|
|
9
10
|
} from "react";
|
|
10
|
-
import PropTypes from "prop-types";
|
|
11
11
|
|
|
12
12
|
function useDebounceEffect(effect, delay, deps) {
|
|
13
13
|
const instanceRef = useRef(0);
|
package/src/select.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//@ts-nocheck
|
|
2
|
-
import { forwardRef } from "react";
|
|
3
2
|
import PropTypes from "prop-types";
|
|
3
|
+
import { forwardRef } from "react";
|
|
4
4
|
|
|
5
5
|
export const Select = forwardRef(function Select(props, ref) {
|
|
6
6
|
return (
|
|
@@ -43,8 +43,7 @@ Select.propTypes = {
|
|
|
43
43
|
/** Optional label for the dropdown */
|
|
44
44
|
label: PropTypes.string,
|
|
45
45
|
/** Optional inital selected value must match the value of an element of an object in the options array. (defaults to first value in the list)*/
|
|
46
|
-
defaultValue: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
|
|
47
|
-
.isRequired,
|
|
46
|
+
defaultValue: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
48
47
|
/** Array of objects with value and display properties */
|
|
49
48
|
options: PropTypes.arrayOf(
|
|
50
49
|
PropTypes.shape({
|
package/src/sort/sort.tsx
CHANGED
|
@@ -1,65 +1,67 @@
|
|
|
1
1
|
//@ts-nocheck
|
|
2
2
|
import { useState, useRef, useEffect } from 'react'
|
|
3
3
|
import PropTypes from 'prop-types'
|
|
4
|
+
import { BiChevronDown } from 'react-icons/bi'
|
|
4
5
|
|
|
5
|
-
export function Sort({ list, align =
|
|
6
|
-
const [hidden, setHidden] = useState(true)
|
|
7
|
-
const counter = useRef(0)
|
|
6
|
+
export function Sort({ list, align = "left", callback }) {
|
|
7
|
+
const [hidden, setHidden] = useState(true);
|
|
8
|
+
const counter = useRef(0);
|
|
8
9
|
|
|
9
|
-
const ref = useRef(null)
|
|
10
|
+
const ref = useRef(null);
|
|
10
11
|
useEffect(() => {
|
|
11
12
|
const handleClickOutside = (e) => {
|
|
12
13
|
if (ref.current && !ref.current.contains(e.target)) {
|
|
13
|
-
setHidden(true)
|
|
14
|
+
setHidden(true);
|
|
14
15
|
}
|
|
15
|
-
}
|
|
16
|
+
};
|
|
16
17
|
|
|
17
|
-
document.addEventListener(
|
|
18
|
+
document.addEventListener("click", handleClickOutside, true);
|
|
18
19
|
return () => {
|
|
19
|
-
document.removeEventListener(
|
|
20
|
-
}
|
|
21
|
-
}, [])
|
|
20
|
+
document.removeEventListener("click", handleClickOutside, true);
|
|
21
|
+
};
|
|
22
|
+
}, []);
|
|
22
23
|
|
|
23
24
|
const handleSelection = (val) => {
|
|
24
|
-
counter.current += 1
|
|
25
|
+
counter.current += 1;
|
|
25
26
|
// ensures that each selection object is unique.
|
|
26
|
-
setHidden(true)
|
|
27
|
-
callback(Object.assign(val, { count: counter.current }))
|
|
28
|
-
}
|
|
27
|
+
setHidden(true);
|
|
28
|
+
callback(Object.assign(val, { count: counter.current }));
|
|
29
|
+
};
|
|
29
30
|
return (
|
|
30
31
|
<div className="relative">
|
|
31
32
|
<button
|
|
32
|
-
id="
|
|
33
|
+
id="sortButton"
|
|
33
34
|
data-dropdown-toggle="dropdown"
|
|
34
|
-
className="bg-white border
|
|
35
|
+
className="text-slate-700 bg-white border border-gray-300 focus:ring-4 focus:outline-none focus:ring-gray-300 dark:bg-gray-700 dark:border-gray-600 font-medium rounded-lg text-sm px-5 py-2.5 text-center inline-flex items-center w-full md:w-auto"
|
|
35
36
|
type="button"
|
|
36
37
|
onClick={() => setHidden(!hidden)}
|
|
37
38
|
>
|
|
38
|
-
Sort
|
|
39
|
-
<
|
|
40
|
-
<path stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="m1 1 4 4 4-4" />
|
|
41
|
-
</svg>
|
|
39
|
+
<span className='flex-auto'>Sort</span>
|
|
40
|
+
<span className='items-right flex justify-end'><BiChevronDown className="pointer-events-none" /></span>
|
|
42
41
|
</button>
|
|
43
42
|
|
|
44
43
|
<div
|
|
45
|
-
id="
|
|
44
|
+
id="sortDropdown"
|
|
46
45
|
ref={ref}
|
|
47
|
-
className={`z-10 ${hidden ? 'hidden' : ''} absolute ${align === 'left' ? 'left-0' : 'right-0'} bg-white divide-y divide-gray-100 rounded-lg shadow
|
|
46
|
+
className={`z-10 ${hidden ? 'hidden' : ''} absolute w-full md:w-44 ${align === 'left' ? 'left-0' : 'right-0'} bg-white divide-y divide-gray-100 rounded-lg shadow dark:bg-gray-700`}
|
|
48
47
|
>
|
|
49
|
-
<ul
|
|
48
|
+
<ul
|
|
49
|
+
className="py-2 text-sm text-gray-700 dark:text-gray-200"
|
|
50
|
+
aria-labelledby="dropdownDefaultButton"
|
|
51
|
+
>
|
|
50
52
|
{(list || []).map((val) => {
|
|
51
53
|
return (
|
|
52
54
|
<li key={`ddi=${val.value}`} onClick={() => handleSelection(val)}>
|
|
53
|
-
<
|
|
55
|
+
<span className="block px-4 py-2 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white cursor-pointer">
|
|
54
56
|
{val.display}
|
|
55
|
-
</
|
|
57
|
+
</span>
|
|
56
58
|
</li>
|
|
57
|
-
)
|
|
59
|
+
);
|
|
58
60
|
})}
|
|
59
61
|
</ul>
|
|
60
62
|
</div>
|
|
61
63
|
</div>
|
|
62
|
-
)
|
|
64
|
+
);
|
|
63
65
|
}
|
|
64
66
|
|
|
65
67
|
Sort.propTypes = {
|
|
@@ -70,14 +72,14 @@ Sort.propTypes = {
|
|
|
70
72
|
value: PropTypes.string.isRequired,
|
|
71
73
|
name: PropTypes.string.isRequired,
|
|
72
74
|
sort: PropTypes.string.isRequired,
|
|
73
|
-
})
|
|
75
|
+
})
|
|
74
76
|
).isRequired,
|
|
75
77
|
/** Aligns the dropdown protion of the sort to either the left or right of the button.
|
|
76
78
|
* Defaults to align with the left side of the button
|
|
77
79
|
*/
|
|
78
|
-
align: PropTypes.oneOf([
|
|
80
|
+
align: PropTypes.oneOf(["left", "right"]),
|
|
79
81
|
/** Returns{ display, value, name, sort, count} */
|
|
80
82
|
callback: PropTypes.func.isRequired,
|
|
81
|
-
}
|
|
83
|
+
};
|
|
82
84
|
|
|
83
|
-
Sort.displayName = "Sort"
|
|
85
|
+
Sort.displayName = "Sort";
|
package/src/spinner.tsx
CHANGED
|
@@ -3,7 +3,7 @@ export function Spinner() {
|
|
|
3
3
|
<div role="status">
|
|
4
4
|
<svg
|
|
5
5
|
aria-hidden="true"
|
|
6
|
-
className="inline
|
|
6
|
+
className="inline h-14 w-14 animate-spin fill-blue-600 text-gray-200 dark:text-gray-600"
|
|
7
7
|
viewBox="0 0 100 101"
|
|
8
8
|
fill="none"
|
|
9
9
|
xmlns="http://www.w3.org/2000/svg"
|
|
@@ -18,7 +18,7 @@ export function Spinner() {
|
|
|
18
18
|
/>
|
|
19
19
|
</svg>
|
|
20
20
|
</div>
|
|
21
|
-
)
|
|
21
|
+
);
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
Spinner.displayName = "Spinner"
|
|
24
|
+
Spinner.displayName = "Spinner";
|