albinasoft-ui-package 1.1.21 → 1.1.23

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,8 +37,8 @@ var CustomButton_1 = __importDefault(require("./CustomButton"));
37
37
  var CustomInput_1 = __importDefault(require("./CustomInput"));
38
38
  ag_grid_community_1.ModuleRegistry.registerModules([ag_grid_community_1.AllCommunityModule]);
39
39
  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, labelButton1 = _a.labelButton1, onClickButton1 = _a.onClickButton1, typeButton1 = _a.typeButton1, disabledButton1 = _a.disabledButton1, labelButton2 = _a.labelButton2, onClickButton2 = _a.onClickButton2, typeButton2 = _a.typeButton2, disabledButton2 = _a.disabledButton2, labelButton3 = _a.labelButton3, onClickButton3 = _a.onClickButton3, typeButton3 = _a.typeButton3, disabledButton3 = _a.disabledButton3, labelButton4 = _a.labelButton4, onClickButton4 = _a.onClickButton4, typeButton4 = _a.typeButton4, disabledButton4 = _a.disabledButton4, labelButton5 = _a.labelButton5, onClickButton5 = _a.onClickButton5, typeButton5 = _a.typeButton5, disabledButton5 = _a.disabledButton5;
41
- var _m = (0, react_1.useState)(""), quickFilterText = _m[0], setQuickFilterText = _m[1];
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, _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;
41
+ var _2 = (0, react_1.useState)(""), quickFilterText = _2[0], setQuickFilterText = _2[1];
42
42
  // Tema ayarları
43
43
  var theme = ag_grid_community_1.themeQuartz.withParams({
44
44
  accentColor: "var(--bs-grid-accentColor)",
@@ -66,7 +66,24 @@ function CustomDatatable(_a) {
66
66
  borderRadius: 10,
67
67
  } }))),
68
68
  react_1.default.createElement("div", { style: { width: "100%", height: tableHeight ? "".concat(tableHeight, "px") : "auto" } },
69
- react_1.default.createElement(ag_grid_react_1.AgGridReact, { loading: loading, domLayout: tableHeight ? undefined : "autoHeight", theme: theme, rowData: rowData, columnDefs: columnDefs, localeText: localeText, quickFilterText: quickFilterText.toLowerCase(), 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 }))));
69
+ react_1.default.createElement(ag_grid_react_1.AgGridReact, { loading: loading, domLayout: tableHeight ? undefined : "autoHeight", theme: theme, rowData: rowData, columnDefs: columnDefs, localeText: localeText, quickFilterText: quickFilterText.toLowerCase(), defaultColDef: {
70
+ flex: 1,
71
+ minWidth: minWidth,
72
+ resizable: true,
73
+ filter: filter,
74
+ floatingFilter: floatingFilter,
75
+ getQuickFilterText: function (params) {
76
+ return params.value ? params.value.toString().toLocaleLowerCase("tr-TR") : "";
77
+ },
78
+ filterParams: {
79
+ textFormatter: function (value) {
80
+ return value ? value.toString().toLocaleLowerCase("tr-TR") : null;
81
+ },
82
+ filterOptions: ["contains"],
83
+ defaultOption: "contains",
84
+ suppressAndOrCondition: true,
85
+ },
86
+ }, 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 }))));
70
87
  }
71
88
  exports.CustomDatatable = CustomDatatable;
72
89
  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
- }, [containerRef.current]);
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
- ? (Array.isArray(value)
106
- ? (value.length > 0 ? "is-valid" : "is-invalid")
107
- : (value ? "is-valid" : "is-invalid"))
108
- : ""), onClick: function () { return !disabled && setDropdownVisible(!dropdownVisible); }, style: { cursor: disabled ? "not-allowed" : "pointer" } }, multiple ? (currentValues.length > 0 ? (currentValues.map(function (val) {
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", // Dışa taşmasına izin ver
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)),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "albinasoft-ui-package",
3
- "version": "1.1.21",
3
+ "version": "1.1.23",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {