@coorpacademy/components 11.19.1-alpha.13 → 11.19.1-alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (181) hide show
  1. package/es/atom/button-link/index.js +2 -2
  2. package/es/atom/button-link/index.js.map +1 -1
  3. package/es/atom/button-link/style.css +0 -1
  4. package/es/atom/drag-and-drop/index.d.ts +0 -1
  5. package/es/atom/drag-and-drop/index.d.ts.map +1 -1
  6. package/es/atom/drag-and-drop/index.js +6 -24
  7. package/es/atom/drag-and-drop/index.js.map +1 -1
  8. package/es/atom/drag-and-drop/style.css +7 -22
  9. package/es/atom/{input-file-draggable → image-upload}/index.d.ts +5 -10
  10. package/es/atom/image-upload/index.d.ts.map +1 -0
  11. package/es/atom/{input-file-draggable → image-upload}/index.js +11 -34
  12. package/es/atom/image-upload/index.js.map +1 -0
  13. package/es/atom/image-upload/style.css +28 -0
  14. package/es/atom/title/style.css +1 -1
  15. package/es/atom/video-upload/index.d.ts +0 -1
  16. package/es/molecule/brand-form-group/index.js +5 -5
  17. package/es/molecule/brand-form-group/index.js.map +1 -1
  18. package/es/molecule/card/index.d.ts.map +1 -1
  19. package/es/molecule/card/index.js +6 -2
  20. package/es/molecule/card/index.js.map +1 -1
  21. package/es/molecule/card/style.css +2 -2
  22. package/es/molecule/cm-popin/index.d.ts.map +1 -1
  23. package/es/molecule/cm-popin/index.js +20 -27
  24. package/es/molecule/cm-popin/index.js.map +1 -1
  25. package/es/molecule/cm-popin/style.css +73 -112
  26. package/es/molecule/cm-popin/types.d.ts +5 -182
  27. package/es/molecule/cm-popin/types.d.ts.map +1 -1
  28. package/es/molecule/cm-popin/types.js +3 -5
  29. package/es/molecule/cm-popin/types.js.map +1 -1
  30. package/es/molecule/drag-and-drop-wrapper/index.d.ts +1 -2
  31. package/es/molecule/drag-and-drop-wrapper/index.js +3 -3
  32. package/es/molecule/drag-and-drop-wrapper/index.js.map +1 -1
  33. package/es/molecule/setup-slider/index.js +3 -3
  34. package/es/molecule/setup-slider/index.js.map +1 -1
  35. package/es/molecule/title-and-checkbox-wrapper/index.d.ts +1 -2
  36. package/es/molecule/title-radio-wrapper/index.d.ts +17 -18
  37. package/es/molecule/title-radio-wrapper/index.d.ts.map +1 -1
  38. package/es/molecule/title-radio-wrapper/index.js +2 -2
  39. package/es/molecule/title-radio-wrapper/index.js.map +1 -1
  40. package/es/molecule/title-radio-wrapper/types.d.ts +19 -20
  41. package/es/molecule/title-radio-wrapper/types.d.ts.map +1 -1
  42. package/es/molecule/title-radio-wrapper/types.js +2 -2
  43. package/es/molecule/title-radio-wrapper/types.js.map +1 -1
  44. package/es/organism/list-item/index.d.ts.map +1 -1
  45. package/es/organism/list-item/index.js +5 -2
  46. package/es/organism/list-item/index.js.map +1 -1
  47. package/es/organism/list-item/style.css +7 -3
  48. package/es/organism/list-items/index.d.ts.map +1 -1
  49. package/es/organism/list-items/index.js +3 -1
  50. package/es/organism/list-items/index.js.map +1 -1
  51. package/es/organism/list-items/style.css +4 -1
  52. package/es/organism/rewards-form/index.d.ts +1 -2
  53. package/es/organism/select-opponents/index.d.ts +17 -18
  54. package/es/organism/select-opponents/index.d.ts.map +1 -1
  55. package/es/organism/select-opponents/types.d.ts +17 -18
  56. package/es/organism/select-opponents/types.d.ts.map +1 -1
  57. package/es/organism/setup-header/style.css +1 -3
  58. package/es/organism/title-and-input/index.d.ts +17 -18
  59. package/es/organism/title-and-input/index.d.ts.map +1 -1
  60. package/es/organism/title-and-input/types.d.ts +17 -18
  61. package/es/organism/title-and-input/types.d.ts.map +1 -1
  62. package/es/organism/wizard-contents/index.d.ts +1 -2
  63. package/es/template/app-player/loading/index.d.ts +2 -178
  64. package/es/template/app-player/player/index.d.ts +4 -356
  65. package/es/template/app-player/player/slides/index.d.ts +2 -178
  66. package/es/template/app-player/player/slides/index.d.ts.map +1 -1
  67. package/es/template/app-player/popin-correction/index.d.ts +2 -178
  68. package/es/template/app-player/popin-correction/index.d.ts.map +1 -1
  69. package/es/template/app-player/popin-end/index.d.ts +2 -178
  70. package/es/template/app-review/index.d.ts +2 -178
  71. package/es/template/app-review/index.d.ts.map +1 -1
  72. package/es/template/app-review/player/prop-types.d.ts +2 -178
  73. package/es/template/app-review/player/prop-types.d.ts.map +1 -1
  74. package/es/template/app-review/prop-types.d.ts +2 -178
  75. package/es/template/app-review/prop-types.d.ts.map +1 -1
  76. package/es/template/back-office/brand-update/index.d.ts +2 -178
  77. package/es/template/cockpit/jw-uploader/index.d.ts +0 -1
  78. package/es/template/common/dashboard/index.d.ts +4 -356
  79. package/es/template/common/search-page/index.d.ts +2 -178
  80. package/es/template/common/search-page/index.d.ts.map +1 -1
  81. package/es/template/common/search-page/index.js +20 -2
  82. package/es/template/common/search-page/index.js.map +1 -1
  83. package/es/template/external-course/index.d.ts +2 -178
  84. package/es/util/proptypes.d.ts +1 -1
  85. package/es/util/proptypes.d.ts.map +1 -1
  86. package/es/util/proptypes.js +5 -6
  87. package/es/util/proptypes.js.map +1 -1
  88. package/lib/atom/button-link/index.js +2 -2
  89. package/lib/atom/button-link/index.js.map +1 -1
  90. package/lib/atom/button-link/style.css +0 -1
  91. package/lib/atom/drag-and-drop/index.d.ts +0 -1
  92. package/lib/atom/drag-and-drop/index.d.ts.map +1 -1
  93. package/lib/atom/drag-and-drop/index.js +6 -24
  94. package/lib/atom/drag-and-drop/index.js.map +1 -1
  95. package/lib/atom/drag-and-drop/style.css +7 -22
  96. package/lib/atom/{input-file-draggable → image-upload}/index.d.ts +5 -10
  97. package/lib/atom/image-upload/index.d.ts.map +1 -0
  98. package/lib/atom/{input-file-draggable → image-upload}/index.js +10 -34
  99. package/lib/atom/image-upload/index.js.map +1 -0
  100. package/lib/atom/image-upload/style.css +28 -0
  101. package/lib/atom/title/style.css +1 -1
  102. package/lib/atom/video-upload/index.d.ts +0 -1
  103. package/lib/molecule/brand-form-group/index.js +5 -5
  104. package/lib/molecule/brand-form-group/index.js.map +1 -1
  105. package/lib/molecule/card/index.d.ts.map +1 -1
  106. package/lib/molecule/card/index.js +6 -2
  107. package/lib/molecule/card/index.js.map +1 -1
  108. package/lib/molecule/card/style.css +2 -2
  109. package/lib/molecule/cm-popin/index.d.ts.map +1 -1
  110. package/lib/molecule/cm-popin/index.js +19 -29
  111. package/lib/molecule/cm-popin/index.js.map +1 -1
  112. package/lib/molecule/cm-popin/style.css +73 -112
  113. package/lib/molecule/cm-popin/types.d.ts +5 -182
  114. package/lib/molecule/cm-popin/types.d.ts.map +1 -1
  115. package/lib/molecule/cm-popin/types.js +3 -6
  116. package/lib/molecule/cm-popin/types.js.map +1 -1
  117. package/lib/molecule/drag-and-drop-wrapper/index.d.ts +1 -2
  118. package/lib/molecule/drag-and-drop-wrapper/index.js +3 -3
  119. package/lib/molecule/drag-and-drop-wrapper/index.js.map +1 -1
  120. package/lib/molecule/setup-slider/index.js +3 -3
  121. package/lib/molecule/setup-slider/index.js.map +1 -1
  122. package/lib/molecule/title-and-checkbox-wrapper/index.d.ts +1 -2
  123. package/lib/molecule/title-radio-wrapper/index.d.ts +17 -18
  124. package/lib/molecule/title-radio-wrapper/index.d.ts.map +1 -1
  125. package/lib/molecule/title-radio-wrapper/index.js +2 -2
  126. package/lib/molecule/title-radio-wrapper/index.js.map +1 -1
  127. package/lib/molecule/title-radio-wrapper/types.d.ts +19 -20
  128. package/lib/molecule/title-radio-wrapper/types.d.ts.map +1 -1
  129. package/lib/molecule/title-radio-wrapper/types.js +2 -2
  130. package/lib/molecule/title-radio-wrapper/types.js.map +1 -1
  131. package/lib/organism/list-item/index.d.ts.map +1 -1
  132. package/lib/organism/list-item/index.js +5 -3
  133. package/lib/organism/list-item/index.js.map +1 -1
  134. package/lib/organism/list-item/style.css +7 -3
  135. package/lib/organism/list-items/index.d.ts.map +1 -1
  136. package/lib/organism/list-items/index.js +3 -1
  137. package/lib/organism/list-items/index.js.map +1 -1
  138. package/lib/organism/list-items/style.css +4 -1
  139. package/lib/organism/rewards-form/index.d.ts +1 -2
  140. package/lib/organism/select-opponents/index.d.ts +17 -18
  141. package/lib/organism/select-opponents/index.d.ts.map +1 -1
  142. package/lib/organism/select-opponents/types.d.ts +17 -18
  143. package/lib/organism/select-opponents/types.d.ts.map +1 -1
  144. package/lib/organism/setup-header/style.css +1 -3
  145. package/lib/organism/title-and-input/index.d.ts +17 -18
  146. package/lib/organism/title-and-input/index.d.ts.map +1 -1
  147. package/lib/organism/title-and-input/types.d.ts +17 -18
  148. package/lib/organism/title-and-input/types.d.ts.map +1 -1
  149. package/lib/organism/wizard-contents/index.d.ts +1 -2
  150. package/lib/template/app-player/loading/index.d.ts +2 -178
  151. package/lib/template/app-player/player/index.d.ts +4 -356
  152. package/lib/template/app-player/player/slides/index.d.ts +2 -178
  153. package/lib/template/app-player/player/slides/index.d.ts.map +1 -1
  154. package/lib/template/app-player/popin-correction/index.d.ts +2 -178
  155. package/lib/template/app-player/popin-correction/index.d.ts.map +1 -1
  156. package/lib/template/app-player/popin-end/index.d.ts +2 -178
  157. package/lib/template/app-review/index.d.ts +2 -178
  158. package/lib/template/app-review/index.d.ts.map +1 -1
  159. package/lib/template/app-review/player/prop-types.d.ts +2 -178
  160. package/lib/template/app-review/player/prop-types.d.ts.map +1 -1
  161. package/lib/template/app-review/prop-types.d.ts +2 -178
  162. package/lib/template/app-review/prop-types.d.ts.map +1 -1
  163. package/lib/template/back-office/brand-update/index.d.ts +2 -178
  164. package/lib/template/cockpit/jw-uploader/index.d.ts +0 -1
  165. package/lib/template/common/dashboard/index.d.ts +4 -356
  166. package/lib/template/common/search-page/index.d.ts +2 -178
  167. package/lib/template/common/search-page/index.d.ts.map +1 -1
  168. package/lib/template/common/search-page/index.js +24 -2
  169. package/lib/template/common/search-page/index.js.map +1 -1
  170. package/lib/template/external-course/index.d.ts +2 -178
  171. package/lib/util/proptypes.d.ts +1 -1
  172. package/lib/util/proptypes.d.ts.map +1 -1
  173. package/lib/util/proptypes.js +7 -10
  174. package/lib/util/proptypes.js.map +1 -1
  175. package/package.json +2 -2
  176. package/es/atom/input-file-draggable/index.d.ts.map +0 -1
  177. package/es/atom/input-file-draggable/index.js.map +0 -1
  178. package/es/atom/input-file-draggable/style.css +0 -81
  179. package/lib/atom/input-file-draggable/index.d.ts.map +0 -1
  180. package/lib/atom/input-file-draggable/index.js.map +0 -1
  181. package/lib/atom/input-file-draggable/style.css +0 -81
