@coorpacademy/components 10.5.1 → 10.5.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/atom/card-image-preview/test/fixtures.js +0 -30
- package/es/atom/card-image-preview/test/fixtures.js.map +1 -1
- package/es/molecule/course-section/test/fixtures.js +15 -0
- package/es/molecule/course-section/test/fixtures.js.map +1 -0
- package/es/molecule/draggable/index.js +56 -0
- package/es/molecule/draggable/index.js.map +1 -0
- package/es/molecule/draggable/style.css +67 -0
- package/es/molecule/draggable/test/fixtures/default.js +12 -0
- package/es/molecule/draggable/test/fixtures/default.js.map +1 -0
- package/es/molecule/draggable/test/fixtures.js +13 -0
- package/es/molecule/draggable/test/fixtures.js.map +1 -0
- package/es/molecule/draggable-list/index.js +54 -0
- package/es/molecule/draggable-list/index.js.map +1 -0
- package/es/molecule/draggable-list/test/fixtures/dashboard-sections.js +26 -0
- package/es/molecule/draggable-list/test/fixtures/dashboard-sections.js.map +1 -0
- package/es/molecule/draggable-list/test/fixtures.js +13 -0
- package/es/molecule/draggable-list/test/fixtures.js.map +1 -0
- package/es/molecule/{setup-sections → draggable-list}/test/on-drop.js +5 -5
- package/es/molecule/draggable-list/test/on-drop.js.map +1 -0
- package/es/molecule/search/test/fixtures.js +15 -0
- package/es/molecule/search/test/fixtures.js.map +1 -0
- package/es/molecule/select-multiple/style.css +8 -5
- package/es/molecule/setup-section/index.js +2 -23
- package/es/molecule/setup-section/index.js.map +1 -1
- package/es/molecule/setup-section/style.css +1 -26
- package/es/molecule/setup-sections/index.js +7 -85
- package/es/molecule/setup-sections/index.js.map +1 -1
- package/es/molecule/setup-sections/style.css +0 -56
- package/es/organism/brand-form/test/fixtures/wizard-playlists.js +1 -1
- package/es/organism/brand-form/test/fixtures/wizard-playlists.js.map +1 -1
- package/es/template/app-player/popin-end/test/fixtures.js +2 -0
- package/es/template/app-player/popin-end/test/fixtures.js.map +1 -1
- package/lib/atom/card-image-preview/test/fixtures.js +0 -45
- package/lib/atom/card-image-preview/test/fixtures.js.map +1 -1
- package/lib/molecule/course-section/test/fixtures.js +25 -0
- package/lib/molecule/course-section/test/fixtures.js.map +1 -0
- package/lib/molecule/draggable/index.js +71 -0
- package/lib/molecule/draggable/index.js.map +1 -0
- package/lib/molecule/draggable/style.css +67 -0
- package/lib/molecule/draggable/test/fixtures/default.js +17 -0
- package/lib/molecule/draggable/test/fixtures/default.js.map +1 -0
- package/lib/molecule/draggable/test/fixtures.js +22 -0
- package/lib/molecule/draggable/test/fixtures.js.map +1 -0
- package/lib/molecule/draggable-list/index.js +70 -0
- package/lib/molecule/draggable-list/index.js.map +1 -0
- package/lib/molecule/draggable-list/test/fixtures/dashboard-sections.js +37 -0
- package/lib/molecule/draggable-list/test/fixtures/dashboard-sections.js.map +1 -0
- package/lib/molecule/draggable-list/test/fixtures.js +22 -0
- package/lib/molecule/draggable-list/test/fixtures.js.map +1 -0
- package/lib/molecule/{setup-sections → draggable-list}/test/on-drop.js +7 -7
- package/lib/molecule/draggable-list/test/on-drop.js.map +1 -0
- package/lib/molecule/search/test/fixtures.js +25 -0
- package/lib/molecule/search/test/fixtures.js.map +1 -0
- package/lib/molecule/select-multiple/style.css +8 -5
- package/lib/molecule/setup-section/index.js +2 -21
- package/lib/molecule/setup-section/index.js.map +1 -1
- package/lib/molecule/setup-section/style.css +1 -26
- package/lib/molecule/setup-sections/index.js +7 -89
- package/lib/molecule/setup-sections/index.js.map +1 -1
- package/lib/molecule/setup-sections/style.css +0 -56
- package/lib/organism/brand-form/test/fixtures/wizard-playlists.js +1 -1
- package/lib/organism/brand-form/test/fixtures/wizard-playlists.js.map +1 -1
- package/lib/template/app-player/popin-end/test/fixtures.js +3 -0
- package/lib/template/app-player/popin-end/test/fixtures.js.map +1 -1
- package/package.json +2 -2
- package/es/molecule/setup-sections/test/on-drop.js.map +0 -1
- package/lib/molecule/setup-sections/test/on-drop.js.map +0 -1
|
@@ -0,0 +1,70 @@
|
|
|
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
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
+
|
|
16
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
|
17
|
+
|
|
18
|
+
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; }
|
|
19
|
+
|
|
20
|
+
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); }
|
|
21
|
+
|
|
22
|
+
const ITEMS = {
|
|
23
|
+
'setup-section': _setupSection.default
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const SetupSections = ({
|
|
27
|
+
items,
|
|
28
|
+
onDrop,
|
|
29
|
+
itemType
|
|
30
|
+
}) => {
|
|
31
|
+
const [dragTo, setDragTo] = (0, _react.useState)(null);
|
|
32
|
+
const [dragFrom, setDragFrom] = (0, _react.useState)(null);
|
|
33
|
+
const dragStartHandler = (0, _react.useCallback)(id => {
|
|
34
|
+
setDragFrom(id);
|
|
35
|
+
}, [setDragFrom]);
|
|
36
|
+
const dragOverHandler = (0, _react.useCallback)(id => {
|
|
37
|
+
if (dragTo === id) return;
|
|
38
|
+
setDragTo(id);
|
|
39
|
+
}, [dragTo, setDragTo]);
|
|
40
|
+
const dragLeaveHandler = (0, _react.useCallback)(id => {
|
|
41
|
+
setDragTo(null);
|
|
42
|
+
}, [setDragTo]);
|
|
43
|
+
const dropHandler = (0, _react.useCallback)(id => {
|
|
44
|
+
if (onDrop && dragFrom) onDrop(dragFrom, id);
|
|
45
|
+
setDragTo(null);
|
|
46
|
+
setDragFrom(null);
|
|
47
|
+
}, [onDrop, setDragTo, setDragFrom, dragFrom]);
|
|
48
|
+
const Item = ITEMS[itemType];
|
|
49
|
+
const itemsView = items.map(item => /*#__PURE__*/_react.default.createElement(_draggable.default, {
|
|
50
|
+
key: item.id,
|
|
51
|
+
id: item.id,
|
|
52
|
+
dragging: dragTo === item.id,
|
|
53
|
+
onDragStart: dragStartHandler,
|
|
54
|
+
onDragOver: dragOverHandler,
|
|
55
|
+
onDragLeave: dragLeaveHandler,
|
|
56
|
+
onDrop: dropHandler
|
|
57
|
+
}, /*#__PURE__*/_react.default.createElement(Item, _extends({}, item, {
|
|
58
|
+
key: item.id
|
|
59
|
+
}))));
|
|
60
|
+
return /*#__PURE__*/_react.default.createElement("div", null, itemsView);
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
SetupSections.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
64
|
+
items: _propTypes.default.arrayOf(_propTypes.default.shape(_setupSection.default.propTypes)),
|
|
65
|
+
onDrop: _propTypes.default.func,
|
|
66
|
+
itemType: _propTypes.default.string
|
|
67
|
+
} : {};
|
|
68
|
+
var _default = SetupSections;
|
|
69
|
+
exports.default = _default;
|
|
70
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/molecule/draggable-list/index.js"],"names":["ITEMS","SetupSection","SetupSections","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;;;;;;;;;;AAEA,MAAMA,KAAK,GAAG;AAAC,mBAAiBC;AAAlB,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,GAAGf,KAAK,CAACK,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,CAAgBrB,sBAAakB,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';\n\nconst ITEMS = {'setup-section': SetupSection};\n\nconst SetupSections = ({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\nSetupSections.propTypes = {\n items: PropTypes.arrayOf(PropTypes.shape(SetupSection.propTypes)),\n onDrop: PropTypes.func,\n itemType: PropTypes.string\n};\n\nexport default SetupSections;\n"],"file":"index.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"}
|
|
@@ -0,0 +1,22 @@
|
|
|
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 _dashboardSections = _interopRequireDefault(require("./fixtures/dashboard-sections"));
|
|
12
|
+
|
|
13
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
+
|
|
15
|
+
(0, _ava.default)('Molecule › MoleculeDraggableList > should have valid propTypes', t => {
|
|
16
|
+
t.pass();
|
|
17
|
+
(0, _forEach.default)(_.default.propTypes, (value, key) => {
|
|
18
|
+
t.not(value, undefined, `PropType for "Molecule.MoleculeDraggableList.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
(0, _ava.default)('Molecule › MoleculeDraggableList › DashboardSections › should be rendered', _renderComponent.default, _.default, _dashboardSections.default);
|
|
22
|
+
//# sourceMappingURL=fixtures.js.map
|
|
@@ -0,0 +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"}
|
|
@@ -16,9 +16,9 @@ var _renderComponent = require("../../../test/helpers/render-component");
|
|
|
16
16
|
|
|
17
17
|
var _ = _interopRequireDefault(require(".."));
|
|
18
18
|
|
|
19
|
-
var _style = _interopRequireDefault(require("
|
|
19
|
+
var _style = _interopRequireDefault(require("../../draggable/style.css"));
|
|
20
20
|
|
|
21
|
-
var
|
|
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 =
|
|
34
|
-
const elementToDrop =
|
|
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({},
|
|
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
|
|
@@ -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({},
|
|
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
|
|
@@ -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)('
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/molecule/draggable-list/test/on-drop.js"],"names":["adapter","Adapter","t","plan","elementToDrag","fixtures","props","items","id","elementToDrop","dropHandler","dragged","dropped","is","wrapper","wrappingComponent","dragStartEvent","preventDefault","pass","dragOverEvent","d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AArC,EAAwCC,QAAxC,CAAiD,UAAjD,EAA6DP,aAA7D;AACAL,EAAAA,OAAO,CAACQ,IAAR,CAAc,IAAGC,eAAMC,OAAQ,EAA/B,EAAkCC,EAAlC,CAAqC,CAArC,EAAwCC,QAAxC,CAAiD,WAAjD,EAA8DN,cAA9D;AACAN,EAAAA,OAAO,CAACQ,IAAR,CAAc,IAAGC,eAAMC,OAAQ,EAA/B,EAAkCC,EAAlC,CAAqC,CAArC,EAAwCC,QAAxC,CAAiD,UAAjD,EAA6DP,aAA7D;AACAL,EAAAA,OAAO,CAACQ,IAAR,CAAc,IAAGC,eAAMC,OAAQ,EAA/B,EAAkCC,EAAlC,CAAqC,CAArC,EAAwCC,QAAxC,CAAiD,MAAjD,EAAyDL,SAAzD;AACD,CAzBD","sourcesContent":["import browserEnv from 'browser-env';\nimport test from 'ava';\nimport React from 'react';\nimport {mount, configure} from 'enzyme';\nimport {set} from 'lodash/fp';\nimport Adapter from 'enzyme-adapter-react-16';\nimport {wrappingComponent} from '../../../test/helpers/render-component';\nimport SetupSections from '..';\n// eslint-disable-next-line css-modules/no-unused-class\nimport style from '../../draggable/style.css';\nimport fixtures from './fixtures/dashboard-sections';\n\nbrowserEnv();\nconfigure({adapter: new Adapter()});\n\ntest('should trigger onDrop handler', t => {\n t.plan(7);\n\n const elementToDrag = fixtures.props.items[0].id;\n const elementToDrop = fixtures.props.items[2].id;\n\n const dropHandler = (dragged, dropped) => {\n t.is(dropped, elementToDrop);\n t.is(dragged, elementToDrag);\n };\n\n const wrapper = mount(<SetupSections {...fixtures.props} onDrop={dropHandler} />, {\n wrappingComponent\n });\n\n const dragStartEvent = {preventDefault: () => t.pass()};\n const dragOverEvent = {preventDefault: () => t.pass()};\n const dragLeaveEvent = {preventDefault: () => t.pass()};\n const dropEvent = {preventDefault: () => t.pass()};\n\n wrapper.find(`.${style.section}`).at(0).simulate('dragStart', dragStartEvent);\n wrapper.find(`.${style.section}`).at(0).simulate('dragOver', dragOverEvent);\n wrapper.find(`.${style.section}`).at(0).simulate('dragOver', dragOverEvent);\n wrapper.find(`.${style.section}`).at(0).simulate('dragLeave', dragLeaveEvent);\n wrapper.find(`.${style.section}`).at(2).simulate('dragOver', dragOverEvent);\n wrapper.find(`.${style.section}`).at(2).simulate('drop', dropEvent);\n});\n\ntest('should skip drop event if dragStart is not called', t => {\n t.plan(1);\n\n const dropHandler = (dragged, dropped) => {\n t.fail();\n };\n\n const wrapper = mount(<SetupSections {...fixtures.props} onDrop={dropHandler} />, {\n wrappingComponent\n });\n\n const dropEvent = {preventDefault: () => t.pass()};\n wrapper.find(`.${style.section}`).at(2).simulate('drop', dropEvent);\n});\n\ntest('should skip dragStart event if section id is not defined', t => {\n t.plan(0);\n\n const dropHandler = (dragged, dropped) => {\n t.fail();\n };\n\n const wrapper = mount(\n <SetupSections {...set('items.0.id', '', fixtures.props)} onDrop={dropHandler} />,\n {\n wrappingComponent\n }\n );\n\n const dragStartEvent = {preventDefault: () => {}};\n const dragOverEvent = {preventDefault: () => {}};\n const dragLeaveEvent = {preventDefault: () => {}};\n const dropEvent = {preventDefault: () => {}};\n\n wrapper.find(`.${style.section}`).at(0).simulate('dragStart', dragStartEvent);\n wrapper.find(`.${style.section}`).at(0).simulate('dragOver', dragOverEvent);\n wrapper.find(`.${style.section}`).at(0).simulate('dragOver', dragOverEvent);\n wrapper.find(`.${style.section}`).at(0).simulate('dragLeave', dragLeaveEvent);\n wrapper.find(`.${style.section}`).at(2).simulate('dragOver', dragOverEvent);\n wrapper.find(`.${style.section}`).at(2).simulate('drop', dropEvent);\n});\n"],"file":"on-drop.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 _withValue = _interopRequireDefault(require("./fixtures/with-value"));
|
|
14
|
+
|
|
15
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
|
+
|
|
17
|
+
(0, _ava.default)('Molecule › MoleculeSearch > should have valid propTypes', t => {
|
|
18
|
+
t.pass();
|
|
19
|
+
(0, _forEach.default)(_.default.propTypes, (value, key) => {
|
|
20
|
+
t.not(value, undefined, `PropType for "Molecule.MoleculeSearch.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
(0, _ava.default)('Molecule › MoleculeSearch › Default › should be rendered', _renderComponent.default, _.default, _default.default);
|
|
24
|
+
(0, _ava.default)('Molecule › MoleculeSearch › WithValue › should be rendered', _renderComponent.default, _.default, _withValue.default);
|
|
25
|
+
//# sourceMappingURL=fixtures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/molecule/search/test/fixtures.js"],"names":["t","pass","MoleculeSearch","propTypes","value","key","not","undefined","renderComponentMacro","fixtureDefault","fixtureWithValue"],"mappings":";;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,kBAAK,yDAAL,EAAgEA,CAAC,IAAI;AACnEA,EAAAA,CAAC,CAACC,IAAF;AACA,wBAAQC,UAAeC,SAAvB,EAAkC,CAACC,KAAD,EAAQC,GAAR,KAAgB;AAChDL,IAAAA,CAAC,CAACM,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,mDAAkDF,GAAI,mEAA/E;AACD,GAFD;AAGD,CALD;AAOA,kBAAK,0DAAL,EAAiEG,wBAAjE,EAAuFN,SAAvF,EAAuGO,gBAAvG;AACA,kBAAK,4DAAL,EAAmED,wBAAnE,EAAyFN,SAAzF,EAAyGQ,kBAAzG","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport MoleculeSearch from '..';\nimport fixtureDefault from './fixtures/default';\nimport fixtureWithValue from './fixtures/with-value';\n\ntest('Molecule › MoleculeSearch > should have valid propTypes', t => {\n t.pass();\n forEach(MoleculeSearch.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Molecule.MoleculeSearch.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Molecule › MoleculeSearch › Default › should be rendered', renderComponentMacro, MoleculeSearch, fixtureDefault);\ntest('Molecule › MoleculeSearch › WithValue › should be rendered', renderComponentMacro, MoleculeSearch, fixtureWithValue);\n"],"file":"fixtures.js"}
|
|
@@ -352,6 +352,7 @@
|
|
|
352
352
|
|
|
353
353
|
.coorpmanager .descriptionLabel {
|
|
354
354
|
margin: 0 1px 18px 0;
|
|
355
|
+
padding: 8px 16px;
|
|
355
356
|
border-radius: 7px;
|
|
356
357
|
background-color: cm_grey_700;
|
|
357
358
|
flex-grow: 0;
|
|
@@ -365,14 +366,16 @@
|
|
|
365
366
|
text-align: center;
|
|
366
367
|
color: white;
|
|
367
368
|
padding: 8px 16px;
|
|
368
|
-
max-width:
|
|
369
|
-
position: absolute;
|
|
370
|
-
left: -20px;
|
|
371
|
-
z-index: 999;
|
|
372
|
-
bottom: 18px;
|
|
369
|
+
max-width: 348px;
|
|
373
370
|
width: max-content;
|
|
371
|
+
position: absolute;
|
|
372
|
+
left: -24px;
|
|
373
|
+
z-index: 3;
|
|
374
|
+
bottom: 5px;
|
|
374
375
|
visibility: hidden;
|
|
375
376
|
opacity: 0;
|
|
377
|
+
overflow-wrap: break-word;
|
|
378
|
+
white-space: break-spaces;
|
|
376
379
|
}
|
|
377
380
|
|
|
378
381
|
.coorpmanager .title.titleWithSelection .descriptionLabel,
|
|
@@ -9,8 +9,6 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
9
9
|
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
11
|
|
|
12
|
-
var _novaIcons = require("@coorpacademy/nova-icons");
|
|
13
|
-
|
|
14
12
|
var _provider = _interopRequireDefault(require("../../atom/provider"));
|
|
15
13
|
|
|
16
14
|
var _inputSwitch = _interopRequireDefault(require("../../atom/input-switch"));
|
|
@@ -56,20 +54,13 @@ ContentTypesToggler.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
56
54
|
|
|
57
55
|
const SetupSection = (props, context) => {
|
|
58
56
|
const {
|
|
59
|
-
translate
|
|
60
|
-
skin
|
|
57
|
+
translate
|
|
61
58
|
} = context;
|
|
62
|
-
const brand = (0, _get2.default)('common.brand', skin);
|
|
63
|
-
const medium = (0, _get2.default)('common.medium', skin);
|
|
64
59
|
const {
|
|
65
60
|
title,
|
|
66
|
-
onUp,
|
|
67
|
-
onDown,
|
|
68
61
|
display,
|
|
69
62
|
contentTypes
|
|
70
63
|
} = props;
|
|
71
|
-
const colorUp = onDown ? brand : medium;
|
|
72
|
-
const colorDown = onUp ? brand : medium;
|
|
73
64
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
74
65
|
className: _style.default.wrapper
|
|
75
66
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -80,17 +71,7 @@ const SetupSection = (props, context) => {
|
|
|
80
71
|
contentTypes: contentTypes
|
|
81
72
|
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
82
73
|
className: _style.default.label
|
|
83
|
-
}, translate('Show')), /*#__PURE__*/_react.default.createElement(_inputSwitch.default, display)
|
|
84
|
-
className: _style.default.arrowSection
|
|
85
|
-
}, /*#__PURE__*/_react.default.createElement(_novaIcons.NovaCompositionNavigationArrowDown, {
|
|
86
|
-
color: colorUp,
|
|
87
|
-
className: onDown ? _style.default.arrow : _style.default.disabled,
|
|
88
|
-
onClick: onDown
|
|
89
|
-
}), /*#__PURE__*/_react.default.createElement(_novaIcons.NovaCompositionNavigationArrowTop, {
|
|
90
|
-
color: colorDown,
|
|
91
|
-
className: onUp ? _style.default.arrow : _style.default.disabled,
|
|
92
|
-
onClick: onUp
|
|
93
|
-
}))));
|
|
74
|
+
}, translate('Show')), /*#__PURE__*/_react.default.createElement(_inputSwitch.default, display)));
|
|
94
75
|
};
|
|
95
76
|
|
|
96
77
|
SetupSection.contextTypes = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/molecule/setup-section/index.js"],"names":["ContentTypesToggler","props","context","skin","contentTypes","brand","orange","contentTypesColor","style","contentTypeWrapper","contextTypes","Provider","childContextTypes","propTypes","PropTypes","shape","RadioGroup","modified","bool","SetupSection","translate","
|
|
1
|
+
{"version":3,"sources":["../../../src/molecule/setup-section/index.js"],"names":["ContentTypesToggler","props","context","skin","contentTypes","brand","orange","contentTypesColor","style","contentTypeWrapper","contextTypes","Provider","childContextTypes","propTypes","PropTypes","shape","RadioGroup","modified","bool","SetupSection","translate","title","display","wrapper","settings","label","string","isRequired","onUp","func","onDown","InputSwitch"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;;;;;AAEA,MAAMA,mBAAmB,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;AAC9C,QAAM;AAACC,IAAAA;AAAD,MAASD,OAAf;AACA,QAAM;AAACE,IAAAA;AAAD,MAAiBH,KAAvB;;AAEA,MAAI,CAACG,YAAL,EAAmB;AACjB,WAAO,IAAP;AACD;;AAED,QAAMC,KAAK,GAAG,mBAAI,cAAJ,EAAoBF,IAApB,CAAd;AACA,QAAMG,MAAM,GAAG,mBAAI,eAAJ,EAAqBH,IAArB,CAAf;AACA,QAAMI,iBAAiB,GAAG,mBAAI,UAAJ,EAAgBH,YAAhB,IAAgCE,MAAhC,GAAyCD,KAAnE;AAEA,sBACE;AAAK,IAAA,SAAS,EAAEG,eAAMC;AAAtB,kBACE,6BAAC,mBAAD,eAAgBL,YAAhB;AAA8B,IAAA,KAAK,EAA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mBAAUC,KAAV,CAAgBgB,qBAAYlB,SAA5B,CAJc;AAKvBT,EAAAA,YAAY,EAAEJ,mBAAmB,CAACa,SAApB,CAA8BT;AALrB,CAAzB;eAQee,Y","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {get} from 'lodash/fp';\nimport Provider from '../../atom/provider';\nimport InputSwitch from '../../atom/input-switch';\nimport RadioGroup from '../../atom/radio-group';\nimport style from './style.css';\n\nconst ContentTypesToggler = (props, context) => {\n const {skin} = context;\n const {contentTypes} = props;\n\n if (!contentTypes) {\n return null;\n }\n\n const brand = get('common.brand', skin);\n const orange = get('common.orange', skin);\n const contentTypesColor = get('modified', contentTypes) ? orange : brand;\n\n return (\n <div className={style.contentTypeWrapper}>\n <RadioGroup {...contentTypes} color={contentTypesColor} />\n </div>\n );\n};\n\nContentTypesToggler.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nContentTypesToggler.propTypes = {\n contentTypes: PropTypes.shape({\n ...RadioGroup.propTypes,\n modified: PropTypes.bool\n })\n};\n\nconst SetupSection = (props, context) => {\n const {translate} = context;\n\n const {title, display, contentTypes} = props;\n\n return (\n <div className={style.wrapper}>\n <div className={style.title}>{title}</div>\n <div className={style.settings}>\n <ContentTypesToggler contentTypes={contentTypes} />\n <div className={style.label}>{translate('Show')}</div>\n <InputSwitch {...display} />\n </div>\n </div>\n );\n};\n\nSetupSection.contextTypes = {\n translate: Provider.childContextTypes.translate,\n skin: Provider.childContextTypes.skin\n};\n\nSetupSection.propTypes = {\n title: PropTypes.string.isRequired,\n onUp: PropTypes.func,\n onDown: PropTypes.func,\n display: PropTypes.shape(InputSwitch.propTypes),\n contentTypes: ContentTypesToggler.propTypes.contentTypes\n};\n\nexport default SetupSection;\n"],"file":"index.js"}
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
display: flex;
|
|
13
13
|
align-items: center;
|
|
14
14
|
justify-content: space-between;
|
|
15
|
-
padding: 0 24px;
|
|
15
|
+
padding: 0 24px 0 48px;
|
|
16
16
|
box-sizing: border-box;
|
|
17
17
|
}
|
|
18
18
|
|
|
@@ -37,32 +37,7 @@
|
|
|
37
37
|
margin-left: 30px;
|
|
38
38
|
margin-right: 16px;
|
|
39
39
|
}
|
|
40
|
-
.arrowSection {
|
|
41
|
-
display: none
|
|
42
|
-
}
|
|
43
|
-
.arrow {
|
|
44
|
-
left: 50%;
|
|
45
|
-
top: 50%;
|
|
46
|
-
margin: 0 0 0 24px;
|
|
47
|
-
width: 30px;
|
|
48
|
-
height: 30px;
|
|
49
|
-
cursor: pointer;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.arrow:hover path:last-child {
|
|
53
|
-
fill: primaryAdd1;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.disabled {
|
|
57
|
-
composes: arrow;
|
|
58
|
-
pointer-events: none;
|
|
59
|
-
}
|
|
60
40
|
|
|
61
41
|
.contentTypeWrapper {
|
|
62
42
|
width: 310px;
|
|
63
43
|
}
|
|
64
|
-
@media mobile {
|
|
65
|
-
.arrowSection {
|
|
66
|
-
display: block;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.default = void 0;
|
|
5
5
|
|
|
6
|
-
var _react =
|
|
6
|
+
var _react = _interopRequireDefault(require("react"));
|
|
7
7
|
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _draggableList = _interopRequireDefault(require("../draggable-list"));
|
|
11
11
|
|
|
12
12
|
var _setupSection = _interopRequireDefault(require("../setup-section"));
|
|
13
13
|
|
|
@@ -17,62 +17,6 @@ var _style = _interopRequireDefault(require("./style.css"));
|
|
|
17
17
|
|
|
18
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
19
|
|
|
20
|
-
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
|
21
|
-
|
|
22
|
-
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; }
|
|
23
|
-
|
|
24
|
-
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); }
|
|
25
|
-
|
|
26
|
-
const preventDefault = e => e.preventDefault();
|
|
27
|
-
|
|
28
|
-
const stopPropagation = e => e.stopPropagation();
|
|
29
|
-
|
|
30
|
-
const Draggable = props => {
|
|
31
|
-
const {
|
|
32
|
-
id,
|
|
33
|
-
dragging = false,
|
|
34
|
-
onDragStart,
|
|
35
|
-
onDragOver,
|
|
36
|
-
onDragLeave,
|
|
37
|
-
onDrop,
|
|
38
|
-
children
|
|
39
|
-
} = props;
|
|
40
|
-
const dragStartHandler = (0, _react.useCallback)(e => {
|
|
41
|
-
stopPropagation(e);
|
|
42
|
-
onDragStart(id);
|
|
43
|
-
}, [id, onDragStart]);
|
|
44
|
-
const dragOverHandler = (0, _react.useCallback)(e => {
|
|
45
|
-
preventDefault(e);
|
|
46
|
-
onDragOver(id);
|
|
47
|
-
}, [id, onDragOver]);
|
|
48
|
-
const dragLeaveHandler = (0, _react.useCallback)(e => {
|
|
49
|
-
preventDefault(e);
|
|
50
|
-
onDragLeave(id);
|
|
51
|
-
}, [id, onDragLeave]);
|
|
52
|
-
const dropHandler = (0, _react.useCallback)(e => {
|
|
53
|
-
preventDefault(e);
|
|
54
|
-
onDrop(id);
|
|
55
|
-
}, [id, onDrop]);
|
|
56
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
57
|
-
className: (0, _classnames.default)(dragging ? _style.default.dragging : null, _style.default.section, _style.default.draggable),
|
|
58
|
-
onDragStart: dragStartHandler,
|
|
59
|
-
onDragOver: dragOverHandler,
|
|
60
|
-
onDragLeave: dragLeaveHandler,
|
|
61
|
-
onDrop: dropHandler,
|
|
62
|
-
draggable: true
|
|
63
|
-
}, children);
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
Draggable.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
67
|
-
id: _propTypes.default.string,
|
|
68
|
-
dragging: _propTypes.default.bool,
|
|
69
|
-
onDragStart: _propTypes.default.func,
|
|
70
|
-
onDragOver: _propTypes.default.func,
|
|
71
|
-
onDragLeave: _propTypes.default.func,
|
|
72
|
-
onDrop: _propTypes.default.func,
|
|
73
|
-
children: _propTypes.default.element
|
|
74
|
-
} : {};
|
|
75
|
-
|
|
76
20
|
const Loading = () => /*#__PURE__*/_react.default.createElement("div", {
|
|
77
21
|
className: _style.default.loading
|
|
78
22
|
}, /*#__PURE__*/_react.default.createElement(_loader.default, null));
|
|
@@ -82,38 +26,12 @@ const SetupSections = ({
|
|
|
82
26
|
loading,
|
|
83
27
|
onDrop
|
|
84
28
|
}) => {
|
|
85
|
-
const [dragTo, setDragTo] = (0, _react.useState)(null);
|
|
86
|
-
const [dragFrom, setDragFrom] = (0, _react.useState)(null);
|
|
87
|
-
const dragStartHandler = (0, _react.useCallback)(id => {
|
|
88
|
-
setDragFrom(id);
|
|
89
|
-
}, [setDragFrom]);
|
|
90
|
-
const dragOverHandler = (0, _react.useCallback)(id => {
|
|
91
|
-
if (dragTo === id) return;
|
|
92
|
-
setDragTo(id);
|
|
93
|
-
}, [dragTo, setDragTo]);
|
|
94
|
-
const dragLeaveHandler = (0, _react.useCallback)(id => {
|
|
95
|
-
setDragTo(null);
|
|
96
|
-
}, [setDragTo]);
|
|
97
|
-
const dropHandler = (0, _react.useCallback)(id => {
|
|
98
|
-
if (onDrop && dragFrom) onDrop(dragFrom, id);
|
|
99
|
-
setDragTo(null);
|
|
100
|
-
setDragFrom(null);
|
|
101
|
-
}, [onDrop, setDragTo, setDragFrom, dragFrom]);
|
|
102
29
|
if (loading) return /*#__PURE__*/_react.default.createElement(Loading, null);
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
onDragOver: dragOverHandler,
|
|
109
|
-
onDragLeave: dragLeaveHandler,
|
|
110
|
-
onDrop: dropHandler
|
|
111
|
-
}, /*#__PURE__*/_react.default.createElement(_setupSection.default, _extends({}, section, {
|
|
112
|
-
key: section.id,
|
|
113
|
-
onUp: index === 0 ? null : section.onUp,
|
|
114
|
-
onDown: index === sections.length - 1 ? null : section.onDown
|
|
115
|
-
}))));
|
|
116
|
-
return /*#__PURE__*/_react.default.createElement("div", null, sectionsView);
|
|
30
|
+
return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_draggableList.default, {
|
|
31
|
+
itemType: "setup-section",
|
|
32
|
+
items: sections,
|
|
33
|
+
onDrop: onDrop
|
|
34
|
+
}));
|
|
117
35
|
};
|
|
118
36
|
|
|
119
37
|
SetupSections.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/molecule/setup-sections/index.js"],"names":["
|
|
1
|
+
{"version":3,"sources":["../../../src/molecule/setup-sections/index.js"],"names":["Loading","style","loading","SetupSections","sections","onDrop","propTypes","PropTypes","arrayOf","shape","SetupSection","bool","func"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,MAAMA,OAAO,GAAG,mBACd;AAAK,EAAA,SAAS,EAAEC,eAAMC;AAAtB,gBACE,6BAAC,eAAD,OADF,CADF;;AAMA,MAAMC,aAAa,GAAG,CAAC;AAACC,EAAAA,QAAD;AAAWF,EAAAA,OAAX;AAAoBG,EAAAA;AAApB,CAAD,KAAiC;AACrD,MAAIH,OAAJ,EAAa,oBAAO,6BAAC,OAAD,OAAP;AAEb,sBACE,uDACE,6BAAC,sBAAD;AAAe,IAAA,QAAQ,EAAC,eAAxB;AAAwC,IAAA,KAAK,EAAEE,QAA/C;AAAyD,IAAA,MAAM,EAAEC;AAAjE,IADF,CADF;AAKD,CARD;;AAUAF,aAAa,CAACG,SAAd,2CAA0B;AACxBF,EAAAA,QAAQ,EAAEG,mBAAUC,OAAV,CAAkBD,mBAAUE,KAAV,CAAgBC,sBAAaJ,SAA7B,CAAlB,CADc;AAExBJ,EAAAA,OAAO,EAAEK,mBAAUI,IAFK;AAGxBN,EAAAA,MAAM,EAAEE,mBAAUK;AAHM,CAA1B;eAMeT,a","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport DraggableList from '../draggable-list';\nimport SetupSection from '../setup-section';\nimport Loader from '../../atom/loader';\nimport style from './style.css';\n\nconst Loading = () => (\n <div className={style.loading}>\n <Loader />\n </div>\n);\n\nconst SetupSections = ({sections, loading, onDrop}) => {\n if (loading) return <Loading />;\n\n return (\n <div>\n <DraggableList itemType=\"setup-section\" items={sections} onDrop={onDrop} />\n </div>\n );\n};\n\nSetupSections.propTypes = {\n sections: PropTypes.arrayOf(PropTypes.shape(SetupSection.propTypes)),\n loading: PropTypes.bool,\n onDrop: PropTypes.func\n};\n\nexport default SetupSections;\n"],"file":"index.js"}
|
|
@@ -15,10 +15,6 @@
|
|
|
15
15
|
border-bottom: 0;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
.section:last-child {
|
|
19
|
-
border-bottom: 1px solid medium;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
18
|
.loading {
|
|
23
19
|
composes: section;
|
|
24
20
|
width: 100%;
|
|
@@ -27,55 +23,3 @@
|
|
|
27
23
|
min-height: 60px;
|
|
28
24
|
position: relative;
|
|
29
25
|
}
|
|
30
|
-
.draggable {
|
|
31
|
-
cursor: grab;
|
|
32
|
-
position: relative;
|
|
33
|
-
background: transparent;
|
|
34
|
-
}
|
|
35
|
-
.draggable:hover{
|
|
36
|
-
background: rgba(0, 0, 0, 0.3);
|
|
37
|
-
}
|
|
38
|
-
.draggable:active{
|
|
39
|
-
background: transparent;
|
|
40
|
-
}
|
|
41
|
-
.draggable:before {
|
|
42
|
-
content: '.';
|
|
43
|
-
position: absolute;
|
|
44
|
-
left: 5px;
|
|
45
|
-
font-size: 20px;
|
|
46
|
-
line-height: 7px;
|
|
47
|
-
color: medium;
|
|
48
|
-
pointer-events: none;
|
|
49
|
-
text-shadow: 0 0 medium, 0 5px medium, 0 10px medium, 0 15px medium, 0 20px medium, 0 25px medium, 0 30px medium, 0 35px medium, 0 40px medium, 0 45px medium,
|
|
50
|
-
5px 0 medium, 5px 5px medium, 5px 10px medium, 5px 15px medium, 5px 20px medium, 5px 25px medium, 5px 30px medium, 5px 35px medium, 5px 40px medium, 5px 45px medium,
|
|
51
|
-
10px 0 medium, 10px 5px medium, 10px 10px medium, 10px 15px medium, 10px 20px medium, 10px 25px medium, 10px 30px medium, 10px 35px medium, 10px 40px medium, 10px 45px medium;
|
|
52
|
-
}
|
|
53
|
-
.dragging {
|
|
54
|
-
background: rgba(0, 0, 0, 0.1);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
.dragging:after {
|
|
58
|
-
position: absolute;
|
|
59
|
-
content: "drop here";
|
|
60
|
-
left: 5px;
|
|
61
|
-
top: 5px;
|
|
62
|
-
bottom: 5px;
|
|
63
|
-
right: 5px;
|
|
64
|
-
background: color(black lightness(95%));
|
|
65
|
-
pointer-events: none;
|
|
66
|
-
border: 1px dashed medium;
|
|
67
|
-
box-sizing: border-box;
|
|
68
|
-
display: flex;
|
|
69
|
-
justify-content: center;
|
|
70
|
-
align-items: center;
|
|
71
|
-
color: dark;
|
|
72
|
-
font-family: 'Gilroy';
|
|
73
|
-
font-weight: 600;
|
|
74
|
-
font-size: 14px;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
@media mobile {
|
|
78
|
-
.draggable:before {
|
|
79
|
-
content: none;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
@@ -9,7 +9,7 @@ var _default = {
|
|
|
9
9
|
type: 'selectMultiple',
|
|
10
10
|
title: 'Languages',
|
|
11
11
|
placeholder: 'Language selection',
|
|
12
|
-
description: '
|
|
12
|
+
description: 'The name and description of your custom playlist will be displayed in the selected language. Only the selected language will be saved. You can translate during step 2 "Translations".',
|
|
13
13
|
theme: 'coorpmanager',
|
|
14
14
|
hint: '15 / 30 characters',
|
|
15
15
|
size: 'default',
|