@pushwoosh/smart-components-kit 1.0.90 → 1.1.1

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.
Files changed (65) hide show
  1. package/CampaignsConfigurationDrawer/CampaignsConfigurationDrawer.d.ts +1 -2
  2. package/CampaignsConfigurationDrawer/CampaignsConfigurationDrawer.js +103 -88
  3. package/CampaignsConfigurationDrawer/components/Card/Card.d.ts +1 -2
  4. package/CampaignsConfigurationDrawer/components/Card/Card.js +19 -13
  5. package/DocsButton/DocsButton.d.ts +1 -2
  6. package/DocsButton/DocsButton.js +21 -18
  7. package/DynamicContentPicker/DynamicContentPicker.js +76 -63
  8. package/DynamicContentPicker/Line.js +24 -22
  9. package/DynamicContentPickerForm/DynamicContentCustomPickerForm.js +18 -17
  10. package/DynamicContentPickerForm/DynamicContentEventPickerForm.js +60 -57
  11. package/DynamicContentPickerForm/DynamicContentTagPickerForm.js +60 -57
  12. package/DynamicContentPickerForm/SimpleDynamicContentPickerFormSmart.js +72 -63
  13. package/DynamicContentPickerForm/VariedDynamicContentPickerFormSmart.js +86 -74
  14. package/EmailTemplatePreview/EmailTemplatePreview.js +8 -6
  15. package/ExportCSV/ExportCsvBanner/ExportCsvBanner.d.ts +1 -2
  16. package/ExportCSV/ExportCsvBanner/ExportCsvBanner.js +54 -49
  17. package/ExportCSV/useExportService/useExportService.js +1 -0
  18. package/LanguagesSelector/LanguagesModal.js +38 -24
  19. package/LanguagesSelector/LanguagesSelectForm.js +73 -62
  20. package/LanguagesSelector/LanguagesSelectFormLoader.js +8 -7
  21. package/LanguagesSelector/LanguagesSelector.js +92 -78
  22. package/MediaStore/CreateVariantDrawer.js +134 -85
  23. package/MediaStore/MediaStore.d.ts +6 -10
  24. package/MediaStore/MediaStore.js +201 -161
  25. package/MediaStore/MediaStorePaginated.d.ts +8 -0
  26. package/MediaStore/MediaStorePaginated.js +24 -0
  27. package/MediaStore/index.d.ts +3 -1
  28. package/MediaStore/index.js +2 -1
  29. package/MediaStore/types.d.ts +22 -0
  30. package/MediaStore/types.js +1 -0
  31. package/ModalCloningJourney/ModalCloningJourney.d.ts +1 -2
  32. package/ModalCloningJourney/ModalCloningJourney.js +113 -91
  33. package/OpenActions/components/OpenActionsSummary/OpenActionsSummary.d.ts +1 -2
  34. package/OpenActions/components/OpenActionsSummary/OpenActionsSummary.js +98 -78
  35. package/OpenActions/components/OpenActionsSummaryByPreset.d.ts +1 -2
  36. package/OpenActions/components/OpenActionsSummaryByPreset.js +2 -2
  37. package/PlatformsConfigurationDrawer/PlatformsConfigurationDrawer.js +21 -17
  38. package/PlatformsConfigurationDrawer/components/DesktopPage/DesktopPage.js +112 -75
  39. package/PlatformsConfigurationDrawer/components/MainPage/MainPage.js +155 -101
  40. package/PlatformsConfigurationDrawer/components/MobilePage/MobilePage.js +138 -91
  41. package/ResendModal/ResendModal.d.ts +1 -2
  42. package/ResendModal/ResendModal.js +92 -72
  43. package/RichMessageEditorSmart/NewDynamicContentForm.js +16 -12
  44. package/RichMessageEditorSmart/RichMessageEditorSmart.js +4 -4
  45. package/SystemParcel/SystemParcel.d.ts +3 -3
  46. package/SystemParcel/SystemParcel.js +3 -2
  47. package/Table/components/DataTable/DataTable.js +80 -61
  48. package/Table/components/DataTableGetContext/DataTableGetContext.d.ts +1 -2
  49. package/Table/components/DataTableGetContext/DataTableGetContext.js +5 -2
  50. package/Table/components/DataTableList/DataTableList.d.ts +1 -2
  51. package/Table/components/DataTableList/DataTableList.js +86 -68
  52. package/Table/components/DataTablePagination/DataTablePagination.js +6 -4
  53. package/Table/components/DataTableSearchInput/DataTableSearchInput.js +3 -2
  54. package/Table/components/DataTableSortableCell/DataTableSortableCell.js +6 -4
  55. package/Table/components/Loading/Loading.d.ts +1 -2
  56. package/Table/components/Loading/Loading.js +16 -14
  57. package/Table/components/TablePagination/TablePagination.js +31 -25
  58. package/_devel/index.js +36 -24
  59. package/_devel/lib/dynamic-content-picker.d.ts +1 -2
  60. package/_devel/lib/dynamic-content-picker.js +16 -10
  61. package/_devel/lib/index.d.ts +2 -2
  62. package/_devel/lib/index.js +38 -19
  63. package/_devel/test-place.d.ts +1 -2
  64. package/_devel/test-place.js +4 -2
  65. package/package.json +2 -2
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Button, Spinner } from '@pushwoosh/dumb-components';
3
3
  import { Color } from '@pushwoosh/kit-constants';
