@coorpacademy/components 10.17.2 → 10.17.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -97,7 +97,7 @@ class DragAndDrop extends React.Component {
97
97
  }
98
98
 
99
99
  const resetContent = previewContent && previewContent.src ? /*#__PURE__*/React.createElement("div", {
100
- className: style.resetUploadWrapper
100
+ className: classnames(style.resetUploadWrapper, disabled && style.disabled)
101
101
  }, /*#__PURE__*/React.createElement("div", {
102
102
  className: style.resetSrcLabel
103
103
  }, previewContent.label ? previewContent.label : previewContent.src), onReset ? /*#__PURE__*/React.createElement(Close, {
@@ -155,7 +155,7 @@ class DragAndDrop extends React.Component {
155
155
  }, description) : null, error ? null : /*#__PURE__*/React.createElement("div", {
156
156
  className: style.dragAndDropLabel
157
157
  }, 'Drag & Drop here')), button, /*#__PURE__*/React.createElement("div", null, children(this.handleDragStart, this.handleDragStop))), error ? /*#__PURE__*/React.createElement("span", {
158
- className: style.errorMessage
158
+ className: classnames(style.errorMessage, disabled && style.disabled)
159
159
  }, error) : resetContent);
160
160
  }
161
161
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/atom/drag-and-drop/index.js"],"names":["React","PropTypes","NovaSolidStatusClose","Close","NovaSolidFilesBasicFileUpload2","FileUploadIcon","NovaSolidFilesBasicFileBlock2","FileUploadBlockedIcon","classnames","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","buttonAriaLabel","errorButtonLabel","disabled","previewView","type","preview","src","loaderWrapper","loadingCancel","closeIcon","loader","loaderText","resetContent","resetUploadWrapper","resetSrcLabel","label","buildButton","defaultButtonProps","icon","position","button","previewContainer","modifiedPreviewContainer","inputWrapper","modifiedInputWrapper","errorInputWrapper","wrapper","infosContainer","iconError","dragAndDropLabel","errorMessage","propTypes","string","shape","bool","func"],"mappings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,KAAKN,eAAN,EAAuB,KAAKE,cAA5B,CAAd,CAjBF,CAPJ,EA2BGa,KAAK,gBAAG;AAAM,MAAA,SAAS,EAAEvB,KAAK,CAACsD;AAAvB,OAAsC/B,KAAtC,CAAH,GAAyDa,YA3BjE,CADF;AA+BD;;AAxLuC;;AAApClC,W,CACGqD,S,2CAAY;AACjBxC,EAAAA,KAAK,EAAE1B,SAAS,CAACmE,MADA;AAEjBxC,EAAAA,WAAW,EAAE3B,SAAS,CAACmE,MAFN;AAGjBvC,EAAAA,WAAW,EAAE5B,SAAS,CAACmE,MAHN;AAIjBtC,EAAAA,YAAY,EAAE7B,SAAS,CAACmE,MAJP;AAKjBrC,EAAAA,cAAc,EAAE9B,SAAS,CAACoE,KAAV,CAAgB;AAC9B7B,IAAAA,IAAI,EAAEvC,SAAS,CAACmE,MADc;AAE9B1B,IAAAA,GAAG,EAAEzC,SAAS,CAACmE,MAFe;AAG9BjB,IAAAA,KAAK,EAAElD,SAAS,CAACmE;AAHa,GAAhB,CALC;AAUjBpC,EAAAA,OAAO,EAAE/B,SAAS,CAACqE,IAVF;AAWjBrC,EAAAA,QAAQ,EAAEhC,SAAS,CAACqE,IAXH;AAYjBhC,EAAAA,QAAQ,EAAErC,SAAS,CAACqE,IAZH;AAajB5C,EAAAA,QAAQ,EAAEzB,SAAS,CAACsE,IAbH;AAcjBrC,EAAAA,OAAO,EAAEjC,SAAS,CAACsE,IAdF;AAejBpC,EAAAA,KAAK,EAAElC,SAAS,CAACmE,MAfA;AAgBjBhC,EAAAA,eAAe,EAAEnC,SAAS,CAACmE,MAhBV;AAiBjB/B,EAAAA,gBAAgB,EAAEpC,SAAS,CAACmE;AAjBX,C;AA0LrB,eAAetD,WAAf","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {uniqueId, constant, isEmpty} from 'lodash/fp';\nimport {\n NovaSolidStatusClose as Close,\n NovaSolidFilesBasicFileUpload2 as FileUploadIcon,\n NovaSolidFilesBasicFileBlock2 as FileUploadBlockedIcon\n} from '@coorpacademy/nova-icons';\nimport classnames from 'classnames';\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 label: PropTypes.string\n }),\n loading: PropTypes.bool,\n modified: PropTypes.bool,\n disabled: PropTypes.bool,\n children: PropTypes.func,\n onReset: PropTypes.func,\n error: PropTypes.string,\n buttonAriaLabel: PropTypes.string,\n errorButtonLabel: 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 buttonAriaLabel = '',\n errorButtonLabel = '',\n disabled = 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={12}\n width={12}\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}>\n {previewContent.label ? previewContent.label : previewContent.src}\n </div>\n {onReset ? (\n <Close\n data-name=\"reset-content-icon\"\n height={12}\n width={12}\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': buttonAriaLabel,\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={errorButtonLabel} 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 <div className={style.title}>{title}</div>\n {!isEmpty(previewContent) || loading ? (\n <div className={classnames(previewContainer, disabled && style.disabled)}>\n {previewView}\n </div>\n ) : (\n <div\n className={classnames(\n dragging ? style.dragging : inputWrapper,\n disabled && style.disabled\n )}\n id={idBox}\n >\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.dragAndDropLabel}>{'Drag & Drop here'}</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","NovaSolidStatusClose","Close","NovaSolidFilesBasicFileUpload2","FileUploadIcon","NovaSolidFilesBasicFileBlock2","FileUploadBlockedIcon","classnames","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","buttonAriaLabel","errorButtonLabel","disabled","previewView","type","preview","src","loaderWrapper","loadingCancel","closeIcon","loader","loaderText","resetContent","resetUploadWrapper","resetSrcLabel","label","buildButton","defaultButtonProps","icon","position","button","previewContainer","modifiedPreviewContainer","inputWrapper","modifiedInputWrapper","errorInputWrapper","wrapper","infosContainer","iconError","dragAndDropLabel","errorMessage","propTypes","string","shape","bool","func"],"mappings":";;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,SACEC,oBAAoB,IAAIC,KAD1B,EAEEC,8BAA8B,IAAIC,cAFpC,EAGEC,6BAA6B,IAAIC,qBAHnC,QAIO,0BAJP;AAKA,OAAOC,UAAP,MAAuB,YAAvB;AACA,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,SAA0Bd,KAAK,CAACe,SAAhC,CAA0C;AAqBxCC,EAAAA,WAAW,CAACC,KAAD,EAAQ;AACjB,UAAMA,KAAN;AAEA,SAAKC,KAAL,GAAa;AACXC,MAAAA,QAAQ,EAAE;AADC,KAAb;AAIA,SAAKC,eAAL,GAAuB,KAAKA,eAAL,CAAqBC,IAArB,CAA0B,IAA1B,CAAvB;AACA,SAAKC,cAAL,GAAsB,KAAKA,cAAL,CAAoBD,IAApB,CAAyB,IAAzB,CAAtB;AACD;;AAEDD,EAAAA,eAAe,GAAG;AACh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C,EAAAA,OAAO,EAAE/B,SAAS,CAACqE,IAVF;AAWjBrC,EAAAA,QAAQ,EAAEhC,SAAS,CAACqE,IAXH;AAYjBhC,EAAAA,QAAQ,EAAErC,SAAS,CAACqE,IAZH;AAajB5C,EAAAA,QAAQ,EAAEzB,SAAS,CAACsE,IAbH;AAcjBrC,EAAAA,OAAO,EAAEjC,SAAS,CAACsE,IAdF;AAejBpC,EAAAA,KAAK,EAAElC,SAAS,CAACmE,MAfA;AAgBjBhC,EAAAA,eAAe,EAAEnC,SAAS,CAACmE,MAhBV;AAiBjB/B,EAAAA,gBAAgB,EAAEpC,SAAS,CAACmE;AAjBX,C;AAgMrB,eAAetD,WAAf","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {uniqueId, constant, isEmpty} from 'lodash/fp';\nimport {\n NovaSolidStatusClose as Close,\n NovaSolidFilesBasicFileUpload2 as FileUploadIcon,\n NovaSolidFilesBasicFileBlock2 as FileUploadBlockedIcon\n} from '@coorpacademy/nova-icons';\nimport classnames from 'classnames';\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 label: PropTypes.string\n }),\n loading: PropTypes.bool,\n modified: PropTypes.bool,\n disabled: PropTypes.bool,\n children: PropTypes.func,\n onReset: PropTypes.func,\n error: PropTypes.string,\n buttonAriaLabel: PropTypes.string,\n errorButtonLabel: 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 buttonAriaLabel = '',\n errorButtonLabel = '',\n disabled = 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={12}\n width={12}\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={classnames(style.resetUploadWrapper, disabled && style.disabled)}>\n <div className={style.resetSrcLabel}>\n {previewContent.label ? previewContent.label : previewContent.src}\n </div>\n {onReset ? (\n <Close\n data-name=\"reset-content-icon\"\n height={12}\n width={12}\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': buttonAriaLabel,\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={errorButtonLabel} 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 <div className={style.title}>{title}</div>\n {!isEmpty(previewContent) || loading ? (\n <div className={classnames(previewContainer, disabled && style.disabled)}>\n {previewView}\n </div>\n ) : (\n <div\n className={classnames(\n dragging ? style.dragging : inputWrapper,\n disabled && style.disabled\n )}\n id={idBox}\n >\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.dragAndDropLabel}>{'Drag & Drop here'}</div>}\n </div>\n {button}\n <div>{children(this.handleDragStart, this.handleDragStop)}</div>\n </div>\n )}\n {error ? (\n <span className={classnames(style.errorMessage, disabled && style.disabled)}>\n {error}\n </span>\n ) : (\n resetContent\n )}\n </div>\n );\n }\n}\n\nexport default DragAndDrop;\n"],"file":"index.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 withImageReset from './with-image-reset';
4
+ const {
5
+ props
6
+ } = withImageReset;
7
+ export default {
8
+ props: _extends(_extends({}, props), {}, {
9
+ disabled: true
10
+ })
11
+ };
12
+ //# sourceMappingURL=disabled-with-image-reset.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/atom/drag-and-drop/test/fixtures/disabled-with-image-reset.js"],"names":["withImageReset","props","disabled"],"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 disabled: true\n }\n};\n"],"file":"disabled-with-image-reset.js"}
@@ -4,6 +4,7 @@ import renderComponentMacro from '../../../test/helpers/render-component';
4
4
  import AtomDragAndDrop from '..';
