@coorpacademy/components 10.5.3 → 10.5.7-alpha.3

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 (127) hide show
  1. package/es/molecule/course-section/index.js +5 -3
  2. package/es/molecule/course-section/index.js.map +1 -1
  3. package/es/molecule/course-section/style.css +2 -1
  4. package/es/molecule/course-section/test/fixtures/chapter.js +2 -1
  5. package/es/molecule/course-section/test/fixtures/chapter.js.map +1 -1
  6. package/es/molecule/course-section/test/fixtures/course.js +2 -1
  7. package/es/molecule/course-section/test/fixtures/course.js.map +1 -1
  8. package/es/molecule/course-section/test/fixtures.js +15 -0
  9. package/es/molecule/course-section/test/fixtures.js.map +1 -0
  10. package/es/molecule/course-sections/index.js +40 -0
  11. package/es/molecule/course-sections/index.js.map +1 -0
  12. package/es/molecule/course-sections/style.css +3 -0
  13. package/es/molecule/course-sections/test/fixtures/default.js +149 -0
  14. package/es/molecule/course-sections/test/fixtures/default.js.map +1 -0
  15. package/es/molecule/course-sections/test/fixtures/loading.js +9 -0
  16. package/es/molecule/course-sections/test/fixtures/loading.js.map +1 -0
  17. package/es/molecule/draggable/index.js +1 -1
  18. package/es/molecule/draggable/index.js.map +1 -1
  19. package/es/molecule/draggable/style.css +2 -16
  20. package/es/molecule/draggable-list/index.js +56 -0
  21. package/es/molecule/draggable-list/index.js.map +1 -0
  22. package/es/molecule/draggable-list/test/fixtures/course-sections.js +20 -0
  23. package/es/molecule/draggable-list/test/fixtures/course-sections.js.map +1 -0
  24. package/es/molecule/draggable-list/test/fixtures/dashboard-sections.js +26 -0
  25. package/es/molecule/draggable-list/test/fixtures/dashboard-sections.js.map +1 -0
  26. package/es/molecule/draggable-list/test/fixtures.js +13 -0
  27. package/es/molecule/draggable-list/test/fixtures.js.map +1 -0
  28. package/es/molecule/{setup-sections → draggable-list}/test/on-drop.js +17 -17
  29. package/es/molecule/draggable-list/test/on-drop.js.map +1 -0
  30. package/es/molecule/questions/qcm/index.js +40 -25
  31. package/es/molecule/questions/qcm/index.js.map +1 -1
  32. package/es/molecule/questions/qcm/style.css +39 -15
  33. package/es/molecule/questions/qcm/test/fixtures/default.js +8 -0
  34. package/es/molecule/questions/qcm/test/fixtures/default.js.map +1 -1
  35. package/es/molecule/questions/qcm/test/qcm.js +105 -0
  36. package/es/molecule/questions/qcm/test/qcm.js.map +1 -0
  37. package/es/molecule/questions/qcm-graphic/index.js +38 -17
  38. package/es/molecule/questions/qcm-graphic/index.js.map +1 -1
  39. package/es/molecule/questions/qcm-graphic/style.css +60 -15
  40. package/es/molecule/questions/qcm-graphic/test/qcm-graphic.js +65 -0
  41. package/es/molecule/questions/qcm-graphic/test/qcm-graphic.js.map +1 -0
  42. package/es/molecule/select-multiple/style.css +8 -5
  43. package/es/molecule/setup-section/style.css +1 -0
  44. package/es/molecule/setup-sections/index.js +7 -33
  45. package/es/molecule/setup-sections/index.js.map +1 -1
  46. package/es/molecule/wizard-summary/test/fixtures/organize-courses.js +106 -0
  47. package/es/molecule/wizard-summary/test/fixtures/organize-courses.js.map +1 -0
  48. package/es/organism/brand-form/test/fixtures/wizard-playlists.js +1 -1
  49. package/es/organism/brand-form/test/fixtures/wizard-playlists.js.map +1 -1
  50. package/es/organism/wizard-contents/index.js +6 -0
  51. package/es/organism/wizard-contents/index.js.map +1 -1
  52. package/es/organism/wizard-contents/test/fixtures/playlist-organize-courses.js +45 -0
  53. package/es/organism/wizard-contents/test/fixtures/playlist-organize-courses.js.map +1 -0
  54. package/es/template/back-office/brand-update/test/fixtures/wizard-organize-courses-playlist.js +22 -0
  55. package/es/template/back-office/brand-update/test/fixtures/wizard-organize-courses-playlist.js.map +1 -0
  56. package/es/util/get-shadow-box-color-from-primary.js +4 -0
  57. package/es/util/get-shadow-box-color-from-primary.js.map +1 -0
  58. package/es/util/test/get-shadow-box-color-from-primary.js +33 -0
  59. package/es/util/test/get-shadow-box-color-from-primary.js.map +1 -0
  60. package/es/variables/colors.css +3 -0
  61. package/lib/molecule/course-section/index.js +5 -3
  62. package/lib/molecule/course-section/index.js.map +1 -1
  63. package/lib/molecule/course-section/style.css +2 -1
  64. package/lib/molecule/course-section/test/fixtures/chapter.js +2 -1
  65. package/lib/molecule/course-section/test/fixtures/chapter.js.map +1 -1
  66. package/lib/molecule/course-section/test/fixtures/course.js +2 -1
  67. package/lib/molecule/course-section/test/fixtures/course.js.map +1 -1
  68. package/lib/molecule/course-section/test/fixtures.js +25 -0
  69. package/lib/molecule/course-section/test/fixtures.js.map +1 -0
  70. package/lib/molecule/course-sections/index.js +54 -0
  71. package/lib/molecule/course-sections/index.js.map +1 -0
  72. package/lib/molecule/course-sections/style.css +3 -0
  73. package/lib/molecule/course-sections/test/fixtures/default.js +154 -0
  74. package/lib/molecule/course-sections/test/fixtures/default.js.map +1 -0
  75. package/lib/molecule/course-sections/test/fixtures/loading.js +14 -0
  76. package/lib/molecule/course-sections/test/fixtures/loading.js.map +1 -0
  77. package/lib/molecule/draggable/index.js +1 -1
  78. package/lib/molecule/draggable/index.js.map +1 -1
  79. package/lib/molecule/draggable/style.css +2 -16
  80. package/lib/molecule/draggable-list/index.js +73 -0
  81. package/lib/molecule/draggable-list/index.js.map +1 -0
  82. package/lib/molecule/draggable-list/test/fixtures/course-sections.js +29 -0
  83. package/lib/molecule/draggable-list/test/fixtures/course-sections.js.map +1 -0
  84. package/lib/molecule/draggable-list/test/fixtures/dashboard-sections.js +37 -0
  85. package/lib/molecule/draggable-list/test/fixtures/dashboard-sections.js.map +1 -0
  86. package/lib/molecule/draggable-list/test/fixtures.js +22 -0
  87. package/lib/molecule/draggable-list/test/fixtures.js.map +1 -0
  88. package/lib/molecule/{setup-sections → draggable-list}/test/on-drop.js +19 -19
  89. package/lib/molecule/draggable-list/test/on-drop.js.map +1 -0
  90. package/lib/molecule/questions/qcm/index.js +47 -23
  91. package/lib/molecule/questions/qcm/index.js.map +1 -1
  92. package/lib/molecule/questions/qcm/style.css +39 -15
  93. package/lib/molecule/questions/qcm/test/fixtures/default.js +8 -0
  94. package/lib/molecule/questions/qcm/test/fixtures/default.js.map +1 -1
  95. package/lib/molecule/questions/qcm/test/qcm.js +117 -0
  96. package/lib/molecule/questions/qcm/test/qcm.js.map +1 -0
  97. package/lib/molecule/questions/qcm-graphic/index.js +36 -15
  98. package/lib/molecule/questions/qcm-graphic/index.js.map +1 -1
  99. package/lib/molecule/questions/qcm-graphic/style.css +60 -15
  100. package/lib/molecule/questions/qcm-graphic/test/qcm-graphic.js +76 -0
  101. package/lib/molecule/questions/qcm-graphic/test/qcm-graphic.js.map +1 -0
  102. package/lib/molecule/select-multiple/style.css +8 -5
  103. package/lib/molecule/setup-section/style.css +1 -0
  104. package/lib/molecule/setup-sections/index.js +7 -37
  105. package/lib/molecule/setup-sections/index.js.map +1 -1
  106. package/lib/molecule/wizard-summary/test/fixtures/organize-courses.js +111 -0
  107. package/lib/molecule/wizard-summary/test/fixtures/organize-courses.js.map +1 -0
  108. package/lib/organism/brand-form/test/fixtures/wizard-playlists.js +1 -1
  109. package/lib/organism/brand-form/test/fixtures/wizard-playlists.js.map +1 -1
  110. package/lib/organism/wizard-contents/index.js +7 -0
  111. package/lib/organism/wizard-contents/index.js.map +1 -1
  112. package/lib/organism/wizard-contents/test/fixtures/playlist-organize-courses.js +54 -0
  113. package/lib/organism/wizard-contents/test/fixtures/playlist-organize-courses.js.map +1 -0
  114. package/lib/template/back-office/brand-update/test/fixtures/wizard-organize-courses-playlist.js +32 -0
  115. package/lib/template/back-office/brand-update/test/fixtures/wizard-organize-courses-playlist.js.map +1 -0
  116. package/lib/util/get-shadow-box-color-from-primary.js +12 -0
  117. package/lib/util/get-shadow-box-color-from-primary.js.map +1 -0
  118. package/lib/util/test/get-shadow-box-color-from-primary.js +40 -0
  119. package/lib/util/test/get-shadow-box-color-from-primary.js.map +1 -0
  120. package/lib/variables/colors.css +3 -0
  121. package/package.json +2 -2
  122. package/es/molecule/search/test/fixtures.js +0 -15
  123. package/es/molecule/search/test/fixtures.js.map +0 -1
  124. package/es/molecule/setup-sections/test/on-drop.js.map +0 -1
  125. package/lib/molecule/search/test/fixtures.js +0 -25
  126. package/lib/molecule/search/test/fixtures.js.map +0 -1
  127. package/lib/molecule/setup-sections/test/on-drop.js.map +0 -1
