kamotive_ui 1.2.16 → 1.2.19

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.
@@ -208,7 +208,7 @@
208
208
 
209
209
  .label {
210
210
  transition: 0.3ms ease-out;
211
- font-weight: 500;
211
+ font-weight: 500 !important;
212
212
  /* color: var(--text-grey); */
213
213
  }
214
214
  .label--readOnly {
@@ -225,13 +225,13 @@
225
225
  text-overflow: ellipsis;
226
226
  max-width: calc(100% - 32px);
227
227
  color: var(--text-dark);
228
- font-weight: var(--font-weight-semiBold);
228
+ /* font-weight: var(--font-weight-semiBold); */
229
229
  }
230
230
  .label--default.lg {
231
- font-size: 12px;
231
+ font-size: 12px !important;
232
232
  }
233
233
  .label--default.md {
234
- font-size: 10px;
234
+ font-size: 10px !important;
235
235
  }
236
236
 
237
237
  .label--left {
@@ -239,24 +239,18 @@
239
239
  min-width: fit-content;
240
240
  }
241
241
  .label--left.lg {
242
- font-size: 14px;
242
+ font-size: 14px !important;
243
243
  }
244
244
  .label--left.md {
245
- font-size: 12px;
245
+ font-size: 12px !important;
246
246
  }
247
247
  /* Стили для обязательного поля */
248
- /* .label--default.label--required {
249
- position: relative;
250
- top: 0;
251
- } */
252
248
  .label--required::after {
253
249
  content: '*';
254
250
  color: var(--error-main);
255
- /* position: absolute; */
256
251
  margin-left: 2px;
257
252
  top: 2px;
258
- /* font-size: 22px; */
259
- font-size: 12px;
253
+ font-size: 12px !important;
260
254
  }
261
255
 
262
256
  .item-selected {
@@ -12,6 +12,7 @@
12
12
  top: 0;
13
13
  z-index: 1;
14
14
  margin-bottom: 5px;
15
+ font-weight: 500 !important;
15
16
  }