@@ -221,7 +221,6 @@ declare namespace SearchPage {
221
221
  backgroundImageUrl: PropTypes.Requireable<string>;
222
222
  descriptionText: PropTypes.Requireable<string>;
223
223
  cookieTitle: PropTypes.Requireable<string>;
224
- headerSubtitle: PropTypes.Requireable<string>;
225
224
  descriptionBtnTxt: PropTypes.Requireable<string>;
226
225
  listBtnSwicth: PropTypes.Requireable<(PropTypes.InferProps<{
227
226
  title: PropTypes.Requireable<string>;
@@ -242,185 +241,10 @@ declare namespace SearchPage {
242
241
  }> | null | undefined)[]>;
243
242
  items: PropTypes.Requireable<PropTypes.InferProps<{
244
243
  type: PropTypes.Requireable<string>;
245
- list: PropTypes.Requireable<NonNullable<PropTypes.InferProps<{
244
+ list: PropTypes.Requireable<PropTypes.InferProps<{
246
245
  list: PropTypes.Requireable<(PropTypes.InferProps<any> | null | undefined)[]>;
247
246
  loading: PropTypes.Requireable<boolean>;
248
- }> | PropTypes.InferProps<{
249
- 'aria-label': PropTypes.Requireable<string>;
250
- buttonLink: PropTypes.Requireable<PropTypes.InferProps<{
251
- type: PropTypes.Requireable<string>;
252
- label: PropTypes.Requireable<string>;
253
- 'aria-label': PropTypes.Requireable<string>;
254
- 'data-name': PropTypes.Requireable<string>;
255
- 'data-testid': PropTypes.Requireable<string>;
256
- icon: PropTypes.Requireable<PropTypes.InferProps<{
257
- position: PropTypes.Requireable<string>;
258
- type: PropTypes.Requireable<string>;
259
- }>>;
260
- onClick: PropTypes.Requireable<(...args: any[]) => any>;
261
- link: PropTypes.Requireable<PropTypes.InferProps<{
262
- href: PropTypes.Requireable<string>;
263
- download: PropTypes.Requireable<boolean>;
264
- target: PropTypes.Requireable<string>;
265
- }>>;
266
- disabled: PropTypes.Requireable<boolean>;
267
- className: PropTypes.Requireable<string>;
268
- customStyle: PropTypes.Requireable<PropTypes.InferProps<{}>>;
269
- }>>;
270
- selectMultiple: PropTypes.Requireable<PropTypes.InferProps<{
271
- title: PropTypes.Requireable<string>;
272
- placeholder: PropTypes.Requireable<string>;
273
- description: PropTypes.Requireable<string>;
274
- hint: PropTypes.Requireable<string>;
275
- options: PropTypes.Requireable<NonNullable<PropTypes.InferProps<{
276
- selected: PropTypes.Validator<boolean>;
277
- name: PropTypes.Validator<string>;
278
- value: PropTypes.Requireable<string>;
279
- }>>[]>;
280
- onChange: PropTypes.Requireable<(...args: any[]) => any>;
281
- onError: PropTypes.Requireable<(...args: any[]) => any>;
282
- multiple: PropTypes.Requireable<boolean>;
283
- modified: PropTypes.Requireable<boolean>;
284
- disabled: PropTypes.Requireable<boolean>;
285
- error: PropTypes.Requireable<string>;
286
- theme: PropTypes.Requireable<string>;
287
- }>>;
288
- content: PropTypes.Requireable<NonNullable<PropTypes.InferProps<{
289
- items: PropTypes.Requireable<(PropTypes.InferProps<{
290
- title: PropTypes.Validator<string>;
291
- dataColumns: PropTypes.Requireable<(PropTypes.InferProps<{
292
- label: PropTypes.Requireable<string>;
293
- type: PropTypes.Requireable<string>;
294
- className: PropTypes.Requireable<string>;
295
- }> | null | undefined)[]>;
296
- buttonLink: PropTypes.Requireable<PropTypes.InferProps<{
297
- type: PropTypes.Requireable<string>;
298
- label: PropTypes.Requireable<string>;
299
- ariaLabel: PropTypes.Requireable<string>;
300
- dataName: PropTypes.Requireable<string>;
301
- icon: PropTypes.Requireable<PropTypes.InferProps<{
302
- position: PropTypes.Requireable<string>;
303
- type: PropTypes.Requireable<string>;
304
- }>>;
305
- onClick: PropTypes.Requireable<(...args: any[]) => any>;
306
- }>>;
307
- buttonLinkIcon: PropTypes.Requireable<PropTypes.InferProps<{
308
- size: PropTypes.Requireable<string>;
309
- 'aria-label': PropTypes.Requireable<string>;
310
- 'data-name': PropTypes.Requireable<string>;
311
- icon: PropTypes.Requireable<string>;
312
- onClick: PropTypes.Requireable<(...args: any[]) => any>;
313
- link: PropTypes.Requireable<PropTypes.InferProps<{
314
- href: PropTypes.Requireable<string>;
315
- download: PropTypes.Requireable<boolean>;
316
- target: PropTypes.Requireable<string>;
317
- }>>;
318
- disabled: PropTypes.Requireable<boolean>;
319
- className: PropTypes.Requireable<string>;
320
- }>>;
321
- bulletPointMenuButton: PropTypes.Requireable<PropTypes.InferProps<{
322
- buttonAriaLabel: PropTypes.Requireable<string>;
323
- menuAriaLabel: PropTypes.Requireable<string>;
324
- buttons: PropTypes.Requireable<(PropTypes.InferProps<{
325
- 'data-name': PropTypes.Requireable<string>;
326
- label: PropTypes.Requireable<string>;
327
- type: PropTypes.Requireable<string>;
328
- onClick: PropTypes.Requireable<(...args: any[]) => any>;
329
- }> | null | undefined)[]>;
330
- onClick: PropTypes.Requireable<(...args: any[]) => any>;
331
- }>>;
332
- tags: PropTypes.Requireable<(PropTypes.InferProps<{
333
- label: PropTypes.Requireable<string>;
334
- type: PropTypes.Requireable<string>;
335
- }> | null | undefined)[]>;
336
- isBulkStyle: PropTypes.Requireable<boolean>;
337
- order: PropTypes.Requireable<number>;
338
- 'aria-label': PropTypes.Requireable<string>;
339
- contentType: PropTypes.Requireable<string>;
340
- id: PropTypes.Requireable<string>;
341
- }> | null | undefined)[]>;
342
- type: PropTypes.Requireable<string>;
343
- itemType: PropTypes.Requireable<string>;
344
- onDrop: PropTypes.Requireable<(...args: any[]) => any>;
345
- isDraggable: PropTypes.Requireable<boolean>;
346
- tableHeader: PropTypes.Requireable<(string | null | undefined)[]>;
347
- }> | PropTypes.InferProps<{
348
- type: PropTypes.Requireable<string>;
349
- columns: PropTypes.Requireable<(PropTypes.InferProps<{
350
- title: PropTypes.Validator<string>;
351
- }> | null | undefined)[]>;
352
- rows: PropTypes.Requireable<(PropTypes.InferProps<{
353
- fields: PropTypes.Requireable<(NonNullable<string | PropTypes.InferProps<{
354
- type: PropTypes.Requireable<string>;
355
- current: PropTypes.Requireable<boolean>;
356
- selected: PropTypes.Requireable<boolean>;
357
- icon: PropTypes.Requireable<string>;
358
- value: PropTypes.Requireable<string>;
359
- }> | null | undefined> | null | undefined)[]>;
360
- isRowExpandible: PropTypes.Requireable<boolean>;
361
- lastField: PropTypes.Requireable<NonNullable<string | PropTypes.InferProps<{
362
- type: PropTypes.Requireable<string>;
363
- disabled: PropTypes.Requireable<boolean>;
364
- buttonAriaLabel: PropTypes.Requireable<string>;
365
- menuAriaLabel: PropTypes.Requireable<string>;
366
- buttons: PropTypes.Validator<(PropTypes.InferProps<{
367
- 'data-name': PropTypes.Requireable<string>;
368
- disabled: PropTypes.Requireable<boolean>;
369
- label: PropTypes.Validator<string>;
370
- onClick: PropTypes.Validator<(...args: any[]) => any>;
371
- type: PropTypes.Requireable<string>;
372
- }> | null | undefined)[]>;
373
- onClick: PropTypes.Requireable<(...args: any[]) => any>;
374
- menuButtonClassName: PropTypes.Requireable<string>;
375
- isBulkMenu: PropTypes.Requireable<boolean>;
376
- }> | null | undefined>>;
377
- }> | null | undefined)[]>;
378
- stickyFirstColumn: PropTypes.Requireable<boolean>;
379
- stickyLastColumn: PropTypes.Requireable<boolean>;
380
- columnWidth: PropTypes.Requireable<string>;
381
- ariaDescribedby: PropTypes.Requireable<string>;
382
- lastField: PropTypes.Requireable<NonNullable<PropTypes.InferProps<{
383
- componentType: PropTypes.Requireable<string>;
384
- type: PropTypes.Requireable<string>;
385
- label: PropTypes.Requireable<string>;
386
- 'aria-label': PropTypes.Requireable<string>;
387
- 'data-name': PropTypes.Requireable<string>;
388
- 'data-testid': PropTypes.Requireable<string>;
389
- icon: PropTypes.Requireable<PropTypes.InferProps<{
390
- position: PropTypes.Requireable<string>;
391
- type: PropTypes.Requireable<string>;
392
- }>>;
393
- onClick: PropTypes.Requireable<(...args: any[]) => any>;
394
- link: PropTypes.Requireable<PropTypes.InferProps<{
395
- href: PropTypes.Requireable<string>;
396
- download: PropTypes.Requireable<boolean>;
397
- target: PropTypes.Requireable<string>;
398
- }>>;
399
- disabled: PropTypes.Requireable<boolean>;
400
- className: PropTypes.Requireable<string>;
401
- customStyle: PropTypes.Requireable<PropTypes.InferProps<{}>>;
402
- }> | PropTypes.InferProps<{
403
- componentType: PropTypes.Requireable<string>;
404
- disabled: PropTypes.Requireable<boolean>;
405
- buttonAriaLabel: PropTypes.Requireable<string>;
406
- menuAriaLabel: PropTypes.Requireable<string>;
407
- buttons: PropTypes.Validator<(PropTypes.InferProps<{
408
- 'data-name': PropTypes.Requireable<string>;
409
- disabled: PropTypes.Requireable<boolean>;
410
- label: PropTypes.Validator<string>;
411
- onClick: PropTypes.Validator<(...args: any[]) => any>;
412
- type: PropTypes.Requireable<string>;
413
- }> | null | undefined)[]>;
414
- onClick: PropTypes.Requireable<(...args: any[]) => any>;
415
- menuButtonClassName: PropTypes.Requireable<string>;
416
- isBulkMenu: PropTypes.Requireable<boolean>;
417
- }> | null | undefined>>;
418
- isNestedTable: PropTypes.Requireable<boolean>;
419
- emptyStateFirstMessage: PropTypes.Requireable<string>;
420
- emptyStateSecondMessage: PropTypes.Requireable<string>;
421
- }> | null | undefined>>;
422
- title: PropTypes.Requireable<string>;
423
- }> | null | undefined>>;
247
+ }>>;
424
248
  }>>;
425
249
  }>>;
426
250
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/template/common/search-page/index.js"],"names":[],"mappings":";AAWA,mEA4DC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/template/common/search-page/index.js"],"names":[],"mappings":";AAWA,mEA0EC"}
@@ -3,7 +3,7 @@ import _getOr from "lodash/fp/getOr";
3
3
 
4
4
  function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
5
5
 
6
- import React from 'react';
6
+ import React, { useCallback, useEffect, useRef } from 'react';
7
7
  import PropTypes from 'prop-types';
8
8
  import Provider from '../../../atom/provider';
9
9
  import Button from '../../../atom/button';
@@ -33,6 +33,22 @@ const SearchPage = (props, context) => {
33
33
 
34
34
  const defaultColor = _getOr('#00B0FF', 'common.primary', skin);
35
35
 
36
+ const nodeRef = useRef(null);
37
+ const closePopin = useCallback(e => {
38
+ // eslint-disable-next-line no-console
39
+ console.log(nodeRef);
40
+
41
+ if (nodeRef && nodeRef.current && !nodeRef.current.contains(e.target)) {
42
+ // eslint-disable-next-line no-console
43
+ console.log('closePopin function called');
44
+ }
45
+ }, []);
46
+ useEffect(() => {
47
+ document.addEventListener('click', closePopin);
48
+ return () => {
49
+ document.removeEventListener('click', closePopin);
50
+ };
51
+ }, [closePopin]);
36
52
  const recommendationsView = _isEmpty(recommendations) ? null : /*#__PURE__*/React.createElement(CardsList, recommendations);
37
53
  const cardsView = _isEmpty(cards.list) ? /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
38
54
  className: style.noresults
@@ -46,7 +62,9 @@ const SearchPage = (props, context) => {
46
62
  },
47
63
  type: "link"
48
64
  }))), recommendationsView) : /*#__PURE__*/React.createElement(CardsGrid, cards);