5
5
  import fixtureCleanAndModified from './fixtures/clean-and-modified';
6
6
  import fixtureDefault from './fixtures/default';
7
+ import fixtureDisabledWithImageReset from './fixtures/disabled-with-image-reset';
7
8
  import fixtureDisabled from './fixtures/disabled';
8
9
  import fixtureError from './fixtures/error';
9
10
  import fixtureLoading from './fixtures/loading';
@@ -21,6 +22,7 @@ test('Atom › AtomDragAndDrop > should have valid propTypes', t => {
21
22
  });
22
23
  test('Atom › AtomDragAndDrop › CleanAndModified › should be rendered', renderComponentMacro, AtomDragAndDrop, fixtureCleanAndModified);
23
24
  test('Atom › AtomDragAndDrop › Default › should be rendered', renderComponentMacro, AtomDragAndDrop, fixtureDefault);
25
+ test('Atom › AtomDragAndDrop › DisabledWithImageReset › should be rendered', renderComponentMacro, AtomDragAndDrop, fixtureDisabledWithImageReset);
24
26
  test('Atom › AtomDragAndDrop › Disabled › should be rendered', renderComponentMacro, AtomDragAndDrop, fixtureDisabled);
25
27
  test('Atom › AtomDragAndDrop › Error › should be rendered', renderComponentMacro, AtomDragAndDrop, fixtureError);
