ar-design 0.4.32 → 0.4.34
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/components/data-display/calendar/styles.week-view.css +36 -19
- package/dist/components/data-display/calendar/views/Week.js +52 -14
- package/dist/components/data-display/table/FilterPopup.js +1 -0
- package/dist/components/data-display/table/PropertiesPopup.d.ts +3 -2
- package/dist/components/data-display/table/PropertiesPopup.js +7 -4
- package/dist/components/data-display/table/index.js +17 -26
- package/dist/libs/core/application/hooks/useTranslation.d.ts +2 -1
- package/dist/libs/core/application/hooks/useTranslation.js +7 -5
- package/dist/libs/core/application/locales/table/ITableLocale.d.ts +17 -0
- package/dist/libs/core/application/locales/table/ITableLocale.js +1 -0
- package/dist/libs/core/application/locales/table/en.d.ts +3 -0
- package/dist/libs/core/application/locales/table/en.js +20 -0
- package/dist/libs/core/application/locales/table/tr.d.ts +3 -0
- package/dist/libs/core/application/locales/table/tr.js +20 -0
- package/dist/libs/infrastructure/shared/DATE.d.ts +2 -2
- package/dist/libs/infrastructure/shared/DATE.js +4 -2
- package/package.json +1 -1
|
@@ -16,10 +16,12 @@
|
|
|
16
16
|
> .item {
|
|
17
17
|
display: flex;
|
|
18
18
|
flex-direction: column;
|
|
19
|
+
flex: 1;
|
|
19
20
|
align-items: center;
|
|
20
21
|
gap: 1rem;
|
|
21
22
|
width: calc(100% / 7);
|
|
22
23
|
padding: 0.5rem 0;
|
|
24
|
+
text-align: center;
|
|
23
25
|
|
|
24
26
|
> .day-name {
|
|
25
27
|
color: var(--gray-400);
|
|
@@ -33,11 +35,16 @@
|
|
|
33
35
|
}
|
|
34
36
|
|
|
35
37
|
> .body {
|
|
38
|
+
position: relative;
|
|
36
39
|
display: flex;
|
|
37
40
|
flex-direction: row;
|
|
38
41
|
width: 100%;
|
|
39
42
|
|
|
40
43
|
> .clocks {
|
|
44
|
+
position: relative;
|
|
45
|
+
width: 50px;
|
|
46
|
+
z-index: 1;
|
|
47
|
+
|
|
41
48
|
> div {
|
|
42
49
|
height: 60px;
|
|
43
50
|
|
|
@@ -54,25 +61,7 @@
|
|
|
54
61
|
height: calc(24 * 60px);
|
|
55
62
|
border: solid 1px transparent;
|
|
56
63
|
border-top-color: var(--gray-200);
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
> .events-layer {
|
|
60
|
-
position: absolute;
|
|
61
|
-
top: 0;
|
|
62
|
-
left: 0;
|
|
63
|
-
width: 100%;
|
|
64
|
-
height: 100%;
|
|
65
|
-
pointer-events: none;
|
|
66
|
-
z-index: 1;
|
|
67
|
-
|
|
68
|
-
> .event-box {
|
|
69
|
-
position: absolute;
|
|
70
|
-
width: calc(100% / 7);
|
|
71
|
-
padding: 0.5rem;
|
|
72
|
-
color: var(--white);
|
|
73
|
-
font-size: 12px;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
64
|
+
z-index: 1;
|
|
76
65
|
|
|
77
66
|
> .row {
|
|
78
67
|
position: relative;
|
|
@@ -123,6 +112,34 @@
|
|
|
123
112
|
}
|
|
124
113
|
}
|
|
125
114
|
}
|
|
115
|
+
|
|
116
|
+
> .events-layer {
|
|
117
|
+
position: absolute;
|
|
118
|
+
right: 0;
|
|
119
|
+
width: calc(100% - 50px); /* Solda yer alan clocks'dan dolayı -50px yapıldı. */
|
|
120
|
+
height: calc(24 * 60px);
|
|
121
|
+
z-index: 2;
|
|
122
|
+
|
|
123
|
+
> .event-box {
|
|
124
|
+
position: absolute;
|
|
125
|
+
width: calc(100% / 7);
|
|
126
|
+
padding: 0.5rem;
|
|
127
|
+
color: var(--white);
|
|
128
|
+
font-size: 12px;
|
|
129
|
+
overflow: hidden;
|
|
130
|
+
z-index: 10;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
126
133
|
}
|
|
127
134
|
}
|
|
128
135
|
}
|
|
136
|
+
|
|
137
|
+
.ar-calendar-tooltip {
|
|
138
|
+
position: fixed;
|
|
139
|
+
background-color: var(--black);
|
|
140
|
+
padding: 1rem;
|
|
141
|
+
border-radius: var(--border-radius-sm);
|
|
142
|
+
color: var(--white);
|
|
143
|
+
pointer-events: none;
|
|
144
|
+
z-index: 200;
|
|
145
|
+
}
|
|
@@ -1,21 +1,49 @@
|
|
|
1
|
-
import React, { useMemo } from "react";
|
|
1
|
+
import React, { useEffect, useMemo, useRef, useState } from "react";
|
|
2
|
+
import ReactDOM from "react-dom";
|
|
2
3
|
const Week = function ({ data, renderItem, states, config }) {
|
|
4
|
+
// refs
|
|
5
|
+
const _eventBox = useRef([]);
|
|
6
|
+
// states
|
|
7
|
+
const [mouseCoordinate, setMouseCoordinate] = useState({
|
|
8
|
+
x: 0,
|
|
9
|
+
y: 0,
|
|
10
|
+
isRightHalf: false,
|
|
11
|
+
isBottomHalf: false,
|
|
12
|
+
});
|
|
13
|
+
const [activeTooltip, setActiveTooltip] = useState(null);
|
|
14
|
+
// variables
|
|
3
15
|
const startHour = 0;
|
|
4
16
|
const endHour = 24;
|
|
5
17
|
const hours = endHour - startHour;
|
|
6
18
|
const cellHeight = 60;
|
|
19
|
+
// methods
|
|
7
20
|
const weekDays = useMemo(() => getWeekDays(states.currentDate.get, config?.weekStartsOn ?? 1), [states.currentDate.get, config?.weekStartsOn]);
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
21
|
+
// useEffects
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
const handleMouseMove = (event) => {
|
|
24
|
+
setMouseCoordinate({
|
|
25
|
+
x: event.clientX,
|
|
26
|
+
y: event.clientY,
|
|
27
|
+
isRightHalf: event.clientX > window.innerWidth / 2,
|
|
28
|
+
isBottomHalf: event.clientY > window.innerHeight / 2,
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
window.addEventListener("mousemove", handleMouseMove);
|
|
32
|
+
return () => {
|
|
33
|
+
window.removeEventListener("mousemove", handleMouseMove);
|
|
34
|
+
};
|
|
35
|
+
}, []);
|
|
36
|
+
return (React.createElement(React.Fragment, null,
|
|
37
|
+
React.createElement("div", { className: "ar-calendar-week-view" },
|
|
38
|
+
React.createElement("div", { className: "head" }, weekDays.map((day) => (React.createElement("div", { key: day.toISOString(), className: "item" },
|
|
39
|
+
React.createElement("span", { className: "day-name" }, day.toLocaleString(config?.locale ?? "tr", { weekday: "short" }).toUpperCase()),
|
|
40
|
+
React.createElement("span", { className: "date" }, day.getDate()))))),
|
|
41
|
+
React.createElement("div", { className: "body" },
|
|
42
|
+
React.createElement("div", { className: "clocks" }, Array.from({ length: hours }, (_, index) => (React.createElement("div", { key: index },
|
|
43
|
+
React.createElement("span", null,
|
|
44
|
+
String(startHour + index).padStart(2, "0"),
|
|
45
|
+
":00"))))),
|
|
46
|
+
React.createElement("div", { role: "grid", className: "grid" }, Array.from({ length: hours }).map((_, rowIndex) => (React.createElement("div", { key: rowIndex, className: "row" }, weekDays.map((_, colIndex) => (React.createElement("div", { key: colIndex, className: "cell" }))))))),
|
|
19
47
|
React.createElement("div", { className: "events-layer" }, data.flatMap((event, eventIdx) => {
|
|
20
48
|
const eventColor = getColor(eventIdx);
|
|
21
49
|
// Her etkinlik için haftanın günlerini gezip, o güne düşen parçayı hesaplıyoruz
|
|
@@ -36,7 +64,11 @@ const Week = function ({ data, renderItem, states, config }) {
|
|
|
36
64
|
// Durum Kontrolleri
|
|
37
65
|
const isContinuedFromYesterday = event.start < dayStart;
|
|
38
66
|
const isContinuingTomorrow = event.end > dayEnd;
|
|
39
|
-
return (React.createElement("div", {
|
|
67
|
+
return (React.createElement("div", { ref: (element) => {
|
|
68
|
+
if (!element)
|
|
69
|
+
return;
|
|
70
|
+
_eventBox.current[dayIndex] = element;
|
|
71
|
+
}, key: `${eventIdx}-${dayIndex}`, onMouseEnter: () => setActiveTooltip({ content: renderItem(event, eventIdx), id: eventIdx }), onMouseLeave: () => setActiveTooltip(null), className: "event-box", style: {
|
|
40
72
|
backgroundColor: eventColor.bg,
|
|
41
73
|
top: `${top}px`,
|
|
42
74
|
height: `${height}px`,
|
|
@@ -53,7 +85,13 @@ const Week = function ({ data, renderItem, states, config }) {
|
|
|
53
85
|
}
|
|
54
86
|
return null;
|
|
55
87
|
});
|
|
56
|
-
}))))
|
|
88
|
+
})))),
|
|
89
|
+
activeTooltip &&
|
|
90
|
+
ReactDOM.createPortal(React.createElement("div", { className: "ar-calendar-tooltip", style: {
|
|
91
|
+
top: mouseCoordinate.y,
|
|
92
|
+
left: mouseCoordinate.x,
|
|
93
|
+
transform: `translate(${mouseCoordinate.isRightHalf ? "-110%" : "10%"}, ${mouseCoordinate.isBottomHalf ? "-110%" : "10%"})`,
|
|
94
|
+
} }, activeTooltip.content), document.body)));
|
|
57
95
|
};
|
|
58
96
|
// Yardımcı Fonksiyonlar aynı kalıyor
|
|
59
97
|
const getWeekRange = (date, weekStartsOn = 1) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { Dispatch, MutableRefObject, SetStateAction } from "react";
|
|
2
2
|
import { TableColumnType } from "../../../libs/types";
|
|
3
|
-
import { Sort } from "./IProps";
|
|
3
|
+
import { Config, Sort } from "./IProps";
|
|
4
4
|
interface IProps<T> {
|
|
5
5
|
refs: {
|
|
6
6
|
tableContent: MutableRefObject<HTMLDivElement | null>;
|
|
@@ -24,7 +24,8 @@ interface IProps<T> {
|
|
|
24
24
|
x: number;
|
|
25
25
|
y: number;
|
|
26
26
|
};
|
|
27
|
+
config: Config<T>;
|
|
27
28
|
}
|
|
28
|
-
declare function PropertiesPopup<T extends object>({ refs, states, methods, coordinate }: IProps<T>): false | React.ReactPortal;
|
|
29
|
+
declare function PropertiesPopup<T extends object>({ refs, states, methods, coordinate, config }: IProps<T>): false | React.ReactPortal;
|
|
29
30
|
declare const _default: typeof PropertiesPopup;
|
|
30
31
|
export default _default;
|
|
@@ -3,9 +3,12 @@ import React, { memo, useEffect, useMemo, useRef } from "react";
|
|
|
3
3
|
import ReactDOM from "react-dom";
|
|
4
4
|
import { ARIcon } from "../../icons";
|
|
5
5
|
import { ExtractKey } from "./Helpers";
|
|
6
|
-
|
|
6
|
+
import { useTranslation } from "../../../libs/core/application/hooks";
|
|
7
|
+
function PropertiesPopup({ refs, states, methods, coordinate, config }) {
|
|
7
8
|
// refs
|
|
8
9
|
const _arTablePropertiesPopup = useRef(null);
|
|
10
|
+
// hooks
|
|
11
|
+
const { t } = useTranslation(String(config.locale ?? "tr"));
|
|
9
12
|
// methods
|
|
10
13
|
const handleClickOutSide = (event) => {
|
|
11
14
|
const target = event.target;
|
|
@@ -80,17 +83,17 @@ function PropertiesPopup({ refs, states, methods, coordinate }) {
|
|
|
80
83
|
currentSort && (!currentSort.direction || currentSort.direction === "desc") && (React.createElement("li", { onClick: () => handleSort(currentKey, "asc") },
|
|
81
84
|
React.createElement("span", null,
|
|
82
85
|
React.createElement(ARIcon, { icon: "ArrowUp" })),
|
|
83
|
-
React.createElement("span", null, "
|
|
86
|
+
React.createElement("span", null, t("Table.Properties.Asc.Text")))),
|
|
84
87
|
currentSort && (!currentSort.direction || currentSort.direction === "asc") && (React.createElement("li", { onClick: () => handleSort(currentKey, "desc") },
|
|
85
88
|
React.createElement("span", null,
|
|
86
89
|
React.createElement(ARIcon, { icon: "ArrowDown" })),
|
|
87
|
-
React.createElement("span", null, "
|
|
90
|
+
React.createElement("span", null, t("Table.Properties.Desc.Text")))),
|
|
88
91
|
currentSort && currentSort.direction && (React.createElement("li", { onClick: () => {
|
|
89
92
|
states.sort.set((prev) => prev.filter((s) => s.key !== currentKey));
|
|
90
93
|
states.open.set(false);
|
|
91
94
|
} },
|
|
92
95
|
React.createElement("span", null,
|
|
93
96
|
React.createElement(ARIcon, { icon: "ChevronExpand" })),
|
|
94
|
-
React.createElement("span", null, "
|
|
97
|
+
React.createElement("span", null, t("Table.Properties.ClearSort.Text")))))), document.body));
|
|
95
98
|
}
|
|
96
99
|
export default memo(PropertiesPopup);
|
|
@@ -19,16 +19,7 @@ import { ExtractKey } from "./Helpers";
|
|
|
19
19
|
import Header from "./header/Header";
|
|
20
20
|
import TBody from "./body/TBody";
|
|
21
21
|
import DatePicker from "../../form/date-picker";
|
|
22
|
-
|
|
23
|
-
{ value: FilterOperator.Contains, text: "İçerir" },
|
|
24
|
-
{ value: FilterOperator.DoesNotContains, text: "İçermez" },
|
|
25
|
-
{ value: FilterOperator.Equals, text: "Eşittir" },
|
|
26
|
-
{ value: FilterOperator.DoesNotEquals, text: "Eşit değildir" },
|
|
27
|
-
{ value: FilterOperator.BeginsWith, text: "İle başlar" },
|
|
28
|
-
{ value: FilterOperator.EndsWith, text: "İle biter" },
|
|
29
|
-
{ value: FilterOperator.Blank, text: "Boş" },
|
|
30
|
-
{ value: FilterOperator.NotBlank, text: "Boş değil" },
|
|
31
|
-
];
|
|
22
|
+
import { useTranslation } from "../../../libs/core/application/hooks";
|
|
32
23
|
const { Row, Column } = Grid;
|
|
33
24
|
const Table = forwardRef(({ children, trackBy, title, description, data, columns, actions, rowBackgroundColor, selections, previousSelections, sortedParams, searchedParams, onEditable, onDnD, pagination, config = { isSearchable: false }, }, ref) => {
|
|
34
25
|
// refs
|
|
@@ -88,6 +79,7 @@ const Table = forwardRef(({ children, trackBy, title, description, data, columns
|
|
|
88
79
|
// states -> Mobil
|
|
89
80
|
const [isMobile, setIsMobile] = useState(false);
|
|
90
81
|
// hooks
|
|
82
|
+
const { t } = useTranslation(String(config.locale ?? "tr"));
|
|
91
83
|
// Dışarıdan gelen ref'i _innerRef'e bağla.
|
|
92
84
|
useImperativeHandle(ref, () => _innerRef.current);
|
|
93
85
|
if (config && Object.keys(config.scroll || {}).length > 0) {
|
|
@@ -236,14 +228,14 @@ const Table = forwardRef(({ children, trackBy, title, description, data, columns
|
|
|
236
228
|
React.createElement(Column, { size: 12 },
|
|
237
229
|
React.createElement(Select, { value: filterOption.find((x) => x.value === filterPopupOption?.option?.value && filterPopupOption.key === c.key) ?? filterOption[0], options: filterOption, onChange: (option) => {
|
|
238
230
|
setFilterPopupOption({ key: c.key, option: option });
|
|
239
|
-
}, placeholder: "
|
|
231
|
+
}, placeholder: t("Table.Filters.Where.Input.Placeholder") })),
|
|
240
232
|
React.createElement(Column, { size: 12 },
|
|
241
|
-
React.createElement(Input, { value: value ?? "", onChange: (event) => handleChange(event.target.value), placeholder: "
|
|
233
|
+
React.createElement(Input, { value: value ?? "", onChange: (event) => handleChange(event.target.value), placeholder: t("Table.Filters.Search.Input.Placeholder") }))));
|
|
242
234
|
case "object":
|
|
243
235
|
case "boolean":
|
|
244
236
|
return (React.createElement(Row, null,
|
|
245
237
|
React.createElement(Column, { size: 12 },
|
|
246
|
-
React.createElement(Input, {
|
|
238
|
+
React.createElement(Input, { value: value ?? "", onChange: (event) => setFilterPopupOptionSearchText(event.target.value), placeholder: t("Table.Filters.Search.Input.Placeholder") })),
|
|
247
239
|
React.createElement(Column, { size: 12 }, c.filters
|
|
248
240
|
?.filter((filter) => filter.text.toLocaleLowerCase().includes(filterPopupOptionSearchText?.toLocaleLowerCase() ?? ""))
|
|
249
241
|
?.map((filter, fIndex) => {
|
|
@@ -577,6 +569,16 @@ const Table = forwardRef(({ children, trackBy, title, description, data, columns
|
|
|
577
569
|
window.removeEventListener("resize", handleResize);
|
|
578
570
|
};
|
|
579
571
|
}, []);
|
|
572
|
+
const filterOption = [
|
|
573
|
+
{ value: FilterOperator.Contains, text: t("Table.Filters.Where.Input.Item.1.Text") },
|
|
574
|
+
{ value: FilterOperator.DoesNotContains, text: t("Table.Filters.Where.Input.Item.2.Text") },
|
|
575
|
+
{ value: FilterOperator.Equals, text: t("Table.Filters.Where.Input.Item.3.Text") },
|
|
576
|
+
{ value: FilterOperator.DoesNotEquals, text: t("Table.Filters.Where.Input.Item.4.Text") },
|
|
577
|
+
{ value: FilterOperator.BeginsWith, text: t("Table.Filters.Where.Input.Item.5.Text") },
|
|
578
|
+
{ value: FilterOperator.EndsWith, text: t("Table.Filters.Where.Input.Item.6.Text") },
|
|
579
|
+
{ value: FilterOperator.Blank, text: t("Table.Filters.Where.Input.Item.7.Text") },
|
|
580
|
+
{ value: FilterOperator.NotBlank, text: t("Table.Filters.Where.Input.Item.8.Text") },
|
|
581
|
+
];
|
|
580
582
|
return (React.createElement("div", { ref: _tableWrapper, className: _tableClassName.map((c) => c).join(" ") },
|
|
581
583
|
(title || description || actions || React.Children.count(children) > 0) && (React.createElement(Header, { title: title, description: description, actions: actions })),
|
|
582
584
|
React.createElement("div", { ref: _tableContent, className: "content", onScroll: handleScroll },
|
|
@@ -682,7 +684,7 @@ const Table = forwardRef(({ children, trackBy, title, description, data, columns
|
|
|
682
684
|
}, states: {
|
|
683
685
|
open: { get: openProperties, set: setOpenProperties },
|
|
684
686
|
sort: { get: sortConfig, set: setSortConfig, currentColumn: sortCurrentColumn },
|
|
685
|
-
}, methods: { handleScroll }, coordinate: propertiesButtonCoordinate })),
|
|
687
|
+
}, methods: { handleScroll }, coordinate: propertiesButtonCoordinate, config: config })),
|
|
686
688
|
React.createElement("div", { className: "footer" },
|
|
687
689
|
React.createElement("span", null, isMobile ? (React.createElement(React.Fragment, null,
|
|
688
690
|
React.createElement("strong", null,
|
|
@@ -692,18 +694,7 @@ const Table = forwardRef(({ children, trackBy, title, description, data, columns
|
|
|
692
694
|
Math.min(currentPage * selectedPerPage, pagination?.totalRecords || getData.length),
|
|
693
695
|
" of",
|
|
694
696
|
" ",
|
|
695
|
-
pagination?.totalRecords || getData.length))) : (
|
|
696
|
-
React.createElement("strong", null,
|
|
697
|
-
"Showing ",
|
|
698
|
-
(currentPage - 1) * selectedPerPage + 1,
|
|
699
|
-
" to",
|
|
700
|
-
" ",
|
|
701
|
-
Math.min(currentPage * selectedPerPage, pagination?.totalRecords || getData.length)),
|
|
702
|
-
" ",
|
|
703
|
-
React.createElement("span", null,
|
|
704
|
-
"of ",
|
|
705
|
-
pagination?.totalRecords || getData.length,
|
|
706
|
-
" agreements")))),
|
|
697
|
+
pagination?.totalRecords || getData.length))) : (t("Table.Pagination.Information.Text", (currentPage - 1) * selectedPerPage + 1, Math.min(currentPage * selectedPerPage, pagination?.totalRecords || getData.length), pagination?.totalRecords || getData.length))),
|
|
707
698
|
pagination && (React.createElement(Pagination, { totalRecords: config.isServerSide ? pagination.totalRecords : (totalRecords ?? 0), currentPage: currentPage, perPage: selectedPerPage, onChange: (currentPage, perPage) => {
|
|
708
699
|
setCurrentPage(currentPage);
|
|
709
700
|
setSelectedPerPage(perPage);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { INotificationLocale } from "../locales";
|
|
2
|
+
import ITableLocale from "../locales/table/ITableLocale";
|
|
2
3
|
type LocaleMap = Record<string, Record<string, any>>;
|
|
3
4
|
declare const useTranslation: <TBaseLocale>(currentLanguage: string | undefined, translations?: LocaleMap) => {
|
|
4
|
-
t: (key: Extract<keyof TBaseLocale | keyof INotificationLocale, string>, ...args: any[]) => string;
|
|
5
|
+
t: (key: Extract<keyof TBaseLocale | keyof ITableLocale | keyof INotificationLocale, string>, ...args: any[]) => string;
|
|
5
6
|
currentLanguage: string | undefined;
|
|
6
7
|
};
|
|
7
8
|
export default useTranslation;
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import Utils from "../../../infrastructure/shared/Utils";
|
|
2
2
|
import { NotificationEN, NotificationTR } from "../locales";
|
|
3
|
+
import TableEN from "../locales/table/en";
|
|
4
|
+
import TableTR from "../locales/table/tr";
|
|
3
5
|
const useTranslation = function (currentLanguage, translations = {}) {
|
|
4
6
|
const merged = {};
|
|
5
|
-
const
|
|
6
|
-
tr: NotificationTR,
|
|
7
|
-
en: NotificationEN,
|
|
7
|
+
const ExtraLocales = {
|
|
8
|
+
tr: { ...TableTR, ...NotificationTR },
|
|
9
|
+
en: { ...TableEN, ...NotificationEN },
|
|
8
10
|
};
|
|
9
|
-
const allLanguages = new Set([...Object.keys(translations), ...Object.keys(
|
|
11
|
+
const allLanguages = new Set([...Object.keys(translations), ...Object.keys(ExtraLocales)]);
|
|
10
12
|
allLanguages.forEach((lang) => {
|
|
11
13
|
merged[lang] = {
|
|
12
14
|
...translations[lang],
|
|
13
|
-
...
|
|
15
|
+
...ExtraLocales[lang],
|
|
14
16
|
};
|
|
15
17
|
});
|
|
16
18
|
const t = (key, ...args) => {
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
interface ITableLocale {
|
|
2
|
+
"Table.Properties.Asc.Text": string;
|
|
3
|
+
"Table.Properties.Desc.Text": string;
|
|
4
|
+
"Table.Properties.ClearSort.Text": string;
|
|
5
|
+
"Table.Filters.Where.Input.Placeholder": string;
|
|
6
|
+
"Table.Filters.Where.Input.Item.1.Text": string;
|
|
7
|
+
"Table.Filters.Where.Input.Item.2.Text": string;
|
|
8
|
+
"Table.Filters.Where.Input.Item.3.Text": string;
|
|
9
|
+
"Table.Filters.Where.Input.Item.4.Text": string;
|
|
10
|
+
"Table.Filters.Where.Input.Item.5.Text": string;
|
|
11
|
+
"Table.Filters.Where.Input.Item.6.Text": string;
|
|
12
|
+
"Table.Filters.Where.Input.Item.7.Text": string;
|
|
13
|
+
"Table.Filters.Where.Input.Item.8.Text": string;
|
|
14
|
+
"Table.Filters.Search.Input.Placeholder": string;
|
|
15
|
+
"Table.Pagination.Information.Text": string;
|
|
16
|
+
}
|
|
17
|
+
export default ITableLocale;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const TableEN = {
|
|
2
|
+
// Properties
|
|
3
|
+
"Table.Properties.Asc.Text": "Sort Ascending",
|
|
4
|
+
"Table.Properties.Desc.Text": "Sort Descending",
|
|
5
|
+
"Table.Properties.ClearSort.Text": "Clear Sort",
|
|
6
|
+
// Filters
|
|
7
|
+
"Table.Filters.Where.Input.Placeholder": "Where",
|
|
8
|
+
"Table.Filters.Where.Input.Item.1.Text": "Contains",
|
|
9
|
+
"Table.Filters.Where.Input.Item.2.Text": "Does Not Contain",
|
|
10
|
+
"Table.Filters.Where.Input.Item.3.Text": "Equals",
|
|
11
|
+
"Table.Filters.Where.Input.Item.4.Text": "Does Not Equal",
|
|
12
|
+
"Table.Filters.Where.Input.Item.5.Text": "Starts With",
|
|
13
|
+
"Table.Filters.Where.Input.Item.6.Text": "Ends With",
|
|
14
|
+
"Table.Filters.Where.Input.Item.7.Text": "Is Empty",
|
|
15
|
+
"Table.Filters.Where.Input.Item.8.Text": "Is Not Empty",
|
|
16
|
+
"Table.Filters.Search.Input.Placeholder": "Search",
|
|
17
|
+
// Pagination
|
|
18
|
+
"Table.Pagination.Information.Text": "Showing {0} to {1} of {2} agreements",
|
|
19
|
+
};
|
|
20
|
+
export default TableEN;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const TableTR = {
|
|
2
|
+
// Properties
|
|
3
|
+
"Table.Properties.Asc.Text": "Artan Sırada Sırala",
|
|
4
|
+
"Table.Properties.Desc.Text": "Azalan Sırada Sırala",
|
|
5
|
+
"Table.Properties.ClearSort.Text": "Sıralamayı Temizle",
|
|
6
|
+
// Filters
|
|
7
|
+
"Table.Filters.Where.Input.Placeholder": "Koşul",
|
|
8
|
+
"Table.Filters.Where.Input.Item.1.Text": "İçerir",
|
|
9
|
+
"Table.Filters.Where.Input.Item.2.Text": "İçermez",
|
|
10
|
+
"Table.Filters.Where.Input.Item.3.Text": "Eşittir",
|
|
11
|
+
"Table.Filters.Where.Input.Item.4.Text": "Eşit değildir",
|
|
12
|
+
"Table.Filters.Where.Input.Item.5.Text": "İle başlar",
|
|
13
|
+
"Table.Filters.Where.Input.Item.6.Text": "İle biter",
|
|
14
|
+
"Table.Filters.Where.Input.Item.7.Text": "Boş",
|
|
15
|
+
"Table.Filters.Where.Input.Item.8.Text": "Boş değil",
|
|
16
|
+
"Table.Filters.Search.Input.Placeholder": "Ara",
|
|
17
|
+
// Pagination
|
|
18
|
+
"Table.Pagination.Information.Text": "{2} kayıt içerisinden {0} - {1} aralığı listeleniyor",
|
|
19
|
+
};
|
|
20
|
+
export default TableTR;
|
|
@@ -20,8 +20,8 @@ declare class DATE {
|
|
|
20
20
|
* @param locale
|
|
21
21
|
* @returns
|
|
22
22
|
*/
|
|
23
|
-
Verbose: (date: Date, locale?: string) => string;
|
|
24
|
-
WithTime: (date: Date, locale?: string) => string;
|
|
23
|
+
Verbose: (date: Date, locale?: string, UTC?: boolean) => string;
|
|
24
|
+
WithTime: (date: Date, locale?: string, UTC?: boolean) => string;
|
|
25
25
|
private GetLocaleFromLanguage;
|
|
26
26
|
}
|
|
27
27
|
declare const _default: DATE;
|
|
@@ -30,20 +30,22 @@ class DATE {
|
|
|
30
30
|
* @param locale
|
|
31
31
|
* @returns
|
|
32
32
|
*/
|
|
33
|
-
Verbose = (date, locale = "tr") => {
|
|
33
|
+
Verbose = (date, locale = "tr", UTC = false) => {
|
|
34
34
|
return date.toLocaleDateString(this.GetLocaleFromLanguage(locale), {
|
|
35
35
|
day: "numeric",
|
|
36
36
|
month: "long",
|
|
37
37
|
year: "numeric",
|
|
38
|
+
...(UTC ? { timeZone: "UTC" } : {}),
|
|
38
39
|
});
|
|
39
40
|
};
|
|
40
|
-
WithTime = (date, locale = "tr") => {
|
|
41
|
+
WithTime = (date, locale = "tr", UTC = false) => {
|
|
41
42
|
return date.toLocaleString(this.GetLocaleFromLanguage(locale), {
|
|
42
43
|
day: "numeric",
|
|
43
44
|
month: "long",
|
|
44
45
|
year: "numeric",
|
|
45
46
|
hour: "2-digit",
|
|
46
47
|
minute: "2-digit",
|
|
48
|
+
...(UTC ? { timeZone: "UTC" } : {}),
|
|
47
49
|
});
|
|
48
50
|
};
|
|
49
51
|
GetLocaleFromLanguage = (lang) => {
|