@coorpacademy/components 11.32.52-alpha.57 → 11.32.52-alpha.58

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.
@@ -81,6 +81,10 @@ declare namespace PlaylistDetail {
81
81
  'aria-label': PropTypes.Requireable<string>;
82
82
  'aria-labelledby': PropTypes.Requireable<string>;
83
83
  }>>;
84
+ const search: PropTypes.Requireable<PropTypes.InferProps<{
85
+ oldValue: PropTypes.Requireable<string>;
86
+ onChange: PropTypes.Requireable<(...args: any[]) => any>;
87
+ }>>;
84
88
  const onBackClick: PropTypes.Requireable<(...args: any[]) => any>;
85
89
  const onContinueLearningClick: PropTypes.Requireable<(...args: any[]) => any>;
86
90
  namespace bannerMicrolearning {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/playlist-detail/index.js"],"names":[],"mappings":";AAgBA,uEAoGC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/playlist-detail/index.js"],"names":[],"mappings":";AAgBA,uEAsGC"}
@@ -26,6 +26,7 @@ const PlaylistDetail = (props, context) => {
26
26
  sorting,
27
27
  onBackClick,
28
28
  onContinueLearningClick,
29
+ search,
29
30
  bannerMicrolearning = {}
30
31
  } = props;
31
32
  const descriptionRef = useRef(null);
@@ -98,7 +99,8 @@ const PlaylistDetail = (props, context) => {
98
99
  type: 'playlist',
99
100
  action: bannerMicrolearningAction,
100
101
  oldSwitchValue
101
- } : {}
102
+ } : {},
103
+ search: search
102
104
  })));
103
105
  };
104
106
 
@@ -118,6 +120,10 @@ PlaylistDetail.propTypes = process.env.NODE_ENV !== "production" ? {
118
120
  options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes))
119
121
  }),
120
122
  sorting: PropTypes.shape(Select.propTypes),
123
+ search: PropTypes.shape({
124
+ oldValue: PropTypes.string,
125
+ onChange: PropTypes.func
126
+ }),
121
127
  onBackClick: PropTypes.func,
122
128
  onContinueLearningClick: PropTypes.func,