26
28
  test('Atom › AtomDragAndDrop › Loading › should be rendered', renderComponentMacro, AtomDragAndDrop, fixtureLoading);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/atom/drag-and-drop/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","AtomDragAndDrop","fixtureCleanAndModified","fixtureDefault","fixtureDisabled","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,wC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/D,EAAqFC,eAArF,EAAsGO,mBAAtG,CAAJ;AACAV,IAAI,CAAC,8DAAD,EAAiEE,oBAAjE,EAAuFC,eAAvF,EAAwGQ,qBAAxG,CAAJ;AACAX,IAAI,CAAC,yDAAD,EAA4DE,oBAA5D,EAAkFC,eAAlF,EAAmGS,gBAAnG,CAAJ;AACAZ,IAAI,CAAC,mEAAD,EAAsEE,oBAAtE,EAA4FC,eAA5F,EAA6GU,0BAA7G,CAAJ;AACAb,IAAI,CAAC,yDAAD,EAA4DE,oBAA5D,EAAkFC,eAAlF,EAAmGW,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 fixtureDisabled from './fixtures/disabled';\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 › Disabled › should be rendered', renderComponentMacro, AtomDragAndDrop, fixtureDisabled);\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
+ {"version":3,"sources":["../../../../src/atom/drag-and-drop/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","AtomDragAndDrop","fixtureCleanAndModified","fixtureDefault","fixtureDisabledWithImageReset","fixtureDisabled","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,6BAAP,MAA0C,sCAA1C;AACA,OAAOC,eAAP,MAA4B,qBAA5B;AACA,OAAOC,YAAP,MAAyB,kBAAzB;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,eAAP,MAA4B,qBAA5B;AACA,OAAOC,mBAAP,MAAgC,0BAAhC;AACA,OAAOC,qBAAP,MAA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AAI,CAAC,mEAAD,EAAsEE,oBAAtE,EAA4FC,eAA5F,EAA6GW,0BAA7G,CAAJ;AACAd,IAAI,CAAC,yDAAD,EAA4DE,oBAA5D,EAAkFC,eAAlF,EAAmGY,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 fixtureDisabledWithImageReset from './fixtures/disabled-with-image-reset';\nimport fixtureDisabled from './fixtures/disabled';\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 › DisabledWithImageReset › should be rendered', renderComponentMacro, AtomDragAndDrop, fixtureDisabledWithImageReset);\ntest('Atom › AtomDragAndDrop › Disabled › should be rendered', renderComponentMacro, AtomDragAndDrop, fixtureDisabled);\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"}
@@ -112,7 +112,7 @@ class DragAndDrop extends _react.default.Component {
112
112
  }
113
113
 
114
114
  const resetContent = previewContent && previewContent.src ? /*#__PURE__*/_react.default.createElement("div", {
115
- className: _style.default.resetUploadWrapper
115
+ className: (0, _classnames.default)(_style.default.resetUploadWrapper, disabled && _style.default.disabled)
116
116
  }, /*#__PURE__*/_react.default.createElement("div", {
117
117
  className: _style.default.resetSrcLabel
118
118
  }, previewContent.label ? previewContent.label : previewContent.src), onReset ? /*#__PURE__*/_react.default.createElement(_novaIcons.NovaSolidStatusClose, {
@@ -170,7 +170,7 @@ class DragAndDrop extends _react.default.Component {
170
170
  }, description) : null, error ? null : /*#__PURE__*/_react.default.createElement("div", {
171
171
  className: _style.default.dragAndDropLabel
172
172
  }, 'Drag & Drop here')), button, /*#__PURE__*/_react.default.createElement("div", null, children(this.handleDragStart, this.handleDragStop))), error ? /*#__PURE__*/_react.default.createElement("span", {
173
- className: _style.default.errorMessage
173
+ className: (0, _classnames.default)(_style.default.errorMessage, disabled && _style.default.disabled)
174
174
  }, error) : resetContent);
