eleven-solutions-common-website-unique-web 10.0.14 → 10.0.16
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.
|
@@ -62,7 +62,7 @@ const Taxionomies = ({ url }) => {
|
|
|
62
62
|
window.dispatchEvent(new PopStateEvent("popstate"));
|
|
63
63
|
};
|
|
64
64
|
return (_jsxs("div", { className: "container px-4 mx-auto mt-6 h-full", children: [_jsx("div", { className: "w-3/4", children: _jsx("h1", { className: "text-3xl font-bold text-blue-600 mb-5", children: "Taxonomy" }) }), _jsx("div", { className: "flex-grow ml-0 w-full mt-10", children: _jsxs("form", { className: "w-full ", children: [_jsx("label", { htmlFor: "default-search", className: "mb-2 text-sm font-medium text-gray-900 sr-only dark:text-white", children: "Search" }), _jsxs("div", { className: "relative w-full", children: [_jsx("div", { className: "absolute inset-y-0 start-0 flex items-center ps-3 pointer-events-none", children: _jsx("svg", { className: "w-4 h-4 text-gray-500 dark:text-gray-400", "aria-hidden": "true", xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 20 20", children: _jsx("path", { stroke: "currentColor", "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", d: "m19 19-4-4m0-7A7 7 0 1 1 1 8a7 7 0 0 1 14 0Z" }) }) }), _jsx("input", { type: "search", id: "default-search", className: "inline-block min-w-full p-3 ps-10 outline-none text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500", placeholder: "Search Taxonomies", required: true }), _jsx("button", { type: "submit", className: "text-white absolute end-1.5 bottom-1.5 bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-4 py-2 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800", children: "Search" })] })] }) }), _jsx("div", { className: "flex-grow ml-0 w-3/4", children: _jsx("form", { className: "w-auto" }) }), _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", style: { width: "200px" }, children: "Actions" }), _jsx("th", { scope: "col", className: "py-3.5 px-4 text-md font-normal text-left rtl:text-right text-gray-500 dark:text-gray-400", children: "Type" })] }) }), _jsx("tbody", { className: "bg-white divide-y divide-gray-200 dark:divide-gray-700 dark:bg-gray-900", children: paginatedTaxonomies
|
|
65
|
-
|
|
65
|
+
.filter((taxonomy) => taxonomy.isView)
|
|
66
66
|
.map((taxonomy, index) => (_jsxs("tr", { children: [_jsx("td", { className: "px-4 py-4 text-sm whitespace-nowrap", children: _jsx("div", { className: "flex items-center gap-x-6", children: taxonomy.isEdit ? (_jsx("button", { type: "button", onClick: (event) => {
|
|
67
67
|
handleViewClick(event, "/admin/taxinomies/taxonomyform?", taxonomy.id, taxonomy.type);
|
|
68
68
|
}, 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" }) }) })) : taxonomy.isView ? (_jsx("button", { onClick: (event) => {
|
package/package.json
CHANGED
|
@@ -1,3 +1,331 @@
|
|
|
1
|
+
// import React from "react";
|
|
2
|
+
// import { useState, useEffect } from "react";
|
|
3
|
+
|
|
4
|
+
// import { FaPlus } from "react-icons/fa";
|
|
5
|
+
// import { fetchTaxonomiessApi } from "../api/taxonomy";
|
|
6
|
+
|
|
7
|
+
// interface TaxionomiesProps {
|
|
8
|
+
// url: string;
|
|
9
|
+
// }
|
|
10
|
+
|
|
11
|
+
// const Taxionomies = ({ url }: TaxionomiesProps) => {
|
|
12
|
+
// const [taxonomy, setTaxonomy] = useState<any[]>([]);
|
|
13
|
+
|
|
14
|
+
// const fetchTaxonomiesData = async () => {
|
|
15
|
+
// const data = await fetchTaxonomiessApi(url);
|
|
16
|
+
// if (data) {
|
|
17
|
+
// const uniqueTaxonomies = (data as any[]).reduce(
|
|
18
|
+
// (acc: any[], item: any) => {
|
|
19
|
+
// if (
|
|
20
|
+
// !item.parentId &&
|
|
21
|
+
// !acc.some((taxonomy) => taxonomy.type === item.type)
|
|
22
|
+
// ) {
|
|
23
|
+
// acc.push(item);
|
|
24
|
+
// }
|
|
25
|
+
// return acc;
|
|
26
|
+
// },
|
|
27
|
+
// []
|
|
28
|
+
// );
|
|
29
|
+
|
|
30
|
+
// setTaxonomy(uniqueTaxonomies);
|
|
31
|
+
// } else {
|
|
32
|
+
// console.error("Failed to fetch taxonomies");
|
|
33
|
+
// }
|
|
34
|
+
// };
|
|
35
|
+
|
|
36
|
+
// useEffect(() => {
|
|
37
|
+
// fetchTaxonomiesData();
|
|
38
|
+
// }, []);
|
|
39
|
+
|
|
40
|
+
// const [currentPage, setCurrentPage] = useState(1);
|
|
41
|
+
// const itemsPerPage = 10;
|
|
42
|
+
|
|
43
|
+
// const totalPages = Math.ceil(taxonomy.length / itemsPerPage);
|
|
44
|
+
|
|
45
|
+
// const handleNextPage = () => {
|
|
46
|
+
// if (currentPage < totalPages) {
|
|
47
|
+
// setCurrentPage(currentPage + 1);
|
|
48
|
+
// }
|
|
49
|
+
// };
|
|
50
|
+
|
|
51
|
+
// const handlePreviousPage = () => {
|
|
52
|
+
// if (currentPage > 1) {
|
|
53
|
+
// setCurrentPage(currentPage - 1);
|
|
54
|
+
// }
|
|
55
|
+
// };
|
|
56
|
+
|
|
57
|
+
// const handlePageClick = (pageNumber: number) => {
|
|
58
|
+
// setCurrentPage(pageNumber);
|
|
59
|
+
// };
|
|
60
|
+
|
|
61
|
+
// const paginatedTaxonomies = taxonomy.slice(
|
|
62
|
+
// (currentPage - 1) * itemsPerPage,
|
|
63
|
+
// currentPage * itemsPerPage
|
|
64
|
+
// );
|
|
65
|
+
|
|
66
|
+
// const handleNavigation = (event: React.MouseEvent, path: string) => {
|
|
67
|
+
// event.preventDefault();
|
|
68
|
+
// window.history.pushState({}, "", path);
|
|
69
|
+
// window.dispatchEvent(new PopStateEvent("popstate"));
|
|
70
|
+
// };
|
|
71
|
+
|
|
72
|
+
// const handleViewClick = (
|
|
73
|
+
// event: React.MouseEvent,
|
|
74
|
+
// path: string,
|
|
75
|
+
// id: string,
|
|
76
|
+
// type: string
|
|
77
|
+
// ) => {
|
|
78
|
+
// event.preventDefault();
|
|
79
|
+
|
|
80
|
+
// const queryParams = new URLSearchParams({ id, type });
|
|
81
|
+
// const fullPath = `${path}${queryParams.toString()}`;
|
|
82
|
+
|
|
83
|
+
// window.history.pushState({ id, type }, "", fullPath);
|
|
84
|
+
|
|
85
|
+
// window.dispatchEvent(new PopStateEvent("popstate"));
|
|
86
|
+
// };
|
|
87
|
+
|
|
88
|
+
// return (
|
|
89
|
+
// <div className="container px-4 mx-auto mt-6 h-full">
|
|
90
|
+
// <div className="w-3/4">
|
|
91
|
+
// <h1 className="text-3xl font-bold text-blue-600 mb-5">Taxonomy</h1>
|
|
92
|
+
// </div>
|
|
93
|
+
// <div className="flex-grow ml-0 w-full mt-10">
|
|
94
|
+
// <form className="w-full ">
|
|
95
|
+
// <label
|
|
96
|
+
// htmlFor="default-search"
|
|
97
|
+
// className="mb-2 text-sm font-medium text-gray-900 sr-only dark:text-white"
|
|
98
|
+
// >
|
|
99
|
+
// Search
|
|
100
|
+
// </label>
|
|
101
|
+
// <div className="relative w-full">
|
|
102
|
+
// <div className="absolute inset-y-0 start-0 flex items-center ps-3 pointer-events-none">
|
|
103
|
+
// <svg
|
|
104
|
+
// className="w-4 h-4 text-gray-500 dark:text-gray-400"
|
|
105
|
+
// aria-hidden="true"
|
|
106
|
+
// xmlns="http://www.w3.org/2000/svg"
|
|
107
|
+
// fill="none"
|
|
108
|
+
// viewBox="0 0 20 20"
|
|
109
|
+
// >
|
|
110
|
+
// <path
|
|
111
|
+
// stroke="currentColor"
|
|
112
|
+
// stroke-linecap="round"
|
|
113
|
+
// stroke-linejoin="round"
|
|
114
|
+
// stroke-width="2"
|
|
115
|
+
// d="m19 19-4-4m0-7A7 7 0 1 1 1 8a7 7 0 0 1 14 0Z"
|
|
116
|
+
// />
|
|
117
|
+
// </svg>
|
|
118
|
+
// </div>
|
|
119
|
+
// <input
|
|
120
|
+
// type="search"
|
|
121
|
+
// id="default-search"
|
|
122
|
+
// className="inline-block min-w-full p-3 ps-10 outline-none text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
|
|
123
|
+
// placeholder="Search Taxonomies"
|
|
124
|
+
// required
|
|
125
|
+
// />
|
|
126
|
+
// <button
|
|
127
|
+
// type="submit"
|
|
128
|
+
// className="text-white absolute end-1.5 bottom-1.5 bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-4 py-2 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"
|
|
129
|
+
// >
|
|
130
|
+
// Search
|
|
131
|
+
// </button>
|
|
132
|
+
// </div>
|
|
133
|
+
// </form>
|
|
134
|
+
// </div>
|
|
135
|
+
// <div className="flex-grow ml-0 w-3/4">
|
|
136
|
+
// <form className="w-auto">{/* Search Form */}</form>
|
|
137
|
+
// </div>
|
|
138
|
+
// <div className="flex-grow ml-0 mt-4 w-full">
|
|
139
|
+
// <div className="overflow-hidden border border-gray-200 dark:border-gray-700 md:rounded-lg mt-6">
|
|
140
|
+
// <table className="min-w-full divide-y divide-gray-200 dark:divide-gray-700">
|
|
141
|
+
// <thead className="bg-gray-50 dark:bg-gray-800">
|
|
142
|
+
// <tr>
|
|
143
|
+
// <th
|
|
144
|
+
// scope="col"
|
|
145
|
+
// className="px-4 py-3.5 text-md font-normal text-left rtl:text-right text-gray-500 dark:text-gray-400"
|
|
146
|
+
// style={{ width: "200px" }}
|
|
147
|
+
// >
|
|
148
|
+
// Actions
|
|
149
|
+
// </th>
|
|
150
|
+
// <th
|
|
151
|
+
// scope="col"
|
|
152
|
+
// className="py-3.5 px-4 text-md font-normal text-left rtl:text-right text-gray-500 dark:text-gray-400"
|
|
153
|
+
// >
|
|
154
|
+
// Type
|
|
155
|
+
// </th>
|
|
156
|
+
// </tr>
|
|
157
|
+
// </thead>
|
|
158
|
+
// <tbody className="bg-white divide-y divide-gray-200 dark:divide-gray-700 dark:bg-gray-900">
|
|
159
|
+
// {paginatedTaxonomies
|
|
160
|
+
// .filter((taxonomy) => taxonomy.isView)
|
|
161
|
+
// .map((taxonomy, index) => (
|
|
162
|
+
// <tr key={taxonomy.id || index}>
|
|
163
|
+
// <td className="px-4 py-4 text-sm whitespace-nowrap">
|
|
164
|
+
// <div className="flex items-center gap-x-6">
|
|
165
|
+
// {taxonomy.isEdit ? (
|
|
166
|
+
// <button
|
|
167
|
+
// type="button"
|
|
168
|
+
// onClick={(event) => {
|
|
169
|
+
// handleViewClick(
|
|
170
|
+
// event,
|
|
171
|
+
// "/admin/taxinomies/taxonomyform?",
|
|
172
|
+
// taxonomy.id,
|
|
173
|
+
// taxonomy.type
|
|
174
|
+
// );
|
|
175
|
+
// }}
|
|
176
|
+
// className="text-gray-500 transition-colors duration-200 dark:hover:text-yellow-500 dark:text-gray-300 hover:text-yellow-500 focus:outline-none"
|
|
177
|
+
// >
|
|
178
|
+
// {/* Edit icon */}
|
|
179
|
+
// <svg
|
|
180
|
+
// xmlns="http://www.w3.org/2000/svg"
|
|
181
|
+
// fill="none"
|
|
182
|
+
// viewBox="0 0 24 24"
|
|
183
|
+
// stroke-width="1.5"
|
|
184
|
+
// stroke="currentColor"
|
|
185
|
+
// className="w-5 h-5"
|
|
186
|
+
// >
|
|
187
|
+
// <path
|
|
188
|
+
// stroke-linecap="round"
|
|
189
|
+
// stroke-linejoin="round"
|
|
190
|
+
// 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"
|
|
191
|
+
// />
|
|
192
|
+
// </svg>
|
|
193
|
+
// </button>
|
|
194
|
+
// ) : taxonomy.isView ? (
|
|
195
|
+
// <button
|
|
196
|
+
// onClick={(event) => {
|
|
197
|
+
// handleViewClick(
|
|
198
|
+
// event,
|
|
199
|
+
// "/admin/taxinomies/taxonomyform?",
|
|
200
|
+
// taxonomy.id,
|
|
201
|
+
// taxonomy.type
|
|
202
|
+
// );
|
|
203
|
+
// }}
|
|
204
|
+
// className="text-gray-500 transition-colors duration-200 dark:hover:text-yellow-500 dark:text-gray-300 hover:text-blue-500 focus:outline-none"
|
|
205
|
+
// >
|
|
206
|
+
// {/* Eye icon */}
|
|
207
|
+
// <svg
|
|
208
|
+
// xmlns="http://www.w3.org/2000/svg"
|
|
209
|
+
// fill="none"
|
|
210
|
+
// viewBox="0 0 24 24"
|
|
211
|
+
// stroke-width="1.5"
|
|
212
|
+
// stroke="currentColor"
|
|
213
|
+
// className="w-5 h-5"
|
|
214
|
+
// >
|
|
215
|
+
// <path
|
|
216
|
+
// stroke-linecap="round"
|
|
217
|
+
// stroke-linejoin="round"
|
|
218
|
+
// d="M12 4.5c4.142 0 7.788 2.93 9 7.5-1.212 4.57-4.858 7.5-9 7.5s-7.788-2.93-9-7.5c1.212-4.57 4.858-7.5 9-7.5z"
|
|
219
|
+
// />
|
|
220
|
+
// <path
|
|
221
|
+
// stroke-linecap="round"
|
|
222
|
+
// stroke-linejoin="round"
|
|
223
|
+
// d="M12 9a3 3 0 100 6 3 3 0 000-6z"
|
|
224
|
+
// />
|
|
225
|
+
// </svg>
|
|
226
|
+
// </button>
|
|
227
|
+
// ) : null}
|
|
228
|
+
// </div>
|
|
229
|
+
// </td>
|
|
230
|
+
// <td className="px-4 py-4 text-sm font-medium text-gray-700 whitespace-nowrap">
|
|
231
|
+
// <div className="inline-flex items-center gap-x-3">
|
|
232
|
+
// <div className="flex items-center gap-x-2">
|
|
233
|
+
// <div>
|
|
234
|
+
// <h2 className=" text-sm font-medium text-gray-800 dark:text-white ">
|
|
235
|
+
// {taxonomy.type}
|
|
236
|
+
// </h2>
|
|
237
|
+
// </div>
|
|
238
|
+
// </div>
|
|
239
|
+
// </div>
|
|
240
|
+
// </td>
|
|
241
|
+
// </tr>
|
|
242
|
+
// ))}
|
|
243
|
+
// </tbody>
|
|
244
|
+
// </table>
|
|
245
|
+
// </div>
|
|
246
|
+
|
|
247
|
+
// <div className="flex items-center justify-between mt-6">
|
|
248
|
+
// <button
|
|
249
|
+
// onClick={handlePreviousPage}
|
|
250
|
+
// disabled={currentPage === 1}
|
|
251
|
+
// className="flex items-center px-5 py-2 text-sm text-gray-700 capitalize transition-colors duration-200 bg-white border rounded-md gap-x-2 hover:bg-gray-100 dark:bg-gray-900 dark:text-gray-200 dark:border-gray-700 dark:hover:bg-gray-800"
|
|
252
|
+
// >
|
|
253
|
+
// <svg
|
|
254
|
+
// xmlns="http://www.w3.org/2000/svg"
|
|
255
|
+
// fill="none"
|
|
256
|
+
// viewBox="0 0 24 24"
|
|
257
|
+
// stroke-width="1.5"
|
|
258
|
+
// stroke="currentColor"
|
|
259
|
+
// className="w-5 h-5 rtl:-scale-x-100"
|
|
260
|
+
// >
|
|
261
|
+
// <path
|
|
262
|
+
// stroke-linecap="round"
|
|
263
|
+
// stroke-linejoin="round"
|
|
264
|
+
// d="M6.75 15.75L3 12m0 0l3.75-3.75M3 12h18"
|
|
265
|
+
// />
|
|
266
|
+
// </svg>
|
|
267
|
+
|
|
268
|
+
// <span>previous</span>
|
|
269
|
+
// </button>
|
|
270
|
+
|
|
271
|
+
// <div className="items-center hidden lg:flex gap-x-3">
|
|
272
|
+
// {Array.from({ length: totalPages }, (_, index) => (
|
|
273
|
+
// <button
|
|
274
|
+
// key={index + 1}
|
|
275
|
+
// onClick={() => handlePageClick(index + 1)}
|
|
276
|
+
// className={`px-2 py-1 text-sm ${
|
|
277
|
+
// currentPage === index + 1
|
|
278
|
+
// ? "text-blue-500 bg-blue-100"
|
|
279
|
+
// : "text-gray-500 hover:bg-gray-100"
|
|
280
|
+
// } rounded-md`}
|
|
281
|
+
// >
|
|
282
|
+
// {index + 1}
|
|
283
|
+
// </button>
|
|
284
|
+
// ))}
|
|
285
|
+
// </div>
|
|
286
|
+
// <button
|
|
287
|
+
// onClick={handleNextPage}
|
|
288
|
+
// disabled={currentPage === totalPages}
|
|
289
|
+
// className="flex items-center px-5 py-2 text-sm text-gray-700 capitalize transition-colors duration-200 bg-white border rounded-md gap-x-2 hover:bg-gray-100 dark:bg-gray-900 dark:text-gray-200 dark:border-gray-700 dark:hover:bg-gray-800"
|
|
290
|
+
// >
|
|
291
|
+
// <span>Next</span>
|
|
292
|
+
|
|
293
|
+
// <svg
|
|
294
|
+
// xmlns="http://www.w3.org/2000/svg"
|
|
295
|
+
// fill="none"
|
|
296
|
+
// viewBox="0 0 24 24"
|
|
297
|
+
// stroke-width="1.5"
|
|
298
|
+
// stroke="currentColor"
|
|
299
|
+
// className="w-5 h-5 rtl:-scale-x-100"
|
|
300
|
+
// >
|
|
301
|
+
// <path
|
|
302
|
+
// stroke-linecap="round"
|
|
303
|
+
// stroke-linejoin="round"
|
|
304
|
+
// d="M17.25 8.25L21 12m0 0l-3.75 3.75M21 12H3"
|
|
305
|
+
// />
|
|
306
|
+
// </svg>
|
|
307
|
+
// </button>
|
|
308
|
+
// </div>
|
|
309
|
+
|
|
310
|
+
// <div className="flex-grow ml-0 mt-4 w-0 ">
|
|
311
|
+
// <button
|
|
312
|
+
// type="button"
|
|
313
|
+
// onClick={(event) =>
|
|
314
|
+
// handleNavigation(event, "/admin/taxinomies/taxonomyform")
|
|
315
|
+
// }
|
|
316
|
+
// 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"
|
|
317
|
+
// >
|
|
318
|
+
// <FaPlus className="mr-2 font-medium" />
|
|
319
|
+
// Taxonomy
|
|
320
|
+
// </button>
|
|
321
|
+
// </div>
|
|
322
|
+
// </div>
|
|
323
|
+
// </div>
|
|
324
|
+
// );
|
|
325
|
+
// };
|
|
326
|
+
|
|
327
|
+
// export default Taxionomies;
|
|
328
|
+
|
|
1
329
|
import React from "react";
|
|
2
330
|
import { useState, useEffect } from "react";
|
|
3
331
|
|
|
@@ -157,7 +485,7 @@ const Taxionomies = ({ url }: TaxionomiesProps) => {
|
|
|
157
485
|
</thead>
|
|
158
486
|
<tbody className="bg-white divide-y divide-gray-200 dark:divide-gray-700 dark:bg-gray-900">
|
|
159
487
|
{paginatedTaxonomies
|
|
160
|
-
|
|
488
|
+
.filter((taxonomy) => taxonomy.isView)
|
|
161
489
|
.map((taxonomy, index) => (
|
|
162
490
|
<tr key={taxonomy.id || index}>
|
|
163
491
|
<td className="px-4 py-4 text-sm whitespace-nowrap">
|