123
129
  bannerMicrolearning: {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","useCallback","useState","useEffect","useRef","PropTypes","classnames","Markdown","Provider","Tag","Select","SelectOptionPropTypes","ButtonLinkIcon","Icon","CardsGrid","AllCourses","PlaylistDetailCover","ContinueLearningButton","style","PlaylistDetail","props","context","title","coverImages","playlistRef","description","ongoingCoursesAvailable","playlistCourses","filters","sorting","onBackClick","onContinueLearningClick","bannerMicrolearning","descriptionRef","translate","action","bannerMicrolearningAction","oldSwitchValue","isDescriptionTruncated","setIsDescriptionTruncated","showMore","setShowMore","handleShowMore","current","clientHeight","scrollHeight","Description","truncate","backgroundContainer","container","backButton","ctaContainer","coverWrapper","showMoreWrapper","faSize","wrapperSize","continueLearningButton","type","contextTypes","skin","childContextTypes","propTypes","string","isRequired","images","bool","shape","onChange","func","options","arrayOf"],"sources":["../../../src/template/playlist-detail/index.js"],"sourcesContent":["import React, {useCallback, useState, useEffect, useRef} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {isNil} from 'lodash/fp';\nimport Markdown from 'markdown-to-jsx';\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 PlaylistDetailCover from '../../molecule/playlist-detail-cover';\nimport {ContinueLearningButton} from '../skill-detail';\nimport style from './style.css';\n\nconst PlaylistDetail = (props, context) => {\n const {\n title,\n coverImages,\n playlistRef,\n description,\n ongoingCoursesAvailable,\n playlistCourses,\n filters,\n sorting,\n onBackClick,\n onContinueLearningClick,\n bannerMicrolearning = {}\n } = props;\n const descriptionRef = useRef(null);\n const {translate} = context;\n const {action: bannerMicrolearningAction, oldSwitchValue} = bannerMicrolearning;\n\n const [isDescriptionTruncated, setIsDescriptionTruncated] = useState(false);\n const [showMore, setShowMore] = useState(false);\n\n const handleShowMore = useCallback(() => setShowMore(!showMore), [setShowMore, showMore]);\n\n useEffect(() => {\n if (descriptionRef.current) {\n const {clientHeight = 0, scrollHeight = 0} = descriptionRef.current;\n setIsDescriptionTruncated(scrollHeight > clientHeight);\n }\n }, [description]);\n\n const Description = useCallback(() => {\n return (\n <div\n ref={descriptionRef}\n className={classnames(style.description, !showMore && style.truncate)}\n >\n <Markdown>{description}</Markdown>\n </div>\n );\n }, [showMore, description]);\n\n return (\n <div className={style.backgroundContainer}>\n <div className={style.container} data-name={playlistRef}>\n {!isNil(onBackClick) ? (\n <ButtonLinkIcon\n faIcon=\"arrow-left\"\n data-name=\"back-button\"\n aria-label={translate('back')}\n onClick={onBackClick}\n className={style.backButton}\n tooltipPlacement=\"right\"\n />\n ) : null}\n <div className={style.ctaContainer}>\n <div className={style.coverWrapper}>\n <PlaylistDetailCover images={coverImages} />\n </div>\n <div>\n <Tag label={translate('playlist')} />\n <div className={style.title}>{title}</div>\n {description ? (\n <>\n <Description />\n {isDescriptionTruncated ? (\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.continueLearningButton}>\n <ContinueLearningButton\n ongoingCoursesAvailable={ongoingCoursesAvailable}\n onClick={onContinueLearningClick}\n />\n </div>\n </div>\n </div>\n <AllCourses\n content={playlistCourses}\n filters={filters}\n sorting={sorting}\n bannerMicrolearning={\n bannerMicrolearningAction\n ? {\n type: 'playlist',\n action: bannerMicrolearningAction,\n oldSwitchValue\n }\n : {}\n }\n />\n </div>\n </div>\n );\n};\n\nPlaylistDetail.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nPlaylistDetail.propTypes = {\n title: PropTypes.string.isRequired,\n coverImages: PlaylistDetailCover.propTypes.images,\n playlistRef: PropTypes.string.isRequired,\n description: PropTypes.string,\n ongoingCoursesAvailable: PropTypes.bool,\n playlistCourses: PropTypes.shape(CardsGrid.propTypes),\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 bannerMicrolearning: {\n action: PropTypes.func,\n oldSwitchValue: PropTypes.bool\n }\n};\n\nexport default PlaylistDetail;\n"],"mappings":";AAAA,OAAOA,KAAP,IAAeC,WAAf,EAA4BC,QAA5B,EAAsCC,SAAtC,EAAiDC,MAAjD,QAA8D,OAA9D;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AAEA,OAAOC,QAAP,MAAqB,iBAArB;AACA,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;AACA,OAAOC,mBAAP,MAAgC,sCAAhC;AACA,SAAQC,sBAAR,QAAqC,iBAArC;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,cAAc,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EACzC,MAAM;IACJC,KADI;IAEJC,WAFI;IAGJC,WAHI;IAIJC,WAJI;IAKJC,uBALI;IAMJC,eANI;IAOJC,OAPI;IAQJC,OARI;IASJC,WATI;IAUJC,uBAVI;IAWJC,mBAAmB,GAAG;EAXlB,IAYFZ,KAZJ;EAaA,MAAMa,cAAc,GAAG7B,MAAM,CAAC,IAAD,CAA7B;EACA,MAAM;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AAE1B,QAAQ,CAACoD,iBAAT,CAA2B1B;AAFV,CAA9B;AAKAf,cAAc,CAAC0C,SAAf,2CAA2B;EACzBvC,KAAK,EAAEjB,SAAS,CAACyD,MAAV,CAAiBC,UADC;EAEzBxC,WAAW,EAAEP,mBAAmB,CAAC6C,SAApB,CAA8BG,MAFlB;EAGzBxC,WAAW,EAAEnB,SAAS,CAACyD,MAAV,CAAiBC,UAHL;EAIzBtC,WAAW,EAAEpB,SAAS,CAACyD,MAJE;EAKzBpC,uBAAuB,EAAErB,SAAS,CAAC4D,IALV;EAMzBtC,eAAe,EAAEtB,SAAS,CAAC6D,KAAV,CAAgBpD,SAAS,CAAC+C,SAA1B,CANQ;EAOzBjC,OAAO,EAAEvB,SAAS,CAAC6D,KAAV,CAAgB;IACvBC,QAAQ,EAAE9D,SAAS,CAAC+D,IADG;IAEvBC,OAAO,EAAEhE,SAAS,CAACiE,OAAV,CAAkBjE,SAAS,CAAC6D,KAAV,CAAgBvD,qBAAhB,CAAlB;EAFc,CAAhB,CAPgB;EAWzBkB,OAAO,EAAExB,SAAS,CAAC6D,KAAV,CAAgBxD,MAAM,CAACmD,SAAvB,CAXgB;EAYzB/B,WAAW,EAAEzB,SAAS,CAAC+D,IAZE;EAazBrC,uBAAuB,EAAE1B,SAAS,CAAC+D,IAbV;EAczBpC,mBAAmB,EAAE;IACnBG,MAAM,EAAE9B,SAAS,CAAC+D,IADC;IAEnB/B,cAAc,EAAEhC,SAAS,CAAC4D;EAFP;AAdI,CAA3B;AAoBA,eAAe9C,cAAf"}
1
+ {"version":3,"file":"index.js","names":["React","useCallback","useState","useEffect","useRef","PropTypes","classnames","Markdown","Provider","Tag","Select","SelectOptionPropTypes","ButtonLinkIcon","Icon","CardsGrid","AllCourses","PlaylistDetailCover","ContinueLearningButton","style","PlaylistDetail","props","context","title","coverImages","playlistRef","description","ongoingCoursesAvailable","playlistCourses","filters","sorting","onBackClick","onContinueLearningClick","search","bannerMicrolearning","descriptionRef","translate","action","bannerMicrolearningAction","oldSwitchValue","isDescriptionTruncated","setIsDescriptionTruncated","showMore","setShowMore","handleShowMore","current","clientHeight","scrollHeight","Description","truncate","backgroundContainer","container","backButton","ctaContainer","coverWrapper","showMoreWrapper","faSize","wrapperSize","continueLearningButton","type","contextTypes","skin","childContextTypes","propTypes","string","isRequired","images","bool","shape","onChange","func","options","arrayOf","oldValue"],"sources":["../../../src/template/playlist-detail/index.js"],"sourcesContent":["import React, {useCallback, useState, useEffect, useRef} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {isNil} from 'lodash/fp';\nimport Markdown from 'markdown-to-jsx';\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 PlaylistDetailCover from '../../molecule/playlist-detail-cover';\nimport {ContinueLearningButton} from '../skill-detail';\nimport style from './style.css';\n\nconst PlaylistDetail = (props, context) => {\n const {\n title,\n coverImages,\n playlistRef,\n description,\n ongoingCoursesAvailable,\n playlistCourses,\n filters,\n sorting,\n onBackClick,\n onContinueLearningClick,\n search,\n bannerMicrolearning = {}\n } = props;\n const descriptionRef = useRef(null);\n const {translate} = context;\n const {action: bannerMicrolearningAction, oldSwitchValue} = bannerMicrolearning;\n\n const [isDescriptionTruncated, setIsDescriptionTruncated] = useState(false);\n const [showMore, setShowMore] = useState(false);\n\n const handleShowMore = useCallback(() => setShowMore(!showMore), [setShowMore, showMore]);\n\n useEffect(() => {\n if (descriptionRef.current) {\n const {clientHeight = 0, scrollHeight = 0} = descriptionRef.current;\n setIsDescriptionTruncated(scrollHeight > clientHeight);\n }\n }, [description]);\n\n const Description = useCallback(() => {\n return (\n <div\n ref={descriptionRef}\n className={classnames(style.description, !showMore && style.truncate)}\n >\n <Markdown>{description}</Markdown>\n </div>\n );\n }, [showMore, description]);\n\n return (\n <div className={style.backgroundContainer}>\n <div className={style.container} data-name={playlistRef}>\n {!isNil(onBackClick) ? (\n <ButtonLinkIcon\n faIcon=\"arrow-left\"\n data-name=\"back-button\"\n aria-label={translate('back')}\n onClick={onBackClick}\n className={style.backButton}\n tooltipPlacement=\"right\"\n />\n ) : null}\n <div className={style.ctaContainer}>\n <div className={style.coverWrapper}>\n <PlaylistDetailCover images={coverImages} />\n </div>\n <div>\n <Tag label={translate('playlist')} />\n <div className={style.title}>{title}</div>\n {description ? (\n <>\n <Description />\n {isDescriptionTruncated ? (\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.continueLearningButton}>\n <ContinueLearningButton\n ongoingCoursesAvailable={ongoingCoursesAvailable}\n onClick={onContinueLearningClick}\n />\n </div>\n </div>\n </div>\n <AllCourses\n content={playlistCourses}\n filters={filters}\n sorting={sorting}\n bannerMicrolearning={\n bannerMicrolearningAction\n ? {\n type: 'playlist',\n action: bannerMicrolearningAction,\n oldSwitchValue\n }\n : {}\n }\n search={search}\n />\n </div>\n </div>\n );\n};\n\nPlaylistDetail.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nPlaylistDetail.propTypes = {\n title: PropTypes.string.isRequired,\n coverImages: PlaylistDetailCover.propTypes.images,\n playlistRef: PropTypes.string.isRequired,\n description: PropTypes.string,\n ongoingCoursesAvailable: PropTypes.bool,\n playlistCourses: PropTypes.shape(CardsGrid.propTypes),\n filters: PropTypes.shape({\n onChange: PropTypes.func,\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes))\n }),\n sorting: PropTypes.shape(Select.propTypes),\n search: PropTypes.shape({\n oldValue: PropTypes.string,\n onChange: PropTypes.func\n }),\n onBackClick: PropTypes.func,\n onContinueLearningClick: PropTypes.func,\n bannerMicrolearning: {\n action: PropTypes.func,\n oldSwitchValue: PropTypes.bool\n }\n};\n\nexport default PlaylistDetail;\n"],"mappings":";AAAA,OAAOA,KAAP,IAAeC,WAAf,EAA4BC,QAA5B,EAAsCC,SAAtC,EAAiDC,MAAjD,QAA8D,OAA9D;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AAEA,OAAOC,QAAP,MAAqB,iBAArB;AACA,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;AACA,OAAOC,mBAAP,MAAgC,sCAAhC;AACA,SAAQC,sBAAR,QAAqC,iBAArC;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,cAAc,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EACzC,MAAM;IACJC,KADI;IAEJC,WAFI;IAGJC,WAHI;IAIJC,WAJI;IAKJC,uBALI;IAMJC,eANI;IAOJC,OAPI;IAQJC,OARI;IASJC,WATI;IAUJC,uBAVI;IAWJC,MAXI;IAYJC,mBAAmB,GAAG;EAZlB,IAaFb,KAbJ;EAcA,MAAMc,cAAc,GAAG9B,MAAM,CAAC,IAAD,CAA7B;EACA,MAAM;IAAC+B;EAAD,IAAcd,OAApB;EACA,MAAM;IAACe,MAAM,EAAEC,yBAAT;IAAoCC;EAApC,IAAsDL,mBAA5D;EAEA,MAAM,CAACM,sBAAD,EAAyBC,yBAAzB,IAAsDtC,QAAQ,CAAC,KAAD,CAApE;EACA,MAAM,CAACuC,QAAD,EAAWC,WAAX,IAA0BxC,QAAQ,CAAC,KAAD,CA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C,WAAW,EAAEnB,SAAS,CAAC0D,MAAV,CAAiBC,UAHL;EAIzBvC,WAAW,EAAEpB,SAAS,CAAC0D,MAJE;EAKzBrC,uBAAuB,EAAErB,SAAS,CAAC6D,IALV;EAMzBvC,eAAe,EAAEtB,SAAS,CAAC8D,KAAV,CAAgBrD,SAAS,CAACgD,SAA1B,CANQ;EAOzBlC,OAAO,EAAEvB,SAAS,CAAC8D,KAAV,CAAgB;IACvBC,QAAQ,EAAE/D,SAAS,CAACgE,IADG;IAEvBC,OAAO,EAAEjE,SAAS,CAACkE,OAAV,CAAkBlE,SAAS,CAAC8D,KAAV,CAAgBxD,qBAAhB,CAAlB;EAFc,CAAhB,CAPgB;EAWzBkB,OAAO,EAAExB,SAAS,CAAC8D,KAAV,CAAgBzD,MAAM,CAACoD,SAAvB,CAXgB;EAYzB9B,MAAM,EAAE3B,SAAS,CAAC8D,KAAV,CAAgB;IACtBK,QAAQ,EAAEnE,SAAS,CAAC0D,MADE;IAEtBK,QAAQ,EAAE/D,SAAS,CAACgE;EAFE,CAAhB,CAZiB;EAgBzBvC,WAAW,EAAEzB,SAAS,CAACgE,IAhBE;EAiBzBtC,uBAAuB,EAAE1B,SAAS,CAACgE,IAjBV;EAkBzBpC,mBAAmB,EAAE;IACnBG,MAAM,EAAE/B,SAAS,CAACgE,IADC;IAEnB/B,cAAc,EAAEjC,SAAS,CAAC6D;EAFP;AAlBI,CAA3B;AAwBA,eAAe/C,cAAf"}
@@ -79,6 +79,10 @@ declare namespace AllCourses {
79
79
  action: PropTypes.Requireable<(...args: any[]) => any>;
80
80
  oldSwitchValue: PropTypes.Requireable<boolean>;
81
81
  }>>;
82
+ const search: PropTypes.Requireable<PropTypes.InferProps<{
83
+ oldValue: PropTypes.Requireable<string>;
84
+ onChange: PropTypes.Requireable<(...args: any[]) => any>;
85
+ }>>;
82
86
  }
83
87
  }
84
88
  import PropTypes from "prop-types";
@@ -1 +1 @@
1
- {"version":3,"file":"all-courses.d.ts","sourceRoot":"","sources":["../../../src/template/skill-detail/all-courses.js"],"names":[],"mappings":";AAiDA,mEAgJC"}
1
+ {"version":3,"file":"all-courses.d.ts","sourceRoot":"","sources":["../../../src/template/skill-detail/all-courses.js"],"names":[],"mappings":";AAgDA,mEA0JC"}
@@ -1,3 +1,4 @@
1
+ import _debounce from "lodash/fp/debounce";
1
2
  import _isEmpty from "lodash/fp/isEmpty";
2
3
  import _isNil from "lodash/fp/isNil";
3
4
  import _size from "lodash/fp/size";
@@ -14,7 +15,6 @@ import Select, { SelectOptionPropTypes } from '../../atom/select';
14
15
  import ButtonLink from '../../atom/button-link';
15
16
  import SearchForm from '../../molecule/search-form';
16
17
  import CardsGrid from '../../organism/cards-grid';
17
- import searchValueIncluded from '../../util/search-value-included';
18
18
  import InputSwitch from '../../atom/input-switch';
19
19
  import Banner from '../../molecule/banner';
20
20
  import style from './all-courses.css';
@@ -73,7 +73,11 @@ const AllCourses = (props, context) => {
73
73
  filters,
74
74
  sorting,
75
75
  totalContents,
76
- bannerMicrolearning = {}
76
+ bannerMicrolearning = {},
77
+ search: {
78
+ oldValue: oldSearchValue,
79
+ onChange: handleSearch
80
+ }
77
81
  } = props;
78
82
  const {
79
83
  options,
@@ -89,7 +93,7 @@ const AllCourses = (props, context) => {
89
93
  oldSwitchValue
90
94
  } = bannerMicrolearning;
91
95
  const [showCompleted, setShowCompleted] = useState(true);
92
- const [searchValue, setSearchValue] = useState('');
96
+ const [searchValue, setSearchValue] = useState(oldSearchValue || '');
93
97
  const sortView = sorting !== undefined ? /*#__PURE__*/React.createElement("div", {
94
98
  "data-name": "choice"
95
99
  }, /*#__PURE__*/React.createElement(Select, _extends({}, sorting, {
@@ -98,15 +102,17 @@ const AllCourses = (props, context) => {
98
102
  const filteredContent = useMemo(() => {
99
103
  return showCompleted ? list : _filter(course => course.progress < 1, list);
100
104
  }, [list, showCompleted]);
101
- const contentResult = useMemo(() => {
102
- return _filter(skill => searchValueIncluded(skill.title, searchValue), filteredContent);
103
- }, [filteredContent, searchValue]);
104
- const handleSearch = useCallback(value => {
105
+
106
+ const debounceHandleSearch = _debounce(300, value => handleSearch(value));
107
+
108
+ const onSearchChange = useCallback(value => {
105
109
  setSearchValue(value);
106
- }, [setSearchValue]);
107
- const handleSearchReset = useCallback(() => {
110
+ debounceHandleSearch(value);
111
+ }, [debounceHandleSearch]);
112
+ const handleSearchReset = useCallback(value => {
108
113
  setSearchValue('');
109
- }, [setSearchValue]);
114
+ debounceHandleSearch('');
115
+ }, [debounceHandleSearch]);
110
116
  const handleShowCompletedToggle = useCallback(() => {
111
117
  setShowCompleted(prevShowCompleted => !prevShowCompleted);
112
118
  }, []);
@@ -116,7 +122,7 @@ const AllCourses = (props, context) => {
116
122
  className: style.continueLearningTitle
117
123
  }, translate('all_content')), /*#__PURE__*/React.createElement("span", {
118
124
  className: style.continueLearningNumber
119
- }, _isNil(totalContents) ? _size(contentResult) : totalContents)), /*#__PURE__*/React.createElement("div", {
125
+ }, _isNil(totalContents) ? _size(filteredContent) : totalContents)), /*#__PURE__*/React.createElement("div", {
120
126
  className: style.searchAndSortSection
121
127
  }, /*#__PURE__*/React.createElement("div", {
122
128
  className: style.searchWrapper
@@ -124,7 +130,7 @@ const AllCourses = (props, context) => {
124
130
  search: {
125
131
  placeholder: translate('search_place_holder'),
126
132
  value: searchValue,
127
- onChange: handleSearch
133
+ onChange: onSearchChange
128
134
  },
129
135
  onReset: handleSearchReset,
130
136
  dataTestId: "all-courses-search-input"
@@ -176,8 +182,8 @@ const AllCourses = (props, context) => {
176
182
  }), value === 'ALL' ? /*#__PURE__*/React.createElement("div", {
177
183
  className: style.divider
178
184
  }) : null);
179
- }, options) : null), /*#__PURE__*/React.createElement("div", null, _size(contentResult) ? /*#__PURE__*/React.createElement(CardsGrid, {
180
- list: contentResult,
185
+ }, options) : null), /*#__PURE__*/React.createElement("div", null, _size(filteredContent) ? /*#__PURE__*/React.createElement(CardsGrid, {
186
+ list: filteredContent,
181
187
  loading: loading,
182
188
  customStyle: {
183
189
  justifyContent: 'left'
@@ -212,6 +218,10 @@ AllCourses.propTypes = process.env.NODE_ENV !== "production" ? {
212
218
  type: PropTypes.oneOf(['skill', 'playlist']),
213
219
  action: PropTypes.func,
214
220
  oldSwitchValue: PropTypes.bool
221
+ }),
222
+ search: PropTypes.shape({
223
+ oldValue: PropTypes.string,
224
+ onChange: PropTypes.func
215
225
  })
216
226
  } : {};
217
227
  export default AllCourses;
@@ -1 +1 @@
1
- {"version":3,"file":"all-courses.js","names":["React","useState","useCallback","useMemo","PropTypes","Provider","Select","SelectOptionPropTypes","ButtonLink","SearchForm","CardsGrid","searchValueIncluded","InputSwitch","Banner","style","uncappedMap","convert","cap","FilterButton","props","context","dataName","ariaLabel","selected","label","onClick","skin","primarySkinColor","buttonProps","customStyle","backgroundColor","color","transition","width","contextTypes","childContextTypes","translate","propTypes","string","bool","func","AllCourses","content","filters","sorting","totalContents","bannerMicrolearning","options","onChange","list","loading","type","bannerMessageType","action","bannerAction","oldSwitchValue","showCompleted","setShowCompleted","searchValue","setSearchValue","sortView","undefined","filteredContent","course","progress","contentResult","skill","title","handleSearch","value","handleSearchReset","handleShowCompletedToggle","prevShowCompleted","continueLearningWrapper","continueLearningTitle","continueLearningNumber","searchAndSortSection","searchWrapper","placeholder","sortSection","sortWrapper","bannerWrapper","filterWrapper","filterProps","index","name","handleFilterChange","filterButtonWrapper","divider","justifyContent","emptySearchResultContainer","emptySearchResultTitle","emptySearchResultDescription","emptySearchResultClearSearch","shape","number","arrayOf","oneOf"],"sources":["../../../src/template/skill-detail/all-courses.js"],"sourcesContent":["import React, {useState, useCallback, useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport {get, filter, map, size, isNil, isEmpty} 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 Banner from '../../molecule/banner';\nimport style from './all-courses.css';\n\nconst uncappedMap = map.convert({cap: false});\n\nconst FilterButton = (props, context) => {\n const {dataName, ariaLabel, selected, label, 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,\n onClick,\n 'data-name': dataName,\n 'aria-label': ariaLabel\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 dataName: PropTypes.string,\n ariaLabel: PropTypes.string,\n selected: PropTypes.bool,\n label: PropTypes.string,\n onClick: PropTypes.func\n};\n\nconst AllCourses = (props, context) => {\n const {translate} = context;\n const {content, filters, sorting, totalContents, bannerMicrolearning = {}} = props;\n const {options, onChange} = filters;\n const {list, loading} = content;\n const {type: bannerMessageType, action: bannerAction, oldSwitchValue} = bannerMicrolearning;\n const [showCompleted, setShowCompleted] = useState(true);\n const [searchValue, setSearchValue] = useState('');\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 const filteredContent = useMemo(() => {\n return showCompleted ? list : filter(course => course.progress < 1, list);\n }, [list, showCompleted]);\n\n const contentResult = useMemo(() => {\n return filter(skill => searchValueIncluded(skill.title, searchValue), filteredContent);\n }, [filteredContent, searchValue]);\n\n const handleSearch = useCallback(\n value => {\n setSearchValue(value);\n },\n [setSearchValue]\n );\n\n const handleSearchReset = useCallback(() => {\n setSearchValue('');\n }, [setSearchValue]);\n\n const handleShowCompletedToggle = useCallback(() => {\n setShowCompleted(prevShowCompleted => !prevShowCompleted);\n }, []);\n\n return (\n <>\n <div className={style.continueLearningWrapper}>\n <span className={style.continueLearningTitle}>{translate('all_content')}</span>\n <span className={style.continueLearningNumber}>\n {isNil(totalContents) ? size(contentResult) : totalContents}\n </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 dataTestId=\"all-courses-search-input\"\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 {!isEmpty(bannerMicrolearning) ? (\n <div className={style.bannerWrapper}>\n <Banner\n type=\"info\"\n message={\n bannerMessageType === 'skill'\n ? translate('banner_microlearning_rule_message_skill')\n : translate('banner_microlearning_rule_message')\n }\n cta={[\n {\n type: 'switch',\n label: translate('banner_microlearning_rule_label'),\n action: bannerAction,\n oldSwitchValue\n }\n ]}\n />\n </div>\n ) : null}\n <div className={style.filterWrapper}>\n {size(options) > 2\n ? uncappedMap((filterProps, index) => {\n const {name, value, selected} = filterProps;\n\n function handleFilterChange() {\n onChange(value);\n }\n\n return (\n <div key={index} className={style.filterButtonWrapper}>\n <FilterButton\n dataName={`filter-button-${value}`}\n ariaLabel={`Filter by ${name}`}\n selected={selected}\n label={name}\n onClick={handleFilterChange}\n />\n {value === 'ALL' ? <div className={style.divider} /> : null}\n </div>\n );\n }, options)\n : null}\n </div>\n <div>\n {size(contentResult) ? (\n <CardsGrid\n list={contentResult}\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 content: PropTypes.shape(CardsGrid.propTypes),\n totalContents: 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 bannerMicrolearning: PropTypes.shape({\n type: PropTypes.oneOf(['skill', 'playlist']),\n action: PropTypes.func,\n oldSwitchValue: PropTypes.bool\n })\n};\n\nexport default AllCourses;\n"],"mappings":";;;;;;;;;AAAA,OAAOA,KAAP,IAAeC,QAAf,EAAyBC,WAAzB,EAAsCC,OAAtC,QAAoD,OAApD;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,MAAP,MAAmB,uBAAnB;AACA,OAAOC,KAAP,MAAkB,mBAAlB;;AAEA,MAAMC,WAAW,GAAG,KAAIC,OAAJ,CAAY;EAACC,GAAG,EAAE;AAAN,CAAZ,CAApB;;AAEA,MAAMC,YAAY,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EACvC,MAAM;IAACC,QAAD;IAAWC,SAAX;IAAsBC,QAAtB;IAAgCC,KAAhC;IAAuCC;EAAvC,IAAkDN,KAAxD;EACA,MAAM;IAACO;EAAD,IAASN,OAAf;;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,GACGlC,SAAS,CAAC,kCAAD,CADZ,CAPF,CARJ,CAjFF,CADF;AAyGD,CAhJD;;AAkJAK,UAAU,CAACP,YAAX,GAA0B;EACxBR,IAAI,EAAErB,QAAQ,CAAC8B,iBAAT,CAA2BT,IADT;EAExBU,SAAS,EAAE/B,QAAQ,CAAC8B,iBAAT,CAA2BC;AAFd,CAA1B;AAKAK,UAAU,CAACJ,SAAX,2CAAuB;EACrBK,OAAO,EAAEtC,SAAS,CAAC0F,KAAV,CAAgBpF,SAAS,CAAC2B,SAA1B,CADY;EAErBQ,aAAa,EAAEzC,SAAS,CAAC2F,MAFJ;EAGrBpD,OAAO,EAAEvC,SAAS,CAAC0F,KAAV,CAAgB;IACvB9C,QAAQ,EAAE5C,SAAS,CAACoC,IADG;IAEvBO,OAAO,EAAE3C,SAAS,CAAC4F,OAAV,CAAkB5F,SAAS,CAAC0F,KAAV,CAAgBvF,qBAAhB,CAAlB;EAFc,CAAhB,CAHY;EAOrBqC,OAAO,EAAExC,SAAS,CAAC0F,KAAV,CAAgBxF,MAAM,CAAC+B,SAAvB,CAPY;EAQrBS,mBAAmB,EAAE1C,SAAS,CAAC0F,KAAV,CAAgB;IACnC3C,IAAI,EAAE/C,SAAS,CAAC6F,KAAV,CAAgB,CAAC,OAAD,EAAU,UAAV,CAAhB,CAD6B;IAEnC5C,MAAM,EAAEjD,SAAS,CAACoC,IAFiB;IAGnCe,cAAc,EAAEnD,SAAS,CAACmC;EAHS,CAAhB;AARA,CAAvB;AAeA,eAAeE,UAAf"}
1
+ {"version":3,"file":"all-courses.js","names":["React","useState","useCallback","useMemo","PropTypes","Provider","Select","SelectOptionPropTypes","ButtonLink","SearchForm","CardsGrid","InputSwitch","Banner","style","uncappedMap","convert","cap","FilterButton","props","context","dataName","ariaLabel","selected","label","onClick","skin","primarySkinColor","buttonProps","customStyle","backgroundColor","color","transition","width","contextTypes","childContextTypes","translate","propTypes","string","bool","func","AllCourses","content","filters","sorting","totalContents","bannerMicrolearning","search","oldValue","oldSearchValue","onChange","handleSearch","options","list","loading","type","bannerMessageType","action","bannerAction","oldSwitchValue","showCompleted","setShowCompleted","searchValue","setSearchValue","sortView","undefined","filteredContent","course","progress","debounceHandleSearch","value","onSearchChange","handleSearchReset","handleShowCompletedToggle","prevShowCompleted","continueLearningWrapper","continueLearningTitle","continueLearningNumber","searchAndSortSection","searchWrapper","placeholder","sortSection","sortWrapper","bannerWrapper","filterWrapper","filterProps","index","name","handleFilterChange","filterButtonWrapper","divider","justifyContent","emptySearchResultContainer","emptySearchResultTitle","emptySearchResultDescription","emptySearchResultClearSearch","shape","number","arrayOf","oneOf"],"sources":["../../../src/template/skill-detail/all-courses.js"],"sourcesContent":["import React, {useState, useCallback, useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport {get, filter, map, size, isNil, isEmpty, debounce} 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 InputSwitch from '../../atom/input-switch';\nimport Banner from '../../molecule/banner';\nimport style from './all-courses.css';\n\nconst uncappedMap = map.convert({cap: false});\n\nconst FilterButton = (props, context) => {\n const {dataName, ariaLabel, selected, label, 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,\n onClick,\n 'data-name': dataName,\n 'aria-label': ariaLabel\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 dataName: PropTypes.string,\n ariaLabel: PropTypes.string,\n selected: PropTypes.bool,\n label: PropTypes.string,\n onClick: PropTypes.func\n};\n\nconst AllCourses = (props, context) => {\n const {translate} = context;\n const {\n content,\n filters,\n sorting,\n totalContents,\n bannerMicrolearning = {},\n search: {oldValue: oldSearchValue, onChange: handleSearch}\n } = props;\n const {options, onChange} = filters;\n const {list, loading} = content;\n const {type: bannerMessageType, action: bannerAction, oldSwitchValue} = bannerMicrolearning;\n const [showCompleted, setShowCompleted] = useState(true);\n const [searchValue, setSearchValue] = useState(oldSearchValue || '');\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 const filteredContent = useMemo(() => {\n return showCompleted ? list : filter(course => course.progress < 1, list);\n }, [list, showCompleted]);\n\n const debounceHandleSearch = debounce(300, value => handleSearch(value));\n\n const onSearchChange = useCallback(\n value => {\n setSearchValue(value);\n debounceHandleSearch(value);\n },\n [debounceHandleSearch]\n );\n\n const handleSearchReset = useCallback(\n value => {\n setSearchValue('');\n debounceHandleSearch('');\n },\n [debounceHandleSearch]\n );\n\n const handleShowCompletedToggle = useCallback(() => {\n setShowCompleted(prevShowCompleted => !prevShowCompleted);\n }, []);\n\n return (\n <>\n <div className={style.continueLearningWrapper}>\n <span className={style.continueLearningTitle}>{translate('all_content')}</span>\n <span className={style.continueLearningNumber}>\n {isNil(totalContents) ? size(filteredContent) : totalContents}\n </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: onSearchChange\n }}\n onReset={handleSearchReset}\n dataTestId=\"all-courses-search-input\"\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 {!isEmpty(bannerMicrolearning) ? (\n <div className={style.bannerWrapper}>\n <Banner\n type=\"info\"\n message={\n bannerMessageType === 'skill'\n ? translate('banner_microlearning_rule_message_skill')\n : translate('banner_microlearning_rule_message')\n }\n cta={[\n {\n type: 'switch',\n label: translate('banner_microlearning_rule_label'),\n action: bannerAction,\n oldSwitchValue\n }\n ]}\n />\n </div>\n ) : null}\n <div className={style.filterWrapper}>\n {size(options) > 2\n ? uncappedMap((filterProps, index) => {\n const {name, value, selected} = filterProps;\n\n function handleFilterChange() {\n onChange(value);\n }\n\n return (\n <div key={index} className={style.filterButtonWrapper}>\n <FilterButton\n dataName={`filter-button-${value}`}\n ariaLabel={`Filter by ${name}`}\n selected={selected}\n label={name}\n onClick={handleFilterChange}\n />\n {value === 'ALL' ? <div className={style.divider} /> : null}\n </div>\n );\n }, options)\n : null}\n </div>\n <div>\n {size(filteredContent) ? (\n <CardsGrid\n list={filteredContent}\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 content: PropTypes.shape(CardsGrid.propTypes),\n totalContents: 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 bannerMicrolearning: PropTypes.shape({\n type: PropTypes.oneOf(['skill', 'playlist']),\n action: PropTypes.func,\n oldSwitchValue: PropTypes.bool\n }),\n search: PropTypes.shape({\n oldValue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AAQ,EAAE7C,SAAS,CAACmC,IADG;IAEvBY,OAAO,EAAE/C,SAAS,CAAC6F,OAAV,CAAkB7F,SAAS,CAAC2F,KAAV,CAAgBxF,qBAAhB,CAAlB;EAFc,CAAhB,CAHY;EAOrBoC,OAAO,EAAEvC,SAAS,CAAC2F,KAAV,CAAgBzF,MAAM,CAAC8B,SAAvB,CAPY;EAQrBS,mBAAmB,EAAEzC,SAAS,CAAC2F,KAAV,CAAgB;IACnCzC,IAAI,EAAElD,SAAS,CAAC8F,KAAV,CAAgB,CAAC,OAAD,EAAU,UAAV,CAAhB,CAD6B;IAEnC1C,MAAM,EAAEpD,SAAS,CAACmC,IAFiB;IAGnCmB,cAAc,EAAEtD,SAAS,CAACkC;EAHS,CAAhB,CARA;EAarBQ,MAAM,EAAE1C,SAAS,CAAC2F,KAAV,CAAgB;IACtBhD,QAAQ,EAAE3C,SAAS,CAACiC,MADE;IAEtBY,QAAQ,EAAE7C,SAAS,CAACmC;EAFE,CAAhB;AAba,CAAvB;AAmBA,eAAeC,UAAf"}
@@ -81,6 +81,10 @@ declare namespace PlaylistDetail {
81
81
  'aria-label': PropTypes.Requireable<string>;
82
82
  'aria-labelledby': PropTypes.Requireable<string>;
83
83
  }>>;
84
+ const search: PropTypes.Requireable<PropTypes.InferProps<{
85
+ oldValue: PropTypes.Requireable<string>;
86
+ onChange: PropTypes.Requireable<(...args: any[]) => any>;
87
+ }>>;
84
88
  const onBackClick: PropTypes.Requireable<(...args: any[]) => any>;
85
89
  const onContinueLearningClick: PropTypes.Requireable<(...args: any[]) => any>;
86
90
  namespace bannerMicrolearning {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/playlist-detail/index.js"],"names":[],"mappings":";AAgBA,uEAoGC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/playlist-detail/index.js"],"names":[],"mappings":";AAgBA,uEAsGC"}
@@ -51,6 +51,7 @@ const PlaylistDetail = (props, context) => {
51
51
  sorting,
52
52
  onBackClick,
53
53
  onContinueLearningClick,
54
+ search,
54
55
  bannerMicrolearning = {}
55
56
  } = props;
56
57
  const descriptionRef = (0, _react.useRef)(null);
@@ -123,7 +124,8 @@ const PlaylistDetail = (props, context) => {
123
124
  type: 'playlist',
124
125
  action: bannerMicrolearningAction,
125
126
  oldSwitchValue
126
- } : {}
127
+ } : {},
128
+ search: search
127
129
  })));
128
130
  };
129
131
 
@@ -143,6 +145,10 @@ PlaylistDetail.propTypes = process.env.NODE_ENV !== "production" ? {
143
145
  options: _propTypes.default.arrayOf(_propTypes.default.shape(_select.SelectOptionPropTypes))
144
146
  }),
