albinasoft-ui-package 1.0.47 → 1.0.49
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/assets/css/dark.css
CHANGED
@@ -88,14 +88,16 @@ var CustomTab = function (_a) {
|
|
88
88
|
textAlign: "center",
|
89
89
|
margin: "0 5px",
|
90
90
|
borderRadius: "20px 20px 0 0",
|
91
|
+
cursor: "pointer",
|
91
92
|
} },
|
92
93
|
react_1.default.createElement("div", { className: "card-body d-flex flex-column text-center justify-content-center" },
|
93
94
|
react_1.default.createElement("span", { style: { fontSize: iconSize } }, tab.icon || react_1.default.createElement(react_1.default.Fragment, null)),
|
94
95
|
react_1.default.createElement("span", { className: fsClass }, tab.title)))))); })),
|
95
96
|
react_1.default.createElement(react_bootstrap_1.Tab.Content, { style: {
|
96
|
-
border: "1px solid var(--bs-primary)",
|
97
|
-
borderRadius: "5px 5px 20px 20px",
|
98
97
|
padding: "10px",
|
98
|
+
border: "10px solid transparent",
|
99
|
+
borderRadius: "".concat(isFullWidth ? "6px" : "20px"),
|
100
|
+
background: "linear-gradient(var(--bs-body-bg),var(--bs-body-bg)) padding-box, linear-gradient(180deg, rgba(var(--bs-primary-rgb), 1) 0%, rgba(var(--bs-primary-rgb), 0.1) 15%, rgba(var(--bs-primary-rgb), 0) 35%) border-box",
|
99
101
|
} }, tabs.map(function (tab) { return (react_1.default.createElement(react_bootstrap_1.Tab.Pane, { eventKey: tab.key, key: tab.key }, tab.content)); })))));
|
100
102
|
};
|
101
103
|
exports.CustomTab = CustomTab;
|
package/package.json
CHANGED
@@ -1,31 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { TableColumn } from 'react-data-table-component';
|
3
|
-
import './CustomDataTable.css';
|
4
|
-
interface DataTableProps {
|
5
|
-
columns: TableColumn<any>[];
|
6
|
-
data: any[];
|
7
|
-
loading?: boolean;
|
8
|
-
paginationPerPage?: number;
|
9
|
-
paginationTotalRows?: number;
|
10
|
-
selectableRows?: boolean;
|
11
|
-
paginationServer?: boolean;
|
12
|
-
addPagination?: boolean;
|
13
|
-
noDataComponent?: string;
|
14
|
-
fixedHeaderScrollHeight?: string;
|
15
|
-
handleRowSelected?: (selected: {
|
16
|
-
allSelected: boolean;
|
17
|
-
selectedCount: number;
|
18
|
-
selectedRows: any[];
|
19
|
-
}) => void;
|
20
|
-
handlePageChange?: (page: number) => void;
|
21
|
-
conditionalRowStyles?: any[];
|
22
|
-
}
|
23
|
-
interface DataTableHandle {
|
24
|
-
validate: () => boolean;
|
25
|
-
showError: () => void;
|
26
|
-
hideError: () => void;
|
27
|
-
getValue: () => string | string[];
|
28
|
-
setValue: (value: string | string[]) => void;
|
29
|
-
}
|
30
|
-
declare const CustomDataTable: React.ForwardRefExoticComponent<DataTableProps & React.RefAttributes<DataTableHandle>>;
|
31
|
-
export default CustomDataTable;
|
@@ -1,94 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
-
if (k2 === undefined) k2 = k;
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
-
}
|
8
|
-
Object.defineProperty(o, k2, desc);
|
9
|
-
}) : (function(o, m, k, k2) {
|
10
|
-
if (k2 === undefined) k2 = k;
|
11
|
-
o[k2] = m[k];
|
12
|
-
}));
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
15
|
-
}) : function(o, v) {
|
16
|
-
o["default"] = v;
|
17
|
-
});
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
19
|
-
if (mod && mod.__esModule) return mod;
|
20
|
-
var result = {};
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
22
|
-
__setModuleDefault(result, mod);
|
23
|
-
return result;
|
24
|
-
};
|
25
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
26
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
27
|
-
if (ar || !(i in from)) {
|
28
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
29
|
-
ar[i] = from[i];
|
30
|
-
}
|
31
|
-
}
|
32
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
33
|
-
};
|
34
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
35
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
36
|
-
};
|
37
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
38
|
-
var react_1 = __importStar(require("react"));
|
39
|
-
var react_data_table_component_1 = __importDefault(require("react-data-table-component"));
|
40
|
-
var LangTranslations_1 = require("../LangComponents/LangTranslations");
|
41
|
-
var LanguageContext_1 = require("../LangComponents/LanguageContext");
|
42
|
-
require("./CustomDataTable.css");
|
43
|
-
var CustomDataTable = (0, react_1.forwardRef)(function (_a, ref) {
|
44
|
-
var _b = _a.columns, columns = _b === void 0 ? [] : _b, _c = _a.data, data = _c === void 0 ? [] : _c, _d = _a.loading, loading = _d === void 0 ? false : _d, _e = _a.paginationPerPage, paginationPerPage = _e === void 0 ? 20 : _e, paginationTotalRows = _a.paginationTotalRows, _f = _a.fixedHeaderScrollHeight, fixedHeaderScrollHeight = _f === void 0 ? "500px" : _f, _g = _a.selectableRows, selectableRows = _g === void 0 ? false : _g, _h = _a.paginationServer, paginationServer = _h === void 0 ? false : _h, _j = _a.addPagination, addPagination = _j === void 0 ? true : _j, handleRowSelected = _a.handleRowSelected, handlePageChange = _a.handlePageChange, _k = _a.conditionalRowStyles, conditionalRowStyles = _k === void 0 ? [] : _k, noDataComponent = _a.noDataComponent;
|
45
|
-
var lang = (0, LanguageContext_1.useLanguage)().lang;
|
46
|
-
var _l = (0, react_1.useState)([]), selectedRows = _l[0], setSelectedRows = _l[1];
|
47
|
-
// Expose methods to parent via ref
|
48
|
-
(0, react_1.useImperativeHandle)(ref, function () { return ({
|
49
|
-
validate: function () { return selectedRows.length > 0; },
|
50
|
-
showError: function () {
|
51
|
-
console.error('Validation error: No rows selected!');
|
52
|
-
},
|
53
|
-
hideError: function () {
|
54
|
-
console.log('Error hidden');
|
55
|
-
},
|
56
|
-
getValue: function () { return selectedRows; },
|
57
|
-
setValue: function (value) {
|
58
|
-
if (typeof value === 'string') {
|
59
|
-
setSelectedRows([value]); // Tek bir string ise diziye çevirip ata
|
60
|
-
}
|
61
|
-
else {
|
62
|
-
setSelectedRows(value); // Zaten bir string[] ise direkt ata
|
63
|
-
}
|
64
|
-
},
|
65
|
-
}); });
|
66
|
-
// Default conditionalRowStyles to highlight selected rows
|
67
|
-
var defaultConditionalRowStyles = [
|
68
|
-
{
|
69
|
-
when: function (row) { return selectedRows.includes(row); },
|
70
|
-
style: {
|
71
|
-
backgroundColor: 'rgba(63, 195, 128, 0.9)',
|
72
|
-
color: 'white',
|
73
|
-
'&:hover': {
|
74
|
-
cursor: 'pointer',
|
75
|
-
},
|
76
|
-
},
|
77
|
-
},
|
78
|
-
];
|
79
|
-
var mergedConditionalRowStyles = __spreadArray(__spreadArray([], defaultConditionalRowStyles, true), conditionalRowStyles, true);
|
80
|
-
var paginationOptions = {
|
81
|
-
rowsPerPageText: (0, LangTranslations_1.getTranslation)('Sayfadaki veri sayısı', lang) || 'Sayfa başına veri sayısı',
|
82
|
-
rangeSeparatorText: ' - ',
|
83
|
-
selectAllRowsItem: true,
|
84
|
-
selectAllRowsItemText: (0, LangTranslations_1.getTranslation)('Tümü', lang) || 'Tümü',
|
85
|
-
};
|
86
|
-
return (react_1.default.createElement("div", { className: "data-table-wrapper" },
|
87
|
-
react_1.default.createElement(react_data_table_component_1.default, { columns: columns, data: data, pagination: addPagination, paginationPerPage: paginationPerPage, paginationRowsPerPageOptions: [paginationPerPage, paginationPerPage * 2, paginationPerPage * 3], paginationTotalRows: paginationTotalRows, paginationServer: paginationServer, onChangePage: handlePageChange, highlightOnHover: true, pointerOnHover: true, fixedHeader: true, fixedHeaderScrollHeight: fixedHeaderScrollHeight, progressPending: loading, progressComponent: react_1.default.createElement("div", { className: "loading-container" },
|
88
|
-
react_1.default.createElement("div", { className: "loading-spinner" })), noDataComponent: react_1.default.createElement("div", null, noDataComponent !== null && noDataComponent !== void 0 ? noDataComponent : (0, LangTranslations_1.getTranslation)('noDataFound', lang)), selectableRows: selectableRows, onSelectedRowsChange: function (selected) {
|
89
|
-
setSelectedRows(selected.selectedRows);
|
90
|
-
if (handleRowSelected)
|
91
|
-
handleRowSelected(selected);
|
92
|
-
}, conditionalRowStyles: mergedConditionalRowStyles, paginationComponentOptions: paginationOptions })));
|
93
|
-
});
|
94
|
-
exports.default = CustomDataTable;
|