albinasoft-ui-package 1.1.22 → 1.1.24
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.
@@ -37,5 +37,5 @@ export interface CustomDatatableProps<T> {
|
|
37
37
|
disabledButton5?: boolean;
|
38
38
|
}
|
39
39
|
declare function CustomDatatable<T extends {}>({ rowData, columnDefs, loading, pagination, paginationPageSize, paginationPageSizeSelector, filterAll, tableTitle, tableHeight, localeText, filter, floatingFilter, minWidth, labelButton1, onClickButton1, typeButton1, disabledButton1, labelButton2, onClickButton2, typeButton2, disabledButton2, labelButton3, onClickButton3, typeButton3, disabledButton3, labelButton4, onClickButton4, typeButton4, disabledButton4, labelButton5, onClickButton5, typeButton5, disabledButton5, }: CustomDatatableProps<T>): React.JSX.Element;
|
40
|
-
export { CustomDatatable, ColDef };
|
40
|
+
export type { CustomDatatable, ColDef };
|
41
41
|
export default CustomDatatable;
|
@@ -26,7 +26,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
27
27
|
};
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
29
|
-
exports.CustomDatatable = void 0;
|
30
29
|
var react_1 = __importStar(require("react"));
|
31
30
|
var ag_grid_react_1 = require("ag-grid-react");
|
32
31
|
var ag_grid_community_1 = require("ag-grid-community");
|
@@ -37,8 +36,8 @@ var CustomButton_1 = __importDefault(require("./CustomButton"));
|
|
37
36
|
var CustomInput_1 = __importDefault(require("./CustomInput"));
|
38
37
|
ag_grid_community_1.ModuleRegistry.registerModules([ag_grid_community_1.AllCommunityModule]);
|
39
38
|
function CustomDatatable(_a) {
|
40
|
-
var rowData = _a.rowData, columnDefs = _a.columnDefs, _b = _a.loading, loading = _b === void 0 ? false : _b, _c = _a.pagination, pagination = _c === void 0 ? true : _c, _d = _a.paginationPageSize, paginationPageSize = _d === void 0 ? 10 : _d, _e = _a.paginationPageSizeSelector, paginationPageSizeSelector = _e === void 0 ? [10, 20, 50, 100] : _e, _f = _a.filterAll, filterAll = _f === void 0 ? true : _f, _g = _a.tableTitle, tableTitle = _g === void 0 ? "" : _g, tableHeight = _a.tableHeight, _h = _a.localeText, localeText = _h === void 0 ? locale_1.AG_GRID_LOCALE_TR : _h, _j = _a.filter, filter = _j === void 0 ? true : _j, _k = _a.floatingFilter, floatingFilter = _k === void 0 ? true : _k, _l = _a.minWidth, minWidth = _l === void 0 ? 100 : _l,
|
41
|
-
var
|
39
|
+
var rowData = _a.rowData, columnDefs = _a.columnDefs, _b = _a.loading, loading = _b === void 0 ? false : _b, _c = _a.pagination, pagination = _c === void 0 ? true : _c, _d = _a.paginationPageSize, paginationPageSize = _d === void 0 ? 10 : _d, _e = _a.paginationPageSizeSelector, paginationPageSizeSelector = _e === void 0 ? [10, 20, 50, 100] : _e, _f = _a.filterAll, filterAll = _f === void 0 ? true : _f, _g = _a.tableTitle, tableTitle = _g === void 0 ? "" : _g, tableHeight = _a.tableHeight, _h = _a.localeText, localeText = _h === void 0 ? locale_1.AG_GRID_LOCALE_TR : _h, _j = _a.filter, filter = _j === void 0 ? true : _j, _k = _a.floatingFilter, floatingFilter = _k === void 0 ? true : _k, _l = _a.minWidth, minWidth = _l === void 0 ? 100 : _l, _m = _a.labelButton1, labelButton1 = _m === void 0 ? "" : _m, onClickButton1 = _a.onClickButton1, _o = _a.typeButton1, typeButton1 = _o === void 0 ? "primary" : _o, _p = _a.disabledButton1, disabledButton1 = _p === void 0 ? false : _p, _q = _a.labelButton2, labelButton2 = _q === void 0 ? "" : _q, onClickButton2 = _a.onClickButton2, _r = _a.typeButton2, typeButton2 = _r === void 0 ? "primary" : _r, _s = _a.disabledButton2, disabledButton2 = _s === void 0 ? false : _s, _t = _a.labelButton3, labelButton3 = _t === void 0 ? "" : _t, onClickButton3 = _a.onClickButton3, _u = _a.typeButton3, typeButton3 = _u === void 0 ? "primary" : _u, _v = _a.disabledButton3, disabledButton3 = _v === void 0 ? false : _v, _w = _a.labelButton4, labelButton4 = _w === void 0 ? "" : _w, onClickButton4 = _a.onClickButton4, _x = _a.typeButton4, typeButton4 = _x === void 0 ? "primary" : _x, _y = _a.disabledButton4, disabledButton4 = _y === void 0 ? false : _y, _z = _a.labelButton5, labelButton5 = _z === void 0 ? "" : _z, onClickButton5 = _a.onClickButton5, _0 = _a.typeButton5, typeButton5 = _0 === void 0 ? "primary" : _0, _1 = _a.disabledButton5, disabledButton5 = _1 === void 0 ? false : _1;
|
40
|
+
var _2 = (0, react_1.useState)(""), quickFilterText = _2[0], setQuickFilterText = _2[1];
|
42
41
|
// Tema ayarları
|
43
42
|
var theme = ag_grid_community_1.themeQuartz.withParams({
|
44
43
|
accentColor: "var(--bs-grid-accentColor)",
|
@@ -85,5 +84,4 @@ function CustomDatatable(_a) {
|
|
85
84
|
},
|
86
85
|
}, suppressServerSideFullWidthLoadingRow: true, overlayLoadingTemplate: "\n <div class=\"spinner-border spinner-border-lg\" role=\"status\">\n </div>", overlayNoRowsTemplate: '<span class="ag-overlay-no-rows-center">G\u00F6sterilecek Sat\u0131r Yok</span>', pagination: pagination, paginationPageSize: paginationPageSize, paginationPageSizeSelector: paginationPageSizeSelector }))));
|
87
86
|
}
|
88
|
-
exports.CustomDatatable = CustomDatatable;
|
89
87
|
exports.default = CustomDatatable;
|
@@ -40,7 +40,6 @@ var CustomSelect = function (_a) {
|
|
40
40
|
var id = _a.id, name = _a.name, label = _a.label, options = _a.options, value = _a.value, _c = _a.searchable, searchable = _c === void 0 ? true : _c, _d = _a.required, required = _d === void 0 ? false : _d, _e = _a.multiple, multiple = _e === void 0 ? false : _e, _f = _a.placeholder, placeholder = _f === void 0 ? "Seçiniz..." : _f, errorMessage = _a.errorMessage, conditionalErrorVisible = _a.conditionalErrorVisible, conditionalErrorMessage = _a.conditionalErrorMessage, tooltip = _a.tooltip, description = _a.description, _g = _a.disabled, disabled = _g === void 0 ? false : _g, className = _a.className, mainClass = _a.mainClass, style = _a.style, mainStyle = _a.mainStyle, submitted = _a.submitted, onChange = _a.onChange;
|
41
41
|
var _h = (0, react_1.useState)(""), inputValue = _h[0], setInputValue = _h[1];
|
42
42
|
var _j = (0, react_1.useState)(false), dropdownVisible = _j[0], setDropdownVisible = _j[1];
|
43
|
-
// Dropdown genişliği için
|
44
43
|
var _k = (0, react_1.useState)(undefined), dropdownWidth = _k[0], setDropdownWidth = _k[1];
|
45
44
|
var _l = (0, react_1.useState)(false), isInvalid = _l[0], setIsInvalid = _l[1];
|
46
45
|
var containerRef = (0, react_1.useRef)(null);
|
@@ -62,7 +61,7 @@ var CustomSelect = function (_a) {
|
|
62
61
|
return function () {
|
63
62
|
window.removeEventListener("resize", updateDropdownWidth);
|
64
63
|
};
|
65
|
-
}, [
|
64
|
+
}, []);
|
66
65
|
// Dış tıklamada dropdown'ı kapat
|
67
66
|
(0, react_1.useEffect)(function () {
|
68
67
|
var handleClickOutside = function (event) {
|
@@ -76,6 +75,18 @@ var CustomSelect = function (_a) {
|
|
76
75
|
document.removeEventListener("mousedown", handleClickOutside);
|
77
76
|
};
|
78
77
|
}, []);
|
78
|
+
var handleToggle = function () {
|
79
|
+
if (disabled)
|
80
|
+
return;
|
81
|
+
if (!dropdownVisible && containerRef.current) {
|
82
|
+
var style_1 = window.getComputedStyle(containerRef.current);
|
83
|
+
var width = containerRef.current.getBoundingClientRect().width -
|
84
|
+
parseFloat(style_1.paddingLeft) -
|
85
|
+
parseFloat(style_1.paddingRight);
|
86
|
+
setDropdownWidth(width);
|
87
|
+
}
|
88
|
+
setDropdownVisible(function (v) { return !v; });
|
89
|
+
};
|
79
90
|
var toggleValue = function (selectedVal) {
|
80
91
|
if (multiple) {
|
81
92
|
var newValue = currentValues.includes(selectedVal)
|
@@ -102,10 +113,14 @@ var CustomSelect = function (_a) {
|
|
102
113
|
react_1.default.createElement("div", { className: "form-group" },
|
103
114
|
react_1.default.createElement("label", { htmlFor: id, className: "form-label" }, label),
|
104
115
|
react_1.default.createElement("div", { className: "select-container form-control ".concat(disabled ? "disabled" : "", " \n ").concat(submitted
|
105
|
-
?
|
106
|
-
?
|
107
|
-
|
108
|
-
|
116
|
+
? Array.isArray(value)
|
117
|
+
? value.length > 0
|
118
|
+
? "is-valid"
|
119
|
+
: "is-invalid"
|
120
|
+
: value
|
121
|
+
? "is-valid"
|
122
|
+
: "is-invalid"
|
123
|
+
: ""), onClick: handleToggle, style: { cursor: disabled ? "not-allowed" : "pointer" } }, multiple ? (currentValues.length > 0 ? (currentValues.map(function (val) {
|
109
124
|
var option = options.find(function (opt) { return opt.value === val; });
|
110
125
|
return (react_1.default.createElement("span", { key: val, className: "badge bg-primary m-1" },
|
111
126
|
react_1.default.createElement("span", null, option === null || option === void 0 ? void 0 : option.label),
|
@@ -126,18 +141,17 @@ var CustomSelect = function (_a) {
|
|
126
141
|
position: "absolute",
|
127
142
|
zIndex: 10,
|
128
143
|
width: dropdownWidth,
|
129
|
-
overflow: "visible",
|
144
|
+
overflow: "visible",
|
130
145
|
} },
|
131
146
|
react_1.default.createElement("div", { style: {
|
132
147
|
maxHeight: "200px",
|
133
148
|
overflowY: "auto",
|
134
|
-
//paddingBottom: "40px", // Kapama butonunun yer açması için
|
135
149
|
} },
|
136
150
|
searchable && (react_1.default.createElement("input", { type: "text", placeholder: "Ara...", className: "form-control search-input", value: inputValue, onChange: function (e) { return setInputValue(e.target.value); } })),
|
137
151
|
filteredOptions.length > 0 ? (filteredOptions.map(function (option) { return (react_1.default.createElement("div", { key: option.id, className: "dropdown-item ".concat(currentValues.includes(option.value) ? "selected" : ""), onClick: function () { return toggleValue(option.value); } },
|
138
|
-
currentValues.includes(option.value) && react_1.default.createElement(fa_1.FaCheck, { className: "me-2 text-success" }),
|
152
|
+
currentValues.includes(option.value) && (react_1.default.createElement(fa_1.FaCheck, { className: "me-2 text-success" })),
|
139
153
|
option.label)); })) : (react_1.default.createElement("div", { className: "dropdown-item text-muted" }, "Uygun se\u00E7enek yok"))),
|
140
|
-
react_1.default.createElement("button", { type: "button", className: "dropdown-close-btn", style: {
|
154
|
+
multiple && (react_1.default.createElement("button", { type: "button", className: "dropdown-close-btn", style: {
|
141
155
|
position: "absolute",
|
142
156
|
bottom: "0",
|
143
157
|
right: "0",
|
@@ -152,7 +166,7 @@ var CustomSelect = function (_a) {
|
|
152
166
|
justifyContent: "center",
|
153
167
|
cursor: "pointer",
|
154
168
|
}, onClick: function () { return setDropdownVisible(false); } },
|
155
|
-
react_1.default.createElement(fa_1.FaTimes, null)))),
|
169
|
+
react_1.default.createElement(fa_1.FaTimes, null))))),
|
156
170
|
react_1.default.createElement("div", { className: "invalid-feedback text-danger mt-2" },
|
157
171
|
react_1.default.createElement("div", { className: "description-icon" },
|
158
172
|
react_1.default.createElement(fa_1.FaExclamationTriangle, null)),
|