sprint-asia-custom-component 0.1.133 → 0.1.135
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 +29 -16
- package/package.json +1 -1
- package/src/components/description/file/index.js +5 -10
- package/src/components/filter/filterDropdown/index.js +19 -1
- package/src/components/searchdropdown/index.js +1 -1
- package/src/components/table/pagination/index.js +5 -5
- package/src/templates/index.js +59 -0
package/dist/index.js
CHANGED
|
@@ -23905,14 +23905,11 @@
|
|
|
23905
23905
|
|
|
23906
23906
|
const DescriptionFile = ({
|
|
23907
23907
|
title = "Title",
|
|
23908
|
-
link
|
|
23908
|
+
link,
|
|
23909
|
+
fileName
|
|
23909
23910
|
}) => {
|
|
23910
|
-
const
|
|
23911
|
-
const
|
|
23912
|
-
return match ? match.toLowerCase() : "file";
|
|
23913
|
-
};
|
|
23914
|
-
const fileExtension = getFileExtension(link);
|
|
23915
|
-
const getFileIcon = ext => {
|
|
23911
|
+
const getFileIcon = fileName => {
|
|
23912
|
+
const ext = fileName.split(".").pop().toLowerCase();
|
|
23916
23913
|
switch (ext) {
|
|
23917
23914
|
case "pdf":
|
|
23918
23915
|
return /*#__PURE__*/React__default["default"].createElement(PiFilePdf, {
|
|
@@ -23939,12 +23936,12 @@
|
|
|
23939
23936
|
className: "text-sm font-normal text-black mb-1 py-2"
|
|
23940
23937
|
}, title), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
23941
23938
|
className: "flex items-center cursor-pointer"
|
|
23942
|
-
}, /*#__PURE__*/React__default["default"].createElement("div", null, getFileIcon(
|
|
23939
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", null, getFileIcon(fileName || title)), /*#__PURE__*/React__default["default"].createElement("a", {
|
|
23943
23940
|
className: "text-md font-semibold text-base ml-1",
|
|
23944
23941
|
href: link || "#",
|
|
23945
23942
|
target: "_blank",
|
|
23946
23943
|
rel: "noopener noreferrer"
|
|
23947
|
-
},
|
|
23944
|
+
}, fileName || title)));
|
|
23948
23945
|
};
|
|
23949
23946
|
|
|
23950
23947
|
const DropdownCard = ({
|
|
@@ -45439,12 +45436,12 @@
|
|
|
45439
45436
|
className: "flex justify-between items-center"
|
|
45440
45437
|
}, /*#__PURE__*/React__default["default"].createElement("div", null, /*#__PURE__*/React__default["default"].createElement("p", {
|
|
45441
45438
|
className: "text-sm text-black font-normal p-4"
|
|
45442
|
-
}, "From ", firstData, " to ", lastData, " of total : ", totalCount)), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
45439
|
+
}, "From ", firstData || 0, " to ", lastData || 0, " of total : ", totalCount || 0)), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
45443
45440
|
className: "flex px-4 py-2"
|
|
45444
45441
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
45445
|
-
className: `m-1 w-10 h-10 rounded-full ${currentPage === 1 ? 'bg-neutral20 cursor-default' : 'bg-white cursor-pointer border border-neutral40'} flex items-center justify-center`,
|
|
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`,
|
|
45446
45443
|
onClick: () => {
|
|
45447
|
-
if (currentPage !== 1) {
|
|
45444
|
+
if (currentPage !== 1 || firstData > 0 || lastData > 0 || totalCount > 0) {
|
|
45448
45445
|
handleChangePages(currentPage - 1);
|
|
45449
45446
|
}
|
|
45450
45447
|
}
|
|
@@ -45516,9 +45513,9 @@
|
|
|
45516
45513
|
className: "m-1 w-10 h-10 rounded-full bg-primary500 text-white cursor-pointer flex items-center justify-center font-semibold",
|
|
45517
45514
|
onClick: () => handleChangePages(currentPage)
|
|
45518
45515
|
}, /*#__PURE__*/React__default["default"].createElement("p", null, currentPage)))), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
45519
|
-
className: `m-1 w-10 h-10 rounded-full ${currentPage === totalPage ? 'bg-neutral20 cursor-default' : 'bg-white cursor-pointer border border-neutral40'} flex items-center justify-center`,
|
|
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`,
|
|
45520
45517
|
onClick: () => {
|
|
45521
|
-
if (currentPage !== totalPage) {
|
|
45518
|
+
if (currentPage !== totalPage || firstData > 0 || lastData > 0 || totalCount > 0) {
|
|
45522
45519
|
handleChangePages(currentPage + 1);
|
|
45523
45520
|
}
|
|
45524
45521
|
}
|
|
@@ -47748,7 +47745,7 @@
|
|
|
47748
47745
|
className: `${input ? "border-black" : "border-neutral50"} relative cursor-pointer border-t border-b border-l rounded-tl-md rounded-bl-md`,
|
|
47749
47746
|
onClick: () => setIsOpen(!isOpen)
|
|
47750
47747
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
47751
|
-
className: "flex items-center bg-white rounded-tl-md rounded-bl-md"
|
|
47748
|
+
className: "flex items-center bg-white rounded-tl-md rounded-bl-md min-w-36"
|
|
47752
47749
|
}, /*#__PURE__*/React__default["default"].createElement("p", {
|
|
47753
47750
|
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"
|
|
47754
47751
|
}, filterDropdown.option), isOpen ? /*#__PURE__*/React__default["default"].createElement(PiCaretUp, null) : /*#__PURE__*/React__default["default"].createElement(PiCaretDown, null), /*#__PURE__*/React__default["default"].createElement("p", {
|
|
@@ -47810,6 +47807,22 @@
|
|
|
47810
47807
|
value: "payment1"
|
|
47811
47808
|
}],
|
|
47812
47809
|
type: "checkbox"
|
|
47810
|
+
}, {
|
|
47811
|
+
menu: "Payment 2",
|
|
47812
|
+
parameter: "payment 2",
|
|
47813
|
+
submenu: [{
|
|
47814
|
+
option: "Payment 2",
|
|
47815
|
+
value: "payment2"
|
|
47816
|
+
}],
|
|
47817
|
+
type: "checkbox"
|
|
47818
|
+
}, {
|
|
47819
|
+
menu: "Payment 3",
|
|
47820
|
+
parameter: "payment 3",
|
|
47821
|
+
submenu: [{
|
|
47822
|
+
option: "Payment 3",
|
|
47823
|
+
value: "payment3"
|
|
47824
|
+
}],
|
|
47825
|
+
type: "checkbox"
|
|
47813
47826
|
}],
|
|
47814
47827
|
dataFilterResult,
|
|
47815
47828
|
setDataFilterResult = () => {}
|
|
@@ -47913,7 +47926,7 @@
|
|
|
47913
47926
|
fontSize: "8px"
|
|
47914
47927
|
}
|
|
47915
47928
|
}, dataFilterResult[option.parameter]?.length || 0))), showFilterSubmenu && option.submenu.length > 0 && dataSelectionOptionMenu === option.menu && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
47916
|
-
className: `ml-1 border border-neutral40 bg-white p-3 shadow-md rounded-md w-56 absolute left-48 cursor-pointer ${index == 0 && "top-0"} ${index == 1 && "top-16"} ${index == 2 && "top-24"} ${index == 3 && "top-36"}`
|
|
47929
|
+
className: `ml-1 border border-neutral40 bg-white p-3 shadow-md rounded-md w-56 absolute left-48 cursor-pointer ${index == 0 && "top-0"} ${index == 1 && "top-16"} ${index == 2 && "top-24"} ${index == 3 && "top-36"} ${index == 4 && "top-48"}`
|
|
47917
47930
|
}, option.submenu.map((submenu, subIndex) => /*#__PURE__*/React__default["default"].createElement("div", {
|
|
47918
47931
|
key: subIndex,
|
|
47919
47932
|
className: "flex bg-white hover:bg-neutral20 rounded-md py-2.5 px-4 my-0.5",
|
package/package.json
CHANGED
|
@@ -3,15 +3,10 @@ import { PiFilePdf } from "react-icons/pi";
|
|
|
3
3
|
import { FaFileImage } from "react-icons/fa";
|
|
4
4
|
import { FaFileAlt } from "react-icons/fa";
|
|
5
5
|
|
|
6
|
-
const DescriptionFile = ({ title = "Title", link }) => {
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
return match ? match.toLowerCase() : "file";
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
const fileExtension = getFileExtension(link);
|
|
6
|
+
const DescriptionFile = ({ title = "Title", link, fileName }) => {
|
|
7
|
+
const getFileIcon = (fileName) => {
|
|
8
|
+
const ext = fileName.split(".").pop().toLowerCase();
|
|
13
9
|
|
|
14
|
-
const getFileIcon = (ext) => {
|
|
15
10
|
switch (ext) {
|
|
16
11
|
case "pdf":
|
|
17
12
|
return <PiFilePdf className="text-black" size={16} />;
|
|
@@ -28,14 +23,14 @@ const DescriptionFile = ({ title = "Title", link }) => {
|
|
|
28
23
|
<div className="w-full">
|
|
29
24
|
{title && <p className="text-sm font-normal text-black mb-1 py-2">{title}</p>}
|
|
30
25
|
<div className="flex items-center cursor-pointer">
|
|
31
|
-
<div>{getFileIcon(
|
|
26
|
+
<div>{getFileIcon(fileName || title)}</div>
|
|
32
27
|
<a
|
|
33
28
|
className="text-md font-semibold text-base ml-1"
|
|
34
29
|
href={link || "#"}
|
|
35
30
|
target="_blank"
|
|
36
31
|
rel="noopener noreferrer"
|
|
37
32
|
>
|
|
38
|
-
{
|
|
33
|
+
{fileName || title}
|
|
39
34
|
</a>
|
|
40
35
|
</div>
|
|
41
36
|
</div>
|
|
@@ -30,6 +30,24 @@ const FilterDropdown = ({
|
|
|
30
30
|
}],
|
|
31
31
|
type:"checkbox"
|
|
32
32
|
},
|
|
33
|
+
{
|
|
34
|
+
menu:"Payment 2",
|
|
35
|
+
parameter : "payment 2",
|
|
36
|
+
submenu:[{
|
|
37
|
+
option : "Payment 2",
|
|
38
|
+
value : "payment2"
|
|
39
|
+
}],
|
|
40
|
+
type:"checkbox"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
menu:"Payment 3",
|
|
44
|
+
parameter : "payment 3",
|
|
45
|
+
submenu:[{
|
|
46
|
+
option : "Payment 3",
|
|
47
|
+
value : "payment3"
|
|
48
|
+
}],
|
|
49
|
+
type:"checkbox"
|
|
50
|
+
},
|
|
33
51
|
],
|
|
34
52
|
dataFilterResult,
|
|
35
53
|
setDataFilterResult = () => {},
|
|
@@ -157,7 +175,7 @@ const FilterDropdown = ({
|
|
|
157
175
|
</div>
|
|
158
176
|
{
|
|
159
177
|
showFilterSubmenu && option.submenu.length > 0 && dataSelectionOptionMenu === option.menu &&
|
|
160
|
-
<div className={`ml-1 border border-neutral40 bg-white p-3 shadow-md rounded-md w-56 absolute left-48 cursor-pointer ${index == 0 && "top-0"} ${index == 1 && "top-16"} ${index == 2 && "top-24"} ${index == 3 && "top-36"}`}>
|
|
178
|
+
<div className={`ml-1 border border-neutral40 bg-white p-3 shadow-md rounded-md w-56 absolute left-48 cursor-pointer ${index == 0 && "top-0"} ${index == 1 && "top-16"} ${index == 2 && "top-24"} ${index == 3 && "top-36"} ${index == 4 && "top-48"}`}>
|
|
161
179
|
{
|
|
162
180
|
option.submenu.map((submenu, subIndex) => (
|
|
163
181
|
<div key={subIndex} className='flex bg-white hover:bg-neutral20 rounded-md py-2.5 px-4 my-0.5'
|
|
@@ -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">
|
|
44
|
+
<div className="flex items-center bg-white rounded-tl-md rounded-bl-md min-w-36">
|
|
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>
|
|
@@ -20,18 +20,18 @@ const Pagination = ({
|
|
|
20
20
|
<div className='flex justify-between items-center'>
|
|
21
21
|
<div>
|
|
22
22
|
<p className='text-sm text-black font-normal p-4'>
|
|
23
|
-
From {firstData} to {lastData} of total : {totalCount}
|
|
23
|
+
From {firstData || 0} to {lastData || 0} of total : {totalCount || 0}
|
|
24
24
|
</p>
|
|
25
25
|
</div>
|
|
26
26
|
<div className='flex px-4 py-2'>
|
|
27
27
|
<div
|
|
28
28
|
className={`m-1 w-10 h-10 rounded-full ${
|
|
29
|
-
currentPage === 1
|
|
29
|
+
(currentPage === 1 || firstData === 0 || lastData === 0 || totalCount === 0 || !firstData || !lastData || !totalCount)
|
|
30
30
|
? 'bg-neutral20 cursor-default'
|
|
31
31
|
: 'bg-white cursor-pointer border border-neutral40'
|
|
32
32
|
} flex items-center justify-center`}
|
|
33
33
|
onClick={() => {
|
|
34
|
-
if (currentPage !== 1) {
|
|
34
|
+
if (currentPage !== 1 || firstData > 0 || lastData > 0 || totalCount > 0) {
|
|
35
35
|
handleChangePages(currentPage - 1);
|
|
36
36
|
}
|
|
37
37
|
}}
|
|
@@ -190,12 +190,12 @@ const Pagination = ({
|
|
|
190
190
|
}
|
|
191
191
|
<div
|
|
192
192
|
className={`m-1 w-10 h-10 rounded-full ${
|
|
193
|
-
currentPage === totalPage
|
|
193
|
+
(currentPage === totalPage || firstData === 0 || lastData === 0 || totalCount === 0 || !firstData || !lastData || !totalCount)
|
|
194
194
|
? 'bg-neutral20 cursor-default'
|
|
195
195
|
: 'bg-white cursor-pointer border border-neutral40'
|
|
196
196
|
} flex items-center justify-center`}
|
|
197
197
|
onClick={() => {
|
|
198
|
-
if (currentPage !== totalPage) {
|
|
198
|
+
if (currentPage !== totalPage || firstData > 0 || lastData > 0 || totalCount > 0) {
|
|
199
199
|
handleChangePages(currentPage + 1)
|
|
200
200
|
}
|
|
201
201
|
}}
|
package/src/templates/index.js
CHANGED
|
@@ -60,6 +60,7 @@ import CellModelFive from "../components/table/listTable/cellmodefive";
|
|
|
60
60
|
import CellModelSix from "../components/table/listTable/cellmodesix";
|
|
61
61
|
import CellModelSeven from "../components/table/listTable/cellmodelseven";
|
|
62
62
|
import CustomPhone from "../components/customphone";
|
|
63
|
+
import DescriptionFile from "../components/description/file";
|
|
63
64
|
|
|
64
65
|
const Templates = () => {
|
|
65
66
|
const [startDate, setStartDate] = useState(null);
|
|
@@ -838,6 +839,14 @@ const Templates = () => {
|
|
|
838
839
|
|
|
839
840
|
return (
|
|
840
841
|
<div>
|
|
842
|
+
<DescriptionFile
|
|
843
|
+
title="Project Brief"
|
|
844
|
+
link={
|
|
845
|
+
"http://192.168.4.224:8080/api/division/files/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjbGllbnRJZCI6IjlhOGM4ZTU1LWM3YzctNDEwZS1iNzYwLTVlZWI4NmI4YzVkMyIsImNsaWVudE5hbWUiOiJNYXN0ZXIgQ2xpZW50IiwiZGl2aXNpb25JZCI6IjljMmM2Y2NiLWZlZGUtNDJmZi1hMzc1LTE0ZWNjOTY5OWExMSIsImRpdmlzaW9uTmFtZSI6Ik1hc3RlciBEaXZpc2lvbiIsImV4cCI6MTczNjI2MzI2NSwicm9sZUlkIjoiMTk5ZWMxODItZjBjMy0xMWVlLTkzMzYtZGMxYmExNGE1YmY5IiwidXNlcklkIjoiNjlkNTUwNTUtYmY5NS00YjBkLWJkZWMtYjY1YTI0MWFiNjRmIiwidXNlck5hbWUiOiJoYW5keSBudWdyYWhhIn0.bfqIMzp-htu0-CWDRakgOem-c9Hn_2u6MfqgEMCPq54/61820a4c-f102-4dc1-a8bc-6c2956a333a5.pdf"
|
|
846
|
+
}
|
|
847
|
+
fileName="61820a4c-f102-4dc1-a8bc-6c2956a333a5.pdf"
|
|
848
|
+
/>
|
|
849
|
+
|
|
841
850
|
<div>
|
|
842
851
|
{/* <OutlineButton title="Test" /> */}
|
|
843
852
|
<Header title="Navbar" roleName="System Administrators" dataBalance={10000} />
|
|
@@ -1211,6 +1220,40 @@ const Templates = () => {
|
|
|
1211
1220
|
option: "Payment 1",
|
|
1212
1221
|
value: "payment1",
|
|
1213
1222
|
},
|
|
1223
|
+
{
|
|
1224
|
+
option: "Payment 1",
|
|
1225
|
+
value: "payment1",
|
|
1226
|
+
},
|
|
1227
|
+
],
|
|
1228
|
+
type: "radiobutton",
|
|
1229
|
+
},
|
|
1230
|
+
{
|
|
1231
|
+
menu: "Payment 2",
|
|
1232
|
+
parameter: "payment2",
|
|
1233
|
+
submenu: [
|
|
1234
|
+
{
|
|
1235
|
+
option: "Payment 1",
|
|
1236
|
+
value: "payment1",
|
|
1237
|
+
},
|
|
1238
|
+
{
|
|
1239
|
+
option: "Payment 1",
|
|
1240
|
+
value: "payment1",
|
|
1241
|
+
},
|
|
1242
|
+
],
|
|
1243
|
+
type: "radiobutton",
|
|
1244
|
+
},
|
|
1245
|
+
{
|
|
1246
|
+
menu: "Payment 3",
|
|
1247
|
+
parameter: "payment3",
|
|
1248
|
+
submenu: [
|
|
1249
|
+
{
|
|
1250
|
+
option: "Payment 1",
|
|
1251
|
+
value: "payment1",
|
|
1252
|
+
},
|
|
1253
|
+
{
|
|
1254
|
+
option: "Payment 1",
|
|
1255
|
+
value: "payment1",
|
|
1256
|
+
},
|
|
1214
1257
|
],
|
|
1215
1258
|
type: "radiobutton",
|
|
1216
1259
|
},
|
|
@@ -1296,6 +1339,14 @@ const Templates = () => {
|
|
|
1296
1339
|
option: "Name 2",
|
|
1297
1340
|
value: "Value 2",
|
|
1298
1341
|
},
|
|
1342
|
+
{
|
|
1343
|
+
option: "Ref id",
|
|
1344
|
+
value: "Value 2",
|
|
1345
|
+
},
|
|
1346
|
+
{
|
|
1347
|
+
option: "Voucher Statusssssssss",
|
|
1348
|
+
value: "Value 2",
|
|
1349
|
+
},
|
|
1299
1350
|
]}
|
|
1300
1351
|
placeholderSearch="Search Here..."
|
|
1301
1352
|
filterDropdown={filterDropdown}
|
|
@@ -1464,6 +1515,14 @@ const Templates = () => {
|
|
|
1464
1515
|
totalPage={totalPage}
|
|
1465
1516
|
onChangePages={(page) => setCurrentPage(page)}
|
|
1466
1517
|
/>
|
|
1518
|
+
<Pagination
|
|
1519
|
+
firstData={null}
|
|
1520
|
+
lastData={null}
|
|
1521
|
+
totalCount={null}
|
|
1522
|
+
currentPage={1}
|
|
1523
|
+
totalPage={null}
|
|
1524
|
+
onChangePages={(page) => setCurrentPage(page)}
|
|
1525
|
+
/>
|
|
1467
1526
|
|
|
1468
1527
|
<div className="m-9"></div>
|
|
1469
1528
|
<p className="text-black font-bold text-2xl text-center py-2">Text Input</p>
|