49
- return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Filters, _extends({}, searchFilters, {
65
+ return /*#__PURE__*/React.createElement("div", {
66
+ ref: nodeRef
67
+ }, /*#__PURE__*/React.createElement(Filters, _extends({}, searchFilters, {
50
68
  moreSortAriaLabel: moreSortAriaLabel,
51
69
  moreFilterAriaLabel: moreFilterAriaLabel,
52
70
  filterGroupAriaLabel: filterGroupAriaLabel,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","PropTypes","Provider","Button","Filters","CardsGrid","CardsList","CMPopin","style","SearchPage","props","context","title","searchFilters","cards","noresultsfound","clearFilters","recommendations","moreSortAriaLabel","moreFilterAriaLabel","filterGroupAriaLabel","sortAriaLabel","popinWithCards","skin","defaultColor","recommendationsView","cardsView","list","noresults","noresultstxt","clear","background","cardsWrapper","contextTypes","childContextTypes","propTypes","string","shape"],"sources":["../../../../src/template/common/search-page/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {getOr, isEmpty} from 'lodash/fp';\nimport Provider from '../../../atom/provider';\nimport Button from '../../../atom/button';\nimport Filters from '../../../molecule/filters';\nimport CardsGrid from '../../../organism/cards-grid';\nimport CardsList from '../../../molecule/dashboard/cards-list';\nimport CMPopin from '../../../molecule/cm-popin';\nimport style from './style.css';\n\nconst SearchPage = (props, context) => {\n const {\n title,\n searchFilters,\n cards,\n noresultsfound,\n clearFilters,\n recommendations,\n moreSortAriaLabel,\n moreFilterAriaLabel,\n filterGroupAriaLabel,\n sortAriaLabel,\n popinWithCards\n } = props;\n\n const {skin} = context;\n const defaultColor = getOr('#00B0FF', 'common.primary', skin);\n\n const recommendationsView = isEmpty(recommendations) ? null : <CardsList {...recommendations} />;\n\n const cardsView = isEmpty(cards.list) ? (\n <div>\n <div className={style.noresults}>\n <div className={style.noresultstxt}>{noresultsfound}</div>\n <Button\n {...clearFilters}\n data-name=\"searchPageClear\"\n className={style.clear}\n style={{background: defaultColor}}\n type=\"link\"\n />\n </div>\n {recommendationsView}\n </div>\n ) : (\n <CardsGrid {...cards} />\n );\n\n return (\n <div>\n <Filters\n {...searchFilters}\n moreSortAriaLabel={moreSortAriaLabel}\n moreFilterAriaLabel={moreFilterAriaLabel}\n filterGroupAriaLabel={filterGroupAriaLabel}\n sortAriaLabel={sortAriaLabel}\n />\n <div data-name=\"searchResult\" className={style.cardsWrapper}>\n <div className={style.title} role=\"status\">\n {title}\n </div>\n {cardsView}\n </div>\n {popinWithCards ? (\n <div className={style.popinWithCards}>\n <CMPopin {...popinWithCards} />\n </div>\n ) : null}\n </div>\n );\n};\n\nSearchPage.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nSearchPage.propTypes = {\n noresultsfound: PropTypes.string,\n title: PropTypes.string,\n searchFilters: PropTypes.shape(Filters.propTypes),\n cards: PropTypes.shape(CardsGrid.propTypes),\n clearFilters: PropTypes.shape(Button.propTypes),\n recommendations: PropTypes.shape(CardsList.propTypes),\n moreSortAriaLabel: PropTypes.string,\n moreFilterAriaLabel: PropTypes.string,\n filterGroupAriaLabel: PropTypes.string,\n sortAriaLabel: PropTypes.string,\n popinWithCards: PropTypes.shape(CMPopin.propTypes)\n};\n\nexport default SearchPage;\n"],"mappings":";;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,OAAOC,QAAP,MAAqB,wBAArB;AACA,OAAOC,MAAP,MAAmB,sBAAnB;AACA,OAAOC,OAAP,MAAoB,2BAApB;AACA,OAAOC,SAAP,MAAsB,8BAAtB;AACA,OAAOC,SAAP,MAAsB,wCAAtB;AACA,OAAOC,OAAP,MAAoB,4BAApB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,UAAU,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EACrC,MAAM;IACJC,KADI;IAEJC,aAFI;IAGJC,KAHI;IAIJC,cAJI;IAKJC,YALI;IAMJC,eANI;IAOJC,iBAPI;IAQJC,mBARI;IASJC,oBATI;IAUJC,aAVI;IAWJC;EAXI,IAYFZ,KAZJ;EAcA,MAAM;IAACa;EAAD,IAASZ,OAAf;;EACA,MAAMa,YAAY,GAAG,OAAM,SAAN,EAAiB,gBAAjB,EAAmCD,IAAnC,CAArB;;EAEA,MAAME,mBAAmB,GAAG,SAAQR,eAAR,IAA2B,IAA3B,gBAAkC,oBAAC,SAAD,EAAeA,eAAf,CAA9D;EAEA,MAAMS,SAAS,GAAG,SAAQZ,KAAK,CAACa,IAAd,iBAChB,8CACE;IAAK,SAAS,EAAEnB,KAAK,CAACoB;EAAtB,gBACE;IAAK,SAAS,EAAEpB,KAAK,CAACqB;E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AS,CAAC6B,SAA1B,CANI;EAOrBjB,iBAAiB,EAAEjB,SAAS,CAACmC,MAPR;EAQrBjB,mBAAmB,EAAElB,SAAS,CAACmC,MARV;EASrBhB,oBAAoB,EAAEnB,SAAS,CAACmC,MATX;EAUrBf,aAAa,EAAEpB,SAAS,CAACmC,MAVJ;EAWrBd,cAAc,EAAErB,SAAS,CAACoC,KAAV,CAAgB9B,OAAO,CAAC4B,SAAxB;AAXK,CAAvB;AAcA,eAAe1B,UAAf"}
1
+ {"version":3,"file":"index.js","names":["React","useCallback","useEffect","useRef","PropTypes","Provider","Button","Filters","CardsGrid","CardsList","CMPopin","style","SearchPage","props","context","title","searchFilters","cards","noresultsfound","clearFilters","recommendations","moreSortAriaLabel","moreFilterAriaLabel","filterGroupAriaLabel","sortAriaLabel","popinWithCards","skin","defaultColor","nodeRef","closePopin","e","console","log","current","contains","target","document","addEventListener","removeEventListener","recommendationsView","cardsView","list","noresults","noresultstxt","clear","background","cardsWrapper","contextTypes","childContextTypes","propTypes","string","shape"],"sources":["../../../../src/template/common/search-page/index.js"],"sourcesContent":["import React, {useCallback, useEffect, useRef} from 'react';\nimport PropTypes from 'prop-types';\nimport {getOr, isEmpty} from 'lodash/fp';\nimport Provider from '../../../atom/provider';\nimport Button from '../../../atom/button';\nimport Filters from '../../../molecule/filters';\nimport CardsGrid from '../../../organism/cards-grid';\nimport CardsList from '../../../molecule/dashboard/cards-list';\nimport CMPopin from '../../../molecule/cm-popin';\nimport style from './style.css';\n\nconst SearchPage = (props, context) => {\n const {\n title,\n searchFilters,\n cards,\n noresultsfound,\n clearFilters,\n recommendations,\n moreSortAriaLabel,\n moreFilterAriaLabel,\n filterGroupAriaLabel,\n sortAriaLabel,\n popinWithCards\n } = props;\n\n const {skin} = context;\n const defaultColor = getOr('#00B0FF', 'common.primary', skin);\n const nodeRef = useRef(null);\n const closePopin = useCallback(e => {\n // eslint-disable-next-line no-console\n console.log(nodeRef);\n if (nodeRef && nodeRef.current && !nodeRef.current.contains(e.target)) {\n // eslint-disable-next-line no-console\n console.log('closePopin function called');\n }\n }, []);\n useEffect(() => {\n document.addEventListener('click', closePopin);\n return () => {\n document.removeEventListener('click', closePopin);\n };\n }, [closePopin]);\n const recommendationsView = isEmpty(recommendations) ? null : <CardsList {...recommendations} />;\n\n const cardsView = isEmpty(cards.list) ? (\n <div>\n <div className={style.noresults}>\n <div className={style.noresultstxt}>{noresultsfound}</div>\n <Button\n {...clearFilters}\n data-name=\"searchPageClear\"\n className={style.clear}\n style={{background: defaultColor}}\n type=\"link\"\n />\n </div>\n {recommendationsView}\n </div>\n ) : (\n <CardsGrid {...cards} />\n );\n\n return (\n <div ref={nodeRef}>\n <Filters\n {...searchFilters}\n moreSortAriaLabel={moreSortAriaLabel}\n moreFilterAriaLabel={moreFilterAriaLabel}\n filterGroupAriaLabel={filterGroupAriaLabel}\n sortAriaLabel={sortAriaLabel}\n />\n <div data-name=\"searchResult\" className={style.cardsWrapper}>\n <div className={style.title} role=\"status\">\n {title}\n </div>\n {cardsView}\n </div>\n {popinWithCards ? (\n <div className={style.popinWithCards}>\n <CMPopin {...popinWithCards} />\n </div>\n ) : null}\n </div>\n );\n};\n\nSearchPage.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nSearchPage.propTypes = {\n noresultsfound: PropTypes.string,\n title: PropTypes.string,\n searchFilters: PropTypes.shape(Filters.propTypes),\n cards: PropTypes.shape(CardsGrid.propTypes),\n clearFilters: PropTypes.shape(Button.propTypes),\n recommendations: PropTypes.shape(CardsList.propTypes),\n moreSortAriaLabel: PropTypes.string,\n moreFilterAriaLabel: PropTypes.string,\n filterGroupAriaLabel: PropTypes.string,\n sortAriaLabel: PropTypes.string,\n popinWithCards: PropTypes.shape(CMPopin.propTypes)\n};\n\nexport default SearchPage;\n"],"mappings":";;;;;AAAA,OAAOA,KAAP,IAAeC,WAAf,EAA4BC,SAA5B,EAAuCC,MAAvC,QAAoD,OAApD;AACA,OAAOC,SAAP,MAAsB,YAAtB;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C,KAAK,EAAEb,SAAS,CAAC+C,KAAV,CAAgB3C,SAAS,CAACyC,SAA1B,CAJc;EAKrB9B,YAAY,EAAEf,SAAS,CAAC+C,KAAV,CAAgB7C,MAAM,CAAC2C,SAAvB,CALO;EAMrB7B,eAAe,EAAEhB,SAAS,CAAC+C,KAAV,CAAgB1C,SAAS,CAACwC,SAA1B,CANI;EAOrB5B,iBAAiB,EAAEjB,SAAS,CAAC8C,MAPR;EAQrB5B,mBAAmB,EAAElB,SAAS,CAAC8C,MARV;EASrB3B,oBAAoB,EAAEnB,SAAS,CAAC8C,MATX;EAUrB1B,aAAa,EAAEpB,SAAS,CAAC8C,MAVJ;EAWrBzB,cAAc,EAAErB,SAAS,CAAC+C,KAAV,CAAgBzC,OAAO,CAACuC,SAAxB;AAXK,CAAvB;AAcA,eAAerC,UAAf"}
@@ -66,7 +66,6 @@ declare namespace ExternalCourse {
66
66
  backgroundImageUrl: PropTypes.Requireable<string>;
67
67
  descriptionText: PropTypes.Requireable<string>;
68
68
  cookieTitle: PropTypes.Requireable<string>;
69
- headerSubtitle: PropTypes.Requireable<string>;
70
69
  descriptionBtnTxt: PropTypes.Requireable<string>;
71
70
  listBtnSwicth: PropTypes.Requireable<(PropTypes.InferProps<{
72
71
  title: PropTypes.Requireable<string>;
@@ -87,185 +86,10 @@ declare namespace ExternalCourse {
87
86
  }> | null | undefined)[]>;
88
87
  items: PropTypes.Requireable<PropTypes.InferProps<{
89
88
  type: PropTypes.Requireable<string>;
90
- list: PropTypes.Requireable<NonNullable<PropTypes.InferProps<{
89
+ list: PropTypes.Requireable<PropTypes.InferProps<{
91
90
  list: PropTypes.Requireable<(PropTypes.InferProps<any> | null | undefined)[]>;
92
91
  loading: PropTypes.Requireable<boolean>;
93
- }> | PropTypes.InferProps<{
94
- 'aria-label': PropTypes.Requireable<string>;
95
- buttonLink: PropTypes.Requireable<PropTypes.InferProps<{
96
- type: PropTypes.Requireable<string>;
97
- label: PropTypes.Requireable<string>;
98
- 'aria-label': PropTypes.Requireable<string>;
99
- 'data-name': PropTypes.Requireable<string>;
100
- 'data-testid': PropTypes.Requireable<string>;
101
- icon: PropTypes.Requireable<PropTypes.InferProps<{
102
- position: PropTypes.Requireable<string>;
103
- type: PropTypes.Requireable<string>;
104
- }>>;
105
- onClick: PropTypes.Requireable<(...args: any[]) => any>;
106
- link: PropTypes.Requireable<PropTypes.InferProps<{
107
- href: PropTypes.Requireable<string>;
108
- download: PropTypes.Requireable<boolean>;
109
- target: PropTypes.Requireable<string>;
110
- }>>;
111
- disabled: PropTypes.Requireable<boolean>;
112
- className: PropTypes.Requireable<string>;
113
- customStyle: PropTypes.Requireable<PropTypes.InferProps<{}>>;
114
- }>>;
115
- selectMultiple: PropTypes.Requireable<PropTypes.InferProps<{
116
- title: PropTypes.Requireable<string>;
117
- placeholder: PropTypes.Requireable<string>;
118
- description: PropTypes.Requireable<string>;
119
- hint: PropTypes.Requireable<string>;
120
- options: PropTypes.Requireable<NonNullable<PropTypes.InferProps<{
121
- selected: PropTypes.Validator<boolean>;
122
- name: PropTypes.Validator<string>;
123
- value: PropTypes.Requireable<string>;
124
- }>>[]>;
125
- onChange: PropTypes.Requireable<(...args: any[]) => any>;
126
- onError: PropTypes.Requireable<(...args: any[]) => any>;
127
- multiple: PropTypes.Requireable<boolean>;
128
- modified: PropTypes.Requireable<boolean>;
129
- disabled: PropTypes.Requireable<boolean>;
130
- error: PropTypes.Requireable<string>;
131
- theme: PropTypes.Requireable<string>;
132
- }>>;
133
- content: PropTypes.Requireable<NonNullable<PropTypes.InferProps<{
134
- items: PropTypes.Requireable<(PropTypes.InferProps<{
135
- title: PropTypes.Validator<string>;
136
- dataColumns: PropTypes.Requireable<(PropTypes.InferProps<{
137
- label: PropTypes.Requireable<string>;
138
- type: PropTypes.Requireable<string>;
139
- className: PropTypes.Requireable<string>;
140
- }> | null | undefined)[]>;
141
- buttonLink: PropTypes.Requireable<PropTypes.InferProps<{
142
- type: PropTypes.Requireable<string>;
143
- label: PropTypes.Requireable<string>;
144
- ariaLabel: PropTypes.Requireable<string>;
145
- dataName: PropTypes.Requireable<string>;
146
- icon: PropTypes.Requireable<PropTypes.InferProps<{
147
- position: PropTypes.Requireable<string>;
148
- type: PropTypes.Requireable<string>;
149
- }>>;
150
- onClick: PropTypes.Requireable<(...args: any[]) => any>;
151
- }>>;
152
- buttonLinkIcon: PropTypes.Requireable<PropTypes.InferProps<{
153
- size: PropTypes.Requireable<string>;
154
- 'aria-label': PropTypes.Requireable<string>;
155
- 'data-name': PropTypes.Requireable<string>;
156
- icon: PropTypes.Requireable<string>;
157
- onClick: PropTypes.Requireable<(...args: any[]) => any>;
158
- link: PropTypes.Requireable<PropTypes.InferProps<{
159
- href: PropTypes.Requireable<string>;
160
- download: PropTypes.Requireable<boolean>;
161
- target: PropTypes.Requireable<string>;
162
- }>>;
163
- disabled: PropTypes.Requireable<boolean>;
164
- className: PropTypes.Requireable<string>;
165
- }>>;
166
- bulletPointMenuButton: PropTypes.Requireable<PropTypes.InferProps<{
167
- buttonAriaLabel: PropTypes.Requireable<string>;
168
- menuAriaLabel: PropTypes.Requireable<string>;
169
- buttons: PropTypes.Requireable<(PropTypes.InferProps<{
170
- 'data-name': PropTypes.Requireable<string>;
171
- label: PropTypes.Requireable<string>;
172
- type: PropTypes.Requireable<string>;
173
- onClick: PropTypes.Requireable<(...args: any[]) => any>;
174
- }> | null | undefined)[]>;
175
- onClick: PropTypes.Requireable<(...args: any[]) => any>;
176
- }>>;
177
- tags: PropTypes.Requireable<(PropTypes.InferProps<{
178
- label: PropTypes.Requireable<string>;
179
- type: PropTypes.Requireable<string>;
180
- }> | null | undefined)[]>;
181
- isBulkStyle: PropTypes.Requireable<boolean>;
182
- order: PropTypes.Requireable<number>;
183
- 'aria-label': PropTypes.Requireable<string>;
184
- contentType: PropTypes.Requireable<string>;
185
- id: PropTypes.Requireable<string>;
186
- }> | null | undefined)[]>;
187
- type: PropTypes.Requireable<string>;
188
- itemType: PropTypes.Requireable<string>;
189
- onDrop: PropTypes.Requireable<(...args: any[]) => any>;
190
- isDraggable: PropTypes.Requireable<boolean>;
191
- tableHeader: PropTypes.Requireable<(string | null | undefined)[]>;
192
- }> | PropTypes.InferProps<{
193
- type: PropTypes.Requireable<string>;
194
- columns: PropTypes.Requireable<(PropTypes.InferProps<{
195
- title: PropTypes.Validator<string>;
196
- }> | null | undefined)[]>;
197
- rows: PropTypes.Requireable<(PropTypes.InferProps<{
198
- fields: PropTypes.Requireable<(NonNullable<string | PropTypes.InferProps<{
199
- type: PropTypes.Requireable<string>;
200
- current: PropTypes.Requireable<boolean>;
201
- selected: PropTypes.Requireable<boolean>;
202
- icon: PropTypes.Requireable<string>;
203
- value: PropTypes.Requireable<string>;
204
- }> | null | undefined> | null | undefined)[]>;
205
- isRowExpandible: PropTypes.Requireable<boolean>;
206
- lastField: PropTypes.Requireable<NonNullable<string | PropTypes.InferProps<{
207
- type: PropTypes.Requireable<string>;
208
- disabled: PropTypes.Requireable<boolean>;
209
- buttonAriaLabel: PropTypes.Requireable<string>;
210
- menuAriaLabel: PropTypes.Requireable<string>;
211
- buttons: PropTypes.Validator<(PropTypes.InferProps<{
212
- 'data-name': PropTypes.Requireable<string>;
213
- disabled: PropTypes.Requireable<boolean>;
214
- label: PropTypes.Validator<string>;
215
- onClick: PropTypes.Validator<(...args: any[]) => any>;
216
- type: PropTypes.Requireable<string>;
217
- }> | null | undefined)[]>;
218
- onClick: PropTypes.Requireable<(...args: any[]) => any>;
219
- menuButtonClassName: PropTypes.Requireable<string>;
220
- isBulkMenu: PropTypes.Requireable<boolean>;
221
- }> | null | undefined>>;
222
- }> | null | undefined)[]>;
223
- stickyFirstColumn: PropTypes.Requireable<boolean>;
224
- stickyLastColumn: PropTypes.Requireable<boolean>;
225
- columnWidth: PropTypes.Requireable<string>;
226
- ariaDescribedby: PropTypes.Requireable<string>;
227
- lastField: PropTypes.Requireable<NonNullable<PropTypes.InferProps<{
228
- componentType: PropTypes.Requireable<string>;
229
- type: PropTypes.Requireable<string>;
230
- label: PropTypes.Requireable<string>;
231
- 'aria-label': PropTypes.Requireable<string>;
232
- 'data-name': PropTypes.Requireable<string>;
233
- 'data-testid': PropTypes.Requireable<string>;
234
- icon: PropTypes.Requireable<PropTypes.InferProps<{
235
- position: PropTypes.Requireable<string>;
236
- type: PropTypes.Requireable<string>;
237
- }>>;
238
- onClick: PropTypes.Requireable<(...args: any[]) => any>;
239
- link: PropTypes.Requireable<PropTypes.InferProps<{
240
- href: PropTypes.Requireable<string>;
241
- download: PropTypes.Requireable<boolean>;
242
- target: PropTypes.Requireable<string>;
243
- }>>;
244
- disabled: PropTypes.Requireable<boolean>;
245
- className: PropTypes.Requireable<string>;
246
- customStyle: PropTypes.Requireable<PropTypes.InferProps<{}>>;
247
- }> | PropTypes.InferProps<{
248
- componentType: PropTypes.Requireable<string>;
249
- disabled: PropTypes.Requireable<boolean>;
250
- buttonAriaLabel: PropTypes.Requireable<string>;
251
- menuAriaLabel: PropTypes.Requireable<string>;
252
- buttons: PropTypes.Validator<(PropTypes.InferProps<{
253
- 'data-name': PropTypes.Requireable<string>;
254
- disabled: PropTypes.Requireable<boolean>;
255
- label: PropTypes.Validator<string>;
256
- onClick: PropTypes.Validator<(...args: any[]) => any>;
257
- type: PropTypes.Requireable<string>;
258
- }> | null | undefined)[]>;
259
- onClick: PropTypes.Requireable<(...args: any[]) => any>;
260
- menuButtonClassName: PropTypes.Requireable<string>;
261
- isBulkMenu: PropTypes.Requireable<boolean>;
262
- }> | null | undefined>>;
263
- isNestedTable: PropTypes.Requireable<boolean>;
264
- emptyStateFirstMessage: PropTypes.Requireable<string>;
265
- emptyStateSecondMessage: PropTypes.Requireable<string>;
266
- }> | null | undefined>>;
267
- title: PropTypes.Requireable<string>;
268
- }> | null | undefined>>;
92
+ }>>;
269
93
  }>>;
270
94
  }>>;
271
95
  }
@@ -1,7 +1,7 @@
1
1
  export const UrlPropType: any;
2
2
  export const PathPropType: any;
3
3
  export const SrcPropType: PropTypes.Requireable<any>;
4
- export function FilesPropType(props: any, propName: any, componentName: any): Error | null;
4
+ export function ImagePropType(props: any, propName: any, componentName: any): Error | null;
5
5
  export const ColorPropType: any;
6
6
  export const HexPropType: any;
7
7
  import PropTypes from "prop-types";
@@ -1 +1 @@
1
- {"version":3,"file":"proptypes.d.ts","sourceRoot":"","sources":["../../src/util/proptypes.js"],"names":[],"mappings":"AAcA,8BAAsD;AAGtD,+BAAwD;AAExD,qDAA4E;AAErE,2FAoBN;AAED,gCAA4C;AAC5C,8BAAwC"}
1
+ {"version":3,"file":"proptypes.d.ts","sourceRoot":"","sources":["../../src/util/proptypes.js"],"names":[],"mappings":"AAYA,8BAAsD;AAGtD,+BAAwD;AAExD,qDAA4E;AAErE,2FAmBN;AAED,gCAA4C;AAC5C,8BAAwC"}
@@ -6,18 +6,17 @@ import every from 'lodash/fp/every';
6
6
  import stringMatching from 'extended-proptypes/lib/validators/stringMatching';
7
7
  import _ColorPropType from 'extended-proptypes/lib/validators/color';
8
8
  import _HexPropType from 'extended-proptypes/lib/validators/hex';
9
- import isEmpty from 'lodash/fp/isEmpty';
10
- import head from 'lodash/fp/head';
11
9
  const URL_REGEXP = /^(http(s)?:\/\/.)[-a-zA-Z0-9@:%._\\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\\+.~#?&//=]*)$/;
12
10
  export const UrlPropType = stringMatching(URL_REGEXP);
13
11
  const PATH_REGEXP = /^\/([-a-zA-Z0-9@:%_\\+.~#?&//=]*)$/;
14
12
  export const PathPropType = stringMatching(PATH_REGEXP);
15
13
  export const SrcPropType = PropTypes.oneOfType([UrlPropType, PathPropType]);
16
- export const FilesPropType = (props, propName, componentName) => {
17
- const validFilesTypes = ['image/jpeg', 'image/png', 'image/svg+xml', 'image/*', 'application/pdf', 'application/zip', 'text/csv'];
14
+ export const ImagePropType = (props, propName, componentName) => {
15
+ const validImageTypes = ['image/jpeg', 'image/png', 'image/svg+xml', 'image/*', 'application/pdf'];
18
16
  const propValue = props[propName];
19
- const filesTypes = split(',', propValue);
20
- const isValid = isEmpty(head(filesTypes)) || every(type => includes(trim(type), validFilesTypes), filesTypes);
17
+ if (!propValue) return new Error(`Missing prop: ${propName} at component: ${componentName}`);
18
+ const imageTypes = split(',', propValue);
19
+ const isValid = every(type => includes(trim(type), validImageTypes), imageTypes);
21
20
  if (isValid) return null;
22
21
  return new Error(`Invalid prop value: ${propValue}, at component: ${componentName}. Expected a valid image type: image/jpeg, image/png, image/* image/svg+xml or application/pdf.`);
23
22
  };
@@ -1 +1 @@
1
- {"version":3,"file":"proptypes.js","names":["PropTypes","split","trim","includes","every","stringMatching","_ColorPropType","_HexPropType","isEmpty","head","URL_REGEXP","UrlPropType","PATH_REGEXP","PathPropType","SrcPropType","oneOfType","FilesPropType","props","propName","componentName","validFilesTypes","propValue","filesTypes","isValid","type","Error","ColorPropType","HexPropType"],"sources":["../../src/util/proptypes.js"],"sourcesContent":["import PropTypes from 'prop-types';\nimport split from 'lodash/fp/split';\nimport trim from 'lodash/fp/trim';\nimport includes from 'lodash/fp/includes';\nimport every from 'lodash/fp/every';\nimport stringMatching from 'extended-proptypes/lib/validators/stringMatching';\n\nimport _ColorPropType from 'extended-proptypes/lib/validators/color';\nimport _HexPropType from 'extended-proptypes/lib/validators/hex';\nimport isEmpty from 'lodash/fp/isEmpty';\nimport head from 'lodash/fp/head';\n\nconst URL_REGEXP =\n /^(http(s)?:\\/\\/.)[-a-zA-Z0-9@:%._\\\\+~#=]{2,256}\\.[a-z]{2,6}\\b([-a-zA-Z0-9@:%_\\\\+.~#?&//=]*)$/;\nexport const UrlPropType = stringMatching(URL_REGEXP);\n\nconst PATH_REGEXP = /^\\/([-a-zA-Z0-9@:%_\\\\+.~#?&//=]*)$/;\nexport const PathPropType = stringMatching(PATH_REGEXP);\n\nexport const SrcPropType = PropTypes.oneOfType([UrlPropType, PathPropType]);\n\nexport const FilesPropType = (props, propName, componentName) => {\n const validFilesTypes = [\n 'image/jpeg',\n 'image/png',\n 'image/svg+xml',\n 'image/*',\n 'application/pdf',\n 'application/zip',\n 'text/csv'\n ];\n\n const propValue = props[propName];\n const filesTypes = split(',', propValue);\n const isValid =\n isEmpty(head(filesTypes)) || every(type => includes(trim(type), validFilesTypes), filesTypes);\n if (isValid) return null;\n\n return new Error(\n `Invalid prop value: ${propValue}, at component: ${componentName}. Expected a valid image type: image/jpeg, image/png, image/* image/svg+xml or application/pdf.`\n );\n};\n\nexport const ColorPropType = _ColorPropType;\nexport const HexPropType = _HexPropType;\n"],"mappings":"AAAA,OAAOA,SAAP,MAAsB,YAAtB;AACA,OAAOC,KAAP,MAAkB,iBAAlB;AACA,OAAOC,IAAP,MAAiB,gBAAjB;AACA,OAAOC,QAAP,MAAqB,oBAArB;AACA,OAAOC,KAAP,MAAkB,iBAAlB;AACA,OAAOC,cAAP,MAA2B,kDAA3B;AAEA,OAAOC,cAAP,MAA2B,yCAA3B;AACA,OAAOC,YAAP,MAAyB,uCAAzB;AACA,OAAOC,OAAP,MAAoB,mBAApB;AACA,OAAOC,IAAP,MAAiB,gBAAjB;AAEA,MAAMC,UAAU,GACd,8FADF;AAEA,OAAO,MAAMC,WAAW,GAAGN,cAAc,CAACK,UAAD,CAAlC;AAEP,MAAME,WAAW,GAAG,oCAApB;AACA,OAAO,MAAMC,YAAY,GAAGR,cAAc,CAACO,WAAD,CAAnC;AAEP,OAAO,MAAME,WAAW,GAAGd,SAAS,CAACe,SAAV,CAAoB,CAACJ,WAAD,EAAcE,YAAd,CAApB,CAApB;AAEP,OAAO,MAAMG,aAAa,GAAG,CAACC,KAAD,EAAQC,QAAR,EAAkBC,aAAlB,KAAoC;EAC/D,MAAMC,eAAe,GAAG,CACtB,YADsB,EAEtB,WAFsB,EAGtB,eAHsB,EAItB,SAJsB,EAKtB,iBALsB,EAMtB,iBANsB,EAOtB,UAPsB,CAAxB;EAUA,MAAMC,SAAS,GAAGJ,KAAK,CAACC,QAAD,CAAvB;EACA,MAAMI,UAAU,GAAGrB,KAAK,CAAC,GAAD,EAAMoB,SAAN,CAAxB;EACA,MAAME,OAAO,GACXf,OAAO,CAACC,IAAI,CAACa,UAAD,CAAL,CAAP,IAA6BlB,KAAK,CAACoB,IAAI,IAAIrB,QAAQ,CAACD,IAAI,CAACsB,IAAD,CAAL,EAAaJ,eAAb,CAAjB,EAAgDE,UAAhD,CADpC;EAEA,IAAIC,OAAJ,EAAa,OAAO,IAAP;EAEb,OAAO,IAAIE,KAAJ,CACJ,uBAAsBJ,SAAU,mBAAkBF,aAAc,iGAD5D,CAAP;AAGD,CApBM;AAsBP,OAAO,MAAMO,aAAa,GAAGpB,cAAtB;AACP,OAAO,MAAMqB,WAAW,GAAGpB,YAApB"}
1
+ {"version":3,"file":"proptypes.js","names":["PropTypes","split","trim","includes","every","stringMatching","_ColorPropType","_HexPropType","URL_REGEXP","UrlPropType","PATH_REGEXP","PathPropType","SrcPropType","oneOfType","ImagePropType","props","propName","componentName","validImageTypes","propValue","Error","imageTypes","isValid","type","ColorPropType","HexPropType"],"sources":["../../src/util/proptypes.js"],"sourcesContent":["import PropTypes from 'prop-types';\nimport split from 'lodash/fp/split';\nimport trim from 'lodash/fp/trim';\nimport includes from 'lodash/fp/includes';\nimport every from 'lodash/fp/every';\nimport stringMatching from 'extended-proptypes/lib/validators/stringMatching';\n\nimport _ColorPropType from 'extended-proptypes/lib/validators/color';\nimport _HexPropType from 'extended-proptypes/lib/validators/hex';\n\nconst URL_REGEXP =\n /^(http(s)?:\\/\\/.)[-a-zA-Z0-9@:%._\\\\+~#=]{2,256}\\.[a-z]{2,6}\\b([-a-zA-Z0-9@:%_\\\\+.~#?&//=]*)$/;\nexport const UrlPropType = stringMatching(URL_REGEXP);\n\nconst PATH_REGEXP = /^\\/([-a-zA-Z0-9@:%_\\\\+.~#?&//=]*)$/;\nexport const PathPropType = stringMatching(PATH_REGEXP);\n\nexport const SrcPropType = PropTypes.oneOfType([UrlPropType, PathPropType]);\n\nexport const ImagePropType = (props, propName, componentName) => {\n const validImageTypes = [\n 'image/jpeg',\n 'image/png',\n 'image/svg+xml',\n 'image/*',\n 'application/pdf'\n ];\n\n const propValue = props[propName];\n if (!propValue) return new Error(`Missing prop: ${propName} at component: ${componentName}`);\n\n const imageTypes = split(',', propValue);\n const isValid = every(type => includes(trim(type), validImageTypes), imageTypes);\n if (isValid) return null;\n\n return new Error(\n `Invalid prop value: ${propValue}, at component: ${componentName}. Expected a valid image type: image/jpeg, image/png, image/* image/svg+xml or application/pdf.`\n );\n};\n\nexport const ColorPropType = _ColorPropType;\nexport const HexPropType = _HexPropType;\n"],"mappings":"AAAA,OAAOA,SAAP,MAAsB,YAAtB;AACA,OAAOC,KAAP,MAAkB,iBAAlB;AACA,OAAOC,IAAP,MAAiB,gBAAjB;AACA,OAAOC,QAAP,MAAqB,oBAArB;AACA,OAAOC,KAAP,MAAkB,iBAAlB;AACA,OAAOC,cAAP,MAA2B,kDAA3B;AAEA,OAAOC,cAAP,MAA2B,yCAA3B;AACA,OAAOC,YAAP,MAAyB,uCAAzB;AAEA,MAAMC,UAAU,GACd,8FADF;AAEA,OAAO,MAAMC,WAAW,GAAGJ,cAAc,CAACG,UAAD,CAAlC;AAEP,MAAME,WAAW,GAAG,oCAApB;AACA,OAAO,MAAMC,YAAY,GAAGN,cAAc,CAACK,WAAD,CAAnC;AAEP,OAAO,MAAME,WAAW,GAAGZ,SAAS,CAACa,SAAV,CAAoB,CAACJ,WAAD,EAAcE,YAAd,CAApB,CAApB;AAEP,OAAO,MAAMG,aAAa,GAAG,CAACC,KAAD,EAAQC,QAAR,EAAkBC,aAAlB,KAAoC;EAC/D,MAAMC,eAAe,GAAG,CACtB,YADsB,EAEtB,WAFsB,EAGtB,eAHsB,EAItB,SAJsB,EAKtB,iBALsB,CAAxB;EAQA,MAAMC,SAAS,GAAGJ,KAAK,CAACC,QAAD,CAAvB;EACA,IAAI,CAACG,SAAL,EAAgB,OAAO,IAAIC,KAAJ,CAAW,iBAAgBJ,QAAS,kBAAiBC,aAAc,EAAnE,CAAP;EAEhB,MAAMI,UAAU,GAAGpB,KAAK,CAAC,GAAD,EAAMkB,SAAN,CAAxB;EACA,MAAMG,OAAO,GAAGlB,KAAK,CAACmB,IAAI,IAAIpB,QAAQ,CAACD,IAAI,CAACqB,IAAD,CAAL,EAAaL,eAAb,CAAjB,EAAgDG,UAAhD,CAArB;EACA,IAAIC,OAAJ,EAAa,OAAO,IAAP;EAEb,OAAO,IAAIF,KAAJ,CACJ,uBAAsBD,SAAU,mBAAkBF,aAAc,iGAD5D,CAAP;AAGD,CAnBM;AAqBP,OAAO,MAAMO,aAAa,GAAGlB,cAAtB;AACP,OAAO,MAAMmB,WAAW,GAAGlB,YAApB"}
@@ -47,9 +47,9 @@ const getButtonContent = (icon, label) => {
47
47
  className: _style.default.buttonContent
48
48
  }, position === 'left' ? /*#__PURE__*/_react.default.createElement(Icon, {
49
49
  className: _style.default.icon
50
- }) : null, label ? /*#__PURE__*/_react.default.createElement("span", {
50
+ }) : null, /*#__PURE__*/_react.default.createElement("span", {
51
51
  className: _style.default.label
52
- }, label) : null, position === 'right' ? /*#__PURE__*/_react.default.createElement(Icon, {
52
+ }, label), position === 'right' ? /*#__PURE__*/_react.default.createElement(Icon, {
53
53
  className: _style.default.icon
54
54
  }) : null);
55
55
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["getButtonContent","icon","label","type","position","Icon","ICONS","style","buttonContent","ButtonLink","props","disabled","dataName","dataTestId","ariaLabel","link","onClick","onKeyDown","className","customStyle","useTitle","contentView","styleButton","classnames","button","primary","secondary","tertiary","text","dangerous","handleOnClick","useCallback","handleOnKeyDown","event","title","propTypes"],"sources":["../../../src/atom/button-link/index.tsx"],"sourcesContent":["import React, {useCallback} from 'react';\nimport {noop} from 'lodash/fp';\nimport classnames from 'classnames';\nimport Link from '../link';\nimport {ICONS} from '../../util/button-icons';\nimport propTypes, {ButtonLinkProps, IconType} from './types';\nimport style from './style.css';\n\nconst getButtonContent = (icon?: IconType, label?: string) => {\n const {type, position} = icon || {type: '', position: ''};\n const Icon = type && ICONS[type];\n\n if (!Icon) {\n return (\n <div className={style.buttonContent}>\n <span className={style.label}>{label}</span>\n </div>\n );\n }\n\n return (\n <div className={style.buttonContent}>\n {position === 'left' ? <Icon className={style.icon} /> : null}\n {label ? <span className={style.label}>{label}</span> : null}\n {position === 'right' ? <Icon className={style.icon} /> : null}\n </div>\n );\n};\n\nconst ButtonLink = (props: ButtonLinkProps) => {\n const {\n type,\n label,\n disabled,\n icon,\n 'data-name': dataName,\n 'data-testid': dataTestId = 'button-link',\n 'aria-label': ariaLabel,\n link,\n onClick = noop,\n onKeyDown = noop,\n className,\n customStyle,\n useTitle = true\n } = props;\n const contentView = getButtonContent(icon, label);\n const styleButton = classnames(\n className,\n style.button,\n type === 'primary' && style.primary,\n type === 'secondary' && style.secondary,\n type === 'tertiary' && style.tertiary,\n type === 'text' && style.text,\n type === 'dangerous' && style.dangerous,\n link && style.link,\n disabled && style.disabled\n );\n\n const handleOnClick = useCallback(() => onClick(), [onClick]);\n\n const handleOnKeyDown = useCallback(event => onKeyDown(event), [onKeyDown]);\n\n if (link) {\n return (\n <Link\n {...link}\n {...(useTitle && {\n title: ariaLabel || label\n })}\n style={customStyle}\n className={styleButton}\n data-name={dataName}\n data-testid={dataTestId}\n aria-label={ariaLabel || label}\n >\n {contentView}\n </Link>\n );\n }\n\n return (\n <button\n {...(useTitle && {\n title: ariaLabel || label\n })}\n type=\"button\"\n aria-label={ariaLabel || label}\n data-name={dataName}\n data-testid={dataTestId}\n style={customStyle}\n className={styleButton}\n onClick={handleOnClick}\n onKeyDown={handleOnKeyDown}\n tabIndex={0}\n >\n {contentView}\n </button>\n );\n};\n\nButtonLink.propTypes = propTypes;\n\nexport default ButtonLink;\n"],"mappings":";;;;;;;AAAA;;AAEA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,gBAAgB,GAAG,CAACC,IAAD,EAAkBC,KAAlB,KAAqC;EAC5D,MAAM;I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ONS","style","buttonContent","ButtonLink","props","disabled","dataName","dataTestId","ariaLabel","link","onClick","onKeyDown","className","customStyle","useTitle","contentView","styleButton","classnames","button","primary","secondary","tertiary","text","dangerous","handleOnClick","useCallback","handleOnKeyDown","event","title","propTypes"],"sources":["../../../src/atom/button-link/index.tsx"],"sourcesContent":["import React, {useCallback} from 'react';\nimport {noop} from 'lodash/fp';\nimport classnames from 'classnames';\nimport Link from '../link';\nimport {ICONS} from '../../util/button-icons';\nimport propTypes, {ButtonLinkProps, IconType} from './types';\nimport style from './style.css';\n\nconst getButtonContent = (icon?: IconType, label?: string) => {\n const {type, position} = icon || {type: '', position: ''};\n const Icon = type && ICONS[type];\n\n if (!Icon) {\n return (\n <div className={style.buttonContent}>\n <span className={style.label}>{label}</span>\n </div>\n );\n }\n\n return (\n <div className={style.buttonContent}>\n {position === 'left' ? <Icon className={style.icon} /> : null}\n <span className={style.label}>{label}</span>\n {position === 'right' ? <Icon className={style.icon} /> : null}\n </div>\n );\n};\n\nconst ButtonLink = (props: ButtonLinkProps) => {\n const {\n type,\n label,\n disabled,\n icon,\n 'data-name': dataName,\n 'data-testid': dataTestId = 'button-link',\n 'aria-label': ariaLabel,\n link,\n onClick = noop,\n onKeyDown = noop,\n className,\n customStyle,\n useTitle = true\n } = props;\n const contentView = getButtonContent(icon, label);\n const styleButton = classnames(\n className,\n style.button,\n type === 'primary' && style.primary,\n type === 'secondary' && style.secondary,\n type === 'tertiary' && style.tertiary,\n type === 'text' && style.text,\n type === 'dangerous' && style.dangerous,\n link && style.link,\n disabled && style.disabled\n );\n\n const handleOnClick = useCallback(() => onClick(), [onClick]);\n\n const handleOnKeyDown = useCallback(event => onKeyDown(event), [onKeyDown]);\n\n if (link) {\n return (\n <Link\n {...link}\n {...(useTitle && {\n title: ariaLabel || label\n })}\n style={customStyle}\n className={styleButton}\n data-name={dataName}\n data-testid={dataTestId}\n aria-label={ariaLabel || label}\n >\n {contentView}\n </Link>\n );\n }\n\n return (\n <button\n {...(useTitle && {\n title: ariaLabel || label\n })}\n type=\"button\"\n aria-label={ariaLabel || label}\n data-name={dataName}\n data-testid={dataTestId}\n style={customStyle}\n className={styleButton}\n onClick={handleOnClick}\n onKeyDown={handleOnKeyDown}\n tabIndex={0}\n >\n {contentView}\n </button>\n );\n};\n\nButtonLink.propTypes = propTypes;\n\nexport default ButtonLink;\n"],"mappings":";;;;;;;AAAA;;AAEA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,gBAAgB,GAAG,CAACC,IAAD,EAAkBC,KAAlB,KAAqC;EAC5D,MAAM;IAACC,IAAD;IAAOC;EAAP,IAAmBH,IAAI,IAAI;IAACE,IAAI,EAAE,EAAP;IAAWC,QAAQ,EAAE;EAArB,CAAjC;EACA,MAAMC,IAAI,GAAGF,IAAI,IAAIG,kBAAA,CAAMH,IAAN,CAArB;;EAEA,IAAI,CAACE,IAAL,EAAW;IACT,oBACE;MAAK,SAAS,EAAEE,cAAA,CAAMC;IAAtB,gBACE;MAAM,SAAS,EAAED,cAAA,CAAML;IAAvB,GAA+BA,KAA/B,CADF,CADF;EAKD;;EAED,oBACE;IAAK,SAAS,EAAEK,cAAA,CAAMC;EAAtB,GACGJ,QAAQ,KAAK,MAAb,gBAAsB,6BAAC,IAAD;IAAM,SAAS,EAAEG,cAAA,CAAMN;EAAvB,EAAtB,GAAwD,IAD3D,eAEE;IAAM,SAAS,EAAEM,cAAA,CAAML;EAAvB,GAA+BA,KAA/B,CAFF,EAGGE,QAAQ,KAAK,OAAb,gBAAuB,6BAAC,IAAD;IAAM,SAAS,EAAEG,cAAA,CAAMN;EAAvB,EAAvB,GAAyD,IAH5D,CADF;AAOD,CAnBD;;AAqBA,MAAMQ,UAAU,GAAIC,KAAD,IAA4B;EAC7C,MAAM;IACJP,IADI;IAEJD,KAFI;IAGJS,QAHI;IAIJV,IAJI;IAKJ,aAAaW,QALT;IAMJ,eAAeC,UAAU,GAAG,aANxB;IAOJ,cAAcC,SAPV;IAQJC,IAR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KE,cAAYY,SAAS,IAAIZ,KAL3B;IAME,aAAWU,QANb;IAOE,eAAaC,UAPf;IAQE,KAAK,EAAEM,WART;IASE,SAAS,EAAEG,WATb;IAUE,OAAO,EAAEQ,aAVX;IAWE,SAAS,EAAEE,eAXb;IAYE,QAAQ,EAAE;EAZZ,IAcGX,WAdH,CADF;AAkBD,CArED;;AAuEAZ,UAAU,CAAC0B,SAAX,2CAAuBA,cAAvB;eAEe1B,U"}
@@ -21,7 +21,6 @@
21
21
  align-items: center;
22
22
  cursor: pointer;
23
23
  border: none;
24
- padding: 0px 16px;
25
24
  /* prevents text selection when dragging
26
25
  the mouse over the button */
27
26
  user-select: none;
@@ -20,7 +20,6 @@ declare class DragAndDrop extends React.Component<any, any, any> {
20
20
  errorButtonLabel: PropTypes.Requireable<string>;
21
21
  pdfButtonLabel: PropTypes.Requireable<string>;
22
22
  pdfButtonAriaLabel: PropTypes.Requireable<string>;
23
- multiple: PropTypes.Requireable<boolean>;
24
23
  };
25
24
  constructor(props: any);
26
25
  state: {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/drag-and-drop/index.js"],"names":[],"mappings":";AAiBA;IACE;;;;;;;;;;;;;;;;;;;;;MAqBE;IAEF,wBASC;IANC;;MAEC;IAMH,wBAIC;IAED,uBAIC;IAED,sBA4MC;CACF"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/drag-and-drop/index.js"],"names":[],"mappings":";AAiBA;IACE;;;;;;;;;;;;;;;;;;;;MAoBE;IAEF,wBASC;IANC;;MAEC;IAMH,wBAIC;IAED,uBAIC;IAED,sBA0LC;CACF"}