145
147
  sorting: _propTypes.default.shape(_select.default.propTypes),
148
+ search: _propTypes.default.shape({
149
+ oldValue: _propTypes.default.string,
150
+ onChange: _propTypes.default.func
151
+ }),
146
152
  onBackClick: _propTypes.default.func,
147
153
  onContinueLearningClick: _propTypes.default.func,
148
154
  bannerMicrolearning: {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["PlaylistDetail","props","context","title","coverImages","playlistRef","description","ongoingCoursesAvailable","playlistCourses","filters","sorting","onBackClick","onContinueLearningClick","bannerMicrolearning","descriptionRef","useRef","translate","action","bannerMicrolearningAction","oldSwitchValue","isDescriptionTruncated","setIsDescriptionTruncated","useState","showMore","setShowMore","handleShowMore","useCallback","useEffect","current","clientHeight","scrollHeight","Description","classnames","style","truncate","backgroundContainer","container","backButton","ctaContainer","coverWrapper","showMoreWrapper","faSize","wrapperSize","continueLearningButton","type","contextTypes","skin","Provider","childContextTypes","propTypes","PropTypes","string","isRequired","PlaylistDetailCover","images","bool","shape","CardsGrid","onChange","func","options","arrayOf","SelectOptionPropTypes","Select"],"sources":["../../../src/template/playlist-detail/index.js"],"sourcesContent":["import React, {useCallback, useState, useEffect, useRef} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {isNil} from 'lodash/fp';\nimport Markdown from 'markdown-to-jsx';\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 PlaylistDetailCover from '../../molecule/playlist-detail-cover';\nimport {ContinueLearningButton} from '../skill-detail';\nimport style from './style.css';\n\nconst PlaylistDetail = (props, context) => {\n const {\n title,\n coverImages,\n playlistRef,\n description,\n ongoingCoursesAvailable,\n playlistCourses,\n filters,\n sorting,\n onBackClick,\n onContinueLearningClick,\n bannerMicrolearning = {}\n } = props;\n const descriptionRef = useRef(null);\n const {translate} = context;\n const {action: bannerMicrolearningAction, oldSwitchValue} = bannerMicrolearning;\n\n const [isDescriptionTruncated, setIsDescriptionTruncated] = useState(false);\n const [showMore, setShowMore] = useState(false);\n\n const handleShowMore = useCallback(() => setShowMore(!showMore), [setShowMore, showMore]);\n\n useEffect(() => {\n if (descriptionRef.current) {\n const {clientHeight = 0, scrollHeight = 0} = descriptionRef.current;\n setIsDescriptionTruncated(scrollHeight > clientHeight);\n }\n }, [description]);\n\n const Description = useCallback(() => {\n return (\n <div\n ref={descriptionRef}\n className={classnames(style.description, !showMore && style.truncate)}\n >\n <Markdown>{description}</Markdown>\n </div>\n );\n }, [showMore, description]);\n\n return (\n <div className={style.backgroundContainer}>\n <div className={style.container} data-name={playlistRef}>\n {!isNil(onBackClick) ? (\n <ButtonLinkIcon\n faIcon=\"arrow-left\"\n data-name=\"back-button\"\n aria-label={translate('back')}\n onClick={onBackClick}\n className={style.backButton}\n tooltipPlacement=\"right\"\n />\n ) : null}\n <div className={style.ctaContainer}>\n <div className={style.coverWrapper}>\n <PlaylistDetailCover images={coverImages} />\n </div>\n <div>\n <Tag label={translate('playlist')} />\n <div className={style.title}>{title}</div>\n {description ? (\n <>\n <Description />\n {isDescriptionTruncated ? (\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.continueLearningButton}>\n <ContinueLearningButton\n ongoingCoursesAvailable={ongoingCoursesAvailable}\n onClick={onContinueLearningClick}\n />\n </div>\n </div>\n </div>\n <AllCourses\n content={playlistCourses}\n filters={filters}\n sorting={sorting}\n bannerMicrolearning={\n bannerMicrolearningAction\n ? {\n type: 'playlist',\n action: bannerMicrolearningAction,\n oldSwitchValue\n }\n : {}\n }\n />\n </div>\n </div>\n );\n};\n\nPlaylistDetail.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nPlaylistDetail.propTypes = {\n title: PropTypes.string.isRequired,\n coverImages: PlaylistDetailCover.propTypes.images,\n playlistRef: PropTypes.string.isRequired,\n description: PropTypes.string,\n ongoingCoursesAvailable: PropTypes.bool,\n playlistCourses: PropTypes.shape(CardsGrid.propTypes),\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 bannerMicrolearning: {\n action: PropTypes.func,\n oldSwitchValue: PropTypes.bool\n }\n};\n\nexport default PlaylistDetail;\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAEA,MAAMA,cAAc,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EACzC,MAAM;IACJC,KADI;IAEJC,WAFI;IAGJC,WAHI;IAIJC,WAJI;IAKJC,uBALI;IAMJC,eANI;IAOJC,OAPI;IAQJC,OARI;IASJC,WATI;IAUJC,uBAVI;IAWJC,mBAAmB,GAAG;EAXlB,IAYFZ,KAZJ;E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,YAAf,GAA8B;EAC5BC,IAAI,EAAEC,iBAAA,CAASC,iBAAT,CAA2BF,IADL;EAE5B9B,SAAS,EAAE+B,iBAAA,CAASC,iBAAT,CAA2BhC;AAFV,CAA9B;AAKAhB,cAAc,CAACiD,SAAf,2CAA2B;EACzB9C,KAAK,EAAE+C,kBAAA,CAAUC,MAAV,CAAiBC,UADC;EAEzBhD,WAAW,EAAEiD,4BAAA,CAAoBJ,SAApB,CAA8BK,MAFlB;EAGzBjD,WAAW,EAAE6C,kBAAA,CAAUC,MAAV,CAAiBC,UAHL;EAIzB9C,WAAW,EAAE4C,kBAAA,CAAUC,MAJE;EAKzB5C,uBAAuB,EAAE2C,kBAAA,CAAUK,IALV;EAMzB/C,eAAe,EAAE0C,kBAAA,CAAUM,KAAV,CAAgBC,kBAAA,CAAUR,SAA1B,CANQ;EAOzBxC,OAAO,EAAEyC,kBAAA,CAAUM,KAAV,CAAgB;IACvBE,QAAQ,EAAER,kBAAA,CAAUS,IADG;IAEvBC,OAAO,EAAEV,kBAAA,CAAUW,OAAV,CAAkBX,kBAAA,CAAUM,KAAV,CAAgBM,6BAAhB,CAAlB;EAFc,CAAhB,CAPgB;EAWzBpD,OAAO,EAAEwC,kBAAA,CAAUM,KAAV,CAAgBO,eAAA,CAAOd,SAAvB,CAXgB;EAYzBtC,WAAW,EAAEuC,kBAAA,CAAUS,IAZE;EAazB/C,uBAAuB,EAAEsC,kBAAA,CAAUS,IAbV;EAczB9C,mBAAmB,EAAE;IACnBI,MAAM,EAAEiC,kBAAA,CAAUS,IADC;IAEnBxC,cAAc,EAAE+B,kBAAA,CAAUK;EAFP;AAdI,CAA3B;eAoBevD,c"}
1
+ {"version":3,"file":"index.js","names":["PlaylistDetail","props","context","title","coverImages","playlistRef","description","ongoingCoursesAvailable","playlistCourses","filters","sorting","onBackClick","onContinueLearningClick","search","bannerMicrolearning","descriptionRef","useRef","translate","action","bannerMicrolearningAction","oldSwitchValue","isDescriptionTruncated","setIsDescriptionTruncated","useState","showMore","setShowMore","handleShowMore","useCallback","useEffect","current","clientHeight","scrollHeight","Description","classnames","style","truncate","backgroundContainer","container","backButton","ctaContainer","coverWrapper","showMoreWrapper","faSize","wrapperSize","continueLearningButton","type","contextTypes","skin","Provider","childContextTypes","propTypes","PropTypes","string","isRequired","PlaylistDetailCover","images","bool","shape","CardsGrid","onChange","func","options","arrayOf","SelectOptionPropTypes","Select","oldValue"],"sources":["../../../src/template/playlist-detail/index.js"],"sourcesContent":["import React, {useCallback, useState, useEffect, useRef} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {isNil} from 'lodash/fp';\nimport Markdown from 'markdown-to-jsx';\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 PlaylistDetailCover from '../../molecule/playlist-detail-cover';\nimport {ContinueLearningButton} from '../skill-detail';\nimport style from './style.css';\n\nconst PlaylistDetail = (props, context) => {\n const {\n title,\n coverImages,\n playlistRef,\n description,\n ongoingCoursesAvailable,\n playlistCourses,\n filters,\n sorting,\n onBackClick,\n onContinueLearningClick,\n search,\n bannerMicrolearning = {}\n } = props;\n const descriptionRef = useRef(null);\n const {translate} = context;\n const {action: bannerMicrolearningAction, oldSwitchValue} = bannerMicrolearning;\n\n const [isDescriptionTruncated, setIsDescriptionTruncated] = useState(false);\n const [showMore, setShowMore] = useState(false);\n\n const handleShowMore = useCallback(() => setShowMore(!showMore), [setShowMore, showMore]);\n\n useEffect(() => {\n if (descriptionRef.current) {\n const {clientHeight = 0, scrollHeight = 0} = descriptionRef.current;\n setIsDescriptionTruncated(scrollHeight > clientHeight);\n }\n }, [description]);\n\n const Description = useCallback(() => {\n return (\n <div\n ref={descriptionRef}\n className={classnames(style.description, !showMore && style.truncate)}\n >\n <Markdown>{description}</Markdown>\n </div>\n );\n }, [showMore, description]);\n\n return (\n <div className={style.backgroundContainer}>\n <div className={style.container} data-name={playlistRef}>\n {!isNil(onBackClick) ? (\n <ButtonLinkIcon\n faIcon=\"arrow-left\"\n data-name=\"back-button\"\n aria-label={translate('back')}\n onClick={onBackClick}\n className={style.backButton}\n tooltipPlacement=\"right\"\n />\n ) : null}\n <div className={style.ctaContainer}>\n <div className={style.coverWrapper}>\n <PlaylistDetailCover images={coverImages} />\n </div>\n <div>\n <Tag label={translate('playlist')} />\n <div className={style.title}>{title}</div>\n {description ? (\n <>\n <Description />\n {isDescriptionTruncated ? (\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.continueLearningButton}>\n <ContinueLearningButton\n ongoingCoursesAvailable={ongoingCoursesAvailable}\n onClick={onContinueLearningClick}\n />\n </div>\n </div>\n </div>\n <AllCourses\n content={playlistCourses}\n filters={filters}\n sorting={sorting}\n bannerMicrolearning={\n bannerMicrolearningAction\n ? {\n type: 'playlist',\n action: bannerMicrolearningAction,\n oldSwitchValue\n }\n : {}\n }\n search={search}\n />\n </div>\n </div>\n );\n};\n\nPlaylistDetail.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nPlaylistDetail.propTypes = {\n title: PropTypes.string.isRequired,\n coverImages: PlaylistDetailCover.propTypes.images,\n playlistRef: PropTypes.string.isRequired,\n description: PropTypes.string,\n ongoingCoursesAvailable: PropTypes.bool,\n playlistCourses: PropTypes.shape(CardsGrid.propTypes),\n filters: PropTypes.shape({\n onChange: PropTypes.func,\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes))\n }),\n sorting: PropTypes.shape(Select.propTypes),\n search: PropTypes.shape({\n oldValue: PropTypes.string,\n onChange: PropTypes.func\n }),\n onBackClick: PropTypes.func,\n onContinueLearningClick: PropTypes.func,\n bannerMicrolearning: {\n action: PropTypes.func,\n oldSwitchValue: PropTypes.bool\n }\n};\n\nexport default PlaylistDetail;\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAEA,MAAMA,cAAc,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EACzC,MAAM;IACJC,KADI;IAEJC,WAFI;IAGJC,WAHI;IAIJC,WAJI;IAKJC,uBALI;IAMJC,eANI;IAOJC,OAPI;IAQJC,OARI;IASJC,WATI;IAUJC,uBAVI;IAWJC,MAXI;IAYJC,mBAAmB,GAAG;EAZlB,IAaFb,KAbJ;EAcA,MAAMc,cAAc,GAAG,IAAAC,aAAA,EAAO,IAAP,CAAvB;EACA,MAAM;IAACC;EAAD,IAAcf,OAApB;EACA,MAAM;IAACgB,MAAM,EAAEC,yBAAT;IAAoCC;EAApC,IAAsDN,mBAA5D;EAEA,MAAM,CAACO,sBAAD,EAAyBC,yBAAzB,IAAsD,IAAAC,eAAA,EAAS,KAAT,CAA5D;EACA,MAAM,CAACC,QAAD,EAAWC,WAAX,IAA0B,IAAAF,eAAA,EAAS,KAAT,CAAhC;EAEA,MAAMG,cAAc,GAAG,IAAAC,kBAAA,EAAY,MAAMF,WAAW,CAAC,CAACD,QAAF,CAA7B,EAA0C,CAACC,WAAD,EAAcD,QAAd,CAA1C,CAAvB;EAEA,IAAAI,gBAAA,EAAU,MAAM;IACd,IAAIb,cAAc,CAACc,OAAnB,EAA4B;MAC1B,MAAM;QAACC,YAAY,GAAG,CAAhB;QAAmBC,YAAY,GAAG;MAAlC,IAAuChB,cAAc,CAACc,OAA5D;MACAP,yBAAyB,CAACS,YAAY,GAAGD,YAAhB,CAAzB;IACD;EACF,CALD,EAKG,CAACxB,WAAD,CALH;EAOA,MAAM0B,WAAW,GA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CAAlB;EAFc,CAAhB,CAPgB;EAWzBrD,OAAO,EAAEyC,kBAAA,CAAUM,KAAV,CAAgBO,eAAA,CAAOd,SAAvB,CAXgB;EAYzBrC,MAAM,EAAEsC,kBAAA,CAAUM,KAAV,CAAgB;IACtBQ,QAAQ,EAAEd,kBAAA,CAAUC,MADE;IAEtBO,QAAQ,EAAER,kBAAA,CAAUS;EAFE,CAAhB,CAZiB;EAgBzBjD,WAAW,EAAEwC,kBAAA,CAAUS,IAhBE;EAiBzBhD,uBAAuB,EAAEuC,kBAAA,CAAUS,IAjBV;EAkBzB9C,mBAAmB,EAAE;IACnBI,MAAM,EAAEiC,kBAAA,CAAUS,IADC;IAEnBxC,cAAc,EAAE+B,kBAAA,CAAUK;EAFP;AAlBI,CAA3B;eAwBexD,c"}
@@ -79,6 +79,10 @@ declare namespace AllCourses {
79
79
  action: PropTypes.Requireable<(...args: any[]) => any>;
80
80
  oldSwitchValue: PropTypes.Requireable<boolean>;
81
81
  }>>;
82
+ const search: PropTypes.Requireable<PropTypes.InferProps<{
83
+ oldValue: PropTypes.Requireable<string>;
84
+ onChange: PropTypes.Requireable<(...args: any[]) => any>;
85
+ }>>;
82
86
  }
83
87
  }
