eleven-solutions-common-website-unique-web 12.0.0 → 12.0.1
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.
|
@@ -320,11 +320,13 @@ const TaxonomyForm = ({ url }) => {
|
|
|
320
320
|
console.error("Error deleting Taxonomy:", error);
|
|
321
321
|
}
|
|
322
322
|
});
|
|
323
|
-
return (_jsxs("div", { className: `${
|
|
323
|
+
return (_jsxs("div", { className: `${
|
|
324
|
+
// isEditMode && isMultiple ? "w-full" : "max-w-4xl"
|
|
325
|
+
isEditMode ? "w-full" : "max-w-4xl"} p-6 mx-auto dark:bg-gray-800`, children: [_jsxs("div", { className: `transition duration-300 ${isModalOpen ? "filter blur-sm" : ""}`, children: [_jsx("h1", { className: "text-3xl font-bold text-center text-blue-600 capitalize dark:text-white mb-4", children: isEditMode ? "Edit Taxonomy" : "Add Taxonomy" }), _jsx("h1", { className: "text-2xl text-blue-600 capitalize dark:text-white mb-4", children: isEditMode ? `Taxonomy Type: ${type}` : "" }), _jsxs("form", { children: [!isEditMode && (_jsxs("div", { className: "mb-6 w-full", children: [_jsxs("label", { className: "text-gray-900 dark:text-gray-200 font-semibold", children: ["Type ", _jsx("span", { className: "text-red-500", children: "*" })] }), _jsx("input", { required: true, value: inputType, onChange: (e) => setInputType(e.target.value), type: "text", className: "w-full px-4 py-2 mt-2 text-gray-800 bg-white border border-gray-400 rounded-md dark:bg-gray-800 dark:text-gray-300 dark:border-gray-800 focus:border-blue-400 focus:ring-blue-300 focus:ring-opacity-40 dark:focus:border-blue-300 focus:outline-none focus:ring", placeholder: "Enter Type" })] })), _jsxs("div", { className: "mb-6 w-full", children: [_jsxs("label", { className: "text-gray-900 dark:text-gray-200 font-semibold", children: ["Code ", _jsx("span", { className: "text-red-500", children: "*" })] }), _jsx("input", { required: true, value: code, onChange: (e) => setCode(e.target.value === "" ? "" : Number(e.target.value)), type: "number", className: "w-full px-4 py-2 mt-2 text-gray-800 bg-white border border-gray-400 rounded-md dark:bg-gray-800 dark:text-gray-300 dark:border-gray-800 focus:border-blue-400 focus:ring-blue-300 focus:ring-opacity-40 dark:focus:border-blue-300 focus:outline-none focus:ring", placeholder: "Enter Code", disabled: similarTaxonomies.some((taxonomy) => taxonomy.isEdit === false) })] }), _jsxs("div", { className: "mb-6 w-full", children: [_jsxs("label", { className: "text-gray-900 dark:text-gray-200 font-semibold", children: ["Value ", _jsx("span", { className: "text-red-500", children: "*" })] }), _jsx("input", { required: true, value: value, onChange: (e) => setValue(e.target.value), type: "text", className: "w-full px-4 py-2 mt-2 text-gray-800 bg-white border border-gray-400 rounded-md dark:bg-gray-800 dark:text-gray-300 dark:border-gray-800 focus:border-blue-400 focus:ring-blue-300 focus:ring-opacity-40 dark:focus:border-blue-300 focus:outline-none focus:ring", placeholder: "Enter Value", disabled: similarTaxonomies.some((taxonomy) => taxonomy.isEdit === false) })] }), _jsxs("div", { className: "flex space-x-4 mt-6 justify-between", children: [_jsx("div", { children: isEditMode && (_jsx("div", { children: similarTaxonomies.some((taxonomy) => taxonomy.isEdit) && (_jsx("button", { type: "button", onClick: () => {
|
|
324
326
|
handleDeleteClick(id);
|
|
325
327
|
window.location.href = "/admin/taxinomies";
|
|
326
328
|
}, 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) &&
|
|
327
|
-
!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" })] })] })] })
|
|
329
|
+
!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 && 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", { scope: "col", className: "px-4 py-3.5 text-md font-normal text-left rtl:text-right text-gray-500 dark:text-gray-400", style: { width: "200px" }, 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) => {
|
|
328
330
|
const hasChildren = allTaxonomies.some((item) => item.parentId === taxonomy.id);
|
|
329
331
|
return (_jsxs(React.Fragment, { children: [_jsxs("tr", { children: [_jsx("td", { className: "px-4 py-4 text-sm whitespace-nowrap", children: taxonomy.isEdit && (_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", { scope: "col", className: "px-4 py-3.5 text-md font-normal text-left rtl:text-right text-gray-500 dark:text-gray-400", style: { width: "200px" }, 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", { children: allTaxonomies
|
|
330
332
|
.filter((item) => item.parentId === taxonomy.id)
|
|
@@ -335,7 +337,7 @@ const TaxonomyForm = ({ url }) => {
|
|
|
335
337
|
setTempTaxonomy(newTempTaxonomy);
|
|
336
338
|
}, 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", "stroke-width": "1.5", stroke: "currentColor", className: "w-5 h-5", children: _jsx("path", { "stroke-linecap": "round", "stroke-linejoin": "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: () => {
|
|
337
339
|
handleTempEditClick(index);
|
|
338
|
-
}, 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", "stroke-width": "1.5", stroke: "currentColor", className: "w-5 h-5", children: _jsx("path", { "stroke-linecap": "round", "stroke-linejoin": "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 text-gray-500 dark:text-gray-400", children: item.code }), _jsx("td", { className: "px-4 py-4 text-sm text-gray-500 dark:text-gray-400", children: item.value })] }, index))) })] }) }), _jsx("div", { className: "flex space-x-4 mt-6 justify-start", children: _jsx("button", { type: "button", onClick: handleSaveClick, 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: "Save" }) })] })) })),
|
|
340
|
+
}, 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", "stroke-width": "1.5", stroke: "currentColor", className: "w-5 h-5", children: _jsx("path", { "stroke-linecap": "round", "stroke-linejoin": "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 text-gray-500 dark:text-gray-400", children: item.code }), _jsx("td", { className: "px-4 py-4 text-sm text-gray-500 dark:text-gray-400", children: item.value })] }, index))) })] }) }), _jsx("div", { className: "flex space-x-4 mt-6 justify-start", children: _jsx("button", { type: "button", onClick: handleSaveClick, 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: "Save" }) })] })) })), _jsxs("div", { className: "flex space-x-4 mt-6 justify-start", children: [similarTaxonomies.some((taxonomy) => taxonomy.isEdit) && (_jsx("button", { type: "submit", onClick: handleSubmit, 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" })] })] }), _jsx("div", { className: `fixed inset-y-0 right-0 z-50 w-1/3 bg-white dark:bg-gray-800 p-6 shadow-lg transform ${isModalOpen ? "translate-x-0" : "translate-x-full"} transition-transform duration-300`, children: _jsxs("div", { className: "p-6", children: [_jsxs("div", { className: "flex justify-between", children: [_jsx("h2", { className: "text-xl font-bold text-blue-600 mb-4 ", children: isAddingSubType
|
|
339
341
|
? editTaxonomyItem
|
|
340
342
|
? "Edit SubType"
|
|
341
343
|
: "Add SubType"
|
package/package.json
CHANGED
|
@@ -411,7 +411,8 @@ const TaxonomyForm = ({ url }: TaxionomyFormProps) => {
|
|
|
411
411
|
return (
|
|
412
412
|
<div
|
|
413
413
|
className={`${
|
|
414
|
-
isEditMode && isMultiple ? "w-full" : "max-w-4xl"
|
|
414
|
+
// isEditMode && isMultiple ? "w-full" : "max-w-4xl"
|
|
415
|
+
isEditMode ? "w-full" : "max-w-4xl"
|
|
415
416
|
} p-6 mx-auto dark:bg-gray-800`}
|
|
416
417
|
>
|
|
417
418
|
<div
|
|
@@ -426,112 +427,113 @@ const TaxonomyForm = ({ url }: TaxionomyFormProps) => {
|
|
|
426
427
|
{isEditMode ? `Taxonomy Type: ${type}` : ""}
|
|
427
428
|
</h1>
|
|
428
429
|
|
|
429
|
-
{!isMultiple && (
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
<div className="mb-6 w-full">
|
|
433
|
-
<label className="text-gray-900 dark:text-gray-200 font-semibold">
|
|
434
|
-
Type <span className="text-red-500">*</span>
|
|
435
|
-
</label>
|
|
436
|
-
<input
|
|
437
|
-
required
|
|
438
|
-
value={inputType}
|
|
439
|
-
onChange={(e) => setInputType(e.target.value)}
|
|
440
|
-
type="text"
|
|
441
|
-
className="w-full px-4 py-2 mt-2 text-gray-800 bg-white border border-gray-400 rounded-md dark:bg-gray-800 dark:text-gray-300 dark:border-gray-800 focus:border-blue-400 focus:ring-blue-300 focus:ring-opacity-40 dark:focus:border-blue-300 focus:outline-none focus:ring"
|
|
442
|
-
placeholder="Enter Type"
|
|
443
|
-
/>
|
|
444
|
-
</div>
|
|
445
|
-
)}
|
|
446
|
-
<div className="mb-6 w-full">
|
|
447
|
-
<label className="text-gray-900 dark:text-gray-200 font-semibold">
|
|
448
|
-
Code <span className="text-red-500">*</span>
|
|
449
|
-
</label>
|
|
450
|
-
<input
|
|
451
|
-
required
|
|
452
|
-
value={code}
|
|
453
|
-
onChange={(e) =>
|
|
454
|
-
setCode(e.target.value === "" ? "" : Number(e.target.value))
|
|
455
|
-
}
|
|
456
|
-
type="number"
|
|
457
|
-
className="w-full px-4 py-2 mt-2 text-gray-800 bg-white border border-gray-400 rounded-md dark:bg-gray-800 dark:text-gray-300 dark:border-gray-800 focus:border-blue-400 focus:ring-blue-300 focus:ring-opacity-40 dark:focus:border-blue-300 focus:outline-none focus:ring"
|
|
458
|
-
placeholder="Enter Code"
|
|
459
|
-
disabled={similarTaxonomies.some(
|
|
460
|
-
(taxonomy) => taxonomy.isEdit === false
|
|
461
|
-
)}
|
|
462
|
-
/>
|
|
463
|
-
</div>
|
|
430
|
+
{/* {!isMultiple && ( */}
|
|
431
|
+
<form>
|
|
432
|
+
{!isEditMode && (
|
|
464
433
|
<div className="mb-6 w-full">
|
|
465
434
|
<label className="text-gray-900 dark:text-gray-200 font-semibold">
|
|
466
|
-
|
|
435
|
+
Type <span className="text-red-500">*</span>
|
|
467
436
|
</label>
|
|
468
437
|
<input
|
|
469
438
|
required
|
|
470
|
-
value={
|
|
471
|
-
onChange={(e) =>
|
|
439
|
+
value={inputType}
|
|
440
|
+
onChange={(e) => setInputType(e.target.value)}
|
|
472
441
|
type="text"
|
|
473
442
|
className="w-full px-4 py-2 mt-2 text-gray-800 bg-white border border-gray-400 rounded-md dark:bg-gray-800 dark:text-gray-300 dark:border-gray-800 focus:border-blue-400 focus:ring-blue-300 focus:ring-opacity-40 dark:focus:border-blue-300 focus:outline-none focus:ring"
|
|
474
|
-
placeholder="Enter
|
|
475
|
-
disabled={similarTaxonomies.some(
|
|
476
|
-
(taxonomy) => taxonomy.isEdit === false
|
|
477
|
-
)}
|
|
443
|
+
placeholder="Enter Type"
|
|
478
444
|
/>
|
|
479
445
|
</div>
|
|
446
|
+
)}
|
|
447
|
+
<div className="mb-6 w-full">
|
|
448
|
+
<label className="text-gray-900 dark:text-gray-200 font-semibold">
|
|
449
|
+
Code <span className="text-red-500">*</span>
|
|
450
|
+
</label>
|
|
451
|
+
<input
|
|
452
|
+
required
|
|
453
|
+
value={code}
|
|
454
|
+
onChange={(e) =>
|
|
455
|
+
setCode(e.target.value === "" ? "" : Number(e.target.value))
|
|
456
|
+
}
|
|
457
|
+
type="number"
|
|
458
|
+
className="w-full px-4 py-2 mt-2 text-gray-800 bg-white border border-gray-400 rounded-md dark:bg-gray-800 dark:text-gray-300 dark:border-gray-800 focus:border-blue-400 focus:ring-blue-300 focus:ring-opacity-40 dark:focus:border-blue-300 focus:outline-none focus:ring"
|
|
459
|
+
placeholder="Enter Code"
|
|
460
|
+
disabled={similarTaxonomies.some(
|
|
461
|
+
(taxonomy) => taxonomy.isEdit === false
|
|
462
|
+
)}
|
|
463
|
+
/>
|
|
464
|
+
</div>
|
|
465
|
+
<div className="mb-6 w-full">
|
|
466
|
+
<label className="text-gray-900 dark:text-gray-200 font-semibold">
|
|
467
|
+
Value <span className="text-red-500">*</span>
|
|
468
|
+
</label>
|
|
469
|
+
<input
|
|
470
|
+
required
|
|
471
|
+
value={value}
|
|
472
|
+
onChange={(e) => setValue(e.target.value)}
|
|
473
|
+
type="text"
|
|
474
|
+
className="w-full px-4 py-2 mt-2 text-gray-800 bg-white border border-gray-400 rounded-md dark:bg-gray-800 dark:text-gray-300 dark:border-gray-800 focus:border-blue-400 focus:ring-blue-300 focus:ring-opacity-40 dark:focus:border-blue-300 focus:outline-none focus:ring"
|
|
475
|
+
placeholder="Enter Value"
|
|
476
|
+
disabled={similarTaxonomies.some(
|
|
477
|
+
(taxonomy) => taxonomy.isEdit === false
|
|
478
|
+
)}
|
|
479
|
+
/>
|
|
480
|
+
</div>
|
|
480
481
|
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
<button
|
|
487
|
-
type="button"
|
|
488
|
-
onClick={() => {
|
|
489
|
-
handleDeleteClick(id);
|
|
490
|
-
window.location.href = "/admin/taxinomies";
|
|
491
|
-
}}
|
|
492
|
-
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"
|
|
493
|
-
>
|
|
494
|
-
Delete
|
|
495
|
-
</button>
|
|
496
|
-
)}
|
|
497
|
-
</div>
|
|
498
|
-
)}
|
|
499
|
-
</div>
|
|
500
|
-
|
|
501
|
-
<div className="flex space-x-4 justify-end">
|
|
502
|
-
{similarTaxonomies.some((taxonomy) => taxonomy.isEdit) && (
|
|
503
|
-
<button
|
|
504
|
-
type="submit"
|
|
505
|
-
onClick={handleSave}
|
|
506
|
-
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"
|
|
507
|
-
>
|
|
508
|
-
{isEditMode ? "Save" : "Add"}
|
|
509
|
-
</button>
|
|
510
|
-
)}
|
|
511
|
-
{!similarTaxonomies.some((taxonomy) => taxonomy.isEdit) &&
|
|
512
|
-
!isEditMode && (
|
|
482
|
+
<div className="flex space-x-4 mt-6 justify-between">
|
|
483
|
+
<div>
|
|
484
|
+
{isEditMode && (
|
|
485
|
+
<div>
|
|
486
|
+
{similarTaxonomies.some((taxonomy) => taxonomy.isEdit) && (
|
|
513
487
|
<button
|
|
514
|
-
type="
|
|
515
|
-
onClick={
|
|
488
|
+
type="button"
|
|
489
|
+
onClick={() => {
|
|
490
|
+
handleDeleteClick(id);
|
|
491
|
+
window.location.href = "/admin/taxinomies";
|
|
492
|
+
}}
|
|
516
493
|
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"
|
|
517
494
|
>
|
|
518
|
-
|
|
495
|
+
Delete
|
|
519
496
|
</button>
|
|
520
497
|
)}
|
|
498
|
+
</div>
|
|
499
|
+
)}
|
|
500
|
+
</div>
|
|
501
|
+
|
|
502
|
+
<div className="flex space-x-4 justify-end">
|
|
503
|
+
{similarTaxonomies.some((taxonomy) => taxonomy.isEdit) && (
|
|
521
504
|
<button
|
|
522
|
-
|
|
523
|
-
|
|
505
|
+
type="submit"
|
|
506
|
+
onClick={handleSave}
|
|
524
507
|
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"
|
|
525
508
|
>
|
|
526
|
-
|
|
509
|
+
{isEditMode ? "Save" : "Add"}
|
|
527
510
|
</button>
|
|
528
|
-
|
|
511
|
+
)}
|
|
512
|
+
{!similarTaxonomies.some((taxonomy) => taxonomy.isEdit) &&
|
|
513
|
+
!isEditMode && (
|
|
514
|
+
<button
|
|
515
|
+
type="submit"
|
|
516
|
+
onClick={handleSave}
|
|
517
|
+
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"
|
|
518
|
+
>
|
|
519
|
+
{isEditMode ? "Save" : "Add"}
|
|
520
|
+
</button>
|
|
521
|
+
)}
|
|
522
|
+
<button
|
|
523
|
+
onClick={handleCancelClick}
|
|
524
|
+
type="button"
|
|
525
|
+
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"
|
|
526
|
+
>
|
|
527
|
+
Cancel
|
|
528
|
+
</button>
|
|
529
529
|
</div>
|
|
530
|
-
</
|
|
531
|
-
|
|
530
|
+
</div>
|
|
531
|
+
</form>
|
|
532
|
+
{/* )} */}
|
|
532
533
|
|
|
533
534
|
{/* Table for Displaying Similar Taxonomies */}
|
|
534
|
-
{isSimilarTaxonomyOpen && isMultiple && isEditMode && (
|
|
535
|
+
{/* {isSimilarTaxonomyOpen && isMultiple && isEditMode && ( */}
|
|
536
|
+
{isSimilarTaxonomyOpen && isEditMode && (
|
|
535
537
|
<div className="flex-grow ml-0 mt-4 w-full">
|
|
536
538
|
<div className="overflow-hidden border border-gray-200 dark:border-gray-700 md:rounded-lg mt-6">
|
|
537
539
|
<table className="min-w-full divide-y divide-gray-200 dark:divide-gray-700">
|
|
@@ -924,26 +926,26 @@ const TaxonomyForm = ({ url }: TaxionomyFormProps) => {
|
|
|
924
926
|
</>
|
|
925
927
|
)}
|
|
926
928
|
|
|
927
|
-
{isMultiple && (
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
<button
|
|
931
|
-
type="submit"
|
|
932
|
-
onClick={handleSubmit}
|
|
933
|
-
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"
|
|
934
|
-
>
|
|
935
|
-
{isEditMode ? "Save " : "Add "}
|
|
936
|
-
</button>
|
|
937
|
-
)}
|
|
929
|
+
{/* {isMultiple && ( */}
|
|
930
|
+
<div className="flex space-x-4 mt-6 justify-start">
|
|
931
|
+
{similarTaxonomies.some((taxonomy) => taxonomy.isEdit) && (
|
|
938
932
|
<button
|
|
939
|
-
|
|
940
|
-
|
|
933
|
+
type="submit"
|
|
934
|
+
onClick={handleSubmit}
|
|
941
935
|
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"
|
|
942
936
|
>
|
|
943
|
-
|
|
937
|
+
{isEditMode ? "Save " : "Add "}
|
|
944
938
|
</button>
|
|
945
|
-
|
|
946
|
-
|
|
939
|
+
)}
|
|
940
|
+
<button
|
|
941
|
+
onClick={handleCancelClick}
|
|
942
|
+
type="button"
|
|
943
|
+
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"
|
|
944
|
+
>
|
|
945
|
+
Cancel
|
|
946
|
+
</button>
|
|
947
|
+
</div>
|
|
948
|
+
{/* )} */}
|
|
947
949
|
</div>
|
|
948
950
|
|
|
949
951
|
{/* Drawer */}
|