@coorpacademy/components 11.20.0 → 11.20.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/atom/title/style.css +1 -1
- package/es/molecule/card/index.d.ts.map +1 -1
- package/es/molecule/card/index.js +6 -2
- package/es/molecule/card/index.js.map +1 -1
- package/es/molecule/card/style.css +2 -2
- package/es/molecule/cm-popin/index.d.ts +3 -0
- package/es/molecule/cm-popin/index.d.ts.map +1 -1
- package/es/molecule/cm-popin/index.js +39 -6
- package/es/molecule/cm-popin/index.js.map +1 -1
- package/es/molecule/cm-popin/style.css +29 -4
- package/es/molecule/cm-popin/types.d.ts +1 -0
- package/es/molecule/cm-popin/types.d.ts.map +1 -1
- package/es/molecule/cm-popin/types.js.map +1 -1
- package/es/template/back-office/brand-create/index.d.ts +24 -0
- package/es/template/back-office/brand-create/index.d.ts.map +1 -1
- package/es/template/back-office/brand-list/index.d.ts +24 -0
- package/es/template/back-office/brand-list/index.d.ts.map +1 -1
- package/es/template/back-office/dashboard-preview/index.d.ts +24 -0
- package/es/template/back-office/layout/index.d.ts +24 -0
- package/es/template/back-office/layout/index.d.ts.map +1 -1
- package/es/template/back-office/layout/index.js +5 -0
- package/es/template/back-office/layout/index.js.map +1 -1
- package/es/template/common/dashboard/index.d.ts.map +1 -1
- package/es/template/common/dashboard/index.js.map +1 -1
- package/es/template/common/search-page/index.d.ts.map +1 -1
- package/es/template/common/search-page/index.js +4 -2
- package/es/template/common/search-page/index.js.map +1 -1
- package/es/template/teams-dashboard/index.d.ts +24 -0
- package/es/template/teams-dashboard/index.d.ts.map +1 -1
- package/es/template/teams-dashboard/index.js +7 -3
- package/es/template/teams-dashboard/index.js.map +1 -1
- package/es/util/render-with-context.d.ts.map +1 -1
- package/es/util/render-with-context.js +3 -1
- package/es/util/render-with-context.js.map +1 -1
- package/lib/atom/title/style.css +1 -1
- package/lib/molecule/card/index.d.ts.map +1 -1
- package/lib/molecule/card/index.js +6 -2
- package/lib/molecule/card/index.js.map +1 -1
- package/lib/molecule/card/style.css +2 -2
- package/lib/molecule/cm-popin/index.d.ts +3 -0
- package/lib/molecule/cm-popin/index.d.ts.map +1 -1
- package/lib/molecule/cm-popin/index.js +44 -6
- package/lib/molecule/cm-popin/index.js.map +1 -1
- package/lib/molecule/cm-popin/style.css +29 -4
- package/lib/molecule/cm-popin/types.d.ts +1 -0
- package/lib/molecule/cm-popin/types.d.ts.map +1 -1
- package/lib/molecule/cm-popin/types.js.map +1 -1
- package/lib/template/back-office/brand-create/index.d.ts +24 -0
- package/lib/template/back-office/brand-create/index.d.ts.map +1 -1
- package/lib/template/back-office/brand-list/index.d.ts +24 -0
- package/lib/template/back-office/brand-list/index.d.ts.map +1 -1
- package/lib/template/back-office/dashboard-preview/index.d.ts +24 -0
- package/lib/template/back-office/layout/index.d.ts +24 -0
- package/lib/template/back-office/layout/index.d.ts.map +1 -1
- package/lib/template/back-office/layout/index.js +6 -0
- package/lib/template/back-office/layout/index.js.map +1 -1
- package/lib/template/common/dashboard/index.d.ts.map +1 -1
- package/lib/template/common/dashboard/index.js.map +1 -1
- package/lib/template/common/search-page/index.d.ts.map +1 -1
- package/lib/template/common/search-page/index.js +8 -2
- package/lib/template/common/search-page/index.js.map +1 -1
- package/lib/template/teams-dashboard/index.d.ts +24 -0
- package/lib/template/teams-dashboard/index.d.ts.map +1 -1
- package/lib/template/teams-dashboard/index.js +8 -3
- package/lib/template/teams-dashboard/index.js.map +1 -1
- package/lib/util/render-with-context.d.ts.map +1 -1
- package/lib/util/render-with-context.js +3 -1
- package/lib/util/render-with-context.js.map +1 -1
- package/locales/bs/global.json +3 -3
- package/locales/cs/global.json +3 -3
- package/locales/de/global.json +3 -3
- package/locales/es/global.json +2 -2
- package/locales/hr/global.json +3 -3
- package/locales/hu/global.json +3 -3
- package/locales/hy/global.json +3 -3
- package/locales/it/global.json +3 -3
- package/locales/ja/global.json +3 -3
- package/locales/ko/global.json +3 -3
- package/locales/nl/global.json +3 -3
- package/locales/pl/global.json +3 -3
- package/locales/pt/global.json +3 -3
- package/locales/ro/global.json +3 -3
- package/locales/ru/global.json +3 -3
- package/locales/sk/global.json +3 -3
- package/locales/th/global.json +3 -3
- package/locales/tl/global.json +3 -3
- package/locales/tr/global.json +3 -3
- package/locales/uk/global.json +4 -4
- package/locales/vi/global.json +3 -3
- package/locales/zh/global.json +3 -3
- package/locales/zh_TW/global.json +3 -3
- package/package.json +2 -2
- package/locales/.mtslconfig.json +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","PropTypes","Header","style","createLayout","Template","Layout","props","header","contentWrapper","propTypes","shape"],"sources":["../../../../src/template/back-office/layout/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport Header from '../../../organism/setup-header';\nimport style from './style.css';\n\nconst createLayout = Template => {\n const Layout = props => {\n const {header} = props;\n return (\n <div>\n <div className={style.header}>\n <Header {...header} />\n </div>\n <div className={style.contentWrapper}>\n <Template {...props} />\n </div>\n </div>\n );\n };\n\n Layout.propTypes = {\n header: PropTypes.shape(Header.propTypes)\n };\n\n return Layout;\n};\n\nexport default createLayout;\n"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,MAAP,MAAmB,gCAAnB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,YAAY,GAAGC,QAAQ,IAAI;EAC/B,MAAMC,MAAM,GAAGC,KAAK,IAAI;IACtB,MAAM;MAACC;IAAD,IAAWD,KAAjB;IACA,oBACE,8CACE;MAAK,SAAS,EAAEJ,KAAK,CAACK;IAAtB,gBACE,oBAAC,MAAD,EAAYA,MAAZ,CADF,CADF,eAIE;MAAK,SAAS,EAAEL,KAAK,CAACM;IAAtB,gBACE,oBAAC,QAAD,EAAcF,KAAd,CADF,CAJF,CADF;EAUD,CAZD;;EAcAD,MAAM,CAACI,SAAP,2CAAmB;IACjBF,MAAM,
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PropTypes","Header","Provider","style","createLayout","Template","Layout","props","header","contentWrapper","propTypes","shape","contextTypes","skin","childContextTypes","translate"],"sources":["../../../../src/template/back-office/layout/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport Header from '../../../organism/setup-header';\nimport Provider from '../../../atom/provider';\nimport style from './style.css';\n\nconst createLayout = Template => {\n const Layout = props => {\n const {header} = props;\n return (\n <div>\n <div className={style.header}>\n <Header {...header} />\n </div>\n <div className={style.contentWrapper}>\n <Template {...props} />\n </div>\n </div>\n );\n };\n\n Layout.propTypes = {\n header: PropTypes.shape(Header.propTypes)\n };\n\n Layout.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n };\n\n return Layout;\n};\n\nexport default createLayout;\n"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,MAAP,MAAmB,gCAAnB;AACA,OAAOC,QAAP,MAAqB,wBAArB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,YAAY,GAAGC,QAAQ,IAAI;EAC/B,MAAMC,MAAM,GAAGC,KAAK,IAAI;IACtB,MAAM;MAACC;IAAD,IAAWD,KAAjB;IACA,oBACE,8CACE;MAAK,SAAS,EAAEJ,KAAK,CAACK;IAAtB,gBACE,oBAAC,MAAD,EAAYA,MAAZ,CADF,CADF,eAIE;MAAK,SAAS,EAAEL,KAAK,CAACM;IAAtB,gBACE,oBAAC,QAAD,EAAcF,KAAd,CADF,CAJF,CADF;EAUD,CAZD;;EAcAD,MAAM,CAACI,SAAP,2CAAmB;IACjBF,MAAM,EAAER,SAAS,CAACW,KAAV,CAAgBV,MAAM,CAACS,SAAvB;EADS,CAAnB;EAIAJ,MAAM,CAACM,YAAP,GAAsB;IACpBC,IAAI,EAAEX,QAAQ,CAACY,iBAAT,CAA2BD,IADb;IAEpBE,SAAS,EAAEb,QAAQ,CAACY,iBAAT,CAA2BC;EAFlB,CAAtB;EAKA,OAAOT,MAAP;AACD,CAzBD;;AA2BA,eAAeF,YAAf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/template/common/dashboard/index.js"],"names":[],"mappings":";AAqBA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/template/common/dashboard/index.js"],"names":[],"mappings":";AAqBA,oDAiDC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","PropTypes","Slide","HeroCard","BattleRequestList","CardsList","NewsList","StartBattle","CMPopin","ReviewBanner","style","Hero","memo","hero","welcome","propTypes","shape","Dashboard","props","sections","cookie","popinWithCards","showMoreOnLeftOrRightAriaLabel","buildSectionComponent","section","type","buildSection","index","sectionView","sectionsList","key","map","wrapper","arrayOf","oneOfType"],"sources":["../../../../src/template/common/dashboard/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport Slide from '../../../atom/slide';\nimport HeroCard from '../../../molecule/hero';\nimport BattleRequestList from '../../../molecule/dashboard/battle-request-list';\nimport CardsList from '../../../molecule/dashboard/cards-list';\nimport NewsList from '../../../molecule/dashboard/news-list';\nimport StartBattle from '../../../molecule/dashboard/start-battle';\nimport CMPopin from '../../../molecule/cm-popin';\nimport ReviewBanner from '../../../molecule/dashboard/review-banner';\nimport style from './style.css';\n\nconst Hero = React.memo(function Hero({hero, welcome}) {\n return <div className={style.hero}>{hero ? <HeroCard {...hero} /> : <Slide {...welcome} />}</div>;\n});\n\nHero.propTypes = {\n hero: PropTypes.shape(HeroCard.propTypes),\n welcome: PropTypes.shape(Slide.propTypes)\n};\n\nconst Dashboard = props => {\n const {\n sections = [],\n hero,\n welcome,\n cookie,\n popinWithCards,\n 'arrows-aria-label': showMoreOnLeftOrRightAriaLabel\n } = props;\n
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PropTypes","Slide","HeroCard","BattleRequestList","CardsList","NewsList","StartBattle","CMPopin","ReviewBanner","style","Hero","memo","hero","welcome","propTypes","shape","Dashboard","props","sections","cookie","popinWithCards","showMoreOnLeftOrRightAriaLabel","buildSectionComponent","section","type","buildSection","index","sectionView","sectionsList","key","map","wrapper","arrayOf","oneOfType"],"sources":["../../../../src/template/common/dashboard/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport Slide from '../../../atom/slide';\nimport HeroCard from '../../../molecule/hero';\nimport BattleRequestList from '../../../molecule/dashboard/battle-request-list';\nimport CardsList from '../../../molecule/dashboard/cards-list';\nimport NewsList from '../../../molecule/dashboard/news-list';\nimport StartBattle from '../../../molecule/dashboard/start-battle';\nimport CMPopin from '../../../molecule/cm-popin';\nimport ReviewBanner from '../../../molecule/dashboard/review-banner';\nimport style from './style.css';\n\nconst Hero = React.memo(function Hero({hero, welcome}) {\n return <div className={style.hero}>{hero ? <HeroCard {...hero} /> : <Slide {...welcome} />}</div>;\n});\n\nHero.propTypes = {\n hero: PropTypes.shape(HeroCard.propTypes),\n welcome: PropTypes.shape(Slide.propTypes)\n};\n\nconst Dashboard = props => {\n const {\n sections = [],\n hero,\n welcome,\n cookie,\n popinWithCards,\n 'arrows-aria-label': showMoreOnLeftOrRightAriaLabel\n } = props;\n const buildSectionComponent = section => {\n const {type} = section;\n switch (type) {\n case 'hero':\n return <Hero hero={hero} welcome={welcome} />;\n case 'battleRequests':\n return <BattleRequestList {...section} />;\n case 'cards':\n return <CardsList {...section} arrows-aria-label={showMoreOnLeftOrRightAriaLabel} />;\n case 'news':\n return <NewsList {...section} />;\n case 'battle':\n return <StartBattle {...section} />;\n case 'review':\n return <ReviewBanner {...section} />;\n default:\n return null;\n }\n };\n\n const buildSection = (section, index) => {\n const sectionView = buildSectionComponent(section);\n\n return <div key={index}>{sectionView}</div>;\n };\n\n const sectionsList = [{type: 'hero', key: 'hero'}, ...sections].map(section => (\n <div key={section.key}>{buildSection(section)}</div>\n ));\n return (\n <div className={style.wrapper} data-name=\"dashboard\">\n {sectionsList}\n {cookie ? <CMPopin {...cookie} /> : null}\n {popinWithCards ? (\n <div className={style.popinWithCards}>\n <CMPopin {...popinWithCards} />\n </div>\n ) : null}\n </div>\n );\n};\n\nDashboard.propTypes = {\n hero: Hero.propTypes.hero,\n welcome: Hero.propTypes.welcome,\n sections: PropTypes.arrayOf(\n PropTypes.oneOfType([\n PropTypes.shape(BattleRequestList.propTypes),\n PropTypes.shape(CardsList.propTypes),\n PropTypes.shape(NewsList.propTypes),\n PropTypes.shape(StartBattle.propTypes),\n PropTypes.shape(ReviewBanner.propTypes)\n ])\n ),\n cookie: PropTypes.shape(CMPopin.propTypes),\n 'arrows-aria-label': CardsList.propTypes['arrows-aria-label'],\n popinWithCards: PropTypes.shape(CMPopin.propTypes)\n};\nexport default Dashboard;\n"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,KAAP,MAAkB,qBAAlB;AACA,OAAOC,QAAP,MAAqB,wBAArB;AACA,OAAOC,iBAAP,MAA8B,iDAA9B;AACA,OAAOC,SAAP,MAAsB,wCAAtB;AACA,OAAOC,QAAP,MAAqB,uCAArB;AACA,OAAOC,WAAP,MAAwB,0CAAxB;AACA,OAAOC,OAAP,MAAoB,4BAApB;AACA,OAAOC,YAAP,MAAyB,2CAAzB;AACA,OAAOC,KAAP,MAAkB,aAAlB;AAEA,MAAMC,IAAI,gBAAGX,KAAK,CAACY,IAAN,CAAW,SAASD,IAAT,CAAc;EAACE,IAAD;EAAOC;AAAP,CAAd,EAA+B;EACrD,oBAAO;IAAK,SAAS,EAAEJ,KAAK,CAACG;EAAtB,GAA6BA,IAAI,gBAAG,oBAAC,QAAD,EAAcA,IAAd,CAAH,gBAA4B,oBAAC,KAAD,EAAWC,OAAX,CAA7D,CAAP;AACD,CAFY,CAAb;AAIAH,IAAI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oot":"","sources":["../../../../src/template/common/search-page/index.js"],"names":[],"mappings":";AAWA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/template/common/search-page/index.js"],"names":[],"mappings":";AAWA,mEA2DC"}
|
|
@@ -3,7 +3,7 @@ import _getOr from "lodash/fp/getOr";
|
|
|
3
3
|
|
|
4
4
|
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); }
|
|
5
5
|
|
|
6
|
-
import React from 'react';
|
|
6
|
+
import React, { useRef } from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import Provider from '../../../atom/provider';
|
|
9
9
|
import Button from '../../../atom/button';
|
|
@@ -33,6 +33,7 @@ const SearchPage = (props, context) => {
|
|
|
33
33
|
|
|
34
34
|
const defaultColor = _getOr('#00B0FF', 'common.primary', skin);
|
|
35
35
|
|
|
36
|
+
const nodeRef = useRef(null);
|
|
36
37
|
const recommendationsView = _isEmpty(recommendations) ? null : /*#__PURE__*/React.createElement(CardsList, recommendations);
|
|
37
38
|
const cardsView = _isEmpty(cards.list) ? /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
38
39
|
className: style.noresults
|
|
@@ -58,7 +59,8 @@ const SearchPage = (props, context) => {
|
|
|
58
59
|
className: style.title,
|
|
59
60
|
role: "status"
|
|
60
61
|
}, title), cardsView), popinWithCards ? /*#__PURE__*/React.createElement("div", {
|
|
61
|
-
className: style.popinWithCards
|
|
62
|
+
className: style.popinWithCards,
|
|
63
|
+
ref: nodeRef
|
|
62
64
|
}, /*#__PURE__*/React.createElement(CMPopin, popinWithCards)) : null);
|
|
63
65
|
};
|
|
64
66
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","PropTypes","Provider","Button","Filters","CardsGrid","CardsList","CMPopin","style","SearchPage","props","context","title","searchFilters","cards","noresultsfound","clearFilters","recommendations","moreSortAriaLabel","moreFilterAriaLabel","filterGroupAriaLabel","sortAriaLabel","popinWithCards","skin","defaultColor","recommendationsView","cardsView","list","noresults","noresultstxt","clear","background","cardsWrapper","contextTypes","childContextTypes","propTypes","string","shape"],"sources":["../../../../src/template/common/search-page/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {getOr, isEmpty} from 'lodash/fp';\nimport Provider from '../../../atom/provider';\nimport Button from '../../../atom/button';\nimport Filters from '../../../molecule/filters';\nimport CardsGrid from '../../../organism/cards-grid';\nimport CardsList from '../../../molecule/dashboard/cards-list';\nimport CMPopin from '../../../molecule/cm-popin';\nimport style from './style.css';\n\nconst SearchPage = (props, context) => {\n const {\n title,\n searchFilters,\n cards,\n noresultsfound,\n clearFilters,\n recommendations,\n moreSortAriaLabel,\n moreFilterAriaLabel,\n filterGroupAriaLabel,\n sortAriaLabel,\n popinWithCards\n } = props;\n
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useRef","PropTypes","Provider","Button","Filters","CardsGrid","CardsList","CMPopin","style","SearchPage","props","context","title","searchFilters","cards","noresultsfound","clearFilters","recommendations","moreSortAriaLabel","moreFilterAriaLabel","filterGroupAriaLabel","sortAriaLabel","popinWithCards","skin","defaultColor","nodeRef","recommendationsView","cardsView","list","noresults","noresultstxt","clear","background","cardsWrapper","contextTypes","childContextTypes","propTypes","string","shape"],"sources":["../../../../src/template/common/search-page/index.js"],"sourcesContent":["import React, {useRef} from 'react';\nimport PropTypes from 'prop-types';\nimport {getOr, isEmpty} from 'lodash/fp';\nimport Provider from '../../../atom/provider';\nimport Button from '../../../atom/button';\nimport Filters from '../../../molecule/filters';\nimport CardsGrid from '../../../organism/cards-grid';\nimport CardsList from '../../../molecule/dashboard/cards-list';\nimport CMPopin from '../../../molecule/cm-popin';\nimport style from './style.css';\n\nconst SearchPage = (props, context) => {\n const {\n title,\n searchFilters,\n cards,\n noresultsfound,\n clearFilters,\n recommendations,\n moreSortAriaLabel,\n moreFilterAriaLabel,\n filterGroupAriaLabel,\n sortAriaLabel,\n popinWithCards\n } = props;\n const {skin} = context;\n const defaultColor = getOr('#00B0FF', 'common.primary', skin);\n const nodeRef = useRef(null);\n const recommendationsView = isEmpty(recommendations) ? null : <CardsList {...recommendations} />;\n\n const cardsView = isEmpty(cards.list) ? (\n <div>\n <div className={style.noresults}>\n <div className={style.noresultstxt}>{noresultsfound}</div>\n <Button\n {...clearFilters}\n data-name=\"searchPageClear\"\n className={style.clear}\n style={{background: defaultColor}}\n type=\"link\"\n />\n </div>\n {recommendationsView}\n </div>\n ) : (\n <CardsGrid {...cards} />\n );\n\n return (\n <div>\n <Filters\n {...searchFilters}\n moreSortAriaLabel={moreSortAriaLabel}\n moreFilterAriaLabel={moreFilterAriaLabel}\n filterGroupAriaLabel={filterGroupAriaLabel}\n sortAriaLabel={sortAriaLabel}\n />\n <div data-name=\"searchResult\" className={style.cardsWrapper}>\n <div className={style.title} role=\"status\">\n {title}\n </div>\n {cardsView}\n </div>\n {popinWithCards ? (\n <div className={style.popinWithCards} ref={nodeRef}>\n <CMPopin {...popinWithCards} />\n </div>\n ) : null}\n </div>\n );\n};\n\nSearchPage.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nSearchPage.propTypes = {\n noresultsfound: PropTypes.string,\n title: PropTypes.string,\n searchFilters: PropTypes.shape(Filters.propTypes),\n cards: PropTypes.shape(CardsGrid.propTypes),\n clearFilters: PropTypes.shape(Button.propTypes),\n recommendations: PropTypes.shape(CardsList.propTypes),\n moreSortAriaLabel: PropTypes.string,\n moreFilterAriaLabel: PropTypes.string,\n filterGroupAriaLabel: PropTypes.string,\n sortAriaLabel: PropTypes.string,\n popinWithCards: PropTypes.shape(CMPopin.propTypes)\n};\n\nexport default SearchPage;\n"],"mappings":";;;;;AAAA,OAAOA,KAAP,IAAeC,MAAf,QAA4B,OAA5B;A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
|
|
@@ -101,6 +101,30 @@ declare namespace TeamsDashboard {
|
|
|
101
101
|
}> | null | undefined)[]>;
|
|
102
102
|
const isLoading: PropTypes.Requireable<boolean>;
|
|
103
103
|
}
|
|
104
|
+
namespace contextTypes {
|
|
105
|
+
const translate: PropTypes.Requireable<(...args: any[]) => any>;
|
|
106
|
+
const skin: PropTypes.Requireable<PropTypes.InferProps<{
|
|
107
|
+
common: PropTypes.Requireable<{
|
|
108
|
+
[x: string]: any;
|
|
109
|
+
}>;
|
|
110
|
+
images: PropTypes.Requireable<PropTypes.InferProps<{
|
|
111
|
+
'logo-mobile': PropTypes.Requireable<any>;
|
|
112
|
+
logo: PropTypes.Requireable<any>;
|
|
113
|
+
'logo-email': PropTypes.Requireable<any>;
|
|
114
|
+
login: PropTypes.Requireable<any>;
|
|
115
|
+
}>>;
|
|
116
|
+
icons: PropTypes.Requireable<{
|
|
117
|
+
[x: string]: any;
|
|
118
|
+
}>;
|
|
119
|
+
mod: PropTypes.Requireable<{
|
|
120
|
+
[x: string]: any;
|
|
121
|
+
}>;
|
|
122
|
+
courses: PropTypes.Requireable<any[]>;
|
|
123
|
+
texts: PropTypes.Requireable<{
|
|
124
|
+
[x: string]: any;
|
|
125
|
+
}>;
|
|
126
|
+
}>>;
|
|
127
|
+
}
|
|
104
128
|
}
|
|
105
129
|
import PropTypes from "prop-types";
|
|
106
130
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/teams-dashboard/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/teams-dashboard/index.js"],"names":[],"mappings":";AAUA;;;;;gBAkCC"}
|
|
@@ -8,6 +8,7 @@ import MoocHeader from '../../organism/mooc-header';
|
|
|
8
8
|
import Cta from '../../atom/cta';
|
|
9
9
|
import Loader from '../../atom/loader';
|
|
10
10
|
import CardsList from '../../molecule/dashboard/cards-list';
|
|
11
|
+
import Provider from '../../atom/provider';
|
|
11
12
|
import style from './style.css';
|
|
12
13
|
|
|
13
14
|
const TeamsDashboard = ({
|
|
@@ -28,10 +29,9 @@ const TeamsDashboard = ({
|
|
|
28
29
|
cap: false
|
|
29
30
|
})(buildSection, sections), [buildSection, sections]);
|
|
30
31
|
return isLoading ? /*#__PURE__*/React.createElement("div", {
|
|
31
|
-
className: style.loader
|
|
32
|
-
}, /*#__PURE__*/React.createElement(Loader, {
|
|
32
|
+
className: style.loader,
|
|
33
33
|
"data-name": "teams-dashboard-loader"
|
|
34
|
-
})) : /*#__PURE__*/React.createElement("div", {
|
|
34
|
+
}, /*#__PURE__*/React.createElement(Loader, null)) : /*#__PURE__*/React.createElement("div", {
|
|
35
35
|
"data-name": "teams-dashboard",
|
|
36
36
|
className: isShadowed ? style.shadowedTeamsDashboard : style.teamsDashboard
|
|
37
37
|
}, /*#__PURE__*/React.createElement(MoocHeader, {
|
|
@@ -52,5 +52,9 @@ TeamsDashboard.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
52
52
|
sections: PropTypes.arrayOf(PropTypes.shape(CardsList.propTypes)),
|
|
53
53
|
isLoading: PropTypes.bool
|
|
54
54
|
} : {};
|
|
55
|
+
TeamsDashboard.contextTypes = {
|
|
56
|
+
translate: Provider.childContextTypes.translate,
|
|
57
|
+
skin: Provider.childContextTypes.skin
|
|
58
|
+
};
|
|
55
59
|
export default TeamsDashboard;
|
|
56
60
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useState","useCallback","useMemo","PropTypes","MoocHeader","Cta","Loader","CardsList","style","TeamsDashboard","logo","platformLinks","sections","isLoading","isShadowed","setShadowed","onMenuOpen","onMenuClose","buildSection","section","index","title","sectionsList","convert","cap","loader","shadowedTeamsDashboard","teamsDashboard","sectionsWrapper","propTypes","arrayOf","shape","bool"],"sources":["../../../src/template/teams-dashboard/index.js"],"sourcesContent":["import React, {useState, useCallback, useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport {map} from 'lodash/fp';\nimport MoocHeader from '../../organism/mooc-header';\nimport Cta from '../../atom/cta';\nimport Loader from '../../atom/loader';\nimport CardsList from '../../molecule/dashboard/cards-list';\nimport style from './style.css';\n\nconst TeamsDashboard = ({logo, platformLinks, sections, isLoading}) => {\n const [isShadowed, setShadowed] = useState(false);\n const onMenuOpen = useCallback(() => setShadowed(true), []);\n const onMenuClose = useCallback(() => setShadowed(false), []);\n\n const buildSection = useCallback((section, index) => {\n return <CardsList {...section} key={section.title + index} />;\n }, []);\n\n const sectionsList = useMemo(\n () => map.convert({cap: false})(buildSection, sections),\n [buildSection, sections]\n );\n
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useState","useCallback","useMemo","PropTypes","MoocHeader","Cta","Loader","CardsList","Provider","style","TeamsDashboard","logo","platformLinks","sections","isLoading","isShadowed","setShadowed","onMenuOpen","onMenuClose","buildSection","section","index","title","sectionsList","convert","cap","loader","shadowedTeamsDashboard","teamsDashboard","sectionsWrapper","propTypes","arrayOf","shape","bool","contextTypes","translate","childContextTypes","skin"],"sources":["../../../src/template/teams-dashboard/index.js"],"sourcesContent":["import React, {useState, useCallback, useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport {map} from 'lodash/fp';\nimport MoocHeader from '../../organism/mooc-header';\nimport Cta from '../../atom/cta';\nimport Loader from '../../atom/loader';\nimport CardsList from '../../molecule/dashboard/cards-list';\nimport Provider from '../../atom/provider';\nimport style from './style.css';\n\nconst TeamsDashboard = ({logo, platformLinks, sections, isLoading}) => {\n const [isShadowed, setShadowed] = useState(false);\n const onMenuOpen = useCallback(() => setShadowed(true), []);\n const onMenuClose = useCallback(() => setShadowed(false), []);\n\n const buildSection = useCallback((section, index) => {\n return <CardsList {...section} key={section.title + index} />;\n }, []);\n\n const sectionsList = useMemo(\n () => map.convert({cap: false})(buildSection, sections),\n [buildSection, sections]\n );\n return isLoading ? (\n <div className={style.loader} data-name=\"teams-dashboard-loader\">\n <Loader />\n </div>\n ) : (\n <div\n data-name=\"teams-dashboard\"\n className={isShadowed ? style.shadowedTeamsDashboard : style.teamsDashboard}\n >\n <MoocHeader\n data-name=\"teams-dashboard-header\"\n logo={logo}\n links={platformLinks}\n onMenuOpen={onMenuOpen}\n onMenuClose={onMenuClose}\n />\n <div data-name=\"sections-wrapper\" className={isShadowed ? style.sectionsWrapper : null}>\n {sectionsList}\n </div>\n </div>\n );\n};\n\nTeamsDashboard.propTypes = {\n logo: MoocHeader.propTypes.logo,\n platformLinks: PropTypes.arrayOf(PropTypes.shape(Cta.propTypes)),\n sections: PropTypes.arrayOf(PropTypes.shape(CardsList.propTypes)),\n isLoading: PropTypes.bool\n};\n\nTeamsDashboard.contextTypes = {\n translate: Provider.childContextTypes.translate,\n skin: Provider.childContextTypes.skin\n};\n\nexport default TeamsDashboard;\n"],"mappings":";;;;AAAA,OAAOA,KAAP,IAAeC,QAAf,EAAyBC,WAAzB,EAAsCC,OAAtC,QAAoD,OAApD;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,OAAOC,UAAP,MAAuB,4BAAvB;AACA,OAAOC,GAAP,MAAgB,gBAAhB;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,OAAOC,SAAP,MAAsB,qCAAtB;AACA,OAAOC,QAAP,MAAqB,qBAArB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,cAAc,GAAG,CAAC;EAACC,IAAD;EAAOC,aAAP;EAAsBC,QAAtB;EAAgCC;AAAhC,CAAD,KAAgD;EACrE,MAAM,CAACC,UAAD,EAAaC,WAAb,IAA4BhB,QAAQ,CAAC,KAAD,CAA1C;EACA,MAAMiB,UAAU,GAAGhB,WAAW,CAAC,MAAMe,WAAW,CAAC,IAAD,CAAlB,EAA0B,EAA1B,CAA9B;EACA,MAAME,WAAW,GAAGjB,WAAW,CAAC,MAAMe,WAAW,CAAC,KAAD,CAAlB,EAA2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BhB,SAAS,EAAEX,SAAS,CAAC8B;AAJI,CAA3B;AAOAvB,cAAc,CAACwB,YAAf,GAA8B;EAC5BC,SAAS,EAAE3B,QAAQ,CAAC4B,iBAAT,CAA2BD,SADV;EAE5BE,IAAI,EAAE7B,QAAQ,CAAC4B,iBAAT,CAA2BC;AAFL,CAA9B;AAKA,eAAe3B,cAAf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render-with-context.d.ts","sourceRoot":"","sources":["../../src/util/render-with-context.js"],"names":[],"mappings":"AAOO,
|
|
1
|
+
{"version":3,"file":"render-with-context.d.ts","sourceRoot":"","sources":["../../src/util/render-with-context.js"],"names":[],"mappings":"AAOO,8LA4BN"}
|
|
@@ -27,7 +27,9 @@ export const renderWithContext = (component, options = {}) => {
|
|
|
27
27
|
const wrapper = ({
|
|
28
28
|
children
|
|
29
29
|
}) => {
|
|
30
|
-
const hasContextTypes = useLegacyProvider || has(['type', 'contextTypes'], children);
|
|
30
|
+
const hasContextTypes = useLegacyProvider || has(['type', 'contextTypes'], children); // eslint-disable-next-line no-console
|
|
31
|
+
|
|
32
|
+
if (!hasContextTypes) console.log('ContextTypes not found, using WebContext');
|
|
31
33
|
return hasContextTypes ? /*#__PURE__*/React.createElement(Provider, _extends({}, rest, {
|
|
32
34
|
translate: translate
|
|
33
35
|
}), children) : /*#__PURE__*/React.createElement(WebContext, _extends({}, rest, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render-with-context.js","names":["React","PropTypes","render","has","mockTranslate","Provider","WebContext","renderWithContext","component","options","context","useLegacyProvider","renderOptions","translate","rest","wrapper","children","hasContextTypes","propTypes","node"],"sources":["../../src/util/render-with-context.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {render} from '@testing-library/react';\nimport has from 'lodash/fp/has';\nimport {mockTranslate} from '@coorpacademy/translate';\nimport Provider, {WebContext} from '../atom/provider';\n\nexport const renderWithContext = (component, options = {}) => {\n const {context = {}, useLegacyProvider = false, ...renderOptions} = options;\n // uses mockTranslate as a default translate function\n const {translate = mockTranslate, ...rest} = context;\n\n const wrapper = ({children}) => {\n const hasContextTypes = useLegacyProvider || has(['type', 'contextTypes'], children);\n return hasContextTypes ? (\n <Provider {...rest} translate={translate}>\n {children}\n </Provider>\n ) : (\n <WebContext {...rest} translate={translate}>\n {children}\n </WebContext>\n );\n };\n\n wrapper.propTypes = {\n children: PropTypes.node\n };\n\n return render(component, {\n ...renderOptions,\n wrapper\n });\n};\n"],"mappings":";;;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,SAAQC,MAAR,QAAqB,wBAArB;AACA,OAAOC,GAAP,MAAgB,eAAhB;AACA,SAAQC,aAAR,QAA4B,yBAA5B;AACA,OAAOC,QAAP,IAAkBC,UAAlB,QAAmC,kBAAnC;AAEA,OAAO,MAAMC,iBAAiB,GAAG,CAACC,SAAD,EAAYC,OAAO,GAAG,EAAtB,KAA6B;EAC5D,MAAM;IAACC,OAAO,GAAG,EAAX;IAAeC,iBAAiB,GAAG;EAAnC,IAA8DF,OAApE;EAAA,MAAmDG,aAAnD,iCAAoEH,OAApE,aAD4D,CAE5D;;;EACA,MAAM;IAACI,SAAS,GAAGT;EAAb,IAAuCM,OAA7C;EAAA,MAAqCI,IAArC,iCAA6CJ,OAA7C;;EAEA,MAAMK,OAAO,GAAG,CAAC;IAACC;EAAD,CAAD,KAAgB;IAC9B,MAAMC,eAAe,GAAGN,iBAAiB,IAAIR,GAAG,CAAC,CAAC,MAAD,EAAS,cAAT,CAAD,EAA2Ba,QAA3B,CAAhD
|
|
1
|
+
{"version":3,"file":"render-with-context.js","names":["React","PropTypes","render","has","mockTranslate","Provider","WebContext","renderWithContext","component","options","context","useLegacyProvider","renderOptions","translate","rest","wrapper","children","hasContextTypes","console","log","propTypes","node"],"sources":["../../src/util/render-with-context.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {render} from '@testing-library/react';\nimport has from 'lodash/fp/has';\nimport {mockTranslate} from '@coorpacademy/translate';\nimport Provider, {WebContext} from '../atom/provider';\n\nexport const renderWithContext = (component, options = {}) => {\n const {context = {}, useLegacyProvider = false, ...renderOptions} = options;\n // uses mockTranslate as a default translate function\n const {translate = mockTranslate, ...rest} = context;\n\n const wrapper = ({children}) => {\n const hasContextTypes = useLegacyProvider || has(['type', 'contextTypes'], children);\n // eslint-disable-next-line no-console\n if (!hasContextTypes) console.log('ContextTypes not found, using WebContext');\n return hasContextTypes ? (\n <Provider {...rest} translate={translate}>\n {children}\n </Provider>\n ) : (\n <WebContext {...rest} translate={translate}>\n {children}\n </WebContext>\n );\n };\n\n wrapper.propTypes = {\n children: PropTypes.node\n };\n\n return render(component, {\n ...renderOptions,\n wrapper\n });\n};\n"],"mappings":";;;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,SAAQC,MAAR,QAAqB,wBAArB;AACA,OAAOC,GAAP,MAAgB,eAAhB;AACA,SAAQC,aAAR,QAA4B,yBAA5B;AACA,OAAOC,QAAP,IAAkBC,UAAlB,QAAmC,kBAAnC;AAEA,OAAO,MAAMC,iBAAiB,GAAG,CAACC,SAAD,EAAYC,OAAO,GAAG,EAAtB,KAA6B;EAC5D,MAAM;IAACC,OAAO,GAAG,EAAX;IAAeC,iBAAiB,GAAG;EAAnC,IAA8DF,OAApE;EAAA,MAAmDG,aAAnD,iCAAoEH,OAApE,aAD4D,CAE5D;;;EACA,MAAM;IAACI,SAAS,GAAGT;EAAb,IAAuCM,OAA7C;EAAA,MAAqCI,IAArC,iCAA6CJ,OAA7C;;EAEA,MAAMK,OAAO,GAAG,CAAC;IAACC;EAAD,CAAD,KAAgB;IAC9B,MAAMC,eAAe,GAAGN,iBAAiB,IAAIR,GAAG,CAAC,CAAC,MAAD,EAAS,cAAT,CAAD,EAA2Ba,QAA3B,CAAhD,CAD8B,CAE9B;;IACA,IAAI,CAACC,eAAL,EAAsBC,OAAO,CAACC,GAAR,CAAY,0CAAZ;IACtB,OAAOF,eAAe,gBACpB,oBAAC,QAAD,eAAcH,IAAd;MAAoB,SAAS,EAAED;IAA/B,IACGG,QADH,CADoB,gBAKpB,oBAAC,UAAD,eAAgBF,IAAhB;MAAsB,SAAS,EAAED;IAAjC,IACGG,QADH,CALF;EASD,CAbD;;EAeAD,OAAO,CAACK,SAAR,2CAAoB;IAClBJ,QAAQ,EAAEf,SAAS,CAACoB;EADF,CAApB;EAIA,OAAOnB,MAAM,CAACM,SAAD,eACRI,aADQ;IAEXG;EAFW,GAAb;AAID,CA5BM"}
|
package/lib/atom/title/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/card/index.js"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/card/index.js"],"names":[],"mappings":";;;;;AA2PA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8BE;;;AAlKF,uDA8HG"}
|
|
@@ -182,8 +182,12 @@ const Card = /*#__PURE__*/(0, _react.memo)(function Card(props, context) {
|
|
|
182
182
|
className: _style.default.lockIcon,
|
|
183
183
|
height: 48
|
|
184
184
|
}), /*#__PURE__*/_react.default.createElement("span", {
|
|
185
|
-
"aria-label": disabledArialabel
|
|
186
|
-
|
|
185
|
+
"aria-label": disabledArialabel // eslint-disable-next-line react/no-danger
|
|
186
|
+
,
|
|
187
|
+
dangerouslySetInnerHTML: {
|
|
188
|
+
__html: disabledContent
|
|
189
|
+
}
|
|
190
|
+
})) : null;
|
|
187
191
|
const inlineBadgeStyle = {
|
|
188
192
|
color: primaryColor
|
|
189
193
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["THEMES","default","coorpmanager","style","CardBackground","type","image","empty","ariaLabel","skin","externalContent","isExternalContent","primaryColor","whiteColor","EXTERNAL_CONTENT_ICONS","IconType","icon","iconColor","color","backgroundIcon","externalIconCircleWrapper","externalIcon","_backgroundIcon","classnames","externalIconCircleWithImageWrapper","backgroundColor","externalIconWithImage","imageWrapper","backgroundImage","externalContentHeader","externalBackground","emptyIcon","chapterImageWrapper","contextTypes","Provider","childContextTypes","propTypes","PropTypes","string","bool","Card","memo","props","context","badge","adaptiv","disabled","hidden","title","author","customer","certifiedAuthor","progress","favorite","addFavoriteToolTip","removeFavoriteToolTip","onClick","onFavoriteClick","isSelected","notification","badgeCategory","badgeLabel","theme","disabledContent","cardArialabel","backgroundAriaLabel","favoriteAriaLabel","selectableAriaLabel","customerAriaLabel","badgeAriaLabel","disabledArialabel","cardContentLabelAriaLabel","cardStyle","chapter","course","lazy","grid","handleClick","useMemo","e","lock","lockContent","lockIcon","inlineBadgeStyle","getType","contentType","MODES","CARD","lockWrapper","cardPropTypes","shape","Customer","number","func","Notification","CardContentInfo","oneOf","Favorite","Selectable"],"sources":["../../../src/molecule/card/index.js"],"sourcesContent":["import React, {useMemo, memo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {get, isEmpty, isUndefined, pick, keys} from 'lodash/fp';\nimport {\n NovaCompositionCoorpacademyPadlock as LockIcon,\n NovaCompositionCoorpacademyPictures as PicturesIcon\n} from '@coorpacademy/nova-icons';\nimport {isExternalContent, EXTERNAL_CONTENT_ICONS} from '../../util/external-content';\nimport Provider from '../../atom/provider';\nimport CardContentInfo, {MODES} from '../card-content';\nimport Customer from './customer';\nimport Favorite from './favorite';\nimport Selectable from './selectable';\nimport Notification from './notification';\nimport style from './style.css';\n\nexport const THEMES = {\n default: null,\n coorpmanager: style.coorpmanager\n};\n\nconst CardBackground = ({type, image, empty, 'aria-label': ariaLabel}, {skin}) => {\n const externalContent = isExternalContent(type);\n const primaryColor = get('common.primary', skin);\n const whiteColor = get('common.white', skin);\n\n if (externalContent && EXTERNAL_CONTENT_ICONS[type]) {\n const IconType = EXTERNAL_CONTENT_ICONS[type].icon;\n const iconColor = EXTERNAL_CONTENT_ICONS[type].color;\n const backgroundIcon = (\n <div className={style.externalIconCircleWrapper}>\n <IconType className={style.externalIcon} />\n </div>\n );\n\n if (image) {\n const _backgroundIcon = (\n <div\n className={classnames(\n style.externalIconCircleWrapper,\n style.externalIconCircleWithImageWrapper\n )}\n style={{\n backgroundColor: iconColor\n }}\n >\n <IconType className={style.externalIconWithImage} />\n </div>\n );\n\n return (\n <div className={style.imageWrapper}>\n <div\n data-name=\"cover\"\n aria-label={ariaLabel}\n style={{\n backgroundColor: iconColor,\n backgroundImage: `url('${image}')`\n }}\n className={classnames(style.externalContentHeader, style.externalBackground)}\n >\n {_backgroundIcon}\n </div>\n </div>\n );\n }\n return (\n <div className={style.imageWrapper}>\n <div\n data-name=\"cover\"\n aria-label={ariaLabel}\n style={{\n backgroundColor: iconColor\n }}\n className={style.externalContentHeader}\n >\n {backgroundIcon}\n </div>\n </div>\n );\n }\n\n const emptyIcon = empty ? (\n <PicturesIcon className={style.emptyIcon} style={{color: whiteColor}} />\n ) : null;\n return (\n <div\n className={classnames(\n style.imageWrapper,\n type === 'chapter' ? style.chapterImageWrapper : null\n )}\n >\n <div\n data-name=\"cover\"\n aria-label={ariaLabel}\n className={style.image}\n style={{\n backgroundColor: primaryColor,\n backgroundImage: image ? `url('${image}')` : 'none'\n }}\n >\n {emptyIcon}\n </div>\n </div>\n );\n};\n\nCardBackground.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nCardBackground.propTypes = {\n type: PropTypes.string,\n image: PropTypes.string,\n empty: PropTypes.bool,\n 'aria-label': PropTypes.string\n};\n\nconst Card = memo(function Card(props, context) {\n const {skin} = context;\n const {\n image,\n badge,\n adaptiv,\n disabled: hidden = false,\n type = 'course',\n title,\n author,\n customer,\n certifiedAuthor,\n progress,\n favorite,\n addFavoriteToolTip,\n removeFavoriteToolTip,\n onClick,\n onFavoriteClick,\n isSelected,\n notification,\n badgeCategory,\n badgeLabel,\n theme = 'default',\n disabledContent,\n 'aria-label': cardArialabel,\n 'background-aria-label': backgroundAriaLabel,\n 'favorite-aria-label': favoriteAriaLabel,\n 'selectable-aria-label': selectableAriaLabel,\n 'customer-aria-label': customerAriaLabel,\n 'badge-aria-label': badgeAriaLabel,\n 'disabled-aria-label': disabledArialabel,\n 'card-content-aria-label': cardContentLabelAriaLabel\n } = props;\n const empty = isEmpty(pick(['title', 'type', 'author', 'image'], props));\n const primaryColor = get('common.primary', skin);\n const cardStyle = classnames(\n THEMES[theme],\n type === 'chapter' ? style.chapter : style.course,\n title ? null : style.lazy,\n style.grid,\n empty ? style.empty : null\n );\n const disabled = hidden && (!isSelected || isUndefined(isSelected));\n const handleClick = useMemo(() => e => onClick(e), [onClick]);\n const lock = disabled ? (\n <div className={style.lockContent}>\n <LockIcon className={style.lockIcon} height={48} />\n <span aria-label={disabledArialabel}>{disabledContent}</span>\n </div>\n ) : null;\n const inlineBadgeStyle = {color: primaryColor};\n const getType = contentType => {\n switch (contentType) {\n case 'chapter':\n return 'microlearning';\n case 'course':\n return 'learner';\n default:\n return contentType;\n }\n };\n\n return (\n <div\n className={cardStyle}\n data-name=\"card\"\n data-lock={disabled}\n data-type={getType(type)}\n disabled={disabled}\n onClick={handleClick}\n aria-label={cardArialabel}\n >\n <CardBackground type={type} image={image} empty={empty} aria-label={backgroundAriaLabel} />\n {isUndefined(isSelected) && !isUndefined(favorite) ? (\n <Favorite\n className={style.favorite}\n favorite={favorite}\n disabled={disabled}\n onFavoriteClick={onFavoriteClick}\n addFavoriteToolTip={addFavoriteToolTip}\n removeFavoriteToolTip={removeFavoriteToolTip}\n aria-label={favoriteAriaLabel}\n />\n ) : null}\n <Selectable isSelected={isSelected} hidden={hidden} aria-label={selectableAriaLabel} />\n {notification ? <Notification {...notification} /> : null}\n {customer ? (\n <Customer\n {...customer}\n theme={theme}\n type={type}\n disabled={disabled}\n aria-label={customerAriaLabel}\n />\n ) : null}\n <CardContentInfo\n mode={MODES.CARD}\n adaptiv={adaptiv}\n author={author}\n certifiedAuthor={certifiedAuthor}\n disabled={disabled}\n empty={empty}\n progress={progress}\n title={title}\n type={type}\n badgeCategory={badgeCategory}\n badgeLabel={badgeLabel}\n theme={theme}\n aria-label={cardContentLabelAriaLabel}\n />\n {badge ? (\n <div className={style.badge} style={inlineBadgeStyle} aria-label={badgeAriaLabel}>\n {badge}\n </div>\n ) : null}\n {disabled ? (\n <div className={style.lockWrapper} aria-label={disabledArialabel}>\n {lock}\n </div>\n ) : null}\n </div>\n );\n});\n\nCard.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nexport const cardPropTypes = {\n badge: PropTypes.string,\n image: PropTypes.string,\n disabled: PropTypes.bool,\n adaptiv: PropTypes.bool,\n type: PropTypes.string,\n title: PropTypes.string,\n author: PropTypes.string,\n certifiedAuthor: PropTypes.bool,\n customer: PropTypes.shape(Customer.propTypes),\n progress: PropTypes.number,\n favorite: PropTypes.bool,\n addFavoriteToolTip: PropTypes.string,\n removeFavoriteToolTip: PropTypes.string,\n onClick: PropTypes.func,\n onFavoriteClick: PropTypes.func,\n isSelected: PropTypes.bool,\n notification: PropTypes.shape(Notification.propTypes),\n badgeCategory: CardContentInfo.propTypes.badgeCategory,\n badgeLabel: CardContentInfo.propTypes.badgeLabel,\n theme: PropTypes.oneOf(keys(THEMES)),\n disabledContent: PropTypes.string,\n 'aria-label': PropTypes.string,\n 'background-aria-label': PropTypes.string,\n 'favorite-aria-label': Favorite.propTypes['aria-label'],\n 'selectable-aria-label': Selectable.propTypes['aria-label'],\n 'customer-aria-label': Customer.propTypes['aria-label'],\n 'badge-aria-label': PropTypes.string,\n 'disabled-aria-label': PropTypes.string,\n 'card-content-aria-label': CardContentInfo.propTypes['aria-label']\n};\n\nCard.propTypes = cardPropTypes;\n\nexport default Card;\n"],"mappings":";;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AAEA;;AAIA;;AACA;;AACA;;AACA;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3B,uBAAuBuD,iBAAA,CAASvD,SAAT,CAAmB,YAAnB,CA1BI;EA2B3B,oBAAoBC,kBAAA,CAAUC,MA3BH;EA4B3B,uBAAuBD,kBAAA,CAAUC,MA5BN;EA6B3B,2BAA2ByD,oBAAA,CAAgB3D,SAAhB,CAA0B,YAA1B;AA7BA,CAAtB;;AAgCPI,IAAI,CAACJ,SAAL,2CAAiBqD,aAAjB;eAEejD,I"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["THEMES","default","coorpmanager","style","CardBackground","type","image","empty","ariaLabel","skin","externalContent","isExternalContent","primaryColor","whiteColor","EXTERNAL_CONTENT_ICONS","IconType","icon","iconColor","color","backgroundIcon","externalIconCircleWrapper","externalIcon","_backgroundIcon","classnames","externalIconCircleWithImageWrapper","backgroundColor","externalIconWithImage","imageWrapper","backgroundImage","externalContentHeader","externalBackground","emptyIcon","chapterImageWrapper","contextTypes","Provider","childContextTypes","propTypes","PropTypes","string","bool","Card","memo","props","context","badge","adaptiv","disabled","hidden","title","author","customer","certifiedAuthor","progress","favorite","addFavoriteToolTip","removeFavoriteToolTip","onClick","onFavoriteClick","isSelected","notification","badgeCategory","badgeLabel","theme","disabledContent","cardArialabel","backgroundAriaLabel","favoriteAriaLabel","selectableAriaLabel","customerAriaLabel","badgeAriaLabel","disabledArialabel","cardContentLabelAriaLabel","cardStyle","chapter","course","lazy","grid","handleClick","useMemo","e","lock","lockContent","lockIcon","__html","inlineBadgeStyle","getType","contentType","MODES","CARD","lockWrapper","cardPropTypes","shape","Customer","number","func","Notification","CardContentInfo","oneOf","Favorite","Selectable"],"sources":["../../../src/molecule/card/index.js"],"sourcesContent":["import React, {useMemo, memo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {get, isEmpty, isUndefined, pick, keys} from 'lodash/fp';\nimport {\n NovaCompositionCoorpacademyPadlock as LockIcon,\n NovaCompositionCoorpacademyPictures as PicturesIcon\n} from '@coorpacademy/nova-icons';\nimport {isExternalContent, EXTERNAL_CONTENT_ICONS} from '../../util/external-content';\nimport Provider from '../../atom/provider';\nimport CardContentInfo, {MODES} from '../card-content';\nimport Customer from './customer';\nimport Favorite from './favorite';\nimport Selectable from './selectable';\nimport Notification from './notification';\nimport style from './style.css';\n\nexport const THEMES = {\n default: null,\n coorpmanager: style.coorpmanager\n};\n\nconst CardBackground = ({type, image, empty, 'aria-label': ariaLabel}, {skin}) => {\n const externalContent = isExternalContent(type);\n const primaryColor = get('common.primary', skin);\n const whiteColor = get('common.white', skin);\n\n if (externalContent && EXTERNAL_CONTENT_ICONS[type]) {\n const IconType = EXTERNAL_CONTENT_ICONS[type].icon;\n const iconColor = EXTERNAL_CONTENT_ICONS[type].color;\n const backgroundIcon = (\n <div className={style.externalIconCircleWrapper}>\n <IconType className={style.externalIcon} />\n </div>\n );\n\n if (image) {\n const _backgroundIcon = (\n <div\n className={classnames(\n style.externalIconCircleWrapper,\n style.externalIconCircleWithImageWrapper\n )}\n style={{\n backgroundColor: iconColor\n }}\n >\n <IconType className={style.externalIconWithImage} />\n </div>\n );\n\n return (\n <div className={style.imageWrapper}>\n <div\n data-name=\"cover\"\n aria-label={ariaLabel}\n style={{\n backgroundColor: iconColor,\n backgroundImage: `url('${image}')`\n }}\n className={classnames(style.externalContentHeader, style.externalBackground)}\n >\n {_backgroundIcon}\n </div>\n </div>\n );\n }\n return (\n <div className={style.imageWrapper}>\n <div\n data-name=\"cover\"\n aria-label={ariaLabel}\n style={{\n backgroundColor: iconColor\n }}\n className={style.externalContentHeader}\n >\n {backgroundIcon}\n </div>\n </div>\n );\n }\n\n const emptyIcon = empty ? (\n <PicturesIcon className={style.emptyIcon} style={{color: whiteColor}} />\n ) : null;\n return (\n <div\n className={classnames(\n style.imageWrapper,\n type === 'chapter' ? style.chapterImageWrapper : null\n )}\n >\n <div\n data-name=\"cover\"\n aria-label={ariaLabel}\n className={style.image}\n style={{\n backgroundColor: primaryColor,\n backgroundImage: image ? `url('${image}')` : 'none'\n }}\n >\n {emptyIcon}\n </div>\n </div>\n );\n};\n\nCardBackground.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nCardBackground.propTypes = {\n type: PropTypes.string,\n image: PropTypes.string,\n empty: PropTypes.bool,\n 'aria-label': PropTypes.string\n};\n\nconst Card = memo(function Card(props, context) {\n const {skin} = context;\n const {\n image,\n badge,\n adaptiv,\n disabled: hidden = false,\n type = 'course',\n title,\n author,\n customer,\n certifiedAuthor,\n progress,\n favorite,\n addFavoriteToolTip,\n removeFavoriteToolTip,\n onClick,\n onFavoriteClick,\n isSelected,\n notification,\n badgeCategory,\n badgeLabel,\n theme = 'default',\n disabledContent,\n 'aria-label': cardArialabel,\n 'background-aria-label': backgroundAriaLabel,\n 'favorite-aria-label': favoriteAriaLabel,\n 'selectable-aria-label': selectableAriaLabel,\n 'customer-aria-label': customerAriaLabel,\n 'badge-aria-label': badgeAriaLabel,\n 'disabled-aria-label': disabledArialabel,\n 'card-content-aria-label': cardContentLabelAriaLabel\n } = props;\n const empty = isEmpty(pick(['title', 'type', 'author', 'image'], props));\n const primaryColor = get('common.primary', skin);\n const cardStyle = classnames(\n THEMES[theme],\n type === 'chapter' ? style.chapter : style.course,\n title ? null : style.lazy,\n style.grid,\n empty ? style.empty : null\n );\n const disabled = hidden && (!isSelected || isUndefined(isSelected));\n const handleClick = useMemo(() => e => onClick(e), [onClick]);\n const lock = disabled ? (\n <div className={style.lockContent}>\n <LockIcon className={style.lockIcon} height={48} />\n <span\n aria-label={disabledArialabel}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: disabledContent}}\n />\n </div>\n ) : null;\n const inlineBadgeStyle = {color: primaryColor};\n const getType = contentType => {\n switch (contentType) {\n case 'chapter':\n return 'microlearning';\n case 'course':\n return 'learner';\n default:\n return contentType;\n }\n };\n\n return (\n <div\n className={cardStyle}\n data-name=\"card\"\n data-lock={disabled}\n data-type={getType(type)}\n disabled={disabled}\n onClick={handleClick}\n aria-label={cardArialabel}\n >\n <CardBackground type={type} image={image} empty={empty} aria-label={backgroundAriaLabel} />\n {isUndefined(isSelected) && !isUndefined(favorite) ? (\n <Favorite\n className={style.favorite}\n favorite={favorite}\n disabled={disabled}\n onFavoriteClick={onFavoriteClick}\n addFavoriteToolTip={addFavoriteToolTip}\n removeFavoriteToolTip={removeFavoriteToolTip}\n aria-label={favoriteAriaLabel}\n />\n ) : null}\n <Selectable isSelected={isSelected} hidden={hidden} aria-label={selectableAriaLabel} />\n {notification ? <Notification {...notification} /> : null}\n {customer ? (\n <Customer\n {...customer}\n theme={theme}\n type={type}\n disabled={disabled}\n aria-label={customerAriaLabel}\n />\n ) : null}\n <CardContentInfo\n mode={MODES.CARD}\n adaptiv={adaptiv}\n author={author}\n certifiedAuthor={certifiedAuthor}\n disabled={disabled}\n empty={empty}\n progress={progress}\n title={title}\n type={type}\n badgeCategory={badgeCategory}\n badgeLabel={badgeLabel}\n theme={theme}\n aria-label={cardContentLabelAriaLabel}\n />\n {badge ? (\n <div className={style.badge} style={inlineBadgeStyle} aria-label={badgeAriaLabel}>\n {badge}\n </div>\n ) : null}\n {disabled ? (\n <div className={style.lockWrapper} aria-label={disabledArialabel}>\n {lock}\n </div>\n ) : null}\n </div>\n );\n});\n\nCard.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nexport const cardPropTypes = {\n badge: PropTypes.string,\n image: PropTypes.string,\n disabled: PropTypes.bool,\n adaptiv: PropTypes.bool,\n type: PropTypes.string,\n title: PropTypes.string,\n author: PropTypes.string,\n certifiedAuthor: PropTypes.bool,\n customer: PropTypes.shape(Customer.propTypes),\n progress: PropTypes.number,\n favorite: PropTypes.bool,\n addFavoriteToolTip: PropTypes.string,\n removeFavoriteToolTip: PropTypes.string,\n onClick: PropTypes.func,\n onFavoriteClick: PropTypes.func,\n isSelected: PropTypes.bool,\n notification: PropTypes.shape(Notification.propTypes),\n badgeCategory: CardContentInfo.propTypes.badgeCategory,\n badgeLabel: CardContentInfo.propTypes.badgeLabel,\n theme: PropTypes.oneOf(keys(THEMES)),\n disabledContent: PropTypes.string,\n 'aria-label': PropTypes.string,\n 'background-aria-label': PropTypes.string,\n 'favorite-aria-label': Favorite.propTypes['aria-label'],\n 'selectable-aria-label': Selectable.propTypes['aria-label'],\n 'customer-aria-label': Customer.propTypes['aria-label'],\n 'badge-aria-label': PropTypes.string,\n 'disabled-aria-label': PropTypes.string,\n 'card-content-aria-label': CardContentInfo.propTypes['aria-label']\n};\n\nCard.propTypes = cardPropTypes;\n\nexport default Card;\n"],"mappings":";;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AAEA;;AAIA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEO,MAAMA,MAAM,GAAG;EACpBC,OAAO,EAAE,IADW;EAEpBC,YAAY,EAAEC,cAAA,CAAMD;AAFA,CAAf;;;AAKP,MAAME,cAAc,GAAG,CAAC;EAACC,IAAD;EAAOC,KAAP;EAAcC,KAAd;EAAqB,cAAcC;AAAnC,CAAD,EAAgD;EAACC;AAAD,CAAhD,KAA2D;EAChF,MAAMC,eAAe,GAAG,IAAAC,kCAAA,EAAkBN,IAAlB,CAAxB;EACA,MAAMO,YAAY,GAAG,mBAAI,gBAAJ,EAAsBH,IAAtB,CAArB;EACA,MAAMI,UAAU,GAAG,mBAAI,cAAJ,EAAoBJ,IAApB,CAAnB;;EAEA,IAAIC,eAAe,IAAII,uCAAA,CAAuBT,IAAvB,CAAvB,EAAqD;IACnD,MAAMU,QAAQ,GAAGD,uCAAA,CAAuBT,IAAvB,EAA6BW,IAA9C;IACA,MAAMC,SAAS,GAAGH,uCAAA,CAAuBT,IAAvB,EAA6Ba,KAA/C;;IACA,MAAMC,cAAc,gBAClB;MAAK,SAAS,EAAEhB,cAAA,CAAMiB;IAAtB,gBACE,6BAAC,QAAD;MAAU,SAAS,EAAEjB,cAAA,CAAMkB;IAA3B,EADF,CADF;;IAMA,IAAIf,KAAJ,EAAW;MACT,MAAMgB,eAAe,gBACnB;QACE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AA,CAAgB5D,SAAhB,CAA0BwB,aAlBd;EAmB3BC,UAAU,EAAEmC,oBAAA,CAAgB5D,SAAhB,CAA0ByB,UAnBX;EAoB3BC,KAAK,EAAEzB,kBAAA,CAAU4D,KAAV,CAAgB,oBAAKjG,MAAL,CAAhB,CApBoB;EAqB3B+D,eAAe,EAAE1B,kBAAA,CAAUC,MArBA;EAsB3B,cAAcD,kBAAA,CAAUC,MAtBG;EAuB3B,yBAAyBD,kBAAA,CAAUC,MAvBR;EAwB3B,uBAAuB4D,iBAAA,CAAS9D,SAAT,CAAmB,YAAnB,CAxBI;EAyB3B,yBAAyB+D,mBAAA,CAAW/D,SAAX,CAAqB,YAArB,CAzBE;EA0B3B,uBAAuBwD,iBAAA,CAASxD,SAAT,CAAmB,YAAnB,CA1BI;EA2B3B,oBAAoBC,kBAAA,CAAUC,MA3BH;EA4B3B,uBAAuBD,kBAAA,CAAUC,MA5BN;EA6B3B,2BAA2B0D,oBAAA,CAAgB5D,SAAhB,CAA0B,YAA1B;AA7BA,CAAtB;;AAgCPI,IAAI,CAACJ,SAAL,2CAAiBsD,aAAjB;eAEelD,I"}
|
|
@@ -206,7 +206,7 @@
|
|
|
206
206
|
|
|
207
207
|
.lockWrapper:hover span {
|
|
208
208
|
font-weight: 600;
|
|
209
|
-
width:
|
|
209
|
+
width: 185px;
|
|
210
210
|
}
|
|
211
211
|
|
|
212
212
|
.lockContent {
|
|
@@ -217,7 +217,7 @@
|
|
|
217
217
|
}
|
|
218
218
|
|
|
219
219
|
.lockContent span {
|
|
220
|
-
width:
|
|
220
|
+
width: 174px;
|
|
221
221
|
height: 40px;
|
|
222
222
|
color: white;
|
|
223
223
|
text-align: center;
|
|
@@ -2,6 +2,9 @@ export default CMPopin;
|
|
|
2
2
|
declare function CMPopin(props: any): JSX.Element;
|
|
3
3
|
declare namespace CMPopin {
|
|
4
4
|
export { propTypes };
|
|
5
|
+
export namespace contextTypes {
|
|
6
|
+
const translate: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
7
|
+
}
|
|
5
8
|
}
|
|
6
9
|
import propTypes from "./types";
|
|
7
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -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":";AAgCA,kDAgQC"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.default = void 0;
|
|
5
5
|
|
|
6
|
-
var _react =
|
|
6
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
7
7
|
|
|
8
8
|
var _novaIcons = require("@coorpacademy/nova-icons");
|
|
9
9
|
|
|
@@ -13,6 +13,8 @@ var _isEmpty = _interopRequireDefault(require("lodash/fp/isEmpty"));
|
|
|
13
13
|
|
|
14
14
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
15
15
|
|
|
16
|
+
var _provider = _interopRequireDefault(require("../../atom/provider"));
|
|
17
|
+
|
|
16
18
|
var _buttonLink = _interopRequireDefault(require("../../atom/button-link"));
|
|
17
19
|
|
|
18
20
|
var _buttonLinkIconOnly = _interopRequireDefault(require("../../atom/button-link-icon-only"));
|
|
@@ -31,6 +33,10 @@ var _types = _interopRequireDefault(require("./types"));
|
|
|
31
33
|
|
|
32
34
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
33
35
|
|
|
36
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
37
|
+
|
|
38
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
39
|
+
|
|
34
40
|
const IconType = {
|
|
35
41
|
lockedContent: /*#__PURE__*/_react.default.createElement(_novaIcons.NovaCompositionCoorpacademyPadlock, {
|
|
36
42
|
className: _style.default.lockIcon
|
|
@@ -70,6 +76,32 @@ const CMPopin = props => {
|
|
|
70
76
|
backgroundImage: `url(${backgroundImageUrl})`,
|
|
71
77
|
backgroundSize: 'cover'
|
|
72
78
|
} : null;
|
|
79
|
+
const handleCloseButton = (0, _react.useMemo)(() => () => onClose(), [onClose]);
|
|
80
|
+
const nodeRef = (0, _react.useRef)(null);
|
|
81
|
+
(0, _react.useEffect)(() => {
|
|
82
|
+
if (mode === 'items') {
|
|
83
|
+
const closePopin = e => {
|
|
84
|
+
if (nodeRef && nodeRef.current && !nodeRef.current.contains(e.target)) {
|
|
85
|
+
handleCloseButton();
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
const handleKeyDown = e => {
|
|
90
|
+
if (e?.key === 'Escape') {
|
|
91
|
+
handleCloseButton();
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
document.addEventListener('click', closePopin);
|
|
96
|
+
document.addEventListener('touchstart', closePopin);
|
|
97
|
+
document.addEventListener('keydown', handleKeyDown);
|
|
98
|
+
return () => {
|
|
99
|
+
document.removeEventListener('click', closePopin);
|
|
100
|
+
document.removeEventListener('touchstart', closePopin);
|
|
101
|
+
document.removeEventListener('keydown', handleKeyDown);
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
}, [handleCloseButton, mode, onClose]);
|
|
73
105
|
|
|
74
106
|
const renderHeader = () => {
|
|
75
107
|
if (header) {
|
|
@@ -164,22 +196,25 @@ const CMPopin = props => {
|
|
|
164
196
|
return null;
|
|
165
197
|
};
|
|
166
198
|
|
|
167
|
-
const wrapperPopinStyle = (0, _classnames.default)(mode === 'cookie' && _style.default.popinCookie, mode === 'list' && _style.default.popinFilesList, _style.default.popin);
|
|
199
|
+
const wrapperPopinStyle = (0, _classnames.default)(mode === 'cookie' && _style.default.popinCookie, mode === 'list' && _style.default.popinFilesList, mode === 'items' && _style.default.popinItems, _style.default.popin);
|
|
168
200
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
169
201
|
className: mode !== 'cookie' ? _style.default.background : null,
|
|
170
202
|
style: backgroundImageStyle,
|
|
171
203
|
"data-name": 'cm-popin-container'
|
|
172
204
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
173
|
-
className: wrapperPopinStyle
|
|
205
|
+
className: wrapperPopinStyle,
|
|
206
|
+
ref: nodeRef
|
|
174
207
|
}, /*#__PURE__*/_react.default.createElement("header", {
|
|
175
208
|
className: _style.default.popinHeader
|
|
176
|
-
}, renderHeader(), onClose ? /*#__PURE__*/_react.default.createElement(
|
|
177
|
-
|
|
209
|
+
}, renderHeader(), onClose ? /*#__PURE__*/_react.default.createElement("div", {
|
|
210
|
+
className: _style.default.onCloseButton
|
|
211
|
+
}, /*#__PURE__*/_react.default.createElement(_buttonLinkIconOnly.default, {
|
|
212
|
+
onClick: handleCloseButton,
|
|
178
213
|
"data-name": 'close-icon',
|
|
179
214
|
"aria-label": 'close-icon',
|
|
180
215
|
size: "small",
|
|
181
216
|
icon: "close"
|
|
182
|
-
}) : null), mode !== 'items' && mode !== 'list' ? /*#__PURE__*/_react.default.createElement("div", {
|
|
217
|
+
})) : null), mode !== 'items' && mode !== 'list' ? /*#__PURE__*/_react.default.createElement("div", {
|
|
183
218
|
className: mode === 'cookie' || mode === 'information' ? _style.default.cookieTitleContainer : _style.default.titleContainer
|
|
184
219
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
185
220
|
className: _style.default.contentSection
|
|
@@ -233,6 +268,9 @@ const CMPopin = props => {
|
|
|
233
268
|
};
|
|
234
269
|
|
|
235
270
|
CMPopin.propTypes = process.env.NODE_ENV !== "production" ? _types.default : {};
|
|
271
|
+
CMPopin.contextTypes = {
|
|
272
|
+
translate: _provider.default.childContextTypes.translate
|
|
273
|
+
};
|
|
236
274
|
var _default = CMPopin;
|
|
237
275
|
exports.default = _default;
|
|
238
276
|
//# sourceMappingURL=index.js.map
|
|
@@ -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","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","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 {\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\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\n const wrapperPopinStyle = classNames(\n mode === 'cookie' && style.popinCookie,\n mode === 'list' && style.popinFilesList,\n style.popin\n );\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}>\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 {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;;AASA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,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;I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AEvE,YAAY,CAACwE,KADtB;IAEE,OAAO,EAAExE,YAAY,CAACyE,aAFxB;IAGE,aAAY,gBAAezE,YAAY,CAACyC,IAAK,EAH/C;IAIE,cAAYzC,YAAY,CAAC,YAAD,CAJ1B;IAKE,IAAI,EAAEA,YAAY,CAACyC,IALrB;IAME,WAAW,EAAEzC,YAAY,CAAC0E;EAN5B,EADF,CADW,GAWT,IAxBN,EAyBGpE,WAAW,gBACV;IAAK,SAAS,EAAEA,WAAW,CAACgE,WAAZ,GAA0BhF,cAAA,CAAMgF,WAAhC,GAA8ChF,cAAA,CAAMiF;EAApE,gBACE,6BAAC,mBAAD;IACE,KAAK,EAAEjE,WAAW,CAACkE,KADrB;IAEE,OAAO,EAAElE,WAAW,CAACmE,aAFvB;IAGE,aAAY,gBAAenE,WAAW,CAACmC,IAAK,EAH9C;IAIE,cAAYnC,WAAW,CAAC,YAAD,CAJzB;IAKE,IAAI,EAAEA,WAAW,CAACmC,IALpB;IAME,WAAW,EAAEnC,WAAW,CAACoE;EAN3B,EADF,CADU,GAWR,IApCN,CADD,GAuCG,IAnFN,CALF,CADF;AA6FD,CAxOD;;AA0OA/E,OAAO,CAACgF,SAAR,2CAAoBA,cAApB;eAEehF,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","handleKeyDown","key","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","onCloseButton","cookieTitleContainer","titleContainer","contentSection","message","__html","descriptionBtn","buttonContainer","largeButton","button","label","handleOnclick","customStyle","propTypes","contextTypes","translate","Provider","childContextTypes"],"sources":["../../../src/molecule/cm-popin/index.js"],"sourcesContent":["import 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 Provider from '../../atom/provider';\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 handleCloseButton = useMemo(() => () => onClose(), [onClose]);\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 handleCloseButton();\n }\n };\n const handleKeyDown = e => {\n if (e?.key === 'Escape') {\n handleCloseButton();\n }\n };\n document.addEventListener('click', closePopin);\n document.addEventListener('touchstart', closePopin);\n document.addEventListener('keydown', handleKeyDown);\n return () => {\n document.removeEventListener('click', closePopin);\n document.removeEventListener('touchstart', closePopin);\n document.removeEventListener('keydown', handleKeyDown);\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 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 <div className={style.onCloseButton}>\n <ButtonLinkIconOnly\n onClick={handleCloseButton}\n data-name={'close-icon'}\n aria-label={'close-icon'}\n size=\"small\"\n icon=\"close\"\n />\n </div>\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;\nCMPopin.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nexport default CMPopin;\n"],"mappings":";;;;;AAAA;;AACA;;AASA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAEA,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;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