@pushwoosh/dumb-components 1.1.133 → 1.1.135
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/AccessForbidden/AccessForbidden.js +10 -2
- package/AccessForbidden/polyglot/index.d.ts +2 -0
- package/AccessForbidden/polyglot/index.js +10 -0
- package/AccessForbidden/polyglot/messages_en.d.ts +3 -0
- package/AccessForbidden/polyglot/messages_en.js +4 -0
- package/AccessForbidden/polyglot/messages_ru.d.ts +3 -0
- package/AccessForbidden/polyglot/messages_ru.js +4 -0
- package/AccessForbidden/polyglot/types.d.ts +5 -0
- package/AccessForbidden/polyglot/types.js +1 -0
- package/Calendar/CalendarDropdown/CalendarDropdown.js +15 -3
- package/Calendar/CalendarSuperForm/components/CalendarTimeAndTimezoneSection/CalendarTimeAndTimezoneSection.js +14 -4
- package/Calendar/polyglot/index.d.ts +2 -0
- package/Calendar/polyglot/index.js +10 -0
- package/Calendar/polyglot/messages_en.d.ts +3 -0
- package/Calendar/polyglot/messages_en.js +11 -0
- package/Calendar/polyglot/messages_ru.d.ts +3 -0
- package/Calendar/polyglot/messages_ru.js +11 -0
- package/Calendar/polyglot/types.d.ts +14 -0
- package/Calendar/polyglot/types.js +1 -0
- package/CrashScreen/CrashScreen.js +6 -1
- package/CrashScreen/polyglot/index.d.ts +2 -0
- package/CrashScreen/polyglot/index.js +10 -0
- package/CrashScreen/polyglot/messages_en.d.ts +3 -0
- package/CrashScreen/polyglot/messages_en.js +4 -0
- package/CrashScreen/polyglot/messages_ru.d.ts +3 -0
- package/CrashScreen/polyglot/messages_ru.js +4 -0
- package/CrashScreen/polyglot/types.d.ts +5 -0
- package/CrashScreen/polyglot/types.js +1 -0
- package/DateTimePicker/components/DatePickerField/DatePickerField.js +4 -1
- package/DateTimePicker/components/DateTimePickerField/DateTimePickerField.js +4 -1
- package/DateTimePicker/components/Month/Month.js +16 -1
- package/DateTimePicker/polyglot/index.d.ts +2 -0
- package/DateTimePicker/polyglot/index.js +9 -0
- package/DateTimePicker/polyglot/messages_en.d.ts +3 -0
- package/DateTimePicker/polyglot/messages_en.js +11 -0
- package/DateTimePicker/polyglot/messages_ru.d.ts +3 -0
- package/DateTimePicker/polyglot/messages_ru.js +11 -0
- package/DateTimePicker/polyglot/types.d.ts +12 -0
- package/DateTimePicker/polyglot/types.js +1 -0
- package/Drawer/components/DrawerDocs/DrawerDocs.js +9 -3
- package/Drawer/polyglot/index.d.ts +2 -0
- package/Drawer/polyglot/index.js +10 -0
- package/Drawer/polyglot/messages_en.d.ts +3 -0
- package/Drawer/polyglot/messages_en.js +4 -0
- package/Drawer/polyglot/messages_ru.d.ts +3 -0
- package/Drawer/polyglot/messages_ru.js +4 -0
- package/Drawer/polyglot/types.d.ts +5 -0
- package/Drawer/polyglot/types.js +1 -0
- package/EditableField/EditableField.js +7 -2
- package/EditableField/polyglot/index.d.ts +2 -0
- package/EditableField/polyglot/index.js +9 -0
- package/EditableField/polyglot/messages_en.d.ts +3 -0
- package/EditableField/polyglot/messages_en.js +4 -0
- package/EditableField/polyglot/messages_ru.d.ts +3 -0
- package/EditableField/polyglot/messages_ru.js +4 -0
- package/EditableField/polyglot/types.d.ts +5 -0
- package/EditableField/polyglot/types.js +1 -0
- package/EmailTemplatePreview/components/NoEmailTemplatePreview/NoEmailTemplatePreview.js +11 -3
- package/EmailTemplatePreview/polyglot/index.d.ts +2 -0
- package/EmailTemplatePreview/polyglot/index.js +10 -0
- package/EmailTemplatePreview/polyglot/messages_en.d.ts +3 -0
- package/EmailTemplatePreview/polyglot/messages_en.js +5 -0
- package/EmailTemplatePreview/polyglot/messages_ru.d.ts +3 -0
- package/EmailTemplatePreview/polyglot/messages_ru.js +5 -0
- package/EmailTemplatePreview/polyglot/types.d.ts +6 -0
- package/EmailTemplatePreview/polyglot/types.js +1 -0
- package/FrequencyCapping/FrequencyCappingEdit.js +7 -2
- package/FrequencyCapping/FrequencyCappingInApps.js +7 -2
- package/FrequencyCapping/FrequencyCappingReadonly.js +5 -2
- package/FrequencyCapping/components/Description/index.js +3 -1
- package/FrequencyCapping/components/Settings/EditCappingSettings.js +10 -3
- package/FrequencyCapping/components/Settings/EditInAppCappingSettings.js +25 -8
- package/FrequencyCapping/helpers/getCappingChipText.d.ts +2 -1
- package/FrequencyCapping/helpers/getCappingChipText.js +13 -15
- package/FrequencyCapping/helpers/getDescriptionMessages.d.ts +2 -1
- package/FrequencyCapping/helpers/getDescriptionMessages.js +42 -22
- package/FrequencyCapping/helpers/getGlobalCappingLinkText.d.ts +2 -0
- package/FrequencyCapping/helpers/getGlobalCappingLinkText.js +7 -0
- package/FrequencyCapping/helpers/getReadonlyCappingHelpers.d.ts +2 -1
- package/FrequencyCapping/helpers/getReadonlyCappingHelpers.js +27 -15
- package/FrequencyCapping/polyglot/index.d.ts +4 -0
- package/FrequencyCapping/polyglot/index.js +10 -0
- package/FrequencyCapping/polyglot/messages_en.d.ts +3 -0
- package/FrequencyCapping/polyglot/messages_en.js +33 -0
- package/FrequencyCapping/polyglot/messages_ru.d.ts +3 -0
- package/FrequencyCapping/polyglot/messages_ru.js +33 -0
- package/FrequencyCapping/polyglot/types.d.ts +46 -0
- package/FrequencyCapping/polyglot/types.js +1 -0
- package/Modal/components/ModalConfirm/ModalConfirm.js +21 -8
- package/Modal/components/ModalConfirm/types.d.ts +1 -1
- package/Modal/polyglot/index.d.ts +2 -0
- package/Modal/polyglot/index.js +9 -0
- package/Modal/polyglot/messages_en.d.ts +3 -0
- package/Modal/polyglot/messages_en.js +6 -0
- package/Modal/polyglot/messages_ru.d.ts +3 -0
- package/Modal/polyglot/messages_ru.js +6 -0
- package/Modal/polyglot/types.d.ts +7 -0
- package/Modal/polyglot/types.js +1 -0
- package/NotificationInbox/NotificationBell.js +7 -1
- package/NotificationInbox/NotificationInbox.js +19 -5
- package/NotificationInbox/polyglot/index.d.ts +2 -0
- package/NotificationInbox/polyglot/index.js +10 -0
- package/NotificationInbox/polyglot/messages_en.d.ts +3 -0
- package/NotificationInbox/polyglot/messages_en.js +8 -0
- package/NotificationInbox/polyglot/messages_ru.d.ts +3 -0
- package/NotificationInbox/polyglot/messages_ru.js +8 -0
- package/NotificationInbox/polyglot/types.d.ts +11 -0
- package/NotificationInbox/polyglot/types.js +1 -0
- package/PushPreview/components/MissedContentPreview/MissedContentPreview.js +7 -2
- package/PushPreview/polyglot/index.d.ts +2 -0
- package/PushPreview/polyglot/index.js +9 -0
- package/PushPreview/polyglot/messages_en.d.ts +3 -0
- package/PushPreview/polyglot/messages_en.js +4 -0
- package/PushPreview/polyglot/messages_ru.d.ts +3 -0
- package/PushPreview/polyglot/messages_ru.js +4 -0
- package/PushPreview/polyglot/types.d.ts +5 -0
- package/PushPreview/polyglot/types.js +1 -0
- package/SendRate/SendRateEdit.js +7 -2
- package/SendRate/SendRateReadonly.js +5 -2
- package/SendRate/components/Condition/index.js +8 -1
- package/SendRate/components/Description/index.js +20 -6
- package/SendRate/components/Settings/index.js +7 -2
- package/SendRate/helpers/getGlobalSendRateLinkText.d.ts +2 -0
- package/SendRate/helpers/getGlobalSendRateLinkText.js +7 -0
- package/SendRate/helpers/getReadonlySendRateHelpers.d.ts +2 -1
- package/SendRate/helpers/getReadonlySendRateHelpers.js +20 -11
- package/SendRate/polyglot/index.d.ts +4 -0
- package/SendRate/polyglot/index.js +10 -0
- package/SendRate/polyglot/messages_en.d.ts +3 -0
- package/SendRate/polyglot/messages_en.js +20 -0
- package/SendRate/polyglot/messages_ru.d.ts +3 -0
- package/SendRate/polyglot/messages_ru.js +20 -0
- package/SendRate/polyglot/types.d.ts +23 -0
- package/SendRate/polyglot/types.js +1 -0
- package/package.json +1 -1
- package/polyglot/index.d.ts +1 -1
- package/polyglot/index.js +1 -1
- package/polyglot/react.d.ts +12 -2
- package/polyglot/react.js +80 -45
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import accessForbiddenImage from './assets/AccessForbidden.svg?url';
|
|
3
|
+
import { Lang, useLang } from './polyglot';
|
|
3
4
|
import { RootBox, ImageBox, TitleBox, DescriptionBox } from './styles';
|
|
4
5
|
export function AccessForbidden() {
|
|
6
|
+
const lang = useLang();
|
|
5
7
|
return React.createElement(RootBox, null, React.createElement(ImageBox, {
|
|
6
|
-
alt:
|
|
8
|
+
alt: lang({
|
|
9
|
+
message: 'DUMB.ACCESS_FORBIDDEN.TITLE'
|
|
10
|
+
}),
|
|
7
11
|
src: accessForbiddenImage
|
|
8
|
-
}), React.createElement(TitleBox, null,
|
|
12
|
+
}), React.createElement(TitleBox, null, React.createElement(Lang, {
|
|
13
|
+
message: "DUMB.ACCESS_FORBIDDEN.TITLE"
|
|
14
|
+
})), React.createElement(DescriptionBox, null, React.createElement(Lang, {
|
|
15
|
+
message: "DUMB.ACCESS_FORBIDDEN.DESCRIPTION"
|
|
16
|
+
})));
|
|
9
17
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -8,6 +8,7 @@ import { Button } from '../../Button';
|
|
|
8
8
|
import { Chip } from '../../Chip';
|
|
9
9
|
import { Popover } from '../../Popover';
|
|
10
10
|
import { CalendarSuperForm } from '../CalendarSuperForm';
|
|
11
|
+
import { Lang, useLang } from '../polyglot';
|
|
11
12
|
export const CalendarDropdown = props => {
|
|
12
13
|
const {
|
|
13
14
|
mode,
|
|
@@ -24,6 +25,7 @@ export const CalendarDropdown = props => {
|
|
|
24
25
|
const popoverRef = useRef(null);
|
|
25
26
|
const [isShaking, setIsShaking] = useState(false);
|
|
26
27
|
const [isOpen, setIsOpen] = useState(false);
|
|
28
|
+
const lang = useLang();
|
|
27
29
|
const [value, setValue] = useState(props.value ?? (isRangePicker ? [] : undefined));
|
|
28
30
|
const initialTimezone = calendarProps.timezone || 'UTC';
|
|
29
31
|
const [timezone, setTimezone] = useState(initialTimezone);
|
|
@@ -51,7 +53,11 @@ export const CalendarDropdown = props => {
|
|
|
51
53
|
const noValue = isRangePicker ? ((value === null || value === void 0 ? void 0 : value.length) ?? 0) === 0 : !value;
|
|
52
54
|
let buttonText;
|
|
53
55
|
if (noValue) {
|
|
54
|
-
buttonText = isRangePicker ?
|
|
56
|
+
buttonText = isRangePicker ? lang({
|
|
57
|
+
message: 'DUMB.CALENDAR.SELECT_PERIOD'
|
|
58
|
+
}) : lang({
|
|
59
|
+
message: 'DUMB.CALENDAR.SELECT_DATE'
|
|
60
|
+
});
|
|
55
61
|
} else {
|
|
56
62
|
buttonText = stringifyValue(value, withTime, timezone);
|
|
57
63
|
}
|
|
@@ -136,7 +142,11 @@ export const CalendarDropdown = props => {
|
|
|
136
142
|
setTimezone(initialTimezone);
|
|
137
143
|
}
|
|
138
144
|
}
|
|
139
|
-
}, noValue ?
|
|
145
|
+
}, noValue ? React.createElement(Lang, {
|
|
146
|
+
message: "DUMB.CALENDAR.CANCEL"
|
|
147
|
+
}) : React.createElement(Lang, {
|
|
148
|
+
message: "DUMB.CALENDAR.RESET"
|
|
149
|
+
})), React.createElement(Button, {
|
|
140
150
|
color: "primary",
|
|
141
151
|
size: "compact",
|
|
142
152
|
onClick: () => {
|
|
@@ -155,5 +165,7 @@ export const CalendarDropdown = props => {
|
|
|
155
165
|
closePopover();
|
|
156
166
|
}
|
|
157
167
|
}
|
|
158
|
-
},
|
|
168
|
+
}, React.createElement(Lang, {
|
|
169
|
+
message: "DUMB.CALENDAR.APPLY"
|
|
170
|
+
})))))));
|
|
159
171
|
};
|
|
@@ -6,6 +6,7 @@ import { H5, Text } from '@pushwoosh/kit-typography';
|
|
|
6
6
|
import { Button } from '../../../../Button';
|
|
7
7
|
import { extendPeriodStruct, formatTwoDigitNumber } from '../../../helpers';
|
|
8
8
|
import { formatTimezoneShort } from '../../../helpers-tz';
|
|
9
|
+
import { Lang } from '../../../polyglot';
|
|
9
10
|
import { CalendarTimeInput } from '../CalendarTimeInput';
|
|
10
11
|
import { CalendarTimezoneSelect } from '../CalendarTimezoneSelect';
|
|
11
12
|
export const CalendarTimeAndTimezoneSection = ({
|
|
@@ -70,16 +71,22 @@ export const CalendarTimeAndTimezoneSection = ({
|
|
|
70
71
|
size: "compact",
|
|
71
72
|
view: "ghost",
|
|
72
73
|
onClick: () => setExpanded(true)
|
|
73
|
-
},
|
|
74
|
+
}, React.createElement(Lang, {
|
|
75
|
+
message: "DUMB.CALENDAR.EXPAND_TIME"
|
|
76
|
+
}))) : React.createElement(React.Fragment, null, isRangePicker && React.createElement(Columns, {
|
|
74
77
|
"$sizes": "1fr max-content",
|
|
75
78
|
"$gap": 8,
|
|
76
79
|
"$alignItems": "center"
|
|
77
|
-
}, React.createElement(H5, null,
|
|
80
|
+
}, React.createElement(H5, null, React.createElement(Lang, {
|
|
81
|
+
message: "DUMB.CALENDAR.TIME_RANGE"
|
|
82
|
+
})), React.createElement(Button, {
|
|
78
83
|
color: "secondary",
|
|
79
84
|
size: "compact",
|
|
80
85
|
view: "ghost",
|
|
81
86
|
onClick: () => setExpanded(false)
|
|
82
|
-
},
|
|
87
|
+
}, React.createElement(Lang, {
|
|
88
|
+
message: "DUMB.CALENDAR.COLLAPSE_TIME"
|
|
89
|
+
}))), !isRangePicker ? React.createElement(Horizontal, {
|
|
83
90
|
"$alignItems": "center",
|
|
84
91
|
"$gap": 8,
|
|
85
92
|
"$justifyContent": "start"
|
|
@@ -131,5 +138,8 @@ export const CalendarTimeAndTimezoneSection = ({
|
|
|
131
138
|
}, React.createElement(Text, {
|
|
132
139
|
"$variant": "footnote",
|
|
133
140
|
"$color": Color.LOCKED
|
|
134
|
-
},
|
|
141
|
+
}, React.createElement(Lang, {
|
|
142
|
+
message: "DUMB.CALENDAR.SELECT_FIRST_HINT",
|
|
143
|
+
isRange: Boolean(isRangePicker)
|
|
144
|
+
})))));
|
|
135
145
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export const messages = {
|
|
2
|
+
'DUMB.CALENDAR.SELECT_PERIOD': 'Select period',
|
|
3
|
+
'DUMB.CALENDAR.SELECT_DATE': 'Select date',
|
|
4
|
+
'DUMB.CALENDAR.CANCEL': 'Cancel',
|
|
5
|
+
'DUMB.CALENDAR.RESET': 'Reset',
|
|
6
|
+
'DUMB.CALENDAR.APPLY': 'Apply',
|
|
7
|
+
'DUMB.CALENDAR.EXPAND_TIME': 'Expand time',
|
|
8
|
+
'DUMB.CALENDAR.COLLAPSE_TIME': 'Collapse time',
|
|
9
|
+
'DUMB.CALENDAR.TIME_RANGE': 'Time range:',
|
|
10
|
+
'DUMB.CALENDAR.SELECT_FIRST_HINT': 'Please select {% if isRange == true %}date range{% else %}date{% endif %} first to set time'
|
|
11
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export const messages = {
|
|
2
|
+
'DUMB.CALENDAR.SELECT_PERIOD': 'Выберите период',
|
|
3
|
+
'DUMB.CALENDAR.SELECT_DATE': 'Выберите дату',
|
|
4
|
+
'DUMB.CALENDAR.CANCEL': 'Отмена',
|
|
5
|
+
'DUMB.CALENDAR.RESET': 'Сбросить',
|
|
6
|
+
'DUMB.CALENDAR.APPLY': 'Применить',
|
|
7
|
+
'DUMB.CALENDAR.EXPAND_TIME': 'Развернуть время',
|
|
8
|
+
'DUMB.CALENDAR.COLLAPSE_TIME': 'Свернуть время',
|
|
9
|
+
'DUMB.CALENDAR.TIME_RANGE': 'Диапазон времени:',
|
|
10
|
+
'DUMB.CALENDAR.SELECT_FIRST_HINT': 'Сначала выберите {% if isRange == true %}диапазон дат{% else %}дату{% endif %}, чтобы задать время'
|
|
11
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { NoParams } from '../../polyglot';
|
|
2
|
+
export type CalendarMessages = {
|
|
3
|
+
'DUMB.CALENDAR.SELECT_PERIOD': NoParams;
|
|
4
|
+
'DUMB.CALENDAR.SELECT_DATE': NoParams;
|
|
5
|
+
'DUMB.CALENDAR.CANCEL': NoParams;
|
|
6
|
+
'DUMB.CALENDAR.RESET': NoParams;
|
|
7
|
+
'DUMB.CALENDAR.APPLY': NoParams;
|
|
8
|
+
'DUMB.CALENDAR.EXPAND_TIME': NoParams;
|
|
9
|
+
'DUMB.CALENDAR.COLLAPSE_TIME': NoParams;
|
|
10
|
+
'DUMB.CALENDAR.TIME_RANGE': NoParams;
|
|
11
|
+
'DUMB.CALENDAR.SELECT_FIRST_HINT': {
|
|
12
|
+
isRange: boolean;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Color } from '@pushwoosh/kit-constants';
|
|
3
3
|
import { WarningRoundIcon } from '@pushwoosh/kit-icons';
|
|
4
|
+
import { Lang } from './polyglot';
|
|
4
5
|
import { RootBox, IconBox, TitleBox, DescriptionBox } from './styles';
|
|
5
6
|
export function CrashScreen() {
|
|
6
7
|
return React.createElement(RootBox, null, React.createElement(IconBox, null, React.createElement(WarningRoundIcon, {
|
|
7
8
|
size: "medium",
|
|
8
9
|
view: "filled",
|
|
9
10
|
color: Color.WARNING
|
|
10
|
-
})), React.createElement(TitleBox, null,
|
|
11
|
+
})), React.createElement(TitleBox, null, React.createElement(Lang, {
|
|
12
|
+
message: "DUMB.CRASH_SCREEN.TITLE"
|
|
13
|
+
})), React.createElement(DescriptionBox, null, React.createElement(Lang, {
|
|
14
|
+
message: "DUMB.CRASH_SCREEN.DESCRIPTION"
|
|
15
|
+
})));
|
|
11
16
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -2,6 +2,7 @@ import { useFloating, offset, autoPlacement } from '@floating-ui/react-dom';
|
|
|
2
2
|
import React, { useState, useEffect } from 'react';
|
|
3
3
|
import { CalendarIcon } from '@pushwoosh/kit-icons';
|
|
4
4
|
import { format, monthName, get } from '../../helpers';
|
|
5
|
+
import { Lang } from '../../polyglot';
|
|
5
6
|
import { InputFrame } from '../../styles';
|
|
6
7
|
import { DatePicker } from '../DatePicker';
|
|
7
8
|
export function DatePickerField(props) {
|
|
@@ -56,7 +57,9 @@ export function DatePickerField(props) {
|
|
|
56
57
|
}, React.createElement(CalendarIcon, {
|
|
57
58
|
size: "medium",
|
|
58
59
|
view: "lined"
|
|
59
|
-
}), value ? React.createElement(React.Fragment, null, format(value, 'day '), monthName(get(value, 'month'), 'long'), format(value, ' year')) :
|
|
60
|
+
}), value ? React.createElement(React.Fragment, null, format(value, 'day '), monthName(get(value, 'month'), 'long'), format(value, ' year')) : React.createElement(Lang, {
|
|
61
|
+
message: "DUMB.DATE_TIME_PICKER.SELECT_DATE"
|
|
62
|
+
})), showPicker && React.createElement("div", {
|
|
60
63
|
ref: refs.setFloating,
|
|
61
64
|
style: {
|
|
62
65
|
...floatingStyles,
|
|
@@ -2,6 +2,7 @@ import { useFloating, offset, autoPlacement } from '@floating-ui/react-dom';
|
|
|
2
2
|
import React, { useState, useEffect } from 'react';
|
|
3
3
|
import { CalendarIcon } from '@pushwoosh/kit-icons';
|
|
4
4
|
import { useUTCDate } from './helpers';
|
|
5
|
+
import { Lang } from '../../polyglot';
|
|
5
6
|
import { InputFrame } from '../../styles';
|
|
6
7
|
import { DateTimePicker } from '../DateTimePicker';
|
|
7
8
|
export function DateTimePickerField(props) {
|
|
@@ -63,7 +64,9 @@ export function DateTimePickerField(props) {
|
|
|
63
64
|
}, React.createElement(CalendarIcon, {
|
|
64
65
|
size: "medium",
|
|
65
66
|
view: "lined"
|
|
66
|
-
}), value ? `${day} ${month} ${year} ${hours}:${minutes}` :
|
|
67
|
+
}), value ? `${day} ${month} ${year} ${hours}:${minutes}` : React.createElement(Lang, {
|
|
68
|
+
message: "DUMB.DATE_TIME_PICKER.SELECT_DATE_TIME"
|
|
69
|
+
})), showPicker && React.createElement("div", {
|
|
67
70
|
ref: refs.setFloating,
|
|
68
71
|
style: {
|
|
69
72
|
...floatingStyles,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { useMemo } from 'react';
|
|
2
2
|
import { Columns } from '@pushwoosh/kit-helpers';
|
|
3
3
|
import { format, firstDayOfWeek, parseStringToDate, differenceInDays, isSamePeriod, isInRange } from '../../helpers';
|
|
4
|
+
import { Lang } from '../../polyglot';
|
|
4
5
|
import { CellBox, DayHeader } from '../../styles';
|
|
5
6
|
export function Month(props) {
|
|
6
7
|
const {
|
|
@@ -26,7 +27,21 @@ export function Month(props) {
|
|
|
26
27
|
return React.createElement(Columns, {
|
|
27
28
|
"$sizes": 7,
|
|
28
29
|
"$gap": 4
|
|
29
|
-
}, React.createElement(DayHeader, null,
|
|
30
|
+
}, React.createElement(DayHeader, null, React.createElement(Lang, {
|
|
31
|
+
message: "DUMB.DATE_TIME_PICKER.WEEKDAY_SUN"
|
|
32
|
+
})), React.createElement(DayHeader, null, React.createElement(Lang, {
|
|
33
|
+
message: "DUMB.DATE_TIME_PICKER.WEEKDAY_MON"
|
|
34
|
+
})), React.createElement(DayHeader, null, React.createElement(Lang, {
|
|
35
|
+
message: "DUMB.DATE_TIME_PICKER.WEEKDAY_TUE"
|
|
36
|
+
})), React.createElement(DayHeader, null, React.createElement(Lang, {
|
|
37
|
+
message: "DUMB.DATE_TIME_PICKER.WEEKDAY_WED"
|
|
38
|
+
})), React.createElement(DayHeader, null, React.createElement(Lang, {
|
|
39
|
+
message: "DUMB.DATE_TIME_PICKER.WEEKDAY_THU"
|
|
40
|
+
})), React.createElement(DayHeader, null, React.createElement(Lang, {
|
|
41
|
+
message: "DUMB.DATE_TIME_PICKER.WEEKDAY_FRI"
|
|
42
|
+
})), React.createElement(DayHeader, null, React.createElement(Lang, {
|
|
43
|
+
message: "DUMB.DATE_TIME_PICKER.WEEKDAY_SAT"
|
|
44
|
+
})), Array.from({
|
|
30
45
|
length: days
|
|
31
46
|
}).map((_, i) => {
|
|
32
47
|
const curDay = new Date(Date.UTC(firstDayDate.getUTCFullYear(), firstDayDate.getUTCMonth(), firstDayDate.getUTCDate() + i));
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export const messages = {
|
|
2
|
+
'DUMB.DATE_TIME_PICKER.WEEKDAY_SUN': 'Sun',
|
|
3
|
+
'DUMB.DATE_TIME_PICKER.WEEKDAY_MON': 'Mon',
|
|
4
|
+
'DUMB.DATE_TIME_PICKER.WEEKDAY_TUE': 'Tue',
|
|
5
|
+
'DUMB.DATE_TIME_PICKER.WEEKDAY_WED': 'Wed',
|
|
6
|
+
'DUMB.DATE_TIME_PICKER.WEEKDAY_THU': 'Thu',
|
|
7
|
+
'DUMB.DATE_TIME_PICKER.WEEKDAY_FRI': 'Fri',
|
|
8
|
+
'DUMB.DATE_TIME_PICKER.WEEKDAY_SAT': 'Sat',
|
|
9
|
+
'DUMB.DATE_TIME_PICKER.SELECT_DATE': 'Select date',
|
|
10
|
+
'DUMB.DATE_TIME_PICKER.SELECT_DATE_TIME': 'Select date and time'
|
|
11
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export const messages = {
|
|
2
|
+
'DUMB.DATE_TIME_PICKER.WEEKDAY_SUN': 'Вс',
|
|
3
|
+
'DUMB.DATE_TIME_PICKER.WEEKDAY_MON': 'Пн',
|
|
4
|
+
'DUMB.DATE_TIME_PICKER.WEEKDAY_TUE': 'Вт',
|
|
5
|
+
'DUMB.DATE_TIME_PICKER.WEEKDAY_WED': 'Ср',
|
|
6
|
+
'DUMB.DATE_TIME_PICKER.WEEKDAY_THU': 'Чт',
|
|
7
|
+
'DUMB.DATE_TIME_PICKER.WEEKDAY_FRI': 'Пт',
|
|
8
|
+
'DUMB.DATE_TIME_PICKER.WEEKDAY_SAT': 'Сб',
|
|
9
|
+
'DUMB.DATE_TIME_PICKER.SELECT_DATE': 'Выберите дату',
|
|
10
|
+
'DUMB.DATE_TIME_PICKER.SELECT_DATE_TIME': 'Выберите дату и время'
|
|
11
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { NoParams } from '../../polyglot';
|
|
2
|
+
export type DateTimePickerMessages = {
|
|
3
|
+
'DUMB.DATE_TIME_PICKER.WEEKDAY_SUN': NoParams;
|
|
4
|
+
'DUMB.DATE_TIME_PICKER.WEEKDAY_MON': NoParams;
|
|
5
|
+
'DUMB.DATE_TIME_PICKER.WEEKDAY_TUE': NoParams;
|
|
6
|
+
'DUMB.DATE_TIME_PICKER.WEEKDAY_WED': NoParams;
|
|
7
|
+
'DUMB.DATE_TIME_PICKER.WEEKDAY_THU': NoParams;
|
|
8
|
+
'DUMB.DATE_TIME_PICKER.WEEKDAY_FRI': NoParams;
|
|
9
|
+
'DUMB.DATE_TIME_PICKER.WEEKDAY_SAT': NoParams;
|
|
10
|
+
'DUMB.DATE_TIME_PICKER.SELECT_DATE': NoParams;
|
|
11
|
+
'DUMB.DATE_TIME_PICKER.SELECT_DATE_TIME': NoParams;
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import React, { useEffect, useRef, useState } from 'react';
|
|
2
|
+
import { DrawerBodyIframe, IframeElement, LoadingBox } from './styles';
|
|
2
3
|
import { Spinner } from '../../../Spinner';
|
|
4
|
+
import { Lang, useLang } from '../../polyglot';
|
|
3
5
|
import { Drawer } from '../Drawer';
|
|
4
|
-
import { DrawerBodyIframe, IframeElement, LoadingBox } from './styles';
|
|
5
6
|
export function DrawerDocs(props) {
|
|
6
7
|
const {
|
|
7
8
|
isOpen,
|
|
8
9
|
url,
|
|
9
10
|
onClose
|
|
10
11
|
} = props;
|
|
12
|
+
const lang = useLang();
|
|
11
13
|
const [drawerWidth, setDrawerWidth] = useState(0);
|
|
12
14
|
const [iframeLoaded, setIframeLoaded] = useState(false);
|
|
13
15
|
const drawerDocsRef = useRef(null);
|
|
@@ -33,10 +35,14 @@ export function DrawerDocs(props) {
|
|
|
33
35
|
ref: drawerDocsRef
|
|
34
36
|
}, !iframeLoaded && React.createElement(LoadingBox, null, React.createElement(Spinner, {
|
|
35
37
|
size: "medium"
|
|
36
|
-
}), ' ',
|
|
38
|
+
}), ' ', React.createElement(Lang, {
|
|
39
|
+
message: "DUMB.DRAWER.DOCS_LOADING"
|
|
40
|
+
})), React.createElement(IframeElement, {
|
|
37
41
|
src: url,
|
|
38
42
|
ref: iframeRef,
|
|
39
|
-
title:
|
|
43
|
+
title: lang({
|
|
44
|
+
message: 'DUMB.DRAWER.DOCS_TITLE'
|
|
45
|
+
}),
|
|
40
46
|
width: drawerWidth,
|
|
41
47
|
height: "95%",
|
|
42
48
|
"$isLoaded": iframeLoaded,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -5,6 +5,7 @@ import { DropdownIcon, EditIcon } from '@pushwoosh/kit-icons';
|
|
|
5
5
|
import { Button } from '../Button';
|
|
6
6
|
import { useOnClickOutside } from '../hooks';
|
|
7
7
|
import { Popover, PopoverContainer } from '../Popover';
|
|
8
|
+
import { Lang } from './polyglot';
|
|
8
9
|
import { FieldBox, TitleBox, ButtonsGroup } from './styles';
|
|
9
10
|
export function EditableField({
|
|
10
11
|
value,
|
|
@@ -53,11 +54,15 @@ export function EditableField({
|
|
|
53
54
|
size: "compact",
|
|
54
55
|
isLoading: loading,
|
|
55
56
|
onClick: onSubmit
|
|
56
|
-
},
|
|
57
|
+
}, React.createElement(Lang, {
|
|
58
|
+
message: "DUMB.EDITABLE_FIELD.SUBMIT"
|
|
59
|
+
})), React.createElement(Button, {
|
|
57
60
|
view: "shape",
|
|
58
61
|
color: "secondary",
|
|
59
62
|
size: "compact",
|
|
60
63
|
isDisabled: loading,
|
|
61
64
|
onClick: onCancel
|
|
62
|
-
},
|
|
65
|
+
}, React.createElement(Lang, {
|
|
66
|
+
message: "DUMB.EDITABLE_FIELD.CANCEL"
|
|
67
|
+
}))))));
|
|
63
68
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|