@coorpacademy/components 11.32.3 → 11.32.5
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/battle-opponent/index.d.ts.map +1 -1
- package/es/atom/battle-opponent/index.js +1 -1
- package/es/atom/battle-opponent/index.js.map +1 -1
- package/es/molecule/base-modal/index.d.ts +24 -1
- package/es/molecule/base-modal/index.d.ts.map +1 -1
- package/es/molecule/base-modal/index.js +26 -5
- package/es/molecule/base-modal/index.js.map +1 -1
- package/es/molecule/card/favorite.d.ts.map +1 -1
- package/es/molecule/card/favorite.js +1 -1
- package/es/molecule/card/favorite.js.map +1 -1
- package/es/molecule/discipline-associated-skills/index.d.ts +17 -0
- package/es/molecule/discipline-associated-skills/index.d.ts.map +1 -0
- package/es/molecule/discipline-associated-skills/index.js +73 -0
- package/es/molecule/discipline-associated-skills/index.js.map +1 -0
- package/es/molecule/discipline-associated-skills/style.css +71 -0
- package/es/molecule/learner-skill-card/index.d.ts +22 -0
- package/es/molecule/learner-skill-card/index.d.ts.map +1 -1
- package/es/molecule/learner-skill-card/index.js +7 -6
- package/es/molecule/learner-skill-card/index.js.map +1 -1
- package/es/molecule/learning-profile-radar-chart/index.d.ts +28 -1
- package/es/molecule/learning-profile-radar-chart/index.d.ts.map +1 -1
- package/es/molecule/learning-profile-radar-chart/index.js +115 -28
- package/es/molecule/learning-profile-radar-chart/index.js.map +1 -1
- package/es/molecule/learning-profile-radar-chart/style.css +14 -0
- package/es/molecule/learning-profile-radar-chart/types.d.ts +2 -0
- package/es/molecule/learning-profile-radar-chart/types.d.ts.map +1 -1
- package/es/molecule/learning-profile-radar-chart/types.js +2 -1
- package/es/molecule/learning-profile-radar-chart/types.js.map +1 -1
- package/es/molecule/review-correction-popin/index.d.ts.map +1 -1
- package/es/molecule/review-correction-popin/index.js +1 -1
- package/es/molecule/review-correction-popin/index.js.map +1 -1
- package/es/molecule/skill-picker-modal/index.d.ts.map +1 -1
- package/es/molecule/skill-picker-modal/index.js +2 -1
- package/es/molecule/skill-picker-modal/index.js.map +1 -1
- package/es/organism/user-preferences/index.d.ts.map +1 -1
- package/es/organism/user-preferences/index.js +1 -1
- package/es/organism/user-preferences/index.js.map +1 -1
- package/es/template/activity/engine-stars.d.ts.map +1 -1
- package/es/template/activity/engine-stars.js +1 -1
- package/es/template/activity/engine-stars.js.map +1 -1
- package/es/template/common/discipline/index.d.ts +6 -0
- package/es/template/common/discipline/index.d.ts.map +1 -1
- package/es/template/common/discipline/index.js +17 -2
- package/es/template/common/discipline/index.js.map +1 -1
- package/es/template/common/discipline/style.css +4 -1
- package/es/template/my-learning/index.d.ts +21 -0
- package/es/template/my-learning/index.d.ts.map +1 -1
- package/es/template/my-learning/index.js +41 -15
- package/es/template/my-learning/index.js.map +1 -1
- package/es/template/my-learning/style.css +6 -1
- package/lib/atom/battle-opponent/index.d.ts.map +1 -1
- package/lib/atom/battle-opponent/index.js +1 -1
- package/lib/atom/battle-opponent/index.js.map +1 -1
- package/lib/molecule/base-modal/index.d.ts +24 -1
- package/lib/molecule/base-modal/index.d.ts.map +1 -1
- package/lib/molecule/base-modal/index.js +26 -4
- package/lib/molecule/base-modal/index.js.map +1 -1
- package/lib/molecule/card/favorite.d.ts.map +1 -1
- package/lib/molecule/card/favorite.js +1 -1
- package/lib/molecule/card/favorite.js.map +1 -1
- package/lib/molecule/discipline-associated-skills/index.d.ts +17 -0
- package/lib/molecule/discipline-associated-skills/index.d.ts.map +1 -0
- package/lib/molecule/discipline-associated-skills/index.js +94 -0
- package/lib/molecule/discipline-associated-skills/index.js.map +1 -0
- package/lib/molecule/discipline-associated-skills/style.css +71 -0
- package/lib/molecule/learner-skill-card/index.d.ts +22 -0
- package/lib/molecule/learner-skill-card/index.d.ts.map +1 -1
- package/lib/molecule/learner-skill-card/index.js +7 -7
- package/lib/molecule/learner-skill-card/index.js.map +1 -1
- package/lib/molecule/learning-profile-radar-chart/index.d.ts +28 -1
- package/lib/molecule/learning-profile-radar-chart/index.d.ts.map +1 -1
- package/lib/molecule/learning-profile-radar-chart/index.js +117 -28
- package/lib/molecule/learning-profile-radar-chart/index.js.map +1 -1
- package/lib/molecule/learning-profile-radar-chart/style.css +14 -0
- package/lib/molecule/learning-profile-radar-chart/types.d.ts +2 -0
- package/lib/molecule/learning-profile-radar-chart/types.d.ts.map +1 -1
- package/lib/molecule/learning-profile-radar-chart/types.js +2 -1
- package/lib/molecule/learning-profile-radar-chart/types.js.map +1 -1
- package/lib/molecule/review-correction-popin/index.d.ts.map +1 -1
- package/lib/molecule/review-correction-popin/index.js +1 -1
- package/lib/molecule/review-correction-popin/index.js.map +1 -1
- package/lib/molecule/skill-picker-modal/index.d.ts.map +1 -1
- package/lib/molecule/skill-picker-modal/index.js +2 -1
- package/lib/molecule/skill-picker-modal/index.js.map +1 -1
- package/lib/organism/user-preferences/index.d.ts.map +1 -1
- package/lib/organism/user-preferences/index.js +1 -1
- package/lib/organism/user-preferences/index.js.map +1 -1
- package/lib/template/activity/engine-stars.d.ts.map +1 -1
- package/lib/template/activity/engine-stars.js +1 -1
- package/lib/template/activity/engine-stars.js.map +1 -1
- package/lib/template/common/discipline/index.d.ts +6 -0
- package/lib/template/common/discipline/index.d.ts.map +1 -1
- package/lib/template/common/discipline/index.js +18 -2
- package/lib/template/common/discipline/index.js.map +1 -1
- package/lib/template/common/discipline/style.css +4 -1
- package/lib/template/my-learning/index.d.ts +21 -0
- package/lib/template/my-learning/index.d.ts.map +1 -1
- package/lib/template/my-learning/index.js +39 -15
- package/lib/template/my-learning/index.js.map +1 -1
- package/lib/template/my-learning/style.css +6 -1
- package/locales/bs/global.json +3 -1
- package/locales/cs/global.json +4 -2
- package/locales/de/global.json +3 -1
- package/locales/en/global.json +3 -1
- package/locales/es/global.json +3 -1
- package/locales/et/global.json +3 -1
- package/locales/fi/global.json +3 -1
- package/locales/fr/global.json +3 -1
- package/locales/hr/global.json +3 -1
- package/locales/hu/global.json +3 -1
- package/locales/hy/global.json +3 -1
- package/locales/it/global.json +3 -1
- package/locales/ja/global.json +3 -1
- package/locales/ko/global.json +3 -1
- package/locales/nl/global.json +3 -1
- package/locales/pl/global.json +3 -1
- package/locales/pt/global.json +3 -1
- package/locales/ro/global.json +3 -1
- package/locales/ru/global.json +3 -1
- package/locales/sk/global.json +3 -1
- package/locales/sl/global.json +3 -1
- package/locales/sv/global.json +3 -1
- package/locales/th/global.json +1 -1
- package/locales/tl/global.json +4 -2
- package/locales/tr/global.json +3 -1
- package/locales/uk/global.json +3 -1
- package/locales/vi/global.json +4 -2
- package/locales/zh/global.json +3 -1
- package/locales/zh_TW/global.json +3 -1
- package/package.json +2 -2
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.default = void 0;
|
|
5
|
+
|
|
6
|
+
var _uniqueId2 = _interopRequireDefault(require("lodash/fp/uniqueId"));
|
|
7
|
+
|
|
8
|
+
var _isEmpty2 = _interopRequireDefault(require("lodash/fp/isEmpty"));
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
12
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
+
|
|
14
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
15
|
+
|
|
16
|
+
var _icon = _interopRequireDefault(require("../../atom/icon"));
|
|
17
|
+
|
|
18
|
+
var _tooltip = _interopRequireDefault(require("../../atom/tooltip"));
|
|
19
|
+
|
|
20
|
+
var _provider = _interopRequireDefault(require("../../atom/provider"));
|
|
21
|
+
|
|
22
|
+
var _catalogSection = _interopRequireDefault(require("../../atom/catalog-section"));
|
|
23
|
+
|
|
24
|
+
var _style = _interopRequireDefault(require("./style.css"));
|
|
25
|
+
|
|
26
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
27
|
+
|
|
28
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
29
|
+
|
|
30
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
31
|
+
|
|
32
|
+
const DisciplineAssociatedSkills = (props, context) => {
|
|
33
|
+
const {
|
|
34
|
+
translate
|
|
35
|
+
} = context;
|
|
36
|
+
const {
|
|
37
|
+
skills = [],
|
|
38
|
+
onSkillClick
|
|
39
|
+
} = props;
|
|
40
|
+
const AnchorElement = (0, _react.useCallback)(skill => /*#__PURE__*/_react.default.createElement("div", {
|
|
41
|
+
className: _style.default.chipFocusedContent
|
|
42
|
+
}, /*#__PURE__*/_react.default.createElement(_icon.default, {
|
|
43
|
+
iconName: "bullseye-arrow",
|
|
44
|
+
backgroundColor: "#DDD1FF",
|
|
45
|
+
size: {
|
|
46
|
+
faSize: 12,
|
|
47
|
+
wrapperSize: 12
|
|
48
|
+
}
|
|
49
|
+
}), skill), []);
|
|
50
|
+
return !(0, _isEmpty2.default)(skills) ? /*#__PURE__*/_react.default.createElement("div", {
|
|
51
|
+
"data-name": "discipline-associated-skills",
|
|
52
|
+
className: _style.default.associatedSkillsWrapper
|
|
53
|
+
}, /*#__PURE__*/_react.default.createElement(_catalogSection.default, {
|
|
54
|
+
title: translate('associated_skills')
|
|
55
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
56
|
+
className: _style.default.chipsWrapper
|
|
57
|
+
}, skills.map(skill => {
|
|
58
|
+
function handleSkillClick() {
|
|
59
|
+
return onSkillClick(skill.ref);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function handleAnchorElement() {
|
|
63
|
+
return AnchorElement(skill.locale);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
67
|
+
key: (0, _uniqueId2.default)(),
|
|
68
|
+
className: (0, _classnames.default)(_style.default.chipWrapper, skill.focused && _style.default.chipWrapperFocused),
|
|
69
|
+
onClick: handleSkillClick
|
|
70
|
+
}, skill.focused ? /*#__PURE__*/_react.default.createElement(_tooltip.default, {
|
|
71
|
+
AnchorElement: handleAnchorElement,
|
|
72
|
+
fontSize: 12,
|
|
73
|
+
iconContainerClassName: _style.default.infoIconTooltip,
|
|
74
|
+
tooltipClassName: _style.default.tooltip,
|
|
75
|
+
TooltipContent: translate('skill_focused_chip_tooltip'),
|
|
76
|
+
closeToolTipInformationTextAriaLabel: translate('close_tooltip_information')
|
|
77
|
+
}) : skill.locale);
|
|
78
|
+
})))) : null;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
DisciplineAssociatedSkills.contextTypes = {
|
|
82
|
+
translate: _provider.default.childContextTypes.translate
|
|
83
|
+
};
|
|
84
|
+
DisciplineAssociatedSkills.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
85
|
+
skills: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
86
|
+
ref: _propTypes.default.string,
|
|
87
|
+
locale: _propTypes.default.string,
|
|
88
|
+
focused: _propTypes.default.bool
|
|
89
|
+
})),
|
|
90
|
+
onSkillClick: _propTypes.default.func
|
|
91
|
+
} : {};
|
|
92
|
+
var _default = DisciplineAssociatedSkills;
|
|
93
|
+
exports.default = _default;
|
|
94
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["DisciplineAssociatedSkills","props","context","translate","skills","onSkillClick","AnchorElement","useCallback","skill","style","chipFocusedContent","faSize","wrapperSize","associatedSkillsWrapper","chipsWrapper","map","handleSkillClick","ref","handleAnchorElement","locale","classnames","chipWrapper","focused","chipWrapperFocused","infoIconTooltip","tooltip","contextTypes","Provider","childContextTypes","propTypes","PropTypes","arrayOf","shape","string","bool","func"],"sources":["../../../src/molecule/discipline-associated-skills/index.js"],"sourcesContent":["import React, {useCallback} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {isEmpty, uniqueId} from 'lodash/fp';\nimport Icon from '../../atom/icon';\nimport ToolTip from '../../atom/tooltip';\nimport Provider from '../../atom/provider';\nimport CatalogSection from '../../atom/catalog-section';\nimport style from './style.css';\n\nconst DisciplineAssociatedSkills = (props, context) => {\n const {translate} = context;\n\n const {skills = [], onSkillClick} = props;\n\n const AnchorElement = useCallback(\n skill => (\n <div className={style.chipFocusedContent}>\n <Icon\n iconName=\"bullseye-arrow\"\n backgroundColor=\"#DDD1FF\"\n size={{\n faSize: 12,\n wrapperSize: 12\n }}\n />\n {skill}\n </div>\n ),\n []\n );\n\n return !isEmpty(skills) ? (\n <div data-name=\"discipline-associated-skills\" className={style.associatedSkillsWrapper}>\n <CatalogSection title={translate('associated_skills')}>\n <div className={style.chipsWrapper}>\n {skills.map(skill => {\n function handleSkillClick() {\n return onSkillClick(skill.ref);\n }\n function handleAnchorElement() {\n return AnchorElement(skill.locale);\n }\n return (\n <div\n key={uniqueId()}\n className={classnames(style.chipWrapper, skill.focused && style.chipWrapperFocused)}\n onClick={handleSkillClick}\n >\n {skill.focused ? (\n <ToolTip\n AnchorElement={handleAnchorElement}\n fontSize={12}\n iconContainerClassName={style.infoIconTooltip}\n tooltipClassName={style.tooltip}\n TooltipContent={translate('skill_focused_chip_tooltip')}\n closeToolTipInformationTextAriaLabel={translate('close_tooltip_information')}\n />\n ) : (\n skill.locale\n )}\n </div>\n );\n })}\n </div>\n </CatalogSection>\n </div>\n ) : null;\n};\n\nDisciplineAssociatedSkills.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nDisciplineAssociatedSkills.propTypes = {\n skills: PropTypes.arrayOf(\n PropTypes.shape({\n ref: PropTypes.string,\n locale: PropTypes.string,\n focused: PropTypes.bool\n })\n ),\n onSkillClick: PropTypes.func\n};\n\nexport default DisciplineAssociatedSkills;\n"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAEA,MAAMA,0BAA0B,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EACrD,MAAM;IAACC;EAAD,IAAcD,OAApB;EAEA,MAAM;IAACE,MAAM,GAAG,EAAV;IAAcC;EAAd,IAA8BJ,KAApC;EAEA,MAAMK,aAAa,GAAG,IAAAC,kBAAA,EACpBC,KAAK,iBACH;IAAK,SAAS,EAAEC,cAAA,CAAMC;EAAtB,gBACE,6BAAC,aAAD;IACE,QAAQ,EAAC,gBADX;IAEE,eAAe,EAAC,SAFlB;IAGE,IAAI,EAAE;MACJC,MAAM,EAAE,EADJ;MAEJC,WAAW,EAAE;IAFT;EAHR,EADF,EASGJ,KATH,CAFkB,EAcpB,EAdoB,CAAtB;EAiBA,OAAO,CAAC,uBAAQJ,MAAR,CAAD,gBACL;IAAK,aAAU,8BAAf;IAA8C,SAAS,EAAEK,cAAA,CAAMI;EAA/D,gBACE,6BAAC,uBAAD;IAAgB,KAAK,EAAEV,SAAS,CAAC,mBAAD;EAAhC,gBACE;IAAK,SAAS,EAAEM,cAAA,CAAMK;EAAtB,GACGV,MAAM,CAACW,GAAP,CAAWP,KAAK,IAAI;IACnB,SAASQ,gBAAT,GAA4B;MAC1B,OAAOX,YAAY,CAACG,KAAK,CAACS,GAAP,CAAnB;IACD;;IACD,SAASC,mBAAT,GAA+B;MAC7B,OAAOZ,aAAa,CAACE,KAAK,CAACW,MAAP,CAApB;IACD;;IACD,oBACE;MACE,GAAG,EAAE,yBADP;MAEE,SAAS,EAAE,IAAAC,mBAAA,EAAWX,cAAA,CAAMY,WAAjB,EAA8Bb,KAAK,CAACc,OAAN,IAAiBb,cAAA,CAAMc,kBAArD,CAFb;MAGE,OAAO,EAAEP;IAHX,GAKGR,KAAK,CAACc,OAAN,gBACC,6BAAC,gBAAD;MACE,aAAa,EAAEJ,mBADjB;MAEE,QAAQ,EAAE,EAFZ;MAGE,sBAAsB,EAAET,cAAA,CAAMe,eAHhC;MAIE,gBAAgB,EAAEf,cAAA,CAAMgB,OAJ1B;MAKE,cAAc,EAAEtB,SAAS,CAAC,4BAAD,CAL3B;MAME,oCAAoC,EAAEA,SAAS,CAAC,2BAAD;IANjD,EADD,GAUCK,KAAK,CAACW,MAfV,CADF;EAoBD,CA3BA,CADH,CADF,CADF,CADK,GAmCH,IAnCJ;AAoCD,CA1DD;;AA4DAnB,0BAA0B,CAAC0B,YAA3B,GAA0C;EACxCvB,SAAS,EAAEwB,iBAAA,CAASC,iBAAT,CAA2BzB;AADE,CAA1C;AAIAH,0BAA0B,CAAC6B,SAA3B,2CAAuC;EACrCzB,MAAM,EAAE0B,kBAAA,CAAUC,OAAV,CACND,kBAAA,CAAUE,KAAV,CAAgB;IACdf,GAAG,EAAEa,kBAAA,CAAUG,MADD;IAEdd,MAAM,EAAEW,kBAAA,CAAUG,MAFJ;IAGdX,OAAO,EAAEQ,kBAAA,CAAUI;EAHL,CAAhB,CADM,CAD6B;EAQrC7B,YAAY,EAAEyB,kBAAA,CAAUK;AARa,CAAvC;eAWenC,0B"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
@value colors: "../../variables/colors.css";
|
|
2
|
+
@value breakpoints: "../../variables/breakpoints.css";
|
|
3
|
+
@value desktop from breakpoints;
|
|
4
|
+
@value cm_grey_100 from colors;
|
|
5
|
+
@value cm_grey_200 from colors;
|
|
6
|
+
@value cm_grey_700 from colors;
|
|
7
|
+
|
|
8
|
+
.associatedSkillsWrapper {
|
|
9
|
+
margin-bottom: 12px;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.chipsWrapper {
|
|
13
|
+
display: flex;
|
|
14
|
+
flex-wrap: wrap;
|
|
15
|
+
gap: 8px;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.chipWrapper {
|
|
19
|
+
width: fit-content;
|
|
20
|
+
border-radius: 8px;
|
|
21
|
+
padding: 4px 8px;
|
|
22
|
+
background-color: cm_grey_200;
|
|
23
|
+
color: cm_grey_700;
|
|
24
|
+
font-family: 'Gilroy';
|
|
25
|
+
font-style: normal;
|
|
26
|
+
font-weight: 600;
|
|
27
|
+
line-height: 20px;
|
|
28
|
+
font-size: 14px;
|
|
29
|
+
text-overflow: ellipsis;
|
|
30
|
+
white-space: nowrap;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.chipWrapperFocused {
|
|
34
|
+
background-color: #DDD1FF;
|
|
35
|
+
color: #3900D6;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.chipFocusedContent {
|
|
39
|
+
display: flex;
|
|
40
|
+
align-items: center;
|
|
41
|
+
gap: 4px;
|
|
42
|
+
|
|
43
|
+
div {
|
|
44
|
+
padding: 0 !important;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.infoIconTooltip {
|
|
49
|
+
background-color: transparent;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.tooltip {
|
|
53
|
+
width: fit-content;
|
|
54
|
+
color: #FFF;
|
|
55
|
+
font-size: 12px;
|
|
56
|
+
font-style: normal;
|
|
57
|
+
line-height: 16px;
|
|
58
|
+
right: -28px;
|
|
59
|
+
top: -48px;
|
|
60
|
+
|
|
61
|
+
p {
|
|
62
|
+
padding: 8px 8px;
|
|
63
|
+
margin: 0;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
@media desktop {
|
|
68
|
+
.associatedSkillsWrapper {
|
|
69
|
+
margin-top: 24px;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -2,6 +2,27 @@ export default LearnerSkillCard;
|
|
|
2
2
|
declare function LearnerSkillCard(props: any, context: any): JSX.Element;
|
|
3
3
|
declare namespace LearnerSkillCard {
|
|
4
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
|
+
}>>;
|
|
5
26
|
const translate: PropTypes.Requireable<(...args: any[]) => any>;
|
|
6
27
|
}
|
|
7
28
|
const propTypes: {
|
|
@@ -10,6 +31,7 @@ declare namespace LearnerSkillCard {
|
|
|
10
31
|
skillAriaLabel: PropTypes.Requireable<string>;
|
|
11
32
|
focus: PropTypes.Requireable<boolean>;
|
|
12
33
|
metrics: PropTypes.Requireable<PropTypes.InferProps<{
|
|
34
|
+
score: PropTypes.Requireable<number>;
|
|
13
35
|
skillCourses: PropTypes.Requireable<number>;
|
|
14
36
|
skillQuestions: PropTypes.Requireable<number>;
|
|
15
37
|
completedCourses: PropTypes.Requireable<number>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/learner-skill-card/index.js"],"names":[],"mappings":";AASA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/learner-skill-card/index.js"],"names":[],"mappings":";AASA,yEAwJC"}
|
|
@@ -3,8 +3,6 @@
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.default = void 0;
|
|
5
5
|
|
|
6
|
-
var _getOr2 = _interopRequireDefault(require("lodash/fp/getOr"));
|
|
7
|
-
|
|
8
6
|
var _get2 = _interopRequireDefault(require("lodash/fp/get"));
|
|
9
7
|
|
|
10
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
@@ -39,6 +37,7 @@ const LearnerSkillCard = (props, context) => {
|
|
|
39
37
|
onExploreClick
|
|
40
38
|
} = props;
|
|
41
39
|
const {
|
|
40
|
+
score,
|
|
42
41
|
skillCourses,
|
|
43
42
|
skillQuestions,
|
|
44
43
|
completedCourses = 0
|
|
@@ -48,7 +47,7 @@ const LearnerSkillCard = (props, context) => {
|
|
|
48
47
|
translate
|
|
49
48
|
} = context;
|
|
50
49
|
const [hovered, setHovered] = (0, _react.useState)(false);
|
|
51
|
-
const primarySkinColor = (0,
|
|
50
|
+
const primarySkinColor = (0, _get2.default)('common.primary', skin);
|
|
52
51
|
const reviewLocale = translate('Review');
|
|
53
52
|
const exploreLocale = translate('Explore');
|
|
54
53
|
const coursesLocale = translate('courses');
|
|
@@ -88,13 +87,12 @@ const LearnerSkillCard = (props, context) => {
|
|
|
88
87
|
}
|
|
89
88
|
}
|
|
90
89
|
};
|
|
91
|
-
const completedPercentage = skillCourses && Number.parseInt(completedCourses / skillCourses * 100);
|
|
92
90
|
const ProgressBar = (0, _react.useCallback)(() => {
|
|
93
91
|
if (!skillCourses) return null;
|
|
94
92
|
const progressBarColor = '#3EC483';
|
|
95
93
|
const inlineProgressValueStyle = {
|
|
96
94
|
backgroundColor: progressBarColor,
|
|
97
|
-
width: `${
|
|
95
|
+
width: `${score}%`
|
|
98
96
|
};
|
|
99
97
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
100
98
|
className: _style.default.progressWrapper
|
|
@@ -105,7 +103,7 @@ const LearnerSkillCard = (props, context) => {
|
|
|
105
103
|
role: "progressbar",
|
|
106
104
|
"aria-label": (0, _get2.default)('progression', ariaLabel)
|
|
107
105
|
}));
|
|
108
|
-
}, [
|
|
106
|
+
}, [score, ariaLabel, skillCourses]);
|
|
109
107
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
110
108
|
className: _style.default.learnerSkillCardWrapper,
|
|
111
109
|
"data-name": "learner-skill-card-wrapper",
|
|
@@ -149,7 +147,7 @@ const LearnerSkillCard = (props, context) => {
|
|
|
149
147
|
"data-name": "completed-percentage"
|
|
150
148
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
151
149
|
className: _style.default.progressInformationNumber
|
|
152
|
-
},
|
|
150
|
+
}, score, "%")))), /*#__PURE__*/_react.default.createElement("div", {
|
|
153
151
|
className: _style.default.ctaWrapper,
|
|
154
152
|
"data-name": "cta-wrapper"
|
|
155
153
|
}, /*#__PURE__*/_react.default.createElement(_buttonLink.default, buttonReviewProps), /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -161,6 +159,7 @@ const LearnerSkillCard = (props, context) => {
|
|
|
161
159
|
};
|
|
162
160
|
|
|
163
161
|
LearnerSkillCard.contextTypes = {
|
|
162
|
+
skin: _provider.default.childContextTypes.skin,
|
|
164
163
|
translate: _provider.default.childContextTypes.translate
|
|
165
164
|
};
|
|
166
165
|
LearnerSkillCard.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
@@ -169,6 +168,7 @@ LearnerSkillCard.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
169
168
|
skillAriaLabel: _propTypes.default.string,
|
|
170
169
|
focus: _propTypes.default.bool,
|
|
171
170
|
metrics: _propTypes.default.shape({
|
|
171
|
+
score: _propTypes.default.number,
|
|
172
172
|
skillCourses: _propTypes.default.number,
|
|
173
173
|
skillQuestions: _propTypes.default.number,
|
|
174
174
|
completedCourses: _propTypes.default.number
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["LearnerSkillCard","props","context","ariaLabel","skillTitle","skillAriaLabel","focus","metrics","review","onReviewClick","onExploreClick","skillCourses","skillQuestions","completedCourses","skin","translate","hovered","setHovered","useState","primarySkinColor","reviewLocale","exploreLocale","coursesLocale","questionsLocale","skillFocusLocale","coursesCompletedLocale","handleMouseOver","useCallback","handleMouseLeave","buttonReviewProps","customStyle","backgroundColor","transition","disabled","onClick","label","buttonExploreProps","convert","color","icon","position","faIcon","name","size","completedPercentage","Number","parseInt","ProgressBar","progressBarColor","inlineProgressValueStyle","width","style","progressWrapper","progress","learnerSkillCardWrapper","skillCoursesAndQuestionsWrapper","skillInformation","skillInformationNumber","skillTitleWrapper","skillFocusBadge","faSize","wrapperSize","progressInformations","progressInformation","progressInformationNumber","ctaWrapper","buttonWrapper","contextTypes","Provider","childContextTypes","propTypes","PropTypes","string","bool","shape","number","func"],"sources":["../../../src/molecule/learner-skill-card/index.js"],"sourcesContent":["import React, {useCallback, useState} from 'react';\nimport {convert} from 'css-color-function';\nimport {get, getOr} from 'lodash/fp';\nimport PropTypes from 'prop-types';\nimport Icon from '../../atom/icon';\nimport ButtonLink from '../../atom/button-link';\nimport Provider from '../../atom/provider';\nimport style from './style.css';\n\nconst LearnerSkillCard = (props, context) => {\n const {\n 'aria-label': ariaLabel,\n skillTitle,\n skillAriaLabel,\n focus = false,\n metrics,\n review = false,\n onReviewClick,\n onExploreClick\n } = props;\n const {skillCourses, skillQuestions, completedCourses = 0} = metrics;\n const {skin, translate} = context;\n const [hovered, setHovered] = useState(false);\n const primarySkinColor = getOr('#0061FF', 'common.primary', skin);\n\n const reviewLocale = translate('Review');\n const exploreLocale = translate('Explore');\n const coursesLocale = translate('courses');\n const questionsLocale = translate('questions');\n const skillFocusLocale = translate('skill_focus');\n const coursesCompletedLocale = translate('courses_completed');\n\n const handleMouseOver = useCallback(() => setHovered(true), [setHovered]);\n\n const handleMouseLeave = useCallback(() => setHovered(false), [setHovered]);\n\n const buttonReviewProps = {\n customStyle: {\n backgroundColor: '#FFF',\n transition: 'background-color 0.15s ease-in-out, color 0.15s ease-in-out'\n },\n disabled: !review,\n onClick: onReviewClick,\n 'aria-label': `${skillTitle}, ${reviewLocale}`,\n label: reviewLocale,\n 'data-name': 'learner-skill-card-review-button'\n };\n\n const buttonExploreProps = {\n customStyle: {\n backgroundColor: hovered ? primarySkinColor : convert(`color(${primarySkinColor} a(0.07))`),\n color: hovered ? '#FFFFFF' : primarySkinColor,\n transition: 'background-color 0.15s ease-in-out, color 0.15s ease-in-out'\n },\n onClick: onExploreClick,\n 'aria-label': `${skillTitle}, ${exploreLocale}`,\n label: exploreLocale,\n 'data-name': 'learner-skill-card-explore-button',\n icon: {\n position: 'left',\n faIcon: {\n name: 'compass',\n backgroundColor: hovered ? primarySkinColor : convert(`color(${primarySkinColor} a(0.07))`),\n color: hovered ? '#FFFFFF' : primarySkinColor,\n size: 16\n }\n }\n };\n\n const completedPercentage =\n skillCourses && Number.parseInt((completedCourses / skillCourses) * 100);\n\n const ProgressBar = useCallback(() => {\n if (!skillCourses) return null;\n\n const progressBarColor = '#3EC483';\n const inlineProgressValueStyle = {\n backgroundColor: progressBarColor,\n width: `${completedPercentage}%`\n };\n\n return (\n <div className={style.progressWrapper}>\n <div\n data-name=\"progress\"\n className={style.progress}\n style={inlineProgressValueStyle}\n role=\"progressbar\"\n aria-label={get('progression', ariaLabel)}\n />\n </div>\n );\n }, [completedPercentage, ariaLabel, skillCourses]);\n\n return (\n <div\n className={style.learnerSkillCardWrapper}\n data-name=\"learner-skill-card-wrapper\"\n aria-label={ariaLabel}\n >\n {skillCourses || skillQuestions ? (\n <div className={style.skillCoursesAndQuestionsWrapper}>\n {skillCourses ? (\n <div className={style.skillInformation} data-name=\"skill-courses\">\n <span className={style.skillInformationNumber}>{skillCourses}</span> {coursesLocale}\n </div>\n ) : null}\n {skillQuestions ? (\n <div className={style.skillInformation} data-name=\"skill-questions\">\n <span className={style.skillInformationNumber}>{skillQuestions}</span>\n {questionsLocale}\n </div>\n ) : null}\n </div>\n ) : null}\n <div className={style.skillTitleWrapper}>\n <div\n data-name=\"skill-title\"\n className={style.skillTitle}\n aria-label={skillAriaLabel || skillTitle}\n >\n {skillTitle}\n </div>\n {focus ? (\n <div className={style.skillFocusBadge}>\n <Icon\n iconName=\"bullseye-arrow\"\n backgroundColor=\"#DDD1FF\"\n size={{\n faSize: 10,\n wrapperSize: 16\n }}\n />\n {skillFocusLocale}\n </div>\n ) : null}\n </div>\n <ProgressBar />\n <div className={style.progressInformations}>\n {skillCourses && (\n <>\n <div className={style.progressInformation} data-name=\"skill-completed-courses\">\n <span className={style.progressInformationNumber}>{completedCourses}</span>\n {` ${coursesCompletedLocale}`}\n </div>\n <div className={style.progressInformation} data-name=\"completed-percentage\">\n <span className={style.progressInformationNumber}>{completedPercentage}%</span>\n </div>\n </>\n )}\n </div>\n <div className={style.ctaWrapper} data-name=\"cta-wrapper\">\n <ButtonLink {...buttonReviewProps} />\n <div\n className={style.buttonWrapper}\n onMouseOver={handleMouseOver}\n onMouseLeave={handleMouseLeave}\n data-name=\"button-explore-wrapper\"\n >\n <ButtonLink {...buttonExploreProps} />\n </div>\n </div>\n </div>\n );\n};\n\nLearnerSkillCard.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nLearnerSkillCard.propTypes = {\n 'aria-label': PropTypes.string,\n skillTitle: PropTypes.string,\n skillAriaLabel: PropTypes.string,\n focus: PropTypes.bool,\n metrics: PropTypes.shape({\n skillCourses: PropTypes.number,\n skillQuestions: PropTypes.number,\n completedCourses: PropTypes.number\n }),\n review: PropTypes.bool,\n onReviewClick: PropTypes.func,\n onExploreClick: PropTypes.func\n};\n\nexport default LearnerSkillCard;\n"],"mappings":";;;;;;;;;AAAA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E;EAY3BlE,cAAc,EAAE6D,kBAAA,CAAUK;AAZC,CAA7B;eAee5E,gB"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["LearnerSkillCard","props","context","ariaLabel","skillTitle","skillAriaLabel","focus","metrics","review","onReviewClick","onExploreClick","score","skillCourses","skillQuestions","completedCourses","skin","translate","hovered","setHovered","useState","primarySkinColor","reviewLocale","exploreLocale","coursesLocale","questionsLocale","skillFocusLocale","coursesCompletedLocale","handleMouseOver","useCallback","handleMouseLeave","buttonReviewProps","customStyle","backgroundColor","transition","disabled","onClick","label","buttonExploreProps","convert","color","icon","position","faIcon","name","size","ProgressBar","progressBarColor","inlineProgressValueStyle","width","style","progressWrapper","progress","learnerSkillCardWrapper","skillCoursesAndQuestionsWrapper","skillInformation","skillInformationNumber","skillTitleWrapper","skillFocusBadge","faSize","wrapperSize","progressInformations","progressInformation","progressInformationNumber","ctaWrapper","buttonWrapper","contextTypes","Provider","childContextTypes","propTypes","PropTypes","string","bool","shape","number","func"],"sources":["../../../src/molecule/learner-skill-card/index.js"],"sourcesContent":["import React, {useCallback, useState} from 'react';\nimport {convert} from 'css-color-function';\nimport {get} from 'lodash/fp';\nimport PropTypes from 'prop-types';\nimport Icon from '../../atom/icon';\nimport ButtonLink from '../../atom/button-link';\nimport Provider from '../../atom/provider';\nimport style from './style.css';\n\nconst LearnerSkillCard = (props, context) => {\n const {\n 'aria-label': ariaLabel,\n skillTitle,\n skillAriaLabel,\n focus = false,\n metrics,\n review = false,\n onReviewClick,\n onExploreClick\n } = props;\n const {score, skillCourses, skillQuestions, completedCourses = 0} = metrics;\n const {skin, translate} = context;\n const [hovered, setHovered] = useState(false);\n const primarySkinColor = get('common.primary', skin);\n\n const reviewLocale = translate('Review');\n const exploreLocale = translate('Explore');\n const coursesLocale = translate('courses');\n const questionsLocale = translate('questions');\n const skillFocusLocale = translate('skill_focus');\n const coursesCompletedLocale = translate('courses_completed');\n\n const handleMouseOver = useCallback(() => setHovered(true), [setHovered]);\n\n const handleMouseLeave = useCallback(() => setHovered(false), [setHovered]);\n\n const buttonReviewProps = {\n customStyle: {\n backgroundColor: '#FFF',\n transition: 'background-color 0.15s ease-in-out, color 0.15s ease-in-out'\n },\n disabled: !review,\n onClick: onReviewClick,\n 'aria-label': `${skillTitle}, ${reviewLocale}`,\n label: reviewLocale,\n 'data-name': 'learner-skill-card-review-button'\n };\n\n const buttonExploreProps = {\n customStyle: {\n backgroundColor: hovered ? primarySkinColor : convert(`color(${primarySkinColor} a(0.07))`),\n color: hovered ? '#FFFFFF' : primarySkinColor,\n transition: 'background-color 0.15s ease-in-out, color 0.15s ease-in-out'\n },\n onClick: onExploreClick,\n 'aria-label': `${skillTitle}, ${exploreLocale}`,\n label: exploreLocale,\n 'data-name': 'learner-skill-card-explore-button',\n icon: {\n position: 'left',\n faIcon: {\n name: 'compass',\n backgroundColor: hovered ? primarySkinColor : convert(`color(${primarySkinColor} a(0.07))`),\n color: hovered ? '#FFFFFF' : primarySkinColor,\n size: 16\n }\n }\n };\n\n const ProgressBar = useCallback(() => {\n if (!skillCourses) return null;\n\n const progressBarColor = '#3EC483';\n const inlineProgressValueStyle = {\n backgroundColor: progressBarColor,\n width: `${score}%`\n };\n\n return (\n <div className={style.progressWrapper}>\n <div\n data-name=\"progress\"\n className={style.progress}\n style={inlineProgressValueStyle}\n role=\"progressbar\"\n aria-label={get('progression', ariaLabel)}\n />\n </div>\n );\n }, [score, ariaLabel, skillCourses]);\n\n return (\n <div\n className={style.learnerSkillCardWrapper}\n data-name=\"learner-skill-card-wrapper\"\n aria-label={ariaLabel}\n >\n {skillCourses || skillQuestions ? (\n <div className={style.skillCoursesAndQuestionsWrapper}>\n {skillCourses ? (\n <div className={style.skillInformation} data-name=\"skill-courses\">\n <span className={style.skillInformationNumber}>{skillCourses}</span> {coursesLocale}\n </div>\n ) : null}\n {skillQuestions ? (\n <div className={style.skillInformation} data-name=\"skill-questions\">\n <span className={style.skillInformationNumber}>{skillQuestions}</span>\n {questionsLocale}\n </div>\n ) : null}\n </div>\n ) : null}\n <div className={style.skillTitleWrapper}>\n <div\n data-name=\"skill-title\"\n className={style.skillTitle}\n aria-label={skillAriaLabel || skillTitle}\n >\n {skillTitle}\n </div>\n {focus ? (\n <div className={style.skillFocusBadge}>\n <Icon\n iconName=\"bullseye-arrow\"\n backgroundColor=\"#DDD1FF\"\n size={{\n faSize: 10,\n wrapperSize: 16\n }}\n />\n {skillFocusLocale}\n </div>\n ) : null}\n </div>\n <ProgressBar />\n <div className={style.progressInformations}>\n {skillCourses && (\n <>\n <div className={style.progressInformation} data-name=\"skill-completed-courses\">\n <span className={style.progressInformationNumber}>{completedCourses}</span>\n {` ${coursesCompletedLocale}`}\n </div>\n <div className={style.progressInformation} data-name=\"completed-percentage\">\n <span className={style.progressInformationNumber}>{score}%</span>\n </div>\n </>\n )}\n </div>\n <div className={style.ctaWrapper} data-name=\"cta-wrapper\">\n <ButtonLink {...buttonReviewProps} />\n <div\n className={style.buttonWrapper}\n onMouseOver={handleMouseOver}\n onMouseLeave={handleMouseLeave}\n data-name=\"button-explore-wrapper\"\n >\n <ButtonLink {...buttonExploreProps} />\n </div>\n </div>\n </div>\n );\n};\n\nLearnerSkillCard.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nLearnerSkillCard.propTypes = {\n 'aria-label': PropTypes.string,\n skillTitle: PropTypes.string,\n skillAriaLabel: PropTypes.string,\n focus: PropTypes.bool,\n metrics: PropTypes.shape({\n score: PropTypes.number,\n skillCourses: PropTypes.number,\n skillQuestions: PropTypes.number,\n completedCourses: PropTypes.number\n }),\n review: PropTypes.bool,\n onReviewClick: PropTypes.func,\n onExploreClick: PropTypes.func\n};\n\nexport default LearnerSkillCard;\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAEA,MAAMA,gBAAgB,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EAC3C,MAAM;IACJ,cAA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} from '../../atom/provider/web-context';
|
|
2
3
|
import { FormatedDataType, LearningProfileRadarChartPropTypes } from './types';
|
|
3
4
|
export declare const formatData: (legend: {
|
|
4
5
|
[ref: string]: string;
|
|
5
6
|
}, data_: LearningProfileRadarChartPropTypes['data']) => FormatedDataType[];
|
|
6
7
|
export declare const LearningProfileRadarChart: {
|
|
7
|
-
({ data, legend, totalDataset, colors: colorsProps, onClick, width, height, margin }: LearningProfileRadarChartPropTypes): JSX.Element;
|
|
8
|
+
({ data, legend, totalDataset, colors: colorsProps, onClick, onExploreClick, width, height, margin }: LearningProfileRadarChartPropTypes, legacyContext: WebContextValues): JSX.Element;
|
|
9
|
+
contextTypes: {
|
|
10
|
+
skin: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
11
|
+
common: import("prop-types").Requireable<{
|
|
12
|
+
[x: string]: any;
|
|
13
|
+
}>;
|
|
14
|
+
images: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
15
|
+
'logo-mobile': import("prop-types").Requireable<any>;
|
|
16
|
+
logo: import("prop-types").Requireable<any>;
|
|
17
|
+
'logo-email': import("prop-types").Requireable<any>;
|
|
18
|
+
login: import("prop-types").Requireable<any>;
|
|
19
|
+
}>>;
|
|
20
|
+
icons: import("prop-types").Requireable<{
|
|
21
|
+
[x: string]: any;
|
|
22
|
+
}>;
|
|
23
|
+
mod: import("prop-types").Requireable<{
|
|
24
|
+
[x: string]: any;
|
|
25
|
+
}>;
|
|
26
|
+
courses: import("prop-types").Requireable<any[]>;
|
|
27
|
+
texts: import("prop-types").Requireable<{
|
|
28
|
+
[x: string]: any;
|
|
29
|
+
}>;
|
|
30
|
+
}>>;
|
|
31
|
+
translate: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
32
|
+
};
|
|
8
33
|
propTypes: {
|
|
9
34
|
data: import("prop-types").Validator<{
|
|
10
35
|
[x: string]: NonNullable<number | (number | null | undefined)[] | null | undefined> | null | undefined;
|
|
@@ -26,6 +51,7 @@ export declare const LearningProfileRadarChart: {
|
|
|
26
51
|
}> | null | undefined)[]>;
|
|
27
52
|
width: import("prop-types").Requireable<number>;
|
|
28
53
|
height: import("prop-types").Requireable<number>;
|
|
54
|
+
onExploreClick: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
29
55
|
};
|
|
30
56
|
};
|
|
31
57
|
declare const ResponsiveLearningProfileRadarChart: {
|
|
@@ -51,6 +77,7 @@ declare const ResponsiveLearningProfileRadarChart: {
|
|
|
51
77
|
}> | null | undefined)[]>;
|
|
52
78
|
width: import("prop-types").Requireable<number>;
|
|
53
79
|
height: import("prop-types").Requireable<number>;
|
|
80
|
+
onExploreClick: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
54
81
|
};
|
|
55
82
|
};
|
|
56
83
|
export default ResponsiveLearningProfileRadarChart;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/learning-profile-radar-chart/index.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/learning-profile-radar-chart/index.tsx"],"names":[],"mappings":";AAiCA,OAAO,EAAC,gBAAgB,EAAC,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAGL,gBAAgB,EAChB,kCAAkC,EAGnC,MAAM,SAAS,CAAC;AAmUjB,eAAO,MAAM,UAAU,EAAE,CACvB,MAAM,EAAE;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CAAC,EAC/B,KAAK,EAAE,kCAAkC,CAAC,MAAM,CAAC,KAC9C,gBAAgB,EAOX,CAAC;AAEX,eAAO,MAAM,yBAAyB;0GAWjC,kCAAkC,iBACtB,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqJhC,CAAC;AAEF,QAAA,MAAM,mCAAmC;YAAW,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;CAIrF,CAAC;AAUF,eAAe,mCAAmC,CAAC"}
|