eleven-solutions-common-website-unique-web 7.0.5 → 7.0.7
Sign up to get free protection for your applications and to get access to all the features.
@@ -327,13 +327,13 @@ const TaxonomyForm = () => {
|
|
327
327
|
}, className: "px-8 py-2.5 leading-5 text-white transition-colors duration-300 transform bg-blue-600 rounded-md hover:bg-blue-500 focus:outline-none focus:bg-gray-600", children: "Delete" })) })) }), _jsxs("div", { className: "flex space-x-4 justify-end", children: [similarTaxonomies.some((taxonomy) => taxonomy.isEdit) && (_jsx("button", { type: "submit", onClick: handleSave, className: "px-8 py-2.5 leading-5 text-white transition-colors duration-300 transform bg-blue-600 rounded-md hover:bg-blue-500 focus:outline-none focus:bg-gray-600", children: isEditMode ? "Save" : "Add" })), !similarTaxonomies.some((taxonomy) => taxonomy.isEdit) &&
|
328
328
|
!isEditMode && (_jsx("button", { type: "submit", onClick: handleSave, className: "px-8 py-2.5 leading-5 text-white transition-colors duration-300 transform bg-blue-600 rounded-md hover:bg-blue-500 focus:outline-none focus:bg-gray-600", children: isEditMode ? "Save" : "Add" })), _jsx("button", { onClick: handleCancelClick, type: "button", className: "px-8 py-2.5 leading-5 text-white transition-colors duration-300 transform bg-blue-600 rounded-md hover:bg-blue-500 focus:outline-none focus:bg-gray-600", children: "Cancel" })] })] })] })), isSimilarTaxonomyOpen && isMultiple && isEditMode && (_jsxs("div", { className: "flex-grow ml-0 mt-4 w-full", children: [_jsx("div", { className: "overflow-hidden border border-gray-200 dark:border-gray-700 md:rounded-lg mt-6", children: _jsxs("table", { className: "min-w-full divide-y divide-gray-200 dark:divide-gray-700", children: [_jsx("thead", { className: "bg-gray-50 dark:bg-gray-800", children: _jsxs("tr", { children: [similarTaxonomies.some((taxonomy) => taxonomy.isEdit) && (_jsx("th", { className: "px-4 py-3.5 text-md font-normal text-left rtl:text-right text-gray-500 dark:text-gray-400", children: "Actions" })), _jsx("th", { className: "px-4 py-3.5 text-md font-normal text-left rtl:text-right text-gray-500 dark:text-gray-400", children: "Code" }), _jsx("th", { className: "px-4 py-3.5 text-md font-normal text-left rtl:text-right text-gray-500 dark:text-gray-400", children: "Value" })] }) }), _jsx("tbody", { className: "divide-y divide-gray-200", children: similarTaxonomies.map((taxonomy, index) => {
|
329
329
|
const hasChildren = allTaxonomies.some((item) => item.parentId === taxonomy.id);
|
330
|
-
return (_jsxs(React.Fragment, { children: [_jsxs("tr", { children: [_jsx("td", { className: "px-4 py-4 text-sm whitespace-nowrap", children: _jsxs("div", { className: "flex items-center gap-x-6", children: [_jsx("button", { type: "button", onClick: () => handleDeleteClick(taxonomy.id), className: "text-gray-500 transition-colors duration-200 dark:hover:text-red-600 dark:text-gray-300 hover:text-red-500 focus:outline-none", children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: "1.5", stroke: "currentColor", className: "w-5 h-5", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0" }) }) }), _jsx("button", { type: "button", onClick: () => handleEditClick(index, taxonomy.id), className: "text-gray-500 transition-colors duration-200 dark:hover:text-yellow-500 dark:text-gray-300 hover:text-yellow-500 focus:outline-none", children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: "1.5", stroke: "currentColor", className: "w-5 h-5", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L10.582 16.07a4.5 4.5 0 01-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 011.13-1.897l8.932-8.931zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0115.75 21H5.25A2.25 2.25 0 013 18.75V8.25A2.25 2.25 0 015.25 6H10" }) }) }), _jsx("button", { type: "button", onClick: () => handleAddSubType(index, taxonomy.id), className: "text-gray-500 transition-colors duration-200 dark:hover:text-blue-500 dark:text-gray-300 hover:text-blue-500 focus:outline-none", children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: "1.5", stroke: "currentColor", className: "w-5 h-5", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4.5v15m7.5-7.5h-15" }) }) })] }) }), _jsx("td", { className: "px-4 py-4 text-sm text-gray-500 dark:text-gray-400", children: taxonomy.code }), _jsx("td", { className: "px-4 py-4 text-sm font-medium text-gray-900 dark:text-white", children: _jsxs("div", { className: "flex justify-between items-center", children: [_jsx("span", { children: taxonomy.value }), hasChildren && (_jsx("button", { type: "button", onClick: () => toggleRowExpansion(taxonomy.id), className: "text-gray-500 transition-colors duration-200 dark:hover:text-blue-600 dark:text-gray-300 hover:text-blue-500 focus:outline-none", children: expandedRows.indexOf(taxonomy.id) !== -1 ? (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: "1.5", stroke: "currentColor", className: "w-5 h-5", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19.5 8.25l-7.5 7.5-7.5-7.5" }) })) : (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: "1.5", stroke: "currentColor", className: "w-5 h-5", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19.5 15.75l-7.5-7.5-7.5 7.5" }) })) }))] }) })] }, index), expandedRows.indexOf(taxonomy.id) !== -1 && (_jsx("tr", { children: _jsx("td", { colSpan: 3, children: _jsxs("table", { className: "min-w-full divide-y ", children: [_jsx("thead", { className: "bg-gray-50 dark:bg-gray-800", children: _jsxs("tr", { children: [_jsx("th", { className: "px-4 py-3.5 text-md font-normal text-left rtl:text-right text-gray-500 dark:text-gray-400", children: "Actions" }), _jsx("th", { className: "px-4 py-3.5 text-md font-normal text-left rtl:text-right text-gray-500 dark:text-gray-400", children: "Sub Type" }), _jsx("th", { className: "px-4 py-3.5 text-md font-normal text-left rtl:text-right text-gray-500 dark:text-gray-400", children: "Code" }), _jsx("th", { className: "px-4 py-3.5 text-md font-normal text-left rtl:text-right text-gray-500 dark:text-gray-400", children: "Value" })] }) }), _jsx("tbody", { children: allTaxonomies
|
330
|
+
return (_jsxs(React.Fragment, { children: [_jsxs("tr", { children: [similarTaxonomies.some((taxonomy) => taxonomy.isEdit) && (_jsx("td", { className: "px-4 py-4 text-sm whitespace-nowrap", children: _jsxs("div", { className: "flex items-center gap-x-6", children: [_jsx("button", { type: "button", onClick: () => handleDeleteClick(taxonomy.id), className: "text-gray-500 transition-colors duration-200 dark:hover:text-red-600 dark:text-gray-300 hover:text-red-500 focus:outline-none", children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: "1.5", stroke: "currentColor", className: "w-5 h-5", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0" }) }) }), _jsx("button", { type: "button", onClick: () => handleEditClick(index, taxonomy.id), className: "text-gray-500 transition-colors duration-200 dark:hover:text-yellow-500 dark:text-gray-300 hover:text-yellow-500 focus:outline-none", children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: "1.5", stroke: "currentColor", className: "w-5 h-5", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L10.582 16.07a4.5 4.5 0 01-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 011.13-1.897l8.932-8.931zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0115.75 21H5.25A2.25 2.25 0 013 18.75V8.25A2.25 2.25 0 015.25 6H10" }) }) }), _jsx("button", { type: "button", onClick: () => handleAddSubType(index, taxonomy.id), className: "text-gray-500 transition-colors duration-200 dark:hover:text-blue-500 dark:text-gray-300 hover:text-blue-500 focus:outline-none", children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: "1.5", stroke: "currentColor", className: "w-5 h-5", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4.5v15m7.5-7.5h-15" }) }) })] }) })), _jsx("td", { className: "px-4 py-4 text-sm text-gray-500 dark:text-gray-400", children: taxonomy.code }), _jsx("td", { className: "px-4 py-4 text-sm font-medium text-gray-900 dark:text-white", children: _jsxs("div", { className: "flex justify-between items-center", children: [_jsx("span", { children: taxonomy.value }), hasChildren && (_jsx("button", { type: "button", onClick: () => toggleRowExpansion(taxonomy.id), className: "text-gray-500 transition-colors duration-200 dark:hover:text-blue-600 dark:text-gray-300 hover:text-blue-500 focus:outline-none", children: expandedRows.indexOf(taxonomy.id) !== -1 ? (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: "1.5", stroke: "currentColor", className: "w-5 h-5", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19.5 8.25l-7.5 7.5-7.5-7.5" }) })) : (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: "1.5", stroke: "currentColor", className: "w-5 h-5", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19.5 15.75l-7.5-7.5-7.5 7.5" }) })) }))] }) })] }, index), expandedRows.indexOf(taxonomy.id) !== -1 && (_jsx("tr", { children: _jsx("td", { colSpan: 3, children: _jsxs("table", { className: "min-w-full divide-y ", children: [_jsx("thead", { className: "bg-gray-50 dark:bg-gray-800", children: _jsxs("tr", { children: [similarTaxonomies.some((taxonomy) => taxonomy.isEdit) && (_jsx("th", { className: "px-4 py-3.5 text-md font-normal text-left rtl:text-right text-gray-500 dark:text-gray-400", children: "Actions" })), _jsx("th", { className: "px-4 py-3.5 text-md font-normal text-left rtl:text-right text-gray-500 dark:text-gray-400", children: "Sub Type" }), _jsx("th", { className: "px-4 py-3.5 text-md font-normal text-left rtl:text-right text-gray-500 dark:text-gray-400", children: "Code" }), _jsx("th", { className: "px-4 py-3.5 text-md font-normal text-left rtl:text-right text-gray-500 dark:text-gray-400", children: "Value" })] }) }), _jsx("tbody", { children: allTaxonomies
|
331
331
|
.filter((item) => item.parentId === taxonomy.id)
|
332
|
-
.map((child, key) => (_jsxs("tr", { children: [_jsx("td", { className: "px-4 py-4 text-sm whitespace-nowrap", children: _jsxs("div", { className: "flex items-center gap-x-6", children: [_jsx("button", { type: "button", onClick: () => handleDeleteSubTypeClick(child.id), className: "text-gray-500 transition-colors duration-200 dark:hover:text-red-600 dark:text-gray-300 hover:text-red-500 focus:outline-none", children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: "1.5", stroke: "currentColor", className: "w-5 h-5", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0" }) }) }), _jsx("button", { type: "button",
|
332
|
+
.map((child, key) => (_jsxs("tr", { children: [similarTaxonomies.some((taxonomy) => taxonomy.isEdit) && (_jsx("td", { className: "px-4 py-4 text-sm whitespace-nowrap", children: _jsxs("div", { className: "flex items-center gap-x-6", children: [_jsx("button", { type: "button", onClick: () => handleDeleteSubTypeClick(child.id), className: "text-gray-500 transition-colors duration-200 dark:hover:text-red-600 dark:text-gray-300 hover:text-red-500 focus:outline-none", children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: "1.5", stroke: "currentColor", className: "w-5 h-5", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0" }) }) }), _jsx("button", { type: "button",
|
333
333
|
// onClick={() =>
|
334
334
|
// // handleSubEdit(key, child.id)
|
335
335
|
// }
|
336
|
-
onClick: () => handleSubEdit(child), className: "text-gray-500 transition-colors duration-200 dark:hover:text-yellow-500 dark:text-gray-300 hover:text-yellow-500 focus:outline-none", children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: "1.5", stroke: "currentColor", className: "w-5 h-5", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L10.582 16.07a4.5 4.5 0 01-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 011.13-1.897l8.932-8.931zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0115.75 21H5.25A2.25 2.25 0 013 18.75V8.25A2.25 2.25 0 015.25 6H10" }) }) })] }) }), _jsx("td", { className: "px-4 py-4 text-sm font-medium text-gray-900 dark:text-white", children: child.type }), _jsx("td", { className: "px-4 py-2 text-sm text-gray-500 dark:text-gray-400", children: child.code }), _jsx("td", { className: "px-4 py-4 text-sm font-medium text-gray-900 dark:text-white", children: child.value })] }, key))) })] }) }) }))] }, taxonomy.id));
|
336
|
+
onClick: () => handleSubEdit(child), className: "text-gray-500 transition-colors duration-200 dark:hover:text-yellow-500 dark:text-gray-300 hover:text-yellow-500 focus:outline-none", children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: "1.5", stroke: "currentColor", className: "w-5 h-5", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L10.582 16.07a4.5 4.5 0 01-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 011.13-1.897l8.932-8.931zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0115.75 21H5.25A2.25 2.25 0 013 18.75V8.25A2.25 2.25 0 015.25 6H10" }) }) })] }) })), _jsx("td", { className: "px-4 py-4 text-sm font-medium text-gray-900 dark:text-white", children: child.type }), _jsx("td", { className: "px-4 py-2 text-sm text-gray-500 dark:text-gray-400", children: child.code }), _jsx("td", { className: "px-4 py-4 text-sm font-medium text-gray-900 dark:text-white", children: child.value })] }, key))) })] }) }) }))] }, taxonomy.id));
|
337
337
|
}) })] }) }), similarTaxonomies.some((taxonomy) => taxonomy.isEdit) && (_jsx("div", { className: "flex space-x-4 mt-6 justify-start", children: _jsxs("button", { type: "button", onClick: handleOpenModal, className: "flex items-center justify-center px-6 py-2 font-medium tracking-wide text-white capitalize transition-colors duration-300 transform bg-blue-600 rounded-lg hover:bg-blue-500 focus:outline-none focus:ring focus:ring-blue-300 focus:ring-opacity-80", children: [_jsx(FaPlus, { className: "mr-2 font-medium" }), "Add Multiple Values"] }) }))] })), isEditMode && (_jsx(_Fragment, { children: tempTaxonomy.length > 0 && (_jsxs("div", { className: "flex-grow ml-0 mt-4 w-full", children: [_jsx("div", { className: "overflow-hidden border border-gray-200 dark:border-gray-700 md:rounded-lg mt-6", children: _jsxs("table", { className: "min-w-full divide-y divide-gray-200 dark:divide-gray-700", children: [_jsx("thead", { className: "bg-gray-50 dark:bg-gray-800", children: _jsxs("tr", { children: [_jsx("th", { scope: "col", className: "px-4 py-3.5 text-md font-normal text-left rtl:text-right text-gray-500 dark:text-gray-400", children: "Edit/Delete" }), _jsx("th", { scope: "col", className: "px-4 py-3.5 text-md font-normal text-left text-gray-500 dark:text-gray-400", children: "Code" }), _jsx("th", { scope: "col", className: "px-4 py-3.5 text-md font-normal text-left text-gray-500 dark:text-gray-400", children: "Value" })] }) }), _jsx("tbody", { className: "bg-white divide-y divide-gray-200 dark:bg-gray-800 dark:divide-gray-700", children: [...tempTaxonomy].map((item, index) => (_jsxs("tr", { children: [_jsx("td", { className: "px-4 py-4 text-sm whitespace-nowrap", children: _jsxs("div", { className: "flex items-center gap-x-6", children: [_jsx("button", { type: "button", onClick: () => {
|
338
338
|
const newTempTaxonomy = [...tempTaxonomy];
|
339
339
|
newTempTaxonomy.splice(index, 1);
|
@@ -346,7 +346,7 @@ const TaxonomyForm = () => {
|
|
346
346
|
: "Add SubType"
|
347
347
|
: editTaxonomyItem
|
348
348
|
? "Edit Values"
|
349
|
-
: "Add Values" }), _jsx("button", { onClick: handleCloseModal, className: "text-xl text-gray-600 dark:text-gray-400 h-6 w-6
|
349
|
+
: "Add Values" }), _jsx("button", { onClick: handleCloseModal, className: "text-xl text-gray-600 dark:text-gray-400 h-6 w-6", children: "\u00D7" })] }), isAddingSubType ? (_jsxs(_Fragment, { children: [_jsx("label", { className: "text-gray-900 dark:text-gray-200 font-semibold", children: "Type" }), _jsx("input", { type: "text", value: subType, onChange: (e) => setSubType(e.target.value), placeholder: "Enter Type", className: "w-full px-4 py-2 mt-2 mb-4 border border-gray-300 rounded-md" }), _jsx("label", { className: "text-gray-900 dark:text-gray-200 font-semibold", children: "Code" }), _jsx("input", { type: "number", value: subCode, onChange: (e) => setSubCode(e.target.value), placeholder: "Enter Code", className: "w-full px-4 py-2 mt-2 mb-4 border border-gray-300 rounded-md" }), _jsx("label", { className: "text-gray-900 dark:text-gray-200 font-semibold", children: "Value" }), _jsx("input", { type: "text", value: subValue, onChange: (e) => setSubValue(e.target.value), placeholder: "Enter Value", className: "w-full px-4 py-2 mt-2 mb-4 border border-gray-300 rounded-md" }), _jsxs("div", { className: "flex space-x-4 justify-end", children: [_jsx("button", { onClick: handleCloseModal, className: "px-8 py-2.5 leading-5 bg-gray-300 rounded-md", children: "Cancel" }), _jsx("button", { onClick: editTaxonomyItem
|
350
350
|
? handleSubTypeEditClick
|
351
351
|
: handleSubTypeAddClick, className: "px-8 py-2.5 leading-5 text-white transition-colors duration-300 transform bg-blue-600 rounded-md hover:bg-blue-500 focus:outline-none focus:bg-gray-600", children: editTaxonomyItem ? "Edit SubType" : "Add SubType" })] })] })) : (_jsxs(_Fragment, { children: [_jsx("label", { className: "text-gray-900 dark:text-gray-200 font-semibold", children: "Code" }), _jsx("input", { type: "number", value: newCode, onChange: (e) => setNewCode(e.target.value), placeholder: "Enter Code", className: "w-full px-4 py-2 mt-2 mb-4 border border-gray-300 rounded-md" }), _jsx("label", { className: "text-gray-900 dark:text-gray-200 font-semibold", children: "Value" }), _jsx("input", { type: "text", value: newValue, onChange: (e) => setNewValue(e.target.value), placeholder: "Enter Value", className: "w-full px-4 py-2 mt-2 mb-4 border border-gray-300 rounded-md" }), _jsxs("div", { className: "flex space-x-4 justify-end", children: [_jsx("button", { onClick: handleCloseModal, className: "px-8 py-2.5 leading-5 bg-gray-300 rounded-md", children: "Cancel" }), _jsx("button", { onClick: editTaxonomyItem ? handleEditTaxClick : handleAddClick, className: "px-8 py-2.5 leading-5 text-white transition-colors duration-300 transform bg-blue-600 rounded-md hover:bg-blue-500 focus:outline-none focus:bg-gray-600", children: editTaxonomyItem || editTempTaxonomyItem ? "Edit" : "Add" })] })] }))] }) })] }));
|
352
352
|
};
|
package/package.json
CHANGED
@@ -555,76 +555,80 @@ const TaxonomyForm = () => {
|
|
555
555
|
return (
|
556
556
|
<React.Fragment key={taxonomy.id}>
|
557
557
|
<tr key={index}>
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
fill="none"
|
568
|
-
viewBox="0 0 24 24"
|
569
|
-
strokeWidth="1.5"
|
570
|
-
stroke="currentColor"
|
571
|
-
className="w-5 h-5"
|
558
|
+
{similarTaxonomies.some(
|
559
|
+
(taxonomy) => taxonomy.isEdit
|
560
|
+
) && (
|
561
|
+
<td className="px-4 py-4 text-sm whitespace-nowrap">
|
562
|
+
<div className="flex items-center gap-x-6">
|
563
|
+
<button
|
564
|
+
type="button"
|
565
|
+
onClick={() => handleDeleteClick(taxonomy.id)}
|
566
|
+
className="text-gray-500 transition-colors duration-200 dark:hover:text-red-600 dark:text-gray-300 hover:text-red-500 focus:outline-none"
|
572
567
|
>
|
573
|
-
<
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
|
568
|
+
<svg
|
569
|
+
xmlns="http://www.w3.org/2000/svg"
|
570
|
+
fill="none"
|
571
|
+
viewBox="0 0 24 24"
|
572
|
+
strokeWidth="1.5"
|
573
|
+
stroke="currentColor"
|
574
|
+
className="w-5 h-5"
|
575
|
+
>
|
576
|
+
<path
|
577
|
+
strokeLinecap="round"
|
578
|
+
strokeLinejoin="round"
|
579
|
+
d="M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0"
|
580
|
+
/>
|
581
|
+
</svg>
|
582
|
+
</button>
|
580
583
|
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
>
|
588
|
-
<svg
|
589
|
-
xmlns="http://www.w3.org/2000/svg"
|
590
|
-
fill="none"
|
591
|
-
viewBox="0 0 24 24"
|
592
|
-
strokeWidth="1.5"
|
593
|
-
stroke="currentColor"
|
594
|
-
className="w-5 h-5"
|
584
|
+
<button
|
585
|
+
type="button"
|
586
|
+
onClick={() =>
|
587
|
+
handleEditClick(index, taxonomy.id)
|
588
|
+
}
|
589
|
+
className="text-gray-500 transition-colors duration-200 dark:hover:text-yellow-500 dark:text-gray-300 hover:text-yellow-500 focus:outline-none"
|
595
590
|
>
|
596
|
-
<
|
597
|
-
|
598
|
-
|
599
|
-
|
600
|
-
|
601
|
-
|
602
|
-
|
591
|
+
<svg
|
592
|
+
xmlns="http://www.w3.org/2000/svg"
|
593
|
+
fill="none"
|
594
|
+
viewBox="0 0 24 24"
|
595
|
+
strokeWidth="1.5"
|
596
|
+
stroke="currentColor"
|
597
|
+
className="w-5 h-5"
|
598
|
+
>
|
599
|
+
<path
|
600
|
+
strokeLinecap="round"
|
601
|
+
strokeLinejoin="round"
|
602
|
+
d="M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L10.582 16.07a4.5 4.5 0 01-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 011.13-1.897l8.932-8.931zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0115.75 21H5.25A2.25 2.25 0 013 18.75V8.25A2.25 2.25 0 015.25 6H10"
|
603
|
+
/>
|
604
|
+
</svg>
|
605
|
+
</button>
|
603
606
|
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
>
|
611
|
-
<svg
|
612
|
-
xmlns="http://www.w3.org/2000/svg"
|
613
|
-
fill="none"
|
614
|
-
viewBox="0 0 24 24"
|
615
|
-
strokeWidth="1.5"
|
616
|
-
stroke="currentColor"
|
617
|
-
className="w-5 h-5"
|
607
|
+
<button
|
608
|
+
type="button"
|
609
|
+
onClick={() =>
|
610
|
+
handleAddSubType(index, taxonomy.id)
|
611
|
+
}
|
612
|
+
className="text-gray-500 transition-colors duration-200 dark:hover:text-blue-500 dark:text-gray-300 hover:text-blue-500 focus:outline-none"
|
618
613
|
>
|
619
|
-
<
|
620
|
-
|
621
|
-
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
|
614
|
+
<svg
|
615
|
+
xmlns="http://www.w3.org/2000/svg"
|
616
|
+
fill="none"
|
617
|
+
viewBox="0 0 24 24"
|
618
|
+
strokeWidth="1.5"
|
619
|
+
stroke="currentColor"
|
620
|
+
className="w-5 h-5"
|
621
|
+
>
|
622
|
+
<path
|
623
|
+
strokeLinecap="round"
|
624
|
+
strokeLinejoin="round"
|
625
|
+
d="M12 4.5v15m7.5-7.5h-15"
|
626
|
+
/>
|
627
|
+
</svg>
|
628
|
+
</button>
|
629
|
+
</div>
|
630
|
+
</td>
|
631
|
+
)}
|
628
632
|
<td className="px-4 py-4 text-sm text-gray-500 dark:text-gray-400">
|
629
633
|
{taxonomy.code}
|
630
634
|
</td>
|
@@ -683,9 +687,13 @@ const TaxonomyForm = () => {
|
|
683
687
|
<table className="min-w-full divide-y ">
|
684
688
|
<thead className="bg-gray-50 dark:bg-gray-800">
|
685
689
|
<tr>
|
686
|
-
|
687
|
-
|
688
|
-
|
690
|
+
{similarTaxonomies.some(
|
691
|
+
(taxonomy) => taxonomy.isEdit
|
692
|
+
) && (
|
693
|
+
<th className="px-4 py-3.5 text-md font-normal text-left rtl:text-right text-gray-500 dark:text-gray-400">
|
694
|
+
Actions
|
695
|
+
</th>
|
696
|
+
)}
|
689
697
|
<th className="px-4 py-3.5 text-md font-normal text-left rtl:text-right text-gray-500 dark:text-gray-400">
|
690
698
|
Sub Type
|
691
699
|
</th>
|
@@ -704,60 +712,64 @@ const TaxonomyForm = () => {
|
|
704
712
|
)
|
705
713
|
.map((child, key) => (
|
706
714
|
<tr key={key}>
|
707
|
-
|
708
|
-
|
709
|
-
|
710
|
-
|
711
|
-
|
712
|
-
|
713
|
-
|
714
|
-
)
|
715
|
-
|
716
|
-
|
717
|
-
|
718
|
-
|
719
|
-
|
720
|
-
fill="none"
|
721
|
-
viewBox="0 0 24 24"
|
722
|
-
strokeWidth="1.5"
|
723
|
-
stroke="currentColor"
|
724
|
-
className="w-5 h-5"
|
715
|
+
{similarTaxonomies.some(
|
716
|
+
(taxonomy) => taxonomy.isEdit
|
717
|
+
) && (
|
718
|
+
<td className="px-4 py-4 text-sm whitespace-nowrap">
|
719
|
+
<div className="flex items-center gap-x-6">
|
720
|
+
<button
|
721
|
+
type="button"
|
722
|
+
onClick={() =>
|
723
|
+
handleDeleteSubTypeClick(
|
724
|
+
child.id
|
725
|
+
)
|
726
|
+
}
|
727
|
+
className="text-gray-500 transition-colors duration-200 dark:hover:text-red-600 dark:text-gray-300 hover:text-red-500 focus:outline-none"
|
725
728
|
>
|
726
|
-
<
|
727
|
-
|
728
|
-
|
729
|
-
|
730
|
-
|
731
|
-
|
732
|
-
|
733
|
-
|
734
|
-
|
735
|
-
|
736
|
-
|
737
|
-
|
738
|
-
|
739
|
-
|
740
|
-
|
741
|
-
|
742
|
-
|
743
|
-
|
744
|
-
|
745
|
-
|
746
|
-
|
747
|
-
|
748
|
-
|
749
|
-
|
750
|
-
className="
|
729
|
+
<svg
|
730
|
+
xmlns="http://www.w3.org/2000/svg"
|
731
|
+
fill="none"
|
732
|
+
viewBox="0 0 24 24"
|
733
|
+
strokeWidth="1.5"
|
734
|
+
stroke="currentColor"
|
735
|
+
className="w-5 h-5"
|
736
|
+
>
|
737
|
+
<path
|
738
|
+
strokeLinecap="round"
|
739
|
+
strokeLinejoin="round"
|
740
|
+
d="M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0"
|
741
|
+
/>
|
742
|
+
</svg>
|
743
|
+
</button>
|
744
|
+
|
745
|
+
<button
|
746
|
+
type="button"
|
747
|
+
// onClick={() =>
|
748
|
+
// // handleSubEdit(key, child.id)
|
749
|
+
// }
|
750
|
+
onClick={() =>
|
751
|
+
handleSubEdit(child)
|
752
|
+
}
|
753
|
+
className="text-gray-500 transition-colors duration-200 dark:hover:text-yellow-500 dark:text-gray-300 hover:text-yellow-500 focus:outline-none"
|
751
754
|
>
|
752
|
-
<
|
753
|
-
|
754
|
-
|
755
|
-
|
756
|
-
|
757
|
-
|
758
|
-
|
759
|
-
|
760
|
-
|
755
|
+
<svg
|
756
|
+
xmlns="http://www.w3.org/2000/svg"
|
757
|
+
fill="none"
|
758
|
+
viewBox="0 0 24 24"
|
759
|
+
strokeWidth="1.5"
|
760
|
+
stroke="currentColor"
|
761
|
+
className="w-5 h-5"
|
762
|
+
>
|
763
|
+
<path
|
764
|
+
strokeLinecap="round"
|
765
|
+
strokeLinejoin="round"
|
766
|
+
d="M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L10.582 16.07a4.5 4.5 0 01-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 011.13-1.897l8.932-8.931zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0115.75 21H5.25A2.25 2.25 0 013 18.75V8.25A2.25 2.25 0 015.25 6H10"
|
767
|
+
/>
|
768
|
+
</svg>
|
769
|
+
</button>
|
770
|
+
</div>
|
771
|
+
</td>
|
772
|
+
)}
|
761
773
|
<td className="px-4 py-4 text-sm font-medium text-gray-900 dark:text-white">
|
762
774
|
{child.type}
|
763
775
|
</td>
|
@@ -943,7 +955,7 @@ const TaxonomyForm = () => {
|
|
943
955
|
</h2>
|
944
956
|
<button
|
945
957
|
onClick={handleCloseModal}
|
946
|
-
className="text-xl text-gray-600 dark:text-gray-400 h-6 w-6
|
958
|
+
className="text-xl text-gray-600 dark:text-gray-400 h-6 w-6"
|
947
959
|
>
|
948
960
|
×
|
949
961
|
</button>
|