@coorpacademy/components 11.13.6 → 11.13.7-alpha.12
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 +3 -2
- package/es/molecule/cm-popin/index.js.map +1 -1
- package/es/molecule/cm-popin/style.css +50 -38
- package/es/template/external-course/index.d.ts +52 -0
- package/es/template/external-course/index.d.ts.map +1 -1
- package/es/template/external-course/index.js +10 -3
- package/es/template/external-course/index.js.map +1 -1
- package/es/template/external-course/style.css +1 -1
- package/lib/molecule/cm-popin/index.d.ts.map +1 -1
- package/lib/molecule/cm-popin/index.js +2 -1
- package/lib/molecule/cm-popin/index.js.map +1 -1
- package/lib/molecule/cm-popin/style.css +50 -38
- package/lib/template/external-course/index.d.ts +52 -0
- package/lib/template/external-course/index.d.ts.map +1 -1
- package/lib/template/external-course/index.js +10 -3
- package/lib/template/external-course/index.js.map +1 -1
- package/lib/template/external-course/style.css +1 -1
- package/package.json +2 -2
- package/locales/.mtslconfig.json +0 -1
|
@@ -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":";AAeA,kDAkLC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { NovaSolidInterfaceFeedbackInterfaceAlertDiamond as AlertDiamond, NovaSolidApplicationsWindowUpload3 as WindowUpload, NovaLineSettingsCookie as Cookie, NovaSolidSpaceMoonRocket as MoonRocket } from '@coorpacademy/nova-icons';
|
|
2
|
+
import { NovaSolidInterfaceFeedbackInterfaceAlertDiamond as AlertDiamond, NovaSolidApplicationsWindowUpload3 as WindowUpload, NovaLineSettingsCookie as Cookie, NovaSolidSpaceMoonRocket as MoonRocket, NovaLineStatusCheckCircle1 as CheckCircle1 } from '@coorpacademy/nova-icons';
|
|
3
3
|
import map from 'lodash/fp/map';
|
|
4
4
|
import Cta from '../../atom/button-link';
|
|
5
5
|
import ButtonLinkIconOnly from '../../atom/button-link-icon-only';
|
|
@@ -26,7 +26,8 @@ const CMPopin = props => {
|
|
|
26
26
|
const logo = {
|
|
27
27
|
AlertDiamond,
|
|
28
28
|
WindowUpload,
|
|
29
|
-
MoonRocket
|
|
29
|
+
MoonRocket,
|
|
30
|
+
CheckCircle1
|
|
30
31
|
};
|
|
31
32
|
const LogoComponent = logo[icon];
|
|
32
33
|
const backgroundImageStyle = backgroundImageUrl ? {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","NovaSolidInterfaceFeedbackInterfaceAlertDiamond","AlertDiamond","NovaSolidApplicationsWindowUpload3","WindowUpload","NovaLineSettingsCookie","Cookie","NovaSolidSpaceMoonRocket","MoonRocket","map","Cta","ButtonLinkIconOnly","InputSwitch","style","propTypes","CMPopin","props","content","mode","firstButton","secondButton","onClose","header","icon","backgroundImageUrl","descriptionText","thirdButton","cookieTitle","descriptionBtnTxt","listBtnSwicth","logo","LogoComponent","backgroundImageStyle","backgroundImage","backgroundSize","renderHeader","headerBackground","cookieHeader","cookieIconContainer","cookieIcon","getClassBtnSwitch","index","btnList","firstBtnSwitchContainer","length","lastBtnSwitchContainer","singleSwitchContainer","renderBtnSwitch","convert","cap","el","type","title","value","onChange","titlePosition","theme","details","requiredSelection","disabled","id","dataName","background","popinCookie","popin","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 {\n NovaSolidInterfaceFeedbackInterfaceAlertDiamond as AlertDiamond,\n NovaSolidApplicationsWindowUpload3 as WindowUpload,\n NovaLineSettingsCookie as Cookie,\n NovaSolidSpaceMoonRocket as MoonRocket\n} from '@coorpacademy/nova-icons';\nimport map from 'lodash/fp/map';\nimport Cta from '../../atom/button-link';\nimport ButtonLinkIconOnly from '../../atom/button-link-icon-only';\nimport InputSwitch from '../../atom/input-switch';\nimport style from './style.css';\nimport propTypes from './types';\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 } = props;\n\n const logo = {\n AlertDiamond,\n WindowUpload,\n MoonRocket\n };\n const LogoComponent = logo[icon];\n\n const backgroundImageStyle = backgroundImageUrl\n ? {\n backgroundImage: `url(${backgroundImageUrl})`,\n backgroundSize: 'cover'\n }\n : null;\n const renderHeader = () => {\n if (header) return <img className={style.headerBackground} src={header} />;\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 return null;\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 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 return (\n <div\n className={mode !== 'cookie' ? style.background : null}\n style={backgroundImageStyle}\n data-name={'cm-popin-container'}\n >\n <div className={mode === 'cookie' ? style.popinCookie : style.popin}>\n <header className={style.popinHeader}>\n {renderHeader()}\n {onClose ? (\n <ButtonLinkIconOnly\n onClick={onClose}\n data-name={'close-icon'}\n aria-label={'close-icon'}\n size=\"small\"\n icon=\"close\"\n />\n ) : null}\n </header>\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 {descriptionBtnTxt ? <div className={style.descriptionBtn}>{descriptionBtnTxt}</div> : null}\n {renderBtnSwitch()}\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 </div>\n </div>\n );\n};\n\nCMPopin.propTypes = propTypes;\n\nexport default CM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W,CAACwD,KADrB;IAEE,OAAO,EAAExD,WAAW,CAACyD,aAFvB;IAGE,aAAW,cAHb;IAIE,cAAYzD,WAAW,CAAC,YAAD,CAJzB;IAKE,IAAI,EAAEA,WAAW,CAACgC,IALpB;IAME,WAAW,EAAEhC,WAAW,CAAC0D;EAN3B,EADF,CADU,GAWR,IAZN,EAaGzD,YAAY,gBACX;IAAK,SAAS,EAAEA,YAAY,CAACqD,WAAb,GAA2B5D,KAAK,CAAC4D,WAAjC,GAA+C5D,KAAK,CAAC6D;EAArE,gBACE,oBAAC,GAAD;IACE,KAAK,EAAEtD,YAAY,CAACuD,KADtB;IAEE,OAAO,EAAEvD,YAAY,CAACwD,aAFxB;IAGE,aAAY,gBAAexD,YAAY,CAAC+B,IAAK,EAH/C;IAIE,cAAY/B,YAAY,CAAC,YAAD,CAJ1B;IAKE,IAAI,EAAEA,YAAY,CAAC+B,IALrB;IAME,WAAW,EAAE/B,YAAY,CAACyD;EAN5B,EADF,CADW,GAWT,IAxBN,EAyBGnD,WAAW,gBACV;IAAK,SAAS,EAAEA,WAAW,CAAC+C,WAAZ,GAA0B5D,KAAK,CAAC4D,WAAhC,GAA8C5D,KAAK,CAAC6D;EAApE,gBACE,oBAAC,GAAD;IACE,KAAK,EAAEhD,WAAW,CAACiD,KADrB;IAEE,OAAO,EAAEjD,WAAW,CAACkD,aAFvB;IAGE,aAAY,gBAAelD,WAAW,CAACyB,IAAK,EAH9C;IAIE,cAAYzB,WAAW,CAAC,YAAD,CAJzB;IAKE,IAAI,EAAEA,WAAW,CAACyB,IALpB;IAME,WAAW,EAAEzB,WAAW,CAACmD;EAN3B,EADF,CADU,GAWR,IApCN,CAzCF,CALF,CADF;AAwFD,CAjLD;;AAmLA9D,OAAO,CAACD,SAAR,2CAAoBA,SAApB;AAEA,eAAeC,OAAf"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","NovaSolidInterfaceFeedbackInterfaceAlertDiamond","AlertDiamond","NovaSolidApplicationsWindowUpload3","WindowUpload","NovaLineSettingsCookie","Cookie","NovaSolidSpaceMoonRocket","MoonRocket","NovaLineStatusCheckCircle1","CheckCircle1","map","Cta","ButtonLinkIconOnly","InputSwitch","style","propTypes","CMPopin","props","content","mode","firstButton","secondButton","onClose","header","icon","backgroundImageUrl","descriptionText","thirdButton","cookieTitle","descriptionBtnTxt","listBtnSwicth","logo","LogoComponent","backgroundImageStyle","backgroundImage","backgroundSize","renderHeader","headerBackground","cookieHeader","cookieIconContainer","cookieIcon","getClassBtnSwitch","index","btnList","firstBtnSwitchContainer","length","lastBtnSwitchContainer","singleSwitchContainer","renderBtnSwitch","convert","cap","el","type","title","value","onChange","titlePosition","theme","details","requiredSelection","disabled","id","dataName","background","popinCookie","popin","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 {\n NovaSolidInterfaceFeedbackInterfaceAlertDiamond as AlertDiamond,\n NovaSolidApplicationsWindowUpload3 as WindowUpload,\n NovaLineSettingsCookie as Cookie,\n NovaSolidSpaceMoonRocket as MoonRocket,\n NovaLineStatusCheckCircle1 as CheckCircle1\n} from '@coorpacademy/nova-icons';\nimport map from 'lodash/fp/map';\nimport Cta from '../../atom/button-link';\nimport ButtonLinkIconOnly from '../../atom/button-link-icon-only';\nimport InputSwitch from '../../atom/input-switch';\nimport style from './style.css';\nimport propTypes from './types';\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 } = props;\n\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 renderHeader = () => {\n if (header) return <img className={style.headerBackground} src={header} />;\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 return null;\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 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 return (\n <div\n className={mode !== 'cookie' ? style.background : null}\n style={backgroundImageStyle}\n data-name={'cm-popin-container'}\n >\n <div className={mode === 'cookie' ? style.popinCookie : style.popin}>\n <header className={style.popinHeader}>\n {renderHeader()}\n {onClose ? (\n <ButtonLinkIconOnly\n onClick={onClose}\n data-name={'close-icon'}\n aria-label={'close-icon'}\n size=\"small\"\n icon=\"close\"\n />\n ) : null}\n </header>\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 {descriptionBtnTxt ? <div className={style.descriptionBtn}>{descriptionBtnTxt}</div> : null}\n {renderBtnSwitch()}\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 </div>\n </div>\n );\n};\n\nCMPopin.propTypes = propTypes;\n\nexport default CMPopin;\n"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SACEC,+CAA+C,IAAIC,YADrD,EAEEC,kCAAkC,IAAIC,YAFxC,EAGEC,sBAAsB,IAAIC,MAH5B,EAIEC,wBAAwB,IAAIC,UAJ9B,EAKEC,0BAA0B,IAAIC,YALhC,QAMO,0BANP;AAOA,OAAOC,GAAP,MAAgB,eAAhB;AACA,OAAOC,GAAP,MAAgB,wBAAhB;AACA,OAAOC,kBAAP,MAA+B,kCAA/B;AACA,OAAOC,WAAP,MAAwB,yBAAxB;AACA,OAAOC,KAAP,MAAkB,aAAlB;AACA,OAAOC,SAAP,MAAsB,SAAtB;;AAEA,MAAMC,OAAO,GAAGC,KAAK,IAAI;EACvB,MAAM;IACJC,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;IAGE,aAAY,gBAAexD,YAAY,CAAC+B,IAAK,EAH/C;IAIE,cAAY/B,YAAY,CAAC,YAAD,CAJ1B;IAKE,IAAI,EAAEA,YAAY,CAAC+B,IALrB;IAME,WAAW,EAAE/B,YAAY,CAACyD;EAN5B,EADF,CADW,GAWT,IAxBN,EAyBGnD,WAAW,gBACV;IAAK,SAAS,EAAEA,WAAW,CAAC+C,WAAZ,GAA0B5D,KAAK,CAAC4D,WAAhC,GAA8C5D,KAAK,CAAC6D;EAApE,gBACE,oBAAC,GAAD;IACE,KAAK,EAAEhD,WAAW,CAACiD,KADrB;IAEE,OAAO,EAAEjD,WAAW,CAACkD,aAFvB;IAGE,aAAY,gBAAelD,WAAW,CAACyB,IAAK,EAH9C;IAIE,cAAYzB,WAAW,CAAC,YAAD,CAJzB;IAKE,IAAI,EAAEA,WAAW,CAACyB,IALpB;IAME,WAAW,EAAEzB,WAAW,CAACmD;EAN3B,EADF,CADU,GAWR,IApCN,CAzCF,CALF,CADF;AAwFD,CAlLD;;AAoLA9D,OAAO,CAACD,SAAR,2CAAoBA,SAApB;AAEA,eAAeC,OAAf"}
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
|
|
48
48
|
.popin {
|
|
49
49
|
overflow: auto;
|
|
50
|
-
width:
|
|
50
|
+
width: 434px;
|
|
51
51
|
flex-grow: 0;
|
|
52
52
|
margin: 16px;
|
|
53
53
|
padding: 16px 16px 20px 16px;
|
|
@@ -114,12 +114,12 @@
|
|
|
114
114
|
|
|
115
115
|
.button {
|
|
116
116
|
min-width: max-content;
|
|
117
|
-
width:
|
|
117
|
+
width: 161px;
|
|
118
118
|
padding: 8px;
|
|
119
119
|
}
|
|
120
120
|
|
|
121
121
|
.largeButton {
|
|
122
|
-
width:
|
|
122
|
+
width: 75%;
|
|
123
123
|
padding: 8px;
|
|
124
124
|
}
|
|
125
125
|
|
|
@@ -150,6 +150,11 @@
|
|
|
150
150
|
margin-top: 0px;
|
|
151
151
|
}
|
|
152
152
|
|
|
153
|
+
.descriptionText, .content, .message {
|
|
154
|
+
margin-left: 32px;
|
|
155
|
+
margin-right: 32px;
|
|
156
|
+
}
|
|
157
|
+
|
|
153
158
|
.cookieTitleContainer {
|
|
154
159
|
align-items: center;
|
|
155
160
|
display: flex;
|
|
@@ -278,29 +283,21 @@ a {
|
|
|
278
283
|
}
|
|
279
284
|
|
|
280
285
|
@media tablet {
|
|
281
|
-
.popin {
|
|
282
|
-
position: fixed;
|
|
283
|
-
}
|
|
284
|
-
|
|
285
286
|
.popin {
|
|
286
287
|
width: 80%;
|
|
288
|
+
overflow: hidden;
|
|
287
289
|
}
|
|
288
290
|
|
|
289
291
|
.buttonContainer {
|
|
290
292
|
display: flex;
|
|
291
293
|
flex-wrap: wrap-reverse;
|
|
292
|
-
margin:
|
|
293
|
-
width: 85%;
|
|
294
|
+
margin: 12px 24px 32px 24px;
|
|
294
295
|
}
|
|
295
296
|
|
|
296
|
-
.button {
|
|
297
|
+
.largeButton, .button , .titleContainer {
|
|
297
298
|
width: 100%;
|
|
298
299
|
}
|
|
299
300
|
|
|
300
|
-
.titleContainer {
|
|
301
|
-
width: 85%;
|
|
302
|
-
}
|
|
303
|
-
|
|
304
301
|
.popinCookie {
|
|
305
302
|
position: fixed;
|
|
306
303
|
bottom: 10px;
|
|
@@ -316,34 +313,50 @@ a {
|
|
|
316
313
|
}
|
|
317
314
|
|
|
318
315
|
.popinCookie .largeButton {
|
|
319
|
-
padding: 8px 0px 0px 0px
|
|
316
|
+
padding: 8px 0px 0px 0px;
|
|
320
317
|
}
|
|
321
318
|
.popinCookie .message {
|
|
322
319
|
padding: 24px 24px 0px 24px
|
|
323
320
|
}
|
|
324
321
|
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
322
|
+
.descriptionText, .content, .message {
|
|
323
|
+
margin-left: 16px;
|
|
324
|
+
margin-right: 16px;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
@media mobile {
|
|
329
|
+
.background {
|
|
330
|
+
padding: 0;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
.popin {
|
|
334
|
+
width: 80%;
|
|
335
|
+
overflow: hidden;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
.buttonContainer {
|
|
339
|
+
display: flex;
|
|
340
|
+
margin: 12px 16px 32px 16px;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
.button {
|
|
344
|
+
width: 100%;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
.titleContainer {
|
|
348
|
+
width: 100%;
|
|
349
|
+
margin-left: 16px;
|
|
350
|
+
margin-right: 16px;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
.content, .message, .descriptionText {
|
|
354
|
+
margin-left: 16px;
|
|
355
|
+
margin-right: 16px;
|
|
356
|
+
}
|
|
357
|
+
.largeButton {
|
|
358
|
+
margin-left: 32px;
|
|
359
|
+
margin-right: 32px;
|
|
347
360
|
}
|
|
348
361
|
}
|
|
349
362
|
|
|
@@ -355,7 +368,6 @@ button {
|
|
|
355
368
|
}
|
|
356
369
|
|
|
357
370
|
_:-ms-fullscreen,
|
|
358
|
-
.descriptionText,
|
|
359
371
|
.buttonContainer {
|
|
360
372
|
width: 85%;
|
|
361
373
|
}
|
|
@@ -21,6 +21,58 @@ declare class ExternalCourse extends React.Component<any, any, any> {
|
|
|
21
21
|
backgroundImageUrl: PropTypes.Requireable<string>;
|
|
22
22
|
contentType: PropTypes.Requireable<string>;
|
|
23
23
|
mode: PropTypes.Requireable<string>;
|
|
24
|
+
closePopin: PropTypes.Requireable<PropTypes.InferProps<{
|
|
25
|
+
content: PropTypes.Requireable<string>;
|
|
26
|
+
mode: PropTypes.Requireable<string>;
|
|
27
|
+
header: PropTypes.Requireable<string>;
|
|
28
|
+
firstButton: PropTypes.Requireable<PropTypes.InferProps<{
|
|
29
|
+
label: PropTypes.Requireable<string>;
|
|
30
|
+
handleOnclick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
31
|
+
'aria-label': PropTypes.Requireable<string>;
|
|
32
|
+
largeButton: PropTypes.Requireable<boolean>;
|
|
33
|
+
type: PropTypes.Requireable<string>;
|
|
34
|
+
customStyle: PropTypes.Requireable<PropTypes.InferProps<{}>>;
|
|
35
|
+
}>>;
|
|
36
|
+
secondButton: PropTypes.Requireable<PropTypes.InferProps<{
|
|
37
|
+
label: PropTypes.Requireable<string>;
|
|
38
|
+
handleOnclick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
39
|
+
type: PropTypes.Requireable<string>;
|
|
40
|
+
'aria-label': PropTypes.Requireable<string>;
|
|
41
|
+
largeButton: PropTypes.Requireable<boolean>;
|
|
42
|
+
customStyle: PropTypes.Requireable<PropTypes.InferProps<{}>>;
|
|
43
|
+
}>>;
|
|
44
|
+
thirdButton: PropTypes.Requireable<PropTypes.InferProps<{
|
|
45
|
+
label: PropTypes.Requireable<string>;
|
|
46
|
+
handleOnclick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
47
|
+
type: PropTypes.Requireable<string>;
|
|
48
|
+
'aria-label': PropTypes.Requireable<string>;
|
|
49
|
+
largeButton: PropTypes.Requireable<boolean>;
|
|
50
|
+
customStyle: PropTypes.Requireable<PropTypes.InferProps<{}>>;
|
|
51
|
+
}>>;
|
|
52
|
+
onClose: PropTypes.Requireable<(...args: any[]) => any>;
|
|
53
|
+
icon: PropTypes.Requireable<string>;
|
|
54
|
+
backgroundImageUrl: PropTypes.Requireable<string>;
|
|
55
|
+
descriptionText: PropTypes.Requireable<string>;
|
|
56
|
+
cookieTitle: PropTypes.Requireable<string>;
|
|
57
|
+
descriptionBtnTxt: PropTypes.Requireable<string>;
|
|
58
|
+
listBtnSwicth: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
59
|
+
title: PropTypes.Requireable<string>;
|
|
60
|
+
name: PropTypes.Requireable<string>;
|
|
61
|
+
id: PropTypes.Requireable<string>;
|
|
62
|
+
value: PropTypes.Requireable<boolean>;
|
|
63
|
+
disabled: PropTypes.Requireable<boolean>;
|
|
64
|
+
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
65
|
+
description: PropTypes.Requireable<string>;
|
|
66
|
+
'aria-labelledby': PropTypes.Requireable<string>;
|
|
67
|
+
'aria-label': PropTypes.Requireable<string>;
|
|
68
|
+
modified: PropTypes.Requireable<boolean>;
|
|
69
|
+
titlePosition: PropTypes.Requireable<string>;
|
|
70
|
+
theme: PropTypes.Requireable<string>;
|
|
71
|
+
details: PropTypes.Requireable<string>;
|
|
72
|
+
'data-name': PropTypes.Requireable<string>;
|
|
73
|
+
requiredSelection: PropTypes.Requireable<boolean>;
|
|
74
|
+
}> | null | undefined)[]>;
|
|
75
|
+
}>>;
|
|
24
76
|
};
|
|
25
77
|
static contextTypes: {
|
|
26
78
|
skin: PropTypes.Requireable<PropTypes.InferProps<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/external-course/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/external-course/index.js"],"names":[],"mappings":";AAoBA;IACE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAsBE;IAEF;;;;;;;;;;;;;;;;;;;;;;MAEE;IAmIu8c,wBAA8C;IAAA,sCAAyJ;IAjIhpd,+CAKE;IAEF,sBAsHC;CACF"}
|
|
@@ -4,6 +4,9 @@ import _identity from "lodash/fp/identity";
|
|
|
4
4
|
import _keys from "lodash/fp/keys";
|
|
5
5
|
import _getOr from "lodash/fp/getOr";
|
|
6
6
|
import _get from "lodash/fp/get";
|
|
7
|
+
|
|
8
|
+
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); }
|
|
9
|
+
|
|
7
10
|
import React from 'react';
|
|
8
11
|
import { NovaSolidInterfaceFeedbackInterfaceQuestionMark as QuestionIcon } from '@coorpacademy/nova-icons';
|
|
9
12
|
import { convert } from 'css-color-function';
|
|
@@ -14,6 +17,7 @@ import Provider from '../../atom/provider';
|
|
|
14
17
|
import Loader from '../../atom/loader';
|
|
15
18
|
import Button from '../../atom/button';
|
|
16
19
|
import ExternalContentViewer from '../../molecule/external-content-viewer';
|
|
20
|
+
import CmPopin from '../../molecule/cm-popin';
|
|
17
21
|
import style from './style.css';
|
|
18
22
|
const defaultWrapperStyle = {
|
|
19
23
|
default: style.default,
|
|
@@ -46,7 +50,8 @@ class ExternalCourse extends React.Component {
|
|
|
46
50
|
loading,
|
|
47
51
|
backgroundImageUrl,
|
|
48
52
|
contentType,
|
|
49
|
-
mode = 'default'
|
|
53
|
+
mode = 'default',
|
|
54
|
+
closePopin
|
|
50
55
|
} = this.props;
|
|
51
56
|
const {
|
|
52
57
|
skin
|
|
@@ -117,9 +122,10 @@ class ExternalCourse extends React.Component {
|
|
|
117
122
|
}, warningButton, completeButton, _isNil(warning) ? null : /*#__PURE__*/React.createElement("div", {
|
|
118
123
|
className: style.rightSection
|
|
119
124
|
})) : null;
|
|
125
|
+
const popin = !_isNil(closePopin) ? /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CmPopin, closePopin)) : null;
|
|
120
126
|
return /*#__PURE__*/React.createElement("div", {
|
|
121
127
|
className: defaultWrapperStyle[mode]
|
|
122
|
-
}, header, mainContentSlot, footer);
|
|
128
|
+
}, header, popin, mainContentSlot, footer);
|
|
123
129
|
}
|
|
124
130
|
|
|
125
131
|
}
|
|
@@ -147,7 +153,8 @@ ExternalCourse.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
147
153
|
loading: PropTypes.bool,
|
|
148
154
|
backgroundImageUrl: PropTypes.string,
|
|
149
155
|
contentType: PropTypes.string,
|
|
150
|
-
mode: PropTypes.string
|
|
156
|
+
mode: PropTypes.string,
|
|
157
|
+
closePopin: PropTypes.shape(_extends({}, CmPopin.propTypes))
|
|
151
158
|
} : {};
|
|
152
159
|
export default ExternalCourse;
|
|
153
160
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","NovaSolidInterfaceFeedbackInterfaceQuestionMark","QuestionIcon","convert","classnames","PropTypes","EXTERNAL_CONTENT_ICONS","Provider","Loader","Button","ExternalContentViewer","style","defaultWrapperStyle","default","cockpit","defaultCockpit","mobile","ExternalCourse","Component","handleOnClick","field","e","stopPropagation","preventDefault","onClick","render","name","type","url","warning","complete","quit","loading","backgroundImageUrl","contentType","mode","props","skin","context","primary","IconType","icon","IconColor","color","mainContentSlot","loader","completeButton","disabled","label","backgroundColor","cursor","completeCta","warningButton","leftSection","iconLabel","link","iconQuestion","quitButton","quitCta","titleSection","title","oval","iconHeader","innerHTML","__html","header","rightSection","footer","contextTypes","childContextTypes","propTypes","string","oneOf","isRequired","shape","func","bool"],"sources":["../../../src/template/external-course/index.js"],"sourcesContent":["import React from 'react';\nimport {NovaSolidInterfaceFeedbackInterfaceQuestionMark as QuestionIcon} from '@coorpacademy/nova-icons';\nimport {convert} from 'css-color-function';\nimport classnames from 'classnames';\nimport {get, getOr, keys, identity, isNil, isEmpty} from 'lodash/fp';\nimport PropTypes from 'prop-types';\nimport {EXTERNAL_CONTENT_ICONS} from '../../util/external-content';\nimport Provider from '../../atom/provider';\nimport Loader from '../../atom/loader';\nimport Button from '../../atom/button';\nimport ExternalContentViewer from '../../molecule/external-content-viewer';\nimport style from './style.css';\n\nconst defaultWrapperStyle = {\n default: style.default,\n cockpit: style.defaultCockpit,\n mobile: style.default\n};\n\nclass ExternalCourse extends React.Component {\n static propTypes = {\n name: PropTypes.string,\n type: PropTypes.oneOf(keys(EXTERNAL_CONTENT_ICONS)),\n url: PropTypes.string.isRequired,\n quit: PropTypes.shape({\n label: PropTypes.string.isRequired,\n onClick: PropTypes.func\n }),\n complete: PropTypes.shape({\n label: PropTypes.string.isRequired,\n disabled: PropTypes.bool,\n onClick: PropTypes.func\n }),\n warning: PropTypes.shape({\n label: PropTypes.string.isRequired,\n onClick: PropTypes.func\n }),\n loading: PropTypes.bool,\n backgroundImageUrl: PropTypes.string,\n contentType: PropTypes.string,\n mode: PropTypes.string\n };\n\n static contextTypes = {\n skin: Provider.childContextTypes.skin\n };\n\n handleOnClick = field => e => {\n e.stopPropagation();\n e.preventDefault();\n const onClick = get('onClick', field);\n return onClick && onClick(e);\n };\n\n render() {\n const {\n name,\n type,\n url,\n warning,\n complete,\n quit,\n loading,\n backgroundImageUrl,\n contentType,\n mode = 'default'\n } = this.props;\n const {skin} = this.context;\n const primary = getOr('#00B0FF', 'common.primary', skin);\n const IconType = EXTERNAL_CONTENT_ICONS[type].icon;\n const IconColor = EXTERNAL_CONTENT_ICONS[type].color;\n\n const mainContentSlot = loading ? (\n <div className={style.loader}>\n <Loader />\n </div>\n ) : (\n <ExternalContentViewer\n url={url}\n mode={mode}\n backgroundImageUrl={backgroundImageUrl}\n contentType={contentType}\n />\n );\n\n const completeButton = !isNil(complete) ? (\n <Button\n type=\"button\"\n disabled={loading ? true : complete.disabled}\n onClick={loading ? identity : this.handleOnClick(complete)}\n submitValue={complete.label}\n style={{\n backgroundColor:\n complete.disabled || loading ? convert(`color(${primary} a(-50%))`) : primary,\n cursor: loading ? 'progress' : 'pointer'\n }}\n className={classnames(\n style.completeCta,\n complete.disabled || loading ? style.disabled : null,\n loading ? style.loading : null\n )}\n />\n ) : null;\n\n const warningButton = !isNil(warning) ? (\n <div className={style.leftSection}>\n <div\n onClick={this.handleOnClick(warning)}\n className={classnames(style.iconLabel, style.link)}\n >\n <QuestionIcon className={style.iconQuestion} width={24} height={24} />\n <span>{warning.label}</span>\n </div>\n </div>\n ) : null;\n\n const quitButton = !isNil(quit) ? (\n <div className={style.leftSection}>\n <span\n className={classnames(style.quitCta, loading ? style.loading : null)}\n onClick={loading ? identity : this.handleOnClick(quit)}\n >\n {quit.label}\n </span>\n </div>\n ) : null;\n\n const titleSection = !isNil(name) ? (\n <div className={classnames(style.iconLabel, style.title)}>\n <div className={style.oval} style={{backgroundColor: IconColor}}>\n <IconType className={style.iconHeader} />\n </div>\n <span\n className={style.innerHTML}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: name}}\n />\n </div>\n ) : null;\n\n const header =\n !isNil(quit) || !isEmpty(name) ? (\n <div className={style.header}>\n {quitButton}\n {titleSection}\n {isNil(quit) ? null : <div className={style.rightSection} />}\n </div>\n ) : null;\n\n const footer =\n !isNil(warning) || !isNil(complete) ? (\n <div className={style.footer}>\n {warningButton}\n {completeButton}\n {isNil(warning) ? null : <div className={style.rightSection} />}\n </div>\n ) : null;\n\n return (\n <div className={defaultWrapperStyle[mode]}>\n {header}\n {mainContentSlot}\n {footer}\n </div>\n );\n }\n}\n\nexport default ExternalCourse;\n"],"mappings":";;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAAQC,+CAA+C,IAAIC,YAA3D,QAA8E,0BAA9E;AACA,SAAQC,OAAR,QAAsB,oBAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AAEA,OAAOC,SAAP,MAAsB,YAAtB;AACA,SAAQC,sBAAR,QAAqC,6BAArC;AACA,OAAOC,QAAP,MAAqB,qBAArB;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,OAAOC,qBAAP,MAAkC,wCAAlC;AACA,OAAOC,KAAP,MAAkB,aAAlB;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,EAGGuB,MAHH,CADF;EAOD;;AAlJ0C;;AAAvClD,c,CAwBGmD,Y,GAAe;EACpB/B,IAAI,EAAE9B,QAAQ,CAAC8D,iBAAT,CAA2BhC;AADb,C;AAxBlBpB,c,CACGqD,S,2CAAY;EACjB5C,IAAI,EAAErB,SAAS,CAACkE,MADC;EAEjB5C,IAAI,EAAEtB,SAAS,CAACmE,KAAV,CAAgB,MAAKlE,sBAAL,CAAhB,CAFW;EAGjBsB,GAAG,EAAEvB,SAAS,CAACkE,MAAV,CAAiBE,UAHL;EAIjB1C,IAAI,EAAE1B,SAAS,CAACqE,KAAV,CAAgB;IACpB1B,KAAK,EAAE3C,SAAS,CAACkE,MAAV,CAAiBE,UADJ;IAEpBjD,OAAO,EAAEnB,SAAS,CAACsE;EAFC,CAAhB,CAJW;EAQjB7C,QAAQ,EAAEzB,SAAS,CAACqE,KAAV,CAAgB;IACxB1B,KAAK,EAAE3C,SAAS,CAACkE,MAAV,CAAiBE,UADA;IAExB1B,QAAQ,EAAE1C,SAAS,CAACuE,IAFI;IAGxBpD,OAAO,EAAEnB,SAAS,CAACsE;EAHK,CAAhB,CARO;EAajB9C,OAAO,EAAExB,SAAS,CAACqE,KAAV,CAAgB;IACvB1B,KAAK,EAAE3C,SAAS,CAACkE,MAAV,CAAiBE,UADD;IAEvBjD,OAAO,EAAEnB,SAAS,CAACsE;EAFI,CAAhB,CAbQ;EAiBjB3C,OAAO,EAAE3B,SAAS,CAACuE,IAjBF;EAkBjB3C,kBAAkB,EAAE5B,SAAS,CAACkE,MAlBb;EAmBjBrC,WAAW,EAAE7B,SAAS,CAACkE,MAnBN;EAoBjBpC,IAAI,EAAE9B,SAAS,CAACkE;AApBC,C;AAoJrB,eAAetD,cAAf"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","NovaSolidInterfaceFeedbackInterfaceQuestionMark","QuestionIcon","convert","classnames","PropTypes","EXTERNAL_CONTENT_ICONS","Provider","Loader","Button","ExternalContentViewer","CmPopin","style","defaultWrapperStyle","default","cockpit","defaultCockpit","mobile","ExternalCourse","Component","handleOnClick","field","e","stopPropagation","preventDefault","onClick","render","name","type","url","warning","complete","quit","loading","backgroundImageUrl","contentType","mode","closePopin","props","skin","context","primary","IconType","icon","IconColor","color","mainContentSlot","loader","completeButton","disabled","label","backgroundColor","cursor","completeCta","warningButton","leftSection","iconLabel","link","iconQuestion","quitButton","quitCta","titleSection","title","oval","iconHeader","innerHTML","__html","header","rightSection","footer","popin","contextTypes","childContextTypes","propTypes","string","oneOf","isRequired","shape","func","bool"],"sources":["../../../src/template/external-course/index.js"],"sourcesContent":["import React from 'react';\nimport {NovaSolidInterfaceFeedbackInterfaceQuestionMark as QuestionIcon} from '@coorpacademy/nova-icons';\nimport {convert} from 'css-color-function';\nimport classnames from 'classnames';\nimport {get, getOr, keys, identity, isNil, isEmpty} from 'lodash/fp';\nimport PropTypes from 'prop-types';\nimport {EXTERNAL_CONTENT_ICONS} from '../../util/external-content';\nimport Provider from '../../atom/provider';\nimport Loader from '../../atom/loader';\nimport Button from '../../atom/button';\nimport ExternalContentViewer from '../../molecule/external-content-viewer';\nimport CmPopin from '../../molecule/cm-popin';\nimport style from './style.css';\n\nconst defaultWrapperStyle = {\n default: style.default,\n cockpit: style.defaultCockpit,\n mobile: style.default\n};\n\nclass ExternalCourse extends React.Component {\n static propTypes = {\n name: PropTypes.string,\n type: PropTypes.oneOf(keys(EXTERNAL_CONTENT_ICONS)),\n url: PropTypes.string.isRequired,\n quit: PropTypes.shape({\n label: PropTypes.string.isRequired,\n onClick: PropTypes.func\n }),\n complete: PropTypes.shape({\n label: PropTypes.string.isRequired,\n disabled: PropTypes.bool,\n onClick: PropTypes.func\n }),\n warning: PropTypes.shape({\n label: PropTypes.string.isRequired,\n onClick: PropTypes.func\n }),\n loading: PropTypes.bool,\n backgroundImageUrl: PropTypes.string,\n contentType: PropTypes.string,\n mode: PropTypes.string,\n closePopin: PropTypes.shape({...CmPopin.propTypes})\n };\n\n static contextTypes = {\n skin: Provider.childContextTypes.skin\n };\n\n handleOnClick = field => e => {\n e.stopPropagation();\n e.preventDefault();\n const onClick = get('onClick', field);\n return onClick && onClick(e);\n };\n\n render() {\n const {\n name,\n type,\n url,\n warning,\n complete,\n quit,\n loading,\n backgroundImageUrl,\n contentType,\n mode = 'default',\n closePopin\n } = this.props;\n const {skin} = this.context;\n const primary = getOr('#00B0FF', 'common.primary', skin);\n const IconType = EXTERNAL_CONTENT_ICONS[type].icon;\n const IconColor = EXTERNAL_CONTENT_ICONS[type].color;\n\n const mainContentSlot = loading ? (\n <div className={style.loader}>\n <Loader />\n </div>\n ) : (\n <ExternalContentViewer\n url={url}\n mode={mode}\n backgroundImageUrl={backgroundImageUrl}\n contentType={contentType}\n />\n );\n const completeButton = !isNil(complete) ? (\n <Button\n type=\"button\"\n disabled={loading ? true : complete.disabled}\n onClick={loading ? identity : this.handleOnClick(complete)}\n submitValue={complete.label}\n style={{\n backgroundColor:\n complete.disabled || loading ? convert(`color(${primary} a(-50%))`) : primary,\n cursor: loading ? 'progress' : 'pointer'\n }}\n className={classnames(\n style.completeCta,\n complete.disabled || loading ? style.disabled : null,\n loading ? style.loading : null\n )}\n />\n ) : null;\n\n const warningButton = !isNil(warning) ? (\n <div className={style.leftSection}>\n <div\n onClick={this.handleOnClick(warning)}\n className={classnames(style.iconLabel, style.link)}\n >\n <QuestionIcon className={style.iconQuestion} width={24} height={24} />\n <span>{warning.label}</span>\n </div>\n </div>\n ) : null;\n\n const quitButton = !isNil(quit) ? (\n <div className={style.leftSection}>\n <span\n className={classnames(style.quitCta, loading ? style.loading : null)}\n onClick={loading ? identity : this.handleOnClick(quit)}\n >\n {quit.label}\n </span>\n </div>\n ) : null;\n\n const titleSection = !isNil(name) ? (\n <div className={classnames(style.iconLabel, style.title)}>\n <div className={style.oval} style={{backgroundColor: IconColor}}>\n <IconType className={style.iconHeader} />\n </div>\n <span\n className={style.innerHTML}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: name}}\n />\n </div>\n ) : null;\n\n const header =\n !isNil(quit) || !isEmpty(name) ? (\n <div className={style.header}>\n {quitButton}\n {titleSection}\n {isNil(quit) ? null : <div className={style.rightSection} />}\n </div>\n ) : null;\n\n const footer =\n !isNil(warning) || !isNil(complete) ? (\n <div className={style.footer}>\n {warningButton}\n {completeButton}\n {isNil(warning) ? null : <div className={style.rightSection} />}\n </div>\n ) : null;\n\n const popin = !isNil(closePopin) ? (\n <div>\n <CmPopin {...closePopin} />\n </div>\n ) : null;\n\n return (\n <div className={defaultWrapperStyle[mode]}>\n {header}\n {popin}\n {mainContentSlot}\n {footer}\n </div>\n );\n }\n}\n\nexport default ExternalCourse;\n"],"mappings":";;;;;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAAQC,+CAA+C,IAAIC,YAA3D,QAA8E,0BAA9E;AACA,SAAQC,OAAR,QAAsB,oBAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AAEA,OAAOC,SAAP,MAAsB,YAAtB;AACA,SAAQC,sBAAR,QAAqC,6BAArC;AACA,OAAOC,QAAP,MAAqB,qBAArB;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,OAAOC,qBAAP,MAAkC,wCAAlC;AACA,OAAOC,OAAP,MAAoB,yBAApB;AACA,OAAOC,KAAP,MAAkB,aAAlB;AAEA,MAAMC,mBAAmB,GAAG;EAC1BC,OAAO,EAAEF,KAAK,CAACE,OADW;EAE1BC,OAAO,EAAEH,KAAK,CAACI,cAFW;EAG1BC,MAAM,EAAEL,KAAK,CAACE;AAHY,CAA5B;;AAMA,MAAMI,cAAN,SAA6BlB,KAAK,CAACmB,SAAnC,CAA6C;EAAA;IAAA;;IAAA,KA6B3CC,aA7B2C,GA6B3BC,KAAK,IAAIC,CAAC,IAAI;MAC5BA,CAAC,CAACC,eAAF;MACAD,CAAC,CAACE,cAAF;;MACA,MAAMC,OAAO,GAAG,KAAI,SAAJ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AAS,CAACsE,KAAV,CAAgB,MAAKrE,sBAAL,CAAhB,CAFW;EAGjBuB,GAAG,EAAExB,SAAS,CAACqE,MAAV,CAAiBE,UAHL;EAIjB5C,IAAI,EAAE3B,SAAS,CAACwE,KAAV,CAAgB;IACpB3B,KAAK,EAAE7C,SAAS,CAACqE,MAAV,CAAiBE,UADJ;IAEpBnD,OAAO,EAAEpB,SAAS,CAACyE;EAFC,CAAhB,CAJW;EAQjB/C,QAAQ,EAAE1B,SAAS,CAACwE,KAAV,CAAgB;IACxB3B,KAAK,EAAE7C,SAAS,CAACqE,MAAV,CAAiBE,UADA;IAExB3B,QAAQ,EAAE5C,SAAS,CAAC0E,IAFI;IAGxBtD,OAAO,EAAEpB,SAAS,CAACyE;EAHK,CAAhB,CARO;EAajBhD,OAAO,EAAEzB,SAAS,CAACwE,KAAV,CAAgB;IACvB3B,KAAK,EAAE7C,SAAS,CAACqE,MAAV,CAAiBE,UADD;IAEvBnD,OAAO,EAAEpB,SAAS,CAACyE;EAFI,CAAhB,CAbQ;EAiBjB7C,OAAO,EAAE5B,SAAS,CAAC0E,IAjBF;EAkBjB7C,kBAAkB,EAAE7B,SAAS,CAACqE,MAlBb;EAmBjBvC,WAAW,EAAE9B,SAAS,CAACqE,MAnBN;EAoBjBtC,IAAI,EAAE/B,SAAS,CAACqE,MApBC;EAqBjBrC,UAAU,EAAEhC,SAAS,CAACwE,KAAV,cAAoBlE,OAAO,CAAC8D,SAA5B;AArBK,C;AA4JrB,eAAevD,cAAf"}
|
|
@@ -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":";AAeA,kDAkLC"}
|
|
@@ -40,7 +40,8 @@ const CMPopin = props => {
|
|
|
40
40
|
const logo = {
|
|
41
41
|
AlertDiamond: _novaIcons.NovaSolidInterfaceFeedbackInterfaceAlertDiamond,
|
|
42
42
|
WindowUpload: _novaIcons.NovaSolidApplicationsWindowUpload3,
|
|
43
|
-
MoonRocket: _novaIcons.NovaSolidSpaceMoonRocket
|
|
43
|
+
MoonRocket: _novaIcons.NovaSolidSpaceMoonRocket,
|
|
44
|
+
CheckCircle1: _novaIcons.NovaLineStatusCheckCircle1
|
|
44
45
|
};
|
|
45
46
|
const LogoComponent = logo[icon];
|
|
46
47
|
const backgroundImageStyle = backgroundImageUrl ? {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["CMPopin","props","content","mode","firstButton","secondButton","onClose","header","icon","backgroundImageUrl","descriptionText","thirdButton","cookieTitle","descriptionBtnTxt","listBtnSwicth","logo","AlertDiamond","WindowUpload","MoonRocket","LogoComponent","backgroundImageStyle","backgroundImage","backgroundSize","renderHeader","style","headerBackground","cookieHeader","cookieIconContainer","cookieIcon","getClassBtnSwitch","index","btnList","firstBtnSwitchContainer","length","lastBtnSwitchContainer","singleSwitchContainer","renderBtnSwitch","map","convert","cap","el","type","title","value","onChange","titlePosition","theme","details","requiredSelection","disabled","id","dataName","background","popinCookie","popin","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 {\n NovaSolidInterfaceFeedbackInterfaceAlertDiamond as AlertDiamond,\n NovaSolidApplicationsWindowUpload3 as WindowUpload,\n NovaLineSettingsCookie as Cookie,\n NovaSolidSpaceMoonRocket as MoonRocket\n} from '@coorpacademy/nova-icons';\nimport map from 'lodash/fp/map';\nimport Cta from '../../atom/button-link';\nimport ButtonLinkIconOnly from '../../atom/button-link-icon-only';\nimport InputSwitch from '../../atom/input-switch';\nimport style from './style.css';\nimport propTypes from './types';\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 } = props;\n\n const logo = {\n AlertDiamond,\n WindowUpload,\n MoonRocket\n };\n const LogoComponent = logo[icon];\n\n const backgroundImageStyle = backgroundImageUrl\n ? {\n backgroundImage: `url(${backgroundImageUrl})`,\n backgroundSize: 'cover'\n }\n : null;\n const renderHeader = () => {\n if (header) return <img className={style.headerBackground} src={header} />;\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 return null;\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 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 return (\n <div\n className={mode !== 'cookie' ? style.background : null}\n style={backgroundImageStyle}\n data-name={'cm-popin-container'}\n >\n <div className={mode === 'cookie' ? style.popinCookie : style.popin}>\n <header className={style.popinHeader}>\n {renderHeader()}\n {onClose ? (\n <ButtonLinkIconOnly\n onClick={onClose}\n data-name={'close-icon'}\n aria-label={'close-icon'}\n size=\"small\"\n icon=\"close\"\n />\n ) : null}\n </header>\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 {descriptionBtnTxt ? <div className={style.descriptionBtn}>{descriptionBtnTxt}</div> : null}\n {renderBtnSwitch()}\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 </div>\n </div>\n );\n};\n\nCMPopin.propTypes = propTypes;\n\nexport default CMPopin;\n"],"mappings":";;;;;AAAA;;AACA;;AAMA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,MAAMA,OAAO,GAAGC,KAAK,IAAI;EACvB,MAAM;IACJC,OADI;IAEJC,IAAI,GAAG,OAFH;IAGJC,WAHI;IAIJC,YAJI;IAKJC,OALI;IAMJC,MANI;IAOJC,IAPI;IA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oC,IAAK,EAH/C;IAIE,cAAYpC,YAAY,CAAC,YAAD,CAJ1B;IAKE,IAAI,EAAEA,YAAY,CAACoC,IALrB;IAME,WAAW,EAAEpC,YAAY,CAAC8D;EAN5B,EADF,CADW,GAWT,IAxBN,EAyBGxD,WAAW,gBACV;IAAK,SAAS,EAAEA,WAAW,CAACoD,WAAZ,GAA0BvC,cAAA,CAAMuC,WAAhC,GAA8CvC,cAAA,CAAMwC;EAApE,gBACE,6BAAC,mBAAD;IACE,KAAK,EAAErD,WAAW,CAACsD,KADrB;IAEE,OAAO,EAAEtD,WAAW,CAACuD,aAFvB;IAGE,aAAY,gBAAevD,WAAW,CAAC8B,IAAK,EAH9C;IAIE,cAAY9B,WAAW,CAAC,YAAD,CAJzB;IAKE,IAAI,EAAEA,WAAW,CAAC8B,IALpB;IAME,WAAW,EAAE9B,WAAW,CAACwD;EAN3B,EADF,CADU,GAWR,IApCN,CAzCF,CALF,CADF;AAwFD,CAjLD;;AAmLAnE,OAAO,CAACoE,SAAR,2CAAoBA,cAApB;eAEepE,O"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["CMPopin","props","content","mode","firstButton","secondButton","onClose","header","icon","backgroundImageUrl","descriptionText","thirdButton","cookieTitle","descriptionBtnTxt","listBtnSwicth","logo","AlertDiamond","WindowUpload","MoonRocket","CheckCircle1","LogoComponent","backgroundImageStyle","backgroundImage","backgroundSize","renderHeader","style","headerBackground","cookieHeader","cookieIconContainer","cookieIcon","getClassBtnSwitch","index","btnList","firstBtnSwitchContainer","length","lastBtnSwitchContainer","singleSwitchContainer","renderBtnSwitch","map","convert","cap","el","type","title","value","onChange","titlePosition","theme","details","requiredSelection","disabled","id","dataName","background","popinCookie","popin","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 {\n NovaSolidInterfaceFeedbackInterfaceAlertDiamond as AlertDiamond,\n NovaSolidApplicationsWindowUpload3 as WindowUpload,\n NovaLineSettingsCookie as Cookie,\n NovaSolidSpaceMoonRocket as MoonRocket,\n NovaLineStatusCheckCircle1 as CheckCircle1\n} from '@coorpacademy/nova-icons';\nimport map from 'lodash/fp/map';\nimport Cta from '../../atom/button-link';\nimport ButtonLinkIconOnly from '../../atom/button-link-icon-only';\nimport InputSwitch from '../../atom/input-switch';\nimport style from './style.css';\nimport propTypes from './types';\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 } = props;\n\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 renderHeader = () => {\n if (header) return <img className={style.headerBackground} src={header} />;\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 return null;\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 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 return (\n <div\n className={mode !== 'cookie' ? style.background : null}\n style={backgroundImageStyle}\n data-name={'cm-popin-container'}\n >\n <div className={mode === 'cookie' ? style.popinCookie : style.popin}>\n <header className={style.popinHeader}>\n {renderHeader()}\n {onClose ? (\n <ButtonLinkIconOnly\n onClick={onClose}\n data-name={'close-icon'}\n aria-label={'close-icon'}\n size=\"small\"\n icon=\"close\"\n />\n ) : null}\n </header>\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 {descriptionBtnTxt ? <div className={style.descriptionBtn}>{descriptionBtnTxt}</div> : null}\n {renderBtnSwitch()}\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 </div>\n </div>\n );\n};\n\nCMPopin.propTypes = propTypes;\n\nexport default CMPopin;\n"],"mappings":";;;;;AAAA;;AACA;;AAOA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,MAAMA,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;EAbI,IAcFb,KAdJ;EAgBA,MAAMc,IAAI,GAAG;IACXC,YAAY,EAAZA,0DADW;IAEXC,YAAY,EAAZA,6CAFW;IAGXC,UAAU,EAAVA,mCAHW;IAIXC,YAAY,EAAZA;EAJW,CAAb;EAMA,MAAMC,aAAa,GAAGL,IAAI,CAACP,IAAD,CAA1B;EAEA,MAAMa,oBAAoB,GAAGZ,kBAAkB,GAC3C;IACEa,eAAe,EAAG,OAAMb,kBAAmB,GAD7C;IAEEc,cAAc,EAAE;EAFlB,CAD2C,GAK3C,IALJ;;EAMA,MAAMC,YAAY,GAAG,MAAM;IACzB,IAAIjB,MAAJ,EAAY,oBAAO;MAAK,SAAS,EAAEkB,cAAA,CAAMC,gBAAtB;MAAwC,GAAG,EAAEnB;IAA7C,EAAP;IACZ,IAAIJ,IAAI,KAAK,QAAb,EACE,oBACE;MAAK,SAAS,EAAEsB,cAAA,CAAME;IAAtB,gBACE;MAAK,SAAS,EAAEF,cAAA,CAAMG;IAAtB,gBACE,6BAAC,iCAAD;MAAQ,SAAS,EAAEH,cAAA,CAAMI;IAAzB,EADF,CADF,eAIE;MAAK,SAAS,EAAEJ,cAAA,CAAMb;IAAtB,GAAoCA,WAApC,CAJF,CADF;IAQF,OAAO,IAAP;EACD,CAZD;;EAaA,M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 20px 16px;
|
|
@@ -114,12 +114,12 @@
|
|
|
114
114
|
|
|
115
115
|
.button {
|
|
116
116
|
min-width: max-content;
|
|
117
|
-
width:
|
|
117
|
+
width: 161px;
|
|
118
118
|
padding: 8px;
|
|
119
119
|
}
|
|
120
120
|
|
|
121
121
|
.largeButton {
|
|
122
|
-
width:
|
|
122
|
+
width: 75%;
|
|
123
123
|
padding: 8px;
|
|
124
124
|
}
|
|
125
125
|
|
|
@@ -150,6 +150,11 @@
|
|
|
150
150
|
margin-top: 0px;
|
|
151
151
|
}
|
|
152
152
|
|
|
153
|
+
.descriptionText, .content, .message {
|
|
154
|
+
margin-left: 32px;
|
|
155
|
+
margin-right: 32px;
|
|
156
|
+
}
|
|
157
|
+
|
|
153
158
|
.cookieTitleContainer {
|
|
154
159
|
align-items: center;
|
|
155
160
|
display: flex;
|
|
@@ -278,29 +283,21 @@ a {
|
|
|
278
283
|
}
|
|
279
284
|
|
|
280
285
|
@media tablet {
|
|
281
|
-
.popin {
|
|
282
|
-
position: fixed;
|
|
283
|
-
}
|
|
284
|
-
|
|
285
286
|
.popin {
|
|
286
287
|
width: 80%;
|
|
288
|
+
overflow: hidden;
|
|
287
289
|
}
|
|
288
290
|
|
|
289
291
|
.buttonContainer {
|
|
290
292
|
display: flex;
|
|
291
293
|
flex-wrap: wrap-reverse;
|
|
292
|
-
margin:
|
|
293
|
-
width: 85%;
|
|
294
|
+
margin: 12px 24px 32px 24px;
|
|
294
295
|
}
|
|
295
296
|
|
|
296
|
-
.button {
|
|
297
|
+
.largeButton, .button , .titleContainer {
|
|
297
298
|
width: 100%;
|
|
298
299
|
}
|
|
299
300
|
|
|
300
|
-
.titleContainer {
|
|
301
|
-
width: 85%;
|
|
302
|
-
}
|
|
303
|
-
|
|
304
301
|
.popinCookie {
|
|
305
302
|
position: fixed;
|
|
306
303
|
bottom: 10px;
|
|
@@ -316,34 +313,50 @@ a {
|
|
|
316
313
|
}
|
|
317
314
|
|
|
318
315
|
.popinCookie .largeButton {
|
|
319
|
-
padding: 8px 0px 0px 0px
|
|
316
|
+
padding: 8px 0px 0px 0px;
|
|
320
317
|
}
|
|
321
318
|
.popinCookie .message {
|
|
322
319
|
padding: 24px 24px 0px 24px
|
|
323
320
|
}
|
|
324
321
|
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
322
|
+
.descriptionText, .content, .message {
|
|
323
|
+
margin-left: 16px;
|
|
324
|
+
margin-right: 16px;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
@media mobile {
|
|
329
|
+
.background {
|
|
330
|
+
padding: 0;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
.popin {
|
|
334
|
+
width: 80%;
|
|
335
|
+
overflow: hidden;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
.buttonContainer {
|
|
339
|
+
display: flex;
|
|
340
|
+
margin: 12px 16px 32px 16px;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
.button {
|
|
344
|
+
width: 100%;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
.titleContainer {
|
|
348
|
+
width: 100%;
|
|
349
|
+
margin-left: 16px;
|
|
350
|
+
margin-right: 16px;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
.content, .message, .descriptionText {
|
|
354
|
+
margin-left: 16px;
|
|
355
|
+
margin-right: 16px;
|
|
356
|
+
}
|
|
357
|
+
.largeButton {
|
|
358
|
+
margin-left: 32px;
|
|
359
|
+
margin-right: 32px;
|
|
347
360
|
}
|
|
348
361
|
}
|
|
349
362
|
|
|
@@ -355,7 +368,6 @@ button {
|
|
|
355
368
|
}
|
|
356
369
|
|
|
357
370
|
_:-ms-fullscreen,
|
|
358
|
-
.descriptionText,
|
|
359
371
|
.buttonContainer {
|
|
360
372
|
width: 85%;
|
|
361
373
|
}
|
|
@@ -21,6 +21,58 @@ declare class ExternalCourse extends React.Component<any, any, any> {
|
|
|
21
21
|
backgroundImageUrl: PropTypes.Requireable<string>;
|
|
22
22
|
contentType: PropTypes.Requireable<string>;
|
|
23
23
|
mode: PropTypes.Requireable<string>;
|
|
24
|
+
closePopin: PropTypes.Requireable<PropTypes.InferProps<{
|
|
25
|
+
content: PropTypes.Requireable<string>;
|
|
26
|
+
mode: PropTypes.Requireable<string>;
|
|
27
|
+
header: PropTypes.Requireable<string>;
|
|
28
|
+
firstButton: PropTypes.Requireable<PropTypes.InferProps<{
|
|
29
|
+
label: PropTypes.Requireable<string>;
|
|
30
|
+
handleOnclick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
31
|
+
'aria-label': PropTypes.Requireable<string>;
|
|
32
|
+
largeButton: PropTypes.Requireable<boolean>;
|
|
33
|
+
type: PropTypes.Requireable<string>;
|
|
34
|
+
customStyle: PropTypes.Requireable<PropTypes.InferProps<{}>>;
|
|
35
|
+
}>>;
|
|
36
|
+
secondButton: PropTypes.Requireable<PropTypes.InferProps<{
|
|
37
|
+
label: PropTypes.Requireable<string>;
|
|
38
|
+
handleOnclick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
39
|
+
type: PropTypes.Requireable<string>;
|
|
40
|
+
'aria-label': PropTypes.Requireable<string>;
|
|
41
|
+
largeButton: PropTypes.Requireable<boolean>;
|
|
42
|
+
customStyle: PropTypes.Requireable<PropTypes.InferProps<{}>>;
|
|
43
|
+
}>>;
|
|
44
|
+
thirdButton: PropTypes.Requireable<PropTypes.InferProps<{
|
|
45
|
+
label: PropTypes.Requireable<string>;
|
|
46
|
+
handleOnclick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
47
|
+
type: PropTypes.Requireable<string>;
|
|
48
|
+
'aria-label': PropTypes.Requireable<string>;
|
|
49
|
+
largeButton: PropTypes.Requireable<boolean>;
|
|
50
|
+
customStyle: PropTypes.Requireable<PropTypes.InferProps<{}>>;
|
|
51
|
+
}>>;
|
|
52
|
+
onClose: PropTypes.Requireable<(...args: any[]) => any>;
|
|
53
|
+
icon: PropTypes.Requireable<string>;
|
|
54
|
+
backgroundImageUrl: PropTypes.Requireable<string>;
|
|
55
|
+
descriptionText: PropTypes.Requireable<string>;
|
|
56
|
+
cookieTitle: PropTypes.Requireable<string>;
|
|
57
|
+
descriptionBtnTxt: PropTypes.Requireable<string>;
|
|
58
|
+
listBtnSwicth: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
59
|
+
title: PropTypes.Requireable<string>;
|
|
60
|
+
name: PropTypes.Requireable<string>;
|
|
61
|
+
id: PropTypes.Requireable<string>;
|
|
62
|
+
value: PropTypes.Requireable<boolean>;
|
|
63
|
+
disabled: PropTypes.Requireable<boolean>;
|
|
64
|
+
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
65
|
+
description: PropTypes.Requireable<string>;
|
|
66
|
+
'aria-labelledby': PropTypes.Requireable<string>;
|
|
67
|
+
'aria-label': PropTypes.Requireable<string>;
|
|
68
|
+
modified: PropTypes.Requireable<boolean>;
|
|
69
|
+
titlePosition: PropTypes.Requireable<string>;
|
|
70
|
+
theme: PropTypes.Requireable<string>;
|
|
71
|
+
details: PropTypes.Requireable<string>;
|
|
72
|
+
'data-name': PropTypes.Requireable<string>;
|
|
73
|
+
requiredSelection: PropTypes.Requireable<boolean>;
|
|
74
|
+
}> | null | undefined)[]>;
|
|
75
|
+
}>>;
|
|
24
76
|
};
|
|
25
77
|
static contextTypes: {
|
|
26
78
|
skin: PropTypes.Requireable<PropTypes.InferProps<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/external-course/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/external-course/index.js"],"names":[],"mappings":";AAoBA;IACE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAsBE;IAEF;;;;;;;;;;;;;;;;;;;;;;MAEE;IAmIu8c,wBAA8C;IAAA,sCAAyJ;IAjIhpd,+CAKE;IAEF,sBAsHC;CACF"}
|
|
@@ -35,10 +35,14 @@ var _button = _interopRequireDefault(require("../../atom/button"));
|
|
|
35
35
|
|
|
36
36
|
var _externalContentViewer = _interopRequireDefault(require("../../molecule/external-content-viewer"));
|
|
37
37
|
|
|
38
|
+
var _cmPopin = _interopRequireDefault(require("../../molecule/cm-popin"));
|
|
39
|
+
|
|
38
40
|
var _style = _interopRequireDefault(require("./style.css"));
|
|
39
41
|
|
|
40
42
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
41
43
|
|
|
44
|
+
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); }
|
|
45
|
+
|
|
42
46
|
const defaultWrapperStyle = {
|
|
43
47
|
default: _style.default.default,
|
|
44
48
|
cockpit: _style.default.defaultCockpit,
|
|
@@ -68,7 +72,8 @@ class ExternalCourse extends _react.default.Component {
|
|
|
68
72
|
loading,
|
|
69
73
|
backgroundImageUrl,
|
|
70
74
|
contentType,
|
|
71
|
-
mode = 'default'
|
|
75
|
+
mode = 'default',
|
|
76
|
+
closePopin
|
|
72
77
|
} = this.props;
|
|
73
78
|
const {
|
|
74
79
|
skin
|
|
@@ -137,9 +142,10 @@ class ExternalCourse extends _react.default.Component {
|
|
|
137
142
|
}, warningButton, completeButton, (0, _isNil2.default)(warning) ? null : /*#__PURE__*/_react.default.createElement("div", {
|
|
138
143
|
className: _style.default.rightSection
|
|
139
144
|
})) : null;
|
|
145
|
+
const popin = !(0, _isNil2.default)(closePopin) ? /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_cmPopin.default, closePopin)) : null;
|
|
140
146
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
141
147
|
className: defaultWrapperStyle[mode]
|
|
142
|
-
}, header, mainContentSlot, footer);
|
|
148
|
+
}, header, popin, mainContentSlot, footer);
|
|
143
149
|
}
|
|
144
150
|
|
|
145
151
|
}
|
|
@@ -167,7 +173,8 @@ ExternalCourse.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
167
173
|
loading: _propTypes.default.bool,
|
|
168
174
|
backgroundImageUrl: _propTypes.default.string,
|
|
169
175
|
contentType: _propTypes.default.string,
|
|
170
|
-
mode: _propTypes.default.string
|
|
176
|
+
mode: _propTypes.default.string,
|
|
177
|
+
closePopin: _propTypes.default.shape(_extends({}, _cmPopin.default.propTypes))
|
|
171
178
|
} : {};
|
|
172
179
|
var _default = ExternalCourse;
|
|
173
180
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["defaultWrapperStyle","default","style","cockpit","defaultCockpit","mobile","ExternalCourse","React","Component","handleOnClick","field","e","stopPropagation","preventDefault","onClick","render","name","type","url","warning","complete","quit","loading","backgroundImageUrl","contentType","mode","props","skin","context","primary","IconType","EXTERNAL_CONTENT_ICONS","icon","IconColor","color","mainContentSlot","loader","completeButton","disabled","label","backgroundColor","convert","cursor","classnames","completeCta","warningButton","leftSection","iconLabel","link","iconQuestion","quitButton","quitCta","titleSection","title","oval","iconHeader","innerHTML","__html","header","rightSection","footer","contextTypes","Provider","childContextTypes","propTypes","PropTypes","string","oneOf","isRequired","shape","func","bool"],"sources":["../../../src/template/external-course/index.js"],"sourcesContent":["import React from 'react';\nimport {NovaSolidInterfaceFeedbackInterfaceQuestionMark as QuestionIcon} from '@coorpacademy/nova-icons';\nimport {convert} from 'css-color-function';\nimport classnames from 'classnames';\nimport {get, getOr, keys, identity, isNil, isEmpty} from 'lodash/fp';\nimport PropTypes from 'prop-types';\nimport {EXTERNAL_CONTENT_ICONS} from '../../util/external-content';\nimport Provider from '../../atom/provider';\nimport Loader from '../../atom/loader';\nimport Button from '../../atom/button';\nimport ExternalContentViewer from '../../molecule/external-content-viewer';\nimport style from './style.css';\n\nconst defaultWrapperStyle = {\n default: style.default,\n cockpit: style.defaultCockpit,\n mobile: style.default\n};\n\nclass ExternalCourse extends React.Component {\n static propTypes = {\n name: PropTypes.string,\n type: PropTypes.oneOf(keys(EXTERNAL_CONTENT_ICONS)),\n url: PropTypes.string.isRequired,\n quit: PropTypes.shape({\n label: PropTypes.string.isRequired,\n onClick: PropTypes.func\n }),\n complete: PropTypes.shape({\n label: PropTypes.string.isRequired,\n disabled: PropTypes.bool,\n onClick: PropTypes.func\n }),\n warning: PropTypes.shape({\n label: PropTypes.string.isRequired,\n onClick: PropTypes.func\n }),\n loading: PropTypes.bool,\n backgroundImageUrl: PropTypes.string,\n contentType: PropTypes.string,\n mode: PropTypes.string\n };\n\n static contextTypes = {\n skin: Provider.childContextTypes.skin\n };\n\n handleOnClick = field => e => {\n e.stopPropagation();\n e.preventDefault();\n const onClick = get('onClick', field);\n return onClick && onClick(e);\n };\n\n render() {\n const {\n name,\n type,\n url,\n warning,\n complete,\n quit,\n loading,\n backgroundImageUrl,\n contentType,\n mode = 'default'\n } = this.props;\n const {skin} = this.context;\n const primary = getOr('#00B0FF', 'common.primary', skin);\n const IconType = EXTERNAL_CONTENT_ICONS[type].icon;\n const IconColor = EXTERNAL_CONTENT_ICONS[type].color;\n\n const mainContentSlot = loading ? (\n <div className={style.loader}>\n <Loader />\n </div>\n ) : (\n <ExternalContentViewer\n url={url}\n mode={mode}\n backgroundImageUrl={backgroundImageUrl}\n contentType={contentType}\n />\n );\n\n const completeButton = !isNil(complete) ? (\n <Button\n type=\"button\"\n disabled={loading ? true : complete.disabled}\n onClick={loading ? identity : this.handleOnClick(complete)}\n submitValue={complete.label}\n style={{\n backgroundColor:\n complete.disabled || loading ? convert(`color(${primary} a(-50%))`) : primary,\n cursor: loading ? 'progress' : 'pointer'\n }}\n className={classnames(\n style.completeCta,\n complete.disabled || loading ? style.disabled : null,\n loading ? style.loading : null\n )}\n />\n ) : null;\n\n const warningButton = !isNil(warning) ? (\n <div className={style.leftSection}>\n <div\n onClick={this.handleOnClick(warning)}\n className={classnames(style.iconLabel, style.link)}\n >\n <QuestionIcon className={style.iconQuestion} width={24} height={24} />\n <span>{warning.label}</span>\n </div>\n </div>\n ) : null;\n\n const quitButton = !isNil(quit) ? (\n <div className={style.leftSection}>\n <span\n className={classnames(style.quitCta, loading ? style.loading : null)}\n onClick={loading ? identity : this.handleOnClick(quit)}\n >\n {quit.label}\n </span>\n </div>\n ) : null;\n\n const titleSection = !isNil(name) ? (\n <div className={classnames(style.iconLabel, style.title)}>\n <div className={style.oval} style={{backgroundColor: IconColor}}>\n <IconType className={style.iconHeader} />\n </div>\n <span\n className={style.innerHTML}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: name}}\n />\n </div>\n ) : null;\n\n const header =\n !isNil(quit) || !isEmpty(name) ? (\n <div className={style.header}>\n {quitButton}\n {titleSection}\n {isNil(quit) ? null : <div className={style.rightSection} />}\n </div>\n ) : null;\n\n const footer =\n !isNil(warning) || !isNil(complete) ? (\n <div className={style.footer}>\n {warningButton}\n {completeButton}\n {isNil(warning) ? null : <div className={style.rightSection} />}\n </div>\n ) : null;\n\n return (\n <div className={defaultWrapperStyle[mode]}>\n {header}\n {mainContentSlot}\n {footer}\n </div>\n );\n }\n}\n\nexport default ExternalCourse;\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,MAAMA,mBAAmB,GAAG;EAC1BC,OAAO,EAAEC,cAAA,CAAMD,OADW;EAE1BE,OAAO,EAA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J0C;;AAAvCtD,c,CAwBGuD,Y,GAAe;EACpBlC,IAAI,EAAEmC,iBAAA,CAASC,iBAAT,CAA2BpC;AADb,C;AAxBlBrB,c,CACG0D,S,2CAAY;EACjBhD,IAAI,EAAEiD,kBAAA,CAAUC,MADC;EAEjBjD,IAAI,EAAEgD,kBAAA,CAAUE,KAAV,CAAgB,oBAAKpC,uCAAL,CAAhB,CAFW;EAGjBb,GAAG,EAAE+C,kBAAA,CAAUC,MAAV,CAAiBE,UAHL;EAIjB/C,IAAI,EAAE4C,kBAAA,CAAUI,KAAV,CAAgB;IACpB9B,KAAK,EAAE0B,kBAAA,CAAUC,MAAV,CAAiBE,UADJ;IAEpBtD,OAAO,EAAEmD,kBAAA,CAAUK;EAFC,CAAhB,CAJW;EAQjBlD,QAAQ,EAAE6C,kBAAA,CAAUI,KAAV,CAAgB;IACxB9B,KAAK,EAAE0B,kBAAA,CAAUC,MAAV,CAAiBE,UADA;IAExB9B,QAAQ,EAAE2B,kBAAA,CAAUM,IAFI;IAGxBzD,OAAO,EAAEmD,kBAAA,CAAUK;EAHK,CAAhB,CARO;EAajBnD,OAAO,EAAE8C,kBAAA,CAAUI,KAAV,CAAgB;IACvB9B,KAAK,EAAE0B,kBAAA,CAAUC,MAAV,CAAiBE,UADD;IAEvBtD,OAAO,EAAEmD,kBAAA,CAAUK;EAFI,CAAhB,CAbQ;EAiBjBhD,OAAO,EAAE2C,kBAAA,CAAUM,IAjBF;EAkBjBhD,kBAAkB,EAAE0C,kBAAA,CAAUC,MAlBb;EAmBjB1C,WAAW,EAAEyC,kBAAA,CAAUC,MAnBN;EAoBjBzC,IAAI,EAAEwC,kBAAA,CAAUC;AApBC,C;eAoJN5D,c"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["defaultWrapperStyle","default","style","cockpit","defaultCockpit","mobile","ExternalCourse","React","Component","handleOnClick","field","e","stopPropagation","preventDefault","onClick","render","name","type","url","warning","complete","quit","loading","backgroundImageUrl","contentType","mode","closePopin","props","skin","context","primary","IconType","EXTERNAL_CONTENT_ICONS","icon","IconColor","color","mainContentSlot","loader","completeButton","disabled","label","backgroundColor","convert","cursor","classnames","completeCta","warningButton","leftSection","iconLabel","link","iconQuestion","quitButton","quitCta","titleSection","title","oval","iconHeader","innerHTML","__html","header","rightSection","footer","popin","contextTypes","Provider","childContextTypes","propTypes","PropTypes","string","oneOf","isRequired","shape","func","bool","CmPopin"],"sources":["../../../src/template/external-course/index.js"],"sourcesContent":["import React from 'react';\nimport {NovaSolidInterfaceFeedbackInterfaceQuestionMark as QuestionIcon} from '@coorpacademy/nova-icons';\nimport {convert} from 'css-color-function';\nimport classnames from 'classnames';\nimport {get, getOr, keys, identity, isNil, isEmpty} from 'lodash/fp';\nimport PropTypes from 'prop-types';\nimport {EXTERNAL_CONTENT_ICONS} from '../../util/external-content';\nimport Provider from '../../atom/provider';\nimport Loader from '../../atom/loader';\nimport Button from '../../atom/button';\nimport ExternalContentViewer from '../../molecule/external-content-viewer';\nimport CmPopin from '../../molecule/cm-popin';\nimport style from './style.css';\n\nconst defaultWrapperStyle = {\n default: style.default,\n cockpit: style.defaultCockpit,\n mobile: style.default\n};\n\nclass ExternalCourse extends React.Component {\n static propTypes = {\n name: PropTypes.string,\n type: PropTypes.oneOf(keys(EXTERNAL_CONTENT_ICONS)),\n url: PropTypes.string.isRequired,\n quit: PropTypes.shape({\n label: PropTypes.string.isRequired,\n onClick: PropTypes.func\n }),\n complete: PropTypes.shape({\n label: PropTypes.string.isRequired,\n disabled: PropTypes.bool,\n onClick: PropTypes.func\n }),\n warning: PropTypes.shape({\n label: PropTypes.string.isRequired,\n onClick: PropTypes.func\n }),\n loading: PropTypes.bool,\n backgroundImageUrl: PropTypes.string,\n contentType: PropTypes.string,\n mode: PropTypes.string,\n closePopin: PropTypes.shape({...CmPopin.propTypes})\n };\n\n static contextTypes = {\n skin: Provider.childContextTypes.skin\n };\n\n handleOnClick = field => e => {\n e.stopPropagation();\n e.preventDefault();\n const onClick = get('onClick', field);\n return onClick && onClick(e);\n };\n\n render() {\n const {\n name,\n type,\n url,\n warning,\n complete,\n quit,\n loading,\n backgroundImageUrl,\n contentType,\n mode = 'default',\n closePopin\n } = this.props;\n const {skin} = this.context;\n const primary = getOr('#00B0FF', 'common.primary', skin);\n const IconType = EXTERNAL_CONTENT_ICONS[type].icon;\n const IconColor = EXTERNAL_CONTENT_ICONS[type].color;\n\n const mainContentSlot = loading ? (\n <div className={style.loader}>\n <Loader />\n </div>\n ) : (\n <ExternalContentViewer\n url={url}\n mode={mode}\n backgroundImageUrl={backgroundImageUrl}\n contentType={contentType}\n />\n );\n const completeButton = !isNil(complete) ? (\n <Button\n type=\"button\"\n disabled={loading ? true : complete.disabled}\n onClick={loading ? identity : this.handleOnClick(complete)}\n submitValue={complete.label}\n style={{\n backgroundColor:\n complete.disabled || loading ? convert(`color(${primary} a(-50%))`) : primary,\n cursor: loading ? 'progress' : 'pointer'\n }}\n className={classnames(\n style.completeCta,\n complete.disabled || loading ? style.disabled : null,\n loading ? style.loading : null\n )}\n />\n ) : null;\n\n const warningButton = !isNil(warning) ? (\n <div className={style.leftSection}>\n <div\n onClick={this.handleOnClick(warning)}\n className={classnames(style.iconLabel, style.link)}\n >\n <QuestionIcon className={style.iconQuestion} width={24} height={24} />\n <span>{warning.label}</span>\n </div>\n </div>\n ) : null;\n\n const quitButton = !isNil(quit) ? (\n <div className={style.leftSection}>\n <span\n className={classnames(style.quitCta, loading ? style.loading : null)}\n onClick={loading ? identity : this.handleOnClick(quit)}\n >\n {quit.label}\n </span>\n </div>\n ) : null;\n\n const titleSection = !isNil(name) ? (\n <div className={classnames(style.iconLabel, style.title)}>\n <div className={style.oval} style={{backgroundColor: IconColor}}>\n <IconType className={style.iconHeader} />\n </div>\n <span\n className={style.innerHTML}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: name}}\n />\n </div>\n ) : null;\n\n const header =\n !isNil(quit) || !isEmpty(name) ? (\n <div className={style.header}>\n {quitButton}\n {titleSection}\n {isNil(quit) ? null : <div className={style.rightSection} />}\n </div>\n ) : null;\n\n const footer =\n !isNil(warning) || !isNil(complete) ? (\n <div className={style.footer}>\n {warningButton}\n {completeButton}\n {isNil(warning) ? null : <div className={style.rightSection} />}\n </div>\n ) : null;\n\n const popin = !isNil(closePopin) ? (\n <div>\n <CmPopin {...closePopin} />\n </div>\n ) : null;\n\n return (\n <div className={defaultWrapperStyle[mode]}>\n {header}\n {popin}\n {mainContentSlot}\n {footer}\n </div>\n );\n }\n}\n\nexport default ExternalCourse;\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEA,MAAMA,mBAAmB,GAAG;EAC1BC,OAAO,EAAEC,cAAA,CAAMD,OADW;EAE1BE,OAAO,EAAED,cAAA,CAAME,cAFW;EAG1BC,MAAM,EAAEH,cAAA,CAAMD;AAHY,CAA5B;;AAMA,MAAMK,cAAN,SAA6BC,cAAA,CAAMC,SAAnC,CAA6C;EAAA;IAAA;;IAAA,KA6B3CC,aA7B2C,GA6B3BC,KAAK,IAAIC,CAAC,IAAI;MAC5BA,CAAC,CAACC,eAAF;MACAD,CAAC,CAACE,cAAF;MACA,MAAMC,OAAO,GAAG,mBAAI,SAAJ,EAAeJ,KAAf,CAAhB;MACA,OAAOI,OAAO,IAAIA,OAAO,CAACH,CAAD,CAAzB;IACD,CAlC0C;EAAA;;EAoC3CI,MAAM,GAAG;IACP,MAAM;MACJC,IADI;MAEJC,IAFI;MAGJC,GAHI;MAIJC,OAJI;MAKJC,QALI;MAMJC,IANI;MAOJC,OAPI;MAQJC,kBARI;MASJC,WATI;MAUJC,IAAI,GAAG,SAVH;MAWJC;IAXI,IAYF,KAAKC,KAZT;IAaA,MAAM;MAACC;IAAD,IAAS,KAAKC,OAApB;IACA,MAAMC,OAAO,GAAG,qBAAM,SAAN,EAAiB,gBAAjB,EAAmCF,IAAnC,CA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B,kBAAA,CAAUC,MAAV,CAAiBE,UADA;IAExB/B,QAAQ,EAAE4B,kBAAA,CAAUM,IAFI;IAGxB3D,OAAO,EAAEqD,kBAAA,CAAUK;EAHK,CAAhB,CARO;EAajBrD,OAAO,EAAEgD,kBAAA,CAAUI,KAAV,CAAgB;IACvB/B,KAAK,EAAE2B,kBAAA,CAAUC,MAAV,CAAiBE,UADD;IAEvBxD,OAAO,EAAEqD,kBAAA,CAAUK;EAFI,CAAhB,CAbQ;EAiBjBlD,OAAO,EAAE6C,kBAAA,CAAUM,IAjBF;EAkBjBlD,kBAAkB,EAAE4C,kBAAA,CAAUC,MAlBb;EAmBjB5C,WAAW,EAAE2C,kBAAA,CAAUC,MAnBN;EAoBjB3C,IAAI,EAAE0C,kBAAA,CAAUC,MApBC;EAqBjB1C,UAAU,EAAEyC,kBAAA,CAAUI,KAAV,cAAoBG,gBAAA,CAAQR,SAA5B;AArBK,C;eA4JN5D,c"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coorpacademy/components",
|
|
3
|
-
"version": "11.13.
|
|
3
|
+
"version": "11.13.7-alpha.12+dd46267726",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -166,5 +166,5 @@
|
|
|
166
166
|
"last 2 versions",
|
|
167
167
|
"IE 11"
|
|
168
168
|
],
|
|
169
|
-
"gitHead": "
|
|
169
|
+
"gitHead": "dd462677263ba790a64ba39b1b3507c5c4fb3bfa"
|
|
170
170
|
}
|
package/locales/.mtslconfig.json
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"ignore_dirs":[]}
|