@coorpacademy/components 11.19.2-alpha.21 → 11.19.2-alpha.22
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/molecule/cm-popin/index.d.ts.map +1 -1
- package/es/molecule/cm-popin/index.js +15 -12
- package/es/molecule/cm-popin/index.js.map +1 -1
- package/lib/molecule/cm-popin/index.d.ts.map +1 -1
- package/lib/molecule/cm-popin/index.js +14 -11
- package/lib/molecule/cm-popin/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/cm-popin/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/cm-popin/index.js"],"names":[],"mappings":";AAkCA,kDAiQC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// import React from 'react';
|
|
2
|
-
import React, { useRef, useEffect,
|
|
2
|
+
import React, { useRef, useEffect, useMemo } from 'react';
|
|
3
3
|
import { NovaSolidInterfaceFeedbackInterfaceAlertDiamond as AlertDiamond, NovaSolidApplicationsWindowUpload3 as WindowUpload, NovaLineSettingsCookie as Cookie, NovaSolidSpaceMoonRocket as MoonRocket, NovaCompositionCoorpacademyPadlock as LockIcon, NovaLineStatusCheckCircle1 as CheckCircle1, NovaSolidFilesBasicFileLines as FileLinesIcon } from '@coorpacademy/nova-icons';
|
|
4
4
|
import map from 'lodash/fp/map';
|
|
5
5
|
import isEmpty from 'lodash/fp/isEmpty';
|
|
@@ -21,7 +21,8 @@ const IconType = {
|
|
|
21
21
|
}, /*#__PURE__*/React.createElement(FileLinesIcon, {
|
|
22
22
|
className: style.filesListIcon
|
|
23
23
|
}))
|
|
24
|
-
};
|
|
24
|
+
}; // const preventDefault = e => e.preventDefault();
|
|
25
|
+
// const stopPropagation = e => e.stopPropagation();
|
|
25
26
|
|
|
26
27
|
const CMPopin = props => {
|
|
27
28
|
const {
|
|
@@ -51,6 +52,7 @@ const CMPopin = props => {
|
|
|
51
52
|
backgroundImage: `url(${backgroundImageUrl})`,
|
|
52
53
|
backgroundSize: 'cover'
|
|
53
54
|
} : null;
|
|
55
|
+
const handleCloseButton = useMemo(() => () => onClose(), [onClose]);
|
|
54
56
|
const nodeRef = useRef(null);
|
|
55
57
|
useEffect(() => {
|
|
56
58
|
if (mode === 'items') {
|
|
@@ -59,10 +61,8 @@ const CMPopin = props => {
|
|
|
59
61
|
// eslint-disable-next-line no-console
|
|
60
62
|
console.log('e.target'); // eslint-disable-next-line no-console
|
|
61
63
|
|
|
62
|
-
console.log(e.target);
|
|
63
|
-
|
|
64
|
-
console.log('No stopPropagation et preventDefault');
|
|
65
|
-
onClose(e);
|
|
64
|
+
console.log(e.target);
|
|
65
|
+
handleCloseButton();
|
|
66
66
|
}
|
|
67
67
|
};
|
|
68
68
|
|
|
@@ -71,7 +71,7 @@ const CMPopin = props => {
|
|
|
71
71
|
document.removeEventListener('click', closePopin);
|
|
72
72
|
};
|
|
73
73
|
}
|
|
74
|
-
}, [mode, onClose]);
|
|
74
|
+
}, [handleCloseButton, mode, onClose]);
|
|
75
75
|
|
|
76
76
|
const renderHeader = () => {
|
|
77
77
|
if (header) {
|
|
@@ -164,12 +164,15 @@ const CMPopin = props => {
|
|
|
164
164
|
className: style.filesListContainer
|
|
165
165
|
}, /*#__PURE__*/React.createElement(ListItems, list));
|
|
166
166
|
return null;
|
|
167
|
-
};
|
|
167
|
+
}; // const handleCloseButton = useCallback(
|
|
168
|
+
// e => {
|
|
169
|
+
// e.preventDefault();
|
|
170
|
+
// onClose();
|
|
171
|
+
// },
|
|
172
|
+
// [onClose]
|
|
173
|
+
// );
|
|
174
|
+
|
|
168
175
|
|
|
169
|
-
const handleCloseButton = useCallback(e => {
|
|
170
|
-
e.stopPropagation();
|
|
171
|
-
onClose(e);
|
|
172
|
-
}, [onClose]);
|
|
173
176
|
const wrapperPopinStyle = classNames(mode === 'cookie' && style.popinCookie, mode === 'list' && style.popinFilesList, mode === 'items' && style.popinItems, style.popin);
|
|
174
177
|
return /*#__PURE__*/React.createElement("div", {
|
|
175
178
|
className: mode !== 'cookie' ? style.background : null,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useRef","useEffect","useCallback","NovaSolidInterfaceFeedbackInterfaceAlertDiamond","AlertDiamond","NovaSolidApplicationsWindowUpload3","WindowUpload","NovaLineSettingsCookie","Cookie","NovaSolidSpaceMoonRocket","MoonRocket","NovaCompositionCoorpacademyPadlock","LockIcon","NovaLineStatusCheckCircle1","CheckCircle1","NovaSolidFilesBasicFileLines","FileLinesIcon","map","isEmpty","classNames","Cta","ButtonLinkIconOnly","InputSwitch","Title","CardsGrid","ListItems","style","propTypes","IconType","lockedContent","lockIcon","fileZipped","filesListIconContainer","filesListIcon","CMPopin","props","content","mode","firstButton","secondButton","onClose","header","icon","backgroundImageUrl","descriptionText","thirdButton","cookieTitle","descriptionBtnTxt","listBtnSwicth","items","logo","LogoComponent","backgroundImageStyle","backgroundImage","backgroundSize","nodeRef","closePopin","e","current","contains","target","console","log","document","addEventListener","removeEventListener","renderHeader","title","headerIcon","TopTitleIcon","headerContent","headerBackground","cookieHeader","cookieIconContainer","cookieIcon","getClassBtnSwitch","index","btnList","firstBtnSwitchContainer","length","lastBtnSwitchContainer","singleSwitchContainer","renderBtnSwitch","convert","cap","el","type","value","onChange","titlePosition","theme","details","requiredSelection","disabled","id","dataName","renderItems","list","itemsContainer","filesListContainer","handleCloseButton","stopPropagation","wrapperPopinStyle","popinCookie","popinFilesList","popinItems","popin","background","popinHeader","cookieTitleContainer","titleContainer","contentSection","message","__html","descriptionBtn","buttonContainer","largeButton","button","label","handleOnclick","customStyle"],"sources":["../../../src/molecule/cm-popin/index.js"],"sourcesContent":["// import React from 'react';\nimport React, {useRef, useEffect, useCallback} from 'react';\nimport {\n NovaSolidInterfaceFeedbackInterfaceAlertDiamond as AlertDiamond,\n NovaSolidApplicationsWindowUpload3 as WindowUpload,\n NovaLineSettingsCookie as Cookie,\n NovaSolidSpaceMoonRocket as MoonRocket,\n NovaCompositionCoorpacademyPadlock as LockIcon,\n NovaLineStatusCheckCircle1 as CheckCircle1,\n NovaSolidFilesBasicFileLines as FileLinesIcon\n} from '@coorpacademy/nova-icons';\nimport map from 'lodash/fp/map';\nimport isEmpty from 'lodash/fp/isEmpty';\nimport classNames from 'classnames';\nimport Cta from '../../atom/button-link';\nimport ButtonLinkIconOnly from '../../atom/button-link-icon-only';\nimport InputSwitch from '../../atom/input-switch';\nimport Title from '../../atom/title';\nimport CardsGrid from '../../organism/cards-grid';\nimport ListItems from '../../organism/list-items';\nimport style from './style.css';\nimport propTypes from './types';\n\nconst IconType = {\n lockedContent: <LockIcon className={style.lockIcon} />,\n fileZipped: (\n <div className={style.filesListIconContainer}>\n <FileLinesIcon className={style.filesListIcon} />\n </div>\n )\n};\n\nconst CMPopin = props => {\n const {\n content,\n mode = 'alert',\n firstButton,\n secondButton,\n onClose,\n header,\n icon,\n backgroundImageUrl,\n descriptionText,\n thirdButton,\n cookieTitle,\n descriptionBtnTxt,\n listBtnSwicth,\n items\n } = props;\n const logo = {\n AlertDiamond,\n WindowUpload,\n MoonRocket,\n CheckCircle1\n };\n const LogoComponent = logo[icon];\n\n const backgroundImageStyle = backgroundImageUrl\n ? {\n backgroundImage: `url(${backgroundImageUrl})`,\n backgroundSize: 'cover'\n }\n : null;\n const nodeRef = useRef(null);\n useEffect(() => {\n if (mode === 'items') {\n const closePopin = e => {\n if (nodeRef && nodeRef.current && !nodeRef.current.contains(e.target)) {\n // eslint-disable-next-line no-console\n console.log('e.target');\n // eslint-disable-next-line no-console\n console.log(e.target);\n // eslint-disable-next-line no-console\n console.log('No stopPropagation et preventDefault');\n onClose(e);\n }\n };\n document.addEventListener('click', closePopin);\n return () => {\n document.removeEventListener('click', closePopin);\n };\n }\n }, [mode, onClose]);\n const renderHeader = () => {\n if (header) {\n const {title, headerIcon, backgroundImage} = header;\n const TopTitleIcon = IconType[headerIcon];\n\n return (\n <>\n {title ? (\n <div className={style.headerContent}>\n {TopTitleIcon}\n <Title {...title} />\n </div>\n ) : null}\n {backgroundImage ? (\n <img className={style.headerBackground} src={backgroundImage} />\n ) : null}\n </>\n );\n }\n\n if (mode === 'cookie')\n return (\n <div className={style.cookieHeader}>\n <div className={style.cookieIconContainer}>\n <Cookie className={style.cookieIcon} />\n </div>\n <div className={style.cookieTitle}>{cookieTitle}</div>\n </div>\n );\n\n return null;\n };\n\n const getClassBtnSwitch = (index, btnList) => {\n switch (index) {\n case 0:\n return style.firstBtnSwitchContainer;\n case btnList.length - 1:\n return style.lastBtnSwitchContainer;\n default:\n return style.singleSwitchContainer;\n }\n };\n\n const renderBtnSwitch = () => {\n return map.convert({cap: false})((el, index) => {\n const {\n type,\n title,\n value,\n onChange,\n titlePosition,\n theme,\n details,\n requiredSelection,\n disabled,\n id,\n 'data-name': dataName\n } = el;\n return (\n <div key={index} className={getClassBtnSwitch(index, listBtnSwicth)}>\n <InputSwitch\n {...{\n type,\n title,\n value,\n onChange,\n titlePosition,\n theme,\n details,\n requiredSelection,\n disabled,\n id,\n 'data-name': dataName\n }}\n />\n </div>\n );\n })(listBtnSwicth);\n };\n\n const renderItems = () => {\n const {type, list} = items;\n if (isEmpty(list)) return null;\n\n if (type === 'content')\n return (\n <div className={style.itemsContainer} data-name={'cm-popin-cards'}>\n <CardsGrid {...list} />\n </div>\n );\n if (type === 'list')\n return (\n <div className={style.filesListContainer}>\n <ListItems {...list} />\n </div>\n );\n\n return null;\n };\n const handleCloseButton = useCallback(\n e => {\n e.stopPropagation();\n onClose(e);\n },\n [onClose]\n );\n const wrapperPopinStyle = classNames(\n mode === 'cookie' && style.popinCookie,\n mode === 'list' && style.popinFilesList,\n mode === 'items' && style.popinItems,\n style.popin\n );\n return (\n <div\n className={mode !== 'cookie' ? style.background : null}\n style={backgroundImageStyle}\n data-name={'cm-popin-container'}\n >\n <div className={wrapperPopinStyle} ref={nodeRef}>\n <header className={style.popinHeader}>\n {renderHeader()}\n {onClose ? (\n <ButtonLinkIconOnly\n onClick={handleCloseButton}\n data-name={'close-icon'}\n aria-label={'close-icon'}\n size=\"small\"\n icon=\"close\"\n />\n ) : null}\n </header>\n {mode !== 'items' && mode !== 'list' ? (\n <div\n className={\n mode === 'cookie' || mode === 'information'\n ? style.cookieTitleContainer\n : style.titleContainer\n }\n >\n <div className={style.contentSection}>\n {LogoComponent ? <LogoComponent className={style.icon} /> : null}\n {content ? (\n <p\n className={mode === 'alert' ? style.content : style.message}\n data-name={'cm-popin-content'}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: content}}\n />\n ) : null}\n </div>\n {descriptionText ? (\n <p\n className={style.descriptionText}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: descriptionText}}\n />\n ) : null}\n </div>\n ) : null}\n {descriptionBtnTxt ? <div className={style.descriptionBtn}>{descriptionBtnTxt}</div> : null}\n {!isEmpty(items) ? renderItems() : null}\n {renderBtnSwitch()}\n {firstButton || secondButton || thirdButton ? (\n <div className={style.buttonContainer}>\n {firstButton ? (\n <div className={firstButton.largeButton ? style.largeButton : style.button}>\n <Cta\n label={firstButton.label}\n onClick={firstButton.handleOnclick}\n data-name={'cm-popin-cta'}\n aria-label={firstButton['aria-label']}\n type={firstButton.type}\n customStyle={firstButton.customStyle}\n />\n </div>\n ) : null}\n {secondButton ? (\n <div className={secondButton.largeButton ? style.largeButton : style.button}>\n <Cta\n label={secondButton.label}\n onClick={secondButton.handleOnclick}\n data-name={`cm-popin-cta-${secondButton.type}`}\n aria-label={secondButton['aria-label']}\n type={secondButton.type}\n customStyle={secondButton.customStyle}\n />\n </div>\n ) : null}\n {thirdButton ? (\n <div className={thirdButton.largeButton ? style.largeButton : style.button}>\n <Cta\n label={thirdButton.label}\n onClick={thirdButton.handleOnclick}\n data-name={`cm-popin-cta-${thirdButton.type}`}\n aria-label={thirdButton['aria-label']}\n type={thirdButton.type}\n customStyle={thirdButton.customStyle}\n />\n </div>\n ) : null}\n </div>\n ) : null}\n </div>\n </div>\n );\n};\n\nCMPopin.propTypes = propTypes;\n\nexport default CMPopin;\n"],"mappings":"AAAA;AACA,OAAOA,KAAP,IAAeC,MAAf,EAAuBC,SAAvB,EAAkCC,WAAlC,QAAoD,OAApD;AACA,SACEC,+CAA+C,IAAIC,YADrD,EAEEC,kCAAkC,IAAIC,YAFxC,EAGEC,sBAAsB,IAAIC,MAH5B,EAIEC,wBAAwB,IAAIC,UAJ9B,EAKEC,kCAAkC,IAAIC,QALxC,EAMEC,0BAA0B,IAAIC,YANhC,EAOEC,4BAA4B,IAAIC,aAPlC,QAQO,0BARP;AASA,OAAOC,GAAP,MAAgB,eAAhB;AACA,OAAOC,OAAP,MAAoB,mBAApB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,GAAP,MAAgB,wBAAhB;AACA,OAAOC,kBAAP,MAA+B,kCAA/B;AACA,OAAOC,WAAP,MAAwB,yBAAxB;AACA,OAAOC,KAAP,MAAkB,kBAAlB;AACA,OAAOC,SAAP,MAAsB,2BAAtB;AACA,OAAOC,SAAP,MAAsB,2BAAtB;AACA,OAAOC,KAAP,MAAkB,aAAlB;AACA,OAAOC,SAAP,MAAsB,SAAtB;AAEA,MAAMC,QAAQ,GAAG;EACfC,aAAa,eAAE,oBAAC,QAAD;IAAU,SAAS,EAAEH,KAAK,CAACI;EAA3B,EADA;EAEfC,UAAU,eACR;IAAK,SAAS,EAAEL,KAAK,CAACM;EAAtB,gBACE,oBAAC,aAAD;IAAe,SAAS,EAAEN,KAAK,CAACO;EAAhC,EADF;AAHa,CAAjB;;AASA,MAAMC,OAAO,GAAGC,KAAK,IAAI;EACvB,MAAM;IACJC,OADI;IAEJC,IAAI,GAAG,OAFH;IAGJC,WAHI;IAIJC,YAJI;IAKJC,OALI;IAMJC,MANI;IAOJC,IAPI;IAQJC,kBARI;IASJC,eATI;I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pB;IAME,WAAW,EAAEzC,WAAW,CAAC2E;EAN3B,EADF,CADU,GAWR,IApCN,CADD,GAuCG,IAnFN,CALF,CADF;AA6FD,CAjQD;;AAmQAtF,OAAO,CAACP,SAAR,2CAAoBA,SAApB;AAEA,eAAeO,OAAf"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useRef","useEffect","useMemo","NovaSolidInterfaceFeedbackInterfaceAlertDiamond","AlertDiamond","NovaSolidApplicationsWindowUpload3","WindowUpload","NovaLineSettingsCookie","Cookie","NovaSolidSpaceMoonRocket","MoonRocket","NovaCompositionCoorpacademyPadlock","LockIcon","NovaLineStatusCheckCircle1","CheckCircle1","NovaSolidFilesBasicFileLines","FileLinesIcon","map","isEmpty","classNames","Cta","ButtonLinkIconOnly","InputSwitch","Title","CardsGrid","ListItems","style","propTypes","IconType","lockedContent","lockIcon","fileZipped","filesListIconContainer","filesListIcon","CMPopin","props","content","mode","firstButton","secondButton","onClose","header","icon","backgroundImageUrl","descriptionText","thirdButton","cookieTitle","descriptionBtnTxt","listBtnSwicth","items","logo","LogoComponent","backgroundImageStyle","backgroundImage","backgroundSize","handleCloseButton","nodeRef","closePopin","e","current","contains","target","console","log","document","addEventListener","removeEventListener","renderHeader","title","headerIcon","TopTitleIcon","headerContent","headerBackground","cookieHeader","cookieIconContainer","cookieIcon","getClassBtnSwitch","index","btnList","firstBtnSwitchContainer","length","lastBtnSwitchContainer","singleSwitchContainer","renderBtnSwitch","convert","cap","el","type","value","onChange","titlePosition","theme","details","requiredSelection","disabled","id","dataName","renderItems","list","itemsContainer","filesListContainer","wrapperPopinStyle","popinCookie","popinFilesList","popinItems","popin","background","popinHeader","cookieTitleContainer","titleContainer","contentSection","message","__html","descriptionBtn","buttonContainer","largeButton","button","label","handleOnclick","customStyle"],"sources":["../../../src/molecule/cm-popin/index.js"],"sourcesContent":["// import React from 'react';\nimport React, {useRef, useEffect, useMemo} from 'react';\nimport {\n NovaSolidInterfaceFeedbackInterfaceAlertDiamond as AlertDiamond,\n NovaSolidApplicationsWindowUpload3 as WindowUpload,\n NovaLineSettingsCookie as Cookie,\n NovaSolidSpaceMoonRocket as MoonRocket,\n NovaCompositionCoorpacademyPadlock as LockIcon,\n NovaLineStatusCheckCircle1 as CheckCircle1,\n NovaSolidFilesBasicFileLines as FileLinesIcon\n} from '@coorpacademy/nova-icons';\nimport map from 'lodash/fp/map';\nimport isEmpty from 'lodash/fp/isEmpty';\nimport classNames from 'classnames';\nimport Cta from '../../atom/button-link';\nimport ButtonLinkIconOnly from '../../atom/button-link-icon-only';\nimport InputSwitch from '../../atom/input-switch';\nimport Title from '../../atom/title';\nimport CardsGrid from '../../organism/cards-grid';\nimport ListItems from '../../organism/list-items';\nimport style from './style.css';\nimport propTypes from './types';\n\nconst IconType = {\n lockedContent: <LockIcon className={style.lockIcon} />,\n fileZipped: (\n <div className={style.filesListIconContainer}>\n <FileLinesIcon className={style.filesListIcon} />\n </div>\n )\n};\n// const preventDefault = e => e.preventDefault();\n// const stopPropagation = e => e.stopPropagation();\n\nconst CMPopin = props => {\n const {\n content,\n mode = 'alert',\n firstButton,\n secondButton,\n onClose,\n header,\n icon,\n backgroundImageUrl,\n descriptionText,\n thirdButton,\n cookieTitle,\n descriptionBtnTxt,\n listBtnSwicth,\n items\n } = props;\n const logo = {\n AlertDiamond,\n WindowUpload,\n MoonRocket,\n CheckCircle1\n };\n const LogoComponent = logo[icon];\n\n const backgroundImageStyle = backgroundImageUrl\n ? {\n backgroundImage: `url(${backgroundImageUrl})`,\n backgroundSize: 'cover'\n }\n : null;\n const handleCloseButton = useMemo(() => () => onClose(), [onClose]);\n\n const nodeRef = useRef(null);\n useEffect(() => {\n if (mode === 'items') {\n const closePopin = e => {\n if (nodeRef && nodeRef.current && !nodeRef.current.contains(e.target)) {\n // eslint-disable-next-line no-console\n console.log('e.target');\n // eslint-disable-next-line no-console\n console.log(e.target);\n handleCloseButton();\n }\n };\n document.addEventListener('click', closePopin);\n return () => {\n document.removeEventListener('click', closePopin);\n };\n }\n }, [handleCloseButton, mode, onClose]);\n const renderHeader = () => {\n if (header) {\n const {title, headerIcon, backgroundImage} = header;\n const TopTitleIcon = IconType[headerIcon];\n\n return (\n <>\n {title ? (\n <div className={style.headerContent}>\n {TopTitleIcon}\n <Title {...title} />\n </div>\n ) : null}\n {backgroundImage ? (\n <img className={style.headerBackground} src={backgroundImage} />\n ) : null}\n </>\n );\n }\n\n if (mode === 'cookie')\n return (\n <div className={style.cookieHeader}>\n <div className={style.cookieIconContainer}>\n <Cookie className={style.cookieIcon} />\n </div>\n <div className={style.cookieTitle}>{cookieTitle}</div>\n </div>\n );\n\n return null;\n };\n\n const getClassBtnSwitch = (index, btnList) => {\n switch (index) {\n case 0:\n return style.firstBtnSwitchContainer;\n case btnList.length - 1:\n return style.lastBtnSwitchContainer;\n default:\n return style.singleSwitchContainer;\n }\n };\n\n const renderBtnSwitch = () => {\n return map.convert({cap: false})((el, index) => {\n const {\n type,\n title,\n value,\n onChange,\n titlePosition,\n theme,\n details,\n requiredSelection,\n disabled,\n id,\n 'data-name': dataName\n } = el;\n return (\n <div key={index} className={getClassBtnSwitch(index, listBtnSwicth)}>\n <InputSwitch\n {...{\n type,\n title,\n value,\n onChange,\n titlePosition,\n theme,\n details,\n requiredSelection,\n disabled,\n id,\n 'data-name': dataName\n }}\n />\n </div>\n );\n })(listBtnSwicth);\n };\n\n const renderItems = () => {\n const {type, list} = items;\n if (isEmpty(list)) return null;\n\n if (type === 'content')\n return (\n <div className={style.itemsContainer} data-name={'cm-popin-cards'}>\n <CardsGrid {...list} />\n </div>\n );\n if (type === 'list')\n return (\n <div className={style.filesListContainer}>\n <ListItems {...list} />\n </div>\n );\n\n return null;\n };\n // const handleCloseButton = useCallback(\n // e => {\n // e.preventDefault();\n // onClose();\n // },\n // [onClose]\n // );\n const wrapperPopinStyle = classNames(\n mode === 'cookie' && style.popinCookie,\n mode === 'list' && style.popinFilesList,\n mode === 'items' && style.popinItems,\n style.popin\n );\n return (\n <div\n className={mode !== 'cookie' ? style.background : null}\n style={backgroundImageStyle}\n data-name={'cm-popin-container'}\n >\n <div className={wrapperPopinStyle} ref={nodeRef}>\n <header className={style.popinHeader}>\n {renderHeader()}\n {onClose ? (\n <ButtonLinkIconOnly\n onClick={handleCloseButton}\n data-name={'close-icon'}\n aria-label={'close-icon'}\n size=\"small\"\n icon=\"close\"\n />\n ) : null}\n </header>\n {mode !== 'items' && mode !== 'list' ? (\n <div\n className={\n mode === 'cookie' || mode === 'information'\n ? style.cookieTitleContainer\n : style.titleContainer\n }\n >\n <div className={style.contentSection}>\n {LogoComponent ? <LogoComponent className={style.icon} /> : null}\n {content ? (\n <p\n className={mode === 'alert' ? style.content : style.message}\n data-name={'cm-popin-content'}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: content}}\n />\n ) : null}\n </div>\n {descriptionText ? (\n <p\n className={style.descriptionText}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: descriptionText}}\n />\n ) : null}\n </div>\n ) : null}\n {descriptionBtnTxt ? <div className={style.descriptionBtn}>{descriptionBtnTxt}</div> : null}\n {!isEmpty(items) ? renderItems() : null}\n {renderBtnSwitch()}\n {firstButton || secondButton || thirdButton ? (\n <div className={style.buttonContainer}>\n {firstButton ? (\n <div className={firstButton.largeButton ? style.largeButton : style.button}>\n <Cta\n label={firstButton.label}\n onClick={firstButton.handleOnclick}\n data-name={'cm-popin-cta'}\n aria-label={firstButton['aria-label']}\n type={firstButton.type}\n customStyle={firstButton.customStyle}\n />\n </div>\n ) : null}\n {secondButton ? (\n <div className={secondButton.largeButton ? style.largeButton : style.button}>\n <Cta\n label={secondButton.label}\n onClick={secondButton.handleOnclick}\n data-name={`cm-popin-cta-${secondButton.type}`}\n aria-label={secondButton['aria-label']}\n type={secondButton.type}\n customStyle={secondButton.customStyle}\n />\n </div>\n ) : null}\n {thirdButton ? (\n <div className={thirdButton.largeButton ? style.largeButton : style.button}>\n <Cta\n label={thirdButton.label}\n onClick={thirdButton.handleOnclick}\n data-name={`cm-popin-cta-${thirdButton.type}`}\n aria-label={thirdButton['aria-label']}\n type={thirdButton.type}\n customStyle={thirdButton.customStyle}\n />\n </div>\n ) : null}\n </div>\n ) : null}\n </div>\n </div>\n );\n};\n\nCMPopin.propTypes = propTypes;\n\nexport default CMPopin;\n"],"mappings":"AAAA;AACA,OAAOA,KAAP,IAAeC,MAAf,EAAuBC,SAAvB,EAAkCC,OAAlC,QAAgD,OAAhD;AACA,SACEC,+CAA+C,IAAIC,YADrD,EAEEC,kCAAkC,IAAIC,YAFxC,EAGEC,sBAAsB,IAAIC,MAH5B,EAIEC,wBAAwB,IAAIC,UAJ9B,EAKEC,kCAAkC,IAAIC,QALxC,EAMEC,0BAA0B,IAAIC,YANhC,EAOEC,4BAA4B,IAAIC,aAPlC,QAQO,0BARP;AASA,OAAOC,GAAP,MAAgB,eAAhB;AACA,OAAOC,OAAP,MAAoB,mBAApB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,GAAP,MAAgB,wBAAhB;AACA,OAAOC,kBAAP,MAA+B,kCAA/B;AACA,OAAOC,WAAP,MAAwB,yBAAxB;AACA,OAAOC,KAAP,MAAkB,kBAAlB;AACA,OAAOC,SAAP,MAAsB,2BAAtB;AACA,OAAOC,SAAP,MAAsB,2BAAtB;AACA,OAAOC,KAAP,MAAkB,aAAlB;AACA,OAAOC,SAAP,MAAsB,SAAtB;AAEA,MAAMC,QAAQ,GAAG;EACfC,aAAa,eAAE,oBAAC,QAAD;IAAU,SAAS,EAAEH,KAAK,CAACI;EAA3B,EADA;EAEfC,UAAU,eACR;IAAK,SAAS,EAAEL,KAAK,CAACM;EAAtB,gBACE,oBAAC,aAAD;IAAe,SAAS,EAAEN,KAAK,CAACO;EAAhC,EADF;AAHa,CAAjB,C,CAQA;AACA;;AAEA,MAAMC,OAAO,GAAGC,KAAK,IAAI;EACvB,MAAM;IACJC,OADI;IAEJC,IAAI,GAAG,OAFH;IAGJC,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,CAAC0C,IALpB;IAME,WAAW,EAAE1C,WAAW,CAAC0E;EAN3B,EADF,CADU,GAWR,IApCN,CADD,GAuCG,IAnFN,CALF,CADF;AA6FD,CAjQD;;AAmQArF,OAAO,CAACP,SAAR,2CAAoBA,SAApB;AAEA,eAAeO,OAAf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/cm-popin/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/cm-popin/index.js"],"names":[],"mappings":";AAkCA,kDAiQC"}
|
|
@@ -45,7 +45,8 @@ const IconType = {
|
|
|
45
45
|
}, /*#__PURE__*/_react.default.createElement(_novaIcons.NovaSolidFilesBasicFileLines, {
|
|
46
46
|
className: _style.default.filesListIcon
|
|
47
47
|
}))
|
|
48
|
-
};
|
|
48
|
+
}; // const preventDefault = e => e.preventDefault();
|
|
49
|
+
// const stopPropagation = e => e.stopPropagation();
|
|
49
50
|
|
|
50
51
|
const CMPopin = props => {
|
|
51
52
|
const {
|
|
@@ -75,6 +76,7 @@ const CMPopin = props => {
|
|
|
75
76
|
backgroundImage: `url(${backgroundImageUrl})`,
|
|
76
77
|
backgroundSize: 'cover'
|
|
77
78
|
} : null;
|
|
79
|
+
const handleCloseButton = (0, _react.useMemo)(() => () => onClose(), [onClose]);
|
|
78
80
|
const nodeRef = (0, _react.useRef)(null);
|
|
79
81
|
(0, _react.useEffect)(() => {
|
|
80
82
|
if (mode === 'items') {
|
|
@@ -83,10 +85,8 @@ const CMPopin = props => {
|
|
|
83
85
|
// eslint-disable-next-line no-console
|
|
84
86
|
console.log('e.target'); // eslint-disable-next-line no-console
|
|
85
87
|
|
|
86
|
-
console.log(e.target);
|
|
87
|
-
|
|
88
|
-
console.log('No stopPropagation et preventDefault');
|
|
89
|
-
onClose(e);
|
|
88
|
+
console.log(e.target);
|
|
89
|
+
handleCloseButton();
|
|
90
90
|
}
|
|
91
91
|
};
|
|
92
92
|
|
|
@@ -95,7 +95,7 @@ const CMPopin = props => {
|
|
|
95
95
|
document.removeEventListener('click', closePopin);
|
|
96
96
|
};
|
|
97
97
|
}
|
|
98
|
-
}, [mode, onClose]);
|
|
98
|
+
}, [handleCloseButton, mode, onClose]);
|
|
99
99
|
|
|
100
100
|
const renderHeader = () => {
|
|
101
101
|
if (header) {
|
|
@@ -188,12 +188,15 @@ const CMPopin = props => {
|
|
|
188
188
|
className: _style.default.filesListContainer
|
|
189
189
|
}, /*#__PURE__*/_react.default.createElement(_listItems.default, list));
|
|
190
190
|
return null;
|
|
191
|
-
};
|
|
191
|
+
}; // const handleCloseButton = useCallback(
|
|
192
|
+
// e => {
|
|
193
|
+
// e.preventDefault();
|
|
194
|
+
// onClose();
|
|
195
|
+
// },
|
|
196
|
+
// [onClose]
|
|
197
|
+
// );
|
|
198
|
+
|
|
192
199
|
|
|
193
|
-
const handleCloseButton = (0, _react.useCallback)(e => {
|
|
194
|
-
e.stopPropagation();
|
|
195
|
-
onClose(e);
|
|
196
|
-
}, [onClose]);
|
|
197
200
|
const wrapperPopinStyle = (0, _classnames.default)(mode === 'cookie' && _style.default.popinCookie, mode === 'list' && _style.default.popinFilesList, mode === 'items' && _style.default.popinItems, _style.default.popin);
|
|
198
201
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
199
202
|
className: mode !== 'cookie' ? _style.default.background : null,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["IconType","lockedContent","style","lockIcon","fileZipped","filesListIconContainer","filesListIcon","CMPopin","props","content","mode","firstButton","secondButton","onClose","header","icon","backgroundImageUrl","descriptionText","thirdButton","cookieTitle","descriptionBtnTxt","listBtnSwicth","items","logo","AlertDiamond","WindowUpload","MoonRocket","CheckCircle1","LogoComponent","backgroundImageStyle","backgroundImage","backgroundSize","nodeRef","useRef","useEffect","closePopin","e","current","contains","target","console","log","document","addEventListener","removeEventListener","renderHeader","title","headerIcon","TopTitleIcon","headerContent","headerBackground","cookieHeader","cookieIconContainer","cookieIcon","getClassBtnSwitch","index","btnList","firstBtnSwitchContainer","length","lastBtnSwitchContainer","singleSwitchContainer","renderBtnSwitch","map","convert","cap","el","type","value","onChange","titlePosition","theme","details","requiredSelection","disabled","id","dataName","renderItems","list","isEmpty","itemsContainer","filesListContainer","handleCloseButton","useCallback","stopPropagation","wrapperPopinStyle","classNames","popinCookie","popinFilesList","popinItems","popin","background","popinHeader","cookieTitleContainer","titleContainer","contentSection","message","__html","descriptionBtn","buttonContainer","largeButton","button","label","handleOnclick","customStyle","propTypes"],"sources":["../../../src/molecule/cm-popin/index.js"],"sourcesContent":["// import React from 'react';\nimport React, {useRef, useEffect, useCallback} from 'react';\nimport {\n NovaSolidInterfaceFeedbackInterfaceAlertDiamond as AlertDiamond,\n NovaSolidApplicationsWindowUpload3 as WindowUpload,\n NovaLineSettingsCookie as Cookie,\n NovaSolidSpaceMoonRocket as MoonRocket,\n NovaCompositionCoorpacademyPadlock as LockIcon,\n NovaLineStatusCheckCircle1 as CheckCircle1,\n NovaSolidFilesBasicFileLines as FileLinesIcon\n} from '@coorpacademy/nova-icons';\nimport map from 'lodash/fp/map';\nimport isEmpty from 'lodash/fp/isEmpty';\nimport classNames from 'classnames';\nimport Cta from '../../atom/button-link';\nimport ButtonLinkIconOnly from '../../atom/button-link-icon-only';\nimport InputSwitch from '../../atom/input-switch';\nimport Title from '../../atom/title';\nimport CardsGrid from '../../organism/cards-grid';\nimport ListItems from '../../organism/list-items';\nimport style from './style.css';\nimport propTypes from './types';\n\nconst IconType = {\n lockedContent: <LockIcon className={style.lockIcon} />,\n fileZipped: (\n <div className={style.filesListIconContainer}>\n <FileLinesIcon className={style.filesListIcon} />\n </div>\n )\n};\n\nconst CMPopin = props => {\n const {\n content,\n mode = 'alert',\n firstButton,\n secondButton,\n onClose,\n header,\n icon,\n backgroundImageUrl,\n descriptionText,\n thirdButton,\n cookieTitle,\n descriptionBtnTxt,\n listBtnSwicth,\n items\n } = props;\n const logo = {\n AlertDiamond,\n WindowUpload,\n MoonRocket,\n CheckCircle1\n };\n const LogoComponent = logo[icon];\n\n const backgroundImageStyle = backgroundImageUrl\n ? {\n backgroundImage: `url(${backgroundImageUrl})`,\n backgroundSize: 'cover'\n }\n : null;\n const nodeRef = useRef(null);\n useEffect(() => {\n if (mode === 'items') {\n const closePopin = e => {\n if (nodeRef && nodeRef.current && !nodeRef.current.contains(e.target)) {\n // eslint-disable-next-line no-console\n console.log('e.target');\n // eslint-disable-next-line no-console\n console.log(e.target);\n // eslint-disable-next-line no-console\n console.log('No stopPropagation et preventDefault');\n onClose(e);\n }\n };\n document.addEventListener('click', closePopin);\n return () => {\n document.removeEventListener('click', closePopin);\n };\n }\n }, [mode, onClose]);\n const renderHeader = () => {\n if (header) {\n const {title, headerIcon, backgroundImage} = header;\n const TopTitleIcon = IconType[headerIcon];\n\n return (\n <>\n {title ? (\n <div className={style.headerContent}>\n {TopTitleIcon}\n <Title {...title} />\n </div>\n ) : null}\n {backgroundImage ? (\n <img className={style.headerBackground} src={backgroundImage} />\n ) : null}\n </>\n );\n }\n\n if (mode === 'cookie')\n return (\n <div className={style.cookieHeader}>\n <div className={style.cookieIconContainer}>\n <Cookie className={style.cookieIcon} />\n </div>\n <div className={style.cookieTitle}>{cookieTitle}</div>\n </div>\n );\n\n return null;\n };\n\n const getClassBtnSwitch = (index, btnList) => {\n switch (index) {\n case 0:\n return style.firstBtnSwitchContainer;\n case btnList.length - 1:\n return style.lastBtnSwitchContainer;\n default:\n return style.singleSwitchContainer;\n }\n };\n\n const renderBtnSwitch = () => {\n return map.convert({cap: false})((el, index) => {\n const {\n type,\n title,\n value,\n onChange,\n titlePosition,\n theme,\n details,\n requiredSelection,\n disabled,\n id,\n 'data-name': dataName\n } = el;\n return (\n <div key={index} className={getClassBtnSwitch(index, listBtnSwicth)}>\n <InputSwitch\n {...{\n type,\n title,\n value,\n onChange,\n titlePosition,\n theme,\n details,\n requiredSelection,\n disabled,\n id,\n 'data-name': dataName\n }}\n />\n </div>\n );\n })(listBtnSwicth);\n };\n\n const renderItems = () => {\n const {type, list} = items;\n if (isEmpty(list)) return null;\n\n if (type === 'content')\n return (\n <div className={style.itemsContainer} data-name={'cm-popin-cards'}>\n <CardsGrid {...list} />\n </div>\n );\n if (type === 'list')\n return (\n <div className={style.filesListContainer}>\n <ListItems {...list} />\n </div>\n );\n\n return null;\n };\n const handleCloseButton = useCallback(\n e => {\n e.stopPropagation();\n onClose(e);\n },\n [onClose]\n );\n const wrapperPopinStyle = classNames(\n mode === 'cookie' && style.popinCookie,\n mode === 'list' && style.popinFilesList,\n mode === 'items' && style.popinItems,\n style.popin\n );\n return (\n <div\n className={mode !== 'cookie' ? style.background : null}\n style={backgroundImageStyle}\n data-name={'cm-popin-container'}\n >\n <div className={wrapperPopinStyle} ref={nodeRef}>\n <header className={style.popinHeader}>\n {renderHeader()}\n {onClose ? (\n <ButtonLinkIconOnly\n onClick={handleCloseButton}\n data-name={'close-icon'}\n aria-label={'close-icon'}\n size=\"small\"\n icon=\"close\"\n />\n ) : null}\n </header>\n {mode !== 'items' && mode !== 'list' ? (\n <div\n className={\n mode === 'cookie' || mode === 'information'\n ? style.cookieTitleContainer\n : style.titleContainer\n }\n >\n <div className={style.contentSection}>\n {LogoComponent ? <LogoComponent className={style.icon} /> : null}\n {content ? (\n <p\n className={mode === 'alert' ? style.content : style.message}\n data-name={'cm-popin-content'}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: content}}\n />\n ) : null}\n </div>\n {descriptionText ? (\n <p\n className={style.descriptionText}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: descriptionText}}\n />\n ) : null}\n </div>\n ) : null}\n {descriptionBtnTxt ? <div className={style.descriptionBtn}>{descriptionBtnTxt}</div> : null}\n {!isEmpty(items) ? renderItems() : null}\n {renderBtnSwitch()}\n {firstButton || secondButton || thirdButton ? (\n <div className={style.buttonContainer}>\n {firstButton ? (\n <div className={firstButton.largeButton ? style.largeButton : style.button}>\n <Cta\n label={firstButton.label}\n onClick={firstButton.handleOnclick}\n data-name={'cm-popin-cta'}\n aria-label={firstButton['aria-label']}\n type={firstButton.type}\n customStyle={firstButton.customStyle}\n />\n </div>\n ) : null}\n {secondButton ? (\n <div className={secondButton.largeButton ? style.largeButton : style.button}>\n <Cta\n label={secondButton.label}\n onClick={secondButton.handleOnclick}\n data-name={`cm-popin-cta-${secondButton.type}`}\n aria-label={secondButton['aria-label']}\n type={secondButton.type}\n customStyle={secondButton.customStyle}\n />\n </div>\n ) : null}\n {thirdButton ? (\n <div className={thirdButton.largeButton ? style.largeButton : style.button}>\n <Cta\n label={thirdButton.label}\n onClick={thirdButton.handleOnclick}\n data-name={`cm-popin-cta-${thirdButton.type}`}\n aria-label={thirdButton['aria-label']}\n type={thirdButton.type}\n customStyle={thirdButton.customStyle}\n />\n </div>\n ) : null}\n </div>\n ) : null}\n </div>\n </div>\n );\n};\n\nCMPopin.propTypes = propTypes;\n\nexport default CMPopin;\n"],"mappings":";;;;;AACA;;AACA;;AASA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AArBA;AAuBA,MAAMA,QAAQ,GAAG;EACfC,aAAa,eAAE,6BAAC,6CAAD;IAAU,SAAS,EAAEC,cAAA,CAAMC;EAA3B,EADA;EAEfC,UAAU,eACR;IAAK,SAAS,EAAEF,cAAA,CAAMG;EAAtB,gBACE,6BAAC,uCAAD;IAAe,SAAS,EAAEH,cAAA,CAAMI;EAAhC,EADF;AAHa,CAAjB;;AASA,MAAMC,OAAO,GAAGC,KAAK,IAAI;EACvB,MAAM;IACJC,OADI;IAEJC,IAAI,GAAG,OAFH;IAGJC,WAHI;IAIJC,YAJI;IAKJC,OALI;IAMJC,MANI;IAOJC,IAPI;IAQJC,kBARI;IASJC,eATI;IAUJC,WAVI;IAWJC,WAXI;IAYJC,iBAZI;IAaJC,aAbI;IA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D,WAAW,CAAC,YAAD,CAJzB;IAKE,IAAI,EAAEA,WAAW,CAACgD,IALpB;IAME,WAAW,EAAEhD,WAAW,CAACqF;EAN3B,EADF,CADU,GAWR,IApCN,CADD,GAuCG,IAnFN,CALF,CADF;AA6FD,CAjQD;;AAmQAhG,OAAO,CAACiG,SAAR,2CAAoBA,cAApB;eAEejG,O"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["IconType","lockedContent","style","lockIcon","fileZipped","filesListIconContainer","filesListIcon","CMPopin","props","content","mode","firstButton","secondButton","onClose","header","icon","backgroundImageUrl","descriptionText","thirdButton","cookieTitle","descriptionBtnTxt","listBtnSwicth","items","logo","AlertDiamond","WindowUpload","MoonRocket","CheckCircle1","LogoComponent","backgroundImageStyle","backgroundImage","backgroundSize","handleCloseButton","useMemo","nodeRef","useRef","useEffect","closePopin","e","current","contains","target","console","log","document","addEventListener","removeEventListener","renderHeader","title","headerIcon","TopTitleIcon","headerContent","headerBackground","cookieHeader","cookieIconContainer","cookieIcon","getClassBtnSwitch","index","btnList","firstBtnSwitchContainer","length","lastBtnSwitchContainer","singleSwitchContainer","renderBtnSwitch","map","convert","cap","el","type","value","onChange","titlePosition","theme","details","requiredSelection","disabled","id","dataName","renderItems","list","isEmpty","itemsContainer","filesListContainer","wrapperPopinStyle","classNames","popinCookie","popinFilesList","popinItems","popin","background","popinHeader","cookieTitleContainer","titleContainer","contentSection","message","__html","descriptionBtn","buttonContainer","largeButton","button","label","handleOnclick","customStyle","propTypes"],"sources":["../../../src/molecule/cm-popin/index.js"],"sourcesContent":["// import React from 'react';\nimport React, {useRef, useEffect, useMemo} from 'react';\nimport {\n NovaSolidInterfaceFeedbackInterfaceAlertDiamond as AlertDiamond,\n NovaSolidApplicationsWindowUpload3 as WindowUpload,\n NovaLineSettingsCookie as Cookie,\n NovaSolidSpaceMoonRocket as MoonRocket,\n NovaCompositionCoorpacademyPadlock as LockIcon,\n NovaLineStatusCheckCircle1 as CheckCircle1,\n NovaSolidFilesBasicFileLines as FileLinesIcon\n} from '@coorpacademy/nova-icons';\nimport map from 'lodash/fp/map';\nimport isEmpty from 'lodash/fp/isEmpty';\nimport classNames from 'classnames';\nimport Cta from '../../atom/button-link';\nimport ButtonLinkIconOnly from '../../atom/button-link-icon-only';\nimport InputSwitch from '../../atom/input-switch';\nimport Title from '../../atom/title';\nimport CardsGrid from '../../organism/cards-grid';\nimport ListItems from '../../organism/list-items';\nimport style from './style.css';\nimport propTypes from './types';\n\nconst IconType = {\n lockedContent: <LockIcon className={style.lockIcon} />,\n fileZipped: (\n <div className={style.filesListIconContainer}>\n <FileLinesIcon className={style.filesListIcon} />\n </div>\n )\n};\n// const preventDefault = e => e.preventDefault();\n// const stopPropagation = e => e.stopPropagation();\n\nconst CMPopin = props => {\n const {\n content,\n mode = 'alert',\n firstButton,\n secondButton,\n onClose,\n header,\n icon,\n backgroundImageUrl,\n descriptionText,\n thirdButton,\n cookieTitle,\n descriptionBtnTxt,\n listBtnSwicth,\n items\n } = props;\n const logo = {\n AlertDiamond,\n WindowUpload,\n MoonRocket,\n CheckCircle1\n };\n const LogoComponent = logo[icon];\n\n const backgroundImageStyle = backgroundImageUrl\n ? {\n backgroundImage: `url(${backgroundImageUrl})`,\n backgroundSize: 'cover'\n }\n : null;\n const handleCloseButton = useMemo(() => () => onClose(), [onClose]);\n\n const nodeRef = useRef(null);\n useEffect(() => {\n if (mode === 'items') {\n const closePopin = e => {\n if (nodeRef && nodeRef.current && !nodeRef.current.contains(e.target)) {\n // eslint-disable-next-line no-console\n console.log('e.target');\n // eslint-disable-next-line no-console\n console.log(e.target);\n handleCloseButton();\n }\n };\n document.addEventListener('click', closePopin);\n return () => {\n document.removeEventListener('click', closePopin);\n };\n }\n }, [handleCloseButton, mode, onClose]);\n const renderHeader = () => {\n if (header) {\n const {title, headerIcon, backgroundImage} = header;\n const TopTitleIcon = IconType[headerIcon];\n\n return (\n <>\n {title ? (\n <div className={style.headerContent}>\n {TopTitleIcon}\n <Title {...title} />\n </div>\n ) : null}\n {backgroundImage ? (\n <img className={style.headerBackground} src={backgroundImage} />\n ) : null}\n </>\n );\n }\n\n if (mode === 'cookie')\n return (\n <div className={style.cookieHeader}>\n <div className={style.cookieIconContainer}>\n <Cookie className={style.cookieIcon} />\n </div>\n <div className={style.cookieTitle}>{cookieTitle}</div>\n </div>\n );\n\n return null;\n };\n\n const getClassBtnSwitch = (index, btnList) => {\n switch (index) {\n case 0:\n return style.firstBtnSwitchContainer;\n case btnList.length - 1:\n return style.lastBtnSwitchContainer;\n default:\n return style.singleSwitchContainer;\n }\n };\n\n const renderBtnSwitch = () => {\n return map.convert({cap: false})((el, index) => {\n const {\n type,\n title,\n value,\n onChange,\n titlePosition,\n theme,\n details,\n requiredSelection,\n disabled,\n id,\n 'data-name': dataName\n } = el;\n return (\n <div key={index} className={getClassBtnSwitch(index, listBtnSwicth)}>\n <InputSwitch\n {...{\n type,\n title,\n value,\n onChange,\n titlePosition,\n theme,\n details,\n requiredSelection,\n disabled,\n id,\n 'data-name': dataName\n }}\n />\n </div>\n );\n })(listBtnSwicth);\n };\n\n const renderItems = () => {\n const {type, list} = items;\n if (isEmpty(list)) return null;\n\n if (type === 'content')\n return (\n <div className={style.itemsContainer} data-name={'cm-popin-cards'}>\n <CardsGrid {...list} />\n </div>\n );\n if (type === 'list')\n return (\n <div className={style.filesListContainer}>\n <ListItems {...list} />\n </div>\n );\n\n return null;\n };\n // const handleCloseButton = useCallback(\n // e => {\n // e.preventDefault();\n // onClose();\n // },\n // [onClose]\n // );\n const wrapperPopinStyle = classNames(\n mode === 'cookie' && style.popinCookie,\n mode === 'list' && style.popinFilesList,\n mode === 'items' && style.popinItems,\n style.popin\n );\n return (\n <div\n className={mode !== 'cookie' ? style.background : null}\n style={backgroundImageStyle}\n data-name={'cm-popin-container'}\n >\n <div className={wrapperPopinStyle} ref={nodeRef}>\n <header className={style.popinHeader}>\n {renderHeader()}\n {onClose ? (\n <ButtonLinkIconOnly\n onClick={handleCloseButton}\n data-name={'close-icon'}\n aria-label={'close-icon'}\n size=\"small\"\n icon=\"close\"\n />\n ) : null}\n </header>\n {mode !== 'items' && mode !== 'list' ? (\n <div\n className={\n mode === 'cookie' || mode === 'information'\n ? style.cookieTitleContainer\n : style.titleContainer\n }\n >\n <div className={style.contentSection}>\n {LogoComponent ? <LogoComponent className={style.icon} /> : null}\n {content ? (\n <p\n className={mode === 'alert' ? style.content : style.message}\n data-name={'cm-popin-content'}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: content}}\n />\n ) : null}\n </div>\n {descriptionText ? (\n <p\n className={style.descriptionText}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: descriptionText}}\n />\n ) : null}\n </div>\n ) : null}\n {descriptionBtnTxt ? <div className={style.descriptionBtn}>{descriptionBtnTxt}</div> : null}\n {!isEmpty(items) ? renderItems() : null}\n {renderBtnSwitch()}\n {firstButton || secondButton || thirdButton ? (\n <div className={style.buttonContainer}>\n {firstButton ? (\n <div className={firstButton.largeButton ? style.largeButton : style.button}>\n <Cta\n label={firstButton.label}\n onClick={firstButton.handleOnclick}\n data-name={'cm-popin-cta'}\n aria-label={firstButton['aria-label']}\n type={firstButton.type}\n customStyle={firstButton.customStyle}\n />\n </div>\n ) : null}\n {secondButton ? (\n <div className={secondButton.largeButton ? style.largeButton : style.button}>\n <Cta\n label={secondButton.label}\n onClick={secondButton.handleOnclick}\n data-name={`cm-popin-cta-${secondButton.type}`}\n aria-label={secondButton['aria-label']}\n type={secondButton.type}\n customStyle={secondButton.customStyle}\n />\n </div>\n ) : null}\n {thirdButton ? (\n <div className={thirdButton.largeButton ? style.largeButton : style.button}>\n <Cta\n label={thirdButton.label}\n onClick={thirdButton.handleOnclick}\n data-name={`cm-popin-cta-${thirdButton.type}`}\n aria-label={thirdButton['aria-label']}\n type={thirdButton.type}\n customStyle={thirdButton.customStyle}\n />\n </div>\n ) : null}\n </div>\n ) : null}\n </div>\n </div>\n );\n};\n\nCMPopin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E,KAAK,EAAEvF,YAAY,CAACwF,KADtB;IAEE,OAAO,EAAExF,YAAY,CAACyF,aAFxB;IAGE,aAAY,gBAAezF,YAAY,CAACwD,IAAK,EAH/C;IAIE,cAAYxD,YAAY,CAAC,YAAD,CAJ1B;IAKE,IAAI,EAAEA,YAAY,CAACwD,IALrB;IAME,WAAW,EAAExD,YAAY,CAAC0F;EAN5B,EADF,CADW,GAWT,IAxBN,EAyBGpF,WAAW,gBACV;IAAK,SAAS,EAAEA,WAAW,CAACgF,WAAZ,GAA0BhG,cAAA,CAAMgG,WAAhC,GAA8ChG,cAAA,CAAMiG;EAApE,gBACE,6BAAC,mBAAD;IACE,KAAK,EAAEjF,WAAW,CAACkF,KADrB;IAEE,OAAO,EAAElF,WAAW,CAACmF,aAFvB;IAGE,aAAY,gBAAenF,WAAW,CAACkD,IAAK,EAH9C;IAIE,cAAYlD,WAAW,CAAC,YAAD,CAJzB;IAKE,IAAI,EAAEA,WAAW,CAACkD,IALpB;IAME,WAAW,EAAElD,WAAW,CAACoF;EAN3B,EADF,CADU,GAWR,IApCN,CADD,GAuCG,IAnFN,CALF,CADF;AA6FD,CAjQD;;AAmQA/F,OAAO,CAACgG,SAAR,2CAAoBA,cAApB;eAEehG,O"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coorpacademy/components",
|
|
3
|
-
"version": "11.19.2-alpha.
|
|
3
|
+
"version": "11.19.2-alpha.22+901bee6b1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -168,5 +168,5 @@
|
|
|
168
168
|
"last 2 versions",
|
|
169
169
|
"IE 11"
|
|
170
170
|
],
|
|
171
|
-
"gitHead": "
|
|
171
|
+
"gitHead": "901bee6b1c492f5322b293ce9fcd352302dcf558"
|
|
172
172
|
}
|