@coorpacademy/components 11.32.14 → 11.32.15-alpha.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/atom/button-link/style.css +1 -0
- package/es/atom/select/index.d.ts.map +1 -1
- package/es/atom/select/index.js +2 -1
- package/es/atom/select/index.js.map +1 -1
- package/es/atom/select/style.css +23 -0
- package/es/molecule/cm-popin/types.d.ts +3 -0
- package/es/molecule/cm-popin/types.d.ts.map +1 -1
- package/es/molecule/dashboard/cards-list/index.d.ts +4 -1
- package/es/molecule/dashboard/cards-list/index.d.ts.map +1 -1
- package/es/molecule/dashboard/cards-list/index.js +8 -3
- package/es/molecule/dashboard/cards-list/index.js.map +1 -1
- package/es/molecule/dashboard/cards-list/prop-types.d.ts +3 -1
- package/es/molecule/dashboard/cards-list/prop-types.d.ts.map +1 -1
- package/es/molecule/dashboard/cards-list/prop-types.js.map +1 -1
- package/es/molecule/dashboard/cards-list/style.css +4 -0
- package/es/molecule/discipline-associated-skills/index.d.ts +1 -0
- package/es/molecule/discipline-associated-skills/index.js +2 -1
- package/es/molecule/discipline-associated-skills/index.js.map +1 -1
- package/es/molecule/discipline-associated-skills/style.css +16 -3
- package/es/organism/cards-grid/index.d.ts +3 -0
- package/es/organism/cards-grid/index.js +4 -1
- package/es/organism/cards-grid/index.js.map +1 -1
- package/es/organism/cards-grid/style.css +0 -1
- package/es/template/app-player/loading/index.d.ts +3 -0
- package/es/template/app-player/player/index.d.ts +6 -0
- package/es/template/app-player/player/slides/index.d.ts +3 -0
- package/es/template/app-player/player/slides/index.d.ts.map +1 -1
- package/es/template/app-player/popin-correction/index.d.ts +3 -0
- package/es/template/app-player/popin-correction/index.d.ts.map +1 -1
- package/es/template/app-player/popin-end/index.d.ts +7 -1
- package/es/template/app-player/popin-end/summary.d.ts +4 -1
- package/es/template/app-review/index.d.ts +3 -0
- package/es/template/app-review/index.d.ts.map +1 -1
- package/es/template/app-review/player/prop-types.d.ts +3 -0
- package/es/template/app-review/player/prop-types.d.ts.map +1 -1
- package/es/template/app-review/prop-types.d.ts +3 -0
- package/es/template/app-review/prop-types.d.ts.map +1 -1
- package/es/template/back-office/brand-update/index.d.ts +3 -0
- package/es/template/common/authors/index.d.ts +3 -0
- package/es/template/common/authors/index.d.ts.map +1 -1
- package/es/template/common/dashboard/index.d.ts +6 -0
- package/es/template/common/discipline/index.d.ts +1 -0
- package/es/template/common/discipline/index.js +1 -0
- package/es/template/common/discipline/index.js.map +1 -1
- package/es/template/common/search-page/index.d.ts +10 -1
- package/es/template/external-course/index.d.ts +3 -0
- package/es/template/my-learning/index.d.ts +3 -0
- package/es/template/my-learning/index.d.ts.map +1 -1
- package/es/template/my-learning/index.js +8 -3
- package/es/template/my-learning/index.js.map +1 -1
- package/es/template/skill-detail/all-courses.css +128 -0
- package/es/template/skill-detail/all-courses.d.ts +80 -0
- package/es/template/skill-detail/all-courses.d.ts.map +1 -0
- package/es/template/skill-detail/all-courses.js +195 -0
- package/es/template/skill-detail/all-courses.js.map +1 -0
- package/es/template/skill-detail/continue-learning.css +16 -0
- package/es/template/skill-detail/continue-learning.d.ts +39 -0
- package/es/template/skill-detail/continue-learning.d.ts.map +1 -0
- package/es/template/skill-detail/continue-learning.js +42 -0
- package/es/template/skill-detail/continue-learning.js.map +1 -0
- package/es/template/skill-detail/index.d.ts +101 -0
- package/es/template/skill-detail/index.d.ts.map +1 -0
- package/es/template/skill-detail/index.js +228 -0
- package/es/template/skill-detail/index.js.map +1 -0
- package/es/template/skill-detail/style.css +174 -0
- package/es/template/teams-dashboard/index.d.ts +4 -1
- package/lib/atom/button-link/style.css +1 -0
- package/lib/atom/select/index.d.ts.map +1 -1
- package/lib/atom/select/index.js +2 -1
- package/lib/atom/select/index.js.map +1 -1
- package/lib/atom/select/style.css +23 -0
- package/lib/molecule/cm-popin/types.d.ts +3 -0
- package/lib/molecule/cm-popin/types.d.ts.map +1 -1
- package/lib/molecule/dashboard/cards-list/index.d.ts +4 -1
- package/lib/molecule/dashboard/cards-list/index.d.ts.map +1 -1
- package/lib/molecule/dashboard/cards-list/index.js +8 -4
- package/lib/molecule/dashboard/cards-list/index.js.map +1 -1
- package/lib/molecule/dashboard/cards-list/prop-types.d.ts +3 -1
- package/lib/molecule/dashboard/cards-list/prop-types.d.ts.map +1 -1
- package/lib/molecule/dashboard/cards-list/prop-types.js.map +1 -1
- package/lib/molecule/dashboard/cards-list/style.css +4 -0
- package/lib/molecule/discipline-associated-skills/index.d.ts +1 -0
- package/lib/molecule/discipline-associated-skills/index.js +2 -1
- package/lib/molecule/discipline-associated-skills/index.js.map +1 -1
- package/lib/molecule/discipline-associated-skills/style.css +16 -3
- package/lib/organism/cards-grid/index.d.ts +3 -0
- package/lib/organism/cards-grid/index.js +4 -1
- package/lib/organism/cards-grid/index.js.map +1 -1
- package/lib/organism/cards-grid/style.css +0 -1
- package/lib/template/app-player/loading/index.d.ts +3 -0
- package/lib/template/app-player/player/index.d.ts +6 -0
- package/lib/template/app-player/player/slides/index.d.ts +3 -0
- package/lib/template/app-player/player/slides/index.d.ts.map +1 -1
- package/lib/template/app-player/popin-correction/index.d.ts +3 -0
- package/lib/template/app-player/popin-correction/index.d.ts.map +1 -1
- package/lib/template/app-player/popin-end/index.d.ts +7 -1
- package/lib/template/app-player/popin-end/summary.d.ts +4 -1
- package/lib/template/app-review/index.d.ts +3 -0
- package/lib/template/app-review/index.d.ts.map +1 -1
- package/lib/template/app-review/player/prop-types.d.ts +3 -0
- package/lib/template/app-review/player/prop-types.d.ts.map +1 -1
- package/lib/template/app-review/prop-types.d.ts +3 -0
- package/lib/template/app-review/prop-types.d.ts.map +1 -1
- package/lib/template/back-office/brand-update/index.d.ts +3 -0
- package/lib/template/common/authors/index.d.ts +3 -0
- package/lib/template/common/authors/index.d.ts.map +1 -1
- package/lib/template/common/dashboard/index.d.ts +6 -0
- package/lib/template/common/discipline/index.d.ts +1 -0
- package/lib/template/common/discipline/index.js +1 -0
- package/lib/template/common/discipline/index.js.map +1 -1
- package/lib/template/common/search-page/index.d.ts +10 -1
- package/lib/template/external-course/index.d.ts +3 -0
- package/lib/template/my-learning/index.d.ts +3 -0
- package/lib/template/my-learning/index.d.ts.map +1 -1
- package/lib/template/my-learning/index.js +8 -3
- package/lib/template/my-learning/index.js.map +1 -1
- package/lib/template/skill-detail/all-courses.css +128 -0
- package/lib/template/skill-detail/all-courses.d.ts +80 -0
- package/lib/template/skill-detail/all-courses.d.ts.map +1 -0
- package/lib/template/skill-detail/all-courses.js +214 -0
- package/lib/template/skill-detail/all-courses.js.map +1 -0
- package/lib/template/skill-detail/continue-learning.css +16 -0
- package/lib/template/skill-detail/continue-learning.d.ts +39 -0
- package/lib/template/skill-detail/continue-learning.d.ts.map +1 -0
- package/lib/template/skill-detail/continue-learning.js +59 -0
- package/lib/template/skill-detail/continue-learning.js.map +1 -0
- package/lib/template/skill-detail/index.d.ts +101 -0
- package/lib/template/skill-detail/index.d.ts.map +1 -0
- package/lib/template/skill-detail/index.js +250 -0
- package/lib/template/skill-detail/index.js.map +1 -0
- package/lib/template/skill-detail/style.css +174 -0
- package/lib/template/teams-dashboard/index.d.ts +4 -1
- package/locales/en/global.json +8 -0
- package/package.json +2 -2
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
@value colors: "../../variables/colors.css";
|
|
2
|
+
@value breakpoints: "../../variables/breakpoints.css";
|
|
3
|
+
@value tablet from breakpoints;
|
|
4
|
+
@value mobile from breakpoints;
|
|
5
|
+
@value xtraLightGrey from colors;
|
|
6
|
+
@value cm_grey_100 from colors;
|
|
7
|
+
@value cm_grey_200 from colors;
|
|
8
|
+
@value cm_grey_400 from colors;
|
|
9
|
+
|
|
10
|
+
.continueLearningWrapper {
|
|
11
|
+
margin-top: 40px;
|
|
12
|
+
margin-bottom: 16px;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.continueLearningTitle {
|
|
16
|
+
font-size: 16px;
|
|
17
|
+
font-weight: 600;
|
|
18
|
+
line-height: 22px;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.continueLearningNumber {
|
|
22
|
+
border-radius: 50%;
|
|
23
|
+
background-color: #EAEAEB;
|
|
24
|
+
color: #515161;
|
|
25
|
+
padding: 2px 4px;
|
|
26
|
+
margin-left: 8px;
|
|
27
|
+
font-size: 10px;
|
|
28
|
+
font-weight: 600;
|
|
29
|
+
line-height: 12px;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.searchAndSortSection {
|
|
33
|
+
display: flex;
|
|
34
|
+
margin-bottom: 16px;
|
|
35
|
+
justify-content: space-between;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.searchWrapper {
|
|
39
|
+
border-radius: 12px;
|
|
40
|
+
width: 300px;
|
|
41
|
+
background-color: cm_grey_100;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.sortSection {
|
|
45
|
+
display: flex;
|
|
46
|
+
gap: 32px;
|
|
47
|
+
align-items: center;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.sortWrapper {
|
|
51
|
+
display: flex;
|
|
52
|
+
align-items: center;
|
|
53
|
+
gap: 12px;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.filterWrapper {
|
|
57
|
+
display: flex;
|
|
58
|
+
gap: 12px;
|
|
59
|
+
margin-bottom: 32px;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.filterButtonWrapper {
|
|
63
|
+
display: flex;
|
|
64
|
+
align-items: center;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.divider {
|
|
68
|
+
height: 24px;
|
|
69
|
+
width: 1px;
|
|
70
|
+
background-color: cm_grey_200;
|
|
71
|
+
margin-left: 12px;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.emptySearchResultContainer {
|
|
75
|
+
display: flex;
|
|
76
|
+
flex-direction: column;
|
|
77
|
+
align-items: center;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.emptySearchResultTitle {
|
|
81
|
+
font-size: 20px;
|
|
82
|
+
font-weight: 700;
|
|
83
|
+
line-height: 28px;
|
|
84
|
+
margin-bottom: 8px;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.emptySearchResultDescription {
|
|
88
|
+
font-size: 16px;
|
|
89
|
+
font-weight: 500;
|
|
90
|
+
line-height: 22px;
|
|
91
|
+
margin-bottom: 16px;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.emptySearchResultClearSearch {
|
|
95
|
+
color: #0061FF;
|
|
96
|
+
font-size: 14px;
|
|
97
|
+
font-style: normal;
|
|
98
|
+
font-weight: 600;
|
|
99
|
+
line-height: 20px;
|
|
100
|
+
cursor: pointer;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.emptySearchResultClearSearch:hover {
|
|
104
|
+
text-decoration: underline;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
@media (max-width: 799px) {
|
|
108
|
+
.searchAndSortSection {
|
|
109
|
+
flex-direction: column;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.sortSection {
|
|
113
|
+
margin-top: 16px;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
@media mobile {
|
|
118
|
+
.sortSection {
|
|
119
|
+
flex-direction: column;
|
|
120
|
+
gap: 16px;
|
|
121
|
+
align-items: flex-start;
|
|
122
|
+
margin-top: 16px;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.filterWrapper {
|
|
126
|
+
overflow-x: scroll;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
export default AllCourses;
|
|
2
|
+
declare function AllCourses(props: any, context: any): JSX.Element;
|
|
3
|
+
declare namespace AllCourses {
|
|
4
|
+
namespace contextTypes {
|
|
5
|
+
const skin: PropTypes.Requireable<PropTypes.InferProps<{
|
|
6
|
+
common: PropTypes.Requireable<{
|
|
7
|
+
[x: string]: any;
|
|
8
|
+
}>;
|
|
9
|
+
images: PropTypes.Requireable<PropTypes.InferProps<{
|
|
10
|
+
'logo-mobile': PropTypes.Requireable<any>;
|
|
11
|
+
logo: PropTypes.Requireable<any>;
|
|
12
|
+
'logo-email': PropTypes.Requireable<any>;
|
|
13
|
+
login: PropTypes.Requireable<any>;
|
|
14
|
+
}>>;
|
|
15
|
+
icons: PropTypes.Requireable<{
|
|
16
|
+
[x: string]: any;
|
|
17
|
+
}>;
|
|
18
|
+
mod: PropTypes.Requireable<{
|
|
19
|
+
[x: string]: any;
|
|
20
|
+
}>;
|
|
21
|
+
courses: PropTypes.Requireable<any[]>;
|
|
22
|
+
texts: PropTypes.Requireable<{
|
|
23
|
+
[x: string]: any;
|
|
24
|
+
}>;
|
|
25
|
+
}>>;
|
|
26
|
+
const translate: PropTypes.Requireable<(...args: any[]) => any>;
|
|
27
|
+
}
|
|
28
|
+
namespace propTypes {
|
|
29
|
+
const skillIncludedCourses: PropTypes.Requireable<PropTypes.InferProps<{
|
|
30
|
+
list: PropTypes.Requireable<(PropTypes.InferProps<any> | null | undefined)[]>;
|
|
31
|
+
customStyle: PropTypes.Requireable<{
|
|
32
|
+
[x: string]: string | null | undefined;
|
|
33
|
+
}>;
|
|
34
|
+
loading: PropTypes.Requireable<boolean>;
|
|
35
|
+
}>>;
|
|
36
|
+
const totalCourses: PropTypes.Requireable<number>;
|
|
37
|
+
const filters: PropTypes.Requireable<PropTypes.InferProps<{
|
|
38
|
+
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
39
|
+
options: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
40
|
+
name: PropTypes.Validator<string>;
|
|
41
|
+
value: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
42
|
+
selected: PropTypes.Requireable<boolean>;
|
|
43
|
+
validOption: PropTypes.Requireable<boolean>;
|
|
44
|
+
}> | null | undefined)[]>;
|
|
45
|
+
}>>;
|
|
46
|
+
const sorting: PropTypes.Requireable<PropTypes.InferProps<{
|
|
47
|
+
title: PropTypes.Requireable<string>;
|
|
48
|
+
name: PropTypes.Requireable<string>;
|
|
49
|
+
className: PropTypes.Requireable<string>;
|
|
50
|
+
borderClassName: PropTypes.Requireable<string>;
|
|
51
|
+
disabled: PropTypes.Requireable<boolean>;
|
|
52
|
+
multiple: PropTypes.Requireable<boolean>;
|
|
53
|
+
description: PropTypes.Requireable<string>;
|
|
54
|
+
required: PropTypes.Requireable<boolean>;
|
|
55
|
+
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
56
|
+
theme: PropTypes.Requireable<string>;
|
|
57
|
+
options: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
58
|
+
name: PropTypes.Validator<string>;
|
|
59
|
+
value: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
60
|
+
selected: PropTypes.Requireable<boolean>;
|
|
61
|
+
validOption: PropTypes.Requireable<boolean>;
|
|
62
|
+
}> | null | undefined)[]>;
|
|
63
|
+
optgroups: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
64
|
+
label: PropTypes.Validator<string>;
|
|
65
|
+
options: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
66
|
+
name: PropTypes.Validator<string>;
|
|
67
|
+
value: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
68
|
+
selected: PropTypes.Requireable<boolean>;
|
|
69
|
+
validOption: PropTypes.Requireable<boolean>;
|
|
70
|
+
}> | null | undefined)[]>;
|
|
71
|
+
}> | null | undefined)[]>;
|
|
72
|
+
modified: PropTypes.Requireable<boolean>;
|
|
73
|
+
error: PropTypes.Requireable<boolean>;
|
|
74
|
+
'aria-label': PropTypes.Requireable<string>;
|
|
75
|
+
'aria-labelledby': PropTypes.Requireable<string>;
|
|
76
|
+
}>>;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
import PropTypes from "prop-types";
|
|
80
|
+
//# sourceMappingURL=all-courses.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"all-courses.d.ts","sourceRoot":"","sources":["../../../src/template/skill-detail/all-courses.js"],"names":[],"mappings":";AA2CA,mEAkIC"}
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import _get from "lodash/fp/get";
|
|
2
|
+
|
|
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
|
+
|
|
5
|
+
import React, { useState, useCallback, useEffect } from 'react';
|
|
6
|
+
import PropTypes from 'prop-types';
|
|
7
|
+
import Provider from '../../atom/provider';
|
|
8
|
+
import Select, { SelectOptionPropTypes } from '../../atom/select';
|
|
9
|
+
import ButtonLink from '../../atom/button-link';
|
|
10
|
+
import SearchForm from '../../molecule/search-form';
|
|
11
|
+
import CardsGrid from '../../organism/cards-grid';
|
|
12
|
+
import searchValueIncluded from '../../util/search-value-included';
|
|
13
|
+
import InputSwitch from '../../atom/input-switch';
|
|
14
|
+
import style from './all-courses.css';
|
|
15
|
+
|
|
16
|
+
const FilterButton = (props, context) => {
|
|
17
|
+
const {
|
|
18
|
+
selected,
|
|
19
|
+
filter,
|
|
20
|
+
onClick
|
|
21
|
+
} = props;
|
|
22
|
+
const {
|
|
23
|
+
skin
|
|
24
|
+
} = context;
|
|
25
|
+
|
|
26
|
+
const primarySkinColor = _get('common.primary', skin);
|
|
27
|
+
|
|
28
|
+
const buttonProps = {
|
|
29
|
+
customStyle: {
|
|
30
|
+
backgroundColor: selected ? primarySkinColor : '#E1E1E3',
|
|
31
|
+
color: selected ? '#FFFFFF' : '#515161',
|
|
32
|
+
transition: 'background-color 0.15s ease-in-out, color 0.15s ease-in-out',
|
|
33
|
+
width: 'fit-content'
|
|
34
|
+
},
|
|
35
|
+
label: filter,
|
|
36
|
+
onClick,
|
|
37
|
+
'data-name': 'filter-type-course-button'
|
|
38
|
+
};
|
|
39
|
+
return /*#__PURE__*/React.createElement(ButtonLink, buttonProps);
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
FilterButton.contextTypes = {
|
|
43
|
+
skin: Provider.childContextTypes.skin,
|
|
44
|
+
translate: Provider.childContextTypes.translate
|
|
45
|
+
};
|
|
46
|
+
FilterButton.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
47
|
+
selected: PropTypes.bool,
|
|
48
|
+
filter: PropTypes.string,
|
|
49
|
+
onClick: PropTypes.func
|
|
50
|
+
} : {};
|
|
51
|
+
|
|
52
|
+
const AllCourses = (props, context) => {
|
|
53
|
+
const {
|
|
54
|
+
skillIncludedCourses,
|
|
55
|
+
totalCourses,
|
|
56
|
+
filters,
|
|
57
|
+
sorting
|
|
58
|
+
} = props;
|
|
59
|
+
const {
|
|
60
|
+
options,
|
|
61
|
+
onChange
|
|
62
|
+
} = filters;
|
|
63
|
+
const {
|
|
64
|
+
list,
|
|
65
|
+
loading
|
|
66
|
+
} = skillIncludedCourses;
|
|
67
|
+
const {
|
|
68
|
+
translate
|
|
69
|
+
} = context;
|
|
70
|
+
const [showCompleted, setShowCompleted] = useState(true);
|
|
71
|
+
const [searchValue, setSearchValue] = useState('');
|
|
72
|
+
const [searchResults, setSearchResults] = useState(list.sort((a, b) => {
|
|
73
|
+
const progressA = a.progress ?? 0;
|
|
74
|
+
const progressB = b.progress ?? 0;
|
|
75
|
+
return progressB - progressA;
|
|
76
|
+
}));
|
|
77
|
+
const sortView = sorting !== undefined ? /*#__PURE__*/React.createElement("div", {
|
|
78
|
+
"data-name": "choice"
|
|
79
|
+
}, /*#__PURE__*/React.createElement(Select, _extends({}, sorting, {
|
|
80
|
+
"aria-label": "All courses sort"
|
|
81
|
+
}))) : null;
|
|
82
|
+
useEffect(() => {
|
|
83
|
+
setSearchResults(list.sort((a, b) => {
|
|
84
|
+
const progressA = a.progress ?? 0;
|
|
85
|
+
const progressB = b.progress ?? 0;
|
|
86
|
+
return progressB - progressA;
|
|
87
|
+
}));
|
|
88
|
+
}, [list]);
|
|
89
|
+
const handleSearch = useCallback(value => {
|
|
90
|
+
setSearchValue(value);
|
|
91
|
+
setSearchResults(list.filter(skill => searchValueIncluded(skill.title, value)));
|
|
92
|
+
}, [list, setSearchValue, setSearchResults]);
|
|
93
|
+
const handleSearchReset = useCallback(() => {
|
|
94
|
+
setSearchValue('');
|
|
95
|
+
setSearchResults(list);
|
|
96
|
+
}, [list, setSearchValue, setSearchResults]);
|
|
97
|
+
const handleShowCompletedToggle = useCallback(() => {
|
|
98
|
+
const tempShowCompleted = !showCompleted;
|
|
99
|
+
setShowCompleted(tempShowCompleted);
|
|
100
|
+
|
|
101
|
+
if (tempShowCompleted) {
|
|
102
|
+
setSearchResults(list);
|
|
103
|
+
handleSearchReset();
|
|
104
|
+
} else {
|
|
105
|
+
setSearchResults(searchResults.filter(skill => skill.progress === 0));
|
|
106
|
+
}
|
|
107
|
+
}, [list, searchResults, showCompleted, setShowCompleted, setSearchResults, handleSearchReset]);
|
|
108
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
109
|
+
className: style.continueLearningWrapper
|
|
110
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
111
|
+
className: style.continueLearningTitle
|
|
112
|
+
}, translate('all_courses')), /*#__PURE__*/React.createElement("span", {
|
|
113
|
+
className: style.continueLearningNumber
|
|
114
|
+
}, totalCourses)), /*#__PURE__*/React.createElement("div", {
|
|
115
|
+
className: style.searchAndSortSection
|
|
116
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
117
|
+
className: style.searchWrapper
|
|
118
|
+
}, /*#__PURE__*/React.createElement(SearchForm, {
|
|
119
|
+
search: {
|
|
120
|
+
placeholder: translate('search_place_holder'),
|
|
121
|
+
value: searchValue,
|
|
122
|
+
onChange: handleSearch
|
|
123
|
+
},
|
|
124
|
+
onReset: handleSearchReset
|
|
125
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
126
|
+
className: style.sortSection
|
|
127
|
+
}, /*#__PURE__*/React.createElement(InputSwitch, {
|
|
128
|
+
id: 'show-completed-courses-switch',
|
|
129
|
+
type: "switch",
|
|
130
|
+
name: translate('show_completed'),
|
|
131
|
+
title: translate('show_completed'),
|
|
132
|
+
"aria-label": 'Show completed courses aria label',
|
|
133
|
+
value: showCompleted,
|
|
134
|
+
onChange: handleShowCompletedToggle
|
|
135
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
136
|
+
className: style.sortWrapper
|
|
137
|
+
}, translate('sort_by'), sortView))), /*#__PURE__*/React.createElement("div", {
|
|
138
|
+
className: style.filterWrapper
|
|
139
|
+
}, options.length > 2 && searchResults.length > 0 ? options.map((filter, index) => {
|
|
140
|
+
const {
|
|
141
|
+
name,
|
|
142
|
+
value,
|
|
143
|
+
selected
|
|
144
|
+
} = filter;
|
|
145
|
+
|
|
146
|
+
function handleChange() {
|
|
147
|
+
onChange(value);
|
|
148
|
+
handleSearchReset();
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
152
|
+
key: index,
|
|
153
|
+
className: style.filterButtonWrapper
|
|
154
|
+
}, /*#__PURE__*/React.createElement(FilterButton, {
|
|
155
|
+
selected: selected,
|
|
156
|
+
filter: name,
|
|
157
|
+
onClick: handleChange
|
|
158
|
+
}), value === 'ALL' ? /*#__PURE__*/React.createElement("div", {
|
|
159
|
+
className: style.divider
|
|
160
|
+
}) : null);
|
|
161
|
+
}) : null), /*#__PURE__*/React.createElement("div", null, searchResults.length > 0 ? /*#__PURE__*/React.createElement(CardsGrid, {
|
|
162
|
+
list: searchResults,
|
|
163
|
+
loading: loading,
|
|
164
|
+
customStyle: {
|
|
165
|
+
justifyContent: 'left'
|
|
166
|
+
}
|
|
167
|
+
}) : /*#__PURE__*/React.createElement("div", {
|
|
168
|
+
className: style.emptySearchResultContainer
|
|
169
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
170
|
+
className: style.emptySearchResultTitle
|
|
171
|
+
}, translate('empty_search_result_title', {
|
|
172
|
+
searchValue
|
|
173
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
174
|
+
className: style.emptySearchResultDescription
|
|
175
|
+
}, translate('empty_search_result_description')), /*#__PURE__*/React.createElement("div", {
|
|
176
|
+
className: style.emptySearchResultClearSearch,
|
|
177
|
+
onClick: handleSearchReset
|
|
178
|
+
}, translate('empty_search_result_clear_search')))));
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
AllCourses.contextTypes = {
|
|
182
|
+
skin: Provider.childContextTypes.skin,
|
|
183
|
+
translate: Provider.childContextTypes.translate
|
|
184
|
+
};
|
|
185
|
+
AllCourses.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
186
|
+
skillIncludedCourses: PropTypes.shape(CardsGrid.propTypes),
|
|
187
|
+
totalCourses: PropTypes.number,
|
|
188
|
+
filters: PropTypes.shape({
|
|
189
|
+
onChange: PropTypes.func,
|
|
190
|
+
options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes))
|
|
191
|
+
}),
|
|
192
|
+
sorting: PropTypes.shape(Select.propTypes)
|
|
193
|
+
} : {};
|
|
194
|
+
export default AllCourses;
|
|
195
|
+
//# sourceMappingURL=all-courses.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"all-courses.js","names":["React","useState","useCallback","useEffect","PropTypes","Provider","Select","SelectOptionPropTypes","ButtonLink","SearchForm","CardsGrid","searchValueIncluded","InputSwitch","style","FilterButton","props","context","selected","filter","onClick","skin","primarySkinColor","buttonProps","customStyle","backgroundColor","color","transition","width","label","contextTypes","childContextTypes","translate","propTypes","bool","string","func","AllCourses","skillIncludedCourses","totalCourses","filters","sorting","options","onChange","list","loading","showCompleted","setShowCompleted","searchValue","setSearchValue","searchResults","setSearchResults","sort","a","b","progressA","progress","progressB","sortView","undefined","handleSearch","value","skill","title","handleSearchReset","handleShowCompletedToggle","tempShowCompleted","continueLearningWrapper","continueLearningTitle","continueLearningNumber","searchAndSortSection","searchWrapper","placeholder","sortSection","sortWrapper","filterWrapper","length","map","index","name","handleChange","filterButtonWrapper","divider","justifyContent","emptySearchResultContainer","emptySearchResultTitle","emptySearchResultDescription","emptySearchResultClearSearch","shape","number","arrayOf"],"sources":["../../../src/template/skill-detail/all-courses.js"],"sourcesContent":["import React, {useState, useCallback, useEffect} from 'react';\nimport PropTypes from 'prop-types';\nimport {get} from 'lodash/fp';\nimport Provider from '../../atom/provider';\nimport Select, {SelectOptionPropTypes} from '../../atom/select';\nimport ButtonLink from '../../atom/button-link';\nimport SearchForm from '../../molecule/search-form';\nimport CardsGrid from '../../organism/cards-grid';\nimport searchValueIncluded from '../../util/search-value-included';\nimport InputSwitch from '../../atom/input-switch';\nimport style from './all-courses.css';\n\nconst FilterButton = (props, context) => {\n const {selected, filter, onClick} = props;\n const {skin} = context;\n const primarySkinColor = get('common.primary', skin);\n\n const buttonProps = {\n customStyle: {\n backgroundColor: selected ? primarySkinColor : '#E1E1E3',\n color: selected ? '#FFFFFF' : '#515161',\n transition: 'background-color 0.15s ease-in-out, color 0.15s ease-in-out',\n width: 'fit-content'\n },\n label: filter,\n onClick,\n 'data-name': 'filter-type-course-button'\n };\n\n return <ButtonLink {...buttonProps} />;\n};\n\nFilterButton.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nFilterButton.propTypes = {\n selected: PropTypes.bool,\n filter: PropTypes.string,\n onClick: PropTypes.func\n};\n\nconst AllCourses = (props, context) => {\n const {skillIncludedCourses, totalCourses, filters, sorting} = props;\n const {options, onChange} = filters;\n const {list, loading} = skillIncludedCourses;\n const {translate} = context;\n const [showCompleted, setShowCompleted] = useState(true);\n const [searchValue, setSearchValue] = useState('');\n const [searchResults, setSearchResults] = useState(\n list.sort((a, b) => {\n const progressA = a.progress ?? 0;\n const progressB = b.progress ?? 0;\n return progressB - progressA;\n })\n );\n\n const sortView =\n sorting !== undefined ? (\n <div data-name=\"choice\">\n <Select {...sorting} aria-label=\"All courses sort\" />\n </div>\n ) : null;\n\n useEffect(() => {\n setSearchResults(\n list.sort((a, b) => {\n const progressA = a.progress ?? 0;\n const progressB = b.progress ?? 0;\n return progressB - progressA;\n })\n );\n }, [list]);\n\n const handleSearch = useCallback(\n value => {\n setSearchValue(value);\n setSearchResults(list.filter(skill => searchValueIncluded(skill.title, value)));\n },\n [list, setSearchValue, setSearchResults]\n );\n\n const handleSearchReset = useCallback(() => {\n setSearchValue('');\n setSearchResults(list);\n }, [list, setSearchValue, setSearchResults]);\n\n const handleShowCompletedToggle = useCallback(() => {\n const tempShowCompleted = !showCompleted;\n setShowCompleted(tempShowCompleted);\n if (tempShowCompleted) {\n setSearchResults(list);\n handleSearchReset();\n } else {\n setSearchResults(searchResults.filter(skill => skill.progress === 0));\n }\n }, [list, searchResults, showCompleted, setShowCompleted, setSearchResults, handleSearchReset]);\n\n return (\n <>\n <div className={style.continueLearningWrapper}>\n <span className={style.continueLearningTitle}>{translate('all_courses')}</span>\n <span className={style.continueLearningNumber}>{totalCourses}</span>\n </div>\n <div className={style.searchAndSortSection}>\n <div className={style.searchWrapper}>\n <SearchForm\n search={{\n placeholder: translate('search_place_holder'),\n value: searchValue,\n onChange: handleSearch\n }}\n onReset={handleSearchReset}\n />\n </div>\n <div className={style.sortSection}>\n <InputSwitch\n id={'show-completed-courses-switch'}\n type=\"switch\"\n name={translate('show_completed')}\n title={translate('show_completed')}\n aria-label={'Show completed courses aria label'}\n value={showCompleted}\n onChange={handleShowCompletedToggle}\n />\n <div className={style.sortWrapper}>\n {translate('sort_by')}\n {sortView}\n </div>\n </div>\n </div>\n <div className={style.filterWrapper}>\n {options.length > 2 && searchResults.length > 0\n ? options.map((filter, index) => {\n const {name, value, selected} = filter;\n\n function handleChange() {\n onChange(value);\n handleSearchReset();\n }\n return (\n <div key={index} className={style.filterButtonWrapper}>\n <FilterButton selected={selected} filter={name} onClick={handleChange} />\n {value === 'ALL' ? <div className={style.divider} /> : null}\n </div>\n );\n })\n : null}\n </div>\n <div>\n {searchResults.length > 0 ? (\n <CardsGrid\n list={searchResults}\n loading={loading}\n customStyle={{justifyContent: 'left'}}\n />\n ) : (\n <div className={style.emptySearchResultContainer}>\n <div className={style.emptySearchResultTitle}>\n {translate('empty_search_result_title', {searchValue})}\n </div>\n <div className={style.emptySearchResultDescription}>\n {translate('empty_search_result_description')}\n </div>\n <div className={style.emptySearchResultClearSearch} onClick={handleSearchReset}>\n {translate('empty_search_result_clear_search')}\n </div>\n </div>\n )}\n </div>\n </>\n );\n};\n\nAllCourses.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nAllCourses.propTypes = {\n skillIncludedCourses: PropTypes.shape(CardsGrid.propTypes),\n totalCourses: PropTypes.number,\n filters: PropTypes.shape({\n onChange: PropTypes.func,\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes))\n }),\n sorting: PropTypes.shape(Select.propTypes)\n};\n\nexport default AllCourses;\n"],"mappings":";;;;AAAA,OAAOA,KAAP,IAAeC,QAAf,EAAyBC,WAAzB,EAAsCC,SAAtC,QAAsD,OAAtD;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,OAAOC,QAAP,MAAqB,qBAArB;AACA,OAAOC,MAAP,IAAgBC,qBAAhB,QAA4C,mBAA5C;AACA,OAAOC,UAAP,MAAuB,wBAAvB;AACA,OAAOC,UAAP,MAAuB,4BAAvB;AACA,OAAOC,SAAP,MAAsB,2BAAtB;AACA,OAAOC,mBAAP,MAAgC,kCAAhC;AACA,OAAOC,WAAP,MAAwB,yBAAxB;AACA,OAAOC,KAAP,MAAkB,mBAAlB;;AAEA,MAAMC,YAAY,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EACvC,MAAM;IAACC,QAAD;IAAWC,MAAX;IAAmBC;EAAnB,IAA8BJ,KAApC;EACA,MAAM;IAACK;EAAD,IAASJ,OAAf;;EACA,MAAMK,gBAAgB,GAAG,KAAI,gBAAJ,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F,CARJ,CAlDF,CADF;AA0ED,CAlID;;AAoIAK,UAAU,CAACP,YAAX,GAA0B;EACxBT,IAAI,EAAEf,QAAQ,CAACyB,iBAAT,CAA2BV,IADT;EAExBW,SAAS,EAAE1B,QAAQ,CAACyB,iBAAT,CAA2BC;AAFd,CAA1B;AAKAK,UAAU,CAACJ,SAAX,2CAAuB;EACrBK,oBAAoB,EAAEjC,SAAS,CAACmF,KAAV,CAAgB7E,SAAS,CAACsB,SAA1B,CADD;EAErBM,YAAY,EAAElC,SAAS,CAACoF,MAFH;EAGrBjD,OAAO,EAAEnC,SAAS,CAACmF,KAAV,CAAgB;IACvB7C,QAAQ,EAAEtC,SAAS,CAAC+B,IADG;IAEvBM,OAAO,EAAErC,SAAS,CAACqF,OAAV,CAAkBrF,SAAS,CAACmF,KAAV,CAAgBhF,qBAAhB,CAAlB;EAFc,CAAhB,CAHY;EAOrBiC,OAAO,EAAEpC,SAAS,CAACmF,KAAV,CAAgBjF,MAAM,CAAC0B,SAAvB;AAPY,CAAvB;AAUA,eAAeI,UAAf"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
.continueLearningTitle {
|
|
2
|
+
font-size: 16px;
|
|
3
|
+
font-weight: 600;
|
|
4
|
+
line-height: 22px;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.continueLearningNumber {
|
|
8
|
+
border-radius: 50%;
|
|
9
|
+
background-color: #EAEAEB;
|
|
10
|
+
color: #515161;
|
|
11
|
+
padding: 2px 4px;
|
|
12
|
+
margin-left: 8px;
|
|
13
|
+
font-size: 10px;
|
|
14
|
+
font-weight: 600;
|
|
15
|
+
line-height: 12px;
|
|
16
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export default ContinueLearning;
|
|
2
|
+
declare function ContinueLearning(props: any, context: any): JSX.Element | null;
|
|
3
|
+
declare namespace ContinueLearning {
|
|
4
|
+
namespace contextTypes {
|
|
5
|
+
const skin: PropTypes.Requireable<PropTypes.InferProps<{
|
|
6
|
+
common: PropTypes.Requireable<{
|
|
7
|
+
[x: string]: any;
|
|
8
|
+
}>;
|
|
9
|
+
images: PropTypes.Requireable<PropTypes.InferProps<{
|
|
10
|
+
'logo-mobile': PropTypes.Requireable<any>;
|
|
11
|
+
logo: PropTypes.Requireable<any>;
|
|
12
|
+
'logo-email': PropTypes.Requireable<any>;
|
|
13
|
+
login: PropTypes.Requireable<any>;
|
|
14
|
+
}>>;
|
|
15
|
+
icons: PropTypes.Requireable<{
|
|
16
|
+
[x: string]: any;
|
|
17
|
+
}>;
|
|
18
|
+
mod: PropTypes.Requireable<{
|
|
19
|
+
[x: string]: any;
|
|
20
|
+
}>;
|
|
21
|
+
courses: PropTypes.Requireable<any[]>;
|
|
22
|
+
texts: PropTypes.Requireable<{
|
|
23
|
+
[x: string]: any;
|
|
24
|
+
}>;
|
|
25
|
+
}>>;
|
|
26
|
+
const translate: PropTypes.Requireable<(...args: any[]) => any>;
|
|
27
|
+
}
|
|
28
|
+
namespace propTypes {
|
|
29
|
+
const ongoingCourses: PropTypes.Requireable<PropTypes.InferProps<{
|
|
30
|
+
list: PropTypes.Requireable<(PropTypes.InferProps<any> | null | undefined)[]>;
|
|
31
|
+
customStyle: PropTypes.Requireable<{
|
|
32
|
+
[x: string]: string | null | undefined;
|
|
33
|
+
}>;
|
|
34
|
+
loading: PropTypes.Requireable<boolean>;
|
|
35
|
+
}>>;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
import PropTypes from "prop-types";
|
|
39
|
+
//# sourceMappingURL=continue-learning.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"continue-learning.d.ts","sourceRoot":"","sources":["../../../src/template/skill-detail/continue-learning.js"],"names":[],"mappings":";AAOA,gFAyBC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React, { useCallback } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import Provider from '../../atom/provider';
|
|
4
|
+
import CardsGrid from '../../organism/cards-grid';
|
|
5
|
+
import CardsList from '../../molecule/dashboard/cards-list';
|
|
6
|
+
import style from './continue-learning.css';
|
|
7
|
+
|
|
8
|
+
const ContinueLearning = (props, context) => {
|
|
9
|
+
const {
|
|
10
|
+
ongoingCourses
|
|
11
|
+
} = props;
|
|
12
|
+
const {
|
|
13
|
+
translate
|
|
14
|
+
} = context;
|
|
15
|
+
const Title = useCallback(() => /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
|
|
16
|
+
className: style.continueLearningTitle
|
|
17
|
+
}, translate('continue_learning')), /*#__PURE__*/React.createElement("span", {
|
|
18
|
+
className: style.continueLearningNumber
|
|
19
|
+
}, ongoingCourses.list.length)), [ongoingCourses, translate]);
|
|
20
|
+
|
|
21
|
+
if (ongoingCourses.list.length === 0) {
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return /*#__PURE__*/React.createElement(CardsList, {
|
|
26
|
+
cards: ongoingCourses.list,
|
|
27
|
+
title: /*#__PURE__*/React.createElement(Title, null),
|
|
28
|
+
customStyle: {
|
|
29
|
+
padding: '16px 0px 8px'
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
ContinueLearning.contextTypes = {
|
|
35
|
+
skin: Provider.childContextTypes.skin,
|
|
36
|
+
translate: Provider.childContextTypes.translate
|
|
37
|
+
};
|
|
38
|
+
ContinueLearning.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
39
|
+
ongoingCourses: PropTypes.shape(CardsGrid.propTypes)
|
|
40
|
+
} : {};
|
|
41
|
+
export default ContinueLearning;
|
|
42
|
+
//# sourceMappingURL=continue-learning.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"continue-learning.js","names":["React","useCallback","PropTypes","Provider","CardsGrid","CardsList","style","ContinueLearning","props","context","ongoingCourses","translate","Title","continueLearningTitle","continueLearningNumber","list","length","padding","contextTypes","skin","childContextTypes","propTypes","shape"],"sources":["../../../src/template/skill-detail/continue-learning.js"],"sourcesContent":["import React, {useCallback} from 'react';\nimport PropTypes from 'prop-types';\nimport Provider from '../../atom/provider';\nimport CardsGrid from '../../organism/cards-grid';\nimport CardsList from '../../molecule/dashboard/cards-list';\nimport style from './continue-learning.css';\n\nconst ContinueLearning = (props, context) => {\n const {ongoingCourses} = props;\n const {translate} = context;\n\n const Title = useCallback(\n () => (\n <>\n <span className={style.continueLearningTitle}>{translate('continue_learning')}</span>\n <span className={style.continueLearningNumber}>{ongoingCourses.list.length}</span>\n </>\n ),\n [ongoingCourses, translate]\n );\n\n if (ongoingCourses.list.length === 0) {\n return null;\n }\n\n return (\n <CardsList\n cards={ongoingCourses.list}\n title={<Title />}\n customStyle={{padding: '16px 0px 8px'}}\n />\n );\n};\n\nContinueLearning.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nContinueLearning.propTypes = {\n ongoingCourses: PropTypes.shape(CardsGrid.propTypes)\n};\n\nexport default ContinueLearning;\n"],"mappings":"AAAA,OAAOA,KAAP,IAAeC,WAAf,QAAiC,OAAjC;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,QAAP,MAAqB,qBAArB;AACA,OAAOC,SAAP,MAAsB,2BAAtB;AACA,OAAOC,SAAP,MAAsB,qCAAtB;AACA,OAAOC,KAAP,MAAkB,yBAAlB;;AAEA,MAAMC,gBAAgB,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EAC3C,MAAM;IAACC;EAAD,IAAmBF,KAAzB;EACA,MAAM;IAACG;EAAD,IAAcF,OAApB;EAEA,MAAMG,KAAK,GAAGX,WAAW,CACvB,mBACE,uDACE;IAAM,SAAS,EAAEK,KAAK,CAACO;EAAvB,GAA+CF,SAAS,CAAC,mBAAD,CAAxD,CADF,eAEE;IAAM,SAAS,EAAEL,KAAK,CAACQ;EAAvB,GAAgDJ,cAAc,CAACK,IAAf,CAAoBC,MAApE,CAFF,CAFqB,EAOvB,CAACN,cAAD,EAAiBC,SAAjB,CAPuB,CAAzB;;EAUA,IAAID,cAAc,CAACK,IAAf,CAAoBC,MAApB,KAA+B,CAAnC,EAAsC;IACpC,OAAO,IAAP;EACD;;EAED,oBACE,oBAAC,SAAD;IACE,KAAK,EAAEN,cAAc,CAACK,IADxB;IAEE,KAAK,eAAE,oBAAC,KAAD,OAFT;IAGE,WAAW,EAAE;MAACE,OAAO,EAAE;IAAV;EAHf,EADF;AAOD,CAzBD;;AA2BAV,gBAAgB,CAACW,YAAjB,GAAgC;EAC9BC,IAAI,EAAEhB,QAAQ,CAACiB,iBAAT,CAA2BD,IADH;EAE9BR,SAAS,EAAER,QAAQ,CAACiB,iBAAT,CAA2BT;AAFR,CAAhC;AAKAJ,gBAAgB,CAACc,SAAjB,2CAA6B;EAC3BX,cAAc,EAAER,SAAS,CAACoB,KAAV,CAAgBlB,SAAS,CAACiB,SAA1B;AADW,CAA7B;AAIA,eAAed,gBAAf"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
export default SkillDetail;
|
|
2
|
+
declare function SkillDetail(props: any, context: any): JSX.Element;
|
|
3
|
+
declare namespace SkillDetail {
|
|
4
|
+
namespace contextTypes {
|
|
5
|
+
const skin: PropTypes.Requireable<PropTypes.InferProps<{
|
|
6
|
+
common: PropTypes.Requireable<{
|
|
7
|
+
[x: string]: any;
|
|
8
|
+
}>;
|
|
9
|
+
images: PropTypes.Requireable<PropTypes.InferProps<{
|
|
10
|
+
'logo-mobile': PropTypes.Requireable<any>;
|
|
11
|
+
logo: PropTypes.Requireable<any>;
|
|
12
|
+
'logo-email': PropTypes.Requireable<any>;
|
|
13
|
+
login: PropTypes.Requireable<any>;
|
|
14
|
+
}>>;
|
|
15
|
+
icons: PropTypes.Requireable<{
|
|
16
|
+
[x: string]: any;
|
|
17
|
+
}>;
|
|
18
|
+
mod: PropTypes.Requireable<{
|
|
19
|
+
[x: string]: any;
|
|
20
|
+
}>;
|
|
21
|
+
courses: PropTypes.Requireable<any[]>;
|
|
22
|
+
texts: PropTypes.Requireable<{
|
|
23
|
+
[x: string]: any;
|
|
24
|
+
}>;
|
|
25
|
+
}>>;
|
|
26
|
+
const translate: PropTypes.Requireable<(...args: any[]) => any>;
|
|
27
|
+
}
|
|
28
|
+
namespace propTypes {
|
|
29
|
+
const title: PropTypes.Validator<string>;
|
|
30
|
+
const skillRef: PropTypes.Validator<string>;
|
|
31
|
+
const description: PropTypes.Requireable<string>;
|
|
32
|
+
const metrics: PropTypes.Requireable<PropTypes.InferProps<{
|
|
33
|
+
score: PropTypes.Requireable<number>;
|
|
34
|
+
content: PropTypes.Requireable<number>;
|
|
35
|
+
questionsToReview: PropTypes.Requireable<number>;
|
|
36
|
+
contentCompleted: PropTypes.Requireable<number>;
|
|
37
|
+
}>>;
|
|
38
|
+
const focused: PropTypes.Requireable<boolean>;
|
|
39
|
+
const availableForReview: PropTypes.Requireable<boolean>;
|
|
40
|
+
const ongoingCourses: PropTypes.Requireable<PropTypes.InferProps<{
|
|
41
|
+
list: PropTypes.Requireable<(PropTypes.InferProps<any> | null | undefined)[]>;
|
|
42
|
+
customStyle: PropTypes.Requireable<{
|
|
43
|
+
[x: string]: string | null | undefined;
|
|
44
|
+
}>;
|
|
45
|
+
loading: PropTypes.Requireable<boolean>;
|
|
46
|
+
}>>;
|
|
47
|
+
const skillIncludedCourses: PropTypes.Requireable<PropTypes.InferProps<{
|
|
48
|
+
list: PropTypes.Requireable<(PropTypes.InferProps<any> | null | undefined)[]>;
|
|
49
|
+
customStyle: PropTypes.Requireable<{
|
|
50
|
+
[x: string]: string | null | undefined;
|
|
51
|
+
}>;
|
|
52
|
+
loading: PropTypes.Requireable<boolean>;
|
|
53
|
+
}>>;
|
|
54
|
+
const totalCourses: PropTypes.Requireable<number>;
|
|
55
|
+
const filters: PropTypes.Requireable<PropTypes.InferProps<{
|
|
56
|
+
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
57
|
+
options: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
58
|
+
name: PropTypes.Validator<string>;
|
|
59
|
+
value: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
60
|
+
selected: PropTypes.Requireable<boolean>;
|
|
61
|
+
validOption: PropTypes.Requireable<boolean>;
|
|
62
|
+
}> | null | undefined)[]>;
|
|
63
|
+
}>>;
|
|
64
|
+
const sorting: PropTypes.Requireable<PropTypes.InferProps<{
|
|
65
|
+
title: PropTypes.Requireable<string>;
|
|
66
|
+
name: PropTypes.Requireable<string>;
|
|
67
|
+
className: PropTypes.Requireable<string>;
|
|
68
|
+
borderClassName: PropTypes.Requireable<string>;
|
|
69
|
+
disabled: PropTypes.Requireable<boolean>;
|
|
70
|
+
multiple: PropTypes.Requireable<boolean>;
|
|
71
|
+
description: PropTypes.Requireable<string>;
|
|
72
|
+
required: PropTypes.Requireable<boolean>;
|
|
73
|
+
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
74
|
+
theme: PropTypes.Requireable<string>;
|
|
75
|
+
options: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
76
|
+
name: PropTypes.Validator<string>;
|
|
77
|
+
value: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
78
|
+
selected: PropTypes.Requireable<boolean>;
|
|
79
|
+
validOption: PropTypes.Requireable<boolean>;
|
|
80
|
+
}> | null | undefined)[]>;
|
|
81
|
+
optgroups: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
82
|
+
label: PropTypes.Validator<string>;
|
|
83
|
+
options: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
84
|
+
name: PropTypes.Validator<string>;
|
|
85
|
+
value: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
86
|
+
selected: PropTypes.Requireable<boolean>;
|
|
87
|
+
validOption: PropTypes.Requireable<boolean>;
|
|
88
|
+
}> | null | undefined)[]>;
|
|
89
|
+
}> | null | undefined)[]>;
|
|
90
|
+
modified: PropTypes.Requireable<boolean>;
|
|
91
|
+
error: PropTypes.Requireable<boolean>;
|
|
92
|
+
'aria-label': PropTypes.Requireable<string>;
|
|
93
|
+
'aria-labelledby': PropTypes.Requireable<string>;
|
|
94
|
+
}>>;
|
|
95
|
+
const onBackClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
96
|
+
const onReviewClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
97
|
+
const onContinueLearningClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
import PropTypes from "prop-types";
|
|
101
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/skill-detail/index.js"],"names":[],"mappings":";AA8DA,oEA+JC"}
|