@@ -17,12 +17,13 @@ const CourseSection = props => {
17
17
  'aria-label': {
18
18
  title: ariaLabelTitle,
19
19
  author: ariaLabelAuthor
20
- }
20
+ },
21
+ id
21
22
  } = props;
22
23
  return /*#__PURE__*/React.createElement("div", {
23
24
  className: style.container,
24
25
  "aria-label": ariaLabelTitle,
25
- "data-name": `course-section-${position}`
26
+ "data-name": `course-section-${id}`
26
27
  }, /*#__PURE__*/React.createElement("span", {
27
28
  className: style.position
28
29
  }, position), /*#__PURE__*/React.createElement("div", {
@@ -54,7 +55,8 @@ CourseSection.propTypes = process.env.NODE_ENV !== "production" ? {
54
55
  contentBadge: PropTypes.shape(ContentBadge.propTypes),
55
56
  title: PropTypes.string,
56
57
  author: PropTypes.string,
57
- position: PropTypes.number
58
+ position: PropTypes.number,
59
+ id: PropTypes.string
58
60
  } : {};
59
61
  export default CourseSection;
60
62
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/molecule/course-section/index.js"],"names":["React","PropTypes","CardImagePreview","ContentBadge","style","CourseSection","props","image","contentBadge","category","label","title","author","position","ariaLabelTitle","ariaLabelAuthor","container","containerImage","containerInfos","containerMainInfos","propTypes","shape","string","number"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,gBAAP,MAA6B,+BAA7B;AACA,OAAOC,YAAP,MAAyB,0BAAzB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,aAAa,GAAGC,KAAK,IAAI;AAC7B,QAAM;AACJC,IAAAA,KADI;AAEJC,IAAAA,YAAY,EAAE;AAACC,MAAAA,QAAD;AAAWC,MAAAA;AAAX,KAFV;AAGJC,IAAA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PO;AAQxBV,EAAAA,MAAM,EAAEX,SAAS,CAACqB,MARM;AASxBT,EAAAA,QAAQ,EAAEZ,SAAS,CAACsB;AATI,CAA1B;AAYA,eAAelB,aAAf","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 } = props;\n return (\n <div\n className={style.container}\n aria-label={ariaLabelTitle}\n data-name={`course-section-${position}`}\n >\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};\n\nexport default CourseSection;\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../../src/molecule/course-section/index.js"],"names":["React","PropTypes","CardImagePreview","ContentBadge","style","CourseSection","props","image","contentBadge","category","label","title","author","position","ariaLabelTitle","ariaLabelAuthor","id","container","containerImage","containerInfos","containerMainInfos","propTypes","shape","string","number"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,gBAAP,MAA6B,+BAA7B;AACA,OAAOC,YAAP,MAAyB,0BAAzB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,aAAa,GAAGC,KAAK,IAAI;AAC7B,QAAM;AAC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,MALO;AAMxBf,EAAAA,YAAY,EAAEP,SAAS,CAACqB,KAAV,CAAgBnB,YAAY,CAACkB,SAA7B,CANU;AAOxBV,EAAAA,KAAK,EAAEV,SAAS,CAACsB,MAPO;AAQxBX,EAAAA,MAAM,EAAEX,SAAS,CAACsB,MARM;AASxBV,EAAAA,QAAQ,EAAEZ,SAAS,CAACuB,MATI;AAUxBR,EAAAA,EAAE,EAAEf,SAAS,CAACsB;AAVU,CAA1B;AAaA,eAAelB,aAAf","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 14px;
54
+ margin: 0 12px 0 32px;
54
55
  }
55
56
 
56
57
  .contentBadge {
@@ -11,7 +11,8 @@ export default {
11
11
  label: 'chapter',
12
12
  category: 'chapter'
13
13
  },
14
- position: 2
14
+ position: 2,
15
+ id: 'chap_1'
15
16
  }
16
17
  };
17
18
  //# sourceMappingURL=chapter.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/molecule/course-section/test/fixtures/chapter.js"],"names":["props","title","author","image","contentBadge","label","category","position"],"mappings":"AAAA,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;AAbL;AADM,CAAf","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 }\n};\n"],"file":"chapter.js"}
1
+ {"version":3,"sources":["../../../../../src/molecule/course-section/test/fixtures/chapter.js"],"names":["props","title","author","image","contentBadge","label","category","position","id"],"mappings":"AAAA,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,CAAf","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"}
@@ -11,7 +11,8 @@ export default {
11
11
  label: 'course',
12
12
  category: 'course'
13
13
  },
14
- position: 1
14
+ position: 1,
15
+ id: 'disc_1'
15
16
  }