175
175
  }
176
176
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/atom/drag-and-drop/index.js"],"names":["constantNull","DragAndDrop","React","Component","constructor","props","state","dragging","handleDragStart","bind","handleDragStop","setState","render","idBox","children","title","description","uploadLabel","previewLabel","previewContent","loading","modified","onReset","error","buttonAriaLabel","errorButtonLabel","disabled","previewView","type","style","preview","src","loaderWrapper","loadingCancel","closeIcon","loader","loaderText","resetContent","resetUploadWrapper","resetSrcLabel","label","buildButton","defaultButtonProps","icon","position","button","previewContainer","modifiedPreviewContainer","inputWrapper","modifiedInputWrapper","errorInputWrapper","wrapper","infosContainer","iconError","dragAndDropLabel","errorMessage","propTypes","PropTypes","string","shape","bool","func"],"mappings":";;;;;;;;;;;AAAA;;AACA;;AAEA;;AAKA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEA,MAAMA,YAAY,GAAG,wBAAS,IAAT,CAArB;;AAEA,MAAMC,WAAN,SAA0BC,eAAMC,SAAhC,CAA0C;AAqBxCC,EAAAA,WAAW,CAACC,KAAD,EAAQ;AACjB,UAAMA,KAAN;AAEA,SAAKC,KAAL,GAAa;AACXC,MAAAA,QAAQ,EAAE;AADC,KAAb;AAIA,SAAKC,eAAL,GAAuB,KAAKA,eAAL,CAAqBC,IAArB,CAA0B,IAA1B,CAAvB;AACA,SAAKC,cAAL,GAAsB,KAAKA,cAAL,CAAoBD,IAApB,CAAyB,IAAzB,CAAtB;AACD;;AAEDD,EAAAA,eAAe,GAAG;AAChB,SAAKG,QAAL,CAAc;AACZJ,MAAAA,QAAQ,EAAE;AADE,KAAd;AAGD;;AAEDG,EAAAA,cAAc,GAAG;AACf,SAAKC,QAAL,CAAc;AACZJ,MAAAA,QAAQ,EAAE;AADE,KAAd;AAGD;;AAEDK,EAAAA,MAAM,GAAG;AACP,UAAMC,KAAK,GAAG,wBAAS,WAAT,CAAd;AACA,UAAM;AACJC,MAAAA,QAAQ,GAAGd,YADP;AAEJe,MAAAA,KAFI;AAGJC,MAAAA,WAHI;AAIJC,MAAAA,WAJI;AAKJC,MAAAA,YAAY,GAAG,EALX;AAMJC,MAAAA,cANI;AAOJC,MAAAA,OAAO,GAAG,KAPN;AAQ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AH,GAAyDc,YA3BjE,CADF;AA+BD;;AAxLuC;;AAApCpC,W,CACGuD,S,2CAAY;AACjBzC,EAAAA,KAAK,EAAE0C,mBAAUC,MADA;AAEjB1C,EAAAA,WAAW,EAAEyC,mBAAUC,MAFN;AAGjBzC,EAAAA,WAAW,EAAEwC,mBAAUC,MAHN;AAIjBxC,EAAAA,YAAY,EAAEuC,mBAAUC,MAJP;AAKjBvC,EAAAA,cAAc,EAAEsC,mBAAUE,KAAV,CAAgB;AAC9B/B,IAAAA,IAAI,EAAE6B,mBAAUC,MADc;AAE9B3B,IAAAA,GAAG,EAAE0B,mBAAUC,MAFe;AAG9BlB,IAAAA,KAAK,EAAEiB,mBAAUC;AAHa,GAAhB,CALC;AAUjBtC,EAAAA,OAAO,EAAEqC,mBAAUG,IAVF;AAWjBvC,EAAAA,QAAQ,EAAEoC,mBAAUG,IAXH;AAYjBlC,EAAAA,QAAQ,EAAE+B,mBAAUG,IAZH;AAajB9C,EAAAA,QAAQ,EAAE2C,mBAAUI,IAbH;AAcjBvC,EAAAA,OAAO,EAAEmC,mBAAUI,IAdF;AAejBtC,EAAAA,KAAK,EAAEkC,mBAAUC,MAfA;AAgBjBlC,EAAAA,eAAe,EAAEiC,mBAAUC,MAhBV;AAiBjBjC,EAAAA,gBAAgB,EAAEgC,mBAAUC;AAjBX,C;eA0LNzD,W","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {uniqueId, constant, isEmpty} from 'lodash/fp';\nimport {\n NovaSolidStatusClose as Close,\n NovaSolidFilesBasicFileUpload2 as FileUploadIcon,\n NovaSolidFilesBasicFileBlock2 as FileUploadBlockedIcon\n} from '@coorpacademy/nova-icons';\nimport classnames from 'classnames';\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 label: PropTypes.string\n }),\n loading: PropTypes.bool,\n modified: PropTypes.bool,\n disabled: PropTypes.bool,\n children: PropTypes.func,\n onReset: PropTypes.func,\n error: PropTypes.string,\n buttonAriaLabel: PropTypes.string,\n errorButtonLabel: 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 buttonAriaLabel = '',\n errorButtonLabel = '',\n disabled = 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={12}\n width={12}\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}>\n {previewContent.label ? previewContent.label : previewContent.src}\n </div>\n {onReset ? (\n <Close\n data-name=\"reset-content-icon\"\n height={12}\n width={12}\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': buttonAriaLabel,\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={errorButtonLabel} 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 <div className={style.title}>{title}</div>\n {!isEmpty(previewContent) || loading ? (\n <div className={classnames(previewContainer, disabled && style.disabled)}>\n {previewView}\n </div>\n ) : (\n <div\n className={classnames(\n dragging ? style.dragging : inputWrapper,\n disabled && style.disabled\n )}\n id={idBox}\n >\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.dragAndDropLabel}>{'Drag & Drop here'}</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":["constantNull","DragAndDrop","React","Component","constructor","props","state","dragging","handleDragStart","bind","handleDragStop","setState","render","idBox","children","title","description","uploadLabel","previewLabel","previewContent","loading","modified","onReset","error","buttonAriaLabel","errorButtonLabel","disabled","previewView","type","style","preview","src","loaderWrapper","loadingCancel","closeIcon","loader","loaderText","resetContent","resetUploadWrapper","resetSrcLabel","label","buildButton","defaultButtonProps","icon","position","button","previewContainer","modifiedPreviewContainer","inputWrapper","modifiedInputWrapper","errorInputWrapper","wrapper","infosContainer","iconError","dragAndDropLabel","errorMessage","propTypes","PropTypes","string","shape","bool","func"],"mappings":";;;;;;;;;;;AAAA;;AACA;;AAEA;;AAKA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEA,MAAMA,YAAY,GAAG,wBAAS,IAAT,CAArB;;AAEA,MAAMC,WAAN,SAA0BC,eAAMC,SAAhC,CAA0C;AAqBxCC,EAAAA,WAAW,CAACC,KAAD,EAAQ;AACjB,UAAMA,KAAN;AAEA,SAAKC,KAAL,GAAa;AACXC,MAAAA,QAAQ,EAAE;AADC,KAAb;AAIA,SAAKC,eAAL,GAAuB,KAAKA,eAAL,CAAqBC,IAArB,CAA0B,IAA1B,CAAvB;AACA,SAAKC,cAAL,GAAsB,KAAKA,cAAL,CAAoBD,IAApB,CAAyB,IAAzB,CAAtB;AACD;;AAEDD,EAAAA,eAAe,GAAG;AAChB,SAAKG,QAAL,CAAc;AACZJ,MAAAA,QAAQ,EAAE;AADE,KAAd;AAGD;;AAEDG,EAAAA,cAAc,GAAG;AACf,SAAKC,QAAL,CAAc;AACZJ,MAAAA,QAAQ,EAAE;AADE,KAAd;AAGD;;AAEDK,EAAAA,MAAM,GAAG;AACP,UAAMC,KAAK,GAAG,wBAAS,WAAT,CAAd;AACA,UAAM;AACJC,MAAAA,QAAQ,GAAGd,YADP;AAEJe,MAAAA,KAFI;AAGJC,MAAAA,WAHI;AAIJC,MAAAA,WAJI;AAKJC,MAAAA,YAAY,GAAG,EALX;AAMJC,MAAAA,cANI;AAOJC,MAAAA,OAAO,GAAG,KAPN;AAQJC,MAAAA,QAAQ,GAAG,KARP;AASJC,MAAAA,OAAO,GAAG,IATN;AAUJC,MAAAA,KAAK,GAAG,EAVJ;AAWJC,MAAAA,eAAe,GAAG,EAXd;AAYJC,MAAAA,gBAAgB,GAAG,EAZf;AAaJC,MAAAA,QAAQ,GAAG;AAbP,QA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AE0C,mBAAUC,MADA;AAEjB1C,EAAAA,WAAW,EAAEyC,mBAAUC,MAFN;AAGjBzC,EAAAA,WAAW,EAAEwC,mBAAUC,MAHN;AAIjBxC,EAAAA,YAAY,EAAEuC,mBAAUC,MAJP;AAKjBvC,EAAAA,cAAc,EAAEsC,mBAAUE,KAAV,CAAgB;AAC9B/B,IAAAA,IAAI,EAAE6B,mBAAUC,MADc;AAE9B3B,IAAAA,GAAG,EAAE0B,mBAAUC,MAFe;AAG9BlB,IAAAA,KAAK,EAAEiB,mBAAUC;AAHa,GAAhB,CALC;AAUjBtC,EAAAA,OAAO,EAAEqC,mBAAUG,IAVF;AAWjBvC,EAAAA,QAAQ,EAAEoC,mBAAUG,IAXH;AAYjBlC,EAAAA,QAAQ,EAAE+B,mBAAUG,IAZH;AAajB9C,EAAAA,QAAQ,EAAE2C,mBAAUI,IAbH;AAcjBvC,EAAAA,OAAO,EAAEmC,mBAAUI,IAdF;AAejBtC,EAAAA,KAAK,EAAEkC,mBAAUC,MAfA;AAgBjBlC,EAAAA,eAAe,EAAEiC,mBAAUC,MAhBV;AAiBjBjC,EAAAA,gBAAgB,EAAEgC,mBAAUC;AAjBX,C;eAgMNzD,W","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {uniqueId, constant, isEmpty} from 'lodash/fp';\nimport {\n NovaSolidStatusClose as Close,\n NovaSolidFilesBasicFileUpload2 as FileUploadIcon,\n NovaSolidFilesBasicFileBlock2 as FileUploadBlockedIcon\n} from '@coorpacademy/nova-icons';\nimport classnames from 'classnames';\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 label: PropTypes.string\n }),\n loading: PropTypes.bool,\n modified: PropTypes.bool,\n disabled: PropTypes.bool,\n children: PropTypes.func,\n onReset: PropTypes.func,\n error: PropTypes.string,\n buttonAriaLabel: PropTypes.string,\n errorButtonLabel: 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 buttonAriaLabel = '',\n errorButtonLabel = '',\n disabled = 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={12}\n width={12}\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={classnames(style.resetUploadWrapper, disabled && style.disabled)}>\n <div className={style.resetSrcLabel}>\n {previewContent.label ? previewContent.label : previewContent.src}\n </div>\n {onReset ? (\n <Close\n data-name=\"reset-content-icon\"\n height={12}\n width={12}\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': buttonAriaLabel,\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={errorButtonLabel} 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 <div className={style.title}>{title}</div>\n {!isEmpty(previewContent) || loading ? (\n <div className={classnames(previewContainer, disabled && style.disabled)}>\n {previewView}\n </div>\n ) : (\n <div\n className={classnames(\n dragging ? style.dragging : inputWrapper,\n disabled && style.disabled\n )}\n id={idBox}\n >\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.dragAndDropLabel}>{'Drag & Drop here'}</div>}\n </div>\n {button}\n <div>{children(this.handleDragStart, this.handleDragStop)}</div>\n </div>\n )}\n {error ? (\n <span className={classnames(style.errorMessage, disabled && style.disabled)}>\n {error}\n </span>\n ) : (\n resetContent\n )}\n </div>\n );\n }\n}\n\nexport default DragAndDrop;\n"],"file":"index.js"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.default = void 0;
5
+
6
+ var _withImageReset = _interopRequireDefault(require("./with-image-reset"));
7
+
8
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9
+
10
+ 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); }
11
+
12
+ const {
13
+ props
14
+ } = _withImageReset.default;
15
+ var _default = {
16
+ props: _extends(_extends({}, props), {}, {
17
+ disabled: true
18
+ })
19
+ };
20
+ exports.default = _default;
21
+ //# sourceMappingURL=disabled-with-image-reset.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/atom/drag-and-drop/test/fixtures/disabled-with-image-reset.js"],"names":["props","withImageReset","disabled"],"mappings":";;;;;AAAA;;;;;;AAEA,MAAM;AAACA,EAAAA;AAAD,IAAUC,uBAAhB;eAEe;AACbD,EAAAA,KAAK,wBACAA,KADA;AAEHE,IAAAA,QAAQ,EAAE;AAFP;AADQ,C","sourcesContent":["import withImageReset from './with-image-reset';\n\nconst {props} = withImageReset;\n\nexport default {\n props: {\n ...props,\n disabled: true\n }\n};\n"],"file":"disabled-with-image-reset.js"}
@@ -12,6 +12,8 @@ var _cleanAndModified = _interopRequireDefault(require("./fixtures/clean-and-mod
12
12
 
13
13
  var _default = _interopRequireDefault(require("./fixtures/default"));
14
14
 
15
+ var _disabledWithImageReset = _interopRequireDefault(require("./fixtures/disabled-with-image-reset"));
16
+
15
17
  var _disabled = _interopRequireDefault(require("./fixtures/disabled"));
16
18
 
17
19
  var _error = _interopRequireDefault(require("./fixtures/error"));
@@ -40,6 +42,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
40
42
  });
