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.
Files changed (264) hide show
  1. package/.turbo/turbo-build.log +128 -128
  2. package/CHANGELOG.md +12 -0
  3. package/dist/accordion.d.ts +28 -21
  4. package/dist/accordion.mjs +1 -1
  5. package/dist/alert-banner.mjs +1 -1
  6. package/dist/avatar.mjs +1 -1
  7. package/dist/badge.mjs +1 -1
  8. package/dist/breadcrumb.mjs +1 -1
  9. package/dist/card-payment-block.css +1 -1
  10. package/dist/card-payment-block.css.map +1 -1
  11. package/dist/card-payment-block.mjs +46 -46
  12. package/dist/checkbox.mjs +1 -1
  13. package/dist/chunk-2OTVEVU7.mjs +11 -0
  14. package/dist/chunk-2OTVEVU7.mjs.map +1 -0
  15. package/dist/{chunk-47S6AX7M.mjs → chunk-2PW7KHXJ.mjs} +1 -1
  16. package/dist/chunk-2PW7KHXJ.mjs.map +1 -0
  17. package/dist/{chunk-CMA7TSQG.mjs → chunk-35VEFUPA.mjs} +4 -4
  18. package/dist/chunk-35VEFUPA.mjs.map +1 -0
  19. package/dist/{chunk-ZWJSMASL.mjs → chunk-3AGRJPPN.mjs} +3 -3
  20. package/dist/chunk-3AGRJPPN.mjs.map +1 -0
  21. package/dist/{chunk-MRJOYGDD.mjs → chunk-3TAXDPV6.mjs} +2 -2
  22. package/dist/{chunk-MRJOYGDD.mjs.map → chunk-3TAXDPV6.mjs.map} +1 -1
  23. package/dist/{chunk-5DQUZENZ.mjs → chunk-6F3XKP3G.mjs} +2 -2
  24. package/dist/chunk-6F3XKP3G.mjs.map +1 -0
  25. package/dist/{chunk-HEKVJKLH.mjs → chunk-6UK5Y6KZ.mjs} +2 -2
  26. package/dist/{chunk-HEKVJKLH.mjs.map → chunk-6UK5Y6KZ.mjs.map} +1 -1
  27. package/dist/{chunk-EWNPNF2B.mjs → chunk-76V2THLN.mjs} +3 -3
  28. package/dist/chunk-76V2THLN.mjs.map +1 -0
  29. package/dist/chunk-7GLTVVKS.mjs +12 -0
  30. package/dist/chunk-7GLTVVKS.mjs.map +1 -0
  31. package/dist/{chunk-UUWBHZKH.mjs → chunk-7MH2LXFV.mjs} +4 -4
  32. package/dist/{chunk-UUWBHZKH.mjs.map → chunk-7MH2LXFV.mjs.map} +1 -1
  33. package/dist/{chunk-7YKZ7D7U.mjs → chunk-ATNP3Z6G.mjs} +2 -2
  34. package/dist/{chunk-25FJ277C.mjs → chunk-AYH56CFA.mjs} +3 -3
  35. package/dist/chunk-AYH56CFA.mjs.map +1 -0
  36. package/dist/{chunk-NEJOZRKV.mjs → chunk-BK5RX7N5.mjs} +2 -2
  37. package/dist/chunk-BK5RX7N5.mjs.map +1 -0
  38. package/dist/{chunk-F6ZWBNIM.mjs → chunk-CIUW5YZ7.mjs} +2 -2
  39. package/dist/chunk-CIUW5YZ7.mjs.map +1 -0
  40. package/dist/{chunk-WMFTYTMD.mjs → chunk-CZC4EJOD.mjs} +3 -3
  41. package/dist/chunk-CZC4EJOD.mjs.map +1 -0
  42. package/dist/{chunk-CEK5K5TU.mjs → chunk-D3VRYN5H.mjs} +4 -4
  43. package/dist/chunk-D3VRYN5H.mjs.map +1 -0
  44. package/dist/{chunk-W3DRXKTC.mjs → chunk-DBTYTFGU.mjs} +2 -2
  45. package/dist/chunk-DBTYTFGU.mjs.map +1 -0
  46. package/dist/{chunk-JCWSMIVA.mjs → chunk-E6KQBM7F.mjs} +2 -2
  47. package/dist/chunk-E6KQBM7F.mjs.map +1 -0
  48. package/dist/{chunk-5FPVCRAI.mjs → chunk-ECOC3JRK.mjs} +1 -1
  49. package/dist/{chunk-5FPVCRAI.mjs.map → chunk-ECOC3JRK.mjs.map} +1 -1
  50. package/dist/{chunk-3LINEESX.mjs → chunk-EH3ZVEVT.mjs} +1 -1
  51. package/dist/chunk-EH3ZVEVT.mjs.map +1 -0
  52. package/dist/{chunk-YJKULMWM.mjs → chunk-EX5FMSQL.mjs} +2 -2
  53. package/dist/chunk-EX5FMSQL.mjs.map +1 -0
  54. package/dist/{chunk-ASCPOK5F.mjs → chunk-FVUORQJX.mjs} +4 -4
  55. package/dist/chunk-FVUORQJX.mjs.map +1 -0
  56. package/dist/{chunk-WFRV27QA.mjs → chunk-G5A3E5IG.mjs} +3 -3
  57. package/dist/chunk-G5A3E5IG.mjs.map +1 -0
  58. package/dist/{chunk-2IL2LP47.mjs → chunk-HOCKBMTF.mjs} +3 -3
  59. package/dist/chunk-HOCKBMTF.mjs.map +1 -0
  60. package/dist/{chunk-FRIXS4BL.mjs → chunk-JPF3K5TD.mjs} +1 -1
  61. package/dist/chunk-JPF3K5TD.mjs.map +1 -0
  62. package/dist/{chunk-AYXC2DCM.mjs → chunk-K2G6O2LX.mjs} +3 -3
  63. package/dist/chunk-K2G6O2LX.mjs.map +1 -0
  64. package/dist/chunk-LVJYP46A.mjs +9 -0
  65. package/dist/chunk-LVJYP46A.mjs.map +1 -0
  66. package/dist/{chunk-VQ3MZS4J.mjs → chunk-MPIWXVKP.mjs} +2 -2
  67. package/dist/chunk-MPIWXVKP.mjs.map +1 -0
  68. package/dist/{chunk-DZABAR36.mjs → chunk-NJC2WLYK.mjs} +2 -2
  69. package/dist/chunk-NJC2WLYK.mjs.map +1 -0
  70. package/dist/{chunk-5CGIKL2Y.mjs → chunk-OG6UBKMG.mjs} +2 -2
  71. package/dist/chunk-OG6UBKMG.mjs.map +1 -0
  72. package/dist/chunk-PEODF7PL.mjs +34 -0
  73. package/dist/chunk-PEODF7PL.mjs.map +1 -0
  74. package/dist/{chunk-FAFXVD4P.mjs → chunk-PJZVMYPN.mjs} +4 -4
  75. package/dist/chunk-PJZVMYPN.mjs.map +1 -0
  76. package/dist/{chunk-KEIDXVZB.mjs → chunk-PT4IH2KW.mjs} +2 -2
  77. package/dist/chunk-PT4IH2KW.mjs.map +1 -0
  78. package/dist/{chunk-MXH3TZWM.mjs → chunk-QFECX4D6.mjs} +1 -1
  79. package/dist/chunk-QFECX4D6.mjs.map +1 -0
  80. package/dist/{chunk-5VH26DHQ.mjs → chunk-QMFUWXJJ.mjs} +1 -1
  81. package/dist/chunk-QMFUWXJJ.mjs.map +1 -0
  82. package/dist/chunk-R4A5DO7E.mjs +12 -0
  83. package/dist/chunk-R4A5DO7E.mjs.map +1 -0
  84. package/dist/{chunk-LQQDRIZN.mjs → chunk-RGCO6BCU.mjs} +3 -3
  85. package/dist/chunk-RGCO6BCU.mjs.map +1 -0
  86. package/dist/{chunk-PPMW7YAZ.mjs → chunk-SFSA2WUE.mjs} +28 -28
  87. package/dist/chunk-SFSA2WUE.mjs.map +1 -0
  88. package/dist/{chunk-XUXHB434.mjs → chunk-SM4TG5VI.mjs} +1 -1
  89. package/dist/chunk-SM4TG5VI.mjs.map +1 -0
  90. package/dist/{chunk-D6H235SZ.mjs → chunk-UPAA75QA.mjs} +1 -1
  91. package/dist/chunk-UPAA75QA.mjs.map +1 -0
  92. package/dist/{chunk-256SAVHD.mjs → chunk-W3XYS7M3.mjs} +1 -1
  93. package/dist/{chunk-256SAVHD.mjs.map → chunk-W3XYS7M3.mjs.map} +1 -1
  94. package/dist/chunk-X2JENUDV.mjs +16 -0
  95. package/dist/chunk-X2JENUDV.mjs.map +1 -0
  96. package/dist/chunk-XBWUYKZW.mjs +10 -0
  97. package/dist/chunk-XBWUYKZW.mjs.map +1 -0
  98. package/dist/{chunk-Q365BFES.mjs → chunk-YJINOUZ7.mjs} +1 -1
  99. package/dist/chunk-YJINOUZ7.mjs.map +1 -0
  100. package/dist/{chunk-4IKXV4FQ.mjs → chunk-Z5YZVKS5.mjs} +2 -2
  101. package/dist/{chunk-ZHCGY4YB.mjs → chunk-ZO5NWKNY.mjs} +2 -2
  102. package/dist/{chunk-ZHCGY4YB.mjs.map → chunk-ZO5NWKNY.mjs.map} +1 -1
  103. package/dist/color-picker.mjs +1 -1
  104. package/dist/dashboard-notification.mjs +1 -1
  105. package/dist/date-range-picker.mjs +4 -4
  106. package/dist/drag-and-drop.css +1 -1
  107. package/dist/drag-and-drop.css.map +1 -1
  108. package/dist/drag-and-drop.mjs +46 -46
  109. package/dist/draggable-stacked-list-item.mjs +2 -2
  110. package/dist/drawer.mjs +1 -1
  111. package/dist/dropdown.mjs +1 -1
  112. package/dist/feature-cards/feature-card.mjs +2 -2
  113. package/dist/featurePageComponents/feature-page-group.mjs +1 -1
  114. package/dist/file-picker/file-listing.d.ts +1 -1
  115. package/dist/file-picker/file-listing.mjs +2 -2
  116. package/dist/file-picker/file-picker.css +1 -1
  117. package/dist/file-picker/file-picker.css.map +1 -1
  118. package/dist/file-picker/file-picker.d.ts +2 -2
  119. package/dist/file-picker/file-picker.mjs +46 -46
  120. package/dist/fixed-alert.mjs +1 -1
  121. package/dist/footer-heart-icon.mjs +1 -1
  122. package/dist/form-row.mjs +2 -2
  123. package/dist/index.css +1 -1
  124. package/dist/index.css.map +1 -1
  125. package/dist/index.mjs +46 -46
  126. package/dist/input-copy.mjs +2 -2
  127. package/dist/label.mjs +1 -1
  128. package/dist/layout/layout.css +1 -1
  129. package/dist/layout/layout.css.map +1 -1
  130. package/dist/layout/layout.mjs +46 -46
  131. package/dist/loading-button.mjs +1 -1
  132. package/dist/love-footer.mjs +2 -2
  133. package/dist/mini-feature-block.mjs +2 -2
  134. package/dist/modal.mjs +1 -1
  135. package/dist/navbar/navbar.mjs +1 -1
  136. package/dist/no-results-block.d.ts +1 -1
  137. package/dist/no-results-block.mjs +1 -1
  138. package/dist/page-header.mjs +2 -2
  139. package/dist/pagination/pagination.mjs +1 -1
  140. package/dist/product-picker/product-drawer.css +1 -1
  141. package/dist/product-picker/product-drawer.css.map +1 -1
  142. package/dist/product-picker/product-drawer.mjs +46 -46
  143. package/dist/product-picker/product-listing.d.ts +1 -1
  144. package/dist/product-picker/product-listing.mjs +2 -2
  145. package/dist/progress-bar.mjs +1 -1
  146. package/dist/radio.mjs +1 -1
  147. package/dist/rich-text-editor/index.mjs +1 -1
  148. package/dist/search/search.mjs +1 -1
  149. package/dist/select.mjs +1 -1
  150. package/dist/sort/sort.mjs +1 -1
  151. package/dist/spinner.mjs +1 -1
  152. package/dist/stacked-list-item.css +1 -1
  153. package/dist/stacked-list-item.css.map +1 -1
  154. package/dist/stacked-list-item.mjs +46 -46
  155. package/dist/table-header/table-header.mjs +3 -3
  156. package/dist/table-result-block.css +1 -1
  157. package/dist/table-result-block.css.map +1 -1
  158. package/dist/table-result-block.mjs +46 -46
  159. package/dist/text-row.mjs +1 -1
  160. package/dist/textarea.mjs +1 -1
  161. package/dist/textinput.mjs +1 -1
  162. package/dist/toast/index.mjs +1 -1
  163. package/dist/toggleswitch.mjs +1 -1
  164. package/dist/tooltip/tooltip.mjs +1 -1
  165. package/dist/video-dashboard-notification.mjs +1 -1
  166. package/dist/video-modal.mjs +1 -1
  167. package/package.json +4 -2
  168. package/src/accordion.tsx +120 -58
  169. package/src/alert-banner.tsx +78 -56
  170. package/src/avatar.tsx +71 -49
  171. package/src/badge.tsx +38 -30
  172. package/src/breadcrumb.tsx +28 -21
  173. package/src/checkbox.tsx +28 -20
  174. package/src/color-picker.tsx +2 -4
  175. package/src/dashboard-notification.tsx +1 -2
  176. package/src/date-range-picker.tsx +208 -139
  177. package/src/drag-and-drop.tsx +4 -4
  178. package/src/draggable-stacked-list-item.tsx +2 -2
  179. package/src/drawer.tsx +2 -2
  180. package/src/dropdown.tsx +91 -73
  181. package/src/featurePageComponents/feature-page-group.tsx +0 -1
  182. package/src/file-picker/file-listing.tsx +86 -38
  183. package/src/file-picker/file-picker.tsx +296 -212
  184. package/src/fixed-alert.tsx +2 -5
  185. package/src/footer-heart-icon.tsx +31 -7
  186. package/src/form-row.tsx +1 -1
  187. package/src/index.tsx +1 -1
  188. package/src/input-copy.tsx +1 -1
  189. package/src/label.tsx +12 -6
  190. package/src/layout/layout.tsx +2 -2
  191. package/src/loading-button.tsx +21 -21
  192. package/src/mini-feature-block.tsx +2 -6
  193. package/src/modal.tsx +46 -34
  194. package/src/navbar/navbar.tsx +1 -1
  195. package/src/no-results-block.tsx +7 -3
  196. package/src/page-header.tsx +13 -8
  197. package/src/pagination/pagination.tsx +1 -1
  198. package/src/product-picker/product-drawer.tsx +226 -144
  199. package/src/product-picker/product-listing.tsx +84 -45
  200. package/src/progress-bar.tsx +39 -25
  201. package/src/radio.tsx +11 -11
  202. package/src/rich-text-editor/headless-editor.ts +5 -5
  203. package/src/search/search.tsx +4 -4
  204. package/src/select.tsx +2 -3
  205. package/src/sort/sort.tsx +33 -31
  206. package/src/spinner.tsx +3 -3
  207. package/src/stacked-list-item.tsx +1 -1
  208. package/src/table-header/table-header.tsx +114 -90
  209. package/src/table-result-block.tsx +12 -10
  210. package/src/text-row.tsx +1 -1
  211. package/src/textarea.tsx +27 -24
  212. package/src/textinput.tsx +31 -28
  213. package/src/toast/index.tsx +4 -4
  214. package/src/toggleswitch.tsx +3 -1
  215. package/src/tooltip/tooltip.tsx +1 -1
  216. package/src/video-dashboard-notification.tsx +0 -2
  217. package/src/video-modal.tsx +2 -5
  218. package/dist/chunk-25FJ277C.mjs.map +0 -1
  219. package/dist/chunk-2IL2LP47.mjs.map +0 -1
  220. package/dist/chunk-3LINEESX.mjs.map +0 -1
  221. package/dist/chunk-47S6AX7M.mjs.map +0 -1
  222. package/dist/chunk-5CGIKL2Y.mjs.map +0 -1
  223. package/dist/chunk-5DQUZENZ.mjs.map +0 -1
  224. package/dist/chunk-5VH26DHQ.mjs.map +0 -1
  225. package/dist/chunk-ASCPOK5F.mjs.map +0 -1
  226. package/dist/chunk-AYXC2DCM.mjs.map +0 -1
  227. package/dist/chunk-CEK5K5TU.mjs.map +0 -1
  228. package/dist/chunk-CMA7TSQG.mjs.map +0 -1
  229. package/dist/chunk-CZNQ24DQ.mjs +0 -16
  230. package/dist/chunk-CZNQ24DQ.mjs.map +0 -1
  231. package/dist/chunk-D6H235SZ.mjs.map +0 -1
  232. package/dist/chunk-DZABAR36.mjs.map +0 -1
  233. package/dist/chunk-EWNPNF2B.mjs.map +0 -1
  234. package/dist/chunk-F6ZWBNIM.mjs.map +0 -1
  235. package/dist/chunk-FAFXVD4P.mjs.map +0 -1
  236. package/dist/chunk-FRIXS4BL.mjs.map +0 -1
  237. package/dist/chunk-HZTQAUGX.mjs +0 -34
  238. package/dist/chunk-HZTQAUGX.mjs.map +0 -1
  239. package/dist/chunk-JACXLYPD.mjs +0 -12
  240. package/dist/chunk-JACXLYPD.mjs.map +0 -1
  241. package/dist/chunk-JCWSMIVA.mjs.map +0 -1
  242. package/dist/chunk-KEIDXVZB.mjs.map +0 -1
  243. package/dist/chunk-LQQDRIZN.mjs.map +0 -1
  244. package/dist/chunk-MXH3TZWM.mjs.map +0 -1
  245. package/dist/chunk-NEJOZRKV.mjs.map +0 -1
  246. package/dist/chunk-PPMW7YAZ.mjs.map +0 -1
  247. package/dist/chunk-Q365BFES.mjs.map +0 -1
  248. package/dist/chunk-REFCK56T.mjs +0 -12
  249. package/dist/chunk-REFCK56T.mjs.map +0 -1
  250. package/dist/chunk-VPLCWU7T.mjs +0 -9
  251. package/dist/chunk-VPLCWU7T.mjs.map +0 -1
  252. package/dist/chunk-VQ3MZS4J.mjs.map +0 -1
  253. package/dist/chunk-W3DRXKTC.mjs.map +0 -1
  254. package/dist/chunk-WFRV27QA.mjs.map +0 -1
  255. package/dist/chunk-WLJEFSES.mjs +0 -10
  256. package/dist/chunk-WLJEFSES.mjs.map +0 -1
  257. package/dist/chunk-WMFTYTMD.mjs.map +0 -1
  258. package/dist/chunk-XUXHB434.mjs.map +0 -1
  259. package/dist/chunk-YJKULMWM.mjs.map +0 -1
  260. package/dist/chunk-ZJATBQ3X.mjs +0 -10
  261. package/dist/chunk-ZJATBQ3X.mjs.map +0 -1
  262. package/dist/chunk-ZWJSMASL.mjs.map +0 -1
  263. /package/dist/{chunk-7YKZ7D7U.mjs.map → chunk-ATNP3Z6G.mjs.map} +0 -0
  264. /package/dist/{chunk-4IKXV4FQ.mjs.map → chunk-Z5YZVKS5.mjs.map} +0 -0
@@ -1,98 +1,137 @@
1
1
  // @ts-nocheck
2
- import { useState, useEffect, useRef } from 'react'
3
- import { Checkbox } from '../checkbox'
4
- import PropTypes from 'prop-types'
5
- import pluralize from 'pluralize'
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
- return `${window.resourceSettings.imageBasePath}${imageUrl}?v=${window.resourceSettings.version}`;
10
- }
9
+ return `${window.resourceSettings.imageBasePath}${imageUrl}?v=${window.resourceSettings.version}`;
10
+ }
11
11
 
12
- export function Listing({ border, products, isMore, selected, page, pages, callback }) {
13
- const scrollRef = useRef()
14
- const [showLoader, setShowLoader] = useState(false)
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('#product-list')
18
- if (element && !element.hasAttribute('scroll')) scrollRef.current.addEventListener('scroll', handleScroll)
19
- if (scrollRef.current != null) scrollRef.current.scrollTop = 0
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('#product-list')
22
- if (element && element.hasAttribute('scroll')) scrollRef.current.removeEventListener('scroll', handleScroll)
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 = scrollRef.current.scrollHeight - scrollRef.current.offsetHeight
29
- const scroll = Math.floor(scrollRef.current.scrollTop)
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: 'FETCH_DATA', payload: true })
43
+ setShowLoader(true);
44
+ callback({ type: "FETCH_DATA", payload: true });
34
45
  }
