sprint-asia-custom-component 0.1.135 → 0.1.137

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/dist/index.js CHANGED
@@ -26797,6 +26797,95 @@
26797
26797
  }, option))))));
26798
26798
  };
26799
26799
 
26800
+ const FilterCheckboxDropdown = ({
26801
+ options = [{
26802
+ option: "Option 1",
26803
+ value: "value 1"
26804
+ }, {
26805
+ option: "Option 2",
26806
+ value: "value 2"
26807
+ }, {
26808
+ option: "Option 3",
26809
+ value: "value 3"
26810
+ }],
26811
+ currentValue = [],
26812
+ buttonText = "Filter",
26813
+ onSelect
26814
+ }) => {
26815
+ const [isOpen, setIsOpen] = React.useState(false);
26816
+ const [selectedOptions, setSelectedOptions] = React.useState([]);
26817
+ const dropdownRef = React.useRef(null);
26818
+
26819
+ // Inisialisasi selectedOptions dengan currentValue saat pertama kali render
26820
+ React.useEffect(() => {
26821
+ setSelectedOptions(currentValue);
26822
+ }, [currentValue]);
26823
+ React.useEffect(() => {
26824
+ const handleOutsideClick = event => {
26825
+ if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
26826
+ setIsOpen(false);
26827
+ }
26828
+ };
26829
+ if (isOpen) {
26830
+ document.addEventListener('mousedown', handleOutsideClick);
26831
+ }
26832
+ return () => {
26833
+ document.removeEventListener('mousedown', handleOutsideClick);
26834
+ };
26835
+ }, [isOpen]);
26836
+ const handleToggleFilterCheckboxDropdown = () => {
26837
+ setIsOpen(!isOpen);
26838
+ };
26839
+ const handleOptionClick = optionValue => {
26840
+ const updatedOptions = selectedOptions.some(option => option.value === optionValue) ? selectedOptions.filter(selected => selected.value !== optionValue) : [...selectedOptions, options.find(option => option.value === optionValue)];
26841
+ setSelectedOptions(updatedOptions);
26842
+
26843
+ // Menampilkan selectedOptions setelah setiap klik
26844
+ console.log('Current selected options:', updatedOptions);
26845
+ if (onSelect) {
26846
+ onSelect(updatedOptions);
26847
+ }
26848
+ };
26849
+ return /*#__PURE__*/React__default["default"].createElement("div", {
26850
+ className: "relative inline-block text-left",
26851
+ ref: dropdownRef
26852
+ }, /*#__PURE__*/React__default["default"].createElement("div", null, /*#__PURE__*/React__default["default"].createElement("span", {
26853
+ className: "rounded-md shadow-sm"
26854
+ }, /*#__PURE__*/React__default["default"].createElement("button", {
26855
+ type: "button",
26856
+ className: "flex items-center w-60 py-2.5 text-left px-4 bg-neutral20 border-neutral50 font-normal text-sm text-neutral300 rounded-md border focus:outline-none",
26857
+ onClick: handleToggleFilterCheckboxDropdown
26858
+ }, /*#__PURE__*/React__default["default"].createElement("span", {
26859
+ className: "flex-grow"
26860
+ }, buttonText), /*#__PURE__*/React__default["default"].createElement("span", {
26861
+ className: "ml-2"
26862
+ }, isOpen ? /*#__PURE__*/React__default["default"].createElement(PiCaretUp, {
26863
+ size: 16,
26864
+ className: "text-neutral300"
26865
+ }) : /*#__PURE__*/React__default["default"].createElement(PiCaretDown, {
26866
+ size: 16,
26867
+ className: "text-neutral300"
26868
+ }))))), isOpen && /*#__PURE__*/React__default["default"].createElement("div", {
26869
+ className: "z-10 origin-top-right absolute left-0 mt-2 w-60 rounded-md shadow-md bg-white ring-1 ring-black ring-opacity-5 focus:outline-none",
26870
+ role: "menu",
26871
+ "aria-orientation": "vertical",
26872
+ "aria-labelledby": "options-menu"
26873
+ }, /*#__PURE__*/React__default["default"].createElement("div", {
26874
+ className: "px-1 py-2"
26875
+ }, options.map(val => /*#__PURE__*/React__default["default"].createElement("div", {
26876
+ key: val.value,
26877
+ className: `hover:bg-neutral20 bg-white py-2.5 px-4 my-0.5 rounded-md flex items-center cursor-pointer ${selectedOptions.some(option => option.value === val.value) ? 'bg-primary500' : ''}`,
26878
+ onClick: () => handleOptionClick(val.value)
26879
+ }, /*#__PURE__*/React__default["default"].createElement("input", {
26880
+ type: "checkbox",
26881
+ className: "mr-2",
26882
+ checked: selectedOptions.some(option => option.value === val.value),
26883
+ onChange: () => handleOptionClick(val.value)
26884
+ }), /*#__PURE__*/React__default["default"].createElement("p", {
26885
+ className: `text-sm ${selectedOptions.some(option => option.value === val.value) ? 'text-primary500' : 'text-black'}`
26886
+ }, val.option))))));
26887
+ };
26888
+
26800
26889
  const FilterText = ({
26801
26890
  options = ["Type", "Company"],
26802
26891
  onSelect
@@ -45422,6 +45511,7 @@
45422
45511
  totalCount = 0,
45423
45512
  currentPage = 1,
45424
45513
  totalPage = 10,
45514
+ isLoading = false,
45425
45515
  onChangePages
45426
45516
  }) => {
45427
45517
  const pageNumbers = Array.from({
@@ -45436,23 +45526,23 @@
45436
45526
  className: "flex justify-between items-center"
45437
45527
  }, /*#__PURE__*/React__default["default"].createElement("div", null, /*#__PURE__*/React__default["default"].createElement("p", {
45438
45528
  className: "text-sm text-black font-normal p-4"
45439
- }, "From ", firstData || 0, " to ", lastData || 0, " of total : ", totalCount || 0)), /*#__PURE__*/React__default["default"].createElement("div", {
45529
+ }, "From ", isLoading ? 0 : firstData || 0, " to ", isLoading ? 0 : lastData || 0, " of total : ", isLoading ? 0 : totalCount || 0)), /*#__PURE__*/React__default["default"].createElement("div", {
45440
45530
  className: "flex px-4 py-2"
45441
45531
  }, /*#__PURE__*/React__default["default"].createElement("div", {
45442
- className: `m-1 w-10 h-10 rounded-full ${currentPage === 1 || firstData === 0 || lastData === 0 || totalCount === 0 || !firstData || !lastData || !totalCount ? 'bg-neutral20 cursor-default' : 'bg-white cursor-pointer border border-neutral40'} flex items-center justify-center`,
45532
+ className: `m-1 w-10 h-10 rounded-full ${currentPage === 1 || firstData === 0 || lastData === 0 || totalCount === 0 || !firstData || !lastData || !totalCount || isLoading ? 'bg-neutral20 cursor-default' : 'bg-white cursor-pointer border border-neutral40'} flex items-center justify-center`,
45443
45533
  onClick: () => {
45444
- if (currentPage !== 1 || firstData > 0 || lastData > 0 || totalCount > 0) {
45534
+ if (currentPage !== 1 && !isLoading) {
45445
45535
  handleChangePages(currentPage - 1);
45446
45536
  }
45447
45537
  }
45448
45538
  }, /*#__PURE__*/React__default["default"].createElement(PiCaretLeft, {
45449
45539
  size: 16,
45450
45540
  className: "text-neutral300"
45451
- })), totalPage < 4 ? pageNumbers.map(pageNumber => /*#__PURE__*/React__default["default"].createElement("div", {
45541
+ })), totalPage < 4 && !isLoading ? pageNumbers.map(pageNumber => /*#__PURE__*/React__default["default"].createElement("div", {
45452
45542
  key: pageNumber,
45453
45543
  className: `m-1 w-10 h-10 rounded-full cursor-pointer ${currentPage === pageNumber ? 'bg-primary500 text-white' : 'bg-white text-black border border-neutral40'} flex items-center justify-center font-semibold`,
45454
45544
  onClick: () => handleChangePages(pageNumber)
45455
- }, /*#__PURE__*/React__default["default"].createElement("p", null, pageNumber))) : /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, currentPage == 1 && /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("div", {
45545
+ }, /*#__PURE__*/React__default["default"].createElement("p", null, pageNumber))) : /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, currentPage == 1 && !isLoading && /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("div", {
45456
45546
  key: currentPage,
45457
45547
  className: "m-1 w-10 h-10 rounded-full bg-primary500 text-white cursor-pointer flex items-center justify-center font-semibold",
45458
45548
  onClick: () => handleChangePages(currentPage)
@@ -45467,7 +45557,7 @@
45467
45557
  key: totalPage,
45468
45558
  className: "m-1 w-10 h-10 rounded-full bg-white text-black border border-neutral40 cursor-pointer flex items-center justify-center font-semibold",
45469
45559
  onClick: () => handleChangePages(totalPage)
45470
- }, /*#__PURE__*/React__default["default"].createElement("p", null, totalPage))), currentPage > 1 && currentPage != totalPage - 1 && currentPage != totalPage && /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("div", {
45560
+ }, /*#__PURE__*/React__default["default"].createElement("p", null, totalPage))), currentPage > 1 && currentPage != totalPage - 1 && currentPage != totalPage && !isLoading && /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("div", {
45471
45561
  key: currentPage - 1,
45472
45562
  className: "m-1 w-10 h-10 rounded-full bg-white text-black border border-neutral40 cursor-pointer flex items-center justify-center font-semibold",
45473
45563
  onClick: () => handleChangePages(currentPage - 1)
@@ -45482,7 +45572,7 @@
45482
45572
  key: totalPage,
45483
45573
  className: "m-1 w-10 h-10 rounded-full bg-white text-black border border-neutral40 cursor-pointer flex items-center justify-center font-semibold",
45484
45574
  onClick: () => handleChangePages(totalPage)
45485
- }, /*#__PURE__*/React__default["default"].createElement("p", null, totalPage))), currentPage == totalPage - 1 && /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("div", {
45575
+ }, /*#__PURE__*/React__default["default"].createElement("p", null, totalPage))), currentPage == totalPage - 1 && !isLoading && /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("div", {
45486
45576
  key: totalPage - 2,
45487
45577
  className: "m-1 w-10 h-10 rounded-full bg-white text-black border border-neutral40 cursor-pointer flex items-center justify-center font-semibold",
45488
45578
  onClick: () => handleChangePages(totalPage - 2)
@@ -45497,7 +45587,7 @@
45497
45587
  key: totalPage,
45498
45588
  className: "m-1 w-10 h-10 rounded-full bg-white text-black border border-neutral40 cursor-pointer flex items-center justify-center font-semibold",
45499
45589
  onClick: () => handleChangePages(totalPage)
45500
- }, /*#__PURE__*/React__default["default"].createElement("p", null, totalPage))), currentPage == totalPage && /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("div", {
45590
+ }, /*#__PURE__*/React__default["default"].createElement("p", null, totalPage))), currentPage == totalPage && !isLoading && /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("div", {
45501
45591
  key: totalPage - 2,
45502
45592
  className: "m-1 w-10 h-10 rounded-full bg-white text-black border border-neutral40 cursor-pointer flex items-center justify-center font-semibold",
45503
45593
  onClick: () => handleChangePages(totalPage - 2)
@@ -45513,9 +45603,9 @@
45513
45603
  className: "m-1 w-10 h-10 rounded-full bg-primary500 text-white cursor-pointer flex items-center justify-center font-semibold",
45514
45604
  onClick: () => handleChangePages(currentPage)
45515
45605
  }, /*#__PURE__*/React__default["default"].createElement("p", null, currentPage)))), /*#__PURE__*/React__default["default"].createElement("div", {
45516
- className: `m-1 w-10 h-10 rounded-full ${currentPage === totalPage || firstData === 0 || lastData === 0 || totalCount === 0 || !firstData || !lastData || !totalCount ? 'bg-neutral20 cursor-default' : 'bg-white cursor-pointer border border-neutral40'} flex items-center justify-center`,
45606
+ className: `m-1 w-10 h-10 rounded-full ${currentPage === totalPage || firstData === 0 || lastData === 0 || totalCount === 0 || !firstData || !lastData || !totalCount || isLoading ? 'bg-neutral20 cursor-default' : 'bg-white cursor-pointer border border-neutral40'} flex items-center justify-center`,
45517
45607
  onClick: () => {
45518
- if (currentPage !== totalPage || firstData > 0 || lastData > 0 || totalCount > 0) {
45608
+ if (currentPage !== totalPage && firstData > 0 && lastData > 0 && totalCount > 0 && !isLoading) {
45519
45609
  handleChangePages(currentPage + 1);
45520
45610
  }
45521
45611
  }
@@ -47745,7 +47835,10 @@
47745
47835
  className: `${input ? "border-black" : "border-neutral50"} relative cursor-pointer border-t border-b border-l rounded-tl-md rounded-bl-md`,
47746
47836
  onClick: () => setIsOpen(!isOpen)
47747
47837
  }, /*#__PURE__*/React__default["default"].createElement("div", {
47748
- className: "flex items-center bg-white rounded-tl-md rounded-bl-md min-w-36"
47838
+ className: "flex items-center bg-white rounded-tl-md rounded-bl-md",
47839
+ style: {
47840
+ minWidth: "144px"
47841
+ }
47749
47842
  }, /*#__PURE__*/React__default["default"].createElement("p", {
47750
47843
  className: "flex items-center w-full py-2.5 text-left pl-4 pr-4 bg-white rounded-md font-bold text-sm text-neutral300"
47751
47844
  }, filterDropdown.option), isOpen ? /*#__PURE__*/React__default["default"].createElement(PiCaretUp, null) : /*#__PURE__*/React__default["default"].createElement(PiCaretDown, null), /*#__PURE__*/React__default["default"].createElement("p", {
@@ -48771,6 +48864,7 @@
48771
48864
  exports.EmptyData = EmptyData;
48772
48865
  exports.ExportToExcel = ExportToExcel;
48773
48866
  exports.FilterCheckbox = FilterCheckbox;
48867
+ exports.FilterCheckboxDropdown = FilterCheckboxDropdown;
48774
48868
  exports.FilterDropdown = FilterDropdown;
48775
48869
  exports.FilterText = FilterText;
48776
48870
  exports.Footer = Footer;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "sprint-asia-custom-component",
3
3
  "main": "dist/index.js",
4
- "version": "0.1.135",
4
+ "version": "0.1.137",
5
5
  "private": false,
6
6
  "dependencies": {
7
7
  "@headlessui/react": "^1.7.18",
@@ -0,0 +1,109 @@
1
+ import React, { useState, useEffect, useRef } from 'react';
2
+ import { PiCaretDown, PiCaretUp } from 'react-icons/pi';
3
+
4
+ const FilterCheckboxDropdown = ({
5
+ options = [
6
+ { option: "Option 1", value: "value 1" },
7
+ { option: "Option 2", value: "value 2" },
8
+ { option: "Option 3", value: "value 3" },
9
+ ],
10
+ currentValue = [],
11
+ buttonText = "Filter",
12
+ onSelect
13
+ }) => {
14
+ const [isOpen, setIsOpen] = useState(false);
15
+ const [selectedOptions, setSelectedOptions] = useState([]);
16
+ const dropdownRef = useRef(null);
17
+
18
+ // Inisialisasi selectedOptions dengan currentValue saat pertama kali render
19
+ useEffect(() => {
20
+ setSelectedOptions(currentValue);
21
+ }, [currentValue]);
22
+
23
+ useEffect(() => {
24
+ const handleOutsideClick = (event) => {
25
+ if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
26
+ setIsOpen(false);
27
+ }
28
+ };
29
+
30
+ if (isOpen) {
31
+ document.addEventListener('mousedown', handleOutsideClick);
32
+ }
33
+
34
+ return () => {
35
+ document.removeEventListener('mousedown', handleOutsideClick);
36
+ };
37
+ }, [isOpen]);
38
+
39
+ const handleToggleFilterCheckboxDropdown = () => {
40
+ setIsOpen(!isOpen);
41
+ };
42
+
43
+ const handleOptionClick = (optionValue) => {
44
+ const updatedOptions = selectedOptions.some(option => option.value === optionValue)
45
+ ? selectedOptions.filter((selected) => selected.value !== optionValue)
46
+ : [...selectedOptions, options.find(option => option.value === optionValue)];
47
+
48
+ setSelectedOptions(updatedOptions);
49
+
50
+ // Menampilkan selectedOptions setelah setiap klik
51
+ console.log('Current selected options:', updatedOptions);
52
+
53
+ if (onSelect) {
54
+ onSelect(updatedOptions);
55
+ }
56
+ };
57
+
58
+ return (
59
+ <div className='relative inline-block text-left' ref={dropdownRef}>
60
+ <div>
61
+ <span className='rounded-md shadow-sm'>
62
+ <button
63
+ type='button'
64
+ className="flex items-center w-60 py-2.5 text-left px-4 bg-neutral20 border-neutral50 font-normal text-sm text-neutral300 rounded-md border focus:outline-none"
65
+ onClick={handleToggleFilterCheckboxDropdown}
66
+ >
67
+ <span className='flex-grow'>{buttonText}</span>
68
+ <span className='ml-2'>
69
+ {isOpen ? <PiCaretUp size={16} className='text-neutral300' /> : <PiCaretDown size={16} className='text-neutral300' />}
70
+ </span>
71
+ </button>
72
+ </span>
73
+ </div>
74
+
75
+ {isOpen && (
76
+ <div
77
+ className='z-10 origin-top-right absolute left-0 mt-2 w-60 rounded-md shadow-md bg-white ring-1 ring-black ring-opacity-5 focus:outline-none'
78
+ role='menu'
79
+ aria-orientation='vertical'
80
+ aria-labelledby='options-menu'
81
+ >
82
+ <div className='px-1 py-2'>
83
+ {options.map((val) => (
84
+ <div
85
+ key={val.value}
86
+ className={`hover:bg-neutral20 bg-white py-2.5 px-4 my-0.5 rounded-md flex items-center cursor-pointer ${
87
+ selectedOptions.some(option => option.value === val.value) ? 'bg-primary500' : ''
88
+ }`}
89
+ onClick={() => handleOptionClick(val.value)}
90
+ >
91
+ <input
92
+ type='checkbox'
93
+ className='mr-2'
94
+ checked={selectedOptions.some(option => option.value === val.value)}
95
+ onChange={() => handleOptionClick(val.value)}
96
+ />
97
+ <p className={`text-sm ${selectedOptions.some(option => option.value === val.value) ? 'text-primary500' : 'text-black'}`}>
98
+ {val.option}
99
+ </p>
100
+ </div>
101
+ ))}
102
+ </div>
103
+ </div>
104
+ )}
105
+ </div>
106
+ );
107
+ };
108
+
109
+ export default FilterCheckboxDropdown;
@@ -41,7 +41,7 @@ const SearchDropdown = ({
41
41
  } relative cursor-pointer border-t border-b border-l rounded-tl-md rounded-bl-md`}
42
42
  onClick={() => setIsOpen(!isOpen)}
43
43
  >
44
- <div className="flex items-center bg-white rounded-tl-md rounded-bl-md min-w-36">
44
+ <div className="flex items-center bg-white rounded-tl-md rounded-bl-md" style={{minWidth:"144px"}}>
45
45
  <p className="flex items-center w-full py-2.5 text-left pl-4 pr-4 bg-white rounded-md font-bold text-sm text-neutral300">
46
46
  {filterDropdown.option}
47
47
  </p>
@@ -7,6 +7,7 @@ const Pagination = ({
7
7
  totalCount = 0,
8
8
  currentPage = 1,
9
9
  totalPage = 10,
10
+ isLoading = false,
10
11
  onChangePages
11
12
  }) => {
12
13
  const pageNumbers = Array.from({ length: totalPage }, (_, index) => index + 1);
@@ -20,25 +21,25 @@ const Pagination = ({
20
21
  <div className='flex justify-between items-center'>
21
22
  <div>
22
23
  <p className='text-sm text-black font-normal p-4'>
23
- From {firstData || 0} to {lastData || 0} of total : {totalCount || 0}
24
+ From {isLoading ? 0 : firstData || 0} to {isLoading ? 0 : lastData || 0} of total : {isLoading ? 0 : totalCount || 0}
24
25
  </p>
25
26
  </div>
26
27
  <div className='flex px-4 py-2'>
27
28
  <div
28
29
  className={`m-1 w-10 h-10 rounded-full ${
29
- (currentPage === 1 || firstData === 0 || lastData === 0 || totalCount === 0 || !firstData || !lastData || !totalCount)
30
+ (currentPage === 1 || firstData === 0 || lastData === 0 || totalCount === 0 || !firstData || !lastData || !totalCount || isLoading)
30
31
  ? 'bg-neutral20 cursor-default'
31
32
  : 'bg-white cursor-pointer border border-neutral40'
32
33
  } flex items-center justify-center`}
33
34
  onClick={() => {
34
- if (currentPage !== 1 || firstData > 0 || lastData > 0 || totalCount > 0) {
35
+ if (currentPage !== 1 && !isLoading) {
35
36
  handleChangePages(currentPage - 1);
36
37
  }
37
38
  }}
38
39
  >
39
40
  <PiCaretLeft size={16} className='text-neutral300' />
40
41
  </div>
41
- {totalPage < 4 ?
42
+ {totalPage < 4 && !isLoading ?
42
43
  pageNumbers.map((pageNumber) => (
43
44
  <div
44
45
  key={pageNumber}
@@ -55,7 +56,7 @@ const Pagination = ({
55
56
  :
56
57
  <>
57
58
  {
58
- currentPage == 1 && (
59
+ currentPage == 1 && !isLoading && (
59
60
  <>
60
61
  <div
61
62
  key={currentPage}
@@ -88,7 +89,7 @@ const Pagination = ({
88
89
  )
89
90
  }
90
91
  {
91
- (currentPage > 1 && currentPage != totalPage - 1 && currentPage != totalPage) && (
92
+ (currentPage > 1 && currentPage != totalPage - 1 && currentPage != totalPage) && !isLoading && (
92
93
  <>
93
94
  <div
94
95
  key={currentPage - 1}
@@ -121,7 +122,7 @@ const Pagination = ({
121
122
  )
122
123
  }
123
124
  {
124
- (currentPage == totalPage - 1) && (
125
+ (currentPage == totalPage - 1) && !isLoading && (
125
126
  <>
126
127
  <div
127
128
  key={totalPage - 2}
@@ -154,7 +155,7 @@ const Pagination = ({
154
155
  )
155
156
  }
156
157
  {
157
- (currentPage == totalPage) && (
158
+ (currentPage == totalPage) && !isLoading && (
158
159
  <>
159
160
  <div
160
161
  key={totalPage - 2}
@@ -190,12 +191,12 @@ const Pagination = ({
190
191
  }
191
192
  <div
192
193
  className={`m-1 w-10 h-10 rounded-full ${
193
- (currentPage === totalPage || firstData === 0 || lastData === 0 || totalCount === 0 || !firstData || !lastData || !totalCount)
194
+ (currentPage === totalPage || firstData === 0 || lastData === 0 || totalCount === 0 || !firstData || !lastData || !totalCount || isLoading)
194
195
  ? 'bg-neutral20 cursor-default'
195
196
  : 'bg-white cursor-pointer border border-neutral40'
196
197
  } flex items-center justify-center`}
197
198
  onClick={() => {
198
- if (currentPage !== totalPage || firstData > 0 || lastData > 0 || totalCount > 0) {
199
+ if (currentPage !== totalPage && firstData > 0 && lastData > 0 && totalCount > 0 && !isLoading) {
199
200
  handleChangePages(currentPage + 1)
200
201
  }
201
202
  }}
package/src/index.js CHANGED
@@ -48,6 +48,7 @@ import EmptyData from "./components/emptystate/table/emptydata";
48
48
  import NotFound from "./components/emptystate/table/notfound";
49
49
  import ExportToExcel from "./components/export/excel";
50
50
  import FilterCheckbox from "./components/filter/filterCheckbox";
51
+ import FilterCheckboxDropdown from "./components/filter/filterCheckboxDropdown";
51
52
  import FilterText from "./components/filter/filterText";
52
53
  import Menu from "./components/menu";
53
54
  import ModalLoading from "./components/modal/modalLoading";
@@ -123,6 +124,7 @@ export {
123
124
  Menu,
124
125
  FilterText,
125
126
  FilterCheckbox,
127
+ FilterCheckboxDropdown,
126
128
  ExportToExcel,
127
129
  NotFound,
128
130
  EmptyData,
@@ -61,6 +61,7 @@ import CellModelSix from "../components/table/listTable/cellmodesix";
61
61
  import CellModelSeven from "../components/table/listTable/cellmodelseven";
62
62
  import CustomPhone from "../components/customphone";
63
63
  import DescriptionFile from "../components/description/file";
64
+ import FilterCheckboxDropdown from "../components/filter/filterCheckboxDropdown";
64
65
 
65
66
  const Templates = () => {
66
67
  const [startDate, setStartDate] = useState(null);
@@ -828,6 +829,7 @@ const Templates = () => {
828
829
  });
829
830
 
830
831
  const [searchFilter, setSearchFilter] = useState();
832
+ const [valueSelectFilter, setValueSelectFilter] = useState([]);
831
833
  const [filterDropdown, setFilterDropdown] = useState({
832
834
  option: "duar",
833
835
  value: "dfdsf",
@@ -1171,6 +1173,27 @@ const Templates = () => {
1171
1173
  <div className="m-9"></div>
1172
1174
  <FilterText options={["Option 1", "Option 2", "Option 3"]} onSelect={handleSelect} />
1173
1175
 
1176
+ <div className="m-9"></div>
1177
+ <FilterCheckboxDropdown
1178
+ options={[
1179
+ {
1180
+ option : "Option1",
1181
+ value : "value 1"
1182
+ },
1183
+ {
1184
+ option : "Option2",
1185
+ value : "value 2"
1186
+ },
1187
+ ]}
1188
+ buttonText="Division"
1189
+ currentValue={valueSelectFilter}
1190
+ onSelect={setValueSelectFilter}
1191
+ />
1192
+
1193
+ {
1194
+ console.log("ini value select", valueSelectFilter)
1195
+ }
1196
+
1174
1197
  <div className="m-9"></div>
1175
1198
  <FilterDropdown
1176
1199
  options={[
@@ -1523,6 +1546,23 @@ const Templates = () => {
1523
1546
  totalPage={null}
1524
1547
  onChangePages={(page) => setCurrentPage(page)}
1525
1548
  />
1549
+ <Pagination
1550
+ firstData={0}
1551
+ lastData={0}
1552
+ totalCount={0}
1553
+ currentPage={1}
1554
+ totalPage={0}
1555
+ onChangePages={(page) => setCurrentPage(page)}
1556
+ />
1557
+ <Pagination
1558
+ firstData={(currentPage - 1) * 10 + 1}
1559
+ lastData={currentPage * 10 > totalCount ? totalCount : currentPage * 10}
1560
+ totalCount={totalCount}
1561
+ currentPage={currentPage}
1562
+ totalPage={totalPage}
1563
+ isLoading
1564
+ onChangePages={(page) => setCurrentPage(page)}
1565
+ />
1526
1566
 
1527
1567
  <div className="m-9"></div>
1528
1568
  <p className="text-black font-bold text-2xl text-center py-2">Text Input</p>