@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
|
@@ -8,9 +8,9 @@ import React from 'react';
|
|
|
8
8
|
import PropTypes from 'prop-types';
|
|
9
9
|
import { NovaLineStatusClose as Close, NovaSolidFilesBasicFileUpload2 as FileUploadIcon, NovaSolidFilesBasicFileBlock2 as FileUploadBlockedIcon } from '@coorpacademy/nova-icons';
|
|
10
10
|
import Loader from '../loader';
|
|
11
|
-
import style from './style.css';
|
|
12
11
|
import Button from '../button-link';
|
|
13
12
|
import getClassState from '../../util/get-class-state';
|
|
13
|
+
import style from './style.css';
|
|
14
14
|
|
|
15
15
|
const constantNull = _constant(null);
|
|
16
16
|
|
|
@@ -49,7 +49,7 @@ class DragAndDrop extends React.Component {
|
|
|
49
49
|
loading = false,
|
|
50
50
|
modified = false,
|
|
51
51
|
onReset = null,
|
|
52
|
-
error =
|
|
52
|
+
error = ''
|
|
53
53
|
} = this.props;
|
|
54
54
|
const {
|
|
55
55
|
dragging
|
|
@@ -92,19 +92,19 @@ class DragAndDrop extends React.Component {
|
|
|
92
92
|
previewView = /*#__PURE__*/React.createElement("span", null, previewLabel);
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
const resetContent = previewContent && previewContent.src
|
|
95
|
+
const resetContent = previewContent && previewContent.src ? /*#__PURE__*/React.createElement("div", {
|
|
96
96
|
className: style.resetUploadWrapper
|
|
97
97
|
}, /*#__PURE__*/React.createElement("div", {
|
|
98
98
|
className: style.resetSrcLabel
|
|
99
|
-
}, previewContent.src), /*#__PURE__*/React.createElement(Close, {
|
|
99
|
+
}, previewContent.src), onReset ? /*#__PURE__*/React.createElement(Close, {
|
|
100
100
|
"data-name": "reset-content-icon",
|
|
101
101
|
height: 16,
|
|
102
102
|
width: 16,
|
|
103
103
|
className: style.closeIcon,
|
|
104
104
|
onClick: onReset
|
|
105
|
-
})) : null;
|
|
105
|
+
}) : null) : null;
|
|
106
106
|
|
|
107
|
-
const buildButton = (
|
|
107
|
+
const buildButton = () => {
|
|
108
108
|
const defaultButtonProps = {
|
|
109
109
|
label: uploadLabel,
|
|
110
110
|
'aria-label': 'aria button',
|
|
@@ -118,12 +118,10 @@ class DragAndDrop extends React.Component {
|
|
|
118
118
|
if (dragging) {
|
|
119
119
|
return null;
|
|
120
120
|
} else if (error) {
|
|
121
|
-
|
|
122
|
-
label:
|
|
121
|
+
return /*#__PURE__*/React.createElement(Button, _extends({}, defaultButtonProps, {
|
|
122
|
+
label: "Try again",
|
|
123
123
|
icon: {}
|
|
124
|
-
});
|
|
125
|
-
|
|
126
|
-
return /*#__PURE__*/React.createElement(Button, errorButtonProps);
|
|
124
|
+
}));
|
|
127
125
|
} else {
|
|
128
126
|
return /*#__PURE__*/React.createElement(Button, defaultButtonProps);
|
|
129
127
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/atom/drag-and-drop/index.js"],"names":["React","PropTypes","NovaLineStatusClose","Close","NovaSolidFilesBasicFileUpload2","FileUploadIcon","NovaSolidFilesBasicFileBlock2","FileUploadBlockedIcon","Loader","style","Button","getClassState","constantNull","DragAndDrop","Component","constructor","props","state","dragging","handleDragStart","bind","handleDragStop","setState","render","idBox","children","title","description","uploadLabel","previewLabel","previewContent","loading","modified","onReset","error","previewView","type","preview","src","loaderWrapper","loadingCancel","closeIcon","loader","loaderText","resetContent","resetUploadWrapper","resetSrcLabel","buildButton","defaultButtonProps","label","icon","position","errorButtonProps","button","previewContainer","modifiedPreviewContainer","inputWrapper","modifiedInputWrapper","errorInputWrapper","wrapper","infosContainer","iconError","errorMessage","propTypes","string","shape","bool","func"],"mappings":";;;;;;AAAA,OAAOA,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,MAHN;AAIjBnC,EAAAA,YAAY,EAAE5B,SAAS,CAAC+D,MAJP;AAKjBlC,EAAAA,cAAc,EAAE7B,SAAS,CAACgE,KAAV,CAAgB;AAC9B7B,IAAAA,IAAI,EAAEnC,SAAS,CAAC+D,MADc;AAE9B1B,IAAAA,GAAG,EAAErC,SAAS,CAAC+D;AAFe,GAAhB,CALC;AASjBjC,EAAAA,OAAO,EAAE9B,SAAS,CAACiE,IATF;AAUjBlC,EAAAA,QAAQ,EAAE/B,SAAS,CAACiE,IAVH;AAWjBzC,EAAAA,QAAQ,EAAExB,SAAS,CAACkE,IAXH;AAYjBlC,EAAAA,OAAO,EAAEhC,SAAS,CAACkE,IAZF;AAajBjC,EAAAA,KAAK,EAAEjC,SAAS,CAAC+D;AAbA,C;AA0JrB,eAAenD,WAAf","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {uniqueId, constant, isEmpty} from 'lodash/fp';\nimport {\n NovaLineStatusClose as Close,\n NovaSolidFilesBasicFileUpload2 as FileUploadIcon,\n NovaSolidFilesBasicFileBlock2 as FileUploadBlockedIcon,\n} from '@coorpacademy/nova-icons';\nimport Loader from '../loader';\nimport style from './style.css';\nimport Button from '../button-link';\nimport getClassState from '../../util/get-class-state';\n\nconst constantNull = constant(null);\n\nclass DragAndDrop extends React.Component {\n static propTypes = {\n title: PropTypes.string,\n description: PropTypes.string,\n uploadLabel: PropTypes.string,\n previewLabel: PropTypes.string,\n previewContent: PropTypes.shape({\n type: PropTypes.string,\n src: PropTypes.string\n }),\n loading: PropTypes.bool,\n modified: PropTypes.bool,\n children: PropTypes.func,\n onReset: PropTypes.func,\n error: PropTypes.string\n };\n\n constructor(props) {\n super(props);\n\n this.state = {\n dragging: false\n };\n\n this.handleDragStart = this.handleDragStart.bind(this);\n this.handleDragStop = this.handleDragStop.bind(this);\n }\n\n handleDragStart() {\n this.setState({\n dragging: true\n });\n }\n\n handleDragStop() {\n this.setState({\n dragging: false\n });\n }\n\n render() {\n const idBox = uniqueId('drop-box-');\n const {\n children = constantNull,\n title,\n description,\n uploadLabel,\n previewLabel = '',\n previewContent,\n loading = false,\n modified = false,\n onReset = null,\n error = false\n } = this.props;\n const {dragging} = this.state;\n\n let previewView = null;\n\n if (previewContent && previewContent.type === 'image') {\n previewView = (\n <div className={style.preview}>\n <img src={previewContent.src} />\n </div>\n );\n } else if (previewContent && previewContent.type === 'video') {\n previewView = (\n <div className={style.preview}>\n <video controls src={previewContent.src} type=\"video/*\" />\n </div>\n );\n } else if (loading) {\n previewView = (\n <div className={style.loaderWrapper}>\n <div className={style.loadingCancel}>\n <Close\n data-name=\"reset-content-icon\"\n height={16}\n width={16}\n className={style.closeIcon}\n onClick={onReset}\n />\n </div>\n <div className={style.loader}>\n <Loader theme='coorpmanager'/>\n </div>\n <span className={style.loaderText}>Uploading</span>\n </div>\n );\n } else {\n previewView = <span>{previewLabel}</span>;\n }\n\n const resetContent =\n previewContent && previewContent.src && onReset ? (\n <div className={style.resetUploadWrapper}>\n <div className={style.resetSrcLabel}>{previewContent.src}</div>\n <Close\n data-name=\"reset-content-icon\"\n height={16}\n width={16}\n className={style.closeIcon}\n onClick={onReset}\n />\n </div>\n ) : null;\n\n \n const buildButton = (dragging, error) => {\n const defaultButtonProps = {\n label: uploadLabel,\n 'aria-label': 'aria button',\n 'data-name': 'default-button',\n icon: {\n position: 'left',\n type: 'folders'\n },\n };\n if (dragging) {\n return null;\n } else if (error) {\n const errorButtonProps = {...defaultButtonProps, label: 'Try again', icon: {}}\n return <Button {...errorButtonProps} />;\n } else {\n return <Button {...defaultButtonProps} />;\n }\n }\n\n const button = buildButton(dragging, error);\n\n const previewContainer = getClassState(style.previewContainer, style.modifiedPreviewContainer, null, modified, error);\n const inputWrapper = getClassState(style.inputWrapper, style.modifiedInputWrapper, style.errorInputWrapper, modified, error);\n\n return (\n <div className={style.wrapper} data-name=\"drag-and-drop-wrapper\">\n {!isEmpty(previewContent) || loading ? \n <div className={previewContainer}>{previewView}</div> \n : \n <div className={dragging ? style.dragging : inputWrapper} id={idBox}>\n <div className={style.infosContainer}>\n {error ? <FileUploadBlockedIcon className={style.iconError} /> : <FileUploadIcon className={style.icon} />}\n {description ? (\n <div className={style.description}>{description}</div>\n ) : null}\n {error ? null : <div className={style.title}>{title}</div>}\n </div>\n {button}\n <div>{children(this.handleDragStart, this.handleDragStop)}</div>\n </div>\n }\n {error ? <span className={style.errorMessage}>{error}</span> : resetContent}\n </div>\n );\n }\n}\n\nexport default DragAndDrop;\n"],"file":"index.js"}
|
|
1
|
+
{"version":3,"sources":["../../../src/atom/drag-and-drop/index.js"],"names":["React","PropTypes","NovaLineStatusClose","Close","NovaSolidFilesBasicFileUpload2","FileUploadIcon","NovaSolidFilesBasicFileBlock2","FileUploadBlockedIcon","Loader","Button","getClassState","style","constantNull","DragAndDrop","Component","constructor","props","state","dragging","handleDragStart","bind","handleDragStop","setState","render","idBox","children","title","description","uploadLabel","previewLabel","previewContent","loading","modified","onReset","error","previewView","type","preview","src","loaderWrapper","loadingCancel","closeIcon","loader","loaderText","resetContent","resetUploadWrapper","resetSrcLabel","buildButton","defaultButtonProps","label","icon","position","button","previewContainer","modifiedPreviewContainer","inputWrapper","modifiedInputWrapper","errorInputWrapper","wrapper","infosContainer","iconError","errorMessage","propTypes","string","shape","bool","func"],"mappings":";;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,SACEC,mBAAmB,IAAIC,KADzB,EAEEC,8BAA8B,IAAIC,cAFpC,EAGEC,6BAA6B,IAAIC,qBAHnC,QAIO,0BAJP;AAKA,OAAOC,MAAP,MAAmB,WAAnB;AACA,OAAOC,MAAP,MAAmB,gBAAnB;AACA,OAAOC,aAAP,MAA0B,4BAA1B;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,YAAY,GAAG,UAAS,IAAT,CAArB;;AAEA,MAAMC,WAAN,SAA0Bb,KAAK,CAACc,SAAhC,CAA0C;A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AK,EAAEjC,SAAS,CAAC8D;AAbA,C;AAwKrB,eAAelD,WAAf","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {uniqueId, constant, isEmpty} from 'lodash/fp';\nimport {\n NovaLineStatusClose as Close,\n NovaSolidFilesBasicFileUpload2 as FileUploadIcon,\n NovaSolidFilesBasicFileBlock2 as FileUploadBlockedIcon\n} from '@coorpacademy/nova-icons';\nimport Loader from '../loader';\nimport Button from '../button-link';\nimport getClassState from '../../util/get-class-state';\nimport style from './style.css';\n\nconst constantNull = constant(null);\n\nclass DragAndDrop extends React.Component {\n static propTypes = {\n title: PropTypes.string,\n description: PropTypes.string,\n uploadLabel: PropTypes.string,\n previewLabel: PropTypes.string,\n previewContent: PropTypes.shape({\n type: PropTypes.string,\n src: PropTypes.string\n }),\n loading: PropTypes.bool,\n modified: PropTypes.bool,\n children: PropTypes.func,\n onReset: PropTypes.func,\n error: PropTypes.string\n };\n\n constructor(props) {\n super(props);\n\n this.state = {\n dragging: false\n };\n\n this.handleDragStart = this.handleDragStart.bind(this);\n this.handleDragStop = this.handleDragStop.bind(this);\n }\n\n handleDragStart() {\n this.setState({\n dragging: true\n });\n }\n\n handleDragStop() {\n this.setState({\n dragging: false\n });\n }\n\n render() {\n const idBox = uniqueId('drop-box-');\n const {\n children = constantNull,\n title,\n description,\n uploadLabel,\n previewLabel = '',\n previewContent,\n loading = false,\n modified = false,\n onReset = null,\n error = ''\n } = this.props;\n const {dragging} = this.state;\n\n let previewView = null;\n\n if (previewContent && previewContent.type === 'image') {\n previewView = (\n <div className={style.preview}>\n <img src={previewContent.src} />\n </div>\n );\n } else if (previewContent && previewContent.type === 'video') {\n previewView = (\n <div className={style.preview}>\n <video controls src={previewContent.src} type=\"video/*\" />\n </div>\n );\n } else if (loading) {\n previewView = (\n <div className={style.loaderWrapper}>\n <div className={style.loadingCancel}>\n <Close\n data-name=\"reset-content-icon\"\n height={16}\n width={16}\n className={style.closeIcon}\n onClick={onReset}\n />\n </div>\n <div className={style.loader}>\n <Loader theme=\"coorpmanager\" />\n </div>\n <span className={style.loaderText}>Uploading</span>\n </div>\n );\n } else {\n previewView = <span>{previewLabel}</span>;\n }\n\n const resetContent =\n previewContent && previewContent.src ? (\n <div className={style.resetUploadWrapper}>\n <div className={style.resetSrcLabel}>{previewContent.src}</div>\n {onReset ? (\n <Close\n data-name=\"reset-content-icon\"\n height={16}\n width={16}\n className={style.closeIcon}\n onClick={onReset}\n />\n ) : null}\n </div>\n ) : null;\n\n const buildButton = () => {\n const defaultButtonProps = {\n label: uploadLabel,\n 'aria-label': 'aria button',\n 'data-name': 'default-button',\n icon: {\n position: 'left',\n type: 'folders'\n }\n };\n if (dragging) {\n return null;\n } else if (error) {\n return <Button {...defaultButtonProps} label=\"Try again\" icon={{}} />;\n } else {\n return <Button {...defaultButtonProps} />;\n }\n };\n\n const button = buildButton(dragging, error);\n\n const previewContainer = getClassState(\n style.previewContainer,\n style.modifiedPreviewContainer,\n null,\n modified,\n error\n );\n const inputWrapper = getClassState(\n style.inputWrapper,\n style.modifiedInputWrapper,\n style.errorInputWrapper,\n modified,\n error\n );\n\n return (\n <div className={style.wrapper} data-name=\"drag-and-drop-wrapper\">\n {!isEmpty(previewContent) || loading ? (\n <div className={previewContainer}>{previewView}</div>\n ) : (\n <div className={dragging ? style.dragging : inputWrapper} id={idBox}>\n <div className={style.infosContainer}>\n {error ? (\n <FileUploadBlockedIcon className={style.iconError} />\n ) : (\n <FileUploadIcon className={style.icon} />\n )}\n {description ? <div className={style.description}>{description}</div> : null}\n {error ? null : <div className={style.title}>{title}</div>}\n </div>\n {button}\n <div>{children(this.handleDragStart, this.handleDragStop)}</div>\n </div>\n )}\n {error ? <span className={style.errorMessage}>{error}</span> : resetContent}\n </div>\n );\n }\n}\n\nexport default DragAndDrop;\n"],"file":"index.js"}
|
|
@@ -6,19 +6,19 @@
|
|
|
6
6
|
@value battle from colors;
|
|
7
7
|
@value light from colors;
|
|
8
8
|
@value xtraLightGrey from colors;
|
|
9
|
-
@value cm_grey_300 from colors;
|
|
10
|
-
@value cm_grey_700 from colors;
|
|
11
9
|
@value cm_grey_50 from colors;
|
|
12
|
-
@value cm_grey_200 from colors;
|
|
13
10
|
@value cm_grey_100 from colors;
|
|
11
|
+
@value cm_grey_200 from colors;
|
|
12
|
+
@value cm_grey_300 from colors;
|
|
14
13
|
@value cm_grey_400 from colors;
|
|
14
|
+
@value cm_grey_700 from colors;
|
|
15
15
|
@value white from colors;
|
|
16
16
|
@value cm_negative_100 from colors;
|
|
17
17
|
@value cm_yellow_100 from colors;
|
|
18
18
|
|
|
19
19
|
.wrapper {
|
|
20
20
|
font-family: "Gilroy";
|
|
21
|
-
max-height:
|
|
21
|
+
max-height: 360px;
|
|
22
22
|
max-width: 360px;
|
|
23
23
|
height: 100%;
|
|
24
24
|
width: 100%;
|
|
@@ -33,10 +33,9 @@
|
|
|
33
33
|
|
|
34
34
|
.description {
|
|
35
35
|
max-height: 85px;
|
|
36
|
-
font-size:
|
|
36
|
+
font-size: 1.2em;
|
|
37
37
|
font-weight: 400;
|
|
38
38
|
color: cm_grey_300;
|
|
39
|
-
margin-bottom: 8px;
|
|
40
39
|
text-align: center;
|
|
41
40
|
padding: 8px;
|
|
42
41
|
}
|
|
@@ -74,6 +73,7 @@
|
|
|
74
73
|
}
|
|
75
74
|
|
|
76
75
|
.infosContainer {
|
|
76
|
+
font-size: 10px;;
|
|
77
77
|
width: 100%;
|
|
78
78
|
height: 100%;
|
|
79
79
|
display: flex;
|
|
@@ -132,7 +132,7 @@
|
|
|
132
132
|
|
|
133
133
|
.resetUploadWrapper {
|
|
134
134
|
width: 100%;
|
|
135
|
-
height: 24px;
|
|
135
|
+
min-height: 24px;
|
|
136
136
|
box-sizing: border-box;
|
|
137
137
|
background-color: cm_grey_50;
|
|
138
138
|
border-radius: 3px;
|
|
@@ -182,10 +182,11 @@
|
|
|
182
182
|
.icon {
|
|
183
183
|
min-width: 14px;
|
|
184
184
|
min-height: 14px;
|
|
185
|
+
max-width: 30px;
|
|
186
|
+
max-height: 30px;
|
|
185
187
|
height: 20%;
|
|
186
188
|
width: 20%;;
|
|
187
189
|
transition: all 0.2s cubic-bezier(0.47, 1.04, 0.46, 2.16);
|
|
188
|
-
margin-bottom: 4px;
|
|
189
190
|
}
|
|
190
191
|
|
|
191
192
|
.iconError {
|
|
@@ -193,12 +194,6 @@
|
|
|
193
194
|
color: cm_negative_100;
|
|
194
195
|
}
|
|
195
196
|
|
|
196
|
-
.uploadLabel {
|
|
197
|
-
font-size: 14px;
|
|
198
|
-
font-weight: 700;
|
|
199
|
-
color: cm_grey_700;
|
|
200
|
-
}
|
|
201
|
-
|
|
202
197
|
.loaderWrapper {
|
|
203
198
|
position: relative;
|
|
204
199
|
height: 100%;
|
|
@@ -228,22 +223,12 @@
|
|
|
228
223
|
right: 0;
|
|
229
224
|
}
|
|
230
225
|
|
|
231
|
-
.button {
|
|
232
|
-
display: flex;
|
|
233
|
-
justify-content: center;
|
|
234
|
-
align-items: center;
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
.folderIcon {
|
|
238
|
-
margin-right: 8px;
|
|
239
|
-
}
|
|
240
|
-
|
|
241
226
|
.loaderWrapper:hover .loadingCancel {
|
|
242
227
|
display: block;
|
|
243
228
|
}
|
|
244
229
|
|
|
245
230
|
.loaderWrapper:hover {
|
|
246
|
-
background-color:
|
|
231
|
+
background-color: cm_grey_100;
|
|
247
232
|
}
|
|
248
233
|
|
|
249
234
|
.errorMessage {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
|
|
1
3
|
import browserEnv from 'browser-env';
|
|
2
4
|
import test from 'ava';
|
|
3
5
|
import React from 'react';
|
|
@@ -10,8 +12,13 @@ browserEnv();
|
|
|
10
12
|
configure({
|
|
11
13
|
adapter: new Adapter()
|
|
12
14
|
});
|
|
15
|
+
const {
|
|
16
|
+
props
|
|
17
|
+
} = withChildrenFixtures;
|
|
13
18
|
test('should set state to dragging when user starts dragging', t => {
|
|
14
|
-
const wrapper = shallow( /*#__PURE__*/React.createElement(DragAndDrop,
|
|
19
|
+
const wrapper = shallow( /*#__PURE__*/React.createElement(DragAndDrop, _extends({}, props, {
|
|
20
|
+
previewContent: {}
|
|
21
|
+
}), (onDragStart, onDragStop) => /*#__PURE__*/React.createElement("input", {
|
|
15
22
|
className: style.input,
|
|
16
23
|
key: "1",
|
|
17
24
|
type: "file",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/atom/drag-and-drop/test/dragging.js"],"names":["browserEnv","test","React","shallow","configure","Adapter","style","DragAndDrop","withChildrenFixtures","adapter","
|
|
1
|
+
{"version":3,"sources":["../../../../src/atom/drag-and-drop/test/dragging.js"],"names":["browserEnv","test","React","shallow","configure","Adapter","style","DragAndDrop","withChildrenFixtures","adapter","props","t","wrapper","onDragStart","onDragStop","input","instance","false","state","dragging","find","simulate","true"],"mappings":";;AAAA,OAAOA,UAAP,MAAuB,aAAvB;AACA,OAAOC,IAAP,MAAiB,KAAjB;AACA,OAAOC,KAAP,MAAkB,OAAlB;AACA,SAAQC,OAAR,EAAiBC,SAAjB,QAAiC,QAAjC;AACA,OAAOC,OAAP,MAAoB,yBAApB;AACA,OAAOC,KAAP,MAAkB,8BAAlB;AACA,OAAOC,WAAP,MAAwB,IAAxB;AACA,OAAOC,oBAAP,MAAiC,0BAAjC;AAEAR,UAAU;AACVI,SAAS,CAAC;AAACK,EAAAA,OAAO,EAAE,IAAIJ,OAAJ;AAAV,CAAD,CAAT;AAEA,MAAM;AAACK,EAAAA;AAAD,IAAUF,oBAAhB;AAEAP,IAAI,CAAC,wDAAD,EAA2DU,CAAC,IAAI;AAClE,QAAMC,OAAO,GAAGT,OAAO,eACrB,oBAAC,WAAD,eAAiBO,KAAjB;AAAwB,IAAA,cAAc,EAAE;AAAxC,MACG,CAACG,WAAD,EAAcC,UAAd,kBACC;AACE,IAAA,SAAS,EAAER,KAAK,CAACS,KADnB;AAEE,IAAA,GAAG,EAAC,GAFN;AAGE,IAAA,IAAI,EAAC,MAHP;AAIE,IAAA,MAAM,EAAC,SAJT;AAKE,IAAA,QAAQ,EAAE,MAAM,IALlB;AAME,IAAA,WAAW,EAAEF,WANf;AAOE,IAAA,MAAM,EAAEC,UAPV;AAQE,IAAA,WAAW,EAAEA;AARf,IAFJ,CADqB,CAAvB;AAgBA,QAAME,QAAQ,GAAGJ,OAAO,CAACI,QAAR,EAAjB;AAEAL,EAAAA,CAAC,CAACM,KAAF,CAAQD,QAAQ,CAACE,KAAT,CAAeC,QAAvB;AACAP,EAAAA,OAAO,CAACQ,IAAR,CAAa,OAAb,EAAsBC,QAAtB,CAA+B,WAA/B;AACAV,EAAAA,CAAC,CAACW,IAAF,CAAON,QAAQ,CAACE,KAAT,CAAeC,QAAtB;AACAP,EAAAA,OAAO,CAACQ,IAAR,CAAa,OAAb,EAAsBC,QAAtB,CAA+B,WAA/B;AACAV,EAAAA,CAAC,CAACM,KAAF,CAAQD,QAAQ,CAACE,KAAT,CAAeC,QAAvB;AACD,CAxBG,CAAJ","sourcesContent":["import browserEnv from 'browser-env';\nimport test from 'ava';\nimport React from 'react';\nimport {shallow, configure} from 'enzyme';\nimport Adapter from 'enzyme-adapter-react-16';\nimport style from '../../image-upload/style.css';\nimport DragAndDrop from '..';\nimport withChildrenFixtures from './fixtures/with-children';\n\nbrowserEnv();\nconfigure({adapter: new Adapter()});\n\nconst {props} = withChildrenFixtures;\n\ntest('should set state to dragging when user starts dragging', t => {\n const wrapper = shallow(\n <DragAndDrop {...props} previewContent={{}}>\n {(onDragStart, onDragStop) => (\n <input\n className={style.input}\n key=\"1\"\n type=\"file\"\n accept=\"image*/\"\n onChange={() => true}\n onDragEnter={onDragStart}\n onDrop={onDragStop}\n onDragLeave={onDragStop}\n />\n )}\n </DragAndDrop>\n );\n const instance = wrapper.instance();\n\n t.false(instance.state.dragging);\n wrapper.find('input').simulate('dragenter');\n t.true(instance.state.dragging);\n wrapper.find('input').simulate('dragleave');\n t.false(instance.state.dragging);\n});\n"],"file":"dragging.js"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
|
|
3
|
+
import defaultProps from './default';
|
|
4
|
+
const {
|
|
5
|
+
props
|
|
6
|
+
} = defaultProps;
|
|
7
|
+
export default {
|
|
8
|
+
props: _extends(_extends({}, props), {}, {
|
|
9
|
+
modified: true
|
|
10
|
+
})
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=clean-and-modified.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/atom/drag-and-drop/test/fixtures/clean-and-modified.js"],"names":["defaultProps","props","modified"],"mappings":";;AAAA,OAAOA,YAAP,MAAyB,WAAzB;AAEA,MAAM;AAACC,EAAAA;AAAD,IAAUD,YAAhB;AAEA,eAAe;AACbC,EAAAA,KAAK,wBACAA,KADA;AAEHC,IAAAA,QAAQ,EAAE;AAFP;AADQ,CAAf","sourcesContent":["import defaultProps from './default';\n\nconst {props} = defaultProps;\n\nexport default {\n props: {\n ...props,\n modified: true\n }\n};\n"],"file":"clean-and-modified.js"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/atom/drag-and-drop/test/fixtures/default.js"],"names":["props","
|
|
1
|
+
{"version":3,"sources":["../../../../../src/atom/drag-and-drop/test/fixtures/default.js"],"names":["props","title","description","uploadLabel","previewLabel"],"mappings":"AAAA,eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,KAAK,EAAE,kBADF;AAELC,IAAAA,WAAW,EAAE,8BAFR;AAGLC,IAAAA,WAAW,EAAE,QAHR;AAILC,IAAAA,YAAY,EAAE;AAJT;AADM,CAAf","sourcesContent":["export default {\n props: {\n title: 'Drag & drop here',\n description: 'JPG or PNG, smaller than 5mb',\n uploadLabel: 'Browse',\n previewLabel: 'File Preview'\n }\n};\n"],"file":"default.js"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/atom/drag-and-drop/test/fixtures/error.js"],"names":["defaultProps","props","error"],"mappings":";;AAAA,OAAOA,YAAP,MAAyB,WAAzB;AAEA,MAAM;AAACC,EAAAA;AAAD,IAAUD,YAAhB;AAEA,eAAe;
|
|
1
|
+
{"version":3,"sources":["../../../../../src/atom/drag-and-drop/test/fixtures/error.js"],"names":["defaultProps","props","error"],"mappings":";;AAAA,OAAOA,YAAP,MAAyB,WAAzB;AAEA,MAAM;AAACC,EAAAA;AAAD,IAAUD,YAAhB;AAEA,eAAe;AACbC,EAAAA,KAAK,wBACAA,KADA;AAEHC,IAAAA,KAAK,EAAE;AAFJ;AADQ,CAAf","sourcesContent":["import defaultProps from './default';\n\nconst {props} = defaultProps;\n\nexport default {\n props: {\n ...props,\n error: 'The file is invalid'\n }\n};\n"],"file":"error.js"}
|
|
@@ -3,8 +3,7 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
|
3
3
|
import Default from './default';
|
|
4
4
|
export default {
|
|
5
5
|
props: _extends(_extends({}, Default.props), {}, {
|
|
6
|
-
loading: true
|
|
7
|
-
modified: false
|
|
6
|
+
loading: true
|
|
8
7
|
})
|
|
9
8
|
};
|
|
10
9
|
//# sourceMappingURL=loading.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/atom/drag-and-drop/test/fixtures/loading.js"],"names":["Default","props","loading"
|
|
1
|
+
{"version":3,"sources":["../../../../../src/atom/drag-and-drop/test/fixtures/loading.js"],"names":["Default","props","loading"],"mappings":";;AAAA,OAAOA,OAAP,MAAoB,WAApB;AAEA,eAAe;AACbC,EAAAA,KAAK,wBACAD,OAAO,CAACC,KADR;AAEHC,IAAAA,OAAO,EAAE;AAFN;AADQ,CAAf","sourcesContent":["import Default from './default';\n\nexport default {\n props: {\n ...Default.props,\n loading: true\n }\n};\n"],"file":"loading.js"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/atom/drag-and-drop/test/fixtures/modified.js"],"names":["withImageReset","props","modified"],"mappings":";;AAAA,OAAOA,cAAP,MAA2B,oBAA3B;AAEA,MAAM;AAACC,EAAAA;AAAD,IAAUD,cAAhB;AAEA,eAAe;
|
|
1
|
+
{"version":3,"sources":["../../../../../src/atom/drag-and-drop/test/fixtures/modified.js"],"names":["withImageReset","props","modified"],"mappings":";;AAAA,OAAOA,cAAP,MAA2B,oBAA3B;AAEA,MAAM;AAACC,EAAAA;AAAD,IAAUD,cAAhB;AAEA,eAAe;AACbC,EAAAA,KAAK,wBACAA,KADA;AAEHC,IAAAA,QAAQ,EAAE;AAFP;AADQ,CAAf","sourcesContent":["import withImageReset from './with-image-reset';\n\nconst {props} = withImageReset;\n\nexport default {\n props: {\n ...props,\n modified: true\n }\n};\n"],"file":"modified.js"}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import style from '../../../image-upload/style.css';
|
|
3
1
|
export default {
|
|
4
2
|
props: {
|
|
5
|
-
modified: false,
|
|
6
3
|
previewContent: {
|
|
7
4
|
type: 'image',
|
|
8
5
|
src: 'https://static.coorpacademy.com/content/up/raw/logo_coorp-1491560495763.svg'
|
|
@@ -10,17 +7,6 @@ export default {
|
|
|
10
7
|
title: 'Desktop (*)',
|
|
11
8
|
displayName: 'Upload image',
|
|
12
9
|
uploadLabel: 'Upload'
|
|
13
|
-
}
|
|
14
|
-
// eslint-disable-next-line react/display-name
|
|
15
|
-
children: (onDragStart, onDragStop) => /*#__PURE__*/React.createElement("input", {
|
|
16
|
-
className: style.input,
|
|
17
|
-
key: "1",
|
|
18
|
-
type: "file",
|
|
19
|
-
accept: "image*/",
|
|
20
|
-
onChange: () => true,
|
|
21
|
-
onDragEnter: onDragStart,
|
|
22
|
-
onDrop: onDragStop,
|
|
23
|
-
onDragLeave: onDragStop
|
|
24
|
-
})
|
|
10
|
+
}
|
|
25
11
|
};
|
|
26
12
|
//# sourceMappingURL=with-children.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/atom/drag-and-drop/test/fixtures/with-children.js"],"names":["
|
|
1
|
+
{"version":3,"sources":["../../../../../src/atom/drag-and-drop/test/fixtures/with-children.js"],"names":["props","previewContent","type","src","title","displayName","uploadLabel"],"mappings":"AAAA,eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,cAAc,EAAE;AACdC,MAAAA,IAAI,EAAE,OADQ;AAEdC,MAAAA,GAAG,EAAE;AAFS,KADX;AAKLC,IAAAA,KAAK,EAAE,aALF;AAMLC,IAAAA,WAAW,EAAE,cANR;AAOLC,IAAAA,WAAW,EAAE;AAPR;AADM,CAAf","sourcesContent":["export default {\n props: {\n previewContent: {\n type: 'image',\n src: 'https://static.coorpacademy.com/content/up/raw/logo_coorp-1491560495763.svg'\n },\n title: 'Desktop (*)',\n displayName: 'Upload image',\n uploadLabel: 'Upload'\n }\n};\n"],"file":"with-children.js"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/atom/drag-and-drop/test/fixtures/with-image.js"],"names":["props","
|
|
1
|
+
{"version":3,"sources":["../../../../../src/atom/drag-and-drop/test/fixtures/with-image.js"],"names":["props","title","description","uploadLabel","previewLabel","previewContent","type","src"],"mappings":"AAAA,eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,KAAK,EAAE,wBADF;AAELC,IAAAA,WAAW,EAAE,uCAFR;AAGLC,IAAAA,WAAW,EAAE,iBAHR;AAILC,IAAAA,YAAY,EAAE,cAJT;AAKLC,IAAAA,cAAc,EAAE;AACdC,MAAAA,IAAI,EAAE,OADQ;AAEdC,MAAAA,GAAG,EAAE;AAFS;AALX;AADM,CAAf","sourcesContent":["export default {\n props: {\n title: 'Drag & Drop With Image',\n description: 'Drag and drop component with an image',\n uploadLabel: 'Upload Image(s)',\n previewLabel: 'File Preview',\n previewContent: {\n type: 'image',\n src: 'https://static.coorpacademy.com/content/up/raw/logo_coorp-1491560495763.svg'\n }\n }\n};\n"],"file":"with-image.js"}
|
package/es/atom/drag-and-drop/test/fixtures/{withLongDescription.js → with-long-description.js}
RENAMED
|
@@ -9,4 +9,4 @@ export default {
|
|
|
9
9
|
description: '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).'
|
|
10
10
|
})
|
|
11
11
|
};
|
|
12
|
-
//# sourceMappingURL=
|
|
12
|
+
//# sourceMappingURL=with-long-description.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/atom/drag-and-drop/test/fixtures/with-long-description.js"],"names":["defaultProps","props","description"],"mappings":";;AAAA,OAAOA,YAAP,MAAyB,WAAzB;AAEA,MAAM;AAACC,EAAAA;AAAD,IAAUD,YAAhB;AACA,eAAe;AACbC,EAAAA,KAAK,wBACAA,KADA;AAEHC,IAAAA,WAAW,EACT;AAHC;AADQ,CAAf","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":"AAAA,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,CAAf","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"}
|
|
@@ -2,6 +2,7 @@ import test from 'ava';
|
|
|
2
2
|
import forEach from 'lodash/forEach';
|
|
3
3
|
import renderComponentMacro from '../../../test/helpers/render-component';
|
|
4
4
|
import AtomDragAndDrop from '..';
|
|
5
|
+
import fixtureCleanAndModified from './fixtures/clean-and-modified';
|
|
5
6
|
import fixtureDefault from './fixtures/default';
|
|
6
7
|
import fixtureError from './fixtures/error';
|
|
7
8
|
import fixtureLoading from './fixtures/loading';
|
|
@@ -9,14 +10,15 @@ import fixtureModified from './fixtures/modified';
|
|
|
9
10
|
import fixtureWithChildren from './fixtures/with-children';
|
|
10
11
|
import fixtureWithImageReset from './fixtures/with-image-reset';
|
|
11
12
|
import fixtureWithImage from './fixtures/with-image';
|
|
13
|
+
import fixtureWithLongDescription from './fixtures/with-long-description';
|
|
12
14
|
import fixtureWithVideo from './fixtures/with-video';
|
|
13
|
-
import fixtureWithLongDescription from './fixtures/withLongDescription';
|
|
14
15
|
test('Atom › AtomDragAndDrop > should have valid propTypes', t => {
|
|
15
16
|
t.pass();
|
|
16
17
|
forEach(AtomDragAndDrop.propTypes, (value, key) => {
|
|
17
18
|
t.not(value, undefined, `PropType for "Atom.AtomDragAndDrop.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
|
|
18
19
|
});
|
|
19
20
|
});
|
|
21
|
+
test('Atom › AtomDragAndDrop › CleanAndModified › should be rendered', renderComponentMacro, AtomDragAndDrop, fixtureCleanAndModified);
|
|
20
22
|
test('Atom › AtomDragAndDrop › Default › should be rendered', renderComponentMacro, AtomDragAndDrop, fixtureDefault);
|
|
21
23
|
test('Atom › AtomDragAndDrop › Error › should be rendered', renderComponentMacro, AtomDragAndDrop, fixtureError);
|
|
22
24
|
test('Atom › AtomDragAndDrop › Loading › should be rendered', renderComponentMacro, AtomDragAndDrop, fixtureLoading);
|
|
@@ -24,6 +26,6 @@ test('Atom › AtomDragAndDrop › Modified › should be rendered', renderCompo
|
|
|
24
26
|
test('Atom › AtomDragAndDrop › WithChildren › should be rendered', renderComponentMacro, AtomDragAndDrop, fixtureWithChildren);
|
|
25
27
|
test('Atom › AtomDragAndDrop › WithImageReset › should be rendered', renderComponentMacro, AtomDragAndDrop, fixtureWithImageReset);
|
|
26
28
|
test('Atom › AtomDragAndDrop › WithImage › should be rendered', renderComponentMacro, AtomDragAndDrop, fixtureWithImage);
|
|
27
|
-
test('Atom › AtomDragAndDrop › WithVideo › should be rendered', renderComponentMacro, AtomDragAndDrop, fixtureWithVideo);
|
|
28
29
|
test('Atom › AtomDragAndDrop › WithLongDescription › should be rendered', renderComponentMacro, AtomDragAndDrop, fixtureWithLongDescription);
|
|
30
|
+
test('Atom › AtomDragAndDrop › WithVideo › should be rendered', renderComponentMacro, AtomDragAndDrop, fixtureWithVideo);
|
|
29
31
|
//# sourceMappingURL=fixtures.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/atom/drag-and-drop/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","AtomDragAndDrop","fixtureDefault","fixtureError","fixtureLoading","fixtureModified","fixtureWithChildren","fixtureWithImageReset","fixtureWithImage","
|
|
1
|
+
{"version":3,"sources":["../../../../src/atom/drag-and-drop/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","AtomDragAndDrop","fixtureCleanAndModified","fixtureDefault","fixtureError","fixtureLoading","fixtureModified","fixtureWithChildren","fixtureWithImageReset","fixtureWithImage","fixtureWithLongDescription","fixtureWithVideo","t","pass","propTypes","value","key","not","undefined"],"mappings":"AAAA,OAAOA,IAAP,MAAiB,KAAjB;AACA,OAAOC,OAAP,MAAoB,gBAApB;AACA,OAAOC,oBAAP,MAAiC,wCAAjC;AACA,OAAOC,eAAP,MAA4B,IAA5B;AACA,OAAOC,uBAAP,MAAoC,+BAApC;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,YAAP,MAAyB,kBAAzB;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,eAAP,MAA4B,qBAA5B;AACA,OAAOC,mBAAP,MAAgC,0BAAhC;AACA,OAAOC,qBAAP,MAAkC,6BAAlC;AACA,OAAOC,gBAAP,MAA6B,uBAA7B;AACA,OAAOC,0BAAP,MAAuC,kCAAvC;AACA,OAAOC,gBAAP,MAA6B,uBAA7B;AAEAb,IAAI,CAAC,sDAAD,EAAyDc,CAAC,IAAI;AAChEA,EAAAA,CAAC,CAACC,IAAF;AACAd,EAAAA,OAAO,CAACE,eAAe,CAACa,SAAjB,EAA4B,CAACC,KAAD,EAAQC,GAAR,KAAgB;AACjDJ,IAAAA,CAAC,CAACK,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,gDAA+CF,GAAI,mEAA5E;AACD,GAFM,CAAP;AAGD,CALG,CAAJ;AAOAlB,IAAI,CAAC,gEAAD,EAAmEE,oBAAnE,EAAyFC,eAAzF,EAA0GC,uBAA1G,CAAJ;AACAJ,IAAI,CAAC,uDAAD,EAA0DE,oBAA1D,EAAgFC,eAAhF,EAAiGE,cAAjG,CAAJ;AACAL,IAAI,CAAC,qDAAD,EAAwDE,oBAAxD,EAA8EC,eAA9E,EAA+FG,YAA/F,CAAJ;AACAN,IAAI,CAAC,uDAAD,EAA0DE,oBAA1D,EAAgFC,eAAhF,EAAiGI,cAAjG,CAAJ;AACAP,IAAI,CAAC,wDAAD,EAA2DE,oBAA3D,EAAiFC,eAAjF,EAAkGK,eAAlG,CAAJ;AACAR,IAAI,CAAC,4DAAD,EAA+DE,oBAA/D,EAAqFC,eAArF,EAAsGM,mBAAtG,CAAJ;AACAT,IAAI,CAAC,8DAAD,EAAiEE,oBAAjE,EAAuFC,eAAvF,EAAwGO,qBAAxG,CAAJ;AACAV,IAAI,CAAC,yDAAD,EAA4DE,oBAA5D,EAAkFC,eAAlF,EAAmGQ,gBAAnG,CAAJ;AACAX,IAAI,CAAC,mEAAD,EAAsEE,oBAAtE,EAA4FC,eAA5F,EAA6GS,0BAA7G,CAAJ;AACAZ,IAAI,CAAC,yDAAD,EAA4DE,oBAA5D,EAAkFC,eAAlF,EAAmGU,gBAAnG,CAAJ","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":["Desktop","props","previewContent","modified"],"mappings":";;
|
|
1
|
+
{"version":3,"sources":["../../../../../src/atom/image-upload/test/fixtures/clean-modified.js"],"names":["Desktop","props","previewContent","modified"],"mappings":";;AAAA,OAAOA,OAAP,MAAoB,WAApB;AAEA,MAAM;AAACC,EAAAA;AAAD,IAAUD,OAAhB;AAEA,eAAe;AACbC,EAAAA,KAAK,wBACAA,KADA;AAEHC,IAAAA,cAAc,EAAE,EAFb;AAGHC,IAAAA,QAAQ,EAAE;AAHP;AADQ,CAAf","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":"AAAA,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,CAAf","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":["Desktop","props","title","description","previewContent","type","src"
|
|
1
|
+
{"version":3,"sources":["../../../../../src/atom/image-upload/test/fixtures/mobile.js"],"names":["Desktop","props","title","description","previewContent","type","src"],"mappings":";;AAAA,OAAOA,OAAP,MAAoB,WAApB;AAEA,MAAM;AAACC,EAAAA;AAAD,IAAUD,OAAhB;AAEA,eAAe;AACbC,EAAAA,KAAK,wBACAA,KADA;AAEHC,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,CAAf","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"}
|
|
@@ -12,6 +12,7 @@ const InputTextWithTitle = props => {
|
|
|
12
12
|
'data-name': dataName,
|
|
13
13
|
'aria-label': ariaLabel
|
|
14
14
|
} = props;
|
|
15
|
+
const inputTextClass = inputText.size === 'small' ? style.smallInputText : style.defaultInputText;
|
|
15
16
|
return /*#__PURE__*/React.createElement("div", {
|
|
16
17
|
className: style.container,
|
|
17
18
|
"data-name": dataName,
|
|
@@ -19,13 +20,14 @@ const InputTextWithTitle = props => {
|
|
|
19
20
|
}, /*#__PURE__*/React.createElement("span", {
|
|
20
21
|
className: style.title
|
|
21
22
|
}, title), /*#__PURE__*/React.createElement("div", {
|
|
22
|
-
className:
|
|
23
|
+
className: inputTextClass
|
|
23
24
|
}, /*#__PURE__*/React.createElement(InputText, inputText)));
|
|
24
25
|
};
|
|
25
26
|
|
|
26
27
|
InputTextWithTitle.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
27
28
|
inputText: PropTypes.shape(_extends(_extends({}, InputText.propTypes), {}, {
|
|
28
|
-
theme: PropTypes.string
|
|
29
|
+
theme: PropTypes.string,
|
|
30
|
+
size: PropTypes.string
|
|
29
31
|
})),
|
|
30
32
|
title: PropTypes.string,
|
|
31
33
|
'aria-label': PropTypes.string,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/atom/input-text-with-title/index.js"],"names":["React","PropTypes","InputText","style","InputTextWithTitle","props","inputText","title","dataName","ariaLabel","container","propTypes","shape","theme","string"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,SAAP,MAAsB,eAAtB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,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":["React","PropTypes","InputText","style","InputTextWithTitle","props","inputText","title","dataName","ariaLabel","inputTextClass","size","smallInputText","defaultInputText","container","propTypes","shape","theme","string"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,SAAP,MAAsB,eAAtB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,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,GAA6BR,KAAK,CAACS,cAAnC,GAAoDT,KAAK,CAACU,gBAAjF;AAEA,sBACE;AAAK,IAAA,SAAS,EAAEV,KAAK,CAACW,SAAtB;AAAiC,iBAAWN,QAA5C;AAAsD,kBAAYC;AAAlE,kBACE;AAAM,IAAA,SAAS,EAAEN,KAAK,CAACI;AAAvB,KAA+BA,KAA/B,CADF,eAEE;AAAK,IAAA,SAAS,EAAEG;AAAhB,kBACE,oBAAC,SAAD,EAAeJ,SAAf,CADF,CAFF,CADF;AAQD,CAZD;;AAcAF,kBAAkB,CAACW,SAAnB,2CAA+B;AAC7BT,EAAAA,SAAS,EAAEL,SAAS,CAACe,KAAV,uBACNd,SAAS,CAACa,SADJ;AAETE,IAAAA,KAAK,EAAEhB,SAAS,CAACiB,MAFR;AAGTP,IAAAA,IAAI,EAAEV,SAAS,CAACiB;AAHP,KADkB;AAM7BX,EAAAA,KAAK,EAAEN,SAAS,CAACiB,MANY;AAO7B,gBAAcjB,SAAS,CAACiB,MAPK;AAQ7B,eAAajB,SAAS,CAACiB;AARM,CAA/B;AAUA,eAAed,kBAAf","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"}
|
|
@@ -5,8 +5,10 @@ export default {
|
|
|
5
5
|
props: {
|
|
6
6
|
title: 'Mandatory courses to complete certification',
|
|
7
7
|
inputText: _extends(_extends({}, inputText.props), {}, {
|
|
8
|
+
title: 'Amount (6 items max)',
|
|
8
9
|
error: 'this is error',
|
|
9
|
-
hint: ''
|
|
10
|
+
hint: '',
|
|
11
|
+
size: 'small'
|
|
10
12
|
})
|
|
11
13
|
}
|
|
12
14
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/atom/input-text-with-title/test/fixtures/error.js"],"names":["inputText","props","title","error","hint"],"mappings":";;AAAA,OAAOA,SAAP,MAAsB,8CAAtB;AAEA,eAAe;AACbC,EAAAA,KAAK,EAAE;AACLC,IAAAA,KAAK,EAAE,6CADF;AAELF,IAAAA,SAAS,
|
|
1
|
+
{"version":3,"sources":["../../../../../src/atom/input-text-with-title/test/fixtures/error.js"],"names":["inputText","props","title","error","hint","size"],"mappings":";;AAAA,OAAOA,SAAP,MAAsB,8CAAtB;AAEA,eAAe;AACbC,EAAAA,KAAK,EAAE;AACLC,IAAAA,KAAK,EAAE,6CADF;AAELF,IAAAA,SAAS,wBACJA,SAAS,CAACC,KADN;AAEPC,MAAAA,KAAK,EAAE,sBAFA;AAGPC,MAAAA,KAAK,EAAE,eAHA;AAIPC,MAAAA,IAAI,EAAE,EAJC;AAKPC,MAAAA,IAAI,EAAE;AALC;AAFJ;AADM,CAAf","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"}
|