16
17
  };
17
18
  //# sourceMappingURL=course.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/molecule/course-section/test/fixtures/course.js"],"names":["props","title","author","image","contentBadge","label","category","position"],"mappings":"AAAA,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;AAdL;AADM,CAAf","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 }\n};\n"],"file":"course.js"}
1
+ {"version":3,"sources":["../../../../../src/molecule/course-section/test/fixtures/course.js"],"names":["props","title","author","image","contentBadge","label","category","position","id"],"mappings":"AAAA,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,CAAf","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,15 @@
1
+ import test from 'ava';
2
+ import forEach from 'lodash/forEach';
3
+ import renderComponentMacro from '../../../test/helpers/render-component';
4
+ import MoleculeCourseSection from '..';
5
+ import fixtureChapter from './fixtures/chapter';
6
+ import fixtureCourse from './fixtures/course';
7
+ test('Molecule › MoleculeCourseSection > should have valid propTypes', t => {
8
+ t.pass();
9
+ forEach(MoleculeCourseSection.propTypes, (value, key) => {
10
+ t.not(value, undefined, `PropType for "Molecule.MoleculeCourseSection.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
11
+ });
12
+ });
13
+ test('Molecule › MoleculeCourseSection › Chapter › should be rendered', renderComponentMacro, MoleculeCourseSection, fixtureChapter);
14
+ test('Molecule › MoleculeCourseSection › Course › should be rendered', renderComponentMacro, MoleculeCourseSection, fixtureCourse);
15
+ //# sourceMappingURL=fixtures.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/molecule/course-section/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","MoleculeCourseSection","fixtureChapter","fixtureCourse","t","pass","propTypes","value","key","not","undefined"],"mappings":"AAAA,OAAOA,IAAP,MAAiB,KAAjB;AACA,OAAOC,OAAP,MAAoB,gBAApB;AACA,OAAOC,oBAAP,MAAiC,wCAAjC;AACA,OAAOC,qBAAP,MAAkC,IAAlC;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,aAAP,MAA0B,mBAA1B;AAEAL,IAAI,CAAC,gEAAD,EAAmEM,CAAC,IAAI;AAC1EA,EAAAA,CAAC,CAACC,IAAF;AACAN,EAAAA,OAAO,CAACE,qBAAqB,CAACK,SAAvB,EAAkC,CAACC,KAAD,EAAQC,GAAR,KAAgB;AACvDJ,IAAAA,CAAC,CAACK,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,0DAAyDF,GAAI,mEAAtF;AACD,GAFM,CAAP;AAGD,CALG,CAAJ;AAOAV,IAAI,CAAC,iEAAD,EAAoEE,oBAApE,EAA0FC,qBAA1F,EAAiHC,cAAjH,CAAJ;AACAJ,IAAI,CAAC,gEAAD,EAAmEE,oBAAnE,EAAyFC,qBAAzF,EAAgHE,aAAhH,CAAJ","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport MoleculeCourseSection from '..';\nimport fixtureChapter from './fixtures/chapter';\nimport fixtureCourse from './fixtures/course';\n\ntest('Molecule › MoleculeCourseSection > should have valid propTypes', t => {\n t.pass();\n forEach(MoleculeCourseSection.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Molecule.MoleculeCourseSection.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Molecule › MoleculeCourseSection › Chapter › should be rendered', renderComponentMacro, MoleculeCourseSection, fixtureChapter);\ntest('Molecule › MoleculeCourseSection › Course › should be rendered', renderComponentMacro, MoleculeCourseSection, fixtureCourse);\n"],"file":"fixtures.js"}
@@ -0,0 +1,40 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import CourseSection from '../course-section';
4
+ import DraggableList from '../draggable-list';
5
+ import Loader from '../../atom/loader';
6
+ import Title from '../../atom/title';
7
+ import style from './style.css';
8
+
9
+ const Loading = () => /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Loader, {
10
+ theme: "coorpmanager"
11
+ }));
12
+
13
+ const CourseSections = ({
14
+ sections,
15
+ onDrop,
16
+ isLoading,
17
+ title
18
+ }) => {
19
+ if (isLoading) return /*#__PURE__*/React.createElement(Loading, null);
20
+ return /*#__PURE__*/React.createElement("div", null, title ? /*#__PURE__*/React.createElement("div", {
21
+ className: style.title
22
+ }, /*#__PURE__*/React.createElement(Title, {
23
+ title: title,
24
+ type: 'form-group',
25
+ "data-name": 'course-sections-title'
26
+ })) : null, /*#__PURE__*/React.createElement(DraggableList, {
27
+ itemType: "course-section",
28
+ items: sections,
29
+ onDrop: onDrop
30
+ }));
31
+ };
32
+
33
+ CourseSections.propTypes = process.env.NODE_ENV !== "production" ? {
34
+ title: PropTypes.string,
35
+ sections: PropTypes.arrayOf(PropTypes.shape(CourseSection.propTypes)),
36
+ onDrop: PropTypes.func,
37
+ isLoading: PropTypes.bool
38
+ } : {};
39
+ export default CourseSections;
40
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/molecule/course-sections/index.js"],"names":["React","PropTypes","CourseSection","DraggableList","Loader","Title","style","Loading","CourseSections","sections","onDrop","isLoading","title","propTypes","string","arrayOf","shape","func","bool"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,aAAP,MAA0B,mBAA1B;AACA,OAAOC,aAAP,MAA0B,mBAA1B;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,OAAOC,KAAP,MAAkB,kBAAlB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,OAAO,GAAG,mBACd,8CACE,oBAAC,MAAD;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,oBAAC,OAAD,OAAP;AAEf,sBACE,iCACGC,KAAK,gBACJ;AAAK,IAAA,SAAS,EAAEN,KAAK,CAACM;AAAtB,kBACE,oBAAC,KAAD;AAAO,IAAA,KAAK,EAAEA,KAAd;AAAqB,IAAA,IAAI,EAAE,YAA3B;AAAyC,iBAAW;AAApD,IADF,CADI,GAIF,IALN,eAME,oBAAC,aAAD;AAAe,IAAA,QAAQ,EAAC,gBAAxB;AAAyC,IAAA,KAAK,EAAEH,QAAhD;AAA0D,IAAA,MAAM,EAAEC;AAAlE,IANF,CADF;AAUD,CAbD;;AAeAF,cAAc,CAACK,SAAf,2CAA2B;AACzBD,EAAAA,KAAK,EAAEX,SAAS,CAACa,MADQ;AAEzBL,EAAAA,QAAQ,EAAER,SAAS,CAACc,OAAV,CAAkBd,SAAS,CAACe,KAAV,CAAgBd,aAAa,CAACW,SAA9B,CAAlB,CAFe;AAGzBH,EAAAA,MAAM,EAAET,SAAS,CAACgB,IAHO;AAIzBN,EAAAA,SAAS,EAAEV,SAAS,CAACiB;AAJI,CAA3B;AAOA,eAAeV,cAAf","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"}
@@ -0,0 +1,3 @@
1
+ .title {
2
+ margin-bottom: 16px;
3
+ }
@@ -0,0 +1,149 @@
1
+ export default {
2
+ props: {
3
+ sections: [{
4
+ 'aria-label': {
5
+ title: 'aria label title',
6
+ author: 'aria label author'
7
+ },
8
+ title: 'Marketing and online advertising Marketing and online advertising Marketing and online advertising Marketing and online advertising',
9
+ author: 'Author',
10
+ image: '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',
11
+ contentBadge: {
12
+ label: 'course',
13
+ category: 'course'
14
+ },
15
+ position: 1,
16
+ id: 'disc_1'
17
+ }, {
18
+ 'aria-label': {
19
+ title: 'aria label title',
20
+ author: 'aria label author'
21
+ },
22
+ title: 'Social networks',
23
+ author: 'Author',
24
+ image: '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',
25
+ contentBadge: {
26
+ label: "5' learning",
27
+ category: 'chapter'
28
+ },
29
+ position: 2,
30
+ id: 'chap_1'
31
+ }, {
32
+ 'aria-label': {
33
+ title: 'aria label title',
34
+ author: 'aria label author'
35
+ },
36
+ title: 'Other title',
37
+ author: 'Author 2',
38
+ image: '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',
39
+ contentBadge: {
40
+ label: 'course',
41
+ category: 'course'
42
+ },
43
+ position: 3,
44
+ id: 'disc_2'
45
+ }, {
46
+ 'aria-label': {
47
+ title: 'aria label title',
48
+ author: 'aria label author'
49
+ },
50
+ title: 'Social others',
51
+ author: 'Author XXX',
52
+ image: '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',
53
+ contentBadge: {
54
+ label: "5' learning",
55
+ category: 'chapter'
56
+ },
57
+ position: 4,
58
+ id: 'chap_2'
59
+ }, {
60
+ 'aria-label': {
61
+ title: 'aria label title',
62
+ author: 'aria label author'
63
+ },
64
+ title: 'Social others others',
65
+ author: 'Author XXX',
66
+ image: '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',
67
+ contentBadge: {
68
+ label: "5' learning",
69
+ category: 'chapter'
70
+ },
71
+ position: 5,
72
+ id: 'chap_3'
73
+ }, {
74
+ 'aria-label': {
75
+ title: 'aria label title',
76
+ author: 'aria label author'
77
+ },
78
+ title: 'Something about empowerment',
79
+ author: 'Author XXX',
80
+ image: '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',
81
+ contentBadge: {
82
+ label: 'course',
83
+ category: 'course'
84
+ },
85
+ position: 6,
86
+ id: 'disc_3'
87
+ }, {
88
+ 'aria-label': {
89
+ title: 'aria label title',
90
+ author: 'aria label author'
91
+ },
92
+ title: 'Be a better human being',
93
+ author: 'Author XXX',
94
+ image: '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',
95
+ contentBadge: {
96
+ label: "5' learning",
97
+ category: 'chapter'
98
+ },
99
+ position: 7,
100
+ id: 'chap_4'
101
+ }, {
102
+ 'aria-label': {
103
+ title: 'aria label title',
104
+ author: 'aria label author'
105
+ },
106
+ title: 'Stronger faster better',
107
+ author: 'Author XXX',
108
+ image: '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',
109
+ contentBadge: {
110
+ label: 'course',
111
+ category: 'course'
112
+ },
113
+ position: 8,
114
+ id: 'disc_4'
115
+ }, {
116
+ 'aria-label': {
117
+ title: 'aria label title',
118
+ author: 'aria label author'
119
+ },
120
+ title: 'Relativity beyond time',
121
+ author: 'Author XXX',
122
+ image: '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',
123
+ contentBadge: {
124
+ label: 'course',
125
+ category: 'course'
126
+ },
127
+ position: 9,
128
+ id: 'disc_5'
129
+ }, {
130
+ 'aria-label': {
131
+ title: 'aria label title',
132
+ author: 'aria label author'
133
+ },
134
+ title: 'Are you awake?',
135
+ author: 'Author XXX',
136
+ image: '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',
137
+ contentBadge: {
138
+ label: "5' learning",
139
+ category: 'chapter'
140
+ },
141
+ position: 10,
142
+ id: 'chap_5'
143
+ }],
144
+ isLoading: false,
145
+ onDrop: () => console.log('on drop'),
146
+ title: 'Organize courses'
147
+ }
148
+ };
149
+ //# sourceMappingURL=default.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/molecule/course-sections/test/fixtures/default.js"],"names":["props","sections","title","author","image","contentBadge","label","category","position","id","isLoading","onDrop","console","log"],"mappings":"AAAA,eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,QAAQ,EAAE,CACR;AACE,oBAAc;AACZC,QAAAA,KAAK,EAAE,kBADK;AAEZC,QAAAA,MAAM,EAAE;AAFI,OADhB;AAKED,MAAAA,KAAK,EACH,qIANJ;AAOEC,MAAAA,MAAM,EAAE,QAPV;AAQEC,MAAAA,KAAK,EACH,4LATJ;AAUEC,MAAAA,YAAY,EAAE;AACZC,QAAAA,KAAK,EAAE,QADK;AAEZC,QAAAA,QAAQ,EAAE;AAFE,OAVhB;AAcEC,MAAAA,QAAQ,EAAE,CAdZ;AAeEC,MAAAA,EAAE,EAAE;AAfN,KADQ,EAkBR;AACE,oBAAc;AACZP,QAAAA,KAAK,EAAE,kBADK;AAEZC,QAAAA,MAAM,EAAE;AAFI,OADhB;AAKED,MAAAA,KAAK,EAAE,iBALT;AAMEC,MAAAA,MAAM,EAAE,QANV;AAOEC,MAAAA,KAAK,EACH,4LARJ;AASEC,MAAAA,YAAY,EAAE;AACZC,QAAAA,KAAK,EAAE,aADK;AAEZC,QAAAA,QAAQ,EAAE;AAFE,OAThB;AAaEC,MAAAA,QAAQ,EAAE,CAbZ;AAcEC,MAAAA,EAAE,EAAE;AAdN,KAlBQ,EAkCR;AACE,oBAAc;AACZP,QAAAA,KAAK,EAAE,kBADK;AAEZC,QAAAA,MAAM,EAAE;AAFI,OADhB;AAKED,MAAAA,KAAK,EAAE,aALT;AAMEC,MAAAA,MAAM,EAAE,UANV;AAOEC,MAAAA,KAAK,EACH,4LARJ;AASEC,MAAAA,YAAY,EAAE;AACZC,QAAAA,KAAK,EAAE,QADK;AAEZC,QAAAA,QAAQ,EAAE;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AAA,QAAQ,EAAE;AAFE,OAThB;AAaEC,MAAAA,QAAQ,EAAE,EAbZ;AAcEC,MAAAA,EAAE,EAAE;AAdN,KAlJQ,CADL;AAoKLC,IAAAA,SAAS,EAAE,KApKN;AAqKLC,IAAAA,MAAM,EAAE,MAAMC,OAAO,CAACC,GAAR,CAAY,SAAZ,CArKT;AAsKLX,IAAAA,KAAK,EAAE;AAtKF;AADM,CAAf","sourcesContent":["export default {\n props: {\n sections: [\n {\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 '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: \"5' learning\",\n category: 'chapter'\n },\n position: 2,\n id: 'chap_1'\n },\n {\n 'aria-label': {\n title: 'aria label title',\n author: 'aria label author'\n },\n title: 'Other title',\n author: 'Author 2',\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: 3,\n id: 'disc_2'\n },\n {\n 'aria-label': {\n title: 'aria label title',\n author: 'aria label author'\n },\n title: 'Social others',\n author: 'Author XXX',\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: \"5' learning\",\n category: 'chapter'\n },\n position: 4,\n id: 'chap_2'\n },\n {\n 'aria-label': {\n title: 'aria label title',\n author: 'aria label author'\n },\n title: 'Social others others',\n author: 'Author XXX',\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: \"5' learning\",\n category: 'chapter'\n },\n position: 5,\n id: 'chap_3'\n },\n {\n 'aria-label': {\n title: 'aria label title',\n author: 'aria label author'\n },\n title: 'Something about empowerment',\n author: 'Author XXX',\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: 6,\n id: 'disc_3'\n },\n {\n 'aria-label': {\n title: 'aria label title',\n author: 'aria label author'\n },\n title: 'Be a better human being',\n author: 'Author XXX',\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: \"5' learning\",\n category: 'chapter'\n },\n position: 7,\n id: 'chap_4'\n },\n {\n 'aria-label': {\n title: 'aria label title',\n author: 'aria label author'\n },\n title: 'Stronger faster better',\n author: 'Author XXX',\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: 8,\n id: 'disc_4'\n },\n {\n 'aria-label': {\n title: 'aria label title',\n author: 'aria label author'\n },\n title: 'Relativity beyond time',\n author: 'Author XXX',\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: 9,\n id: 'disc_5'\n },\n {\n 'aria-label': {\n title: 'aria label title',\n author: 'aria label author'\n },\n title: 'Are you awake?',\n author: 'Author XXX',\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: \"5' learning\",\n category: 'chapter'\n },\n position: 10,\n id: 'chap_5'\n }\n ],\n isLoading: false,\n onDrop: () => console.log('on drop'),\n title: 'Organize courses'\n }\n};\n"],"file":"default.js"}
@@ -0,0 +1,9 @@
1
+ export default {
2
+ props: {
3
+ sections: [],
4
+ isLoading: true,
5
+ onDrop: () => console.log('on drop'),
6
+ title: ''
7
+ }
8
+ };
9
+ //# sourceMappingURL=loading.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/molecule/course-sections/test/fixtures/loading.js"],"names":["props","sections","isLoading","onDrop","console","log","title"],"mappings":"AAAA,eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,QAAQ,EAAE,EADL;AAELC,IAAAA,SAAS,EAAE,IAFN;AAGLC,IAAAA,MAAM,EAAE,MAAMC,OAAO,CAACC,GAAR,CAAY,SAAZ,CAHT;AAILC,IAAAA,KAAK,EAAE;AAJF;AADM,CAAf","sourcesContent":["export default {\n props: {\n sections: [],\n isLoading: true,\n onDrop: () => console.log('on drop'),\n title: ''\n }\n};\n"],"file":"loading.js"}
@@ -34,7 +34,7 @@ const Draggable = props => {
34
34
  onDrop(id);
35
35
  }, [id, onDrop]);
36
36
  return /*#__PURE__*/React.createElement("div", {
37
- className: classnames(dragging ? style.dragging : null, style.section, style.draggable),
37
+ className: classnames(dragging ? style.dragging : null, style.draggable),
38
38
  onDragStart: dragStartHandler,
39
39
  onDragOver: dragOverHandler,
40
40
  onDragLeave: dragLeaveHandler,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/molecule/draggable/index.js"],"names":["React","useCallback","PropTypes","classnames","style","preventDefault","e","stopPropagation","Draggable","props","id","dragging","onDragStart","onDragOver","onDragLeave","onDrop","children","dragStartHandler","dragOverHandler","dragLeaveHandler","dropHandler","section","draggable","propTypes","string","bool","func","element"],"mappings":"AAAA,OAAOA,KAAP,IAAeC,WAAf,QAAiC,OAAjC;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,cAAc,GAAGC,CAAC,IAAIA,CAAC,CAACD,cAAF,EAA5B;;AACA,MAAME,eAAe,GAAGD,CAAC,IAAIA,CAAC,CAACC,eAAF,EAA7B;;AAEA,MAAMC,SAAS,GAAGC,KAAK,IAAI;AACzB,QAAM;AAACC,IAAAA,EAAD;AAAKC,IAAAA,QAAQ,GAAG,KAAhB;AAAuBC,IAAAA,WAAvB;AAAoCC,IAAAA,UAApC;AAAgDC,IAAAA,WAAhD;AAA6DC,IAAAA,MAA7D;AAAqEC,IAAAA;AAArE,MAAiFP,KAAvF;AAEA,QAAMQ,gBAAgB,GAAGhB,WAAW,CAClCK,CAAC,IAAI;AACHC,IAAAA,eAAe,CAACD,CAAD,CAAf;AACAM,IAAAA,WAAW,CAACF,EAAD,CAAX;AACD,GAJiC,EAKlC,CAACA,EAAD,EAAKE,WAAL,CALkC,CAApC;AAOA,QAAMM,eAAe,GAAGjB,WAAW,CACjCK,CAAC,IAAI;AACHD,IAAAA,cAAc,CAACC,CAAD,CAAd;AACAO,IAAAA,UAAU,CAACH,EAAD,CAAV;AACD,GAJgC,EAKjC,CAACA,EAAD,EAAKG,UAAL,CALiC,CAAnC;AAOA,QAAMM,gBAAgB,GAAGlB,WAAW,CAClCK,CAAC,IAAI;AACHD,IAAAA,cAAc,CAACC,CAAD,CAAd;AACAQ,IAAAA,WAAW,CAACJ,EAAD,CAAX;AACD,GAJiC,EAKlC,CAACA,EAAD,EAAKI,WAAL,CALkC,CAApC;AAOA,QAAMM,WAAW,GAAGnB,WAAW,CAC7BK,CAAC,IAAI;AACHD,IAAAA,cAAc,CAACC,CAAD,CAAd;AACAS,IAAAA,MAAM,CAACL,EAAD,CAAN;AACD,GAJ4B,EAK7B,CAACA,EAAD,EAAKK,MAAL,CAL6B,CAA/B;AAQA,sBACE;AACE,IAAA,SAAS,EAAEZ,UAAU,CAACQ,QAAQ,GAAGP,KAAK,CAACO,QAAT,GAAoB,IAA7B,EAAmCP,KAAK,CAACiB,OAAzC,EAAkDjB,KAAK,CAACkB,SAAxD,CADvB;AAEE,IAAA,WAAW,EAAEL,gBAFf;AAGE,IAAA,UAAU,EAAEC,eAHd;AAIE,IAAA,WAAW,EAAEC,gBAJf;AAKE,IAAA,MAAM,EAAEC,WALV;AAME,IAAA,SAAS;AANX,KAQGJ,QARH,CADF;AAYD,CA5CD;;AA6CAR,SAAS,CAACe,SAAV,2CAAsB;AACpBb,EAAAA,EAAE,EAAER,SAAS,CAACsB,MADM;AAEpBb,EAAAA,QAAQ,EAAET,SAAS,CAACuB,IAFA;AAGpBb,EAAAA,WAAW,EAAEV,SAAS,CAACwB,IAHH;AAIpBb,EAAAA,UAAU,EAAEX,SAAS,CAACwB,IAJF;AAKpBZ,EAAAA,WAAW,EAAEZ,SAAS,CAACwB,IALH;AAMpBX,EAAAA,MAAM,EAAEb,SAAS,CAACwB,IANE;AAOpBV,EAAAA,QAAQ,EAAEd,SAAS,CAACyB;AAPA,CAAtB;AAUA,eAAenB,SAAf","sourcesContent":["import React, {useCallback} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport style from './style.css';\n\nconst preventDefault = e => e.preventDefault();\nconst stopPropagation = e => e.stopPropagation();\n\nconst Draggable = props => {\n const {id, dragging = false, onDragStart, onDragOver, onDragLeave, onDrop, children} = props;\n\n const dragStartHandler = useCallback(\n e => {\n stopPropagation(e);\n onDragStart(id);\n },\n [id, onDragStart]\n );\n const dragOverHandler = useCallback(\n e => {\n preventDefault(e);\n onDragOver(id);\n },\n [id, onDragOver]\n );\n const dragLeaveHandler = useCallback(\n e => {\n preventDefault(e);\n onDragLeave(id);\n },\n [id, onDragLeave]\n );\n const dropHandler = useCallback(\n e => {\n preventDefault(e);\n onDrop(id);\n },\n [id, onDrop]\n );\n\n return (\n <div\n className={classnames(dragging ? style.dragging : null, style.section, style.draggable)}\n onDragStart={dragStartHandler}\n onDragOver={dragOverHandler}\n onDragLeave={dragLeaveHandler}\n onDrop={dropHandler}\n draggable\n >\n {children}\n </div>\n );\n};\nDraggable.propTypes = {\n id: PropTypes.string,\n dragging: PropTypes.bool,\n onDragStart: PropTypes.func,\n onDragOver: PropTypes.func,\n onDragLeave: PropTypes.func,\n onDrop: PropTypes.func,\n children: PropTypes.element\n};\n\nexport default Draggable;\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../../src/molecule/draggable/index.js"],"names":["React","useCallback","PropTypes","classnames","style","preventDefault","e","stopPropagation","Draggable","props","id","dragging","onDragStart","onDragOver","onDragLeave","onDrop","children","dragStartHandler","dragOverHandler","dragLeaveHandler","dropHandler","draggable","propTypes","string","bool","func","element"],"mappings":"AAAA,OAAOA,KAAP,IAAeC,WAAf,QAAiC,OAAjC;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,cAAc,GAAGC,CAAC,IAAIA,CAAC,CAACD,cAAF,EAA5B;;AACA,MAAME,eAAe,GAAGD,CAAC,IAAIA,CAAC,CAACC,eAAF,EAA7B;;AAEA,MAAMC,SAAS,GAAGC,KAAK,IAAI;AACzB,QAAM;AAACC,IAAAA,EAAD;AAAKC,IAAAA,QAAQ,GAAG,KAAhB;AAAuBC,IAAAA,WAAvB;AAAoCC,IAAAA,UAApC;AAAgDC,IAA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,QAAQ,EAAET,SAAS,CAACsB,IAFA;AAGpBZ,EAAAA,WAAW,EAAEV,SAAS,CAACuB,IAHH;AAIpBZ,EAAAA,UAAU,EAAEX,SAAS,CAACuB,IAJF;AAKpBX,EAAAA,WAAW,EAAEZ,SAAS,CAACuB,IALH;AAMpBV,EAAAA,MAAM,EAAEb,SAAS,CAACuB,IANE;AAOpBT,EAAAA,QAAQ,EAAEd,SAAS,CAACwB;AAPA,CAAtB;AAUA,eAAelB,SAAf","sourcesContent":["import React, {useCallback} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport style from './style.css';\n\nconst preventDefault = e => e.preventDefault();\nconst stopPropagation = e => e.stopPropagation();\n\nconst Draggable = props => {\n const {id, dragging = false, onDragStart, onDragOver, onDragLeave, onDrop, children} = props;\n\n const dragStartHandler = useCallback(\n e => {\n stopPropagation(e);\n onDragStart(id);\n },\n [id, onDragStart]\n );\n const dragOverHandler = useCallback(\n e => {\n preventDefault(e);\n onDragOver(id);\n },\n [id, onDragOver]\n );\n const dragLeaveHandler = useCallback(\n e => {\n preventDefault(e);\n onDragLeave(id);\n },\n [id, onDragLeave]\n );\n const dropHandler = useCallback(\n e => {\n preventDefault(e);\n onDrop(id);\n },\n [id, onDrop]\n );\n\n return (\n <div\n className={classnames(dragging ? style.dragging : null, style.draggable)}\n onDragStart={dragStartHandler}\n onDragOver={dragOverHandler}\n onDragLeave={dragLeaveHandler}\n onDrop={dropHandler}\n draggable\n >\n {children}\n </div>\n );\n};\nDraggable.propTypes = {\n id: PropTypes.string,\n dragging: PropTypes.bool,\n onDragStart: PropTypes.func,\n onDragOver: PropTypes.func,\n onDragLeave: PropTypes.func,\n onDrop: PropTypes.func,\n children: PropTypes.element\n};\n\nexport default Draggable;\n"],"file":"index.js"}
@@ -4,24 +4,9 @@
4
4
  @value medium from colors;
5
5
  @value xtraLightGrey from colors;
6
6
  @value dark from colors;
7
- @value cm_grey_100 from colors
7
+ @value cm_grey_100 from colors;
8
8
 
9
9
 
10
- .section {
11
- border-top: 1px;
12
- border-left: 1px;
13
- border-right: 1px;
14
- border-style: solid;
15
- border-color: medium;
16
- border-bottom: 0;
17
- display: flex;
18
- justify-content: center;
19
- }
20
-
21
- .section:last-child {
22
- border-bottom: 1px solid medium;
23
- }
24
-
25
10
  .draggable {
26
11
  cursor: grab;
27
12
  position: relative;
@@ -68,6 +53,7 @@
68
53
  font-family: 'Open Sans';
69
54
  font-weight: 600;
70
55
  font-size: 14px;
56
+ border-radius: 7px;
71
57
  }
72
58
 
73
59
  @media mobile {
@@ -0,0 +1,56 @@
1
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
+
3
+ import React, { useState, useCallback } from 'react';
4
+ import PropTypes from 'prop-types';
5
+ import Draggable from '../draggable';
6
+ import SetupSection from '../setup-section';
7
+ import CourseSection from '../course-section';
8
+ const ITEMS = {
9
+ 'setup-section': SetupSection,
10
+ 'course-section': CourseSection
11
+ };
12
+
13
+ const DraggableList = ({
14
+ items,
15
+ onDrop,
16
+ itemType
17
+ }) => {
18
+ const [dragTo, setDragTo] = useState(null);
19
+ const [dragFrom, setDragFrom] = useState(null);
20
+ const dragStartHandler = useCallback(id => {
21
+ setDragFrom(id);
22
+ }, [setDragFrom]);
23
+ const dragOverHandler = useCallback(id => {
24
+ if (dragTo === id) return;
25
+ setDragTo(id);
26
+ }, [dragTo, setDragTo]);
27
+ const dragLeaveHandler = useCallback(id => {
28
+ setDragTo(null);
29
+ }, [setDragTo]);
30
+ const dropHandler = useCallback(id => {
31
+ if (onDrop && dragFrom) onDrop(dragFrom, id);
32
+ setDragTo(null);
33
+ setDragFrom(null);
34
+ }, [onDrop, setDragTo, setDragFrom, dragFrom]);
35
+ const Item = ITEMS[itemType];
36
+ const itemsView = items.map(item => /*#__PURE__*/React.createElement(Draggable, {
37
+ key: item.id,
38
+ id: item.id,
39
+ dragging: dragTo === item.id,
40
+ onDragStart: dragStartHandler,
41
+ onDragOver: dragOverHandler,
42
+ onDragLeave: dragLeaveHandler,
43
+ onDrop: dropHandler
44
+ }, /*#__PURE__*/React.createElement(Item, _extends({}, item, {
45
+ key: item.id
46
+ }))));
47
+ return /*#__PURE__*/React.createElement("div", null, itemsView);
48
+ };
49
+
50
+ DraggableList.propTypes = process.env.NODE_ENV !== "production" ? {
51
+ items: PropTypes.arrayOf(PropTypes.shape(SetupSection.propTypes)),
52
+ onDrop: PropTypes.func,
53
+ itemType: PropTypes.string
54
+ } : {};
55
+ export default DraggableList;
56
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/molecule/draggable-list/index.js"],"names":["React","useState","useCallback","PropTypes","Draggable","SetupSection","CourseSection","ITEMS","DraggableList","items","onDrop","itemType","dragTo","setDragTo","dragFrom","setDragFrom","dragStartHandler","id","dragOverHandler","dragLeaveHandler","dropHandler","Item","itemsView","map","item","propTypes","arrayOf","shape","func","string"],"mappings":";;AAAA,OAAOA,KAAP,IAAeC,QAAf,EAAyBC,WAAzB,QAA2C,OAA3C;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,SAAP,MAAsB,cAAtB;AACA,OAAOC,YAAP,MAAyB,kBAAzB;AACA,OAAOC,aAAP,MAA0B,mBAA1B;AAEA,MAAMC,KAAK,GAAG;AAAC,mBAAiBF,YAAlB;AAAgC,oBAAkBC;AAAlD,CAAd;;AAEA,MAAME,aAAa,GAAG,CAAC;AAACC,EAAAA,KAAD;AAAQC,EAAAA,MAAR;AAAgBC,EAAAA;AAAhB,CAAD,KAA+B;AACnD,QAAM,CAACC,MAAD,EAASC,SAAT,IAAsBZ,QAAQ,CAAC,IAAD,CAApC;AACA,QAAM,CAACa,QAAD,EAAWC,WAAX,IAA0Bd,QAAQ,CAAC,IAAD,CAAxC;AAEA,QAAMe,gBAAgB,GAA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A,sBAAO,iCAAMK,SAAN,CAAP;AACD,CAnDD;;AAqDAd,aAAa,CAACiB,SAAd,2CAA0B;AACxBhB,EAAAA,KAAK,EAAEN,SAAS,CAACuB,OAAV,CAAkBvB,SAAS,CAACwB,KAAV,CAAgBtB,YAAY,CAACoB,SAA7B,CAAlB,CADiB;AAExBf,EAAAA,MAAM,EAAEP,SAAS,CAACyB,IAFM;AAGxBjB,EAAAA,QAAQ,EAAER,SAAS,CAAC0B;AAHI,CAA1B;AAMA,eAAerB,aAAf","sourcesContent":["import React, {useState, useCallback} from 'react';\nimport PropTypes from 'prop-types';\nimport Draggable from '../draggable';\nimport SetupSection from '../setup-section';\nimport CourseSection from '../course-section';\n\nconst ITEMS = {'setup-section': SetupSection, 'course-section': CourseSection};\n\nconst DraggableList = ({items, onDrop, itemType}) => {\n const [dragTo, setDragTo] = useState(null);\n const [dragFrom, setDragFrom] = useState(null);\n\n const dragStartHandler = useCallback(\n id => {\n setDragFrom(id);\n },\n [setDragFrom]\n );\n\n const dragOverHandler = useCallback(\n id => {\n if (dragTo === id) return;\n setDragTo(id);\n },\n [dragTo, setDragTo]\n );\n\n const dragLeaveHandler = useCallback(\n id => {\n setDragTo(null);\n },\n [setDragTo]\n );\n\n const dropHandler = useCallback(\n id => {\n if (onDrop && dragFrom) onDrop(dragFrom, id);\n\n setDragTo(null);\n setDragFrom(null);\n },\n [onDrop, setDragTo, setDragFrom, dragFrom]\n );\n\n const Item = ITEMS[itemType];\n const itemsView = items.map(item => (\n <Draggable\n key={item.id}\n id={item.id}\n dragging={dragTo === item.id}\n onDragStart={dragStartHandler}\n onDragOver={dragOverHandler}\n onDragLeave={dragLeaveHandler}\n onDrop={dropHandler}\n >\n <Item {...item} key={item.id} />\n </Draggable>\n ));\n return <div>{itemsView}</div>;\n};\n\nDraggableList.propTypes = {\n items: PropTypes.arrayOf(PropTypes.shape(SetupSection.propTypes)),\n onDrop: PropTypes.func,\n itemType: PropTypes.string\n};\n\nexport default DraggableList;\n"],"file":"index.js"}
@@ -0,0 +1,20 @@
1
+ import courseSections from '../../../course-sections/test/fixtures/default';
2
+ const {
3
+ props: {
4
+ sections
5
+ }
6
+ } = courseSections;
7
+ export default {
8
+ props: {
9
+ itemType: 'course-section',
10
+ items: sections,
11
+ onDrop: (dragged, dropped) => {
12
+ console.log('foo');
13
+ console.log({
14
+ dragged,
15
+ dropped
16
+ });
17
+ }
18
+ }
19
+ };
20
+ //# sourceMappingURL=course-sections.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/molecule/draggable-list/test/fixtures/course-sections.js"],"names":["courseSections","props","sections","itemType","items","onDrop","dragged","dropped","console","log"],"mappings":"AAAA,OAAOA,cAAP,MAA2B,gDAA3B;AAEA,MAAM;AACJC,EAAAA,KAAK,EAAE;AAACC,IAAAA;AAAD;AADH,IAEFF,cAFJ;AAIA,eAAe;AACbC,EAAAA,KAAK,EAAE;AACLE,IAAAA,QAAQ,EAAE,gBADL;AAELC,IAAAA,KAAK,EAAEF,QAFF;AAGLG,IAAAA,MAAM,EAAE,CAACC,OAAD,EAAUC,OAAV,KAAsB;AAC5BC,MAAAA,OAAO,CAACC,GAAR,CAAY,KAAZ;AACAD,MAAAA,OAAO,CAACC,GAAR,CAAY;AAACH,QAAAA,OAAD;AAAUC,QAAAA;AAAV,OAAZ;AACD;AANI;AADM,CAAf","sourcesContent":["import courseSections from '../../../course-sections/test/fixtures/default';\n\nconst {\n props: {sections}\n} = courseSections;\n\nexport default {\n props: {\n itemType: 'course-section',\n items: sections,\n onDrop: (dragged, dropped) => {\n console.log('foo');\n console.log({dragged, dropped});\n }\n }\n};\n"],"file":"course-sections.js"}
@@ -0,0 +1,26 @@
1
+ import Boutique from '../../../setup-section/test/fixtures/analytics-boutique';
2
+ import Branch from '../../../setup-section/test/fixtures/analytics-branch';
3
+ import Region from '../../../setup-section/test/fixtures/analytics-region';
4
+ const {
5
+ props: boutique
6
+ } = Boutique;
7
+ const {
8
+ props: branch
9
+ } = Branch;
10
+ const {
11
+ props: region
12
+ } = Region;
13
+ export default {
14
+ props: {
15
+ itemType: 'setup-section',
16
+ items: [boutique, branch, region],
17
+ onDrop: (dragged, dropped) => {
18
+ console.log('foo');
19
+ console.log({
20
+ dragged,
21
+ dropped
22
+ });
23
+ }
24
+ }
25
+ };
26
+ //# sourceMappingURL=dashboard-sections.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/molecule/draggable-list/test/fixtures/dashboard-sections.js"],"names":["Boutique","Branch","Region","props","boutique","branch","region","itemType","items","onDrop","dragged","dropped","console","log"],"mappings":"AAAA,OAAOA,QAAP,MAAqB,yDAArB;AACA,OAAOC,MAAP,MAAmB,uDAAnB;AACA,OAAOC,MAAP,MAAmB,uDAAnB;AAEA,MAAM;AAACC,EAAAA,KAAK,EAAEC;AAAR,IAAoBJ,QAA1B;AACA,MAAM;AAACG,EAAAA,KAAK,EAAEE;AAAR,IAAkBJ,MAAxB;AACA,MAAM;AAACE,EAAAA,KAAK,EAAEG;AAAR,IAAkBJ,MAAxB;AAEA,eAAe;AACbC,EAAAA,KAAK,EAAE;AACLI,IAAAA,QAAQ,EAAE,eADL;AAELC,IAAAA,KAAK,EAAE,CAACJ,QAAD,EAAWC,MAAX,EAAmBC,MAAnB,CAFF;AAGLG,IAAAA,MAAM,EAAE,CAACC,OAAD,EAAUC,OAAV,KAAsB;AAC5BC,MAAAA,OAAO,CAACC,GAAR,CAAY,KAAZ;AACAD,MAAAA,OAAO,CAACC,GAAR,CAAY;AAACH,QAAAA,OAAD;AAAUC,QAAAA;AAAV,OAAZ;AACD;AANI;AADM,CAAf","sourcesContent":["import Boutique from '../../../setup-section/test/fixtures/analytics-boutique';\nimport Branch from '../../../setup-section/test/fixtures/analytics-branch';\nimport Region from '../../../setup-section/test/fixtures/analytics-region';\n\nconst {props: boutique} = Boutique;\nconst {props: branch} = Branch;\nconst {props: region} = Region;\n\nexport default {\n props: {\n itemType: 'setup-section',\n items: [boutique, branch, region],\n onDrop: (dragged, dropped) => {\n console.log('foo');\n console.log({dragged, dropped});\n }\n }\n};\n"],"file":"dashboard-sections.js"}
@@ -0,0 +1,13 @@
1
+ import test from 'ava';
2
+ import forEach from 'lodash/forEach';
3
+ import renderComponentMacro from '../../../test/helpers/render-component';
4
+ import MoleculeDraggableList from '..';
5
+ import fixtureDashboardSections from './fixtures/dashboard-sections';
6
+ test('Molecule › MoleculeDraggableList > should have valid propTypes', t => {
7
+ t.pass();
8
+ forEach(MoleculeDraggableList.propTypes, (value, key) => {
9
+ t.not(value, undefined, `PropType for "Molecule.MoleculeDraggableList.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
10
+ });
11
+ });
12
+ test('Molecule › MoleculeDraggableList › DashboardSections › should be rendered', renderComponentMacro, MoleculeDraggableList, fixtureDashboardSections);
13
+ //# sourceMappingURL=fixtures.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/molecule/draggable-list/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","MoleculeDraggableList","fixtureDashboardSections","t","pass","propTypes","value","key","not","undefined"],"mappings":"AAAA,OAAOA,IAAP,MAAiB,KAAjB;AACA,OAAOC,OAAP,MAAoB,gBAApB;AACA,OAAOC,oBAAP,MAAiC,wCAAjC;AACA,OAAOC,qBAAP,MAAkC,IAAlC;AACA,OAAOC,wBAAP,MAAqC,+BAArC;AAEAJ,IAAI,CAAC,gEAAD,EAAmEK,CAAC,IAAI;AAC1EA,EAAAA,CAAC,CAACC,IAAF;AACAL,EAAAA,OAAO,CAACE,qBAAqB,CAACI,SAAvB,EAAkC,CAACC,KAAD,EAAQC,GAAR,KAAgB;AACvDJ,IAAAA,CAAC,CAACK,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,0DAAyDF,GAAI,mEAAtF;AACD,GAFM,CAAP;AAGD,CALG,CAAJ;AAOAT,IAAI,CAAC,2EAAD,EAA8EE,oBAA9E,EAAoGC,qBAApG,EAA2HC,wBAA3H,CAAJ","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport MoleculeDraggableList from '..';\nimport fixtureDashboardSections from './fixtures/dashboard-sections';\n\ntest('Molecule › MoleculeDraggableList > should have valid propTypes', t => {\n t.pass();\n forEach(MoleculeDraggableList.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Molecule.MoleculeDraggableList.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Molecule › MoleculeDraggableList › DashboardSections › should be rendered', renderComponentMacro, MoleculeDraggableList, fixtureDashboardSections);\n"],"file":"fixtures.js"}