84
88
  import PropTypes from "prop-types";
@@ -1 +1 @@
1
- {"version":3,"file":"all-courses.d.ts","sourceRoot":"","sources":["../../../src/template/skill-detail/all-courses.js"],"names":[],"mappings":";AAiDA,mEAgJC"}
1
+ {"version":3,"file":"all-courses.d.ts","sourceRoot":"","sources":["../../../src/template/skill-detail/all-courses.js"],"names":[],"mappings":";AAgDA,mEA0JC"}
@@ -3,6 +3,8 @@
3
3
  exports.__esModule = true;
4
4
  exports.default = void 0;
5
5
 
6
+ var _debounce2 = _interopRequireDefault(require("lodash/fp/debounce"));
7
+
6
8
  var _isEmpty2 = _interopRequireDefault(require("lodash/fp/isEmpty"));
7
9
 
8
10
  var _isNil2 = _interopRequireDefault(require("lodash/fp/isNil"));
@@ -29,8 +31,6 @@ var _searchForm = _interopRequireDefault(require("../../molecule/search-form"));
29
31
 
30
32
  var _cardsGrid = _interopRequireDefault(require("../../organism/cards-grid"));
31
33
 
32
- var _searchValueIncluded = _interopRequireDefault(require("../../util/search-value-included"));
33
-
34
34
  var _inputSwitch = _interopRequireDefault(require("../../atom/input-switch"));
