px-react-ui-components 1.0.0
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/.babelrc +3 -0
- package/README.md +126 -0
- package/dist/components/MyAlert/MyAlert.css +113 -0
- package/dist/components/MyAlert/MyAlert.js +109 -0
- package/dist/components/MyContainer/MyContainer.js +59 -0
- package/dist/components/MyContainer/MyContainer.module.css +110 -0
- package/dist/components/MyContainer/MyContainerBody.js +9 -0
- package/dist/components/MyContainer/MyContainerFooter.js +9 -0
- package/dist/components/MyContainer/MyContainerRight.js +10 -0
- package/dist/components/MyEditor/MyEditor.js +292 -0
- package/dist/components/MyEditor/MyEditor.scss +277 -0
- package/dist/components/MyFileUpload/MyFileUpload.js +288 -0
- package/dist/components/MyFileUpload/MyFileUpload.module.css +86 -0
- package/dist/components/MyImageCropper/MyImageCropper.js +95 -0
- package/dist/components/MyInput/MyInput.js +768 -0
- package/dist/components/MyInput/MyInput.module.css +420 -0
- package/dist/components/MyMaps/YandexMaps.js +162 -0
- package/dist/components/MyMenu/MenuItem.js +55 -0
- package/dist/components/MyMenu/MyMenu.module.css +102 -0
- package/dist/components/MyModal/MyModal.css +83 -0
- package/dist/components/MyModal/MyModal.js +71 -0
- package/dist/components/MyModal/MyModalBody.js +9 -0
- package/dist/components/MyModal/MyModalFooter.js +9 -0
- package/dist/components/MyNotFound/MyNotFound.css +22 -0
- package/dist/components/MyNotFound/MyNotFound.js +20 -0
- package/dist/components/MyScrollableCard/MyScrollableCard.js +74 -0
- package/dist/components/MyTable/MyTable.js +310 -0
- package/dist/components/MyTable/MyTable.module.css +350 -0
- package/dist/components/MyTable/MyTableBody.js +9 -0
- package/dist/components/MyTable/MyTableHead.js +9 -0
- package/dist/components/MyTabs/MyTabPane.js +17 -0
- package/dist/components/MyTabs/MyTabs.css +105 -0
- package/dist/components/MyTabs/MyTabs.js +66 -0
- package/dist/components/MyWaiting/MyWaiting.css +28 -0
- package/dist/components/MyWaiting/MyWaiting.js +27 -0
- package/dist/components/MyZoomImage/MyZoomImage.css +0 -0
- package/dist/components/MyZoomImage/MyZoomImage.js +108 -0
- package/dist/index.js +15 -0
- package/package.json +44 -0
- package/src/components/MyAlert/MyAlert.css +113 -0
- package/src/components/MyAlert/MyAlert.jsx +96 -0
- package/src/components/MyContainer/MyContainer.jsx +90 -0
- package/src/components/MyContainer/MyContainer.module.css +110 -0
- package/src/components/MyContainer/MyContainerBody.jsx +8 -0
- package/src/components/MyContainer/MyContainerFooter.jsx +8 -0
- package/src/components/MyContainer/MyContainerRight.jsx +11 -0
- package/src/components/MyEditor/MyEditor.jsx +252 -0
- package/src/components/MyEditor/MyEditor.scss +277 -0
- package/src/components/MyFileUpload/MyFileUpload.jsx +373 -0
- package/src/components/MyFileUpload/MyFileUpload.module.css +86 -0
- package/src/components/MyImageCropper/MyImageCropper.jsx +108 -0
- package/src/components/MyInput/MyInput.jsx +896 -0
- package/src/components/MyInput/MyInput.module.css +420 -0
- package/src/components/MyMaps/YandexMaps.jsx +186 -0
- package/src/components/MyMenu/MenuItem.jsx +62 -0
- package/src/components/MyMenu/MyMenu.module.css +102 -0
- package/src/components/MyModal/MyModal.css +83 -0
- package/src/components/MyModal/MyModal.jsx +78 -0
- package/src/components/MyModal/MyModalBody.jsx +8 -0
- package/src/components/MyModal/MyModalFooter.jsx +8 -0
- package/src/components/MyNotFound/MyNotFound.css +22 -0
- package/src/components/MyNotFound/MyNotFound.jsx +11 -0
- package/src/components/MyScrollableCard/MyScrollableCard.jsx +86 -0
- package/src/components/MyTable/MyTable.jsx +458 -0
- package/src/components/MyTable/MyTable.module.css +350 -0
- package/src/components/MyTable/MyTableBody.jsx +8 -0
- package/src/components/MyTable/MyTableHead.jsx +10 -0
- package/src/components/MyTabs/MyTabPane.jsx +9 -0
- package/src/components/MyTabs/MyTabs.css +105 -0
- package/src/components/MyTabs/MyTabs.jsx +63 -0
- package/src/components/MyWaiting/MyWaiting.css +28 -0
- package/src/components/MyWaiting/MyWaiting.jsx +27 -0
- package/src/components/MyZoomImage/MyZoomImage.css +0 -0
- package/src/components/MyZoomImage/MyZoomImage.jsx +139 -0
- package/src/index.js +15 -0
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
import React, { useEffect, useState } from "react";
|
|
2
|
+
import styles from "./MyTable.module.css";
|
|
3
|
+
import { useTranslation } from "../../context/TranslationContext";
|
|
4
|
+
export const MyTableIsNumeric = value => {
|
|
5
|
+
if (value === null || value === undefined || value === "") return false;
|
|
6
|
+
return !isNaN(value) && !isNaN(parseFloat(value));
|
|
7
|
+
};
|
|
8
|
+
export const CountBlock = ({
|
|
9
|
+
count
|
|
10
|
+
}) => {
|
|
11
|
+
const {
|
|
12
|
+
t
|
|
13
|
+
} = useTranslation();
|
|
14
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
15
|
+
className: styles.rowsCount
|
|
16
|
+
}, /*#__PURE__*/React.createElement("span", null, count), /*#__PURE__*/React.createElement("small", null, t("kayıt listelendi")));
|
|
17
|
+
};
|
|
18
|
+
function MyTable({
|
|
19
|
+
columns = [],
|
|
20
|
+
//
|
|
21
|
+
data = null,
|
|
22
|
+
emptyText = "",
|
|
23
|
+
children,
|
|
24
|
+
height = null,
|
|
25
|
+
totalCount = null,
|
|
26
|
+
onSearchText = null,
|
|
27
|
+
searchable = false,
|
|
28
|
+
showCount = false,
|
|
29
|
+
pageSize = 0,
|
|
30
|
+
selectedRow = null,
|
|
31
|
+
onRowClick = null,
|
|
32
|
+
onPageChange = null
|
|
33
|
+
}) {
|
|
34
|
+
const {
|
|
35
|
+
t
|
|
36
|
+
} = useTranslation();
|
|
37
|
+
const tableid = `key${Date.now() + Math.random().toString(36).substr(2, 9)}`;
|
|
38
|
+
const [curEmptyText, setCurEmptyText] = useState(emptyText);
|
|
39
|
+
const [curTotalCount, setCurTotalCount] = useState(data ? data.length : totalCount);
|
|
40
|
+
const [searchTerm, setSearchTerm] = useState("");
|
|
41
|
+
const [filteredRows, setFilteredRows] = useState([]);
|
|
42
|
+
const [currentPage, setCurrentPage] = useState(1);
|
|
43
|
+
const [totalPages, setTotalPages] = useState(0);
|
|
44
|
+
const [sortConfig, setSortConfig] = useState({
|
|
45
|
+
key: null,
|
|
46
|
+
direction: "asc"
|
|
47
|
+
});
|
|
48
|
+
const [displayData, setDisplayData] = useState([]);
|
|
49
|
+
const arrChild = React.Children.toArray(children);
|
|
50
|
+
let childHeader = null;
|
|
51
|
+
let childBody = null;
|
|
52
|
+
if (arrChild.length > 0) {
|
|
53
|
+
for (let i = 0; i < arrChild.length; i++) {
|
|
54
|
+
const el = arrChild[i];
|
|
55
|
+
if (el.type.toString().includes("MyTableTagHead")) {
|
|
56
|
+
childHeader = el;
|
|
57
|
+
} else if (el.type.toString().includes("MyTableTagBody")) {
|
|
58
|
+
childBody = el;
|
|
59
|
+
} else if (childBody == null) {
|
|
60
|
+
childBody = el;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// Veri işleme ve sıralama
|
|
66
|
+
useEffect(() => {
|
|
67
|
+
let processedData = Array.isArray(data) ? [...data] : [];
|
|
68
|
+
|
|
69
|
+
// Arama işlemi
|
|
70
|
+
if (searchTerm != "") {
|
|
71
|
+
processedData = processedData.filter(record => {
|
|
72
|
+
let _status = false;
|
|
73
|
+
Object.keys(record).forEach(key => {
|
|
74
|
+
if (record[key] && record[key].toString().toLocaleLowerCase().includes(searchTerm.toLocaleLowerCase())) {
|
|
75
|
+
_status = true;
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
return _status;
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
setTotalPages(Math.ceil(processedData.length / pageSize));
|
|
82
|
+
|
|
83
|
+
// Sıralama işlemi
|
|
84
|
+
if (sortConfig.key) {
|
|
85
|
+
processedData.sort((a, b) => {
|
|
86
|
+
const aValue = a[sortConfig.key];
|
|
87
|
+
const bValue = b[sortConfig.key];
|
|
88
|
+
if (MyTableIsNumeric(aValue) && MyTableIsNumeric(bValue)) {
|
|
89
|
+
return sortConfig.direction === "asc" ? Number(aValue) - Number(bValue) : Number(bValue) - Number(aValue);
|
|
90
|
+
}
|
|
91
|
+
return sortConfig.direction === "asc" ? String(aValue).localeCompare(String(bValue)) : String(bValue).localeCompare(String(aValue));
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// Sayfalama
|
|
96
|
+
if (pageSize > 0) {
|
|
97
|
+
const startIndex = (currentPage - 1) * pageSize;
|
|
98
|
+
processedData = processedData.slice(startIndex, startIndex + pageSize);
|
|
99
|
+
}
|
|
100
|
+
setDisplayData(processedData);
|
|
101
|
+
if (data) {
|
|
102
|
+
setCurTotalCount(data.length);
|
|
103
|
+
} else {
|
|
104
|
+
setCurTotalCount(0);
|
|
105
|
+
}
|
|
106
|
+
}, [data, searchTerm, sortConfig, currentPage, pageSize]);
|
|
107
|
+
useEffect(() => {
|
|
108
|
+
if (emptyText == "") {
|
|
109
|
+
setCurEmptyText(t("Henüz bir kayıt mevcut değil!"));
|
|
110
|
+
}
|
|
111
|
+
return () => {};
|
|
112
|
+
}, [tableid]);
|
|
113
|
+
|
|
114
|
+
// Arama işlevi
|
|
115
|
+
const filterRows = row => {
|
|
116
|
+
if (!searchTerm) return true;
|
|
117
|
+
const cells = row.props.children;
|
|
118
|
+
return React.Children.toArray(cells).some(cell => {
|
|
119
|
+
const cellText = cell.props.children ? cell.props.children.toString().trim().toLocaleLowerCase() : "";
|
|
120
|
+
const cleanCellText = cellText.replace(/[^a-zA-Z0-9\s]/g, ""); // Virgül ve diğer özel karakterleri temizle
|
|
121
|
+
const cleanSearchTerm = searchTerm.replace(/[^a-zA-Z0-9\s]/g, "").toLocaleLowerCase(); // Aynı şekilde arama terimini temizle
|
|
122
|
+
|
|
123
|
+
return cleanCellText.includes(cleanSearchTerm);
|
|
124
|
+
});
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
// Sıralama işleyicisi
|
|
128
|
+
const handleSort = key => {
|
|
129
|
+
setSortConfig(prevSort => ({
|
|
130
|
+
key,
|
|
131
|
+
direction: prevSort.key === key && prevSort.direction === "asc" ? "desc" : "asc"
|
|
132
|
+
}));
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
// Sütun başlığı render fonksiyonu
|
|
136
|
+
const renderColumnHeader = column => {
|
|
137
|
+
const isSorted = sortConfig.key === column.key;
|
|
138
|
+
const sortDirection = isSorted ? sortConfig.direction : null;
|
|
139
|
+
let style = {};
|
|
140
|
+
if (column.style) style = {
|
|
141
|
+
...style,
|
|
142
|
+
...column.style
|
|
143
|
+
};
|
|
144
|
+
if (column.width) style = {
|
|
145
|
+
...style,
|
|
146
|
+
width: column.width
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
//style = { ...style, minWidth: column.width || "150px" };
|
|
150
|
+
|
|
151
|
+
return /*#__PURE__*/React.createElement("th", {
|
|
152
|
+
key: "head" + column.key + btoa(Math.random().toString(36).substr(2, 9)),
|
|
153
|
+
onClick: column.sortable ? () => handleSort(column.key) : undefined,
|
|
154
|
+
className: `
|
|
155
|
+
${styles.th}
|
|
156
|
+
${column.className && column.className || ""}
|
|
157
|
+
${column.sortable ? styles.sortable : ""}
|
|
158
|
+
${isSorted ? styles[`sort-${sortDirection}`] : ""}
|
|
159
|
+
`,
|
|
160
|
+
style: style
|
|
161
|
+
}, column.title);
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
// Hücre render fonksiyonu
|
|
165
|
+
const renderCell = (item, column, index) => {
|
|
166
|
+
const value = item[column.key];
|
|
167
|
+
const content = column.render ? column.render(value, item, index, currentPage) : value;
|
|
168
|
+
const key = "cell" + column.key + btoa(Math.random().toString(36).substr(2, 9));
|
|
169
|
+
|
|
170
|
+
// If the content is already a React element (like from a render function that returns MathJax),
|
|
171
|
+
// just return it directly in the cell
|
|
172
|
+
if (/*#__PURE__*/React.isValidElement(content)) {
|
|
173
|
+
return /*#__PURE__*/React.createElement("td", {
|
|
174
|
+
key: key,
|
|
175
|
+
style: column.tdStyle,
|
|
176
|
+
className: `${styles.td} ${column.tdClassName && column.tdClassName || ""}`,
|
|
177
|
+
"data-row-index": index
|
|
178
|
+
}, content);
|
|
179
|
+
}
|
|
180
|
+
return /*#__PURE__*/React.createElement("td", {
|
|
181
|
+
key: key,
|
|
182
|
+
style: column.tdStyle,
|
|
183
|
+
className: `${styles.td} ${column.tdClassName && column.tdClassName || ""}`,
|
|
184
|
+
"data-row-index": index
|
|
185
|
+
}, typeof content === 'string' ? /*#__PURE__*/React.createElement("span", {
|
|
186
|
+
dangerouslySetInnerHTML: {
|
|
187
|
+
__html: content
|
|
188
|
+
}
|
|
189
|
+
}) : content);
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
// Filtrelenen satırları güncelle
|
|
193
|
+
useEffect(() => {
|
|
194
|
+
if (onSearchText == null) {
|
|
195
|
+
if (childBody) {
|
|
196
|
+
const rows = React.Children.toArray(childBody.props.children);
|
|
197
|
+
const filtered = rows.filter(row => filterRows(row));
|
|
198
|
+
setFilteredRows(filtered);
|
|
199
|
+
}
|
|
200
|
+
} else {
|
|
201
|
+
onSearchText(searchTerm);
|
|
202
|
+
}
|
|
203
|
+
}, [searchTerm, children]);
|
|
204
|
+
|
|
205
|
+
// Sayfa değiştirme işleyicisi
|
|
206
|
+
const handlePageChange = page => {
|
|
207
|
+
setCurrentPage(page);
|
|
208
|
+
};
|
|
209
|
+
// Sayfalama render fonksiyonu
|
|
210
|
+
const renderPagination = () => {
|
|
211
|
+
if (pageSize == 0 || totalPages <= 1) return null;
|
|
212
|
+
const maxVisiblePages = 10;
|
|
213
|
+
let pagesToShow = [];
|
|
214
|
+
if (totalPages <= maxVisiblePages) {
|
|
215
|
+
// Toplam sayfa sayısı 10 veya daha az ise hepsini göster
|
|
216
|
+
pagesToShow = Array.from({
|
|
217
|
+
length: totalPages
|
|
218
|
+
}, (_, i) => i + 1);
|
|
219
|
+
} else {
|
|
220
|
+
// Her zaman ilk ve son sayfayı göster
|
|
221
|
+
// Aktif sayfanın etrafında dengeli dağılım yap
|
|
222
|
+
const sidePages = 4; // Aktif sayfanın her iki yanında kaç sayfa gösterileceği
|
|
223
|
+
|
|
224
|
+
if (currentPage <= sidePages + 1) {
|
|
225
|
+
// Başlangıçtayız
|
|
226
|
+
pagesToShow = [...Array(maxVisiblePages - 1).keys()].map(i => i + 1);
|
|
227
|
+
pagesToShow.push(totalPages);
|
|
228
|
+
} else if (currentPage >= totalPages - sidePages) {
|
|
229
|
+
// Sondayız
|
|
230
|
+
pagesToShow = [1];
|
|
231
|
+
pagesToShow.push(...Array.from({
|
|
232
|
+
length: maxVisiblePages - 1
|
|
233
|
+
}, (_, i) => totalPages - (maxVisiblePages - 2) + i));
|
|
234
|
+
} else {
|
|
235
|
+
// Ortadayız
|
|
236
|
+
pagesToShow = [1];
|
|
237
|
+
const start = currentPage - Math.floor((maxVisiblePages - 4) / 2);
|
|
238
|
+
const end = currentPage + Math.floor((maxVisiblePages - 4) / 2);
|
|
239
|
+
pagesToShow.push(...Array.from({
|
|
240
|
+
length: end - start + 1
|
|
241
|
+
}, (_, i) => start + i));
|
|
242
|
+
pagesToShow.push(totalPages);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
246
|
+
className: styles.pagination
|
|
247
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
248
|
+
onClick: () => handlePageChange(currentPage - 1),
|
|
249
|
+
disabled: currentPage === 1,
|
|
250
|
+
className: styles.pageButton
|
|
251
|
+
}, "<"), pagesToShow.map((page, index) => /*#__PURE__*/React.createElement(React.Fragment, {
|
|
252
|
+
key: page
|
|
253
|
+
}, index > 0 && pagesToShow[index] - pagesToShow[index - 1] > 1 && /*#__PURE__*/React.createElement("span", {
|
|
254
|
+
className: styles.pageEllipsis
|
|
255
|
+
}, "..."), /*#__PURE__*/React.createElement("button", {
|
|
256
|
+
onClick: () => handlePageChange(page),
|
|
257
|
+
className: `${styles.pageButton} ${currentPage === page ? styles.activePage : ""}`
|
|
258
|
+
}, page))), /*#__PURE__*/React.createElement("button", {
|
|
259
|
+
onClick: () => handlePageChange(currentPage + 1),
|
|
260
|
+
disabled: currentPage === totalPages,
|
|
261
|
+
className: styles.pageButton
|
|
262
|
+
}, ">"));
|
|
263
|
+
};
|
|
264
|
+
const headerCellsCount = columns.filter(column => column.title).length > 0 ? columns.filter(column => column.title).length : childBody ? React.Children.count(childBody.props.children.props.children) : 0;
|
|
265
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
266
|
+
id: tableid,
|
|
267
|
+
className: `${styles.myTableContainer} ${searchable && styles.searchable} ${totalPages > 0 && styles.myTablePagination}`,
|
|
268
|
+
style: {
|
|
269
|
+
height: height
|
|
270
|
+
}
|
|
271
|
+
}, searchable && /*#__PURE__*/React.createElement("div", {
|
|
272
|
+
className: styles.searchContainer
|
|
273
|
+
}, /*#__PURE__*/React.createElement("input", {
|
|
274
|
+
type: "text",
|
|
275
|
+
placeholder: t("Ara"),
|
|
276
|
+
value: searchTerm,
|
|
277
|
+
className: styles.searchInput,
|
|
278
|
+
onChange: e => setSearchTerm(e.target.value)
|
|
279
|
+
}), /*#__PURE__*/React.createElement(CountBlock, {
|
|
280
|
+
count: curTotalCount && curTotalCount || childBody && childBody.props.children.length || 0
|
|
281
|
+
})) || showCount && /*#__PURE__*/React.createElement(CountBlock, {
|
|
282
|
+
count: curTotalCount && curTotalCount || childBody && childBody.props.children.length || 0
|
|
283
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
284
|
+
className: styles.myTable
|
|
285
|
+
}, /*#__PURE__*/React.createElement("table", {
|
|
286
|
+
className: styles.table
|
|
287
|
+
}, columns.filter(column => column.title).length > 0 ? /*#__PURE__*/React.createElement("thead", {
|
|
288
|
+
className: styles.thead
|
|
289
|
+
}, /*#__PURE__*/React.createElement("tr", {
|
|
290
|
+
className: styles.tr
|
|
291
|
+
}, columns.filter(column => column.title).map(renderColumnHeader))) : childHeader, /*#__PURE__*/React.createElement("tbody", null, onSearchText && childBody && childBody.props.children.length > 0 && childBody.props.children || filteredRows && filteredRows.length > 0 && filteredRows || displayData.length > 0 && displayData.map((item, index) => /*#__PURE__*/React.createElement("tr", {
|
|
292
|
+
key: index,
|
|
293
|
+
onClick: () => onRowClick && onRowClick(item),
|
|
294
|
+
className: `
|
|
295
|
+
${styles.tr}
|
|
296
|
+
${onRowClick ? styles.clickable : ""}
|
|
297
|
+
${selectedRow === item ? styles.selected : ""}
|
|
298
|
+
`
|
|
299
|
+
}, columns.filter(column => column.title).map(column => renderCell(item, column, index)), children && /*#__PURE__*/React.createElement("td", null, typeof children === "function" ? children(item) : children))) || /*#__PURE__*/React.createElement("tr", {
|
|
300
|
+
className: styles.noData + " " + styles.tr
|
|
301
|
+
}, /*#__PURE__*/React.createElement("td", {
|
|
302
|
+
colSpan: headerCellsCount,
|
|
303
|
+
className: styles.td
|
|
304
|
+
}, searchTerm != "" && /*#__PURE__*/React.createElement("span", {
|
|
305
|
+
dangerouslySetInnerHTML: {
|
|
306
|
+
__html: `${t("Aradığınız kriterlere uygun kayıt bulunamadı!")}<br/><b>(${searchTerm})</b>`
|
|
307
|
+
}
|
|
308
|
+
}) || curEmptyText))))), totalPages > 0 && renderPagination());
|
|
309
|
+
}
|
|
310
|
+
export default MyTable;
|
|
@@ -0,0 +1,350 @@
|
|
|
1
|
+
.myTableContainer {
|
|
2
|
+
position: relative;
|
|
3
|
+
background: #fbfbfd;
|
|
4
|
+
border: 1px solid #dadada;
|
|
5
|
+
border-radius: 8px;
|
|
6
|
+
height: 100%;
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
overflow: hidden;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.myTableContainer::-webkit-scrollbar {
|
|
13
|
+
width: 8px;
|
|
14
|
+
height: 8px;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.myTableContainer::-webkit-scrollbar-track {
|
|
18
|
+
background: #e0e0e0;
|
|
19
|
+
border-radius: 10px;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.myTableContainer::-webkit-scrollbar-thumb {
|
|
23
|
+
background-color: #888;
|
|
24
|
+
border-radius: 10px;
|
|
25
|
+
border: 2px solid #e0e0e0;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.myTableContainer::-webkit-scrollbar-thumb:hover {
|
|
29
|
+
background-color: #555;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.rowsCount {
|
|
33
|
+
display: flex;
|
|
34
|
+
flex-direction: column;
|
|
35
|
+
justify-items: center;
|
|
36
|
+
align-items: end;
|
|
37
|
+
gap: 0px;
|
|
38
|
+
line-height: 0.8rem;
|
|
39
|
+
font-size: 13px;
|
|
40
|
+
font-weight: 300;
|
|
41
|
+
}
|
|
42
|
+
.rowsCount span{
|
|
43
|
+
font-weight: 500;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.searchContainer {
|
|
47
|
+
position: relative;
|
|
48
|
+
width: 100%;
|
|
49
|
+
flex-shrink: 0;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.searchContainer .rowsCount {
|
|
53
|
+
position: absolute;
|
|
54
|
+
right: 10px;
|
|
55
|
+
top: 50%;
|
|
56
|
+
transform: translateY(-50%);
|
|
57
|
+
z-index: 2;
|
|
58
|
+
font-size: 13px;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.searchInput {
|
|
62
|
+
width: 100%;
|
|
63
|
+
padding: 8px 10px 5px 10px;
|
|
64
|
+
margin-bottom: 1px;
|
|
65
|
+
border-radius: 8px 8px 0 0;
|
|
66
|
+
outline: none;
|
|
67
|
+
background: #f5f6f7;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.searchable .myTable {
|
|
71
|
+
border-radius: 0 0 8px 8px;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.myTable {
|
|
75
|
+
width: 100%;
|
|
76
|
+
height: 100% ;
|
|
77
|
+
overflow: auto;
|
|
78
|
+
-webkit-overflow-scrolling: touch;
|
|
79
|
+
scrollbar-width: thin;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.myTablePagination {
|
|
83
|
+
height: calc(100% - 50px);
|
|
84
|
+
height: 50px;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.table {
|
|
88
|
+
width: 100%;
|
|
89
|
+
min-width: 300px;
|
|
90
|
+
table-layout: auto;
|
|
91
|
+
border-collapse: separate;
|
|
92
|
+
border-spacing: 0;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.thead {
|
|
96
|
+
position: sticky;
|
|
97
|
+
top: 0;
|
|
98
|
+
background-color: #dce3eb;
|
|
99
|
+
box-shadow: 0 2px 6px rgba(97, 98, 100, 0.301);
|
|
100
|
+
/* #dce3eb */
|
|
101
|
+
z-index: 1;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.th {
|
|
105
|
+
background-color: #dce3eb;
|
|
106
|
+
padding: 8px 4px;
|
|
107
|
+
font-weight: 500;
|
|
108
|
+
font-size: 13px;
|
|
109
|
+
text-align: left;
|
|
110
|
+
white-space: nowrap;
|
|
111
|
+
overflow: hidden;
|
|
112
|
+
text-overflow: ellipsis;
|
|
113
|
+
border-right: 1px solid #bdc7d4 !important;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.th,
|
|
117
|
+
.td {
|
|
118
|
+
border-collapse: collapse;
|
|
119
|
+
border-right: 1px solid #d0d6de;
|
|
120
|
+
border-bottom: 1px solid #d0d6de;
|
|
121
|
+
}
|
|
122
|
+
.th[data-width],
|
|
123
|
+
.td[data-width] {
|
|
124
|
+
width: attr(data-width); /* data attribute ile genişlik belirleme */
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.th:last-child,
|
|
128
|
+
.td:last-child {
|
|
129
|
+
border-right: none;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.leftAlign {
|
|
133
|
+
text-align: left;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.tr {
|
|
137
|
+
background-color: #fff;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.tr:nth-child(2n + 1) {
|
|
141
|
+
background-color: #eff3f3;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.tr:hover {
|
|
145
|
+
cursor: default;
|
|
146
|
+
background-color: #d6eff0;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
.td {
|
|
152
|
+
font-size: 13px;
|
|
153
|
+
font-weight: normal;
|
|
154
|
+
padding: 5px;
|
|
155
|
+
white-space: nowrap;
|
|
156
|
+
overflow: hidden;
|
|
157
|
+
text-overflow: ellipsis;
|
|
158
|
+
text-wrap: balance;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.tableBtn {
|
|
162
|
+
cursor: pointer;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.td button {
|
|
166
|
+
background-color: unset;
|
|
167
|
+
border: none;
|
|
168
|
+
border-radius: 8px;
|
|
169
|
+
color: #1d4736;
|
|
170
|
+
padding: 7px;
|
|
171
|
+
white-space: nowrap;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.td button:hover {
|
|
175
|
+
background-color: #0c696a;
|
|
176
|
+
color: #fff;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.noData {
|
|
180
|
+
background-color: unset !important;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.noData td {
|
|
184
|
+
text-align: center;
|
|
185
|
+
color: #888;
|
|
186
|
+
font-style: italic;
|
|
187
|
+
font-size: 15px;
|
|
188
|
+
padding: 50px 0;
|
|
189
|
+
border-bottom: none;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.paginationContainer {
|
|
193
|
+
height: 50px;
|
|
194
|
+
width: 100%;
|
|
195
|
+
background: #f0f2f3;
|
|
196
|
+
border-radius: 0 0 8px 8px;
|
|
197
|
+
flex-shrink: 0;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.pagination {
|
|
201
|
+
height: auto;
|
|
202
|
+
width: 100%;
|
|
203
|
+
display: flex;
|
|
204
|
+
flex-wrap: wrap;
|
|
205
|
+
justify-content: center;
|
|
206
|
+
align-items: center;
|
|
207
|
+
gap: 4px;
|
|
208
|
+
background: #f0f2f3;
|
|
209
|
+
padding: 2px 10px;
|
|
210
|
+
box-shadow: 0 -1px 5px rgba(97, 98, 100, 0.301);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.pageButton {
|
|
214
|
+
min-width: 32px;
|
|
215
|
+
padding: 4px 8px;
|
|
216
|
+
border: 1px solid #dee2e6;
|
|
217
|
+
background: #f8f8f8;
|
|
218
|
+
color: #000;
|
|
219
|
+
cursor: pointer;
|
|
220
|
+
border-radius: 4px;
|
|
221
|
+
font-size: 13px;
|
|
222
|
+
font-weight: normal;
|
|
223
|
+
display: flex;
|
|
224
|
+
align-items: center;
|
|
225
|
+
justify-content: center;
|
|
226
|
+
touch-action: manipulation;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.pageButton:hover:not(:disabled) {
|
|
230
|
+
background-color: #e9ecef;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.pageButton:disabled {
|
|
234
|
+
opacity: 0.5;
|
|
235
|
+
cursor: not-allowed;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
.pageEllipsis {
|
|
239
|
+
padding: 0 5px;
|
|
240
|
+
color: #666;
|
|
241
|
+
align-self: center;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
.activePage {
|
|
245
|
+
background-color: #0c696a;
|
|
246
|
+
color: white;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
.activePage:hover {
|
|
250
|
+
background-color: #065052 !important;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
.sortable {
|
|
254
|
+
cursor: pointer;
|
|
255
|
+
position: relative;
|
|
256
|
+
padding-right: 20px !important;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
.sortable:after {
|
|
260
|
+
content: '↕';
|
|
261
|
+
position: absolute;
|
|
262
|
+
right: 8px;
|
|
263
|
+
top: 50%;
|
|
264
|
+
transform: translateY(-50%);
|
|
265
|
+
opacity: 0.3;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
.sort-asc:after {
|
|
269
|
+
content: '↑';
|
|
270
|
+
opacity: 1;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
.sort-desc:after {
|
|
274
|
+
content: '↓';
|
|
275
|
+
opacity: 1;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
.clickable {
|
|
279
|
+
cursor: pointer;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
.selected {
|
|
283
|
+
background-color: #b6d4d5 !important;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
@media screen and (max-width: 1024px) {
|
|
287
|
+
.pageButton {
|
|
288
|
+
min-width: 28px;
|
|
289
|
+
min-height: 28px;
|
|
290
|
+
font-size: 12px;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
.th, .td {
|
|
294
|
+
min-width: 40px !important;
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
/* Tablet ve mobil için doğal genişlik */
|
|
299
|
+
@media screen and (max-width: 1023px) {
|
|
300
|
+
.th,
|
|
301
|
+
.td {
|
|
302
|
+
min-width: unset;
|
|
303
|
+
width: auto;
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
@media screen and (max-width: 768px) {
|
|
308
|
+
.searchInput {
|
|
309
|
+
font-size: 14px;
|
|
310
|
+
padding: 6px 8px 4px 8px;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
.rowsCount {
|
|
314
|
+
font-size: 11px;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
.pageButton {
|
|
318
|
+
min-width: 24px;
|
|
319
|
+
min-height: 24px;
|
|
320
|
+
padding: 2px 4px;
|
|
321
|
+
font-size: 11px;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
.pagination {
|
|
325
|
+
padding: 2px 5px;
|
|
326
|
+
gap: 2px;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
.pageEllipsis {
|
|
330
|
+
padding: 0 2px;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
.th, .td {
|
|
334
|
+
min-width: 60px;
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
@media screen and (max-width: 480px) {
|
|
339
|
+
.searchInput {
|
|
340
|
+
font-size: 13px;
|
|
341
|
+
padding: 5px 6px 3px 6px;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
.pageButton {
|
|
345
|
+
min-width: 22px;
|
|
346
|
+
min-height: 22px;
|
|
347
|
+
padding: 1px 3px;
|
|
348
|
+
font-size: 10px;
|
|
349
|
+
}
|
|
350
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
|
+
function MyTabPane({
|
|
3
|
+
children,
|
|
4
|
+
label = null,
|
|
5
|
+
title = null,
|
|
6
|
+
description = null,
|
|
7
|
+
badge = null,
|
|
8
|
+
name = null,
|
|
9
|
+
icon = null,
|
|
10
|
+
className = null,
|
|
11
|
+
style = null,
|
|
12
|
+
tabClassName = null,
|
|
13
|
+
tabStyle = null
|
|
14
|
+
}) {
|
|
15
|
+
return /*#__PURE__*/React.createElement("div", null, children);
|
|
16
|
+
}
|
|
17
|
+
export default MyTabPane;
|