@coorpacademy/components 10.5.4 → 10.5.7-alpha.11

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 (197) hide show
  1. package/es/atom/range/handle.css +18 -2
  2. package/es/atom/range/handle.js +7 -3
  3. package/es/atom/range/handle.js.map +1 -1
  4. package/es/atom/range/style.css +2 -2
  5. package/es/atom/select/index.js +38 -20
  6. package/es/atom/select/index.js.map +1 -1
  7. package/es/atom/select/style.css +129 -40
  8. package/es/atom/select/test/fixtures/player.js +11 -0
  9. package/es/atom/select/test/fixtures/player.js.map +1 -0
  10. package/es/atom/select/test/fixtures.js +2 -0
  11. package/es/atom/select/test/fixtures.js.map +1 -1
  12. package/es/atom/select/test/select.js +49 -0
  13. package/es/atom/select/test/select.js.map +1 -0
  14. package/es/molecule/course-section/index.js +5 -3
  15. package/es/molecule/course-section/index.js.map +1 -1
  16. package/es/molecule/course-section/style.css +2 -1
  17. package/es/molecule/course-section/test/fixtures/chapter.js +2 -1
  18. package/es/molecule/course-section/test/fixtures/chapter.js.map +1 -1
  19. package/es/molecule/course-section/test/fixtures/course.js +2 -1
  20. package/es/molecule/course-section/test/fixtures/course.js.map +1 -1
  21. package/es/molecule/course-sections/index.js +40 -0
  22. package/es/molecule/course-sections/index.js.map +1 -0
  23. package/es/molecule/course-sections/style.css +3 -0
  24. package/es/molecule/course-sections/test/fixtures/default.js +149 -0
  25. package/es/molecule/course-sections/test/fixtures/default.js.map +1 -0
  26. package/es/molecule/course-sections/test/fixtures/loading.js +9 -0
  27. package/es/molecule/course-sections/test/fixtures/loading.js.map +1 -0
  28. package/es/molecule/course-sections/test/fixtures.js +15 -0
  29. package/es/molecule/course-sections/test/fixtures.js.map +1 -0
  30. package/es/molecule/draggable/index.js +1 -1
  31. package/es/molecule/draggable/index.js.map +1 -1
  32. package/es/molecule/draggable/style.css +1 -5
  33. package/es/molecule/draggable-list/index.js +56 -0
  34. package/es/molecule/draggable-list/index.js.map +1 -0
  35. package/es/molecule/draggable-list/test/fixtures/course-sections.js +20 -0
  36. package/es/molecule/draggable-list/test/fixtures/course-sections.js.map +1 -0
  37. package/es/molecule/draggable-list/test/fixtures/dashboard-sections.js +26 -0
  38. package/es/molecule/draggable-list/test/fixtures/dashboard-sections.js.map +1 -0
  39. package/es/molecule/draggable-list/test/fixtures.js +2 -0
  40. package/es/molecule/draggable-list/test/fixtures.js.map +1 -1
  41. package/es/molecule/{setup-sections → draggable-list}/test/on-drop.js +17 -17
  42. package/es/molecule/draggable-list/test/on-drop.js.map +1 -0
  43. package/es/molecule/questions/drop-down/index.js +1 -6
  44. package/es/molecule/questions/drop-down/index.js.map +1 -1
  45. package/es/molecule/questions/free-text/index.js +35 -15
  46. package/es/molecule/questions/free-text/index.js.map +1 -1
  47. package/es/molecule/questions/free-text/style.css +35 -15
  48. package/es/molecule/questions/free-text/test/fixtures/default.js +1 -1
  49. package/es/molecule/questions/free-text/test/fixtures/default.js.map +1 -1
  50. package/es/molecule/questions/free-text/test/fixtures/with-value-on-change.js +9 -0
  51. package/es/molecule/questions/free-text/test/fixtures/with-value-on-change.js.map +1 -0
  52. package/es/molecule/questions/free-text/test/fixtures/{with-default-value.js → with-value.js} +2 -2
  53. package/es/molecule/questions/free-text/test/fixtures/with-value.js.map +1 -0
  54. package/es/molecule/questions/free-text/test/fixtures.js +4 -2
  55. package/es/molecule/questions/free-text/test/fixtures.js.map +1 -1
  56. package/es/molecule/questions/free-text/test/free-text.js +106 -0
  57. package/es/molecule/questions/free-text/test/free-text.js.map +1 -0
  58. package/es/molecule/questions/qcm/index.js +37 -25
  59. package/es/molecule/questions/qcm/index.js.map +1 -1
  60. package/es/molecule/questions/qcm/style.css +48 -14
  61. package/es/molecule/questions/qcm/test/fixtures/default.js +8 -0
  62. package/es/molecule/questions/qcm/test/fixtures/default.js.map +1 -1
  63. package/es/molecule/questions/qcm/test/qcm.js +103 -0
  64. package/es/molecule/questions/qcm/test/qcm.js.map +1 -0
  65. package/es/molecule/questions/qcm-graphic/index.js +35 -17
  66. package/es/molecule/questions/qcm-graphic/index.js.map +1 -1
  67. package/es/molecule/questions/qcm-graphic/style.css +64 -13
  68. package/es/molecule/questions/qcm-graphic/test/qcm-graphic.js +65 -0
  69. package/es/molecule/questions/qcm-graphic/test/qcm-graphic.js.map +1 -0
  70. package/es/molecule/questions/question-range/style.css +9 -8
  71. package/es/molecule/questions/template/index.js +13 -10
  72. package/es/molecule/questions/template/index.js.map +1 -1
  73. package/es/molecule/setup-section/style.css +1 -0
  74. package/es/molecule/setup-sections/index.js +7 -33
  75. package/es/molecule/setup-sections/index.js.map +1 -1
  76. package/es/molecule/wizard-summary/test/fixtures/organize-courses.js +106 -0
  77. package/es/molecule/wizard-summary/test/fixtures/organize-courses.js.map +1 -0
  78. package/es/molecule/wizard-summary/test/fixtures.js +2 -0
  79. package/es/molecule/wizard-summary/test/fixtures.js.map +1 -1
  80. package/es/organism/wizard-contents/index.js +6 -0
  81. package/es/organism/wizard-contents/index.js.map +1 -1
  82. package/es/organism/wizard-contents/test/fixtures/playlist-organize-courses.js +45 -0
  83. package/es/organism/wizard-contents/test/fixtures/playlist-organize-courses.js.map +1 -0
  84. package/es/organism/wizard-contents/test/fixtures.js +2 -0
  85. package/es/organism/wizard-contents/test/fixtures.js.map +1 -1
  86. package/es/template/back-office/brand-update/test/fixtures/wizard-organize-courses-playlist.js +22 -0
  87. package/es/template/back-office/brand-update/test/fixtures/wizard-organize-courses-playlist.js.map +1 -0
  88. package/es/template/back-office/brand-update/test/fixtures.js +2 -0
  89. package/es/template/back-office/brand-update/test/fixtures.js.map +1 -1
  90. package/es/util/get-shadow-box-color-from-primary.js +4 -0
  91. package/es/util/get-shadow-box-color-from-primary.js.map +1 -0
  92. package/es/util/test/get-shadow-box-color-from-primary.js +33 -0
  93. package/es/util/test/get-shadow-box-color-from-primary.js.map +1 -0
  94. package/es/variables/colors.css +3 -0
  95. package/lib/atom/range/handle.css +18 -2
  96. package/lib/atom/range/handle.js +8 -3
  97. package/lib/atom/range/handle.js.map +1 -1
  98. package/lib/atom/range/style.css +2 -2
  99. package/lib/atom/select/index.js +40 -17
  100. package/lib/atom/select/index.js.map +1 -1
  101. package/lib/atom/select/style.css +129 -40
  102. package/lib/atom/select/test/fixtures/player.js +21 -0
  103. package/lib/atom/select/test/fixtures/player.js.map +1 -0
  104. package/lib/atom/select/test/fixtures.js +3 -0
  105. package/lib/atom/select/test/fixtures.js.map +1 -1
  106. package/lib/atom/select/test/select.js +62 -0
  107. package/lib/atom/select/test/select.js.map +1 -0
  108. package/lib/molecule/course-section/index.js +5 -3
  109. package/lib/molecule/course-section/index.js.map +1 -1
  110. package/lib/molecule/course-section/style.css +2 -1
  111. package/lib/molecule/course-section/test/fixtures/chapter.js +2 -1
  112. package/lib/molecule/course-section/test/fixtures/chapter.js.map +1 -1
  113. package/lib/molecule/course-section/test/fixtures/course.js +2 -1
  114. package/lib/molecule/course-section/test/fixtures/course.js.map +1 -1
  115. package/lib/molecule/course-sections/index.js +54 -0
  116. package/lib/molecule/course-sections/index.js.map +1 -0
  117. package/lib/molecule/course-sections/style.css +3 -0
  118. package/lib/molecule/course-sections/test/fixtures/default.js +154 -0
  119. package/lib/molecule/course-sections/test/fixtures/default.js.map +1 -0
  120. package/lib/molecule/course-sections/test/fixtures/loading.js +14 -0
  121. package/lib/molecule/course-sections/test/fixtures/loading.js.map +1 -0
  122. package/lib/molecule/course-sections/test/fixtures.js +25 -0
  123. package/lib/molecule/course-sections/test/fixtures.js.map +1 -0
  124. package/lib/molecule/draggable/index.js +1 -1
  125. package/lib/molecule/draggable/index.js.map +1 -1
  126. package/lib/molecule/draggable/style.css +1 -5
  127. package/lib/molecule/draggable-list/index.js +73 -0
  128. package/lib/molecule/draggable-list/index.js.map +1 -0
  129. package/lib/molecule/draggable-list/test/fixtures/course-sections.js +29 -0
  130. package/lib/molecule/draggable-list/test/fixtures/course-sections.js.map +1 -0
  131. package/lib/molecule/draggable-list/test/fixtures/dashboard-sections.js +37 -0
  132. package/lib/molecule/draggable-list/test/fixtures/dashboard-sections.js.map +1 -0
  133. package/lib/molecule/draggable-list/test/fixtures.js +3 -0
  134. package/lib/molecule/draggable-list/test/fixtures.js.map +1 -1
  135. package/lib/molecule/{setup-sections → draggable-list}/test/on-drop.js +19 -19
  136. package/lib/molecule/draggable-list/test/on-drop.js.map +1 -0
  137. package/lib/molecule/questions/drop-down/index.js +1 -5
  138. package/lib/molecule/questions/drop-down/index.js.map +1 -1
  139. package/lib/molecule/questions/free-text/index.js +32 -14
  140. package/lib/molecule/questions/free-text/index.js.map +1 -1
  141. package/lib/molecule/questions/free-text/style.css +35 -15
  142. package/lib/molecule/questions/free-text/test/fixtures/default.js +1 -1
  143. package/lib/molecule/questions/free-text/test/fixtures/default.js.map +1 -1
  144. package/lib/molecule/questions/free-text/test/fixtures/with-value-on-change.js +14 -0
  145. package/lib/molecule/questions/free-text/test/fixtures/with-value-on-change.js.map +1 -0
  146. package/lib/molecule/questions/free-text/test/fixtures/{with-default-value.js → with-value.js} +2 -2
  147. package/lib/molecule/questions/free-text/test/fixtures/with-value.js.map +1 -0
  148. package/lib/molecule/questions/free-text/test/fixtures.js +5 -2
  149. package/lib/molecule/questions/free-text/test/fixtures.js.map +1 -1
  150. package/lib/molecule/questions/free-text/test/free-text.js +119 -0
  151. package/lib/molecule/questions/free-text/test/free-text.js.map +1 -0
  152. package/lib/molecule/questions/qcm/index.js +44 -23
  153. package/lib/molecule/questions/qcm/index.js.map +1 -1
  154. package/lib/molecule/questions/qcm/style.css +48 -14
  155. package/lib/molecule/questions/qcm/test/fixtures/default.js +8 -0
  156. package/lib/molecule/questions/qcm/test/fixtures/default.js.map +1 -1
  157. package/lib/molecule/questions/qcm/test/qcm.js +115 -0
  158. package/lib/molecule/questions/qcm/test/qcm.js.map +1 -0
  159. package/lib/molecule/questions/qcm-graphic/index.js +33 -15
  160. package/lib/molecule/questions/qcm-graphic/index.js.map +1 -1
  161. package/lib/molecule/questions/qcm-graphic/style.css +64 -13
  162. package/lib/molecule/questions/qcm-graphic/test/qcm-graphic.js +76 -0
  163. package/lib/molecule/questions/qcm-graphic/test/qcm-graphic.js.map +1 -0
  164. package/lib/molecule/questions/question-range/style.css +9 -8
  165. package/lib/molecule/questions/template/index.js +13 -10
  166. package/lib/molecule/questions/template/index.js.map +1 -1
  167. package/lib/molecule/setup-section/style.css +1 -0
  168. package/lib/molecule/setup-sections/index.js +7 -37
  169. package/lib/molecule/setup-sections/index.js.map +1 -1
  170. package/lib/molecule/wizard-summary/test/fixtures/organize-courses.js +111 -0
  171. package/lib/molecule/wizard-summary/test/fixtures/organize-courses.js.map +1 -0
  172. package/lib/molecule/wizard-summary/test/fixtures.js +3 -0
  173. package/lib/molecule/wizard-summary/test/fixtures.js.map +1 -1
  174. package/lib/organism/wizard-contents/index.js +7 -0
  175. package/lib/organism/wizard-contents/index.js.map +1 -1
  176. package/lib/organism/wizard-contents/test/fixtures/playlist-organize-courses.js +54 -0
  177. package/lib/organism/wizard-contents/test/fixtures/playlist-organize-courses.js.map +1 -0
  178. package/lib/organism/wizard-contents/test/fixtures.js +3 -0
  179. package/lib/organism/wizard-contents/test/fixtures.js.map +1 -1
  180. package/lib/template/back-office/brand-update/test/fixtures/wizard-organize-courses-playlist.js +32 -0
  181. package/lib/template/back-office/brand-update/test/fixtures/wizard-organize-courses-playlist.js.map +1 -0
  182. package/lib/template/back-office/brand-update/test/fixtures.js +3 -0
  183. package/lib/template/back-office/brand-update/test/fixtures.js.map +1 -1
  184. package/lib/util/get-shadow-box-color-from-primary.js +12 -0
  185. package/lib/util/get-shadow-box-color-from-primary.js.map +1 -0
  186. package/lib/util/test/get-shadow-box-color-from-primary.js +40 -0
  187. package/lib/util/test/get-shadow-box-color-from-primary.js.map +1 -0
  188. package/lib/variables/colors.css +3 -0
  189. package/package.json +2 -2
  190. package/es/molecule/questions/free-text/test/fixtures/with-default-value.js.map +0 -1
  191. package/es/molecule/search/test/fixtures.js +0 -15
  192. package/es/molecule/search/test/fixtures.js.map +0 -1
  193. package/es/molecule/setup-sections/test/on-drop.js.map +0 -1
  194. package/lib/molecule/questions/free-text/test/fixtures/with-default-value.js.map +0 -1
  195. package/lib/molecule/search/test/fixtures.js +0 -25
  196. package/lib/molecule/search/test/fixtures.js.map +0 -1
  197. package/lib/molecule/setup-sections/test/on-drop.js.map +0 -1
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.default = void 0;
5
+
6
+ var _react = _interopRequireDefault(require("react"));
7
+
8
+ var _propTypes = _interopRequireDefault(require("prop-types"));
9
+
10
+ var _courseSection = _interopRequireDefault(require("../course-section"));
11
+
12
+ var _draggableList = _interopRequireDefault(require("../draggable-list"));
13
+
14
+ var _loader = _interopRequireDefault(require("../../atom/loader"));
15
+
16
+ var _title = _interopRequireDefault(require("../../atom/title"));
17
+
18
+ var _style = _interopRequireDefault(require("./style.css"));
19
+
20
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
+
22
+ const Loading = () => /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_loader.default, {
23
+ theme: "coorpmanager"
24
+ }));
25
+
26
+ const CourseSections = ({
27
+ sections,
28
+ onDrop,
29
+ isLoading,
30
+ title
31
+ }) => {
32
+ if (isLoading) return /*#__PURE__*/_react.default.createElement(Loading, null);
33
+ return /*#__PURE__*/_react.default.createElement("div", null, title ? /*#__PURE__*/_react.default.createElement("div", {
34
+ className: _style.default.title
35
+ }, /*#__PURE__*/_react.default.createElement(_title.default, {
36
+ title: title,
37
+ type: 'form-group',
38
+ "data-name": 'course-sections-title'
39
+ })) : null, /*#__PURE__*/_react.default.createElement(_draggableList.default, {
40
+ itemType: "course-section",
41
+ items: sections,
42
+ onDrop: onDrop
43
+ }));
44
+ };
45
+
46
+ CourseSections.propTypes = process.env.NODE_ENV !== "production" ? {
47
+ title: _propTypes.default.string,
48
+ sections: _propTypes.default.arrayOf(_propTypes.default.shape(_courseSection.default.propTypes)),
49
+ onDrop: _propTypes.default.func,
50
+ isLoading: _propTypes.default.bool
51
+ } : {};
52
+ var _default = CourseSections;
53
+ exports.default = _default;
54
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/molecule/course-sections/index.js"],"names":["Loading","CourseSections","sections","onDrop","isLoading","title","style","propTypes","PropTypes","string","arrayOf","shape","CourseSection","func","bool"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,MAAMA,OAAO,GAAG,mBACd,uDACE,6BAAC,eAAD;AAAQ,EAAA,KAAK,EAAC;AAAd,EADF,CADF;;AAMA,MAAMC,cAAc,GAAG,CAAC;AAACC,EAAAA,QAAD;AAAWC,EAAAA,MAAX;AAAmBC,EAAAA,SAAnB;AAA8BC,EAAAA;AAA9B,CAAD,KAA0C;AAC/D,MAAID,SAAJ,EAAe,oBAAO,6BAAC,OAAD,OAAP;AAEf,sBACE,0CACGC,KAAK,gBACJ;AAAK,IAAA,SAAS,EAAEC,eAAMD;AAAtB,kBACE,6BAAC,cAAD;AAAO,IAAA,KAAK,EAAEA,KAAd;AAAqB,IAAA,IAAI,EAAE,YAA3B;AAAyC,iBAAW;AAApD,IADF,CADI,GAIF,IALN,eAME,6BAAC,sBAAD;AAAe,IAAA,QAAQ,EAAC,gBAAxB;AAAyC,IAAA,KAAK,EAAEH,QAAhD;AAA0D,IAAA,MAAM,EAAEC;AAAlE,IANF,CADF;AAUD,CAbD;;AAeAF,cAAc,CAACM,SAAf,2CAA2B;AACzBF,EAAAA,KAAK,EAAEG,mBAAUC,MADQ;AAEzBP,EAAAA,QAAQ,EAAEM,mBAAUE,OAAV,CAAkBF,mBAAUG,KAAV,CAAgBC,uBAAcL,SAA9B,CAAlB,CAFe;AAGzBJ,EAAAA,MAAM,EAAEK,mBAAUK,IAHO;AAIzBT,EAAAA,SAAS,EAAEI,mBAAUM;AAJI,CAA3B;eAOeb,c","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport CourseSection from '../course-section';\nimport DraggableList from '../draggable-list';\nimport Loader from '../../atom/loader';\nimport Title from '../../atom/title';\nimport style from './style.css';\n\nconst Loading = () => (\n <div>\n <Loader theme=\"coorpmanager\" />\n </div>\n);\n\nconst CourseSections = ({sections, onDrop, isLoading, title}) => {\n if (isLoading) return <Loading />;\n\n return (\n <div>\n {title ? (\n <div className={style.title}>\n <Title title={title} type={'form-group'} data-name={'course-sections-title'} />\n </div>\n ) : null}\n <DraggableList itemType=\"course-section\" items={sections} onDrop={onDrop} />\n </div>\n );\n};\n\nCourseSections.propTypes = {\n title: PropTypes.string,\n sections: PropTypes.arrayOf(PropTypes.shape(CourseSection.propTypes)),\n onDrop: PropTypes.func,\n isLoading: PropTypes.bool\n};\n\nexport default CourseSections;\n"],"file":"index.js"}
@@ -0,0 +1,3 @@
1
+ .title {
2
+ margin-bottom: 16px;
3
+ }
@@ -0,0 +1,154 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.default = void 0;
5
+ var _default = {
6
+ props: {
7
+ sections: [{
8
+ 'aria-label': {
9
+ title: 'aria label title',
10
+ author: 'aria label author'
11
+ },
12
+ title: 'Marketing and online advertising Marketing and online advertising Marketing and online advertising Marketing and online advertising',
13
+ author: 'Author',
14
+ 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',
15
+ contentBadge: {
16
+ label: 'course',
17
+ category: 'course'
18
+ },
19
+ position: 1,
20
+ id: 'disc_1'
21
+ }, {
22
+ 'aria-label': {
23
+ title: 'aria label title',
24
+ author: 'aria label author'
25
+ },
26
+ title: 'Social networks',
27
+ author: 'Author',
28
+ 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',
29
+ contentBadge: {
30
+ label: "5' learning",
31
+ category: 'chapter'
32
+ },
33
+ position: 2,
34
+ id: 'chap_1'
35
+ }, {
36
+ 'aria-label': {
37
+ title: 'aria label title',
38
+ author: 'aria label author'
39
+ },
40
+ title: 'Other title',
41
+ author: 'Author 2',
42
+ 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',
43
+ contentBadge: {
44
+ label: 'course',
45
+ category: 'course'
46
+ },
47
+ position: 3,
48
+ id: 'disc_2'
49
+ }, {
50
+ 'aria-label': {
51
+ title: 'aria label title',
52
+ author: 'aria label author'
53
+ },
54
+ title: 'Social others',
55
+ author: 'Author XXX',
56
+ 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',
57
+ contentBadge: {
58
+ label: "5' learning",
59
+ category: 'chapter'
60
+ },
61
+ position: 4,
62
+ id: 'chap_2'
63
+ }, {
64
+ 'aria-label': {
65
+ title: 'aria label title',
66
+ author: 'aria label author'
67
+ },
68
+ title: 'Social others others',
69
+ author: 'Author XXX',
70
+ 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',
71
+ contentBadge: {
72
+ label: "5' learning",
73
+ category: 'chapter'
74
+ },
75
+ position: 5,
76
+ id: 'chap_3'
77
+ }, {
78
+ 'aria-label': {
79
+ title: 'aria label title',
80
+ author: 'aria label author'
81
+ },
82
+ title: 'Something about empowerment',
83
+ author: 'Author XXX',
84
+ 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',
85
+ contentBadge: {
86
+ label: 'course',
87
+ category: 'course'
88
+ },
89
+ position: 6,
90
+ id: 'disc_3'
91
+ }, {
92
+ 'aria-label': {
93
+ title: 'aria label title',
94
+ author: 'aria label author'
95
+ },
96
+ title: 'Be a better human being',
97
+ author: 'Author XXX',
98
+ 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',
99
+ contentBadge: {
100
+ label: "5' learning",
101
+ category: 'chapter'
102
+ },
103
+ position: 7,
104
+ id: 'chap_4'
105
+ }, {
106
+ 'aria-label': {
107
+ title: 'aria label title',
108
+ author: 'aria label author'
109
+ },
110
+ title: 'Stronger faster better',
111
+ author: 'Author XXX',
112
+ 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',
113
+ contentBadge: {
114
+ label: 'course',
115
+ category: 'course'
116
+ },
117
+ position: 8,
118
+ id: 'disc_4'
119
+ }, {
120
+ 'aria-label': {
121
+ title: 'aria label title',
122
+ author: 'aria label author'
123
+ },
124
+ title: 'Relativity beyond time',
125
+ author: 'Author XXX',
126
+ 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',
127
+ contentBadge: {
128
+ label: 'course',
129
+ category: 'course'
130
+ },
131
+ position: 9,
132
+ id: 'disc_5'
133
+ }, {
134
+ 'aria-label': {
135
+ title: 'aria label title',
136
+ author: 'aria label author'
137
+ },
138
+ title: 'Are you awake?',
139
+ author: 'Author XXX',
140
+ 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',
141
+ contentBadge: {
142
+ label: "5' learning",
143
+ category: 'chapter'
144
+ },
145
+ position: 10,
146
+ id: 'chap_5'
147
+ }],
148
+ isLoading: false,
149
+ onDrop: () => console.log('on drop'),
150
+ title: 'Organize courses'
151
+ }
152
+ };
153
+ exports.default = _default;
154
+ //# 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":";;;;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,YA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;AASEC,MAAAA,YAAY,EAAE;AACZC,QAAAA,KAAK,EAAE,aADK;AAEZC,QAAAA,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,C","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,14 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.default = void 0;
5
+ var _default = {
6
+ props: {
7
+ sections: [],
8
+ isLoading: true,
9
+ onDrop: () => console.log('on drop'),
10
+ title: ''
11
+ }
12
+ };
13
+ exports.default = _default;
14
+ //# 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":";;;;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,C","sourcesContent":["export default {\n props: {\n sections: [],\n isLoading: true,\n onDrop: () => console.log('on drop'),\n title: ''\n }\n};\n"],"file":"loading.js"}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+
3
+ var _ava = _interopRequireDefault(require("ava"));
4
+
5
+ var _forEach = _interopRequireDefault(require("lodash/forEach"));
6
+
7
+ var _renderComponent = _interopRequireDefault(require("../../../test/helpers/render-component"));
8
+
9
+ var _ = _interopRequireDefault(require(".."));
10
+
11
+ var _default = _interopRequireDefault(require("./fixtures/default"));
12
+
13
+ var _loading = _interopRequireDefault(require("./fixtures/loading"));
14
+
15
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16
+
17
+ (0, _ava.default)('Molecule › MoleculeCourseSections > should have valid propTypes', t => {
18
+ t.pass();
19
+ (0, _forEach.default)(_.default.propTypes, (value, key) => {
20
+ t.not(value, undefined, `PropType for "Molecule.MoleculeCourseSections.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
21
+ });
22
+ });
23
+ (0, _ava.default)('Molecule › MoleculeCourseSections › Default › should be rendered', _renderComponent.default, _.default, _default.default);
24
+ (0, _ava.default)('Molecule › MoleculeCourseSections › Loading › should be rendered', _renderComponent.default, _.default, _loading.default);
25
+ //# sourceMappingURL=fixtures.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/molecule/course-sections/test/fixtures.js"],"names":["t","pass","MoleculeCourseSections","propTypes","value","key","not","undefined","renderComponentMacro","fixtureDefault","fixtureLoading"],"mappings":";;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,kBAAK,iEAAL,EAAwEA,CAAC,IAAI;AAC3EA,EAAAA,CAAC,CAACC,IAAF;AACA,wBAAQC,UAAuBC,SAA/B,EAA0C,CAACC,KAAD,EAAQC,GAAR,KAAgB;AACxDL,IAAAA,CAAC,CAACM,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,2DAA0DF,GAAI,mEAAvF;AACD,GAFD;AAGD,CALD;AAOA,kBAAK,kEAAL,EAAyEG,wBAAzE,EAA+FN,SAA/F,EAAuHO,gBAAvH;AACA,kBAAK,kEAAL,EAAyED,wBAAzE,EAA+FN,SAA/F,EAAuHQ,gBAAvH","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport MoleculeCourseSections from '..';\nimport fixtureDefault from './fixtures/default';\nimport fixtureLoading from './fixtures/loading';\n\ntest('Molecule › MoleculeCourseSections > should have valid propTypes', t => {\n t.pass();\n forEach(MoleculeCourseSections.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Molecule.MoleculeCourseSections.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Molecule › MoleculeCourseSections › Default › should be rendered', renderComponentMacro, MoleculeCourseSections, fixtureDefault);\ntest('Molecule › MoleculeCourseSections › Loading › should be rendered', renderComponentMacro, MoleculeCourseSections, fixtureLoading);\n"],"file":"fixtures.js"}
@@ -48,7 +48,7 @@ const Draggable = props => {
48
48
  onDrop(id);
49
49
  }, [id, onDrop]);
50
50
  return /*#__PURE__*/_react.default.createElement("div", {
51
- className: (0, _classnames.default)(dragging ? _style.default.dragging : null, _style.default.section, _style.default.draggable),
51
+ className: (0, _classnames.default)(dragging ? _style.default.dragging : null, _style.default.draggable),
52
52
  onDragStart: dragStartHandler,
53
53
  onDragOver: dragOverHandler,
54
54
  onDragLeave: dragLeaveHandler,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/molecule/draggable/index.js"],"names":["preventDefault","e","stopPropagation","Draggable","props","id","dragging","onDragStart","onDragOver","onDragLeave","onDrop","children","dragStartHandler","dragOverHandler","dragLeaveHandler","dropHandler","style","section","draggable","propTypes","PropTypes","string","bool","func","element"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;;;;;;;AAEA,MAAMA,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,IA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AEpBf,EAAAA,QAAQ,EAAEc,mBAAUE,IAFA;AAGpBf,EAAAA,WAAW,EAAEa,mBAAUG,IAHH;AAIpBf,EAAAA,UAAU,EAAEY,mBAAUG,IAJF;AAKpBd,EAAAA,WAAW,EAAEW,mBAAUG,IALH;AAMpBb,EAAAA,MAAM,EAAEU,mBAAUG,IANE;AAOpBZ,EAAAA,QAAQ,EAAES,mBAAUI;AAPA,CAAtB;eAUerB,S","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":["preventDefault","e","stopPropagation","Draggable","props","id","dragging","onDragStart","onDragOver","onDragLeave","onDrop","children","dragStartHandler","dragOverHandler","dragLeaveHandler","dropHandler","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GAAoB,IAAvC,EAA6CU,eAAMC,SAAnD,CADb;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,EAAEc,mBAAUC,MADM;AAEpBd,EAAAA,QAAQ,EAAEa,mBAAUE,IAFA;AAGpBd,EAAAA,WAAW,EAAEY,mBAAUG,IAHH;AAIpBd,EAAAA,UAAU,EAAEW,mBAAUG,IAJF;AAKpBb,EAAAA,WAAW,EAAEU,mBAAUG,IALH;AAMpBZ,EAAAA,MAAM,EAAES,mBAAUG,IANE;AAOpBX,EAAAA,QAAQ,EAAEQ,mBAAUI;AAPA,CAAtB;eAUepB,S","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"}
@@ -7,11 +7,6 @@
7
7
  @value cm_grey_100 from colors;
8
8
 
9
9
 
10
- .section {
11
- display: flex;
12
- justify-content: center;
13
- }
14
-
15
10
  .draggable {
16
11
  cursor: grab;
17
12
  position: relative;
@@ -58,6 +53,7 @@
58
53
  font-family: 'Open Sans';
59
54
  font-weight: 600;
60
55
  font-size: 14px;
56
+ border-radius: 7px;
61
57
  }
62
58
 
63
59
  @media mobile {
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.default = void 0;
5
+
6
+ var _react = _interopRequireWildcard(require("react"));
7
+
8
+ var _propTypes = _interopRequireDefault(require("prop-types"));
9
+
10
+ var _draggable = _interopRequireDefault(require("../draggable"));
11
+
12
+ var _setupSection = _interopRequireDefault(require("../setup-section"));
13
+
14
+ var _courseSection = _interopRequireDefault(require("../course-section"));
15
+
16
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
+
18
+ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
19
+
20
+ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
21
+
22
+ 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); }
23
+
24
+ const ITEMS = {
25
+ 'setup-section': _setupSection.default,
26
+ 'course-section': _courseSection.default
27
+ };
28
+
29
+ const DraggableList = ({
30
+ items,
31
+ onDrop,
32
+ itemType
33
+ }) => {
34
+ const [dragTo, setDragTo] = (0, _react.useState)(null);
35
+ const [dragFrom, setDragFrom] = (0, _react.useState)(null);
36
+ const dragStartHandler = (0, _react.useCallback)(id => {
37
+ setDragFrom(id);
38
+ }, [setDragFrom]);
39
+ const dragOverHandler = (0, _react.useCallback)(id => {
40
+ if (dragTo === id) return;
41
+ setDragTo(id);
42
+ }, [dragTo, setDragTo]);
43
+ const dragLeaveHandler = (0, _react.useCallback)(id => {
44
+ setDragTo(null);
45
+ }, [setDragTo]);
46
+ const dropHandler = (0, _react.useCallback)(id => {
47
+ if (onDrop && dragFrom) onDrop(dragFrom, id);
48
+ setDragTo(null);
49
+ setDragFrom(null);
50
+ }, [onDrop, setDragTo, setDragFrom, dragFrom]);
51
+ const Item = ITEMS[itemType];
52
+ const itemsView = items.map(item => /*#__PURE__*/_react.default.createElement(_draggable.default, {
53
+ key: item.id,
54
+ id: item.id,
55
+ dragging: dragTo === item.id,
56
+ onDragStart: dragStartHandler,
57
+ onDragOver: dragOverHandler,
58
+ onDragLeave: dragLeaveHandler,
59
+ onDrop: dropHandler
60
+ }, /*#__PURE__*/_react.default.createElement(Item, _extends({}, item, {
61
+ key: item.id
62
+ }))));
63
+ return /*#__PURE__*/_react.default.createElement("div", null, itemsView);
64
+ };
65
+
66
+ DraggableList.propTypes = process.env.NODE_ENV !== "production" ? {
67
+ items: _propTypes.default.arrayOf(_propTypes.default.shape(_setupSection.default.propTypes)),
68
+ onDrop: _propTypes.default.func,
69
+ itemType: _propTypes.default.string
70
+ } : {};
71
+ var _default = DraggableList;
72
+ exports.default = _default;
73
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/molecule/draggable-list/index.js"],"names":["ITEMS","SetupSection","CourseSection","DraggableList","items","onDrop","itemType","dragTo","setDragTo","dragFrom","setDragFrom","dragStartHandler","id","dragOverHandler","dragLeaveHandler","dropHandler","Item","itemsView","map","item","propTypes","PropTypes","arrayOf","shape","func","string"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,KAAK,GAAG;AAAC,mBAAiBC,qBAAlB;AAAgC,oBAAkBC;AAAlD,CAAd;;AAEA,MAAMC,aAAa,GAAG,CAAC;AAACC,EAAAA,KAAD;AAAQC,EAAAA,MAAR;AAAgBC,EAAAA;AAAhB,CAAD,KAA+B;AACnD,QAAM,CAACC,MAAD,EAASC,SAAT,IAAsB,qBAAS,IAAT,CAA5B;AACA,QAAM,CAACC,QAAD,EAAWC,WAAX,IAA0B,qBAAS,IAAT,CAAhC;AAEA,QAAMC,gBAAgB,GAAG,wBACvBC,EAAE,IAAI;AACJF,IAAAA,WAAW,CAACE,EAAD,CAAX;AACD,GAHsB,EAIvB,CAACF,WAAD,CAJuB,CAAzB;AAOA,QAAMG,eAAe,GAAG,wBACtBD,EAAE,IAAI;AACJ,QAAIL,MAAM,KAAKK,EAAf,EAAmB;AACnBJ,IAAAA,SAAS,CAACI,EAAD,CAAT;AACD,GAJqB,EAKtB,CAACL,MAAD,EAASC,SAAT,CALsB,CAAxB;AAQA,QAAMM,gBAAgB,GAAG,wBACvBF,EAAE,IAAI;AACJJ,IAAAA,SAAS,CAAC,IAAD,CAAT;AACD,GAHsB,EAIvB,CAACA,SAAD,CAJuB,CAAzB;AAOA,QAAMO,WAAW,GAAG,wBAClBH,EAAE,IAAI;AACJ,QAAIP,MAAM,IAAII,QAAd,EAAwBJ,MAAM,CAACI,QAAD,EAAWG,EAAX,CAAN;AAExBJ,IAAAA,SAAS,CAAC,IAAD,CAAT;AACAE,IAAAA,WAAW,CAAC,IAAD,CAAX;AACD,GANiB,EAOlB,CAACL,MAAD,EAASG,SAAT,EAAoBE,WAApB,EAAiCD,QAAjC,CAPkB,CAApB;AAUA,QAAMO,IAAI,GAAGhB,KAAK,CAACM,QAAD,CAAlB;AACA,QAAMW,SAAS,GAAGb,KAAK,CAACc,GAAN,CAAUC,IAAI,iBAC9B,6BAAC,kBAAD;AACE,IAAA,GAAG,EAAEA,IAAI,CAACP,EADZ;AAEE,IAAA,EAAE,EAAEO,IAAI,CAACP,EAFX;AAGE,IAAA,QAAQ,EAAEL,MAAM,KAAKY,IAAI,CAACP,EAH5B;AAIE,IAAA,WAAW,EAAED,gBAJf;AAKE,IAAA,UAAU,EAAEE,eALd;AAME,IAAA,WAAW,EAAEC,gBANf;AAOE,IAAA,MAAM,EAAEC;AAPV,kBASE,6BAAC,IAAD,eAAUI,IAAV;AAAgB,IAAA,GAAG,EAAEA,IAAI,CAACP;AAA1B,KATF,CADgB,CAAlB;AAaA,sBAAO,0CAAMK,SAAN,CAAP;AACD,CAnDD;;AAqDAd,aAAa,CAACiB,SAAd,2CAA0B;AACxBhB,EAAAA,KAAK,EAAEiB,mBAAUC,OAAV,CAAkBD,mBAAUE,KAAV,CAAgBtB,sBAAamB,SAA7B,CAAlB,CADiB;AAExBf,EAAAA,MAAM,EAAEgB,mBAAUG,IAFM;AAGxBlB,EAAAA,QAAQ,EAAEe,mBAAUI;AAHI,CAA1B;eAMetB,a","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,29 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.default = void 0;
5
+
6
+ var _default2 = _interopRequireDefault(require("../../../course-sections/test/fixtures/default"));
7
+
8
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9
+
10
+ const {
11
+ props: {
12
+ sections
13
+ }
14
+ } = _default2.default;
15
+ var _default = {
16
+ props: {
17
+ itemType: 'course-section',
18
+ items: sections,
19
+ onDrop: (dragged, dropped) => {
20
+ console.log('foo');
21
+ console.log({
22
+ dragged,
23
+ dropped
24
+ });
25
+ }
26
+ }
27
+ };
28
+ exports.default = _default;
29
+ //# sourceMappingURL=course-sections.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/molecule/draggable-list/test/fixtures/course-sections.js"],"names":["props","sections","courseSections","itemType","items","onDrop","dragged","dropped","console","log"],"mappings":";;;;;AAAA;;;;AAEA,MAAM;AACJA,EAAAA,KAAK,EAAE;AAACC,IAAAA;AAAD;AADH,IAEFC,iBAFJ;eAIe;AACbF,EAAAA,KAAK,EAAE;AACLG,IAAAA,QAAQ,EAAE,gBADL;AAELC,IAAAA,KAAK,EAAEH,QAFF;AAGLI,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,C","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,37 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.default = void 0;
5
+
6
+ var _analyticsBoutique = _interopRequireDefault(require("../../../setup-section/test/fixtures/analytics-boutique"));
7
+
8
+ var _analyticsBranch = _interopRequireDefault(require("../../../setup-section/test/fixtures/analytics-branch"));
9
+
10
+ var _analyticsRegion = _interopRequireDefault(require("../../../setup-section/test/fixtures/analytics-region"));
11
+
12
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
+
14
+ const {
15
+ props: boutique
16
+ } = _analyticsBoutique.default;
17
+ const {
18
+ props: branch
19
+ } = _analyticsBranch.default;
20
+ const {
21
+ props: region
22
+ } = _analyticsRegion.default;
23
+ var _default = {
24
+ props: {
25
+ itemType: 'setup-section',
26
+ items: [boutique, branch, region],
27
+ onDrop: (dragged, dropped) => {
28
+ console.log('foo');
29
+ console.log({
30
+ dragged,
31
+ dropped
32
+ });
33
+ }
34
+ }
35
+ };
36
+ exports.default = _default;
37
+ //# sourceMappingURL=dashboard-sections.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/molecule/draggable-list/test/fixtures/dashboard-sections.js"],"names":["props","boutique","Boutique","branch","Branch","region","Region","itemType","items","onDrop","dragged","dropped","console","log"],"mappings":";;;;;AAAA;;AACA;;AACA;;;;AAEA,MAAM;AAACA,EAAAA,KAAK,EAAEC;AAAR,IAAoBC,0BAA1B;AACA,MAAM;AAACF,EAAAA,KAAK,EAAEG;AAAR,IAAkBC,wBAAxB;AACA,MAAM;AAACJ,EAAAA,KAAK,EAAEK;AAAR,IAAkBC,wBAAxB;eAEe;AACbN,EAAAA,KAAK,EAAE;AACLO,IAAAA,QAAQ,EAAE,eADL;AAELC,IAAAA,KAAK,EAAE,CAACP,QAAD,EAAWE,MAAX,EAAmBE,MAAnB,CAFF;AAGLI,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,C","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"}
@@ -8,6 +8,8 @@ var _renderComponent = _interopRequireDefault(require("../../../test/helpers/ren
8
8
 
9
9
  var _ = _interopRequireDefault(require(".."));
10
10
 
11
+ var _courseSections = _interopRequireDefault(require("./fixtures/course-sections"));
12
+
11
13
  var _dashboardSections = _interopRequireDefault(require("./fixtures/dashboard-sections"));
12
14
 
13
15
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -18,5 +20,6 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
18
20
  t.not(value, undefined, `PropType for "Molecule.MoleculeDraggableList.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
19
21
  });
20
22
  });
23
+ (0, _ava.default)('Molecule › MoleculeDraggableList › CourseSections › should be rendered', _renderComponent.default, _.default, _courseSections.default);
21
24
  (0, _ava.default)('Molecule › MoleculeDraggableList › DashboardSections › should be rendered', _renderComponent.default, _.default, _dashboardSections.default);
22
25
  //# sourceMappingURL=fixtures.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/molecule/draggable-list/test/fixtures.js"],"names":["t","pass","MoleculeDraggableList","propTypes","value","key","not","undefined","renderComponentMacro","fixtureDashboardSections"],"mappings":";;AAAA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,kBAAK,gEAAL,EAAuEA,CAAC,IAAI;AAC1EA,EAAAA,CAAC,CAACC,IAAF;AACA,wBAAQC,UAAsBC,SAA9B,EAAyC,CAACC,KAAD,EAAQC,GAAR,KAAgB;AACvDL,IAAAA,CAAC,CAACM,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,0DAAyDF,GAAI,mEAAtF;AACD,GAFD;AAGD,CALD;AAOA,kBAAK,2EAAL,EAAkFG,wBAAlF,EAAwGN,SAAxG,EAA+HO,0BAA/H","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"}
1
+ {"version":3,"sources":["../../../../src/molecule/draggable-list/test/fixtures.js"],"names":["t","pass","MoleculeDraggableList","propTypes","value","key","not","undefined","renderComponentMacro","fixtureCourseSections","fixtureDashboardSections"],"mappings":";;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,kBAAK,gEAAL,EAAuEA,CAAC,IAAI;AAC1EA,EAAAA,CAAC,CAACC,IAAF;AACA,wBAAQC,UAAsBC,SAA9B,EAAyC,CAACC,KAAD,EAAQC,GAAR,KAAgB;AACvDL,IAAAA,CAAC,CAACM,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,0DAAyDF,GAAI,mEAAtF;AACD,GAFD;AAGD,CALD;AAOA,kBAAK,wEAAL,EAA+EG,wBAA/E,EAAqGN,SAArG,EAA4HO,uBAA5H;AACA,kBAAK,2EAAL,EAAkFD,wBAAlF,EAAwGN,SAAxG,EAA+HQ,0BAA/H","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport MoleculeDraggableList from '..';\nimport fixtureCourseSections from './fixtures/course-sections';\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 › CourseSections › should be rendered', renderComponentMacro, MoleculeDraggableList, fixtureCourseSections);\ntest('Molecule › MoleculeDraggableList › DashboardSections › should be rendered', renderComponentMacro, MoleculeDraggableList, fixtureDashboardSections);\n"],"file":"fixtures.js"}
@@ -18,7 +18,7 @@ var _ = _interopRequireDefault(require(".."));
18
18
 
