@coorpacademy/components 11.32.20-alpha.36 → 11.32.20-alpha.39
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/dashboard/cards-list/index.d.ts +8 -2
- package/es/molecule/dashboard/cards-list/index.d.ts.map +1 -1
- package/es/molecule/dashboard/cards-list/index.js +5 -3
- package/es/molecule/dashboard/cards-list/index.js.map +1 -1
- package/es/molecule/learning-priority-card/index.d.ts +1 -3
- package/es/molecule/learning-priority-card/index.d.ts.map +1 -1
- package/es/molecule/learning-priority-card/index.js +1 -3
- package/es/molecule/learning-priority-card/index.js.map +1 -1
- package/es/molecule/learning-priority-card/types.d.ts +2 -6
- package/es/molecule/learning-priority-card/types.d.ts.map +1 -1
- package/es/molecule/learning-priority-card/types.js +1 -3
- package/es/molecule/learning-priority-card/types.js.map +1 -1
- package/es/template/app-player/popin-end/index.d.ts +8 -2
- package/es/template/app-player/popin-end/summary.d.ts +8 -2
- package/es/template/common/dashboard/index.d.ts.map +1 -1
- package/es/template/common/dashboard/index.js +26 -7
- package/es/template/common/dashboard/index.js.map +1 -1
- package/es/template/common/search-page/index.d.ts +8 -2
- package/es/template/my-learning/index.d.ts +87 -17
- package/es/template/my-learning/index.d.ts.map +1 -1
- package/es/template/my-learning/index.js +23 -14
- package/es/template/my-learning/index.js.map +1 -1
- package/es/template/teams-dashboard/index.d.ts +8 -2
- package/lib/molecule/dashboard/cards-list/index.d.ts +8 -2
- package/lib/molecule/dashboard/cards-list/index.d.ts.map +1 -1
- package/lib/molecule/dashboard/cards-list/index.js +5 -3
- package/lib/molecule/dashboard/cards-list/index.js.map +1 -1
- package/lib/molecule/learning-priority-card/index.d.ts +1 -3
- package/lib/molecule/learning-priority-card/index.d.ts.map +1 -1
- package/lib/molecule/learning-priority-card/index.js +1 -3
- package/lib/molecule/learning-priority-card/index.js.map +1 -1
- package/lib/molecule/learning-priority-card/types.d.ts +2 -6
- package/lib/molecule/learning-priority-card/types.d.ts.map +1 -1
- package/lib/molecule/learning-priority-card/types.js +1 -3
- package/lib/molecule/learning-priority-card/types.js.map +1 -1
- package/lib/template/app-player/popin-end/index.d.ts +8 -2
- package/lib/template/app-player/popin-end/summary.d.ts +8 -2
- package/lib/template/common/dashboard/index.d.ts.map +1 -1
- package/lib/template/common/dashboard/index.js +27 -7
- package/lib/template/common/dashboard/index.js.map +1 -1
- package/lib/template/common/search-page/index.d.ts +8 -2
- package/lib/template/my-learning/index.d.ts +87 -17
- package/lib/template/my-learning/index.d.ts.map +1 -1
- package/lib/template/my-learning/index.js +28 -16
- package/lib/template/my-learning/index.js.map +1 -1
- package/lib/template/teams-dashboard/index.d.ts +8 -2
- package/package.json +2 -2
|
@@ -9,7 +9,7 @@ declare class CardsList extends React.PureComponent<any, any, any> {
|
|
|
9
9
|
dataName: PropTypes.Requireable<string>;
|
|
10
10
|
title: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike>>;
|
|
11
11
|
showMore: PropTypes.Requireable<string>;
|
|
12
|
-
cards: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
12
|
+
cards: PropTypes.Requireable<(NonNullable<PropTypes.InferProps<{
|
|
13
13
|
badge: PropTypes.Requireable<string>;
|
|
14
14
|
image: PropTypes.Requireable<string>;
|
|
15
15
|
disabled: PropTypes.Requireable<boolean>;
|
|
@@ -60,7 +60,13 @@ declare class CardsList extends React.PureComponent<any, any, any> {
|
|
|
60
60
|
progression: PropTypes.Requireable<string>;
|
|
61
61
|
adaptive: PropTypes.Requireable<string>;
|
|
62
62
|
}>>;
|
|
63
|
-
}> |
|
|
63
|
+
}> | PropTypes.InferProps<{
|
|
64
|
+
title: PropTypes.Requireable<string>;
|
|
65
|
+
tagLabel: PropTypes.Requireable<string>;
|
|
66
|
+
progression: PropTypes.Requireable<number>;
|
|
67
|
+
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
68
|
+
type: PropTypes.Requireable<string>;
|
|
69
|
+
}> | null | undefined> | null | undefined)[]>;
|
|
64
70
|
customStyle: PropTypes.Requireable<{
|
|
65
71
|
[x: string]: string | null | undefined;
|
|
66
72
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/molecule/dashboard/cards-list/index.js"],"names":[],"mappings":";AAuFA;IACE;;;OAGG;IACH
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/molecule/dashboard/cards-list/index.js"],"names":[],"mappings":";AAuFA;IACE;;;OAGG;IACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAqBE;IAEF;;;;;;;;;;;;;;;;;;;;;;;MAGE;IAEF,wBAkCC;IA/BC;;;;;;;;MAQC;IAED,0DAAgE;IAsHlE,qBAiBC;IAED,qBAGC;IAED,sBAGC;IAED,0BASC;IAvJC,uEAA6D;IAyJ/D,mCAIC;IA5DD,oCAMC;IAGD,sCAIC;IA5DD,qBAGC;IAnCD,0BAMC;IAED,2BAYC;IAED,6BAOC;IASD,wCAuCC;IAGC,kBAA2B;IA6D7B,sBAsGC;CACF"}
|
|
@@ -323,7 +323,9 @@ class CardsList extends React.PureComponent {
|
|
|
323
323
|
return /*#__PURE__*/React.createElement("div", {
|
|
324
324
|
className: style.card,
|
|
325
325
|
key: key
|
|
326
|
-
}, card && card.type === 'learningPriority' ? /*#__PURE__*/React.createElement(LearningPriorityCard,
|
|
326
|
+
}, card && card.type === 'learningPriority' ? /*#__PURE__*/React.createElement(LearningPriorityCard, _extends({}, card, {
|
|
327
|
+
dataName: `${dataName}-${key}`
|
|
328
|
+
})) : /*#__PURE__*/React.createElement(Card, _extends({}, card, {
|
|
327
329
|
dataName: `${dataName}-${key}`
|
|
328
330
|
})));
|
|
329
331
|
}))(cards);
|
|
@@ -398,7 +400,7 @@ CardsList.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
398
400
|
dataName: PropTypes.string,
|
|
399
401
|
title: PropTypes.oneOfType([PropTypes.node, PropTypes.string]),
|
|
400
402
|
showMore: PropTypes.string,
|
|
401
|
-
cards: PropTypes.arrayOf(PropTypes.shape(cardPropTypes)),
|
|
403
|
+
cards: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.shape(cardPropTypes), PropTypes.shape(LearningPriorityCard.propTypes)])),
|
|
402
404
|
customStyle: PropTypes.objectOf(PropTypes.string),
|
|
403
405
|
onScroll: PropTypes.func,
|
|
404
406
|
onShowMore: PropTypes.func,
|
|
@@ -406,7 +408,7 @@ CardsList.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
406
408
|
showMoreOnLeftAriaLabel: PropTypes.string,
|
|
407
409
|
showMoreOnRightAriaLabel: PropTypes.string
|
|
408
410
|
}),
|
|
409
|
-
type: PropTypes.oneOf(['cards']),
|
|
411
|
+
type: PropTypes.oneOf(['cards', 'learningPrioritiesCards']),
|
|
410
412
|
// eslint-disable-next-line react/forbid-prop-types
|
|
411
413
|
testingSizes: PropTypes.any
|
|
412
414
|
} : {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","PropTypes","NovaSolidContentContentBook1","LearnerIcon","NovaCompositionCoorpacademyTimer","TimerIcon","Provider","Card","cardPropTypes","LearningPriorityCard","Icon","style","ShowMoreLink","props","onShowMore","showMore","className","contextTypes","skin","childContextTypes","propTypes","func","string","IconView","context","contentType","ICONS","chapter","course","dark","IconType","color","icon","computeWidth","card","type","nextPage","page","maxPages","CardsList","PureComponent","constructor","state","actualPage","scrollLeft","offsetWidth","possiblePositions","possiblePages","cardsWidth","handleScroll_","handleScroll","bind","handleOnLeft","handleOnRight","scrollTo","updateState","updatePages","setCardsWrapper","getScrollWidth","handleResize","testingSizes","componentDidMount","cardsWrapper","addEventListener","window","componentDidUpdate","cards","newCardsWidth","updatePaginationState","setState","componentWillUnmount","removeEventListener","cancel","wrapperWidth","wrapperScrollLeft","cardWidths","cardPositions","accWidth","cardWidth","acc","pageIndex","accPageWidth","pageWidth","skip","position","element","index","onScroll","leftBound","rightBound","leftIndex","rightIndex","limit","indexOfNextFirstCard","indexOf","nextPosition","render","title","customStyle","dataName","ariaLabel","titleStyle","titleLink","cardsView","key","arrowIconProps","preset","borderRadius","showMoreOnLeftAriaLabel","arrows","arrowsWrapper","arrow","titleView","titleNode","hasPages","showMoreView","showMoreBar","switchPagesView","pagingWrapper","wrapper","list","header","translate","oneOfType","node","arrayOf","shape","objectOf","showMoreOnRightAriaLabel","oneOf","any"],"sources":["../../../../src/molecule/dashboard/cards-list/index.js"],"sourcesContent":["import React from 'react';\nimport {\n debounce,\n throttle,\n get,\n getOr,\n map,\n sum,\n last,\n pipe,\n toPairs,\n reduce,\n head,\n findIndex,\n findLastIndex\n} from 'lodash/fp';\nimport PropTypes from 'prop-types';\nimport {\n NovaSolidContentContentBook1 as LearnerIcon,\n NovaCompositionCoorpacademyTimer as TimerIcon\n} from '@coorpacademy/nova-icons';\nimport Provider from '../../../atom/provider';\nimport Card, {cardPropTypes} from '../../card';\nimport LearningPriorityCard from '../../learning-priority-card';\nimport Icon from '../../../atom/icon';\nimport style from './style.css';\n\nconst ShowMoreLink = props => {\n const {onShowMore, showMore, className} = props;\n return (\n <div className={className} onClick={onShowMore}>\n {showMore}\n </div>\n );\n};\n\nShowMoreLink.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nShowMoreLink.propTypes = {\n onShowMore: PropTypes.func,\n showMore: PropTypes.string,\n className: PropTypes.string\n};\n\nconst IconView = (props, context) => {\n const {skin} = context;\n const {contentType} = props;\n const ICONS = {\n chapter: TimerIcon,\n course: LearnerIcon\n };\n\n if (!contentType) {\n return null;\n }\n\n const dark = get('common.dark', skin);\n const IconType = ICONS[contentType];\n\n return (\n <div>\n <IconType style={{color: dark}} className={style.icon} data-contenttype={contentType} />\n </div>\n );\n};\n\nconst computeWidth = card => {\n switch (card && card.type) {\n case 'chapter':\n return 219;\n default:\n return 272;\n }\n};\n\nconst nextPage = (page, maxPages) => {\n if (page < 0) return maxPages;\n if (page > maxPages) return 0;\n return page;\n};\n\nIconView.propTypes = {\n contentType: PropTypes.string\n};\n\nclass CardsList extends React.PureComponent {\n /**\n * IMPORTANT: update prop-types.ts too, 1st a migration of tests\n * is intended, then, a TS + functional refactor is planned.\n */\n static propTypes = {\n contentType: PropTypes.string,\n dataName: PropTypes.string,\n title: PropTypes.oneOfType([PropTypes.node, PropTypes.string]),\n showMore: PropTypes.string,\n cards: PropTypes.arrayOf(PropTypes.shape(cardPropTypes)),\n customStyle: PropTypes.objectOf(PropTypes.string),\n onScroll: PropTypes.func,\n onShowMore: PropTypes.func,\n 'arrows-aria-label': PropTypes.shape({\n showMoreOnLeftAriaLabel: PropTypes.string,\n showMoreOnRightAriaLabel: PropTypes.string\n }),\n type: PropTypes.oneOf(['cards']),\n // eslint-disable-next-line react/forbid-prop-types\n testingSizes: PropTypes.any\n };\n\n static contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n };\n\n constructor(props) {\n super(props);\n\n this.state = {\n actualPage: 0,\n maxPages: 0,\n scrollLeft: 0,\n offsetWidth: 0,\n possiblePositions: [],\n possiblePages: [],\n cardsWidth: 0\n };\n\n this.handleScroll_ = throttle(200, this.handleScroll.bind(this));\n this.handleScroll = this.handleScroll.bind(this);\n this.handleOnLeft = this.handleOnLeft.bind(this);\n this.handleOnRight = this.handleOnRight.bind(this);\n this.scrollTo = this.scrollTo.bind(this);\n this.updateState = debounce(200, this.updatePages.bind(this));\n this.updatePages = this.updatePages.bind(this);\n this.setCardsWrapper = this.setCardsWrapper.bind(this);\n this.getScrollWidth = this.getScrollWidth.bind(this);\n this.handleResize = this.handleResize.bind(this);\n\n // for testing purposes only - no other way to test this polluted component\n if (props.testingSizes) {\n const {offsetWidth, scrollLeft, maxPages, possiblePages, possiblePositions} =\n props.testingSizes;\n this.state.offsetWidth = offsetWidth;\n this.state.scrollLeft = scrollLeft;\n this.state.maxPages = maxPages;\n this.state.possiblePages = possiblePages;\n this.state.possiblePositions = possiblePositions;\n }\n }\n\n componentDidMount() {\n this.cardsWrapper.addEventListener('scroll', this.handleScroll_);\n\n if (window) {\n window.addEventListener('resize', this.handleResize);\n }\n }\n\n componentDidUpdate() {\n const {cards = []} = this.props;\n const {offsetWidth, cardsWidth} = this.state;\n const newCardsWidth = pipe(map(computeWidth), sum)(cards);\n\n if (newCardsWidth !== cardsWidth && offsetWidth !== 0) {\n this.updatePaginationState(cards);\n // eslint-disable-next-line react/no-did-update-set-state\n this.setState({\n cardsWidth: newCardsWidth\n });\n }\n }\n\n componentWillUnmount() {\n this.cardsWrapper.removeEventListener('scroll', this.handleScroll_);\n\n if (window) {\n window.removeEventListener('resize', this.handleResize);\n }\n this.updateState.cancel();\n }\n\n /* istanbul ignore next */\n handleResize() {\n const {cards = []} = this.props;\n this.updatePaginationState(cards);\n }\n\n /* istanbul ignore next */\n updatePaginationState(cards) {\n const {offsetWidth: wrapperWidth, scrollLeft: wrapperScrollLeft} = this.state;\n\n const cardWidths = map(computeWidth)(cards);\n\n const possiblePositions = pipe(\n reduce(\n ([cardPositions, accWidth], cardWidth) => [\n [...cardPositions, accWidth],\n cardWidth + accWidth\n ],\n [[], 0]\n ),\n head\n )(cardWidths);\n\n const possiblePages = pipe(\n reduce(\n ([acc, pageIndex, accPageWidth], cardWidth) => {\n const pageWidth = accPageWidth + cardWidth;\n if (pageWidth > wrapperWidth) {\n return [[...acc, pageIndex + 1], pageIndex + 1, cardWidth];\n }\n return [[...acc, pageIndex], pageIndex, pageWidth];\n },\n [[], 0, 0]\n ),\n head\n )(cardWidths);\n\n const skip = findIndex(position => position >= wrapperScrollLeft, possiblePositions);\n const actualPage = possiblePages[skip + 1];\n\n this.setState({\n possiblePositions,\n possiblePages,\n maxPages: last(possiblePages),\n actualPage\n });\n }\n\n setCardsWrapper(element) {\n this.cardsWrapper = element;\n this.setState({\n scrollLeft: this.cardsWrapper?.scrollLeft,\n offsetWidth: this.cardsWrapper?.offsetWidth\n });\n }\n\n /* istanbul ignore next */\n getScrollWidth(index) {\n const {cards = []} = this.props;\n const card = cards[index];\n return computeWidth(card);\n }\n\n /* istanbul ignore next */\n handleScroll() {\n const scrollLeft = this.cardsWrapper?.scrollLeft;\n this.setState({scrollLeft});\n\n const {possiblePositions, offsetWidth} = this.state;\n const {onScroll} = this.props;\n if (onScroll) {\n const leftBound = scrollLeft;\n const rightBound = scrollLeft + offsetWidth;\n\n const leftIndex = findIndex(position => position > leftBound, possiblePositions) - 1;\n const rightIndex = findLastIndex(position => position < rightBound, possiblePositions);\n const skip = leftIndex;\n const limit = rightIndex - skip + 1;\n\n onScroll(skip, limit);\n }\n }\n\n handleOnLeft() {\n const {actualPage, maxPages} = this.state;\n this.scrollTo(nextPage(actualPage - 1, maxPages));\n }\n\n handleOnRight() {\n const {actualPage, maxPages} = this.state;\n this.scrollTo(nextPage(actualPage + 1, maxPages));\n }\n\n scrollTo(page) {\n const {possiblePages, possiblePositions} = this.state;\n const indexOfNextFirstCard = possiblePages.indexOf(page);\n const nextPosition = possiblePositions[indexOfNextFirstCard];\n this.cardsWrapper.scrollLeft = nextPosition;\n this.updatePages(page);\n this.setState({\n scrollLeft: nextPosition\n });\n }\n\n updatePages(actualPage) {\n this.setState({\n actualPage\n });\n }\n\n render() {\n const {\n title,\n showMore,\n cards,\n customStyle = {},\n onShowMore,\n dataName,\n contentType,\n 'arrows-aria-label': ariaLabel = {}\n } = this.props;\n const {skin} = this.context;\n const {maxPages} = this.state;\n const dark = getOr('#90A4AE', 'common.dark', skin);\n const titleStyle = onShowMore ? style.titleLink : style.title;\n const cardsView = pipe(\n toPairs,\n map(([key, card]) => {\n return (\n <div className={style.card} key={key}>\n {card && card.type === 'learningPriority' ? (\n <LearningPriorityCard {...card} />\n ) : (\n <Card {...card} dataName={`${dataName}-${key}`} />\n )}\n </div>\n );\n })\n )(cards);\n\n const arrowIconProps = {\n color: dark,\n preset: 's',\n borderRadius: '8px',\n ariaLabel: ariaLabel.showMoreOnLeftAriaLabel\n };\n\n const arrows = (\n <div className={style.arrowsWrapper}>\n <div className={style.arrow} onClick={this.handleOnLeft} data-name=\"card-list-left-arrow\">\n <Icon {...arrowIconProps} iconName=\"arrow-left\" />\n </div>\n <div className={style.arrow} onClick={this.handleOnRight} data-name=\"card-list-right-arrow\">\n <Icon {...arrowIconProps} iconName=\"arrow-right\" />\n </div>\n </div>\n );\n\n const titleView =\n typeof title === 'string' ? (\n <span data-name=\"title\" className={titleStyle} onClick={onShowMore}>\n <IconView contentType={contentType} />\n <span>{title}</span>\n </span>\n ) : (\n <span className={style.titleNode}>{title}</span>\n );\n\n const hasPages = maxPages > 0;\n const showMoreView =\n hasPages && showMore && onShowMore ? (\n <ShowMoreLink\n className={hasPages ? style.showMoreBar : style.showMore}\n onShowMore={onShowMore}\n showMore={showMore}\n />\n ) : null;\n\n const switchPagesView = hasPages ? (\n <div className={style.pagingWrapper}>\n {showMoreView}\n {arrows}\n </div>\n ) : null;\n\n return (\n <div\n className={style.wrapper}\n style={customStyle}\n data-name=\"cardsList\"\n data-max-pages={`${maxPages}`}\n // eslint-disable-next-line react/destructuring-assignment\n data-actual-page={`${this.state.actualPage}`}\n data-scroll-left={this.cardsWrapper?.scrollLeft}\n >\n <div className={style.list}>\n <div>\n <div data-name=\"header\" className={style.header}>\n {titleView}\n {switchPagesView}\n </div>\n <div\n className={style.cards}\n data-testid=\"cards-view-wrapper\"\n ref={this.setCardsWrapper}\n >\n {cardsView}\n </div>\n </div>\n </div>\n </div>\n );\n }\n}\n\nexport default CardsList;\n"],"mappings":";;;;;;;;;;;;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAgBA,OAAOC,SAAP,MAAsB,YAAtB;AACA,SACEC,4BAA4B,IAAIC,WADlC,EAEEC,gCAAgC,IAAIC,SAFtC,QAGO,0BAHP;AAIA,OAAOC,QAAP,MAAqB,wBAArB;AACA,OAAOC,IAAP,IAAcC,aAA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;EA2BD;;AAnTyC;;AAAtChE,S,CAuBGtB,Y,GAAe;EACpBC,IAAI,EAAEZ,QAAQ,CAACa,iBAAT,CAA2BD,IADb;EAEpBwG,SAAS,EAAEpH,QAAQ,CAACa,iBAAT,CAA2BuG;AAFlB,C;AAvBlBnF,S,CAKGnB,S,2CAAY;EACjBK,WAAW,EAAExB,SAAS,CAACqB,MADN;EAEjB6E,QAAQ,EAAElG,SAAS,CAACqB,MAFH;EAGjB2E,KAAK,EAAEhG,SAAS,CAAC0H,SAAV,CAAoB,CAAC1H,SAAS,CAAC2H,IAAX,EAAiB3H,SAAS,CAACqB,MAA3B,CAApB,CAHU;EAIjBP,QAAQ,EAAEd,SAAS,CAACqB,MAJH;EAKjB4C,KAAK,EAAEjE,SAAS,CAAC4H,OAAV,CAAkB5H,SAAS,CAAC6H,KAAV,CAAgBtH,aAAhB,CAAlB,CALU;EAMjB0F,WAAW,EAAEjG,SAAS,CAAC8H,QAAV,CAAmB9H,SAAS,CAACqB,MAA7B,CANI;EAOjBiE,QAAQ,EAAEtF,SAAS,CAACoB,IAPH;EAQjBP,UAAU,EAAEb,SAAS,CAACoB,IARL;EASjB,qBAAqBpB,SAAS,CAAC6H,KAAV,CAAgB;IACnClB,uBAAuB,EAAE3G,SAAS,CAACqB,MADA;IAEnC0G,wBAAwB,EAAE/H,SAAS,CAACqB;EAFD,CAAhB,CATJ;EAajBa,IAAI,EAAElC,SAAS,CAACgI,KAAV,CAAgB,CAAC,OAAD,CAAhB,CAbW;EAcjB;EACArE,YAAY,EAAE3D,SAAS,CAACiI;AAfP,C;AAiTrB,eAAe3F,SAAf"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PropTypes","NovaSolidContentContentBook1","LearnerIcon","NovaCompositionCoorpacademyTimer","TimerIcon","Provider","Card","cardPropTypes","LearningPriorityCard","Icon","style","ShowMoreLink","props","onShowMore","showMore","className","contextTypes","skin","childContextTypes","propTypes","func","string","IconView","context","contentType","ICONS","chapter","course","dark","IconType","color","icon","computeWidth","card","type","nextPage","page","maxPages","CardsList","PureComponent","constructor","state","actualPage","scrollLeft","offsetWidth","possiblePositions","possiblePages","cardsWidth","handleScroll_","handleScroll","bind","handleOnLeft","handleOnRight","scrollTo","updateState","updatePages","setCardsWrapper","getScrollWidth","handleResize","testingSizes","componentDidMount","cardsWrapper","addEventListener","window","componentDidUpdate","cards","newCardsWidth","updatePaginationState","setState","componentWillUnmount","removeEventListener","cancel","wrapperWidth","wrapperScrollLeft","cardWidths","cardPositions","accWidth","cardWidth","acc","pageIndex","accPageWidth","pageWidth","skip","position","element","index","onScroll","leftBound","rightBound","leftIndex","rightIndex","limit","indexOfNextFirstCard","indexOf","nextPosition","render","title","customStyle","dataName","ariaLabel","titleStyle","titleLink","cardsView","key","arrowIconProps","preset","borderRadius","showMoreOnLeftAriaLabel","arrows","arrowsWrapper","arrow","titleView","titleNode","hasPages","showMoreView","showMoreBar","switchPagesView","pagingWrapper","wrapper","list","header","translate","oneOfType","node","arrayOf","shape","objectOf","showMoreOnRightAriaLabel","oneOf","any"],"sources":["../../../../src/molecule/dashboard/cards-list/index.js"],"sourcesContent":["import React from 'react';\nimport {\n debounce,\n throttle,\n get,\n getOr,\n map,\n sum,\n last,\n pipe,\n toPairs,\n reduce,\n head,\n findIndex,\n findLastIndex\n} from 'lodash/fp';\nimport PropTypes from 'prop-types';\nimport {\n NovaSolidContentContentBook1 as LearnerIcon,\n NovaCompositionCoorpacademyTimer as TimerIcon\n} from '@coorpacademy/nova-icons';\nimport Provider from '../../../atom/provider';\nimport Card, {cardPropTypes} from '../../card';\nimport LearningPriorityCard from '../../learning-priority-card';\nimport Icon from '../../../atom/icon';\nimport style from './style.css';\n\nconst ShowMoreLink = props => {\n const {onShowMore, showMore, className} = props;\n return (\n <div className={className} onClick={onShowMore}>\n {showMore}\n </div>\n );\n};\n\nShowMoreLink.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nShowMoreLink.propTypes = {\n onShowMore: PropTypes.func,\n showMore: PropTypes.string,\n className: PropTypes.string\n};\n\nconst IconView = (props, context) => {\n const {skin} = context;\n const {contentType} = props;\n const ICONS = {\n chapter: TimerIcon,\n course: LearnerIcon\n };\n\n if (!contentType) {\n return null;\n }\n\n const dark = get('common.dark', skin);\n const IconType = ICONS[contentType];\n\n return (\n <div>\n <IconType style={{color: dark}} className={style.icon} data-contenttype={contentType} />\n </div>\n );\n};\n\nconst computeWidth = card => {\n switch (card && card.type) {\n case 'chapter':\n return 219;\n default:\n return 272;\n }\n};\n\nconst nextPage = (page, maxPages) => {\n if (page < 0) return maxPages;\n if (page > maxPages) return 0;\n return page;\n};\n\nIconView.propTypes = {\n contentType: PropTypes.string\n};\n\nclass CardsList extends React.PureComponent {\n /**\n * IMPORTANT: update prop-types.ts too, 1st a migration of tests\n * is intended, then, a TS + functional refactor is planned.\n */\n static propTypes = {\n contentType: PropTypes.string,\n dataName: PropTypes.string,\n title: PropTypes.oneOfType([PropTypes.node, PropTypes.string]),\n showMore: PropTypes.string,\n cards: PropTypes.arrayOf(\n PropTypes.oneOfType([\n PropTypes.shape(cardPropTypes),\n PropTypes.shape(LearningPriorityCard.propTypes)\n ])\n ),\n customStyle: PropTypes.objectOf(PropTypes.string),\n onScroll: PropTypes.func,\n onShowMore: PropTypes.func,\n 'arrows-aria-label': PropTypes.shape({\n showMoreOnLeftAriaLabel: PropTypes.string,\n showMoreOnRightAriaLabel: PropTypes.string\n }),\n type: PropTypes.oneOf(['cards', 'learningPrioritiesCards']),\n // eslint-disable-next-line react/forbid-prop-types\n testingSizes: PropTypes.any\n };\n\n static contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n };\n\n constructor(props) {\n super(props);\n\n this.state = {\n actualPage: 0,\n maxPages: 0,\n scrollLeft: 0,\n offsetWidth: 0,\n possiblePositions: [],\n possiblePages: [],\n cardsWidth: 0\n };\n\n this.handleScroll_ = throttle(200, this.handleScroll.bind(this));\n this.handleScroll = this.handleScroll.bind(this);\n this.handleOnLeft = this.handleOnLeft.bind(this);\n this.handleOnRight = this.handleOnRight.bind(this);\n this.scrollTo = this.scrollTo.bind(this);\n this.updateState = debounce(200, this.updatePages.bind(this));\n this.updatePages = this.updatePages.bind(this);\n this.setCardsWrapper = this.setCardsWrapper.bind(this);\n this.getScrollWidth = this.getScrollWidth.bind(this);\n this.handleResize = this.handleResize.bind(this);\n\n // for testing purposes only - no other way to test this polluted component\n if (props.testingSizes) {\n const {offsetWidth, scrollLeft, maxPages, possiblePages, possiblePositions} =\n props.testingSizes;\n this.state.offsetWidth = offsetWidth;\n this.state.scrollLeft = scrollLeft;\n this.state.maxPages = maxPages;\n this.state.possiblePages = possiblePages;\n this.state.possiblePositions = possiblePositions;\n }\n }\n\n componentDidMount() {\n this.cardsWrapper.addEventListener('scroll', this.handleScroll_);\n\n if (window) {\n window.addEventListener('resize', this.handleResize);\n }\n }\n\n componentDidUpdate() {\n const {cards = []} = this.props;\n const {offsetWidth, cardsWidth} = this.state;\n const newCardsWidth = pipe(map(computeWidth), sum)(cards);\n\n if (newCardsWidth !== cardsWidth && offsetWidth !== 0) {\n this.updatePaginationState(cards);\n // eslint-disable-next-line react/no-did-update-set-state\n this.setState({\n cardsWidth: newCardsWidth\n });\n }\n }\n\n componentWillUnmount() {\n this.cardsWrapper.removeEventListener('scroll', this.handleScroll_);\n\n if (window) {\n window.removeEventListener('resize', this.handleResize);\n }\n this.updateState.cancel();\n }\n\n /* istanbul ignore next */\n handleResize() {\n const {cards = []} = this.props;\n this.updatePaginationState(cards);\n }\n\n /* istanbul ignore next */\n updatePaginationState(cards) {\n const {offsetWidth: wrapperWidth, scrollLeft: wrapperScrollLeft} = this.state;\n\n const cardWidths = map(computeWidth)(cards);\n\n const possiblePositions = pipe(\n reduce(\n ([cardPositions, accWidth], cardWidth) => [\n [...cardPositions, accWidth],\n cardWidth + accWidth\n ],\n [[], 0]\n ),\n head\n )(cardWidths);\n\n const possiblePages = pipe(\n reduce(\n ([acc, pageIndex, accPageWidth], cardWidth) => {\n const pageWidth = accPageWidth + cardWidth;\n if (pageWidth > wrapperWidth) {\n return [[...acc, pageIndex + 1], pageIndex + 1, cardWidth];\n }\n return [[...acc, pageIndex], pageIndex, pageWidth];\n },\n [[], 0, 0]\n ),\n head\n )(cardWidths);\n\n const skip = findIndex(position => position >= wrapperScrollLeft, possiblePositions);\n const actualPage = possiblePages[skip + 1];\n\n this.setState({\n possiblePositions,\n possiblePages,\n maxPages: last(possiblePages),\n actualPage\n });\n }\n\n setCardsWrapper(element) {\n this.cardsWrapper = element;\n this.setState({\n scrollLeft: this.cardsWrapper?.scrollLeft,\n offsetWidth: this.cardsWrapper?.offsetWidth\n });\n }\n\n /* istanbul ignore next */\n getScrollWidth(index) {\n const {cards = []} = this.props;\n const card = cards[index];\n return computeWidth(card);\n }\n\n /* istanbul ignore next */\n handleScroll() {\n const scrollLeft = this.cardsWrapper?.scrollLeft;\n this.setState({scrollLeft});\n\n const {possiblePositions, offsetWidth} = this.state;\n const {onScroll} = this.props;\n if (onScroll) {\n const leftBound = scrollLeft;\n const rightBound = scrollLeft + offsetWidth;\n\n const leftIndex = findIndex(position => position > leftBound, possiblePositions) - 1;\n const rightIndex = findLastIndex(position => position < rightBound, possiblePositions);\n const skip = leftIndex;\n const limit = rightIndex - skip + 1;\n\n onScroll(skip, limit);\n }\n }\n\n handleOnLeft() {\n const {actualPage, maxPages} = this.state;\n this.scrollTo(nextPage(actualPage - 1, maxPages));\n }\n\n handleOnRight() {\n const {actualPage, maxPages} = this.state;\n this.scrollTo(nextPage(actualPage + 1, maxPages));\n }\n\n scrollTo(page) {\n const {possiblePages, possiblePositions} = this.state;\n const indexOfNextFirstCard = possiblePages.indexOf(page);\n const nextPosition = possiblePositions[indexOfNextFirstCard];\n this.cardsWrapper.scrollLeft = nextPosition;\n this.updatePages(page);\n this.setState({\n scrollLeft: nextPosition\n });\n }\n\n updatePages(actualPage) {\n this.setState({\n actualPage\n });\n }\n\n render() {\n const {\n title,\n showMore,\n cards,\n customStyle = {},\n onShowMore,\n dataName,\n contentType,\n 'arrows-aria-label': ariaLabel = {}\n } = this.props;\n const {skin} = this.context;\n const {maxPages} = this.state;\n const dark = getOr('#90A4AE', 'common.dark', skin);\n const titleStyle = onShowMore ? style.titleLink : style.title;\n const cardsView = pipe(\n toPairs,\n map(([key, card]) => {\n return (\n <div className={style.card} key={key}>\n {card && card.type === 'learningPriority' ? (\n <LearningPriorityCard {...card} dataName={`${dataName}-${key}`} />\n ) : (\n <Card {...card} dataName={`${dataName}-${key}`} />\n )}\n </div>\n );\n })\n )(cards);\n\n const arrowIconProps = {\n color: dark,\n preset: 's',\n borderRadius: '8px',\n ariaLabel: ariaLabel.showMoreOnLeftAriaLabel\n };\n\n const arrows = (\n <div className={style.arrowsWrapper}>\n <div className={style.arrow} onClick={this.handleOnLeft} data-name=\"card-list-left-arrow\">\n <Icon {...arrowIconProps} iconName=\"arrow-left\" />\n </div>\n <div className={style.arrow} onClick={this.handleOnRight} data-name=\"card-list-right-arrow\">\n <Icon {...arrowIconProps} iconName=\"arrow-right\" />\n </div>\n </div>\n );\n\n const titleView =\n typeof title === 'string' ? (\n <span data-name=\"title\" className={titleStyle} onClick={onShowMore}>\n <IconView contentType={contentType} />\n <span>{title}</span>\n </span>\n ) : (\n <span className={style.titleNode}>{title}</span>\n );\n\n const hasPages = maxPages > 0;\n const showMoreView =\n hasPages && showMore && onShowMore ? (\n <ShowMoreLink\n className={hasPages ? style.showMoreBar : style.showMore}\n onShowMore={onShowMore}\n showMore={showMore}\n />\n ) : null;\n\n const switchPagesView = hasPages ? (\n <div className={style.pagingWrapper}>\n {showMoreView}\n {arrows}\n </div>\n ) : null;\n\n return (\n <div\n className={style.wrapper}\n style={customStyle}\n data-name=\"cardsList\"\n data-max-pages={`${maxPages}`}\n // eslint-disable-next-line react/destructuring-assignment\n data-actual-page={`${this.state.actualPage}`}\n data-scroll-left={this.cardsWrapper?.scrollLeft}\n >\n <div className={style.list}>\n <div>\n <div data-name=\"header\" className={style.header}>\n {titleView}\n {switchPagesView}\n </div>\n <div\n className={style.cards}\n data-testid=\"cards-view-wrapper\"\n ref={this.setCardsWrapper}\n >\n {cardsView}\n </div>\n </div>\n </div>\n </div>\n );\n }\n}\n\nexport default CardsList;\n"],"mappings":";;;;;;;;;;;;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAgBA,OAAOC,SAAP,MAAsB,YAAtB;AACA,SACEC,4BAA4B,IAAIC,WADlC,EAEEC,gCAAgC,IAAIC,SAFtC,QAGO,0BAHP;AAIA,OAAOC,QAAP,MAAqB,wBAArB;AACA,OAAOC,IAAP,IAAcC,aAAd,QAAkC,YAAlC;AACA,OAAOC,oBAAP,MAAiC,8BAAjC;AACA,OAAOC,IAAP,MAAiB,oBAAjB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,YAAY,GAAGC,KAAK,IAAI;EAC5B,MAAM;IAACC,UAAD;IAAaC,QAAb;IAAuBC;EAAvB,IAAoCH,KAA1C;EACA,oBACE;IAAK,SAAS,EAAEG,SAAhB;IAA2B,OAAO,EAAEF;EAApC,GACGC,QADH,CADF;AAKD,CAPD;;AASAH,YAAY,CAACK,YAAb,GAA4B;EAC1BC,IAAI,EAAEZ,QAAQ,CAACa,iBAAT,CAA2BD;AADP,CAA5B;AAIAN,YAAY,CAACQ,SAAb,2CAAyB;EACvBN,UAAU,EAAEb,SAAS,CAACoB,IADC;EAEvBN,QAAQ,EAAEd,SAAS,CAACqB,MAFG;EAGvBN,SAAS,EAAEf,SAAS,CAACqB;AAHE,CAAzB;;AAMA,MAAMC,QAAQ,GAAG,CAACV,KAAD,EAAQW,OAAR,KAAoB;EACnC,MAAM;IAACN;EAAD,IAASM,OAAf;EACA,MAAM;IAACC;EAAD,IAAgBZ,KAAtB;EACA,MAAMa,KAAK,GAAG;IACZC,OAAO,EAAEtB,SADG;IAEZuB,MAAM,EAAEzB;EAFI,CAAd;;EAKA,IAAI,CAACsB,WAAL,EAAkB;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,IAZH;EAajBP,UAAU,EAAEb,SAAS,CAACoB,IAbL;EAcjB,qBAAqBpB,SAAS,CAAC6H,KAAV,CAAgB;IACnClB,uBAAuB,EAAE3G,SAAS,CAACqB,MADA;IAEnC0G,wBAAwB,EAAE/H,SAAS,CAACqB;EAFD,CAAhB,CAdJ;EAkBjBa,IAAI,EAAElC,SAAS,CAACgI,KAAV,CAAgB,CAAC,OAAD,EAAU,yBAAV,CAAhB,CAlBW;EAmBjB;EACArE,YAAY,EAAE3D,SAAS,CAACiI;AApBP,C;AAsTrB,eAAe3F,SAAf"}
|
|
@@ -5,9 +5,7 @@ declare const LearningPriorityCard: {
|
|
|
5
5
|
(props: LearningPriorityCardPropTypes, context: WebContextValues): JSX.Element;
|
|
6
6
|
propTypes: {
|
|
7
7
|
title: import("prop-types").Requireable<string>;
|
|
8
|
-
|
|
9
|
-
label: import("prop-types").Requireable<string>;
|
|
10
|
-
}>>;
|
|
8
|
+
tagLabel: import("prop-types").Requireable<string>;
|
|
11
9
|
progression: import("prop-types").Requireable<number>;
|
|
12
10
|
onClick: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
13
11
|
type: import("prop-types").Requireable<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/learning-priority-card/index.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAC,gBAAgB,EAAC,MAAM,iCAAiC,CAAC;AAIjE,OAAO,EAAC,6BAA6B,EAAY,MAAM,SAAS,CAAC;AAGjE,QAAA,MAAM,oBAAoB;YAAW,6BAA6B,WAAW,gBAAgB
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/learning-priority-card/index.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAC,gBAAgB,EAAC,MAAM,iCAAiC,CAAC;AAIjE,OAAO,EAAC,6BAA6B,EAAY,MAAM,SAAS,CAAC;AAGjE,QAAA,MAAM,oBAAoB;YAAW,6BAA6B,WAAW,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+D5F,CAAC;AASF,eAAe,oBAAoB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useState","useCallback","convert","Provider","GetTranslateFromContext","GetSkinFromContext","Tag","ButtonLink","CircularProgressBar","propTypes","style","LearningPriorityCard","props","context","
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useState","useCallback","convert","Provider","GetTranslateFromContext","GetSkinFromContext","Tag","ButtonLink","CircularProgressBar","propTypes","style","LearningPriorityCard","props","context","tagLabel","title","progression","onClick","translate","skin","exploreLocale","primarySkinColor","hovered","setHovered","handleMouseOver","handleMouseLeave","buttonExploreProps","customStyle","backgroundColor","color","transition","label","icon","position","faIcon","name","size","container","circularProgressBarContainer","strokeWidth","contextTypes","childContextTypes"],"sources":["../../../src/molecule/learning-priority-card/index.tsx"],"sourcesContent":["import React, {useState, useCallback} from 'react';\nimport {get} from 'lodash/fp';\nimport {convert} from 'css-color-function';\nimport Provider, {GetTranslateFromContext, GetSkinFromContext} from '../../atom/provider';\nimport {WebContextValues} from '../../atom/provider/web-context';\nimport Tag from '../../atom/tag';\nimport ButtonLink from '../../atom/button-link';\nimport CircularProgressBar from '../../atom/circular-progress-bar';\nimport {LearningPriorityCardPropTypes, propTypes} from './types';\nimport style from './style.css';\n\nconst LearningPriorityCard = (props: LearningPriorityCardPropTypes, context: WebContextValues) => {\n const {tagLabel, title, progression, onClick} = props;\n const translate = GetTranslateFromContext(context);\n const skin = GetSkinFromContext(context);\n const exploreLocale = translate('Explore');\n const primarySkinColor = get('common.primary', skin);\n\n const [hovered, setHovered] = useState(false);\n const handleMouseOver = useCallback(() => setHovered(true), [setHovered]);\n const handleMouseLeave = useCallback(() => setHovered(false), [setHovered]);\n\n const buttonExploreProps = {\n customStyle: {\n backgroundColor: hovered ? primarySkinColor : convert(`color(${primarySkinColor} a(0.07))`),\n color: hovered ? '#FFFFFF' : primarySkinColor,\n transition: 'background-color 0.15s ease-in-out, color 0.15s ease-in-out'\n },\n onClick,\n 'aria-label': `${title}, ${exploreLocale}`,\n label: exploreLocale,\n 'data-name': 'learning-priority-explore-button',\n icon: {\n position: 'left' as const,\n faIcon: {\n name: 'compass',\n backgroundColor: hovered ? primarySkinColor : convert(`color(${primarySkinColor} a(0.07))`),\n color: hovered ? '#FFFFFF' : primarySkinColor,\n size: 16\n }\n }\n };\n\n return (\n <div\n className={style.container}\n aria-label={`learning priority card ${title}`}\n data-name={`learning-priority-card-${title}`}\n >\n <div>\n <Tag label={tagLabel} size={'S'} />\n </div>\n <div className={style.title}>{title}</div>\n <div className={style.circularProgressBarContainer}>\n <CircularProgressBar\n {...{\n size: 162,\n strokeWidth: 12,\n progression,\n label: translate('completed'),\n 'aria-label': `${title} ${progression}%`,\n 'data-name': `circular-progress-bar-${title}`\n }}\n />\n </div>\n <div\n onMouseOver={handleMouseOver}\n onMouseLeave={handleMouseLeave}\n data-name=\"button-explore-wrapper\"\n >\n <ButtonLink {...buttonExploreProps} />\n </div>\n </div>\n );\n};\n\nLearningPriorityCard.propTypes = propTypes;\n\nLearningPriorityCard.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nexport default LearningPriorityCard;\n"],"mappings":";AAAA,OAAOA,KAAP,IAAeC,QAAf,EAAyBC,WAAzB,QAA2C,OAA3C;AAEA,SAAQC,OAAR,QAAsB,oBAAtB;AACA,OAAOC,QAAP,IAAkBC,uBAAlB,EAA2CC,kBAA3C,QAAoE,qBAApE;AAEA,OAAOC,GAAP,MAAgB,gBAAhB;AACA,OAAOC,UAAP,MAAuB,wBAAvB;AACA,OAAOC,mBAAP,MAAgC,kCAAhC;AACA,SAAuCC,SAAvC,QAAuD,SAAvD;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,oBAAoB,GAAG,CAACC,KAAD,EAAuCC,OAAvC,KAAqE;EAChG,MAAM;IA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AAC2B,SADnB;IAEE,cAAa,0BAAyBtB,KAAM,EAF9C;IAGE,aAAY,0BAAyBA,KAAM;EAH7C,gBAKE,8CACE,oBAAC,GAAD;IAAK,KAAK,EAAED,QAAZ;IAAsB,IAAI,EAAE;EAA5B,EADF,CALF,eAQE;IAAK,SAAS,EAAEJ,KAAK,CAACK;EAAtB,GAA8BA,KAA9B,CARF,eASE;IAAK,SAAS,EAAEL,KAAK,CAAC4B;EAAtB,gBACE,oBAAC,mBAAD;IAEIF,IAAI,EAAE,GAFV;IAGIG,WAAW,EAAE,EAHjB;IAIIvB,WAJJ;IAKIe,KAAK,EAAEb,SAAS,CAAC,WAAD,CALpB;IAMI,cAAe,GAAEH,KAAM,IAAGC,WAAY,GAN1C;IAOI,aAAc,yBAAwBD,KAAM;EAPhD,EADF,CATF,eAqBE;IACE,WAAW,EAAES,eADf;IAEE,YAAY,EAAEC,gBAFhB;IAGE,aAAU;EAHZ,gBAKE,oBAAC,UAAD,EAAgBC,kBAAhB,CALF,CArBF,CADF;AA+BD,CA/DD;;AAiEAf,oBAAoB,CAACF,SAArB,2CAAiCA,SAAjC;AAEAE,oBAAoB,CAAC6B,YAArB,GAAoC;EAClCrB,IAAI,EAAEhB,QAAQ,CAACsC,iBAAT,CAA2BtB,IADC;EAElCD,SAAS,EAAEf,QAAQ,CAACsC,iBAAT,CAA2BvB;AAFJ,CAApC;AAKA,eAAeP,oBAAf"}
|
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
2
|
export declare type LearningPriorityCardPropTypes = {
|
|
3
3
|
title: string;
|
|
4
|
-
|
|
5
|
-
label: 'Skill' | 'Playlist' | 'Certification';
|
|
6
|
-
};
|
|
4
|
+
tagLabel: 'Skill' | 'Playlist' | 'Certification';
|
|
7
5
|
progression: number;
|
|
8
6
|
onClick: () => void;
|
|
9
7
|
type: 'learningPriority';
|
|
10
8
|
};
|
|
11
9
|
export declare const propTypes: {
|
|
12
10
|
title: PropTypes.Requireable<string>;
|
|
13
|
-
|
|
14
|
-
label: PropTypes.Requireable<string>;
|
|
15
|
-
}>>;
|
|
11
|
+
tagLabel: PropTypes.Requireable<string>;
|
|
16
12
|
progression: PropTypes.Requireable<number>;
|
|
17
13
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
18
14
|
type: PropTypes.Requireable<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/molecule/learning-priority-card/types.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,oBAAY,6BAA6B,GAAG;IAC1C,KAAK,EAAE,MAAM,CAAC;IACd,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/molecule/learning-priority-card/types.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,oBAAY,6BAA6B,GAAG;IAC1C,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,OAAO,GAAG,UAAU,GAAG,eAAe,CAAC;IACjD,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,IAAI,EAAE,kBAAkB,CAAC;CAC1B,CAAC;AAEF,eAAO,MAAM,SAAS;;;;;;CAMrB,CAAC"}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
2
|
export const propTypes = {
|
|
3
3
|
title: PropTypes.string,
|
|
4
|
-
|
|
5
|
-
label: PropTypes.oneOf(['Playlist', 'Certification', 'Skill'])
|
|
6
|
-
}),
|
|
4
|
+
tagLabel: PropTypes.oneOf(['Playlist', 'Certification', 'Skill']),
|
|
7
5
|
progression: PropTypes.number,
|
|
8
6
|
onClick: PropTypes.func,
|
|
9
7
|
type: PropTypes.oneOf(['learningPriority'])
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":["PropTypes","propTypes","title","string","
|
|
1
|
+
{"version":3,"file":"types.js","names":["PropTypes","propTypes","title","string","tagLabel","oneOf","progression","number","onClick","func","type"],"sources":["../../../src/molecule/learning-priority-card/types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\n\nexport type LearningPriorityCardPropTypes = {\n title: string;\n tagLabel: 'Skill' | 'Playlist' | 'Certification';\n progression: number;\n onClick: () => void;\n type: 'learningPriority';\n};\n\nexport const propTypes = {\n title: PropTypes.string,\n tagLabel: PropTypes.oneOf(['Playlist', 'Certification', 'Skill']),\n progression: PropTypes.number,\n onClick: PropTypes.func,\n type: PropTypes.oneOf(['learningPriority'])\n};\n"],"mappings":"AAAA,OAAOA,SAAP,MAAsB,YAAtB;AAUA,OAAO,MAAMC,SAAS,GAAG;EACvBC,KAAK,EAAEF,SAAS,CAACG,MADM;EAEvBC,QAAQ,EAAEJ,SAAS,CAACK,KAAV,CAAgB,CAAC,UAAD,EAAa,eAAb,EAA8B,OAA9B,CAAhB,CAFa;EAGvBC,WAAW,EAAEN,SAAS,CAACO,MAHA;EAIvBC,OAAO,EAAER,SAAS,CAACS,IAJI;EAKvBC,IAAI,EAAEV,SAAS,CAACK,KAAV,CAAgB,CAAC,kBAAD,CAAhB;AALiB,CAAlB"}
|
|
@@ -110,7 +110,7 @@ declare namespace PopinEnd {
|
|
|
110
110
|
dataName: PropTypes.Requireable<string>;
|
|
111
111
|
title: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike>>;
|
|
112
112
|
showMore: PropTypes.Requireable<string>;
|
|
113
|
-
cards: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
113
|
+
cards: PropTypes.Requireable<(NonNullable<PropTypes.InferProps<{
|
|
114
114
|
badge: PropTypes.Requireable<string>;
|
|
115
115
|
image: PropTypes.Requireable<string>;
|
|
116
116
|
disabled: PropTypes.Requireable<boolean>;
|
|
@@ -161,7 +161,13 @@ declare namespace PopinEnd {
|
|
|
161
161
|
progression: PropTypes.Requireable<string>;
|
|
162
162
|
adaptive: PropTypes.Requireable<string>;
|
|
163
163
|
}>>;
|
|
164
|
-
}> |
|
|
164
|
+
}> | PropTypes.InferProps<{
|
|
165
|
+
title: PropTypes.Requireable<string>;
|
|
166
|
+
tagLabel: PropTypes.Requireable<string>;
|
|
167
|
+
progression: PropTypes.Requireable<number>;
|
|
168
|
+
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
169
|
+
type: PropTypes.Requireable<string>;
|
|
170
|
+
}> | null | undefined> | null | undefined)[]>;
|
|
165
171
|
customStyle: PropTypes.Requireable<{
|
|
166
172
|
[x: string]: string | null | undefined;
|
|
167
173
|
}>;
|
|
@@ -116,7 +116,7 @@ declare namespace Summary {
|
|
|
116
116
|
dataName: PropTypes.Requireable<string>;
|
|
117
117
|
title: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike>>;
|
|
118
118
|
showMore: PropTypes.Requireable<string>;
|
|
119
|
-
cards: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
119
|
+
cards: PropTypes.Requireable<(NonNullable<PropTypes.InferProps<{
|
|
120
120
|
badge: PropTypes.Requireable<string>;
|
|
121
121
|
image: PropTypes.Requireable<string>;
|
|
122
122
|
disabled: PropTypes.Requireable<boolean>;
|
|
@@ -167,7 +167,13 @@ declare namespace Summary {
|
|
|
167
167
|
progression: PropTypes.Requireable<string>;
|
|
168
168
|
adaptive: PropTypes.Requireable<string>;
|
|
169
169
|
}>>;
|
|
170
|
-
}> |
|
|
170
|
+
}> | PropTypes.InferProps<{
|
|
171
|
+
title: PropTypes.Requireable<string>;
|
|
172
|
+
tagLabel: PropTypes.Requireable<string>;
|
|
173
|
+
progression: PropTypes.Requireable<number>;
|
|
174
|
+
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
175
|
+
type: PropTypes.Requireable<string>;
|
|
176
|
+
}> | null | undefined> | null | undefined)[]>;
|
|
171
177
|
customStyle: PropTypes.Requireable<{
|
|
172
178
|
[x: string]: string | null | undefined;
|
|
173
179
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/template/common/dashboard/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/template/common/dashboard/index.js"],"names":[],"mappings":";AAyBA,oDA+EC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _size from "lodash/fp/size";
|
|
2
2
|
|
|
3
3
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
4
|
|
|
@@ -14,6 +14,7 @@ import CMPopin from '../../../molecule/cm-popin';
|
|
|
14
14
|
import ReviewBanner from '../../../molecule/dashboard/review-banner';
|
|
15
15
|
import LearningProfileBanner from '../../../molecule/dashboard/learning-profile-banner';
|
|
16
16
|
import Title from '../../../atom/title';
|
|
17
|
+
import { learningPrioritiesPropTypes } from '../../my-learning';
|
|
17
18
|
import style from './style.css';
|
|
18
19
|
const Hero = /*#__PURE__*/React.memo(function Hero({
|
|
19
20
|
hero,
|
|
@@ -40,8 +41,7 @@ const Dashboard = props => {
|
|
|
40
41
|
|
|
41
42
|
const buildSectionComponent = section => {
|
|
42
43
|
const {
|
|
43
|
-
type
|
|
44
|
-
title
|
|
44
|
+
type
|
|
45
45
|
} = section;
|
|
46
46
|
|
|
47
47
|
switch (type) {
|
|
@@ -54,15 +54,34 @@ const Dashboard = props => {
|
|
|
54
54
|
case 'battleRequests':
|
|
55
55
|
return /*#__PURE__*/React.createElement(BattleRequestList, section);
|
|
56
56
|
|
|
57
|
-
case '
|
|
57
|
+
case 'learningPrioritiesCards':
|
|
58
58
|
{
|
|
59
|
-
const CardsListTitle = /*#__PURE__*/React.isValidElement(title) || _isString(title) ? section.title : /*#__PURE__*/React.createElement(Title, section.title);
|
|
60
59
|
return /*#__PURE__*/React.createElement(CardsList, _extends({}, section, {
|
|
61
|
-
title:
|
|
60
|
+
title: /*#__PURE__*/React.createElement(Title, {
|
|
61
|
+
type: 'form-group',
|
|
62
|
+
title: section.title,
|
|
63
|
+
subtitle: section.subtitle,
|
|
64
|
+
icon: {
|
|
65
|
+
iconName: 'sign-post',
|
|
66
|
+
iconColor: '#A32700',
|
|
67
|
+
borderRadius: '12px',
|
|
68
|
+
backgroundColor: '#FFDCD1'
|
|
69
|
+
},
|
|
70
|
+
tag: {
|
|
71
|
+
label: `${_size(section.cards)}`,
|
|
72
|
+
type: 'default',
|
|
73
|
+
size: 'S'
|
|
74
|
+
}
|
|
75
|
+
}),
|
|
62
76
|
"arrows-aria-label": showMoreOnLeftOrRightAriaLabel
|
|
63
77
|
}));
|
|
64
78
|
}
|
|
65
79
|
|
|
80
|
+
case 'cards':
|
|
81
|
+
return /*#__PURE__*/React.createElement(CardsList, _extends({}, section, {
|
|
82
|
+
"arrows-aria-label": showMoreOnLeftOrRightAriaLabel
|
|
83
|
+
}));
|
|
84
|
+
|
|
66
85
|
case 'news':
|
|
67
86
|
return /*#__PURE__*/React.createElement(NewsList, section);
|
|
68
87
|
|
|
@@ -104,7 +123,7 @@ const Dashboard = props => {
|
|
|
104
123
|
Dashboard.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
105
124
|
hero: Hero.propTypes.hero,
|
|
106
125
|
welcome: Hero.propTypes.welcome,
|
|
107
|
-
sections: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.shape(BattleRequestList.propTypes), PropTypes.shape(CardsList.propTypes), PropTypes.shape(NewsList.propTypes), PropTypes.shape(StartBattle.propTypes), PropTypes.shape(ReviewBanner.propTypes), PropTypes.shape(LearningProfileBanner.propTypes)])),
|
|
126
|
+
sections: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.shape(BattleRequestList.propTypes), PropTypes.shape(CardsList.propTypes), PropTypes.shape(learningPrioritiesPropTypes), PropTypes.shape(NewsList.propTypes), PropTypes.shape(StartBattle.propTypes), PropTypes.shape(ReviewBanner.propTypes), PropTypes.shape(LearningProfileBanner.propTypes)])),
|
|
108
127
|
cookie: PropTypes.shape(CMPopin.propTypes),
|
|
109
128
|
'arrows-aria-label': CardsList.propTypes['arrows-aria-label'],
|
|
110
129
|
popinWithCards: PropTypes.shape(CMPopin.propTypes)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","PropTypes","Slide","HeroCard","BattleRequestList","CardsList","NewsList","StartBattle","CMPopin","ReviewBanner","LearningProfileBanner","Title","style","Hero","memo","hero","welcome","propTypes","shape","Dashboard","props","sections","cookie","popinWithCards","showMoreOnLeftOrRightAriaLabel","buildSectionComponent","section","type","title","
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PropTypes","Slide","HeroCard","BattleRequestList","CardsList","NewsList","StartBattle","CMPopin","ReviewBanner","LearningProfileBanner","Title","learningPrioritiesPropTypes","style","Hero","memo","hero","welcome","propTypes","shape","Dashboard","props","sections","cookie","popinWithCards","showMoreOnLeftOrRightAriaLabel","buildSectionComponent","section","type","title","subtitle","icon","iconName","iconColor","borderRadius","backgroundColor","tag","label","cards","size","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 {size} from 'lodash/fp';\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 LearningProfileBanner from '../../../molecule/dashboard/learning-profile-banner';\nimport Title from '../../../atom/title';\nimport {learningPrioritiesPropTypes} from '../../my-learning';\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 'learningPrioritiesCards': {\n return (\n <CardsList\n {...section}\n title={\n <Title\n {...{\n type: 'form-group',\n title: section.title,\n subtitle: section.subtitle,\n icon: {\n iconName: 'sign-post',\n iconColor: '#A32700',\n borderRadius: '12px',\n backgroundColor: '#FFDCD1'\n },\n tag: {\n label: `${size(section.cards)}`,\n type: 'default',\n size: 'S'\n }\n }}\n />\n }\n arrows-aria-label={showMoreOnLeftOrRightAriaLabel}\n />\n );\n }\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 case 'learningProfile':\n return <LearningProfileBanner {...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(learningPrioritiesPropTypes),\n PropTypes.shape(NewsList.propTypes),\n PropTypes.shape(StartBattle.propTypes),\n PropTypes.shape(ReviewBanner.propTypes),\n PropTypes.shape(LearningProfileBanner.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;AAEA,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,qBAAP,MAAkC,qDAAlC;AACA,OAAOC,KAAP,MAAkB,qBAAlB;AACA,SAAQC,2BAAR,QAA0C,mBAA1C;AACA,OAAOC,KAAP,MAAkB,aAAlB;AAEA,MAAMC,IAAI,gBAAGd,KAAK,CAACe,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,CAACI,SAAL,2CAAiB;EACfF,IAAI,EAAEf,SAA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EAElBjB,SAAS,CAACkB,KAAV,CAAgBd,SAAS,CAACa,SAA1B,CAFkB,EAGlBjB,SAAS,CAACkB,KAAV,CAAgBP,2BAAhB,CAHkB,EAIlBX,SAAS,CAACkB,KAAV,CAAgBb,QAAQ,CAACY,SAAzB,CAJkB,EAKlBjB,SAAS,CAACkB,KAAV,CAAgBZ,WAAW,CAACW,SAA5B,CALkB,EAMlBjB,SAAS,CAACkB,KAAV,CAAgBV,YAAY,CAACS,SAA7B,CANkB,EAOlBjB,SAAS,CAACkB,KAAV,CAAgBT,qBAAqB,CAACQ,SAAtC,CAPkB,CAApB,CADQ,CAHU;EAcpBK,MAAM,EAAEtB,SAAS,CAACkB,KAAV,CAAgBX,OAAO,CAACU,SAAxB,CAdY;EAepB,qBAAqBb,SAAS,CAACa,SAAV,CAAoB,mBAApB,CAfD;EAgBpBM,cAAc,EAAEvB,SAAS,CAACkB,KAAV,CAAgBX,OAAO,CAACU,SAAxB;AAhBI,CAAtB;AAkBA,eAAeE,SAAf"}
|
|
@@ -116,7 +116,7 @@ declare namespace SearchPage {
|
|
|
116
116
|
dataName: PropTypes.Requireable<string>;
|
|
117
117
|
title: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike>>;
|
|
118
118
|
showMore: PropTypes.Requireable<string>;
|
|
119
|
-
cards: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
119
|
+
cards: PropTypes.Requireable<(NonNullable<PropTypes.InferProps<{
|
|
120
120
|
badge: PropTypes.Requireable<string>;
|
|
121
121
|
image: PropTypes.Requireable<string>;
|
|
122
122
|
disabled: PropTypes.Requireable<boolean>;
|
|
@@ -167,7 +167,13 @@ declare namespace SearchPage {
|
|
|
167
167
|
progression: PropTypes.Requireable<string>;
|
|
168
168
|
adaptive: PropTypes.Requireable<string>;
|
|
169
169
|
}>>;
|
|
170
|
-
}> |
|
|
170
|
+
}> | PropTypes.InferProps<{
|
|
171
|
+
title: PropTypes.Requireable<string>;
|
|
172
|
+
tagLabel: PropTypes.Requireable<string>;
|
|
173
|
+
progression: PropTypes.Requireable<number>;
|
|
174
|
+
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
175
|
+
type: PropTypes.Requireable<string>;
|
|
176
|
+
}> | null | undefined> | null | undefined)[]>;
|
|
171
177
|
customStyle: PropTypes.Requireable<{
|
|
172
178
|
[x: string]: string | null | undefined;
|
|
173
179
|
}>;
|