@pushwoosh/smart-components-kit 1.0.89 → 1.1.0
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/CampaignsConfigurationDrawer/CampaignsConfigurationDrawer.d.ts +1 -2
- package/CampaignsConfigurationDrawer/CampaignsConfigurationDrawer.js +105 -56
- package/CampaignsConfigurationDrawer/components/Card/Card.d.ts +1 -2
- package/CampaignsConfigurationDrawer/components/Card/Card.js +19 -13
- package/CampaignsConfigurationDrawer/polyglot/index.d.ts +2 -0
- package/CampaignsConfigurationDrawer/polyglot/index.js +10 -0
- package/CampaignsConfigurationDrawer/polyglot/messages_en.d.ts +3 -0
- package/CampaignsConfigurationDrawer/polyglot/messages_en.js +18 -0
- package/CampaignsConfigurationDrawer/polyglot/messages_ru.d.ts +3 -0
- package/CampaignsConfigurationDrawer/polyglot/messages_ru.js +18 -0
- package/CampaignsConfigurationDrawer/polyglot/types.d.ts +19 -0
- package/CampaignsConfigurationDrawer/polyglot/types.js +1 -0
- package/DocsButton/DocsButton.d.ts +1 -2
- package/DocsButton/DocsButton.js +21 -18
- package/DynamicContentPicker/DynamicContentPicker.js +76 -63
- package/DynamicContentPicker/Line.js +24 -22
- package/DynamicContentPickerForm/DynamicContentCustomPickerForm.js +20 -15
- package/DynamicContentPickerForm/DynamicContentEventPickerForm.js +62 -51
- package/DynamicContentPickerForm/DynamicContentTagPickerForm.js +62 -51
- package/DynamicContentPickerForm/SimpleDynamicContentPickerFormSmart.js +74 -59
- package/DynamicContentPickerForm/VariedDynamicContentPickerFormSmart.js +104 -78
- package/DynamicContentPickerForm/polyglot/index.d.ts +2 -0
- package/DynamicContentPickerForm/polyglot/index.js +10 -0
- package/DynamicContentPickerForm/polyglot/messages_en.d.ts +3 -0
- package/DynamicContentPickerForm/polyglot/messages_en.js +16 -0
- package/DynamicContentPickerForm/polyglot/messages_ru.d.ts +3 -0
- package/DynamicContentPickerForm/polyglot/messages_ru.js +16 -0
- package/DynamicContentPickerForm/polyglot/types.d.ts +17 -0
- package/DynamicContentPickerForm/polyglot/types.js +1 -0
- package/EmailTemplatePreview/EmailTemplatePreview.js +10 -4
- package/EmailTemplatePreview/polyglot/index.d.ts +5 -0
- package/EmailTemplatePreview/polyglot/index.js +10 -0
- package/EmailTemplatePreview/polyglot/messages_en.d.ts +3 -0
- package/EmailTemplatePreview/polyglot/messages_en.js +3 -0
- package/EmailTemplatePreview/polyglot/messages_ru.d.ts +3 -0
- package/EmailTemplatePreview/polyglot/messages_ru.js +3 -0
- package/EmailTemplatePreview/polyglot/types.d.ts +4 -0
- package/EmailTemplatePreview/polyglot/types.js +1 -0
- package/ExportCSV/ExportCsvBanner/ExportCsvBanner.d.ts +1 -2
- package/ExportCSV/ExportCsvBanner/ExportCsvBanner.js +63 -42
- package/ExportCSV/polyglot/index.d.ts +2 -0
- package/ExportCSV/polyglot/index.js +10 -0
- package/ExportCSV/polyglot/messages_en.d.ts +3 -0
- package/ExportCSV/polyglot/messages_en.js +9 -0
- package/ExportCSV/polyglot/messages_ru.d.ts +3 -0
- package/ExportCSV/polyglot/messages_ru.js +9 -0
- package/ExportCSV/polyglot/types.d.ts +10 -0
- package/ExportCSV/polyglot/types.js +1 -0
- package/ExportCSV/useExportService/useExportService.js +1 -0
- package/LanguagesSelector/LanguagesModal.js +38 -24
- package/LanguagesSelector/LanguagesSelectForm.js +73 -62
- package/LanguagesSelector/LanguagesSelectFormLoader.js +8 -7
- package/LanguagesSelector/LanguagesSelector.js +92 -78
- package/MediaStore/CreateVariantDrawer.js +134 -85
- package/MediaStore/MediaStore.js +137 -112
- package/ModalCloningJourney/ModalCloningJourney.d.ts +1 -2
- package/ModalCloningJourney/ModalCloningJourney.js +113 -91
- package/OpenActions/components/OpenActionsSummary/OpenActionsSummary.d.ts +1 -2
- package/OpenActions/components/OpenActionsSummary/OpenActionsSummary.js +101 -37
- package/OpenActions/components/OpenActionsSummaryByPreset.d.ts +1 -2
- package/OpenActions/components/OpenActionsSummaryByPreset.js +2 -2
- package/OpenActions/polyglot/index.d.ts +2 -0
- package/OpenActions/polyglot/index.js +10 -0
- package/OpenActions/polyglot/messages_en.d.ts +3 -0
- package/OpenActions/polyglot/messages_en.js +14 -0
- package/OpenActions/polyglot/messages_ru.d.ts +3 -0
- package/OpenActions/polyglot/messages_ru.js +14 -0
- package/OpenActions/polyglot/types.d.ts +18 -0
- package/OpenActions/polyglot/types.js +1 -0
- package/PlatformsConfigurationDrawer/PlatformsConfigurationDrawer.js +21 -17
- package/PlatformsConfigurationDrawer/components/DesktopPage/DesktopPage.js +114 -57
- package/PlatformsConfigurationDrawer/components/MainPage/MainPage.js +157 -75
- package/PlatformsConfigurationDrawer/components/MobilePage/MobilePage.js +140 -69
- package/PlatformsConfigurationDrawer/polyglot/index.d.ts +2 -0
- package/PlatformsConfigurationDrawer/polyglot/index.js +10 -0
- package/PlatformsConfigurationDrawer/polyglot/messages_en.d.ts +3 -0
- package/PlatformsConfigurationDrawer/polyglot/messages_en.js +24 -0
- package/PlatformsConfigurationDrawer/polyglot/messages_ru.d.ts +3 -0
- package/PlatformsConfigurationDrawer/polyglot/messages_ru.js +24 -0
- package/PlatformsConfigurationDrawer/polyglot/types.d.ts +25 -0
- package/PlatformsConfigurationDrawer/polyglot/types.js +1 -0
- package/ResendModal/ResendModal.d.ts +1 -2
- package/ResendModal/ResendModal.js +95 -59
- package/ResendModal/polyglot/index.d.ts +2 -0
- package/ResendModal/polyglot/index.js +10 -0
- package/ResendModal/polyglot/messages_en.d.ts +3 -0
- package/ResendModal/polyglot/messages_en.js +9 -0
- package/ResendModal/polyglot/messages_ru.d.ts +3 -0
- package/ResendModal/polyglot/messages_ru.js +9 -0
- package/ResendModal/polyglot/types.d.ts +10 -0
- package/ResendModal/polyglot/types.js +1 -0
- package/RichMessageEditorSmart/NewDynamicContentForm.js +16 -12
- package/RichMessageEditorSmart/RichMessageEditorSmart.js +4 -4
- package/SystemParcel/SystemParcel.d.ts +3 -3
- package/SystemParcel/SystemParcel.js +3 -2
- package/Table/components/DataTable/DataTable.js +80 -61
- package/Table/components/DataTableGetContext/DataTableGetContext.d.ts +1 -2
- package/Table/components/DataTableGetContext/DataTableGetContext.js +5 -2
- package/Table/components/DataTableList/DataTableList.d.ts +1 -2
- package/Table/components/DataTableList/DataTableList.js +86 -68
- package/Table/components/DataTablePagination/DataTablePagination.js +6 -4
- package/Table/components/DataTableSearchInput/DataTableSearchInput.js +3 -2
- package/Table/components/DataTableSortableCell/DataTableSortableCell.js +6 -4
- package/Table/components/Loading/Loading.d.ts +1 -2
- package/Table/components/Loading/Loading.js +16 -14
- package/Table/components/TablePagination/TablePagination.js +31 -25
- package/_devel/index.js +36 -24
- package/_devel/lib/dynamic-content-picker.d.ts +1 -2
- package/_devel/lib/dynamic-content-picker.js +16 -10
- package/_devel/lib/index.d.ts +2 -2
- package/_devel/lib/index.js +38 -19
- package/_devel/test-place.d.ts +1 -2
- package/_devel/test-place.js +4 -2
- package/package.json +2 -2
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useContext } from 'react';
|
|
2
3
|
import { FontSize, FontWeight } from '@pushwoosh/kit-constants';
|
|
3
4
|
import { Horizontal, Vertical } from '@pushwoosh/kit-helpers';
|
|
4
5
|
import Box from '../../assets/box.svg?url';
|
|
@@ -18,83 +19,100 @@ export function DataTableList({
|
|
|
18
19
|
} = useContext(DataTableContext);
|
|
19
20
|
const lang = useLang();
|
|
20
21
|
if (data.loading) {
|
|
21
|
-
return
|
|
22
|
+
return _jsx(Loading, {});
|
|
22
23
|
}
|
|
23
24
|
if ((_data$value = data.value) !== null && _data$value !== void 0 && (_data$value = _data$value.items) !== null && _data$value !== void 0 && _data$value.length) {
|
|
24
|
-
return
|
|
25
|
+
return _jsx(_Fragment, {
|
|
26
|
+
children: data.value.items.map(renderItem)
|
|
27
|
+
});
|
|
25
28
|
}
|
|
26
29
|
if (!data.loading && data.error) {
|
|
27
|
-
return
|
|
30
|
+
return _jsx(Horizontal, {
|
|
28
31
|
"$placeItems": "center",
|
|
29
|
-
"$padding": 64
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
"$padding": 64,
|
|
33
|
+
children: _jsxs(Horizontal, {
|
|
34
|
+
"$gap": 16,
|
|
35
|
+
children: [_jsx("img", {
|
|
36
|
+
src: Error,
|
|
37
|
+
alt: lang({
|
|
38
|
+
message: 'SMART.TABLE.ERROR_IMG_ALT'
|
|
39
|
+
})
|
|
40
|
+
}), _jsxs(Vertical, {
|
|
41
|
+
"$alignContent": "center",
|
|
42
|
+
"$gap": 8,
|
|
43
|
+
children: [_jsx(LockedText, {
|
|
44
|
+
"$fontWeight": FontWeight.MEDIUM,
|
|
45
|
+
"$maxWidth": "250px",
|
|
46
|
+
children: lang({
|
|
47
|
+
message: 'SMART.TABLE.ERROR_TITLE'
|
|
48
|
+
})
|
|
49
|
+
}), _jsx(LockedText, {
|
|
50
|
+
"$fontSize": FontSize.SMALL,
|
|
51
|
+
"$maxWidth": "250px",
|
|
52
|
+
children: lang({
|
|
53
|
+
message: 'SMART.TABLE.ERROR_DESCRIPTION'
|
|
54
|
+
})
|
|
55
|
+
})]
|
|
56
|
+
})]
|
|
36
57
|
})
|
|
37
|
-
})
|
|
38
|
-
"$alignContent": "center",
|
|
39
|
-
"$gap": 8
|
|
40
|
-
}, React.createElement(LockedText, {
|
|
41
|
-
"$fontWeight": FontWeight.MEDIUM,
|
|
42
|
-
"$maxWidth": "250px"
|
|
43
|
-
}, lang({
|
|
44
|
-
message: 'SMART.TABLE.ERROR_TITLE'
|
|
45
|
-
})), React.createElement(LockedText, {
|
|
46
|
-
"$fontSize": FontSize.SMALL,
|
|
47
|
-
"$maxWidth": "250px"
|
|
48
|
-
}, lang({
|
|
49
|
-
message: 'SMART.TABLE.ERROR_DESCRIPTION'
|
|
50
|
-
})))));
|
|
58
|
+
});
|
|
51
59
|
}
|
|
52
60
|
const isFiltered = ((_data$value2 = data.value) === null || _data$value2 === void 0 ? void 0 : _data$value2.isFiltered) || params.search;
|
|
53
|
-
return isFiltered ?
|
|
61
|
+
return isFiltered ? _jsx(Horizontal, {
|
|
54
62
|
"$placeItems": "center",
|
|
55
|
-
"$padding": 64
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
63
|
+
"$padding": 64,
|
|
64
|
+
children: _jsxs(Horizontal, {
|
|
65
|
+
"$gap": 16,
|
|
66
|
+
children: [_jsx("img", {
|
|
67
|
+
src: NotFound,
|
|
68
|
+
alt: lang({
|
|
69
|
+
message: 'SMART.TABLE.NO_MATCH_IMG_ALT'
|
|
70
|
+
})
|
|
71
|
+
}), _jsxs(Vertical, {
|
|
72
|
+
"$alignContent": "center",
|
|
73
|
+
"$gap": 8,
|
|
74
|
+
children: [_jsx(LockedText, {
|
|
75
|
+
"$fontWeight": FontWeight.MEDIUM,
|
|
76
|
+
"$maxWidth": "250px",
|
|
77
|
+
children: lang({
|
|
78
|
+
message: 'SMART.TABLE.NO_MATCH'
|
|
79
|
+
})
|
|
80
|
+
}), _jsx(LockedText, {
|
|
81
|
+
"$fontSize": FontSize.SMALL,
|
|
82
|
+
"$maxWidth": "250px",
|
|
83
|
+
children: lang({
|
|
84
|
+
message: 'SMART.TABLE.NO_MATCH_DESCRIPTION'
|
|
85
|
+
})
|
|
86
|
+
})]
|
|
87
|
+
})]
|
|
62
88
|
})
|
|
63
|
-
})
|
|
64
|
-
"$alignContent": "center",
|
|
65
|
-
"$gap": 8
|
|
66
|
-
}, React.createElement(LockedText, {
|
|
67
|
-
"$fontWeight": FontWeight.MEDIUM,
|
|
68
|
-
"$maxWidth": "250px"
|
|
69
|
-
}, lang({
|
|
70
|
-
message: 'SMART.TABLE.NO_MATCH'
|
|
71
|
-
})), React.createElement(LockedText, {
|
|
72
|
-
"$fontSize": FontSize.SMALL,
|
|
73
|
-
"$maxWidth": "250px"
|
|
74
|
-
}, lang({
|
|
75
|
-
message: 'SMART.TABLE.NO_MATCH_DESCRIPTION'
|
|
76
|
-
}))))) : React.createElement(Horizontal, {
|
|
89
|
+
}) : _jsx(Horizontal, {
|
|
77
90
|
"$placeItems": "center",
|
|
78
|
-
"$padding": 64
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
91
|
+
"$padding": 64,
|
|
92
|
+
children: _jsxs(Horizontal, {
|
|
93
|
+
"$gap": 16,
|
|
94
|
+
children: [_jsx("img", {
|
|
95
|
+
src: Box,
|
|
96
|
+
alt: lang({
|
|
97
|
+
message: 'SMART.TABLE.EMPTY_IMG_ALT'
|
|
98
|
+
})
|
|
99
|
+
}), _jsxs(Vertical, {
|
|
100
|
+
"$alignContent": "center",
|
|
101
|
+
"$gap": 8,
|
|
102
|
+
children: [_jsx(LockedText, {
|
|
103
|
+
"$fontWeight": FontWeight.MEDIUM,
|
|
104
|
+
"$maxWidth": "250px",
|
|
105
|
+
children: lang({
|
|
106
|
+
message: 'SMART.TABLE.EMPTY_TITLE'
|
|
107
|
+
})
|
|
108
|
+
}), _jsx(LockedText, {
|
|
109
|
+
"$fontSize": FontSize.SMALL,
|
|
110
|
+
"$maxWidth": "250px",
|
|
111
|
+
children: lang({
|
|
112
|
+
message: 'SMART.TABLE.EMPTY_DESCRIPTION'
|
|
113
|
+
})
|
|
114
|
+
})]
|
|
115
|
+
})]
|
|
85
116
|
})
|
|
86
|
-
})
|
|
87
|
-
"$alignContent": "center",
|
|
88
|
-
"$gap": 8
|
|
89
|
-
}, React.createElement(LockedText, {
|
|
90
|
-
"$fontWeight": FontWeight.MEDIUM,
|
|
91
|
-
"$maxWidth": "250px"
|
|
92
|
-
}, lang({
|
|
93
|
-
message: 'SMART.TABLE.EMPTY_TITLE'
|
|
94
|
-
})), React.createElement(LockedText, {
|
|
95
|
-
"$fontSize": FontSize.SMALL,
|
|
96
|
-
"$maxWidth": "250px"
|
|
97
|
-
}, lang({
|
|
98
|
-
message: 'SMART.TABLE.EMPTY_DESCRIPTION'
|
|
99
|
-
})))));
|
|
117
|
+
});
|
|
100
118
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useContext } from 'react';
|
|
2
3
|
import { DataTableContext } from '../../context';
|
|
3
4
|
import { TablePagination } from '../TablePagination';
|
|
4
5
|
export function DataTablePagination({
|
|
@@ -13,7 +14,7 @@ export function DataTablePagination({
|
|
|
13
14
|
params,
|
|
14
15
|
onChangeParams
|
|
15
16
|
} = useContext(DataTableContext);
|
|
16
|
-
return
|
|
17
|
+
return _jsx(TablePagination, {
|
|
17
18
|
activePage: params.page,
|
|
18
19
|
totalPages: ((_data$value = data.value) === null || _data$value === void 0 ? void 0 : _data$value.totalPages) || 1,
|
|
19
20
|
limit: params.perPage,
|
|
@@ -32,6 +33,7 @@ export function DataTablePagination({
|
|
|
32
33
|
perPage
|
|
33
34
|
});
|
|
34
35
|
},
|
|
35
|
-
hidePageSizeSelector: hidePageSizeSelector
|
|
36
|
-
|
|
36
|
+
hidePageSizeSelector: hidePageSizeSelector,
|
|
37
|
+
children: children
|
|
38
|
+
});
|
|
37
39
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useRef, useState, useEffect, useContext } from 'react';
|
|
2
3
|
import { SearchInput } from '@pushwoosh/dumb-components';
|
|
3
4
|
import { DataTableContext } from '../../context';
|
|
4
5
|
export function DataTableSearchInput(props) {
|
|
@@ -10,7 +11,7 @@ export function DataTableSearchInput(props) {
|
|
|
10
11
|
setInputValue(context.params.search);
|
|
11
12
|
}
|
|
12
13
|
}, [context.params.search]); // eslint-disable-line react-hooks/exhaustive-deps
|
|
13
|
-
return
|
|
14
|
+
return _jsx(SearchInput, {
|
|
14
15
|
...props,
|
|
15
16
|
value: inputValue,
|
|
16
17
|
"$onClear": () => {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useContext } from 'react';
|
|
2
3
|
import { SortButton } from '@pushwoosh/dumb-components';
|
|
3
4
|
import { DataTableContext } from '../../context';
|
|
4
5
|
export function DataTableSortableCell(props) {
|
|
@@ -10,7 +11,7 @@ export function DataTableSortableCell(props) {
|
|
|
10
11
|
params,
|
|
11
12
|
onChangeParams
|
|
12
13
|
} = useContext(DataTableContext);
|
|
13
|
-
return
|
|
14
|
+
return _jsx(SortButton, {
|
|
14
15
|
name: name,
|
|
15
16
|
order: params.order === name ? params.direction : null,
|
|
16
17
|
onClick: sortParams => {
|
|
@@ -20,6 +21,7 @@ export function DataTableSortableCell(props) {
|
|
|
20
21
|
direction: sortParams.order || 'asc',
|
|
21
22
|
page: 1
|
|
22
23
|
});
|
|
23
|
-
}
|
|
24
|
-
|
|
24
|
+
},
|
|
25
|
+
children: children
|
|
26
|
+
});
|
|
25
27
|
}
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const Loading: () => React.JSX.Element;
|
|
1
|
+
export declare const Loading: () => import("react").JSX.Element;
|
|
@@ -1,20 +1,22 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { TextSkeleton } from '@pushwoosh/dumb-components';
|
|
3
3
|
import { Horizontal } from '@pushwoosh/kit-helpers';
|
|
4
4
|
import { Wrapper } from './styles';
|
|
5
5
|
const Row = ({
|
|
6
6
|
width
|
|
7
|
-
}) =>
|
|
7
|
+
}) => _jsx(Horizontal, {
|
|
8
8
|
"$alignItems": "center",
|
|
9
|
-
"$padding": "0 24px"
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
})
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
9
|
+
"$padding": "0 24px",
|
|
10
|
+
children: _jsx(TextSkeleton, {
|
|
11
|
+
width: width
|
|
12
|
+
})
|
|
13
|
+
});
|
|
14
|
+
export const Loading = () => _jsx(Wrapper, {
|
|
15
|
+
children: Array.from({
|
|
16
|
+
length: 4
|
|
17
|
+
}).map((_, index) =>
|
|
18
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
19
|
+
_jsx(Row, {
|
|
20
|
+
width: `${index % 2 ? 35 : 50}%`
|
|
21
|
+
}, index))
|
|
22
|
+
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { NativeSelect, Pagination } from '@pushwoosh/dumb-components';
|
|
3
3
|
import { Horizontal } from '@pushwoosh/kit-helpers';
|
|
4
4
|
import { useLang } from '../../polyglot';
|
|
@@ -14,30 +14,36 @@ export function TablePagination({
|
|
|
14
14
|
children
|
|
15
15
|
}) {
|
|
16
16
|
const lang = useLang();
|
|
17
|
-
return
|
|
17
|
+
return _jsxs(Horizontal, {
|
|
18
18
|
"$alignItems": "center",
|
|
19
19
|
"$justifyContent": "space-between",
|
|
20
|
-
"$padding": padding
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
20
|
+
"$padding": padding,
|
|
21
|
+
children: [_jsxs(Horizontal, {
|
|
22
|
+
"$gap": 8,
|
|
23
|
+
"$alignItems": "center",
|
|
24
|
+
children: [totalPages > 1 && _jsx(Pagination, {
|
|
25
|
+
activePage: activePage,
|
|
26
|
+
totalPages: totalPages,
|
|
27
|
+
onChangePage: onChangePage
|
|
28
|
+
}), children]
|
|
29
|
+
}), !hidePageSizeSelector && _jsxs(Horizontal, {
|
|
30
|
+
"$gap": 8,
|
|
31
|
+
"$alignItems": "center",
|
|
32
|
+
children: [_jsx("span", {
|
|
33
|
+
children: lang({
|
|
34
|
+
message: 'SMART.TABLE.SHOW_ON_PAGE'
|
|
35
|
+
})
|
|
36
|
+
}), _jsx(NativeSelect, {
|
|
37
|
+
name: "page",
|
|
38
|
+
value: limit,
|
|
39
|
+
onChange: event => {
|
|
40
|
+
onChangeLimit(Number(event.target.value));
|
|
41
|
+
},
|
|
42
|
+
children: allLimits.map(option => _jsx("option", {
|
|
43
|
+
value: option,
|
|
44
|
+
children: option
|
|
45
|
+
}, option))
|
|
46
|
+
})]
|
|
47
|
+
})]
|
|
48
|
+
});
|
|
43
49
|
}
|
package/_devel/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { createRoot } from 'react-dom/client';
|
|
3
3
|
import { Router, Route, Switch, Link } from 'react-router-dom';
|
|
4
4
|
import { SPAContextProvider } from '@pushwoosh/spa-context';
|
|
@@ -8,29 +8,41 @@ export function parcel(container) {
|
|
|
8
8
|
const root = createRoot(container);
|
|
9
9
|
return {
|
|
10
10
|
render(props) {
|
|
11
|
-
root.render(
|
|
12
|
-
history: props.spaContext.history
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
11
|
+
root.render(_jsx(Router, {
|
|
12
|
+
history: props.spaContext.history,
|
|
13
|
+
children: _jsx(SPAContextProvider, {
|
|
14
|
+
value: props.spaContext,
|
|
15
|
+
children: _jsxs(Switch, {
|
|
16
|
+
children: [_jsx(Route, {
|
|
17
|
+
path: "/:url",
|
|
18
|
+
exact: true,
|
|
19
|
+
render: ({
|
|
20
|
+
match
|
|
21
|
+
}) => {
|
|
22
|
+
return _jsxs("ul", {
|
|
23
|
+
children: [_jsx("li", {
|
|
24
|
+
children: _jsx(Link, {
|
|
25
|
+
to: `${match.url}/test`,
|
|
26
|
+
children: "Test your new component"
|
|
27
|
+
})
|
|
28
|
+
}), _jsx("li", {
|
|
29
|
+
children: _jsx(Link, {
|
|
30
|
+
to: `${match.url}/lib`,
|
|
31
|
+
children: "Components lib"
|
|
32
|
+
})
|
|
33
|
+
})]
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
}), _jsx(Route, {
|
|
37
|
+
path: "/:url/test",
|
|
38
|
+
component: TestPlace
|
|
39
|
+
}), _jsx(Route, {
|
|
40
|
+
path: "/:url/lib",
|
|
41
|
+
component: Lib
|
|
42
|
+
})]
|
|
43
|
+
})
|
|
44
|
+
})
|
|
45
|
+
}));
|
|
34
46
|
},
|
|
35
47
|
unmount() {
|
|
36
48
|
root.unmount();
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function DynamicContentPickerExample(): React.JSX.Element;
|
|
1
|
+
export declare function DynamicContentPickerExample(): import("react").JSX.Element;
|
|
@@ -1,17 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
/* eslint-disable no-console */
|
|
2
|
-
import
|
|
3
|
+
import { useState } from 'react';
|
|
3
4
|
import { Button } from '@pushwoosh/dumb-components';
|
|
4
5
|
import { Horizontal } from '@pushwoosh/kit-helpers';
|
|
5
6
|
import { SimpleDynamicContentPickerFormSmart } from '../../DynamicContentPickerForm';
|
|
6
7
|
export function DynamicContentPickerExample() {
|
|
7
8
|
const [dc, setDc] = useState();
|
|
8
|
-
return
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
9
|
+
return _jsx("div", {
|
|
10
|
+
children: _jsx(SimpleDynamicContentPickerFormSmart, {
|
|
11
|
+
dc: dc,
|
|
12
|
+
onChange: setDc,
|
|
13
|
+
children: _jsx(Horizontal, {
|
|
14
|
+
"$justifyContent": "end",
|
|
15
|
+
children: _jsx(Button, {
|
|
16
|
+
color: "primary",
|
|
17
|
+
onClick: () => console.log(dc),
|
|
18
|
+
children: "Log to console"
|
|
19
|
+
})
|
|
20
|
+
})
|
|
21
|
+
})
|
|
22
|
+
});
|
|
17
23
|
}
|
package/_devel/lib/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type FC } from 'react';
|
|
2
2
|
import { type RouteComponentProps } from 'react-router-dom';
|
|
3
3
|
interface MatchParams {
|
|
4
4
|
path: string;
|
|
5
5
|
url: string;
|
|
6
6
|
}
|
|
7
|
-
export declare const Lib:
|
|
7
|
+
export declare const Lib: FC<RouteComponentProps<MatchParams>>;
|
|
8
8
|
export {};
|
package/_devel/lib/index.js
CHANGED
|
@@ -1,29 +1,48 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Route, Switch, Link } from 'react-router-dom';
|
|
3
3
|
import { Columns } from '@pushwoosh/kit-helpers';
|
|
4
4
|
import { DynamicContentPickerExample } from './dynamic-content-picker';
|
|
5
5
|
function Example() {
|
|
6
|
-
return
|
|
6
|
+
return _jsx("div", {
|
|
7
|
+
children: _jsx("h3", {
|
|
8
|
+
children: "component example"
|
|
9
|
+
})
|
|
10
|
+
});
|
|
7
11
|
}
|
|
8
12
|
export const Lib = ({
|
|
9
13
|
match
|
|
10
14
|
}) => {
|
|
11
|
-
return
|
|
15
|
+
return _jsxs(Columns, {
|
|
12
16
|
"$gap": 12,
|
|
13
|
-
"$sizes": "200px 780px"
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
17
|
+
"$sizes": "200px 780px",
|
|
18
|
+
children: [_jsxs("ul", {
|
|
19
|
+
children: [_jsx("li", {
|
|
20
|
+
children: _jsx(Link, {
|
|
21
|
+
to: `${match.url}/dynamic-content-picker`,
|
|
22
|
+
children: "Dynamic content picker"
|
|
23
|
+
})
|
|
24
|
+
}), _jsx("li", {
|
|
25
|
+
children: _jsx(Link, {
|
|
26
|
+
to: `${match.url}/example`,
|
|
27
|
+
children: "Child 2"
|
|
28
|
+
})
|
|
29
|
+
})]
|
|
30
|
+
}), _jsx("div", {
|
|
31
|
+
children: _jsxs(Switch, {
|
|
32
|
+
children: [_jsx(Route, {
|
|
33
|
+
path: `${match.path}/dynamic-content-picker`,
|
|
34
|
+
component: DynamicContentPickerExample
|
|
35
|
+
}), _jsx(Route, {
|
|
36
|
+
path: `${match.path}/example`,
|
|
37
|
+
component: Example
|
|
38
|
+
}), _jsx(Route, {
|
|
39
|
+
path: match.path,
|
|
40
|
+
exact: true,
|
|
41
|
+
render: () => _jsx("div", {
|
|
42
|
+
children: "Please select a child route."
|
|
43
|
+
})
|
|
44
|
+
})]
|
|
45
|
+
})
|
|
46
|
+
})]
|
|
47
|
+
});
|
|
29
48
|
};
|
package/_devel/test-place.d.ts
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function TestPlace(): React.JSX.Element;
|
|
1
|
+
export declare function TestPlace(): import("react").JSX.Element;
|
package/_devel/test-place.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
// PLEASE, DON'T COMMIT THIS FILE
|
|
2
3
|
// I is for testing components, you can add your component here to test it
|
|
3
|
-
import React from 'react';
|
|
4
4
|
export function TestPlace() {
|
|
5
|
-
return
|
|
5
|
+
return _jsx("div", {
|
|
6
|
+
children: "add your component to test please, don't commit this file"
|
|
7
|
+
});
|
|
6
8
|
}
|
package/package.json
CHANGED
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"react-router-dom": "^5.3.4"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@pushwoosh/frontend-builder-engine": "^1.0
|
|
36
|
+
"@pushwoosh/frontend-builder-engine": "^2.1.0",
|
|
37
37
|
"@svgr/webpack": "^8.1.0",
|
|
38
38
|
"@types/react": "^18.3.5",
|
|
39
39
|
"@types/react-dom": "^18.3.0",
|
|
@@ -49,5 +49,5 @@
|
|
|
49
49
|
"react": "^16.14.0 || ^18.0.0",
|
|
50
50
|
"react-dom": "^16.14.0 || ^18.0.0"
|
|
51
51
|
},
|
|
52
|
-
"version": "1.0
|
|
52
|
+
"version": "1.1.0"
|
|
53
53
|
}
|