@qore-project/urshipper-custom-table-component
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -88,2 +88,14 @@ import { __awaiter, __rest } from "tslib"; | ||
}), [selectedRow, userId]); | ||
const client = props.hooks.useClient(); | ||
const triggerDenoAction = () => __awaiter(this, void 0, void 0, function* () { | ||
const server = `https://staging-qore-data-apple-202883.qore.dev`; | ||
const actionResponse = yield client.project.axios.post(`${server}/v1/action/api_crendential/get_rate/1`, { args: { userId: 'albar@feedloop.io', shipment: selectedRow } }, { | ||
headers: { | ||
authority: 'staging-qore-data-apple-202883.qore.dev', | ||
'x-qore-engine-admin-secret': 'LPUFvfGKE6KscQt5DAYb2AtqZiUjm76Z', | ||
}, | ||
}); | ||
console.log(actionResponse); | ||
return actionResponse.data; | ||
}); | ||
const handleClickActionOne = (item) => { | ||
@@ -93,2 +105,3 @@ console.log({ item }); | ||
actionOne.handleClick(); | ||
return; | ||
}; | ||
@@ -99,10 +112,14 @@ const handleClickActionTwo = (item) => { | ||
actionTwo.handleClick(); | ||
return; | ||
}; | ||
return (_jsxs(_Fragment, { children: [_jsx(ActionModal, { isOpen: isOpen, onClose: onClose, rowData: selectedRow }), _jsx(Flex, Object.assign({ w: "100%" }, { children: _jsxs(HStack, Object.assign({ alignItems: 'center', w: "xs" }, { children: [_jsx(IconButton, { colorScheme: "blue", "aria-label": "Search database", icon: _jsx(BiPlus, {}) }), _jsx(Input, { type: "text", onChange: handleFilterInputChange, placeholder: "Search here.." })] })) })), _jsx(TableContainer, Object.assign({ p: "5" }, { children: _jsxs(Table, Object.assign({}, getTableProps(), { children: [_jsx(Thead, { children: headerGroups.map((headerGroup, index) => (_jsxs(Tr, Object.assign({}, headerGroup.getHeaderGroupProps(), { children: [index == 0 && _jsx(Th, { children: "action" }), headerGroup.headers.map((column) => (_jsxs(Th, Object.assign({ textTransform: 'capitalize' }, column.getHeaderProps(column.getSortByToggleProps()), { children: [column.render('Header'), _jsx(chakra.span, Object.assign({ pl: "4" }, { children: column.isSorted ? (column.isSortedDesc ? (_jsx(Icon, { as: iconsList['ArrowUp'], "aria-label": "sorted descending" })) : (_jsx(Icon, { as: iconsList['ArrowDown'], "aria-label": "sorted ascending" }))) : null }))] }))))] })))) }), _jsx(Tbody, Object.assign({}, getTableBodyProps(), { children: rows.slice(0, 10).map((row, i) => { | ||
const handleCreateSingleInvoice = (data) => { | ||
return data; | ||
}; | ||
return (_jsxs(_Fragment, { children: [_jsx(ActionModal, { isOpen: isOpen, onClose: onClose, rowData: selectedRow }), _jsx(Flex, Object.assign({ w: "100%" }, { children: _jsxs(HStack, Object.assign({ alignItems: 'center', w: "xs" }, { children: [_jsx(IconButton, { onClick: handleClickActionTwo, colorScheme: "blue", "aria-label": "Search database", icon: _jsx(BiPlus, {}) }), _jsx(Input, { type: "text", onChange: handleFilterInputChange, placeholder: "Search here.." })] })) })), _jsx(TableContainer, Object.assign({ p: "5" }, { children: _jsxs(Table, Object.assign({}, getTableProps(), { children: [_jsx(Thead, { children: headerGroups.map((headerGroup, index) => (_jsxs(Tr, Object.assign({}, headerGroup.getHeaderGroupProps(), { children: [index == 0 && _jsx(Th, { children: "action" }), headerGroup.headers.map((column) => (_jsxs(Th, Object.assign({ textTransform: 'capitalize' }, column.getHeaderProps(column.getSortByToggleProps()), { children: [column.render('Header'), _jsx(chakra.span, Object.assign({ pl: "4" }, { children: column.isSorted ? (column.isSortedDesc ? (_jsx(Icon, { as: iconsList['ArrowUp'], "aria-label": "sorted descending" })) : (_jsx(Icon, { as: iconsList['ArrowDown'], "aria-label": "sorted ascending" }))) : null }))] }))))] })))) }), _jsx(Tbody, Object.assign({}, getTableBodyProps(), { children: rows.slice(0, 10).map((row, i) => { | ||
prepareRow(row); | ||
return (_jsxs(Tr, Object.assign({}, row.getRowProps(), { children: [_jsx(Td, Object.assign({ p: "12px", maxW: "30px", textAlign: "center", className: "user-action-wrapper" }, { children: _jsxs(Popover, Object.assign({ placement: "top" }, { children: [_jsx(PopoverTrigger, { children: _jsx(IconButton, { minW: "24px", h: "24px", border: "1px", borderColor: "#E9E9E9", variant: "ghost", "aria-label": "open menu", _focus: { outline: 'none' }, icon: _jsx(BiDotsHorizontal, { width: "10px" }) }) }), _jsx(Portal, { children: _jsx(PopoverContent, Object.assign({ maxW: "170px", _focus: { outline: 'none' } }, { children: _jsx(PopoverBody, Object.assign({ p: "0" }, { children: _jsxs(Stack, Object.assign({ direction: "column", spacing: 0 }, { children: [_jsx(Button, Object.assign({ onClick: () => handleClickActionOne(row.values), leftIcon: _jsx(BiEditAlt, { color: "rgba(162, 162, 162, 1)", fontSize: "16px" }), _hover: { | ||
backgroundColor: 'rgba(249, 247, 242, 1)', | ||
}, color: "rgba(69, 69, 69, 1)", fontSize: "14px", fontWeight: "400", p: "16px", w: "100%", justifyContent: "flex-start", variant: "ghost" }, { children: "Edit" })), _jsx(Button, Object.assign({ onClick: () => handleClickActionTwo(row.values), leftIcon: _jsx(FaPrint, { color: "rgba(162, 162, 162, 1)", fontSize: "16px" }), _hover: { | ||
}, color: "rgba(69, 69, 69, 1)", fontSize: "14px", fontWeight: "400", p: "16px", w: "100%", justifyContent: "flex-start", variant: "ghost" }, { children: "Edit" })), _jsx(Button, Object.assign({ onClick: () => handleCreateSingleInvoice(row.values), leftIcon: _jsx(FaPrint, { color: "rgba(162, 162, 162, 1)", fontSize: "16px" }), _hover: { | ||
backgroundColor: 'rgba(249, 247, 242, 1)', | ||
}, color: "rgba(69, 69, 69, 1)", fontSize: "14px", fontWeight: "400", p: "16px", w: "100%", justifyContent: "flex-start", variant: "ghost" }, { children: "Print Label" })), type == 'admin' && (_jsx(Button, Object.assign({ onClick: handleCreateInvoice, leftIcon: _jsx(FaFileInvoice, { color: "rgba(162, 162, 162, 1)", fontSize: "16px" }), _hover: { | ||
}, color: "rgba(69, 69, 69, 1)", fontSize: "14px", fontWeight: "400", p: "16px", w: "100%", justifyContent: "flex-start", variant: "ghost" }, { children: "Print Label" })), type == 'admin' && (_jsx(Button, Object.assign({ onClick: triggerDenoAction, leftIcon: _jsx(FaFileInvoice, { color: "rgba(162, 162, 162, 1)", fontSize: "16px" }), _hover: { | ||
backgroundColor: 'rgba(249, 247, 242, 1)', | ||
@@ -109,0 +126,0 @@ }, color: "rgba(69, 69, 69, 1)", fontSize: "14px", fontWeight: "400", p: "16px", w: "100%", justifyContent: "flex-start", variant: "ghost" }, { children: "Create Inovice" })))] })) })) })) })] })) })), row.cells.map((cell) => { |
{ | ||
"name": "@qore-project/urshipper-custom-table-component", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"module": "lib/urshipper-custom-table.js", | ||
@@ -5,0 +5,0 @@ "type": "module", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
792292
17204