@qn-pandora/pandora-component 4.0.3 → 4.0.4

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 (47) hide show
  1. package/CHANGELOG.json +23 -0
  2. package/CHANGELOG.md +9 -1
  3. package/es/components/FileResumable/constants.d.ts +33 -0
  4. package/es/components/FileResumable/constants.js +0 -0
  5. package/es/components/FileResumable/index.d.ts +13 -0
  6. package/es/components/FileResumable/index.js +327 -0
  7. package/es/components/FileResumable/style.css +777 -0
  8. package/es/components/FileResumable/style.less +94 -0
  9. package/es/components/FileResumable/utils.d.ts +1 -0
  10. package/es/components/FileResumable/utils.js +17 -0
  11. package/es/constants/language/en.js +3 -1
  12. package/es/constants/language/type.d.ts +2 -0
  13. package/es/constants/language/upload/en.d.ts +3 -0
  14. package/es/constants/language/upload/en.js +20 -0
  15. package/es/constants/language/upload/type.d.ts +20 -0
  16. package/es/constants/language/upload/type.js +4 -0
  17. package/es/constants/language/upload/zh.d.ts +3 -0
  18. package/es/constants/language/upload/zh.js +20 -0
  19. package/es/constants/language/zh.js +3 -1
  20. package/es/index.css +2297 -1530
  21. package/es/index.d.ts +1 -0
  22. package/es/index.js +1 -0
  23. package/es/index.less +17 -16
  24. package/es/style/theme.less +1 -0
  25. package/lib/components/FileResumable/constants.d.ts +33 -0
  26. package/lib/components/FileResumable/constants.js +2 -0
  27. package/lib/components/FileResumable/index.d.ts +13 -0
  28. package/lib/components/FileResumable/index.js +340 -0
  29. package/lib/components/FileResumable/style.css +777 -0
  30. package/lib/components/FileResumable/style.less +94 -0
  31. package/lib/components/FileResumable/utils.d.ts +1 -0
  32. package/lib/components/FileResumable/utils.js +19 -0
  33. package/lib/constants/language/en.js +6 -1
  34. package/lib/constants/language/type.d.ts +2 -0
  35. package/lib/constants/language/upload/en.d.ts +3 -0
  36. package/lib/constants/language/upload/en.js +22 -0
  37. package/lib/constants/language/upload/type.d.ts +20 -0
  38. package/lib/constants/language/upload/type.js +9 -0
  39. package/lib/constants/language/upload/zh.d.ts +3 -0
  40. package/lib/constants/language/upload/zh.js +22 -0
  41. package/lib/constants/language/zh.js +6 -1
  42. package/lib/index.css +2086 -1319
  43. package/lib/index.d.ts +1 -0
  44. package/lib/index.js +2 -0
  45. package/lib/index.less +8 -7
  46. package/lib/style/theme.less +1 -0
  47. package/package.json +6 -4
@@ -0,0 +1,94 @@
1
+ @import 'antd/lib/upload/style/index.less';
2
+ @import '../../style/theme.less';
3
+
4
+ .@{sdk-prefix}-file-resumable {
5
+ cursor: pointer;
6
+ }
7
+
8
+ .@{sdk-prefix}-file-resumable-run-container {
9
+ text-align: right;
10
+ .@{sdk-prefix}-file-resumable-run-container-icon {
11
+ color: @theme-color;
12
+ cursor: pointer;
13
+ font-size: 14px;
14
+ margin: 0 6px;
15
+ }
16
+
17
+ .@{sdk-prefix}-file-resumable-run-container-icon-disabled {
18
+ color: @font-disable-color;
19
+ &:hover {
20
+ cursor: not-allowed;
21
+ }
22
+ }
23
+ }
24
+
25
+ .@{sdk-prefix}-file-resumable-upload-icon {
26
+ font-size: 50px;
27
+ color: @icon-color;
28
+ }
29
+
30
+ .downloadIcon {
31
+ color: @theme-color;
32
+ cursor: pointer;
33
+ font-size: 20px;
34
+ }
35
+
36
+ .@{sdk-prefix}-file-resumable:hover {
37
+ border-color: @theme-color;
38
+ }
39
+
40
+ .@{sdk-prefix}-file-resumable-img-container {
41
+ background: @normal-color;
42
+ border: 1px dashed @border-color-1;
43
+ width: 50px;
44
+ height: 50px;
45
+ padding: 4px;
46
+ border-radius: 2px;
47
+ align-items: center;
48
+ cursor: pointer;
49
+ position: relative;
50
+ font-size: 16px;
51
+ display: flex;
52
+ justify-content: center;
53
+ .@{sdk-prefix}-file-resumable-img-operator {
54
+ display: flex;
55
+ justify-content: center;
56
+ align-items: center;
57
+ position: absolute;
58
+ top: 4px;
59
+ left: 4px;
60
+ right: 4px;
61
+ bottom: 4px;
62
+ .anticon {
63
+ font-size: 16px;
64
+ }
65
+ }
66
+ .@{sdk-prefix}-file-resumable-img-hidden-plus-icon {
67
+ display: none;
68
+ }
69
+
70
+ .@{sdk-prefix}-file-resumable-img-box {
71
+ max-width: 100%;
72
+ max-height: 100%;
73
+ padding: 4px;
74
+ }
75
+
76
+ &:hover {
77
+ .@{sdk-prefix}-file-resumable-img-operator {
78
+ background: @image-operator-hover-bg;
79
+ display: flex;
80
+ .anticon {
81
+ font-size: 16px;
82
+ color: @normal-color;
83
+ }
84
+ }
85
+ }
86
+ }
87
+ .@{sdk-prefix}-file-resumable-img.ant-upload.ant-upload-drag {
88
+ width: 50px;
89
+ height: 50px;
90
+ border: none;
91
+ .@{ant-prefix}-upload-btn {
92
+ padding: 0;
93
+ }
94
+ }
@@ -0,0 +1 @@
1
+ export declare const isJpgOrPngOrSvg: (type?: string, hexValue?: string) => boolean;
@@ -0,0 +1,17 @@
1
+ import { includes } from 'lodash';
2
+ var MIME_IMAGE_TYPE = [
3
+ 'image/png',
4
+ 'image/jpeg',
5
+ 'image/jpeg',
6
+ 'image/svg+xml',
7
+ 'image/vnd.microsoft.icon'
8
+ ];
9
+ export var isJpgOrPngOrSvg = function (type, hexValue) {
10
+ if (type === void 0) { type = ''; }
11
+ if (hexValue === void 0) { hexValue = ''; }
12
+ return (includes(MIME_IMAGE_TYPE, type.toLocaleLowerCase()) &&
13
+ (includes(hexValue.toLowerCase(), '100') || // ico
14
+ includes(hexValue.toLowerCase(), 'ffd8ff') ||
15
+ includes(hexValue.toLowerCase(), '3c3f786d') || // svg
16
+ includes(hexValue.toLowerCase(), '89504e47')));
17
+ };
@@ -4,11 +4,13 @@ import { range_input_en } from './range_input/en';
4
4
  import { steps_en } from './steps/en';
5
5
  import { table_en } from './table/en';
6
6
  import { transfer_en } from './transfer/en';
7
+ import upload_en from './upload/en';
7
8
  export var component_en = {
8
9
  check_transform_list: check_transform_list_en,
9
10
  datetime: datetime_en,
10
11
  range_input: range_input_en,
11
12
  steps: steps_en,
12
13
  table: table_en,
13
- transfer: transfer_en
14
+ transfer: transfer_en,
15
+ upload: upload_en
14
16
  };
@@ -4,6 +4,7 @@ import { IRangeInputLocale } from './range_input/type';
4
4
  import { IStepsLocale } from './steps/type';
5
5
  import { ITableLocale } from './table/type';
6
6
  import { ITransferLocale } from './transfer/type';