19
19
  var _style = _interopRequireDefault(require("../../draggable/style.css"));
20
20
 
21
- var _default = _interopRequireDefault(require("./fixtures/default"));
21
+ var _dashboardSections = _interopRequireDefault(require("./fixtures/dashboard-sections"));
22
22
 
23
23
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
24
24
 
@@ -30,15 +30,15 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
30
30
  });
31
31
  (0, _ava.default)('should trigger onDrop handler', t => {
32
32
  t.plan(7);
33
- const elementToDrag = _default.default.props.sections[0].id;
34
- const elementToDrop = _default.default.props.sections[2].id;
33
+ const elementToDrag = _dashboardSections.default.props.items[0].id;
34
+ const elementToDrop = _dashboardSections.default.props.items[2].id;
35
35
 
36
36
  const dropHandler = (dragged, dropped) => {
37
37
  t.is(dropped, elementToDrop);
38
38
  t.is(dragged, elementToDrag);
39
39
  };
40
40
 
41
- const wrapper = (0, _enzyme.mount)( /*#__PURE__*/_react.default.createElement(_.default, _extends({}, _default.default.props, {
41
+ const wrapper = (0, _enzyme.mount)( /*#__PURE__*/_react.default.createElement(_.default, _extends({}, _dashboardSections.default.props, {
42
42
  onDrop: dropHandler
43
43
  })), {
44
44
  wrappingComponent: _renderComponent.wrappingComponent
@@ -55,12 +55,12 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
55
55
  const dropEvent = {
56
56
  preventDefault: () => t.pass()
57
57
  };
58
- wrapper.find(`.${_style.default.section}`).at(0).simulate('dragStart', dragStartEvent);
59
- wrapper.find(`.${_style.default.section}`).at(0).simulate('dragOver', dragOverEvent);
60
- wrapper.find(`.${_style.default.section}`).at(0).simulate('dragOver', dragOverEvent);
61
- wrapper.find(`.${_style.default.section}`).at(0).simulate('dragLeave', dragLeaveEvent);
62
- wrapper.find(`.${_style.default.section}`).at(2).simulate('dragOver', dragOverEvent);
63
- wrapper.find(`.${_style.default.section}`).at(2).simulate('drop', dropEvent);
58
+ wrapper.find(`.${_style.default.draggable}`).at(0).simulate('dragStart', dragStartEvent);
59
+ wrapper.find(`.${_style.default.draggable}`).at(0).simulate('dragOver', dragOverEvent);
60
+ wrapper.find(`.${_style.default.draggable}`).at(0).simulate('dragOver', dragOverEvent);
61
+ wrapper.find(`.${_style.default.draggable}`).at(0).simulate('dragLeave', dragLeaveEvent);
62
+ wrapper.find(`.${_style.default.draggable}`).at(2).simulate('dragOver', dragOverEvent);
63
+ wrapper.find(`.${_style.default.draggable}`).at(2).simulate('drop', dropEvent);
64
64
  });
65
65
  (0, _ava.default)('should skip drop event if dragStart is not called', t => {
66
66
  t.plan(1);
@@ -69,7 +69,7 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
69
69
  t.fail();
70
70
  };
71
71
 
72
- const wrapper = (0, _enzyme.mount)( /*#__PURE__*/_react.default.createElement(_.default, _extends({}, _default.default.props, {
72
+ const wrapper = (0, _enzyme.mount)( /*#__PURE__*/_react.default.createElement(_.default, _extends({}, _dashboardSections.default.props, {
73
73
  onDrop: dropHandler
74
74
  })), {
75
75
  wrappingComponent: _renderComponent.wrappingComponent
@@ -77,7 +77,7 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
77
77
  const dropEvent = {
78
78
  preventDefault: () => t.pass()
79
79
  };
80
- wrapper.find(`.${_style.default.section}`).at(2).simulate('drop', dropEvent);
80
+ wrapper.find(`.${_style.default.draggable}`).at(2).simulate('drop', dropEvent);
81
81
  });
82
82
  (0, _ava.default)('should skip dragStart event if section id is not defined', t => {
83
83
  t.plan(0);
@@ -86,7 +86,7 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
86
86
  t.fail();
87
87
  };
88
88
 
89
- const wrapper = (0, _enzyme.mount)( /*#__PURE__*/_react.default.createElement(_.default, _extends({}, (0, _set2.default)('sections.0.id', '', _default.default.props), {
89
+ const wrapper = (0, _enzyme.mount)( /*#__PURE__*/_react.default.createElement(_.default, _extends({}, (0, _set2.default)('items.0.id', '', _dashboardSections.default.props), {
90
90
  onDrop: dropHandler
91
91
  })), {
92
92
  wrappingComponent: _renderComponent.wrappingComponent
@@ -103,11 +103,11 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
103
103
  const dropEvent = {
104
104
  preventDefault: () => {}
105
105
  };
106
- wrapper.find(`.${_style.default.section}`).at(0).simulate('dragStart', dragStartEvent);
107
- wrapper.find(`.${_style.default.section}`).at(0).simulate('dragOver', dragOverEvent);
108
- wrapper.find(`.${_style.default.section}`).at(0).simulate('dragOver', dragOverEvent);
109
- wrapper.find(`.${_style.default.section}`).at(0).simulate('dragLeave', dragLeaveEvent);
110
- wrapper.find(`.${_style.default.section}`).at(2).simulate('dragOver', dragOverEvent);
111
- wrapper.find(`.${_style.default.section}`).at(2).simulate('drop', dropEvent);
106
+ wrapper.find(`.${_style.default.draggable}`).at(0).simulate('dragStart', dragStartEvent);
107
+ wrapper.find(`.${_style.default.draggable}`).at(0).simulate('dragOver', dragOverEvent);
108
+ wrapper.find(`.${_style.default.draggable}`).at(0).simulate('dragOver', dragOverEvent);
109
+ wrapper.find(`.${_style.default.draggable}`).at(0).simulate('dragLeave', dragLeaveEvent);
110
+ wrapper.find(`.${_style.default.draggable}`).at(2).simulate('dragOver', dragOverEvent);
111
+ wrapper.find(`.${_style.default.draggable}`).at(2).simulate('drop', dropEvent);
112
112
  });
113
113
  //# sourceMappingURL=on-drop.js.map