@alfalab/core-components-file-upload-item 6.0.4 → 6.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/Component.js +1 -1
- package/actions-control.module-340119ff.js +6 -0
- package/components/actions-control/actions-control.css +6 -6
- package/components/actions-control/actions.js +1 -1
- package/components/actions-control/components/delete-button/delete-button.js +1 -1
- package/components/actions-control/components/download-button/download-button.js +1 -1
- package/components/actions-control/components/restore-button/restore-button.js +1 -1
- package/components/content/components/content-error/content-error.css +2 -2
- package/components/content/components/content-error/content-error.js +1 -1
- package/components/content/components/content-subtitle/content-subtitle.css +4 -4
- package/components/content/components/content-subtitle/content-subtitle.js +1 -1
- package/components/content/content.css +8 -8
- package/components/content/content.js +1 -1
- package/components/status-control/components/status-control-icon/status-control-icon.css +6 -6
- package/components/status-control/components/status-control-icon/status-control-icon.js +1 -1
- package/components/status-control/status-control.css +10 -10
- package/components/status-control/status-control.js +1 -1
- package/context/file-upload-item-context.d.ts +2 -1
- package/cssm/context/file-upload-item-context.d.ts +2 -1
- package/cssm/index.d.ts +2 -0
- package/cssm/types/file-upload-item-props.d.ts +2 -1
- package/cssm/types/status.d.ts +2 -0
- package/cssm/types/status.js +2 -0
- package/cssm/utils.d.ts +6 -5
- package/esm/Component.js +1 -1
- package/esm/actions-control.module-9f6e94da.js +4 -0
- package/esm/components/actions-control/actions-control.css +6 -6
- package/esm/components/actions-control/actions.js +1 -1
- package/esm/components/actions-control/components/delete-button/delete-button.js +1 -1
- package/esm/components/actions-control/components/download-button/download-button.js +1 -1
- package/esm/components/actions-control/components/restore-button/restore-button.js +1 -1
- package/esm/components/content/components/content-error/content-error.css +2 -2
- package/esm/components/content/components/content-error/content-error.js +1 -1
- package/esm/components/content/components/content-subtitle/content-subtitle.css +4 -4
- package/esm/components/content/components/content-subtitle/content-subtitle.js +1 -1
- package/esm/components/content/content.css +8 -8
- package/esm/components/content/content.js +1 -1
- package/esm/components/status-control/components/status-control-icon/status-control-icon.css +6 -6
- package/esm/components/status-control/components/status-control-icon/status-control-icon.js +1 -1
- package/esm/components/status-control/status-control.css +10 -10
- package/esm/components/status-control/status-control.js +1 -1
- package/esm/context/file-upload-item-context.d.ts +2 -1
- package/esm/index.css +3 -3
- package/esm/index.d.ts +2 -0
- package/esm/types/file-upload-item-props.d.ts +2 -1
- package/esm/types/status.d.ts +2 -0
- package/esm/types/status.js +1 -0
- package/esm/utils.d.ts +6 -5
- package/index.css +3 -3
- package/index.d.ts +2 -0
- package/modern/Component.js +1 -1
- package/modern/actions-control.module-4ddd7980.js +4 -0
- package/modern/components/actions-control/actions-control.css +6 -6
- package/modern/components/actions-control/actions.js +1 -1
- package/modern/components/actions-control/components/delete-button/delete-button.js +1 -1
- package/modern/components/actions-control/components/download-button/download-button.js +1 -1
- package/modern/components/actions-control/components/restore-button/restore-button.js +1 -1
- package/modern/components/content/components/content-error/content-error.css +2 -2
- package/modern/components/content/components/content-error/content-error.js +1 -1
- package/modern/components/content/components/content-subtitle/content-subtitle.css +4 -4
- package/modern/components/content/components/content-subtitle/content-subtitle.js +1 -1
- package/modern/components/content/content.css +8 -8
- package/modern/components/content/content.js +1 -1
- package/modern/components/status-control/components/status-control-icon/status-control-icon.css +6 -6
- package/modern/components/status-control/components/status-control-icon/status-control-icon.js +1 -1
- package/modern/components/status-control/status-control.css +10 -10
- package/modern/components/status-control/status-control.js +1 -1
- package/modern/context/file-upload-item-context.d.ts +2 -1
- package/modern/index.css +3 -3
- package/modern/index.d.ts +2 -0
- package/modern/types/file-upload-item-props.d.ts +2 -1
- package/modern/types/status.d.ts +2 -0
- package/modern/types/status.js +1 -0
- package/modern/utils.d.ts +6 -5
- package/moderncssm/context/file-upload-item-context.d.ts +2 -1
- package/moderncssm/index.d.ts +2 -0
- package/moderncssm/types/file-upload-item-props.d.ts +2 -1
- package/moderncssm/types/status.d.ts +2 -0
- package/moderncssm/types/status.js +1 -0
- package/moderncssm/utils.d.ts +6 -5
- package/package.json +6 -5
- package/src/Component.tsx +1 -1
- package/src/context/file-upload-item-context.tsx +3 -1
- package/src/index.ts +3 -0
- package/src/types/file-upload-item-props.ts +3 -1
- package/src/types/status.ts +7 -0
- package/src/utils.ts +7 -5
- package/types/file-upload-item-props.d.ts +2 -1
- package/types/status.d.ts +2 -0
- package/types/status.js +2 -0
- package/utils.d.ts +6 -5
- package/actions-control.module-4c64f0ce.js +0 -6
- package/esm/actions-control.module-e32db318.js +0 -4
- package/modern/actions-control.module-8c021ec2.js +0 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alfalab/core-components-file-upload-item",
|
|
3
|
-
"version": "6.0
|
|
3
|
+
"version": "6.1.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"license": "MIT",
|
|
@@ -10,15 +10,16 @@
|
|
|
10
10
|
"access": "public",
|
|
11
11
|
"directory": "dist"
|
|
12
12
|
},
|
|
13
|
+
"sideEffects": false,
|
|
13
14
|
"peerDependencies": {
|
|
14
15
|
"react": "^16.9.0 || ^17.0.1 || ^18.0.0"
|
|
15
16
|
},
|
|
16
17
|
"dependencies": {
|
|
17
|
-
"@alfalab/core-components-icon-button": "^6.11.
|
|
18
|
-
"@alfalab/core-components-link": "^5.3.
|
|
19
|
-
"@alfalab/core-components-spinner": "^4.0.
|
|
18
|
+
"@alfalab/core-components-icon-button": "^6.11.5",
|
|
19
|
+
"@alfalab/core-components-link": "^5.3.3",
|
|
20
|
+
"@alfalab/core-components-spinner": "^4.0.2",
|
|
20
21
|
"@alfalab/icons-glyph": "^2.189.0",
|
|
21
|
-
"@alfalab/core-components-typography": "^4.11.
|
|
22
|
+
"@alfalab/core-components-typography": "^4.11.2",
|
|
22
23
|
"classnames": "^2.5.1",
|
|
23
24
|
"tslib": "^2.4.0"
|
|
24
25
|
},
|
package/src/Component.tsx
CHANGED
|
@@ -5,7 +5,7 @@ import { Actions } from './components/actions-control';
|
|
|
5
5
|
import { Content } from './components/content';
|
|
6
6
|
import { StatusControl } from './components/status-control';
|
|
7
7
|
import { FileUploadItemContext } from './context/file-upload-item-context';
|
|
8
|
-
import { FileUploadItemProps } from './types/file-upload-item-props';
|
|
8
|
+
import { type FileUploadItemProps } from './types/file-upload-item-props';
|
|
9
9
|
|
|
10
10
|
import styles from './index.module.css';
|
|
11
11
|
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { createContext, ElementType, HTMLAttributeAnchorTarget, MouseEvent } from 'react';
|
|
2
2
|
|
|
3
|
+
import { type FileUploadItemStatus } from '../types/status';
|
|
4
|
+
|
|
3
5
|
type TFileUploadItemContext = {
|
|
4
6
|
showRestore?: boolean;
|
|
5
|
-
uploadStatus?:
|
|
7
|
+
uploadStatus?: FileUploadItemStatus;
|
|
6
8
|
error?: string | string[];
|
|
7
9
|
title?: string;
|
|
8
10
|
subtitle?: string;
|
package/src/index.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import React, { ElementType, HTMLAttributeAnchorTarget, MouseEvent } from 'react';
|
|
2
2
|
|
|
3
|
+
import { type FileUploadItemStatus } from './status';
|
|
4
|
+
|
|
3
5
|
export type FileUploadItemProps = {
|
|
4
6
|
/**
|
|
5
7
|
* Дополнительный класс
|
|
@@ -55,7 +57,7 @@ export type FileUploadItemProps = {
|
|
|
55
57
|
/**
|
|
56
58
|
* Статус загрузки файла
|
|
57
59
|
*/
|
|
58
|
-
uploadStatus?:
|
|
60
|
+
uploadStatus?: FileUploadItemStatus;
|
|
59
61
|
|
|
60
62
|
/**
|
|
61
63
|
* Сообщение об ошибке
|
package/src/utils.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { type FileUploadItemStatus } from './types/status';
|
|
2
|
+
|
|
1
3
|
export function humanFileSize(size: string | number) {
|
|
2
4
|
const units = ['Б', 'КБ', 'МБ', 'ГБ'];
|
|
3
5
|
|
|
@@ -16,8 +18,8 @@ export function humanFileSize(size: string | number) {
|
|
|
16
18
|
|
|
17
19
|
export const getExtension = (filename: string) => filename.toLowerCase().split('.').pop();
|
|
18
20
|
|
|
19
|
-
export const isInitialStatus = (status?:
|
|
20
|
-
export const isSuccessStatus = (status?:
|
|
21
|
-
export const isErrorStatus = (status?:
|
|
22
|
-
export const isUploadingStatus = (status?:
|
|
23
|
-
export const isUploadedStatus = (status?:
|
|
21
|
+
export const isInitialStatus = (status?: FileUploadItemStatus) => status === 'INITIAL';
|
|
22
|
+
export const isSuccessStatus = (status?: FileUploadItemStatus) => status === 'SUCCESS';
|
|
23
|
+
export const isErrorStatus = (status?: FileUploadItemStatus) => status === 'ERROR';
|
|
24
|
+
export const isUploadingStatus = (status?: FileUploadItemStatus) => status === 'UPLOADING';
|
|
25
|
+
export const isUploadedStatus = (status?: FileUploadItemStatus) => status === 'UPLOADED';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { ElementType, HTMLAttributeAnchorTarget, MouseEvent } from "react";
|
|
4
|
+
import { FileUploadItemStatus } from "./status";
|
|
4
5
|
type FileUploadItemProps = {
|
|
5
6
|
/**
|
|
6
7
|
* Дополнительный класс
|
|
@@ -46,7 +47,7 @@ type FileUploadItemProps = {
|
|
|
46
47
|
/**
|
|
47
48
|
* Статус загрузки файла
|
|
48
49
|
*/
|
|
49
|
-
uploadStatus?:
|
|
50
|
+
uploadStatus?: FileUploadItemStatus;
|
|
50
51
|
/**
|
|
51
52
|
* Сообщение об ошибке
|
|
52
53
|
*/
|
package/types/status.js
ADDED
package/utils.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { FileUploadItemStatus } from "./types/status";
|
|
1
2
|
declare function humanFileSize(size: string | number): string;
|
|
2
3
|
declare const getExtension: (filename: string) => string | undefined;
|
|
3
|
-
declare const isInitialStatus: (status?:
|
|
4
|
-
declare const isSuccessStatus: (status?:
|
|
5
|
-
declare const isErrorStatus: (status?:
|
|
6
|
-
declare const isUploadingStatus: (status?:
|
|
7
|
-
declare const isUploadedStatus: (status?:
|
|
4
|
+
declare const isInitialStatus: (status?: FileUploadItemStatus) => boolean;
|
|
5
|
+
declare const isSuccessStatus: (status?: FileUploadItemStatus) => boolean;
|
|
6
|
+
declare const isErrorStatus: (status?: FileUploadItemStatus) => boolean;
|
|
7
|
+
declare const isUploadingStatus: (status?: FileUploadItemStatus) => boolean;
|
|
8
|
+
declare const isUploadedStatus: (status?: FileUploadItemStatus) => boolean;
|
|
8
9
|
export { humanFileSize, getExtension, isInitialStatus, isSuccessStatus, isErrorStatus, isUploadingStatus, isUploadedStatus };
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var styles = {"container":"file-upload-item__container_jtpzt","icon":"file-upload-item__icon_jtpzt","deleteIconColor":"file-upload-item__deleteIconColor_jtpzt","downloadIconColor":"file-upload-item__downloadIconColor_jtpzt","restoreIconColor":"file-upload-item__restoreIconColor_jtpzt"};
|
|
4
|
-
require('./components/actions-control/actions-control.css')
|
|
5
|
-
|
|
6
|
-
exports.styles = styles;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
var styles = {"container":"file-upload-item__container_jtpzt","icon":"file-upload-item__icon_jtpzt","deleteIconColor":"file-upload-item__deleteIconColor_jtpzt","downloadIconColor":"file-upload-item__downloadIconColor_jtpzt","restoreIconColor":"file-upload-item__restoreIconColor_jtpzt"};
|
|
2
|
-
require('./components/actions-control/actions-control.css')
|
|
3
|
-
|
|
4
|
-
export { styles as s };
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
const styles = {"container":"file-upload-item__container_jtpzt","icon":"file-upload-item__icon_jtpzt","deleteIconColor":"file-upload-item__deleteIconColor_jtpzt","downloadIconColor":"file-upload-item__downloadIconColor_jtpzt","restoreIconColor":"file-upload-item__restoreIconColor_jtpzt"};
|
|
2
|
-
require('./components/actions-control/actions-control.css')
|
|
3
|
-
|
|
4
|
-
export { styles as s };
|