4
4
  import { Horizontal } from '@pushwoosh/kit-helpers';
@@ -41,64 +41,83 @@ export function DataTable(props) {
41
41
  search: ''
42
42
  }));
43
43
  };
44
- return React.createElement(DataTableContext.Provider, {
45
- value: context
46
- }, React.createElement(Table, {
47
- columns: columns,
48
- width: width,
49
- isBordered: isBordered,
50
- "$bgColor": bgColor
51
- }, renderTableTop === null || renderTableTop === void 0 ? void 0 : renderTableTop(context), 'renderHead' in props && props.renderHead(), 'renderList' in props ? props.renderList(context) : React.createElement(DataTableList, {
52
- renderItem: props.renderItem
53
- }), !hidePagination && React.createElement(DataTablePagination, {
54
- allLimits: allLimits ?? [10, 20, 50, 100],
55
- padding: paginationPadding,
56
- hidePageSizeSelector: hidePageSizeSelector
57
- }, data.loading && React.createElement(Horizontal, {
58
- "$alignItems": "center",
59
- "$gap": 4
60
- }, React.createElement(Spinner, {
61
- size: "medium",
62
- color: Color.LOCKED
63
- }), React.createElement(LockedText, null, lang({
64
- message: 'SMART.TABLE.LOADING'
65
- }))), !data.loading && data.error && React.createElement(Horizontal, {
66
- "$alignItems": "center",
67
- "$gap": 4
68
- }, React.createElement(WarningRoundIcon, {
69
- size: "medium",
70
- view: "lined",
71
- color: Color.WARNING
72
- }), React.createElement(Text, {
73
- "$color": Color.WARNING
74
- }, lang({
75
- message: 'SMART.TABLE.REQUEST_FAILED'
76
- }))), !data.loading && !data.error && (((_data$value2 = data.value) === null || _data$value2 === void 0 ? void 0 : _data$value2.total) ?? 0) > 0 && React.createElement(Horizontal, {
77
- "$placeItems": "center",
78
- "$gap": 4
79
- }, lang({
80
- message: 'SMART.TABLE.RESULT_LABEL'
81
- }), React.createElement(LockedText, null, lang({
82
- message: 'SMART.TABLE.RESULT_COUNT',
83
- total: ((_data$value3 = data.value) === null || _data$value3 === void 0 ? void 0 : _data$value3.total) ?? 0
84
- }))), !data.loading && !data.error && (((_data$value4 = data.value) === null || _data$value4 === void 0 ? void 0 : _data$value4.total) ?? 0) === 0 && !isFiltered && React.createElement(Horizontal, {
85
- "$placeItems": "center"
86
- }, React.createElement(LockedText, null, lang({
87
- message: 'SMART.TABLE.NO_ITEMS'
88
- }))), !data.loading && isFiltered && React.createElement(Horizontal, {
89
- "$gap": 16
90
- }, !data.error && (((_data$value5 = data.value) === null || _data$value5 === void 0 || (_data$value5 = _data$value5.items) === null || _data$value5 === void 0 ? void 0 : _data$value5.length) ?? 0) === 0 && React.createElement(Horizontal, {
91
- "$placeItems": "center",
92
- "$gap": 4
93
- }, lang({
94
- message: 'SMART.TABLE.RESULT_LABEL'
95
- }), React.createElement(LockedText, null, lang({
96
- message: 'SMART.TABLE.NO_MATCH'
97
- }))), React.createElement(Button, {
98
- color: "primary",
99
- view: "ghost",
100
- onClick: onClearRequest ?? onClearRequestDefault
101
- }, lang({
102
- message: 'SMART.TABLE.CLEAR_REQUEST'
103
- }))))), renderAfter === null || renderAfter === void 0 ? void 0 : renderAfter(context));
44
+ return _jsxs(DataTableContext.Provider, {
45
+ value: context,
46
+ children: [_jsxs(Table, {
47
+ columns: columns,
48
+ width: width,
49
+ isBordered: isBordered,
50
+ "$bgColor": bgColor,
51
+ children: [renderTableTop === null || renderTableTop === void 0 ? void 0 : renderTableTop(context), 'renderHead' in props && props.renderHead(), 'renderList' in props ? props.renderList(context) : _jsx(DataTableList, {
52
+ renderItem: props.renderItem
53
+ }), !hidePagination && _jsxs(DataTablePagination, {
54
+ allLimits: allLimits ?? [10, 20, 50, 100],
55
+ padding: paginationPadding,
56
+ hidePageSizeSelector: hidePageSizeSelector,
57
+ children: [data.loading && _jsxs(Horizontal, {
58
+ "$alignItems": "center",
59
+ "$gap": 4,
60
+ children: [_jsx(Spinner, {
61
+ size: "medium",
62
+ color: Color.LOCKED
63
+ }), _jsx(LockedText, {
64
+ children: lang({
65
+ message: 'SMART.TABLE.LOADING'
66
+ })
67
+ })]
68
+ }), !data.loading && data.error && _jsxs(Horizontal, {
69
+ "$alignItems": "center",
70
+ "$gap": 4,
71
+ children: [_jsx(WarningRoundIcon, {
72
+ size: "medium",
73
+ view: "lined",
74
+ color: Color.WARNING
75
+ }), _jsx(Text, {
76
+ "$color": Color.WARNING,
77
+ children: lang({
78
+ message: 'SMART.TABLE.REQUEST_FAILED'
79
+ })
80
+ })]
81
+ }), !data.loading && !data.error && (((_data$value2 = data.value) === null || _data$value2 === void 0 ? void 0 : _data$value2.total) ?? 0) > 0 && _jsxs(Horizontal, {
82
+ "$placeItems": "center",
83
+ "$gap": 4,
84
+ children: [lang({
85
+ message: 'SMART.TABLE.RESULT_LABEL'
86
+ }), _jsx(LockedText, {
87
+ children: lang({
88
+ message: 'SMART.TABLE.RESULT_COUNT',
89
+ total: ((_data$value3 = data.value) === null || _data$value3 === void 0 ? void 0 : _data$value3.total) ?? 0
90
+ })
91
+ })]
92
+ }), !data.loading && !data.error && (((_data$value4 = data.value) === null || _data$value4 === void 0 ? void 0 : _data$value4.total) ?? 0) === 0 && !isFiltered && _jsx(Horizontal, {
93
+ "$placeItems": "center",
94
+ children: _jsx(LockedText, {
95
+ children: lang({
96
+ message: 'SMART.TABLE.NO_ITEMS'
97
+ })
98
+ })
99
+ }), !data.loading && isFiltered && _jsxs(Horizontal, {
100
+ "$gap": 16,
101
+ children: [!data.error && (((_data$value5 = data.value) === null || _data$value5 === void 0 || (_data$value5 = _data$value5.items) === null || _data$value5 === void 0 ? void 0 : _data$value5.length) ?? 0) === 0 && _jsxs(Horizontal, {
102
+ "$placeItems": "center",
103
+ "$gap": 4,
104
+ children: [lang({
105
+ message: 'SMART.TABLE.RESULT_LABEL'
106
+ }), _jsx(LockedText, {
107
+ children: lang({
108
+ message: 'SMART.TABLE.NO_MATCH'
109
+ })
110
+ })]
111
+ }), _jsx(Button, {
112
+ color: "primary",
113
+ view: "ghost",
114
+ onClick: onClearRequest ?? onClearRequestDefault,
115
+ children: lang({
116
+ message: 'SMART.TABLE.CLEAR_REQUEST'
117
+ })
118
+ })]
119
+ })]
120
+ })]
121
+ }), renderAfter === null || renderAfter === void 0 ? void 0 : renderAfter(context)]
122
+ });
104
123
  }
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
1
  import type { DataGetContextProps } from './types';
3
2
  import type { DataTableContextType } from '../../types';
4
- export declare const DataTableGetContext: <C extends DataTableContextType<any, any>>({ children }: DataGetContextProps<C>) => React.JSX.Element;
3
+ export declare const DataTableGetContext: <C extends DataTableContextType<any, any>>({ children }: DataGetContextProps<C>) => import("react").JSX.Element;
@@ -1,8 +1,11 @@
1
- import React, { useContext } from 'react';
1
+ import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
2
+ import { useContext } from 'react';
2
3
  import { DataTableContext } from '../../context';
3
4
  export const DataTableGetContext = ({
4
5
  children
5
6
  }) => {
6
7
  const ctxValue = useContext(DataTableContext);
7
- return React.createElement(React.Fragment, null, children(ctxValue));
8
+ return _jsx(_Fragment, {
9
+ children: children(ctxValue)
10
+ });
8
11
  };
@@ -1,3 +1,2 @@
1
- import React from 'react';
2
1
  import type { DataTableListProps } from './types';
3
- export declare function DataTableList<T>({ renderItem }: DataTableListProps<T>): React.JSX.Element;
2
+ export declare function DataTableList<T>({ renderItem }: DataTableListProps<T>): import("react").JSX.Element;
@@ -1,4 +1,5 @@
1
- import React, { useContext } from 'react';
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 React.createElement(Loading, null);
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 React.createElement(React.Fragment, null, data.value.items.map(renderItem));
25
+ return _jsx(_Fragment, {
26
+ children: data.value.items.map(renderItem)
27
+ });
25
28
  }
