@coorpacademy/components 11.32.35-alpha.7 → 11.32.35
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/discipline-associated-skills/index.d.ts +0 -1
- package/es/molecule/discipline-associated-skills/index.d.ts.map +1 -1
- package/es/molecule/discipline-associated-skills/index.js +3 -8
- package/es/molecule/discipline-associated-skills/index.js.map +1 -1
- package/es/molecule/progress-wrapper/index.d.ts +5 -4
- package/es/molecule/progress-wrapper/index.d.ts.map +1 -1
- package/es/molecule/progress-wrapper/index.js +28 -14
- package/es/molecule/progress-wrapper/index.js.map +1 -1
- package/es/molecule/progress-wrapper/style.css +25 -3
- package/es/template/certification-detail/index.d.ts +47 -5
- package/es/template/certification-detail/index.d.ts.map +1 -1
- package/es/template/certification-detail/index.js +41 -26
- package/es/template/certification-detail/index.js.map +1 -1
- package/es/template/certification-detail/style.css +12 -1
- package/es/template/common/discipline/index.d.ts +0 -1
- package/es/template/common/discipline/index.d.ts.map +1 -1
- package/es/template/common/discipline/index.js +2 -6
- package/es/template/common/discipline/index.js.map +1 -1
- package/es/template/skill-detail/all-courses.d.ts.map +1 -1
- package/es/template/skill-detail/all-courses.js +2 -2
- package/es/template/skill-detail/all-courses.js.map +1 -1
- package/lib/molecule/discipline-associated-skills/index.d.ts +0 -1
- package/lib/molecule/discipline-associated-skills/index.d.ts.map +1 -1
- package/lib/molecule/discipline-associated-skills/index.js +3 -8
- package/lib/molecule/discipline-associated-skills/index.js.map +1 -1
- package/lib/molecule/progress-wrapper/index.d.ts +5 -4
- package/lib/molecule/progress-wrapper/index.d.ts.map +1 -1
- package/lib/molecule/progress-wrapper/index.js +29 -14
- package/lib/molecule/progress-wrapper/index.js.map +1 -1
- package/lib/molecule/progress-wrapper/style.css +25 -3
- package/lib/template/certification-detail/index.d.ts +47 -5
- package/lib/template/certification-detail/index.d.ts.map +1 -1
- package/lib/template/certification-detail/index.js +42 -27
- package/lib/template/certification-detail/index.js.map +1 -1
- package/lib/template/certification-detail/style.css +12 -1
- package/lib/template/common/discipline/index.d.ts +0 -1
- package/lib/template/common/discipline/index.d.ts.map +1 -1
- package/lib/template/common/discipline/index.js +2 -6
- package/lib/template/common/discipline/index.js.map +1 -1
- package/lib/template/skill-detail/all-courses.d.ts.map +1 -1
- package/lib/template/skill-detail/all-courses.js +2 -2
- package/lib/template/skill-detail/all-courses.js.map +1 -1
- package/locales/en/global.json +0 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useCallback","useState","PropTypes","classnames","Provider","Tag","SelectOptionPropTypes","ButtonLinkIcon","Icon","CardsGrid","AllCourses","ContinueLearningButton","ProgressWrapper","style","DESCRIPTION_BREAKPOINT","CertificationDetail","props","context","certificationRef","title","description","certificationCourses","ongoingCoursesAvailable","filters","onBackClick","onContinueLearningClick","metrics","logoUrl","diplomaUrl","badgeUrl","translate","progression","mandatoryModules","stars","totalModules","showMore","setShowMore","handleShowMore","Description","truncate","totalCourses","completedModules","backgroundContainer","container","backButton","ctaContainer","logoContainer","logo","length","showMoreWrapper","faSize","wrapperSize","contentStats","type","downloadUrl","contextTypes","skin","childContextTypes","propTypes","string","isRequired","shape","number","bool","onChange","func","options","arrayOf"],"sources":["../../../src/template/certification-detail/index.js"],"sourcesContent":["import React, {useCallback, useState} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {compact, lowerCase, pipe, get, size} from 'lodash/fp';\nimport Provider from '../../atom/provider';\nimport Tag from '../../atom/tag';\nimport {SelectOptionPropTypes} from '../../atom/select';\nimport ButtonLinkIcon from '../../atom/button-link-icon';\nimport Icon from '../../atom/icon';\nimport CardsGrid from '../../organism/cards-grid';\nimport AllCourses from '../skill-detail/all-courses';\nimport {ContinueLearningButton} from '../skill-detail';\nimport ProgressWrapper from '../../molecule/progress-wrapper';\nimport style from './style.css';\n\nconst DESCRIPTION_BREAKPOINT = 382;\n\nconst CertificationDetail = (props, context) => {\n const {\n certificationRef,\n title,\n description,\n certificationCourses,\n ongoingCoursesAvailable,\n filters,\n onBackClick,\n onContinueLearningClick,\n metrics,\n logoUrl,\n diplomaUrl,\n badgeUrl\n } = props;\n const {translate} = context;\n const {progression, mandatoryModules, stars, totalModules} = metrics;\n\n const [showMore, setShowMore] = useState(false);\n const handleShowMore = useCallback(() => setShowMore(!showMore), [setShowMore, showMore]);\n\n const Description = useCallback(() => {\n return (\n <div className={classnames(style.description, !showMore && style.truncate)}>\n {description}\n </div>\n );\n }, [showMore, description]);\n\n const totalCourses = pipe(get('list'), size)(certificationCourses);\n const completedModules = (mandatoryModules * progression) / 100;\n\n return (\n <div className={style.backgroundContainer}>\n <div className={style.container} data-name={certificationRef}>\n <ButtonLinkIcon\n faIcon=\"arrow-left\"\n data-name=\"back-button\"\n aria-label=\"Back\"\n onClick={onBackClick}\n className={style.backButton}\n tooltipPlacement=\"right\"\n />\n <div className={style.ctaContainer}>\n <div className={style.logoContainer}>\n <img className={style.logo} src={logoUrl} />\n </div>\n <div>\n <Tag label={translate('certification')} />\n <div className={style.title}>{title}</div>\n {description ? (\n <>\n <Description />\n {description.length >= DESCRIPTION_BREAKPOINT ? (\n <div className={style.showMoreWrapper} onClick={handleShowMore}>\n {translate(showMore ? 'Show less' : 'Show more')}\n <Icon\n iconName={showMore ? 'chevron-up' : 'chevron-down'}\n size={{faSize: 14, wrapperSize: 16}}\n />\n </div>\n ) : null}\n </>\n ) : null}\n <div className={style.contentStats}>\n <span>{`${totalModules} ${lowerCase(translate('modules'))}`}</span>\n </div>\n <ContinueLearningButton\n ongoingCoursesAvailable={ongoingCoursesAvailable}\n onClick={onContinueLearningClick}\n />\n </div>\n </div>\n <ProgressWrapper\n title={translate('your_progress')}\n subtitle={translate('certification_progress_wrapper_subtitle')}\n progression={progression}\n completedModules={completedModules}\n mandatoryModules={mandatoryModules}\n sections={compact([\n {\n type: 'diploma',\n downloadUrl: diplomaUrl\n },\n badgeUrl && {\n type: 'badge',\n downloadUrl: badgeUrl\n },\n {\n type: 'stars',\n stars\n }\n ])}\n />\n <AllCourses courses={certificationCourses} totalCourses={totalCourses} filters={filters} />\n </div>\n </div>\n );\n};\n\nCertificationDetail.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nCertificationDetail.propTypes = {\n title: PropTypes.string.isRequired,\n certificationRef: PropTypes.string.isRequired,\n description: PropTypes.string,\n logoUrl: PropTypes.string,\n metrics: PropTypes.shape({\n progression: PropTypes.number,\n stars: PropTypes.number,\n mandatoryModules: PropTypes.number,\n totalModules: PropTypes.number\n }),\n diplomaUrl: PropTypes.string,\n badgeUrl: PropTypes.string,\n ongoingCoursesAvailable: PropTypes.bool,\n certificationCourses: PropTypes.shape(CardsGrid.propTypes),\n filters: PropTypes.shape({\n onChange: PropTypes.func,\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes))\n }),\n onBackClick: PropTypes.func,\n onContinueLearningClick: PropTypes.func\n};\n\nexport default CertificationDetail;\n"],"mappings":";;;;;AAAA,OAAOA,KAAP,IAAeC,WAAf,EAA4BC,QAA5B,QAA2C,OAA3C;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AAEA,OAAOC,QAAP,MAAqB,qBAArB;AACA,OAAOC,GAAP,MAAgB,gBAAhB;AACA,SAAQC,qBAAR,QAAoC,mBAApC;AACA,OAAOC,cAAP,MAA2B,6BAA3B;AACA,OAAOC,IAAP,MAAiB,iBAAjB;AACA,OAAOC,SAAP,MAAsB,2BAAtB;AACA,OAAOC,UAAP,MAAuB,6BAAvB;AACA,SAAQC,sBAAR,QAAqC,iBAArC;AACA,OAAOC,eAAP,MAA4B,iCAA5B;AACA,OAAOC,KAAP,MAAkB,aAAlB;AAEA,MAAMC,sBAAsB,GAAG,GAA/B;;AAEA,MAAMC,mBAAmB,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EAC9C,MAAM;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,CAAkBjE,SAAS,CAAC2D,KAAV,CAAgBvD,qBAAhB,CAAlB;EAFc,CAAhB,CAfqB;EAmB9BkB,WAAW,EAAEtB,SAAS,CAAC+D,IAnBO;EAoB9BxC,uBAAuB,EAAEvB,SAAS,CAAC+D;AApBL,CAAhC;AAuBA,eAAelD,mBAAf"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useCallback","useState","PropTypes","classnames","Provider","Tag","Select","SelectOptionPropTypes","ButtonLinkIcon","Icon","CardsGrid","AllCourses","ContinueLearning","ContinueLearningButton","ProgressWrapper","style","DESCRIPTION_BREAKPOINT","CertificationDetail","props","context","certificationRef","title","description","certificationCourses","ongoingCourses","totalCourses","totalModules","filters","sorting","onBackClick","onContinueLearningClick","metrics","logoUrl","onDownloadDiploma","badge","translate","progression","completedCourses","completedModules","stars","badgeUrl","onDownloadBadge","showMore","setShowMore","handleShowMore","Description","truncate","backgroundContainer","container","backButton","ctaContainer","logoContainer","logo","length","showMoreWrapper","faSize","wrapperSize","contentStats","divider","list","continueLearningSection","type","onDownload","contextTypes","skin","childContextTypes","propTypes","string","isRequired","shape","number","func","onChange","options","arrayOf"],"sources":["../../../src/template/certification-detail/index.js"],"sourcesContent":["import React, {useCallback, useState} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {compact, lowerCase} from 'lodash/fp';\nimport Provider from '../../atom/provider';\nimport Tag from '../../atom/tag';\nimport Select, {SelectOptionPropTypes} from '../../atom/select';\nimport ButtonLinkIcon from '../../atom/button-link-icon';\nimport Icon from '../../atom/icon';\nimport CardsGrid from '../../organism/cards-grid';\nimport AllCourses from '../skill-detail/all-courses';\nimport ContinueLearning from '../skill-detail/continue-learning';\nimport {ContinueLearningButton} from '../skill-detail';\nimport ProgressWrapper from '../../molecule/progress-wrapper';\nimport style from './style.css';\n\nconst DESCRIPTION_BREAKPOINT = 382;\n\nconst CertificationDetail = (props, context) => {\n const {\n certificationRef,\n title,\n description,\n certificationCourses,\n ongoingCourses,\n totalCourses,\n totalModules,\n filters,\n sorting,\n onBackClick,\n onContinueLearningClick,\n metrics,\n logoUrl,\n onDownloadDiploma,\n badge = {}\n } = props;\n const {translate} = context;\n const {progression, completedCourses, completedModules, stars} = metrics;\n const {badgeUrl = false, onDownloadBadge} = badge;\n\n const [showMore, setShowMore] = useState(false);\n const handleShowMore = useCallback(() => setShowMore(!showMore), [setShowMore, showMore]);\n\n const Description = useCallback(() => {\n return (\n <div className={classnames(style.description, !showMore && style.truncate)}>\n {description}\n </div>\n );\n }, [showMore, description]);\n\n return (\n <div className={style.backgroundContainer}>\n <div className={style.container} data-name={certificationRef}>\n <ButtonLinkIcon\n faIcon=\"arrow-left\"\n data-name=\"back-button\"\n aria-label=\"Back\"\n onClick={onBackClick}\n className={style.backButton}\n tooltipPlacement=\"right\"\n />\n <div className={style.ctaContainer}>\n <div className={style.logoContainer}>\n <img className={style.logo} src={logoUrl} />\n </div>\n <div>\n <Tag label={translate('certification')} />\n <div className={style.title}>{title}</div>\n {description ? (\n <>\n <Description />\n {description.length >= DESCRIPTION_BREAKPOINT ? (\n <div className={style.showMoreWrapper} onClick={handleShowMore}>\n {translate(showMore ? 'Show less' : 'Show more')}\n <Icon\n iconName={showMore ? 'chevron-up' : 'chevron-down'}\n size={{faSize: 14, wrapperSize: 16}}\n />\n </div>\n ) : null}\n </>\n ) : null}\n <div className={style.contentStats}>\n <span>{`${totalCourses} ${lowerCase(translate('courses'))}`}</span>\n <div className={style.divider} />\n <span>{`${totalModules} ${lowerCase(translate('modules'))}`}</span>\n </div>\n <ContinueLearningButton\n ongoingCoursesAvailable={!!ongoingCourses.list.length}\n onClick={onContinueLearningClick}\n />\n </div>\n </div>\n <div className={style.continueLearningSection}>\n <ContinueLearning ongoingCourses={ongoingCourses} />\n </div>\n <ProgressWrapper\n title={translate('your_progress')}\n subtitle={translate('certification_progress_wrapper_subtitle')}\n progression={progression}\n completedCourses={completedCourses}\n completedModules={completedModules}\n sections={compact([\n {\n type: 'diploma',\n onDownload: () => onDownloadDiploma\n },\n badgeUrl && {\n type: 'badge',\n badgeUrl,\n onDownload: () => onDownloadBadge\n },\n {\n type: 'stars',\n stars\n }\n ])}\n />\n <AllCourses\n courses={certificationCourses}\n totalCourses={totalCourses}\n filters={filters}\n sorting={sorting}\n />\n </div>\n </div>\n );\n};\n\nCertificationDetail.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nCertificationDetail.propTypes = {\n title: PropTypes.string.isRequired,\n certificationRef: PropTypes.string.isRequired,\n description: PropTypes.string,\n logoUrl: PropTypes.string,\n metrics: PropTypes.shape({\n progression: PropTypes.number,\n stars: PropTypes.number,\n completedCourses: PropTypes.number,\n completedModules: PropTypes.number\n }),\n onDownloadDiploma: PropTypes.func,\n badge: PropTypes.shape({\n badgeUrl: PropTypes.string,\n onDownloadBadge: PropTypes.func\n }),\n ongoingCourses: PropTypes.shape(CardsGrid.propTypes),\n certificationCourses: PropTypes.shape(CardsGrid.propTypes),\n totalCourses: PropTypes.number,\n totalModules: PropTypes.number,\n filters: PropTypes.shape({\n onChange: PropTypes.func,\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes))\n }),\n sorting: PropTypes.shape(Select.propTypes),\n onBackClick: PropTypes.func,\n onContinueLearningClick: PropTypes.func\n};\n\nexport default CertificationDetail;\n"],"mappings":";;AAAA,OAAOA,KAAP,IAAeC,WAAf,EAA4BC,QAA5B,QAA2C,OAA3C;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AAEA,OAAOC,QAAP,MAAqB,qBAArB;AACA,OAAOC,GAAP,MAAgB,gBAAhB;AACA,OAAOC,MAAP,IAAgBC,qBAAhB,QAA4C,mBAA5C;AACA,OAAOC,cAAP,MAA2B,6BAA3B;AACA,OAAOC,IAAP,MAAiB,iBAAjB;AACA,OAAOC,SAAP,MAAsB,2BAAtB;AACA,OAAOC,UAAP,MAAuB,6BAAvB;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|
+
height: 4px;
|
|
14
|
+
background-color: cm_grey_400;
|
|
15
|
+
border: solid cm_grey_400 1px;
|
|
16
|
+
border-radius: 4px;
|
|
17
|
+
}
|
|
18
|
+
|
|
11
19
|
.textBase {
|
|
12
20
|
font-family: "Gilroy";
|
|
13
21
|
font-style: normal;
|
|
@@ -45,7 +53,6 @@
|
|
|
45
53
|
align-items: center;
|
|
46
54
|
width: 100%;
|
|
47
55
|
gap: 40px;
|
|
48
|
-
margin-bottom: 40px;
|
|
49
56
|
}
|
|
50
57
|
|
|
51
58
|
.logoContainer {
|
|
@@ -105,6 +112,10 @@
|
|
|
105
112
|
color: cm_grey_400;
|
|
106
113
|
}
|
|
107
114
|
|
|
115
|
+
.continueLearningSection {
|
|
116
|
+
padding: 24px 0 32px 0;
|
|
117
|
+
}
|
|
118
|
+
|
|
108
119
|
@media tablet {
|
|
109
120
|
.ctaContainer {
|
|
110
121
|
flex-direction: column;
|
|
@@ -122,7 +122,6 @@ declare namespace Discipline {
|
|
|
122
122
|
locale: PropTypes.Requireable<string>;
|
|
123
123
|
focused: PropTypes.Requireable<boolean>;
|
|
124
124
|
}> | null | undefined)[]>;
|
|
125
|
-
const skillsBaseUrl: PropTypes.Requireable<string>;
|
|
126
125
|
const onSkillClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
127
126
|
const addToMyListText: PropTypes.Requireable<string>;
|
|
128
127
|
const removeFromMyListText: PropTypes.Requireable<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/template/common/discipline/index.js"],"names":[],"mappings":";AAeA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/template/common/discipline/index.js"],"names":[],"mappings":";AAeA,mEAmKC"}
|
|
@@ -25,7 +25,6 @@ const Discipline = (props, context) => {
|
|
|
25
25
|
buy,
|
|
26
26
|
startLabel,
|
|
27
27
|
skills = [],
|
|
28
|
-
skillsBaseUrl,
|
|
29
28
|
onSkillClick,
|
|
30
29
|
buyLabel,
|
|
31
30
|
shareWording,
|
|
@@ -95,8 +94,7 @@ const Discipline = (props, context) => {
|
|
|
95
94
|
key: 'shareTablet'
|
|
96
95
|
})), /*#__PURE__*/React.createElement(DisciplineAssociatedSkills, {
|
|
97
96
|
skills: skills,
|
|
98
|
-
onSkillClick: onSkillClick
|
|
99
|
-
skillsBaseUrl: skillsBaseUrl
|
|
97
|
+
onSkillClick: onSkillClick
|
|
100
98
|
}), authorSection), disciplineContent), /*#__PURE__*/React.createElement("div", {
|
|
101
99
|
className: style.rightSection
|
|
102
100
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -118,8 +116,7 @@ const Discipline = (props, context) => {
|
|
|
118
116
|
key: 'addToMyListDesktop'
|
|
119
117
|
}))), /*#__PURE__*/React.createElement(DisciplineAssociatedSkills, {
|
|
120
118
|
skills: skills,
|
|
121
|
-
onSkillClick: onSkillClick
|
|
122
|
-
skillsBaseUrl: skillsBaseUrl
|
|
119
|
+
onSkillClick: onSkillClick
|
|
123
120
|
}), authorSection)));
|
|
124
121
|
const shareFeedBack = disableShare ? null : /*#__PURE__*/React.createElement(ShareFeedback, {
|
|
125
122
|
errorWording: shareErrorWording,
|
|
@@ -159,7 +156,6 @@ Discipline.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
159
156
|
locale: PropTypes.string,
|
|
160
157
|
focused: PropTypes.bool
|
|
161
158
|
})),
|
|
162
|
-
skillsBaseUrl: PropTypes.string,
|
|
163
159
|
onSkillClick: PropTypes.func,
|
|
164
160
|
addToMyListText: AddToMyListFeedback.propTypes.addToMyListText,
|
|
165
161
|
removeFromMyListText: AddToMyListFeedback.propTypes.removeFromMyListText,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","isEmpty","PropTypes","DisciplineCTA","DisciplineHeader","DisciplinePartners","DisciplineScope","DisciplineAssociatedSkills","Share","ShareFeedback","ShareStatusProvider","AddToMyList","AddToMyListFeedback","AddToMyListStatusProvider","style","Discipline","props","context","selected","level","levels","changeLevel","image","title","video","authors","description","start","buy","startLabel","skills","skillsBaseUrl","onSkillClick","buyLabel","shareWording","shareText","shareSuccessWording","shareErrorWording","addToMyListButton","favorite","onFavoriteClick","addToMyListText","removeFromMyListText","disableShare","disableAddToMyList","lastUpdated","authorSection","partners","disciplineCTA","disciplineContent","content","disciplineHeader","header","discipline","container","leftSection","mobileAuthorCtaSection","columnReverse","cta","addToMyListBtn","shareBtn","rightSection","stickySection","buttons","shareFeedBack","addToMyListFeedback","addToMyListProviderWrap","shareProviderWrap","propTypes","onClick","wording","text","successWording","errorWording","arrayOf","shape","ref","string","locale","focused","bool","func","contextTypes","translate"],"sources":["../../../../src/template/common/discipline/index.js"],"sourcesContent":["import React from 'react';\nimport isEmpty from 'lodash/fp/isEmpty';\nimport PropTypes from 'prop-types';\nimport DisciplineCTA from '../../../molecule/discipline-cta';\nimport DisciplineHeader from '../../../molecule/discipline-header';\nimport DisciplinePartners from '../../../molecule/discipline-partners';\nimport DisciplineScope from '../../../molecule/discipline-scope';\nimport DisciplineAssociatedSkills from '../../../molecule/discipline-associated-skills';\nimport Share, {ShareFeedback, ShareStatusProvider} from '../../../molecule/share';\nimport AddToMyList, {\n AddToMyListFeedback,\n AddToMyListStatusProvider\n} from '../../../molecule/add-to-my-list';\nimport style from './style.css';\n\nconst Discipline = (props, context) => {\n const {\n selected = 0,\n level,\n levels,\n changeLevel,\n image,\n title = '',\n video,\n authors = [],\n description = '',\n start,\n buy,\n startLabel,\n skills = [],\n skillsBaseUrl,\n onSkillClick,\n buyLabel,\n shareWording,\n shareText,\n shareSuccessWording,\n shareErrorWording,\n addToMyListButton,\n favorite,\n onFavoriteClick,\n addToMyListText,\n removeFromMyListText,\n disableShare = false,\n disableAddToMyList = false,\n lastUpdated\n } = props;\n\n const authorSection = isEmpty(authors) ? null : (\n <div className={style.partners}>\n <DisciplinePartners authors={authors} />\n </div>\n );\n\n const disciplineCTA = (\n <DisciplineCTA\n type={'discipline'}\n start={start}\n buy={buy}\n startLabel={startLabel}\n buyLabel={buyLabel}\n />\n );\n\n const disciplineContent = (\n <div className={style.content}>\n <DisciplineScope content={level} levels={levels} selected={selected} onClick={changeLevel} />\n </div>\n );\n\n const disciplineHeader = (\n <div className={style.header}>\n <DisciplineHeader\n image={image}\n video={video}\n title={title}\n description={description}\n lastUpdated={lastUpdated}\n />\n </div>\n );\n\n const discipline = (\n <div data-name=\"discipline\" className={style.container} key=\"discipline\">\n <div className={style.leftSection}>\n {disciplineHeader}\n <div className={style.mobileAuthorCtaSection}>\n <div className={style.columnReverse}>\n <div className={style.cta}>{disciplineCTA}</div>\n {disableAddToMyList ? null : (\n <AddToMyList\n style={style.addToMyListBtn}\n addToMyListButton={addToMyListButton}\n favorite={favorite}\n onFavoriteClick={onFavoriteClick}\n key={'addToMyListTablet'}\n />\n )}\n {disableShare ? null : (\n <Share\n style={style.shareBtn}\n wording={shareWording}\n text={shareText}\n key={'shareTablet'}\n />\n )}\n </div>\n <DisciplineAssociatedSkills\n skills={skills}\n onSkillClick={onSkillClick}\n skillsBaseUrl={skillsBaseUrl}\n />\n {authorSection}\n </div>\n {disciplineContent}\n </div>\n <div className={style.rightSection}>\n <div className={style.stickySection}>\n <div className={style.cta}>\n {disciplineCTA}\n {disableShare && disableAddToMyList ? null : (\n <div className={style.buttons}>\n {disableShare ? null : (\n <Share\n style={style.shareBtn}\n wording={shareWording}\n text={shareText}\n key={'shareDesktop'}\n />\n )}\n {disableAddToMyList ? null : (\n <AddToMyList\n style={style.addToMyListBtn}\n addToMyListButton={addToMyListButton}\n favorite={favorite}\n onFavoriteClick={onFavoriteClick}\n key={'addToMyListDesktop'}\n />\n )}\n </div>\n )}\n </div>\n <DisciplineAssociatedSkills\n skills={skills}\n onSkillClick={onSkillClick}\n skillsBaseUrl={skillsBaseUrl}\n />\n {authorSection}\n </div>\n </div>\n </div>\n );\n\n const shareFeedBack = disableShare ? null : (\n <ShareFeedback\n errorWording={shareErrorWording}\n successWording={shareSuccessWording}\n key=\"shareFeedBack\"\n />\n );\n\n const addToMyListFeedback = disableAddToMyList ? null : (\n <AddToMyListFeedback\n addToMyListText={addToMyListText}\n removeFromMyListText={removeFromMyListText}\n favorite={favorite}\n />\n );\n\n const addToMyListProviderWrap = disableAddToMyList ? (\n <>\n {shareFeedBack}\n {discipline}\n </>\n ) : (\n <AddToMyListStatusProvider>\n {shareFeedBack}\n {addToMyListFeedback}\n {discipline}\n </AddToMyListStatusProvider>\n );\n const shareProviderWrap = disableShare ? (\n addToMyListProviderWrap\n ) : (\n <ShareStatusProvider>{addToMyListProviderWrap}</ShareStatusProvider>\n );\n\n return shareProviderWrap;\n};\n\nDiscipline.propTypes = {\n image: DisciplineHeader.propTypes.image,\n video: DisciplineHeader.propTypes.video,\n title: DisciplineHeader.propTypes.title,\n description: DisciplineHeader.propTypes.description,\n start: DisciplineCTA.propTypes.start,\n buy: DisciplineCTA.propTypes.buy,\n startLabel: DisciplineCTA.propTypes.startLabel,\n buyLabel: DisciplineCTA.propTypes.buyLabel,\n authors: DisciplinePartners.propTypes.authors,\n level: DisciplineScope.propTypes.content,\n levels: DisciplineScope.propTypes.levels,\n selected: DisciplineScope.propTypes.selected,\n changeLevel: DisciplineScope.propTypes.onClick,\n shareWording: Share.propTypes.wording,\n shareText: Share.propTypes.text,\n shareSuccessWording: ShareFeedback.propTypes.successWording,\n shareErrorWording: ShareFeedback.propTypes.errorWording,\n skills: PropTypes.arrayOf(\n PropTypes.shape({\n ref: PropTypes.string,\n locale: PropTypes.string,\n focused: PropTypes.bool\n })\n ),\n skillsBaseUrl: PropTypes.string,\n onSkillClick: PropTypes.func,\n addToMyListText: AddToMyListFeedback.propTypes.addToMyListText,\n removeFromMyListText: AddToMyListFeedback.propTypes.removeFromMyListText,\n addToMyListButton: AddToMyList.propTypes.addToMyListButton,\n onFavoriteClick: AddToMyList.propTypes.onFavoriteClick,\n favorite: AddToMyList.propTypes.favorite,\n disableShare: PropTypes.bool,\n disableAddToMyList: PropTypes.bool\n};\n\nDiscipline.contextTypes = {\n translate: PropTypes.func\n};\n\nexport default Discipline;\n"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,OAAP,MAAoB,mBAApB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,aAAP,MAA0B,kCAA1B;AACA,OAAOC,gBAAP,MAA6B,qCAA7B;AACA,OAAOC,kBAAP,MAA+B,uCAA/B;AACA,OAAOC,eAAP,MAA4B,oCAA5B;AACA,OAAOC,0BAAP,MAAuC,gDAAvC;AACA,OAAOC,KAAP,IAAeC,aAAf,EAA8BC,mBAA9B,QAAwD,yBAAxD;AACA,OAAOC,WAAP,IACEC,mBADF,EAEEC,yBAFF,QAGO,kCAHP;AAIA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,UAAU,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EACrC,MAAM;IACJC,QAAQ,GAAG,CADP;IAEJC,KAFI;IAGJC,MAHI;IAIJC,WAJI;IAKJC,KALI;IAMJC,KAAK,GAAG,EANJ;IAOJC,KAPI;IAQJC,OAAO,GAAG,EARN;IASJC,WAAW,GAAG,EATV;IAUJC,KAVI;IAWJC,GAXI;IAYJC,UAZI;IAaJC,MAAM,GAAG,EAbL;IAcJC,aAdI;IAeJC,YAfI;IAgBJC,QAhBI;IAiBJC,YAjBI;IAkBJC,SAlBI;IAmBJC,mBAnBI;IAoBJC,iBApBI;IAqBJC,iBArBI;IAsBJC,QAtBI;IAuBJC,eAvBI;IAwBJC,eAxBI;IAyBJC,oBAzBI;IA0BJC,YAAY,GAAG,KA1BX;IA2BJC,kBAAkB,GAAG,KA3BjB;IA4BJC;EA5BI,IA6BF7B,KA7BJ;EA+BA,MAAM8B,aAAa,GAAG7C,OAAO,CAACwB,OAAD,CAAP,GAAmB,IAAnB,gBACpB;IAAK,SAAS,EAAEX,KAAK,CAACiC;EAAtB,gBACE,o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AAC4D,SAAN,CAAgBE,OAdT;EAerBnC,SAAS,EAAE3B,KAAK,CAAC4D,SAAN,CAAgBG,IAfN;EAgBrBnC,mBAAmB,EAAE3B,aAAa,CAAC2D,SAAd,CAAwBI,cAhBxB;EAiBrBnC,iBAAiB,EAAE5B,aAAa,CAAC2D,SAAd,CAAwBK,YAjBtB;EAkBrB3C,MAAM,EAAE5B,SAAS,CAACwE,OAAV,CACNxE,SAAS,CAACyE,KAAV,CAAgB;IACdC,GAAG,EAAE1E,SAAS,CAAC2E,MADD;IAEdC,MAAM,EAAE5E,SAAS,CAAC2E,MAFJ;IAGdE,OAAO,EAAE7E,SAAS,CAAC8E;EAHL,CAAhB,CADM,CAlBa;EAyBrBjD,aAAa,EAAE7B,SAAS,CAAC2E,MAzBJ;EA0BrB7C,YAAY,EAAE9B,SAAS,CAAC+E,IA1BH;EA2BrBxC,eAAe,EAAE7B,mBAAmB,CAACwD,SAApB,CAA8B3B,eA3B1B;EA4BrBC,oBAAoB,EAAE9B,mBAAmB,CAACwD,SAApB,CAA8B1B,oBA5B/B;EA6BrBJ,iBAAiB,EAAE3B,WAAW,CAACyD,SAAZ,CAAsB9B,iBA7BpB;EA8BrBE,eAAe,EAAE7B,WAAW,CAACyD,SAAZ,CAAsB5B,eA9BlB;EA+BrBD,QAAQ,EAAE5B,WAAW,CAACyD,SAAZ,CAAsB7B,QA/BX;EAgCrBI,YAAY,EAAEzC,SAAS,CAAC8E,IAhCH;EAiCrBpC,kBAAkB,EAAE1C,SAAS,CAAC8E;AAjCT,CAAvB;AAoCAjE,UAAU,CAACmE,YAAX,GAA0B;EACxBC,SAAS,EAAEjF,SAAS,CAAC+E;AADG,CAA1B;AAIA,eAAelE,UAAf"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","isEmpty","PropTypes","DisciplineCTA","DisciplineHeader","DisciplinePartners","DisciplineScope","DisciplineAssociatedSkills","Share","ShareFeedback","ShareStatusProvider","AddToMyList","AddToMyListFeedback","AddToMyListStatusProvider","style","Discipline","props","context","selected","level","levels","changeLevel","image","title","video","authors","description","start","buy","startLabel","skills","onSkillClick","buyLabel","shareWording","shareText","shareSuccessWording","shareErrorWording","addToMyListButton","favorite","onFavoriteClick","addToMyListText","removeFromMyListText","disableShare","disableAddToMyList","lastUpdated","authorSection","partners","disciplineCTA","disciplineContent","content","disciplineHeader","header","discipline","container","leftSection","mobileAuthorCtaSection","columnReverse","cta","addToMyListBtn","shareBtn","rightSection","stickySection","buttons","shareFeedBack","addToMyListFeedback","addToMyListProviderWrap","shareProviderWrap","propTypes","onClick","wording","text","successWording","errorWording","arrayOf","shape","ref","string","locale","focused","bool","func","contextTypes","translate"],"sources":["../../../../src/template/common/discipline/index.js"],"sourcesContent":["import React from 'react';\nimport isEmpty from 'lodash/fp/isEmpty';\nimport PropTypes from 'prop-types';\nimport DisciplineCTA from '../../../molecule/discipline-cta';\nimport DisciplineHeader from '../../../molecule/discipline-header';\nimport DisciplinePartners from '../../../molecule/discipline-partners';\nimport DisciplineScope from '../../../molecule/discipline-scope';\nimport DisciplineAssociatedSkills from '../../../molecule/discipline-associated-skills';\nimport Share, {ShareFeedback, ShareStatusProvider} from '../../../molecule/share';\nimport AddToMyList, {\n AddToMyListFeedback,\n AddToMyListStatusProvider\n} from '../../../molecule/add-to-my-list';\nimport style from './style.css';\n\nconst Discipline = (props, context) => {\n const {\n selected = 0,\n level,\n levels,\n changeLevel,\n image,\n title = '',\n video,\n authors = [],\n description = '',\n start,\n buy,\n startLabel,\n skills = [],\n onSkillClick,\n buyLabel,\n shareWording,\n shareText,\n shareSuccessWording,\n shareErrorWording,\n addToMyListButton,\n favorite,\n onFavoriteClick,\n addToMyListText,\n removeFromMyListText,\n disableShare = false,\n disableAddToMyList = false,\n lastUpdated\n } = props;\n\n const authorSection = isEmpty(authors) ? null : (\n <div className={style.partners}>\n <DisciplinePartners authors={authors} />\n </div>\n );\n\n const disciplineCTA = (\n <DisciplineCTA\n type={'discipline'}\n start={start}\n buy={buy}\n startLabel={startLabel}\n buyLabel={buyLabel}\n />\n );\n\n const disciplineContent = (\n <div className={style.content}>\n <DisciplineScope content={level} levels={levels} selected={selected} onClick={changeLevel} />\n </div>\n );\n\n const disciplineHeader = (\n <div className={style.header}>\n <DisciplineHeader\n image={image}\n video={video}\n title={title}\n description={description}\n lastUpdated={lastUpdated}\n />\n </div>\n );\n\n const discipline = (\n <div data-name=\"discipline\" className={style.container} key=\"discipline\">\n <div className={style.leftSection}>\n {disciplineHeader}\n <div className={style.mobileAuthorCtaSection}>\n <div className={style.columnReverse}>\n <div className={style.cta}>{disciplineCTA}</div>\n {disableAddToMyList ? null : (\n <AddToMyList\n style={style.addToMyListBtn}\n addToMyListButton={addToMyListButton}\n favorite={favorite}\n onFavoriteClick={onFavoriteClick}\n key={'addToMyListTablet'}\n />\n )}\n {disableShare ? null : (\n <Share\n style={style.shareBtn}\n wording={shareWording}\n text={shareText}\n key={'shareTablet'}\n />\n )}\n </div>\n <DisciplineAssociatedSkills skills={skills} onSkillClick={onSkillClick} />\n {authorSection}\n </div>\n {disciplineContent}\n </div>\n <div className={style.rightSection}>\n <div className={style.stickySection}>\n <div className={style.cta}>\n {disciplineCTA}\n {disableShare && disableAddToMyList ? null : (\n <div className={style.buttons}>\n {disableShare ? null : (\n <Share\n style={style.shareBtn}\n wording={shareWording}\n text={shareText}\n key={'shareDesktop'}\n />\n )}\n {disableAddToMyList ? null : (\n <AddToMyList\n style={style.addToMyListBtn}\n addToMyListButton={addToMyListButton}\n favorite={favorite}\n onFavoriteClick={onFavoriteClick}\n key={'addToMyListDesktop'}\n />\n )}\n </div>\n )}\n </div>\n <DisciplineAssociatedSkills skills={skills} onSkillClick={onSkillClick} />\n {authorSection}\n </div>\n </div>\n </div>\n );\n\n const shareFeedBack = disableShare ? null : (\n <ShareFeedback\n errorWording={shareErrorWording}\n successWording={shareSuccessWording}\n key=\"shareFeedBack\"\n />\n );\n\n const addToMyListFeedback = disableAddToMyList ? null : (\n <AddToMyListFeedback\n addToMyListText={addToMyListText}\n removeFromMyListText={removeFromMyListText}\n favorite={favorite}\n />\n );\n\n const addToMyListProviderWrap = disableAddToMyList ? (\n <>\n {shareFeedBack}\n {discipline}\n </>\n ) : (\n <AddToMyListStatusProvider>\n {shareFeedBack}\n {addToMyListFeedback}\n {discipline}\n </AddToMyListStatusProvider>\n );\n const shareProviderWrap = disableShare ? (\n addToMyListProviderWrap\n ) : (\n <ShareStatusProvider>{addToMyListProviderWrap}</ShareStatusProvider>\n );\n\n return shareProviderWrap;\n};\n\nDiscipline.propTypes = {\n image: DisciplineHeader.propTypes.image,\n video: DisciplineHeader.propTypes.video,\n title: DisciplineHeader.propTypes.title,\n description: DisciplineHeader.propTypes.description,\n start: DisciplineCTA.propTypes.start,\n buy: DisciplineCTA.propTypes.buy,\n startLabel: DisciplineCTA.propTypes.startLabel,\n buyLabel: DisciplineCTA.propTypes.buyLabel,\n authors: DisciplinePartners.propTypes.authors,\n level: DisciplineScope.propTypes.content,\n levels: DisciplineScope.propTypes.levels,\n selected: DisciplineScope.propTypes.selected,\n changeLevel: DisciplineScope.propTypes.onClick,\n shareWording: Share.propTypes.wording,\n shareText: Share.propTypes.text,\n shareSuccessWording: ShareFeedback.propTypes.successWording,\n shareErrorWording: ShareFeedback.propTypes.errorWording,\n skills: PropTypes.arrayOf(\n PropTypes.shape({\n ref: PropTypes.string,\n locale: PropTypes.string,\n focused: PropTypes.bool\n })\n ),\n onSkillClick: PropTypes.func,\n addToMyListText: AddToMyListFeedback.propTypes.addToMyListText,\n removeFromMyListText: AddToMyListFeedback.propTypes.removeFromMyListText,\n addToMyListButton: AddToMyList.propTypes.addToMyListButton,\n onFavoriteClick: AddToMyList.propTypes.onFavoriteClick,\n favorite: AddToMyList.propTypes.favorite,\n disableShare: PropTypes.bool,\n disableAddToMyList: PropTypes.bool\n};\n\nDiscipline.contextTypes = {\n translate: PropTypes.func\n};\n\nexport default Discipline;\n"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;A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,SAAd,CAAwBK,YAjBtB;EAkBrB1C,MAAM,EAAE5B,SAAS,CAACuE,OAAV,CACNvE,SAAS,CAACwE,KAAV,CAAgB;IACdC,GAAG,EAAEzE,SAAS,CAAC0E,MADD;IAEdC,MAAM,EAAE3E,SAAS,CAAC0E,MAFJ;IAGdE,OAAO,EAAE5E,SAAS,CAAC6E;EAHL,CAAhB,CADM,CAlBa;EAyBrBhD,YAAY,EAAE7B,SAAS,CAAC8E,IAzBH;EA0BrBxC,eAAe,EAAE5B,mBAAmB,CAACuD,SAApB,CAA8B3B,eA1B1B;EA2BrBC,oBAAoB,EAAE7B,mBAAmB,CAACuD,SAApB,CAA8B1B,oBA3B/B;EA4BrBJ,iBAAiB,EAAE1B,WAAW,CAACwD,SAAZ,CAAsB9B,iBA5BpB;EA6BrBE,eAAe,EAAE5B,WAAW,CAACwD,SAAZ,CAAsB5B,eA7BlB;EA8BrBD,QAAQ,EAAE3B,WAAW,CAACwD,SAAZ,CAAsB7B,QA9BX;EA+BrBI,YAAY,EAAExC,SAAS,CAAC6E,IA/BH;EAgCrBpC,kBAAkB,EAAEzC,SAAS,CAAC6E;AAhCT,CAAvB;AAmCAhE,UAAU,CAACkE,YAAX,GAA0B;EACxBC,SAAS,EAAEhF,SAAS,CAAC8E;AADG,CAA1B;AAIA,eAAejE,UAAf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"all-courses.d.ts","sourceRoot":"","sources":["../../../src/template/skill-detail/all-courses.js"],"names":[],"mappings":";AA2CA,
|
|
1
|
+
{"version":3,"file":"all-courses.d.ts","sourceRoot":"","sources":["../../../src/template/skill-detail/all-courses.js"],"names":[],"mappings":";AA2CA,mEAwHC"}
|
|
@@ -126,9 +126,9 @@ const AllCourses = (props, context) => {
|
|
|
126
126
|
"aria-label": 'Show completed courses aria label',
|
|
127
127
|
value: showCompleted,
|
|
128
128
|
onChange: handleShowCompletedToggle
|
|
129
|
-
}),
|
|
129
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
130
130
|
className: style.sortWrapper
|
|
131
|
-
}, translate('sort_by'), sortView)
|
|
131
|
+
}, translate('sort_by'), sortView))), /*#__PURE__*/React.createElement("div", {
|
|
132
132
|
className: style.filterWrapper
|
|
133
133
|
}, options.length > 2 && searchResults.length > 0 ? options.map((filter, index) => {
|
|
134
134
|
const {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"all-courses.js","names":["React","useState","useCallback","useEffect","PropTypes","Provider","Select","SelectOptionPropTypes","ButtonLink","SearchForm","CardsGrid","searchValueIncluded","InputSwitch","style","FilterButton","props","context","selected","filter","onClick","skin","primarySkinColor","buttonProps","customStyle","backgroundColor","color","transition","width","label","contextTypes","childContextTypes","translate","propTypes","bool","string","func","AllCourses","courses","totalCourses","filters","sorting","options","onChange","list","loading","showCompleted","setShowCompleted","searchValue","setSearchValue","searchResults","setSearchResults","course","sortView","undefined","handleSearch","value","skill","title","handleSearchReset","handleShowCompletedToggle","toggledShowCompleted","progress","continueLearningWrapper","continueLearningTitle","continueLearningNumber","searchAndSortSection","searchWrapper","placeholder","sortSection","sortWrapper","filterWrapper","length","map","index","name","handleChange","filterButtonWrapper","divider","justifyContent","emptySearchResultContainer","emptySearchResultTitle","emptySearchResultDescription","emptySearchResultClearSearch","shape","number","arrayOf"],"sources":["../../../src/template/skill-detail/all-courses.js"],"sourcesContent":["import React, {useState, useCallback, useEffect} from 'react';\nimport PropTypes from 'prop-types';\nimport {get, getOr, sortBy} from 'lodash/fp';\nimport Provider from '../../atom/provider';\nimport Select, {SelectOptionPropTypes} from '../../atom/select';\nimport ButtonLink from '../../atom/button-link';\nimport SearchForm from '../../molecule/search-form';\nimport CardsGrid from '../../organism/cards-grid';\nimport searchValueIncluded from '../../util/search-value-included';\nimport InputSwitch from '../../atom/input-switch';\nimport style from './all-courses.css';\n\nconst FilterButton = (props, context) => {\n const {selected, filter, onClick} = props;\n const {skin} = context;\n const primarySkinColor = get('common.primary', skin);\n\n const buttonProps = {\n customStyle: {\n backgroundColor: selected ? primarySkinColor : '#E1E1E3',\n color: selected ? '#FFFFFF' : '#515161',\n transition: 'background-color 0.15s ease-in-out, color 0.15s ease-in-out',\n width: 'fit-content'\n },\n label: filter,\n onClick,\n 'data-name': 'filter-type-course-button'\n };\n\n return <ButtonLink {...buttonProps} />;\n};\n\nFilterButton.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nFilterButton.propTypes = {\n selected: PropTypes.bool,\n filter: PropTypes.string,\n onClick: PropTypes.func\n};\n\nconst AllCourses = (props, context) => {\n const {courses, totalCourses, filters, sorting} = props;\n const {options, onChange} = filters;\n const {list, loading} = courses;\n const {translate} = context;\n const [showCompleted, setShowCompleted] = useState(true);\n const [searchValue, setSearchValue] = useState('');\n const [searchResults, setSearchResults] = useState(\n sortBy(course => -getOr(0, ['progress'], course), list)\n );\n\n const sortView =\n sorting !== undefined ? (\n <div data-name=\"choice\">\n <Select {...sorting} aria-label=\"All courses sort\" />\n </div>\n ) : null;\n\n useEffect(() => {\n setSearchResults(sortBy(course => -getOr(0, ['progress'], course), list));\n }, [list]);\n\n const handleSearch = useCallback(\n value => {\n setSearchValue(value);\n setSearchResults(list.filter(skill => searchValueIncluded(skill.title, value)));\n },\n [list, setSearchValue, setSearchResults]\n );\n\n const handleSearchReset = useCallback(() => {\n setSearchValue('');\n setSearchResults(list);\n }, [list, setSearchValue, setSearchResults]);\n\n const handleShowCompletedToggle = useCallback(() => {\n const toggledShowCompleted = !showCompleted;\n setShowCompleted(toggledShowCompleted);\n if (toggledShowCompleted) {\n setSearchResults(list);\n handleSearchReset();\n } else {\n setSearchResults(searchResults.filter(skill => skill.progress < 100));\n }\n }, [list, searchResults, showCompleted, setShowCompleted, setSearchResults, handleSearchReset]);\n\n return (\n <>\n <div className={style.continueLearningWrapper}>\n <span className={style.continueLearningTitle}>{translate('all_courses')}</span>\n <span className={style.continueLearningNumber}>{totalCourses}</span>\n </div>\n <div className={style.searchAndSortSection}>\n <div className={style.searchWrapper}>\n <SearchForm\n search={{\n placeholder: translate('search_place_holder'),\n value: searchValue,\n onChange: handleSearch\n }}\n onReset={handleSearchReset}\n />\n </div>\n <div className={style.sortSection}>\n <InputSwitch\n id={'show-completed-courses-switch'}\n type=\"switch\"\n name={translate('show_completed')}\n title={translate('show_completed')}\n aria-label={'Show completed courses aria label'}\n value={showCompleted}\n onChange={handleShowCompletedToggle}\n />\n {sortView ? (\n <div className={style.sortWrapper}>\n {translate('sort_by')}\n {sortView}\n </div>\n ) : null}\n </div>\n </div>\n <div className={style.filterWrapper}>\n {options.length > 2 && searchResults.length > 0\n ? options.map((filter, index) => {\n const {name, value, selected} = filter;\n\n function handleChange() {\n onChange(value);\n handleSearchReset();\n }\n return (\n <div key={index} className={style.filterButtonWrapper}>\n <FilterButton selected={selected} filter={name} onClick={handleChange} />\n {value === 'ALL' ? <div className={style.divider} /> : null}\n </div>\n );\n })\n : null}\n </div>\n <div>\n {searchResults.length > 0 ? (\n <CardsGrid\n list={searchResults}\n loading={loading}\n customStyle={{justifyContent: 'left'}}\n />\n ) : (\n <div className={style.emptySearchResultContainer}>\n <div className={style.emptySearchResultTitle}>\n {translate('empty_search_result_title', {searchValue})}\n </div>\n <div className={style.emptySearchResultDescription}>\n {translate('empty_search_result_description')}\n </div>\n <div className={style.emptySearchResultClearSearch} onClick={handleSearchReset}>\n {translate('empty_search_result_clear_search')}\n </div>\n </div>\n )}\n </div>\n </>\n );\n};\n\nAllCourses.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nAllCourses.propTypes = {\n courses: PropTypes.shape(CardsGrid.propTypes),\n totalCourses: PropTypes.number,\n filters: PropTypes.shape({\n onChange: PropTypes.func,\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes))\n }),\n sorting: PropTypes.shape(Select.propTypes)\n};\n\nexport default AllCourses;\n"],"mappings":";;;;;;AAAA,OAAOA,KAAP,IAAeC,Q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BAOC;IAAK,SAAS,EAAEjE,KAAK,CAACkE;EAAtB,gBACE;IAAK,SAAS,EAAElE,KAAK,CAACmE;EAAtB,GACGjD,SAAS,CAAC,2BAAD,EAA8B;IAACgB;EAAD,CAA9B,CADZ,CADF,eAIE;IAAK,SAAS,EAAElC,KAAK,CAACoE;EAAtB,GACGlD,SAAS,CAAC,iCAAD,CADZ,CAJF,eAOE;IAAK,SAAS,EAAElB,KAAK,CAACqE,4BAAtB;IAAoD,OAAO,EAAExB;EAA7D,GACG3B,SAAS,CAAC,kCAAD,CADZ,CAPF,CARJ,CApDF,CADF;AA4ED,CA1HD;;AA4HAK,UAAU,CAACP,YAAX,GAA0B;EACxBT,IAAI,EAAEf,QAAQ,CAACyB,iBAAT,CAA2BV,IADT;EAExBW,SAAS,EAAE1B,QAAQ,CAACyB,iBAAT,CAA2BC;AAFd,CAA1B;AAKAK,UAAU,CAACJ,SAAX,2CAAuB;EACrBK,OAAO,EAAEjC,SAAS,CAAC+E,KAAV,CAAgBzE,SAAS,CAACsB,SAA1B,CADY;EAErBM,YAAY,EAAElC,SAAS,CAACgF,MAFH;EAGrB7C,OAAO,EAAEnC,SAAS,CAAC+E,KAAV,CAAgB;IACvBzC,QAAQ,EAAEtC,SAAS,CAAC+B,IADG;IAEvBM,OAAO,EAAErC,SAAS,CAACiF,OAAV,CAAkBjF,SAAS,CAAC+E,KAAV,CAAgB5E,qBAAhB,CAAlB;EAFc,CAAhB,CAHY;EAOrBiC,OAAO,EAAEpC,SAAS,CAAC+E,KAAV,CAAgB7E,MAAM,CAAC0B,SAAvB;AAPY,CAAvB;AAUA,eAAeI,UAAf"}
|
|
1
|
+
{"version":3,"file":"all-courses.js","names":["React","useState","useCallback","useEffect","PropTypes","Provider","Select","SelectOptionPropTypes","ButtonLink","SearchForm","CardsGrid","searchValueIncluded","InputSwitch","style","FilterButton","props","context","selected","filter","onClick","skin","primarySkinColor","buttonProps","customStyle","backgroundColor","color","transition","width","label","contextTypes","childContextTypes","translate","propTypes","bool","string","func","AllCourses","courses","totalCourses","filters","sorting","options","onChange","list","loading","showCompleted","setShowCompleted","searchValue","setSearchValue","searchResults","setSearchResults","course","sortView","undefined","handleSearch","value","skill","title","handleSearchReset","handleShowCompletedToggle","toggledShowCompleted","progress","continueLearningWrapper","continueLearningTitle","continueLearningNumber","searchAndSortSection","searchWrapper","placeholder","sortSection","sortWrapper","filterWrapper","length","map","index","name","handleChange","filterButtonWrapper","divider","justifyContent","emptySearchResultContainer","emptySearchResultTitle","emptySearchResultDescription","emptySearchResultClearSearch","shape","number","arrayOf"],"sources":["../../../src/template/skill-detail/all-courses.js"],"sourcesContent":["import React, {useState, useCallback, useEffect} from 'react';\nimport PropTypes from 'prop-types';\nimport {get, getOr, sortBy} from 'lodash/fp';\nimport Provider from '../../atom/provider';\nimport Select, {SelectOptionPropTypes} from '../../atom/select';\nimport ButtonLink from '../../atom/button-link';\nimport SearchForm from '../../molecule/search-form';\nimport CardsGrid from '../../organism/cards-grid';\nimport searchValueIncluded from '../../util/search-value-included';\nimport InputSwitch from '../../atom/input-switch';\nimport style from './all-courses.css';\n\nconst FilterButton = (props, context) => {\n const {selected, filter, onClick} = props;\n const {skin} = context;\n const primarySkinColor = get('common.primary', skin);\n\n const buttonProps = {\n customStyle: {\n backgroundColor: selected ? primarySkinColor : '#E1E1E3',\n color: selected ? '#FFFFFF' : '#515161',\n transition: 'background-color 0.15s ease-in-out, color 0.15s ease-in-out',\n width: 'fit-content'\n },\n label: filter,\n onClick,\n 'data-name': 'filter-type-course-button'\n };\n\n return <ButtonLink {...buttonProps} />;\n};\n\nFilterButton.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nFilterButton.propTypes = {\n selected: PropTypes.bool,\n filter: PropTypes.string,\n onClick: PropTypes.func\n};\n\nconst AllCourses = (props, context) => {\n const {courses, totalCourses, filters, sorting} = props;\n const {options, onChange} = filters;\n const {list, loading} = courses;\n const {translate} = context;\n const [showCompleted, setShowCompleted] = useState(true);\n const [searchValue, setSearchValue] = useState('');\n const [searchResults, setSearchResults] = useState(\n sortBy(course => -getOr(0, ['progress'], course), list)\n );\n\n const sortView =\n sorting !== undefined ? (\n <div data-name=\"choice\">\n <Select {...sorting} aria-label=\"All courses sort\" />\n </div>\n ) : null;\n\n useEffect(() => {\n setSearchResults(sortBy(course => -getOr(0, ['progress'], course), list));\n }, [list]);\n\n const handleSearch = useCallback(\n value => {\n setSearchValue(value);\n setSearchResults(list.filter(skill => searchValueIncluded(skill.title, value)));\n },\n [list, setSearchValue, setSearchResults]\n );\n\n const handleSearchReset = useCallback(() => {\n setSearchValue('');\n setSearchResults(list);\n }, [list, setSearchValue, setSearchResults]);\n\n const handleShowCompletedToggle = useCallback(() => {\n const toggledShowCompleted = !showCompleted;\n setShowCompleted(toggledShowCompleted);\n if (toggledShowCompleted) {\n setSearchResults(list);\n handleSearchReset();\n } else {\n setSearchResults(searchResults.filter(skill => skill.progress < 100));\n }\n }, [list, searchResults, showCompleted, setShowCompleted, setSearchResults, handleSearchReset]);\n\n return (\n <>\n <div className={style.continueLearningWrapper}>\n <span className={style.continueLearningTitle}>{translate('all_courses')}</span>\n <span className={style.continueLearningNumber}>{totalCourses}</span>\n </div>\n <div className={style.searchAndSortSection}>\n <div className={style.searchWrapper}>\n <SearchForm\n search={{\n placeholder: translate('search_place_holder'),\n value: searchValue,\n onChange: handleSearch\n }}\n onReset={handleSearchReset}\n />\n </div>\n <div className={style.sortSection}>\n <InputSwitch\n id={'show-completed-courses-switch'}\n type=\"switch\"\n name={translate('show_completed')}\n title={translate('show_completed')}\n aria-label={'Show completed courses aria label'}\n value={showCompleted}\n onChange={handleShowCompletedToggle}\n />\n <div className={style.sortWrapper}>\n {translate('sort_by')}\n {sortView}\n </div>\n </div>\n </div>\n <div className={style.filterWrapper}>\n {options.length > 2 && searchResults.length > 0\n ? options.map((filter, index) => {\n const {name, value, selected} = filter;\n\n function handleChange() {\n onChange(value);\n handleSearchReset();\n }\n return (\n <div key={index} className={style.filterButtonWrapper}>\n <FilterButton selected={selected} filter={name} onClick={handleChange} />\n {value === 'ALL' ? <div className={style.divider} /> : null}\n </div>\n );\n })\n : null}\n </div>\n <div>\n {searchResults.length > 0 ? (\n <CardsGrid\n list={searchResults}\n loading={loading}\n customStyle={{justifyContent: 'left'}}\n />\n ) : (\n <div className={style.emptySearchResultContainer}>\n <div className={style.emptySearchResultTitle}>\n {translate('empty_search_result_title', {searchValue})}\n </div>\n <div className={style.emptySearchResultDescription}>\n {translate('empty_search_result_description')}\n </div>\n <div className={style.emptySearchResultClearSearch} onClick={handleSearchReset}>\n {translate('empty_search_result_clear_search')}\n </div>\n </div>\n )}\n </div>\n </>\n );\n};\n\nAllCourses.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nAllCourses.propTypes = {\n courses: PropTypes.shape(CardsGrid.propTypes),\n totalCourses: PropTypes.number,\n filters: PropTypes.shape({\n onChange: PropTypes.func,\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes))\n }),\n sorting: PropTypes.shape(Select.propTypes)\n};\n\nexport default AllCourses;\n"],"mappings":";;;;;;AAAA,OAAOA,KAAP,IAAeC,QAAf,EAAyBC,WAAzB,EAAsCC,SAAtC,QAAsD,OAAtD;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,OAAOC,QAAP,MAAqB,qBAArB;AACA,OAAOC,MAAP,IAAgBC,qBAAhB,QAA4C,mBAA5C;AACA,OAAOC,UAAP,MAAuB,wBAAvB;AACA,OAAOC,UAAP,MAAuB,4BAAvB;AACA,OAAOC,SAAP,MAAsB,2BAAtB;AACA,OAAOC,mBAAP,MAAgC,kCAAhC;AACA,OAAOC,WAAP,MAAwB,yBAAxB;AACA,OAAOC,KAAP,MAAkB,mBAAlB;;AAEA,MAAMC,YAAY,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EACvC,MAAM;IAACC,QAAD;IAAWC,MAAX;IAAmBC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QAAQ,CAACyB,iBAAT,CAA2BC;AAFd,CAA1B;AAKAK,UAAU,CAACJ,SAAX,2CAAuB;EACrBK,OAAO,EAAEjC,SAAS,CAAC+E,KAAV,CAAgBzE,SAAS,CAACsB,SAA1B,CADY;EAErBM,YAAY,EAAElC,SAAS,CAACgF,MAFH;EAGrB7C,OAAO,EAAEnC,SAAS,CAAC+E,KAAV,CAAgB;IACvBzC,QAAQ,EAAEtC,SAAS,CAAC+B,IADG;IAEvBM,OAAO,EAAErC,SAAS,CAACiF,OAAV,CAAkBjF,SAAS,CAAC+E,KAAV,CAAgB5E,qBAAhB,CAAlB;EAFc,CAAhB,CAHY;EAOrBiC,OAAO,EAAEpC,SAAS,CAAC+E,KAAV,CAAgB7E,MAAM,CAAC0B,SAAvB;AAPY,CAAvB;AAUA,eAAeI,UAAf"}
|
|
@@ -10,7 +10,6 @@ declare namespace DisciplineAssociatedSkills {
|
|
|
10
10
|
locale: PropTypes.Requireable<string>;
|
|
11
11
|
focused: PropTypes.Requireable<boolean>;
|
|
12
12
|
}> | null | undefined)[]>;
|
|
13
|
-
const skillsBaseUrl: PropTypes.Requireable<string>;
|
|
14
13
|
const onSkillClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
15
14
|
}
|
|
16
15
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/discipline-associated-skills/index.js"],"names":[],"mappings":";AAUA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/discipline-associated-skills/index.js"],"names":[],"mappings":";AAUA,0FAyEC"}
|
|
@@ -35,10 +35,8 @@ const DisciplineAssociatedSkills = (props, context) => {
|
|
|
35
35
|
} = context;
|
|
36
36
|
const {
|
|
37
37
|
skills = [],
|
|
38
|
-
skillsBaseUrl,
|
|
39
38
|
onSkillClick
|
|
40
39
|
} = props;
|
|
41
|
-
const hrefFormat = (0, _react.useCallback)(skill => skillsBaseUrl ? `${skillsBaseUrl}/${skill.ref}` : '', [skillsBaseUrl]);
|
|
42
40
|
const AnchorElement = (0, _react.useCallback)(skill => /*#__PURE__*/_react.default.createElement("div", {
|
|
43
41
|
className: _style.default.chipFocusedContent
|
|
44
42
|
}, skill.focused ? /*#__PURE__*/_react.default.createElement(_icon.default, {
|
|
@@ -61,9 +59,8 @@ const DisciplineAssociatedSkills = (props, context) => {
|
|
|
61
59
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
62
60
|
className: _style.default.chipsWrapper
|
|
63
61
|
}, skills.map(skill => {
|
|
64
|
-
function handleSkillClick(
|
|
65
|
-
|
|
66
|
-
onSkillClick();
|
|
62
|
+
function handleSkillClick() {
|
|
63
|
+
onSkillClick(skill.ref);
|
|
67
64
|
}
|
|
68
65
|
|
|
69
66
|
function handleAnchorElement() {
|
|
@@ -74,8 +71,7 @@ const DisciplineAssociatedSkills = (props, context) => {
|
|
|
74
71
|
return TooltipContentElement(skill);
|
|
75
72
|
}
|
|
76
73
|
|
|
77
|
-
return /*#__PURE__*/_react.default.createElement("
|
|
78
|
-
href: hrefFormat(skill),
|
|
74
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
79
75
|
key: (0, _uniqueId2.default)(),
|
|
80
76
|
className: (0, _classnames.default)(_style.default.chipWrapper, skill.focused && _style.default.chipWrapperFocused),
|
|
81
77
|
onClick: handleSkillClick
|
|
@@ -100,7 +96,6 @@ DisciplineAssociatedSkills.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
100
96
|
locale: _propTypes.default.string,
|
|
101
97
|
focused: _propTypes.default.bool
|
|
102
98
|
})),
|
|
103
|
-
skillsBaseUrl: _propTypes.default.string,
|
|
104
99
|
onSkillClick: _propTypes.default.func
|
|
105
100
|
} : {};
|
|
106
101
|
var _default = DisciplineAssociatedSkills;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["DisciplineAssociatedSkills","props","context","translate","skills","
|
|
1
|
+
{"version":3,"file":"index.js","names":["DisciplineAssociatedSkills","props","context","translate","skills","onSkillClick","AnchorElement","useCallback","skill","style","chipFocusedContent","focused","faSize","wrapperSize","chipFocusedContentText","locale","TooltipContentElement","tooltipContentWrapper","associatedSkillsWrapper","chipsWrapper","map","handleSkillClick","ref","handleAnchorElement","handleTooltipContentElement","classnames","chipWrapper","chipWrapperFocused","infoIconTooltip","tooltipSkillFocused","tooltip","contextTypes","Provider","childContextTypes","propTypes","PropTypes","arrayOf","shape","string","bool","func"],"sources":["../../../src/molecule/discipline-associated-skills/index.js"],"sourcesContent":["import React, {useCallback} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {isEmpty, uniqueId} from 'lodash/fp';\nimport Icon from '../../atom/icon';\nimport ToolTip from '../../atom/tooltip';\nimport Provider from '../../atom/provider';\nimport CatalogSection from '../../atom/catalog-section';\nimport style from './style.css';\n\nconst DisciplineAssociatedSkills = (props, context) => {\n const {translate} = context;\n\n const {skills = [], onSkillClick} = props;\n\n const AnchorElement = useCallback(\n skill => (\n <div className={style.chipFocusedContent}>\n {skill.focused ? (\n <Icon\n iconName=\"bullseye-arrow\"\n size={{\n faSize: 12,\n wrapperSize: 12\n }}\n />\n ) : null}\n <div className={style.chipFocusedContentText}>{skill.locale}</div>\n </div>\n ),\n []\n );\n\n const TooltipContentElement = useCallback(\n skill => (\n <div className={style.tooltipContentWrapper}>\n {skill.focused ? (\n <div>\n <b>{translate('skill_focused_chip_tooltip')}</b>\n </div>\n ) : null}\n <div>{skill.locale}</div>\n </div>\n ),\n [translate]\n );\n\n return !isEmpty(skills) ? (\n <div data-name=\"discipline-associated-skills\" className={style.associatedSkillsWrapper}>\n <CatalogSection title={translate('associated_skills')}>\n <div className={style.chipsWrapper}>\n {skills.map(skill => {\n function handleSkillClick() {\n onSkillClick(skill.ref);\n }\n function handleAnchorElement() {\n return AnchorElement(skill);\n }\n function handleTooltipContentElement() {\n return TooltipContentElement(skill);\n }\n return (\n <div\n key={uniqueId()}\n className={classnames(style.chipWrapper, skill.focused && style.chipWrapperFocused)}\n onClick={handleSkillClick}\n >\n <ToolTip\n AnchorElement={handleAnchorElement}\n fontSize={12}\n delayHide={0}\n iconContainerClassName={style.infoIconTooltip}\n tooltipClassName={skill.focused ? style.tooltipSkillFocused : style.tooltip}\n TooltipContent={handleTooltipContentElement}\n closeToolTipInformationTextAriaLabel={translate('close_tooltip_information')}\n />\n </div>\n );\n })}\n </div>\n </CatalogSection>\n </div>\n ) : null;\n};\n\nDisciplineAssociatedSkills.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nDisciplineAssociatedSkills.propTypes = {\n skills: PropTypes.arrayOf(\n PropTypes.shape({\n ref: PropTypes.string,\n locale: PropTypes.string,\n focused: PropTypes.bool\n })\n ),\n onSkillClick: PropTypes.func\n};\n\nexport default DisciplineAssociatedSkills;\n"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAEA,MAAMA,0BAA0B,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EACrD,MAAM;IAACC;EAAD,IAAcD,OAApB;EAEA,MAAM;IAACE,MAAM,GAAG,EAAV;IAAcC;EAAd,IAA8BJ,KAApC;EAEA,MAAMK,aAAa,GAAG,IAAAC,kBAAA,EACpBC,KAAK,iBACH;IAAK,SAAS,EAAEC,cAAA,CAAMC;EAAtB,GACGF,KAAK,CAACG,OAAN,gBACC,6BAAC,aAAD;IACE,QAAQ,EAAC,gBADX;IAEE,IAAI,EAAE;MACJC,MAAM,EAAE,EADJ;MAEJC,WAAW,EAAE;IAFT;EAFR,EADD,GAQG,IATN,eAUE;IAAK,SAAS,EAAEJ,cAAA,CAAMK;EAAtB,GAA+CN,KAAK,CAACO,MAArD,CAVF,CAFkB,EAepB,EAfoB,CAAtB;EAkBA,MAAMC,qBAAqB,GAAG,IAAAT,kBAAA,EAC5BC,KAAK,iBACH;IAAK,SAAS,EAAEC,cAAA,CA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AAoCD,CAzED;;AA2EAH,0BAA0B,CAAC+B,YAA3B,GAA0C;EACxC5B,SAAS,EAAE6B,iBAAA,CAASC,iBAAT,CAA2B9B;AADE,CAA1C;AAIAH,0BAA0B,CAACkC,SAA3B,2CAAuC;EACrC9B,MAAM,EAAE+B,kBAAA,CAAUC,OAAV,CACND,kBAAA,CAAUE,KAAV,CAAgB;IACdf,GAAG,EAAEa,kBAAA,CAAUG,MADD;IAEdvB,MAAM,EAAEoB,kBAAA,CAAUG,MAFJ;IAGd3B,OAAO,EAAEwB,kBAAA,CAAUI;EAHL,CAAhB,CADM,CAD6B;EAQrClC,YAAY,EAAE8B,kBAAA,CAAUK;AARa,CAAvC;eAWexC,0B"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export default ProgressWrapper;
|
|
2
|
-
declare function ProgressWrapper({
|
|
2
|
+
declare function ProgressWrapper({ completedCourses, completedModules, title, subtitle, progression, sections }: {
|
|
3
|
+
completedCourses: any;
|
|
3
4
|
completedModules: any;
|
|
4
|
-
mandatoryModules: any;
|
|
5
5
|
title: any;
|
|
6
6
|
subtitle: any;
|
|
7
7
|
progression: any;
|
|
@@ -14,12 +14,13 @@ declare namespace ProgressWrapper {
|
|
|
14
14
|
namespace propTypes {
|
|
15
15
|
const title: PropTypes.Requireable<string>;
|
|
16
16
|
const subtitle: PropTypes.Requireable<string>;
|
|
17
|
+
const completedCourses: PropTypes.Requireable<number>;
|
|
17
18
|
const completedModules: PropTypes.Requireable<number>;
|
|
18
|
-
const mandatoryModules: PropTypes.Requireable<number>;
|
|
19
19
|
const progression: PropTypes.Requireable<number>;
|
|
20
20
|
const sections: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
21
21
|
type: PropTypes.Requireable<string>;
|
|
22
|
-
|
|
22
|
+
badgeUrl: PropTypes.Requireable<string>;
|
|
23
|
+
onDownload: PropTypes.Requireable<(...args: any[]) => any>;
|
|
23
24
|
stars: PropTypes.Requireable<number>;
|
|
24
25
|
}> | null | undefined)[]>;
|
|
25
26
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/progress-wrapper/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/progress-wrapper/index.js"],"names":[],"mappings":";AAyFA;;;;;;;8BA8DC"}
|
|
@@ -5,6 +5,8 @@ exports.default = void 0;
|
|
|
5
5
|
|
|
6
6
|
var _map2 = _interopRequireDefault(require("lodash/fp/map"));
|
|
7
7
|
|
|
8
|
+
var _lowerCase2 = _interopRequireDefault(require("lodash/fp/lowerCase"));
|
|
9
|
+
|
|
8
10
|
var _isEmpty2 = _interopRequireDefault(require("lodash/fp/isEmpty"));
|
|
9
11
|
|
|
10
12
|
var _react = _interopRequireDefault(require("react"));
|
|
@@ -39,7 +41,8 @@ const DetailSection = ({
|
|
|
39
41
|
index,
|
|
40
42
|
type,
|
|
41
43
|
isLocked,
|
|
42
|
-
|
|
44
|
+
badgeUrl,
|
|
45
|
+
onDownload,
|
|
43
46
|
stars
|
|
44
47
|
}, context) => {
|
|
45
48
|
const {
|
|
@@ -49,10 +52,7 @@ const DetailSection = ({
|
|
|
49
52
|
|
|
50
53
|
const DownloadButton = /*#__PURE__*/_react.default.createElement(_buttonLink.default, {
|
|
51
54
|
label: translate('download'),
|
|
52
|
-
|
|
53
|
-
target: '_blank',
|
|
54
|
-
href: downloadUrl
|
|
55
|
-
},
|
|
55
|
+
onClick: onDownload,
|
|
56
56
|
"data-name": "download-button",
|
|
57
57
|
"aria-label": "download button",
|
|
58
58
|
customStyle: {
|
|
@@ -106,7 +106,7 @@ const DetailSection = ({
|
|
|
106
106
|
className: _style.default[`detailsSection${index}`]
|
|
107
107
|
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
108
108
|
className: _style.default.img,
|
|
109
|
-
src:
|
|
109
|
+
src: badgeUrl || 'https://s3.eu-west-1.amazonaws.com/static.coorpacademy.com/assets/images/diploma.svg'
|
|
110
110
|
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
111
111
|
className: _style.default.detailsInfo
|
|
112
112
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -119,8 +119,8 @@ const DetailSection = ({
|
|
|
119
119
|
};
|
|
120
120
|
|
|
121
121
|
const ProgressWrapper = ({
|
|
122
|
+
completedCourses,
|
|
122
123
|
completedModules,
|
|
123
|
-
mandatoryModules,
|
|
124
124
|
title,
|
|
125
125
|
subtitle,
|
|
126
126
|
progression,
|
|
@@ -129,7 +129,7 @@ const ProgressWrapper = ({
|
|
|
129
129
|
const {
|
|
130
130
|
translate
|
|
131
131
|
} = context;
|
|
132
|
-
const
|
|
132
|
+
const modulesCompletedLocal = translate('modules_completed');
|
|
133
133
|
const isLocked = progression !== 100;
|
|
134
134
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
135
135
|
className: _style.default.container
|
|
@@ -146,7 +146,13 @@ const ProgressWrapper = ({
|
|
|
146
146
|
className: _style.default.stats
|
|
147
147
|
}, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("span", {
|
|
148
148
|
className: _style.default.statsNumber
|
|
149
|
-
},
|
|
149
|
+
}, completedCourses), (0, _lowerCase2.default)(translate('courses_completed'))), /*#__PURE__*/_react.default.createElement("div", {
|
|
150
|
+
className: _style.default.divider
|
|
151
|
+
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
152
|
+
className: _style.default.statsModule
|
|
153
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
154
|
+
className: _style.default.statsNumber
|
|
155
|
+
}, completedModules), modulesCompletedLocal)), /*#__PURE__*/_react.default.createElement("div", {
|
|
150
156
|
className: _style.default.progression
|
|
151
157
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
152
158
|
className: _style.default.statsNumber
|
|
@@ -159,19 +165,27 @@ const ProgressWrapper = ({
|
|
|
159
165
|
value: progression,
|
|
160
166
|
max: 100
|
|
161
167
|
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
168
|
+
className: _style.default.statsMobile
|
|
169
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
170
|
+
className: _style.default.statsModuleMobile
|
|
171
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
172
|
+
className: _style.default.statsNumber
|
|
173
|
+
}, completedModules), modulesCompletedLocal), /*#__PURE__*/_react.default.createElement("div", {
|
|
162
174
|
className: _style.default.statsProgressionMobile
|
|
163
175
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
164
176
|
className: _style.default.statsNumber
|
|
165
|
-
}, progression, "%")), (0, _isEmpty2.default)(sections) ? null : /*#__PURE__*/_react.default.createElement("div", {
|
|
177
|
+
}, progression, "%"))), (0, _isEmpty2.default)(sections) ? null : /*#__PURE__*/_react.default.createElement("div", {
|
|
166
178
|
className: _style.default.details
|
|
167
179
|
}, uncappedMap(({
|
|
168
180
|
type,
|
|
169
181
|
stars,
|
|
170
|
-
|
|
182
|
+
badgeUrl,
|
|
183
|
+
onDownload
|
|
171
184
|
}, index) => /*#__PURE__*/_react.default.createElement(DetailSection, {
|
|
172
185
|
type,
|
|
173
186
|
isLocked,
|
|
174
|
-
|
|
187
|
+
badgeUrl,
|
|
188
|
+
onDownload,
|
|
175
189
|
stars,
|
|
176
190
|
key: `${type}-${index}`,
|
|
177
191
|
index: index
|
|
@@ -180,7 +194,8 @@ const ProgressWrapper = ({
|
|
|
180
194
|
|
|
181
195
|
const commonDetailSectionPropTypes = process.env.NODE_ENV !== "production" ? {
|
|
182
196
|
type: _propTypes.default.oneOf(['diploma', 'badge', 'stars']),
|
|
183
|
-
|
|
197
|
+
badgeUrl: _propTypes.default.string,
|
|
198
|
+
onDownload: _propTypes.default.func,
|
|
184
199
|
stars: _propTypes.default.number
|
|
185
200
|
} : {};
|
|
186
201
|
DetailSection.contextTypes = {
|
|
@@ -196,8 +211,8 @@ ProgressWrapper.contextTypes = {
|
|
|
196
211
|
ProgressWrapper.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
197
212
|
title: _propTypes.default.string,
|
|
198
213
|
subtitle: _propTypes.default.string,
|
|
214
|
+
completedCourses: _propTypes.default.number,
|
|
199
215
|
completedModules: _propTypes.default.number,
|
|
200
|
-
mandatoryModules: _propTypes.default.number,
|
|
201
216
|
progression: _propTypes.default.number,
|
|
202
217
|
sections: _propTypes.default.arrayOf(_propTypes.default.shape(commonDetailSectionPropTypes))
|
|
203
218
|
} : {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["uncappedMap","convert","cap","DetailSection","index","type","isLocked","downloadUrl","stars","context","translate","isTypeStars","DownloadButton","target","href","backgroundColor","color","position","faIcon","name","size","customStyle","padding","LockedTag","iconName","iconColor","preset","style","detailsInfo","detailsInfoText","detailsTitle","img","buttonContainer","ProgressWrapper","completedModules","mandatoryModules","title","subtitle","progression","sections","mandatoryCompletedModulesLocal","container","titleContainer","statscontainer","stats","statsNumber","customProgressBar","COLORS","positive","statsProgressionMobile","details","commonDetailSectionPropTypes","PropTypes","oneOf","string","number","contextTypes","Provider","childContextTypes","propTypes","bool","arrayOf","shape"],"sources":["../../../src/molecule/progress-wrapper/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {isEmpty, map} from 'lodash/fp';\nimport Title from '../../atom/title';\nimport ProgressBar from '../progress-bar';\nimport {COLORS} from '../../variables/colors';\nimport Tag from '../../atom/tag';\nimport ButtonLink from '../../atom/button-link';\nimport Icon from '../../atom/icon';\nimport Provider from '../../atom/provider';\n// eslint-disable-next-line css-modules/no-unused-class\nimport style from './style.css';\n\nconst uncappedMap = map.convert({cap: false});\n\nconst DetailSection = ({index, type, isLocked, downloadUrl, stars}, context) => {\n const {translate} = context;\n const isTypeStars = type === 'stars';\n\n const DownloadButton = (\n <ButtonLink\n label={translate('download')}\n link={{\n target: '_blank',\n href: downloadUrl\n }}\n data-name=\"download-button\"\n aria-label=\"download button\"\n customStyle={{backgroundColor: '#F1F6FE', color: '#0061FF'}}\n icon={{\n position: 'left',\n faIcon: {\n name: 'download',\n color: '#0061FF',\n size: 14,\n customStyle: {padding: 0}\n }\n }}\n disabled={isLocked}\n />\n );\n\n const LockedTag = (\n <Tag\n label=\"Locked\"\n size=\"S\"\n icon={{\n position: 'left',\n iconName: 'lock',\n iconColor: '#515161',\n preset: 's',\n customStyle: {padding: 0}\n }}\n />\n );\n\n return isTypeStars ? (\n <div className={style[`detailsSection${index}`]}>\n <div className={style.detailsInfo}>\n <div className={style.detailsInfoText}>\n <span className={style.detailsTitle}>{translate('bonus_stars')}</span>\n {isLocked ? LockedTag : null}\n </div>\n <div className={style.stars}>\n <Icon iconName=\"star\" iconColor=\"#FFCE0A\" backgroundColor=\"#FFF9D1\" preset=\"xl\" />\n <span>{stars}</span>\n </div>\n </div>\n </div>\n ) : (\n <div className={style[`detailsSection${index}`]}>\n <img\n className={style.img}\n src={\n type === 'badge'\n ? downloadUrl\n : 'https://s3.eu-west-1.amazonaws.com/static.coorpacademy.com/assets/images/diploma.svg'\n }\n />\n <div className={style.detailsInfo}>\n <div className={style.detailsInfoText}>\n <span className={style.detailsTitle}>\n {type === 'diploma' ? translate('diploma') : translate('badge')}\n </span>\n {isLocked ? LockedTag : null}\n </div>\n\n <div className={style.buttonContainer}>{DownloadButton}</div>\n </div>\n </div>\n );\n};\n\nconst ProgressWrapper = (\n {completedModules, mandatoryModules, title, subtitle, progression, sections},\n context\n) => {\n const {translate} = context;\n const mandatoryCompletedModulesLocal = translate('modules_completed_mandatory');\n const isLocked = progression !== 100;\n\n return (\n <div className={style.container}>\n <div className={style.titleContainer}>\n <Title type=\"form-group\" titleSize=\"medium\" title={title} subtitle={subtitle} />\n </div>\n <div className={style.statscontainer}>\n <div className={style.stats}>\n <div>\n <span className={style.statsNumber}>\n {`${\n completedModules > mandatoryModules ? mandatoryModules : completedModules\n } / ${mandatoryModules}`}\n </span>\n {mandatoryCompletedModulesLocal}\n </div>\n </div>\n <div className={style.progression}>\n <span className={style.statsNumber}>{progression}%</span>\n </div>\n </div>\n <ProgressBar\n className={style.customProgressBar}\n style={{backgroundColor: COLORS.positive}}\n displayInfo={false}\n value={progression}\n max={100}\n />\n <div className={style.statsProgressionMobile}>\n <span className={style.statsNumber}>{progression}%</span>\n </div>\n\n {isEmpty(sections) ? null : (\n <div className={style.details}>\n {uncappedMap(\n ({type, stars, downloadUrl}, index) => (\n <DetailSection\n {...{type, isLocked, downloadUrl, stars}}\n key={`${type}-${index}`}\n index={index}\n />\n ),\n sections\n )}\n </div>\n )}\n </div>\n );\n};\n\nconst commonDetailSectionPropTypes = {\n type: PropTypes.oneOf(['diploma', 'badge', 'stars']),\n downloadUrl: PropTypes.string,\n stars: PropTypes.number\n};\n\nDetailSection.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nDetailSection.propTypes = {\n index: PropTypes.number,\n isLocked: PropTypes.bool,\n ...commonDetailSectionPropTypes\n};\n\nProgressWrapper.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nProgressWrapper.propTypes = {\n title: PropTypes.string,\n subtitle: PropTypes.string,\n completedModules: PropTypes.number,\n mandatoryModules: PropTypes.number,\n progression: PropTypes.number,\n sections: PropTypes.arrayOf(PropTypes.shape(commonDetailSectionPropTypes))\n};\n\nexport default ProgressWrapper;\n"],"mappings":";;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;;;;;AAEA,MAAMA,WAAW,GAAG,cAAIC,OAAJ,CAAY;EAACC,GAAG,EAAE;AAAN,CAAZ,CAApB;;AAEA,MAAMC,aAAa,GAAG,CAAC;EAACC,KAAD;EAAQC,IAAR;EAAcC,QAAd;EAAwBC,WAAxB;EAAqCC;AAArC,CAAD,EAA8CC,OAA9C,KAA0D;EAC9E,MAAM;IAACC;EAAD,IAAcD,OAApB;EACA,MAAME,WAAW,GAAGN,IAAI,KAAK,OAA7B;;EAEA,MAAMO,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aAAa,CAACqD,YAAd,GAA6B;EAC3B9C,SAAS,EAAE+C,iBAAA,CAASC,iBAAT,CAA2BhD;AADX,CAA7B;AAIAP,aAAa,CAACwD,SAAd;EACEvD,KAAK,EAAEgD,kBAAA,CAAUG,MADnB;EAEEjD,QAAQ,EAAE8C,kBAAA,CAAUQ;AAFtB,GAGKT,4BAHL;AAMAlB,eAAe,CAACuB,YAAhB,GAA+B;EAC7B9C,SAAS,EAAE+C,iBAAA,CAASC,iBAAT,CAA2BhD;AADT,CAA/B;AAIAuB,eAAe,CAAC0B,SAAhB,2CAA4B;EAC1BvB,KAAK,EAAEgB,kBAAA,CAAUE,MADS;EAE1BjB,QAAQ,EAAEe,kBAAA,CAAUE,MAFM;EAG1BpB,gBAAgB,EAAEkB,kBAAA,CAAUG,MAHF;EAI1BpB,gBAAgB,EAAEiB,kBAAA,CAAUG,MAJF;EAK1BjB,WAAW,EAAEc,kBAAA,CAAUG,MALG;EAM1BhB,QAAQ,EAAEa,kBAAA,CAAUS,OAAV,CAAkBT,kBAAA,CAAUU,KAAV,CAAgBX,4BAAhB,CAAlB;AANgB,CAA5B;eASelB,e"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["uncappedMap","convert","cap","DetailSection","index","type","isLocked","badgeUrl","onDownload","stars","context","translate","isTypeStars","DownloadButton","backgroundColor","color","position","faIcon","name","size","customStyle","padding","LockedTag","iconName","iconColor","preset","style","detailsInfo","detailsInfoText","detailsTitle","img","buttonContainer","ProgressWrapper","completedCourses","completedModules","title","subtitle","progression","sections","modulesCompletedLocal","container","titleContainer","statscontainer","stats","statsNumber","divider","statsModule","customProgressBar","COLORS","positive","statsMobile","statsModuleMobile","statsProgressionMobile","details","commonDetailSectionPropTypes","PropTypes","oneOf","string","func","number","contextTypes","Provider","childContextTypes","propTypes","bool","arrayOf","shape"],"sources":["../../../src/molecule/progress-wrapper/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {isEmpty, lowerCase, map} from 'lodash/fp';\nimport Title from '../../atom/title';\nimport ProgressBar from '../progress-bar';\nimport {COLORS} from '../../variables/colors';\nimport Tag from '../../atom/tag';\nimport ButtonLink from '../../atom/button-link';\nimport Icon from '../../atom/icon';\nimport Provider from '../../atom/provider';\n// eslint-disable-next-line css-modules/no-unused-class\nimport style from './style.css';\n\nconst uncappedMap = map.convert({cap: false});\n\nconst DetailSection = ({index, type, isLocked, badgeUrl, onDownload, stars}, context) => {\n const {translate} = context;\n const isTypeStars = type === 'stars';\n\n const DownloadButton = (\n <ButtonLink\n label={translate('download')}\n onClick={onDownload}\n data-name=\"download-button\"\n aria-label=\"download button\"\n customStyle={{backgroundColor: '#F1F6FE', color: '#0061FF'}}\n icon={{\n position: 'left',\n faIcon: {\n name: 'download',\n color: '#0061FF',\n size: 14,\n customStyle: {padding: 0}\n }\n }}\n disabled={isLocked}\n />\n );\n\n const LockedTag = (\n <Tag\n label=\"Locked\"\n size=\"S\"\n icon={{\n position: 'left',\n iconName: 'lock',\n iconColor: '#515161',\n preset: 's',\n customStyle: {padding: 0}\n }}\n />\n );\n\n return isTypeStars ? (\n <div className={style[`detailsSection${index}`]}>\n <div className={style.detailsInfo}>\n <div className={style.detailsInfoText}>\n <span className={style.detailsTitle}>{translate('bonus_stars')}</span>\n {isLocked ? LockedTag : null}\n </div>\n <div className={style.stars}>\n <Icon iconName=\"star\" iconColor=\"#FFCE0A\" backgroundColor=\"#FFF9D1\" preset=\"xl\" />\n <span>{stars}</span>\n </div>\n </div>\n </div>\n ) : (\n <div className={style[`detailsSection${index}`]}>\n <img\n className={style.img}\n src={\n badgeUrl ||\n 'https://s3.eu-west-1.amazonaws.com/static.coorpacademy.com/assets/images/diploma.svg'\n }\n />\n <div className={style.detailsInfo}>\n <div className={style.detailsInfoText}>\n <span className={style.detailsTitle}>\n {type === 'diploma' ? translate('diploma') : translate('badge')}\n </span>\n {isLocked ? LockedTag : null}\n </div>\n\n <div className={style.buttonContainer}>{DownloadButton}</div>\n </div>\n </div>\n );\n};\n\nconst ProgressWrapper = (\n {completedCourses, completedModules, title, subtitle, progression, sections},\n context\n) => {\n const {translate} = context;\n const modulesCompletedLocal = translate('modules_completed');\n const isLocked = progression !== 100;\n\n return (\n <div className={style.container}>\n <div className={style.titleContainer}>\n <Title type=\"form-group\" titleSize=\"medium\" title={title} subtitle={subtitle} />\n </div>\n <div className={style.statscontainer}>\n <div className={style.stats}>\n <div>\n <span className={style.statsNumber}>{completedCourses}</span>\n {lowerCase(translate('courses_completed'))}\n </div>\n <div className={style.divider} />\n <div className={style.statsModule}>\n <span className={style.statsNumber}>{completedModules}</span>\n {modulesCompletedLocal}\n </div>\n </div>\n <div className={style.progression}>\n <span className={style.statsNumber}>{progression}%</span>\n </div>\n </div>\n <ProgressBar\n className={style.customProgressBar}\n style={{backgroundColor: COLORS.positive}}\n displayInfo={false}\n value={progression}\n max={100}\n />\n <div className={style.statsMobile}>\n <div className={style.statsModuleMobile}>\n <span className={style.statsNumber}>{completedModules}</span>\n {modulesCompletedLocal}\n </div>\n <div className={style.statsProgressionMobile}>\n <span className={style.statsNumber}>{progression}%</span>\n </div>\n </div>\n\n {isEmpty(sections) ? null : (\n <div className={style.details}>\n {uncappedMap(\n ({type, stars, badgeUrl, onDownload}, index) => (\n <DetailSection\n {...{type, isLocked, badgeUrl, onDownload, stars}}\n key={`${type}-${index}`}\n index={index}\n />\n ),\n sections\n )}\n </div>\n )}\n </div>\n );\n};\n\nconst commonDetailSectionPropTypes = {\n type: PropTypes.oneOf(['diploma', 'badge', 'stars']),\n badgeUrl: PropTypes.string,\n onDownload: PropTypes.func,\n stars: PropTypes.number\n};\n\nDetailSection.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nDetailSection.propTypes = {\n index: PropTypes.number,\n isLocked: PropTypes.bool,\n ...commonDetailSectionPropTypes\n};\n\nProgressWrapper.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nProgressWrapper.propTypes = {\n title: PropTypes.string,\n subtitle: PropTypes.string,\n completedCourses: PropTypes.number,\n completedModules: PropTypes.number,\n progression: PropTypes.number,\n sections: PropTypes.arrayOf(PropTypes.shape(commonDetailSectionPropTypes))\n};\n\nexport default ProgressWrapper;\n"],"mappings":";;;;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;;;;;AAEA,MAAMA,WAAW,GAAG,cAAIC,OAAJ,CAAY;EAACC,GAAG,EAAE;AAAN,CAAZ,CAApB;;AAEA,MAAMC,aAAa,GAAG,CAAC;EAACC,KAAD;EAAQC,IAAR;EAAcC,QAAd;EAAwBC,QAAxB;EAAkCC,UAAlC;EAA8CC;AAA9C,CAAD,EAAuDC,OAAvD,KAAmE;EACvF,MAAM;IAACC;EAAD,IAAcD,OAApB;EACA,MAAME,WAAW,GAAGP,IAAI,KAAK,OAA7B;;EAEA,MAAMQ,cAAc,gBAClB,6BAAC,mBAAD;IACE,KAAK,EAAEF,SAAS,CAAC,UAAD,CADlB;IAEE,OAAO,EAAEH,UAFX;IAGE,aAAU,iBAHZ;IAIE,cAAW,iBAJb;IAKE,WAAW,EAAE;MAACM,eAAe,EAAE,SAAlB;MAA6BC,KAAK,EAAE;IAApC,CALf;IAME,IAAI,EAAE;MACJC,QAAQ,EAAE,MADN;MAEJC,MAAM,EAAE;QACNC,IAAI,EAAE,UADA;QAENH,KAAK,EAAE,SAFD;QAGNI,IAAI,EAAE,EAHA;QAINC,WAAW,EAAE;UAACC,OAAO,EAAE;QAAV;MAJP;IAFJ,CANR;IAeE,QAAQ,EAAEf;EAfZ,EADF;;EAoBA,MAAMgB,SAAS,gBACb,6BAAC,YAAD;IACE,KAAK,EAAC,QADR;IAEE,IAAI,EAAC,GAFP;IAGE,IAAI,EAAE;MACJN,QAAQ,EAAE,MADN;MAEJO,QAAQ,EAAE,MAFN;MAGJC,SAAS,EAAE,SAHP;MAIJC,MAAM,EAAE,GAJJ;MAKJL,WAAW,EAAE;QAACC,OAAO,EAAE;MAAV;IALT;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