7
+ import { IUploadLocale } from './upload/type';
7
8
  export interface IComponentLocal {
8
9
  check_transform_list: ICheckTransformListLocale;
9
10
  datetime: IDateTimeLocale;
@@ -11,5 +12,6 @@ export interface IComponentLocal {
11
12
  steps: IStepsLocale;
12
13
  table: ITableLocale;
13
14
  transfer: ITransferLocale;
15
+ upload: IUploadLocale;
14
16
  }
15
17
  export declare const ComponentLocale: IComponentLocal;
@@ -0,0 +1,3 @@
1
+ import { IUploadLocale } from './type';
2
+ declare const upload_en: IUploadLocale;
3
+ export default upload_en;
@@ -0,0 +1,20 @@
1
+ var upload_en = {
2
+ play: 'Play',
3
+ pause: 'Pause',
4
+ stop: 'Stop',
5
+ error: 'Upload failed, try again later',
6
+ text: 'Drop file here to upload',
7
+ file: {
8
+ content: 'Drop your data file here',
9
+ steps: {
10
+ upload: 'Uploading',
11
+ complete: 'Done'
12
+ }
13
+ },
14
+ select_file: 'Selected',
15
+ min_size_error_msg: 'File size cannot be smaller than',
16
+ max_size_error_msg: 'File size cannot be larger than',
17
+ empty_file_error_msg: 'Cannot upload empty files',
18
+ byte: 'bytes'
19
+ };
20
+ export default upload_en;
@@ -0,0 +1,20 @@
1
+ export interface IUploadLocale {
2
+ text: string;
3
+ play: string;
4
+ pause: string;
5
+ stop: string;
6
+ error: string;
7
+ file: {
8
+ content: string;
9
+ steps: {
10
+ upload: string;
11
+ complete: string;
12
+ };
13
+ };
14
+ select_file: string;
15
+ min_size_error_msg: string;
16
+ max_size_error_msg: string;
17
+ empty_file_error_msg: string;
18
+ byte: string;
19
+ }
20
+ export declare const UploadLocale: IUploadLocale;
@@ -0,0 +1,4 @@
1
+ import { languageLocale } from '../../../utils/languageLocale';
2
+ import upload_zh from './zh';
3
+ var prefix = 'upload.';
4
+ export var UploadLocale = languageLocale(prefix, upload_zh);
@@ -0,0 +1,3 @@
1
+ import { IUploadLocale } from './type';
2
+ declare const upload_zh: IUploadLocale;
3
+ export default upload_zh;
@@ -0,0 +1,20 @@
1
+ var upload_zh = {
2
+ play: '恢复',
3
+ pause: '暂停',
4
+ stop: '停止',
5
+ error: '上传文件失败,请稍后重试',
6
+ text: '点击或将配置文件拖拽到这里上传',
7
+ file: {
8
+ content: '点击或将文件拖拽到这里上传',
9
+ steps: {
10
+ upload: '上传文件',
11
+ complete: '完成'
12
+ }
13
+ },
14
+ select_file: '选择文件',
15
+ min_size_error_msg: '文件大小不能小于',
16
+ max_size_error_msg: '文件大小不能大于',
17
+ empty_file_error_msg: '不能上传空文件',
18
+ byte: '字节'
19
+ };
20
+ export default upload_zh;
@@ -4,11 +4,13 @@ import { range_input_zh } from './range_input/zh';
4
4
  import { steps_zh } from './steps/zh';
5
5
  import { table_zh } from './table/zh';
6
6
  import { transfer_zh } from './transfer/zh';
7
+ import upload_zh from './upload/zh';
7
8
  export var component_zh = {
8
9
  check_transform_list: check_transform_list_zh,
9
10
  datetime: datetime_zh,
10
11
  range_input: range_input_zh,
11
12
  steps: steps_zh,
12
13
  table: table_zh,
13
- transfer: transfer_zh
14
+ transfer: transfer_zh,
15
+ upload: upload_zh
14
16
  };