ekm-ui 0.4.71 → 0.4.72
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 +434 -434
- package/CHANGELOG.md +6 -0
- package/dist/button.d.ts +1 -1
- package/dist/button.js +1 -1
- package/dist/card-payment-block.css +1 -1
- package/dist/card-payment-block.css.map +1 -1
- package/dist/card-payment-block.js +10 -10
- package/dist/{chunk-SE2IYY2P.js → chunk-BF6NM3B7.js} +2 -2
- package/dist/{chunk-AHD6UTU2.js → chunk-CYOCZEOE.js} +2 -2
- package/dist/chunk-CYOCZEOE.js.map +1 -0
- package/dist/chunk-FOWKHGHJ.js +9 -0
- package/dist/chunk-FOWKHGHJ.js.map +1 -0
- package/dist/{chunk-TY6TW6AX.js → chunk-MMFRYMGJ.js} +2 -2
- package/dist/{chunk-XNPFK34J.js → chunk-MQETRVUJ.js} +2 -2
- package/dist/{chunk-T3HFBJ37.js → chunk-TU4FTVZK.js} +2 -2
- package/dist/{chunk-5Z7OC2TH.js → chunk-TXJVQRS6.js} +2 -2
- package/dist/{chunk-NGCAIS7M.js → chunk-VE6J42I7.js} +2 -2
- package/dist/chunk-ZNWAFIZY.js +11 -0
- package/dist/chunk-ZNWAFIZY.js.map +1 -0
- package/dist/{chunk-7V5FAXED.js → chunk-ZRMNYAO7.js} +3 -3
- package/dist/country-picker/country-modal.css +1 -1
- package/dist/country-picker/country-modal.css.map +1 -1
- package/dist/country-picker/country-modal.js +10 -10
- package/dist/cross-sell/cross-sell-carousel.js +2 -2
- package/dist/cross-sell/service-card.js +2 -2
- package/dist/date-range-picker.js +2 -2
- package/dist/date-time-component.js +2 -2
- package/dist/date-time-picker.js +2 -2
- package/dist/drag-and-drop.css +1 -1
- package/dist/drag-and-drop.css.map +1 -1
- package/dist/drag-and-drop.js +10 -10
- 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.js +10 -10
- package/dist/fixed-alert.js +2 -2
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.js +10 -10
- package/dist/layout/layout.css +1 -1
- package/dist/layout/layout.css.map +1 -1
- package/dist/layout/layout.js +10 -10
- package/dist/pagination/pagination.d.ts +2 -1
- package/dist/pagination/pagination.js +1 -1
- package/dist/product-picker/product-modal.css +1 -1
- package/dist/product-picker/product-modal.css.map +1 -1
- package/dist/product-picker/product-modal.js +10 -10
- package/dist/search/search.js +1 -1
- package/dist/stacked-list-item.css +1 -1
- package/dist/stacked-list-item.css.map +1 -1
- package/dist/stacked-list-item.js +10 -10
- package/dist/table-result-block.css +1 -1
- package/dist/table-result-block.css.map +1 -1
- package/dist/table-result-block.js +10 -10
- package/package.json +1 -1
- package/src/button.tsx +3 -2
- package/src/pagination/pagination.tsx +7 -4
- package/src/search/search.tsx +13 -2
- package/dist/chunk-AHD6UTU2.js.map +0 -1
- package/dist/chunk-LQKVFBLU.js +0 -10
- package/dist/chunk-LQKVFBLU.js.map +0 -1
- package/dist/chunk-WL2NTX3A.js +0 -9
- package/dist/chunk-WL2NTX3A.js.map +0 -1
- /package/dist/{chunk-SE2IYY2P.js.map → chunk-BF6NM3B7.js.map} +0 -0
- /package/dist/{chunk-TY6TW6AX.js.map → chunk-MMFRYMGJ.js.map} +0 -0
- /package/dist/{chunk-XNPFK34J.js.map → chunk-MQETRVUJ.js.map} +0 -0
- /package/dist/{chunk-T3HFBJ37.js.map → chunk-TU4FTVZK.js.map} +0 -0
- /package/dist/{chunk-5Z7OC2TH.js.map → chunk-TXJVQRS6.js.map} +0 -0
- /package/dist/{chunk-NGCAIS7M.js.map → chunk-VE6J42I7.js.map} +0 -0
- /package/dist/{chunk-7V5FAXED.js.map → chunk-ZRMNYAO7.js.map} +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export { h as CardPaymentBlock } from './chunk-
|
|
1
|
+
export { h as CardPaymentBlock } from './chunk-ZRMNYAO7.js';
|
|
2
2
|
import './chunk-NF5KDPMG.js';
|
|
3
3
|
import './chunk-YZ2YZSNQ.js';
|
|
4
4
|
import './chunk-GVNUAH45.js';
|
|
5
5
|
import './chunk-JAR3LP2K.js';
|
|
6
|
-
import './chunk-
|
|
6
|
+
import './chunk-FOWKHGHJ.js';
|
|
7
7
|
import './chunk-22RUXGYW.js';
|
|
8
|
-
import './chunk-
|
|
8
|
+
import './chunk-ZNWAFIZY.js';
|
|
9
9
|
import './chunk-HVNLAQA6.js';
|
|
10
10
|
import './chunk-HW7AZG2V.js';
|
|
11
11
|
import './chunk-AN66H4D6.js';
|
|
@@ -24,9 +24,9 @@ import './chunk-LWTESXND.js';
|
|
|
24
24
|
import './chunk-LIXVY47P.js';
|
|
25
25
|
import './chunk-Y5DEGGVQ.js';
|
|
26
26
|
import './chunk-F7MTEILK.js';
|
|
27
|
-
import './chunk-
|
|
27
|
+
import './chunk-VE6J42I7.js';
|
|
28
28
|
import './chunk-DCVOMIPI.js';
|
|
29
|
-
import './chunk-
|
|
29
|
+
import './chunk-BF6NM3B7.js';
|
|
30
30
|
import './chunk-SBGTFQOD.js';
|
|
31
31
|
import './chunk-IJMS44H4.js';
|
|
32
32
|
import './chunk-AO5TGD7T.js';
|
|
@@ -47,23 +47,23 @@ import './chunk-W55BPRI4.js';
|
|
|
47
47
|
import './chunk-AY4JB2QV.js';
|
|
48
48
|
import './chunk-UQ566F6W.js';
|
|
49
49
|
import './chunk-ESJIQMQJ.js';
|
|
50
|
-
import './chunk-
|
|
50
|
+
import './chunk-MMFRYMGJ.js';
|
|
51
51
|
import './chunk-DL4PX4HA.js';
|
|
52
52
|
import './chunk-6TL5EZJH.js';
|
|
53
53
|
import './chunk-NDDDT4TO.js';
|
|
54
54
|
import './chunk-QYKN3JZ5.js';
|
|
55
55
|
import './chunk-SLIZ4TDR.js';
|
|
56
|
-
import './chunk-
|
|
56
|
+
import './chunk-TXJVQRS6.js';
|
|
57
57
|
import './chunk-ANU7OAPA.js';
|
|
58
58
|
import './chunk-ISA6E23B.js';
|
|
59
59
|
import './chunk-OUR2CLV6.js';
|
|
60
|
-
import './chunk-
|
|
60
|
+
import './chunk-MQETRVUJ.js';
|
|
61
61
|
import './chunk-DSJ5TRZW.js';
|
|
62
62
|
import './chunk-IPAI4R3G.js';
|
|
63
63
|
import './chunk-F7K7HAXY.js';
|
|
64
|
-
import './chunk-
|
|
64
|
+
import './chunk-TU4FTVZK.js';
|
|
65
65
|
import './chunk-4FSPYK2A.js';
|
|
66
|
-
import './chunk-
|
|
66
|
+
import './chunk-CYOCZEOE.js';
|
|
67
67
|
import './chunk-WLWG565K.js';
|
|
68
68
|
import './chunk-GIZ3LLSA.js';
|
|
69
69
|
import './chunk-ER5CL77P.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { b, c } from './chunk-SBGTFQOD.js';
|
|
2
|
-
import { a as a$1 } from './chunk-
|
|
2
|
+
import { a as a$1 } from './chunk-CYOCZEOE.js';
|
|
3
3
|
import { a } from './chunk-ER5CL77P.js';
|
|
4
4
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
5
5
|
|
|
@@ -7,4 +7,4 @@ var o=Object.freeze({Header:"text-black text-lg font-semibold",HeaderBase:"text-
|
|
|
7
7
|
|
|
8
8
|
export { k as a };
|
|
9
9
|
//# sourceMappingURL=out.js.map
|
|
10
|
-
//# sourceMappingURL=chunk-
|
|
10
|
+
//# sourceMappingURL=chunk-BF6NM3B7.js.map
|
|
@@ -4,8 +4,8 @@ import { e as e$1, c, b, a as a$1 } from './chunk-Z4LPO673.js';
|
|
|
4
4
|
import { variantProps } from 'classname-variants/react';
|
|
5
5
|
import { jsx } from 'react/jsx-runtime';
|
|
6
6
|
|
|
7
|
-
var e=e$1(a(),1);var
|
|
7
|
+
var e=e$1(a(),1);var p=variantProps({base:"group flex items-stretch items-center justify-center p-0.5 text-center font-medium relative focus:z-10 focus:outline-none rounded-lg",variants:{color:{default:"focus:outline-none text-white bg-blue-700 border border-transparent enabled:hover:bg-blue-800 focus:ring-blue-300 dark:bg-blue-600 dark:enabled:hover:bg-blue-700 dark:focus:ring-blue-800 rounded-lg focus:ring-2",dark:"enabled:hover:bg-gray-900 focus:ring-4 focus:ring-gray-300 dark:bg-gray-800 dark:enabled:hover:bg-gray-700 dark:focus:ring-gray-800 dark:border-gray-700",failure:"enabled:hover:bg-red-800 focus:ring-4 focus:ring-red-300 dark:enabled:hover:bg-red-700 dark:focus:ring-red-900",gray:"border border-gray-200 enabled:hover:bg-gray-100 focus:ring-blue-700 focus:text-blue-700 dark:bg-transparent dark:text-gray-400 dark:border-gray-600 dark:enabled:hover:text-white dark:enabled:hover:bg-gray-700 focus:ring-2",info:"enabled:hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 dark:bg-blue-600 dark:enabled:hover:bg-blue-700 dark:focus:ring-blue-800",light:"focus:ring-4 focus:ring-blue-300 dark:bg-gray-600 dark:text-white dark:border-gray-600 dark:enabled:hover:bg-gray-700 dark:enabled:hover:border-gray-700 dark:focus:ring-gray-700",success:"enabled:hover:bg-green-800 focus:ring-4 focus:ring-green-300 dark:enabled:hover:bg-green-700 dark:focus:ring-green-800",warning:"enabled:hover:bg-yellow-500 focus:ring-4 focus:ring-yellow-300 dark:focus:ring-yellow-900"},disabled:{true:"cursor-not-allowed opacity-50",false:""},outline:{true:"border",false:""}},compoundVariants:[{variants:{color:"dark",outline:!0},className:"text-gray-800 border-gray-800 hover:text-white"},{variants:{color:"dark",outline:!1},className:"border-0 text-white bg-gray-800"},{variants:{color:"failure",outline:!0},className:"text-red-700 border-red-700 hover:text-white"},{variants:{color:"failure",outline:!1},className:"border-0 text-white bg-red-700"},{variants:{color:"info",outline:!0},className:"text-blue-700 border-blue-700 hover:text-white"},{variants:{color:"info",outline:!1},className:"text-white bg-blue-700"},{variants:{color:"success",outline:!0},className:"text-green-700 border-green-700 hover:text-white"},{variants:{color:"success",outline:!1},className:"text-white bg-green-700"},{variants:{color:"warning",outline:!0},className:"text-yellow-400 border-yellow-400 hover:text-white"},{variants:{color:"warning",outline:!1},className:"text-white bg-yellow-400"},{variants:{color:"gray",outline:!0},className:"text-gray-900 bg-white border border-gray-200"},{variants:{color:"gray",outline:!1},className:"text-gray-900 bg-gray-200 border border-gray-200"},{variants:{color:"light",outline:!0},className:"text-white border border-white hover:brightness-90"},{variants:{color:"light",outline:!1},className:"text-gray-900 bg-white border border-gray-300 enabled:hover:bg-gray-100"}]}),v=Object.freeze({xxs:"text-xs px-1 py-1",xs:"text-xs px-2 py-1",sm:"text-sm px-[12px] py-1.5",md:"text-sm px-[16px] py-2",mdbs:"text-sm px-[12px] py-[8px]",lg:"text-base px-[20px] py-2.5",xl:"text-base px-6 py-[12px]"});function g(m){var t=m,{color:d="default",disabled:a,outline:b$1,size:u="md",children:c$1,className:o}=t,f=c(t,["color","disabled","outline","size","children","className"]);return jsx("button",b(a$1(a$1({},p({color:d,disabled:a,outline:b$1,className:o})),f),{disabled:a,children:jsx("span",{className:a$2("flex items-center justify-center rounded-md transition-all duration-200",v[u],o),children:c$1})}))}g.propTypes={color:e.default.oneOf(["default","dark","failure","gray","info","light","success","warning"]),size:e.default.oneOf(["xxs","xs","sm","md","mdbs","lg","xl"]),disabled:e.default.bool,outline:e.default.bool,addon:e.default.element,icon:e.default.element};g.displayName="Button";
|
|
8
8
|
|
|
9
9
|
export { g as a };
|
|
10
10
|
//# sourceMappingURL=out.js.map
|
|
11
|
-
//# sourceMappingURL=chunk-
|
|
11
|
+
//# sourceMappingURL=chunk-CYOCZEOE.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/button.tsx"],"names":["variantProps","import_prop_types","jsx","buttonProps","sizes","Button","_a","_b","color","disabled","outline","size","children","className","props","__objRest","__spreadProps","__spreadValues","twMerge","PropTypes"],"mappings":"6IACA,OAAS,gBAAAA,MAAoB,2BAE7B,IAAAC,EAAsB,SA8JhB,cAAAC,MAAA,oBA5JN,IAAMC,EAAcH,EAAa,CAC/B,KAAM,uIACN,SAAU,CACR,MAAO,CACL,QACE,qNACF,KAAM,2JACN,QACE,iHACF,KAAM,iOACN,KAAM,sIACN,MACE,oLACF,QACE,yHACF,QACE,2FACJ,EACA,SAAU,CACR,KAAM,gCACN,MAAO,EACT,EACA,QAAS,CACP,KAAM,SACN,MAAO,EACT,CACF,EACA,iBAAkB,CAChB,CACE,SAAU,CACR,MAAO,OACP,QAAS,EACX,EACA,UAAW,gDACb,EACA,CACE,SAAU,CACR,MAAO,OACP,QAAS,EACX,EACA,UAAW,iCACb,EACA,CACE,SAAU,CACR,MAAO,UACP,QAAS,EACX,EACA,UAAW,8CACb,EACA,CACE,SAAU,CACR,MAAO,UACP,QAAS,EACX,EACA,UAAW,gCACb,EACA,CACE,SAAU,CACR,MAAO,OACP,QAAS,EACX,EACA,UAAW,gDACb,EACA,CACE,SAAU,CACR,MAAO,OACP,QAAS,EACX,EACA,UAAW,wBACb,EACA,CACE,SAAU,CACR,MAAO,UACP,QAAS,EACX,EACA,UAAW,kDACb,EACA,CACE,SAAU,CACR,MAAO,UACP,QAAS,EACX,EACA,UAAW,yBACb,EACA,CACE,SAAU,CACR,MAAO,UACP,QAAS,EACX,EACA,UAAW,oDACb,EACA,CACE,SAAU,CACR,MAAO,UACP,QAAS,EACX,EACA,UAAW,0BACb,EACA,CACE,SAAU,CACR,MAAO,OACP,QAAS,EACX,EACA,UACE,+CACJ,EACA,CACE,SAAU,CACR,MAAO,OACP,QAAS,EACX,EACA,UAAW,kDACb,EACA,CACE,SAAU,CACR,MAAO,QACP,QAAS,EACX,EACA,UACE,oDACJ,EACA,CACE,SAAU,CACR,MAAO,QACP,QAAS,EACX,EACA,UAAW,yEACb,CACF,CACF,CAAC,EAEKI,EAAQ,OAAO,OAAO,CAC1B,IAAK,oBACL,GAAI,oBACJ,GAAI,2BACJ,GAAI,yBACJ,KAAM,6BACN,GAAI,6BACJ,GAAI,0BACN,CAAC,EAEM,SAASC,EAAOC,EAQpB,CARoB,IAAAC,EAAAD,EACrB,OAAAE,EAAQ,UACR,SAAAC,EACA,QAAAC,EACA,KAAAC,EAAO,KACP,SAAAC,EACA,UAAAC,CAxJF,EAkJuBN,EAOlBO,EAAAC,EAPkBR,EAOlB,CANH,QACA,WACA,UACA,OACA,WACA,cAGA,OACEL,EAAC,SAAAc,EAAAC,IAAA,GACKd,EAAY,CAAE,MAAAK,EAAO,SAAAC,EAAU,QAAAC,EAAS,UAAAG,CAAU,CAAC,GACnDC,GAFL,CAGC,SAAUL,EAEV,SAAAP,EAAC,QACC,UAAWgB,EACT,0EACAd,EAAMO,CAAI,EACVE,CACF,EAEC,SAAAD,EACH,GACF,CAEJ,CAEAP,EAAO,UAAY,CAEjB,MAAO,EAAAc,QAAU,MAAM,CACrB,UACA,OACA,UACA,OACA,OACA,QACA,UACA,SACF,CAAC,EAED,KAAM,EAAAA,QAAU,MAAM,CAAC,MAAO,KAAM,KAAM,KAAM,OAAQ,KAAM,IAAI,CAAC,EAEnE,SAAU,EAAAA,QAAU,KAEpB,QAAS,EAAAA,QAAU,KAEnB,MAAO,EAAAA,QAAU,QAEjB,KAAM,EAAAA,QAAU,OAClB,EAEAd,EAAO,YAAc","sourcesContent":["//@ts-nocheck\nimport { variantProps } from \"classname-variants/react\";\nimport { twMerge } from \"tailwind-merge\";\nimport PropTypes from \"prop-types\";\n\nconst buttonProps = variantProps({\n base: \"group flex items-stretch items-center justify-center p-0.5 text-center font-medium relative focus:z-10 focus:outline-none rounded-lg\",\n variants: {\n color: {\n default:\n \"focus:outline-none text-white bg-blue-700 border border-transparent enabled:hover:bg-blue-800 focus:ring-blue-300 dark:bg-blue-600 dark:enabled:hover:bg-blue-700 dark:focus:ring-blue-800 rounded-lg focus:ring-2\",\n dark: \"enabled:hover:bg-gray-900 focus:ring-4 focus:ring-gray-300 dark:bg-gray-800 dark:enabled:hover:bg-gray-700 dark:focus:ring-gray-800 dark:border-gray-700\",\n failure:\n \"enabled:hover:bg-red-800 focus:ring-4 focus:ring-red-300 dark:enabled:hover:bg-red-700 dark:focus:ring-red-900\",\n gray: \"border border-gray-200 enabled:hover:bg-gray-100 focus:ring-blue-700 focus:text-blue-700 dark:bg-transparent dark:text-gray-400 dark:border-gray-600 dark:enabled:hover:text-white dark:enabled:hover:bg-gray-700 focus:ring-2\",\n info: \"enabled:hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 dark:bg-blue-600 dark:enabled:hover:bg-blue-700 dark:focus:ring-blue-800\",\n light:\n \"focus:ring-4 focus:ring-blue-300 dark:bg-gray-600 dark:text-white dark:border-gray-600 dark:enabled:hover:bg-gray-700 dark:enabled:hover:border-gray-700 dark:focus:ring-gray-700\",\n success:\n \"enabled:hover:bg-green-800 focus:ring-4 focus:ring-green-300 dark:enabled:hover:bg-green-700 dark:focus:ring-green-800\",\n warning:\n \"enabled:hover:bg-yellow-500 focus:ring-4 focus:ring-yellow-300 dark:focus:ring-yellow-900\",\n },\n disabled: {\n true: \"cursor-not-allowed opacity-50\",\n false: \"\",\n },\n outline: {\n true: \"border\",\n false: \"\",\n },\n },\n compoundVariants: [\n {\n variants: {\n color: \"dark\",\n outline: true,\n },\n className: \"text-gray-800 border-gray-800 hover:text-white\",\n },\n {\n variants: {\n color: \"dark\",\n outline: false,\n },\n className: \"border-0 text-white bg-gray-800\",\n },\n {\n variants: {\n color: \"failure\",\n outline: true,\n },\n className: \"text-red-700 border-red-700 hover:text-white\",\n },\n {\n variants: {\n color: \"failure\",\n outline: false,\n },\n className: \"border-0 text-white bg-red-700\",\n },\n {\n variants: {\n color: \"info\",\n outline: true,\n },\n className: \"text-blue-700 border-blue-700 hover:text-white\",\n },\n {\n variants: {\n color: \"info\",\n outline: false,\n },\n className: \"text-white bg-blue-700\",\n },\n {\n variants: {\n color: \"success\",\n outline: true,\n },\n className: \"text-green-700 border-green-700 hover:text-white\",\n },\n {\n variants: {\n color: \"success\",\n outline: false,\n },\n className: \"text-white bg-green-700\",\n },\n {\n variants: {\n color: \"warning\",\n outline: true,\n },\n className: \"text-yellow-400 border-yellow-400 hover:text-white\",\n },\n {\n variants: {\n color: \"warning\",\n outline: false,\n },\n className: \"text-white bg-yellow-400\",\n },\n {\n variants: {\n color: \"gray\",\n outline: true,\n },\n className:\n \"text-gray-900 bg-white border border-gray-200\",\n },\n {\n variants: {\n color: \"gray\",\n outline: false,\n },\n className: \"text-gray-900 bg-gray-200 border border-gray-200\",\n },\n {\n variants: {\n color: \"light\",\n outline: true,\n },\n className:\n \"text-white border border-white hover:brightness-90\",\n },\n {\n variants: {\n color: \"light\",\n outline: false,\n },\n className: \"text-gray-900 bg-white border border-gray-300 enabled:hover:bg-gray-100\",\n },\n ],\n});\n\nconst sizes = Object.freeze({\n xxs: \"text-xs px-1 py-1\",\n xs: \"text-xs px-2 py-1\",\n sm: \"text-sm px-[12px] py-1.5\",\n md: \"text-sm px-[16px] py-2\",\n mdbs: \"text-sm px-[12px] py-[8px]\",\n lg: \"text-base px-[20px] py-2.5\",\n xl: \"text-base px-6 py-[12px]\",\n});\n\nexport function Button({\n color = \"default\",\n disabled,\n outline,\n size = \"md\",\n children,\n className,\n ...props\n}) {\n return (\n <button\n {...buttonProps({ color, disabled, outline, className })}\n {...props}\n disabled={disabled}\n >\n <span\n className={twMerge(\n \"flex items-center justify-center rounded-md transition-all duration-200\",\n sizes[size],\n className\n )}\n >\n {children}\n </span>\n </button>\n );\n}\n\nButton.propTypes = {\n /** String for color of button */\n color: PropTypes.oneOf([\n \"default\",\n \"dark\",\n \"failure\",\n \"gray\",\n \"info\",\n \"light\",\n \"success\",\n \"warning\",\n ]),\n /** String to determine the size of the badge. \"xxs, xs, sm, md, mdbs, lg, xl\" */\n size: PropTypes.oneOf([\"xxs\", \"xs\", \"sm\", \"md\", \"mdbs\", \"lg\", \"xl\"]),\n /** Bool to disable button */\n disabled: PropTypes.bool,\n /** Bool to outline button */\n outline: PropTypes.bool,\n /** element for addon on button */\n addon: PropTypes.element,\n /** element for icon on button */\n icon: PropTypes.element,\n};\n\nButton.displayName = \"Button\";\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import s from 'clsx';
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
function n(t,i=0){return [...Array(t).keys()].map(r=>r+i)}function w({pageSize:t,total:i,current:r,onChange:o,loading:h,pageSizeOptions:p=[10,25,50,100]}){let b=Math.min((r-1)*t+1,i),v=Math.min(b+t-1,i),a=Math.ceil(i/t),u=useMemo(()=>a>5&&r>=4,[a,r]),y=useMemo(()=>a>5&&r<a-3,[a,r]),g=[];return a<=5?g=n(a,1):y?g=n(5,Math.max(r-2,1)):g=n(5,a-4),jsx("div",{id:"paginationControl",className:"w-full",children:jsx("div",{className:"relative overflow-hidden rounded-b-lg bg-white dark:bg-gray-800",children:jsxs("nav",{className:" flex flex-wrap items-start justify-between gap-x-4 gap-y-2 md:items-center","aria-label":"Table navigation",children:[jsxs("div",{className:"flex w-full justify-between md:hidden",children:[jsxs("button",{id:"btnPreviousM",disabled:r===1,className:s(r===1&&"cursor-not-allowed","ml-0 flex h-full items-center justify-center rounded-lg border border-gray-300 bg-white px-3 py-1.5 text-gray-500 hover:bg-gray-100 hover:text-gray-700 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white"),onClick:()=>o(r-1,t),children:[jsx("svg",{className:"h-5 w-5","aria-hidden":"true",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:jsx("path",{fillRule:"evenodd",d:"M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z",clipRule:"evenodd"})}),jsx("span",{className:"leading-none",children:"Previous"})]}),jsxs("button",{id:"btnNextM",disabled:r===a,className:s(r===a&&"cursor-not-allowed","flex h-full items-center justify-center rounded-lg border border-gray-300 bg-white px-3 py-1.5 leading-tight text-gray-500 hover:bg-gray-100 hover:text-gray-700 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white"),onClick:()=>o(r+1,t),children:[jsx("span",{children:"Next"}),jsx("svg",{className:"h-5 w-5","aria-hidden":"true",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:jsx("path",{fillRule:"evenodd",d:"M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z",clipRule:"evenodd"})})]})]}),jsxs("div",{className:"hidden items-center w-full justify-between md:flex",children:[jsx("div",{id:"showingSection",className:"text-sm font-normal text-gray-500 dark:text-gray-400",children:!h&&jsxs("span",{className:"text-gray-500 dark:text-white",children:["Showing ",jsx("span",{className:"text-gray-900 font-semibold",children:`${i===0?0:b} - ${v}`})," ","of"," ",jsx("span",{className:"text-gray-900 font-semibold",children:i})]})}),jsxs("ul",{className:"hidden items-stretch -space-x-px md:inline-flex",children:[jsx("li",{children:jsxs("button",{id:"btnPrevious",disabled:r===1,className:s(r===1&&"cursor-not-allowed","ml-0 flex h-full items-center justify-center rounded-l-lg border border-gray-300 bg-white px-[8px] lg:px-3 py-1.5 text-gray-500 hover:bg-gray-100 hover:text-gray-700 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white"),onClick:()=>o(r-1,t),children:[jsx("span",{className:"sr-only",children:"Previous"}),jsx("svg",{className:"h-5 w-5","aria-hidden":"true",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:jsx("path",{fillRule:"evenodd",d:"M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z",clipRule:"evenodd"})})]})}),u&&jsxs(Fragment,{children:[jsx("li",{children:jsx("button",{id:"btnPage1",className:s(r===1&&"cursor-not-allowed","flex items-center justify-center border border-gray-300 bg-white px-[8px] lg:px-3 py-2 text-sm leading-tight text-gray-500 hover:bg-gray-100 hover:text-gray-700 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white"),onClick:()=>o(1,t),children:"1"})}),jsx("li",{className:"flex cursor-default items-center justify-center border border-gray-300 bg-white px-[8px] lg:px-3 py-2 text-sm leading-tight text-gray-500 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-400",children:"..."})]}),g.map(d=>jsx("li",{children:jsx("button",{id:`btnPage${d}`,onClick:()=>o(d,t),className:s("hidden items-center justify-center border px-[8px] lg:px-3 py-2 text-sm leading-tight",d===r?"md:flex z-10 border-primary-300 bg-primary-50 text-primary-600 hover:bg-primary-100 hover:text-primary-700 dark:border-gray-700 dark:bg-gray-700 dark:text-white st-pageCurrent":"lg:flex border-gray-300 bg-white text-gray-500 hover:bg-gray-100 hover:text-gray-700 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white"),children:d})},d)),y&&jsxs(Fragment,{children:[jsx("li",{className:"flex cursor-default items-center justify-center border border-gray-300 bg-white px-[8px] lg:px-3 py-2 text-sm leading-tight text-gray-500 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-400",children:"..."}),jsx("li",{children:jsx("button",{id:"btnLast",className:"flex items-center justify-center border border-gray-300 bg-white px-[8px] lg:px-3 py-2 text-sm leading-tight text-gray-500 hover:bg-gray-100 hover:text-gray-700 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white",onClick:()=>o(a,t),children:a})})]}),jsx("li",{children:jsxs("button",{id:"btnNext",disabled:r===a,onClick:()=>o(r+1,t),className:s(r===a&&"cursor-not-allowed","flex h-full items-center justify-center rounded-r-lg border border-gray-300 bg-white px-[8px] lg:px-3 py-1.5 leading-tight text-gray-500 hover:bg-gray-100 hover:text-gray-700 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white"),children:[jsx("span",{className:"sr-only",children:"Next"}),jsx("svg",{className:"h-5 w-5","aria-hidden":"true",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:jsx("path",{fillRule:"evenodd",d:"M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z",clipRule:"evenodd"})})]})})]}),jsxs("div",{id:"rowsPerPageSection",className:"flex items-center space-x-3",children:[jsx("label",{htmlFor:"rows",className:"text-sm font-normal text-gray-500 dark:text-gray-400 mb-0",children:"Show"}),jsx("select",{id:"rows",className:"block rounded-lg border border-gray-300 bg-gray-50 py-1.5 pl-3.5 pr-6 text-sm text-gray-900 focus:border-primary-500 focus:ring-primary-500 dark:border-gray-600 dark:bg-gray-700 dark:text-white dark:placeholder-gray-400 dark:focus:border-primary-500 dark:focus:ring-primary-500",onChange:d=>o(1,Number(d.target.value)),value:t,children:p.map(d=>jsx("option",{value:d,children:d},d))})]})]})]})})})}
|
|
6
|
+
|
|
7
|
+
export { w as a };
|
|
8
|
+
//# sourceMappingURL=out.js.map
|
|
9
|
+
//# sourceMappingURL=chunk-FOWKHGHJ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/pagination/pagination.tsx"],"names":["clsx","useMemo","Fragment","jsx","jsxs","range","size","startAt","i","Pagination","pageSize","total","current","onChange","loading","pageSizeOptions","from","to","totalPages","showJumpPrev","showJumpNext","pages","page","e","option"],"mappings":"AAAA,OAAOA,MAAU,OACjB,OAAS,WAAAC,MAAe,QAsDZ,OAyFI,YAAAC,EAzEA,OAAAC,EAhBJ,QAAAC,MAAA,oBA3CZ,SAASC,EAAMC,EAAcC,EAAU,EAAa,CAClD,MAAO,CAAC,GAAG,MAAMD,CAAI,EAAE,KAAK,CAAC,E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WV,EACT,wFACAsB,IAASV,EACL,kLACA,4LACN,EAEC,SAAAU,EACH,GAZOA,CAaT,CACD,EACAF,GACChB,EAAAF,EAAA,CACE,UAAAC,EAAC,MAAG,UAAU,qMAAqM,eAEnN,EACAA,EAAC,MACC,SAAAA,EAAC,UACC,GAAG,UACH,UAAU,yQACV,QAAS,IAAMU,EAASK,EAAYR,CAAQ,EAE3C,SAAAQ,EACH,EACF,GACF,EAEFf,EAAC,MACC,SAAAC,EAAC,UACC,GAAG,UACH,SAAUQ,IAAYM,EACtB,QAAS,IAAML,EAASD,EAAU,EAAGF,CAAQ,EAC7C,UAAWV,EACTY,IAAYM,GAAc,qBAC1B,sRACF,EAEA,UAAAf,EAAC,QAAK,UAAU,UAAU,gBAAI,EAC9BA,EAAC,OACC,UAAU,UACV,cAAY,OACZ,KAAK,eACL,QAAQ,YACR,MAAM,6BAEN,SAAAA,EAAC,QACC,SAAS,UACT,EAAE,qHACF,SAAS,UACV,EACH,GACF,EACF,GACF,EACAC,EAAC,OAAI,GAAG,qBAAqB,UAAU,8BACrC,UAAAD,EAAC,SACC,QAAQ,OACR,UAAU,4DACX,gBAED,EACAA,EAAC,UACC,GAAG,OACH,UAAU,wRACV,SAAWoB,GAAMV,EAAS,EAAG,OAAOU,EAAE,OAAO,KAAK,CAAC,EACnD,MAAOb,EAEN,SAAAK,EAAgB,IAAKS,GACpBrB,EAAC,UAAoB,MAAOqB,EACzB,SAAAA,GADUA,CAEb,CACD,EACH,GAEF,GAEF,GACF,EACF,EACF,CAEJ","sourcesContent":["import clsx from \"clsx\";\nimport { useMemo } from \"react\";\n\nexport type PaginationProps = {\n pageSize: number;\n total: number;\n current: number;\n onChange: (page: number, pageSize: number) => void;\n loading?: boolean;\n pageSizeOptions?: number[];\n};\n\nfunction range(size: number, startAt = 0): number[] {\n return [...Array(size).keys()].map((i) => i + startAt);\n}\n\nexport function Pagination({\n pageSize,\n total,\n current,\n onChange,\n loading,\n pageSizeOptions = [10, 25, 50, 100],\n}: PaginationProps) {\n // Calculate the values that are displayed\n const from = Math.min((current - 1) * pageSize + 1, total);\n const to = Math.min(from + pageSize - 1, total);\n const totalPages = Math.ceil(total / pageSize);\n\n const showJumpPrev = useMemo(() => {\n return totalPages > 5 && current >= 4;\n }, [totalPages, current]);\n\n const showJumpNext = useMemo(() => {\n return totalPages > 5 && current < totalPages - 3;\n }, [totalPages, current]);\n\n let pages: number[] = [];\n\n if (totalPages <= 5) {\n pages = range(totalPages, 1);\n } else if (showJumpNext) {\n pages = range(5, Math.max(current - 2, 1));\n } else {\n pages = range(5, totalPages - 4);\n }\n\n return (\n <div id=\"paginationControl\" className=\"w-full\">\n <div className=\"relative overflow-hidden rounded-b-lg bg-white dark:bg-gray-800\">\n <nav\n className=\" flex flex-wrap items-start justify-between gap-x-4 gap-y-2 md:items-center\"\n aria-label=\"Table navigation\"\n >\n <div className=\"flex w-full justify-between md:hidden\">\n <button\n id=\"btnPreviousM\"\n disabled={current === 1}\n className={clsx(\n current === 1 && \"cursor-not-allowed\",\n \"ml-0 flex h-full items-center justify-center rounded-lg border border-gray-300 bg-white px-3 py-1.5 text-gray-500 hover:bg-gray-100 hover:text-gray-700 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white\"\n )}\n onClick={() => onChange(current - 1, pageSize)}\n >\n <svg\n className=\"h-5 w-5\"\n aria-hidden=\"true\"\n fill=\"currentColor\"\n viewBox=\"0 0 20 20\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z\"\n clipRule=\"evenodd\"\n ></path>\n </svg>\n <span className=\"leading-none\">Previous</span>\n </button>\n\n <button\n id=\"btnNextM\"\n disabled={current === totalPages}\n className={clsx(\n current === totalPages && \"cursor-not-allowed\",\n \"flex h-full items-center justify-center rounded-lg border border-gray-300 bg-white px-3 py-1.5 leading-tight text-gray-500 hover:bg-gray-100 hover:text-gray-700 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white\"\n )}\n onClick={() => onChange(current + 1, pageSize)}\n >\n <span>Next</span>\n <svg\n className=\"h-5 w-5\"\n aria-hidden=\"true\"\n fill=\"currentColor\"\n viewBox=\"0 0 20 20\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z\"\n clipRule=\"evenodd\"\n ></path>\n </svg>\n </button>\n </div>\n <div className=\"hidden items-center w-full justify-between md:flex\">\n <div id=\"showingSection\" className=\"text-sm font-normal text-gray-500 dark:text-gray-400\">\n {!loading && (\n <span className=\"text-gray-500 dark:text-white\">\n Showing <span className=\"text-gray-900 font-semibold\">{`${total === 0 ? 0 : from} - ${to}`}</span>{\" \"}of{\" \"}\n <span className=\"text-gray-900 font-semibold\">\n {total}\n </span>\n </span>\n )}\n </div>\n <ul className=\"hidden items-stretch -space-x-px md:inline-flex\">\n <li>\n <button\n id=\"btnPrevious\"\n disabled={current === 1}\n className={clsx(\n current === 1 && \"cursor-not-allowed\",\n \"ml-0 flex h-full items-center justify-center rounded-l-lg border border-gray-300 bg-white px-[8px] lg:px-3 py-1.5 text-gray-500 hover:bg-gray-100 hover:text-gray-700 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white\"\n )}\n onClick={() => onChange(current - 1, pageSize)}\n >\n <span className=\"sr-only\">Previous</span>\n <svg\n className=\"h-5 w-5\"\n aria-hidden=\"true\"\n fill=\"currentColor\"\n viewBox=\"0 0 20 20\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z\"\n clipRule=\"evenodd\"\n ></path>\n </svg>\n </button>\n </li>\n {showJumpPrev && (\n <>\n <li>\n <button\n id=\"btnPage1\"\n className={clsx(\n current === 1 && \"cursor-not-allowed\",\n \"flex items-center justify-center border border-gray-300 bg-white px-[8px] lg:px-3 py-2 text-sm leading-tight text-gray-500 hover:bg-gray-100 hover:text-gray-700 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white\"\n )}\n onClick={() => onChange(1, pageSize)}\n >\n 1\n </button>\n </li>\n <li className=\"flex cursor-default items-center justify-center border border-gray-300 bg-white px-[8px] lg:px-3 py-2 text-sm leading-tight text-gray-500 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-400\">\n ...\n </li>\n </>\n )}\n {pages.map((page) => (\n <li key={page}>\n <button\n id={`btnPage${page}`}\n onClick={() => onChange(page, pageSize)}\n className={clsx(\n \"hidden items-center justify-center border px-[8px] lg:px-3 py-2 text-sm leading-tight\",\n page === current\n ? \"md:flex z-10 border-primary-300 bg-primary-50 text-primary-600 hover:bg-primary-100 hover:text-primary-700 dark:border-gray-700 dark:bg-gray-700 dark:text-white st-pageCurrent\"\n : \"lg:flex border-gray-300 bg-white text-gray-500 hover:bg-gray-100 hover:text-gray-700 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white\"\n )}\n >\n {page}\n </button>\n </li>\n ))}\n {showJumpNext && (\n <>\n <li className=\"flex cursor-default items-center justify-center border border-gray-300 bg-white px-[8px] lg:px-3 py-2 text-sm leading-tight text-gray-500 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-400\">\n ...\n </li>\n <li>\n <button\n id=\"btnLast\"\n className=\"flex items-center justify-center border border-gray-300 bg-white px-[8px] lg:px-3 py-2 text-sm leading-tight text-gray-500 hover:bg-gray-100 hover:text-gray-700 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white\"\n onClick={() => onChange(totalPages, pageSize)}\n >\n {totalPages}\n </button>\n </li>\n </>\n )}\n <li>\n <button\n id=\"btnNext\"\n disabled={current === totalPages}\n onClick={() => onChange(current + 1, pageSize)}\n className={clsx(\n current === totalPages && \"cursor-not-allowed\",\n \"flex h-full items-center justify-center rounded-r-lg border border-gray-300 bg-white px-[8px] lg:px-3 py-1.5 leading-tight text-gray-500 hover:bg-gray-100 hover:text-gray-700 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white\"\n )}\n >\n <span className=\"sr-only\">Next</span>\n <svg\n className=\"h-5 w-5\"\n aria-hidden=\"true\"\n fill=\"currentColor\"\n viewBox=\"0 0 20 20\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z\"\n clipRule=\"evenodd\"\n ></path>\n </svg>\n </button>\n </li>\n </ul>\n <div id=\"rowsPerPageSection\" className=\"flex items-center space-x-3\">\n <label\n htmlFor=\"rows\"\n className=\"text-sm font-normal text-gray-500 dark:text-gray-400 mb-0\"\n >\n Show\n </label>\n <select\n id=\"rows\"\n className=\"block rounded-lg border border-gray-300 bg-gray-50 py-1.5 pl-3.5 pr-6 text-sm text-gray-900 focus:border-primary-500 focus:ring-primary-500 dark:border-gray-600 dark:bg-gray-700 dark:text-white dark:placeholder-gray-400 dark:focus:border-primary-500 dark:focus:ring-primary-500\"\n onChange={(e) => onChange(1, Number(e.target.value))}\n value={pageSize}\n >\n {pageSizeOptions.map((option) => (\n <option key={option} value={option}>\n {option}\n </option>\n ))}\n </select>\n \n </div>\n \n </div>\n </nav>\n </div>\n </div>\n );\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a, c, b as b$1 } from './chunk-4FSPYK2A.js';
|
|
2
|
-
import { a as a$3 } from './chunk-
|
|
2
|
+
import { a as a$3 } from './chunk-CYOCZEOE.js';
|
|
3
3
|
import { a as a$1 } from './chunk-6LHL364H.js';
|
|
4
4
|
import { e, b, a as a$2 } from './chunk-Z4LPO673.js';
|
|
5
5
|
import { createContext, useState, useRef, useEffect, useMemo } from 'react';
|
|
@@ -12,4 +12,4 @@ var E=e(a(),1),n=e(a$1(),1);var ne=createContext(),ie=variantProps({base:"focus:
|
|
|
12
12
|
|
|
13
13
|
export { R as a };
|
|
14
14
|
//# sourceMappingURL=out.js.map
|
|
15
|
-
//# sourceMappingURL=chunk-
|
|
15
|
+
//# sourceMappingURL=chunk-MMFRYMGJ.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as a$4 } from './chunk-DSJ5TRZW.js';
|
|
2
2
|
import { a as a$3 } from './chunk-IPAI4R3G.js';
|
|
3
3
|
import { a, c, b as b$1 } from './chunk-4FSPYK2A.js';
|
|
4
|
-
import { a as a$5 } from './chunk-
|
|
4
|
+
import { a as a$5 } from './chunk-CYOCZEOE.js';
|
|
5
5
|
import { a as a$1 } from './chunk-6LHL364H.js';
|
|
6
6
|
import { e, b, a as a$2 } from './chunk-Z4LPO673.js';
|
|
7
7
|
import { createContext, useState, useRef, useEffect, useMemo } from 'react';
|
|
@@ -14,4 +14,4 @@ var q=e(a(),1),s=e(a$1(),1);var ne=createContext(),se=variantProps({base:"focus:
|
|
|
14
14
|
|
|
15
15
|
export { Y as a };
|
|
16
16
|
//# sourceMappingURL=out.js.map
|
|
17
|
-
//# sourceMappingURL=chunk-
|
|
17
|
+
//# sourceMappingURL=chunk-MQETRVUJ.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a, c, b } from './chunk-4FSPYK2A.js';
|
|
2
|
-
import { a as a$2 } from './chunk-
|
|
2
|
+
import { a as a$2 } from './chunk-CYOCZEOE.js';
|
|
3
3
|
import { a as a$1 } from './chunk-6LHL364H.js';
|
|
4
4
|
import { e } from './chunk-Z4LPO673.js';
|
|
5
5
|
import { useState, useRef, useEffect, useMemo } from 'react';
|
|
@@ -11,4 +11,4 @@ var F=e(a(),1),g=e(a$1(),1);var Q=o=>{let t=new Date(Date.parse(o));return new D
|
|
|
11
11
|
|
|
12
12
|
export { H as a };
|
|
13
13
|
//# sourceMappingURL=out.js.map
|
|
14
|
-
//# sourceMappingURL=chunk-
|
|
14
|
+
//# sourceMappingURL=chunk-TU4FTVZK.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a } from './chunk-
|
|
1
|
+
import { a } from './chunk-CYOCZEOE.js';
|
|
2
2
|
import i from 'clsx';
|
|
3
3
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
4
|
|
|
@@ -6,4 +6,4 @@ function x({title:s,text:p,buttonText:e,position:r}){return jsxs("div",{classNam
|
|
|
6
6
|
|
|
7
7
|
export { x as a };
|
|
8
8
|
//# sourceMappingURL=out.js.map
|
|
9
|
-
//# sourceMappingURL=chunk-
|
|
9
|
+
//# sourceMappingURL=chunk-TXJVQRS6.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a } from './chunk-SBGTFQOD.js';
|
|
2
|
-
import { a as a$1 } from './chunk-
|
|
2
|
+
import { a as a$1 } from './chunk-CYOCZEOE.js';
|
|
3
3
|
import 'react-responsive-carousel/lib/styles/carousel.min.css';
|
|
4
4
|
import { Carousel } from 'react-responsive-carousel';
|
|
5
5
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
@@ -8,4 +8,4 @@ var d="https://shared.ekmcdn.com/images/dashboard/services/",c=Object.freeze([{S
|
|
|
8
8
|
|
|
9
9
|
export { p as a };
|
|
10
10
|
//# sourceMappingURL=out.js.map
|
|
11
|
-
//# sourceMappingURL=chunk-
|
|
11
|
+
//# sourceMappingURL=chunk-VE6J42I7.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { a } from './chunk-6LHL364H.js';
|
|
2
|
+
import { e, b, a as a$1 } from './chunk-Z4LPO673.js';
|
|
3
|
+
import { forwardRef, useState, useImperativeHandle, useEffect, useRef, useCallback } from 'react';
|
|
4
|
+
import { HiSearch } from 'react-icons/hi';
|
|
5
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
6
|
+
|
|
7
|
+
var r=e(a(),1);function F(w,n,t){let d=useRef(0),s=useRef(null),u=useCallback(w,t);useEffect(()=>(d.current===0?d.current=1:s.current=setTimeout(()=>{u();},n),()=>{clearTimeout(s.current);}),[u,n]);}var R=forwardRef(function({id:n,categories:t=[],delay:d=1500,placeholder:s="Enter a keyword to search...",callback:u,disabled:D=!1,initialValue:i="",additionalClasses:x="",showSearchIcon:C=!1},N){let[o,y]=useState({text:null,category:(t==null?void 0:t.length)>0?t[0]:null}),[S,h]=useState(i),[$,b$1]=useState(!0);useImperativeHandle(N,()=>({clear:()=>{h(""),y(b(a$1({},o),{text:""}));},removeFocus:()=>{document.getElementById(`${n}-search-input`).blur();}}));let E=e=>{h(e.target.value),y(b(a$1({},o),{text:e.target.value}));},T=(e,l)=>{e.preventDefault(),y(b(a$1({},o),{category:l})),b$1(!0);},L=e=>{(e.charCode||e.keyCode)===13&&e.preventDefault();};F(()=>{u(o);},d,[o.text,o.category]),useEffect(()=>{i!==S&&h(i);},[i]);let p=useRef(null);useEffect(()=>{let e=l=>{p.current&&!p.current.contains(l.target)&&b$1(!0);};return document.addEventListener("click",e,!0),()=>{document.removeEventListener("click",e,!0);}},[]);let q=()=>jsxs(Fragment,{children:[jsxs("button",{id:`${n}-dropdown-button`,className:"absolute right-0 top-0 z-10 inline-flex flex-shrink-0 items-center rounded-r-lg border border-gray-300 bg-white px-4 py-2 text-center text-sm font-medium text-gray-900 hover:bg-gray-200 focus:outline-none focus:ring-4 focus:ring-gray-300 dark:border-gray-700 dark:bg-gray-600 dark:text-white dark:hover:bg-gray-700 dark:focus:ring-gray-800",type:"button",onClick:()=>b$1(!$),children:[o.category.display,jsx("svg",{className:"ml-2.5 h-2.5 w-2.5","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 10 6",children:jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"m1 1 4 4 4-4"})})]}),jsx("div",{id:`${n}-dropdown`,ref:p,className:`z-10 ${$?"hidden":""} absolute right-0 w-44 divide-y divide-gray-100 rounded-r-lg bg-white shadow dark:bg-gray-700`,children:jsx("ul",{className:"py-2 text-sm text-gray-700 dark:text-gray-200","aria-labelledby":"dropdown-button",children:(t||[]).map(e=>jsx("li",{className:"block px-4 py-2 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white cursor-pointer",onClick:l=>T(l,e),children:e.display},`gst-${e.display}`))})})]});return jsx("div",{className:`flex ${x||""}`,children:jsxs("div",{className:"relative w-full",children:[C&&jsx("div",{className:"pointer-events-none hidden lg:flex absolute inset-y-0 start-0 items-center ps-3.5",children:jsx(HiSearch,{size:20,className:"text-gray-500"})}),jsx("input",{ref:N,placeholder:s,value:S,"aria-label":"search","aria-describedby":"Search",onChange:E,onKeyDown:L,disabled:D,id:`${n}-search-input`,className:`block w-full rounded-lg border border-gray-300 border-r-gray-300 text-sm text-gray-900 focus:border-blue-500 focus:ring-blue-500 dark:border-gray-600 dark:bg-gray-700 dark:text-white dark:placeholder-gray-400 dark:focus:border-blue-500 ${C?"pl-2 lg:pl-10 pr-2 py-2 bg-white":"p-2 bg-gray-50"}`}),(t==null?void 0:t.length)>0&&q()]})})});R.propTypes={categories:r.default.arrayOf(r.default.shape({display:r.default.string.isRequired,value:r.default.oneOfType([r.default.string,r.default.number]).isRequired})),delay:r.default.number,placeholder:r.default.string,callback:r.default.func.isRequired,disabled:r.default.bool,initialValue:r.default.string,additionalClasses:r.default.string,showSearchIcon:r.default.bool};R.displayName="Search";
|
|
8
|
+
|
|
9
|
+
export { R as a };
|
|
10
|
+
//# sourceMappingURL=out.js.map
|
|
11
|
+
//# sourceMappingURL=chunk-ZNWAFIZY.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/search/search.tsx"],"names":["import_prop_types","forwardRef","useCallback","useEffect","useImperativeHandle","useRef","useState","HiSearch","Fragment","jsx","jsxs","useDebounceEffect","effect","delay","deps","instanceRef","handlerRef","callback","Search","id","categories","placeholder","disabled","initialValue","additionalClasses","showSearchIcon","reference","state","setState","currentSearchValue","setCurrentSearchValue","hidden","setHidden","__spreadProps","__spreadValues","handleSearchChange","handleTypeChange","selection","handleKeyDown","ref","handleClickOutside","e","renderDropdown","x","PropTypes"],"mappings":"8FACA,IAAAA,EAAsB,SACtB,OACE,cAAAC,EACA,eAAAC,EACA,aAAAC,EACA,uBAAAC,EACA,UAAAC,EACA,YAAAC,MACK,QACP,OAAS,YAAAC,MAAgB,iBAiGrB,mBAAAC,EAeM,OAAAC,EAdJ,QAAAC,MADF,oBA/FJ,SAASC,EAAkBC,EAAQC,EAAOC,EAAM,CAC9C,IAAMC,EAAcV,EAAO,CAAC,EACtBW,EAAaX,EAAO,IAAI,EACxBY,EAAWf,EAAYU,EAAQE,CAAI,EAEzCX,EAAU,KACJY,EAAY,UAAY,EAC1BA,EAAY,QAAU,EAEtBC,EAAW,QAAU,WAAW,IAAM,CACpCC,EAAS,CACX,EAAGJ,CAAK,EAEH,IAAM,CACX,aAAaG,EAAW,OAAO,CACjC,GACC,CAACC,EAAUJ,CAAK,CAAC,CACtB,CAEO,IAAMK,EAASjB,EAAW,SAC/B,CACE,GAAAkB,EACA,WAAAC,EAAa,CAAC,EACd,MAAAP,EAAQ,KACR,YAAAQ,EAAc,+BACd,SAAAJ,EACA,SAAAK,EAAW,GACX,aAAAC,EAAe,GACf,kBAAAC,EAAmB,GACnB,eAAAC,EAAiB,EACnB,EACAC,EACA,CAEA,GAAM,CAACC,EAAOC,CAAQ,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AAU,MAAM,CAAC,EAC5D,UACL,CAAC,CACH,EAIA,MAAO,EAAAA,QAAU,OAIjB,YAAa,EAAAA,QAAU,OAKvB,SAAU,EAAAA,QAAU,KAAK,WAIzB,SAAU,EAAAA,QAAU,KAKpB,aAAc,EAAAA,QAAU,OAIxB,kBAAmB,EAAAA,QAAU,OAI7B,eAAgB,EAAAA,QAAU,IAC5B,EAEA1B,EAAO,YAAc","sourcesContent":["//@ts-nocheck\nimport PropTypes from \"prop-types\";\nimport {\n forwardRef,\n useCallback,\n useEffect,\n useImperativeHandle,\n useRef,\n useState,\n} from \"react\";\nimport { HiSearch } from \"react-icons/hi\";\n\nfunction useDebounceEffect(effect, delay, deps) {\n const instanceRef = useRef(0);\n const handlerRef = useRef(null);\n const callback = useCallback(effect, deps);\n\n useEffect(() => {\n if (instanceRef.current === 0) {\n instanceRef.current = 1;\n } else {\n handlerRef.current = setTimeout(() => {\n callback();\n }, delay);\n }\n return () => {\n clearTimeout(handlerRef.current);\n };\n }, [callback, delay]);\n}\n\nexport const Search = forwardRef(function Search(\n {\n id,\n categories = [],\n delay = 1500,\n placeholder = \"Enter a keyword to search...\",\n callback,\n disabled = false,\n initialValue = \"\",\n additionalClasses= \"\",\n showSearchIcon = false,\n },\n reference\n) {\n // Create state based on config\n const [state, setState] = useState({\n text: null,\n category: categories?.length > 0 ? categories[0] : null,\n });\n const [currentSearchValue, setCurrentSearchValue] = useState(initialValue);\n const [hidden, setHidden] = useState(true);\n\n useImperativeHandle(reference, () => ({\n clear: () => {\n setCurrentSearchValue(\"\");\n setState({ ...state, text: \"\" });\n },\n removeFocus: () => {\n document.getElementById(`${id}-search-input`).blur();\n },\n }));\n\n const handleSearchChange = (e) => {\n setCurrentSearchValue(e.target.value);\n setState({ ...state, text: e.target.value });\n };\n\n const handleTypeChange = (e, selection) => {\n e.preventDefault();\n setState({ ...state, category: selection });\n setHidden(true);\n };\n\n const handleKeyDown = (e) => {\n if ((e.charCode || e.keyCode) === 13) {\n e.preventDefault();\n }\n };\n\n useDebounceEffect(\n () => {\n callback(state);\n },\n delay,\n [state.text, state.category]\n );\n useEffect(() => {\n if (initialValue !== currentSearchValue)\n setCurrentSearchValue(initialValue);\n }, [initialValue]);\n\n const ref = useRef(null);\n useEffect(() => {\n const handleClickOutside = (e) => {\n if (ref.current && !ref.current.contains(e.target)) {\n setHidden(true);\n }\n };\n\n document.addEventListener(\"click\", handleClickOutside, true);\n return () => {\n document.removeEventListener(\"click\", handleClickOutside, true);\n };\n }, []);\n\n const renderDropdown = () => (\n <>\n <button\n id={`${id}-dropdown-button`}\n className=\"absolute right-0 top-0 z-10 inline-flex flex-shrink-0 items-center rounded-r-lg border border-gray-300 bg-white px-4 py-2 text-center text-sm font-medium text-gray-900 hover:bg-gray-200 focus:outline-none focus:ring-4 focus:ring-gray-300 dark:border-gray-700 dark:bg-gray-600 dark:text-white dark:hover:bg-gray-700 dark:focus:ring-gray-800\"\n type=\"button\"\n onClick={() => setHidden(!hidden)}\n >\n {state.category.display}\n <svg\n className=\"ml-2.5 h-2.5 w-2.5\"\n aria-hidden=\"true\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 10 6\"\n >\n <path\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth=\"2\"\n d=\"m1 1 4 4 4-4\"\n />\n </svg>\n </button>\n <div\n id={`${id}-dropdown`}\n ref={ref}\n className={`z-10 ${\n hidden ? \"hidden\" : \"\"\n } absolute right-0 w-44 divide-y divide-gray-100 rounded-r-lg bg-white shadow dark:bg-gray-700`}\n >\n <ul\n className=\"py-2 text-sm text-gray-700 dark:text-gray-200\"\n aria-labelledby=\"dropdown-button\"\n >\n {(categories || []).map((x) => {\n return (\n <li \n key={`gst-${x.display}`} \n className=\"block px-4 py-2 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white cursor-pointer\"\n onClick={(e) => handleTypeChange(e, x)}\n >\n {x.display}\n </li>\n );\n })}\n </ul>\n </div>\n </>\n );\n\n return (\n <div className={`flex ${additionalClasses ? additionalClasses : ''}`}>\n <div className=\"relative w-full\">\n {showSearchIcon && (\n <div className=\"pointer-events-none hidden lg:flex absolute inset-y-0 start-0 items-center ps-3.5\">\n <HiSearch size={20} className=\"text-gray-500\"/>\n </div>\n )}\n <input\n ref={reference}\n placeholder={placeholder}\n value={currentSearchValue}\n aria-label=\"search\"\n aria-describedby=\"Search\"\n onChange={handleSearchChange}\n onKeyDown={handleKeyDown}\n disabled={disabled}\n id={`${id}-search-input`}\n className={`block w-full rounded-lg border border-gray-300 border-r-gray-300 text-sm text-gray-900 focus:border-blue-500 focus:ring-blue-500 dark:border-gray-600 dark:bg-gray-700 dark:text-white dark:placeholder-gray-400 dark:focus:border-blue-500 ${showSearchIcon ? 'pl-2 lg:pl-10 pr-2 py-2 bg-white' : 'p-2 bg-gray-50'}`}\n />\n {categories?.length > 0 && renderDropdown()}\n </div>\n </div>\n );\n});\n\nSearch.propTypes = {\n /** Optional List of categories that the search term can be applied to. If supplied\n * the categories appear on the far right of the search input in a drop down list, otherwise it is hidden.\n */\n categories: PropTypes.arrayOf(\n PropTypes.shape({\n /**\n * The text shown to the user in the dropdown.\n */\n display: PropTypes.string.isRequired,\n /**\n * The value set when the item is selected.\n */\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number])\n .isRequired,\n })\n ),\n /**\n * The delay between requests made to the server when typing in milliseconds.\n */\n delay: PropTypes.number,\n /**\n * Optional placeholder for the search field.\n */\n placeholder: PropTypes.string,\n /**\n * Callback with the search object for use in the application the format is:\n * { text: '', category: {display:\"\", value:\"\"} }. Note: category is null if no options are provided.\n */\n callback: PropTypes.func.isRequired,\n /**\n * If set to true, the text in the search box cannot be changed\n */\n disabled: PropTypes.bool,\n /**\n * If set, will be the value in the search bar when it first loads.\n * If not set, the search bar will just be empty.\n */\n initialValue: PropTypes.string,\n /**\n * Any additional classes to apply to the outside div of the search component\n */\n additionalClasses: PropTypes.string,\n /**\n * If set to true, a search icon will be displayed inside the search input.\n */\n showSearchIcon: PropTypes.bool,\n};\n\nSearch.displayName = \"Search\";\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as a$i } from './chunk-22RUXGYW.js';
|
|
2
|
-
import { a as a$e } from './chunk-
|
|
2
|
+
import { a as a$e } from './chunk-ZNWAFIZY.js';
|
|
3
3
|
import { a as a$8, b } from './chunk-HVNLAQA6.js';
|
|
4
4
|
import { a as a$j } from './chunk-FPXEE5TC.js';
|
|
5
5
|
import { a as a$9 } from './chunk-XXP5K6Y4.js';
|
|
@@ -13,7 +13,7 @@ import { a as a$a } from './chunk-ESJIQMQJ.js';
|
|
|
13
13
|
import { a as a$b } from './chunk-NDDDT4TO.js';
|
|
14
14
|
import { a as a$6 } from './chunk-IPAI4R3G.js';
|
|
15
15
|
import { a as a$5 } from './chunk-F7K7HAXY.js';
|
|
16
|
-
import { a as a$2 } from './chunk-
|
|
16
|
+
import { a as a$2 } from './chunk-CYOCZEOE.js';
|
|
17
17
|
import { a as a$3 } from './chunk-ER5CL77P.js';
|
|
18
18
|
import { a as a$h } from './chunk-5SEJVYKM.js';
|
|
19
19
|
import { a as a$f } from './chunk-2OPJLYW6.js';
|
|
@@ -34,4 +34,4 @@ function Xe({cardPayment:r,enablePayPal:e}){return jsxs(a$3,{className:"border-0
|
|
|
34
34
|
|
|
35
35
|
export { nr as a, Nr as b, le as c, Fe as d, K as e, Ye as f, ir as g, Xe as h };
|
|
36
36
|
//# sourceMappingURL=out.js.map
|
|
37
|
-
//# sourceMappingURL=chunk-
|
|
37
|
+
//# sourceMappingURL=chunk-ZRMNYAO7.js.map
|