albinasoft-ui-package 1.1.48 → 1.1.50
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.
@@ -9,7 +9,7 @@ interface CustomDateTimePickerProps {
|
|
9
9
|
id?: string;
|
10
10
|
name?: string;
|
11
11
|
label: string;
|
12
|
-
value:
|
12
|
+
value: string | null;
|
13
13
|
placeholder?: string;
|
14
14
|
required?: boolean;
|
15
15
|
errorMessage?: string;
|
@@ -26,7 +26,7 @@ interface CustomDateTimePickerProps {
|
|
26
26
|
timeFormat?: TimeFormat;
|
27
27
|
timeIntervals?: number;
|
28
28
|
submitted?: boolean;
|
29
|
-
onChange: (
|
29
|
+
onChange: (dateString: string | null) => void;
|
30
30
|
}
|
31
31
|
declare const CustomDateTimePicker: React.FC<CustomDateTimePickerProps>;
|
32
32
|
export { CustomDateTimePicker, TimeFormat };
|
@@ -16,20 +16,14 @@ var TimeFormat;
|
|
16
16
|
TimeFormat["HM"] = "HH:mm";
|
17
17
|
})(TimeFormat || (TimeFormat = {}));
|
18
18
|
exports.TimeFormat = TimeFormat;
|
19
|
-
//
|
19
|
+
// Türkçe locale objesi
|
20
20
|
var customTrLocale = {
|
21
21
|
localize: {
|
22
|
-
month: function (n) {
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
return months[n];
|
28
|
-
},
|
29
|
-
day: function (n) {
|
30
|
-
var days = ["Pzr", "Pts", "Sal", "Çrş", "Prş", "Cum", "Cts"];
|
31
|
-
return days[n];
|
32
|
-
},
|
22
|
+
month: function (n) { return [
|
23
|
+
"Ocak", "Şubat", "Mart", "Nisan", "Mayıs", "Haziran",
|
24
|
+
"Temmuz", "Ağustos", "Eylül", "Ekim", "Kasım", "Aralık"
|
25
|
+
][n]; },
|
26
|
+
day: function (n) { return ["Pzr", "Pts", "Sal", "Çrş", "Prş", "Cum", "Cts"][n]; },
|
33
27
|
},
|
34
28
|
formatLong: {
|
35
29
|
date: function () { return "dd.MM.yyyy"; },
|
@@ -40,25 +34,29 @@ var customTrLocale = {
|
|
40
34
|
weekStartsOn: 1,
|
41
35
|
},
|
42
36
|
};
|
37
|
+
// Yardımcı: Date objesini TR saatine göre ISO-like string'e çevir
|
38
|
+
var toLocalISOString = function (date) {
|
39
|
+
var pad = function (n) { return n.toString().padStart(2, "0"); };
|
40
|
+
return "".concat(date.getFullYear(), "-").concat(pad(date.getMonth() + 1), "-").concat(pad(date.getDate()), "T").concat(pad(date.getHours()), ":").concat(pad(date.getMinutes()), ":").concat(pad(date.getSeconds()));
|
41
|
+
};
|
43
42
|
var CustomDateTimePicker = function (_a) {
|
44
43
|
var id = _a.id, name = _a.name, label = _a.label, value = _a.value, placeholder = _a.placeholder, _b = _a.required, required = _b === void 0 ? false : _b, errorMessage = _a.errorMessage, _c = _a.conditionalErrorVisible, conditionalErrorVisible = _c === void 0 ? false : _c, conditionalErrorMessage = _a.conditionalErrorMessage, tooltip = _a.tooltip, description = _a.description, _d = _a.disabled, disabled = _d === void 0 ? false : _d, className = _a.className, style = _a.style, showTimeSelect = _a.showTimeSelect, showTimeSelectOnly = _a.showTimeSelectOnly, showYearDropdown = _a.showYearDropdown, _e = _a.timeFormat, timeFormat = _e === void 0 ? TimeFormat.HM : _e, timeIntervals = _a.timeIntervals, submitted = _a.submitted, onChange = _a.onChange;
|
45
44
|
var isInvalid = submitted && required && !value;
|
45
|
+
// Value string olarak geliyor, bunu input'ta göstermek için Date'e çeviriyoruz
|
46
|
+
var parsedValue = value ? new Date(value.replace(" ", "T")) : null;
|
46
47
|
var handleChange = function (date) {
|
47
|
-
if (!date)
|
48
|
-
onChange(null);
|
49
|
-
|
50
|
-
|
51
|
-
// TR saatini UTC’ye çevirmeden aynı şekilde yeni Date oluştur
|
52
|
-
var localDate = new Date(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds());
|
53
|
-
onChange(localDate); // TR saatli Date olarak döndür
|
48
|
+
if (!date)
|
49
|
+
return onChange(null);
|
50
|
+
var formatted = toLocalISOString(date);
|
51
|
+
onChange(formatted);
|
54
52
|
};
|
55
53
|
return (react_1.default.createElement("div", { className: "col-12", style: style },
|
56
54
|
react_1.default.createElement("div", { className: "form-group" },
|
57
55
|
react_1.default.createElement("label", { htmlFor: id, className: "form-label" }, label),
|
58
56
|
react_1.default.createElement("div", { className: "position-relative" },
|
59
|
-
react_1.default.createElement(react_bootstrap_1.OverlayTrigger, { placement: "bottom", overlay: tooltip ?
|
57
|
+
react_1.default.createElement(react_bootstrap_1.OverlayTrigger, { placement: "bottom", overlay: tooltip ? react_1.default.createElement(react_bootstrap_1.Tooltip, { id: "tooltip-".concat(id) }, tooltip) : react_1.default.createElement(react_1.default.Fragment, null) },
|
60
58
|
react_1.default.createElement("div", null,
|
61
|
-
react_1.default.createElement(react_datepicker_1.default, { id: id, name: name, selected:
|
59
|
+
react_1.default.createElement(react_datepicker_1.default, { id: id, name: name, selected: parsedValue, onChange: handleChange, className: "form-control ".concat(className || "", " ").concat(submitted
|
62
60
|
? isInvalid
|
63
61
|
? "is-invalid"
|
64
62
|
: "is-valid"
|
@@ -105,12 +105,12 @@ interface DateTimePickerElement {
|
|
105
105
|
id?: string;
|
106
106
|
type: ElementType;
|
107
107
|
label: string;
|
108
|
-
value:
|
108
|
+
value: string | null;
|
109
109
|
rowId?: number;
|
110
110
|
colId?: number;
|
111
111
|
innerRowId?: number;
|
112
112
|
colClass?: string;
|
113
|
-
onChange: (e:
|
113
|
+
onChange: (e: string | null) => void;
|
114
114
|
}
|
115
115
|
interface TextElement {
|
116
116
|
id: string;
|
@@ -60,7 +60,7 @@ var CustomTimeline = function (_a) {
|
|
60
60
|
return (react_1.default.createElement("li", { key: key, className: "w-100 mb-3 position-relative ps-4 timeline-item" },
|
61
61
|
react_1.default.createElement("div", { className: "timeline-line" }),
|
62
62
|
react_1.default.createElement("div", { className: "timeline-dots ".concat(element.dotColor || DotColor.PRIMARY), onClick: function () { return toggleItem(key); } }, isExpanded ? react_1.default.createElement(fa_1.FaChevronDown, null) : react_1.default.createElement(fa_1.FaChevronRight, null)),
|
63
|
-
react_1.default.createElement("div", { className: "ms-3 mt-2" },
|
63
|
+
react_1.default.createElement("div", { className: "ms-3 mt-2", style: { cursor: "pointer" }, onClick: function () { return toggleItem(key); } },
|
64
64
|
react_1.default.createElement(CustomText_1.default, { value: element.title, textType: CustomText_1.TextType.HEADING, lineHeight: CustomText_1.LineHeight.XXS })),
|
65
65
|
react_1.default.createElement("div", { className: "expandable-content ms-3 ".concat(isExpanded ? "expanded" : "collapsed") },
|
66
66
|
react_1.default.createElement(CustomText_1.default, { value: element.mainTime, textType: CustomText_1.TextType.PARAGRAPH, fontSize: CustomText_1.FontSize.XXS, lineHeight: CustomText_1.LineHeight.M, italic: true }),
|