@coorpacademy/components 10.13.6 → 10.13.9
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/test/fixtures.js +0 -2
- package/es/atom/button-link-icon-only/test/fixtures.js.map +1 -1
- package/es/atom/drag-and-drop/index.js +75 -47
- package/es/atom/drag-and-drop/index.js.map +1 -1
- package/es/atom/drag-and-drop/style.css +173 -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/style.css +1 -5
- 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/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/search/test/fixtures.js +15 -0
- package/es/molecule/search/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/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/test/fixtures.js +0 -3
- package/lib/atom/button-link-icon-only/test/fixtures.js.map +1 -1
- package/lib/atom/drag-and-drop/index.js +77 -46
- package/lib/atom/drag-and-drop/index.js.map +1 -1
- package/lib/atom/drag-and-drop/style.css +173 -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/style.css +1 -5
- 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/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/search/test/fixtures.js +25 -0
- package/lib/molecule/search/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/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/es/organism/review-header/test/fixtures.js +0 -23
- package/es/organism/review-header/test/fixtures.js.map +0 -1
- package/lib/atom/image-upload/test/fixtures/without-image.js.map +0 -1
- package/lib/organism/review-header/test/fixtures.js +0 -37
- package/lib/organism/review-header/test/fixtures.js.map +0 -1
|
@@ -6,145 +6,245 @@
|
|
|
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
|
-
|
|
28
|
+
font-size: 16px;
|
|
29
|
+
font-weight: 700;
|
|
30
|
+
color: cm_grey_700;
|
|
31
|
+
margin-bottom: 8px;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.dragAndDropLabel {
|
|
35
|
+
composes: title;
|
|
36
|
+
margin-bottom: 12px;
|
|
37
|
+
font-size: 14px;
|
|
20
38
|
}
|
|
21
39
|
|
|
22
40
|
.description {
|
|
23
|
-
|
|
24
|
-
font-size:
|
|
41
|
+
max-height: 85px;
|
|
42
|
+
font-size: 12px;
|
|
25
43
|
font-weight: 400;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
text-align: justify;
|
|
44
|
+
color: cm_grey_300;
|
|
45
|
+
text-align: center;
|
|
46
|
+
padding: 8px;
|
|
30
47
|
}
|
|
31
48
|
|
|
32
|
-
.
|
|
49
|
+
.previewContainer {
|
|
33
50
|
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;
|
|
51
|
+
height: 80%;
|
|
52
|
+
border: none;
|
|
53
|
+
border-radius: 7px;
|
|
54
|
+
background: cm_grey_50;
|
|
45
55
|
}
|
|
46
56
|
|
|
47
|
-
.
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
font-size: 15px;
|
|
51
|
-
font-weight: 700;
|
|
52
|
-
line-height: 100px;
|
|
57
|
+
.modifiedPreviewContainer {
|
|
58
|
+
composes: previewContainer;
|
|
59
|
+
border: 3px solid cm_yellow_100;
|
|
53
60
|
}
|
|
54
61
|
|
|
55
|
-
.
|
|
56
|
-
padding:
|
|
62
|
+
.preview {
|
|
63
|
+
padding: 16px;
|
|
57
64
|
width: 100%;
|
|
58
|
-
height:
|
|
65
|
+
height: 100%;
|
|
59
66
|
box-sizing: border-box;
|
|
60
67
|
display: flex;
|
|
68
|
+
justify-content: center;
|
|
69
|
+
align-items: center;
|
|
70
|
+
background-clip: content-box;
|
|
71
|
+
border-radius: 19px;
|
|
72
|
+
background-color: white;
|
|
61
73
|
}
|
|
62
74
|
|
|
63
|
-
.
|
|
75
|
+
.preview img, video {
|
|
64
76
|
max-width: 100%;
|
|
65
77
|
max-height: 100%;
|
|
66
78
|
margin: auto;
|
|
67
79
|
}
|
|
68
80
|
|
|
81
|
+
.infosContainer {
|
|
82
|
+
width: 100%;
|
|
83
|
+
height: 100%;
|
|
84
|
+
display: flex;
|
|
85
|
+
flex-direction: column;
|
|
86
|
+
align-items: center;
|
|
87
|
+
justify-content: space-evenly;
|
|
88
|
+
overflow: hidden;
|
|
89
|
+
}
|
|
90
|
+
|
|
69
91
|
.inputWrapper {
|
|
92
|
+
background: cm_grey_50;
|
|
70
93
|
width: 100%;
|
|
71
|
-
height:
|
|
94
|
+
height: 80%;
|
|
72
95
|
box-sizing: border-box;
|
|
73
|
-
border:
|
|
74
|
-
border-radius: 3px;
|
|
96
|
+
border-radius: 7px;
|
|
75
97
|
position: relative;
|
|
76
98
|
display: flex;
|
|
99
|
+
flex-direction: column;
|
|
77
100
|
align-items: center;
|
|
78
|
-
justify-content:
|
|
101
|
+
justify-content: space-between;
|
|
102
|
+
padding: 14px 8px 8px 8px;
|
|
103
|
+
overflow: hidden;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.inputWrapper:before {
|
|
107
|
+
content: "";
|
|
108
|
+
position: absolute;
|
|
109
|
+
border: 10px dashed cm_grey_200;
|
|
110
|
+
top: -8px;
|
|
111
|
+
bottom: -8px;
|
|
112
|
+
left: -8px;
|
|
113
|
+
right: -8px;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.modifiedInputWrapper {
|
|
117
|
+
composes: inputWrapper;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.modifiedInputWrapper::before {
|
|
121
|
+
content: "";
|
|
122
|
+
position: absolute;
|
|
123
|
+
border: 10px dashed cm_yellow_100;
|
|
124
|
+
top: -8px;
|
|
125
|
+
bottom: -8px;
|
|
126
|
+
left: -8px;
|
|
127
|
+
right: -8px;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.errorInputWrapper {
|
|
131
|
+
composes: inputWrapper;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.errorInputWrapper .icon {
|
|
135
|
+
color: cm_negative_100;
|
|
79
136
|
}
|
|
80
137
|
|
|
81
138
|
.resetUploadWrapper {
|
|
82
139
|
width: 100%;
|
|
83
|
-
height:
|
|
140
|
+
height: 24px;
|
|
84
141
|
box-sizing: border-box;
|
|
85
|
-
background-color:
|
|
86
|
-
border: solid 1px light;
|
|
142
|
+
background-color: cm_grey_50;
|
|
87
143
|
border-radius: 3px;
|
|
88
|
-
position: relative;
|
|
89
144
|
display: flex;
|
|
90
145
|
align-items: center;
|
|
91
146
|
justify-content: space-between;
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
font-size:
|
|
147
|
+
margin-top: 16px;
|
|
148
|
+
padding: 4px 8px;
|
|
149
|
+
font-size: 12px;
|
|
95
150
|
font-weight: 400;
|
|
96
|
-
margin-top: 15px;
|
|
97
151
|
}
|
|
98
152
|
|
|
99
153
|
.resetSrcLabel {
|
|
100
|
-
|
|
101
|
-
color: dark;
|
|
102
|
-
max-width: 220px;
|
|
154
|
+
color: cm_grey_700;
|
|
103
155
|
display: inline-block;
|
|
104
156
|
white-space: nowrap;
|
|
105
157
|
overflow: hidden;
|
|
106
158
|
text-overflow: ellipsis;
|
|
107
159
|
direction: rtl;
|
|
108
160
|
text-align: left;
|
|
109
|
-
margin-left: 9px;
|
|
110
161
|
}
|
|
111
162
|
|
|
112
163
|
.closeIcon {
|
|
113
|
-
margin-right: 9px;
|
|
114
164
|
cursor: pointer;
|
|
115
|
-
color:
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
.closeIcon:hover {
|
|
119
|
-
color: black;
|
|
165
|
+
color: cm_grey_400;
|
|
166
|
+
margin-left: 6px;
|
|
120
167
|
}
|
|
121
168
|
|
|
122
169
|
.dragging {
|
|
123
170
|
composes: inputWrapper;
|
|
124
|
-
border:
|
|
171
|
+
border: 1px solid cm_grey_200;
|
|
172
|
+
background: cm_grey_100;
|
|
125
173
|
}
|
|
126
174
|
|
|
127
|
-
.
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
175
|
+
.dragging:before {
|
|
176
|
+
content: "";
|
|
177
|
+
position: absolute;
|
|
178
|
+
border: none;
|
|
179
|
+
top: 0;
|
|
180
|
+
bottom: 0;
|
|
181
|
+
left: 0;
|
|
182
|
+
right: 0;
|
|
132
183
|
}
|
|
133
184
|
|
|
134
|
-
.dragging .
|
|
135
|
-
|
|
185
|
+
.dragging .description .icon {
|
|
186
|
+
font-size: 8px;
|
|
136
187
|
}
|
|
137
188
|
|
|
138
|
-
.
|
|
139
|
-
|
|
140
|
-
font-size: 18px;
|
|
141
|
-
text-transform: uppercase;
|
|
142
|
-
font-weight: 700;
|
|
143
|
-
color: dark;
|
|
189
|
+
.dragging .icon {
|
|
190
|
+
transform: scale(0.85);
|
|
144
191
|
}
|
|
145
192
|
|
|
146
|
-
.
|
|
147
|
-
min-
|
|
148
|
-
|
|
193
|
+
.icon {
|
|
194
|
+
min-width: 14px;
|
|
195
|
+
min-height: 14px;
|
|
196
|
+
max-width: 30px;
|
|
197
|
+
max-height: 30px;
|
|
198
|
+
height: 20%;
|
|
199
|
+
width: 20%;;
|
|
200
|
+
transition: all 0.2s cubic-bezier(0.47, 1.04, 0.46, 2.16);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.iconError {
|
|
204
|
+
composes: icon;
|
|
205
|
+
color: cm_negative_100;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.loaderWrapper {
|
|
149
209
|
position: relative;
|
|
210
|
+
height: 100%;
|
|
211
|
+
width: 100%;
|
|
212
|
+
display: flex;
|
|
213
|
+
flex-direction: column;
|
|
214
|
+
justify-content: center;
|
|
215
|
+
align-items: center;
|
|
216
|
+
border-radius: 7px;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.loader {
|
|
220
|
+
margin-bottom: 8px;
|
|
221
|
+
height: 32px;
|
|
222
|
+
width: 32px;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.loaderText {
|
|
226
|
+
font-size: 12px;
|
|
227
|
+
font-weight: 400;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.loadingCancel {
|
|
231
|
+
display: none;
|
|
232
|
+
position: absolute;
|
|
233
|
+
top: 0;
|
|
234
|
+
right: 0;
|
|
235
|
+
padding: 6px;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
.loaderWrapper:hover .loadingCancel {
|
|
239
|
+
display: block;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
.loaderWrapper:hover {
|
|
243
|
+
background-color: cm_grey_100;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.errorMessage {
|
|
247
|
+
color: cm_negative_100;
|
|
248
|
+
font-size: 12px;
|
|
249
|
+
margin-top: 8px;
|
|
150
250
|
}
|
|
@@ -18,12 +18,19 @@ var _withChildren = _interopRequireDefault(require("./fixtures/with-children"));
|
|
|
18
18
|
|
|
19
19
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
20
20
|
|
|
21
|
+
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); }
|
|
22
|
+
|
|
21
23
|
(0, _browserEnv.default)();
|
|
22
24
|
(0, _enzyme.configure)({
|
|
23
25
|
adapter: new _enzymeAdapterReact.default()
|
|
24
26
|
});
|
|
27
|
+
const {
|
|
28
|
+
props
|
|
29
|
+
} = _withChildren.default;
|
|
25
30
|
(0, _ava.default)('should set state to dragging when user starts dragging', t => {
|
|
26
|
-
const wrapper = (0, _enzyme.shallow)( /*#__PURE__*/_react.default.createElement(_.default,
|
|
31
|
+
const wrapper = (0, _enzyme.shallow)( /*#__PURE__*/_react.default.createElement(_.default, _extends({}, props, {
|
|
32
|
+
previewContent: {}
|
|
33
|
+
}), (onDragStart, onDragStop) => /*#__PURE__*/_react.default.createElement("input", {
|
|
27
34
|
className: _style.default.input,
|
|
28
35
|
key: "1",
|
|
29
36
|
type: "file",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/atom/drag-and-drop/test/dragging.js"],"names":["adapter","Adapter","
|
|
1
|
+
{"version":3,"sources":["../../../../src/atom/drag-and-drop/test/dragging.js"],"names":["adapter","Adapter","props","withChildrenFixtures","t","wrapper","onDragStart","onDragStop","style","input","instance","false","state","dragging","find","simulate","true"],"mappings":";;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEA;AACA,uBAAU;AAACA,EAAAA,OAAO,EAAE,IAAIC,2BAAJ;AAAV,CAAV;AAEA,MAAM;AAACC,EAAAA;AAAD,IAAUC,qBAAhB;AAEA,kBAAK,wDAAL,EAA+DC,CAAC,IAAI;AAClE,QAAMC,OAAO,GAAG,mCACd,6BAAC,SAAD,eAAiBH,KAAjB;AAAwB,IAAA,cAAc,EAAE;AAAxC,MACG,CAACI,WAAD,EAAcC,UAAd,kBACC;AACE,IAAA,SAAS,EAAEC,eAAMC,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,EAAEH,WANf;AAOE,IAAA,MAAM,EAAEC,UAPV;AAQE,IAAA,WAAW,EAAEA;AARf,IAFJ,CADc,CAAhB;AAgBA,QAAMG,QAAQ,GAAGL,OAAO,CAACK,QAAR,EAAjB;AAEAN,EAAAA,CAAC,CAACO,KAAF,CAAQD,QAAQ,CAACE,KAAT,CAAeC,QAAvB;AACAR,EAAAA,OAAO,CAACS,IAAR,CAAa,OAAb,EAAsBC,QAAtB,CAA+B,WAA/B;AACAX,EAAAA,CAAC,CAACY,IAAF,CAAON,QAAQ,CAACE,KAAT,CAAeC,QAAtB;AACAR,EAAAA,OAAO,CAACS,IAAR,CAAa,OAAb,EAAsBC,QAAtB,CAA+B,WAA/B;AACAX,EAAAA,CAAC,CAACO,KAAF,CAAQD,QAAQ,CAACE,KAAT,CAAeC,QAAvB;AACD,CAxBD","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,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.default = void 0;
|
|
5
|
+
|
|
6
|
+
var _default2 = _interopRequireDefault(require("./default"));
|
|
7
|
+
|
|
8
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
|
+
|
|
10
|
+
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); }
|
|
11
|
+
|
|
12
|
+
const {
|
|
13
|
+
props
|
|
14
|
+
} = _default2.default;
|
|
15
|
+
var _default = {
|
|
16
|
+
props: _extends(_extends({}, props), {}, {
|
|
17
|
+
modified: true
|
|
18
|
+
})
|
|
19
|
+
};
|
|
20
|
+
exports.default = _default;
|
|
21
|
+
//# 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":["props","defaultProps","modified"],"mappings":";;;;;AAAA;;;;;;AAEA,MAAM;AAACA,EAAAA;AAAD,IAAUC,iBAAhB;eAEe;AACbD,EAAAA,KAAK,wBACAA,KADA;AAEHE,IAAAA,QAAQ,EAAE;AAFP;AADQ,C","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"}
|
|
@@ -4,9 +4,9 @@ exports.__esModule = true;
|
|
|
4
4
|
exports.default = void 0;
|
|
5
5
|
var _default = {
|
|
6
6
|
props: {
|
|
7
|
-
title: 'Drag &
|
|
8
|
-
description: '
|
|
9
|
-
uploadLabel: '
|
|
7
|
+
title: 'Drag & drop here',
|
|
8
|
+
description: 'JPG or PNG, smaller than 5mb',
|
|
9
|
+
uploadLabel: 'Browse',
|
|
10
10
|
previewLabel: 'File Preview'
|
|
11
11
|
}
|
|
12
12
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/atom/drag-and-drop/test/fixtures/default.js"],"names":["props","title","description","uploadLabel","previewLabel"],"mappings":";;;;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":";;;;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,C","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,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.default = void 0;
|
|
5
|
+
|
|
6
|
+
var _default2 = _interopRequireDefault(require("./default"));
|
|
7
|
+
|
|
8
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
|
+
|
|
10
|
+
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); }
|
|
11
|
+
|
|
12
|
+
const {
|
|
13
|
+
props
|
|
14
|
+
} = _default2.default;
|
|
15
|
+
var _default = {
|
|
16
|
+
props: _extends(_extends({}, props), {}, {
|
|
17
|
+
error: 'The file is invalid'
|
|
18
|
+
})
|
|
19
|
+
};
|
|
20
|
+
exports.default = _default;
|
|
21
|
+
//# sourceMappingURL=error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/atom/drag-and-drop/test/fixtures/error.js"],"names":["props","defaultProps","error"],"mappings":";;;;;AAAA;;;;;;AAEA,MAAM;AAACA,EAAAA;AAAD,IAAUC,iBAAhB;eAEe;AACbD,EAAAA,KAAK,wBACAA,KADA;AAEHE,IAAAA,KAAK,EAAE;AAFJ;AADQ,C","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,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.default = void 0;
|
|
5
|
+
|
|
6
|
+
var _withImageReset = _interopRequireDefault(require("./with-image-reset"));
|
|
7
|
+
|
|
8
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
|
+
|
|
10
|
+
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); }
|
|
11
|
+
|
|
12
|
+
const {
|
|
13
|
+
props
|
|
14
|
+
} = _withImageReset.default;
|
|
15
|
+
var _default = {
|
|
16
|
+
props: _extends(_extends({}, props), {}, {
|
|
17
|
+
modified: true
|
|
18
|
+
})
|
|
19
|
+
};
|
|
20
|
+
exports.default = _default;
|
|
21
|
+
//# sourceMappingURL=modified.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/atom/drag-and-drop/test/fixtures/modified.js"],"names":["props","withImageReset","modified"],"mappings":";;;;;AAAA;;;;;;AAEA,MAAM;AAACA,EAAAA;AAAD,IAAUC,uBAAhB;eAEe;AACbD,EAAAA,KAAK,wBACAA,KADA;AAEHE,IAAAA,QAAQ,EAAE;AAFP;AADQ,C","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"}
|
|
@@ -2,13 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.default = void 0;
|
|
5
|
-
|
|
6
|
-
var _react = _interopRequireDefault(require("react"));
|
|
7
|
-
|
|
8
|
-
var _style = _interopRequireDefault(require("../../../image-upload/style.css"));
|
|
9
|
-
|
|
10
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
-
|
|
12
5
|
var _default = {
|
|
13
6
|
props: {
|
|
14
7
|
previewContent: {
|
|
@@ -18,18 +11,7 @@ var _default = {
|
|
|
18
11
|
title: 'Desktop (*)',
|
|
19
12
|
displayName: 'Upload image',
|
|
20
13
|
uploadLabel: 'Upload'
|
|
21
|
-
}
|
|
22
|
-
// eslint-disable-next-line react/display-name
|
|
23
|
-
children: (onDragStart, onDragStop) => /*#__PURE__*/_react.default.createElement("input", {
|
|
24
|
-
className: _style.default.input,
|
|
25
|
-
key: "1",
|
|
26
|
-
type: "file",
|
|
27
|
-
accept: "image*/",
|
|
28
|
-
onChange: () => true,
|
|
29
|
-
onDragEnter: onDragStart,
|
|
30
|
-
onDrop: onDragStop,
|
|
31
|
-
onDragLeave: onDragStop
|
|
32
|
-
})
|
|
14
|
+
}
|
|
33
15
|
};
|
|
34
16
|
exports.default = _default;
|
|
35
17
|
//# sourceMappingURL=with-children.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/atom/drag-and-drop/test/fixtures/with-children.js"],"names":["props","previewContent","type","src","title","displayName","uploadLabel"
|
|
1
|
+
{"version":3,"sources":["../../../../../src/atom/drag-and-drop/test/fixtures/with-children.js"],"names":["props","previewContent","type","src","title","displayName","uploadLabel"],"mappings":";;;;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,C","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"}
|
|
@@ -10,7 +10,7 @@ var _default = {
|
|
|
10
10
|
previewLabel: 'File Preview',
|
|
11
11
|
previewContent: {
|
|
12
12
|
type: 'image',
|
|
13
|
-
src: 'https://static.coorpacademy.com/content/up/raw/
|
|
13
|
+
src: 'https://static.coorpacademy.com/content/up/raw/logo_coorp-1491560495763.svg'
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
};
|
|
@@ -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":";;;;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,C","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":";;;;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,C","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,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.default = void 0;
|
|
5
|
+
|
|
6
|
+
var _default2 = _interopRequireDefault(require("./default"));
|
|
7
|
+
|
|
8
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
|
+
|
|
10
|
+
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); }
|
|
11
|
+
|
|
12
|
+
const {
|
|
13
|
+
props
|
|
14
|
+
} = _default2.default;
|
|
15
|
+
var _default = {
|
|
16
|
+
props: _extends(_extends({}, props), {}, {
|
|
17
|
+
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).'
|
|
18
|
+
})
|
|
19
|
+
};
|
|
20
|
+
exports.default = _default;
|
|
21
|
+
//# 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":["props","defaultProps","description"],"mappings":";;;;;AAAA;;;;;;AAEA,MAAM;AAACA,EAAAA;AAAD,IAAUC,iBAAhB;eACe;AACbD,EAAAA,KAAK,wBACAA,KADA;AAEHE,IAAAA,WAAW,EACT;AAHC;AADQ,C","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":";;;;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":";;;;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,C","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"}
|
|
@@ -8,16 +8,24 @@ var _renderComponent = _interopRequireDefault(require("../../../test/helpers/ren
|
|
|
8
8
|
|
|
9
9
|
var _ = _interopRequireDefault(require(".."));
|
|
10
10
|
|
|
11
|
+
var _cleanAndModified = _interopRequireDefault(require("./fixtures/clean-and-modified"));
|
|
12
|
+
|
|
11
13
|
var _default = _interopRequireDefault(require("./fixtures/default"));
|
|
12
14
|
|
|
15
|
+
var _error = _interopRequireDefault(require("./fixtures/error"));
|
|
16
|
+
|
|
13
17
|
var _loading = _interopRequireDefault(require("./fixtures/loading"));
|
|
14
18
|
|
|
19
|
+
var _modified = _interopRequireDefault(require("./fixtures/modified"));
|
|
20
|
+
|
|
15
21
|
var _withChildren = _interopRequireDefault(require("./fixtures/with-children"));
|
|
16
22
|
|
|
17
23
|
var _withImageReset = _interopRequireDefault(require("./fixtures/with-image-reset"));
|
|
18
24
|
|
|
19
25
|
var _withImage = _interopRequireDefault(require("./fixtures/with-image"));
|
|
20
26
|
|
|
27
|
+
var _withLongDescription = _interopRequireDefault(require("./fixtures/with-long-description"));
|
|
28
|
+
|
|
21
29
|
var _withVideo = _interopRequireDefault(require("./fixtures/with-video"));
|
|
22
30
|
|
|
23
31
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -28,10 +36,14 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
28
36
|
t.not(value, undefined, `PropType for "Atom.AtomDragAndDrop.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
|
|
29
37
|
});
|
|
30
38
|
});
|
|
39
|
+
(0, _ava.default)('Atom › AtomDragAndDrop › CleanAndModified › should be rendered', _renderComponent.default, _.default, _cleanAndModified.default);
|
|
31
40
|
(0, _ava.default)('Atom › AtomDragAndDrop › Default › should be rendered', _renderComponent.default, _.default, _default.default);
|
|
41
|
+
(0, _ava.default)('Atom › AtomDragAndDrop › Error › should be rendered', _renderComponent.default, _.default, _error.default);
|
|
32
42
|
(0, _ava.default)('Atom › AtomDragAndDrop › Loading › should be rendered', _renderComponent.default, _.default, _loading.default);
|
|
43
|
+
(0, _ava.default)('Atom › AtomDragAndDrop › Modified › should be rendered', _renderComponent.default, _.default, _modified.default);
|
|
33
44
|
(0, _ava.default)('Atom › AtomDragAndDrop › WithChildren › should be rendered', _renderComponent.default, _.default, _withChildren.default);
|
|
34
45
|
(0, _ava.default)('Atom › AtomDragAndDrop › WithImageReset › should be rendered', _renderComponent.default, _.default, _withImageReset.default);
|
|
35
46
|
(0, _ava.default)('Atom › AtomDragAndDrop › WithImage › should be rendered', _renderComponent.default, _.default, _withImage.default);
|
|
47
|
+
(0, _ava.default)('Atom › AtomDragAndDrop › WithLongDescription › should be rendered', _renderComponent.default, _.default, _withLongDescription.default);
|
|
36
48
|
(0, _ava.default)('Atom › AtomDragAndDrop › WithVideo › should be rendered', _renderComponent.default, _.default, _withVideo.default);
|
|
37
49
|
//# sourceMappingURL=fixtures.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/atom/drag-and-drop/test/fixtures.js"],"names":["t","pass","AtomDragAndDrop","propTypes","value","key","not","undefined","renderComponentMacro","fixtureDefault","fixtureLoading","fixtureWithChildren","fixtureWithImageReset","fixtureWithImage","fixtureWithVideo"],"mappings":";;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,kBAAK,sDAAL,EAA6DA,CAAC,IAAI;AAChEA,EAAAA,CAAC,CAACC,IAAF;AACA,wBAAQC,UAAgBC,SAAxB,EAAmC,CAACC,KAAD,EAAQC,GAAR,KAAgB;AACjDL,IAAAA,CAAC,CAACM,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,gDAA+CF,GAAI,mEAA5E;AACD,GAFD;AAGD,CALD;AAOA,kBAAK,uDAAL,
|
|
1
|
+
{"version":3,"sources":["../../../../src/atom/drag-and-drop/test/fixtures.js"],"names":["t","pass","AtomDragAndDrop","propTypes","value","key","not","undefined","renderComponentMacro","fixtureCleanAndModified","fixtureDefault","fixtureError","fixtureLoading","fixtureModified","fixtureWithChildren","fixtureWithImageReset","fixtureWithImage","fixtureWithLongDescription","fixtureWithVideo"],"mappings":";;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,kBAAK,sDAAL,EAA6DA,CAAC,IAAI;AAChEA,EAAAA,CAAC,CAACC,IAAF;AACA,wBAAQC,UAAgBC,SAAxB,EAAmC,CAACC,KAAD,EAAQC,GAAR,KAAgB;AACjDL,IAAAA,CAAC,CAACM,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,gDAA+CF,GAAI,mEAA5E;AACD,GAFD;AAGD,CALD;AAOA,kBAAK,gEAAL,EAAuEG,wBAAvE,EAA6FN,SAA7F,EAA8GO,yBAA9G;AACA,kBAAK,uDAAL,EAA8DD,wBAA9D,EAAoFN,SAApF,EAAqGQ,gBAArG;AACA,kBAAK,qDAAL,EAA4DF,wBAA5D,EAAkFN,SAAlF,EAAmGS,cAAnG;AACA,kBAAK,uDAAL,EAA8DH,wBAA9D,EAAoFN,SAApF,EAAqGU,gBAArG;AACA,kBAAK,wDAAL,EAA+DJ,wBAA/D,EAAqFN,SAArF,EAAsGW,iBAAtG;AACA,kBAAK,4DAAL,EAAmEL,wBAAnE,EAAyFN,SAAzF,EAA0GY,qBAA1G;AACA,kBAAK,8DAAL,EAAqEN,wBAArE,EAA2FN,SAA3F,EAA4Ga,uBAA5G;AACA,kBAAK,yDAAL,EAAgEP,wBAAhE,EAAsFN,SAAtF,EAAuGc,kBAAvG;AACA,kBAAK,mEAAL,EAA0ER,wBAA1E,EAAgGN,SAAhG,EAAiHe,4BAAjH;AACA,kBAAK,yDAAL,EAAgET,wBAAhE,EAAsFN,SAAtF,EAAuGgB,kBAAvG","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"}
|
|
@@ -41,7 +41,8 @@ const ImageUpload = ({
|
|
|
41
41
|
onReset = null,
|
|
42
42
|
name,
|
|
43
43
|
// See ImagePropType for accepted values
|
|
44
|
-
imageTypes = ['*']
|
|
44
|
+
imageTypes = ['*'],
|
|
45
|
+
error = ''
|
|
45
46
|
}) => {
|
|
46
47
|
const handleReset = (0, _react.useCallback)(e => {
|
|
47
48
|
if ((0, _isNil2.default)(onReset)) return;
|
|
@@ -57,7 +58,8 @@ const ImageUpload = ({
|
|
|
57
58
|
uploadLabel: uploadLabel,
|
|
58
59
|
loading: loading,
|
|
59
60
|
modified: modified,
|
|
60
|
-
onReset: handleReset
|
|
61
|
+
onReset: handleReset,
|
|
62
|
+
error: error
|
|
61
63
|
}, (onDragStart, onDragStop) => /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("input", {
|
|
62
64
|
type: "file",
|
|
63
65
|
name: name,
|
|
@@ -75,7 +77,8 @@ ImageUpload.propTypes = process.env.NODE_ENV !== "production" ? _extends(_extend
|
|
|
75
77
|
name: _propTypes.default.string,
|
|
76
78
|
onChange: _propTypes.default.func,
|
|
77
79
|
onReset: _propTypes.default.func,
|
|
78
|
-
imageTypes: _propTypes.default.arrayOf(_proptypes.ImagePropType)
|
|
80
|
+
imageTypes: _propTypes.default.arrayOf(_proptypes.ImagePropType),
|
|
81
|
+
error: _propTypes.default.string
|
|
79
82
|
}) : {};
|
|
80
83
|
var _default = ImageUpload;
|
|
81
84
|
exports.default = _default;
|