26
29
  if (!data.loading && data.error) {
27
- return React.createElement(Horizontal, {
30
+ return _jsx(Horizontal, {
28
31
  "$placeItems": "center",
29
- "$padding": 64
30
- }, React.createElement(Horizontal, {
31
- "$gap": 16
32
- }, React.createElement("img", {
33
- src: Error,
34
- alt: lang({
35
- message: 'SMART.TABLE.ERROR_IMG_ALT'
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
- }), React.createElement(Vertical, {
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 ? React.createElement(Horizontal, {
61
+ return isFiltered ? _jsx(Horizontal, {
54
62
  "$placeItems": "center",
55
- "$padding": 64
56
- }, React.createElement(Horizontal, {
57
- "$gap": 16
58
- }, React.createElement("img", {
59
- src: NotFound,
60
- alt: lang({
61
- message: 'SMART.TABLE.NO_MATCH_IMG_ALT'
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
- }), React.createElement(Vertical, {
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
- }, React.createElement(Horizontal, {
80
- "$gap": 16
81
- }, React.createElement("img", {
82
- src: Box,
83
- alt: lang({
84
- message: 'SMART.TABLE.EMPTY_IMG_ALT'
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
- }), React.createElement(Vertical, {
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 React, { useContext } from 'react';
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 React.createElement(TablePagination, {
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
- }, children);
36
+ hidePageSizeSelector: hidePageSizeSelector,
37
+ children: children
38
+ });
37
39
  }
@@ -1,4 +1,5 @@
1
- import React, { useRef, useState, useEffect, useContext } from 'react';
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 React.createElement(SearchInput, {
14
+ return _jsx(SearchInput, {
14
15
  ...props,
15
16
  value: inputValue,
16
17
  "$onClear": () => {
@@ -1,4 +1,5 @@
1
- import React, { useContext } from 'react';
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 React.createElement(SortButton, {
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
- }, children);
24
+ },
25
+ children: children
26
+ });
25
27
  }
@@ -1,2 +1 @@
1
- import React from 'react';
2
- export declare const Loading: () => React.JSX.Element;
1
+ export declare const Loading: () => import("react").JSX.Element;
@@ -1,20 +1,22 @@
1
- import React from 'react';
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
- }) => React.createElement(Horizontal, {
7
+ }) => _jsx(Horizontal, {
8
8
  "$alignItems": "center",
9
- "$padding": "0 24px"
10
- }, React.createElement(TextSkeleton, {
11
- width: width
12
- }));
13
- export const Loading = () => React.createElement(Wrapper, null, Array.from({
14
- length: 4
15
- }).map((_, index) =>
16
- // eslint-disable-next-line react/no-array-index-key
17
- React.createElement(Row, {
18
- key: index,
19
- width: `${index % 2 ? 35 : 50}%`
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 React from 'react';
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 React.createElement(Horizontal, {
17
+ return _jsxs(Horizontal, {
18
18
  "$alignItems": "center",
19
19
  "$justifyContent": "space-between",
20
- "$padding": padding
21
- }, React.createElement(Horizontal, {
22
- "$gap": 8,
23
- "$alignItems": "center"
24
- }, totalPages > 1 && React.createElement(Pagination, {
25
- activePage: activePage,
26
- totalPages: totalPages,
27
- onChangePage: onChangePage
28
- }), children), !hidePageSizeSelector && React.createElement(Horizontal, {
29
- "$gap": 8,
30
- "$alignItems": "center"
31
- }, React.createElement("span", null, lang({
32
- message: 'SMART.TABLE.SHOW_ON_PAGE'
33
- })), React.createElement(NativeSelect, {
34
- name: "page",
35
- value: limit,
36
- onChange: event => {
37
- onChangeLimit(Number(event.target.value));
38
- }
39
- }, allLimits.map(option => React.createElement("option", {
40
- key: option,
41
- value: option
42
- }, option)))));
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 React from 'react';
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(React.createElement(Router, {
12
- history: props.spaContext.history
13
- }, React.createElement(SPAContextProvider, {
14
- value: props.spaContext
15
- }, React.createElement(Switch, null, React.createElement(Route, {
16
- path: "/:url",
17
- exact: true,
18
- render: ({
19
- match
20
- }) => {
21
- return React.createElement("ul", null, React.createElement("li", null, React.createElement(Link, {
22
- to: `${match.url}/test`
23
- }, "Test your new component")), React.createElement("li", null, React.createElement(Link, {
24
- to: `${match.url}/lib`
25
- }, "Components lib")));
26
- }
27
- }), React.createElement(Route, {
28
- path: "/:url/test",
29
- component: TestPlace
30
- }), React.createElement(Route, {
31
- path: "/:url/lib",
32
- component: Lib
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
- import React from 'react';
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 React, { useState } from 'react';
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 React.createElement("div", null, React.createElement(SimpleDynamicContentPickerFormSmart, {
9
- dc: dc,
10
- onChange: setDc
11
- }, React.createElement(Horizontal, {
12
- "$justifyContent": "end"
13
- }, React.createElement(Button, {
14
- color: "primary",
15
- onClick: () => console.log(dc)
16
- }, "Log to console"))));
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
  }