@coorpacademy/components 11.12.0 → 11.12.1-alpha.13
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.d.ts +2 -0
- package/es/atom/drag-and-drop/index.d.ts.map +1 -1
- package/es/atom/drag-and-drop/index.js +26 -2
- package/es/atom/drag-and-drop/index.js.map +1 -1
- package/es/atom/drag-and-drop/style.css +21 -5
- package/es/atom/image-upload/index.d.ts +5 -1
- package/es/atom/image-upload/index.d.ts.map +1 -1
- package/es/atom/image-upload/index.js +8 -10
- package/es/atom/image-upload/index.js.map +1 -1
- package/es/atom/video-upload/index.d.ts +2 -0
- package/es/molecule/brand-form-group/index.d.ts +4 -0
- package/es/molecule/drag-and-drop-wrapper/index.d.ts +2 -0
- package/es/molecule/drag-and-drop-wrapper/style.css +1 -1
- package/es/molecule/setup-slide/index.d.ts +2 -0
- package/es/molecule/setup-slider/index.d.ts +2 -0
- package/es/molecule/title-and-checkbox-wrapper/index.d.ts +2 -0
- package/es/organism/brand-form/index.d.ts +4 -0
- package/es/organism/list-item/index.d.ts +1 -0
- package/es/organism/list-item/index.d.ts.map +1 -1
- package/es/organism/list-item/index.js +5 -3
- package/es/organism/list-item/index.js.map +1 -1
- package/es/organism/list-items/index.d.ts +1 -0
- package/es/organism/rewards-form/index.d.ts +2 -0
- package/es/organism/wizard-contents/index.d.ts +6 -0
- package/es/template/app-review/index.native.d.ts.map +1 -1
- package/es/template/app-review/index.native.js +3 -3
- package/es/template/app-review/index.native.js.map +1 -1
- package/es/template/back-office/brand-update/index.d.ts +11 -0
- package/es/template/cockpit/jw-uploader/index.d.ts +2 -0
- package/es/util/button-icons.d.ts +1 -0
- package/es/util/button-icons.d.ts.map +1 -1
- package/es/util/button-icons.js +3 -2
- package/es/util/button-icons.js.map +1 -1
- package/es/util/proptypes.d.ts.map +1 -1
- package/es/util/proptypes.js +2 -2
- package/es/util/proptypes.js.map +1 -1
- package/lib/atom/drag-and-drop/index.d.ts +2 -0
- package/lib/atom/drag-and-drop/index.d.ts.map +1 -1
- package/lib/atom/drag-and-drop/index.js +26 -2
- package/lib/atom/drag-and-drop/index.js.map +1 -1
- package/lib/atom/drag-and-drop/style.css +21 -5
- package/lib/atom/image-upload/index.d.ts +5 -1
- package/lib/atom/image-upload/index.d.ts.map +1 -1
- package/lib/atom/image-upload/index.js +8 -11
- package/lib/atom/image-upload/index.js.map +1 -1
- package/lib/atom/video-upload/index.d.ts +2 -0
- package/lib/molecule/brand-form-group/index.d.ts +4 -0
- package/lib/molecule/drag-and-drop-wrapper/index.d.ts +2 -0
- package/lib/molecule/drag-and-drop-wrapper/style.css +1 -1
- package/lib/molecule/setup-slide/index.d.ts +2 -0
- package/lib/molecule/setup-slider/index.d.ts +2 -0
- package/lib/molecule/title-and-checkbox-wrapper/index.d.ts +2 -0
- package/lib/organism/brand-form/index.d.ts +4 -0
- package/lib/organism/list-item/index.d.ts +1 -0
- package/lib/organism/list-item/index.d.ts.map +1 -1
- package/lib/organism/list-item/index.js +5 -3
- package/lib/organism/list-item/index.js.map +1 -1
- package/lib/organism/list-items/index.d.ts +1 -0
- package/lib/organism/rewards-form/index.d.ts +2 -0
- package/lib/organism/wizard-contents/index.d.ts +6 -0
- package/lib/template/app-review/index.native.d.ts.map +1 -1
- package/lib/template/app-review/index.native.js +2 -2
- package/lib/template/app-review/index.native.js.map +1 -1
- package/lib/template/back-office/brand-update/index.d.ts +11 -0
- package/lib/template/cockpit/jw-uploader/index.d.ts +2 -0
- package/lib/util/button-icons.d.ts +1 -0
- package/lib/util/button-icons.d.ts.map +1 -1
- package/lib/util/button-icons.js +2 -1
- package/lib/util/button-icons.js.map +1 -1
- package/lib/util/proptypes.d.ts.map +1 -1
- package/lib/util/proptypes.js +2 -2
- package/lib/util/proptypes.js.map +1 -1
- package/package.json +2 -2
|
@@ -18,6 +18,8 @@ declare class DragAndDrop extends React.Component<any, any, any> {
|
|
|
18
18
|
error: PropTypes.Requireable<string>;
|
|
19
19
|
buttonAriaLabel: PropTypes.Requireable<string>;
|
|
20
20
|
errorButtonLabel: PropTypes.Requireable<string>;
|
|
21
|
+
pdfButtonLabel: PropTypes.Requireable<string>;
|
|
22
|
+
pdfButtonAriaLabel: PropTypes.Requireable<string>;
|
|
21
23
|
};
|
|
22
24
|
constructor(props: any);
|
|
23
25
|
state: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/drag-and-drop/index.js"],"names":[],"mappings":";AAgBA;IACE
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/drag-and-drop/index.js"],"names":[],"mappings":";AAgBA;IACE;;;;;;;;;;;;;;;;;;;;MAoBE;IAEF,wBASC;IANC;;MAEC;IAMH,wBAIC;IAED,uBAIC;IAED,sBAsKC;CACF"}
|
|
@@ -53,7 +53,9 @@ class DragAndDrop extends React.Component {
|
|
|
53
53
|
error = '',
|
|
54
54
|
buttonAriaLabel = '',
|
|
55
55
|
errorButtonLabel = '',
|
|
56
|
-
disabled = false
|
|
56
|
+
disabled = false,
|
|
57
|
+
pdfButtonLabel,
|
|
58
|
+
pdfButtonAriaLabel
|
|
57
59
|
} = this.props;
|
|
58
60
|
const {
|
|
59
61
|
dragging
|
|
@@ -74,6 +76,26 @@ class DragAndDrop extends React.Component {
|
|
|
74
76
|
src: previewContent.src,
|
|
75
77
|
type: "video/*"
|
|
76
78
|
}));
|
|
79
|
+
} else if (previewContent && previewContent.type === 'pdf') {
|
|
80
|
+
previewView = /*#__PURE__*/React.createElement("div", {
|
|
81
|
+
className: style.previewPdf
|
|
82
|
+
}, /*#__PURE__*/React.createElement("p", {
|
|
83
|
+
className: style.previewLabelPdf
|
|
84
|
+
}, previewLabel), /*#__PURE__*/React.createElement(Button, {
|
|
85
|
+
type: "secondary",
|
|
86
|
+
link: {
|
|
87
|
+
href: previewContent.src,
|
|
88
|
+
target: '_blank',
|
|
89
|
+
download: false
|
|
90
|
+
},
|
|
91
|
+
label: pdfButtonLabel,
|
|
92
|
+
"aria-label": pdfButtonAriaLabel,
|
|
93
|
+
"data-name": "default-button-pdf",
|
|
94
|
+
icon: {
|
|
95
|
+
position: 'left',
|
|
96
|
+
type: 'pdf'
|
|
97
|
+
}
|
|
98
|
+
}));
|
|
77
99
|
} else if (loading) {
|
|
78
100
|
previewView = /*#__PURE__*/React.createElement("div", {
|
|
79
101
|
className: style.loaderWrapper
|
|
@@ -179,7 +201,9 @@ DragAndDrop.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
179
201
|
onReset: PropTypes.func,
|
|
180
202
|
error: PropTypes.string,
|
|
181
203
|
buttonAriaLabel: PropTypes.string,
|
|
182
|
-
errorButtonLabel: PropTypes.string
|
|
204
|
+
errorButtonLabel: PropTypes.string,
|
|
205
|
+
pdfButtonLabel: PropTypes.string,
|
|
206
|
+
pdfButtonAriaLabel: PropTypes.string
|
|
183
207
|
} : {};
|
|
184
208
|
export default DragAndDrop;
|
|
185
209
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"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"],"sources":["../../../src/atom/drag-and-drop/index.js"],"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 data-name=\"drag-and-drop-box\"\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"],"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;EAqBxCC,WAAW,CAACC,KAAD,EAAQ;IACjB,MAAMA,KAAN;IAEA,KAAKC,KAAL,GAAa;MACXC,QAAQ,EAAE;IADC,CAAb;IAIA,KAAKC,eAAL,GAAuB,KAAKA,eAAL,CAAqBC,IAArB,CAA0B,IAA1B,CAAvB;IACA,KAAKC,cAAL,GAAsB,KAAKA,cAAL,CAAoBD,IAApB,CAAyB,IAAzB,CAAtB;EACD;;EAEDD,eAAe,GAAG;IAChB,KAAKG,QAAL,CAAc;MACZJ,QAAQ,EAAE;IADE,CAAd;EAGD;;EAEDG,cAAc,GAAG;IACf,KAAKC,QAAL,CAAc;MACZJ,QAAQ,EAAE;IADE,CAAd;EAGD;;EAEDK,MAAM,GAAG;IACP,MAAMC,KAAK,GAAG,UAAS,WAAT,CAAd;;IACA,MAAM;MACJC,QAAQ,GAAGb,YADP;MAEJc,KAFI;MAGJC,WAHI;MAIJC,WAJI;MAKJC,YAAY,GAAG,EALX;MAMJC,cAN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AAK,CAAC0B,QAAvC;IAA3B,GACGH,KADH,CADI,GAKJa,YAjCJ,CADF;EAsCD;;AA/LuC;;AAApClC,W,CACGqD,S,2CAAY;EACjBxC,KAAK,EAAE1B,SAAS,CAACmE,MADA;EAEjBxC,WAAW,EAAE3B,SAAS,CAACmE,MAFN;EAGjBvC,WAAW,EAAE5B,SAAS,CAACmE,MAHN;EAIjBtC,YAAY,EAAE7B,SAAS,CAACmE,MAJP;EAKjBrC,cAAc,EAAE9B,SAAS,CAACoE,KAAV,CAAgB;IAC9B7B,IAAI,EAAEvC,SAAS,CAACmE,MADc;IAE9B1B,GAAG,EAAEzC,SAAS,CAACmE,MAFe;IAG9BjB,KAAK,EAAElD,SAAS,CAACmE;EAHa,CAAhB,CALC;EAUjBpC,OAAO,EAAE/B,SAAS,CAACqE,IAVF;EAWjBrC,QAAQ,EAAEhC,SAAS,CAACqE,IAXH;EAYjBhC,QAAQ,EAAErC,SAAS,CAACqE,IAZH;EAajB5C,QAAQ,EAAEzB,SAAS,CAACsE,IAbH;EAcjBrC,OAAO,EAAEjC,SAAS,CAACsE,IAdF;EAejBpC,KAAK,EAAElC,SAAS,CAACmE,MAfA;EAgBjBhC,eAAe,EAAEnC,SAAS,CAACmE,MAhBV;EAiBjB/B,gBAAgB,EAAEpC,SAAS,CAACmE;AAjBX,C;AAiMrB,eAAetD,WAAf"}
|
|
1
|
+
{"version":3,"file":"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","pdfButtonLabel","pdfButtonAriaLabel","previewView","type","preview","src","previewPdf","previewLabelPdf","href","target","download","position","loaderWrapper","loadingCancel","closeIcon","loader","loaderText","resetContent","resetUploadWrapper","resetSrcLabel","label","buildButton","defaultButtonProps","icon","button","previewContainer","modifiedPreviewContainer","inputWrapper","modifiedInputWrapper","errorInputWrapper","wrapper","infosContainer","iconError","dragAndDropLabel","errorMessage","propTypes","string","shape","bool","func"],"sources":["../../../src/atom/drag-and-drop/index.js"],"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 pdfButtonLabel: PropTypes.string,\n pdfButtonAriaLabel: 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 pdfButtonLabel,\n pdfButtonAriaLabel\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 (previewContent && previewContent.type === 'pdf') {\n previewView = (\n <div className={style.previewPdf}>\n <p className={style.previewLabelPdf}>{previewLabel}</p>\n <Button\n type=\"secondary\"\n link={{href: previewContent.src, target: '_blank', download: false}}\n label={pdfButtonLabel}\n aria-label={pdfButtonAriaLabel}\n data-name=\"default-button-pdf\"\n icon={{\n position: 'left',\n type: 'pdf'\n }}\n />\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 data-name=\"drag-and-drop-box\"\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"],"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;EAuBxCC,WAAW,CAACC,KAAD,EAAQ;IACjB,MAAMA,KAAN;IAEA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E1B,SAAS,CAAC0E,MADA;EAEjB/C,WAAW,EAAE3B,SAAS,CAAC0E,MAFN;EAGjB9C,WAAW,EAAE5B,SAAS,CAAC0E,MAHN;EAIjB7C,YAAY,EAAE7B,SAAS,CAAC0E,MAJP;EAKjB5C,cAAc,EAAE9B,SAAS,CAAC2E,KAAV,CAAgB;IAC9BlC,IAAI,EAAEzC,SAAS,CAAC0E,MADc;IAE9B/B,GAAG,EAAE3C,SAAS,CAAC0E,MAFe;IAG9BhB,KAAK,EAAE1D,SAAS,CAAC0E;EAHa,CAAhB,CALC;EAUjB3C,OAAO,EAAE/B,SAAS,CAAC4E,IAVF;EAWjB5C,QAAQ,EAAEhC,SAAS,CAAC4E,IAXH;EAYjBvC,QAAQ,EAAErC,SAAS,CAAC4E,IAZH;EAajBnD,QAAQ,EAAEzB,SAAS,CAAC6E,IAbH;EAcjB5C,OAAO,EAAEjC,SAAS,CAAC6E,IAdF;EAejB3C,KAAK,EAAElC,SAAS,CAAC0E,MAfA;EAgBjBvC,eAAe,EAAEnC,SAAS,CAAC0E,MAhBV;EAiBjBtC,gBAAgB,EAAEpC,SAAS,CAAC0E,MAjBX;EAkBjBpC,cAAc,EAAEtC,SAAS,CAAC0E,MAlBT;EAmBjBnC,kBAAkB,EAAEvC,SAAS,CAAC0E;AAnBb,C;AAsNrB,eAAe7D,WAAf"}
|
|
@@ -78,12 +78,31 @@
|
|
|
78
78
|
background-color: white;
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
.preview img,
|
|
81
|
+
.preview img,
|
|
82
|
+
video {
|
|
82
83
|
max-width: 100%;
|
|
83
84
|
max-height: 100%;
|
|
84
85
|
margin: auto;
|
|
85
86
|
}
|
|
86
87
|
|
|
88
|
+
.previewPdf {
|
|
89
|
+
composes: preview;
|
|
90
|
+
min-height: 150px;
|
|
91
|
+
display: flex;
|
|
92
|
+
flex-direction: column;
|
|
93
|
+
justify-content: space-evenly;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.previewLabelPdf {
|
|
97
|
+
text-align: center;
|
|
98
|
+
font-family: "Gilroy";
|
|
99
|
+
color: cm_grey_300;
|
|
100
|
+
padding: 0px 4px;
|
|
101
|
+
overflow: hidden;
|
|
102
|
+
text-overflow: ellipsis;
|
|
103
|
+
max-width: 90%;
|
|
104
|
+
white-space: nowrap;
|
|
105
|
+
}
|
|
87
106
|
.infosContainer {
|
|
88
107
|
width: 100%;
|
|
89
108
|
height: 100%;
|
|
@@ -152,7 +171,7 @@
|
|
|
152
171
|
align-items: center;
|
|
153
172
|
justify-content: space-between;
|
|
154
173
|
margin-top: 16px;
|
|
155
|
-
padding:
|
|
174
|
+
padding: 8px 14px 8px 1px;
|
|
156
175
|
font-size: 12px;
|
|
157
176
|
font-weight: 400;
|
|
158
177
|
position: relative;
|
|
@@ -164,9 +183,6 @@
|
|
|
164
183
|
text-overflow: ellipsis;
|
|
165
184
|
white-space: nowrap;
|
|
166
185
|
flex-wrap: nowrap;
|
|
167
|
-
position: absolute;
|
|
168
|
-
left: 0;
|
|
169
|
-
right: 15px;
|
|
170
186
|
}
|
|
171
187
|
|
|
172
188
|
.closeIcon {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export default ImageUpload;
|
|
2
|
-
declare function ImageUpload({ title, description, previewLabel, previewContent, uploadLabel, loading, modified, disabled, onChange, onReset, name, labelLink, labelButtonLink, hrefLink, imageTypes, error, buttonAriaLabel, errorButtonLabel }: {
|
|
2
|
+
declare function ImageUpload({ title, description, previewLabel, previewContent, uploadLabel, loading, modified, disabled, onChange, onReset, name, labelLink, labelButtonLink, hrefLink, imageTypes, error, buttonAriaLabel, errorButtonLabel, pdfButtonLabel, pdfButtonAriaLabel }: {
|
|
3
3
|
title: any;
|
|
4
4
|
description: any;
|
|
5
5
|
previewLabel: any;
|
|
@@ -18,6 +18,8 @@ declare function ImageUpload({ title, description, previewLabel, previewContent,
|
|
|
18
18
|
error?: string | undefined;
|
|
19
19
|
buttonAriaLabel: any;
|
|
20
20
|
errorButtonLabel: any;
|
|
21
|
+
pdfButtonLabel: any;
|
|
22
|
+
pdfButtonAriaLabel: any;
|
|
21
23
|
}): JSX.Element;
|
|
22
24
|
declare namespace ImageUpload {
|
|
23
25
|
const propTypes: {
|
|
@@ -43,6 +45,8 @@ declare namespace ImageUpload {
|
|
|
43
45
|
modified: PropTypes.Requireable<boolean>;
|
|
44
46
|
disabled: PropTypes.Requireable<boolean>;
|
|
45
47
|
children: PropTypes.Requireable<(...args: any[]) => any>;
|
|
48
|
+
pdfButtonLabel: PropTypes.Requireable<string>;
|
|
49
|
+
pdfButtonAriaLabel: PropTypes.Requireable<string>;
|
|
46
50
|
};
|
|
47
51
|
}
|
|
48
52
|
import PropTypes from "prop-types";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/image-upload/index.js"],"names":[],"mappings":";AAQA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/image-upload/index.js"],"names":[],"mappings":";AAQA;;;;;;;;;;;;;;;;;;;;;gBAkFC"}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import _isNil from "lodash/fp/isNil";
|
|
2
|
-
import _pipe from "lodash/fp/pipe";
|
|
3
|
-
import _map from "lodash/fp/map";
|
|
4
|
-
import _join from "lodash/fp/join";
|
|
5
2
|
|
|
6
3
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
|
|
7
4
|
|
|
@@ -24,23 +21,22 @@ const ImageUpload = ({
|
|
|
24
21
|
onChange,
|
|
25
22
|
onReset = null,
|
|
26
23
|
name,
|
|
27
|
-
// See ImagePropType for accepted values
|
|
28
24
|
labelLink,
|
|
29
25
|
labelButtonLink,
|
|
30
26
|
hrefLink,
|
|
27
|
+
// See ImagePropType for accepted values
|
|
31
28
|
imageTypes = ['*'],
|
|
32
29
|
error = '',
|
|
33
30
|
buttonAriaLabel,
|
|
34
|
-
errorButtonLabel
|
|
31
|
+
errorButtonLabel,
|
|
32
|
+
pdfButtonLabel,
|
|
33
|
+
pdfButtonAriaLabel
|
|
35
34
|
}) => {
|
|
36
35
|
const handleReset = useCallback(e => {
|
|
37
36
|
if (_isNil(onReset)) return;
|
|
38
37
|
e.preventDefault();
|
|
39
38
|
return onReset(e);
|
|
40
39
|
}, [onReset]);
|
|
41
|
-
|
|
42
|
-
const acceptedImages = _pipe(_map(t => `image/${t}`), _join(','))(imageTypes);
|
|
43
|
-
|
|
44
40
|
const linkCustomStyle = {
|
|
45
41
|
width: '40px',
|
|
46
42
|
color: 'red'
|
|
@@ -57,11 +53,13 @@ const ImageUpload = ({
|
|
|
57
53
|
error: error,
|
|
58
54
|
disabled: disabled,
|
|
59
55
|
buttonAriaLabel: buttonAriaLabel,
|
|
60
|
-
errorButtonLabel: errorButtonLabel
|
|
56
|
+
errorButtonLabel: errorButtonLabel,
|
|
57
|
+
pdfButtonLabel: pdfButtonLabel,
|
|
58
|
+
pdfButtonAriaLabel: pdfButtonAriaLabel
|
|
61
59
|
}, (onDragStart, onDragStop) => /*#__PURE__*/React.createElement("input", {
|
|
62
60
|
type: "file",
|
|
63
61
|
name: name,
|
|
64
|
-
accept:
|
|
62
|
+
accept: imageTypes,
|
|
65
63
|
disabled: loading || disabled,
|
|
66
64
|
className: style.input,
|
|
67
65
|
onChange: onChange,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useCallback","PropTypes","DragAndDrop","ImagePropType","Link","style","ImageUpload","title","description","previewLabel","previewContent","uploadLabel","loading","modified","disabled","onChange","onReset","name","labelLink","labelButtonLink","hrefLink","imageTypes","error","buttonAriaLabel","errorButtonLabel","
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useCallback","PropTypes","DragAndDrop","ImagePropType","Link","style","ImageUpload","title","description","previewLabel","previewContent","uploadLabel","loading","modified","disabled","onChange","onReset","name","labelLink","labelButtonLink","hrefLink","imageTypes","error","buttonAriaLabel","errorButtonLabel","pdfButtonLabel","pdfButtonAriaLabel","handleReset","e","preventDefault","linkCustomStyle","width","color","onDragStart","onDragStop","input","templateLink","href","download","propTypes","string","func","arrayOf"],"sources":["../../../src/atom/image-upload/index.js"],"sourcesContent":["import React, {useCallback} from 'react';\nimport PropTypes from 'prop-types';\nimport {isNil} from 'lodash/fp';\nimport DragAndDrop from '../drag-and-drop';\nimport {ImagePropType} from '../../util/proptypes';\nimport Link from '../button-link';\nimport style from './style.css';\n\nconst ImageUpload = ({\n title,\n description,\n previewLabel,\n previewContent,\n uploadLabel,\n loading,\n modified,\n disabled = false,\n onChange,\n onReset = null,\n name,\n labelLink,\n labelButtonLink,\n hrefLink,\n // See ImagePropType for accepted values\n imageTypes = ['*'],\n error = '',\n buttonAriaLabel,\n errorButtonLabel,\n pdfButtonLabel,\n pdfButtonAriaLabel\n}) => {\n const handleReset = useCallback(\n e => {\n if (isNil(onReset)) return;\n e.preventDefault();\n return onReset(e);\n },\n [onReset]\n );\n\n const linkCustomStyle = {\n width: '40px',\n color: 'red'\n };\n\n return (\n <div>\n <DragAndDrop\n title={title}\n description={description}\n previewLabel={previewLabel}\n previewContent={previewContent}\n uploadLabel={uploadLabel}\n loading={loading}\n modified={modified}\n onReset={handleReset}\n error={error}\n disabled={disabled}\n buttonAriaLabel={buttonAriaLabel}\n errorButtonLabel={errorButtonLabel}\n pdfButtonLabel={pdfButtonLabel}\n pdfButtonAriaLabel={pdfButtonAriaLabel}\n >\n {(onDragStart, onDragStop) => (\n <input\n type=\"file\"\n name={name}\n accept={imageTypes}\n disabled={loading || disabled}\n className={style.input}\n onChange={onChange}\n onDragEnter={onDragStart}\n onDrop={onDragStop}\n onDragLeave={onDragStop}\n />\n )}\n </DragAndDrop>\n {labelLink && hrefLink ? (\n <div className={style.templateLink}>\n {labelLink}\n <Link\n type=\"text\"\n customStyle={linkCustomStyle}\n link={{href: hrefLink, download: true}}\n label={labelButtonLink}\n />\n </div>\n ) : null}\n </div>\n );\n};\n\nImageUpload.propTypes = {\n ...DragAndDrop.propTypes,\n name: PropTypes.string,\n onChange: PropTypes.func,\n onReset: PropTypes.func,\n imageTypes: PropTypes.arrayOf(ImagePropType),\n error: PropTypes.string,\n buttonAriaLabel: PropTypes.string,\n errorButtonLabel: PropTypes.string,\n labelLink: PropTypes.string,\n hrefLink: PropTypes.string\n};\n\nexport default ImageUpload;\n"],"mappings":";;;;AAAA,OAAOA,KAAP,IAAeC,WAAf,QAAiC,OAAjC;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,OAAOC,WAAP,MAAwB,kBAAxB;AACA,SAAQC,aAAR,QAA4B,sBAA5B;AACA,OAAOC,IAAP,MAAiB,gBAAjB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,WAAW,GAAG,CAAC;EACnBC,KADmB;EAEnBC,WAFmB;EAGnBC,YAHmB;EAInBC,cAJmB;EAKnBC,WALmB;EAMnBC,OANmB;EAOnBC,QAPmB;EAQnBC,QAAQ,GAAG,KARQ;EASnBC,QATmB;EAUnBC,OAAO,GAAG,IAVS;EAWnBC,IAXmB;EAYnBC,SAZmB;EAanBC,eAbmB;EAcnBC,QAdmB;EAenB;EACAC,UAAU,GAAG,CAAC,GAAD,CAhBM;EAiBnBC,KAAK,GAAG,EAjBW;EAkBnBC,eAlBmB;EAmBnBC,gBAnBmB;EAoBnBC,cApBmB;EAqBnBC;AArBmB,CAAD,KAsBd;EACJ,MAAMC,WAAW,GAAG3B,WAAW,CAC7B4B,CAAC,IAAI;IACH,IAAI,OAAMZ,OAAN,CAAJ,EAAoB;IACpBY,CAAC,CAACC,cAAF;IACA,OAAOb,OAAO,CAACY,CAAD,CAAd;EACD,CAL4B,EAM7B,CAACZ,OAAD,CAN6B,CAA/B;EASA,MAAMc,eAAe,GAAG;IACtBC,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rB;EAKEpB,UAAU,EAAEpB,SAAS,CAACyC,OAAV,CAAkBvC,aAAlB,CALd;EAMEmB,KAAK,EAAErB,SAAS,CAACuC,MANnB;EAOEjB,eAAe,EAAEtB,SAAS,CAACuC,MAP7B;EAQEhB,gBAAgB,EAAEvB,SAAS,CAACuC,MAR9B;EASEtB,SAAS,EAAEjB,SAAS,CAACuC,MATvB;EAUEpB,QAAQ,EAAEnB,SAAS,CAACuC;AAVtB;AAaA,eAAelC,WAAf"}
|
|
@@ -31,6 +31,8 @@ declare namespace VideoUpload {
|
|
|
31
31
|
error: PropTypes.Requireable<string>;
|
|
32
32
|
buttonAriaLabel: PropTypes.Requireable<string>;
|
|
33
33
|
errorButtonLabel: PropTypes.Requireable<string>;
|
|
34
|
+
pdfButtonLabel: PropTypes.Requireable<string>;
|
|
35
|
+
pdfButtonAriaLabel: PropTypes.Requireable<string>;
|
|
34
36
|
};
|
|
35
37
|
}
|
|
36
38
|
import PropTypes from "prop-types";
|
|
@@ -148,6 +148,8 @@ declare namespace BrandFormGroup {
|
|
|
148
148
|
modified: PropTypes.Requireable<boolean>;
|
|
149
149
|
disabled: PropTypes.Requireable<boolean>;
|
|
150
150
|
children: PropTypes.Requireable<(...args: any[]) => any>;
|
|
151
|
+
pdfButtonLabel: PropTypes.Requireable<string>;
|
|
152
|
+
pdfButtonAriaLabel: PropTypes.Requireable<string>;
|
|
151
153
|
}> | PropTypes.InferProps<{
|
|
152
154
|
type: PropTypes.Requireable<string>;
|
|
153
155
|
tabProps: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
@@ -266,6 +268,8 @@ declare namespace BrandFormGroup {
|
|
|
266
268
|
modified: PropTypes.Requireable<boolean>;
|
|
267
269
|
disabled: PropTypes.Requireable<boolean>;
|
|
268
270
|
children: PropTypes.Requireable<(...args: any[]) => any>;
|
|
271
|
+
pdfButtonLabel: PropTypes.Requireable<string>;
|
|
272
|
+
pdfButtonAriaLabel: PropTypes.Requireable<string>;
|
|
269
273
|
}> | PropTypes.InferProps<{
|
|
270
274
|
type: PropTypes.Requireable<string>;
|
|
271
275
|
title: PropTypes.Validator<string>;
|
|
@@ -25,6 +25,8 @@ declare namespace DragAndDropWrapper {
|
|
|
25
25
|
modified: PropTypes.Requireable<boolean>;
|
|
26
26
|
disabled: PropTypes.Requireable<boolean>;
|
|
27
27
|
children: PropTypes.Requireable<(...args: any[]) => any>;
|
|
28
|
+
pdfButtonLabel: PropTypes.Requireable<string>;
|
|
29
|
+
pdfButtonAriaLabel: PropTypes.Requireable<string>;
|
|
28
30
|
}> | null | undefined)[]>;
|
|
29
31
|
'data-name': PropTypes.Requireable<string>;
|
|
30
32
|
};
|
|
@@ -105,6 +105,8 @@ declare namespace SetupSlide {
|
|
|
105
105
|
modified: PropTypes.Requireable<boolean>;
|
|
106
106
|
disabled: PropTypes.Requireable<boolean>;
|
|
107
107
|
children: PropTypes.Requireable<(...args: any[]) => any>;
|
|
108
|
+
pdfButtonLabel: PropTypes.Requireable<string>;
|
|
109
|
+
pdfButtonAriaLabel: PropTypes.Requireable<string>;
|
|
108
110
|
}> | PropTypes.InferProps<{
|
|
109
111
|
type: PropTypes.Requireable<string>;
|
|
110
112
|
title: PropTypes.Validator<string>;
|
|
@@ -118,6 +118,8 @@ declare namespace SetupSlider {
|
|
|
118
118
|
modified: PropTypes.Requireable<boolean>;
|
|
119
119
|
disabled: PropTypes.Requireable<boolean>;
|
|
120
120
|
children: PropTypes.Requireable<(...args: any[]) => any>;
|
|
121
|
+
pdfButtonLabel: PropTypes.Requireable<string>;
|
|
122
|
+
pdfButtonAriaLabel: PropTypes.Requireable<string>;
|
|
121
123
|
}> | PropTypes.InferProps<{
|
|
122
124
|
type: PropTypes.Requireable<string>;
|
|
123
125
|
title: PropTypes.Validator<string>;
|
|
@@ -65,6 +65,8 @@ declare namespace TitleAndCheckBoxWrapper {
|
|
|
65
65
|
modified: PropTypes.Requireable<boolean>;
|
|
66
66
|
disabled: PropTypes.Requireable<boolean>;
|
|
67
67
|
children: PropTypes.Requireable<(...args: any[]) => any>;
|
|
68
|
+
pdfButtonLabel: PropTypes.Requireable<string>;
|
|
69
|
+
pdfButtonAriaLabel: PropTypes.Requireable<string>;
|
|
68
70
|
}> | null | undefined)[]>;
|
|
69
71
|
'data-name': PropTypes.Requireable<string>;
|
|
70
72
|
}> | null | undefined>>;
|
|
@@ -178,6 +178,8 @@ declare namespace BrandForm {
|
|
|
178
178
|
modified: PropTypes.Requireable<boolean>;
|
|
179
179
|
disabled: PropTypes.Requireable<boolean>;
|
|
180
180
|
children: PropTypes.Requireable<(...args: any[]) => any>;
|
|
181
|
+
pdfButtonLabel: PropTypes.Requireable<string>;
|
|
182
|
+
pdfButtonAriaLabel: PropTypes.Requireable<string>;
|
|
181
183
|
}> | PropTypes.InferProps<{
|
|
182
184
|
type: PropTypes.Requireable<string>;
|
|
183
185
|
tabProps: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
@@ -296,6 +298,8 @@ declare namespace BrandForm {
|
|
|
296
298
|
modified: PropTypes.Requireable<boolean>;
|
|
297
299
|
disabled: PropTypes.Requireable<boolean>;
|
|
298
300
|
children: PropTypes.Requireable<(...args: any[]) => any>;
|
|
301
|
+
pdfButtonLabel: PropTypes.Requireable<string>;
|
|
302
|
+
pdfButtonAriaLabel: PropTypes.Requireable<string>;
|
|
299
303
|
}> | PropTypes.InferProps<{
|
|
300
304
|
type: PropTypes.Requireable<string>;
|
|
301
305
|
title: PropTypes.Validator<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/list-item/index.js"],"names":[],"mappings":";AAQA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/list-item/index.js"],"names":[],"mappings":";AAQA,mDA4CC"}
|
|
@@ -14,7 +14,8 @@ const ListItem = props => {
|
|
|
14
14
|
tags,
|
|
15
15
|
title,
|
|
16
16
|
order,
|
|
17
|
-
'aria-label': ariaLabel
|
|
17
|
+
'aria-label': ariaLabel,
|
|
18
|
+
contentType
|
|
18
19
|
} = props;
|
|
19
20
|
|
|
20
21
|
const tagsView = _map.convert({
|
|
@@ -29,7 +30,7 @@ const ListItem = props => {
|
|
|
29
30
|
|
|
30
31
|
return /*#__PURE__*/React.createElement("div", {
|
|
31
32
|
className: style.wrapper
|
|
32
|
-
}, isPublished ? /*#__PURE__*/React.createElement("div", {
|
|
33
|
+
}, isPublished && contentType === 'certification' ? /*#__PURE__*/React.createElement("div", {
|
|
33
34
|
className: style.orderWrapper
|
|
34
35
|
}, /*#__PURE__*/React.createElement("div", {
|
|
35
36
|
className: style.order,
|
|
@@ -76,7 +77,8 @@ ListItem.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
76
77
|
})),
|
|
77
78
|
title: PropTypes.string.isRequired,
|
|
78
79
|
order: PropTypes.number,
|
|
79
|
-
'aria-label': PropTypes.string
|
|
80
|
+
'aria-label': PropTypes.string,
|
|
81
|
+
contentType: PropTypes.string
|
|
80
82
|
} : {};
|
|
81
83
|
export default ListItem;
|
|
82
84
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","PropTypes","Tag","ButtonLink","BulletPointMenuButton","style","ListItem","props","isPublished","bulletPointMenuButton","buttonLink","tags","title","order","ariaLabel","tagsView","convert","cap","tag","index","type","wrapper","orderWrapper","settings","edit","propTypes","shape","buttonAriaLabel","string","menuAriaLabel","buttons","arrayOf","label","onClick","func","dataName","icon","position","oneOf","isRequired","number"],"sources":["../../../src/organism/list-item/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {map} from 'lodash/fp';\nimport Tag from '../../atom/tag';\nimport ButtonLink from '../../atom/button-link';\nimport BulletPointMenuButton from '../../molecule/bullet-point-menu-button';\nimport style from './style.css';\n\nconst ListItem = props => {\n let isPublished = false;\n const {bulletPointMenuButton
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PropTypes","Tag","ButtonLink","BulletPointMenuButton","style","ListItem","props","isPublished","bulletPointMenuButton","buttonLink","tags","title","order","ariaLabel","contentType","tagsView","convert","cap","tag","index","type","wrapper","orderWrapper","settings","edit","propTypes","shape","buttonAriaLabel","string","menuAriaLabel","buttons","arrayOf","label","onClick","func","dataName","icon","position","oneOf","isRequired","number"],"sources":["../../../src/organism/list-item/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {map} from 'lodash/fp';\nimport Tag from '../../atom/tag';\nimport ButtonLink from '../../atom/button-link';\nimport BulletPointMenuButton from '../../molecule/bullet-point-menu-button';\nimport style from './style.css';\n\nconst ListItem = props => {\n let isPublished = false;\n const {\n bulletPointMenuButton,\n buttonLink,\n tags,\n title,\n order,\n 'aria-label': ariaLabel,\n contentType\n } = props;\n const tagsView = map.convert({cap: false})((tag, index) => {\n isPublished = tag.type === 'published';\n return (\n <div key={index} className={style.tag}>\n <Tag {...tag} />\n </div>\n );\n })(tags);\n return (\n <div className={style.wrapper}>\n {isPublished && contentType === 'certification' ? (\n <div className={style.orderWrapper}>\n <div className={style.order} aria-label={ariaLabel}>\n {order + 1}\n </div>\n <div className={style.title} title={title}>\n {title}\n </div>\n </div>\n ) : (\n <div className={style.title} title={title}>\n {title}\n </div>\n )}\n <div className={style.settings}>\n {tagsView}\n <div className={style.edit}>\n <ButtonLink {...buttonLink} />\n </div>\n <BulletPointMenuButton {...bulletPointMenuButton} />\n </div>\n </div>\n );\n};\n\nListItem.propTypes = {\n bulletPointMenuButton: PropTypes.shape({\n buttonAriaLabel: PropTypes.string,\n menuAriaLabel: PropTypes.string,\n buttons: PropTypes.arrayOf(\n PropTypes.shape({\n 'data-name': PropTypes.string,\n label: PropTypes.string,\n type: PropTypes.string,\n onClick: PropTypes.func\n })\n ),\n onClick: PropTypes.func\n }),\n buttonLink: PropTypes.shape({\n type: PropTypes.string,\n label: PropTypes.string,\n ariaLabel: PropTypes.string,\n dataName: PropTypes.string,\n icon: PropTypes.shape({\n position: PropTypes.string,\n type: PropTypes.string\n }),\n onClick: PropTypes.func\n }),\n tags: PropTypes.arrayOf(\n PropTypes.shape({\n label: PropTypes.string,\n type: PropTypes.oneOf(['published', 'draft', 'archived', 'revised', 'default'])\n })\n ),\n title: PropTypes.string.isRequired,\n order: PropTypes.number,\n 'aria-label': PropTypes.string,\n contentType: PropTypes.string\n};\n\nexport default ListItem;\n"],"mappings":";AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,OAAOC,GAAP,MAAgB,gBAAhB;AACA,OAAOC,UAAP,MAAuB,wBAAvB;AACA,OAAOC,qBAAP,MAAkC,yCAAlC;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,QAAQ,GAAGC,KAAK,IAAI;EACxB,IAAIC,WAAW,GAAG,KAAlB;EACA,MAAM;IACJC,qBADI;IAEJC,UAFI;IAGJC,IAHI;IAIJC,KAJI;IAKJC,KALI;IAMJ,cAAcC,SANV;IAOJC;EAPI,IAQFR,KARJ;;EASA,MAAMS,QAAQ,GAAG,KAAIC,OAAJ,CAAY;IAACC,GAAG,EAAE;EAAN,CAAZ,EAA0B,CAACC,GAAD,EAAMC,KAAN,KAAgB;IACzDZ,WAAW,GAAGW,GAAG,CAACE,IAAJ,KAAa,WAA3B;IACA,oBACE;MAAK,GAAG,EAAED,KAAV;MAAiB,SAAS,EAAEf,KAAK,CAACc;IAAlC,gBACE,oBAAC,GAAD,EAASA,GAAT,CADF,CADF;EAKD,CAPgB,EAOdR,IAPc,CAAjB;;EAQA,oBACE;IAAK,SAAS,EAAEN,KAAK,CAACiB;EAAtB,GACGd,WAAW,IAAIO,WAAW,KAAK,eAA/B,gBACC;IAAK,SAAS,EAAEV,KAAK,CAACkB;EAAtB,gBACE;IAAK,SAAS,EAAElB,KAAK,CAACQ,KAAtB;IAA6B,cAAYC;EAAzC,GACGD,KAAK,GAAG,CADX,CADF,eAIE;IAAK,S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,CALoB;IAS1BK,OAAO,EAAEjC,SAAS,CAACkC;EATO,CAAhB,CAdO;EAyBnBxB,IAAI,EAAEV,SAAS,CAAC+B,OAAV,CACJ/B,SAAS,CAAC0B,KAAV,CAAgB;IACdM,KAAK,EAAEhC,SAAS,CAAC4B,MADH;IAEdR,IAAI,EAAEpB,SAAS,CAACsC,KAAV,CAAgB,CAAC,WAAD,EAAc,OAAd,EAAuB,UAAvB,EAAmC,SAAnC,EAA8C,SAA9C,CAAhB;EAFQ,CAAhB,CADI,CAzBa;EA+BnB3B,KAAK,EAAEX,SAAS,CAAC4B,MAAV,CAAiBW,UA/BL;EAgCnB3B,KAAK,EAAEZ,SAAS,CAACwC,MAhCE;EAiCnB,cAAcxC,SAAS,CAAC4B,MAjCL;EAkCnBd,WAAW,EAAEd,SAAS,CAAC4B;AAlCJ,CAArB;AAqCA,eAAevB,QAAf"}
|
|
@@ -58,6 +58,7 @@ declare namespace ListItems {
|
|
|
58
58
|
title: PropTypes.Validator<string>;
|
|
59
59
|
order: PropTypes.Requireable<number>;
|
|
60
60
|
'aria-label': PropTypes.Requireable<string>;
|
|
61
|
+
contentType: PropTypes.Requireable<string>;
|
|
61
62
|
}> | null | undefined)[]>;
|
|
62
63
|
title: PropTypes.Requireable<string>;
|
|
63
64
|
};
|
|
@@ -68,6 +68,8 @@ declare namespace RewardsForm {
|
|
|
68
68
|
modified: PropTypes.Requireable<boolean>;
|
|
69
69
|
disabled: PropTypes.Requireable<boolean>;
|
|
70
70
|
children: PropTypes.Requireable<(...args: any[]) => any>;
|
|
71
|
+
pdfButtonLabel: PropTypes.Requireable<string>;
|
|
72
|
+
pdfButtonAriaLabel: PropTypes.Requireable<string>;
|
|
71
73
|
}> | null | undefined)[]>;
|
|
72
74
|
'data-name': PropTypes.Requireable<string>;
|
|
73
75
|
}> | null | undefined>>;
|
|
@@ -195,6 +195,8 @@ declare namespace WizardContents {
|
|
|
195
195
|
modified: PropTypes.Requireable<boolean>;
|
|
196
196
|
disabled: PropTypes.Requireable<boolean>;
|
|
197
197
|
children: PropTypes.Requireable<(...args: any[]) => any>;
|
|
198
|
+
pdfButtonLabel: PropTypes.Requireable<string>;
|
|
199
|
+
pdfButtonAriaLabel: PropTypes.Requireable<string>;
|
|
198
200
|
}> | PropTypes.InferProps<{
|
|
199
201
|
type: PropTypes.Requireable<string>;
|
|
200
202
|
tabProps: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
@@ -313,6 +315,8 @@ declare namespace WizardContents {
|
|
|
313
315
|
modified: PropTypes.Requireable<boolean>;
|
|
314
316
|
disabled: PropTypes.Requireable<boolean>;
|
|
315
317
|
children: PropTypes.Requireable<(...args: any[]) => any>;
|
|
318
|
+
pdfButtonLabel: PropTypes.Requireable<string>;
|
|
319
|
+
pdfButtonAriaLabel: PropTypes.Requireable<string>;
|
|
316
320
|
}> | PropTypes.InferProps<{
|
|
317
321
|
type: PropTypes.Requireable<string>;
|
|
318
322
|
title: PropTypes.Validator<string>;
|
|
@@ -703,6 +707,8 @@ declare namespace WizardContents {
|
|
|
703
707
|
modified: PropTypes.Requireable<boolean>;
|
|
704
708
|
disabled: PropTypes.Requireable<boolean>;
|
|
705
709
|
children: PropTypes.Requireable<(...args: any[]) => any>;
|
|
710
|
+
pdfButtonLabel: PropTypes.Requireable<string>;
|
|
711
|
+
pdfButtonAriaLabel: PropTypes.Requireable<string>;
|
|
706
712
|
}> | null | undefined)[]>;
|
|
707
713
|
'data-name': PropTypes.Requireable<string>;
|
|
708
714
|
}> | null | undefined>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/template/app-review/index.native.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAC,cAAc,EAAC,MAAM,cAAc,CAAC;AA8B5C,QAAA,MAAM,SAAS,UAAW,cAAc,
|
|
1
|
+
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/template/app-review/index.native.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAC,cAAc,EAAC,MAAM,cAAc,CAAC;AA8B5C,QAAA,MAAM,SAAS,UAAW,cAAc,gBAgDvC,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useEffect } from 'react';
|
|
2
|
-
import { StyleSheet, View, BackHandler, Animated } from 'react-native';
|
|
2
|
+
import { StyleSheet, View, BackHandler, Animated, Platform } from 'react-native';
|
|
3
3
|
import { useAnimateProp, useAnimationWaiter } from '@coorpacademy/react-native-animation';
|
|
4
4
|
import Loader from '../../atom/loader/index.native';
|
|
5
5
|
import Player from './player/index.native';
|
|
@@ -52,14 +52,14 @@ const AppReview = props => {
|
|
|
52
52
|
property: 'opacity',
|
|
53
53
|
fromValue: 0,
|
|
54
54
|
toValue: 1,
|
|
55
|
-
duration:
|
|
55
|
+
duration: 1250
|
|
56
56
|
});
|
|
57
57
|
const isLoading = viewName === 'loader';
|
|
58
58
|
useAnimationWaiter(isLoading, fadePlayerIn);
|
|
59
59
|
return /*#__PURE__*/React.createElement(View, {
|
|
60
60
|
style: styles.rootView
|
|
61
61
|
}, /*#__PURE__*/React.createElement(Animated.View, {
|
|
62
|
-
style: [styles.player, fadePlayerIn.animatedStyle]
|
|
62
|
+
style: [styles.player, Platform.OS === 'ios' ? fadePlayerIn.animatedStyle : null]
|
|
63
63
|
}, slides ? /*#__PURE__*/React.createElement(Player, {
|
|
64
64
|
congrats: slides.congrats,
|
|
65
65
|
header: slides.header,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":["React","useEffect","StyleSheet","View","BackHandler","Animated","useAnimateProp","useAnimationWaiter","Loader","Player","styles","create","rootView","flex","alignItems","justifyContent","player","position","top","left","right","bottom","loaderContainer","AppReview","props","navigateBack","viewName","slides","backAction","backHandler","addEventListener","remove","fadePlayerIn","property","fromValue","toValue","duration","isLoading","animatedStyle","congrats","header","stack","quitPopin","backgroundImage"],"sources":["../../../src/template/app-review/index.native.tsx"],"sourcesContent":["import React, {useEffect} from 'react';\nimport {StyleSheet, View, BackHandler, Animated} from 'react-native';\nimport {useAnimateProp, useAnimationWaiter} from '@coorpacademy/react-native-animation';\nimport Loader from '../../atom/loader/index.native';\nimport {AppReviewProps} from './prop-types';\nimport Player from './player/index.native';\n\nconst styles = StyleSheet.create({\n rootView: {\n flex: 1,\n alignItems: 'center',\n justifyContent: 'center'\n },\n player: {\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n justifyContent: 'center',\n alignItems: 'center',\n flex: 1\n },\n loaderContainer: {\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n justifyContent: 'center',\n alignItems: 'center'\n }\n});\n\nconst AppReview = (props: AppReviewProps) => {\n const {navigateBack, viewName, slides} = props;\n\n useEffect(() => {\n const backAction = () => {\n if (navigateBack) {\n navigateBack();\n return true;\n }\n };\n\n // https://reactnative.dev/docs/backhandler\n const backHandler = BackHandler.addEventListener('hardwareBackPress', backAction);\n\n return () => backHandler.remove();\n }, [navigateBack]);\n\n const fadePlayerIn = useAnimateProp({\n property: 'opacity',\n fromValue: 0,\n toValue: 1,\n duration:
|
|
1
|
+
{"version":3,"file":"index.native.js","names":["React","useEffect","StyleSheet","View","BackHandler","Animated","Platform","useAnimateProp","useAnimationWaiter","Loader","Player","styles","create","rootView","flex","alignItems","justifyContent","player","position","top","left","right","bottom","loaderContainer","AppReview","props","navigateBack","viewName","slides","backAction","backHandler","addEventListener","remove","fadePlayerIn","property","fromValue","toValue","duration","isLoading","OS","animatedStyle","congrats","header","stack","quitPopin","backgroundImage"],"sources":["../../../src/template/app-review/index.native.tsx"],"sourcesContent":["import React, {useEffect} from 'react';\nimport {StyleSheet, View, BackHandler, Animated, Platform} from 'react-native';\nimport {useAnimateProp, useAnimationWaiter} from '@coorpacademy/react-native-animation';\nimport Loader from '../../atom/loader/index.native';\nimport {AppReviewProps} from './prop-types';\nimport Player from './player/index.native';\n\nconst styles = StyleSheet.create({\n rootView: {\n flex: 1,\n alignItems: 'center',\n justifyContent: 'center'\n },\n player: {\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n justifyContent: 'center',\n alignItems: 'center',\n flex: 1\n },\n loaderContainer: {\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n justifyContent: 'center',\n alignItems: 'center'\n }\n});\n\nconst AppReview = (props: AppReviewProps) => {\n const {navigateBack, viewName, slides} = props;\n\n useEffect(() => {\n const backAction = () => {\n if (navigateBack) {\n navigateBack();\n return true;\n }\n };\n\n // https://reactnative.dev/docs/backhandler\n const backHandler = BackHandler.addEventListener('hardwareBackPress', backAction);\n\n return () => backHandler.remove();\n }, [navigateBack]);\n\n const fadePlayerIn = useAnimateProp({\n property: 'opacity',\n fromValue: 0,\n toValue: 1,\n duration: 1250\n });\n\n const isLoading = viewName === 'loader';\n useAnimationWaiter(isLoading, fadePlayerIn);\n\n return (\n <View style={styles.rootView}>\n <Animated.View\n style={[styles.player, Platform.OS === 'ios' ? fadePlayerIn.animatedStyle : null]}\n >\n {slides ? (\n <Player\n congrats={slides.congrats}\n header={slides.header}\n stack={slides.stack}\n quitPopin={slides.quitPopin}\n backgroundImage={slides.backgroundImage}\n />\n ) : null}\n </Animated.View>\n\n <View style={styles.loaderContainer} pointerEvents=\"none\">\n <Loader readyToHide={!isLoading} />\n </View>\n </View>\n );\n};\n\nexport default AppReview;\n"],"mappings":"AAAA,OAAOA,KAAP,IAAeC,SAAf,QAA+B,OAA/B;AACA,SAAQC,UAAR,EAAoBC,IAApB,EAA0BC,WAA1B,EAAuCC,QAAvC,EAAiDC,QAAjD,QAAgE,cAAhE;AACA,SAAQC,cAAR,EAAwBC,kBAAxB,QAAiD,sCAAjD;AACA,OAAOC,MAAP,MAAmB,gCAAnB;AAEA,OAAOC,MAAP,MAAmB,uBAAnB;AAEA,MAAMC,MAAM,GAAGT,UAAU,CAACU,MAAX,CAAkB;EAC/BC,QAA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