35
- }
46
+ };
36
47
 
37
48
  const handleProductSelection = (id) => {
38
- callback({ type: 'SELECTION', payload: id })
39
- }
49
+ callback({ type: "SELECTION", payload: id });
50
+ };
40
51
 
41
52
  return (
42
- <div id="product-list" ref={scrollRef} className={`${border} border rounded-md overflow-y-auto`}>
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 <ProductRow key={`product-row-${p.Name}`} product={p} selected={selected.includes(p.ProductId)} callback={handleProductSelection} />
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 pt-4 pb-4 mt-1 mb-1 ${selected && 'bg-blue-50'} justify-between border-b border-gray-100 cursor-pointer`}
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 ml-3">
84
+ <div className="ml-3 flex items-center">
61
85
  <div className="flex-shrink-0">
62
- <Checkbox id={`cb-prod-${product.Id}`} name={product.Name} checked={selected} onChange={() => {}} />
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 !== '[URL-DownloadRequested]' ? (
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('/admin/Content/images/no-image-discount.png')}`
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 src={BuildImageUrl('/admin/Content/images/no-image-discount.png')} alt={product.Name} className="h-10 w-10 rounded-sm" />
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">{`${product.CategoryName} & ${pluralize('other', product.Categories.length, true)}`}</div>
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="text-sm mr-3 text-gray-500">{`${globalThis.globalSettings.CurrencySymbol}${product.Price.toFixed(
91
- globalThis.globalSettings.CurrencyExponent ?? 2,
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 pt-4 pb-4 mt-1 mb-1">
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 w-8 h-8 text-gray-200 animate-spin dark:text-gray-600 fill-gray-600 dark:fill-gray-300"
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
  }
@@ -1,37 +1,51 @@
1
1
  //@ts-nocheck
2
- import PropTypes from 'prop-types'
2
+ import PropTypes from "prop-types";
3
3
 
4
4
  const colors = Object.freeze({
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
- })
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: 'h-1.5 mb-4',
17
- md: 'h-2.5 mb-4',
18
- lg: 'h-4 mb-4',
19
- xl: 'h-6',
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 = 'md', color='primary'}) {
22
+ export function ProgressBar({ progress, size = "md", color = "primary" }) {
23
23
  return (
24
- <div className={`w-full bg-gray-200 rounded-full ${sizes[size]} mb-4 dark:bg-gray-700`}>
25
- <div className={`${sizes[size]} rounded-full ${colors[color]}`} style={{ width: `${progress}%` }}></div>
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
- progress: PropTypes.number.isRequired,
33
- /** Size of the progress bar (defaults to md) */
34
- size: PropTypes.oneOf(['sm', 'md', 'lg', 'xl']),
35
- /** Color of the progress bar (defaults to primary) */
36
- color: PropTypes.oneOf(['primary', 'secondary', 'success', 'danger', 'warning', 'info', 'light', 'dark']),
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
- <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
- />
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
 
@@ -1,13 +1,13 @@
1
1
  //@ts-nocheck
2
+ import PropTypes from "prop-types";
2
3
  import {
3
- useState,
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 = 'left', callback }) {
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('click', handleClickOutside, true)
18
+ document.addEventListener("click", handleClickOutside, true);
18
19
  return () => {
19
- document.removeEventListener('click', handleClickOutside, true)
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="dropdownDefaultButton"
33
+ id="sortButton"
33
34
  data-dropdown-toggle="dropdown"
34
- className="bg-white border-2 border-slate-300 focus:ring-4 focus:outline-none focus:ring-slate-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center inline-flex items-center"
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
- <svg xmlns="http://www.w3.org/2000/svg" fill="none" aria-hidden="true" className="w-2.5 h-2.5 ml-2.5" viewBox="0 0 10 6">
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="dropdown"
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 w-44 dark:bg-gray-700`}
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 className="py-2 text-sm text-gray-700 dark:text-gray-200" aria-labelledby="dropdownDefaultButton">
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
- <a href="javascript:undefined;" className="block px-4 py-2 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white">
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
- </a>
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(['left','right']),
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 w-14 h-14 text-gray-200 animate-spin dark:text-gray-600 fill-blue-600"
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";
@@ -1,6 +1,6 @@
1
1
  //@ts-nocheck
2
- import { Avatar } from "./";
3
2
  import { Badge } from "flowbite-react";
3
+ import { Avatar } from "./";
4
4
 
5
5
  type Props = {
6
6
  id: number;