px-react-ui-components 1.0.2 → 1.0.5
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/dist/components/MyAlert/MyAlert.js +17 -9
- package/dist/components/MyContainer/MyContainer.js +42 -26
- package/dist/components/MyContainer/MyContainerBody.js +14 -5
- package/dist/components/MyContainer/MyContainerFooter.js +14 -5
- package/dist/components/MyContainer/MyContainerRight.js +15 -6
- package/dist/components/MyEditor/MyEditor.js +73 -59
- package/dist/components/MyFileUpload/MyFileUpload.js +132 -102
- package/dist/components/MyImageCropper/MyImageCropper.js +37 -24
- package/dist/components/MyInput/MyInput.js +435 -384
- package/dist/components/MyInput/index.js +23 -0
- package/dist/components/MyMaps/YandexMaps.js +21 -13
- package/dist/components/MyMenu/MenuItem.js +60 -38
- package/dist/components/MyModal/MyModal.js +39 -22
- package/dist/components/MyModal/MyModalBody.js +14 -5
- package/dist/components/MyModal/MyModalFooter.js +14 -5
- package/dist/components/MyNotFound/MyNotFound.js +22 -12
- package/dist/components/MyScrollableCard/MyScrollableCard.js +22 -12
- package/dist/components/MyTable/MyTable.js +142 -108
- package/dist/components/MyTable/MyTableBody.js +14 -5
- package/dist/components/MyTable/MyTableHead.js +14 -5
- package/dist/components/MyTabs/MyTabPane.js +14 -3
- package/dist/components/MyTabs/MyTabs.js +59 -41
- package/dist/components/MyWaiting/MyWaiting.js +30 -19
- package/dist/components/MyZoomImage/MyZoomImage.js +101 -77
- package/dist/index.js +131 -15
- package/package.json +7 -8
|
@@ -1,19 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.MyTableIsNumeric = exports.CountBlock = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _MyTableModule = _interopRequireDefault(require("./MyTable.module.css"));
|
|
9
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
12
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
13
|
+
const MyTableIsNumeric = value => {
|
|
4
14
|
if (value === null || value === undefined || value === "") return false;
|
|
5
15
|
return !isNaN(value) && !isNaN(parseFloat(value));
|
|
6
16
|
};
|
|
7
|
-
|
|
17
|
+
exports.MyTableIsNumeric = MyTableIsNumeric;
|
|
18
|
+
const CountBlock = ({
|
|
8
19
|
count
|
|
9
20
|
}) => {
|
|
10
21
|
const {
|
|
11
22
|
t
|
|
12
23
|
} = useTranslation();
|
|
13
|
-
return /*#__PURE__*/
|
|
14
|
-
className:
|
|
15
|
-
|
|
24
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
25
|
+
className: _MyTableModule.default.rowsCount,
|
|
26
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
27
|
+
children: count
|
|
28
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("small", {
|
|
29
|
+
children: t("kayıt listelendi")
|
|
30
|
+
})]
|
|
31
|
+
});
|
|
16
32
|
};
|
|
33
|
+
exports.CountBlock = CountBlock;
|
|
17
34
|
function MyTable({
|
|
18
35
|
columns = [],
|
|
19
36
|
//
|
|
@@ -31,18 +48,18 @@ function MyTable({
|
|
|
31
48
|
onPageChange = null
|
|
32
49
|
}) {
|
|
33
50
|
const tableid = `key${Date.now() + Math.random().toString(36).substr(2, 9)}`;
|
|
34
|
-
const [curEmptyText, setCurEmptyText] = useState(emptyText);
|
|
35
|
-
const [curTotalCount, setCurTotalCount] = useState(data ? data.length : totalCount);
|
|
36
|
-
const [searchTerm, setSearchTerm] = useState("");
|
|
37
|
-
const [filteredRows, setFilteredRows] = useState([]);
|
|
38
|
-
const [currentPage, setCurrentPage] = useState(1);
|
|
39
|
-
const [totalPages, setTotalPages] = useState(0);
|
|
40
|
-
const [sortConfig, setSortConfig] = useState({
|
|
51
|
+
const [curEmptyText, setCurEmptyText] = (0, _react.useState)(emptyText);
|
|
52
|
+
const [curTotalCount, setCurTotalCount] = (0, _react.useState)(data ? data.length : totalCount);
|
|
53
|
+
const [searchTerm, setSearchTerm] = (0, _react.useState)("");
|
|
54
|
+
const [filteredRows, setFilteredRows] = (0, _react.useState)([]);
|
|
55
|
+
const [currentPage, setCurrentPage] = (0, _react.useState)(1);
|
|
56
|
+
const [totalPages, setTotalPages] = (0, _react.useState)(0);
|
|
57
|
+
const [sortConfig, setSortConfig] = (0, _react.useState)({
|
|
41
58
|
key: null,
|
|
42
59
|
direction: "asc"
|
|
43
60
|
});
|
|
44
|
-
const [displayData, setDisplayData] = useState([]);
|
|
45
|
-
const arrChild =
|
|
61
|
+
const [displayData, setDisplayData] = (0, _react.useState)([]);
|
|
62
|
+
const arrChild = _react.default.Children.toArray(children);
|
|
46
63
|
let childHeader = null;
|
|
47
64
|
let childBody = null;
|
|
48
65
|
if (arrChild.length > 0) {
|
|
@@ -59,7 +76,7 @@ function MyTable({
|
|
|
59
76
|
}
|
|
60
77
|
|
|
61
78
|
// Veri işleme ve sıralama
|
|
62
|
-
useEffect(() => {
|
|
79
|
+
(0, _react.useEffect)(() => {
|
|
63
80
|
let processedData = Array.isArray(data) ? [...data] : [];
|
|
64
81
|
|
|
65
82
|
// Arama işlemi
|
|
@@ -100,7 +117,7 @@ function MyTable({
|
|
|
100
117
|
setCurTotalCount(0);
|
|
101
118
|
}
|
|
102
119
|
}, [data, searchTerm, sortConfig, currentPage, pageSize]);
|
|
103
|
-
useEffect(() => {
|
|
120
|
+
(0, _react.useEffect)(() => {
|
|
104
121
|
if (emptyText == "") {
|
|
105
122
|
// setCurEmptyText(t("Henüz bir kayıt mevcut değil!"));
|
|
106
123
|
setCurEmptyText("No records found!");
|
|
@@ -112,7 +129,7 @@ function MyTable({
|
|
|
112
129
|
const filterRows = row => {
|
|
113
130
|
if (!searchTerm) return true;
|
|
114
131
|
const cells = row.props.children;
|
|
115
|
-
return
|
|
132
|
+
return _react.default.Children.toArray(cells).some(cell => {
|
|
116
133
|
const cellText = cell.props.children ? cell.props.children.toString().trim().toLocaleLowerCase() : "";
|
|
117
134
|
const cleanCellText = cellText.replace(/[^a-zA-Z0-9\s]/g, ""); // Virgül ve diğer özel karakterleri temizle
|
|
118
135
|
const cleanSearchTerm = searchTerm.replace(/[^a-zA-Z0-9\s]/g, "").toLocaleLowerCase(); // Aynı şekilde arama terimini temizle
|
|
@@ -145,17 +162,17 @@ function MyTable({
|
|
|
145
162
|
|
|
146
163
|
//style = { ...style, minWidth: column.width || "150px" };
|
|
147
164
|
|
|
148
|
-
return /*#__PURE__*/
|
|
149
|
-
key: "head" + column.key + btoa(Math.random().toString(36).substr(2, 9)),
|
|
165
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("th", {
|
|
150
166
|
onClick: column.sortable ? () => handleSort(column.key) : undefined,
|
|
151
167
|
className: `
|
|
152
|
-
${
|
|
168
|
+
${_MyTableModule.default.th}
|
|
153
169
|
${column.className && column.className || ""}
|
|
154
|
-
${column.sortable ?
|
|
155
|
-
${isSorted ?
|
|
170
|
+
${column.sortable ? _MyTableModule.default.sortable : ""}
|
|
171
|
+
${isSorted ? _MyTableModule.default[`sort-${sortDirection}`] : ""}
|
|
156
172
|
`,
|
|
157
|
-
style: style
|
|
158
|
-
|
|
173
|
+
style: style,
|
|
174
|
+
children: column.title
|
|
175
|
+
}, "head" + column.key + btoa(Math.random().toString(36).substr(2, 9)));
|
|
159
176
|
};
|
|
160
177
|
|
|
161
178
|
// Hücre render fonksiyonu
|
|
@@ -166,31 +183,31 @@ function MyTable({
|
|
|
166
183
|
|
|
167
184
|
// If the content is already a React element (like from a render function that returns MathJax),
|
|
168
185
|
// just return it directly in the cell
|
|
169
|
-
if (/*#__PURE__*/
|
|
170
|
-
return /*#__PURE__*/
|
|
171
|
-
key: key,
|
|
186
|
+
if (/*#__PURE__*/_react.default.isValidElement(content)) {
|
|
187
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("td", {
|
|
172
188
|
style: column.tdStyle,
|
|
173
|
-
className: `${
|
|
174
|
-
"data-row-index": index
|
|
175
|
-
|
|
189
|
+
className: `${_MyTableModule.default.td} ${column.tdClassName && column.tdClassName || ""}`,
|
|
190
|
+
"data-row-index": index,
|
|
191
|
+
children: content
|
|
192
|
+
}, key);
|
|
176
193
|
}
|
|
177
|
-
return /*#__PURE__*/
|
|
178
|
-
key: key,
|
|
194
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("td", {
|
|
179
195
|
style: column.tdStyle,
|
|
180
|
-
className: `${
|
|
181
|
-
"data-row-index": index
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
196
|
+
className: `${_MyTableModule.default.td} ${column.tdClassName && column.tdClassName || ""}`,
|
|
197
|
+
"data-row-index": index,
|
|
198
|
+
children: typeof content === 'string' ? /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
199
|
+
dangerouslySetInnerHTML: {
|
|
200
|
+
__html: content
|
|
201
|
+
}
|
|
202
|
+
}) : content
|
|
203
|
+
}, key);
|
|
187
204
|
};
|
|
188
205
|
|
|
189
206
|
// Filtrelenen satırları güncelle
|
|
190
|
-
useEffect(() => {
|
|
207
|
+
(0, _react.useEffect)(() => {
|
|
191
208
|
if (onSearchText == null) {
|
|
192
209
|
if (childBody) {
|
|
193
|
-
const rows =
|
|
210
|
+
const rows = _react.default.Children.toArray(childBody.props.children);
|
|
194
211
|
const filtered = rows.filter(row => filterRows(row));
|
|
195
212
|
setFilteredRows(filtered);
|
|
196
213
|
}
|
|
@@ -239,73 +256,90 @@ function MyTable({
|
|
|
239
256
|
pagesToShow.push(totalPages);
|
|
240
257
|
}
|
|
241
258
|
}
|
|
242
|
-
return /*#__PURE__*/
|
|
243
|
-
className:
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
259
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
260
|
+
className: _MyTableModule.default.pagination,
|
|
261
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
|
|
262
|
+
onClick: () => handlePageChange(currentPage - 1),
|
|
263
|
+
disabled: currentPage === 1,
|
|
264
|
+
className: _MyTableModule.default.pageButton,
|
|
265
|
+
children: "<"
|
|
266
|
+
}), pagesToShow.map((page, index) => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_react.default.Fragment, {
|
|
267
|
+
children: [index > 0 && pagesToShow[index] - pagesToShow[index - 1] > 1 && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
268
|
+
className: _MyTableModule.default.pageEllipsis,
|
|
269
|
+
children: "..."
|
|
270
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
|
|
271
|
+
onClick: () => handlePageChange(page),
|
|
272
|
+
className: `${_MyTableModule.default.pageButton} ${currentPage === page ? _MyTableModule.default.activePage : ""}`,
|
|
273
|
+
children: page
|
|
274
|
+
})]
|
|
275
|
+
}, page)), /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
|
|
276
|
+
onClick: () => handlePageChange(currentPage + 1),
|
|
277
|
+
disabled: currentPage === totalPages,
|
|
278
|
+
className: _MyTableModule.default.pageButton,
|
|
279
|
+
children: ">"
|
|
280
|
+
})]
|
|
281
|
+
});
|
|
260
282
|
};
|
|
261
|
-
const headerCellsCount = columns.filter(column => column.title).length > 0 ? columns.filter(column => column.title).length : childBody ?
|
|
262
|
-
return /*#__PURE__*/
|
|
283
|
+
const headerCellsCount = columns.filter(column => column.title).length > 0 ? columns.filter(column => column.title).length : childBody ? _react.default.Children.count(childBody.props.children.props.children) : 0;
|
|
284
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
263
285
|
id: tableid,
|
|
264
|
-
className: `${
|
|
286
|
+
className: `${_MyTableModule.default.myTableContainer} ${searchable && _MyTableModule.default.searchable} ${totalPages > 0 && _MyTableModule.default.myTablePagination}`,
|
|
265
287
|
style: {
|
|
266
288
|
height: height
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
289
|
+
},
|
|
290
|
+
children: [searchable && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
291
|
+
className: _MyTableModule.default.searchContainer,
|
|
292
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
|
|
293
|
+
type: "text"
|
|
294
|
+
// placeholder={t("Ara")}
|
|
295
|
+
,
|
|
296
|
+
placeholder: "Search",
|
|
297
|
+
value: searchTerm,
|
|
298
|
+
className: _MyTableModule.default.searchInput,
|
|
299
|
+
onChange: e => setSearchTerm(e.target.value)
|
|
300
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(CountBlock, {
|
|
301
|
+
count: curTotalCount && curTotalCount || childBody && childBody.props.children.length || 0
|
|
302
|
+
})]
|
|
303
|
+
}) || showCount && /*#__PURE__*/(0, _jsxRuntime.jsx)(CountBlock, {
|
|
304
|
+
count: curTotalCount && curTotalCount || childBody && childBody.props.children.length || 0
|
|
305
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
306
|
+
className: _MyTableModule.default.myTable,
|
|
307
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("table", {
|
|
308
|
+
className: _MyTableModule.default.table,
|
|
309
|
+
children: [columns.filter(column => column.title).length > 0 ? /*#__PURE__*/(0, _jsxRuntime.jsx)("thead", {
|
|
310
|
+
className: _MyTableModule.default.thead,
|
|
311
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("tr", {
|
|
312
|
+
className: _MyTableModule.default.tr,
|
|
313
|
+
children: columns.filter(column => column.title).map(renderColumnHeader)
|
|
314
|
+
})
|
|
315
|
+
}) : childHeader, /*#__PURE__*/(0, _jsxRuntime.jsx)("tbody", {
|
|
316
|
+
children: onSearchText && childBody && childBody.props.children.length > 0 && childBody.props.children || filteredRows && filteredRows.length > 0 && filteredRows || displayData.length > 0 && displayData.map((item, index) => /*#__PURE__*/(0, _jsxRuntime.jsxs)("tr", {
|
|
317
|
+
onClick: () => onRowClick && onRowClick(item),
|
|
318
|
+
className: `
|
|
319
|
+
${_MyTableModule.default.tr}
|
|
320
|
+
${onRowClick ? _MyTableModule.default.clickable : ""}
|
|
321
|
+
${selectedRow === item ? _MyTableModule.default.selected : ""}
|
|
322
|
+
`,
|
|
323
|
+
children: [columns.filter(column => column.title).map(column => renderCell(item, column, index)), children && /*#__PURE__*/(0, _jsxRuntime.jsx)("td", {
|
|
324
|
+
children: typeof children === "function" ? children(item) : children
|
|
325
|
+
})]
|
|
326
|
+
}, index)) || /*#__PURE__*/(0, _jsxRuntime.jsx)("tr", {
|
|
327
|
+
className: _MyTableModule.default.noData + " " + _MyTableModule.default.tr,
|
|
328
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("td", {
|
|
329
|
+
colSpan: headerCellsCount,
|
|
330
|
+
className: _MyTableModule.default.td,
|
|
331
|
+
children: searchTerm != "" && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
332
|
+
dangerouslySetInnerHTML: {
|
|
333
|
+
__html: `${
|
|
334
|
+
// t("Aradığınız kriterlere uygun kayıt bulunamadı!")
|
|
335
|
+
"No records found for the criteria you searched for!"}<br/><b>(${searchTerm})</b>`
|
|
336
|
+
}
|
|
337
|
+
}) || curEmptyText
|
|
338
|
+
})
|
|
339
|
+
})
|
|
340
|
+
})]
|
|
341
|
+
})
|
|
342
|
+
}), totalPages > 0 && renderPagination()]
|
|
343
|
+
});
|
|
310
344
|
}
|
|
311
|
-
|
|
345
|
+
var _default = exports.default = MyTable;
|
|
@@ -1,9 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
2
10
|
function MyTableBody({
|
|
3
11
|
children
|
|
4
12
|
}) {
|
|
5
|
-
return /*#__PURE__*/
|
|
6
|
-
className: "MyTableTagBody"
|
|
7
|
-
|
|
13
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("tbody", {
|
|
14
|
+
className: "MyTableTagBody",
|
|
15
|
+
children: children
|
|
16
|
+
});
|
|
8
17
|
}
|
|
9
|
-
|
|
18
|
+
var _default = exports.default = MyTableBody;
|
|
@@ -1,9 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
2
10
|
function MyTableHead({
|
|
3
11
|
children
|
|
4
12
|
}) {
|
|
5
|
-
return /*#__PURE__*/
|
|
6
|
-
className: "MyTableTagHead"
|
|
7
|
-
|
|
13
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("thead", {
|
|
14
|
+
className: "MyTableTagHead",
|
|
15
|
+
children: children
|
|
16
|
+
});
|
|
8
17
|
}
|
|
9
|
-
|
|
18
|
+
var _default = exports.default = MyTableHead;
|
|
@@ -1,4 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
9
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
10
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
2
11
|
function MyTabPane({
|
|
3
12
|
children,
|
|
4
13
|
label = null,
|
|
@@ -12,6 +21,8 @@ function MyTabPane({
|
|
|
12
21
|
tabClassName = null,
|
|
13
22
|
tabStyle = null
|
|
14
23
|
}) {
|
|
15
|
-
return /*#__PURE__*/
|
|
24
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
25
|
+
children: children
|
|
26
|
+
});
|
|
16
27
|
}
|
|
17
|
-
|
|
28
|
+
var _default = exports.default = MyTabPane;
|
|
@@ -1,5 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
require("./MyTabs.css");
|
|
9
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
11
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
3
12
|
function MyTabs({
|
|
4
13
|
children,
|
|
5
14
|
className = null,
|
|
@@ -8,9 +17,9 @@ function MyTabs({
|
|
|
8
17
|
activePaneIndex = -1,
|
|
9
18
|
activePaneName = null
|
|
10
19
|
}) {
|
|
11
|
-
const [activei, setActivei] = useState(activePaneIndex > -1 ? activePaneIndex : 0);
|
|
12
|
-
const arrChild =
|
|
13
|
-
useEffect(() => {
|
|
20
|
+
const [activei, setActivei] = (0, _react.useState)(activePaneIndex > -1 ? activePaneIndex : 0);
|
|
21
|
+
const arrChild = _react.default.Children.toArray(children);
|
|
22
|
+
(0, _react.useEffect)(() => {
|
|
14
23
|
if (onChange) {
|
|
15
24
|
onChange({
|
|
16
25
|
index: activei,
|
|
@@ -19,7 +28,7 @@ function MyTabs({
|
|
|
19
28
|
});
|
|
20
29
|
}
|
|
21
30
|
}, [activei]);
|
|
22
|
-
useEffect(() => {
|
|
31
|
+
(0, _react.useEffect)(() => {
|
|
23
32
|
if (activePaneName) {
|
|
24
33
|
const index = arrChild.findIndex(item => item.props.name === activePaneName);
|
|
25
34
|
if (index > -1) {
|
|
@@ -27,40 +36,49 @@ function MyTabs({
|
|
|
27
36
|
}
|
|
28
37
|
}
|
|
29
38
|
}, [activePaneName]);
|
|
30
|
-
return /*#__PURE__*/
|
|
39
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
31
40
|
className: "my-TabsContainer " + (className ? className : ''),
|
|
32
|
-
style: style
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
41
|
+
style: style,
|
|
42
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("ul", {
|
|
43
|
+
className: "my-TabsTabList",
|
|
44
|
+
children: arrChild.map((item, i) => {
|
|
45
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("li", {
|
|
46
|
+
className: (i == activei && 'active') + ' ' + (item.props.tabClassName ? item.props.tabClassName : ''),
|
|
47
|
+
style: item.props.tabStyle,
|
|
48
|
+
onClick: () => setActivei(i),
|
|
49
|
+
title: item.props.title,
|
|
50
|
+
children: [item.props.icon != undefined && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
51
|
+
className: "icon",
|
|
52
|
+
children: item.props.icon
|
|
53
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
54
|
+
className: "flex flex-col gap-0 text-start",
|
|
55
|
+
children: [item.props.label != undefined ? /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
56
|
+
className: "title",
|
|
57
|
+
children: item.props.label
|
|
58
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
59
|
+
className: "title",
|
|
60
|
+
children: item.props.title
|
|
61
|
+
}), item.props.description != undefined && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
62
|
+
className: "description",
|
|
63
|
+
children: item.props.description
|
|
64
|
+
})]
|
|
65
|
+
}), item.props.badge != undefined && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
66
|
+
className: "badge",
|
|
67
|
+
children: item.props.badge
|
|
68
|
+
})]
|
|
69
|
+
}, i);
|
|
70
|
+
})
|
|
71
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
72
|
+
className: "my-TabsTabBody",
|
|
73
|
+
children: arrChild.map((item, i) => {
|
|
74
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
75
|
+
className: "my-TabsTabContainer " + (i == activei && 'active') + ' ' + (item.props.className ? item.props.className : ''),
|
|
76
|
+
style: item.props.style,
|
|
77
|
+
onClick: () => setActivei(i),
|
|
78
|
+
children: item.props.children
|
|
79
|
+
}, i);
|
|
80
|
+
})
|
|
81
|
+
})]
|
|
82
|
+
});
|
|
65
83
|
}
|
|
66
|
-
|
|
84
|
+
var _default = exports.default = MyTabs;
|
|
@@ -1,27 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
import { Oval } from "react-loader-spinner";
|
|
3
|
-
import './MyWaiting.css'; // Modal için CSS dosyası
|
|
1
|
+
"use strict";
|
|
4
2
|
|
|
5
|
-
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = MyWaiting;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _reactLoaderSpinner = require("react-loader-spinner");
|
|
9
|
+
require("./MyWaiting.css");
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
// Modal için CSS dosyası
|
|
13
|
+
function MyWaiting({
|
|
6
14
|
show = false,
|
|
7
15
|
message = null
|
|
8
16
|
}) {
|
|
9
17
|
if (!show) {
|
|
10
18
|
return null;
|
|
11
19
|
}
|
|
12
|
-
return /*#__PURE__*/
|
|
13
|
-
className: "my-waiting-backdrop"
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
20
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
21
|
+
className: "my-waiting-backdrop",
|
|
22
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
23
|
+
className: "my-waiting-content",
|
|
24
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactLoaderSpinner.Oval, {
|
|
25
|
+
visible: true,
|
|
26
|
+
height: "60",
|
|
27
|
+
width: "60",
|
|
28
|
+
color: "#fff",
|
|
29
|
+
secondaryColor: "#cdcdcd",
|
|
30
|
+
ariaLabel: "oval-loading",
|
|
31
|
+
strokeWidth: 5
|
|
32
|
+
}), message && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
33
|
+
className: "my-waiting-message",
|
|
34
|
+
children: message
|
|
35
|
+
})]
|
|
36
|
+
})
|
|
37
|
+
});
|
|
27
38
|
}
|