@coorpacademy/components 10.13.5 → 10.13.8
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/es/atom/button-link-icon-only/index.js +19 -4
- package/es/atom/button-link-icon-only/index.js.map +1 -1
- package/es/atom/button-link-icon-only/style.css +29 -0
- package/es/atom/button-link-icon-only/test/button-link-icon-only.js +15 -0
- package/es/atom/button-link-icon-only/test/button-link-icon-only.js.map +1 -1
- package/es/atom/button-link-icon-only/test/fixtures/review-header.js +10 -0
- package/es/atom/button-link-icon-only/test/fixtures/review-header.js.map +1 -0
- package/es/atom/drag-and-drop/index.js +72 -46
- package/es/atom/drag-and-drop/index.js.map +1 -1
- package/es/atom/drag-and-drop/style.css +160 -73
- package/es/atom/drag-and-drop/test/dragging.js +8 -1
- package/es/atom/drag-and-drop/test/dragging.js.map +1 -1
- package/es/atom/drag-and-drop/test/fixtures/clean-and-modified.js +12 -0
- package/es/atom/drag-and-drop/test/fixtures/clean-and-modified.js.map +1 -0
- package/es/atom/drag-and-drop/test/fixtures/default.js +3 -3
- package/es/atom/drag-and-drop/test/fixtures/default.js.map +1 -1
- package/es/atom/drag-and-drop/test/fixtures/error.js +12 -0
- package/es/atom/drag-and-drop/test/fixtures/error.js.map +1 -0
- package/es/atom/drag-and-drop/test/fixtures/modified.js +12 -0
- package/es/atom/drag-and-drop/test/fixtures/modified.js.map +1 -0
- package/es/atom/drag-and-drop/test/fixtures/with-children.js +1 -14
- package/es/atom/drag-and-drop/test/fixtures/with-children.js.map +1 -1
- package/es/atom/drag-and-drop/test/fixtures/with-image.js +1 -1
- package/es/atom/drag-and-drop/test/fixtures/with-image.js.map +1 -1
- package/es/atom/drag-and-drop/test/fixtures/with-long-description.js +12 -0
- package/es/atom/drag-and-drop/test/fixtures/with-long-description.js.map +1 -0
- package/es/atom/drag-and-drop/test/fixtures/with-video.js +2 -1
- package/es/atom/drag-and-drop/test/fixtures/with-video.js.map +1 -1
- package/es/atom/drag-and-drop/test/fixtures.js +8 -0
- package/es/atom/drag-and-drop/test/fixtures.js.map +1 -1
- package/es/atom/image-upload/index.js +6 -3
- package/es/atom/image-upload/index.js.map +1 -1
- package/es/atom/image-upload/test/fixtures/clean-modified.js +13 -0
- package/es/atom/image-upload/test/fixtures/clean-modified.js.map +1 -0
- package/es/atom/image-upload/test/fixtures/{without-image.js → default.js} +1 -1
- package/es/atom/image-upload/test/fixtures/default.js.map +1 -0
- package/es/atom/image-upload/test/fixtures.js +4 -2
- package/es/atom/image-upload/test/fixtures.js.map +1 -1
- package/es/atom/loader/style.css +7 -3
- package/es/atom/review-header-step-item/index.js +3 -3
- package/es/atom/review-header-step-item/index.js.map +1 -1
- package/es/atom/review-header-step-item/style.css +5 -8
- package/es/atom/review-header-step-item/test/fixtures.js +19 -0
- package/es/atom/review-header-step-item/test/fixtures.js.map +1 -0
- package/es/molecule/brand-form-group/index.js +3 -1
- package/es/molecule/brand-form-group/index.js.map +1 -1
- package/es/molecule/brand-form-group/style.css +5 -0
- package/es/molecule/brand-form-group/test/fixtures/images.js +6 -2
- package/es/molecule/brand-form-group/test/fixtures/images.js.map +1 -1
- package/es/molecule/course-sections/index.js +4 -1
- package/es/molecule/course-sections/index.js.map +1 -1
- package/es/molecule/course-sections/style.css +14 -1
- package/es/molecule/drag-and-drop-wrapper/index.js +39 -0
- package/es/molecule/drag-and-drop-wrapper/index.js.map +1 -0
- package/es/molecule/drag-and-drop-wrapper/style.css +15 -0
- package/es/molecule/drag-and-drop-wrapper/test/fixtures/default.js +9 -0
- package/es/molecule/drag-and-drop-wrapper/test/fixtures/default.js.map +1 -0
- package/es/molecule/drag-and-drop-wrapper/test/fixtures/two-drag-and-drops.js +10 -0
- package/es/molecule/drag-and-drop-wrapper/test/fixtures/two-drag-and-drops.js.map +1 -0
- package/es/molecule/drag-and-drop-wrapper/test/fixtures.js +15 -0
- package/es/molecule/drag-and-drop-wrapper/test/fixtures.js.map +1 -0
- package/es/molecule/questions/qcm-graphic/style.css +1 -1
- package/es/molecule/review-header-steps/test/fixtures.js +23 -0
- package/es/molecule/review-header-steps/test/fixtures.js.map +1 -0
- package/es/molecule/setup-slide/index.js +3 -1
- package/es/molecule/setup-slide/index.js.map +1 -1
- package/es/molecule/setup-slide/style.css +5 -0
- package/es/molecule/setup-slide/test/fixtures/without-upload-image.js +41 -0
- package/es/molecule/setup-slide/test/fixtures/without-upload-image.js.map +1 -0
- package/es/molecule/setup-slide/test/fixtures.js +2 -0
- package/es/molecule/setup-slide/test/fixtures.js.map +1 -1
- package/es/molecule/setup-slider/test/fixtures/default.js +8 -4
- package/es/molecule/setup-slider/test/fixtures/default.js.map +1 -1
- package/es/organism/brand-form/test/fixtures/lms.js +14 -0
- package/es/organism/brand-form/test/fixtures/lms.js.map +1 -1
- package/es/organism/course-selection/index.js +2 -1
- package/es/organism/course-selection/index.js.map +1 -1
- package/es/organism/course-selection/style.css +12 -3
- package/es/organism/course-selection/test/fixtures/loading.js +9 -0
- package/es/organism/course-selection/test/fixtures/loading.js.map +1 -0
- package/es/organism/course-selection/test/fixtures.js +2 -0
- package/es/organism/course-selection/test/fixtures.js.map +1 -1
- package/es/organism/review-header/index.js +68 -0
- package/es/organism/review-header/index.js.map +1 -0
- package/es/organism/review-header/style.css +138 -0
- package/es/organism/review-header/test/fixtures/all-questions-ok.js +16 -0
- package/es/organism/review-header/test/fixtures/all-questions-ok.js.map +1 -0
- package/es/organism/review-header/test/fixtures/current-question-no-answered.js +12 -0
- package/es/organism/review-header/test/fixtures/current-question-no-answered.js.map +1 -0
- package/es/organism/review-header/test/fixtures/current-question-wrong.js +10 -0
- package/es/organism/review-header/test/fixtures/current-question-wrong.js.map +1 -0
- package/es/organism/review-header/test/fixtures/first-question-current-right.js +10 -0
- package/es/organism/review-header/test/fixtures/first-question-current-right.js.map +1 -0
- package/es/organism/review-header/test/fixtures/no-answered-question.js +10 -0
- package/es/organism/review-header/test/fixtures/no-answered-question.js.map +1 -0
- package/es/organism/review-header/test/fixtures/question-to-repeat.js +10 -0
- package/es/organism/review-header/test/fixtures/question-to-repeat.js.map +1 -0
- package/es/organism/review-header/test/review-header.js +40 -0
- package/es/organism/review-header/test/review-header.js.map +1 -0
- package/es/organism/search-and-chips-results/index.js +2 -1
- package/es/organism/search-and-chips-results/index.js.map +1 -1
- package/es/organism/search-and-chips-results/style.css +10 -3
- package/es/organism/search-and-chips-results/test/fixtures/loading.js +9 -0
- package/es/organism/search-and-chips-results/test/fixtures/loading.js.map +1 -0
- package/es/organism/search-and-chips-results/test/fixtures.js +2 -0
- package/es/organism/search-and-chips-results/test/fixtures.js.map +1 -1
- package/es/template/back-office/brand-update/index.js +5 -2
- package/es/template/back-office/brand-update/index.js.map +1 -1
- package/es/template/back-office/brand-update/style.css +10 -1
- package/es/util/button-icons.js +3 -2
- package/es/util/button-icons.js.map +1 -1
- package/lib/atom/button-link-icon-only/index.js +19 -4
- package/lib/atom/button-link-icon-only/index.js.map +1 -1
- package/lib/atom/button-link-icon-only/style.css +29 -0
- package/lib/atom/button-link-icon-only/test/button-link-icon-only.js +14 -0
- package/lib/atom/button-link-icon-only/test/button-link-icon-only.js.map +1 -1
- package/lib/atom/button-link-icon-only/test/fixtures/review-header.js +15 -0
- package/lib/atom/button-link-icon-only/test/fixtures/review-header.js.map +1 -0
- package/lib/atom/drag-and-drop/index.js +74 -45
- package/lib/atom/drag-and-drop/index.js.map +1 -1
- package/lib/atom/drag-and-drop/style.css +160 -73
- package/lib/atom/drag-and-drop/test/dragging.js +8 -1
- package/lib/atom/drag-and-drop/test/dragging.js.map +1 -1
- package/lib/atom/drag-and-drop/test/fixtures/clean-and-modified.js +21 -0
- package/lib/atom/drag-and-drop/test/fixtures/clean-and-modified.js.map +1 -0
- package/lib/atom/drag-and-drop/test/fixtures/default.js +3 -3
- package/lib/atom/drag-and-drop/test/fixtures/default.js.map +1 -1
- package/lib/atom/drag-and-drop/test/fixtures/error.js +21 -0
- package/lib/atom/drag-and-drop/test/fixtures/error.js.map +1 -0
- package/lib/atom/drag-and-drop/test/fixtures/modified.js +21 -0
- package/lib/atom/drag-and-drop/test/fixtures/modified.js.map +1 -0
- package/lib/atom/drag-and-drop/test/fixtures/with-children.js +1 -19
- package/lib/atom/drag-and-drop/test/fixtures/with-children.js.map +1 -1
- package/lib/atom/drag-and-drop/test/fixtures/with-image.js +1 -1
- package/lib/atom/drag-and-drop/test/fixtures/with-image.js.map +1 -1
- package/lib/atom/drag-and-drop/test/fixtures/with-long-description.js +21 -0
- package/lib/atom/drag-and-drop/test/fixtures/with-long-description.js.map +1 -0
- package/lib/atom/drag-and-drop/test/fixtures/with-video.js +2 -1
- package/lib/atom/drag-and-drop/test/fixtures/with-video.js.map +1 -1
- package/lib/atom/drag-and-drop/test/fixtures.js +12 -0
- package/lib/atom/drag-and-drop/test/fixtures.js.map +1 -1
- package/lib/atom/image-upload/index.js +6 -3
- package/lib/atom/image-upload/index.js.map +1 -1
- package/lib/atom/image-upload/test/fixtures/clean-modified.js +22 -0
- package/lib/atom/image-upload/test/fixtures/clean-modified.js.map +1 -0
- package/lib/atom/image-upload/test/fixtures/{without-image.js → default.js} +1 -1
- package/lib/atom/image-upload/test/fixtures/default.js.map +1 -0
- package/lib/atom/image-upload/test/fixtures.js +6 -3
- package/lib/atom/image-upload/test/fixtures.js.map +1 -1
- package/lib/atom/loader/style.css +7 -3
- package/lib/atom/review-header-step-item/index.js +3 -3
- package/lib/atom/review-header-step-item/index.js.map +1 -1
- package/lib/atom/review-header-step-item/style.css +5 -8
- package/lib/atom/review-header-step-item/test/fixtures.js +31 -0
- package/lib/atom/review-header-step-item/test/fixtures.js.map +1 -0
- package/lib/molecule/brand-form-group/index.js +3 -1
- package/lib/molecule/brand-form-group/index.js.map +1 -1
- package/lib/molecule/brand-form-group/style.css +5 -0
- package/lib/molecule/brand-form-group/test/fixtures/images.js +6 -2
- package/lib/molecule/brand-form-group/test/fixtures/images.js.map +1 -1
- package/lib/molecule/course-sections/index.js +4 -1
- package/lib/molecule/course-sections/index.js.map +1 -1
- package/lib/molecule/course-sections/style.css +14 -1
- package/lib/molecule/drag-and-drop-wrapper/index.js +49 -0
- package/lib/molecule/drag-and-drop-wrapper/index.js.map +1 -0
- package/lib/molecule/drag-and-drop-wrapper/style.css +15 -0
- package/lib/molecule/drag-and-drop-wrapper/test/fixtures/default.js +19 -0
- package/lib/molecule/drag-and-drop-wrapper/test/fixtures/default.js.map +1 -0
- package/lib/molecule/drag-and-drop-wrapper/test/fixtures/two-drag-and-drops.js +21 -0
- package/lib/molecule/drag-and-drop-wrapper/test/fixtures/two-drag-and-drops.js.map +1 -0
- package/lib/molecule/drag-and-drop-wrapper/test/fixtures.js +25 -0
- package/lib/molecule/drag-and-drop-wrapper/test/fixtures.js.map +1 -0
- package/lib/molecule/questions/qcm-graphic/style.css +1 -1
- package/lib/molecule/review-header-steps/test/fixtures.js +37 -0
- package/lib/molecule/review-header-steps/test/fixtures.js.map +1 -0
- package/lib/molecule/setup-slide/index.js +3 -1
- package/lib/molecule/setup-slide/index.js.map +1 -1
- package/lib/molecule/setup-slide/style.css +5 -0
- package/lib/molecule/setup-slide/test/fixtures/without-upload-image.js +46 -0
- package/lib/molecule/setup-slide/test/fixtures/without-upload-image.js.map +1 -0
- package/lib/molecule/setup-slide/test/fixtures.js +3 -0
- package/lib/molecule/setup-slide/test/fixtures.js.map +1 -1
- package/lib/molecule/setup-slider/test/fixtures/default.js +7 -2
- package/lib/molecule/setup-slider/test/fixtures/default.js.map +1 -1
- package/lib/organism/brand-form/test/fixtures/lms.js +14 -0
- package/lib/organism/brand-form/test/fixtures/lms.js.map +1 -1
- package/lib/organism/course-selection/index.js +2 -1
- package/lib/organism/course-selection/index.js.map +1 -1
- package/lib/organism/course-selection/style.css +12 -3
- package/lib/organism/course-selection/test/fixtures/loading.js +19 -0
- package/lib/organism/course-selection/test/fixtures/loading.js.map +1 -0
- package/lib/organism/course-selection/test/fixtures.js +3 -0
- package/lib/organism/course-selection/test/fixtures.js.map +1 -1
- package/lib/organism/review-header/index.js +81 -0
- package/lib/organism/review-header/index.js.map +1 -0
- package/lib/organism/review-header/style.css +138 -0
- package/lib/organism/review-header/test/fixtures/all-questions-ok.js +26 -0
- package/lib/organism/review-header/test/fixtures/all-questions-ok.js.map +1 -0
- package/lib/organism/review-header/test/fixtures/current-question-no-answered.js +22 -0
- package/lib/organism/review-header/test/fixtures/current-question-no-answered.js.map +1 -0
- package/lib/organism/review-header/test/fixtures/current-question-wrong.js +20 -0
- package/lib/organism/review-header/test/fixtures/current-question-wrong.js.map +1 -0
- package/lib/organism/review-header/test/fixtures/first-question-current-right.js +20 -0
- package/lib/organism/review-header/test/fixtures/first-question-current-right.js.map +1 -0
- package/lib/organism/review-header/test/fixtures/no-answered-question.js +20 -0
- package/lib/organism/review-header/test/fixtures/no-answered-question.js.map +1 -0
- package/lib/organism/review-header/test/fixtures/question-to-repeat.js +20 -0
- package/lib/organism/review-header/test/fixtures/question-to-repeat.js.map +1 -0
- package/lib/organism/review-header/test/review-header.js +51 -0
- package/lib/organism/review-header/test/review-header.js.map +1 -0
- package/lib/organism/search-and-chips-results/index.js +2 -1
- package/lib/organism/search-and-chips-results/index.js.map +1 -1
- package/lib/organism/search-and-chips-results/style.css +10 -3
- package/lib/organism/search-and-chips-results/test/fixtures/loading.js +19 -0
- package/lib/organism/search-and-chips-results/test/fixtures/loading.js.map +1 -0
- package/lib/organism/search-and-chips-results/test/fixtures.js +3 -0
- package/lib/organism/search-and-chips-results/test/fixtures.js.map +1 -1
- package/lib/template/back-office/brand-update/index.js +5 -2
- package/lib/template/back-office/brand-update/index.js.map +1 -1
- package/lib/template/back-office/brand-update/style.css +10 -1
- package/lib/util/button-icons.js +2 -1
- package/lib/util/button-icons.js.map +1 -1
- package/package.json +3 -3
- package/es/atom/image-upload/test/fixtures/without-image.js.map +0 -1
- package/lib/atom/image-upload/test/fixtures/without-image.js.map +0 -1
|
@@ -6,145 +6,232 @@
|
|
|
6
6
|
@value battle from colors;
|
|
7
7
|
@value light from colors;
|
|
8
8
|
@value xtraLightGrey from colors;
|
|
9
|
+
@value cm_grey_50 from colors;
|
|
10
|
+
@value cm_grey_100 from colors;
|
|
11
|
+
@value cm_grey_200 from colors;
|
|
12
|
+
@value cm_grey_300 from colors;
|
|
13
|
+
@value cm_grey_400 from colors;
|
|
14
|
+
@value cm_grey_700 from colors;
|
|
15
|
+
@value white from colors;
|
|
16
|
+
@value cm_negative_100 from colors;
|
|
17
|
+
@value cm_yellow_100 from colors;
|
|
9
18
|
|
|
10
19
|
.wrapper {
|
|
11
|
-
|
|
20
|
+
font-family: "Gilroy";
|
|
21
|
+
max-height: 350px;
|
|
22
|
+
max-width: 460px;
|
|
23
|
+
height: 100%;
|
|
24
|
+
width: 100%;
|
|
12
25
|
}
|
|
13
26
|
|
|
14
27
|
.title {
|
|
15
|
-
font-
|
|
16
|
-
font-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
margin-bottom: 20px;
|
|
28
|
+
font-size: 14px;
|
|
29
|
+
font-weight: 700;
|
|
30
|
+
color: cm_grey_700;
|
|
31
|
+
margin-bottom: 14px;
|
|
20
32
|
}
|
|
21
33
|
|
|
22
34
|
.description {
|
|
23
|
-
|
|
24
|
-
font-size:
|
|
35
|
+
max-height: 85px;
|
|
36
|
+
font-size: 12px;
|
|
25
37
|
font-weight: 400;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
text-align: justify;
|
|
38
|
+
color: cm_grey_300;
|
|
39
|
+
text-align: center;
|
|
40
|
+
padding: 8px;
|
|
30
41
|
}
|
|
31
42
|
|
|
32
|
-
.
|
|
43
|
+
.previewContainer {
|
|
33
44
|
width: 100%;
|
|
34
|
-
|
|
35
|
-
border:
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
align-items: center;
|
|
39
|
-
justify-content: center;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.modified {
|
|
43
|
-
composes: previewWrapper;
|
|
44
|
-
border: 2px solid battle;
|
|
45
|
+
height: 80%;
|
|
46
|
+
border: none;
|
|
47
|
+
border-radius: 7px;
|
|
48
|
+
background: cm_grey_50;
|
|
45
49
|
}
|
|
46
50
|
|
|
47
|
-
.
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
font-size: 15px;
|
|
51
|
-
font-weight: 700;
|
|
52
|
-
line-height: 100px;
|
|
51
|
+
.modifiedPreviewContainer {
|
|
52
|
+
composes: previewContainer;
|
|
53
|
+
border: 3px solid cm_yellow_100;
|
|
53
54
|
}
|
|
54
55
|
|
|
55
|
-
.
|
|
56
|
-
padding:
|
|
56
|
+
.preview {
|
|
57
|
+
padding: 16px;
|
|
57
58
|
width: 100%;
|
|
58
|
-
height:
|
|
59
|
+
height: 100%;
|
|
59
60
|
box-sizing: border-box;
|
|
60
61
|
display: flex;
|
|
62
|
+
justify-content: center;
|
|
63
|
+
align-items: center;
|
|
64
|
+
background-clip: content-box;
|
|
65
|
+
border-radius: 19px;
|
|
66
|
+
background-color: white;
|
|
61
67
|
}
|
|
62
68
|
|
|
63
|
-
.
|
|
69
|
+
.preview img, video {
|
|
64
70
|
max-width: 100%;
|
|
65
71
|
max-height: 100%;
|
|
66
72
|
margin: auto;
|
|
67
73
|
}
|
|
68
74
|
|
|
75
|
+
.infosContainer {
|
|
76
|
+
width: 100%;
|
|
77
|
+
height: 100%;
|
|
78
|
+
display: flex;
|
|
79
|
+
flex-direction: column;
|
|
80
|
+
align-items: center;
|
|
81
|
+
justify-content: space-evenly;
|
|
82
|
+
overflow: hidden;
|
|
83
|
+
}
|
|
84
|
+
|
|
69
85
|
.inputWrapper {
|
|
86
|
+
background: cm_grey_50;
|
|
70
87
|
width: 100%;
|
|
71
|
-
height:
|
|
88
|
+
height: 80%;
|
|
72
89
|
box-sizing: border-box;
|
|
73
|
-
border:
|
|
74
|
-
border-radius: 3px;
|
|
90
|
+
border-radius: 7px;
|
|
75
91
|
position: relative;
|
|
76
92
|
display: flex;
|
|
93
|
+
flex-direction: column;
|
|
77
94
|
align-items: center;
|
|
78
|
-
justify-content:
|
|
95
|
+
justify-content: space-between;
|
|
96
|
+
padding: 14px 8px 8px 8px;
|
|
97
|
+
overflow: hidden;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.inputWrapper:before {
|
|
101
|
+
content: "";
|
|
102
|
+
position: absolute;
|
|
103
|
+
border: 10px dashed cm_grey_200;
|
|
104
|
+
top: -8px;
|
|
105
|
+
bottom: -8px;
|
|
106
|
+
left: -8px;
|
|
107
|
+
right: -8px;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.modifiedInputWrapper {
|
|
111
|
+
composes: inputWrapper;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.modifiedInputWrapper::before {
|
|
115
|
+
content: "";
|
|
116
|
+
position: absolute;
|
|
117
|
+
border: 10px dashed cm_yellow_100;
|
|
118
|
+
top: -8px;
|
|
119
|
+
bottom: -8px;
|
|
120
|
+
left: -8px;
|
|
121
|
+
right: -8px;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.errorInputWrapper {
|
|
125
|
+
composes: inputWrapper;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.errorInputWrapper .icon {
|
|
129
|
+
color: cm_negative_100;
|
|
79
130
|
}
|
|
80
131
|
|
|
81
132
|
.resetUploadWrapper {
|
|
82
133
|
width: 100%;
|
|
83
|
-
height:
|
|
134
|
+
min-height: 24px;
|
|
84
135
|
box-sizing: border-box;
|
|
85
|
-
background-color:
|
|
86
|
-
border: solid 1px light;
|
|
136
|
+
background-color: cm_grey_50;
|
|
87
137
|
border-radius: 3px;
|
|
88
|
-
position: relative;
|
|
89
138
|
display: flex;
|
|
90
139
|
align-items: center;
|
|
91
140
|
justify-content: space-between;
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
font-size:
|
|
141
|
+
margin-top: 16px;
|
|
142
|
+
padding: 4px 8px;
|
|
143
|
+
font-size: 10px;
|
|
95
144
|
font-weight: 400;
|
|
96
|
-
margin-top: 15px;
|
|
97
145
|
}
|
|
98
146
|
|
|
99
147
|
.resetSrcLabel {
|
|
100
|
-
|
|
101
|
-
color: dark;
|
|
102
|
-
max-width: 220px;
|
|
148
|
+
color: cm_grey_700;
|
|
103
149
|
display: inline-block;
|
|
104
150
|
white-space: nowrap;
|
|
105
151
|
overflow: hidden;
|
|
106
152
|
text-overflow: ellipsis;
|
|
107
153
|
direction: rtl;
|
|
108
154
|
text-align: left;
|
|
109
|
-
margin-left: 9px;
|
|
110
155
|
}
|
|
111
156
|
|
|
112
157
|
.closeIcon {
|
|
113
|
-
margin-right: 9px;
|
|
114
158
|
cursor: pointer;
|
|
115
|
-
color:
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
.closeIcon:hover {
|
|
119
|
-
color: black;
|
|
159
|
+
color: cm_grey_400;
|
|
160
|
+
padding: 6px;
|
|
120
161
|
}
|
|
121
162
|
|
|
122
163
|
.dragging {
|
|
123
164
|
composes: inputWrapper;
|
|
124
|
-
border:
|
|
165
|
+
border: 1px solid cm_grey_200;
|
|
166
|
+
background: cm_grey_100;
|
|
125
167
|
}
|
|
126
168
|
|
|
127
|
-
.
|
|
128
|
-
|
|
129
|
-
height: 34px;
|
|
130
|
-
margin-right: 10px;
|
|
131
|
-
transition: all 0.2s cubic-bezier(0.47, 1.04, 0.46, 2.16);
|
|
169
|
+
.dragging .description .icon .title {
|
|
170
|
+
font-size: 8px;
|
|
132
171
|
}
|
|
133
172
|
|
|
134
|
-
.dragging .
|
|
135
|
-
|
|
173
|
+
.dragging .title {
|
|
174
|
+
font-size: 10px;
|
|
136
175
|
}
|
|
137
176
|
|
|
138
|
-
.
|
|
139
|
-
|
|
140
|
-
font-size: 18px;
|
|
141
|
-
text-transform: uppercase;
|
|
142
|
-
font-weight: 700;
|
|
143
|
-
color: dark;
|
|
177
|
+
.dragging .icon {
|
|
178
|
+
transform: scale(0.85);
|
|
144
179
|
}
|
|
145
180
|
|
|
146
|
-
.
|
|
147
|
-
min-
|
|
148
|
-
|
|
181
|
+
.icon {
|
|
182
|
+
min-width: 14px;
|
|
183
|
+
min-height: 14px;
|
|
184
|
+
max-width: 30px;
|
|
185
|
+
max-height: 30px;
|
|
186
|
+
height: 20%;
|
|
187
|
+
width: 20%;;
|
|
188
|
+
transition: all 0.2s cubic-bezier(0.47, 1.04, 0.46, 2.16);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.iconError {
|
|
192
|
+
composes: icon;
|
|
193
|
+
color: cm_negative_100;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.loaderWrapper {
|
|
149
197
|
position: relative;
|
|
198
|
+
height: 100%;
|
|
199
|
+
width: 100%;
|
|
200
|
+
display: flex;
|
|
201
|
+
flex-direction: column;
|
|
202
|
+
justify-content: center;
|
|
203
|
+
align-items: center;
|
|
204
|
+
border-radius: 7px;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.loader {
|
|
208
|
+
margin-bottom: 8px;
|
|
209
|
+
height: 14px;
|
|
210
|
+
width: 14px;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.loaderText {
|
|
214
|
+
font-size: 10px;
|
|
215
|
+
font-weight: 400;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.loadingCancel {
|
|
219
|
+
display: none;
|
|
220
|
+
position: absolute;
|
|
221
|
+
top: 0;
|
|
222
|
+
right: 0;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.loaderWrapper:hover .loadingCancel {
|
|
226
|
+
display: block;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.loaderWrapper:hover {
|
|
230
|
+
background-color: cm_grey_100;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.errorMessage {
|
|
234
|
+
color: cm_negative_100;
|
|
235
|
+
font-size: 12px;
|
|
236
|
+
margin-top: 8px;
|
|
150
237
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
|
|
1
3
|
import browserEnv from 'browser-env';
|
|
2
4
|
import test from 'ava';
|
|
3
5
|
import React from 'react';
|
|
@@ -10,8 +12,13 @@ browserEnv();
|
|
|
10
12
|
configure({
|
|
11
13
|
adapter: new Adapter()
|
|
12
14
|
});
|
|
15
|
+
const {
|
|
16
|
+
props
|
|
17
|
+
} = withChildrenFixtures;
|
|
13
18
|
test('should set state to dragging when user starts dragging', t => {
|
|
14
|
-
const wrapper = shallow( /*#__PURE__*/React.createElement(DragAndDrop,
|
|
19
|
+
const wrapper = shallow( /*#__PURE__*/React.createElement(DragAndDrop, _extends({}, props, {
|
|
20
|
+
previewContent: {}
|
|
21
|
+
}), (onDragStart, onDragStop) => /*#__PURE__*/React.createElement("input", {
|
|
15
22
|
className: style.input,
|
|
16
23
|
key: "1",
|
|
17
24
|
type: "file",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/atom/drag-and-drop/test/dragging.js"],"names":["browserEnv","test","React","shallow","configure","Adapter","style","DragAndDrop","withChildrenFixtures","adapter","
|
|
1
|
+
{"version":3,"sources":["../../../../src/atom/drag-and-drop/test/dragging.js"],"names":["browserEnv","test","React","shallow","configure","Adapter","style","DragAndDrop","withChildrenFixtures","adapter","props","t","wrapper","onDragStart","onDragStop","input","instance","false","state","dragging","find","simulate","true"],"mappings":";;AAAA,OAAOA,UAAP,MAAuB,aAAvB;AACA,OAAOC,IAAP,MAAiB,KAAjB;AACA,OAAOC,KAAP,MAAkB,OAAlB;AACA,SAAQC,OAAR,EAAiBC,SAAjB,QAAiC,QAAjC;AACA,OAAOC,OAAP,MAAoB,yBAApB;AACA,OAAOC,KAAP,MAAkB,8BAAlB;AACA,OAAOC,WAAP,MAAwB,IAAxB;AACA,OAAOC,oBAAP,MAAiC,0BAAjC;AAEAR,UAAU;AACVI,SAAS,CAAC;AAACK,EAAAA,OAAO,EAAE,IAAIJ,OAAJ;AAAV,CAAD,CAAT;AAEA,MAAM;AAACK,EAAAA;AAAD,IAAUF,oBAAhB;AAEAP,IAAI,CAAC,wDAAD,EAA2DU,CAAC,IAAI;AAClE,QAAMC,OAAO,GAAGT,OAAO,eACrB,oBAAC,WAAD,eAAiBO,KAAjB;AAAwB,IAAA,cAAc,EAAE;AAAxC,MACG,CAACG,WAAD,EAAcC,UAAd,kBACC;AACE,IAAA,SAAS,EAAER,KAAK,CAACS,KADnB;AAEE,IAAA,GAAG,EAAC,GAFN;AAGE,IAAA,IAAI,EAAC,MAHP;AAIE,IAAA,MAAM,EAAC,SAJT;AAKE,IAAA,QAAQ,EAAE,MAAM,IALlB;AAME,IAAA,WAAW,EAAEF,WANf;AAOE,IAAA,MAAM,EAAEC,UAPV;AAQE,IAAA,WAAW,EAAEA;AARf,IAFJ,CADqB,CAAvB;AAgBA,QAAME,QAAQ,GAAGJ,OAAO,CAACI,QAAR,EAAjB;AAEAL,EAAAA,CAAC,CAACM,KAAF,CAAQD,QAAQ,CAACE,KAAT,CAAeC,QAAvB;AACAP,EAAAA,OAAO,CAACQ,IAAR,CAAa,OAAb,EAAsBC,QAAtB,CAA+B,WAA/B;AACAV,EAAAA,CAAC,CAACW,IAAF,CAAON,QAAQ,CAACE,KAAT,CAAeC,QAAtB;AACAP,EAAAA,OAAO,CAACQ,IAAR,CAAa,OAAb,EAAsBC,QAAtB,CAA+B,WAA/B;AACAV,EAAAA,CAAC,CAACM,KAAF,CAAQD,QAAQ,CAACE,KAAT,CAAeC,QAAvB;AACD,CAxBG,CAAJ","sourcesContent":["import browserEnv from 'browser-env';\nimport test from 'ava';\nimport React from 'react';\nimport {shallow, configure} from 'enzyme';\nimport Adapter from 'enzyme-adapter-react-16';\nimport style from '../../image-upload/style.css';\nimport DragAndDrop from '..';\nimport withChildrenFixtures from './fixtures/with-children';\n\nbrowserEnv();\nconfigure({adapter: new Adapter()});\n\nconst {props} = withChildrenFixtures;\n\ntest('should set state to dragging when user starts dragging', t => {\n const wrapper = shallow(\n <DragAndDrop {...props} previewContent={{}}>\n {(onDragStart, onDragStop) => (\n <input\n className={style.input}\n key=\"1\"\n type=\"file\"\n accept=\"image*/\"\n onChange={() => true}\n onDragEnter={onDragStart}\n onDrop={onDragStop}\n onDragLeave={onDragStop}\n />\n )}\n </DragAndDrop>\n );\n const instance = wrapper.instance();\n\n t.false(instance.state.dragging);\n wrapper.find('input').simulate('dragenter');\n t.true(instance.state.dragging);\n wrapper.find('input').simulate('dragleave');\n t.false(instance.state.dragging);\n});\n"],"file":"dragging.js"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
|
|
3
|
+
import defaultProps from './default';
|
|
4
|
+
const {
|
|
5
|
+
props
|
|
6
|
+
} = defaultProps;
|
|
7
|
+
export default {
|
|
8
|
+
props: _extends(_extends({}, props), {}, {
|
|
9
|
+
modified: true
|
|
10
|
+
})
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=clean-and-modified.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/atom/drag-and-drop/test/fixtures/clean-and-modified.js"],"names":["defaultProps","props","modified"],"mappings":";;AAAA,OAAOA,YAAP,MAAyB,WAAzB;AAEA,MAAM;AAACC,EAAAA;AAAD,IAAUD,YAAhB;AAEA,eAAe;AACbC,EAAAA,KAAK,wBACAA,KADA;AAEHC,IAAAA,QAAQ,EAAE;AAFP;AADQ,CAAf","sourcesContent":["import defaultProps from './default';\n\nconst {props} = defaultProps;\n\nexport default {\n props: {\n ...props,\n modified: true\n }\n};\n"],"file":"clean-and-modified.js"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/atom/drag-and-drop/test/fixtures/default.js"],"names":["props","title","description","uploadLabel","previewLabel"],"mappings":"AAAA,eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,KAAK,EAAE,
|
|
1
|
+
{"version":3,"sources":["../../../../../src/atom/drag-and-drop/test/fixtures/default.js"],"names":["props","title","description","uploadLabel","previewLabel"],"mappings":"AAAA,eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,KAAK,EAAE,kBADF;AAELC,IAAAA,WAAW,EAAE,8BAFR;AAGLC,IAAAA,WAAW,EAAE,QAHR;AAILC,IAAAA,YAAY,EAAE;AAJT;AADM,CAAf","sourcesContent":["export default {\n props: {\n title: 'Drag & drop here',\n description: 'JPG or PNG, smaller than 5mb',\n uploadLabel: 'Browse',\n previewLabel: 'File Preview'\n }\n};\n"],"file":"default.js"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
|
|
3
|
+
import defaultProps from './default';
|
|
4
|
+
const {
|
|
5
|
+
props
|
|
6
|
+
} = defaultProps;
|
|
7
|
+
export default {
|
|
8
|
+
props: _extends(_extends({}, props), {}, {
|
|
9
|
+
error: 'The file is invalid'
|
|
10
|
+
})
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/atom/drag-and-drop/test/fixtures/error.js"],"names":["defaultProps","props","error"],"mappings":";;AAAA,OAAOA,YAAP,MAAyB,WAAzB;AAEA,MAAM;AAACC,EAAAA;AAAD,IAAUD,YAAhB;AAEA,eAAe;AACbC,EAAAA,KAAK,wBACAA,KADA;AAEHC,IAAAA,KAAK,EAAE;AAFJ;AADQ,CAAf","sourcesContent":["import defaultProps from './default';\n\nconst {props} = defaultProps;\n\nexport default {\n props: {\n ...props,\n error: 'The file is invalid'\n }\n};\n"],"file":"error.js"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
|
|
3
|
+
import withImageReset from './with-image-reset';
|
|
4
|
+
const {
|
|
5
|
+
props
|
|
6
|
+
} = withImageReset;
|
|
7
|
+
export default {
|
|
8
|
+
props: _extends(_extends({}, props), {}, {
|
|
9
|
+
modified: true
|
|
10
|
+
})
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=modified.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/atom/drag-and-drop/test/fixtures/modified.js"],"names":["withImageReset","props","modified"],"mappings":";;AAAA,OAAOA,cAAP,MAA2B,oBAA3B;AAEA,MAAM;AAACC,EAAAA;AAAD,IAAUD,cAAhB;AAEA,eAAe;AACbC,EAAAA,KAAK,wBACAA,KADA;AAEHC,IAAAA,QAAQ,EAAE;AAFP;AADQ,CAAf","sourcesContent":["import withImageReset from './with-image-reset';\n\nconst {props} = withImageReset;\n\nexport default {\n props: {\n ...props,\n modified: true\n }\n};\n"],"file":"modified.js"}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import style from '../../../image-upload/style.css';
|
|
3
1
|
export default {
|
|
4
2
|
props: {
|
|
5
3
|
previewContent: {
|
|
@@ -9,17 +7,6 @@ export default {
|
|
|
9
7
|
title: 'Desktop (*)',
|
|
10
8
|
displayName: 'Upload image',
|
|
11
9
|
uploadLabel: 'Upload'
|
|
12
|
-
}
|
|
13
|
-
// eslint-disable-next-line react/display-name
|
|
14
|
-
children: (onDragStart, onDragStop) => /*#__PURE__*/React.createElement("input", {
|
|
15
|
-
className: style.input,
|
|
16
|
-
key: "1",
|
|
17
|
-
type: "file",
|
|
18
|
-
accept: "image*/",
|
|
19
|
-
onChange: () => true,
|
|
20
|
-
onDragEnter: onDragStart,
|
|
21
|
-
onDrop: onDragStop,
|
|
22
|
-
onDragLeave: onDragStop
|
|
23
|
-
})
|
|
10
|
+
}
|
|
24
11
|
};
|
|
25
12
|
//# sourceMappingURL=with-children.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/atom/drag-and-drop/test/fixtures/with-children.js"],"names":["
|
|
1
|
+
{"version":3,"sources":["../../../../../src/atom/drag-and-drop/test/fixtures/with-children.js"],"names":["props","previewContent","type","src","title","displayName","uploadLabel"],"mappings":"AAAA,eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,cAAc,EAAE;AACdC,MAAAA,IAAI,EAAE,OADQ;AAEdC,MAAAA,GAAG,EAAE;AAFS,KADX;AAKLC,IAAAA,KAAK,EAAE,aALF;AAMLC,IAAAA,WAAW,EAAE,cANR;AAOLC,IAAAA,WAAW,EAAE;AAPR;AADM,CAAf","sourcesContent":["export default {\n props: {\n previewContent: {\n type: 'image',\n src: 'https://static.coorpacademy.com/content/up/raw/logo_coorp-1491560495763.svg'\n },\n title: 'Desktop (*)',\n displayName: 'Upload image',\n uploadLabel: 'Upload'\n }\n};\n"],"file":"with-children.js"}
|
|
@@ -6,7 +6,7 @@ export default {
|
|
|
6
6
|
previewLabel: 'File Preview',
|
|
7
7
|
previewContent: {
|
|
8
8
|
type: 'image',
|
|
9
|
-
src: 'https://static.coorpacademy.com/content/up/raw/
|
|
9
|
+
src: 'https://static.coorpacademy.com/content/up/raw/logo_coorp-1491560495763.svg'
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
12
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/atom/drag-and-drop/test/fixtures/with-image.js"],"names":["props","title","description","uploadLabel","previewLabel","previewContent","type","src"],"mappings":"AAAA,eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,KAAK,EAAE,wBADF;AAELC,IAAAA,WAAW,EAAE,uCAFR;AAGLC,IAAAA,WAAW,EAAE,iBAHR;AAILC,IAAAA,YAAY,EAAE,cAJT;AAKLC,IAAAA,cAAc,EAAE;AACdC,MAAAA,IAAI,EAAE,OADQ;AAEdC,MAAAA,GAAG,EAAE;AAFS;AALX;AADM,CAAf","sourcesContent":["export default {\n props: {\n title: 'Drag & Drop With Image',\n description: 'Drag and drop component with an image',\n uploadLabel: 'Upload Image(s)',\n previewLabel: 'File Preview',\n previewContent: {\n type: 'image',\n src: 'https://static.coorpacademy.com/content/up/raw/
|
|
1
|
+
{"version":3,"sources":["../../../../../src/atom/drag-and-drop/test/fixtures/with-image.js"],"names":["props","title","description","uploadLabel","previewLabel","previewContent","type","src"],"mappings":"AAAA,eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,KAAK,EAAE,wBADF;AAELC,IAAAA,WAAW,EAAE,uCAFR;AAGLC,IAAAA,WAAW,EAAE,iBAHR;AAILC,IAAAA,YAAY,EAAE,cAJT;AAKLC,IAAAA,cAAc,EAAE;AACdC,MAAAA,IAAI,EAAE,OADQ;AAEdC,MAAAA,GAAG,EAAE;AAFS;AALX;AADM,CAAf","sourcesContent":["export default {\n props: {\n title: 'Drag & Drop With Image',\n description: 'Drag and drop component with an image',\n uploadLabel: 'Upload Image(s)',\n previewLabel: 'File Preview',\n previewContent: {\n type: 'image',\n src: 'https://static.coorpacademy.com/content/up/raw/logo_coorp-1491560495763.svg'\n }\n }\n};\n"],"file":"with-image.js"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
|
|
3
|
+
import defaultProps from './default';
|
|
4
|
+
const {
|
|
5
|
+
props
|
|
6
|
+
} = defaultProps;
|
|
7
|
+
export default {
|
|
8
|
+
props: _extends(_extends({}, props), {}, {
|
|
9
|
+
description: 'Max file size: 5MO. Recommended format: SVG (if your client uses a majority of IE, use PNG format instead). Recommended aspect ratio : horizontal 2:1 (e.g. 500px x 250px). Maximum recommended aspect ratio 1:1 (e.g. 500x500, which means that it should not be taller than its width).'
|
|
10
|
+
})
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=with-long-description.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/atom/drag-and-drop/test/fixtures/with-long-description.js"],"names":["defaultProps","props","description"],"mappings":";;AAAA,OAAOA,YAAP,MAAyB,WAAzB;AAEA,MAAM;AAACC,EAAAA;AAAD,IAAUD,YAAhB;AACA,eAAe;AACbC,EAAAA,KAAK,wBACAA,KADA;AAEHC,IAAAA,WAAW,EACT;AAHC;AADQ,CAAf","sourcesContent":["import defaultProps from './default';\n\nconst {props} = defaultProps;\nexport default {\n props: {\n ...props,\n description:\n 'Max file size: 5MO. Recommended format: SVG (if your client uses a majority of IE, use PNG format instead). Recommended aspect ratio : horizontal 2:1 (e.g. 500px x 250px). Maximum recommended aspect ratio 1:1 (e.g. 500x500, which means that it should not be taller than its width).'\n }\n};\n"],"file":"with-long-description.js"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/atom/drag-and-drop/test/fixtures/with-video.js"],"names":["props","title","description","uploadLabel","previewLabel","previewContent","type","src"],"mappings":"AAAA,eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,KAAK,EAAE,aADF;AAELC,IAAAA,WAAW,EAAE,sCAFR;AAGLC,IAAAA,WAAW,EAAE,QAHR;AAILC,IAAAA,YAAY,EAAE,cAJT;AAKLC,IAAAA,cAAc,EAAE;AACdC,MAAAA,IAAI,EAAE,OADQ;AAEdC,MAAAA,GAAG,EAAE;AAFS;
|
|
1
|
+
{"version":3,"sources":["../../../../../src/atom/drag-and-drop/test/fixtures/with-video.js"],"names":["props","title","description","uploadLabel","previewLabel","previewContent","type","src","onReset","console","log"],"mappings":"AAAA,eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,KAAK,EAAE,aADF;AAELC,IAAAA,WAAW,EAAE,sCAFR;AAGLC,IAAAA,WAAW,EAAE,QAHR;AAILC,IAAAA,YAAY,EAAE,cAJT;AAKLC,IAAAA,cAAc,EAAE;AACdC,MAAAA,IAAI,EAAE,OADQ;AAEdC,MAAAA,GAAG,EAAE;AAFS,KALX;AASLC,IAAAA,OAAO,EAAE,MAAMC,OAAO,CAACC,GAAR,CAAY,OAAZ;AATV;AADM,CAAf","sourcesContent":["export default {\n props: {\n title: 'Drag & Drop',\n description: 'Drag and drop component with a video',\n uploadLabel: 'Upload',\n previewLabel: 'File Preview',\n previewContent: {\n type: 'video',\n src: 'https://www.w3schools.com/tags/movie.mp4'\n },\n onReset: () => console.log('reset')\n }\n};\n"],"file":"with-video.js"}
|
|
@@ -2,11 +2,15 @@ import test from 'ava';
|
|
|
2
2
|
import forEach from 'lodash/forEach';
|
|
3
3
|
import renderComponentMacro from '../../../test/helpers/render-component';
|
|
4
4
|
import AtomDragAndDrop from '..';
|
|
5
|
+
import fixtureCleanAndModified from './fixtures/clean-and-modified';
|
|
5
6
|
import fixtureDefault from './fixtures/default';
|
|
7
|
+
import fixtureError from './fixtures/error';
|
|
6
8
|
import fixtureLoading from './fixtures/loading';
|
|
9
|
+
import fixtureModified from './fixtures/modified';
|
|
7
10
|
import fixtureWithChildren from './fixtures/with-children';
|
|
8
11
|
import fixtureWithImageReset from './fixtures/with-image-reset';
|
|
9
12
|
import fixtureWithImage from './fixtures/with-image';
|
|
13
|
+
import fixtureWithLongDescription from './fixtures/with-long-description';
|
|
10
14
|
import fixtureWithVideo from './fixtures/with-video';
|
|
11
15
|
test('Atom › AtomDragAndDrop > should have valid propTypes', t => {
|
|
12
16
|
t.pass();
|
|
@@ -14,10 +18,14 @@ test('Atom › AtomDragAndDrop > should have valid propTypes', t => {
|
|
|
14
18
|
t.not(value, undefined, `PropType for "Atom.AtomDragAndDrop.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
|
|
15
19
|
});
|
|
16
20
|
});
|
|
21
|
+
test('Atom › AtomDragAndDrop › CleanAndModified › should be rendered', renderComponentMacro, AtomDragAndDrop, fixtureCleanAndModified);
|
|
17
22
|
test('Atom › AtomDragAndDrop › Default › should be rendered', renderComponentMacro, AtomDragAndDrop, fixtureDefault);
|
|
23
|
+
test('Atom › AtomDragAndDrop › Error › should be rendered', renderComponentMacro, AtomDragAndDrop, fixtureError);
|
|
18
24
|
test('Atom › AtomDragAndDrop › Loading › should be rendered', renderComponentMacro, AtomDragAndDrop, fixtureLoading);
|
|
25
|
+
test('Atom › AtomDragAndDrop › Modified › should be rendered', renderComponentMacro, AtomDragAndDrop, fixtureModified);
|
|
19
26
|
test('Atom › AtomDragAndDrop › WithChildren › should be rendered', renderComponentMacro, AtomDragAndDrop, fixtureWithChildren);
|
|
20
27
|
test('Atom › AtomDragAndDrop › WithImageReset › should be rendered', renderComponentMacro, AtomDragAndDrop, fixtureWithImageReset);
|
|
21
28
|
test('Atom › AtomDragAndDrop › WithImage › should be rendered', renderComponentMacro, AtomDragAndDrop, fixtureWithImage);
|
|
29
|
+
test('Atom › AtomDragAndDrop › WithLongDescription › should be rendered', renderComponentMacro, AtomDragAndDrop, fixtureWithLongDescription);
|
|
22
30
|
test('Atom › AtomDragAndDrop › WithVideo › should be rendered', renderComponentMacro, AtomDragAndDrop, fixtureWithVideo);
|
|
23
31
|
//# sourceMappingURL=fixtures.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/atom/drag-and-drop/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","AtomDragAndDrop","fixtureDefault","fixtureLoading","fixtureWithChildren","fixtureWithImageReset","fixtureWithImage","fixtureWithVideo","t","pass","propTypes","value","key","not","undefined"],"mappings":"AAAA,OAAOA,IAAP,MAAiB,KAAjB;AACA,OAAOC,OAAP,MAAoB,gBAApB;AACA,OAAOC,oBAAP,MAAiC,wCAAjC;AACA,OAAOC,eAAP,MAA4B,IAA5B;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,mBAAP,MAAgC,0BAAhC;AACA,OAAOC,qBAAP,MAAkC,6BAAlC;AACA,OAAOC,gBAAP,MAA6B,uBAA7B;AACA,OAAOC,gBAAP,MAA6B,uBAA7B;
|
|
1
|
+
{"version":3,"sources":["../../../../src/atom/drag-and-drop/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","AtomDragAndDrop","fixtureCleanAndModified","fixtureDefault","fixtureError","fixtureLoading","fixtureModified","fixtureWithChildren","fixtureWithImageReset","fixtureWithImage","fixtureWithLongDescription","fixtureWithVideo","t","pass","propTypes","value","key","not","undefined"],"mappings":"AAAA,OAAOA,IAAP,MAAiB,KAAjB;AACA,OAAOC,OAAP,MAAoB,gBAApB;AACA,OAAOC,oBAAP,MAAiC,wCAAjC;AACA,OAAOC,eAAP,MAA4B,IAA5B;AACA,OAAOC,uBAAP,MAAoC,+BAApC;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,YAAP,MAAyB,kBAAzB;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,eAAP,MAA4B,qBAA5B;AACA,OAAOC,mBAAP,MAAgC,0BAAhC;AACA,OAAOC,qBAAP,MAAkC,6BAAlC;AACA,OAAOC,gBAAP,MAA6B,uBAA7B;AACA,OAAOC,0BAAP,MAAuC,kCAAvC;AACA,OAAOC,gBAAP,MAA6B,uBAA7B;AAEAb,IAAI,CAAC,sDAAD,EAAyDc,CAAC,IAAI;AAChEA,EAAAA,CAAC,CAACC,IAAF;AACAd,EAAAA,OAAO,CAACE,eAAe,CAACa,SAAjB,EAA4B,CAACC,KAAD,EAAQC,GAAR,KAAgB;AACjDJ,IAAAA,CAAC,CAACK,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,gDAA+CF,GAAI,mEAA5E;AACD,GAFM,CAAP;AAGD,CALG,CAAJ;AAOAlB,IAAI,CAAC,gEAAD,EAAmEE,oBAAnE,EAAyFC,eAAzF,EAA0GC,uBAA1G,CAAJ;AACAJ,IAAI,CAAC,uDAAD,EAA0DE,oBAA1D,EAAgFC,eAAhF,EAAiGE,cAAjG,CAAJ;AACAL,IAAI,CAAC,qDAAD,EAAwDE,oBAAxD,EAA8EC,eAA9E,EAA+FG,YAA/F,CAAJ;AACAN,IAAI,CAAC,uDAAD,EAA0DE,oBAA1D,EAAgFC,eAAhF,EAAiGI,cAAjG,CAAJ;AACAP,IAAI,CAAC,wDAAD,EAA2DE,oBAA3D,EAAiFC,eAAjF,EAAkGK,eAAlG,CAAJ;AACAR,IAAI,CAAC,4DAAD,EAA+DE,oBAA/D,EAAqFC,eAArF,EAAsGM,mBAAtG,CAAJ;AACAT,IAAI,CAAC,8DAAD,EAAiEE,oBAAjE,EAAuFC,eAAvF,EAAwGO,qBAAxG,CAAJ;AACAV,IAAI,CAAC,yDAAD,EAA4DE,oBAA5D,EAAkFC,eAAlF,EAAmGQ,gBAAnG,CAAJ;AACAX,IAAI,CAAC,mEAAD,EAAsEE,oBAAtE,EAA4FC,eAA5F,EAA6GS,0BAA7G,CAAJ;AACAZ,IAAI,CAAC,yDAAD,EAA4DE,oBAA5D,EAAkFC,eAAlF,EAAmGU,gBAAnG,CAAJ","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport AtomDragAndDrop from '..';\nimport fixtureCleanAndModified from './fixtures/clean-and-modified';\nimport fixtureDefault from './fixtures/default';\nimport fixtureError from './fixtures/error';\nimport fixtureLoading from './fixtures/loading';\nimport fixtureModified from './fixtures/modified';\nimport fixtureWithChildren from './fixtures/with-children';\nimport fixtureWithImageReset from './fixtures/with-image-reset';\nimport fixtureWithImage from './fixtures/with-image';\nimport fixtureWithLongDescription from './fixtures/with-long-description';\nimport fixtureWithVideo from './fixtures/with-video';\n\ntest('Atom › AtomDragAndDrop > should have valid propTypes', t => {\n t.pass();\n forEach(AtomDragAndDrop.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Atom.AtomDragAndDrop.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Atom › AtomDragAndDrop › CleanAndModified › should be rendered', renderComponentMacro, AtomDragAndDrop, fixtureCleanAndModified);\ntest('Atom › AtomDragAndDrop › Default › should be rendered', renderComponentMacro, AtomDragAndDrop, fixtureDefault);\ntest('Atom › AtomDragAndDrop › Error › should be rendered', renderComponentMacro, AtomDragAndDrop, fixtureError);\ntest('Atom › AtomDragAndDrop › Loading › should be rendered', renderComponentMacro, AtomDragAndDrop, fixtureLoading);\ntest('Atom › AtomDragAndDrop › Modified › should be rendered', renderComponentMacro, AtomDragAndDrop, fixtureModified);\ntest('Atom › AtomDragAndDrop › WithChildren › should be rendered', renderComponentMacro, AtomDragAndDrop, fixtureWithChildren);\ntest('Atom › AtomDragAndDrop › WithImageReset › should be rendered', renderComponentMacro, AtomDragAndDrop, fixtureWithImageReset);\ntest('Atom › AtomDragAndDrop › WithImage › should be rendered', renderComponentMacro, AtomDragAndDrop, fixtureWithImage);\ntest('Atom › AtomDragAndDrop › WithLongDescription › should be rendered', renderComponentMacro, AtomDragAndDrop, fixtureWithLongDescription);\ntest('Atom › AtomDragAndDrop › WithVideo › should be rendered', renderComponentMacro, AtomDragAndDrop, fixtureWithVideo);\n"],"file":"fixtures.js"}
|
|
@@ -23,7 +23,8 @@ const ImageUpload = ({
|
|
|
23
23
|
onReset = null,
|
|
24
24
|
name,
|
|
25
25
|
// See ImagePropType for accepted values
|
|
26
|
-
imageTypes = ['*']
|
|
26
|
+
imageTypes = ['*'],
|
|
27
|
+
error = ''
|
|
27
28
|
}) => {
|
|
28
29
|
const handleReset = useCallback(e => {
|
|
29
30
|
if (_isNil(onReset)) return;
|
|
@@ -41,7 +42,8 @@ const ImageUpload = ({
|
|
|
41
42
|
uploadLabel: uploadLabel,
|
|
42
43
|
loading: loading,
|
|
43
44
|
modified: modified,
|
|
44
|
-
onReset: handleReset
|
|
45
|
+
onReset: handleReset,
|
|
46
|
+
error: error
|
|
45
47
|
}, (onDragStart, onDragStop) => /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("input", {
|
|
46
48
|
type: "file",
|
|
47
49
|
name: name,
|
|
@@ -59,7 +61,8 @@ ImageUpload.propTypes = process.env.NODE_ENV !== "production" ? _extends(_extend
|
|
|
59
61
|
name: PropTypes.string,
|
|
60
62
|
onChange: PropTypes.func,
|
|
61
63
|
onReset: PropTypes.func,
|
|
62
|
-
imageTypes: PropTypes.arrayOf(ImagePropType)
|
|
64
|
+
imageTypes: PropTypes.arrayOf(ImagePropType),
|
|
65
|
+
error: PropTypes.string
|
|
63
66
|
}) : {};
|
|
64
67
|
export default ImageUpload;
|
|
65
68
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/atom/image-upload/index.js"],"names":["React","useCallback","PropTypes","DragAndDrop","ImagePropType","style","ImageUpload","title","description","previewLabel","previewContent","uploadLabel","loading","modified","onChange","onReset","name","imageTypes","handleReset","e","preventDefault","acceptedImages","t","onDragStart","onDragStop","input","propTypes","string","func","arrayOf"],"mappings":";;;;;;;AAAA,OAAOA,KAAP,IAAeC,WAAf,QAAiC,OAAjC;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,OAAOC,WAAP,MAAwB,kBAAxB;AACA,SAAQC,aAAR,QAA4B,sBAA5B;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,WAAW,GAAG,CAAC;AACnBC,EAAAA,KADmB;AAEnBC,EAAAA,WAFmB;AAGnBC,EAAAA,YAHmB;AAInBC,EAAAA,cAJmB;AAKnBC,EAAAA,WALmB;AAMnBC,EAAAA,OANmB;AAOnBC,EAAAA,QAPmB;AAQnBC,EAAAA,QARmB;AASnBC,EAAAA,OAAO,GAAG,IATS;AAUnBC,EAAAA,IAVmB;AAWnB;AACAC,EAAAA,UAAU,GAAG,CAAC,GAAD;
|
|
1
|
+
{"version":3,"sources":["../../../src/atom/image-upload/index.js"],"names":["React","useCallback","PropTypes","DragAndDrop","ImagePropType","style","ImageUpload","title","description","previewLabel","previewContent","uploadLabel","loading","modified","onChange","onReset","name","imageTypes","error","handleReset","e","preventDefault","acceptedImages","t","onDragStart","onDragStop","input","propTypes","string","func","arrayOf"],"mappings":";;;;;;;AAAA,OAAOA,KAAP,IAAeC,WAAf,QAAiC,OAAjC;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,OAAOC,WAAP,MAAwB,kBAAxB;AACA,SAAQC,aAAR,QAA4B,sBAA5B;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,WAAW,GAAG,CAAC;AACnBC,EAAAA,KADmB;AAEnBC,EAAAA,WAFmB;AAGnBC,EAAAA,YAHmB;AAInBC,EAAAA,cAJmB;AAKnBC,EAAAA,WALmB;AAMnBC,EAAAA,OANmB;AAOnBC,EAAAA,QAPmB;AAQnBC,EAAAA,QARmB;AASnBC,EAAAA,OAAO,GAAG,IATS;AAUnBC,EAAAA,IAVmB;AAWnB;AACAC,EAAAA,UAAU,GAAG,CAAC,GAAD,CAZM;AAanBC,EAAAA,KAAK,GAAG;AAbW,CAAD,KAcd;AACJ,QAAMC,WAAW,GAAGlB,WAAW,CAC7BmB,CAAC,IAAI;AACH,QAAI,OAAML,OAAN,CAAJ,EAAoB;AACpBK,IAAAA,CAAC,CAACC,cAAF;AACA,WAAON,OAAO,CAACK,CAAD,CAAd;AACD,GAL4B,EAM7B,CAACL,OAAD,CAN6B,CAA/B;;AASA,QAAMO,cAAc,GAAG,MACrB,KAAIC,CAAC,IAAK,SAAQA,CAAE,EAApB,CADqB,EAErB,MAAK,GAAL,CAFqB,EAGrBN,UAHqB,CAAvB;;AAKA,sBACE,oBAAC,WAAD;AACE,IAAA,KAAK,EAAEV,KADT;AAEE,IAAA,WAAW,EAAEC,WAFf;AAGE,IAAA,YAAY,EAAEC,YAHhB;AAIE,IAAA,cAAc,EAAEC,cAJlB;AAKE,IAAA,WAAW,EAAEC,WALf;AAME,IAAA,OAAO,EAAEC,OANX;AAOE,IAAA,QAAQ,EAAEC,QAPZ;AAQE,IAAA,OAAO,EAAEM,WARX;AASE,IAAA,KAAK,EAAED;AATT,KAWG,CAACM,WAAD,EAAcC,UAAd,kBACC,8CACE;AACE,IAAA,IAAI,EAAC,MADP;AAEE,IAAA,IAAI,EAAET,IAFR;AAGE,IAAA,MAAM,EAAEM,cAHV;AAIE,IAAA,QAAQ,EAAEV,OAJZ;AAKE,IAAA,SAAS,EAAEP,KAAK,CAACqB,KALnB;AAME,IAAA,QAAQ,EAAEZ,QANZ;AAOE,IAAA,WAAW,EAAEU,WAPf;AAQE,IAAA,MAAM,EAAEC,UARV;AASE,IAAA,WAAW,EAAEA;AATf,IADF,CAZJ,CADF;AA6BD,CA1DD;;AA4DAnB,WAAW,CAACqB,SAAZ,iEACKxB,WAAW,CAACwB,SADjB;AAEEX,EAAAA,IAAI,EAAEd,SAAS,CAAC0B,MAFlB;AAGEd,EAAAA,QAAQ,EAAEZ,SAAS,CAAC2B,IAHtB;AAIEd,EAAAA,OAAO,EAAEb,SAAS,CAAC2B,IAJrB;AAKEZ,EAAAA,UAAU,EAAEf,SAAS,CAAC4B,OAAV,CAAkB1B,aAAlB,CALd;AAMEc,EAAAA,KAAK,EAAEhB,SAAS,CAAC0B;AANnB;AASA,eAAetB,WAAf","sourcesContent":["import React, {useCallback} from 'react';\nimport PropTypes from 'prop-types';\nimport {join, map, pipe, isNil} from 'lodash/fp';\nimport DragAndDrop from '../drag-and-drop';\nimport {ImagePropType} from '../../util/proptypes';\nimport style from './style.css';\n\nconst ImageUpload = ({\n title,\n description,\n previewLabel,\n previewContent,\n uploadLabel,\n loading,\n modified,\n onChange,\n onReset = null,\n name,\n // See ImagePropType for accepted values\n imageTypes = ['*'],\n error = ''\n}) => {\n const handleReset = useCallback(\n e => {\n if (isNil(onReset)) return;\n e.preventDefault();\n return onReset(e);\n },\n [onReset]\n );\n\n const acceptedImages = pipe(\n map(t => `image/${t}`),\n join(',')\n )(imageTypes);\n\n return (\n <DragAndDrop\n title={title}\n description={description}\n previewLabel={previewLabel}\n previewContent={previewContent}\n uploadLabel={uploadLabel}\n loading={loading}\n modified={modified}\n onReset={handleReset}\n error={error}\n >\n {(onDragStart, onDragStop) => (\n <div>\n <input\n type=\"file\"\n name={name}\n accept={acceptedImages}\n disabled={loading}\n className={style.input}\n onChange={onChange}\n onDragEnter={onDragStart}\n onDrop={onDragStop}\n onDragLeave={onDragStop}\n />\n </div>\n )}\n </DragAndDrop>\n );\n};\n\nImageUpload.propTypes = {\n ...DragAndDrop.propTypes,\n name: PropTypes.string,\n onChange: PropTypes.func,\n onReset: PropTypes.func,\n imageTypes: PropTypes.arrayOf(ImagePropType),\n error: PropTypes.string\n};\n\nexport default ImageUpload;\n"],"file":"index.js"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
|
|
3
|
+
import Desktop from './desktop';
|
|
4
|
+
const {
|
|
5
|
+
props
|
|
6
|
+
} = Desktop;
|
|
7
|
+
export default {
|
|
8
|
+
props: _extends(_extends({}, props), {}, {
|
|
9
|
+
previewContent: {},
|
|
10
|
+
modified: true
|
|
11
|
+
})
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=clean-modified.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/atom/image-upload/test/fixtures/clean-modified.js"],"names":["Desktop","props","previewContent","modified"],"mappings":";;AAAA,OAAOA,OAAP,MAAoB,WAApB;AAEA,MAAM;AAACC,EAAAA;AAAD,IAAUD,OAAhB;AAEA,eAAe;AACbC,EAAAA,KAAK,wBACAA,KADA;AAEHC,IAAAA,cAAc,EAAE,EAFb;AAGHC,IAAAA,QAAQ,EAAE;AAHP;AADQ,CAAf","sourcesContent":["import Desktop from './desktop';\n\nconst {props} = Desktop;\n\nexport default {\n props: {\n ...props,\n previewContent: {},\n modified: true\n }\n};\n"],"file":"clean-modified.js"}
|