@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.
Files changed (114) hide show
  1. package/CampaignsConfigurationDrawer/CampaignsConfigurationDrawer.d.ts +1 -2
  2. package/CampaignsConfigurationDrawer/CampaignsConfigurationDrawer.js +105 -56
  3. package/CampaignsConfigurationDrawer/components/Card/Card.d.ts +1 -2
  4. package/CampaignsConfigurationDrawer/components/Card/Card.js +19 -13
  5. package/CampaignsConfigurationDrawer/polyglot/index.d.ts +2 -0
  6. package/CampaignsConfigurationDrawer/polyglot/index.js +10 -0
  7. package/CampaignsConfigurationDrawer/polyglot/messages_en.d.ts +3 -0
  8. package/CampaignsConfigurationDrawer/polyglot/messages_en.js +18 -0
  9. package/CampaignsConfigurationDrawer/polyglot/messages_ru.d.ts +3 -0
  10. package/CampaignsConfigurationDrawer/polyglot/messages_ru.js +18 -0
  11. package/CampaignsConfigurationDrawer/polyglot/types.d.ts +19 -0
  12. package/CampaignsConfigurationDrawer/polyglot/types.js +1 -0
  13. package/DocsButton/DocsButton.d.ts +1 -2
  14. package/DocsButton/DocsButton.js +21 -18
  15. package/DynamicContentPicker/DynamicContentPicker.js +76 -63
  16. package/DynamicContentPicker/Line.js +24 -22
  17. package/DynamicContentPickerForm/DynamicContentCustomPickerForm.js +20 -15
  18. package/DynamicContentPickerForm/DynamicContentEventPickerForm.js +62 -51
  19. package/DynamicContentPickerForm/DynamicContentTagPickerForm.js +62 -51
  20. package/DynamicContentPickerForm/SimpleDynamicContentPickerFormSmart.js +74 -59
  21. package/DynamicContentPickerForm/VariedDynamicContentPickerFormSmart.js +104 -78
  22. package/DynamicContentPickerForm/polyglot/index.d.ts +2 -0
  23. package/DynamicContentPickerForm/polyglot/index.js +10 -0
  24. package/DynamicContentPickerForm/polyglot/messages_en.d.ts +3 -0
  25. package/DynamicContentPickerForm/polyglot/messages_en.js +16 -0
  26. package/DynamicContentPickerForm/polyglot/messages_ru.d.ts +3 -0
  27. package/DynamicContentPickerForm/polyglot/messages_ru.js +16 -0
  28. package/DynamicContentPickerForm/polyglot/types.d.ts +17 -0
  29. package/DynamicContentPickerForm/polyglot/types.js +1 -0
  30. package/EmailTemplatePreview/EmailTemplatePreview.js +10 -4
  31. package/EmailTemplatePreview/polyglot/index.d.ts +5 -0
  32. package/EmailTemplatePreview/polyglot/index.js +10 -0
  33. package/EmailTemplatePreview/polyglot/messages_en.d.ts +3 -0
  34. package/EmailTemplatePreview/polyglot/messages_en.js +3 -0
  35. package/EmailTemplatePreview/polyglot/messages_ru.d.ts +3 -0
  36. package/EmailTemplatePreview/polyglot/messages_ru.js +3 -0
  37. package/EmailTemplatePreview/polyglot/types.d.ts +4 -0
  38. package/EmailTemplatePreview/polyglot/types.js +1 -0
  39. package/ExportCSV/ExportCsvBanner/ExportCsvBanner.d.ts +1 -2
  40. package/ExportCSV/ExportCsvBanner/ExportCsvBanner.js +63 -42
  41. package/ExportCSV/polyglot/index.d.ts +2 -0
  42. package/ExportCSV/polyglot/index.js +10 -0
  43. package/ExportCSV/polyglot/messages_en.d.ts +3 -0
  44. package/ExportCSV/polyglot/messages_en.js +9 -0
  45. package/ExportCSV/polyglot/messages_ru.d.ts +3 -0
  46. package/ExportCSV/polyglot/messages_ru.js +9 -0
  47. package/ExportCSV/polyglot/types.d.ts +10 -0
  48. package/ExportCSV/polyglot/types.js +1 -0
  49. package/ExportCSV/useExportService/useExportService.js +1 -0
  50. package/LanguagesSelector/LanguagesModal.js +38 -24
  51. package/LanguagesSelector/LanguagesSelectForm.js +73 -62
  52. package/LanguagesSelector/LanguagesSelectFormLoader.js +8 -7
  53. package/LanguagesSelector/LanguagesSelector.js +92 -78
  54. package/MediaStore/CreateVariantDrawer.js +134 -85
  55. package/MediaStore/MediaStore.js +137 -112
  56. package/ModalCloningJourney/ModalCloningJourney.d.ts +1 -2
  57. package/ModalCloningJourney/ModalCloningJourney.js +113 -91
  58. package/OpenActions/components/OpenActionsSummary/OpenActionsSummary.d.ts +1 -2
  59. package/OpenActions/components/OpenActionsSummary/OpenActionsSummary.js +101 -37
  60. package/OpenActions/components/OpenActionsSummaryByPreset.d.ts +1 -2
  61. package/OpenActions/components/OpenActionsSummaryByPreset.js +2 -2
  62. package/OpenActions/polyglot/index.d.ts +2 -0
  63. package/OpenActions/polyglot/index.js +10 -0
  64. package/OpenActions/polyglot/messages_en.d.ts +3 -0
  65. package/OpenActions/polyglot/messages_en.js +14 -0
  66. package/OpenActions/polyglot/messages_ru.d.ts +3 -0
  67. package/OpenActions/polyglot/messages_ru.js +14 -0
  68. package/OpenActions/polyglot/types.d.ts +18 -0
  69. package/OpenActions/polyglot/types.js +1 -0
  70. package/PlatformsConfigurationDrawer/PlatformsConfigurationDrawer.js +21 -17
  71. package/PlatformsConfigurationDrawer/components/DesktopPage/DesktopPage.js +114 -57
  72. package/PlatformsConfigurationDrawer/components/MainPage/MainPage.js +157 -75
  73. package/PlatformsConfigurationDrawer/components/MobilePage/MobilePage.js +140 -69
  74. package/PlatformsConfigurationDrawer/polyglot/index.d.ts +2 -0
  75. package/PlatformsConfigurationDrawer/polyglot/index.js +10 -0
  76. package/PlatformsConfigurationDrawer/polyglot/messages_en.d.ts +3 -0
  77. package/PlatformsConfigurationDrawer/polyglot/messages_en.js +24 -0
  78. package/PlatformsConfigurationDrawer/polyglot/messages_ru.d.ts +3 -0
  79. package/PlatformsConfigurationDrawer/polyglot/messages_ru.js +24 -0
  80. package/PlatformsConfigurationDrawer/polyglot/types.d.ts +25 -0
  81. package/PlatformsConfigurationDrawer/polyglot/types.js +1 -0
  82. package/ResendModal/ResendModal.d.ts +1 -2
  83. package/ResendModal/ResendModal.js +95 -59
  84. package/ResendModal/polyglot/index.d.ts +2 -0
  85. package/ResendModal/polyglot/index.js +10 -0
  86. package/ResendModal/polyglot/messages_en.d.ts +3 -0
  87. package/ResendModal/polyglot/messages_en.js +9 -0
  88. package/ResendModal/polyglot/messages_ru.d.ts +3 -0
  89. package/ResendModal/polyglot/messages_ru.js +9 -0
  90. package/ResendModal/polyglot/types.d.ts +10 -0
  91. package/ResendModal/polyglot/types.js +1 -0
  92. package/RichMessageEditorSmart/NewDynamicContentForm.js +16 -12
  93. package/RichMessageEditorSmart/RichMessageEditorSmart.js +4 -4
  94. package/SystemParcel/SystemParcel.d.ts +3 -3
  95. package/SystemParcel/SystemParcel.js +3 -2
  96. package/Table/components/DataTable/DataTable.js +80 -61
  97. package/Table/components/DataTableGetContext/DataTableGetContext.d.ts +1 -2
  98. package/Table/components/DataTableGetContext/DataTableGetContext.js +5 -2
  99. package/Table/components/DataTableList/DataTableList.d.ts +1 -2
  100. package/Table/components/DataTableList/DataTableList.js +86 -68
  101. package/Table/components/DataTablePagination/DataTablePagination.js +6 -4
  102. package/Table/components/DataTableSearchInput/DataTableSearchInput.js +3 -2
  103. package/Table/components/DataTableSortableCell/DataTableSortableCell.js +6 -4
  104. package/Table/components/Loading/Loading.d.ts +1 -2
  105. package/Table/components/Loading/Loading.js +16 -14
  106. package/Table/components/TablePagination/TablePagination.js +31 -25
  107. package/_devel/index.js +36 -24
  108. package/_devel/lib/dynamic-content-picker.d.ts +1 -2
  109. package/_devel/lib/dynamic-content-picker.js +16 -10
  110. package/_devel/lib/index.d.ts +2 -2
  111. package/_devel/lib/index.js +38 -19
  112. package/_devel/test-place.d.ts +1 -2
  113. package/_devel/test-place.js +4 -2
  114. package/package.json +2 -2
