@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, 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
|
|
122
|
+
return _jsxs(Modal, {
|
|
120
123
|
size: "medium",
|
|
121
124
|
isOpen: isOpen,
|
|
122
|
-
onClose: onClose
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
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
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
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,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,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
|
|
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
|
|
13
|
+
return _jsx(SimpleDynamicContentPickerFormSmart, {
|
|
13
14
|
dc: dc,
|
|
14
15
|
onChange: setDc,
|
|
15
|
-
update: update
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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
|
|
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
|
|
6
|
+
return _jsx(RichMessageEditor, {
|
|
7
7
|
...props,
|
|
8
8
|
renderDynamicContent: ({
|
|
9
9
|
dc,
|
|
10
10
|
onChange,
|
|
11
11
|
update
|
|
12
|
-
}) => dc ?
|
|
12
|
+
}) => dc ? _jsx(SimpleDynamicContentPickerFormSmart, {
|
|
13
13
|
dc: dc,
|
|
14
14
|
onChange: onChange,
|
|
15
15
|
update: update
|
|
16
|
-
}) :
|
|
16
|
+
}) : _jsx(NewDynamicContentForm, {
|
|
17
17
|
update: update,
|
|
18
18
|
onSubmit: onChange
|
|
19
19
|
})
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type ComponentType } from 'react';
|
|
2
2
|
type SystemParcelProps = {
|
|
3
3
|
importPath: string;
|
|
4
4
|
methodName?: string;
|
|
5
5
|
mountRootParcel: any;
|
|
6
|
-
Parcel:
|
|
6
|
+
Parcel: ComponentType<any>;
|
|
7
7
|
} & Record<string, unknown>;
|
|
8
|
-
export declare function SystemParcel({ importPath, mountRootParcel, methodName, Parcel, ...restProps }: SystemParcelProps):
|
|
8
|
+
export declare function SystemParcel({ importPath, mountRootParcel, methodName, Parcel, ...restProps }: SystemParcelProps): import("react").JSX.Element;
|
|
9
9
|
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
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
|
|
13
|
+
return _jsx(Parcel, {
|
|
13
14
|
config: parcelConfig,
|
|
14
15
|
spaContext: spaContext,
|
|
15
16
|
mountParcel: mountRootParcel,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
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
|
|
45
|
-
value: context
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
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>) =>
|
|
3
|
+
export declare const DataTableGetContext: <C extends DataTableContextType<any, any>>({ children }: DataGetContextProps<C>) => import("react").JSX.Element;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import
|
|
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
|
|
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>):
|
|
2
|
+
export declare function DataTableList<T>({ renderItem }: DataTableListProps<T>): import("react").JSX.Element;
|