35
35
 
36
36
  var _banner = _interopRequireDefault(require("../../molecule/banner"));
@@ -97,7 +97,11 @@ const AllCourses = (props, context) => {
97
97
  filters,
98
98
  sorting,
99
99
  totalContents,
100
- bannerMicrolearning = {}
100
+ bannerMicrolearning = {},
101
+ search: {
102
+ oldValue: oldSearchValue,
103
+ onChange: handleSearch
104
+ }
101
105
  } = props;
102
106
  const {
103
107
  options,
@@ -113,7 +117,7 @@ const AllCourses = (props, context) => {
113
117
  oldSwitchValue
114
118
  } = bannerMicrolearning;
115
119
  const [showCompleted, setShowCompleted] = (0, _react.useState)(true);
116
- const [searchValue, setSearchValue] = (0, _react.useState)('');
120
+ const [searchValue, setSearchValue] = (0, _react.useState)(oldSearchValue || '');
117
121
  const sortView = sorting !== undefined ? /*#__PURE__*/_react.default.createElement("div", {
118
122
  "data-name": "choice"
119
123
  }, /*#__PURE__*/_react.default.createElement(_select.default, _extends({}, sorting, {
@@ -122,15 +126,15 @@ const AllCourses = (props, context) => {
122
126
  const filteredContent = (0, _react.useMemo)(() => {
123
127
  return showCompleted ? list : (0, _filter2.default)(course => course.progress < 1, list);
124
128
  }, [list, showCompleted]);
125
- const contentResult = (0, _react.useMemo)(() => {
126
- return (0, _filter2.default)(skill => (0, _searchValueIncluded.default)(skill.title, searchValue), filteredContent);
127
- }, [filteredContent, searchValue]);
128
- const handleSearch = (0, _react.useCallback)(value => {
129
+ const debounceHandleSearch = (0, _debounce2.default)(300, value => handleSearch(value));
130
+ const onSearchChange = (0, _react.useCallback)(value => {
129
131
  setSearchValue(value);
130
- }, [setSearchValue]);
131
- const handleSearchReset = (0, _react.useCallback)(() => {
132
+ debounceHandleSearch(value);
133
+ }, [debounceHandleSearch]);
134
+ const handleSearchReset = (0, _react.useCallback)(value => {
132
135
  setSearchValue('');
133
- }, [setSearchValue]);
136
+ debounceHandleSearch('');
137
+ }, [debounceHandleSearch]);
134
138
  const handleShowCompletedToggle = (0, _react.useCallback)(() => {
135
139
  setShowCompleted(prevShowCompleted => !prevShowCompleted);
136
140
  }, []);
@@ -140,7 +144,7 @@ const AllCourses = (props, context) => {
140
144
  className: _allCourses.default.continueLearningTitle
141
145
  }, translate('all_content')), /*#__PURE__*/_react.default.createElement("span", {
142
146
  className: _allCourses.default.continueLearningNumber
143
- }, (0, _isNil2.default)(totalContents) ? (0, _size2.default)(contentResult) : totalContents)), /*#__PURE__*/_react.default.createElement("div", {
147
+ }, (0, _isNil2.default)(totalContents) ? (0, _size2.default)(filteredContent) : totalContents)), /*#__PURE__*/_react.default.createElement("div", {
144
148
  className: _allCourses.default.searchAndSortSection
145
149
  }, /*#__PURE__*/_react.default.createElement("div", {
146
150
  className: _allCourses.default.searchWrapper
@@ -148,7 +152,7 @@ const AllCourses = (props, context) => {
148
152
  search: {
149
153
  placeholder: translate('search_place_holder'),
150
154
  value: searchValue,
151
- onChange: handleSearch
155
+ onChange: onSearchChange
152
156
  },
153
157
  onReset: handleSearchReset,
154
158
  dataTestId: "all-courses-search-input"
@@ -200,8 +204,8 @@ const AllCourses = (props, context) => {
200
204
  }), value === 'ALL' ? /*#__PURE__*/_react.default.createElement("div", {
201
205
  className: _allCourses.default.divider
202
206
  }) : null);
203
- }, options) : null), /*#__PURE__*/_react.default.createElement("div", null, (0, _size2.default)(contentResult) ? /*#__PURE__*/_react.default.createElement(_cardsGrid.default, {
204
- list: contentResult,
207
+ }, options) : null), /*#__PURE__*/_react.default.createElement("div", null, (0, _size2.default)(filteredContent) ? /*#__PURE__*/_react.default.createElement(_cardsGrid.default, {
208
+ list: filteredContent,
205
209
  loading: loading,
206
210
  customStyle: {
207
211
  justifyContent: 'left'
@@ -236,6 +240,10 @@ AllCourses.propTypes = process.env.NODE_ENV !== "production" ? {
236
240
  type: _propTypes.default.oneOf(['skill', 'playlist']),
237
241
  action: _propTypes.default.func,
238
242
  oldSwitchValue: _propTypes.default.bool
243
+ }),
244
+ search: _propTypes.default.shape({
245
+ oldValue: _propTypes.default.string,
246
+ onChange: _propTypes.default.func
239
247
  })
240
248
  } : {};
241
249
  var _default = AllCourses;
@@ -1 +1 @@
1
- {"version":3,"file":"all-courses.js","names":["uncappedMap","convert","cap","FilterButton","props","context","dataName","ariaLabel","selected","label","onClick","skin","primarySkinColor","buttonProps","customStyle","backgroundColor","color","transition","width","contextTypes","Provider","childContextTypes","translate","propTypes","PropTypes","string","bool","func","AllCourses","content","filters","sorting","totalContents","bannerMicrolearning","options","onChange","list","loading","type","bannerMessageType","action","bannerAction","oldSwitchValue","showCompleted","setShowCompleted","useState","searchValue","setSearchValue","sortView","undefined","filteredContent","useMemo","course","progress","contentResult","skill","searchValueIncluded","title","handleSearch","useCallback","value","handleSearchReset","handleShowCompletedToggle","prevShowCompleted","style","continueLearningWrapper","continueLearningTitle","continueLearningNumber","searchAndSortSection","searchWrapper","placeholder","sortSection","sortWrapper","bannerWrapper","filterWrapper","filterProps","index","name","handleFilterChange","filterButtonWrapper","divider","justifyContent","emptySearchResultContainer","emptySearchResultTitle","emptySearchResultDescription","emptySearchResultClearSearch","shape","CardsGrid","number","arrayOf","SelectOptionPropTypes","Select","oneOf"],"sources":["../../../src/template/skill-detail/all-courses.js"],"sourcesContent":["import React, {useState, useCallback, useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport {get, filter, map, size, isNil, isEmpty} 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 Banner from '../../molecule/banner';\nimport style from './all-courses.css';\n\nconst uncappedMap = map.convert({cap: false});\n\nconst FilterButton = (props, context) => {\n const {dataName, ariaLabel, selected, label, 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,\n onClick,\n 'data-name': dataName,\n 'aria-label': ariaLabel\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 dataName: PropTypes.string,\n ariaLabel: PropTypes.string,\n selected: PropTypes.bool,\n label: PropTypes.string,\n onClick: PropTypes.func\n};\n\nconst AllCourses = (props, context) => {\n const {translate} = context;\n const {content, filters, sorting, totalContents, bannerMicrolearning = {}} = props;\n const {options, onChange} = filters;\n const {list, loading} = content;\n const {type: bannerMessageType, action: bannerAction, oldSwitchValue} = bannerMicrolearning;\n const [showCompleted, setShowCompleted] = useState(true);\n const [searchValue, setSearchValue] = useState('');\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 const filteredContent = useMemo(() => {\n return showCompleted ? list : filter(course => course.progress < 1, list);\n }, [list, showCompleted]);\n\n const contentResult = useMemo(() => {\n return filter(skill => searchValueIncluded(skill.title, searchValue), filteredContent);\n }, [filteredContent, searchValue]);\n\n const handleSearch = useCallback(\n value => {\n setSearchValue(value);\n },\n [setSearchValue]\n );\n\n const handleSearchReset = useCallback(() => {\n setSearchValue('');\n }, [setSearchValue]);\n\n const handleShowCompletedToggle = useCallback(() => {\n setShowCompleted(prevShowCompleted => !prevShowCompleted);\n }, []);\n\n return (\n <>\n <div className={style.continueLearningWrapper}>\n <span className={style.continueLearningTitle}>{translate('all_content')}</span>\n <span className={style.continueLearningNumber}>\n {isNil(totalContents) ? size(contentResult) : totalContents}\n </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 dataTestId=\"all-courses-search-input\"\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 {!isEmpty(bannerMicrolearning) ? (\n <div className={style.bannerWrapper}>\n <Banner\n type=\"info\"\n message={\n bannerMessageType === 'skill'\n ? translate('banner_microlearning_rule_message_skill')\n : translate('banner_microlearning_rule_message')\n }\n cta={[\n {\n type: 'switch',\n label: translate('banner_microlearning_rule_label'),\n action: bannerAction,\n oldSwitchValue\n }\n ]}\n />\n </div>\n ) : null}\n <div className={style.filterWrapper}>\n {size(options) > 2\n ? uncappedMap((filterProps, index) => {\n const {name, value, selected} = filterProps;\n\n function handleFilterChange() {\n onChange(value);\n }\n\n return (\n <div key={index} className={style.filterButtonWrapper}>\n <FilterButton\n dataName={`filter-button-${value}`}\n ariaLabel={`Filter by ${name}`}\n selected={selected}\n label={name}\n onClick={handleFilterChange}\n />\n {value === 'ALL' ? <div className={style.divider} /> : null}\n </div>\n );\n }, options)\n : null}\n </div>\n <div>\n {size(contentResult) ? (\n <CardsGrid\n list={contentResult}\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 content: PropTypes.shape(CardsGrid.propTypes),\n totalContents: 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 bannerMicrolearning: PropTypes.shape({\n type: PropTypes.oneOf(['skill', 'playlist']),\n action: PropTypes.func,\n oldSwitchValue: PropTypes.bool\n })\n};\n\nexport default AllCourses;\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,WAAW,GAAG,cAAIC,OAAJ,CAAY;EAACC,GAAG,EAAE;AAAN,CAAZ,CAApB;;AAEA,MAAMC,YAAY,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EACvC,MAAM;IAACC,QAAD;IAAWC,SAAX;IAAsBC,QAAtB;IAAgCC,KAAhC;IAAuCC;EAAvC,IAAkDN,KAAxD;EACA,MAAM;IAACO;EAAD,IAASN,OAAf;EACA,MAAMO,gBAAgB,GAAG,mBAAI,gBAAJ,EAAsBD,IAAtB,CAAzB;EAEA,MAAME,WAAW,GAAG;IAClBC,WAAW,EAAE;MACXC,eAAe,EAAEP,QAAQ,GAAGI,gBAAH,GAAsB,SADpC;MAEXI,KAAK,EAAER,QAAQ,GAAG,SAAH,GAAe,SAFnB;MAGXS,UAAU,EAAE,6DAHD;MAIXC,KAAK,EAAE;IAJI,CADK;IAOlBT,KAPkB;IAQlBC,OARkB;IASlB,aAAaJ,QATK;IAUlB,cAAcC;EAVI,CAApB;EAaA,oBAAO,6BAAC,mBAAD,EAAgBM,WAAhB,CAAP;AACD,CAnBD;;AAqBAV,YAAY,CAACgB,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gE,MAFJ;EAGrB1D,OAAO,EAAEN,kBAAA,CAAU8D,KAAV,CAAgB;IACvBnD,QAAQ,EAAEX,kBAAA,CAAUG,IADG;IAEvBO,OAAO,EAAEV,kBAAA,CAAUiE,OAAV,CAAkBjE,kBAAA,CAAU8D,KAAV,CAAgBI,6BAAhB,CAAlB;EAFc,CAAhB,CAHY;EAOrB3D,OAAO,EAAEP,kBAAA,CAAU8D,KAAV,CAAgBK,eAAA,CAAOpE,SAAvB,CAPY;EAQrBU,mBAAmB,EAAET,kBAAA,CAAU8D,KAAV,CAAgB;IACnChD,IAAI,EAAEd,kBAAA,CAAUoE,KAAV,CAAgB,CAAC,OAAD,EAAU,UAAV,CAAhB,CAD6B;IAEnCpD,MAAM,EAAEhB,kBAAA,CAAUG,IAFiB;IAGnCe,cAAc,EAAElB,kBAAA,CAAUE;EAHS,CAAhB;AARA,CAAvB;eAeeE,U"}
1
+ {"version":3,"file":"all-courses.js","names":["uncappedMap","convert","cap","FilterButton","props","context","dataName","ariaLabel","selected","label","onClick","skin","primarySkinColor","buttonProps","customStyle","backgroundColor","color","transition","width","contextTypes","Provider","childContextTypes","translate","propTypes","PropTypes","string","bool","func","AllCourses","content","filters","sorting","totalContents","bannerMicrolearning","search","oldValue","oldSearchValue","onChange","handleSearch","options","list","loading","type","bannerMessageType","action","bannerAction","oldSwitchValue","showCompleted","setShowCompleted","useState","searchValue","setSearchValue","sortView","undefined","filteredContent","useMemo","course","progress","debounceHandleSearch","value","onSearchChange","useCallback","handleSearchReset","handleShowCompletedToggle","prevShowCompleted","style","continueLearningWrapper","continueLearningTitle","continueLearningNumber","searchAndSortSection","searchWrapper","placeholder","sortSection","sortWrapper","bannerWrapper","filterWrapper","filterProps","index","name","handleFilterChange","filterButtonWrapper","divider","justifyContent","emptySearchResultContainer","emptySearchResultTitle","emptySearchResultDescription","emptySearchResultClearSearch","shape","CardsGrid","number","arrayOf","SelectOptionPropTypes","Select","oneOf"],"sources":["../../../src/template/skill-detail/all-courses.js"],"sourcesContent":["import React, {useState, useCallback, useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport {get, filter, map, size, isNil, isEmpty, debounce} 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 InputSwitch from '../../atom/input-switch';\nimport Banner from '../../molecule/banner';\nimport style from './all-courses.css';\n\nconst uncappedMap = map.convert({cap: false});\n\nconst FilterButton = (props, context) => {\n const {dataName, ariaLabel, selected, label, 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,\n onClick,\n 'data-name': dataName,\n 'aria-label': ariaLabel\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 dataName: PropTypes.string,\n ariaLabel: PropTypes.string,\n selected: PropTypes.bool,\n label: PropTypes.string,\n onClick: PropTypes.func\n};\n\nconst AllCourses = (props, context) => {\n const {translate} = context;\n const {\n content,\n filters,\n sorting,\n totalContents,\n bannerMicrolearning = {},\n search: {oldValue: oldSearchValue, onChange: handleSearch}\n } = props;\n const {options, onChange} = filters;\n const {list, loading} = content;\n const {type: bannerMessageType, action: bannerAction, oldSwitchValue} = bannerMicrolearning;\n const [showCompleted, setShowCompleted] = useState(true);\n const [searchValue, setSearchValue] = useState(oldSearchValue || '');\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 const filteredContent = useMemo(() => {\n return showCompleted ? list : filter(course => course.progress < 1, list);\n }, [list, showCompleted]);\n\n const debounceHandleSearch = debounce(300, value => handleSearch(value));\n\n const onSearchChange = useCallback(\n value => {\n setSearchValue(value);\n debounceHandleSearch(value);\n },\n [debounceHandleSearch]\n );\n\n const handleSearchReset = useCallback(\n value => {\n setSearchValue('');\n debounceHandleSearch('');\n },\n [debounceHandleSearch]\n );\n\n const handleShowCompletedToggle = useCallback(() => {\n setShowCompleted(prevShowCompleted => !prevShowCompleted);\n }, []);\n\n return (\n <>\n <div className={style.continueLearningWrapper}>\n <span className={style.continueLearningTitle}>{translate('all_content')}</span>\n <span className={style.continueLearningNumber}>\n {isNil(totalContents) ? size(filteredContent) : totalContents}\n </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: onSearchChange\n }}\n onReset={handleSearchReset}\n dataTestId=\"all-courses-search-input\"\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 {!isEmpty(bannerMicrolearning) ? (\n <div className={style.bannerWrapper}>\n <Banner\n type=\"info\"\n message={\n bannerMessageType === 'skill'\n ? translate('banner_microlearning_rule_message_skill')\n : translate('banner_microlearning_rule_message')\n }\n cta={[\n {\n type: 'switch',\n label: translate('banner_microlearning_rule_label'),\n action: bannerAction,\n oldSwitchValue\n }\n ]}\n />\n </div>\n ) : null}\n <div className={style.filterWrapper}>\n {size(options) > 2\n ? uncappedMap((filterProps, index) => {\n const {name, value, selected} = filterProps;\n\n function handleFilterChange() {\n onChange(value);\n }\n\n return (\n <div key={index} className={style.filterButtonWrapper}>\n <FilterButton\n dataName={`filter-button-${value}`}\n ariaLabel={`Filter by ${name}`}\n selected={selected}\n label={name}\n onClick={handleFilterChange}\n />\n {value === 'ALL' ? <div className={style.divider} /> : null}\n </div>\n );\n }, options)\n : null}\n </div>\n <div>\n {size(filteredContent) ? (\n <CardsGrid\n list={filteredContent}\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 content: PropTypes.shape(CardsGrid.propTypes),\n totalContents: 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 bannerMicrolearning: PropTypes.shape({\n type: PropTypes.oneOf(['skill', 'playlist']),\n action: PropTypes.func,\n oldSwitchValue: PropTypes.bool\n }),\n search: PropTypes.shape({\n oldValue: PropTypes.string,\n onChange: PropTypes.func\n })\n};\n\nexport default AllCourses;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,WAAW,GAAG,cAAIC,OAAJ,CAAY;EAACC,GAAG,EAAE;AAAN,CAAZ,CAApB;;AAEA,MAAMC,YAAY,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EACvC,MAAM;IAACC,QAAD;IAAWC,SAAX;IAAsBC,QAAtB;IAAgCC,KAAhC;IAAuCC;EAAvC,IAAkDN,KAAxD;EACA,MAAM;IAACO;EAAD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pacademy/components",
3
- "version": "11.32.52-alpha.57+5d4912647",
3
+ "version": "11.32.52-alpha.58+a615e64ee",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -178,5 +178,5 @@
178
178
  "last 2 versions",
179
179
  "IE 11"
180
180
  ],
181
- "gitHead": "5d4912647e417b81e7c0bc6ee78cf60f4cbb895b"
181
+ "gitHead": "a615e64ee2cf2f92d67c8b83e8baf5225038406e"
182
182
  }