41
43
  (0, _ava.default)('Atom › AtomDragAndDrop › CleanAndModified › should be rendered', _renderComponent.default, _.default, _cleanAndModified.default);
42
44
  (0, _ava.default)('Atom › AtomDragAndDrop › Default › should be rendered', _renderComponent.default, _.default, _default.default);
45
+ (0, _ava.default)('Atom › AtomDragAndDrop › DisabledWithImageReset › should be rendered', _renderComponent.default, _.default, _disabledWithImageReset.default);
43
46
  (0, _ava.default)('Atom › AtomDragAndDrop › Disabled › should be rendered', _renderComponent.default, _.default, _disabled.default);
44
47
  (0, _ava.default)('Atom › AtomDragAndDrop › Error › should be rendered', _renderComponent.default, _.default, _error.default);
45
48
  (0, _ava.default)('Atom › AtomDragAndDrop › Loading › should be rendered', _renderComponent.default, _.default, _loading.default);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/atom/drag-and-drop/test/fixtures.js"],"names":["t","pass","AtomDragAndDrop","propTypes","value","key","not","undefined","renderComponentMacro","fixtureCleanAndModified","fixtureDefault","fixtureDisabled","fixtureError","fixtureLoading","fixtureModified","fixtureWithChildren","fixtureWithImageReset","fixtureWithImage","fixtureWithLongDescription","fixtureWithVideo"],"mappings":";;AAAA;;AACA;;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,wDAAL,EAA+DF,wBAA/D,EAAqFN,SAArF,EAAsGS,iBAAtG;AACA,kBAAK,qDAAL,EAA4DH,wBAA5D,EAAkFN,SAAlF,EAAmGU,cAAnG;AACA,kBAAK,uDAAL,EAA8DJ,wBAA9D,EAAoFN,SAApF,EAAqGW,gBAArG;AACA,kBAAK,wDAAL,EAA+DL,wBAA/D,EAAqFN,SAArF,EAAsGY,iBAAtG;AACA,kBAAK,4DAAL,EAAmEN,wBAAnE,EAAyFN,SAAzF,EAA0Ga,qBAA1G;AACA,kBAAK,8DAAL,EAAqEP,wBAArE,EAA2FN,SAA3F,EAA4Gc,uBAA5G;AACA,kBAAK,yDAAL,EAAgER,wBAAhE,EAAsFN,SAAtF,EAAuGe,kBAAvG;AACA,kBAAK,mEAAL,EAA0ET,wBAA1E,EAAgGN,SAAhG,EAAiHgB,4BAAjH;AACA,kBAAK,yDAAL,EAAgEV,wBAAhE,EAAsFN,SAAtF,EAAuGiB,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 fixtureDisabled from './fixtures/disabled';\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 › Disabled › should be rendered', renderComponentMacro, AtomDragAndDrop, fixtureDisabled);\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