16
17
  .fileListFiles {
17
18
  display: flex;
@@ -5,10 +5,10 @@ import { FileItem } from '../FileItem/FileItem';
5
5
  import classNames from 'classnames';
6
6
  export const FileListAttaсhed = ({ filesList, onDelete, onDownload, canDelete, canDownload, isInfoShown = true, lng = 'ru', className, style, }) => {
7
7
  if (!filesList || filesList.length === 0) {
8
- return lng === 'ru' ? (React.createElement(Typography, { variant: "Body2-SemiBold", color: "var(--grey-medium)", style: { marginTop: '5px' } }, "\u041D\u0435\u0442 \u043F\u0440\u0438\u043A\u0440\u0435\u043F\u043B\u0435\u043D\u043D\u044B\u0445 \u0444\u0430\u0439\u043B\u043E\u0432")) : (React.createElement(Typography, { variant: "Body2-SemiBold", color: "var(--grey-medium)", style: { marginTop: '5px' } }, "No attached files"));
8
+ return lng === 'ru' || lng.includes('ru') ? (React.createElement(Typography, { variant: "Body2-SemiBold", color: "var(--grey-medium)", style: { marginTop: '5px' } }, "\u041D\u0435\u0442 \u043F\u0440\u0438\u043A\u0440\u0435\u043F\u043B\u0435\u043D\u043D\u044B\u0445 \u0444\u0430\u0439\u043B\u043E\u0432")) : (React.createElement(Typography, { variant: "Body2-SemiBold", color: "var(--grey-medium)", style: { marginTop: '5px' } }, "No attached files"));
9
9
  }
10
10
  return (React.createElement("div", { className: classNames(styles['fileList'], className), style: style },
11
11
  isInfoShown &&
12
- (lng === 'ru' ? (React.createElement(Typography, { variant: "Body2-SemiBold", color: "var(--text-dark)", style: { lineHeight: '20px' }, className: styles['fileListHeader'] }, `Прикрепленные файлы (${filesList.length})`)) : (React.createElement(Typography, { variant: "Body2-SemiBold", color: "var(--text-dark)", style: { lineHeight: '20px' }, className: styles['fileListHeader'] }, `Attached files (${filesList.length})`))),
12
+ (lng === 'ru' || lng.includes('ru') ? (React.createElement(Typography, { variant: "Body2-SemiBold", color: "var(--text-dark)", style: { lineHeight: '20px' }, className: styles['fileListHeader'] }, `Прикрепленные файлы (${filesList.length})`)) : (React.createElement(Typography, { variant: "Body2-SemiBold", color: "var(--text-dark)", style: { lineHeight: '20px' }, className: styles['fileListHeader'] }, `Attached files (${filesList.length})`))),
13
13
  React.createElement("div", { className: styles['fileListFiles'] }, filesList.map((file) => (React.createElement(FileItem, { key: file.id, file: file, onDownload: onDownload, onDelete: onDelete, canDelete: canDelete, canDownload: canDownload }))))));
14
14
  };
@@ -18,7 +18,7 @@ export const FileLoader = ({ maxFileSize = 2, maxFileCount = 10, acceptedFormats
18
18
  if (file.size > maxFileSize * 1024 * 1024 * 1024) {
19
19
  return {
20
20
  code: 'name-too-large',
21
- message: lng === 'ru'
21
+ message: lng === 'ru' || lng.includes('ru')
22
22
  ? `Максимальный размер файла ${maxFileSize.toFixed(0)} ГБ`
23
23
  : `Maximum file size ${maxFileSize.toFixed(0)} GB`,
24
24
  };
@@ -26,13 +26,13 @@ export const FileLoader = ({ maxFileSize = 2, maxFileCount = 10, acceptedFormats
26
26
  if (addedFiles.find((addedFile) => addedFile.name === file.name)) {
27
27
  return {
28
28
  code: 'repeating-file-name',
29
- message: lng === 'ru' ? `Файл уже добавлен` : `File already added`,
29
+ message: lng === 'ru' || lng.includes('ru') ? `Файл уже добавлен` : `File already added`,
30
30
  };
31
31
  }
32
32
  if (addedFiles.length > maxFileCount - 1) {
33
33
  return {
34
34
  code: 'files-count-too-large',
35
- message: lng === 'ru' ? `Максимальное количество файлов ${maxFileCount}` : `Maximum number of files ${maxFileCount}`,
35
+ message: lng === 'ru' || lng.includes('ru') ? `Максимальное количество файлов ${maxFileCount}` : `Maximum number of files ${maxFileCount}`,
36
36
  };
37
37
  }
38
38
  return null;
@@ -71,7 +71,7 @@ export const FileLoader = ({ maxFileSize = 2, maxFileCount = 10, acceptedFormats
71
71
  errors: [
72
72
  {
73
73
  code: 'files-count-too-large',
74
- message: lng === 'ru'
74
+ message: lng === 'ru' || lng.includes('ru')
75
75
  ? `Максимальное количество файлов ${maxFileCount}`
76
76
  : `Maximum number of files ${maxFileCount}`,
77
77
  },
@@ -127,6 +127,11 @@ export const FileLoader = ({ maxFileSize = 2, maxFileCount = 10, acceptedFormats
127
127
  }
128
128
  return formats.join(', ');
129
129
  };
130
+ useEffect(() => {
131
+ if (addedFiles.length === 0) {
132
+ setAddedFilesFormatted([]);
133
+ }
134
+ }, [addedFiles]);
130
135
  useEffect(() => {
131
136
  if (loadingFilesNames.length === 0 && isLoadingFiles) {
132
137
  setIsLoadingFiles(false);
@@ -136,7 +141,7 @@ export const FileLoader = ({ maxFileSize = 2, maxFileCount = 10, acceptedFormats
136
141
  React.createElement("div", Object.assign({}, getRootProps({ className: `${styles['dropzone']} ${!canAdd ? styles['disabled'] : ''}` })),
137
142
  React.createElement("input", Object.assign({}, getInputProps())),
138
143
  React.createElement(IconUpload, { htmlColor: !canAdd ? 'var(--grey-medium)' : 'var(--icons-grey)' }),
139
- React.createElement(Typography, { variant: "Body1", color: !canAdd ? 'var(--grey-medium)' : 'var(--icons-grey)', style: { textAlign: 'center' } }, lng === 'ru' ? (React.createElement(React.Fragment, null,
144
+ React.createElement(Typography, { variant: "Body1", color: !canAdd ? 'var(--grey-medium)' : 'var(--icons-grey)', style: { textAlign: 'center' } }, lng === 'ru' || lng.includes('ru') ? (React.createElement(React.Fragment, null,
140
145
  React.createElement("span", { style: { textDecoration: 'underline' } }, "\u041D\u0430\u0436\u043C\u0438\u0442\u0435 \u043D\u0430 \u043E\u0431\u043B\u0430\u0441\u0442\u044C"),
141
146
  " ",
142
147
  React.createElement("span", null, " \u0438\u043B\u0438 \u043F\u0435\u0440\u0435\u0442\u0430\u0449\u0438\u0442\u0435 \u0444\u0430\u0439\u043B\u044B"))) : (React.createElement(React.Fragment, null,
@@ -145,7 +150,7 @@ export const FileLoader = ({ maxFileSize = 2, maxFileCount = 10, acceptedFormats
145
150
  React.createElement("span", null, "or drag files here")))),
146
151
  React.createElement("div", null,
147
152
  maxFileSize &&
148
- (lng === 'ru' ? (React.createElement(Typography, { variant: "Body2", color: "var(--grey-medium)" },
153
+ (lng === 'ru' || lng.includes('ru') ? (React.createElement(Typography, { variant: "Body2", color: "var(--grey-medium)" },
149
154
  `Максимальный размер файла ${maxFileSize.toFixed(0)} ГБ`,
150
155
  " ",
151
156
  React.createElement("br", null))) : (React.createElement(Typography, { variant: "Body2", color: "var(--grey-medium)" },
@@ -153,10 +158,10 @@ export const FileLoader = ({ maxFileSize = 2, maxFileCount = 10, acceptedFormats
153
158
  " ",
154
159
  React.createElement("br", null)))),
155
160
  maxFileCount &&
156
- (lng === 'ru' ? (React.createElement(Typography, { variant: "Body2", color: "var(--grey-medium)" }, `За раз можно загрузить ${maxFileCount} ${maxFileCount > 1 ? `файлов` : `файл`}`)) : (React.createElement(Typography, { variant: "Body2", color: "var(--grey-medium)" }, `You can upload ${maxFileCount} ${maxFileCount > 1 ? `files` : `file`}`))))),
161
+ (lng === 'ru' || lng.includes('ru') ? (React.createElement(Typography, { variant: "Body2", color: "var(--grey-medium)" }, `За раз можно загрузить ${maxFileCount} ${maxFileCount > 1 ? `файлов` : `файл`}`)) : (React.createElement(Typography, { variant: "Body2", color: "var(--grey-medium)" }, `You can upload ${maxFileCount} ${maxFileCount > 1 ? `files` : `file`}`))))),
157
162
  acceptedFormats &&
158
- (lng === 'ru' ? (React.createElement(Typography, { variant: "Body2", color: "var(--grey-medium)" }, `Поддерживаемые форматы: ${getAcceptedFormatsString(acceptedFormats)}`)) : (React.createElement(Typography, { variant: "Body2", color: "var(--grey-medium)" }, `Supported formats: ${getAcceptedFormatsString(acceptedFormats)}`))),
163
+ (lng === 'ru' || lng.includes('ru') ? (React.createElement(Typography, { variant: "Body2", color: "var(--grey-medium)" }, `Поддерживаемые форматы: ${getAcceptedFormatsString(acceptedFormats)}`)) : (React.createElement(Typography, { variant: "Body2", color: "var(--grey-medium)" }, `Supported formats: ${getAcceptedFormatsString(acceptedFormats)}`))),
159
164
  (addedFiles === null || addedFiles === void 0 ? void 0 : addedFiles.length) > 0 || (errorFiles === null || errorFiles === void 0 ? void 0 : errorFiles.length) > 0 ? (React.createElement("div", { className: styles['addedFiles'] },
160
165
  acceptedFileItems,
161
- fileRejectionItems)) : lng === 'ru' ? (React.createElement(Typography, { variant: "Body2-SemiBold", color: "var(--grey-medium)", style: { marginTop: '5px' } }, "\u0424\u0430\u0439\u043B\u044B \u043D\u0435 \u0434\u043E\u0431\u0430\u0432\u043B\u0435\u043D\u044B")) : (React.createElement(Typography, { variant: "Body2-SemiBold", color: "var(--grey-medium)", style: { marginTop: '5px' } }, "Files not added"))));
166
+ fileRejectionItems)) : lng === 'ru' || lng.includes('ru') ? (React.createElement(Typography, { variant: "Body2-SemiBold", color: "var(--grey-medium)", style: { marginTop: '5px' } }, "\u0424\u0430\u0439\u043B\u044B \u043D\u0435 \u0434\u043E\u0431\u0430\u0432\u043B\u0435\u043D\u044B")) : (React.createElement(Typography, { variant: "Body2-SemiBold", color: "var(--grey-medium)", style: { marginTop: '5px' } }, "Files not added"))));
162
167
  };
@@ -19,7 +19,6 @@
19
19
  border: 1px dashed var(--blue-main);
20
20
  border-radius: 15px;
21
21
  cursor: pointer;
22
- margin-right: 10px;
23
22
  }
24
23
 
25
24
  .dropzone:hover {
@@ -128,7 +128,7 @@
128
128
 
129
129
  .label {
130
130
  line-height: 14px;
131
- font-weight: 500;
131
+ font-weight: 500 !important;
132
132
  transition: 0.3ms ease-out;
133
133
  /* color: var(--text-grey); */
134
134
  }
@@ -140,30 +140,30 @@
140
140
  overflow: hidden;
141
141
  text-overflow: ellipsis;
142
142
  max-width: calc(100% - 32px);
143
- color: var(--text-dark);
144
- font-weight: var(--font-weight-semiBold);
143
+ color: var(--text-dark) !important;;
144
+ /* font-weight: var(--font-weight-semiBold) !important;; */
145
145
  }
146
146
  .label--default.lg {
147
- font-size: 12px;
147
+ font-size: 12px !important;;
148
148
  }
149
149
  .label--default.md {
150
- font-size: 10px;
150
+ font-size: 10px !important;;
151
151
  }
152
152
  .label--default.sm {
153
- font-size: 16px;
153
+ font-size: 16px !important;;
154
154
  }
155
155
  .label--left {
156
- color: var(--text-dark);
156
+ color: var(--text-dark) !important;;
157
157
  text-wrap-mode: nowrap;
158
158
  }
159
159
  .label--left.lg {
160
- font-size: 14px;
160
+ font-size: 14px !important;;
161
161
  }
162
162
  .label--left.md {
163
- font-size: 12px;
163
+ font-size: 12px !important;;
164
164
  }
165
165
  .label--left.sm {
166
- font-size: 10px;
166
+ font-size: 10px !important;;
167
167
  }
168
168
 
169
169
  /* Стили для обязательного input */
@@ -193,13 +193,13 @@
193
193
  }
194
194
 
195
195
  .helperText.md {
196
- font-size: 10px;
196
+ font-size: 10px !important;
197
197
  }
198
198
  .helperText.sm {
199
- font-size: 8px;
199
+ font-size: 8px !important;
200
200
  }
201
201
  .helperText.lg {
202
- font-size: 12px;
202
+ font-size: 12px !important;
203
203
  }
204
204
  .helperText {
205
205
  position: absolute;
@@ -211,13 +211,13 @@
211
211
  white-space: nowrap;
212
212
  overflow: hidden;
213
213
  text-overflow: ellipsis;
214
- color: var(--error-main);
214
+ color: var(--error-main) !important;
215
215
  }
216
216
 
217
217
  /* Стили для disabled */
218
218
  .input:disabled {
219
219
  background-color: rgba(120, 120, 128, 0.08);
220
- color: var(--text-grey);
220
+ color: var(--text-grey) !important;
221
221
  cursor: not-allowed;
222
222
  border: none;
223
223
  box-shadow: none;
@@ -391,7 +391,7 @@ export interface FileAttachProps {
391
391
  /**Позиционирование блока прикрепленных файлов */
392
392
  position?: 'left' | 'right' | 'bottom';
393
393
  /** Язык */
394
- lng?: 'ru' | 'en';
394
+ lng?: string;
395
395
  /** Дополнительный класс */
396
396
  className?: string;
397
397
  /** Стили передаваемые напрямую */
@@ -411,7 +411,7 @@ export interface FileListAttaсhedProps {
411
411
  /**Флаг для показа информационного текста */
412
412
  isInfoShown?: boolean;
413
413
  /** Язык */
414
- lng?: 'ru' | 'en';
414
+ lng?: string;
415
415
  /** Дополнительный класс */
416
416
  className?: string;
417
417
  /** Стили передаваемые напрямую */
@@ -453,7 +453,7 @@ export interface FileLoaderProps {
453
453
  /**Разрешени на добавление файлов*/
454
454
  canAdd?: boolean;
455
455
  /** Язык */
456
- lng?: 'ru' | 'en';
456
+ lng?: string;
457
457
  /** Дополнительный класс */
458
458
  className?: string;
459
459
  /** Стили передаваемые напрямую */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kamotive_ui",
3
- "version": "1.2.16",
3
+ "version": "1.2.19",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [