@coorpacademy/components 10.13.3-alpha.14 → 10.13.3-alpha.20
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/drag-and-drop/index.js +9 -11
- package/es/atom/drag-and-drop/index.js.map +1 -1
- package/es/atom/drag-and-drop/style.css +10 -25
- package/es/atom/drag-and-drop/test/dragging.js +8 -1
- package/es/atom/drag-and-drop/test/dragging.js.map +1 -1
- package/es/atom/drag-and-drop/test/fixtures/clean-and-modified.js +12 -0
- package/es/atom/drag-and-drop/test/fixtures/clean-and-modified.js.map +1 -0
- package/es/atom/drag-and-drop/test/fixtures/default.js +0 -1
- package/es/atom/drag-and-drop/test/fixtures/default.js.map +1 -1
- package/es/atom/drag-and-drop/test/fixtures/error.js.map +1 -1
- package/es/atom/drag-and-drop/test/fixtures/loading.js +1 -2
- package/es/atom/drag-and-drop/test/fixtures/loading.js.map +1 -1
- package/es/atom/drag-and-drop/test/fixtures/modified.js.map +1 -1
- package/es/atom/drag-and-drop/test/fixtures/with-children.js +1 -15
- package/es/atom/drag-and-drop/test/fixtures/with-children.js.map +1 -1
- package/es/atom/drag-and-drop/test/fixtures/with-image.js +0 -1
- package/es/atom/drag-and-drop/test/fixtures/with-image.js.map +1 -1
- package/es/atom/drag-and-drop/test/fixtures/{withLongDescription.js → with-long-description.js} +1 -1
- package/es/atom/drag-and-drop/test/fixtures/with-long-description.js.map +1 -0
- package/es/atom/drag-and-drop/test/fixtures/with-video.js +0 -1
- package/es/atom/drag-and-drop/test/fixtures/with-video.js.map +1 -1
- package/es/atom/drag-and-drop/test/fixtures.js +4 -2
- package/es/atom/drag-and-drop/test/fixtures.js.map +1 -1
- package/es/atom/image-upload/test/fixtures/clean-modified.js.map +1 -1
- package/es/atom/image-upload/test/fixtures/desktop.js +1 -2
- package/es/atom/image-upload/test/fixtures/desktop.js.map +1 -1
- package/es/atom/image-upload/test/fixtures/mobile.js +1 -2
- package/es/atom/image-upload/test/fixtures/mobile.js.map +1 -1
- package/es/atom/input-text/style.css +1 -1
- package/es/atom/input-text-with-title/index.js +4 -2
- package/es/atom/input-text-with-title/index.js.map +1 -1
- package/es/atom/input-text-with-title/style.css +6 -2
- package/es/atom/input-text-with-title/test/fixtures/error.js +3 -1
- package/es/atom/input-text-with-title/test/fixtures/error.js.map +1 -1
- package/es/atom/select/index.js +4 -1
- package/es/atom/select/index.js.map +1 -1
- package/es/molecule/brand-form-group/index.js.map +1 -1
- package/es/molecule/brand-form-group/style.css +1 -1
- package/es/molecule/course-sections/style.css +1 -1
- package/es/molecule/drag-and-drop-wrapper/index.js +39 -0
- package/es/molecule/drag-and-drop-wrapper/index.js.map +1 -0
- package/es/molecule/drag-and-drop-wrapper/style.css +15 -0
- package/es/molecule/drag-and-drop-wrapper/test/fixtures/default.js +9 -0
- package/es/molecule/drag-and-drop-wrapper/test/fixtures/default.js.map +1 -0
- package/es/molecule/drag-and-drop-wrapper/test/fixtures/two-drag-and-drops.js +10 -0
- package/es/molecule/drag-and-drop-wrapper/test/fixtures/two-drag-and-drops.js.map +1 -0
- package/es/molecule/drag-and-drop-wrapper/test/fixtures.js +15 -0
- package/es/molecule/drag-and-drop-wrapper/test/fixtures.js.map +1 -0
- package/es/molecule/setup-slide/index.js.map +1 -1
- package/es/molecule/setup-slide/style.css +1 -1
- package/es/molecule/setup-slide/test/fixtures/without-upload-image.js +41 -0
- package/es/molecule/setup-slide/test/fixtures/without-upload-image.js.map +1 -0
- package/es/molecule/setup-slide/test/fixtures.js +2 -0
- package/es/molecule/setup-slide/test/fixtures.js.map +1 -1
- package/es/molecule/setup-slider/test/fixtures/default.js +8 -4
- package/es/molecule/setup-slider/test/fixtures/default.js.map +1 -1
- package/es/organism/brand-form/test/fixtures/lms.js +14 -0
- package/es/organism/brand-form/test/fixtures/lms.js.map +1 -1
- package/es/organism/course-selection/test/fixtures/loading.js.map +1 -1
- package/es/organism/search-and-chips-results/test/fixtures/loading.js.map +1 -1
- package/es/template/back-office/brand-update/index.js.map +1 -1
- package/es/template/back-office/brand-update/test/fixtures.js +0 -2
- package/es/template/back-office/brand-update/test/fixtures.js.map +1 -1
- package/lib/atom/drag-and-drop/index.js +10 -12
- package/lib/atom/drag-and-drop/index.js.map +1 -1
- package/lib/atom/drag-and-drop/style.css +10 -25
- package/lib/atom/drag-and-drop/test/dragging.js +8 -1
- package/lib/atom/drag-and-drop/test/dragging.js.map +1 -1
- package/lib/atom/drag-and-drop/test/fixtures/clean-and-modified.js +21 -0
- package/lib/atom/drag-and-drop/test/fixtures/clean-and-modified.js.map +1 -0
- package/lib/atom/drag-and-drop/test/fixtures/default.js +0 -1
- package/lib/atom/drag-and-drop/test/fixtures/default.js.map +1 -1
- package/lib/atom/drag-and-drop/test/fixtures/error.js.map +1 -1
- package/lib/atom/drag-and-drop/test/fixtures/loading.js +1 -2
- package/lib/atom/drag-and-drop/test/fixtures/loading.js.map +1 -1
- package/lib/atom/drag-and-drop/test/fixtures/modified.js.map +1 -1
- package/lib/atom/drag-and-drop/test/fixtures/with-children.js +1 -20
- package/lib/atom/drag-and-drop/test/fixtures/with-children.js.map +1 -1
- package/lib/atom/drag-and-drop/test/fixtures/with-image.js +0 -1
- package/lib/atom/drag-and-drop/test/fixtures/with-image.js.map +1 -1
- package/lib/atom/drag-and-drop/test/fixtures/{withLongDescription.js → with-long-description.js} +1 -1
- package/lib/atom/drag-and-drop/test/fixtures/with-long-description.js.map +1 -0
- package/lib/atom/drag-and-drop/test/fixtures/with-video.js +0 -1
- package/lib/atom/drag-and-drop/test/fixtures/with-video.js.map +1 -1
- package/lib/atom/drag-and-drop/test/fixtures.js +6 -3
- package/lib/atom/drag-and-drop/test/fixtures.js.map +1 -1
- package/lib/atom/image-upload/test/fixtures/clean-modified.js.map +1 -1
- package/lib/atom/image-upload/test/fixtures/desktop.js +1 -2
- package/lib/atom/image-upload/test/fixtures/desktop.js.map +1 -1
- package/lib/atom/image-upload/test/fixtures/mobile.js +1 -2
- package/lib/atom/image-upload/test/fixtures/mobile.js.map +1 -1
- package/lib/atom/input-text/style.css +1 -1
- package/lib/atom/input-text-with-title/index.js +4 -2
- package/lib/atom/input-text-with-title/index.js.map +1 -1
- package/lib/atom/input-text-with-title/style.css +6 -2
- package/lib/atom/input-text-with-title/test/fixtures/error.js +3 -1
- package/lib/atom/input-text-with-title/test/fixtures/error.js.map +1 -1
- package/lib/atom/select/index.js +4 -1
- package/lib/atom/select/index.js.map +1 -1
- package/lib/molecule/brand-form-group/index.js.map +1 -1
- package/lib/molecule/brand-form-group/style.css +1 -1
- package/lib/molecule/course-sections/style.css +1 -1
- package/lib/molecule/drag-and-drop-wrapper/index.js +49 -0
- package/lib/molecule/drag-and-drop-wrapper/index.js.map +1 -0
- package/lib/molecule/drag-and-drop-wrapper/style.css +15 -0
- package/lib/molecule/drag-and-drop-wrapper/test/fixtures/default.js +19 -0
- package/lib/molecule/drag-and-drop-wrapper/test/fixtures/default.js.map +1 -0
- package/lib/molecule/drag-and-drop-wrapper/test/fixtures/two-drag-and-drops.js +21 -0
- package/lib/molecule/drag-and-drop-wrapper/test/fixtures/two-drag-and-drops.js.map +1 -0
- package/lib/molecule/drag-and-drop-wrapper/test/fixtures.js +25 -0
- package/lib/molecule/drag-and-drop-wrapper/test/fixtures.js.map +1 -0
- package/lib/molecule/setup-slide/index.js.map +1 -1
- package/lib/molecule/setup-slide/style.css +1 -1
- package/lib/molecule/setup-slide/test/fixtures/without-upload-image.js +46 -0
- package/lib/molecule/setup-slide/test/fixtures/without-upload-image.js.map +1 -0
- package/lib/molecule/setup-slide/test/fixtures.js +3 -0
- package/lib/molecule/setup-slide/test/fixtures.js.map +1 -1
- package/lib/molecule/setup-slider/test/fixtures/default.js +7 -2
- package/lib/molecule/setup-slider/test/fixtures/default.js.map +1 -1
- package/lib/organism/brand-form/test/fixtures/lms.js +14 -0
- package/lib/organism/brand-form/test/fixtures/lms.js.map +1 -1
- package/lib/organism/course-selection/test/fixtures/loading.js.map +1 -1
- package/lib/organism/search-and-chips-results/test/fixtures/loading.js.map +1 -1
- package/lib/template/back-office/brand-update/index.js.map +1 -1
- package/lib/template/back-office/brand-update/test/fixtures.js +0 -3
- package/lib/template/back-office/brand-update/test/fixtures.js.map +1 -1
- package/package.json +2 -2
- package/es/atom/drag-and-drop/test/fixtures/withLongDescription.js.map +0 -1
- package/lib/atom/drag-and-drop/test/fixtures/withLongDescription.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/atom/drag-and-drop/test/fixtures/with-long-description.js"],"names":["props","defaultProps","description"],"mappings":";;;;;AAAA;;;;;;AAEA,MAAM;AAACA,EAAAA;AAAD,IAAUC,iBAAhB;eACe;AACbD,EAAAA,KAAK,wBACAA,KADA;AAEHE,IAAAA,WAAW,EACT;AAHC;AADQ,C","sourcesContent":["import defaultProps from './default';\n\nconst {props} = defaultProps;\nexport default {\n props: {\n ...props,\n description:\n 'Max file size: 5MO. Recommended format: SVG (if your client uses a majority of IE, use PNG format instead). Recommended aspect ratio : horizontal 2:1 (e.g. 500px x 250px). Maximum recommended aspect ratio 1:1 (e.g. 500x500, which means that it should not be taller than its width).'\n }\n};\n"],"file":"with-long-description.js"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/atom/drag-and-drop/test/fixtures/with-video.js"],"names":["props","
|
|
1
|
+
{"version":3,"sources":["../../../../../src/atom/drag-and-drop/test/fixtures/with-video.js"],"names":["props","title","description","uploadLabel","previewLabel","previewContent","type","src","onReset","console","log"],"mappings":";;;;eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,KAAK,EAAE,aADF;AAELC,IAAAA,WAAW,EAAE,sCAFR;AAGLC,IAAAA,WAAW,EAAE,QAHR;AAILC,IAAAA,YAAY,EAAE,cAJT;AAKLC,IAAAA,cAAc,EAAE;AACdC,MAAAA,IAAI,EAAE,OADQ;AAEdC,MAAAA,GAAG,EAAE;AAFS,KALX;AASLC,IAAAA,OAAO,EAAE,MAAMC,OAAO,CAACC,GAAR,CAAY,OAAZ;AATV;AADM,C","sourcesContent":["export default {\n props: {\n title: 'Drag & Drop',\n description: 'Drag and drop component with a video',\n uploadLabel: 'Upload',\n previewLabel: 'File Preview',\n previewContent: {\n type: 'video',\n src: 'https://www.w3schools.com/tags/movie.mp4'\n },\n onReset: () => console.log('reset')\n }\n};\n"],"file":"with-video.js"}
|
|
@@ -8,6 +8,8 @@ var _renderComponent = _interopRequireDefault(require("../../../test/helpers/ren
|
|
|
8
8
|
|
|
9
9
|
var _ = _interopRequireDefault(require(".."));
|
|
10
10
|
|
|
11
|
+
var _cleanAndModified = _interopRequireDefault(require("./fixtures/clean-and-modified"));
|
|
12
|
+
|
|
11
13
|
var _default = _interopRequireDefault(require("./fixtures/default"));
|
|
12
14
|
|
|
13
15
|
var _error = _interopRequireDefault(require("./fixtures/error"));
|
|
@@ -22,9 +24,9 @@ var _withImageReset = _interopRequireDefault(require("./fixtures/with-image-rese
|
|
|
22
24
|
|
|
23
25
|
var _withImage = _interopRequireDefault(require("./fixtures/with-image"));
|
|
24
26
|
|
|
25
|
-
var
|
|
27
|
+
var _withLongDescription = _interopRequireDefault(require("./fixtures/with-long-description"));
|
|
26
28
|
|
|
27
|
-
var
|
|
29
|
+
var _withVideo = _interopRequireDefault(require("./fixtures/with-video"));
|
|
28
30
|
|
|
29
31
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
30
32
|
|
|
@@ -34,6 +36,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
34
36
|
t.not(value, undefined, `PropType for "Atom.AtomDragAndDrop.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
|
|
35
37
|
});
|
|
36
38
|
});
|
|
39
|
+
(0, _ava.default)('Atom › AtomDragAndDrop › CleanAndModified › should be rendered', _renderComponent.default, _.default, _cleanAndModified.default);
|
|
37
40
|
(0, _ava.default)('Atom › AtomDragAndDrop › Default › should be rendered', _renderComponent.default, _.default, _default.default);
|
|
38
41
|
(0, _ava.default)('Atom › AtomDragAndDrop › Error › should be rendered', _renderComponent.default, _.default, _error.default);
|
|
39
42
|
(0, _ava.default)('Atom › AtomDragAndDrop › Loading › should be rendered', _renderComponent.default, _.default, _loading.default);
|
|
@@ -41,6 +44,6 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
41
44
|
(0, _ava.default)('Atom › AtomDragAndDrop › WithChildren › should be rendered', _renderComponent.default, _.default, _withChildren.default);
|
|
42
45
|
(0, _ava.default)('Atom › AtomDragAndDrop › WithImageReset › should be rendered', _renderComponent.default, _.default, _withImageReset.default);
|
|
43
46
|
(0, _ava.default)('Atom › AtomDragAndDrop › WithImage › should be rendered', _renderComponent.default, _.default, _withImage.default);
|
|
44
|
-
(0, _ava.default)('Atom › AtomDragAndDrop › WithVideo › should be rendered', _renderComponent.default, _.default, _withVideo.default);
|
|
45
47
|
(0, _ava.default)('Atom › AtomDragAndDrop › WithLongDescription › should be rendered', _renderComponent.default, _.default, _withLongDescription.default);
|
|
48
|
+
(0, _ava.default)('Atom › AtomDragAndDrop › WithVideo › should be rendered', _renderComponent.default, _.default, _withVideo.default);
|
|
46
49
|
//# sourceMappingURL=fixtures.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/atom/drag-and-drop/test/fixtures.js"],"names":["t","pass","AtomDragAndDrop","propTypes","value","key","not","undefined","renderComponentMacro","fixtureDefault","fixtureError","fixtureLoading","fixtureModified","fixtureWithChildren","fixtureWithImageReset","fixtureWithImage","
|
|
1
|
+
{"version":3,"sources":["../../../../src/atom/drag-and-drop/test/fixtures.js"],"names":["t","pass","AtomDragAndDrop","propTypes","value","key","not","undefined","renderComponentMacro","fixtureCleanAndModified","fixtureDefault","fixtureError","fixtureLoading","fixtureModified","fixtureWithChildren","fixtureWithImageReset","fixtureWithImage","fixtureWithLongDescription","fixtureWithVideo"],"mappings":";;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,kBAAK,sDAAL,EAA6DA,CAAC,IAAI;AAChEA,EAAAA,CAAC,CAACC,IAAF;AACA,wBAAQC,UAAgBC,SAAxB,EAAmC,CAACC,KAAD,EAAQC,GAAR,KAAgB;AACjDL,IAAAA,CAAC,CAACM,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,gDAA+CF,GAAI,mEAA5E;AACD,GAFD;AAGD,CALD;AAOA,kBAAK,gEAAL,EAAuEG,wBAAvE,EAA6FN,SAA7F,EAA8GO,yBAA9G;AACA,kBAAK,uDAAL,EAA8DD,wBAA9D,EAAoFN,SAApF,EAAqGQ,gBAArG;AACA,kBAAK,qDAAL,EAA4DF,wBAA5D,EAAkFN,SAAlF,EAAmGS,cAAnG;AACA,kBAAK,uDAAL,EAA8DH,wBAA9D,EAAoFN,SAApF,EAAqGU,gBAArG;AACA,kBAAK,wDAAL,EAA+DJ,wBAA/D,EAAqFN,SAArF,EAAsGW,iBAAtG;AACA,kBAAK,4DAAL,EAAmEL,wBAAnE,EAAyFN,SAAzF,EAA0GY,qBAA1G;AACA,kBAAK,8DAAL,EAAqEN,wBAArE,EAA2FN,SAA3F,EAA4Ga,uBAA5G;AACA,kBAAK,yDAAL,EAAgEP,wBAAhE,EAAsFN,SAAtF,EAAuGc,kBAAvG;AACA,kBAAK,mEAAL,EAA0ER,wBAA1E,EAAgGN,SAAhG,EAAiHe,4BAAjH;AACA,kBAAK,yDAAL,EAAgET,wBAAhE,EAAsFN,SAAtF,EAAuGgB,kBAAvG","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport AtomDragAndDrop from '..';\nimport fixtureCleanAndModified from './fixtures/clean-and-modified';\nimport fixtureDefault from './fixtures/default';\nimport fixtureError from './fixtures/error';\nimport fixtureLoading from './fixtures/loading';\nimport fixtureModified from './fixtures/modified';\nimport fixtureWithChildren from './fixtures/with-children';\nimport fixtureWithImageReset from './fixtures/with-image-reset';\nimport fixtureWithImage from './fixtures/with-image';\nimport fixtureWithLongDescription from './fixtures/with-long-description';\nimport fixtureWithVideo from './fixtures/with-video';\n\ntest('Atom › AtomDragAndDrop > should have valid propTypes', t => {\n t.pass();\n forEach(AtomDragAndDrop.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Atom.AtomDragAndDrop.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Atom › AtomDragAndDrop › CleanAndModified › should be rendered', renderComponentMacro, AtomDragAndDrop, fixtureCleanAndModified);\ntest('Atom › AtomDragAndDrop › Default › should be rendered', renderComponentMacro, AtomDragAndDrop, fixtureDefault);\ntest('Atom › AtomDragAndDrop › Error › should be rendered', renderComponentMacro, AtomDragAndDrop, fixtureError);\ntest('Atom › AtomDragAndDrop › Loading › should be rendered', renderComponentMacro, AtomDragAndDrop, fixtureLoading);\ntest('Atom › AtomDragAndDrop › Modified › should be rendered', renderComponentMacro, AtomDragAndDrop, fixtureModified);\ntest('Atom › AtomDragAndDrop › WithChildren › should be rendered', renderComponentMacro, AtomDragAndDrop, fixtureWithChildren);\ntest('Atom › AtomDragAndDrop › WithImageReset › should be rendered', renderComponentMacro, AtomDragAndDrop, fixtureWithImageReset);\ntest('Atom › AtomDragAndDrop › WithImage › should be rendered', renderComponentMacro, AtomDragAndDrop, fixtureWithImage);\ntest('Atom › AtomDragAndDrop › WithLongDescription › should be rendered', renderComponentMacro, AtomDragAndDrop, fixtureWithLongDescription);\ntest('Atom › AtomDragAndDrop › WithVideo › should be rendered', renderComponentMacro, AtomDragAndDrop, fixtureWithVideo);\n"],"file":"fixtures.js"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/atom/image-upload/test/fixtures/clean-modified.js"],"names":["props","Desktop","previewContent","modified"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"sources":["../../../../../src/atom/image-upload/test/fixtures/clean-modified.js"],"names":["props","Desktop","previewContent","modified"],"mappings":";;;;;AAAA;;;;;;AAEA,MAAM;AAACA,EAAAA;AAAD,IAAUC,gBAAhB;eAEe;AACbD,EAAAA,KAAK,wBACAA,KADA;AAEHE,IAAAA,cAAc,EAAE,EAFb;AAGHC,IAAAA,QAAQ,EAAE;AAHP;AADQ,C","sourcesContent":["import Desktop from './desktop';\n\nconst {props} = Desktop;\n\nexport default {\n props: {\n ...props,\n previewContent: {},\n modified: true\n }\n};\n"],"file":"clean-modified.js"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/atom/image-upload/test/fixtures/desktop.js"],"names":["props","title","uploadLabel","previewLabel","onChange","previewContent","type","src"
|
|
1
|
+
{"version":3,"sources":["../../../../../src/atom/image-upload/test/fixtures/desktop.js"],"names":["props","title","uploadLabel","previewLabel","onChange","previewContent","type","src"],"mappings":";;;;eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,KAAK,EAAE,aADF;AAELC,IAAAA,WAAW,EAAE,QAFR;AAGLC,IAAAA,YAAY,EAAE,SAHT;AAILC,IAAAA,QAAQ,EAAE,MAAM,IAJX;AAKLC,IAAAA,cAAc,EAAE;AACdC,MAAAA,IAAI,EAAE,OADQ;AAEdC,MAAAA,GAAG,EAAE;AAFS;AALX;AADM,C","sourcesContent":["export default {\n props: {\n title: 'Desktop (*)',\n uploadLabel: 'Upload',\n previewLabel: 'Preview',\n onChange: () => true,\n previewContent: {\n type: 'image',\n src: 'https://static.coorpacademy.com/content/up/raw/logo_coorp-1491560495763.svg'\n }\n }\n};\n"],"file":"desktop.js"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/atom/image-upload/test/fixtures/mobile.js"],"names":["props","Desktop","title","description","previewContent","type","src"
|
|
1
|
+
{"version":3,"sources":["../../../../../src/atom/image-upload/test/fixtures/mobile.js"],"names":["props","Desktop","title","description","previewContent","type","src"],"mappings":";;;;;AAAA;;;;;;AAEA,MAAM;AAACA,EAAAA;AAAD,IAAUC,gBAAhB;eAEe;AACbD,EAAAA,KAAK,wBACAA,KADA;AAEHE,IAAAA,KAAK,EAAE,YAFJ;AAGHC,IAAAA,WAAW,EACT,iKAJC;AAKHC,IAAAA,cAAc,EAAE;AACdC,MAAAA,IAAI,EAAE,OADQ;AAEdC,MAAAA,GAAG,EAAE;AAFS;AALb;AADQ,C","sourcesContent":["import Desktop from './desktop';\n\nconst {props} = Desktop;\n\nexport default {\n props: {\n ...props,\n title: 'Mobile (*)',\n description:\n 'Recommended aspect ratio: 1:1 (e.g. 250px x 250px). Maximum accepted aspect ratio: 2:1 (e.g. 500px x 250px. Meaning, no more than twice as large as it is tall)',\n previewContent: {\n type: 'image',\n src: 'https://static.coorpacademy.com/content/up/raw/logo_mobile-1491560713685.svg'\n }\n }\n};\n"],"file":"mobile.js"}
|
|
@@ -22,6 +22,7 @@ const InputTextWithTitle = props => {
|
|
|
22
22
|
'data-name': dataName,
|
|
23
23
|
'aria-label': ariaLabel
|
|
24
24
|
} = props;
|
|
25
|
+
const inputTextClass = inputText.size === 'small' ? _style.default.smallInputText : _style.default.defaultInputText;
|
|
25
26
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
26
27
|
className: _style.default.container,
|
|
27
28
|
"data-name": dataName,
|
|
@@ -29,13 +30,14 @@ const InputTextWithTitle = props => {
|
|
|
29
30
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
30
31
|
className: _style.default.title
|
|
31
32
|
}, title), /*#__PURE__*/_react.default.createElement("div", {
|
|
32
|
-
className:
|
|
33
|
+
className: inputTextClass
|
|
33
34
|
}, /*#__PURE__*/_react.default.createElement(_inputText.default, inputText)));
|
|
34
35
|
};
|
|
35
36
|
|
|
36
37
|
InputTextWithTitle.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
37
38
|
inputText: _propTypes.default.shape(_extends(_extends({}, _inputText.default.propTypes), {}, {
|
|
38
|
-
theme: _propTypes.default.string
|
|
39
|
+
theme: _propTypes.default.string,
|
|
40
|
+
size: _propTypes.default.string
|
|
39
41
|
})),
|
|
40
42
|
title: _propTypes.default.string,
|
|
41
43
|
'aria-label': _propTypes.default.string,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/atom/input-text-with-title/index.js"],"names":["InputTextWithTitle","props","inputText","title","dataName","ariaLabel","style","container","propTypes","PropTypes","shape","InputText","theme","string"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;;;;;AAEA,MAAMA,kBAAkB,GAAGC,KAAK,IAAI;AAClC,QAAM;AAACC,IAAAA,SAAD;AAAYC,IAAAA,KAAZ;AAAmB,iBAAaC,QAAhC;AAA0C,kBAAcC;AAAxD,MAAqEJ,KAA3E;AAEA,sBACE;AAAK,IAAA,SAAS,
|
|
1
|
+
{"version":3,"sources":["../../../src/atom/input-text-with-title/index.js"],"names":["InputTextWithTitle","props","inputText","title","dataName","ariaLabel","inputTextClass","size","style","smallInputText","defaultInputText","container","propTypes","PropTypes","shape","InputText","theme","string"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;;;;;AAEA,MAAMA,kBAAkB,GAAGC,KAAK,IAAI;AAClC,QAAM;AAACC,IAAAA,SAAD;AAAYC,IAAAA,KAAZ;AAAmB,iBAAaC,QAAhC;AAA0C,kBAAcC;AAAxD,MAAqEJ,KAA3E;AACA,QAAMK,cAAc,GAAGJ,SAAS,CAACK,IAAV,KAAmB,OAAnB,GAA6BC,eAAMC,cAAnC,GAAoDD,eAAME,gBAAjF;AAEA,sBACE;AAAK,IAAA,SAAS,EAAEF,eAAMG,SAAtB;AAAiC,iBAAWP,QAA5C;AAAsD,kBAAYC;AAAlE,kBACE;AAAM,IAAA,SAAS,EAAEG,eAAML;AAAvB,KAA+BA,KAA/B,CADF,eAEE;AAAK,IAAA,SAAS,EAAEG;AAAhB,kBACE,6BAAC,kBAAD,EAAeJ,SAAf,CADF,CAFF,CADF;AAQD,CAZD;;AAcAF,kBAAkB,CAACY,SAAnB,2CAA+B;AAC7BV,EAAAA,SAAS,EAAEW,mBAAUC,KAAV,uBACNC,mBAAUH,SADJ;AAETI,IAAAA,KAAK,EAAEH,mBAAUI,MAFR;AAGTV,IAAAA,IAAI,EAAEM,mBAAUI;AAHP,KADkB;AAM7Bd,EAAAA,KAAK,EAAEU,mBAAUI,MANY;AAO7B,gBAAcJ,mBAAUI,MAPK;AAQ7B,eAAaJ,mBAAUI;AARM,CAA/B;eAUejB,kB","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport InputText from '../input-text';\nimport style from './style.css';\n\nconst InputTextWithTitle = props => {\n const {inputText, title, 'data-name': dataName, 'aria-label': ariaLabel} = props;\n const inputTextClass = inputText.size === 'small' ? style.smallInputText : style.defaultInputText;\n\n return (\n <div className={style.container} data-name={dataName} aria-label={ariaLabel}>\n <span className={style.title}>{title}</span>\n <div className={inputTextClass}>\n <InputText {...inputText} />\n </div>\n </div>\n );\n};\n\nInputTextWithTitle.propTypes = {\n inputText: PropTypes.shape({\n ...InputText.propTypes,\n theme: PropTypes.string,\n size: PropTypes.string\n }),\n title: PropTypes.string,\n 'aria-label': PropTypes.string,\n 'data-name': PropTypes.string\n};\nexport default InputTextWithTitle;\n"],"file":"index.js"}
|
|
@@ -13,8 +13,10 @@ var _default = {
|
|
|
13
13
|
props: {
|
|
14
14
|
title: 'Mandatory courses to complete certification',
|
|
15
15
|
inputText: _extends(_extends({}, _cmDefault.default.props), {}, {
|
|
16
|
+
title: 'Amount (6 items max)',
|
|
16
17
|
error: 'this is error',
|
|
17
|
-
hint: ''
|
|
18
|
+
hint: '',
|
|
19
|
+
size: 'small'
|
|
18
20
|
})
|
|
19
21
|
}
|
|
20
22
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/atom/input-text-with-title/test/fixtures/error.js"],"names":["props","title","inputText","error","hint"],"mappings":";;;;;AAAA;;;;;;eAEe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,KAAK,EAAE,6CADF;AAELC,IAAAA,SAAS,
|
|
1
|
+
{"version":3,"sources":["../../../../../src/atom/input-text-with-title/test/fixtures/error.js"],"names":["props","title","inputText","error","hint","size"],"mappings":";;;;;AAAA;;;;;;eAEe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,KAAK,EAAE,6CADF;AAELC,IAAAA,SAAS,wBACJA,mBAAUF,KADN;AAEPC,MAAAA,KAAK,EAAE,sBAFA;AAGPE,MAAAA,KAAK,EAAE,eAHA;AAIPC,MAAAA,IAAI,EAAE,EAJC;AAKPC,MAAAA,IAAI,EAAE;AALC;AAFJ;AADM,C","sourcesContent":["import inputText from '../../../input-text/test/fixtures/cm-default';\n\nexport default {\n props: {\n title: 'Mandatory courses to complete certification',\n inputText: {\n ...inputText.props,\n title: 'Amount (6 items max)',\n error: 'this is error',\n hint: '',\n size: 'small'\n }\n }\n};\n"],"file":"error.js"}
|
package/lib/atom/select/index.js
CHANGED
|
@@ -125,7 +125,10 @@ const Select = (props, context) => {
|
|
|
125
125
|
className: _style.default.selectWrapper
|
|
126
126
|
}, titleView, /*#__PURE__*/_react.default.createElement("span", {
|
|
127
127
|
"data-name": "select-span",
|
|
128
|
-
className: (0, _classnames.default)(_style.default.selectSpan, (0, _includes.default)(theme, ['player', 'invalid', 'question', 'thematiques', 'template']) ? _style.default.noLabelCommon : null, borderClassName, isLongLabel ? _style.default.longLabel : null)
|
|
128
|
+
className: (0, _classnames.default)(_style.default.selectSpan, (0, _includes.default)(theme, ['player', 'invalid', 'question', 'thematiques', 'template']) ? _style.default.noLabelCommon : null, borderClassName, isLongLabel ? _style.default.longLabel : null),
|
|
129
|
+
style: _extends({}, shouldUseSkinFontColor && {
|
|
130
|
+
color
|
|
131
|
+
})
|
|
129
132
|
}, selectedLabel), arrowView, /*#__PURE__*/_react.default.createElement("select", {
|
|
130
133
|
"data-name": "native-select",
|
|
131
134
|
className: _style.default.selectBox,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/atom/select/index.js"],"names":["themeStyle","filter","style","invalid","header","mooc","question","sort","thematiques","player","template","coorpmanager","Select","props","context","name","options","className","borderClassName","onChange","multiple","disabled","required","description","theme","modified","error","title","propTitle","skin","optionList","map","option","index","value","selectOption","titleView","selected","selectedLabel","isSelectedInValidOption","validOption","handleChange","e","target","selectedOptions","black","color","shouldUseSkinFontColor","arrowColor","undefined","arrowView","selectedArrow","arrow","behaviourClassName","default","composedClassName","unselected","labelSize","isLongLabel","selectWrapper","selectSpan","noLabelCommon","longLabel","selectBox","SelectOptionPropTypes","PropTypes","string","isRequired","oneOfType","number","bool","contextTypes","Provider","childContextTypes","propTypes","func","oneOf","arrayOf","shape"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,UAAU,GAAG;AACjBC,EAAAA,MAAM,EAAEC,eAAMD,MADG;AAEjBE,EAAAA,OAAO,EAAED,eAAMC,OAFE;AAGjBC,EAAAA,MAAM,EAAEF,eAAME,MAHG;AAIjBC,EAAAA,IAAI,EAAEH,eAAMG,IAJK;AAKjBC,EAAAA,QAAQ,EAAEJ,eAAMI,QALC;AAMjBC,EAAAA,IAAI,EAAEL,eAAMK,IANK;AAOjBC,EAAAA,WAAW,EAAEN,eAAMM,WAPF;AAQjBC,EAAAA,MAAM,EAAEP,eAAMO,MARG;AASjBC,EAAAA,QAAQ,EAAER,eAAMQ,QATC;AAUjBC,EAAAA,YAAY,EAAE;AAVG,CAAnB;;AAaA,MAAMC,MAAM,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;AACjC,QAAM;AACJC,IAAAA,IADI;AAEJC,IAAAA,OAAO,GAAG,EAFN;AAGJC,IAAAA,SAHI;AAIJC,IAAAA,eAJI;AAKJC,IAAAA,QALI;AAMJ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D,SAAP,2CAAmB;AACjB/C,EAAAA,KAAK,EAAEsC,mBAAUC,MADA;AAEjBnD,EAAAA,IAAI,EAAEkD,mBAAUC,MAFC;AAGjBjD,EAAAA,SAAS,EAAEgD,mBAAUC,MAHJ;AAIjBhD,EAAAA,eAAe,EAAE+C,mBAAUC,MAJV;AAKjB7C,EAAAA,QAAQ,EAAE4C,mBAAUK,IALH;AAMjBlD,EAAAA,QAAQ,EAAE6C,mBAAUK,IANH;AAOjB/C,EAAAA,WAAW,EAAE0C,mBAAUC,MAPN;AAQjB5C,EAAAA,QAAQ,EAAE2C,mBAAUK,IARH;AASjBnD,EAAAA,QAAQ,EAAE8C,mBAAUU,IATH;AAUjBnD,EAAAA,KAAK,EAAEyC,mBAAUW,KAAV,CAAgB,mBAAK5E,UAAL,CAAhB,CAVU;AAWjBgB,EAAAA,OAAO,EAAEiD,mBAAUY,OAAV,CAAkBZ,mBAAUa,KAAV,CAAgBd,qBAAhB,CAAlB,CAXQ;AAYjBvC,EAAAA,QAAQ,EAAEwC,mBAAUK,IAZH;AAajB5C,EAAAA,KAAK,EAAEuC,mBAAUK;AAbA,CAAnB;eAgBe1D,M","sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport filter from 'lodash/fp/filter';\nimport find from 'lodash/fp/find';\nimport get from 'lodash/fp/get';\nimport getOr from 'lodash/fp/getOr';\nimport includes from 'lodash/fp/includes';\nimport keys from 'lodash/fp/keys';\nimport map from 'lodash/fp/map';\nimport size from 'lodash/fp/size';\nimport {NovaCompositionNavigationArrowDown as ArrowDown} from '@coorpacademy/nova-icons';\nimport Provider from '../provider';\nimport getClassState from '../../util/get-class-state';\nimport style from './style.css';\n\nconst themeStyle = {\n filter: style.filter,\n invalid: style.invalid,\n header: style.header,\n mooc: style.mooc,\n question: style.question,\n sort: style.sort,\n thematiques: style.thematiques,\n player: style.player,\n template: style.template,\n coorpmanager: null\n};\n\nconst Select = (props, context) => {\n const {\n name,\n options = [],\n className,\n borderClassName,\n onChange,\n multiple = false,\n disabled,\n required,\n description,\n theme,\n modified = false,\n error = false,\n title: propTitle\n } = props;\n\n const {skin} = context;\n\n const title = useMemo(() => (propTitle ? `${propTitle}${required ? '*' : ''}` : null), [\n propTitle,\n required\n ]);\n\n const optionList =\n options &&\n options.map((option, index) => {\n return (\n <option key={index} value={option.value} className={style.selectOption}>\n {option.name}\n </option>\n );\n });\n\n const titleView = title ? <span className={style.title}>{title} </span> : null;\n\n const selected = useMemo(\n () =>\n multiple\n ? map(get('value'), filter({selected: true}, options))\n : get('value', find({selected: true}, options)),\n [multiple, options]\n );\n const selectedLabel = useMemo(\n () =>\n multiple\n ? map(get('name'), filter({selected: true}, options))\n : get('name', find({selected: true}, options)),\n [multiple, options]\n );\n\n const isSelectedInValidOption = useMemo(\n () =>\n theme === 'player' &&\n getOr(false, 'name', find({validOption: false, selected: true}, options)),\n [options, theme]\n );\n\n const handleChange = useMemo(\n () =>\n multiple\n ? e => {\n onChange(map(get('value'), e.target.selectedOptions));\n }\n : e => {\n onChange(e.target.value);\n },\n [onChange, multiple]\n );\n\n const black = useMemo(() => getOr('#14171A', 'common.black', skin), [skin]);\n const color = useMemo(() => getOr('#00B0FF', 'common.primary', skin), [skin]);\n const shouldUseSkinFontColor = useMemo(\n () =>\n !isSelectedInValidOption && selected && includes(theme, ['question', 'template', 'player']),\n [isSelectedInValidOption, selected, theme]\n );\n const arrowColor = selected ? color : undefined;\n\n const arrowView = !multiple ? (\n <ArrowDown\n color={includes(theme, ['question', 'template', 'player']) ? arrowColor : black}\n className={shouldUseSkinFontColor ? style.selectedArrow : style.arrow}\n />\n ) : null;\n const behaviourClassName = useMemo(\n () => getClassState(style.default, style.modified, style.error, modified, error),\n [error, modified]\n );\n const composedClassName = useMemo(\n () =>\n classnames(\n theme && theme !== 'coorpmanager' ? themeStyle[theme] : behaviourClassName,\n selected ? style.selected : style.unselected,\n className\n ),\n [behaviourClassName, className, selected, theme]\n );\n\n const labelSize = useMemo(() => size(selectedLabel), [selectedLabel]);\n\n const isLongLabel = useMemo(() => labelSize >= 65, [labelSize]);\n\n return (\n <div\n className={classnames(\n composedClassName,\n theme === 'coorpmanager' ? style.coorpmanager : null\n )}\n >\n <label\n data-name=\"select-wrapper\"\n style={{\n ...(shouldUseSkinFontColor && {\n color\n })\n }}\n className={style.selectWrapper}\n >\n {titleView}\n <span\n data-name=\"select-span\"\n className={classnames(\n style.selectSpan,\n includes(theme, ['player', 'invalid', 'question', 'thematiques', 'template'])\n ? style.noLabelCommon\n : null,\n borderClassName,\n isLongLabel ? style.longLabel : null\n )}\n >\n {selectedLabel}\n </span>\n {arrowView}\n <select\n data-name=\"native-select\"\n className={style.selectBox}\n title={selectedLabel}\n name={name}\n onChange={handleChange}\n value={selected}\n multiple={multiple}\n disabled={disabled}\n >\n {optionList}\n </select>\n </label>\n <div className={style.description}>{description}</div>\n </div>\n );\n};\n\nexport const SelectOptionPropTypes = {\n name: PropTypes.string.isRequired,\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n selected: PropTypes.bool,\n validOption: PropTypes.bool\n};\n\nSelect.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nSelect.propTypes = {\n title: PropTypes.string,\n name: PropTypes.string,\n className: PropTypes.string,\n borderClassName: PropTypes.string,\n disabled: PropTypes.bool,\n multiple: PropTypes.bool,\n description: PropTypes.string,\n required: PropTypes.bool,\n onChange: PropTypes.func,\n theme: PropTypes.oneOf(keys(themeStyle)),\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes)),\n modified: PropTypes.bool,\n error: PropTypes.bool\n};\n\nexport default Select;\n"],"file":"index.js"}
|
|
1
|
+
{"version":3,"sources":["../../../src/atom/select/index.js"],"names":["themeStyle","filter","style","invalid","header","mooc","question","sort","thematiques","player","template","coorpmanager","Select","props","context","name","options","className","borderClassName","onChange","multiple","disabled","required","description","theme","modified","error","title","propTitle","skin","optionList","map","option","index","value","selectOption","titleView","selected","selectedLabel","isSelectedInValidOption","validOption","handleChange","e","target","selectedOptions","black","color","shouldUseSkinFontColor","arrowColor","undefined","arrowView","selectedArrow","arrow","behaviourClassName","default","composedClassName","unselected","labelSize","isLongLabel","selectWrapper","selectSpan","noLabelCommon","longLabel","selectBox","SelectOptionPropTypes","PropTypes","string","isRequired","oneOfType","number","bool","contextTypes","Provider","childContextTypes","propTypes","func","oneOf","arrayOf","shape"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,UAAU,GAAG;AACjBC,EAAAA,MAAM,EAAEC,eAAMD,MADG;AAEjBE,EAAAA,OAAO,EAAED,eAAMC,OAFE;AAGjBC,EAAAA,MAAM,EAAEF,eAAME,MAHG;AAIjBC,EAAAA,IAAI,EAAEH,eAAMG,IAJK;AAKjBC,EAAAA,QAAQ,EAAEJ,eAAMI,QALC;AAMjBC,EAAAA,IAAI,EAAEL,eAAMK,IANK;AAOjBC,EAAAA,WAAW,EAAEN,eAAMM,WAPF;AAQjBC,EAAAA,MAAM,EAAEP,eAAMO,MARG;AASjBC,EAAAA,QAAQ,EAAER,eAAMQ,QATC;AAUjBC,EAAAA,YAAY,EAAE;AAVG,CAAnB;;AAaA,MAAMC,MAAM,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;AACjC,QAAM;AACJC,IAAAA,IADI;AAEJC,IAAAA,OAAO,GAAG,EAFN;AAGJC,IAAAA,SAHI;AAIJC,IAAAA,eAJI;AAKJC,IAAAA,QALI;AAMJC,IAAAA,QAAQ,GAAG,KANP;AAOJC,IAAAA,QAPI;AAQJC,IAAAA,QARI;AASJC,IAAAA,WATI;AAUJC,IAAAA,KAVI;AAWJC,IAAAA,QAAQ,GAAG,KAXP;AAYJC,IAAAA,KAAK,GAAG,KAZJ;AAaJC,IAAAA,KAAK,EAAEC;AAbH,MAcFf,KAdJ;AAgBA,QA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IjBhD,EAAAA,eAAe,EAAE+C,mBAAUC,MAJV;AAKjB7C,EAAAA,QAAQ,EAAE4C,mBAAUK,IALH;AAMjBlD,EAAAA,QAAQ,EAAE6C,mBAAUK,IANH;AAOjB/C,EAAAA,WAAW,EAAE0C,mBAAUC,MAPN;AAQjB5C,EAAAA,QAAQ,EAAE2C,mBAAUK,IARH;AASjBnD,EAAAA,QAAQ,EAAE8C,mBAAUU,IATH;AAUjBnD,EAAAA,KAAK,EAAEyC,mBAAUW,KAAV,CAAgB,mBAAK5E,UAAL,CAAhB,CAVU;AAWjBgB,EAAAA,OAAO,EAAEiD,mBAAUY,OAAV,CAAkBZ,mBAAUa,KAAV,CAAgBd,qBAAhB,CAAlB,CAXQ;AAYjBvC,EAAAA,QAAQ,EAAEwC,mBAAUK,IAZH;AAajB5C,EAAAA,KAAK,EAAEuC,mBAAUK;AAbA,CAAnB;eAgBe1D,M","sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport filter from 'lodash/fp/filter';\nimport find from 'lodash/fp/find';\nimport get from 'lodash/fp/get';\nimport getOr from 'lodash/fp/getOr';\nimport includes from 'lodash/fp/includes';\nimport keys from 'lodash/fp/keys';\nimport map from 'lodash/fp/map';\nimport size from 'lodash/fp/size';\nimport {NovaCompositionNavigationArrowDown as ArrowDown} from '@coorpacademy/nova-icons';\nimport Provider from '../provider';\nimport getClassState from '../../util/get-class-state';\nimport style from './style.css';\n\nconst themeStyle = {\n filter: style.filter,\n invalid: style.invalid,\n header: style.header,\n mooc: style.mooc,\n question: style.question,\n sort: style.sort,\n thematiques: style.thematiques,\n player: style.player,\n template: style.template,\n coorpmanager: null\n};\n\nconst Select = (props, context) => {\n const {\n name,\n options = [],\n className,\n borderClassName,\n onChange,\n multiple = false,\n disabled,\n required,\n description,\n theme,\n modified = false,\n error = false,\n title: propTitle\n } = props;\n\n const {skin} = context;\n\n const title = useMemo(() => (propTitle ? `${propTitle}${required ? '*' : ''}` : null), [\n propTitle,\n required\n ]);\n\n const optionList =\n options &&\n options.map((option, index) => {\n return (\n <option key={index} value={option.value} className={style.selectOption}>\n {option.name}\n </option>\n );\n });\n\n const titleView = title ? <span className={style.title}>{title} </span> : null;\n\n const selected = useMemo(\n () =>\n multiple\n ? map(get('value'), filter({selected: true}, options))\n : get('value', find({selected: true}, options)),\n [multiple, options]\n );\n const selectedLabel = useMemo(\n () =>\n multiple\n ? map(get('name'), filter({selected: true}, options))\n : get('name', find({selected: true}, options)),\n [multiple, options]\n );\n\n const isSelectedInValidOption = useMemo(\n () =>\n theme === 'player' &&\n getOr(false, 'name', find({validOption: false, selected: true}, options)),\n [options, theme]\n );\n\n const handleChange = useMemo(\n () =>\n multiple\n ? e => {\n onChange(map(get('value'), e.target.selectedOptions));\n }\n : e => {\n onChange(e.target.value);\n },\n [onChange, multiple]\n );\n\n const black = useMemo(() => getOr('#14171A', 'common.black', skin), [skin]);\n const color = useMemo(() => getOr('#00B0FF', 'common.primary', skin), [skin]);\n const shouldUseSkinFontColor = useMemo(\n () =>\n !isSelectedInValidOption && selected && includes(theme, ['question', 'template', 'player']),\n [isSelectedInValidOption, selected, theme]\n );\n const arrowColor = selected ? color : undefined;\n\n const arrowView = !multiple ? (\n <ArrowDown\n color={includes(theme, ['question', 'template', 'player']) ? arrowColor : black}\n className={shouldUseSkinFontColor ? style.selectedArrow : style.arrow}\n />\n ) : null;\n const behaviourClassName = useMemo(\n () => getClassState(style.default, style.modified, style.error, modified, error),\n [error, modified]\n );\n const composedClassName = useMemo(\n () =>\n classnames(\n theme && theme !== 'coorpmanager' ? themeStyle[theme] : behaviourClassName,\n selected ? style.selected : style.unselected,\n className\n ),\n [behaviourClassName, className, selected, theme]\n );\n\n const labelSize = useMemo(() => size(selectedLabel), [selectedLabel]);\n\n const isLongLabel = useMemo(() => labelSize >= 65, [labelSize]);\n\n return (\n <div\n className={classnames(\n composedClassName,\n theme === 'coorpmanager' ? style.coorpmanager : null\n )}\n >\n <label\n data-name=\"select-wrapper\"\n style={{\n ...(shouldUseSkinFontColor && {\n color\n })\n }}\n className={style.selectWrapper}\n >\n {titleView}\n <span\n data-name=\"select-span\"\n className={classnames(\n style.selectSpan,\n includes(theme, ['player', 'invalid', 'question', 'thematiques', 'template'])\n ? style.noLabelCommon\n : null,\n borderClassName,\n isLongLabel ? style.longLabel : null\n )}\n style={{\n ...(shouldUseSkinFontColor && {\n color\n })\n }}\n >\n {selectedLabel}\n </span>\n {arrowView}\n <select\n data-name=\"native-select\"\n className={style.selectBox}\n title={selectedLabel}\n name={name}\n onChange={handleChange}\n value={selected}\n multiple={multiple}\n disabled={disabled}\n >\n {optionList}\n </select>\n </label>\n <div className={style.description}>{description}</div>\n </div>\n );\n};\n\nexport const SelectOptionPropTypes = {\n name: PropTypes.string.isRequired,\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n selected: PropTypes.bool,\n validOption: PropTypes.bool\n};\n\nSelect.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nSelect.propTypes = {\n title: PropTypes.string,\n name: PropTypes.string,\n className: PropTypes.string,\n borderClassName: PropTypes.string,\n disabled: PropTypes.bool,\n multiple: PropTypes.bool,\n description: PropTypes.string,\n required: PropTypes.bool,\n onChange: PropTypes.func,\n theme: PropTypes.oneOf(keys(themeStyle)),\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes)),\n modified: PropTypes.bool,\n error: PropTypes.bool\n};\n\nexport default Select;\n"],"file":"index.js"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/molecule/brand-form-group/index.js"],"names":["inputContainerStyle","default","style","defaultWidth","medium","mediumWidth","large","largeWidth","buildInput","field","type","imageUploadContainer","buildField","index","input","theme","size","styleInput","BrandFormGroup","props","title","subtitle","fieldsLayout","groupLayout","fields","fieldsList","convert","cap","wrapper","groupGrid","titleWrapper","grid","propTypes","PropTypes","string","arrayOf","oneOfType","shape","Autocomplete","oneOf","InputColor","InputReadonly","InputSwitch","InputTextarea","InputHTML","InputDoublestep","Select","InputCheckbox","ImageUpload","SetupSlider","SetupSections","InputText","BrandDownloadBox","BrandUploadBox","Button","SelectMultiple","Roles"],"mappings":";;;;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEA,MAAMA,mBAAmB,GAAG;AAC1BC,EAAAA,OAAO,EAAEC,eAAMC,YADW;AAE1BC,EAAAA,MAAM,EAAEF,eAAMG,WAFY;AAG1BC,EAAAA,KAAK,EAAEJ,eAAMK;AAHa,CAA5B;;AAMA,MAAMC,UAAU,GAAGC,KAAK,IAAI;AAC1B,QAAM;AAACC,IAAAA;AAAD,MAASD,KAAf;;AAEA,UAAQC,IAAR;AACE,SAAK,cAAL;AACE,0BAAO,6BAAC,qBAAD,EAAkBD,KAAlB,CAAP;;AACF,SAAK,OAAL;AACE,0BAAO,6BAAC,mBAAD,EAAgBA,KAAhB,CAAP;;AACF,SAAK,UAAL;AACE,0BAAO,6BAAC,sBAAD,EAAmBA,KAAnB,CAAP;;AACF,SAAK,QAAL;AACE,0BAAO,6BAAC,oBAAD,EAAiBA,KAAjB,CAAP;;AACF,SAAK,UAAL;AACE,0BAAO,6BAAC,sBAAD,EAAmBA,KAAnB,CAAP;;AACF,SAAK,MAAL;AACE,0BAAO,6BAAC,kBAAD,EAAeA,KAAf,CAAP;;AACF,SAAK,YAAL;AACE,0BAAO,6BAAC,wBAAD,EAAqBA,KAArB,CAAP;;AACF,SAAK,QAAL;AACE,0BAAO,6BAAC,eAAD,eAAYA,KAAZ;AAAmB,QAAA,KAAK,EAAE;AAA1B,SAAP;;AACF,SAAK,gBAAL;AACE,0BAAO,6BAAC,uBAAD,EAAoBA,KAApB,CAAP;;AACF,SAAK,UAAL;AACE,0BAAO,6BAAC,sBAAD,EAAmBA,KAAn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AApB,CADM;AALiB,CAA3B;eAuFed,c","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {keys, map, snakeCase} from 'lodash/fp';\nimport classNames from 'classnames';\nimport Autocomplete from '../../atom/autocomplete';\nimport Select from '../../atom/select';\nimport SelectMultiple from '../select-multiple';\nimport InputText from '../../atom/input-text';\nimport InputColor from '../../atom/input-color';\nimport InputCheckbox from '../../atom/input-checkbox';\nimport InputReadonly from '../../atom/input-readonly';\nimport InputSwitch from '../../atom/input-switch';\nimport BrandUploadBox from '../brand-upload-box';\nimport BrandDownloadBox from '../brand-download-box';\nimport Button from '../../atom/button';\nimport InputTextarea from '../../atom/input-textarea';\nimport InputHTML from '../../atom/input-html';\nimport InputDoublestep from '../../atom/input-doublestep';\nimport ImageUpload from '../../atom/image-upload';\nimport SetupSlider from '../setup-slider';\nimport SetupSections from '../setup-sections';\nimport Title from '../../atom/title';\nimport Roles from '../coorp-manager-roles';\nimport style from './style.css';\n\nconst inputContainerStyle = {\n default: style.defaultWidth,\n medium: style.mediumWidth,\n large: style.largeWidth\n};\n\nconst buildInput = field => {\n const {type} = field;\n\n switch (type) {\n case 'autoComplete':\n return <Autocomplete {...field} />;\n case 'color':\n return <InputColor {...field} />;\n case 'readonly':\n return <InputReadonly {...field} />;\n case 'switch':\n return <InputSwitch {...field} />;\n case 'textarea':\n return <InputTextarea {...field} />;\n case 'html':\n return <InputHTML {...field} />;\n case 'doublestep':\n return <InputDoublestep {...field} />;\n case 'select':\n return <Select {...field} theme={'coorpmanager'} />;\n case 'selectMultiple':\n return <SelectMultiple {...field} />;\n case 'checkbox':\n return <InputCheckbox {...field} />;\n case 'image':\n return <div className={style.imageUploadContainer}>\n <ImageUpload {...field} />\n </div>\n case 'slider':\n return <SetupSlider {...field} />;\n case 'sections':\n return <SetupSections {...field} />;\n case 'text':\n return <InputText {...field} />;\n case 'downloadbox':\n return <BrandDownloadBox {...field} />;\n case 'uploadbox':\n return <BrandUploadBox {...field} />;\n case 'button':\n case 'link':\n return <Button {...field} />;\n case 'roles':\n return <Roles {...field} />;\n default:\n return <InputText {...field} />;\n }\n};\n\nconst buildField = (field, index) => {\n const input = buildInput(field);\n const {theme, size = 'default'} = field;\n const styleInput = theme === 'coorpmanager' ? inputContainerStyle[size] : style.field;\n\n return (\n <div className={styleInput} key={index}>\n {input}\n </div>\n );\n};\n\nconst BrandFormGroup = props => {\n const {title, subtitle = '', fieldsLayout = '', groupLayout = '', fields = []} = props;\n const fieldsList = map.convert({cap: false})(buildField, fields);\n\n return (\n <div\n data-name={`brand_form_group_${snakeCase(title)}`}\n className={classNames(style.wrapper, groupLayout === 'grid' && style.groupGrid)}\n >\n <div className={style.titleWrapper}>\n <Title title={title} subtitle={subtitle} type={'form-group'} />\n </div>\n <div className={fieldsLayout === 'grid' ? style.grid : null}>{fieldsList}</div>\n </div>\n );\n};\n\nBrandFormGroup.propTypes = {\n title: PropTypes.string,\n subtitle: PropTypes.string,\n fieldsLayout: PropTypes.string,\n groupLayout: PropTypes.string,\n fields: PropTypes.arrayOf(\n PropTypes.oneOfType([\n PropTypes.shape({\n ...Autocomplete.propTypes,\n type: PropTypes.oneOf(['autoComplete']),\n size: PropTypes.oneOf(keys(inputContainerStyle))\n }),\n PropTypes.shape({\n ...InputColor.propTypes,\n type: PropTypes.oneOf(['color'])\n }),\n PropTypes.shape({\n ...InputReadonly.propTypes,\n type: PropTypes.oneOf(['readonly'])\n }),\n PropTypes.shape({\n ...InputSwitch.propTypes,\n type: PropTypes.oneOf(['switch'])\n }),\n PropTypes.shape({\n ...InputTextarea.propTypes,\n type: PropTypes.oneOf(['textarea']),\n size: PropTypes.oneOf(keys(inputContainerStyle))\n }),\n PropTypes.shape({\n ...InputHTML.propTypes,\n type: PropTypes.oneOf(['html'])\n }),\n PropTypes.shape({\n ...InputDoublestep.propTypes,\n type: PropTypes.oneOf(['doublestep'])\n }),\n PropTypes.shape({\n ...Select.propTypes,\n type: PropTypes.oneOf(['select']),\n size: PropTypes.oneOf(keys(inputContainerStyle))\n }),\n PropTypes.shape({\n ...InputCheckbox.propTypes,\n type: PropTypes.oneOf(['checkbox'])\n }),\n PropTypes.shape({\n ...ImageUpload.propTypes,\n type: PropTypes.oneOf(['image'])\n }),\n PropTypes.shape({\n ...SetupSlider.propTypes,\n type: PropTypes.oneOf(['slider'])\n }),\n PropTypes.shape({\n ...SetupSections.propTypes,\n type: PropTypes.oneOf(['sections'])\n }),\n PropTypes.shape({\n ...InputText.propTypes,\n type: PropTypes.oneOf(['text']),\n size: PropTypes.oneOf(keys(inputContainerStyle))\n }),\n PropTypes.shape({\n ...BrandDownloadBox.propTypes,\n type: PropTypes.oneOf(['downloadbox'])\n }),\n PropTypes.shape({\n ...BrandUploadBox.propTypes,\n type: PropTypes.oneOf(['uploadbox'])\n }),\n PropTypes.shape({\n ...Button.propTypes,\n type: PropTypes.oneOf(['button'])\n }),\n PropTypes.shape({\n ...SelectMultiple.propTypes,\n type: PropTypes.oneOf(['selectMultiple'])\n }),\n PropTypes.shape({\n ...Roles.propTypes,\n type: PropTypes.oneOf(['roles'])\n }),\n PropTypes.shape(InputText.propTypes)\n ])\n )\n};\nexport default BrandFormGroup;\n"],"file":"index.js"}
|
|
1
|
+
{"version":3,"sources":["../../../src/molecule/brand-form-group/index.js"],"names":["inputContainerStyle","default","style","defaultWidth","medium","mediumWidth","large","largeWidth","buildInput","field","type","imageUploadContainer","buildField","index","input","theme","size","styleInput","BrandFormGroup","props","title","subtitle","fieldsLayout","groupLayout","fields","fieldsList","convert","cap","wrapper","groupGrid","titleWrapper","grid","propTypes","PropTypes","string","arrayOf","oneOfType","shape","Autocomplete","oneOf","InputColor","InputReadonly","InputSwitch","InputTextarea","InputHTML","InputDoublestep","Select","InputCheckbox","ImageUpload","SetupSlider","SetupSections","InputText","BrandDownloadBox","BrandUploadBox","Button","SelectMultiple","Roles"],"mappings":";;;;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;A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SADnB;AAEEtB,IAAAA,IAAI,EAAEuB,mBAAUM,KAAV,CAAgB,CAAC,UAAD,CAAhB;AAFR,KAhDkB,EAoDlBN,mBAAUI,KAAV,uBACKc,mBAAUnB,SADf;AAEEtB,IAAAA,IAAI,EAAEuB,mBAAUM,KAAV,CAAgB,CAAC,MAAD,CAAhB,CAFR;AAGEvB,IAAAA,IAAI,EAAEiB,mBAAUM,KAAV,CAAgB,oBAAKvC,mBAAL,CAAhB;AAHR,KApDkB,EAyDlBiC,mBAAUI,KAAV,uBACKe,0BAAiBpB,SADtB;AAEEtB,IAAAA,IAAI,EAAEuB,mBAAUM,KAAV,CAAgB,CAAC,aAAD,CAAhB;AAFR,KAzDkB,EA6DlBN,mBAAUI,KAAV,uBACKgB,wBAAerB,SADpB;AAEEtB,IAAAA,IAAI,EAAEuB,mBAAUM,KAAV,CAAgB,CAAC,WAAD,CAAhB;AAFR,KA7DkB,EAiElBN,mBAAUI,KAAV,uBACKiB,gBAAOtB,SADZ;AAEEtB,IAAAA,IAAI,EAAEuB,mBAAUM,KAAV,CAAgB,CAAC,QAAD,CAAhB;AAFR,KAjEkB,EAqElBN,mBAAUI,KAAV,uBACKkB,wBAAevB,SADpB;AAEEtB,IAAAA,IAAI,EAAEuB,mBAAUM,KAAV,CAAgB,CAAC,gBAAD,CAAhB;AAFR,KArEkB,EAyElBN,mBAAUI,KAAV,uBACKmB,2BAAMxB,SADX;AAEEtB,IAAAA,IAAI,EAAEuB,mBAAUM,KAAV,CAAgB,CAAC,OAAD,CAAhB;AAFR,KAzEkB,EA6ElBN,mBAAUI,KAAV,CAAgBc,mBAAUnB,SAA1B,CA7EkB,CAApB,CADM;AALiB,CAA3B;eAuFed,c","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {keys, map, snakeCase} from 'lodash/fp';\nimport classNames from 'classnames';\nimport Autocomplete from '../../atom/autocomplete';\nimport Select from '../../atom/select';\nimport SelectMultiple from '../select-multiple';\nimport InputText from '../../atom/input-text';\nimport InputColor from '../../atom/input-color';\nimport InputCheckbox from '../../atom/input-checkbox';\nimport InputReadonly from '../../atom/input-readonly';\nimport InputSwitch from '../../atom/input-switch';\nimport BrandUploadBox from '../brand-upload-box';\nimport BrandDownloadBox from '../brand-download-box';\nimport Button from '../../atom/button';\nimport InputTextarea from '../../atom/input-textarea';\nimport InputHTML from '../../atom/input-html';\nimport InputDoublestep from '../../atom/input-doublestep';\nimport ImageUpload from '../../atom/image-upload';\nimport SetupSlider from '../setup-slider';\nimport SetupSections from '../setup-sections';\nimport Title from '../../atom/title';\nimport Roles from '../coorp-manager-roles';\nimport style from './style.css';\n\nconst inputContainerStyle = {\n default: style.defaultWidth,\n medium: style.mediumWidth,\n large: style.largeWidth\n};\n\nconst buildInput = field => {\n const {type} = field;\n\n switch (type) {\n case 'autoComplete':\n return <Autocomplete {...field} />;\n case 'color':\n return <InputColor {...field} />;\n case 'readonly':\n return <InputReadonly {...field} />;\n case 'switch':\n return <InputSwitch {...field} />;\n case 'textarea':\n return <InputTextarea {...field} />;\n case 'html':\n return <InputHTML {...field} />;\n case 'doublestep':\n return <InputDoublestep {...field} />;\n case 'select':\n return <Select {...field} theme={'coorpmanager'} />;\n case 'selectMultiple':\n return <SelectMultiple {...field} />;\n case 'checkbox':\n return <InputCheckbox {...field} />;\n case 'image':\n return (\n <div className={style.imageUploadContainer}>\n <ImageUpload {...field} />\n </div>\n );\n case 'slider':\n return <SetupSlider {...field} />;\n case 'sections':\n return <SetupSections {...field} />;\n case 'text':\n return <InputText {...field} />;\n case 'downloadbox':\n return <BrandDownloadBox {...field} />;\n case 'uploadbox':\n return <BrandUploadBox {...field} />;\n case 'button':\n case 'link':\n return <Button {...field} />;\n case 'roles':\n return <Roles {...field} />;\n default:\n return <InputText {...field} />;\n }\n};\n\nconst buildField = (field, index) => {\n const input = buildInput(field);\n const {theme, size = 'default'} = field;\n const styleInput = theme === 'coorpmanager' ? inputContainerStyle[size] : style.field;\n\n return (\n <div className={styleInput} key={index}>\n {input}\n </div>\n );\n};\n\nconst BrandFormGroup = props => {\n const {title, subtitle = '', fieldsLayout = '', groupLayout = '', fields = []} = props;\n const fieldsList = map.convert({cap: false})(buildField, fields);\n\n return (\n <div\n data-name={`brand_form_group_${snakeCase(title)}`}\n className={classNames(style.wrapper, groupLayout === 'grid' && style.groupGrid)}\n >\n <div className={style.titleWrapper}>\n <Title title={title} subtitle={subtitle} type={'form-group'} />\n </div>\n <div className={fieldsLayout === 'grid' ? style.grid : null}>{fieldsList}</div>\n </div>\n );\n};\n\nBrandFormGroup.propTypes = {\n title: PropTypes.string,\n subtitle: PropTypes.string,\n fieldsLayout: PropTypes.string,\n groupLayout: PropTypes.string,\n fields: PropTypes.arrayOf(\n PropTypes.oneOfType([\n PropTypes.shape({\n ...Autocomplete.propTypes,\n type: PropTypes.oneOf(['autoComplete']),\n size: PropTypes.oneOf(keys(inputContainerStyle))\n }),\n PropTypes.shape({\n ...InputColor.propTypes,\n type: PropTypes.oneOf(['color'])\n }),\n PropTypes.shape({\n ...InputReadonly.propTypes,\n type: PropTypes.oneOf(['readonly'])\n }),\n PropTypes.shape({\n ...InputSwitch.propTypes,\n type: PropTypes.oneOf(['switch'])\n }),\n PropTypes.shape({\n ...InputTextarea.propTypes,\n type: PropTypes.oneOf(['textarea']),\n size: PropTypes.oneOf(keys(inputContainerStyle))\n }),\n PropTypes.shape({\n ...InputHTML.propTypes,\n type: PropTypes.oneOf(['html'])\n }),\n PropTypes.shape({\n ...InputDoublestep.propTypes,\n type: PropTypes.oneOf(['doublestep'])\n }),\n PropTypes.shape({\n ...Select.propTypes,\n type: PropTypes.oneOf(['select']),\n size: PropTypes.oneOf(keys(inputContainerStyle))\n }),\n PropTypes.shape({\n ...InputCheckbox.propTypes,\n type: PropTypes.oneOf(['checkbox'])\n }),\n PropTypes.shape({\n ...ImageUpload.propTypes,\n type: PropTypes.oneOf(['image'])\n }),\n PropTypes.shape({\n ...SetupSlider.propTypes,\n type: PropTypes.oneOf(['slider'])\n }),\n PropTypes.shape({\n ...SetupSections.propTypes,\n type: PropTypes.oneOf(['sections'])\n }),\n PropTypes.shape({\n ...InputText.propTypes,\n type: PropTypes.oneOf(['text']),\n size: PropTypes.oneOf(keys(inputContainerStyle))\n }),\n PropTypes.shape({\n ...BrandDownloadBox.propTypes,\n type: PropTypes.oneOf(['downloadbox'])\n }),\n PropTypes.shape({\n ...BrandUploadBox.propTypes,\n type: PropTypes.oneOf(['uploadbox'])\n }),\n PropTypes.shape({\n ...Button.propTypes,\n type: PropTypes.oneOf(['button'])\n }),\n PropTypes.shape({\n ...SelectMultiple.propTypes,\n type: PropTypes.oneOf(['selectMultiple'])\n }),\n PropTypes.shape({\n ...Roles.propTypes,\n type: PropTypes.oneOf(['roles'])\n }),\n PropTypes.shape(InputText.propTypes)\n ])\n )\n};\nexport default BrandFormGroup;\n"],"file":"index.js"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.default = void 0;
|
|
5
|
+
|
|
6
|
+
var _map2 = _interopRequireDefault(require("lodash/fp/map"));
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
+
|
|
12
|
+
var _dragAndDrop = _interopRequireDefault(require("../../atom/drag-and-drop"));
|
|
13
|
+
|
|
14
|
+
var _checkboxWithTitle = _interopRequireDefault(require("../../atom/checkbox-with-title"));
|
|
15
|
+
|
|
16
|
+
var _style = _interopRequireDefault(require("./style.css"));
|
|
17
|
+
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
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 DragAndDropWrapper = props => {
|
|
23
|
+
const {
|
|
24
|
+
list = [],
|
|
25
|
+
checkBoxTitle,
|
|
26
|
+
'data-name': dataName
|
|
27
|
+
} = props;
|
|
28
|
+
const dragAndDropList = (0, _map2.default)(dragAndDropProps => {
|
|
29
|
+
return /*#__PURE__*/_react.default.createElement("li", {
|
|
30
|
+
className: _style.default.dragAndDrop,
|
|
31
|
+
key: `dragAndDrop-${dragAndDropProps.title}`
|
|
32
|
+
}, /*#__PURE__*/_react.default.createElement(_dragAndDrop.default, dragAndDropProps));
|
|
33
|
+
}, list);
|
|
34
|
+
return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("div", {
|
|
35
|
+
className: _style.default.title
|
|
36
|
+
}, /*#__PURE__*/_react.default.createElement(_checkboxWithTitle.default, checkBoxTitle)), /*#__PURE__*/_react.default.createElement("ul", {
|
|
37
|
+
className: _style.default.group,
|
|
38
|
+
"data-name": dataName
|
|
39
|
+
}, dragAndDropList));
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
DragAndDropWrapper.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
43
|
+
list: _propTypes.default.arrayOf(_propTypes.default.shape(_dragAndDrop.default.propTypes)),
|
|
44
|
+
checkBoxTitle: _propTypes.default.shape(_extends({}, _checkboxWithTitle.default.propTypes)),
|
|
45
|
+
'data-name': _propTypes.default.string
|
|
46
|
+
} : {};
|
|
47
|
+
var _default = DragAndDropWrapper;
|
|
48
|
+
exports.default = _default;
|
|
49
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/molecule/drag-and-drop-wrapper/index.js"],"names":["DragAndDropWrapper","props","list","checkBoxTitle","dataName","dragAndDropList","dragAndDropProps","style","dragAndDrop","title","group","propTypes","PropTypes","arrayOf","shape","DragAndDrop","CheckboxWithTitle","string"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;;;;;AAEA,MAAMA,kBAAkB,GAAGC,KAAK,IAAI;AAClC,QAAM;AAACC,IAAAA,IAAI,GAAG,EAAR;AAAYC,IAAAA,aAAZ;AAA2B,iBAAaC;AAAxC,MAAoDH,KAA1D;AAEA,QAAMI,eAAe,GAAG,mBAAIC,gBAAgB,IAAI;AAC9C,wBACE;AAAI,MAAA,SAAS,EAAEC,eAAMC,WAArB;AAAkC,MAAA,GAAG,EAAG,eAAcF,gBAAgB,CAACG,KAAM;AAA7E,oBACE,6BAAC,oBAAD,EAAiBH,gBAAjB,CADF,CADF;AAKD,GANuB,EAMrBJ,IANqB,CAAxB;AAQA,sBACE,uDACE;AAAK,IAAA,SAAS,EAAEK,eAAME;AAAtB,kBACE,6BAAC,0BAAD,EAAuBN,aAAvB,CADF,CADF,eAIE;AAAI,IAAA,SAAS,EAAEI,eAAMG,KAArB;AAA4B,iBAAWN;AAAvC,KACGC,eADH,CAJF,CADF;AAUD,CArBD;;AAuBAL,kBAAkB,CAACW,SAAnB,2CAA+B;AAC7BT,EAAAA,IAAI,EAAEU,mBAAUC,OAAV,CAAkBD,mBAAUE,KAAV,CAAgBC,qBAAYJ,SAA5B,CAAlB,CADuB;AAE7BR,EAAAA,aAAa,EAAES,mBAAUE,KAAV,cAAoBE,2BAAkBL,SAAtC,EAFc;AAG7B,eAAaC,mBAAUK;AAHM,CAA/B;eAMejB,kB","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {map} from 'lodash/fp';\nimport DragAndDrop from '../../atom/drag-and-drop';\nimport CheckboxWithTitle from '../../atom/checkbox-with-title';\nimport style from './style.css';\n\nconst DragAndDropWrapper = props => {\n const {list = [], checkBoxTitle, 'data-name': dataName} = props;\n\n const dragAndDropList = map(dragAndDropProps => {\n return (\n <li className={style.dragAndDrop} key={`dragAndDrop-${dragAndDropProps.title}`}>\n <DragAndDrop {...dragAndDropProps} />\n </li>\n );\n }, list);\n\n return (\n <div>\n <div className={style.title}>\n <CheckboxWithTitle {...checkBoxTitle} />\n </div>\n <ul className={style.group} data-name={dataName}>\n {dragAndDropList}\n </ul>\n </div>\n );\n};\n\nDragAndDropWrapper.propTypes = {\n list: PropTypes.arrayOf(PropTypes.shape(DragAndDrop.propTypes)),\n checkBoxTitle: PropTypes.shape({...CheckboxWithTitle.propTypes}),\n 'data-name': PropTypes.string\n};\n\nexport default DragAndDropWrapper;\n"],"file":"index.js"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.default = void 0;
|
|
5
|
+
|
|
6
|
+
var _default2 = _interopRequireDefault(require("../../../../atom/drag-and-drop/test/fixtures/default"));
|
|
7
|
+
|
|
8
|
+
var _checked = _interopRequireDefault(require("../../../../atom/checkbox-with-title/test/fixtures/checked"));
|
|
9
|
+
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
|
|
12
|
+
var _default = {
|
|
13
|
+
props: {
|
|
14
|
+
checkBoxTitle: _checked.default.props,
|
|
15
|
+
list: [_default2.default.props]
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
exports.default = _default;
|
|
19
|
+
//# sourceMappingURL=default.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/molecule/drag-and-drop-wrapper/test/fixtures/default.js"],"names":["props","checkBoxTitle","list","firstdDragAndDrop"],"mappings":";;;;;AAAA;;AACA;;;;eAEe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,aAAa,EAAEA,iBAAcD,KADxB;AAELE,IAAAA,IAAI,EAAE,CAACC,kBAAkBH,KAAnB;AAFD;AADM,C","sourcesContent":["import firstdDragAndDrop from '../../../../atom/drag-and-drop/test/fixtures/default';\nimport checkBoxTitle from '../../../../atom/checkbox-with-title/test/fixtures/checked';\n\nexport default {\n props: {\n checkBoxTitle: checkBoxTitle.props,\n list: [firstdDragAndDrop.props]\n }\n};\n"],"file":"default.js"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.default = void 0;
|
|
5
|
+
|
|
6
|
+
var _default2 = _interopRequireDefault(require("../../../../atom/drag-and-drop/test/fixtures/default"));
|
|
7
|
+
|
|
8
|
+
var _withChildren = _interopRequireDefault(require("../../../../atom/drag-and-drop/test/fixtures/with-children"));
|
|
9
|
+
|
|
10
|
+
var _checked = _interopRequireDefault(require("../../../../atom/checkbox-with-title/test/fixtures/checked"));
|
|
11
|
+
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
|
|
14
|
+
var _default = {
|
|
15
|
+
props: {
|
|
16
|
+
checkBoxTitle: _checked.default.props,
|
|
17
|
+
list: [_default2.default.props, _withChildren.default.props]
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
exports.default = _default;
|
|
21
|
+
//# sourceMappingURL=two-drag-and-drops.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/molecule/drag-and-drop-wrapper/test/fixtures/two-drag-and-drops.js"],"names":["props","checkBoxTitle","list","firstdDragAndDrop","secondDragAndDrop"],"mappings":";;;;;AAAA;;AACA;;AACA;;;;eAEe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,aAAa,EAAEA,iBAAcD,KADxB;AAELE,IAAAA,IAAI,EAAE,CAACC,kBAAkBH,KAAnB,EAA0BI,sBAAkBJ,KAA5C;AAFD;AADM,C","sourcesContent":["import firstdDragAndDrop from '../../../../atom/drag-and-drop/test/fixtures/default';\nimport secondDragAndDrop from '../../../../atom/drag-and-drop/test/fixtures/with-children';\nimport checkBoxTitle from '../../../../atom/checkbox-with-title/test/fixtures/checked';\n\nexport default {\n props: {\n checkBoxTitle: checkBoxTitle.props,\n list: [firstdDragAndDrop.props, secondDragAndDrop.props]\n }\n};\n"],"file":"two-drag-and-drops.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 _twoDragAndDrops = _interopRequireDefault(require("./fixtures/two-drag-and-drops"));
|
|
14
|
+
|
|
15
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
|
+
|
|
17
|
+
(0, _ava.default)('Molecule › MoleculeDragAndDropWrapper > should have valid propTypes', t => {
|
|
18
|
+
t.pass();
|
|
19
|
+
(0, _forEach.default)(_.default.propTypes, (value, key) => {
|
|
20
|
+
t.not(value, undefined, `PropType for "Molecule.MoleculeDragAndDropWrapper.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
(0, _ava.default)('Molecule › MoleculeDragAndDropWrapper › Default › should be rendered', _renderComponent.default, _.default, _default.default);
|
|
24
|
+
(0, _ava.default)('Molecule › MoleculeDragAndDropWrapper › TwoDragAndDrops › should be rendered', _renderComponent.default, _.default, _twoDragAndDrops.default);
|
|
25
|
+
//# sourceMappingURL=fixtures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/molecule/drag-and-drop-wrapper/test/fixtures.js"],"names":["t","pass","MoleculeDragAndDropWrapper","propTypes","value","key","not","undefined","renderComponentMacro","fixtureDefault","fixtureTwoDragAndDrops"],"mappings":";;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,kBAAK,qEAAL,EAA4EA,CAAC,IAAI;AAC/EA,EAAAA,CAAC,CAACC,IAAF;AACA,wBAAQC,UAA2BC,SAAnC,EAA8C,CAACC,KAAD,EAAQC,GAAR,KAAgB;AAC5DL,IAAAA,CAAC,CAACM,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,+DAA8DF,GAAI,mEAA3F;AACD,GAFD;AAGD,CALD;AAOA,kBAAK,sEAAL,EAA6EG,wBAA7E,EAAmGN,SAAnG,EAA+HO,gBAA/H;AACA,kBAAK,8EAAL,EAAqFD,wBAArF,EAA2GN,SAA3G,EAAuIQ,wBAAvI","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport MoleculeDragAndDropWrapper from '..';\nimport fixtureDefault from './fixtures/default';\nimport fixtureTwoDragAndDrops from './fixtures/two-drag-and-drops';\n\ntest('Molecule › MoleculeDragAndDropWrapper > should have valid propTypes', t => {\n t.pass();\n forEach(MoleculeDragAndDropWrapper.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Molecule.MoleculeDragAndDropWrapper.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Molecule › MoleculeDragAndDropWrapper › Default › should be rendered', renderComponentMacro, MoleculeDragAndDropWrapper, fixtureDefault);\ntest('Molecule › MoleculeDragAndDropWrapper › TwoDragAndDrops › should be rendered', renderComponentMacro, MoleculeDragAndDropWrapper, fixtureTwoDragAndDrops);\n"],"file":"fixtures.js"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/molecule/setup-slide/index.js"],"names":["SetupSlide","props","fields","buildInput","field","type","style","imageUploadContainer","title","subtitle","buildField","index","input","fieldsList","convert","cap","wrapper","defaultProps","propTypes","PropTypes","arrayOf","oneOfType","shape","InputSwitch","oneOf","Select","InputCheckbox","ImageUpload","InputReadonly","InputDoublestep","SetupCohortItem","MessagePopin","InputText"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEA,MAAMA,UAAU,GAAGC,KAAK,IAAI;AAC1B,QAAM;AAACC,IAAAA;AAAD,MAAWD,KAAjB;;AACA,QAAME,UAAU,GAAGC,KAAK,IAAI;AAC1B,UAAM;AAACC,MAAAA;AAAD,QAASD,KAAf;;AACA,YAAQC,IAAR;AACE,WAAK,QAAL;AACE,4BAAO,6BAAC,oBAAD,EAAiBD,KAAjB,CAAP;;AACF,WAAK,QAAL;AACE,4BAAO,6BAAC,eAAD,eAAYA,KAAZ;AAAmB,UAAA,KAAK,EAAE;AAA1B,WAAP;;AACF,WAAK,UAAL;AACE,4BAAO,6BAAC,sBAAD,EAAmBA,KAAnB,CAAP;;AACF,WAAK,OAAL;AACE,
|
|
1
|
+
{"version":3,"sources":["../../../src/molecule/setup-slide/index.js"],"names":["SetupSlide","props","fields","buildInput","field","type","style","imageUploadContainer","title","subtitle","buildField","index","input","fieldsList","convert","cap","wrapper","defaultProps","propTypes","PropTypes","arrayOf","oneOfType","shape","InputSwitch","oneOf","Select","InputCheckbox","ImageUpload","InputReadonly","InputDoublestep","SetupCohortItem","MessagePopin","InputText"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEA,MAAMA,UAAU,GAAGC,KAAK,IAAI;AAC1B,QAAM;AAACC,IAAAA;AAAD,MAAWD,KAAjB;;AACA,QAAME,UAAU,GAAGC,KAAK,IAAI;AAC1B,UAAM;AAACC,MAAAA;AAAD,QAASD,KAAf;;AACA,YAAQC,IAAR;AACE,WAAK,QAAL;AACE,4BAAO,6BAAC,oBAAD,EAAiBD,KAAjB,CAAP;;AACF,WAAK,QAAL;AACE,4BAAO,6BAAC,eAAD,eAAYA,KAAZ;AAAmB,UAAA,KAAK,EAAE;AAA1B,WAAP;;A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F,mBAAUG,KAAV,uBACKC,qBAAYL,SADjB;AAEEb,IAAAA,IAAI,EAAEc,mBAAUK,KAAV,CAAgB,CAAC,QAAD,CAAhB;AAFR,KADkB,EAKlBL,mBAAUG,KAAV,uBACKG,gBAAOP,SADZ;AAEEb,IAAAA,IAAI,EAAEc,mBAAUK,KAAV,CAAgB,CAAC,QAAD,CAAhB;AAFR,KALkB,EASlBL,mBAAUG,KAAV,uBACKI,uBAAcR,SADnB;AAEEb,IAAAA,IAAI,EAAEc,mBAAUK,KAAV,CAAgB,CAAC,UAAD,CAAhB;AAFR,KATkB,EAalBL,mBAAUG,KAAV,uBACKK,qBAAYT,SADjB;AAEEb,IAAAA,IAAI,EAAEc,mBAAUK,KAAV,CAAgB,CAAC,OAAD,CAAhB;AAFR,KAbkB,EAiBlBL,mBAAUG,KAAV,uBACKM,uBAAcV,SADnB;AAEEb,IAAAA,IAAI,EAAEc,mBAAUK,KAAV,CAAgB,CAAC,UAAD,CAAhB;AAFR,KAjBkB,EAqBlBL,mBAAUG,KAAV,uBACKO,yBAAgBX,SADrB;AAEEb,IAAAA,IAAI,EAAEc,mBAAUK,KAAV,CAAgB,CAAC,YAAD,CAAhB;AAFR,KArBkB,EAyBlBL,mBAAUG,KAAV,uBACKQ,yBAAgBZ,SADrB;AAEEb,IAAAA,IAAI,EAAEc,mBAAUK,KAAV,CAAgB,CAAC,WAAD,CAAhB;AAFR,KAzBkB,EA6BlBL,mBAAUG,KAAV,uBACKS,sBAAab,SADlB;AAEEb,IAAAA,IAAI,EAAEc,mBAAUK,KAAV,CAAgB,CAAC,OAAD,CAAhB;AAFR,KA7BkB,EAiClBL,mBAAUG,KAAV,CAAgBU,mBAAUd,SAA1B,CAjCkB,CAApB,CADM;AADa,CAAvB;eAuCelB,U","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {map} from 'lodash/fp';\nimport Select from '../../atom/select';\nimport InputReadonly from '../../atom/input-readonly';\nimport InputText from '../../atom/input-text';\nimport InputCheckbox from '../../atom/input-checkbox';\nimport InputDoublestep from '../../atom/input-doublestep';\nimport InputSwitch from '../../atom/input-switch';\nimport ImageUpload from '../../atom/image-upload';\nimport SetupCohortItem from '../setup-cohort-item';\nimport MessagePopin from '../message-popin';\nimport style from './style.css';\n\nconst SetupSlide = props => {\n const {fields} = props;\n const buildInput = field => {\n const {type} = field;\n switch (type) {\n case 'switch':\n return <InputSwitch {...field} />;\n case 'select':\n return <Select {...field} theme={'coorpmanager'} />;\n case 'checkbox':\n return <InputCheckbox {...field} />;\n case 'image':\n return (\n <div className={style.imageUploadContainer}>\n <ImageUpload {...field} />\n </div>\n );\n case 'splitForm':\n return <SetupCohortItem field={field} />;\n case 'alert':\n return <MessagePopin header={field.title} content={field.subtitle} />;\n case 'readonly':\n return <InputReadonly {...field} />;\n case 'doublestep':\n return <InputDoublestep {...field} />;\n default:\n return <InputText {...field} />;\n }\n };\n\n const buildField = (field, index) => {\n const input = buildInput(field);\n return (\n <div className={style.field} key={index}>\n {input}\n </div>\n );\n };\n\n const fieldsList = map.convert({cap: false})(buildField, fields);\n\n return <div className={style.wrapper}>{fieldsList}</div>;\n};\n\nSetupSlide.defaultProps = {\n fields: []\n};\n\nSetupSlide.propTypes = {\n fields: PropTypes.arrayOf(\n PropTypes.oneOfType([\n PropTypes.shape({\n ...InputSwitch.propTypes,\n type: PropTypes.oneOf(['switch'])\n }),\n PropTypes.shape({\n ...Select.propTypes,\n type: PropTypes.oneOf(['select'])\n }),\n PropTypes.shape({\n ...InputCheckbox.propTypes,\n type: PropTypes.oneOf(['checkbox'])\n }),\n PropTypes.shape({\n ...ImageUpload.propTypes,\n type: PropTypes.oneOf(['image'])\n }),\n PropTypes.shape({\n ...InputReadonly.propTypes,\n type: PropTypes.oneOf(['readonly'])\n }),\n PropTypes.shape({\n ...InputDoublestep.propTypes,\n type: PropTypes.oneOf(['doublestep'])\n }),\n PropTypes.shape({\n ...SetupCohortItem.propTypes,\n type: PropTypes.oneOf(['splitForm'])\n }),\n PropTypes.shape({\n ...MessagePopin.propTypes,\n type: PropTypes.oneOf(['alert'])\n }),\n PropTypes.shape(InputText.propTypes)\n ])\n )\n};\nexport default SetupSlide;\n"],"file":"index.js"}
|