@pushwoosh/dumb-components 1.0.60 → 1.0.61
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/CardMetric/CardMetric.d.ts +1 -1
- package/CardMetric/CardMetric.js +15 -16
- package/CodeEditor/types.d.ts +0 -1
- package/DateTimePicker/components/DatePickerField/DatePickerField.d.ts +1 -1
- package/DateTimePicker/components/DatePickerField/DatePickerField.js +7 -8
- package/DateTimePicker/components/DateTimePickerField/DateTimePickerField.d.ts +1 -1
- package/DateTimePicker/components/DateTimePickerField/DateTimePickerField.js +7 -8
- package/DateTimePicker/components/NumberPicker/NumberPicker.d.ts +1 -1
- package/DateTimePicker/components/NumberPicker/NumberPicker.js +13 -14
- package/Drawer/components/Drawer/Drawer.d.ts +1 -1
- package/Drawer/components/Drawer/Drawer.js +9 -10
- package/EditableField/EditableField.d.ts +1 -1
- package/EditableField/EditableField.js +13 -14
- package/InputFile/InputFile.d.ts +1 -1
- package/InputFile/InputFile.js +17 -18
- package/Link/index.d.ts +1 -0
- package/NumberPicker/NumberPicker.d.ts +1 -1
- package/NumberPicker/NumberPicker.js +13 -14
- package/Pagination/Pagination.d.ts +1 -1
- package/Pagination/Pagination.js +9 -10
- package/Popover/Popover.d.ts +1 -1
- package/Popover/Popover.js +10 -11
- package/Popover/index.d.ts +1 -1
- package/Popover/index.js +1 -1
- package/Popover/types.d.ts +1 -1
- package/ProgressBar/ProgressBar.d.ts +2 -2
- package/ProgressBar/ProgressBar.js +8 -9
- package/ProgressBar/types.d.ts +1 -1
- package/PushPreview/PushPreview.d.ts +1 -1
- package/PushPreview/PushPreview.js +9 -10
- package/RichMessageEditor/RichMessageViewer.d.ts +3 -2
- package/Skeleton/styles.js +4 -2
- package/Switch/Switch.d.ts +2 -2
- package/Switch/Switch.js +7 -8
- package/Switch/types.d.ts +1 -1
- package/Table/components/TablePagination/TablePagination.d.ts +1 -1
- package/Table/components/TablePagination/TablePagination.js +10 -11
- package/Table/index.d.ts +0 -2
- package/Table/index.js +0 -2
- package/Table/styles.d.ts +5 -4
- package/Tooltip/Tooltip.d.ts +1 -1
- package/Tooltip/Tooltip.js +10 -11
- package/Tooltip/maps.d.ts +1 -14
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/package.json +1 -1
- package/Table/components/TableList/TableList.d.ts +0 -3
- package/Table/components/TableList/TableList.js +0 -15
- package/Table/components/TableList/index.d.ts +0 -1
- package/Table/components/TableList/index.js +0 -1
- package/Table/components/TableList/types.d.ts +0 -9
- package/Table/components/TableList/types.js +0 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type ReactElement } from 'react';
|
|
2
2
|
import type { CardMetricProps } from './types';
|
|
3
|
-
export declare function CardMetric(
|
|
3
|
+
export declare function CardMetric({ view, focus, title, tooltip, description, loading, collapse, metric, extraMetric, extraMetricColor, headerExtra, children, ...otherProps }: CardMetricProps): ReactElement;
|
package/CardMetric/CardMetric.js
CHANGED
|
@@ -5,22 +5,21 @@ import { Spinner } from '../Spinner';
|
|
|
5
5
|
import { Tooltip } from '../Tooltip';
|
|
6
6
|
import { CardChildren } from './CardChildren';
|
|
7
7
|
import { CardContainer, CardHeader, CardTitle, CardInfo, CardMetricValue, CardExtraMetric, CardDescription, CardHeaderLeft } from './styles';
|
|
8
|
-
export function CardMetric(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
} = props;
|
|
8
|
+
export function CardMetric({
|
|
9
|
+
view = 'rounded',
|
|
10
|
+
focus = false,
|
|
11
|
+
title = '',
|
|
12
|
+
tooltip = '',
|
|
13
|
+
description = '',
|
|
14
|
+
loading = false,
|
|
15
|
+
collapse = undefined,
|
|
16
|
+
metric = undefined,
|
|
17
|
+
extraMetric = undefined,
|
|
18
|
+
extraMetricColor = Color.MAIN,
|
|
19
|
+
headerExtra = undefined,
|
|
20
|
+
children,
|
|
21
|
+
...otherProps
|
|
22
|
+
}) {
|
|
24
23
|
const [visibleInfo, setVisibleInfo] = useState(false);
|
|
25
24
|
const [isCollapsed, setIsCollapsed] = useState(!!(collapse !== null && collapse !== void 0 && collapse.isCollapsed));
|
|
26
25
|
const onMouseOver = () => setVisibleInfo(true);
|
package/CodeEditor/types.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type ReactElement } from 'react';
|
|
2
2
|
import type { DatePickerFieldProps } from './types';
|
|
3
|
-
export declare function DatePickerField(
|
|
3
|
+
export declare function DatePickerField({ value, error, allowedPlacements, zIndex, onChange, }: DatePickerFieldProps): ReactElement;
|
|
@@ -4,14 +4,13 @@ import { CalendarIcon } from '@pushwoosh/kit-icons';
|
|
|
4
4
|
import { format, monthName, get } from '../../helpers';
|
|
5
5
|
import { InputFrame } from '../../styles';
|
|
6
6
|
import { DatePicker } from '../DatePicker';
|
|
7
|
-
export function DatePickerField(
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
} = props;
|
|
7
|
+
export function DatePickerField({
|
|
8
|
+
value,
|
|
9
|
+
error,
|
|
10
|
+
allowedPlacements = ['bottom-start', 'bottom-end', 'top-start', 'top-end'],
|
|
11
|
+
zIndex = 1000,
|
|
12
|
+
onChange
|
|
13
|
+
}) {
|
|
15
14
|
const [showPicker, setShowPicker] = useState(false);
|
|
16
15
|
const {
|
|
17
16
|
refs,
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type ReactElement } from 'react';
|
|
2
2
|
import type { DateTimePickerFieldProps } from './types';
|
|
3
|
-
export declare function DateTimePickerField(
|
|
3
|
+
export declare function DateTimePickerField({ value, error, allowedPlacements, zIndex, onChange, }: DateTimePickerFieldProps): ReactElement;
|
|
@@ -5,14 +5,13 @@ import { CalendarIcon } from '@pushwoosh/kit-icons';
|
|
|
5
5
|
import { useUTCDate } from './helpers';
|
|
6
6
|
import { InputFrame } from '../../styles';
|
|
7
7
|
import { DateTimePicker } from '../DateTimePicker';
|
|
8
|
-
export function DateTimePickerField(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
} = props;
|
|
8
|
+
export function DateTimePickerField({
|
|
9
|
+
value,
|
|
10
|
+
error,
|
|
11
|
+
allowedPlacements = ['bottom-start', 'bottom-end', 'top-start', 'top-end'],
|
|
12
|
+
zIndex = 1000,
|
|
13
|
+
onChange
|
|
14
|
+
}) {
|
|
16
15
|
const [showPicker, setShowPicker] = useState(false);
|
|
17
16
|
const {
|
|
18
17
|
refs,
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type ReactElement } from 'react';
|
|
2
2
|
import type { NumberPickerProps } from './types';
|
|
3
|
-
export declare function NumberPicker(
|
|
3
|
+
export declare function NumberPicker({ value, hint, step, placeholder, focusOnMount, minValue, maxValue, autoSize, isDisabled, onChange, onSubmit, }: NumberPickerProps): ReactElement;
|
|
@@ -6,20 +6,19 @@ import { SingleInputFrame } from '../../styles';
|
|
|
6
6
|
import { AutosizeInput } from '../AutosizeInput';
|
|
7
7
|
import { Input } from '../Input';
|
|
8
8
|
import { Hint } from './styles';
|
|
9
|
-
export function NumberPicker(
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
} = props;
|
|
9
|
+
export function NumberPicker({
|
|
10
|
+
value,
|
|
11
|
+
hint,
|
|
12
|
+
step = 1,
|
|
13
|
+
placeholder,
|
|
14
|
+
focusOnMount,
|
|
15
|
+
minValue,
|
|
16
|
+
maxValue,
|
|
17
|
+
autoSize,
|
|
18
|
+
isDisabled,
|
|
19
|
+
onChange,
|
|
20
|
+
onSubmit
|
|
21
|
+
}) {
|
|
23
22
|
const ref = useRef(null);
|
|
24
23
|
const [autoDiff, setAutoDiff] = useState(0);
|
|
25
24
|
const [localValue, setLocalValue] = useState(value.toString() || '');
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type ReactElement } from 'react';
|
|
2
2
|
import type { DrawerProps } from './types';
|
|
3
|
-
export declare function Drawer(
|
|
3
|
+
export declare function Drawer({ size, isOpen, zIndex, onClose, children, withoutLockScreen, closeOnClickOutside, }: DrawerProps): ReactElement;
|
|
@@ -5,16 +5,15 @@ import { DrawerBoxTrans, DrawerBox, LockBody, DrawerInner, DrawerContainer } fro
|
|
|
5
5
|
function createDivElement() {
|
|
6
6
|
return document.createElement('div');
|
|
7
7
|
}
|
|
8
|
-
export function Drawer(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
} = props;
|
|
8
|
+
export function Drawer({
|
|
9
|
+
size,
|
|
10
|
+
isOpen,
|
|
11
|
+
zIndex = 10000,
|
|
12
|
+
onClose,
|
|
13
|
+
children,
|
|
14
|
+
withoutLockScreen = false,
|
|
15
|
+
closeOnClickOutside = true
|
|
16
|
+
}) {
|
|
18
17
|
const ref = useRef();
|
|
19
18
|
const [element] = useState(createDivElement);
|
|
20
19
|
useEffect(() => {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type ReactElement } from 'react';
|
|
2
2
|
import type { EditableFieldProps } from './types';
|
|
3
|
-
export declare function EditableField(
|
|
3
|
+
export declare function EditableField({ value, title, open, loading, width, position, zIndex, onToggleOpen, onSubmit, onCancel, children, }: EditableFieldProps): ReactElement;
|
|
@@ -5,20 +5,19 @@ import { Button } from '../Button';
|
|
|
5
5
|
import { useOnClickOutside } from '../hooks';
|
|
6
6
|
import { Popover, PopoverContainer } from '../Popover';
|
|
7
7
|
import { FieldBox, TitleBox, ButtonsGroup } from './styles';
|
|
8
|
-
export function EditableField(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
} = props;
|
|
8
|
+
export function EditableField({
|
|
9
|
+
value,
|
|
10
|
+
title = '',
|
|
11
|
+
open = false,
|
|
12
|
+
loading = false,
|
|
13
|
+
width = 332,
|
|
14
|
+
position = 'right-start',
|
|
15
|
+
zIndex = 1000,
|
|
16
|
+
onToggleOpen,
|
|
17
|
+
onSubmit,
|
|
18
|
+
onCancel,
|
|
19
|
+
children
|
|
20
|
+
}) {
|
|
22
21
|
const rootRef = useRef(null);
|
|
23
22
|
const buttonRef = useRef(null);
|
|
24
23
|
useOnClickOutside(rootRef, onCancel);
|
package/InputFile/InputFile.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type ReactElement } from 'react';
|
|
2
2
|
import type { InputFileProps } from './types';
|
|
3
|
-
export declare function InputFile(
|
|
3
|
+
export declare function InputFile({ fileId, textId, buttonId, label, buttonText, accept, placeholder, disabled, fileName, errorText, name, maxSize, onError, onChange, isIgnoreFileSize, }: InputFileProps): ReactElement;
|
package/InputFile/InputFile.js
CHANGED
|
@@ -4,24 +4,23 @@ import { AttachmentIcon } from '@pushwoosh/kit-icons';
|
|
|
4
4
|
import { Button } from '../Button';
|
|
5
5
|
import { FieldBox } from '../FieldBox';
|
|
6
6
|
import { InputFileFieldsStyled, InputFileButtonStyled, InputFileInputStyled, InputFileInputHiddenStyled, InputFileErrorStyled } from './styles';
|
|
7
|
-
export function InputFile(
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
} = props;
|
|
7
|
+
export function InputFile({
|
|
8
|
+
fileId,
|
|
9
|
+
textId,
|
|
10
|
+
buttonId,
|
|
11
|
+
label,
|
|
12
|
+
buttonText,
|
|
13
|
+
accept,
|
|
14
|
+
placeholder,
|
|
15
|
+
disabled,
|
|
16
|
+
fileName,
|
|
17
|
+
errorText,
|
|
18
|
+
name,
|
|
19
|
+
maxSize,
|
|
20
|
+
onError = () => {},
|
|
21
|
+
onChange,
|
|
22
|
+
isIgnoreFileSize = false
|
|
23
|
+
}) {
|
|
25
24
|
const fieldRef = useRef(null);
|
|
26
25
|
const uploadFile = event => {
|
|
27
26
|
var _event$target$files;
|
package/Link/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type ReactElement } from 'react';
|
|
2
2
|
import type { NumberPickerProps } from './types';
|
|
3
|
-
export declare function NumberPicker(
|
|
3
|
+
export declare function NumberPicker({ value, hint, step, placeholder, focusOnMount, minValue, maxValue, autoSize, isDisabled, onChange, onSubmit, }: NumberPickerProps): ReactElement;
|
|
@@ -4,20 +4,19 @@ import { ChevronIcon } from '@pushwoosh/kit-icons';
|
|
|
4
4
|
import { AutosizeInput } from './components/AutosizeInput';
|
|
5
5
|
import { intVal, isStringInteger } from './helpers';
|
|
6
6
|
import { Hint, SingleInputFrame, InputStyled } from './styles';
|
|
7
|
-
export function NumberPicker(
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
} = props;
|
|
7
|
+
export function NumberPicker({
|
|
8
|
+
value,
|
|
9
|
+
hint,
|
|
10
|
+
step = 1,
|
|
11
|
+
placeholder,
|
|
12
|
+
focusOnMount,
|
|
13
|
+
minValue,
|
|
14
|
+
maxValue,
|
|
15
|
+
autoSize,
|
|
16
|
+
isDisabled,
|
|
17
|
+
onChange,
|
|
18
|
+
onSubmit
|
|
19
|
+
}) {
|
|
21
20
|
const ref = useRef(null);
|
|
22
21
|
const [autoDiff, setAutoDiff] = useState(0);
|
|
23
22
|
const [localValue, setLocalValue] = useState('');
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type ReactElement } from 'react';
|
|
2
2
|
import type { PaginationProps } from './types';
|
|
3
|
-
export declare function Pagination(
|
|
3
|
+
export declare function Pagination({ boxRef, activePage, totalPages, adjacentPagesCount, isLoading, onChangePage, ...rest }: PaginationProps): ReactElement | null;
|
package/Pagination/Pagination.js
CHANGED
|
@@ -2,16 +2,15 @@ import React, { useCallback } from 'react';
|
|
|
2
2
|
import { ArrowIcon } from '@pushwoosh/kit-icons';
|
|
3
3
|
import { getSafelyNumber } from './helpers';
|
|
4
4
|
import { PaginationBox, PaginationArrow, PaginationDivider, PaginationButton } from './styles';
|
|
5
|
-
export function Pagination(
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
} = props;
|
|
5
|
+
export function Pagination({
|
|
6
|
+
boxRef,
|
|
7
|
+
activePage,
|
|
8
|
+
totalPages,
|
|
9
|
+
adjacentPagesCount = 2,
|
|
10
|
+
isLoading = false,
|
|
11
|
+
onChangePage,
|
|
12
|
+
...rest
|
|
13
|
+
}) {
|
|
15
14
|
const safelyActivePageNumber = getSafelyNumber(activePage);
|
|
16
15
|
const safelyTotalPagesNumber = getSafelyNumber(totalPages);
|
|
17
16
|
const handleChangePage = useCallback(event => {
|
package/Popover/Popover.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type ReactElement } from 'react';
|
|
2
2
|
import type { PopoverProps } from './types';
|
|
3
|
-
export declare function Popover(
|
|
3
|
+
export declare function Popover({ open, anchorEl, internalWindowRef, loading, position, zIndex, windowWidth, children, }: PopoverProps): ReactElement;
|
package/Popover/Popover.js
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { PopoverContainerPortal, PopoverContainerWindow } from './styles';
|
|
3
|
-
export function Popover(
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
} = props;
|
|
3
|
+
export function Popover({
|
|
4
|
+
open,
|
|
5
|
+
anchorEl,
|
|
6
|
+
internalWindowRef = null,
|
|
7
|
+
loading = false,
|
|
8
|
+
position = 'right-start',
|
|
9
|
+
zIndex = 1000,
|
|
10
|
+
windowWidth,
|
|
11
|
+
children
|
|
12
|
+
}) {
|
|
14
13
|
return React.createElement(PopoverContainerPortal, {
|
|
15
14
|
animation: false,
|
|
16
15
|
delay: 0,
|
package/Popover/index.d.ts
CHANGED
package/Popover/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { Popover } from './Popover';
|
|
2
|
-
export { PopoverContainer
|
|
2
|
+
export { PopoverContainer } from './styles';
|
package/Popover/types.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { RefObject, ReactNode } from 'react';
|
|
|
2
2
|
import type { Placement } from 'tippy.js';
|
|
3
3
|
export interface PopoverProps {
|
|
4
4
|
readonly anchorEl: RefObject<HTMLElement>;
|
|
5
|
-
readonly internalWindowRef?: RefObject<HTMLDivElement
|
|
5
|
+
readonly internalWindowRef?: RefObject<HTMLDivElement> | null;
|
|
6
6
|
readonly position?: Placement;
|
|
7
7
|
readonly open: boolean;
|
|
8
8
|
readonly loading?: boolean;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type ReactElement } from 'react';
|
|
2
|
-
import { type
|
|
3
|
-
export declare function ProgressBar(
|
|
2
|
+
import { type ProgressBarProps } from './types';
|
|
3
|
+
export declare function ProgressBar({ percentValue, title, rightSlot, color, backgroundColor, }: ProgressBarProps): ReactElement;
|
|
@@ -2,20 +2,19 @@ import React from 'react';
|
|
|
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';
|
|
5
|
-
export function ProgressBar(
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
} = props;
|
|
5
|
+
export function ProgressBar({
|
|
6
|
+
percentValue,
|
|
7
|
+
title,
|
|
8
|
+
rightSlot,
|
|
9
|
+
color = Color.BRIGHT,
|
|
10
|
+
backgroundColor = Color.BRIGHT_LIGHT
|
|
11
|
+
}) {
|
|
13
12
|
return React.createElement(Container, null, React.createElement(SpinnerContainer, {
|
|
14
13
|
"$backgroundColor": backgroundColor
|
|
15
14
|
}, React.createElement(Spinner, {
|
|
16
15
|
color: color,
|
|
17
16
|
size: "medium"
|
|
18
|
-
})), React.createElement(ProgressBoxContainer, null, React.createElement(LoadingHeader, null, React.createElement(LoadingText, null, title
|
|
17
|
+
})), React.createElement(ProgressBoxContainer, null, React.createElement(LoadingHeader, null, React.createElement(LoadingText, null, `${title} ${percentValue}%`), rightSlot && React.createElement(RightSlotContainer, null, rightSlot)), React.createElement(ProgressLineContainer, null, React.createElement(ProgressLine, null, React.createElement(ProgressBarActive, {
|
|
19
18
|
"$width": percentValue,
|
|
20
19
|
"$color": color
|
|
21
20
|
})))));
|
package/ProgressBar/types.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type ReactElement } from 'react';
|
|
2
2
|
import type { PushBasicData, PushPreviewProps } from './types';
|
|
3
|
-
export declare function PushPreview<T extends PushBasicData>(
|
|
3
|
+
export declare function PushPreview<T extends PushBasicData>({ pushPreset, language, view, appTitle, appIcon, isLoading, width, }: PushPreviewProps<T>): ReactElement;
|
|
@@ -6,16 +6,15 @@ import { PREVIEW_ICON_URL } from './constants';
|
|
|
6
6
|
import { getLocalizedContent } from './helpers';
|
|
7
7
|
import { PushBox, PushIcon, PushTitle, PushDescription } from './styles';
|
|
8
8
|
import { RichMessageViewer } from '../RichMessageEditor';
|
|
9
|
-
export function PushPreview(
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
} = props;
|
|
9
|
+
export function PushPreview({
|
|
10
|
+
pushPreset,
|
|
11
|
+
language,
|
|
12
|
+
view = 'compact',
|
|
13
|
+
appTitle = '',
|
|
14
|
+
appIcon = PREVIEW_ICON_URL,
|
|
15
|
+
isLoading = false,
|
|
16
|
+
width
|
|
17
|
+
}) {
|
|
19
18
|
const title = getLocalizedContent((pushPreset === null || pushPreset === void 0 ? void 0 : pushPreset.title) || (pushPreset === null || pushPreset === void 0 ? void 0 : pushPreset.localizedTitle), language) || appTitle;
|
|
20
19
|
const content = getLocalizedContent((pushPreset === null || pushPreset === void 0 ? void 0 : pushPreset.content) || (pushPreset === null || pushPreset === void 0 ? void 0 : pushPreset.localizedContent), language);
|
|
21
20
|
const icon = (pushPreset === null || pushPreset === void 0 ? void 0 : pushPreset.icon) || appIcon || PREVIEW_ICON_URL;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type FC } from 'react';
|
|
2
2
|
import { type RichMessageEditorContent } from './types';
|
|
3
|
-
export
|
|
3
|
+
export type RichMessageViewerProps = {
|
|
4
4
|
value: RichMessageEditorContent | string;
|
|
5
5
|
flat?: boolean;
|
|
6
|
-
}
|
|
6
|
+
};
|
|
7
|
+
export declare const RichMessageViewer: FC<RichMessageViewerProps>;
|
package/Skeleton/styles.js
CHANGED
|
@@ -26,8 +26,10 @@ export const CircularSkeleton = styled.div.withConfig({
|
|
|
26
26
|
export const TextSkeletonTag = styled.div.withConfig({
|
|
27
27
|
displayName: "TextSkeletonTag",
|
|
28
28
|
componentId: "sc-mdyfd6-2"
|
|
29
|
-
})(["", " color:", ";border-radius:
|
|
29
|
+
})(["", " color:", ";border-radius:", ";", ""], ({
|
|
30
30
|
width
|
|
31
31
|
}) => width ? `width: ${toCssValue(width)};` : '', ({
|
|
32
32
|
color
|
|
33
|
-
}) => color || '#ddd',
|
|
33
|
+
}) => color || '#ddd', ({
|
|
34
|
+
borderRadius
|
|
35
|
+
}) => borderRadius || '4px', skeletonCommonCss);
|
package/Switch/Switch.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type ReactElement } from 'react';
|
|
2
|
-
import type {
|
|
3
|
-
export declare function Switch(
|
|
2
|
+
import type { SwitchProps } from './types';
|
|
3
|
+
export declare function Switch({ labelPosition, enabled, isDisabled, children, onChange, }: SwitchProps): ReactElement;
|
package/Switch/Switch.js
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Container, Box, Circle, Label } from './styles';
|
|
3
|
-
export function Switch(
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
} = props;
|
|
3
|
+
export function Switch({
|
|
4
|
+
labelPosition = 'right',
|
|
5
|
+
enabled = false,
|
|
6
|
+
isDisabled = false,
|
|
7
|
+
children,
|
|
8
|
+
onChange
|
|
9
|
+
}) {
|
|
11
10
|
return React.createElement(Container, {
|
|
12
11
|
labelPosition: labelPosition
|
|
13
12
|
}, React.createElement(Box, {
|
package/Switch/types.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type ReactElement } from 'react';
|
|
2
2
|
import type { TablePaginationProps } from './types';
|
|
3
|
-
export declare function TablePagination(
|
|
3
|
+
export declare function TablePagination({ activePage, totalPages, limit, allLimits, padding, onChangePage, onChangeLimit, children, }: TablePaginationProps): ReactElement;
|
|
@@ -2,17 +2,16 @@ import React from 'react';
|
|
|
2
2
|
import { Horizontal } from '@pushwoosh/kit-helpers';
|
|
3
3
|
import { NativeSelect } from '../../../native';
|
|
4
4
|
import { Pagination } from '../../../Pagination';
|
|
5
|
-
export function TablePagination(
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
} = props;
|
|
5
|
+
export function TablePagination({
|
|
6
|
+
activePage,
|
|
7
|
+
totalPages,
|
|
8
|
+
limit,
|
|
9
|
+
allLimits,
|
|
10
|
+
padding = 24,
|
|
11
|
+
onChangePage,
|
|
12
|
+
onChangeLimit,
|
|
13
|
+
children
|
|
14
|
+
}) {
|
|
16
15
|
return React.createElement(Horizontal, {
|
|
17
16
|
"$alignItems": "center",
|
|
18
17
|
"$justifyContent": "space-between",
|
package/Table/index.d.ts
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
export { DataTable } from './components/DataTable';
|
|
2
|
-
export { DataTableList } from './components/DataTableList';
|
|
3
2
|
export { DataTableGetContext } from './components/DataTableGetContext';
|
|
4
3
|
export { DataTablePagination } from './components/DataTablePagination';
|
|
5
4
|
export { DataTableSearchInput } from './components/DataTableSearchInput';
|
|
6
5
|
export { DataTableSortableCell } from './components/DataTableSortableCell';
|
|
7
6
|
export { Loading } from './components/Loading';
|
|
8
|
-
export { TableList } from './components/TableList';
|
|
9
7
|
export { TablePagination } from './components/TablePagination';
|
|
10
8
|
export { useDataTableContext, useDataTableGetParams } from './hooks';
|
|
11
9
|
export { Table, Td, Tr, Th, ElementHover, ItemDetailLink, ItemName, LockedText, Description, } from './styles';
|
package/Table/index.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
export { DataTable } from './components/DataTable';
|
|
2
|
-
export { DataTableList } from './components/DataTableList';
|
|
3
2
|
export { DataTableGetContext } from './components/DataTableGetContext';
|
|
4
3
|
export { DataTablePagination } from './components/DataTablePagination';
|
|
5
4
|
export { DataTableSearchInput } from './components/DataTableSearchInput';
|
|
6
5
|
export { DataTableSortableCell } from './components/DataTableSortableCell';
|
|
7
6
|
export { Loading } from './components/Loading';
|
|
8
|
-
export { TableList } from './components/TableList';
|
|
9
7
|
export { TablePagination } from './components/TablePagination';
|
|
10
8
|
export { useDataTableContext, useDataTableGetParams } from './hooks';
|
|
11
9
|
export { Table, Td, Tr, Th, ElementHover, ItemDetailLink, ItemName, LockedText, Description } from './styles';
|
package/Table/styles.d.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { FontSize, FontWeight } from '@pushwoosh/kit-constants';
|
|
2
|
+
export type TableProps = {
|
|
3
|
+
columns: string;
|
|
4
|
+
width?: string | number;
|
|
5
|
+
};
|
|
2
6
|
export declare const Table: import("styled-components").StyledComponent<"div", any, {
|
|
3
7
|
$alignContent?: "end" | "start" | "center" | "space-between" | "space-around" | "space-evenly" | "stretch" | undefined;
|
|
4
8
|
$alignItems?: "end" | "start" | "center" | "stretch" | "baseline" | undefined;
|
|
@@ -54,10 +58,7 @@ export declare const Table: import("styled-components").StyledComponent<"div", a
|
|
|
54
58
|
$placeItems?: "end" | "start" | "center" | "stretch" | undefined;
|
|
55
59
|
} & {
|
|
56
60
|
$gridAutoFlow: string;
|
|
57
|
-
} &
|
|
58
|
-
columns: string;
|
|
59
|
-
width?: string | number;
|
|
60
|
-
}, "$gridAutoFlow">;
|
|
61
|
+
} & TableProps, "$gridAutoFlow">;
|
|
61
62
|
export declare const Td: import("styled-components").StyledComponent<"div", any, {
|
|
62
63
|
$alignContent?: "end" | "start" | "center" | "space-between" | "space-around" | "space-evenly" | "stretch" | undefined;
|
|
63
64
|
$alignItems?: "end" | "start" | "center" | "stretch" | "baseline" | undefined;
|
package/Tooltip/Tooltip.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type ReactElement } from 'react';
|
|
2
2
|
import type { TooltipProps } from './types';
|
|
3
|
-
export declare function Tooltip(
|
|
3
|
+
export declare function Tooltip({ position, arrowOffset, offset, maxWidth, zIndex, isDisabled, isVisible, ...rest }: TooltipProps): ReactElement;
|
package/Tooltip/Tooltip.js
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TooltipPositionToArrowOffsetMap, TooltipPositionToTippyOffsetMap, TooltipPositionToTippyPlacementMap } from './maps';
|
|
3
3
|
import { TooltipBox } from './styles';
|
|
4
|
-
export function Tooltip(
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
} = props;
|
|
4
|
+
export function Tooltip({
|
|
5
|
+
position = 'top-start',
|
|
6
|
+
arrowOffset = TooltipPositionToArrowOffsetMap[position],
|
|
7
|
+
offset = TooltipPositionToTippyOffsetMap[position],
|
|
8
|
+
maxWidth = 240,
|
|
9
|
+
zIndex = 999999,
|
|
10
|
+
isDisabled,
|
|
11
|
+
isVisible,
|
|
12
|
+
...rest
|
|
13
|
+
}) {
|
|
15
14
|
return React.createElement(TooltipBox, {
|
|
16
15
|
animation: false,
|
|
17
16
|
delay: 0,
|
package/Tooltip/maps.d.ts
CHANGED
|
@@ -13,20 +13,7 @@ export declare const TooltipPositionToTippyPlacementMap: {
|
|
|
13
13
|
'left-middle': "left";
|
|
14
14
|
'left-end': "left-end";
|
|
15
15
|
};
|
|
16
|
-
export declare const TooltipPositionToTippyOffsetMap:
|
|
17
|
-
'top-start': number[];
|
|
18
|
-
'top-middle': number[];
|
|
19
|
-
'top-end': number[];
|
|
20
|
-
'right-start': number[];
|
|
21
|
-
'right-middle': number[];
|
|
22
|
-
'right-end': number[];
|
|
23
|
-
'bottom-start': number[];
|
|
24
|
-
'bottom-middle': number[];
|
|
25
|
-
'bottom-end': number[];
|
|
26
|
-
'left-start': number[];
|
|
27
|
-
'left-middle': number[];
|
|
28
|
-
'left-end': number[];
|
|
29
|
-
};
|
|
16
|
+
export declare const TooltipPositionToTippyOffsetMap: Record<TooltipPosition, [number, number]>;
|
|
30
17
|
export declare const TooltipPositionToArrowOffsetMap: {
|
|
31
18
|
'top-start': string;
|
|
32
19
|
'top-middle': string;
|
package/index.d.ts
CHANGED
|
@@ -26,7 +26,7 @@ export { StatisticCard } from './StatisticCard';
|
|
|
26
26
|
export { EmailTemplatePreview, NoEmailTemplatePreview } from './EmailTemplatePreview';
|
|
27
27
|
export { PushPreview } from './PushPreview';
|
|
28
28
|
export { Toast, ToastProvider, useToast } from './Toast';
|
|
29
|
-
export { DataTable,
|
|
29
|
+
export { DataTable, DataTableGetContext, DataTablePagination, DataTableSearchInput, DataTableSortableCell, Loading, TablePagination, useDataTableContext, useDataTableGetParams, Table, Td, Tr, Th, ElementHover, ItemDetailLink, ItemName, LockedText, Description, type DataTableParams, type DataTableData, type DataTableContextType, } from './Table';
|
|
30
30
|
export { AutosizeInput, PageHeader, PageHeaderEditable } from './PageHeader';
|
|
31
31
|
export { ExportResult } from './ExportResult';
|
|
32
32
|
export { NativeInput, NativeTextarea, NativeSelect } from './native';
|
package/index.js
CHANGED
|
@@ -26,7 +26,7 @@ export { StatisticCard } from './StatisticCard';
|
|
|
26
26
|
export { EmailTemplatePreview, NoEmailTemplatePreview } from './EmailTemplatePreview';
|
|
27
27
|
export { PushPreview } from './PushPreview';
|
|
28
28
|
export { Toast, ToastProvider, useToast } from './Toast';
|
|
29
|
-
export { DataTable,
|
|
29
|
+
export { DataTable, DataTableGetContext, DataTablePagination, DataTableSearchInput, DataTableSortableCell, Loading, TablePagination, useDataTableContext, useDataTableGetParams, Table, Td, Tr, Th, ElementHover, ItemDetailLink, ItemName, LockedText, Description } from './Table';
|
|
30
30
|
export { AutosizeInput, PageHeader, PageHeaderEditable } from './PageHeader';
|
|
31
31
|
export { ExportResult } from './ExportResult';
|
|
32
32
|
export { NativeInput, NativeTextarea, NativeSelect } from './native';
|
package/package.json
CHANGED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Table } from '../../styles';
|
|
3
|
-
export function TableList(props) {
|
|
4
|
-
const {
|
|
5
|
-
columns,
|
|
6
|
-
items,
|
|
7
|
-
renderHead,
|
|
8
|
-
renderItem,
|
|
9
|
-
renderTableTop,
|
|
10
|
-
renderTableBottom
|
|
11
|
-
} = props;
|
|
12
|
-
return React.createElement(Table, {
|
|
13
|
-
columns: columns
|
|
14
|
-
}, renderTableTop === null || renderTableTop === void 0 ? void 0 : renderTableTop(), renderHead(), items.map(renderItem), renderTableBottom === null || renderTableBottom === void 0 ? void 0 : renderTableBottom());
|
|
15
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { TableList } from './TableList';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { TableList } from './TableList';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|