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.
@@ -1,19 +1,36 @@
1
- import React, { useEffect, useState } from "react";
2
- import styles from "./MyTable.module.css";
3
- export const MyTableIsNumeric = value => {
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
- export const CountBlock = ({
17
+ exports.MyTableIsNumeric = MyTableIsNumeric;
18
+ const CountBlock = ({
8
19
  count
9
20
  }) => {
10
21
  const {
11
22
  t
12
23
  } = useTranslation();
13
- return /*#__PURE__*/React.createElement("div", {
14
- className: styles.rowsCount
15
- }, /*#__PURE__*/React.createElement("span", null, count), /*#__PURE__*/React.createElement("small", null, t("kayıt listelendi")));
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 = React.Children.toArray(children);
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 React.Children.toArray(cells).some(cell => {
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__*/React.createElement("th", {
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
- ${styles.th}
168
+ ${_MyTableModule.default.th}
153
169
  ${column.className && column.className || ""}
154
- ${column.sortable ? styles.sortable : ""}
155
- ${isSorted ? styles[`sort-${sortDirection}`] : ""}
170
+ ${column.sortable ? _MyTableModule.default.sortable : ""}
171
+ ${isSorted ? _MyTableModule.default[`sort-${sortDirection}`] : ""}
156
172
  `,
157
- style: style
158
- }, column.title);
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__*/React.isValidElement(content)) {
170
- return /*#__PURE__*/React.createElement("td", {
171
- key: key,
186
+ if (/*#__PURE__*/_react.default.isValidElement(content)) {
187
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("td", {
172
188
  style: column.tdStyle,
173
- className: `${styles.td} ${column.tdClassName && column.tdClassName || ""}`,
174
- "data-row-index": index
175
- }, content);
189
+ className: `${_MyTableModule.default.td} ${column.tdClassName && column.tdClassName || ""}`,
190
+ "data-row-index": index,
191
+ children: content
192
+ }, key);
176
193
  }
177
- return /*#__PURE__*/React.createElement("td", {
178
- key: key,
194
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("td", {
179
195
  style: column.tdStyle,
180
- className: `${styles.td} ${column.tdClassName && column.tdClassName || ""}`,
181
- "data-row-index": index
182
- }, typeof content === 'string' ? /*#__PURE__*/React.createElement("span", {
183
- dangerouslySetInnerHTML: {
184
- __html: content
185
- }
186
- }) : content);
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 = React.Children.toArray(childBody.props.children);
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__*/React.createElement("div", {
243
- className: styles.pagination
244
- }, /*#__PURE__*/React.createElement("button", {
245
- onClick: () => handlePageChange(currentPage - 1),
246
- disabled: currentPage === 1,
247
- className: styles.pageButton
248
- }, "<"), pagesToShow.map((page, index) => /*#__PURE__*/React.createElement(React.Fragment, {
249
- key: page
250
- }, index > 0 && pagesToShow[index] - pagesToShow[index - 1] > 1 && /*#__PURE__*/React.createElement("span", {
251
- className: styles.pageEllipsis
252
- }, "..."), /*#__PURE__*/React.createElement("button", {
253
- onClick: () => handlePageChange(page),
254
- className: `${styles.pageButton} ${currentPage === page ? styles.activePage : ""}`
255
- }, page))), /*#__PURE__*/React.createElement("button", {
256
- onClick: () => handlePageChange(currentPage + 1),
257
- disabled: currentPage === totalPages,
258
- className: styles.pageButton
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 ? React.Children.count(childBody.props.children.props.children) : 0;
262
- return /*#__PURE__*/React.createElement("div", {
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: `${styles.myTableContainer} ${searchable && styles.searchable} ${totalPages > 0 && styles.myTablePagination}`,
286
+ className: `${_MyTableModule.default.myTableContainer} ${searchable && _MyTableModule.default.searchable} ${totalPages > 0 && _MyTableModule.default.myTablePagination}`,
265
287
  style: {
266
288
  height: height
267
- }
268
- }, searchable && /*#__PURE__*/React.createElement("div", {
269
- className: styles.searchContainer
270
- }, /*#__PURE__*/React.createElement("input", {
271
- type: "text"
272
- // placeholder={t("Ara")}
273
- ,
274
- placeholder: "Search",
275
- value: searchTerm,
276
- className: styles.searchInput,
277
- onChange: e => setSearchTerm(e.target.value)
278
- }), /*#__PURE__*/React.createElement(CountBlock, {
279
- count: curTotalCount && curTotalCount || childBody && childBody.props.children.length || 0
280
- })) || showCount && /*#__PURE__*/React.createElement(CountBlock, {
281
- count: curTotalCount && curTotalCount || childBody && childBody.props.children.length || 0
282
- }), /*#__PURE__*/React.createElement("div", {
283
- className: styles.myTable
284
- }, /*#__PURE__*/React.createElement("table", {
285
- className: styles.table
286
- }, columns.filter(column => column.title).length > 0 ? /*#__PURE__*/React.createElement("thead", {
287
- className: styles.thead
288
- }, /*#__PURE__*/React.createElement("tr", {
289
- className: styles.tr
290
- }, 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", {
291
- key: index,
292
- onClick: () => onRowClick && onRowClick(item),
293
- className: `
294
- ${styles.tr}
295
- ${onRowClick ? styles.clickable : ""}
296
- ${selectedRow === item ? styles.selected : ""}
297
- `
298
- }, 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", {
299
- className: styles.noData + " " + styles.tr
300
- }, /*#__PURE__*/React.createElement("td", {
301
- colSpan: headerCellsCount,
302
- className: styles.td
303
- }, searchTerm != "" && /*#__PURE__*/React.createElement("span", {
304
- dangerouslySetInnerHTML: {
305
- __html: `${
306
- // t("Aradığınız kriterlere uygun kayıt bulunamadı!")
307
- "No records found for the criteria you searched for!"}<br/><b>(${searchTerm})</b>`
308
- }
309
- }) || curEmptyText))))), totalPages > 0 && renderPagination());
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
- export default MyTable;
345
+ var _default = exports.default = MyTable;
@@ -1,9 +1,18 @@
1
- import React from 'react';
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__*/React.createElement("tbody", {
6
- className: "MyTableTagBody"
7
- }, children);
13
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("tbody", {
14
+ className: "MyTableTagBody",
15
+ children: children
16
+ });
8
17
  }
9
- export default MyTableBody;
18
+ var _default = exports.default = MyTableBody;
@@ -1,9 +1,18 @@
1
- import React from 'react';
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__*/React.createElement("thead", {
6
- className: "MyTableTagHead"
7
- }, children);
13
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("thead", {
14
+ className: "MyTableTagHead",
15
+ children: children
16
+ });
8
17
  }
9
- export default MyTableHead;
18
+ var _default = exports.default = MyTableHead;
@@ -1,4 +1,13 @@
1
- import React, { useEffect, useState } from 'react';
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__*/React.createElement("div", null, children);
24
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
25
+ children: children
26
+ });
16
27
  }
17
- export default MyTabPane;
28
+ var _default = exports.default = MyTabPane;
@@ -1,5 +1,14 @@
1
- import React, { useEffect, useState } from 'react';
2
- import "./MyTabs.css";
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 = React.Children.toArray(children);
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__*/React.createElement("div", {
39
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
31
40
  className: "my-TabsContainer " + (className ? className : ''),
32
- style: style
33
- }, /*#__PURE__*/React.createElement("ul", {
34
- className: "my-TabsTabList"
35
- }, arrChild.map((item, i) => {
36
- return /*#__PURE__*/React.createElement("li", {
37
- key: i,
38
- className: (i == activei && 'active') + ' ' + (item.props.tabClassName ? item.props.tabClassName : ''),
39
- style: item.props.tabStyle,
40
- onClick: () => setActivei(i),
41
- title: item.props.title
42
- }, item.props.icon != undefined && /*#__PURE__*/React.createElement("div", {
43
- className: "icon"
44
- }, item.props.icon), /*#__PURE__*/React.createElement("div", {
45
- className: "flex flex-col gap-0 text-start"
46
- }, item.props.label != undefined ? /*#__PURE__*/React.createElement("span", {
47
- className: "title"
48
- }, item.props.label) : /*#__PURE__*/React.createElement("span", {
49
- className: "title"
50
- }, item.props.title), item.props.description != undefined && /*#__PURE__*/React.createElement("div", {
51
- className: "description"
52
- }, item.props.description)), item.props.badge != undefined && /*#__PURE__*/React.createElement("div", {
53
- className: "badge"
54
- }, item.props.badge));
55
- })), /*#__PURE__*/React.createElement("div", {
56
- className: "my-TabsTabBody"
57
- }, arrChild.map((item, i) => {
58
- return /*#__PURE__*/React.createElement("div", {
59
- key: i,
60
- className: "my-TabsTabContainer " + (i == activei && 'active') + ' ' + (item.props.className ? item.props.className : ''),
61
- style: item.props.style,
62
- onClick: () => setActivei(i)
63
- }, item.props.children);
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
- export default MyTabs;
84
+ var _default = exports.default = MyTabs;
@@ -1,27 +1,38 @@
1
- import React from "react";
2
- import { Oval } from "react-loader-spinner";
3
- import './MyWaiting.css'; // Modal için CSS dosyası
1
+ "use strict";
4
2
 
5
- export default function MyWaiting({
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__*/React.createElement("div", {
13
- className: "my-waiting-backdrop"
14
- }, /*#__PURE__*/React.createElement("div", {
15
- className: "my-waiting-content"
16
- }, /*#__PURE__*/React.createElement(Oval, {
17
- visible: true,
18
- height: "60",
19
- width: "60",
20
- color: "#fff",
21
- secondaryColor: "#cdcdcd",
22
- ariaLabel: "oval-loading",
23
- strokeWidth: 5
24
- }), message && /*#__PURE__*/React.createElement("span", {
25
- className: "my-waiting-message"
26
- }, message)));
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
  }