@coorpacademy/components 10.5.5 → 10.5.7-alpha.12
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/range/handle.css +18 -2
- package/es/atom/range/handle.js +7 -3
- package/es/atom/range/handle.js.map +1 -1
- package/es/atom/range/style.css +2 -2
- package/es/atom/select/index.js +38 -20
- package/es/atom/select/index.js.map +1 -1
- package/es/atom/select/style.css +129 -40
- package/es/atom/select/test/fixtures/player.js +11 -0
- package/es/atom/select/test/fixtures/player.js.map +1 -0
- package/es/atom/select/test/fixtures.js +2 -0
- package/es/atom/select/test/fixtures.js.map +1 -1
- package/es/atom/select/test/select.js +49 -0
- package/es/atom/select/test/select.js.map +1 -0
- package/es/molecule/course-section/index.js +5 -3
- package/es/molecule/course-section/index.js.map +1 -1
- package/es/molecule/course-section/style.css +2 -1
- package/es/molecule/course-section/test/fixtures/chapter.js +2 -1
- package/es/molecule/course-section/test/fixtures/chapter.js.map +1 -1
- package/es/molecule/course-section/test/fixtures/course.js +2 -1
- package/es/molecule/course-section/test/fixtures/course.js.map +1 -1
- package/es/molecule/course-sections/index.js +40 -0
- package/es/molecule/course-sections/index.js.map +1 -0
- package/es/molecule/course-sections/style.css +3 -0
- package/es/molecule/course-sections/test/fixtures/default.js +149 -0
- package/es/molecule/course-sections/test/fixtures/default.js.map +1 -0
- package/es/molecule/course-sections/test/fixtures/loading.js +9 -0
- package/es/molecule/course-sections/test/fixtures/loading.js.map +1 -0
- package/es/molecule/course-sections/test/fixtures.js +15 -0
- package/es/molecule/course-sections/test/fixtures.js.map +1 -0
- package/es/molecule/draggable/index.js +1 -1
- package/es/molecule/draggable/index.js.map +1 -1
- package/es/molecule/draggable/style.css +1 -5
- package/es/molecule/draggable-list/index.js +6 -4
- package/es/molecule/draggable-list/index.js.map +1 -1
- package/es/molecule/draggable-list/test/fixtures/course-sections.js +20 -0
- package/es/molecule/draggable-list/test/fixtures/course-sections.js.map +1 -0
- package/es/molecule/draggable-list/test/fixtures.js +2 -0
- package/es/molecule/draggable-list/test/fixtures.js.map +1 -1
- package/es/molecule/draggable-list/test/on-drop.js +13 -13
- package/es/molecule/draggable-list/test/on-drop.js.map +1 -1
- package/es/molecule/questions/drop-down/index.js +1 -6
- package/es/molecule/questions/drop-down/index.js.map +1 -1
- package/es/molecule/questions/free-text/index.js +35 -15
- package/es/molecule/questions/free-text/index.js.map +1 -1
- package/es/molecule/questions/free-text/style.css +39 -15
- package/es/molecule/questions/free-text/test/fixtures/default.js +1 -1
- package/es/molecule/questions/free-text/test/fixtures/default.js.map +1 -1
- package/es/molecule/questions/free-text/test/fixtures/with-value-on-change.js +9 -0
- package/es/molecule/questions/free-text/test/fixtures/with-value-on-change.js.map +1 -0
- package/es/molecule/questions/free-text/test/fixtures/{with-default-value.js → with-value.js} +2 -2
- package/es/molecule/questions/free-text/test/fixtures/with-value.js.map +1 -0
- package/es/molecule/questions/free-text/test/fixtures.js +4 -2
- package/es/molecule/questions/free-text/test/fixtures.js.map +1 -1
- package/es/molecule/questions/free-text/test/free-text.js +106 -0
- package/es/molecule/questions/free-text/test/free-text.js.map +1 -0
- package/es/molecule/questions/qcm/index.js +37 -25
- package/es/molecule/questions/qcm/index.js.map +1 -1
- package/es/molecule/questions/qcm/style.css +48 -14
- package/es/molecule/questions/qcm/test/fixtures/default.js +8 -0
- package/es/molecule/questions/qcm/test/fixtures/default.js.map +1 -1
- package/es/molecule/questions/qcm/test/qcm.js +103 -0
- package/es/molecule/questions/qcm/test/qcm.js.map +1 -0
- package/es/molecule/questions/qcm-graphic/index.js +35 -17
- package/es/molecule/questions/qcm-graphic/index.js.map +1 -1
- package/es/molecule/questions/qcm-graphic/style.css +64 -13
- package/es/molecule/questions/qcm-graphic/test/qcm-graphic.js +65 -0
- package/es/molecule/questions/qcm-graphic/test/qcm-graphic.js.map +1 -0
- package/es/molecule/questions/question-range/style.css +9 -8
- package/es/molecule/questions/template/index.js +13 -10
- package/es/molecule/questions/template/index.js.map +1 -1
- package/es/molecule/setup-section/style.css +1 -0
- package/es/molecule/wizard-summary/test/fixtures/organize-courses.js +106 -0
- package/es/molecule/wizard-summary/test/fixtures/organize-courses.js.map +1 -0
- package/es/molecule/wizard-summary/test/fixtures.js +2 -0
- package/es/molecule/wizard-summary/test/fixtures.js.map +1 -1
- package/es/organism/wizard-contents/index.js +6 -0
- package/es/organism/wizard-contents/index.js.map +1 -1
- package/es/organism/wizard-contents/test/fixtures/playlist-organize-courses.js +45 -0
- package/es/organism/wizard-contents/test/fixtures/playlist-organize-courses.js.map +1 -0
- package/es/organism/wizard-contents/test/fixtures.js +2 -0
- package/es/organism/wizard-contents/test/fixtures.js.map +1 -1
- package/es/template/back-office/brand-update/test/fixtures/wizard-organize-courses-playlist.js +22 -0
- package/es/template/back-office/brand-update/test/fixtures/wizard-organize-courses-playlist.js.map +1 -0
- package/es/template/back-office/brand-update/test/fixtures.js +2 -0
- package/es/template/back-office/brand-update/test/fixtures.js.map +1 -1
- package/es/util/get-shadow-box-color-from-primary.js +4 -0
- package/es/util/get-shadow-box-color-from-primary.js.map +1 -0
- package/es/util/test/get-shadow-box-color-from-primary.js +33 -0
- package/es/util/test/get-shadow-box-color-from-primary.js.map +1 -0
- package/es/variables/colors.css +3 -0
- package/lib/atom/range/handle.css +18 -2
- package/lib/atom/range/handle.js +8 -3
- package/lib/atom/range/handle.js.map +1 -1
- package/lib/atom/range/style.css +2 -2
- package/lib/atom/select/index.js +40 -17
- package/lib/atom/select/index.js.map +1 -1
- package/lib/atom/select/style.css +129 -40
- package/lib/atom/select/test/fixtures/player.js +21 -0
- package/lib/atom/select/test/fixtures/player.js.map +1 -0
- package/lib/atom/select/test/fixtures.js +3 -0
- package/lib/atom/select/test/fixtures.js.map +1 -1
- package/lib/atom/select/test/select.js +62 -0
- package/lib/atom/select/test/select.js.map +1 -0
- package/lib/molecule/course-section/index.js +5 -3
- package/lib/molecule/course-section/index.js.map +1 -1
- package/lib/molecule/course-section/style.css +2 -1
- package/lib/molecule/course-section/test/fixtures/chapter.js +2 -1
- package/lib/molecule/course-section/test/fixtures/chapter.js.map +1 -1
- package/lib/molecule/course-section/test/fixtures/course.js +2 -1
- package/lib/molecule/course-section/test/fixtures/course.js.map +1 -1
- package/lib/molecule/course-sections/index.js +54 -0
- package/lib/molecule/course-sections/index.js.map +1 -0
- package/lib/molecule/course-sections/style.css +3 -0
- package/lib/molecule/course-sections/test/fixtures/default.js +154 -0
- package/lib/molecule/course-sections/test/fixtures/default.js.map +1 -0
- package/lib/molecule/course-sections/test/fixtures/loading.js +14 -0
- package/lib/molecule/course-sections/test/fixtures/loading.js.map +1 -0
- package/lib/molecule/course-sections/test/fixtures.js +25 -0
- package/lib/molecule/course-sections/test/fixtures.js.map +1 -0
- package/lib/molecule/draggable/index.js +1 -1
- package/lib/molecule/draggable/index.js.map +1 -1
- package/lib/molecule/draggable/style.css +1 -5
- package/lib/molecule/draggable-list/index.js +7 -4
- package/lib/molecule/draggable-list/index.js.map +1 -1
- package/lib/molecule/draggable-list/test/fixtures/course-sections.js +29 -0
- package/lib/molecule/draggable-list/test/fixtures/course-sections.js.map +1 -0
- package/lib/molecule/draggable-list/test/fixtures.js +3 -0
- package/lib/molecule/draggable-list/test/fixtures.js.map +1 -1
- package/lib/molecule/draggable-list/test/on-drop.js +13 -13
- package/lib/molecule/draggable-list/test/on-drop.js.map +1 -1
- package/lib/molecule/questions/drop-down/index.js +1 -5
- package/lib/molecule/questions/drop-down/index.js.map +1 -1
- package/lib/molecule/questions/free-text/index.js +32 -14
- package/lib/molecule/questions/free-text/index.js.map +1 -1
- package/lib/molecule/questions/free-text/style.css +39 -15
- package/lib/molecule/questions/free-text/test/fixtures/default.js +1 -1
- package/lib/molecule/questions/free-text/test/fixtures/default.js.map +1 -1
- package/lib/molecule/questions/free-text/test/fixtures/with-value-on-change.js +14 -0
- package/lib/molecule/questions/free-text/test/fixtures/with-value-on-change.js.map +1 -0
- package/lib/molecule/questions/free-text/test/fixtures/{with-default-value.js → with-value.js} +2 -2
- package/lib/molecule/questions/free-text/test/fixtures/with-value.js.map +1 -0
- package/lib/molecule/questions/free-text/test/fixtures.js +5 -2
- package/lib/molecule/questions/free-text/test/fixtures.js.map +1 -1
- package/lib/molecule/questions/free-text/test/free-text.js +119 -0
- package/lib/molecule/questions/free-text/test/free-text.js.map +1 -0
- package/lib/molecule/questions/qcm/index.js +44 -23
- package/lib/molecule/questions/qcm/index.js.map +1 -1
- package/lib/molecule/questions/qcm/style.css +48 -14
- package/lib/molecule/questions/qcm/test/fixtures/default.js +8 -0
- package/lib/molecule/questions/qcm/test/fixtures/default.js.map +1 -1
- package/lib/molecule/questions/qcm/test/qcm.js +115 -0
- package/lib/molecule/questions/qcm/test/qcm.js.map +1 -0
- package/lib/molecule/questions/qcm-graphic/index.js +33 -15
- package/lib/molecule/questions/qcm-graphic/index.js.map +1 -1
- package/lib/molecule/questions/qcm-graphic/style.css +64 -13
- package/lib/molecule/questions/qcm-graphic/test/qcm-graphic.js +76 -0
- package/lib/molecule/questions/qcm-graphic/test/qcm-graphic.js.map +1 -0
- package/lib/molecule/questions/question-range/style.css +9 -8
- package/lib/molecule/questions/template/index.js +13 -10
- package/lib/molecule/questions/template/index.js.map +1 -1
- package/lib/molecule/setup-section/style.css +1 -0
- package/lib/molecule/wizard-summary/test/fixtures/organize-courses.js +111 -0
- package/lib/molecule/wizard-summary/test/fixtures/organize-courses.js.map +1 -0
- package/lib/molecule/wizard-summary/test/fixtures.js +3 -0
- package/lib/molecule/wizard-summary/test/fixtures.js.map +1 -1
- package/lib/organism/wizard-contents/index.js +7 -0
- package/lib/organism/wizard-contents/index.js.map +1 -1
- package/lib/organism/wizard-contents/test/fixtures/playlist-organize-courses.js +54 -0
- package/lib/organism/wizard-contents/test/fixtures/playlist-organize-courses.js.map +1 -0
- package/lib/organism/wizard-contents/test/fixtures.js +3 -0
- package/lib/organism/wizard-contents/test/fixtures.js.map +1 -1
- package/lib/template/back-office/brand-update/test/fixtures/wizard-organize-courses-playlist.js +32 -0
- package/lib/template/back-office/brand-update/test/fixtures/wizard-organize-courses-playlist.js.map +1 -0
- package/lib/template/back-office/brand-update/test/fixtures.js +3 -0
- package/lib/template/back-office/brand-update/test/fixtures.js.map +1 -1
- package/lib/util/get-shadow-box-color-from-primary.js +12 -0
- package/lib/util/get-shadow-box-color-from-primary.js.map +1 -0
- package/lib/util/test/get-shadow-box-color-from-primary.js +40 -0
- package/lib/util/test/get-shadow-box-color-from-primary.js.map +1 -0
- package/lib/variables/colors.css +3 -0
- package/package.json +2 -2
- package/es/molecule/questions/free-text/test/fixtures/with-default-value.js.map +0 -1
- package/es/molecule/search/test/fixtures.js +0 -15
- package/es/molecule/search/test/fixtures.js.map +0 -1
- package/lib/molecule/questions/free-text/test/fixtures/with-default-value.js.map +0 -1
- package/lib/molecule/search/test/fixtures.js +0 -25
- package/lib/molecule/search/test/fixtures.js.map +0 -1
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
@value white from colors;
|
|
11
11
|
@value xtraLightGrey from colors;
|
|
12
12
|
@value transparent from colors;
|
|
13
|
+
@value box_shadow_light_dark from colors;
|
|
14
|
+
@value cm_blue_900 from colors;
|
|
13
15
|
|
|
14
16
|
.default {
|
|
15
17
|
display: flex;
|
|
@@ -23,7 +25,11 @@
|
|
|
23
25
|
composes: default;
|
|
24
26
|
}
|
|
25
27
|
|
|
26
|
-
.
|
|
28
|
+
.selectWrapper {
|
|
29
|
+
position: relative;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.default .selectWrapper {
|
|
27
33
|
display: flex;
|
|
28
34
|
align-items: center;
|
|
29
35
|
height: 50px;
|
|
@@ -41,20 +47,16 @@
|
|
|
41
47
|
width: 180px;
|
|
42
48
|
}
|
|
43
49
|
|
|
44
|
-
.
|
|
50
|
+
.selectSpan {
|
|
45
51
|
display: none;
|
|
46
|
-
position:
|
|
52
|
+
position: relative;
|
|
53
|
+
z-index: 10;
|
|
47
54
|
white-space: nowrap;
|
|
48
|
-
overflow: hidden;
|
|
49
|
-
left: 0;
|
|
50
|
-
right: 0;
|
|
51
|
-
bottom: 0;
|
|
52
55
|
pointer-events: none;
|
|
53
|
-
text-overflow: ellipsis;
|
|
54
56
|
height: 18px;
|
|
55
57
|
}
|
|
56
58
|
|
|
57
|
-
.default
|
|
59
|
+
.default .selectBox {
|
|
58
60
|
font-family: "Gilroy";
|
|
59
61
|
text-transform: none;
|
|
60
62
|
padding: 0 15px;
|
|
@@ -68,6 +70,18 @@
|
|
|
68
70
|
outline: none;
|
|
69
71
|
appearance: none;
|
|
70
72
|
cursor: pointer;
|
|
73
|
+
position: absolute;
|
|
74
|
+
left: 0;
|
|
75
|
+
right: 0;
|
|
76
|
+
bottom: 0;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.selectOption,
|
|
80
|
+
|
|
81
|
+
.no-label .selectWrapper,
|
|
82
|
+
.player .selectWrapper {
|
|
83
|
+
min-width: min-content;
|
|
84
|
+
height: min-content;
|
|
71
85
|
}
|
|
72
86
|
|
|
73
87
|
.modified select {
|
|
@@ -112,6 +126,7 @@
|
|
|
112
126
|
pointer-events: none;
|
|
113
127
|
width: 12px;
|
|
114
128
|
height: 12px;
|
|
129
|
+
z-index: 11;
|
|
115
130
|
}
|
|
116
131
|
|
|
117
132
|
@media mobile {
|
|
@@ -121,7 +136,7 @@
|
|
|
121
136
|
}
|
|
122
137
|
}
|
|
123
138
|
|
|
124
|
-
.default
|
|
139
|
+
.default .selectBox[multiple] {
|
|
125
140
|
padding: 0;
|
|
126
141
|
height: 80px;
|
|
127
142
|
}
|
|
@@ -130,7 +145,7 @@
|
|
|
130
145
|
Filter
|
|
131
146
|
*/
|
|
132
147
|
|
|
133
|
-
.filter
|
|
148
|
+
.filter .selectWrapper {
|
|
134
149
|
display: flex;
|
|
135
150
|
align-items: center;
|
|
136
151
|
position: relative;
|
|
@@ -140,7 +155,7 @@
|
|
|
140
155
|
margin: 0;
|
|
141
156
|
}
|
|
142
157
|
|
|
143
|
-
.filter .
|
|
158
|
+
.filter .selectSpan {
|
|
144
159
|
display: block;
|
|
145
160
|
padding: 15px 30px 15px 15px;
|
|
146
161
|
font-size: 12px;
|
|
@@ -157,7 +172,7 @@
|
|
|
157
172
|
margin-bottom: 10px;
|
|
158
173
|
}
|
|
159
174
|
|
|
160
|
-
.filter
|
|
175
|
+
.filter .selectBox {
|
|
161
176
|
display: block;
|
|
162
177
|
width: 100%;
|
|
163
178
|
height: 50px;
|
|
@@ -186,57 +201,110 @@
|
|
|
186
201
|
position: relative;
|
|
187
202
|
}
|
|
188
203
|
|
|
189
|
-
.no-label
|
|
204
|
+
.no-label .selectWrapper {
|
|
190
205
|
display: flex;
|
|
191
206
|
align-items: center;
|
|
192
|
-
height:
|
|
207
|
+
min-height: 54px;
|
|
193
208
|
position: relative;
|
|
194
209
|
flex-grow: 0;
|
|
195
210
|
}
|
|
196
211
|
|
|
197
|
-
.
|
|
212
|
+
.noLabelCommon {
|
|
198
213
|
display: block;
|
|
199
214
|
padding: 0 30px 0 10px;
|
|
200
215
|
font-size: 14px;
|
|
216
|
+
height: 54px;
|
|
217
|
+
line-height: 52px;
|
|
218
|
+
box-sizing: border-box;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
div.default label.selectWrapper span.longLabel {
|
|
222
|
+
min-width: 230px;
|
|
223
|
+
max-width: 280px;
|
|
224
|
+
white-space: pre-wrap;
|
|
225
|
+
line-height: 22px;
|
|
226
|
+
padding-top: 15px;
|
|
227
|
+
padding-bottom: 15px;
|
|
228
|
+
height: auto;
|
|
229
|
+
border: none;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
div:not(.player) .noLabelCommon.selectSpan {
|
|
201
233
|
border: 1px solid light;
|
|
202
234
|
background: white;
|
|
203
235
|
border-radius: 2px;
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
div.player .noLabelCommon.selectSpan {
|
|
239
|
+
box-shadow: 0px 4px 16px box_shadow_light_dark;
|
|
240
|
+
border-radius: 8px;
|
|
241
|
+
min-width: min-content;
|
|
242
|
+
width: 100%;
|
|
207
243
|
white-space: nowrap;
|
|
208
|
-
text-overflow: ellipsis;
|
|
209
244
|
}
|
|
210
245
|
|
|
211
|
-
.no-label
|
|
246
|
+
.no-label .selectBox {
|
|
212
247
|
font-family: "Gilroy";
|
|
213
248
|
text-transform: none;
|
|
214
249
|
padding: 0 15px;
|
|
215
|
-
height:
|
|
250
|
+
height: 54px;
|
|
216
251
|
border-radius: 2px;
|
|
217
|
-
font-size:
|
|
252
|
+
font-size: 14px;
|
|
218
253
|
color: black;
|
|
219
254
|
font-weight: normal;
|
|
220
255
|
margin-left: 0;
|
|
221
256
|
width: 230px;
|
|
257
|
+
max-width: 280px;
|
|
222
258
|
cursor: pointer;
|
|
223
259
|
background: white;
|
|
224
260
|
border: 2px solid xtraLightGrey;
|
|
225
261
|
}
|
|
226
262
|
|
|
227
263
|
@media mobile {
|
|
228
|
-
.
|
|
229
|
-
|
|
230
|
-
|
|
264
|
+
div.player .selectBox {
|
|
265
|
+
min-width: 0;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
.no-label .selectBox {
|
|
231
269
|
margin-left: 0;
|
|
232
270
|
border-radius: 0;
|
|
271
|
+
position: absolute;
|
|
272
|
+
left: 0;
|
|
273
|
+
right: 0;
|
|
274
|
+
bottom: 0;
|
|
233
275
|
}
|
|
234
276
|
|
|
235
|
-
.no-label
|
|
277
|
+
.no-label .selectWrapper {
|
|
236
278
|
display: block;
|
|
237
279
|
margin-right: 0;
|
|
238
280
|
width: 100%;
|
|
239
|
-
height: 44px;
|
|
281
|
+
min-height: 44px;
|
|
282
|
+
height: min-content;
|
|
283
|
+
min-width: 250px;
|
|
284
|
+
max-width: 280px;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
.player .noLabelCommon {
|
|
288
|
+
height: min-content;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
div.player .noLabelCommon.selectSpan {
|
|
292
|
+
min-width: 250px;
|
|
293
|
+
max-width: 280px;
|
|
294
|
+
white-space: pre-wrap;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
.noLabelCommon.longLabel {
|
|
298
|
+
line-height: 22px;
|
|
299
|
+
height: 100%;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
.player.default .selectBox {
|
|
303
|
+
position: absolute;
|
|
304
|
+
top: 0px;
|
|
305
|
+
left: 0px;
|
|
306
|
+
width: 100%;
|
|
307
|
+
height: 100%;
|
|
240
308
|
}
|
|
241
309
|
}
|
|
242
310
|
|
|
@@ -248,12 +316,16 @@
|
|
|
248
316
|
composes: no-label;
|
|
249
317
|
}
|
|
250
318
|
|
|
251
|
-
.invalid
|
|
319
|
+
.invalid .player {
|
|
320
|
+
color: cm_blue_900;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
.invalid .selectWrapper {
|
|
252
324
|
height: 54px;
|
|
253
325
|
color: black;
|
|
254
326
|
}
|
|
255
327
|
|
|
256
|
-
.invalid .
|
|
328
|
+
.invalid .selectSpan {
|
|
257
329
|
font-size: 15px;
|
|
258
330
|
font-weight: 700;
|
|
259
331
|
border: 2px solid;
|
|
@@ -271,7 +343,7 @@
|
|
|
271
343
|
width: 150px;
|
|
272
344
|
}
|
|
273
345
|
|
|
274
|
-
.mooc
|
|
346
|
+
.mooc .selectWrapper {
|
|
275
347
|
margin: 0;
|
|
276
348
|
height: 35px;
|
|
277
349
|
border: 0;
|
|
@@ -307,11 +379,11 @@
|
|
|
307
379
|
composes: no-label;
|
|
308
380
|
}
|
|
309
381
|
|
|
310
|
-
.question
|
|
382
|
+
.question .selectWrapper {
|
|
311
383
|
height: 54px;
|
|
312
384
|
}
|
|
313
385
|
|
|
314
|
-
.question .
|
|
386
|
+
.question .selectSpan {
|
|
315
387
|
font-size: 15px;
|
|
316
388
|
font-weight: 700;
|
|
317
389
|
border: 2px solid;
|
|
@@ -328,7 +400,7 @@
|
|
|
328
400
|
margin-bottom: 10px;
|
|
329
401
|
}
|
|
330
402
|
|
|
331
|
-
.sort
|
|
403
|
+
.sort .selectWrapper {
|
|
332
404
|
display: flex;
|
|
333
405
|
align-items: center;
|
|
334
406
|
position: relative;
|
|
@@ -338,7 +410,7 @@
|
|
|
338
410
|
margin: 0;
|
|
339
411
|
}
|
|
340
412
|
|
|
341
|
-
.sort .
|
|
413
|
+
.sort .selectSpan {
|
|
342
414
|
display: block;
|
|
343
415
|
padding: 15px 30px 15px 15px;
|
|
344
416
|
font-size: 12px;
|
|
@@ -379,6 +451,14 @@
|
|
|
379
451
|
composes: no-label;
|
|
380
452
|
}
|
|
381
453
|
|
|
454
|
+
/*
|
|
455
|
+
Player
|
|
456
|
+
*/
|
|
457
|
+
|
|
458
|
+
.player {
|
|
459
|
+
composes: no-label;
|
|
460
|
+
}
|
|
461
|
+
|
|
382
462
|
/*
|
|
383
463
|
Header
|
|
384
464
|
*/
|
|
@@ -388,6 +468,15 @@
|
|
|
388
468
|
width: auto;
|
|
389
469
|
}
|
|
390
470
|
|
|
471
|
+
.default .selectWrapper select.selectBox {
|
|
472
|
+
max-width: 280px;
|
|
473
|
+
width: inherit;
|
|
474
|
+
border-radius: 8px;
|
|
475
|
+
padding: 0;
|
|
476
|
+
height: 100%;
|
|
477
|
+
top: 0;
|
|
478
|
+
}
|
|
479
|
+
|
|
391
480
|
.header select {
|
|
392
481
|
background-color: light;
|
|
393
482
|
border: 0;
|
|
@@ -420,7 +509,7 @@
|
|
|
420
509
|
composes: no-label;
|
|
421
510
|
}
|
|
422
511
|
|
|
423
|
-
.template
|
|
512
|
+
.template .selectBox {
|
|
424
513
|
width: auto;
|
|
425
514
|
height: 54px;
|
|
426
515
|
padding: 0 50px 0 0;
|
|
@@ -428,22 +517,22 @@
|
|
|
428
517
|
max-width: 100%;
|
|
429
518
|
}
|
|
430
519
|
|
|
431
|
-
.template .
|
|
520
|
+
.template .selectSpan {
|
|
432
521
|
font-size: 15px;
|
|
433
522
|
font-weight: 700;
|
|
434
523
|
height: 54px;
|
|
435
524
|
line-height: 52px;
|
|
436
525
|
}
|
|
437
526
|
|
|
438
|
-
.selected.template .
|
|
527
|
+
.selected.template .selectSpan {
|
|
439
528
|
border: 1px solid;
|
|
440
529
|
}
|
|
441
530
|
|
|
442
|
-
.unselected.template .
|
|
531
|
+
.unselected.template .selectSpan {
|
|
443
532
|
border: 1px solid color(black lightness(85%));
|
|
444
533
|
}
|
|
445
534
|
|
|
446
|
-
.template
|
|
535
|
+
.template .selectWrapper {
|
|
447
536
|
display: block;
|
|
448
537
|
width: auto;
|
|
449
538
|
margin-right: 0;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.default = void 0;
|
|
5
|
+
|
|
6
|
+
var _defaultsDeep2 = _interopRequireDefault(require("lodash/fp/defaultsDeep"));
|
|
7
|
+
|
|
8
|
+
var _default2 = _interopRequireDefault(require("./default"));
|
|
9
|
+
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
|
|
12
|
+
const {
|
|
13
|
+
props
|
|
14
|
+
} = _default2.default;
|
|
15
|
+
var _default = {
|
|
16
|
+
props: (0, _defaultsDeep2.default)(props, {
|
|
17
|
+
theme: 'player'
|
|
18
|
+
})
|
|
19
|
+
};
|
|
20
|
+
exports.default = _default;
|
|
21
|
+
//# sourceMappingURL=player.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/atom/select/test/fixtures/player.js"],"names":["props","Default","theme"],"mappings":";;;;;;;AACA;;;;AAEA,MAAM;AAACA,EAAAA;AAAD,IAAUC,iBAAhB;eAEe;AACbD,EAAAA,KAAK,EAAE,4BAAaA,KAAb,EAAoB;AACzBE,IAAAA,KAAK,EAAE;AADkB,GAApB;AADM,C","sourcesContent":["import {defaultsDeep} from 'lodash/fp';\nimport Default from './default';\n\nconst {props} = Default;\n\nexport default {\n props: defaultsDeep(props, {\n theme: 'player'\n })\n};\n"],"file":"player.js"}
|
|
@@ -26,6 +26,8 @@ var _multipleSelected = _interopRequireDefault(require("./fixtures/multiple-sele
|
|
|
26
26
|
|
|
27
27
|
var _multiple = _interopRequireDefault(require("./fixtures/multiple"));
|
|
28
28
|
|
|
29
|
+
var _player = _interopRequireDefault(require("./fixtures/player"));
|
|
30
|
+
|
|
29
31
|
var _question = _interopRequireDefault(require("./fixtures/question"));
|
|
30
32
|
|
|
31
33
|
var _requiredWithTitle = _interopRequireDefault(require("./fixtures/required-with-title"));
|
|
@@ -57,6 +59,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
57
59
|
(0, _ava.default)('Atom › AtomSelect › Mooc › should be rendered', _renderComponent.default, _.default, _mooc.default);
|
|
58
60
|
(0, _ava.default)('Atom › AtomSelect › MultipleSelected › should be rendered', _renderComponent.default, _.default, _multipleSelected.default);
|
|
59
61
|
(0, _ava.default)('Atom › AtomSelect › Multiple › should be rendered', _renderComponent.default, _.default, _multiple.default);
|
|
62
|
+
(0, _ava.default)('Atom › AtomSelect › Player › should be rendered', _renderComponent.default, _.default, _player.default);
|
|
60
63
|
(0, _ava.default)('Atom › AtomSelect › Question › should be rendered', _renderComponent.default, _.default, _question.default);
|
|
61
64
|
(0, _ava.default)('Atom › AtomSelect › RequiredWithTitle › should be rendered', _renderComponent.default, _.default, _requiredWithTitle.default);
|
|
62
65
|
(0, _ava.default)('Atom › AtomSelect › Required › should be rendered', _renderComponent.default, _.default, _required.default);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/atom/select/test/fixtures.js"],"names":["t","pass","AtomSelect","propTypes","value","key","not","undefined","renderComponentMacro","fixtureDefault","fixtureDisabled","fixtureError","fixtureFilter","fixtureInvalid","fixtureModified","fixtureMooc","fixtureMultipleSelected","fixtureMultiple","fixtureQuestion","fixtureRequiredWithTitle","fixtureRequired","fixtureSort","fixtureTemplate","fixtureThematiquesLong","fixtureThematiques"],"mappings":";;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,kBAAK,iDAAL,EAAwDA,CAAC,IAAI;AAC3DA,EAAAA,CAAC,CAACC,IAAF;AACA,wBAAQC,UAAWC,SAAnB,EAA8B,CAACC,KAAD,EAAQC,GAAR,KAAgB;AAC5CL,IAAAA,CAAC,CAACM,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,2CAA0CF,GAAI,mEAAvE;AACD,GAFD;AAGD,CALD;AAOA,kBAAK,kDAAL,EAAyDG,wBAAzD,EAA+EN,SAA/E,EAA2FO,gBAA3F;AACA,kBAAK,mDAAL,EAA0DD,wBAA1D,EAAgFN,SAAhF,EAA4FQ,iBAA5F;AACA,kBAAK,gDAAL,EAAuDF,wBAAvD,EAA6EN,SAA7E,EAAyFS,cAAzF;AACA,kBAAK,iDAAL,EAAwDH,wBAAxD,EAA8EN,SAA9E,EAA0FU,eAA1F;AACA,kBAAK,kDAAL,EAAyDJ,wBAAzD,EAA+EN,SAA/E,EAA2FW,gBAA3F;AACA,kBAAK,mDAAL,EAA0DL,wBAA1D,EAAgFN,SAAhF,EAA4FY,iBAA5F;AACA,kBAAK,+CAAL,EAAsDN,wBAAtD,EAA4EN,SAA5E,EAAwFa,aAAxF;AACA,kBAAK,2DAAL,EAAkEP,wBAAlE,EAAwFN,SAAxF,EAAoGc,yBAApG;AACA,kBAAK,mDAAL,EAA0DR,wBAA1D,EAAgFN,SAAhF,EAA4Fe,iBAA5F;AACA,kBAAK,mDAAL,
|
|
1
|
+
{"version":3,"sources":["../../../../src/atom/select/test/fixtures.js"],"names":["t","pass","AtomSelect","propTypes","value","key","not","undefined","renderComponentMacro","fixtureDefault","fixtureDisabled","fixtureError","fixtureFilter","fixtureInvalid","fixtureModified","fixtureMooc","fixtureMultipleSelected","fixtureMultiple","fixturePlayer","fixtureQuestion","fixtureRequiredWithTitle","fixtureRequired","fixtureSort","fixtureTemplate","fixtureThematiquesLong","fixtureThematiques"],"mappings":";;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,kBAAK,iDAAL,EAAwDA,CAAC,IAAI;AAC3DA,EAAAA,CAAC,CAACC,IAAF;AACA,wBAAQC,UAAWC,SAAnB,EAA8B,CAACC,KAAD,EAAQC,GAAR,KAAgB;AAC5CL,IAAAA,CAAC,CAACM,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,2CAA0CF,GAAI,mEAAvE;AACD,GAFD;AAGD,CALD;AAOA,kBAAK,kDAAL,EAAyDG,wBAAzD,EAA+EN,SAA/E,EAA2FO,gBAA3F;AACA,kBAAK,mDAAL,EAA0DD,wBAA1D,EAAgFN,SAAhF,EAA4FQ,iBAA5F;AACA,kBAAK,gDAAL,EAAuDF,wBAAvD,EAA6EN,SAA7E,EAAyFS,cAAzF;AACA,kBAAK,iDAAL,EAAwDH,wBAAxD,EAA8EN,SAA9E,EAA0FU,eAA1F;AACA,kBAAK,kDAAL,EAAyDJ,wBAAzD,EAA+EN,SAA/E,EAA2FW,gBAA3F;AACA,kBAAK,mDAAL,EAA0DL,wBAA1D,EAAgFN,SAAhF,EAA4FY,iBAA5F;AACA,kBAAK,+CAAL,EAAsDN,wBAAtD,EAA4EN,SAA5E,EAAwFa,aAAxF;AACA,kBAAK,2DAAL,EAAkEP,wBAAlE,EAAwFN,SAAxF,EAAoGc,yBAApG;AACA,kBAAK,mDAAL,EAA0DR,wBAA1D,EAAgFN,SAAhF,EAA4Fe,iBAA5F;AACA,kBAAK,iDAAL,EAAwDT,wBAAxD,EAA8EN,SAA9E,EAA0FgB,eAA1F;AACA,kBAAK,mDAAL,EAA0DV,wBAA1D,EAAgFN,SAAhF,EAA4FiB,iBAA5F;AACA,kBAAK,4DAAL,EAAmEX,wBAAnE,EAAyFN,SAAzF,EAAqGkB,0BAArG;AACA,kBAAK,mDAAL,EAA0DZ,wBAA1D,EAAgFN,SAAhF,EAA4FmB,iBAA5F;AACA,kBAAK,+CAAL,EAAsDb,wBAAtD,EAA4EN,SAA5E,EAAwFoB,aAAxF;AACA,kBAAK,mDAAL,EAA0Dd,wBAA1D,EAAgFN,SAAhF,EAA4FqB,iBAA5F;AACA,kBAAK,0DAAL,EAAiEf,wBAAjE,EAAuFN,SAAvF,EAAmGsB,wBAAnG;AACA,kBAAK,sDAAL,EAA6DhB,wBAA7D,EAAmFN,SAAnF,EAA+FuB,oBAA/F","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport AtomSelect from '..';\nimport fixtureDefault from './fixtures/default';\nimport fixtureDisabled from './fixtures/disabled';\nimport fixtureError from './fixtures/error';\nimport fixtureFilter from './fixtures/filter';\nimport fixtureInvalid from './fixtures/invalid';\nimport fixtureModified from './fixtures/modified';\nimport fixtureMooc from './fixtures/mooc';\nimport fixtureMultipleSelected from './fixtures/multiple-selected';\nimport fixtureMultiple from './fixtures/multiple';\nimport fixturePlayer from './fixtures/player';\nimport fixtureQuestion from './fixtures/question';\nimport fixtureRequiredWithTitle from './fixtures/required-with-title';\nimport fixtureRequired from './fixtures/required';\nimport fixtureSort from './fixtures/sort';\nimport fixtureTemplate from './fixtures/template';\nimport fixtureThematiquesLong from './fixtures/thematiques-long';\nimport fixtureThematiques from './fixtures/thematiques';\n\ntest('Atom › AtomSelect > should have valid propTypes', t => {\n t.pass();\n forEach(AtomSelect.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Atom.AtomSelect.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Atom › AtomSelect › Default › should be rendered', renderComponentMacro, AtomSelect, fixtureDefault);\ntest('Atom › AtomSelect › Disabled › should be rendered', renderComponentMacro, AtomSelect, fixtureDisabled);\ntest('Atom › AtomSelect › Error › should be rendered', renderComponentMacro, AtomSelect, fixtureError);\ntest('Atom › AtomSelect › Filter › should be rendered', renderComponentMacro, AtomSelect, fixtureFilter);\ntest('Atom › AtomSelect › Invalid › should be rendered', renderComponentMacro, AtomSelect, fixtureInvalid);\ntest('Atom › AtomSelect › Modified › should be rendered', renderComponentMacro, AtomSelect, fixtureModified);\ntest('Atom › AtomSelect › Mooc › should be rendered', renderComponentMacro, AtomSelect, fixtureMooc);\ntest('Atom › AtomSelect › MultipleSelected › should be rendered', renderComponentMacro, AtomSelect, fixtureMultipleSelected);\ntest('Atom › AtomSelect › Multiple › should be rendered', renderComponentMacro, AtomSelect, fixtureMultiple);\ntest('Atom › AtomSelect › Player › should be rendered', renderComponentMacro, AtomSelect, fixturePlayer);\ntest('Atom › AtomSelect › Question › should be rendered', renderComponentMacro, AtomSelect, fixtureQuestion);\ntest('Atom › AtomSelect › RequiredWithTitle › should be rendered', renderComponentMacro, AtomSelect, fixtureRequiredWithTitle);\ntest('Atom › AtomSelect › Required › should be rendered', renderComponentMacro, AtomSelect, fixtureRequired);\ntest('Atom › AtomSelect › Sort › should be rendered', renderComponentMacro, AtomSelect, fixtureSort);\ntest('Atom › AtomSelect › Template › should be rendered', renderComponentMacro, AtomSelect, fixtureTemplate);\ntest('Atom › AtomSelect › ThematiquesLong › should be rendered', renderComponentMacro, AtomSelect, fixtureThematiquesLong);\ntest('Atom › AtomSelect › Thematiques › should be rendered', renderComponentMacro, AtomSelect, fixtureThematiques);\n"],"file":"fixtures.js"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _browserEnv = _interopRequireDefault(require("browser-env"));
|
|
4
|
+
|
|
5
|
+
var _ava = _interopRequireDefault(require("ava"));
|
|
6
|
+
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
|
|
9
|
+
var _enzyme = require("enzyme");
|
|
10
|
+
|
|
11
|
+
var _cloneDeep = _interopRequireDefault(require("lodash/fp/cloneDeep"));
|
|
12
|
+
|
|
13
|
+
var _noop = _interopRequireDefault(require("lodash/fp/noop"));
|
|
14
|
+
|
|
15
|
+
var _enzymeAdapterReact = _interopRequireDefault(require("enzyme-adapter-react-16"));
|
|
16
|
+
|
|
17
|
+
var _ = _interopRequireDefault(require(".."));
|
|
18
|
+
|
|
19
|
+
var _player = _interopRequireDefault(require("./fixtures/player"));
|
|
20
|
+
|
|
21
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
22
|
+
|
|
23
|
+
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); }
|
|
24
|
+
|
|
25
|
+
(0, _browserEnv.default)();
|
|
26
|
+
(0, _enzyme.configure)({
|
|
27
|
+
adapter: new _enzymeAdapterReact.default()
|
|
28
|
+
});
|
|
29
|
+
(0, _ava.default)('classnames: should pass the styles pertinent to a player theme, text color: use skin color (selected, valid option, player)', t => {
|
|
30
|
+
const wrapper = (0, _enzyme.mount)( /*#__PURE__*/_react.default.createElement(_.default, _extends({}, _player.default.props, {
|
|
31
|
+
onChange: _noop.default
|
|
32
|
+
})));
|
|
33
|
+
const selectWrapper = wrapper.find('[data-name="select-wrapper"]');
|
|
34
|
+
t.true(selectWrapper.at(0).exists()); // should use skin color
|
|
35
|
+
|
|
36
|
+
t.deepEqual(selectWrapper.at(0).props().style, {
|
|
37
|
+
color: '#00B0FF'
|
|
38
|
+
});
|
|
39
|
+
const selectSpan = selectWrapper.at(0).find('[data-name="select-span"]');
|
|
40
|
+
t.true(selectSpan.at(0).exists());
|
|
41
|
+
t.is(selectSpan.at(0).props().className, 'select__selectSpan select__noLabelCommon');
|
|
42
|
+
});
|
|
43
|
+
(0, _ava.default)('text color: should not use skin color (selected, invalid option, player), long label', t => {
|
|
44
|
+
const withInvalid = (0, _cloneDeep.default)(_player.default.props);
|
|
45
|
+
withInvalid.options[1] = {
|
|
46
|
+
name: 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean.',
|
|
47
|
+
value: 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean.',
|
|
48
|
+
selected: true,
|
|
49
|
+
validOption: false
|
|
50
|
+
};
|
|
51
|
+
const wrapper = (0, _enzyme.mount)( /*#__PURE__*/_react.default.createElement(_.default, _extends({}, withInvalid, {
|
|
52
|
+
onChange: _noop.default
|
|
53
|
+
})));
|
|
54
|
+
const selectWrapper = wrapper.find('[data-name="select-wrapper"]');
|
|
55
|
+
t.true(selectWrapper.at(0).exists()); // should not use skin color
|
|
56
|
+
|
|
57
|
+
t.deepEqual(selectWrapper.at(0).props().style, {});
|
|
58
|
+
const selectSpan = selectWrapper.at(0).find('[data-name="select-span"]');
|
|
59
|
+
t.true(selectSpan.at(0).exists());
|
|
60
|
+
t.is(selectSpan.at(0).props().className, 'select__selectSpan select__noLabelCommon select__longLabel');
|
|
61
|
+
});
|
|
62
|
+
//# sourceMappingURL=select.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/atom/select/test/select.js"],"names":["adapter","Adapter","t","wrapper","playerFixture","props","noop","selectWrapper","find","true","at","exists","deepEqual","style","color","selectSpan","is","className","withInvalid","options","name","value","selected","validOption"],"mappings":";;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEA;AACA,uBAAU;AAACA,EAAAA,OAAO,EAAE,IAAIC,2BAAJ;AAAV,CAAV;AAEA,kBAAK,6HAAL,EAAoIC,CAAC,IAAI;AACvI,QAAMC,OAAO,GAAG,iCAAM,6BAAC,SAAD,eAAYC,gBAAcC,KAA1B;AAAiC,IAAA,QAAQ,EAAEC;AAA3C,KAAN,CAAhB;AACA,QAAMC,aAAa,GAAGJ,OAAO,CAACK,IAAR,CAAa,8BAAb,CAAtB;AACAN,EAAAA,CAAC,CAACO,IAAF,CAAOF,aAAa,CAACG,EAAd,CAAiB,CAAjB,EAAoBC,MAApB,EAAP,EAHuI,CAIvI;;AACAT,EAAAA,CAAC,CAACU,SAAF,CAAYL,aAAa,CAACG,EAAd,CAAiB,CAAjB,EAAoBL,KAApB,GAA4BQ,KAAxC,EAA+C;AAC7CC,IAAAA,KAAK,EAAE;AADsC,GAA/C;AAGA,QAAMC,UAAU,GAAGR,aAAa,CAACG,EAAd,CAAiB,CAAjB,EAAoBF,IAApB,CAAyB,2BAAzB,CAAnB;AACAN,EAAAA,CAAC,CAACO,IAAF,CAAOM,UAAU,CAACL,EAAX,CAAc,CAAd,EAAiBC,MAAjB,EAAP;AACAT,EAAAA,CAAC,CAACc,EAAF,CAAKD,UAAU,CAACL,EAAX,CAAc,CAAd,EAAiBL,KAAjB,GAAyBY,SAA9B,EAAyC,0CAAzC;AACD,CAXD;AAaA,kBAAK,sFAAL,EAA6Ff,CAAC,IAAI;AAChG,QAAMgB,WAAW,GAAG,wBAAUd,gBAAcC,KAAxB,CAApB;AACAa,EAAAA,WAAW,CAACC,OAAZ,CAAoB,CAApB,IAAyB;AACvBC,IAAAA,IAAI,EAAE,mEADiB;AAEvBC,IAAAA,KAAK,EAAE,mEAFgB;AAGvBC,IAAAA,QAAQ,EAAE,IAHa;AAIvBC,IAAAA,WAAW,EAAE;AAJU,GAAzB;AAMA,QAAMpB,OAAO,GAAG,iCAAM,6BAAC,SAAD,eAAYe,WAAZ;AAAyB,IAAA,QAAQ,EAAEZ;AAAnC,KAAN,CAAhB;AACA,QAAMC,aAAa,GAAGJ,OAAO,CAACK,IAAR,CAAa,8BAAb,CAAtB;AACAN,EAAAA,CAAC,CAACO,IAAF,CAAOF,aAAa,CAACG,EAAd,CAAiB,CAAjB,EAAoBC,MAApB,EAAP,EAVgG,CAWhG;;AACAT,EAAAA,CAAC,CAACU,SAAF,CAAYL,aAAa,CAACG,EAAd,CAAiB,CAAjB,EAAoBL,KAApB,GAA4BQ,KAAxC,EAA+C,EAA/C;AACA,QAAME,UAAU,GAAGR,aAAa,CAACG,EAAd,CAAiB,CAAjB,EAAoBF,IAApB,CAAyB,2BAAzB,CAAnB;AACAN,EAAAA,CAAC,CAACO,IAAF,CAAOM,UAAU,CAACL,EAAX,CAAc,CAAd,EAAiBC,MAAjB,EAAP;AACAT,EAAAA,CAAC,CAACc,EAAF,CACED,UAAU,CAACL,EAAX,CAAc,CAAd,EAAiBL,KAAjB,GAAyBY,SAD3B,EAEE,4DAFF;AAID,CAnBD","sourcesContent":["import browserEnv from 'browser-env';\nimport test from 'ava';\nimport React from 'react';\nimport {mount, configure} from 'enzyme';\nimport cloneDeep from 'lodash/fp/cloneDeep';\nimport noop from 'lodash/fp/noop';\nimport Adapter from 'enzyme-adapter-react-16';\nimport Select from '..';\nimport playerFixture from './fixtures/player';\n\nbrowserEnv();\nconfigure({adapter: new Adapter()});\n\ntest('classnames: should pass the styles pertinent to a player theme, text color: use skin color (selected, valid option, player)', t => {\n const wrapper = mount(<Select {...playerFixture.props} onChange={noop} />);\n const selectWrapper = wrapper.find('[data-name=\"select-wrapper\"]');\n t.true(selectWrapper.at(0).exists());\n // should use skin color\n t.deepEqual(selectWrapper.at(0).props().style, {\n color: '#00B0FF'\n });\n const selectSpan = selectWrapper.at(0).find('[data-name=\"select-span\"]');\n t.true(selectSpan.at(0).exists());\n t.is(selectSpan.at(0).props().className, 'select__selectSpan select__noLabelCommon');\n});\n\ntest('text color: should not use skin color (selected, invalid option, player), long label', t => {\n const withInvalid = cloneDeep(playerFixture.props);\n withInvalid.options[1] = {\n name: 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean.',\n value: 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean.',\n selected: true,\n validOption: false\n };\n const wrapper = mount(<Select {...withInvalid} onChange={noop} />);\n const selectWrapper = wrapper.find('[data-name=\"select-wrapper\"]');\n t.true(selectWrapper.at(0).exists());\n // should not use skin color\n t.deepEqual(selectWrapper.at(0).props().style, {});\n const selectSpan = selectWrapper.at(0).find('[data-name=\"select-span\"]');\n t.true(selectSpan.at(0).exists());\n t.is(\n selectSpan.at(0).props().className,\n 'select__selectSpan select__noLabelCommon select__longLabel'\n );\n});\n"],"file":"select.js"}
|
|
@@ -28,12 +28,13 @@ const CourseSection = props => {
|
|
|
28
28
|
'aria-label': {
|
|
29
29
|
title: ariaLabelTitle,
|
|
30
30
|
author: ariaLabelAuthor
|
|
31
|
-
}
|
|
31
|
+
},
|
|
32
|
+
id
|
|
32
33
|
} = props;
|
|
33
34
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
34
35
|
className: _style.default.container,
|
|
35
36
|
"aria-label": ariaLabelTitle,
|
|
36
|
-
"data-name": `course-section-${
|
|
37
|
+
"data-name": `course-section-${id}`
|
|
37
38
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
38
39
|
className: _style.default.position
|
|
39
40
|
}, position), /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -65,7 +66,8 @@ CourseSection.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
65
66
|
contentBadge: _propTypes.default.shape(_contentBadge.default.propTypes),
|
|
66
67
|
title: _propTypes.default.string,
|
|
67
68
|
author: _propTypes.default.string,
|
|
68
|
-
position: _propTypes.default.number
|
|
69
|
+
position: _propTypes.default.number,
|
|
70
|
+
id: _propTypes.default.string
|
|
69
71
|
} : {};
|
|
70
72
|
var _default = CourseSection;
|
|
71
73
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/molecule/course-section/index.js"],"names":["CourseSection","props","image","contentBadge","category","label","title","author","position","ariaLabelTitle","ariaLabelAuthor","style","container","containerImage","containerInfos","containerMainInfos","propTypes","PropTypes","shape","string","ContentBadge","number"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,MAAMA,aAAa,GAAGC,KAAK,IAAI;AAC7B,QAAM;AACJC,IAAAA,KADI;AAEJC,IAAAA,YAAY,EAAE;AAACC,MAAAA,QAAD;AAAWC,MAAAA;AAAX,KAFV;AAGJC,IAAAA,KAHI;AAIJC,IAAAA,MAJI;AAKJC,IAAAA,QALI;AAMJ,kBAAc;AAACF,MAAAA,KAAK,EAAEG,cAAR;AAAwBF,MAAAA,MAAM,EAAEG;AAAhC;
|
|
1
|
+
{"version":3,"sources":["../../../src/molecule/course-section/index.js"],"names":["CourseSection","props","image","contentBadge","category","label","title","author","position","ariaLabelTitle","ariaLabelAuthor","id","style","container","containerImage","containerInfos","containerMainInfos","propTypes","PropTypes","shape","string","ContentBadge","number"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,MAAMA,aAAa,GAAGC,KAAK,IAAI;AAC7B,QAAM;AACJC,IAAAA,KADI;AAEJC,IAAAA,YAAY,EAAE;AAACC,MAAAA,QAAD;AAAWC,MAAAA;AAAX,KAFV;AAGJC,IAAAA,KAHI;AAIJC,IAAAA,MAJI;AAKJC,IAAAA,QALI;AAMJ,kBAAc;AAACF,MAAAA,KAAK,EAAEG,cAAR;AAAwBF,MAAAA,MAAM,EAAEG;AAAhC,KANV;AAOJC,IAAAA;AAPI,MAQFV,KARJ;AASA,sBACE;AAAK,IAAA,SAAS,EAAEW,eAAMC,SAAtB;AAAiC,kBAAYJ,cAA7C;AAA6D,iBAAY,kBAAiBE,EAAG;AAA7F,kBACE;AAAM,IAAA,SAAS,EAAEC,eAAMJ;AAAvB,KAAkCA,QAAlC,CADF,eAEE;AAAK,IAAA,SAAS,EAAEI,eAAME;AAAtB,kBACE,6BAAC,yBAAD;AAAkB,IAAA,KAAK,EAAEZ;AAAzB,IADF,CAFF,eAKE;AAAK,IAAA,SAAS,EAAEU,eAAMG;AAAtB,kBACE;AAAK,IAAA,SAAS,EAAEH,eAAMI;AAAtB,kBACE,6BAAC,qBAAD;AAAc,IAAA,SAAS,EAAEJ,eAAMT,YAA/B;AAA6C,IAAA,QAAQ,EAAEC,QAAvD;AAAiE,IAAA,KAAK,EAAEC;AAAxE,IADF,eAEE;AAAK,IAAA,SAAS,EAAEO,eAAMN;AAAtB,KAA8BA,KAA9B,CAFF,CADF,eAKE;AAAM,IAAA,SAAS,EAAEM,eAAML,MAAvB;AAA+B,kBAAYG;AAA3C,KACGH,MADH,CALF,CALF,CADF;AAiBD,CA3BD;;AA6BAP,aAAa,CAACiB,SAAd,2CAA0B;AACxB,gBAAcC,mBAAUC,KAAV,CAAgB;AAC5Bb,IAAAA,KAAK,EAAEY,mBAAUE,MADW;AAE5Bb,IAAAA,MAAM,EAAEW,mBAAUE;AAFU,GAAhB,CADU;AAKxBlB,EAAAA,KAAK,EAAEgB,mBAAUE,MALO;AAMxBjB,EAAAA,YAAY,EAAEe,mBAAUC,KAAV,CAAgBE,sBAAaJ,SAA7B,CANU;AAOxBX,EAAAA,KAAK,EAAEY,mBAAUE,MAPO;AAQxBb,EAAAA,MAAM,EAAEW,mBAAUE,MARM;AASxBZ,EAAAA,QAAQ,EAAEU,mBAAUI,MATI;AAUxBX,EAAAA,EAAE,EAAEO,mBAAUE;AAVU,CAA1B;eAaepB,a","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport CardImagePreview from '../../atom/card-image-preview';\nimport ContentBadge from '../../atom/content-badge';\nimport style from './style.css';\n\nconst CourseSection = props => {\n const {\n image,\n contentBadge: {category, label},\n title,\n author,\n position,\n 'aria-label': {title: ariaLabelTitle, author: ariaLabelAuthor},\n id\n } = props;\n return (\n <div className={style.container} aria-label={ariaLabelTitle} data-name={`course-section-${id}`}>\n <span className={style.position}>{position}</span>\n <div className={style.containerImage}>\n <CardImagePreview image={image} />\n </div>\n <div className={style.containerInfos}>\n <div className={style.containerMainInfos}>\n <ContentBadge className={style.contentBadge} category={category} label={label} />\n <div className={style.title}>{title}</div>\n </div>\n <span className={style.author} aria-label={ariaLabelAuthor}>\n {author}\n </span>\n </div>\n </div>\n );\n};\n\nCourseSection.propTypes = {\n 'aria-label': PropTypes.shape({\n title: PropTypes.string,\n author: PropTypes.string\n }),\n image: PropTypes.string,\n contentBadge: PropTypes.shape(ContentBadge.propTypes),\n title: PropTypes.string,\n author: PropTypes.string,\n position: PropTypes.number,\n id: PropTypes.string\n};\n\nexport default CourseSection;\n"],"file":"index.js"}
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
justify-content: start;
|
|
14
14
|
margin-top: 8px;
|
|
15
15
|
padding: 8px 16px;
|
|
16
|
+
border-radius: 7px;
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
.containerInfos {
|
|
@@ -50,7 +51,7 @@
|
|
|
50
51
|
font-family: Gilroy;
|
|
51
52
|
font-weight: 600;
|
|
52
53
|
line-height: 20px;
|
|
53
|
-
margin: 0 12px 0
|
|
54
|
+
margin: 0 12px 0 32px;
|
|
54
55
|
}
|
|
55
56
|
|
|
56
57
|
.contentBadge {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/molecule/course-section/test/fixtures/chapter.js"],"names":["props","title","author","image","contentBadge","label","category","position"],"mappings":";;;;eAAe;AACbA,EAAAA,KAAK,EAAE;AACL,kBAAc;AACZC,MAAAA,KAAK,EAAE,kBADK;AAEZC,MAAAA,MAAM,EAAE;AAFI,KADT;AAKLD,IAAAA,KAAK,EAAE,iBALF;AAMLC,IAAAA,MAAM,EAAE,QANH;AAOLC,IAAAA,KAAK,EACH,4LARG;AASLC,IAAAA,YAAY,EAAE;AACZC,MAAAA,KAAK,EAAE,SADK;AAEZC,MAAAA,QAAQ,EAAE;AAFE,KATT;AAaLC,IAAAA,QAAQ,EAAE;
|
|
1
|
+
{"version":3,"sources":["../../../../../src/molecule/course-section/test/fixtures/chapter.js"],"names":["props","title","author","image","contentBadge","label","category","position","id"],"mappings":";;;;eAAe;AACbA,EAAAA,KAAK,EAAE;AACL,kBAAc;AACZC,MAAAA,KAAK,EAAE,kBADK;AAEZC,MAAAA,MAAM,EAAE;AAFI,KADT;AAKLD,IAAAA,KAAK,EAAE,iBALF;AAMLC,IAAAA,MAAM,EAAE,QANH;AAOLC,IAAAA,KAAK,EACH,4LARG;AASLC,IAAAA,YAAY,EAAE;AACZC,MAAAA,KAAK,EAAE,SADK;AAEZC,MAAAA,QAAQ,EAAE;AAFE,KATT;AAaLC,IAAAA,QAAQ,EAAE,CAbL;AAcLC,IAAAA,EAAE,EAAE;AAdC;AADM,C","sourcesContent":["export default {\n props: {\n 'aria-label': {\n title: 'aria label title',\n author: 'aria label author'\n },\n title: 'Social networks',\n author: 'Author',\n image:\n 'https://api.coorpacademy.com/api-service/medias?url=https://static.coorpacademy.com/content/partner-wedemain/fr/medias/img/cover/shutterstock_248741149-1470302136299.jpg&h=500&w=500&q=90',\n contentBadge: {\n label: 'chapter',\n category: 'chapter'\n },\n position: 2,\n id: 'chap_1'\n }\n};\n"],"file":"chapter.js"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/molecule/course-section/test/fixtures/course.js"],"names":["props","title","author","image","contentBadge","label","category","position"],"mappings":";;;;eAAe;AACbA,EAAAA,KAAK,EAAE;AACL,kBAAc;AACZC,MAAAA,KAAK,EAAE,kBADK;AAEZC,MAAAA,MAAM,EAAE;AAFI,KADT;AAKLD,IAAAA,KAAK,EACH,qIANG;AAOLC,IAAAA,MAAM,EAAE,QAPH;AAQLC,IAAAA,KAAK,EACH,4LATG;AAULC,IAAAA,YAAY,EAAE;AACZC,MAAAA,KAAK,EAAE,QADK;AAEZC,MAAAA,QAAQ,EAAE;AAFE,KAVT;AAcLC,IAAAA,QAAQ,EAAE;
|
|
1
|
+
{"version":3,"sources":["../../../../../src/molecule/course-section/test/fixtures/course.js"],"names":["props","title","author","image","contentBadge","label","category","position","id"],"mappings":";;;;eAAe;AACbA,EAAAA,KAAK,EAAE;AACL,kBAAc;AACZC,MAAAA,KAAK,EAAE,kBADK;AAEZC,MAAAA,MAAM,EAAE;AAFI,KADT;AAKLD,IAAAA,KAAK,EACH,qIANG;AAOLC,IAAAA,MAAM,EAAE,QAPH;AAQLC,IAAAA,KAAK,EACH,4LATG;AAULC,IAAAA,YAAY,EAAE;AACZC,MAAAA,KAAK,EAAE,QADK;AAEZC,MAAAA,QAAQ,EAAE;AAFE,KAVT;AAcLC,IAAAA,QAAQ,EAAE,CAdL;AAeLC,IAAAA,EAAE,EAAE;AAfC;AADM,C","sourcesContent":["export default {\n props: {\n 'aria-label': {\n title: 'aria label title',\n author: 'aria label author'\n },\n title:\n 'Marketing and online advertising Marketing and online advertising Marketing and online advertising Marketing and online advertising',\n author: 'Author',\n image:\n 'https://api.coorpacademy.com/api-service/medias?url=https://static.coorpacademy.com/content/partner-wedemain/fr/medias/img/cover/shutterstock_248741149-1470302136299.jpg&h=500&w=500&q=90',\n contentBadge: {\n label: 'course',\n category: 'course'\n },\n position: 1,\n id: 'disc_1'\n }\n};\n"],"file":"course.js"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.default = void 0;
|
|
5
|
+
|
|
6
|
+
var _react = _interopRequireDefault(require("react"));
|
|
7
|
+
|
|
8
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
+
|
|
10
|
+
var _courseSection = _interopRequireDefault(require("../course-section"));
|
|
11
|
+
|
|
12
|
+
var _draggableList = _interopRequireDefault(require("../draggable-list"));
|
|
13
|
+
|
|
14
|
+
var _loader = _interopRequireDefault(require("../../atom/loader"));
|
|
15
|
+
|
|
16
|
+
var _title = _interopRequireDefault(require("../../atom/title"));
|
|
17
|
+
|
|
18
|
+
var _style = _interopRequireDefault(require("./style.css"));
|
|
19
|
+
|
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
+
|
|
22
|
+
const Loading = () => /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_loader.default, {
|
|
23
|
+
theme: "coorpmanager"
|
|
24
|
+
}));
|
|
25
|
+
|
|
26
|
+
const CourseSections = ({
|
|
27
|
+
sections,
|
|
28
|
+
onDrop,
|
|
29
|
+
isLoading,
|
|
30
|
+
title
|
|
31
|
+
}) => {
|
|
32
|
+
if (isLoading) return /*#__PURE__*/_react.default.createElement(Loading, null);
|
|
33
|
+
return /*#__PURE__*/_react.default.createElement("div", null, title ? /*#__PURE__*/_react.default.createElement("div", {
|
|
34
|
+
className: _style.default.title
|
|
35
|
+
}, /*#__PURE__*/_react.default.createElement(_title.default, {
|
|
36
|
+
title: title,
|
|
37
|
+
type: 'form-group',
|
|
38
|
+
"data-name": 'course-sections-title'
|
|
39
|
+
})) : null, /*#__PURE__*/_react.default.createElement(_draggableList.default, {
|
|
40
|
+
itemType: "course-section",
|
|
41
|
+
items: sections,
|
|
42
|
+
onDrop: onDrop
|
|
43
|
+
}));
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
CourseSections.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
47
|
+
title: _propTypes.default.string,
|
|
48
|
+
sections: _propTypes.default.arrayOf(_propTypes.default.shape(_courseSection.default.propTypes)),
|
|
49
|
+
onDrop: _propTypes.default.func,
|
|
50
|
+
isLoading: _propTypes.default.bool
|
|
51
|
+
} : {};
|
|
52
|
+
var _default = CourseSections;
|
|
53
|
+
exports.default = _default;
|
|
54
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/molecule/course-sections/index.js"],"names":["Loading","CourseSections","sections","onDrop","isLoading","title","style","propTypes","PropTypes","string","arrayOf","shape","CourseSection","func","bool"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,MAAMA,OAAO,GAAG,mBACd,uDACE,6BAAC,eAAD;AAAQ,EAAA,KAAK,EAAC;AAAd,EADF,CADF;;AAMA,MAAMC,cAAc,GAAG,CAAC;AAACC,EAAAA,QAAD;AAAWC,EAAAA,MAAX;AAAmBC,EAAAA,SAAnB;AAA8BC,EAAAA;AAA9B,CAAD,KAA0C;AAC/D,MAAID,SAAJ,EAAe,oBAAO,6BAAC,OAAD,OAAP;AAEf,sBACE,0CACGC,KAAK,gBACJ;AAAK,IAAA,SAAS,EAAEC,eAAMD;AAAtB,kBACE,6BAAC,cAAD;AAAO,IAAA,KAAK,EAAEA,KAAd;AAAqB,IAAA,IAAI,EAAE,YAA3B;AAAyC,iBAAW;AAApD,IADF,CADI,GAIF,IALN,eAME,6BAAC,sBAAD;AAAe,IAAA,QAAQ,EAAC,gBAAxB;AAAyC,IAAA,KAAK,EAAEH,QAAhD;AAA0D,IAAA,MAAM,EAAEC;AAAlE,IANF,CADF;AAUD,CAbD;;AAeAF,cAAc,CAACM,SAAf,2CAA2B;AACzBF,EAAAA,KAAK,EAAEG,mBAAUC,MADQ;AAEzBP,EAAAA,QAAQ,EAAEM,mBAAUE,OAAV,CAAkBF,mBAAUG,KAAV,CAAgBC,uBAAcL,SAA9B,CAAlB,CAFe;AAGzBJ,EAAAA,MAAM,EAAEK,mBAAUK,IAHO;AAIzBT,EAAAA,SAAS,EAAEI,mBAAUM;AAJI,CAA3B;eAOeb,c","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport CourseSection from '../course-section';\nimport DraggableList from '../draggable-list';\nimport Loader from '../../atom/loader';\nimport Title from '../../atom/title';\nimport style from './style.css';\n\nconst Loading = () => (\n <div>\n <Loader theme=\"coorpmanager\" />\n </div>\n);\n\nconst CourseSections = ({sections, onDrop, isLoading, title}) => {\n if (isLoading) return <Loading />;\n\n return (\n <div>\n {title ? (\n <div className={style.title}>\n <Title title={title} type={'form-group'} data-name={'course-sections-title'} />\n </div>\n ) : null}\n <DraggableList itemType=\"course-section\" items={sections} onDrop={onDrop} />\n </div>\n );\n};\n\nCourseSections.propTypes = {\n title: PropTypes.string,\n sections: PropTypes.arrayOf(PropTypes.shape(CourseSection.propTypes)),\n onDrop: PropTypes.func,\n isLoading: PropTypes.bool\n};\n\nexport default CourseSections;\n"],"file":"index.js"}
|