@@ -1,4 +1,5 @@
1
- import React, { useCallback, useEffect, useMemo } from 'react';
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useCallback, useEffect, useMemo } from 'react';
2
3
  import { Controller, useForm } from 'react-hook-form';
3
4
  import { Button, FieldBox, Modal, ModalBody, ModalFooter, ModalHeader, ModalTitle, NativeInput } from '@pushwoosh/dumb-components';
4
5
  import { Color } from '@pushwoosh/kit-constants';
@@ -8,6 +9,7 @@ import { Paragraph, Text } from '@pushwoosh/kit-typography';
8
9
  import { useSPAContext } from '@pushwoosh/spa-context';
9
10
  import { parseMessageProperties } from './hooks/helpers';
10
11
  import { useResend } from './hooks/useResend';
12
+ import { useLang } from './polyglot';
11
13
  export const ResendModal = ({
12
14
  isOpen,
13
15
  onClose,
@@ -15,6 +17,7 @@ export const ResendModal = ({
15
17
  message,
16
18
  emailTemplate: providedEmailTemplate
17
19
  }) => {
20
+ const lang = useLang();
18
21
  const {
19
22
  history,
20
23
  rpcGateway
@@ -116,65 +119,98 @@ export const ResendModal = ({
116
119
  }
117
120
  }, [applicationCode, message, onClose, presetSubject, resendEmail]);
118
121
  if (!message) return null;
119
- return React.createElement(Modal, {
122
+ return _jsxs(Modal, {
120
123
  size: "medium",
121
124
  isOpen: isOpen,
122
- onClose: onClose
123
- }, React.createElement(ModalHeader, null, React.createElement(ModalTitle, null, "Resend to non-openers")), React.createElement(ModalBody, null, React.createElement(Vertical, {
124
- "$gap": 16
125
- }, React.createElement(Paragraph, null, "This action will send a one-time email campaign to recipients who didn't open the original message. The subject above will be used. Before resending, you can edit the campaign if needed."), React.createElement(Controller, {
126
- control: control,
127
- name: "presetSubject",
128
- rules: {
129
- required: 'This field cannot be empty'
130
- },
131
- render: ({
132
- field,
133
- fieldState
134
- }) => {
135
- var _fieldState$error;
136
- return React.createElement(FieldBox, {
137
- title: "subject LINE",
138
- error: !!fieldState.error && React.createElement(Text, {
139
- "$color": Color.DANGER
140
- }, (_fieldState$error = fieldState.error) === null || _fieldState$error === void 0 ? void 0 : _fieldState$error.message)
141
- }, React.createElement(NativeInput, {
142
- value: field.value ?? '',
143
- disabled: isMultilanguage,
144
- "$isErrored": fieldState.invalid,
145
- name: field.name,
146
- onChange: ({
147
- target: {
148
- value
125
+ onClose: onClose,
126
+ children: [_jsx(ModalHeader, {
127
+ children: _jsx(ModalTitle, {
128
+ children: lang({
129
+ message: 'SMART.RESEND_MODAL.TITLE'
130
+ })
131
+ })
132
+ }), _jsx(ModalBody, {
133
+ children: _jsxs(Vertical, {
134
+ "$gap": 16,
135
+ children: [_jsx(Paragraph, {
136
+ children: lang({
137
+ message: 'SMART.RESEND_MODAL.DESCRIPTION'
138
+ })
139
+ }), _jsx(Controller, {
140
+ control: control,
141
+ name: "presetSubject",
142
+ rules: {
143
+ required: lang({
144
+ message: 'SMART.RESEND_MODAL.ERROR.SUBJECT_REQUIRED'
145
+ })
146
+ },
147
+ render: ({
148
+ field,
149
+ fieldState
150
+ }) => {
151
+ var _fieldState$error;
152
+ return _jsx(FieldBox, {
153
+ title: lang({
154
+ message: 'SMART.RESEND_MODAL.FIELD.SUBJECT'
155
+ }),
156
+ error: !!fieldState.error && _jsx(Text, {
157
+ "$color": Color.DANGER,
158
+ children: (_fieldState$error = fieldState.error) === null || _fieldState$error === void 0 ? void 0 : _fieldState$error.message
159
+ }),
160
+ children: _jsx(NativeInput, {
161
+ value: field.value ?? '',
162
+ disabled: isMultilanguage,
163
+ "$isErrored": fieldState.invalid,
164
+ name: field.name,
165
+ onChange: ({
166
+ target: {
167
+ value
168
+ }
169
+ }) => {
170
+ if (value) {
171
+ clearErrors('presetSubject');
172
+ }
173
+ field.onChange(value);
174
+ }
175
+ })
176
+ });
149
177
  }
150
- }) => {
151
- if (value) {
152
- clearErrors('presetSubject');
153
- }
154
- field.onChange(value);
155
- }
156
- }));
157
- }
158
- }))), React.createElement(ModalFooter, null, React.createElement(Horizontal, {
159
- "$justifyContent": "space-between"
160
- }, React.createElement(Button, {
161
- color: "secondary",
162
- icon: React.createElement(EditIcon, {
163
- size: "medium",
164
- view: "lined"
165
- }),
166
- onClick: handleSubmit(() => {
167
- history.push(editMessageUrl);
168
- })
169
- }, "Edit before resend"), React.createElement(Horizontal, {
170
- "$gap": 8
171
- }, React.createElement(Button, {
172
- color: "secondary",
173
- onClick: onClose
174
- }, "Cancel"), React.createElement(Button, {
175
- color: "primary",
176
- onClick: handleSubmit(() => {
177
- handleResend();
178
- })
179
- }, "Resend now")))));
178
+ })]
179
+ })
180
+ }), _jsx(ModalFooter, {
181
+ children: _jsxs(Horizontal, {
182
+ "$justifyContent": "space-between",
183
+ children: [_jsx(Button, {
184
+ color: "secondary",
185
+ icon: _jsx(EditIcon, {
186
+ size: "medium",
187
+ view: "lined"
188
+ }),
189
+ onClick: handleSubmit(() => {
190
+ history.push(editMessageUrl);
191
+ }),
192
+ children: lang({
193
+ message: 'SMART.RESEND_MODAL.BUTTON.EDIT'
194
+ })
195
+ }), _jsxs(Horizontal, {
196
+ "$gap": 8,
197
+ children: [_jsx(Button, {
198
+ color: "secondary",
199
+ onClick: onClose,
200
+ children: lang({
201
+ message: 'SMART.RESEND_MODAL.BUTTON.CANCEL'
202
+ })
203
+ }), _jsx(Button, {
204
+ color: "primary",
205
+ onClick: handleSubmit(() => {
206
+ handleResend();
207
+ }),
208
+ children: lang({
209
+ message: 'SMART.RESEND_MODAL.BUTTON.RESEND'
210
+ })
211
+ })]
212
+ })]
213
+ })
214
+ })]
215
+ });
180
216
  };
@@ -0,0 +1,2 @@
1
+ import { type ResendModalMessages } from './types';
2
+ export declare const Lang: import("react").FC<import("@pushwoosh/dumb-components/polyglot").LangProps<ResendModalMessages>>, useLang: () => (props: import("@pushwoosh/dumb-components/polyglot").LangProps<ResendModalMessages>) => string;
@@ -0,0 +1,10 @@
1
+ import { createLang } from '@pushwoosh/dumb-components/polyglot';
2
+ import { messages as en } from './messages_en';
3
+ import { messages as ru } from './messages_ru';
4
+ export const {
5
+ Lang,
6
+ useLang
7
+ } = createLang({
8
+ en,
9
+ ru
10
+ });
@@ -0,0 +1,3 @@
1
+ import type { LangMessages } from '@pushwoosh/dumb-components/polyglot';
2
+ import { type ResendModalMessages } from './types';
3
+ export declare const messages: LangMessages<ResendModalMessages>;
@@ -0,0 +1,9 @@
1
+ export const messages = {
2
+ 'SMART.RESEND_MODAL.TITLE': 'Resend to non-openers',
3
+ 'SMART.RESEND_MODAL.DESCRIPTION': 'This action will send a one-time email campaign to recipients who didn’t open the original message. The subject above will be used. Before resending, you can edit the campaign if needed.',
4
+ 'SMART.RESEND_MODAL.FIELD.SUBJECT': 'subject LINE',
5
+ 'SMART.RESEND_MODAL.ERROR.SUBJECT_REQUIRED': 'This field cannot be empty',
6
+ 'SMART.RESEND_MODAL.BUTTON.EDIT': 'Edit before resend',
7
+ 'SMART.RESEND_MODAL.BUTTON.CANCEL': 'Cancel',
8
+ 'SMART.RESEND_MODAL.BUTTON.RESEND': 'Resend now'
9
+ };
@@ -0,0 +1,3 @@
1
+ import type { LangMessages } from '@pushwoosh/dumb-components/polyglot';
2
+ import { type ResendModalMessages } from './types';
3
+ export declare const messages: LangMessages<ResendModalMessages>;
@@ -0,0 +1,9 @@
1
+ export const messages = {
2
+ 'SMART.RESEND_MODAL.TITLE': 'Повторная отправка не открывшим',
3
+ 'SMART.RESEND_MODAL.DESCRIPTION': 'Это действие отправит разовую email-кампанию получателям, которые не открыли исходное сообщение. Будет использована тема, указанная выше. Перед повторной отправкой кампанию можно отредактировать.',
4
+ 'SMART.RESEND_MODAL.FIELD.SUBJECT': 'тема письма',
5
+ 'SMART.RESEND_MODAL.ERROR.SUBJECT_REQUIRED': 'Поле не может быть пустым',
6
+ 'SMART.RESEND_MODAL.BUTTON.EDIT': 'Изменить перед отправкой',
7
+ 'SMART.RESEND_MODAL.BUTTON.CANCEL': 'Отмена',
8
+ 'SMART.RESEND_MODAL.BUTTON.RESEND': 'Отправить сейчас'
9
+ };
@@ -0,0 +1,10 @@
1
+ import type { NoParams } from '@pushwoosh/dumb-components/polyglot';
2
+ export type ResendModalMessages = {
3
+ 'SMART.RESEND_MODAL.TITLE': NoParams;
4
+ 'SMART.RESEND_MODAL.DESCRIPTION': NoParams;
5
+ 'SMART.RESEND_MODAL.FIELD.SUBJECT': NoParams;
6
+ 'SMART.RESEND_MODAL.ERROR.SUBJECT_REQUIRED': NoParams;
7
+ 'SMART.RESEND_MODAL.BUTTON.EDIT': NoParams;
8
+ 'SMART.RESEND_MODAL.BUTTON.CANCEL': NoParams;
9
+ 'SMART.RESEND_MODAL.BUTTON.RESEND': NoParams;
10
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,5 @@
1
- import React, { useState } from 'react';
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useState } from 'react';
2
3
  import { Button } from '@pushwoosh/dumb-components';
3
4
  import { Horizontal } from '@pushwoosh/kit-helpers';
4
5
  import { SimpleDynamicContentPickerFormSmart } from '../DynamicContentPickerForm';
@@ -9,17 +10,20 @@ export const NewDynamicContentForm = ({
9
10
  }) => {
10
11
  const [dc, setDc] = useState();
11
12
  const lang = useLang();
12
- return React.createElement(SimpleDynamicContentPickerFormSmart, {
13
+ return _jsx(SimpleDynamicContentPickerFormSmart, {
13
14
  dc: dc,
14
15
  onChange: setDc,
15
- update: update
16
- }, React.createElement(Horizontal, {
17
- "$justifyContent": "end"
18
- }, React.createElement(Button, {
19
- color: "secondary",
20
- onClick: () => onSubmit(dc),
21
- isDisabled: !dc
22
- }, lang({
23
- message: 'SMART.RICH_MESSAGE_EDITOR.INSERT'
24
- }))));
16
+ update: update,
17
+ children: _jsx(Horizontal, {
18
+ "$justifyContent": "end",
19
+ children: _jsx(Button, {
20
+ color: "secondary",
21
+ onClick: () => onSubmit(dc),
22
+ isDisabled: !dc,
23
+ children: lang({
24
+ message: 'SMART.RICH_MESSAGE_EDITOR.INSERT'
25
+ })
26
+ })
27
+ })
28
+ });
25
29
  };
@@ -1,19 +1,19 @@
1
- import React from 'react';
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { RichMessageEditor } from '@pushwoosh/dumb-components';
3
3
  import { SimpleDynamicContentPickerFormSmart } from '../DynamicContentPickerForm';
4
4
  import { NewDynamicContentForm } from './NewDynamicContentForm';
5
5
  export const RichMessageEditorSmart = props => {
6
- return React.createElement(RichMessageEditor, {
6
+ return _jsx(RichMessageEditor, {
7
7
  ...props,
8
8
  renderDynamicContent: ({
9
9
  dc,
10
10
  onChange,
11
11
  update
12
- }) => dc ? React.createElement(SimpleDynamicContentPickerFormSmart, {
12
+ }) => dc ? _jsx(SimpleDynamicContentPickerFormSmart, {
13
13
  dc: dc,
14
14
  onChange: onChange,
15
15
  update: update
16
- }) : React.createElement(NewDynamicContentForm, {
16
+ }) : _jsx(NewDynamicContentForm, {
17
17
  update: update,
18
18
  onSubmit: onChange
19
19
  })
@@ -1,9 +1,9 @@
1
- import React from 'react';
1
+ import { type ComponentType } from 'react';
2
2
  type SystemParcelProps = {
3
3
  importPath: string;
4
4
  methodName?: string;
5
5
  mountRootParcel: any;
6
- Parcel: React.ComponentType<any>;
6
+ Parcel: ComponentType<any>;
7
7
  } & Record<string, unknown>;
8
- export declare function SystemParcel({ importPath, mountRootParcel, methodName, Parcel, ...restProps }: SystemParcelProps): React.JSX.Element;
8
+ export declare function SystemParcel({ importPath, mountRootParcel, methodName, Parcel, ...restProps }: SystemParcelProps): import("react").JSX.Element;
9
9
  export {};
@@ -1,4 +1,5 @@
1
- import React, { useMemo } from 'react';
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useMemo } from 'react';
2
3
  import { useSPAContext } from '@pushwoosh/spa-context';
3
4
  export function SystemParcel({
4
5
  importPath,
@@ -9,7 +10,7 @@ export function SystemParcel({
9
10
  }) {
10
11
  const spaContext = useSPAContext();
11
12
  const parcelConfig = useMemo(() => createSystemParcelConfig(importPath, methodName), [importPath, methodName]);
12
- return React.createElement(Parcel, {
13
+ return _jsx(Parcel, {
13
14
  config: parcelConfig,
14
15
  spaContext: spaContext,
15
16
  mountParcel: mountRootParcel,
@@ -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;