+ {"version":3,"sources":["../../../../src/atom/drag-and-drop/test/fixtures.js"],"names":["t","pass","AtomDragAndDrop","propTypes","value","key","not","undefined","renderComponentMacro","fixtureCleanAndModified","fixtureDefault","fixtureDisabledWithImageReset","fixtureDisabled","fixtureError","fixtureLoading","fixtureModified","fixtureWithChildren","fixtureWithImageReset","fixtureWithImage","fixtureWithLongDescription","fixtureWithVideo"],"mappings":";;AAAA;;AACA;;AACA;;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,sEAAL,EAA6EF,wBAA7E,EAAmGN,SAAnG,EAAoHS,+BAApH;AACA,kBAAK,wDAAL,EAA+DH,wBAA/D,EAAqFN,SAArF,EAAsGU,iBAAtG;AACA,kBAAK,qDAAL,EAA4DJ,wBAA5D,EAAkFN,SAAlF,EAAmGW,cAAnG;AACA,kBAAK,uDAAL,EAA8DL,wBAA9D,EAAoFN,SAApF,EAAqGY,gBAArG;AACA,kBAAK,wDAAL,EAA+DN,wBAA/D,EAAqFN,SAArF,EAAsGa,iBAAtG;AACA,kBAAK,4DAAL,EAAmEP,wBAAnE,EAAyFN,SAAzF,EAA0Gc,qBAA1G;AACA,kBAAK,8DAAL,EAAqER,wBAArE,EAA2FN,SAA3F,EAA4Ge,uBAA5G;AACA,kBAAK,yDAAL,EAAgET,wBAAhE,EAAsFN,SAAtF,EAAuGgB,kBAAvG;AACA,kBAAK,mEAAL,EAA0EV,wBAA1E,EAAgGN,SAAhG,EAAiHiB,4BAAjH;AACA,kBAAK,yDAAL,EAAgEX,wBAAhE,EAAsFN,SAAtF,EAAuGkB,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 fixtureDisabledWithImageReset from './fixtures/disabled-with-image-reset';\nimport fixtureDisabled from './fixtures/disabled';\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 › DisabledWithImageReset › should be rendered', renderComponentMacro, AtomDragAndDrop, fixtureDisabledWithImageReset);\ntest('Atom › AtomDragAndDrop › Disabled › should be rendered', renderComponentMacro, AtomDragAndDrop, fixtureDisabled);\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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coorpacademy/components",
3
- "version": "10.17.2",
3
+ "version": "10.17.3",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -122,5 +122,5 @@
122
122
  "webpack-hot-middleware": "^2.25.0"
123
123
  },
124
124
  "author": "CoorpAcademy",
125
- "gitHead": "28558981f3f1ce9694b7021a250dba97c0f6bc24"
125
+ "gitHead": "6f2abf73922a4254528e07ecedaa437e48bdb8a2"
126
126
  }