@pushwoosh/dumb-components 1.1.135 → 1.1.136
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 +17 -11
- package/Alert/Alert.d.ts +1 -2
- package/Alert/Alert.js +31 -25
- package/ApplicationPreloader/ApplicationPreloader.d.ts +1 -2
- package/ApplicationPreloader/ApplicationPreloader.js +5 -4
- package/Badge/Badge.js +2 -2
- package/Banner/Banner.js +40 -24
- package/Button/Button.js +20 -9
- package/Button/RemoveButton.js +7 -6
- package/Calendar/CalendarDropdown/CalendarDropdown.js +121 -108
- package/Calendar/CalendarMonth/CalendarMonth.js +68 -66
- package/Calendar/CalendarMonthSlider/CalendarMonthSlider.d.ts +2 -2
- package/Calendar/CalendarMonthSlider/CalendarMonthSlider.js +68 -55
- package/Calendar/CalendarSuperForm/CalendarSuperForm.js +75 -70
- package/Calendar/CalendarSuperForm/components/CalendarRangePicker/CalendarRangePicker.d.ts +2 -2
- package/Calendar/CalendarSuperForm/components/CalendarRangePicker/CalendarRangePicker.js +3 -2
- package/Calendar/CalendarSuperForm/components/CalendarTimeAndTimezoneSection/CalendarTimeAndTimezoneSection.js +106 -88
- package/Calendar/CalendarSuperForm/components/CalendarTimeInput.d.ts +1 -2
- package/Calendar/CalendarSuperForm/components/CalendarTimeInput.js +2 -2
- package/Calendar/CalendarSuperForm/components/CalendarTimezoneSelect.js +3 -2
- package/CardMetric/CardChildren.js +9 -6
- package/CardMetric/CardCollapse.js +8 -6
- package/CardMetric/CardMetric.js +52 -33
- package/Checkbox/Checkbox.js +30 -24
- package/Chip/Chip.d.ts +6 -7
- package/Chip/Chip.js +22 -15
- package/CodeEditor/CodeEditor.d.ts +1 -2
- package/CodeEditor/CodeEditor.js +2 -2
- package/CrashScreen/CrashScreen.js +18 -10
- package/DateTimePicker/components/AutosizeInput/AutosizeInput.js +17 -13
- package/DateTimePicker/components/DatePicker/DatePicker.js +35 -32
- package/DateTimePicker/components/DatePickerField/DatePickerField.js +31 -24
- package/DateTimePicker/components/DateTimePicker/DateTimePicker.js +22 -20
- package/DateTimePicker/components/DateTimePickerField/DateTimePickerField.js +29 -24
- package/DateTimePicker/components/DecadeView/DecadeView.js +19 -17
- package/DateTimePicker/components/Input/Input.js +2 -2
- package/DateTimePicker/components/Month/Month.js +51 -35
- package/DateTimePicker/components/MonthView/MonthView.js +21 -17
- package/DateTimePicker/components/NumberPicker/NumberPicker.js +49 -40
- package/DateTimePicker/components/PickerPlate/PickerPlate.js +17 -14
- package/DateTimePicker/components/YearView/YearView.js +22 -18
- package/Drawer/components/Drawer/Drawer.js +18 -13
- package/Drawer/components/Drawer/styles.d.ts +2 -2
- package/Drawer/components/Drawer/styles.js +5 -4
- package/Drawer/components/DrawerDocs/DrawerDocs.js +25 -20
- package/DropdownMenu/components/DropdownMenu/DropdownMenu.js +28 -24
- package/DropdownMenu/components/DropdownMenuButton/DropdownMenuButton.js +8 -6
- package/DropdownMenu/components/DropdownMenuItem/DropdownMenuItem.js +6 -4
- package/DropdownMenu/components/DropdownMenuSection/DropdownMenuSection.js +13 -10
- package/DropdownMenu/components/DropdownMenuSubmenu/DropdownMenuSubmenu.js +40 -31
- package/EditableField/EditableField.js +55 -43
- package/EmailTemplatePreview/EmailTemplatePreview.js +10 -8
- package/EmailTemplatePreview/components/NoEmailTemplatePreview/NoEmailTemplatePreview.js +28 -22
- package/EnhancedInput/EnhancedInput.d.ts +3 -4
- package/EnhancedInput/EnhancedInput.js +14 -10
- package/EnhancedInput/SearchInput.js +3 -3
- package/ExportResult/ExportResult.js +33 -23
- package/ExternalImagePreview/ExternalImagePreview.js +24 -20
- package/FieldBox/FieldBox.js +50 -37
- package/FrequencyCapping/FrequencyCappingEdit.js +41 -33
- package/FrequencyCapping/FrequencyCappingInApps.js +41 -33
- package/FrequencyCapping/FrequencyCappingReadonly.d.ts +1 -2
- package/FrequencyCapping/FrequencyCappingReadonly.js +24 -20
- package/FrequencyCapping/components/Condition/index.d.ts +1 -2
- package/FrequencyCapping/components/Condition/index.js +24 -20
- package/FrequencyCapping/components/Description/index.d.ts +2 -2
- package/FrequencyCapping/components/Description/index.js +7 -5
- package/FrequencyCapping/components/Settings/EditCappingSettings.js +28 -20
- package/FrequencyCapping/components/Settings/EditInAppCappingSettings.js +86 -71
- package/FrequencyCapping/helpers/getReadonlyCappingHelpers.d.ts +1 -2
- package/FrequencyCapping/helpers/getReadonlyCappingHelpers.js +41 -32
- package/GetStartedPage/GetStartedPage.js +44 -25
- package/InputFile/InputFile.js +44 -35
- package/Link/Link.js +2 -2
- package/Modal/components/Modal/Modal.js +17 -12
- package/Modal/components/Modal/styles.js +5 -4
- package/Modal/components/ModalConfirm/ModalConfirm.js +33 -19
- package/Modal/components/ModalConfirm/ModalConfirmProvider.d.ts +2 -2
- package/Modal/components/ModalConfirm/ModalConfirmProvider.js +8 -6
- package/Modal/components/ModalTitle/ModalTitle.js +10 -8
- package/NotificationInbox/NotificationBar.js +19 -11
- package/NotificationInbox/NotificationBell.js +15 -12
- package/NotificationInbox/NotificationInbox.js +159 -118
- package/NumberPicker/NumberPicker.js +53 -44
- package/NumberPicker/components/AutosizeInput/AutosizeInput.js +19 -15
- package/PageHeader/components/AutosizeInput/AutosizeInput.js +30 -22
- package/PageHeader/components/PageHeader/PageHeader.js +44 -27
- package/PageHeader/components/PageHeaderEditable/PageHeaderEditable.js +51 -34
- package/PageHeader/components/PageHeaderError/PageHeaderError.js +17 -10
- package/PageHeader/components/PageHeaderSkeleton/PageHeaderSkeleton.js +20 -16
- package/Pagination/Pagination.js +60 -49
- package/Popover/Popover.js +6 -5
- package/ProgressBar/ProgressBar.js +25 -10
- package/PushPreview/PushPreview.js +30 -22
- package/PushPreview/components/MissedContentPreview/MissedContentPreview.js +22 -15
- package/PushPreview/components/SilentPushPreview/SilentPushPreview.js +20 -13
- package/Radio/Radio.js +32 -26
- package/RadioCard/RadioCard.js +17 -9
- package/ReCaptcha/ReCaptcha.js +2 -2
- package/RichMessageEditor/EditorEmojiPicker.js +9 -7
- package/RichMessageEditor/RichMessageEditor.js +77 -67
- package/RichMessageEditor/RichMessageViewer.js +19 -13
- package/RichMessageEditor/slate/DynamicContentElement.d.ts +1 -2
- package/RichMessageEditor/slate/DynamicContentElement.js +13 -9
- package/RichMessageEditor/slate/SlateEditor.js +9 -7
- package/RichmediaPreview/RichmediaPreview.js +13 -11
- package/Select/Select.js +10 -8
- package/SendRate/SendRateEdit.d.ts +1 -2
- package/SendRate/SendRateEdit.js +42 -34
- package/SendRate/SendRateReadonly.d.ts +1 -2
- package/SendRate/SendRateReadonly.js +24 -20
- package/SendRate/components/Condition/index.d.ts +1 -2
- package/SendRate/components/Condition/index.js +15 -13
- package/SendRate/components/Description/index.d.ts +2 -2
- package/SendRate/components/Description/index.js +30 -22
- package/SendRate/components/Settings/index.d.ts +1 -2
- package/SendRate/components/Settings/index.js +20 -14
- package/SendRate/helpers/getReadonlySendRateHelpers.d.ts +1 -2
- package/SendRate/helpers/getReadonlySendRateHelpers.js +39 -30
- package/Skeleton/TextSkeleton.js +5 -4
- package/SortButton/SortButton.js +11 -7
- package/Spinner/Spinner.js +7 -4
- package/StatisticCard/StatisticCard.js +44 -29
- package/Switch/Switch.js +16 -13
- package/Tabs/components/Tab/Tab.d.ts +3 -4
- package/Tabs/components/Tab/Tab.js +6 -4
- package/Tabs/components/TabBar/TabBar.d.ts +3 -4
- package/Tabs/components/TabBar/TabBar.js +12 -4
- package/Tabs/components/TabBarScrollableFrame/TabBarScrollableFrame.d.ts +1 -2
- package/Tabs/components/TabBarScrollableFrame/TabBarScrollableFrame.js +27 -21
- package/Tabs/components/TabBase/TabBase.d.ts +3 -4
- package/Tabs/components/TabBase/TabBase.js +11 -6
- package/Tabs/components/TabPanel/TabPanel.js +4 -2
- package/Tabs/components/Tabs/Tabs.js +8 -4
- package/Toast/Toast.js +31 -18
- package/Toast/ToastProvider.d.ts +2 -3
- package/Toast/ToastProvider.js +10 -8
- package/Tooltip/Tooltip.js +2 -2
- package/Tooltip/TooltipTrigger.js +13 -11
- package/package.json +2 -2
- package/polyglot/__tests__/render.test.js +46 -16
- package/polyglot/liquid/render.d.ts +2 -2
- package/polyglot/liquid/render.js +7 -6
- package/polyglot/react.js +7 -5
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useRef, useState } from 'react';
|
|
2
3
|
import { EditIcon } from '@pushwoosh/kit-icons';
|
|
3
4
|
import { DEFAULT_EMPTY_VALUE, WIDTH_EMPTY_VALUE } from './constants';
|
|
4
5
|
import { RootBox, InputBox, InputStyled, PromptBox } from './styles';
|
|
@@ -56,25 +57,32 @@ export function AutosizeInput(props) {
|
|
|
56
57
|
return onComplete === null || onComplete === void 0 ? void 0 : onComplete(inputRef === null || inputRef === void 0 || (_inputRef$current3 = inputRef.current) === null || _inputRef$current3 === void 0 ? void 0 : _inputRef$current3.value);
|
|
57
58
|
}, 100);
|
|
58
59
|
};
|
|
59
|
-
return
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
60
|
+
return _jsxs(RootBox, {
|
|
61
|
+
children: [_jsxs(InputBox, {
|
|
62
|
+
children: [_jsx(InputStyled, {
|
|
63
|
+
ref: inputRef,
|
|
64
|
+
width: width,
|
|
65
|
+
value: value,
|
|
66
|
+
placeholder: placeholder,
|
|
67
|
+
onKeyDown: onKeyDown,
|
|
68
|
+
onChange: onChangeHandler,
|
|
69
|
+
onBlur: onBlur
|
|
70
|
+
}), _jsx("span", {
|
|
71
|
+
ref: hiddenValueRef,
|
|
72
|
+
children: value
|
|
73
|
+
}), _jsx("span", {
|
|
74
|
+
ref: hiddenPlaceholderRef,
|
|
75
|
+
children: placeholder
|
|
76
|
+
})]
|
|
77
|
+
}), _jsx(PromptBox, {
|
|
78
|
+
onClick: () => {
|
|
79
|
+
var _inputRef$current4;
|
|
80
|
+
return (_inputRef$current4 = inputRef.current) === null || _inputRef$current4 === void 0 ? void 0 : _inputRef$current4.focus();
|
|
81
|
+
},
|
|
82
|
+
children: _jsx(EditIcon, {
|
|
83
|
+
size: "small",
|
|
84
|
+
view: "filled"
|
|
85
|
+
})
|
|
86
|
+
})]
|
|
87
|
+
});
|
|
80
88
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Columns } from '@pushwoosh/kit-helpers';
|
|
3
3
|
import { ArrowRoundIcon } from '@pushwoosh/kit-icons';
|
|
4
4
|
import { H1 } from '@pushwoosh/kit-typography';
|
|
@@ -22,30 +22,47 @@ export function PageHeader(props) {
|
|
|
22
22
|
} = props;
|
|
23
23
|
const hasActions = Boolean(onSubmit || onCancel);
|
|
24
24
|
const hasActionsBox = hasActions || Boolean(moreActions);
|
|
25
|
-
return
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
25
|
+
return _jsxs(RootBox, {
|
|
26
|
+
children: [_jsxs(Columns, {
|
|
27
|
+
"$sizes": "minmax(0, 1fr) max-content",
|
|
28
|
+
"$gap": 24,
|
|
29
|
+
children: [_jsxs(TitleBox, {
|
|
30
|
+
children: [onBack && _jsx(BackButton, {
|
|
31
|
+
children: _jsx(Button, {
|
|
32
|
+
color: "primary",
|
|
33
|
+
view: "ghost",
|
|
34
|
+
onClick: onBack,
|
|
35
|
+
children: _jsx(ArrowRoundIcon, {
|
|
36
|
+
direction: "left",
|
|
37
|
+
size: "medium",
|
|
38
|
+
view: "filled"
|
|
39
|
+
})
|
|
40
|
+
})
|
|
41
|
+
}), _jsx(H1, {
|
|
42
|
+
children: title
|
|
43
|
+
})]
|
|
44
|
+
}), hasActionsBox && _jsxs(ActionsBox, {
|
|
45
|
+
children: [!!moreActions && _jsx(MoreActionsBox, {
|
|
46
|
+
hasActions: hasActions,
|
|
47
|
+
children: moreActions
|
|
48
|
+
}), onCancel && _jsx(Button, {
|
|
49
|
+
color: "secondary",
|
|
50
|
+
onClick: onCancel,
|
|
51
|
+
children: cancelText || 'Cancel'
|
|
52
|
+
}), onSubmit && _jsx(Button, {
|
|
53
|
+
color: "primary",
|
|
54
|
+
type: "submit",
|
|
55
|
+
onClick: onSubmit,
|
|
56
|
+
isLoading: !!isLoadingSubmit,
|
|
57
|
+
children: submitText || 'Create'
|
|
58
|
+
})]
|
|
59
|
+
})]
|
|
60
|
+
}), !!error && _jsx(PageHeaderError, {
|
|
61
|
+
error: error,
|
|
62
|
+
resolveErrorText: resolveErrorText,
|
|
63
|
+
onResolveError: onResolveError
|
|
64
|
+
}), !!description && _jsx(DescriptionBox, {
|
|
65
|
+
children: description
|
|
66
|
+
})]
|
|
67
|
+
});
|
|
51
68
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Columns } from '@pushwoosh/kit-helpers';
|
|
3
3
|
import { ArrowRoundIcon } from '@pushwoosh/kit-icons';
|
|
4
4
|
import { Button } from '../../../Button';
|
|
@@ -28,40 +28,57 @@ export function PageHeaderEditable(props) {
|
|
|
28
28
|
onResolveError
|
|
29
29
|
} = props;
|
|
30
30
|
if (isLoading) {
|
|
31
|
-
return
|
|
31
|
+
return _jsx(PageHeaderSkeleton, {});
|
|
32
32
|
}
|
|
33
33
|
const hasActions = Boolean(onSubmit || onCancel);
|
|
34
34
|
const hasActionsBox = hasActions || Boolean(moreActions);
|
|
35
|
-
return
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
35
|
+
return _jsxs(RootBox, {
|
|
36
|
+
children: [_jsxs(Columns, {
|
|
37
|
+
"$sizes": "minmax(0, 1fr) max-content",
|
|
38
|
+
"$gap": 24,
|
|
39
|
+
children: [_jsxs(TitleBox, {
|
|
40
|
+
children: [onBack && _jsx(BackButton, {
|
|
41
|
+
children: _jsx(Button, {
|
|
42
|
+
color: "primary",
|
|
43
|
+
view: "ghost",
|
|
44
|
+
onClick: onBack,
|
|
45
|
+
children: _jsx(ArrowRoundIcon, {
|
|
46
|
+
direction: "left",
|
|
47
|
+
size: "medium",
|
|
48
|
+
view: "filled"
|
|
49
|
+
})
|
|
50
|
+
})
|
|
51
|
+
}), _jsxs(AutosizeInputBox, {
|
|
52
|
+
children: [title, value !== undefined && _jsx(AutosizeInput, {
|
|
53
|
+
placeholder: placeholder,
|
|
54
|
+
maxLength: maxLength,
|
|
55
|
+
value: value,
|
|
56
|
+
onChange: onChange,
|
|
57
|
+
onComplete: onComplete
|
|
58
|
+
})]
|
|
59
|
+
})]
|
|
60
|
+
}), hasActionsBox && _jsxs(ActionsBox, {
|
|
61
|
+
children: [!!moreActions && _jsx(MoreActionsBox, {
|
|
62
|
+
hasActions: hasActions,
|
|
63
|
+
children: moreActions
|
|
64
|
+
}), onCancel && _jsx(Button, {
|
|
65
|
+
color: "secondary",
|
|
66
|
+
onClick: onCancel,
|
|
67
|
+
children: cancelText || 'Cancel'
|
|
68
|
+
}), onSubmit && _jsx(Button, {
|
|
69
|
+
color: "primary",
|
|
70
|
+
type: "submit",
|
|
71
|
+
onClick: () => value ? onSubmit(value) : null,
|
|
72
|
+
isLoading: !!isLoadingSubmit,
|
|
73
|
+
children: submitText || 'Create'
|
|
74
|
+
})]
|
|
75
|
+
})]
|
|
76
|
+
}), !!error && _jsx(PageHeaderError, {
|
|
77
|
+
error: error,
|
|
78
|
+
resolveErrorText: resolveErrorText,
|
|
79
|
+
onResolveError: onResolveError
|
|
80
|
+
}), !!description && _jsx(DescriptionBox, {
|
|
81
|
+
children: description
|
|
82
|
+
})]
|
|
83
|
+
});
|
|
67
84
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { DangerTriangleIcon } from '@pushwoosh/kit-icons';
|
|
3
3
|
import { RootBox, ErrorIconBox, ErrorText, ResolveError } from './styles';
|
|
4
4
|
export function PageHeaderError(props) {
|
|
@@ -7,13 +7,20 @@ export function PageHeaderError(props) {
|
|
|
7
7
|
resolveErrorText,
|
|
8
8
|
onResolveError
|
|
9
9
|
} = props;
|
|
10
|
-
return
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
10
|
+
return _jsxs(RootBox, {
|
|
11
|
+
children: [_jsx(ErrorIconBox, {
|
|
12
|
+
children: _jsx(DangerTriangleIcon, {
|
|
13
|
+
color: "white",
|
|
14
|
+
size: "small",
|
|
15
|
+
view: "filled"
|
|
16
|
+
})
|
|
17
|
+
}), _jsx(ErrorText, {
|
|
18
|
+
children: error
|
|
19
|
+
}), resolveErrorText && onResolveError && _jsx(ResolveError, {
|
|
20
|
+
view: "ghost",
|
|
21
|
+
color: "danger",
|
|
22
|
+
onClick: onResolveError,
|
|
23
|
+
children: resolveErrorText
|
|
24
|
+
})]
|
|
25
|
+
});
|
|
19
26
|
}
|
|
@@ -1,20 +1,24 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Horizontal } from '@pushwoosh/kit-helpers';
|
|
3
3
|
import { RootBox, SkeletonStyled } from './styles';
|
|
4
4
|
export function PageHeaderSkeleton() {
|
|
5
|
-
return
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
5
|
+
return _jsxs(RootBox, {
|
|
6
|
+
children: [_jsxs(Horizontal, {
|
|
7
|
+
"$gap": 16,
|
|
8
|
+
children: [_jsx(SkeletonStyled, {}), _jsx(SkeletonStyled, {
|
|
9
|
+
width: 60
|
|
10
|
+
}), _jsx(SkeletonStyled, {
|
|
11
|
+
width: 60
|
|
12
|
+
})]
|
|
13
|
+
}), _jsxs(Horizontal, {
|
|
14
|
+
"$gap": 16,
|
|
15
|
+
children: [_jsx(SkeletonStyled, {
|
|
16
|
+
width: 68,
|
|
17
|
+
height: 36
|
|
18
|
+
}), _jsx(SkeletonStyled, {
|
|
19
|
+
width: 68,
|
|
20
|
+
height: 36
|
|
21
|
+
})]
|
|
22
|
+
})]
|
|
23
|
+
});
|
|
20
24
|
}
|
package/Pagination/Pagination.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback } from 'react';
|
|
2
3
|
import { ArrowIcon } from '@pushwoosh/kit-icons';
|
|
3
4
|
import { getSafelyNumber } from './helpers';
|
|
4
5
|
import { PaginationBox, PaginationArrow, PaginationDivider, PaginationButton } from './styles';
|
|
@@ -30,55 +31,65 @@ export function Pagination({
|
|
|
30
31
|
console.error(`[Pagination]: prop activePage: ${activePage} is not valid!`);
|
|
31
32
|
return null;
|
|
32
33
|
}
|
|
33
|
-
return
|
|
34
|
+
return _jsxs(PaginationBox, {
|
|
34
35
|
...rest,
|
|
35
|
-
ref: boxRef
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
onClick: handleChangePage
|
|
47
|
-
}, 1), shouldShowShowLeftDivider && React.createElement(PaginationDivider, null, "..."), helperArray.map((_, index) => {
|
|
48
|
-
const currentIndex = safelyActivePageNumber - adjacentPagesCount + index;
|
|
49
|
-
if (currentIndex < 1 || currentIndex > safelyTotalPagesNumber) {
|
|
50
|
-
return null;
|
|
51
|
-
}
|
|
52
|
-
return React.createElement(PaginationButton, {
|
|
53
|
-
key: currentIndex,
|
|
54
|
-
value: currentIndex,
|
|
36
|
+
ref: boxRef,
|
|
37
|
+
children: [_jsx(PaginationArrow, {
|
|
38
|
+
value: safelyActivePageNumber - 1,
|
|
39
|
+
disabled: isLoading || isDisabledLeftArrow,
|
|
40
|
+
onClick: handleChangePage,
|
|
41
|
+
children: _jsx(ArrowIcon, {
|
|
42
|
+
direction: "left",
|
|
43
|
+
size: "medium"
|
|
44
|
+
})
|
|
45
|
+
}), shouldShowShowFirstPage && _jsx(PaginationButton, {
|
|
46
|
+
value: 1,
|
|
55
47
|
disabled: isLoading,
|
|
56
|
-
onClick: handleChangePage
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
48
|
+
onClick: handleChangePage,
|
|
49
|
+
children: 1
|
|
50
|
+
}), shouldShowShowLeftDivider && _jsx(PaginationDivider, {
|
|
51
|
+
children: "..."
|
|
52
|
+
}), helperArray.map((_, index) => {
|
|
53
|
+
const currentIndex = safelyActivePageNumber - adjacentPagesCount + index;
|
|
54
|
+
if (currentIndex < 1 || currentIndex > safelyTotalPagesNumber) {
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
return _jsx(PaginationButton, {
|
|
58
|
+
value: currentIndex,
|
|
59
|
+
disabled: isLoading,
|
|
60
|
+
onClick: handleChangePage,
|
|
61
|
+
children: currentIndex
|
|
62
|
+
}, currentIndex);
|
|
63
|
+
}), _jsx(PaginationButton, {
|
|
64
|
+
"$isActive": true,
|
|
65
|
+
disabled: true,
|
|
66
|
+
children: safelyActivePageNumber
|
|
67
|
+
}), helperArray.map((_, index) => {
|
|
68
|
+
const currentIndex = safelyActivePageNumber + index + 1;
|
|
69
|
+
if (currentIndex > safelyTotalPagesNumber) {
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
return _jsx(PaginationButton, {
|
|
73
|
+
value: currentIndex,
|
|
74
|
+
disabled: isLoading,
|
|
75
|
+
onClick: handleChangePage,
|
|
76
|
+
children: currentIndex
|
|
77
|
+
}, currentIndex);
|
|
78
|
+
}), shouldShowShowRightDivider && _jsx(PaginationDivider, {
|
|
79
|
+
children: "..."
|
|
80
|
+
}), shouldShowShowLastPage && _jsx(PaginationButton, {
|
|
81
|
+
value: safelyTotalPagesNumber,
|
|
69
82
|
disabled: isLoading,
|
|
70
|
-
onClick: handleChangePage
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
size: "medium"
|
|
83
|
-
})));
|
|
83
|
+
onClick: handleChangePage,
|
|
84
|
+
children: safelyTotalPagesNumber
|
|
85
|
+
}), _jsx(PaginationArrow, {
|
|
86
|
+
value: safelyActivePageNumber + 1,
|
|
87
|
+
disabled: isLoading || isDisabledRightArrow,
|
|
88
|
+
onClick: handleChangePage,
|
|
89
|
+
children: _jsx(ArrowIcon, {
|
|
90
|
+
direction: "right",
|
|
91
|
+
size: "medium"
|
|
92
|
+
})
|
|
93
|
+
})]
|
|
94
|
+
});
|
|
84
95
|
}
|
package/Popover/Popover.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { PopoverContainerPortal, PopoverContainerWindow } from './styles';
|
|
3
3
|
export function Popover({
|
|
4
4
|
open,
|
|
@@ -10,7 +10,7 @@ export function Popover({
|
|
|
10
10
|
windowWidth,
|
|
11
11
|
children
|
|
12
12
|
}) {
|
|
13
|
-
return
|
|
13
|
+
return _jsx(PopoverContainerPortal, {
|
|
14
14
|
animation: false,
|
|
15
15
|
delay: 0,
|
|
16
16
|
duration: 0,
|
|
@@ -20,11 +20,12 @@ export function Popover({
|
|
|
20
20
|
zIndex: zIndex,
|
|
21
21
|
visible: open,
|
|
22
22
|
className: "popover-container",
|
|
23
|
-
content:
|
|
23
|
+
content: _jsx(PopoverContainerWindow, {
|
|
24
24
|
"$minWidth": windowWidth,
|
|
25
25
|
"$isLoading": loading,
|
|
26
|
-
ref: internalWindowRef
|
|
27
|
-
|
|
26
|
+
ref: internalWindowRef,
|
|
27
|
+
children: open && children
|
|
28
|
+
}),
|
|
28
29
|
popperOptions: {
|
|
29
30
|
strategy: 'fixed',
|
|
30
31
|
modifiers: [{
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Color } from '@pushwoosh/kit-constants';
|
|
3
3
|
import { Spinner } from '../Spinner';
|
|
4
4
|
import { Container, LoadingHeader, LoadingText, ProgressLine, ProgressBarActive, ProgressBoxContainer, RightSlotContainer, SpinnerContainer, ProgressLineContainer } from './styles';
|
|
@@ -10,13 +10,28 @@ export function ProgressBar({
|
|
|
10
10
|
backgroundColor = Color.BRIGHT_LIGHT,
|
|
11
11
|
showSpinner = true
|
|
12
12
|
}) {
|
|
13
|
-
return
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
13
|
+
return _jsxs(Container, {
|
|
14
|
+
children: [showSpinner && _jsx(SpinnerContainer, {
|
|
15
|
+
"$backgroundColor": backgroundColor,
|
|
16
|
+
children: _jsx(Spinner, {
|
|
17
|
+
color: color,
|
|
18
|
+
size: "medium"
|
|
19
|
+
})
|
|
20
|
+
}), _jsxs(ProgressBoxContainer, {
|
|
21
|
+
children: [_jsxs(LoadingHeader, {
|
|
22
|
+
children: [_jsx(LoadingText, {
|
|
23
|
+
children: `${title} ${percentValue}%`
|
|
24
|
+
}), rightSlot && _jsx(RightSlotContainer, {
|
|
25
|
+
children: rightSlot
|
|
26
|
+
})]
|
|
27
|
+
}), _jsx(ProgressLineContainer, {
|
|
28
|
+
children: _jsx(ProgressLine, {
|
|
29
|
+
children: _jsx(ProgressBarActive, {
|
|
30
|
+
"$width": percentValue,
|
|
31
|
+
"$color": color
|
|
32
|
+
})
|
|
33
|
+
})
|
|
34
|
+
})]
|
|
35
|
+
})]
|
|
36
|
+
});
|
|
22
37
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Vertical } from '@pushwoosh/kit-helpers';
|
|
3
3
|
import { MissedContentPreview } from './components/MissedContentPreview';
|
|
4
4
|
import { SilentPushPreview } from './components/SilentPushPreview';
|
|
@@ -20,35 +20,43 @@ export function PushPreview({
|
|
|
20
20
|
const content = getLocalizedContent((pushPreset === null || pushPreset === void 0 ? void 0 : pushPreset.content) || (pushPreset === null || pushPreset === void 0 ? void 0 : pushPreset.localizedContent), language);
|
|
21
21
|
const icon = (pushPreset === null || pushPreset === void 0 ? void 0 : pushPreset.icon) || appIcon || PREVIEW_ICON_URL;
|
|
22
22
|
if (isLoading) {
|
|
23
|
-
return
|
|
23
|
+
return _jsx(PushBox, {
|
|
24
24
|
view: view,
|
|
25
25
|
"$loading": true
|
|
26
26
|
});
|
|
27
27
|
}
|
|
28
28
|
if (view === 'silent') {
|
|
29
|
-
return
|
|
29
|
+
return _jsx(SilentPushPreview, {});
|
|
30
30
|
}
|
|
31
31
|
if (view === 'missed-content') {
|
|
32
|
-
return
|
|
32
|
+
return _jsx(MissedContentPreview, {});
|
|
33
33
|
}
|
|
34
|
-
return
|
|
34
|
+
return _jsxs(PushBox, {
|
|
35
35
|
view: view,
|
|
36
36
|
"$width": width,
|
|
37
|
-
"$loading": isLoading
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
37
|
+
"$loading": isLoading,
|
|
38
|
+
children: [_jsx(PushIcon, {
|
|
39
|
+
alt: title,
|
|
40
|
+
src: icon
|
|
41
|
+
}), _jsxs(Vertical, {
|
|
42
|
+
children: [_jsx(PushTitle, {
|
|
43
|
+
children: _jsx(RichMessageViewer, {
|
|
44
|
+
value: title,
|
|
45
|
+
flat: true
|
|
46
|
+
})
|
|
47
|
+
}), view === 'extended' && _jsx(PushTitle, {
|
|
48
|
+
children: _jsx(RichMessageViewer, {
|
|
49
|
+
value: subtitle,
|
|
50
|
+
flat: true
|
|
51
|
+
})
|
|
52
|
+
}), _jsxs(PushDescription, {
|
|
53
|
+
view: view,
|
|
54
|
+
locked: !pushPreset || !content,
|
|
55
|
+
children: [content && _jsx(RichMessageViewer, {
|
|
56
|
+
flat: view === 'compact',
|
|
57
|
+
value: content
|
|
58
|
+
}), !content && view === 'empty' && 'Select existing or create a new content…', !content && view !== 'empty' && 'Message is empty…']
|
|
59
|
+
})]
|
|
60
|
+
})]
|
|
61
|
+
});
|
|
54
62
|
}
|
|
@@ -1,22 +1,29 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Color } from '@pushwoosh/kit-constants';
|
|
3
3
|
import { Vertical } from '@pushwoosh/kit-helpers';
|
|
4
4
|
import { CloseIcon } from '@pushwoosh/kit-icons';
|
|
5
5
|
import { Lang } from '../../polyglot';
|
|
6
6
|
import { PushBox, IconContainer, PushTitle, PushDescription } from '../../styles';
|
|
7
7
|
export function MissedContentPreview() {
|
|
8
|
-
return
|
|
9
|
-
view: "compact"
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
8
|
+
return _jsxs(PushBox, {
|
|
9
|
+
view: "compact",
|
|
10
|
+
children: [_jsx(IconContainer, {
|
|
11
|
+
children: _jsx(CloseIcon, {
|
|
12
|
+
size: "small",
|
|
13
|
+
color: Color.CLEAR
|
|
14
|
+
})
|
|
15
|
+
}), _jsxs(Vertical, {
|
|
16
|
+
children: [_jsx(PushTitle, {
|
|
17
|
+
locked: true,
|
|
18
|
+
children: _jsx(Lang, {
|
|
19
|
+
message: "DUMB.PUSH_PREVIEW.CONTENT_MISSED"
|
|
20
|
+
})
|
|
21
|
+
}), _jsx(PushDescription, {
|
|
22
|
+
locked: true,
|
|
23
|
+
children: _jsx(Lang, {
|
|
24
|
+
message: "DUMB.PUSH_PREVIEW.HINT"
|
|
25
|
+
})
|
|
26
|
+
})]
|
|
27
|
+
})]
|
|
28
|
+
});
|
|
22
29
|
}
|