@coorpacademy/components 11.9.3-alpha.25 → 11.9.3-alpha.26
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/select/index.d.ts +1 -0
- package/es/atom/select/index.d.ts.map +1 -1
- package/es/atom/select/index.js +13 -8
- package/es/atom/select/index.js.map +1 -1
- package/es/molecule/answer/index.d.ts +0 -3
- package/es/molecule/answer/index.d.ts.map +1 -1
- package/es/molecule/answer/index.js +3 -9
- package/es/molecule/answer/index.js.map +1 -1
- package/es/molecule/brand-form-group/index.d.ts +2 -0
- package/es/molecule/filters/index.d.ts +1 -0
- package/es/molecule/filters/index.d.ts.map +1 -1
- package/es/molecule/setup-slide/index.d.ts +1 -0
- package/es/molecule/setup-slider/index.d.ts +1 -0
- package/es/organism/brand-form/index.d.ts +2 -0
- package/es/organism/wizard-contents/index.d.ts +2 -0
- package/es/template/activity/index.d.ts +12 -11
- package/es/template/activity/index.d.ts.map +1 -1
- package/es/template/activity/index.js +6 -3
- package/es/template/activity/index.js.map +1 -1
- package/es/template/back-office/brand-update/index.d.ts +4 -0
- package/es/template/common/search-page/index.d.ts +1 -0
- package/lib/atom/select/index.d.ts +1 -0
- package/lib/atom/select/index.d.ts.map +1 -1
- package/lib/atom/select/index.js +13 -8
- package/lib/atom/select/index.js.map +1 -1
- package/lib/molecule/answer/index.d.ts +0 -3
- package/lib/molecule/answer/index.d.ts.map +1 -1
- package/lib/molecule/answer/index.js +3 -9
- package/lib/molecule/answer/index.js.map +1 -1
- package/lib/molecule/brand-form-group/index.d.ts +2 -0
- package/lib/molecule/filters/index.d.ts +1 -0
- package/lib/molecule/filters/index.d.ts.map +1 -1
- package/lib/molecule/setup-slide/index.d.ts +1 -0
- package/lib/molecule/setup-slider/index.d.ts +1 -0
- package/lib/organism/brand-form/index.d.ts +2 -0
- package/lib/organism/wizard-contents/index.d.ts +2 -0
- package/lib/template/activity/index.d.ts +12 -11
- package/lib/template/activity/index.d.ts.map +1 -1
- package/lib/template/activity/index.js +6 -3
- package/lib/template/activity/index.js.map +1 -1
- package/lib/template/back-office/brand-update/index.d.ts +4 -0
- package/lib/template/common/search-page/index.d.ts +1 -0
- package/package.json +2 -2
|
@@ -69,6 +69,7 @@ declare namespace Select {
|
|
|
69
69
|
modified: PropTypes.Requireable<boolean>;
|
|
70
70
|
error: PropTypes.Requireable<boolean>;
|
|
71
71
|
'aria-label': PropTypes.Requireable<string>;
|
|
72
|
+
'aria-labelledby': PropTypes.Requireable<string>;
|
|
72
73
|
};
|
|
73
74
|
}
|
|
74
75
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/select/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/select/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAuDA,qEAwLC"}
|
package/es/atom/select/index.js
CHANGED
|
@@ -38,9 +38,7 @@ const ArrowView = ({
|
|
|
38
38
|
arrowClass,
|
|
39
39
|
arrowColor
|
|
40
40
|
}) => {
|
|
41
|
-
const props = useMemo(() => _extends({},
|
|
42
|
-
'aria-label': ariaLabel
|
|
43
|
-
}, arrowColor & {
|
|
41
|
+
const props = useMemo(() => _extends({}, arrowColor & {
|
|
44
42
|
color: arrowColor
|
|
45
43
|
}, {
|
|
46
44
|
className: arrowClass
|
|
@@ -71,7 +69,8 @@ const Select = (props, legacyContext) => {
|
|
|
71
69
|
modified = false,
|
|
72
70
|
error = false,
|
|
73
71
|
title: propTitle,
|
|
74
|
-
'aria-label': ariaLabel
|
|
72
|
+
'aria-label': ariaLabel,
|
|
73
|
+
'aria-labelledby': ariaLabelledBy
|
|
75
74
|
} = props;
|
|
76
75
|
const skin = GetSkinFromContext(legacyContext);
|
|
77
76
|
const title = useMemo(() => propTitle ? `${propTitle}${required ? '*' : ''}` : null, [propTitle, required]);
|
|
@@ -146,10 +145,15 @@ const Select = (props, legacyContext) => {
|
|
|
146
145
|
ariaLabel: ariaLabel,
|
|
147
146
|
arrowClass: shouldUseSkinFontColor ? style.selectedArrow : style.arrow,
|
|
148
147
|
arrowColor: isThemeOneOfQuestionTemplateOrPlayer ? arrowColor : black
|
|
149
|
-
}), /*#__PURE__*/React.createElement("select", {
|
|
148
|
+
}), /*#__PURE__*/React.createElement("select", _extends({}, ariaLabelledBy ? {
|
|
149
|
+
'aria-labelledby': ariaLabelledBy
|
|
150
|
+
} : {}, ariaLabel && !ariaLabelledBy ? {
|
|
151
|
+
'aria-label': ariaLabel
|
|
152
|
+
} : {}, ariaLabel ? {
|
|
153
|
+
title: ariaLabel
|
|
154
|
+
} : {}, {
|
|
150
155
|
"data-name": "native-select",
|
|
151
156
|
className: style.selectBox,
|
|
152
|
-
title: selectedLabel,
|
|
153
157
|
name: name,
|
|
154
158
|
onChange: handleChange,
|
|
155
159
|
value: selected,
|
|
@@ -162,7 +166,7 @@ const Select = (props, legacyContext) => {
|
|
|
162
166
|
,
|
|
163
167
|
onMouseLeave: handleSelectOnBlur,
|
|
164
168
|
"data-testid": "native-select"
|
|
165
|
-
}, optionList)), /*#__PURE__*/React.createElement("div", {
|
|
169
|
+
}), optionList)), /*#__PURE__*/React.createElement("div", {
|
|
166
170
|
className: style.description
|
|
167
171
|
}, description));
|
|
168
172
|
};
|
|
@@ -195,7 +199,8 @@ Select.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
195
199
|
optgroups: PropTypes.arrayOf(PropTypes.shape(SelectOptionGroupPropTypes)),
|
|
196
200
|
modified: PropTypes.bool,
|
|
197
201
|
error: PropTypes.bool,
|
|
198
|
-
'aria-label': PropTypes.string
|
|
202
|
+
'aria-label': PropTypes.string,
|
|
203
|
+
'aria-labelledby': PropTypes.string
|
|
199
204
|
} : {};
|
|
200
205
|
export default Select;
|
|
201
206
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useCallback","useMemo","useState","PropTypes","classnames","concat","filter","find","flatMapDeep","get","getOr","includes","isEmpty","keys","map","size","NovaCompositionNavigationArrowDown","ArrowDown","NovaCompositionNavigationArrowTop","ArrowUp","Provider","GetSkinFromContext","getClassState","style","themeStyle","invalid","header","mooc","question","sort","thematiques","player","template","coorpmanager","ArrowView","shouldRender","isArrowUp","ariaLabel","arrowClass","arrowColor","props","color","className","Select","legacyContext","name","options","optgroups","borderClassName","onChange","multiple","disabled","required","description","theme","modified","error","title","propTitle","skin","setIsArrowUp","handleSelectOnFocus","handleSelectOnBlur","selectOption","option","index","value","optionList","optgroup","label","i","titleView","selected","selectedLabel","isSelectedInValidOption","validOption","handleChange","e","target","selectedOptions","black","isThemeOneOfQuestionTemplateOrPlayer","shouldUseSkinFontColor","undefined","behaviorClassName","default","composedClassName","unselected","labelSize","isLongLabel","selectWrapper","selectSpan","noLabelCommon","longLabel","selectedArrow","arrow","selectBox","SelectOptionPropTypes","string","isRequired","oneOfType","number","bool","SelectOptionGroupPropTypes","arrayOf","shape","contextTypes","childContextTypes","propTypes","func","oneOf"],"sources":["../../../src/atom/select/index.js"],"sourcesContent":["import React, {useCallback, useMemo, useState} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport concat from 'lodash/fp/concat';\nimport filter from 'lodash/fp/filter';\nimport find from 'lodash/fp/find';\nimport flatMapDeep from 'lodash/fp/flatMapDeep';\nimport get from 'lodash/fp/get';\nimport getOr from 'lodash/fp/getOr';\nimport includes from 'lodash/fp/includes';\nimport isEmpty from 'lodash/fp/isEmpty';\nimport keys from 'lodash/fp/keys';\nimport map from 'lodash/fp/map';\nimport size from 'lodash/fp/size';\nimport {\n NovaCompositionNavigationArrowDown as ArrowDown,\n NovaCompositionNavigationArrowTop as ArrowUp\n} from '@coorpacademy/nova-icons';\nimport Provider, {GetSkinFromContext} from '../provider';\nimport getClassState from '../../util/get-class-state';\nimport style from './style.css';\n\nconst themeStyle = {\n filter: style.filter,\n invalid: style.invalid,\n header: style.header,\n mooc: style.mooc,\n question: style.question,\n sort: style.sort,\n thematiques: style.thematiques,\n player: style.player,\n template: style.template,\n coorpmanager: null\n};\n\nconst ArrowView = ({shouldRender, isArrowUp, ariaLabel, arrowClass, arrowColor}) => {\n const props = useMemo(\n () => ({\n ...(ariaLabel &\n {\n 'aria-label': ariaLabel\n }),\n ...(arrowColor &\n {\n color: arrowColor\n }),\n className: arrowClass\n }),\n [ariaLabel, arrowClass, arrowColor]\n );\n if (shouldRender) {\n return isArrowUp ? (\n <ArrowUp {...props} data-testid=\"select-arrow-up-icon\" />\n ) : (\n <ArrowDown {...props} data-testid=\"select-arrow-down-icon\" />\n );\n } else return null;\n};\n\nconst Select = (props, legacyContext) => {\n const {\n name,\n options = [],\n optgroups = [],\n className,\n borderClassName,\n onChange,\n multiple = false,\n disabled,\n required,\n description,\n theme,\n modified = false,\n error = false,\n title: propTitle,\n 'aria-label': ariaLabel\n } = props;\n\n const skin = GetSkinFromContext(legacyContext);\n const title = useMemo(\n () => (propTitle ? `${propTitle}${required ? '*' : ''}` : null),\n [propTitle, required]\n );\n\n const [isArrowUp, setIsArrowUp] = useState(false);\n\n const handleSelectOnFocus = useCallback(() => setIsArrowUp(true), []);\n const handleSelectOnBlur = useCallback(() => setIsArrowUp(false), []);\n\n const selectOption = (option, index) => {\n return (\n <option key={index} value={option.value} className={style.selectOption}>\n {option.name}\n </option>\n );\n };\n\n const optionList = !isEmpty(options)\n ? options.map((option, index) => selectOption(option, index))\n : optgroups.map((optgroup, index) => {\n return (\n <optgroup key={index} label={optgroup.label}>\n {optgroup.options && optgroup.options.map((option, i) => selectOption(option, i))}\n </optgroup>\n );\n });\n\n const titleView = title ? <span className={style.title}>{title} </span> : null;\n\n const selected = useMemo(\n () =>\n multiple\n ? map(get('value'), filter({selected: true}, options))\n : get('value', find({selected: true}, concat(options, flatMapDeep('options', optgroups)))),\n [multiple, options, optgroups]\n );\n const selectedLabel = useMemo(\n () =>\n multiple\n ? map(get('name'), filter({selected: true}, options))\n : get('name', find({selected: true}, concat(options, flatMapDeep('options', optgroups)))),\n [multiple, options, optgroups]\n );\n\n const isSelectedInValidOption = useMemo(\n () =>\n theme === 'player' &&\n getOr(false, 'name', find({validOption: false, selected: true}, options)),\n [options, theme]\n );\n\n const handleChange = useMemo(\n () =>\n multiple\n ? e => {\n setIsArrowUp(false);\n onChange(map(get('value'), e.target.selectedOptions));\n }\n : e => {\n setIsArrowUp(false);\n onChange(e.target.value);\n },\n [onChange, multiple]\n );\n\n const black = useMemo(() => getOr('#14171A', 'common.black', skin), [skin]);\n const color = useMemo(() => getOr('#00B0FF', 'common.primary', skin), [skin]);\n const isThemeOneOfQuestionTemplateOrPlayer = useMemo(\n () => includes(theme, ['question', 'template', 'player']),\n [theme]\n );\n const shouldUseSkinFontColor = useMemo(\n () => !isSelectedInValidOption && selected && isThemeOneOfQuestionTemplateOrPlayer,\n [isSelectedInValidOption, selected, isThemeOneOfQuestionTemplateOrPlayer]\n );\n const arrowColor = selected ? color : undefined;\n\n const behaviorClassName = useMemo(\n () => getClassState(style.default, style.modified, style.error, modified, error),\n [error, modified]\n );\n const composedClassName = useMemo(\n () =>\n classnames(\n theme && theme !== 'coorpmanager' ? themeStyle[theme] : behaviorClassName,\n selected ? style.selected : style.unselected,\n className\n ),\n [behaviorClassName, className, selected, theme]\n );\n\n const labelSize = useMemo(() => size(selectedLabel), [selectedLabel]);\n\n const isLongLabel = useMemo(() => labelSize >= 65, [labelSize]);\n\n return (\n <div\n className={classnames(\n composedClassName,\n theme === 'coorpmanager' ? style.coorpmanager : null\n )}\n >\n <label\n data-name=\"select-wrapper\"\n style={{\n ...(shouldUseSkinFontColor && {\n color\n })\n }}\n className={style.selectWrapper}\n >\n {titleView}\n <span\n data-name=\"select-span\"\n className={classnames(\n style.selectSpan,\n includes(theme, ['player', 'invalid', 'question', 'thematiques', 'template'])\n ? style.noLabelCommon\n : null,\n borderClassName,\n isLongLabel ? style.longLabel : null\n )}\n style={{\n ...(shouldUseSkinFontColor && {\n color\n })\n }}\n >\n {selectedLabel}\n </span>\n <ArrowView\n shouldRender={!multiple}\n isArrowUp={isArrowUp}\n ariaLabel={ariaLabel}\n arrowClass={shouldUseSkinFontColor ? style.selectedArrow : style.arrow}\n arrowColor={isThemeOneOfQuestionTemplateOrPlayer ? arrowColor : black}\n />\n <select\n data-name=\"native-select\"\n className={style.selectBox}\n title={selectedLabel}\n name={name}\n onChange={handleChange}\n value={selected}\n multiple={multiple}\n disabled={disabled}\n onClick={handleSelectOnFocus}\n onBlur={handleSelectOnBlur}\n // onBlur does not handle completely an out of bounds click\n // ex: select is Opened and a click is done outside, cancelling the select\n // that doesn't count as a Blur, so an onMouseLeave is needed\n onMouseLeave={handleSelectOnBlur}\n data-testid=\"native-select\"\n >\n {optionList}\n </select>\n </label>\n <div className={style.description}>{description}</div>\n </div>\n );\n};\n\nexport const SelectOptionPropTypes = {\n name: PropTypes.string.isRequired,\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n selected: PropTypes.bool,\n validOption: PropTypes.bool\n};\n\nexport const SelectOptionGroupPropTypes = {\n label: PropTypes.string.isRequired,\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes))\n};\n\nSelect.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nSelect.propTypes = {\n title: PropTypes.string,\n name: PropTypes.string,\n className: PropTypes.string,\n borderClassName: PropTypes.string,\n disabled: PropTypes.bool,\n multiple: PropTypes.bool,\n description: PropTypes.string,\n required: PropTypes.bool,\n onChange: PropTypes.func,\n theme: PropTypes.oneOf(keys(themeStyle)),\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes)),\n optgroups: PropTypes.arrayOf(PropTypes.shape(SelectOptionGroupPropTypes)),\n modified: PropTypes.bool,\n error: PropTypes.bool,\n 'aria-label': PropTypes.string\n};\n\nexport default Select;\n"],"mappings":";;A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EAAEjD,SAAS,CAACmG,IARH;EASjBrD,QAAQ,EAAE9C,SAAS,CAAC0G,IATH;EAUjBvD,KAAK,EAAEnD,SAAS,CAAC2G,KAAV,CAAgBjG,IAAI,CAACW,UAAD,CAApB,CAVU;EAWjBsB,OAAO,EAAE3C,SAAS,CAACqG,OAAV,CAAkBrG,SAAS,CAACsG,KAAV,CAAgBR,qBAAhB,CAAlB,CAXQ;EAYjBlD,SAAS,EAAE5C,SAAS,CAACqG,OAAV,CAAkBrG,SAAS,CAACsG,KAAV,CAAgBF,0BAAhB,CAAlB,CAZM;EAajBhD,QAAQ,EAAEpD,SAAS,CAACmG,IAbH;EAcjB9C,KAAK,EAAErD,SAAS,CAACmG,IAdA;EAejB,cAAcnG,SAAS,CAAC+F;AAfP,CAAnB;AAkBA,eAAevD,MAAf"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useCallback","useMemo","useState","PropTypes","classnames","concat","filter","find","flatMapDeep","get","getOr","includes","isEmpty","keys","map","size","NovaCompositionNavigationArrowDown","ArrowDown","NovaCompositionNavigationArrowTop","ArrowUp","Provider","GetSkinFromContext","getClassState","style","themeStyle","invalid","header","mooc","question","sort","thematiques","player","template","coorpmanager","ArrowView","shouldRender","isArrowUp","ariaLabel","arrowClass","arrowColor","props","color","className","Select","legacyContext","name","options","optgroups","borderClassName","onChange","multiple","disabled","required","description","theme","modified","error","title","propTitle","ariaLabelledBy","skin","setIsArrowUp","handleSelectOnFocus","handleSelectOnBlur","selectOption","option","index","value","optionList","optgroup","label","i","titleView","selected","selectedLabel","isSelectedInValidOption","validOption","handleChange","e","target","selectedOptions","black","isThemeOneOfQuestionTemplateOrPlayer","shouldUseSkinFontColor","undefined","behaviorClassName","default","composedClassName","unselected","labelSize","isLongLabel","selectWrapper","selectSpan","noLabelCommon","longLabel","selectedArrow","arrow","selectBox","SelectOptionPropTypes","string","isRequired","oneOfType","number","bool","SelectOptionGroupPropTypes","arrayOf","shape","contextTypes","childContextTypes","propTypes","func","oneOf"],"sources":["../../../src/atom/select/index.js"],"sourcesContent":["import React, {useCallback, useMemo, useState} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport concat from 'lodash/fp/concat';\nimport filter from 'lodash/fp/filter';\nimport find from 'lodash/fp/find';\nimport flatMapDeep from 'lodash/fp/flatMapDeep';\nimport get from 'lodash/fp/get';\nimport getOr from 'lodash/fp/getOr';\nimport includes from 'lodash/fp/includes';\nimport isEmpty from 'lodash/fp/isEmpty';\nimport keys from 'lodash/fp/keys';\nimport map from 'lodash/fp/map';\nimport size from 'lodash/fp/size';\nimport {\n NovaCompositionNavigationArrowDown as ArrowDown,\n NovaCompositionNavigationArrowTop as ArrowUp\n} from '@coorpacademy/nova-icons';\nimport Provider, {GetSkinFromContext} from '../provider';\nimport getClassState from '../../util/get-class-state';\nimport style from './style.css';\n\nconst themeStyle = {\n filter: style.filter,\n invalid: style.invalid,\n header: style.header,\n mooc: style.mooc,\n question: style.question,\n sort: style.sort,\n thematiques: style.thematiques,\n player: style.player,\n template: style.template,\n coorpmanager: null\n};\n\nconst ArrowView = ({shouldRender, isArrowUp, ariaLabel, arrowClass, arrowColor}) => {\n const props = useMemo(\n () => ({\n ...(arrowColor &\n {\n color: arrowColor\n }),\n className: arrowClass\n }),\n [ariaLabel, arrowClass, arrowColor]\n );\n if (shouldRender) {\n return isArrowUp ? (\n <ArrowUp {...props} data-testid=\"select-arrow-up-icon\" />\n ) : (\n <ArrowDown {...props} data-testid=\"select-arrow-down-icon\" />\n );\n } else return null;\n};\n\nconst Select = (props, legacyContext) => {\n const {\n name,\n options = [],\n optgroups = [],\n className,\n borderClassName,\n onChange,\n multiple = false,\n disabled,\n required,\n description,\n theme,\n modified = false,\n error = false,\n title: propTitle,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy\n } = props;\n\n const skin = GetSkinFromContext(legacyContext);\n const title = useMemo(\n () => (propTitle ? `${propTitle}${required ? '*' : ''}` : null),\n [propTitle, required]\n );\n\n const [isArrowUp, setIsArrowUp] = useState(false);\n\n const handleSelectOnFocus = useCallback(() => setIsArrowUp(true), []);\n const handleSelectOnBlur = useCallback(() => setIsArrowUp(false), []);\n\n const selectOption = (option, index) => {\n return (\n <option key={index} value={option.value} className={style.selectOption}>\n {option.name}\n </option>\n );\n };\n\n const optionList = !isEmpty(options)\n ? options.map((option, index) => selectOption(option, index))\n : optgroups.map((optgroup, index) => {\n return (\n <optgroup key={index} label={optgroup.label}>\n {optgroup.options && optgroup.options.map((option, i) => selectOption(option, i))}\n </optgroup>\n );\n });\n\n const titleView = title ? <span className={style.title}>{title} </span> : null;\n\n const selected = useMemo(\n () =>\n multiple\n ? map(get('value'), filter({selected: true}, options))\n : get('value', find({selected: true}, concat(options, flatMapDeep('options', optgroups)))),\n [multiple, options, optgroups]\n );\n const selectedLabel = useMemo(\n () =>\n multiple\n ? map(get('name'), filter({selected: true}, options))\n : get('name', find({selected: true}, concat(options, flatMapDeep('options', optgroups)))),\n [multiple, options, optgroups]\n );\n\n const isSelectedInValidOption = useMemo(\n () =>\n theme === 'player' &&\n getOr(false, 'name', find({validOption: false, selected: true}, options)),\n [options, theme]\n );\n\n const handleChange = useMemo(\n () =>\n multiple\n ? e => {\n setIsArrowUp(false);\n onChange(map(get('value'), e.target.selectedOptions));\n }\n : e => {\n setIsArrowUp(false);\n onChange(e.target.value);\n },\n [onChange, multiple]\n );\n\n const black = useMemo(() => getOr('#14171A', 'common.black', skin), [skin]);\n const color = useMemo(() => getOr('#00B0FF', 'common.primary', skin), [skin]);\n const isThemeOneOfQuestionTemplateOrPlayer = useMemo(\n () => includes(theme, ['question', 'template', 'player']),\n [theme]\n );\n const shouldUseSkinFontColor = useMemo(\n () => !isSelectedInValidOption && selected && isThemeOneOfQuestionTemplateOrPlayer,\n [isSelectedInValidOption, selected, isThemeOneOfQuestionTemplateOrPlayer]\n );\n const arrowColor = selected ? color : undefined;\n\n const behaviorClassName = useMemo(\n () => getClassState(style.default, style.modified, style.error, modified, error),\n [error, modified]\n );\n const composedClassName = useMemo(\n () =>\n classnames(\n theme && theme !== 'coorpmanager' ? themeStyle[theme] : behaviorClassName,\n selected ? style.selected : style.unselected,\n className\n ),\n [behaviorClassName, className, selected, theme]\n );\n\n const labelSize = useMemo(() => size(selectedLabel), [selectedLabel]);\n\n const isLongLabel = useMemo(() => labelSize >= 65, [labelSize]);\n\n return (\n <div\n className={classnames(\n composedClassName,\n theme === 'coorpmanager' ? style.coorpmanager : null\n )}\n >\n <label\n data-name=\"select-wrapper\"\n style={{\n ...(shouldUseSkinFontColor && {\n color\n })\n }}\n className={style.selectWrapper}\n >\n {titleView}\n <span\n data-name=\"select-span\"\n className={classnames(\n style.selectSpan,\n includes(theme, ['player', 'invalid', 'question', 'thematiques', 'template'])\n ? style.noLabelCommon\n : null,\n borderClassName,\n isLongLabel ? style.longLabel : null\n )}\n style={{\n ...(shouldUseSkinFontColor && {\n color\n })\n }}\n >\n {selectedLabel}\n </span>\n <ArrowView\n shouldRender={!multiple}\n isArrowUp={isArrowUp}\n ariaLabel={ariaLabel}\n arrowClass={shouldUseSkinFontColor ? style.selectedArrow : style.arrow}\n arrowColor={isThemeOneOfQuestionTemplateOrPlayer ? arrowColor : black}\n />\n <select\n {...(ariaLabelledBy ? {'aria-labelledby': ariaLabelledBy} : {})}\n {...(ariaLabel && !ariaLabelledBy ? {'aria-label': ariaLabel} : {})}\n {...(ariaLabel ? {title: ariaLabel} : {})}\n data-name=\"native-select\"\n className={style.selectBox}\n name={name}\n onChange={handleChange}\n value={selected}\n multiple={multiple}\n disabled={disabled}\n onClick={handleSelectOnFocus}\n onBlur={handleSelectOnBlur}\n // onBlur does not handle completely an out of bounds click\n // ex: select is Opened and a click is done outside, cancelling the select\n // that doesn't count as a Blur, so an onMouseLeave is needed\n onMouseLeave={handleSelectOnBlur}\n data-testid=\"native-select\"\n >\n {optionList}\n </select>\n </label>\n <div className={style.description}>{description}</div>\n </div>\n );\n};\n\nexport const SelectOptionPropTypes = {\n name: PropTypes.string.isRequired,\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n selected: PropTypes.bool,\n validOption: PropTypes.bool\n};\n\nexport const SelectOptionGroupPropTypes = {\n label: PropTypes.string.isRequired,\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes))\n};\n\nSelect.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nSelect.propTypes = {\n title: PropTypes.string,\n name: PropTypes.string,\n className: PropTypes.string,\n borderClassName: PropTypes.string,\n disabled: PropTypes.bool,\n multiple: PropTypes.bool,\n description: PropTypes.string,\n required: PropTypes.bool,\n onChange: PropTypes.func,\n theme: PropTypes.oneOf(keys(themeStyle)),\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes)),\n optgroups: PropTypes.arrayOf(PropTypes.shape(SelectOptionGroupPropTypes)),\n modified: PropTypes.bool,\n error: PropTypes.bool,\n 'aria-label': PropTypes.string,\n 'aria-labelledby': PropTypes.string\n};\n\nexport default Select;\n"],"mappings":";;AAAA,OAAOA,KAAP,IAAeC,WAAf,EAA4BC,OAA5B,EAAqCC,QAArC,QAAoD,OAApD;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,MAAP,MAAmB,kBAAnB;AACA,OAAOC,MAAP,MAAmB,kBAAnB;AACA,OAAOC,IAAP,MAAiB,gBAAjB;AACA,OAAOC,WAAP,MAAwB,uBAAxB;AACA,OAAOC,GAAP,MAAgB,eAAhB;AACA,OAAOC,KAAP,MAAkB,iBAAlB;AACA,OAAOC,QAAP,MAAqB,oBAArB;AACA,OAAOC,OAAP,MAAoB,mBAApB;AACA,OAAOC,IAAP,MAAiB,gBAAjB;AACA,OAAOC,GAAP,MAAgB,eAAhB;AACA,OAAOC,IAAP,MAAiB,gBAAjB;AACA,SACEC,kCAAkC,IAAIC,SADxC,EAEEC,iCAAiC,IAAIC,OAFvC,QAGO,0BAHP;AAIA,OAAOC,QAAP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AErD,SAAS,CAACoG,IAdA;EAejB,cAAcpG,SAAS,CAACgG,MAfP;EAgBjB,mBAAmBhG,SAAS,CAACgG;AAhBZ,CAAnB;AAmBA,eAAexD,MAAf"}
|
|
@@ -2,9 +2,6 @@ export default Answer;
|
|
|
2
2
|
declare function Answer(props: any): JSX.Element;
|
|
3
3
|
declare namespace Answer {
|
|
4
4
|
export { propTypes };
|
|
5
|
-
export namespace contextTypes {
|
|
6
|
-
const translate: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
7
|
-
}
|
|
8
5
|
}
|
|
9
6
|
import propTypes from "./prop-types";
|
|
10
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/answer/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/answer/index.js"],"names":[],"mappings":";AAwEA,iDAWC"}
|
|
@@ -15,7 +15,7 @@ import QcmGraphic from '../questions/qcm-graphic';
|
|
|
15
15
|
import QuestionRange from '../questions/question-range';
|
|
16
16
|
import Template from '../questions/template';
|
|
17
17
|
import Audio from '../audio';
|
|
18
|
-
import
|
|
18
|
+
import { GetTranslateFromContext } from '../../atom/provider';
|
|
19
19
|
import style from './style.css';
|
|
20
20
|
import propTypes, { MediaViewPropTypes, TYPE_AUDIO, TYPE_IMAGE, TYPE_VIDEO } from './prop-types';
|
|
21
21
|
|
|
@@ -64,11 +64,11 @@ MediaView.propTypes = process.env.NODE_ENV !== "production" ? MediaViewPropTypes
|
|
|
64
64
|
const Switch = ({
|
|
65
65
|
model,
|
|
66
66
|
help
|
|
67
|
-
}
|
|
67
|
+
}) => {
|
|
68
68
|
const {
|
|
69
69
|
type
|
|
70
70
|
} = model;
|
|
71
|
-
const translate =
|
|
71
|
+
const translate = GetTranslateFromContext();
|
|
72
72
|
|
|
73
73
|
switch (type) {
|
|
74
74
|
case 'qcmDrag':
|
|
@@ -111,9 +111,6 @@ Switch.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
111
111
|
model: propTypes.model,
|
|
112
112
|
help: propTypes.help
|
|
113
113
|
} : {};
|
|
114
|
-
Switch.contextTypes = {
|
|
115
|
-
translate: Provider.childContextTypes.translate
|
|
116
|
-
};
|
|
117
114
|
|
|
118
115
|
const Answer = props => {
|
|
119
116
|
const {
|
|
@@ -133,8 +130,5 @@ const Answer = props => {
|
|
|
133
130
|
};
|
|
134
131
|
|
|
135
132
|
Answer.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};
|
|
136
|
-
Answer.contextTypes = {
|
|
137
|
-
translate: Provider.childContextTypes.translate
|
|
138
|
-
};
|
|
139
133
|
export default Answer;
|
|
140
134
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","VideoPlayer","DropDown","FreeText","QcmDrag","Qcm","QcmGraphic","QuestionRange","Template","Audio","
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","VideoPlayer","DropDown","FreeText","QcmDrag","Qcm","QcmGraphic","QuestionRange","Template","Audio","GetTranslateFromContext","style","propTypes","MediaViewPropTypes","TYPE_AUDIO","TYPE_IMAGE","TYPE_VIDEO","MediaView","media","videoId","type","childProps","backgroundImage","url","video","audio","Switch","model","help","translate","Answer","props","wrapper"],"sources":["../../../src/molecule/answer/index.js"],"sourcesContent":["import React from 'react';\nimport {omit} from 'lodash/fp';\nimport VideoPlayer from '../video-player';\nimport DropDown from '../questions/drop-down';\nimport FreeText from '../questions/free-text';\nimport QcmDrag from '../questions/qcm-drag';\nimport Qcm from '../questions/qcm';\nimport QcmGraphic from '../questions/qcm-graphic';\nimport QuestionRange from '../questions/question-range';\nimport Template from '../questions/template';\nimport Audio from '../audio';\nimport {GetTranslateFromContext} from '../../atom/provider';\nimport style from './style.css';\nimport propTypes, {MediaViewPropTypes, TYPE_AUDIO, TYPE_IMAGE, TYPE_VIDEO} from './prop-types';\n\nconst MediaView = ({media}) => {\n const {videoId, type, ...childProps} = media;\n switch (type) {\n case TYPE_IMAGE:\n return (\n <div\n className={style.media}\n style={{\n backgroundImage: `url(${media.url})`\n }}\n />\n );\n case TYPE_VIDEO:\n return (\n <div className={style.video}>\n <VideoPlayer {...omit('id', childProps)} id={videoId} height=\"100%\" width=\"100%\" />\n </div>\n );\n case TYPE_AUDIO:\n return (\n <div className={style.audio}>\n <Audio {...omit('id', childProps)} height=\"100%\" width=\"100%\" />\n </div>\n );\n default:\n return null;\n }\n};\n\nMediaView.propTypes = MediaViewPropTypes;\n\nconst Switch = ({model, help}) => {\n const {type} = model;\n const translate = GetTranslateFromContext();\n switch (type) {\n case 'qcmDrag':\n return <QcmDrag {...model} help={help} groupAriaLabel={translate('answer_the_question')} />;\n case 'qcm':\n return <Qcm {...model} groupAriaLabel={translate('answer_the_question')} />;\n case 'qcmGraphic':\n return <QcmGraphic {...model} groupAriaLabel={translate('answer_the_question')} />;\n case 'freeText':\n return <FreeText {...model} />;\n case 'dropDown':\n return <DropDown {...model} groupAriaLabel={translate('answer_the_question')} />;\n case 'slider':\n return <QuestionRange {...model} groupAriaLabel={translate('answer_the_question')} />;\n case 'template':\n return <Template {...model} groupAriaLabel={translate('answer_the_question')} />;\n }\n};\n\nSwitch.propTypes = {\n model: propTypes.model,\n help: propTypes.help\n};\n\nconst Answer = props => {\n const {model, media, help} = props;\n\n return (\n <div data-name=\"answer\" className={style.wrapper}>\n {media ? <MediaView media={media} /> : null}\n <form>\n <Switch model={model} help={help} />\n </form>\n </div>\n );\n};\n\nAnswer.propTypes = propTypes;\n\nexport default Answer;\n"],"mappings":";;;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAEA,OAAOC,WAAP,MAAwB,iBAAxB;AACA,OAAOC,QAAP,MAAqB,wBAArB;AACA,OAAOC,QAAP,MAAqB,wBAArB;AACA,OAAOC,OAAP,MAAoB,uBAApB;AACA,OAAOC,GAAP,MAAgB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D;IAAQ,KAAK,EAAES,KAAf;IAAsB,IAAI,EAAEC;EAA5B,EADF,CAFF,CADF;AAQD,CAXD;;AAaAE,MAAM,CAAClB,SAAP,2CAAmBA,SAAnB;AAEA,eAAekB,MAAf"}
|
|
@@ -109,6 +109,7 @@ declare namespace BrandFormGroup {
|
|
|
109
109
|
modified: PropTypes.Requireable<boolean>;
|
|
110
110
|
error: PropTypes.Requireable<boolean>;
|
|
111
111
|
'aria-label': PropTypes.Requireable<string>;
|
|
112
|
+
'aria-labelledby': PropTypes.Requireable<string>;
|
|
112
113
|
}> | PropTypes.InferProps<{
|
|
113
114
|
type: PropTypes.Requireable<string>;
|
|
114
115
|
title: PropTypes.Validator<string>;
|
|
@@ -224,6 +225,7 @@ declare namespace BrandFormGroup {
|
|
|
224
225
|
modified: PropTypes.Requireable<boolean>;
|
|
225
226
|
error: PropTypes.Requireable<boolean>;
|
|
226
227
|
'aria-label': PropTypes.Requireable<string>;
|
|
228
|
+
'aria-labelledby': PropTypes.Requireable<string>;
|
|
227
229
|
}> | PropTypes.InferProps<{
|
|
228
230
|
type: PropTypes.Requireable<string>;
|
|
229
231
|
title: PropTypes.Validator<string>;
|
|
@@ -40,6 +40,7 @@ declare class Filters extends React.Component<any, any, any> {
|
|
|
40
40
|
modified: PropTypes.Requireable<boolean>;
|
|
41
41
|
error: PropTypes.Requireable<boolean>;
|
|
42
42
|
'aria-label': PropTypes.Requireable<string>;
|
|
43
|
+
'aria-labelledby': PropTypes.Requireable<string>;
|
|
43
44
|
}>>;
|
|
44
45
|
onSearch: PropTypes.Requireable<(...args: any[]) => any>;
|
|
45
46
|
onToggleFilters: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/filters/index.js"],"names":[],"mappings":";AASA;IACE
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/filters/index.js"],"names":[],"mappings":";AASA;IACE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAeE;IAEF;;;;;;;;;;;;;;;;;;;;;;MAEE;IAEF,wBASC;IAPC;;;MAGC;IAMH,yBAcC;IAED,uBAYC;IAED,qBAOC;IAED,sBA2FC;CACF"}
|
|
@@ -66,6 +66,7 @@ declare namespace SetupSlide {
|
|
|
66
66
|
modified: PropTypes.Requireable<boolean>;
|
|
67
67
|
error: PropTypes.Requireable<boolean>;
|
|
68
68
|
'aria-label': PropTypes.Requireable<string>;
|
|
69
|
+
'aria-labelledby': PropTypes.Requireable<string>;
|
|
69
70
|
}> | PropTypes.InferProps<{
|
|
70
71
|
type: PropTypes.Requireable<string>;
|
|
71
72
|
title: PropTypes.Validator<string>;
|
|
@@ -79,6 +79,7 @@ declare namespace SetupSlider {
|
|
|
79
79
|
modified: PropTypes.Requireable<boolean>;
|
|
80
80
|
error: PropTypes.Requireable<boolean>;
|
|
81
81
|
'aria-label': PropTypes.Requireable<string>;
|
|
82
|
+
'aria-labelledby': PropTypes.Requireable<string>;
|
|
82
83
|
}> | PropTypes.InferProps<{
|
|
83
84
|
type: PropTypes.Requireable<string>;
|
|
84
85
|
title: PropTypes.Validator<string>;
|
|
@@ -139,6 +139,7 @@ declare namespace BrandForm {
|
|
|
139
139
|
modified: PropTypes.Requireable<boolean>;
|
|
140
140
|
error: PropTypes.Requireable<boolean>;
|
|
141
141
|
'aria-label': PropTypes.Requireable<string>;
|
|
142
|
+
'aria-labelledby': PropTypes.Requireable<string>;
|
|
142
143
|
}> | PropTypes.InferProps<{
|
|
143
144
|
type: PropTypes.Requireable<string>;
|
|
144
145
|
title: PropTypes.Validator<string>;
|
|
@@ -254,6 +255,7 @@ declare namespace BrandForm {
|
|
|
254
255
|
modified: PropTypes.Requireable<boolean>;
|
|
255
256
|
error: PropTypes.Requireable<boolean>;
|
|
256
257
|
'aria-label': PropTypes.Requireable<string>;
|
|
258
|
+
'aria-labelledby': PropTypes.Requireable<string>;
|
|
257
259
|
}> | PropTypes.InferProps<{
|
|
258
260
|
type: PropTypes.Requireable<string>;
|
|
259
261
|
title: PropTypes.Validator<string>;
|
|
@@ -156,6 +156,7 @@ declare namespace WizardContents {
|
|
|
156
156
|
modified: PropTypes.Requireable<boolean>;
|
|
157
157
|
error: PropTypes.Requireable<boolean>;
|
|
158
158
|
'aria-label': PropTypes.Requireable<string>;
|
|
159
|
+
'aria-labelledby': PropTypes.Requireable<string>;
|
|
159
160
|
}> | PropTypes.InferProps<{
|
|
160
161
|
type: PropTypes.Requireable<string>;
|
|
161
162
|
title: PropTypes.Validator<string>;
|
|
@@ -271,6 +272,7 @@ declare namespace WizardContents {
|
|
|
271
272
|
modified: PropTypes.Requireable<boolean>;
|
|
272
273
|
error: PropTypes.Requireable<boolean>;
|
|
273
274
|
'aria-label': PropTypes.Requireable<string>;
|
|
275
|
+
'aria-labelledby': PropTypes.Requireable<string>;
|
|
274
276
|
}> | PropTypes.InferProps<{
|
|
275
277
|
type: PropTypes.Requireable<string>;
|
|
276
278
|
title: PropTypes.Validator<string>;
|
|
@@ -24,15 +24,15 @@ declare namespace Progression {
|
|
|
24
24
|
}>;
|
|
25
25
|
}>>;
|
|
26
26
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
const propTypes: {
|
|
28
|
+
mainTitle: PropTypes.Validator<string>;
|
|
29
|
+
mainSubtitle: PropTypes.Validator<string>;
|
|
30
|
+
adaptiveAriaLabel: PropTypes.Requireable<string>;
|
|
31
|
+
total: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
32
32
|
label: PropTypes.Validator<string>;
|
|
33
33
|
stars: PropTypes.Validator<number>;
|
|
34
34
|
}>>>;
|
|
35
|
-
|
|
35
|
+
engines: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
36
36
|
type: PropTypes.Validator<string>;
|
|
37
37
|
stars: PropTypes.Validator<number>;
|
|
38
38
|
title: PropTypes.Validator<string>;
|
|
@@ -47,8 +47,8 @@ declare namespace Progression {
|
|
|
47
47
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
48
48
|
}>>;
|
|
49
49
|
}> | null | undefined)[]>;
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
loading: PropTypes.Validator<boolean>;
|
|
51
|
+
progressions: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
52
52
|
ref: PropTypes.Validator<string>;
|
|
53
53
|
completion: PropTypes.Validator<number>;
|
|
54
54
|
stars: PropTypes.Validator<number>;
|
|
@@ -63,7 +63,7 @@ declare namespace Progression {
|
|
|
63
63
|
adaptive: PropTypes.Validator<boolean>;
|
|
64
64
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
65
65
|
}> | null | undefined)[]>;
|
|
66
|
-
|
|
66
|
+
themeFilter: PropTypes.Requireable<PropTypes.InferProps<{
|
|
67
67
|
options: PropTypes.Validator<(PropTypes.InferProps<{
|
|
68
68
|
name: PropTypes.Validator<string>;
|
|
69
69
|
value: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
@@ -72,14 +72,15 @@ declare namespace Progression {
|
|
|
72
72
|
}> | null | undefined)[]>;
|
|
73
73
|
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
74
74
|
}>>;
|
|
75
|
-
|
|
75
|
+
recommendation: PropTypes.Requireable<PropTypes.InferProps<{
|
|
76
76
|
cta: PropTypes.Validator<string>;
|
|
77
77
|
title: PropTypes.Validator<string>;
|
|
78
78
|
subtitle: PropTypes.Validator<string>;
|
|
79
79
|
courseTitle: PropTypes.Validator<string>;
|
|
80
80
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
81
81
|
}>>;
|
|
82
|
-
|
|
82
|
+
'aria-label': PropTypes.Requireable<string>;
|
|
83
|
+
};
|
|
83
84
|
}
|
|
84
85
|
import PropTypes from "prop-types";
|
|
85
86
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/activity/index.js"],"names":[],"mappings":";AAmBA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/activity/index.js"],"names":[],"mappings":";AAmBA,0EA4GC"}
|
|
@@ -30,7 +30,8 @@ const Progression = (props, legacyContext) => {
|
|
|
30
30
|
total,
|
|
31
31
|
engines = [],
|
|
32
32
|
themeFilter = {},
|
|
33
|
-
loading
|
|
33
|
+
loading,
|
|
34
|
+
'aria-label': ariaLabel
|
|
34
35
|
} = props;
|
|
35
36
|
const skin = GetSkinFromContext(legacyContext);
|
|
36
37
|
const {
|
|
@@ -64,7 +65,8 @@ const Progression = (props, legacyContext) => {
|
|
|
64
65
|
className: style.select,
|
|
65
66
|
theme: "thematiques",
|
|
66
67
|
options: themeFilter.options,
|
|
67
|
-
onChange: handleSelectTheme
|
|
68
|
+
onChange: handleSelectTheme,
|
|
69
|
+
"aria-label": ariaLabel
|
|
68
70
|
}) : null;
|
|
69
71
|
const recommendationSection = !isEmpty(recommendation) ? /*#__PURE__*/React.createElement("div", {
|
|
70
72
|
className: style.recommendationWrapper
|
|
@@ -136,7 +138,8 @@ Progression.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
136
138
|
subtitle: PropTypes.string.isRequired,
|
|
137
139
|
courseTitle: PropTypes.string.isRequired,
|
|
138
140
|
onClick: PropTypes.func
|
|
139
|
-
})
|
|
141
|
+
}),
|
|
142
|
+
'aria-label': PropTypes.string
|
|
140
143
|
} : {};
|
|
141
144
|
export default Progression;
|
|
142
145
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useCallback","get","isEmpty","map","noop","omit","PropTypes","classnames","Provider","GetSkinFromContext","Button","Select","Loader","ProgressionItem","EngineStars","StarsSummary","style","mapWithIndex","convert","cap","Progression","props","legacyContext","mainTitle","mainSubtitle","recommendation","progressions","adaptiveAriaLabel","total","engines","themeFilter","loading","skin","onChange","themeFilterOnChange","handleClick","e","stopPropagation","preventDefault","onClick","handleSelectTheme","primary","loader","allProgressions","progression","index","ref","coreProgression","core","themeSelect","options","selectBorder","select","recommendationSection","recommendationWrapper","title","subtitle","course","innerHTML","__html","courseTitle","cta","backgroundColor","default","headerProgression","wrapperCta","wrapperProgression","contextTypes","childContextTypes","propTypes","string","isRequired","shape","label","stars","number","arrayOf","bool","func"],"sources":["../../../src/template/activity/index.js"],"sourcesContent":["import React, {useCallback} from 'react';\nimport get from 'lodash/fp/get';\nimport isEmpty from 'lodash/fp/isEmpty';\nimport map from 'lodash/fp/map';\nimport noop from 'lodash/fp/noop';\nimport omit from 'lodash/fp/omit';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport Provider, {GetSkinFromContext} from '../../atom/provider';\nimport Button from '../../atom/button';\nimport Select from '../../atom/select';\nimport Loader from '../../atom/loader';\nimport ProgressionItem from './progression-item';\nimport EngineStars from './engine-stars';\nimport StarsSummary from './stars-summary';\nimport style from './style.css';\n\nconst mapWithIndex = map.convert({cap: false});\n\nconst Progression = (props, legacyContext) => {\n const {\n mainTitle,\n mainSubtitle,\n recommendation = {},\n progressions = [],\n adaptiveAriaLabel,\n total,\n engines = [],\n themeFilter = {},\n loading\n } = props;\n const skin = GetSkinFromContext(legacyContext);\n const {onChange: themeFilterOnChange} = themeFilter;\n\n const handleClick = useCallback(\n e => {\n e.stopPropagation();\n e.preventDefault();\n const {onClick = noop} = recommendation;\n onClick(e);\n },\n [recommendation]\n );\n\n const handleSelectTheme = useCallback(\n e => {\n themeFilterOnChange && themeFilterOnChange(e);\n },\n [themeFilterOnChange]\n );\n\n const primary = get('common.primary', skin);\n const loader = loading ? (\n <div className={style.loader}>\n <Loader />\n </div>\n ) : null;\n const allProgressions = mapWithIndex(\n (progression, index) => (\n <ProgressionItem\n {...omit(['ref'], progression)}\n key={`${index}-${progression.ref}`}\n adaptiveAriaLabel={adaptiveAriaLabel}\n />\n ),\n progressions\n );\n\n const coreProgression = (\n <div data-name=\"activityCore\" className={style.core}>\n {allProgressions}\n </div>\n );\n const themeSelect = !isEmpty(themeFilter.options) ? (\n <Select\n borderClassName={style.selectBorder}\n className={style.select}\n theme=\"thematiques\"\n options={themeFilter.options}\n onChange={handleSelectTheme}\n />\n ) : null;\n const recommendationSection = !isEmpty(recommendation) ? (\n <div className={style.recommendationWrapper}>\n <p className={style.recommendationSection}>{recommendation.title} </p>\n <p className={style.recommendationSection}>\n <span>{recommendation.subtitle} </span>\n <span\n className={classnames(style.course, style.innerHTML)}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: recommendation.courseTitle}}\n />\n </p>\n <Button\n type=\"link\"\n onClick={handleClick}\n submitValue={recommendation.cta}\n style={{\n backgroundColor: primary\n }}\n className={style.cta}\n />\n </div>\n ) : null;\n\n return (\n <div className={style.default}>\n <div data-name=\"activity-header\" tabIndex={0}>\n <div className={style.mainTitle} tabIndex={0}>\n <span>{mainTitle}</span> {mainSubtitle}\n </div>\n <div className={style.headerProgression} tabIndex={0}>\n <div className={style.wrapperCta} tabIndex={0}>\n {themeSelect}\n {recommendationSection}\n </div>\n <StarsSummary engines={engines} total={total} />\n </div>\n </div>\n <div className={style.wrapperProgression} data-name=\"activityList\">\n {coreProgression}\n {loader}\n </div>\n </div>\n );\n};\n\nProgression.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nProgression.propTypes = {\n mainTitle: PropTypes.string.isRequired,\n mainSubtitle: PropTypes.string.isRequired,\n adaptiveAriaLabel: PropTypes.string,\n total: PropTypes.shape({\n label: PropTypes.string.isRequired,\n stars: PropTypes.number.isRequired\n }).isRequired,\n engines: PropTypes.arrayOf(PropTypes.shape(EngineStars.propTypes)),\n loading: PropTypes.bool.isRequired,\n progressions: PropTypes.arrayOf(\n PropTypes.shape({...ProgressionItem.propTypes, ref: PropTypes.string.isRequired})\n ),\n themeFilter: PropTypes.shape({\n options: Select.propTypes.options.isRequired,\n onChange: Select.propTypes.onChange\n }),\n recommendation: PropTypes.shape({\n cta: PropTypes.string.isRequired,\n title: PropTypes.string.isRequired,\n subtitle: PropTypes.string.isRequired,\n courseTitle: PropTypes.string.isRequired,\n onClick: PropTypes.func\n })\n};\n\nexport default Progression;\n"],"mappings":";;AAAA,OAAOA,KAAP,IAAeC,WAAf,QAAiC,OAAjC;AACA,OAAOC,GAAP,MAAgB,eAAhB;AACA,OAAOC,OAAP,MAAoB,mBAApB;AACA,OAAOC,GAAP,MAAgB,eAAhB;AACA,OAAOC,IAAP,MAAiB,gBAAjB;AACA,OAAOC,IAAP,MAAiB,gBAAjB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,QAAP,IAAkBC,kBAAlB,QAA2C,qBAA3C;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,OAAOC,eAAP,MAA4B,oBAA5B;AACA,OAAOC,WAAP,MAAwB,gBAAxB;AACA,OAAOC,YAAP,MAAyB,iBAAzB;AACA,OAAOC,KAAP,MAAkB,aAAlB;AAEA,MAAMC,YAAY,GAAGd,GAAG,CAACe,OAAJ,CAAY;EAACC,GAAG,EAAE;AAAN,CAAZ,CAArB;;AAEA,MAAMC,WAAW,GAAG,CAACC,KAAD,EAAQC,aAAR,KAA0B;EAC5C,MAAM;IACJC,SADI;IAEJC,YAFI;IAGJC,cAAc,GAAG,EAHb;IAIJC,YAAY,GAAG,EAJX;IAKJC,iBALI;IAMJC,KANI;IAOJC,OAAO,GAAG,EAPN;IAQJC,WAAW,GAAG,EARV;IASJC;EATI,IAUFV,KAVJ;EAWA,MAAMW,IAAI,GAAGvB,kBAAkB,CAACa,aAAD,CAA/B;EACA,MAAM;IAACW,QAAQ,EAAEC;EAAX,IAAkCJ,WAAxC;EAEA,MAAMK,WA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Bf,QAAQ,EAAElD,SAAS,CAACgE,MAAV,CAAiBC,UAHG;IAI9BX,WAAW,EAAEtD,SAAS,CAACgE,MAAV,CAAiBC,UAJA;IAK9BhC,OAAO,EAAEjC,SAAS,CAACwE;EALW,CAAhB;AAjBM,CAAxB;AA0BA,eAAe1D,WAAf"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useCallback","get","isEmpty","map","noop","omit","PropTypes","classnames","Provider","GetSkinFromContext","Button","Select","Loader","ProgressionItem","EngineStars","StarsSummary","style","mapWithIndex","convert","cap","Progression","props","legacyContext","mainTitle","mainSubtitle","recommendation","progressions","adaptiveAriaLabel","total","engines","themeFilter","loading","ariaLabel","skin","onChange","themeFilterOnChange","handleClick","e","stopPropagation","preventDefault","onClick","handleSelectTheme","primary","loader","allProgressions","progression","index","ref","coreProgression","core","themeSelect","options","selectBorder","select","recommendationSection","recommendationWrapper","title","subtitle","course","innerHTML","__html","courseTitle","cta","backgroundColor","default","headerProgression","wrapperCta","wrapperProgression","contextTypes","childContextTypes","propTypes","string","isRequired","shape","label","stars","number","arrayOf","bool","func"],"sources":["../../../src/template/activity/index.js"],"sourcesContent":["import React, {useCallback} from 'react';\nimport get from 'lodash/fp/get';\nimport isEmpty from 'lodash/fp/isEmpty';\nimport map from 'lodash/fp/map';\nimport noop from 'lodash/fp/noop';\nimport omit from 'lodash/fp/omit';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport Provider, {GetSkinFromContext} from '../../atom/provider';\nimport Button from '../../atom/button';\nimport Select from '../../atom/select';\nimport Loader from '../../atom/loader';\nimport ProgressionItem from './progression-item';\nimport EngineStars from './engine-stars';\nimport StarsSummary from './stars-summary';\nimport style from './style.css';\n\nconst mapWithIndex = map.convert({cap: false});\n\nconst Progression = (props, legacyContext) => {\n const {\n mainTitle,\n mainSubtitle,\n recommendation = {},\n progressions = [],\n adaptiveAriaLabel,\n total,\n engines = [],\n themeFilter = {},\n loading,\n 'aria-label': ariaLabel\n } = props;\n const skin = GetSkinFromContext(legacyContext);\n const {onChange: themeFilterOnChange} = themeFilter;\n\n const handleClick = useCallback(\n e => {\n e.stopPropagation();\n e.preventDefault();\n const {onClick = noop} = recommendation;\n onClick(e);\n },\n [recommendation]\n );\n\n const handleSelectTheme = useCallback(\n e => {\n themeFilterOnChange && themeFilterOnChange(e);\n },\n [themeFilterOnChange]\n );\n\n const primary = get('common.primary', skin);\n const loader = loading ? (\n <div className={style.loader}>\n <Loader />\n </div>\n ) : null;\n const allProgressions = mapWithIndex(\n (progression, index) => (\n <ProgressionItem\n {...omit(['ref'], progression)}\n key={`${index}-${progression.ref}`}\n adaptiveAriaLabel={adaptiveAriaLabel}\n />\n ),\n progressions\n );\n\n const coreProgression = (\n <div data-name=\"activityCore\" className={style.core}>\n {allProgressions}\n </div>\n );\n const themeSelect = !isEmpty(themeFilter.options) ? (\n <Select\n borderClassName={style.selectBorder}\n className={style.select}\n theme=\"thematiques\"\n options={themeFilter.options}\n onChange={handleSelectTheme}\n aria-label={ariaLabel}\n />\n ) : null;\n const recommendationSection = !isEmpty(recommendation) ? (\n <div className={style.recommendationWrapper}>\n <p className={style.recommendationSection}>{recommendation.title} </p>\n <p className={style.recommendationSection}>\n <span>{recommendation.subtitle} </span>\n <span\n className={classnames(style.course, style.innerHTML)}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: recommendation.courseTitle}}\n />\n </p>\n <Button\n type=\"link\"\n onClick={handleClick}\n submitValue={recommendation.cta}\n style={{\n backgroundColor: primary\n }}\n className={style.cta}\n />\n </div>\n ) : null;\n\n return (\n <div className={style.default}>\n <div data-name=\"activity-header\" tabIndex={0}>\n <div className={style.mainTitle} tabIndex={0}>\n <span>{mainTitle}</span> {mainSubtitle}\n </div>\n <div className={style.headerProgression} tabIndex={0}>\n <div className={style.wrapperCta} tabIndex={0}>\n {themeSelect}\n {recommendationSection}\n </div>\n <StarsSummary engines={engines} total={total} />\n </div>\n </div>\n <div className={style.wrapperProgression} data-name=\"activityList\">\n {coreProgression}\n {loader}\n </div>\n </div>\n );\n};\n\nProgression.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nProgression.propTypes = {\n mainTitle: PropTypes.string.isRequired,\n mainSubtitle: PropTypes.string.isRequired,\n adaptiveAriaLabel: PropTypes.string,\n total: PropTypes.shape({\n label: PropTypes.string.isRequired,\n stars: PropTypes.number.isRequired\n }).isRequired,\n engines: PropTypes.arrayOf(PropTypes.shape(EngineStars.propTypes)),\n loading: PropTypes.bool.isRequired,\n progressions: PropTypes.arrayOf(\n PropTypes.shape({...ProgressionItem.propTypes, ref: PropTypes.string.isRequired})\n ),\n themeFilter: PropTypes.shape({\n options: Select.propTypes.options.isRequired,\n onChange: Select.propTypes.onChange\n }),\n recommendation: PropTypes.shape({\n cta: PropTypes.string.isRequired,\n title: PropTypes.string.isRequired,\n subtitle: PropTypes.string.isRequired,\n courseTitle: PropTypes.string.isRequired,\n onClick: PropTypes.func\n }),\n 'aria-label': PropTypes.string\n};\n\nexport default Progression;\n"],"mappings":";;AAAA,OAAOA,KAAP,IAAeC,WAAf,QAAiC,OAAjC;AACA,OAAOC,GAAP,MAAgB,eAAhB;AACA,OAAOC,OAAP,MAAoB,mBAApB;AACA,OAAOC,GAAP,MAAgB,eAAhB;AACA,OAAOC,IAAP,MAAiB,gBAAjB;AACA,OAAOC,IAAP,MAAiB,gBAAjB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,QAAP,IAAkBC,kBAAlB,QAA2C,qBAA3C;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,OAAOC,eAAP,MAA4B,oBAA5B;AACA,OAAOC,WAAP,MAAwB,gBAAxB;AACA,OAAOC,YAAP,MAAyB,iBAAzB;AACA,OAAOC,KAAP,MAAkB,aAAlB;AAEA,MAAMC,YAAY,GAA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AACmE,KAAV,cAAoB5D,eAAe,CAACyD,SAApC;IAA+CvB,GAAG,EAAEzC,SAAS,CAACiE,MAAV,CAAiBC;EAArE,GADY,CAVQ;EAatB1C,WAAW,EAAExB,SAAS,CAACmE,KAAV,CAAgB;IAC3BtB,OAAO,EAAExC,MAAM,CAAC2D,SAAP,CAAiBnB,OAAjB,CAAyBqB,UADP;IAE3BtC,QAAQ,EAAEvB,MAAM,CAAC2D,SAAP,CAAiBpC;EAFA,CAAhB,CAbS;EAiBtBT,cAAc,EAAEnB,SAAS,CAACmE,KAAV,CAAgB;IAC9BX,GAAG,EAAExD,SAAS,CAACiE,MAAV,CAAiBC,UADQ;IAE9BhB,KAAK,EAAElD,SAAS,CAACiE,MAAV,CAAiBC,UAFM;IAG9Bf,QAAQ,EAAEnD,SAAS,CAACiE,MAAV,CAAiBC,UAHG;IAI9BX,WAAW,EAAEvD,SAAS,CAACiE,MAAV,CAAiBC,UAJA;IAK9BhC,OAAO,EAAElC,SAAS,CAACyE;EALW,CAAhB,CAjBM;EAwBtB,cAAczE,SAAS,CAACiE;AAxBF,CAAxB;AA2BA,eAAenD,WAAf"}
|
|
@@ -241,6 +241,7 @@ declare namespace BrandUpdate {
|
|
|
241
241
|
modified: PropTypes.Requireable<boolean>;
|
|
242
242
|
error: PropTypes.Requireable<boolean>;
|
|
243
243
|
'aria-label': PropTypes.Requireable<string>;
|
|
244
|
+
'aria-labelledby': PropTypes.Requireable<string>;
|
|
244
245
|
}> | PropTypes.InferProps<{
|
|
245
246
|
type: PropTypes.Requireable<string>;
|
|
246
247
|
title: PropTypes.Validator<string>;
|
|
@@ -356,6 +357,7 @@ declare namespace BrandUpdate {
|
|
|
356
357
|
modified: PropTypes.Requireable<boolean>;
|
|
357
358
|
error: PropTypes.Requireable<boolean>;
|
|
358
359
|
'aria-label': PropTypes.Requireable<string>;
|
|
360
|
+
'aria-labelledby': PropTypes.Requireable<string>;
|
|
359
361
|
}> | PropTypes.InferProps<{
|
|
360
362
|
type: PropTypes.Requireable<string>;
|
|
361
363
|
title: PropTypes.Validator<string>;
|
|
@@ -887,6 +889,7 @@ declare namespace BrandUpdate {
|
|
|
887
889
|
modified: PropTypes.Requireable<boolean>;
|
|
888
890
|
error: PropTypes.Requireable<boolean>;
|
|
889
891
|
'aria-label': PropTypes.Requireable<string>;
|
|
892
|
+
'aria-labelledby': PropTypes.Requireable<string>;
|
|
890
893
|
}> | PropTypes.InferProps<{
|
|
891
894
|
type: PropTypes.Requireable<string>;
|
|
892
895
|
title: PropTypes.Validator<string>;
|
|
@@ -1002,6 +1005,7 @@ declare namespace BrandUpdate {
|
|
|
1002
1005
|
modified: PropTypes.Requireable<boolean>;
|
|
1003
1006
|
error: PropTypes.Requireable<boolean>;
|
|
1004
1007
|
'aria-label': PropTypes.Requireable<string>;
|
|
1008
|
+
'aria-labelledby': PropTypes.Requireable<string>;
|
|
1005
1009
|
}> | PropTypes.InferProps<{
|
|
1006
1010
|
type: PropTypes.Requireable<string>;
|
|
1007
1011
|
title: PropTypes.Validator<string>;
|
|
@@ -67,6 +67,7 @@ declare namespace SearchPage {
|
|
|
67
67
|
modified: PropTypes.Requireable<boolean>;
|
|
68
68
|
error: PropTypes.Requireable<boolean>;
|
|
69
69
|
'aria-label': PropTypes.Requireable<string>;
|
|
70
|
+
'aria-labelledby': PropTypes.Requireable<string>;
|
|
70
71
|
}>>;
|
|
71
72
|
onSearch: PropTypes.Requireable<(...args: any[]) => any>;
|
|
72
73
|
onToggleFilters: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -69,6 +69,7 @@ declare namespace Select {
|
|
|
69
69
|
modified: PropTypes.Requireable<boolean>;
|
|
70
70
|
error: PropTypes.Requireable<boolean>;
|
|
71
71
|
'aria-label': PropTypes.Requireable<string>;
|
|
72
|
+
'aria-labelledby': PropTypes.Requireable<string>;
|
|
72
73
|
};
|
|
73
74
|
}
|
|
74
75
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/select/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/select/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAuDA,qEAwLC"}
|
package/lib/atom/select/index.js
CHANGED
|
@@ -67,9 +67,7 @@ const ArrowView = ({
|
|
|
67
67
|
arrowClass,
|
|
68
68
|
arrowColor
|
|
69
69
|
}) => {
|
|
70
|
-
const props = (0, _react.useMemo)(() => _extends({},
|
|
71
|
-
'aria-label': ariaLabel
|
|
72
|
-
}, arrowColor & {
|
|
70
|
+
const props = (0, _react.useMemo)(() => _extends({}, arrowColor & {
|
|
73
71
|
color: arrowColor
|
|
74
72
|
}, {
|
|
75
73
|
className: arrowClass
|
|
@@ -100,7 +98,8 @@ const Select = (props, legacyContext) => {
|
|
|
100
98
|
modified = false,
|
|
101
99
|
error = false,
|
|
102
100
|
title: propTitle,
|
|
103
|
-
'aria-label': ariaLabel
|
|
101
|
+
'aria-label': ariaLabel,
|
|
102
|
+
'aria-labelledby': ariaLabelledBy
|
|
104
103
|
} = props;
|
|
105
104
|
const skin = (0, _provider.GetSkinFromContext)(legacyContext);
|
|
106
105
|
const title = (0, _react.useMemo)(() => propTitle ? `${propTitle}${required ? '*' : ''}` : null, [propTitle, required]);
|
|
@@ -175,10 +174,15 @@ const Select = (props, legacyContext) => {
|
|
|
175
174
|
ariaLabel: ariaLabel,
|
|
176
175
|
arrowClass: shouldUseSkinFontColor ? _style.default.selectedArrow : _style.default.arrow,
|
|
177
176
|
arrowColor: isThemeOneOfQuestionTemplateOrPlayer ? arrowColor : black
|
|
178
|
-
}), /*#__PURE__*/_react.default.createElement("select", {
|
|
177
|
+
}), /*#__PURE__*/_react.default.createElement("select", _extends({}, ariaLabelledBy ? {
|
|
178
|
+
'aria-labelledby': ariaLabelledBy
|
|
179
|
+
} : {}, ariaLabel && !ariaLabelledBy ? {
|
|
180
|
+
'aria-label': ariaLabel
|
|
181
|
+
} : {}, ariaLabel ? {
|
|
182
|
+
title: ariaLabel
|
|
183
|
+
} : {}, {
|
|
179
184
|
"data-name": "native-select",
|
|
180
185
|
className: _style.default.selectBox,
|
|
181
|
-
title: selectedLabel,
|
|
182
186
|
name: name,
|
|
183
187
|
onChange: handleChange,
|
|
184
188
|
value: selected,
|
|
@@ -191,7 +195,7 @@ const Select = (props, legacyContext) => {
|
|
|
191
195
|
,
|
|
192
196
|
onMouseLeave: handleSelectOnBlur,
|
|
193
197
|
"data-testid": "native-select"
|
|
194
|
-
}, optionList)), /*#__PURE__*/_react.default.createElement("div", {
|
|
198
|
+
}), optionList)), /*#__PURE__*/_react.default.createElement("div", {
|
|
195
199
|
className: _style.default.description
|
|
196
200
|
}, description));
|
|
197
201
|
};
|
|
@@ -226,7 +230,8 @@ Select.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
226
230
|
optgroups: _propTypes.default.arrayOf(_propTypes.default.shape(SelectOptionGroupPropTypes)),
|
|
227
231
|
modified: _propTypes.default.bool,
|
|
228
232
|
error: _propTypes.default.bool,
|
|
229
|
-
'aria-label': _propTypes.default.string
|
|
233
|
+
'aria-label': _propTypes.default.string,
|
|
234
|
+
'aria-labelledby': _propTypes.default.string
|
|
230
235
|
} : {};
|
|
231
236
|
var _default = Select;
|
|
232
237
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["themeStyle","filter","style","invalid","header","mooc","question","sort","thematiques","player","template","coorpmanager","ArrowView","shouldRender","isArrowUp","ariaLabel","arrowClass","arrowColor","props","useMemo","color","className","Select","legacyContext","name","options","optgroups","borderClassName","onChange","multiple","disabled","required","description","theme","modified","error","title","propTitle","skin","GetSkinFromContext","setIsArrowUp","useState","handleSelectOnFocus","useCallback","handleSelectOnBlur","selectOption","option","index","value","optionList","isEmpty","map","optgroup","label","i","titleView","selected","get","find","concat","flatMapDeep","selectedLabel","isSelectedInValidOption","getOr","validOption","handleChange","e","target","selectedOptions","black","isThemeOneOfQuestionTemplateOrPlayer","includes","shouldUseSkinFontColor","undefined","behaviorClassName","getClassState","default","composedClassName","classnames","unselected","labelSize","size","isLongLabel","selectWrapper","selectSpan","noLabelCommon","longLabel","selectedArrow","arrow","selectBox","SelectOptionPropTypes","PropTypes","string","isRequired","oneOfType","number","bool","SelectOptionGroupPropTypes","arrayOf","shape","contextTypes","Provider","childContextTypes","propTypes","func","oneOf","keys"],"sources":["../../../src/atom/select/index.js"],"sourcesContent":["import React, {useCallback, useMemo, useState} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport concat from 'lodash/fp/concat';\nimport filter from 'lodash/fp/filter';\nimport find from 'lodash/fp/find';\nimport flatMapDeep from 'lodash/fp/flatMapDeep';\nimport get from 'lodash/fp/get';\nimport getOr from 'lodash/fp/getOr';\nimport includes from 'lodash/fp/includes';\nimport isEmpty from 'lodash/fp/isEmpty';\nimport keys from 'lodash/fp/keys';\nimport map from 'lodash/fp/map';\nimport size from 'lodash/fp/size';\nimport {\n NovaCompositionNavigationArrowDown as ArrowDown,\n NovaCompositionNavigationArrowTop as ArrowUp\n} from '@coorpacademy/nova-icons';\nimport Provider, {GetSkinFromContext} from '../provider';\nimport getClassState from '../../util/get-class-state';\nimport style from './style.css';\n\nconst themeStyle = {\n filter: style.filter,\n invalid: style.invalid,\n header: style.header,\n mooc: style.mooc,\n question: style.question,\n sort: style.sort,\n thematiques: style.thematiques,\n player: style.player,\n template: style.template,\n coorpmanager: null\n};\n\nconst ArrowView = ({shouldRender, isArrowUp, ariaLabel, arrowClass, arrowColor}) => {\n const props = useMemo(\n () => ({\n ...(ariaLabel &\n {\n 'aria-label': ariaLabel\n }),\n ...(arrowColor &\n {\n color: arrowColor\n }),\n className: arrowClass\n }),\n [ariaLabel, arrowClass, arrowColor]\n );\n if (shouldRender) {\n return isArrowUp ? (\n <ArrowUp {...props} data-testid=\"select-arrow-up-icon\" />\n ) : (\n <ArrowDown {...props} data-testid=\"select-arrow-down-icon\" />\n );\n } else return null;\n};\n\nconst Select = (props, legacyContext) => {\n const {\n name,\n options = [],\n optgroups = [],\n className,\n borderClassName,\n onChange,\n multiple = false,\n disabled,\n required,\n description,\n theme,\n modified = false,\n error = false,\n title: propTitle,\n 'aria-label': ariaLabel\n } = props;\n\n const skin = GetSkinFromContext(legacyContext);\n const title = useMemo(\n () => (propTitle ? `${propTitle}${required ? '*' : ''}` : null),\n [propTitle, required]\n );\n\n const [isArrowUp, setIsArrowUp] = useState(false);\n\n const handleSelectOnFocus = useCallback(() => setIsArrowUp(true), []);\n const handleSelectOnBlur = useCallback(() => setIsArrowUp(false), []);\n\n const selectOption = (option, index) => {\n return (\n <option key={index} value={option.value} className={style.selectOption}>\n {option.name}\n </option>\n );\n };\n\n const optionList = !isEmpty(options)\n ? options.map((option, index) => selectOption(option, index))\n : optgroups.map((optgroup, index) => {\n return (\n <optgroup key={index} label={optgroup.label}>\n {optgroup.options && optgroup.options.map((option, i) => selectOption(option, i))}\n </optgroup>\n );\n });\n\n const titleView = title ? <span className={style.title}>{title} </span> : null;\n\n const selected = useMemo(\n () =>\n multiple\n ? map(get('value'), filter({selected: true}, options))\n : get('value', find({selected: true}, concat(options, flatMapDeep('options', optgroups)))),\n [multiple, options, optgroups]\n );\n const selectedLabel = useMemo(\n () =>\n multiple\n ? map(get('name'), filter({selected: true}, options))\n : get('name', find({selected: true}, concat(options, flatMapDeep('options', optgroups)))),\n [multiple, options, optgroups]\n );\n\n const isSelectedInValidOption = useMemo(\n () =>\n theme === 'player' &&\n getOr(false, 'name', find({validOption: false, selected: true}, options)),\n [options, theme]\n );\n\n const handleChange = useMemo(\n () =>\n multiple\n ? e => {\n setIsArrowUp(false);\n onChange(map(get('value'), e.target.selectedOptions));\n }\n : e => {\n setIsArrowUp(false);\n onChange(e.target.value);\n },\n [onChange, multiple]\n );\n\n const black = useMemo(() => getOr('#14171A', 'common.black', skin), [skin]);\n const color = useMemo(() => getOr('#00B0FF', 'common.primary', skin), [skin]);\n const isThemeOneOfQuestionTemplateOrPlayer = useMemo(\n () => includes(theme, ['question', 'template', 'player']),\n [theme]\n );\n const shouldUseSkinFontColor = useMemo(\n () => !isSelectedInValidOption && selected && isThemeOneOfQuestionTemplateOrPlayer,\n [isSelectedInValidOption, selected, isThemeOneOfQuestionTemplateOrPlayer]\n );\n const arrowColor = selected ? color : undefined;\n\n const behaviorClassName = useMemo(\n () => getClassState(style.default, style.modified, style.error, modified, error),\n [error, modified]\n );\n const composedClassName = useMemo(\n () =>\n classnames(\n theme && theme !== 'coorpmanager' ? themeStyle[theme] : behaviorClassName,\n selected ? style.selected : style.unselected,\n className\n ),\n [behaviorClassName, className, selected, theme]\n );\n\n const labelSize = useMemo(() => size(selectedLabel), [selectedLabel]);\n\n const isLongLabel = useMemo(() => labelSize >= 65, [labelSize]);\n\n return (\n <div\n className={classnames(\n composedClassName,\n theme === 'coorpmanager' ? style.coorpmanager : null\n )}\n >\n <label\n data-name=\"select-wrapper\"\n style={{\n ...(shouldUseSkinFontColor && {\n color\n })\n }}\n className={style.selectWrapper}\n >\n {titleView}\n <span\n data-name=\"select-span\"\n className={classnames(\n style.selectSpan,\n includes(theme, ['player', 'invalid', 'question', 'thematiques', 'template'])\n ? style.noLabelCommon\n : null,\n borderClassName,\n isLongLabel ? style.longLabel : null\n )}\n style={{\n ...(shouldUseSkinFontColor && {\n color\n })\n }}\n >\n {selectedLabel}\n </span>\n <ArrowView\n shouldRender={!multiple}\n isArrowUp={isArrowUp}\n ariaLabel={ariaLabel}\n arrowClass={shouldUseSkinFontColor ? style.selectedArrow : style.arrow}\n arrowColor={isThemeOneOfQuestionTemplateOrPlayer ? arrowColor : black}\n />\n <select\n data-name=\"native-select\"\n className={style.selectBox}\n title={selectedLabel}\n name={name}\n onChange={handleChange}\n value={selected}\n multiple={multiple}\n disabled={disabled}\n onClick={handleSelectOnFocus}\n onBlur={handleSelectOnBlur}\n // onBlur does not handle completely an out of bounds click\n // ex: select is Opened and a click is done outside, cancelling the select\n // that doesn't count as a Blur, so an onMouseLeave is needed\n onMouseLeave={handleSelectOnBlur}\n data-testid=\"native-select\"\n >\n {optionList}\n </select>\n </label>\n <div className={style.description}>{description}</div>\n </div>\n );\n};\n\nexport const SelectOptionPropTypes = {\n name: PropTypes.string.isRequired,\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n selected: PropTypes.bool,\n validOption: PropTypes.bool\n};\n\nexport const SelectOptionGroupPropTypes = {\n label: PropTypes.string.isRequired,\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes))\n};\n\nSelect.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nSelect.propTypes = {\n title: PropTypes.string,\n name: PropTypes.string,\n className: PropTypes.string,\n borderClassName: PropTypes.string,\n disabled: PropTypes.bool,\n multiple: PropTypes.bool,\n description: PropTypes.string,\n required: PropTypes.bool,\n onChange: PropTypes.func,\n theme: PropTypes.oneOf(keys(themeStyle)),\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes)),\n optgroups: PropTypes.arrayOf(PropTypes.shape(SelectOptionGroupPropTypes)),\n modified: PropTypes.bool,\n error: PropTypes.bool,\n 'aria-label': PropTypes.string\n};\n\nexport default Select;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAIA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,UAAU,GAAG;EACjBC,MAAM,EAAEC,cAAA,CAAMD,MADG;EAEjBE,OAAO,EAAED,cAAA,CAAMC,OAFE;EAGjBC,MAAM,EAAEF,cAAA,CAAME,MAHG;EAIjBC,IAAI,EAAEH,cAAA,CAAMG,IAJK;EAKjBC,QAAQ,EAAEJ,cAAA,CAAMI,QALC;EAMjBC,IAAI,EAAEL,cAAA,CAAMK,IANK;EAOjBC,WAAW,EAAEN,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,kBAAA,CAAUO,OAAV,CAAkBP,kBAAA,CAAUQ,KAAV,CAAgBT,qBAAhB,CAAlB;AAF+B,CAAnC;;AAKPpE,MAAM,CAAC8E,YAAP,GAAsB;EACpB9D,IAAI,EAAE+D,iBAAA,CAASC,iBAAT,CAA2BhE;AADb,CAAtB;AAIAhB,MAAM,CAACiF,SAAP,2CAAmB;EACjBnE,KAAK,EAAEuD,kBAAA,CAAUC,MADA;EAEjBpE,IAAI,EAAEmE,kBAAA,CAAUC,MAFC;EAGjBvE,SAAS,EAAEsE,kBAAA,CAAUC,MAHJ;EAIjBjE,eAAe,EAAEgE,kBAAA,CAAUC,MAJV;EAKjB9D,QAAQ,EAAE6D,kBAAA,CAAUK,IALH;EAMjBnE,QAAQ,EAAE8D,kBAAA,CAAUK,IANH;EAOjBhE,WAAW,EAAE2D,kBAAA,CAAUC,MAPN;EAQjB7D,QAAQ,EAAE4D,kBAAA,CAAUK,IARH;EASjBpE,QAAQ,EAAE+D,kBAAA,CAAUa,IATH;EAUjBvE,KAAK,EAAE0D,kBAAA,CAAUc,KAAV,CAAgB,IAAAC,aAAA,EAAK1G,UAAL,CAAhB,CAVU;EAWjByB,OAAO,EAAEkE,kBAAA,CAAUO,OAAV,CAAkBP,kBAAA,CAAUQ,KAAV,CAAgBT,qBAAhB,CAAlB,CAXQ;EAYjBhE,SAAS,EAAEiE,kBAAA,CAAUO,OAAV,CAAkBP,kBAAA,CAAUQ,KAAV,CAAgBF,0BAAhB,CAAlB,CAZM;EAajB/D,QAAQ,EAAEyD,kBAAA,CAAUK,IAbH;EAcjB7D,KAAK,EAAEwD,kBAAA,CAAUK,IAdA;EAejB,cAAcL,kBAAA,CAAUC;AAfP,CAAnB;eAkBetE,M"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["themeStyle","filter","style","invalid","header","mooc","question","sort","thematiques","player","template","coorpmanager","ArrowView","shouldRender","isArrowUp","ariaLabel","arrowClass","arrowColor","props","useMemo","color","className","Select","legacyContext","name","options","optgroups","borderClassName","onChange","multiple","disabled","required","description","theme","modified","error","title","propTitle","ariaLabelledBy","skin","GetSkinFromContext","setIsArrowUp","useState","handleSelectOnFocus","useCallback","handleSelectOnBlur","selectOption","option","index","value","optionList","isEmpty","map","optgroup","label","i","titleView","selected","get","find","concat","flatMapDeep","selectedLabel","isSelectedInValidOption","getOr","validOption","handleChange","e","target","selectedOptions","black","isThemeOneOfQuestionTemplateOrPlayer","includes","shouldUseSkinFontColor","undefined","behaviorClassName","getClassState","default","composedClassName","classnames","unselected","labelSize","size","isLongLabel","selectWrapper","selectSpan","noLabelCommon","longLabel","selectedArrow","arrow","selectBox","SelectOptionPropTypes","PropTypes","string","isRequired","oneOfType","number","bool","SelectOptionGroupPropTypes","arrayOf","shape","contextTypes","Provider","childContextTypes","propTypes","func","oneOf","keys"],"sources":["../../../src/atom/select/index.js"],"sourcesContent":["import React, {useCallback, useMemo, useState} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport concat from 'lodash/fp/concat';\nimport filter from 'lodash/fp/filter';\nimport find from 'lodash/fp/find';\nimport flatMapDeep from 'lodash/fp/flatMapDeep';\nimport get from 'lodash/fp/get';\nimport getOr from 'lodash/fp/getOr';\nimport includes from 'lodash/fp/includes';\nimport isEmpty from 'lodash/fp/isEmpty';\nimport keys from 'lodash/fp/keys';\nimport map from 'lodash/fp/map';\nimport size from 'lodash/fp/size';\nimport {\n NovaCompositionNavigationArrowDown as ArrowDown,\n NovaCompositionNavigationArrowTop as ArrowUp\n} from '@coorpacademy/nova-icons';\nimport Provider, {GetSkinFromContext} from '../provider';\nimport getClassState from '../../util/get-class-state';\nimport style from './style.css';\n\nconst themeStyle = {\n filter: style.filter,\n invalid: style.invalid,\n header: style.header,\n mooc: style.mooc,\n question: style.question,\n sort: style.sort,\n thematiques: style.thematiques,\n player: style.player,\n template: style.template,\n coorpmanager: null\n};\n\nconst ArrowView = ({shouldRender, isArrowUp, ariaLabel, arrowClass, arrowColor}) => {\n const props = useMemo(\n () => ({\n ...(arrowColor &\n {\n color: arrowColor\n }),\n className: arrowClass\n }),\n [ariaLabel, arrowClass, arrowColor]\n );\n if (shouldRender) {\n return isArrowUp ? (\n <ArrowUp {...props} data-testid=\"select-arrow-up-icon\" />\n ) : (\n <ArrowDown {...props} data-testid=\"select-arrow-down-icon\" />\n );\n } else return null;\n};\n\nconst Select = (props, legacyContext) => {\n const {\n name,\n options = [],\n optgroups = [],\n className,\n borderClassName,\n onChange,\n multiple = false,\n disabled,\n required,\n description,\n theme,\n modified = false,\n error = false,\n title: propTitle,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy\n } = props;\n\n const skin = GetSkinFromContext(legacyContext);\n const title = useMemo(\n () => (propTitle ? `${propTitle}${required ? '*' : ''}` : null),\n [propTitle, required]\n );\n\n const [isArrowUp, setIsArrowUp] = useState(false);\n\n const handleSelectOnFocus = useCallback(() => setIsArrowUp(true), []);\n const handleSelectOnBlur = useCallback(() => setIsArrowUp(false), []);\n\n const selectOption = (option, index) => {\n return (\n <option key={index} value={option.value} className={style.selectOption}>\n {option.name}\n </option>\n );\n };\n\n const optionList = !isEmpty(options)\n ? options.map((option, index) => selectOption(option, index))\n : optgroups.map((optgroup, index) => {\n return (\n <optgroup key={index} label={optgroup.label}>\n {optgroup.options && optgroup.options.map((option, i) => selectOption(option, i))}\n </optgroup>\n );\n });\n\n const titleView = title ? <span className={style.title}>{title} </span> : null;\n\n const selected = useMemo(\n () =>\n multiple\n ? map(get('value'), filter({selected: true}, options))\n : get('value', find({selected: true}, concat(options, flatMapDeep('options', optgroups)))),\n [multiple, options, optgroups]\n );\n const selectedLabel = useMemo(\n () =>\n multiple\n ? map(get('name'), filter({selected: true}, options))\n : get('name', find({selected: true}, concat(options, flatMapDeep('options', optgroups)))),\n [multiple, options, optgroups]\n );\n\n const isSelectedInValidOption = useMemo(\n () =>\n theme === 'player' &&\n getOr(false, 'name', find({validOption: false, selected: true}, options)),\n [options, theme]\n );\n\n const handleChange = useMemo(\n () =>\n multiple\n ? e => {\n setIsArrowUp(false);\n onChange(map(get('value'), e.target.selectedOptions));\n }\n : e => {\n setIsArrowUp(false);\n onChange(e.target.value);\n },\n [onChange, multiple]\n );\n\n const black = useMemo(() => getOr('#14171A', 'common.black', skin), [skin]);\n const color = useMemo(() => getOr('#00B0FF', 'common.primary', skin), [skin]);\n const isThemeOneOfQuestionTemplateOrPlayer = useMemo(\n () => includes(theme, ['question', 'template', 'player']),\n [theme]\n );\n const shouldUseSkinFontColor = useMemo(\n () => !isSelectedInValidOption && selected && isThemeOneOfQuestionTemplateOrPlayer,\n [isSelectedInValidOption, selected, isThemeOneOfQuestionTemplateOrPlayer]\n );\n const arrowColor = selected ? color : undefined;\n\n const behaviorClassName = useMemo(\n () => getClassState(style.default, style.modified, style.error, modified, error),\n [error, modified]\n );\n const composedClassName = useMemo(\n () =>\n classnames(\n theme && theme !== 'coorpmanager' ? themeStyle[theme] : behaviorClassName,\n selected ? style.selected : style.unselected,\n className\n ),\n [behaviorClassName, className, selected, theme]\n );\n\n const labelSize = useMemo(() => size(selectedLabel), [selectedLabel]);\n\n const isLongLabel = useMemo(() => labelSize >= 65, [labelSize]);\n\n return (\n <div\n className={classnames(\n composedClassName,\n theme === 'coorpmanager' ? style.coorpmanager : null\n )}\n >\n <label\n data-name=\"select-wrapper\"\n style={{\n ...(shouldUseSkinFontColor && {\n color\n })\n }}\n className={style.selectWrapper}\n >\n {titleView}\n <span\n data-name=\"select-span\"\n className={classnames(\n style.selectSpan,\n includes(theme, ['player', 'invalid', 'question', 'thematiques', 'template'])\n ? style.noLabelCommon\n : null,\n borderClassName,\n isLongLabel ? style.longLabel : null\n )}\n style={{\n ...(shouldUseSkinFontColor && {\n color\n })\n }}\n >\n {selectedLabel}\n </span>\n <ArrowView\n shouldRender={!multiple}\n isArrowUp={isArrowUp}\n ariaLabel={ariaLabel}\n arrowClass={shouldUseSkinFontColor ? style.selectedArrow : style.arrow}\n arrowColor={isThemeOneOfQuestionTemplateOrPlayer ? arrowColor : black}\n />\n <select\n {...(ariaLabelledBy ? {'aria-labelledby': ariaLabelledBy} : {})}\n {...(ariaLabel && !ariaLabelledBy ? {'aria-label': ariaLabel} : {})}\n {...(ariaLabel ? {title: ariaLabel} : {})}\n data-name=\"native-select\"\n className={style.selectBox}\n name={name}\n onChange={handleChange}\n value={selected}\n multiple={multiple}\n disabled={disabled}\n onClick={handleSelectOnFocus}\n onBlur={handleSelectOnBlur}\n // onBlur does not handle completely an out of bounds click\n // ex: select is Opened and a click is done outside, cancelling the select\n // that doesn't count as a Blur, so an onMouseLeave is needed\n onMouseLeave={handleSelectOnBlur}\n data-testid=\"native-select\"\n >\n {optionList}\n </select>\n </label>\n <div className={style.description}>{description}</div>\n </div>\n );\n};\n\nexport const SelectOptionPropTypes = {\n name: PropTypes.string.isRequired,\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n selected: PropTypes.bool,\n validOption: PropTypes.bool\n};\n\nexport const SelectOptionGroupPropTypes = {\n label: PropTypes.string.isRequired,\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes))\n};\n\nSelect.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nSelect.propTypes = {\n title: PropTypes.string,\n name: PropTypes.string,\n className: PropTypes.string,\n borderClassName: PropTypes.string,\n disabled: PropTypes.bool,\n multiple: PropTypes.bool,\n description: PropTypes.string,\n required: PropTypes.bool,\n onChange: PropTypes.func,\n theme: PropTypes.oneOf(keys(themeStyle)),\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes)),\n optgroups: PropTypes.arrayOf(PropTypes.shape(SelectOptionGroupPropTypes)),\n modified: PropTypes.bool,\n error: PropTypes.bool,\n 'aria-label': PropTypes.string,\n 'aria-labelledby': PropTypes.string\n};\n\nexport default Select;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAI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E,kBAAA,CAAUO,OAAV,CAAkBP,kBAAA,CAAUQ,KAAV,CAAgBT,qBAAhB,CAAlB,CAXQ;EAYjBjE,SAAS,EAAEkE,kBAAA,CAAUO,OAAV,CAAkBP,kBAAA,CAAUQ,KAAV,CAAgBF,0BAAhB,CAAlB,CAZM;EAajBhE,QAAQ,EAAE0D,kBAAA,CAAUK,IAbH;EAcjB9D,KAAK,EAAEyD,kBAAA,CAAUK,IAdA;EAejB,cAAcL,kBAAA,CAAUC,MAfP;EAgBjB,mBAAmBD,kBAAA,CAAUC;AAhBZ,CAAnB;eAmBevE,M"}
|
|
@@ -2,9 +2,6 @@ export default Answer;
|
|
|
2
2
|
declare function Answer(props: any): JSX.Element;
|
|
3
3
|
declare namespace Answer {
|
|
4
4
|
export { propTypes };
|
|
5
|
-
export namespace contextTypes {
|
|
6
|
-
const translate: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
7
|
-
}
|
|
8
5
|
}
|
|
9
6
|
import propTypes from "./prop-types";
|
|
10
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/answer/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/answer/index.js"],"names":[],"mappings":";AAwEA,iDAWC"}
|
|
@@ -25,7 +25,7 @@ var _template = _interopRequireDefault(require("../questions/template"));
|
|
|
25
25
|
|
|
26
26
|
var _audio = _interopRequireDefault(require("../audio"));
|
|
27
27
|
|
|
28
|
-
var _provider =
|
|
28
|
+
var _provider = require("../../atom/provider");
|
|
29
29
|
|
|
30
30
|
var _style = _interopRequireDefault(require("./style.css"));
|
|
31
31
|
|
|
@@ -88,11 +88,11 @@ MediaView.propTypes = process.env.NODE_ENV !== "production" ? _propTypes.MediaVi
|
|
|
88
88
|
const Switch = ({
|
|
89
89
|
model,
|
|
90
90
|
help
|
|
91
|
-
}
|
|
91
|
+
}) => {
|
|
92
92
|
const {
|
|
93
93
|
type
|
|
94
94
|
} = model;
|
|
95
|
-
const translate =
|
|
95
|
+
const translate = (0, _provider.GetTranslateFromContext)();
|
|
96
96
|
|
|
97
97
|
switch (type) {
|
|
98
98
|
case 'qcmDrag':
|
|
@@ -135,9 +135,6 @@ Switch.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
135
135
|
model: _propTypes.default.model,
|
|
136
136
|
help: _propTypes.default.help
|
|
137
137
|
} : {};
|
|
138
|
-
Switch.contextTypes = {
|
|
139
|
-
translate: _provider.default.childContextTypes.translate
|
|
140
|
-
};
|
|
141
138
|
|
|
142
139
|
const Answer = props => {
|
|
143
140
|
const {
|
|
@@ -157,9 +154,6 @@ const Answer = props => {
|
|
|
157
154
|
};
|
|
158
155
|
|
|
159
156
|
Answer.propTypes = process.env.NODE_ENV !== "production" ? _propTypes.default : {};
|
|
160
|
-
Answer.contextTypes = {
|
|
161
|
-
translate: _provider.default.childContextTypes.translate
|
|
162
|
-
};
|
|
163
157
|
var _default = Answer;
|
|
164
158
|
exports.default = _default;
|
|
165
159
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["MediaView","media","videoId","type","childProps","TYPE_IMAGE","style","backgroundImage","url","TYPE_VIDEO","video","TYPE_AUDIO","audio","propTypes","MediaViewPropTypes","Switch","model","help","
|
|
1
|
+
{"version":3,"file":"index.js","names":["MediaView","media","videoId","type","childProps","TYPE_IMAGE","style","backgroundImage","url","TYPE_VIDEO","video","TYPE_AUDIO","audio","propTypes","MediaViewPropTypes","Switch","model","help","translate","GetTranslateFromContext","Answer","props","wrapper"],"sources":["../../../src/molecule/answer/index.js"],"sourcesContent":["import React from 'react';\nimport {omit} from 'lodash/fp';\nimport VideoPlayer from '../video-player';\nimport DropDown from '../questions/drop-down';\nimport FreeText from '../questions/free-text';\nimport QcmDrag from '../questions/qcm-drag';\nimport Qcm from '../questions/qcm';\nimport QcmGraphic from '../questions/qcm-graphic';\nimport QuestionRange from '../questions/question-range';\nimport Template from '../questions/template';\nimport Audio from '../audio';\nimport {GetTranslateFromContext} from '../../atom/provider';\nimport style from './style.css';\nimport propTypes, {MediaViewPropTypes, TYPE_AUDIO, TYPE_IMAGE, TYPE_VIDEO} from './prop-types';\n\nconst MediaView = ({media}) => {\n const {videoId, type, ...childProps} = media;\n switch (type) {\n case TYPE_IMAGE:\n return (\n <div\n className={style.media}\n style={{\n backgroundImage: `url(${media.url})`\n }}\n />\n );\n case TYPE_VIDEO:\n return (\n <div className={style.video}>\n <VideoPlayer {...omit('id', childProps)} id={videoId} height=\"100%\" width=\"100%\" />\n </div>\n );\n case TYPE_AUDIO:\n return (\n <div className={style.audio}>\n <Audio {...omit('id', childProps)} height=\"100%\" width=\"100%\" />\n </div>\n );\n default:\n return null;\n }\n};\n\nMediaView.propTypes = MediaViewPropTypes;\n\nconst Switch = ({model, help}) => {\n const {type} = model;\n const translate = GetTranslateFromContext();\n switch (type) {\n case 'qcmDrag':\n return <QcmDrag {...model} help={help} groupAriaLabel={translate('answer_the_question')} />;\n case 'qcm':\n return <Qcm {...model} groupAriaLabel={translate('answer_the_question')} />;\n case 'qcmGraphic':\n return <QcmGraphic {...model} groupAriaLabel={translate('answer_the_question')} />;\n case 'freeText':\n return <FreeText {...model} />;\n case 'dropDown':\n return <DropDown {...model} groupAriaLabel={translate('answer_the_question')} />;\n case 'slider':\n return <QuestionRange {...model} groupAriaLabel={translate('answer_the_question')} />;\n case 'template':\n return <Template {...model} groupAriaLabel={translate('answer_the_question')} />;\n }\n};\n\nSwitch.propTypes = {\n model: propTypes.model,\n help: propTypes.help\n};\n\nconst Answer = props => {\n const {model, media, help} = props;\n\n return (\n <div data-name=\"answer\" className={style.wrapper}>\n {media ? <MediaView media={media} /> : null}\n <form>\n <Switch model={model} help={help} />\n </form>\n </div>\n );\n};\n\nAnswer.propTypes = propTypes;\n\nexport default Answer;\n"],"mappings":";;;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
|
|
109
109
|
modified: PropTypes.Requireable<boolean>;
|
|
110
110
|
error: PropTypes.Requireable<boolean>;
|
|
111
111
|
'aria-label': PropTypes.Requireable<string>;
|
|
112
|
+
'aria-labelledby': PropTypes.Requireable<string>;
|
|
112
113
|
}> | PropTypes.InferProps<{
|
|
113
114
|
type: PropTypes.Requireable<string>;
|
|
114
115
|
title: PropTypes.Validator<string>;
|
|
@@ -224,6 +225,7 @@ declare namespace BrandFormGroup {
|
|
|
224
225
|
modified: PropTypes.Requireable<boolean>;
|
|
225
226
|
error: PropTypes.Requireable<boolean>;
|
|
226
227
|
'aria-label': PropTypes.Requireable<string>;
|
|
228
|
+
'aria-labelledby': PropTypes.Requireable<string>;
|
|
227
229
|
}> | PropTypes.InferProps<{
|
|
228
230
|
type: PropTypes.Requireable<string>;
|
|
229
231
|
title: PropTypes.Validator<string>;
|
|
@@ -40,6 +40,7 @@ declare class Filters extends React.Component<any, any, any> {
|
|
|
40
40
|
modified: PropTypes.Requireable<boolean>;
|
|
41
41
|
error: PropTypes.Requireable<boolean>;
|
|
42
42
|
'aria-label': PropTypes.Requireable<string>;
|
|
43
|
+
'aria-labelledby': PropTypes.Requireable<string>;
|
|
43
44
|
}>>;
|
|
44
45
|
onSearch: PropTypes.Requireable<(...args: any[]) => any>;
|
|
45
46
|
onToggleFilters: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/filters/index.js"],"names":[],"mappings":";AASA;IACE
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/filters/index.js"],"names":[],"mappings":";AASA;IACE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAeE;IAEF;;;;;;;;;;;;;;;;;;;;;;MAEE;IAEF,wBASC;IAPC;;;MAGC;IAMH,yBAcC;IAED,uBAYC;IAED,qBAOC;IAED,sBA2FC;CACF"}
|
|
@@ -66,6 +66,7 @@ declare namespace SetupSlide {
|
|
|
66
66
|
modified: PropTypes.Requireable<boolean>;
|
|
67
67
|
error: PropTypes.Requireable<boolean>;
|
|
68
68
|
'aria-label': PropTypes.Requireable<string>;
|
|
69
|
+
'aria-labelledby': PropTypes.Requireable<string>;
|
|
69
70
|
}> | PropTypes.InferProps<{
|
|
70
71
|
type: PropTypes.Requireable<string>;
|
|
71
72
|
title: PropTypes.Validator<string>;
|
|
@@ -79,6 +79,7 @@ declare namespace SetupSlider {
|
|
|
79
79
|
modified: PropTypes.Requireable<boolean>;
|
|
80
80
|
error: PropTypes.Requireable<boolean>;
|
|
81
81
|
'aria-label': PropTypes.Requireable<string>;
|
|
82
|
+
'aria-labelledby': PropTypes.Requireable<string>;
|
|
82
83
|
}> | PropTypes.InferProps<{
|
|
83
84
|
type: PropTypes.Requireable<string>;
|
|
84
85
|
title: PropTypes.Validator<string>;
|
|
@@ -139,6 +139,7 @@ declare namespace BrandForm {
|
|
|
139
139
|
modified: PropTypes.Requireable<boolean>;
|
|
140
140
|
error: PropTypes.Requireable<boolean>;
|
|
141
141
|
'aria-label': PropTypes.Requireable<string>;
|
|
142
|
+
'aria-labelledby': PropTypes.Requireable<string>;
|
|
142
143
|
}> | PropTypes.InferProps<{
|
|
143
144
|
type: PropTypes.Requireable<string>;
|
|
144
145
|
title: PropTypes.Validator<string>;
|
|
@@ -254,6 +255,7 @@ declare namespace BrandForm {
|
|
|
254
255
|
modified: PropTypes.Requireable<boolean>;
|
|
255
256
|
error: PropTypes.Requireable<boolean>;
|
|
256
257
|
'aria-label': PropTypes.Requireable<string>;
|
|
258
|
+
'aria-labelledby': PropTypes.Requireable<string>;
|
|
257
259
|
}> | PropTypes.InferProps<{
|
|
258
260
|
type: PropTypes.Requireable<string>;
|
|
259
261
|
title: PropTypes.Validator<string>;
|
|
@@ -156,6 +156,7 @@ declare namespace WizardContents {
|
|
|
156
156
|
modified: PropTypes.Requireable<boolean>;
|
|
157
157
|
error: PropTypes.Requireable<boolean>;
|
|
158
158
|
'aria-label': PropTypes.Requireable<string>;
|
|
159
|
+
'aria-labelledby': PropTypes.Requireable<string>;
|
|
159
160
|
}> | PropTypes.InferProps<{
|
|
160
161
|
type: PropTypes.Requireable<string>;
|
|
161
162
|
title: PropTypes.Validator<string>;
|
|
@@ -271,6 +272,7 @@ declare namespace WizardContents {
|
|
|
271
272
|
modified: PropTypes.Requireable<boolean>;
|
|
272
273
|
error: PropTypes.Requireable<boolean>;
|
|
273
274
|
'aria-label': PropTypes.Requireable<string>;
|
|
275
|
+
'aria-labelledby': PropTypes.Requireable<string>;
|
|
274
276
|
}> | PropTypes.InferProps<{
|
|
275
277
|
type: PropTypes.Requireable<string>;
|
|
276
278
|
title: PropTypes.Validator<string>;
|
|
@@ -24,15 +24,15 @@ declare namespace Progression {
|
|
|
24
24
|
}>;
|
|
25
25
|
}>>;
|
|
26
26
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
const propTypes: {
|
|
28
|
+
mainTitle: PropTypes.Validator<string>;
|
|
29
|
+
mainSubtitle: PropTypes.Validator<string>;
|
|
30
|
+
adaptiveAriaLabel: PropTypes.Requireable<string>;
|
|
31
|
+
total: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
32
32
|
label: PropTypes.Validator<string>;
|
|
33
33
|
stars: PropTypes.Validator<number>;
|
|
34
34
|
}>>>;
|
|
35
|
-
|
|
35
|
+
engines: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
36
36
|
type: PropTypes.Validator<string>;
|
|
37
37
|
stars: PropTypes.Validator<number>;
|
|
38
38
|
title: PropTypes.Validator<string>;
|
|
@@ -47,8 +47,8 @@ declare namespace Progression {
|
|
|
47
47
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
48
48
|
}>>;
|
|
49
49
|
}> | null | undefined)[]>;
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
loading: PropTypes.Validator<boolean>;
|
|
51
|
+
progressions: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
52
52
|
ref: PropTypes.Validator<string>;
|
|
53
53
|
completion: PropTypes.Validator<number>;
|
|
54
54
|
stars: PropTypes.Validator<number>;
|
|
@@ -63,7 +63,7 @@ declare namespace Progression {
|
|
|
63
63
|
adaptive: PropTypes.Validator<boolean>;
|
|
64
64
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
65
65
|
}> | null | undefined)[]>;
|
|
66
|
-
|
|
66
|
+
themeFilter: PropTypes.Requireable<PropTypes.InferProps<{
|
|
67
67
|
options: PropTypes.Validator<(PropTypes.InferProps<{
|
|
68
68
|
name: PropTypes.Validator<string>;
|
|
69
69
|
value: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
@@ -72,14 +72,15 @@ declare namespace Progression {
|
|
|
72
72
|
}> | null | undefined)[]>;
|
|
73
73
|
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
74
74
|
}>>;
|
|
75
|
-
|
|
75
|
+
recommendation: PropTypes.Requireable<PropTypes.InferProps<{
|
|
76
76
|
cta: PropTypes.Validator<string>;
|
|
77
77
|
title: PropTypes.Validator<string>;
|
|
78
78
|
subtitle: PropTypes.Validator<string>;
|
|
79
79
|
courseTitle: PropTypes.Validator<string>;
|
|
80
80
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
81
81
|
}>>;
|
|
82
|
-
|
|
82
|
+
'aria-label': PropTypes.Requireable<string>;
|
|
83
|
+
};
|
|
83
84
|
}
|
|
84
85
|
import PropTypes from "prop-types";
|
|
85
86
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/activity/index.js"],"names":[],"mappings":";AAmBA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/activity/index.js"],"names":[],"mappings":";AAmBA,0EA4GC"}
|
|
@@ -57,7 +57,8 @@ const Progression = (props, legacyContext) => {
|
|
|
57
57
|
total,
|
|
58
58
|
engines = [],
|
|
59
59
|
themeFilter = {},
|
|
60
|
-
loading
|
|
60
|
+
loading,
|
|
61
|
+
'aria-label': ariaLabel
|
|
61
62
|
} = props;
|
|
62
63
|
const skin = (0, _provider.GetSkinFromContext)(legacyContext);
|
|
63
64
|
const {
|
|
@@ -93,7 +94,8 @@ const Progression = (props, legacyContext) => {
|
|
|
93
94
|
className: _style.default.select,
|
|
94
95
|
theme: "thematiques",
|
|
95
96
|
options: themeFilter.options,
|
|
96
|
-
onChange: handleSelectTheme
|
|
97
|
+
onChange: handleSelectTheme,
|
|
98
|
+
"aria-label": ariaLabel
|
|
97
99
|
}) : null;
|
|
98
100
|
const recommendationSection = !(0, _isEmpty.default)(recommendation) ? /*#__PURE__*/_react.default.createElement("div", {
|
|
99
101
|
className: _style.default.recommendationWrapper
|
|
@@ -165,7 +167,8 @@ Progression.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
165
167
|
subtitle: _propTypes.default.string.isRequired,
|
|
166
168
|
courseTitle: _propTypes.default.string.isRequired,
|
|
167
169
|
onClick: _propTypes.default.func
|
|
168
|
-
})
|
|
170
|
+
}),
|
|
171
|
+
'aria-label': _propTypes.default.string
|
|
169
172
|
} : {};
|
|
170
173
|
var _default = Progression;
|
|
171
174
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["mapWithIndex","map","convert","cap","Progression","props","legacyContext","mainTitle","mainSubtitle","recommendation","progressions","adaptiveAriaLabel","total","engines","themeFilter","loading","skin","GetSkinFromContext","onChange","themeFilterOnChange","handleClick","useCallback","e","stopPropagation","preventDefault","onClick","noop","handleSelectTheme","primary","get","loader","style","allProgressions","progression","index","omit","ref","coreProgression","core","themeSelect","isEmpty","options","selectBorder","select","recommendationSection","recommendationWrapper","title","subtitle","classnames","course","innerHTML","__html","courseTitle","cta","backgroundColor","default","headerProgression","wrapperCta","wrapperProgression","contextTypes","Provider","childContextTypes","propTypes","PropTypes","string","isRequired","shape","label","stars","number","arrayOf","EngineStars","bool","ProgressionItem","Select","func"],"sources":["../../../src/template/activity/index.js"],"sourcesContent":["import React, {useCallback} from 'react';\nimport get from 'lodash/fp/get';\nimport isEmpty from 'lodash/fp/isEmpty';\nimport map from 'lodash/fp/map';\nimport noop from 'lodash/fp/noop';\nimport omit from 'lodash/fp/omit';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport Provider, {GetSkinFromContext} from '../../atom/provider';\nimport Button from '../../atom/button';\nimport Select from '../../atom/select';\nimport Loader from '../../atom/loader';\nimport ProgressionItem from './progression-item';\nimport EngineStars from './engine-stars';\nimport StarsSummary from './stars-summary';\nimport style from './style.css';\n\nconst mapWithIndex = map.convert({cap: false});\n\nconst Progression = (props, legacyContext) => {\n const {\n mainTitle,\n mainSubtitle,\n recommendation = {},\n progressions = [],\n adaptiveAriaLabel,\n total,\n engines = [],\n themeFilter = {},\n loading\n } = props;\n const skin = GetSkinFromContext(legacyContext);\n const {onChange: themeFilterOnChange} = themeFilter;\n\n const handleClick = useCallback(\n e => {\n e.stopPropagation();\n e.preventDefault();\n const {onClick = noop} = recommendation;\n onClick(e);\n },\n [recommendation]\n );\n\n const handleSelectTheme = useCallback(\n e => {\n themeFilterOnChange && themeFilterOnChange(e);\n },\n [themeFilterOnChange]\n );\n\n const primary = get('common.primary', skin);\n const loader = loading ? (\n <div className={style.loader}>\n <Loader />\n </div>\n ) : null;\n const allProgressions = mapWithIndex(\n (progression, index) => (\n <ProgressionItem\n {...omit(['ref'], progression)}\n key={`${index}-${progression.ref}`}\n adaptiveAriaLabel={adaptiveAriaLabel}\n />\n ),\n progressions\n );\n\n const coreProgression = (\n <div data-name=\"activityCore\" className={style.core}>\n {allProgressions}\n </div>\n );\n const themeSelect = !isEmpty(themeFilter.options) ? (\n <Select\n borderClassName={style.selectBorder}\n className={style.select}\n theme=\"thematiques\"\n options={themeFilter.options}\n onChange={handleSelectTheme}\n />\n ) : null;\n const recommendationSection = !isEmpty(recommendation) ? (\n <div className={style.recommendationWrapper}>\n <p className={style.recommendationSection}>{recommendation.title} </p>\n <p className={style.recommendationSection}>\n <span>{recommendation.subtitle} </span>\n <span\n className={classnames(style.course, style.innerHTML)}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: recommendation.courseTitle}}\n />\n </p>\n <Button\n type=\"link\"\n onClick={handleClick}\n submitValue={recommendation.cta}\n style={{\n backgroundColor: primary\n }}\n className={style.cta}\n />\n </div>\n ) : null;\n\n return (\n <div className={style.default}>\n <div data-name=\"activity-header\" tabIndex={0}>\n <div className={style.mainTitle} tabIndex={0}>\n <span>{mainTitle}</span> {mainSubtitle}\n </div>\n <div className={style.headerProgression} tabIndex={0}>\n <div className={style.wrapperCta} tabIndex={0}>\n {themeSelect}\n {recommendationSection}\n </div>\n <StarsSummary engines={engines} total={total} />\n </div>\n </div>\n <div className={style.wrapperProgression} data-name=\"activityList\">\n {coreProgression}\n {loader}\n </div>\n </div>\n );\n};\n\nProgression.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nProgression.propTypes = {\n mainTitle: PropTypes.string.isRequired,\n mainSubtitle: PropTypes.string.isRequired,\n adaptiveAriaLabel: PropTypes.string,\n total: PropTypes.shape({\n label: PropTypes.string.isRequired,\n stars: PropTypes.number.isRequired\n }).isRequired,\n engines: PropTypes.arrayOf(PropTypes.shape(EngineStars.propTypes)),\n loading: PropTypes.bool.isRequired,\n progressions: PropTypes.arrayOf(\n PropTypes.shape({...ProgressionItem.propTypes, ref: PropTypes.string.isRequired})\n ),\n themeFilter: PropTypes.shape({\n options: Select.propTypes.options.isRequired,\n onChange: Select.propTypes.onChange\n }),\n recommendation: PropTypes.shape({\n cta: PropTypes.string.isRequired,\n title: PropTypes.string.isRequired,\n subtitle: PropTypes.string.isRequired,\n courseTitle: PropTypes.string.isRequired,\n onClick: PropTypes.func\n })\n};\n\nexport default Progression;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,YAAY,GAAGC,YAAA,CAAIC,OAAJ,CAAY;EAACC,GAAG,EAAE;AAAN,CAAZ,CAArB;;AAEA,MAAMC,WAAW,GAAG,CAACC,KAAD,EAAQC,aAAR,KAA0B;EAC5C,MAAM;IACJC,SADI;IAEJC,YAFI;IAGJC,cAAc,GAAG,EAHb;IAIJC,YAAY,GAAG,EAJX;IAKJC,iBALI;IAMJC,KANI;IAOJC,OAAO,GAAG,EAPN;IAQJC,WAAW,GAAG,EARV;IASJC;
|
|
1
|
+
{"version":3,"file":"index.js","names":["mapWithIndex","map","convert","cap","Progression","props","legacyContext","mainTitle","mainSubtitle","recommendation","progressions","adaptiveAriaLabel","total","engines","themeFilter","loading","ariaLabel","skin","GetSkinFromContext","onChange","themeFilterOnChange","handleClick","useCallback","e","stopPropagation","preventDefault","onClick","noop","handleSelectTheme","primary","get","loader","style","allProgressions","progression","index","omit","ref","coreProgression","core","themeSelect","isEmpty","options","selectBorder","select","recommendationSection","recommendationWrapper","title","subtitle","classnames","course","innerHTML","__html","courseTitle","cta","backgroundColor","default","headerProgression","wrapperCta","wrapperProgression","contextTypes","Provider","childContextTypes","propTypes","PropTypes","string","isRequired","shape","label","stars","number","arrayOf","EngineStars","bool","ProgressionItem","Select","func"],"sources":["../../../src/template/activity/index.js"],"sourcesContent":["import React, {useCallback} from 'react';\nimport get from 'lodash/fp/get';\nimport isEmpty from 'lodash/fp/isEmpty';\nimport map from 'lodash/fp/map';\nimport noop from 'lodash/fp/noop';\nimport omit from 'lodash/fp/omit';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport Provider, {GetSkinFromContext} from '../../atom/provider';\nimport Button from '../../atom/button';\nimport Select from '../../atom/select';\nimport Loader from '../../atom/loader';\nimport ProgressionItem from './progression-item';\nimport EngineStars from './engine-stars';\nimport StarsSummary from './stars-summary';\nimport style from './style.css';\n\nconst mapWithIndex = map.convert({cap: false});\n\nconst Progression = (props, legacyContext) => {\n const {\n mainTitle,\n mainSubtitle,\n recommendation = {},\n progressions = [],\n adaptiveAriaLabel,\n total,\n engines = [],\n themeFilter = {},\n loading,\n 'aria-label': ariaLabel\n } = props;\n const skin = GetSkinFromContext(legacyContext);\n const {onChange: themeFilterOnChange} = themeFilter;\n\n const handleClick = useCallback(\n e => {\n e.stopPropagation();\n e.preventDefault();\n const {onClick = noop} = recommendation;\n onClick(e);\n },\n [recommendation]\n );\n\n const handleSelectTheme = useCallback(\n e => {\n themeFilterOnChange && themeFilterOnChange(e);\n },\n [themeFilterOnChange]\n );\n\n const primary = get('common.primary', skin);\n const loader = loading ? (\n <div className={style.loader}>\n <Loader />\n </div>\n ) : null;\n const allProgressions = mapWithIndex(\n (progression, index) => (\n <ProgressionItem\n {...omit(['ref'], progression)}\n key={`${index}-${progression.ref}`}\n adaptiveAriaLabel={adaptiveAriaLabel}\n />\n ),\n progressions\n );\n\n const coreProgression = (\n <div data-name=\"activityCore\" className={style.core}>\n {allProgressions}\n </div>\n );\n const themeSelect = !isEmpty(themeFilter.options) ? (\n <Select\n borderClassName={style.selectBorder}\n className={style.select}\n theme=\"thematiques\"\n options={themeFilter.options}\n onChange={handleSelectTheme}\n aria-label={ariaLabel}\n />\n ) : null;\n const recommendationSection = !isEmpty(recommendation) ? (\n <div className={style.recommendationWrapper}>\n <p className={style.recommendationSection}>{recommendation.title} </p>\n <p className={style.recommendationSection}>\n <span>{recommendation.subtitle} </span>\n <span\n className={classnames(style.course, style.innerHTML)}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: recommendation.courseTitle}}\n />\n </p>\n <Button\n type=\"link\"\n onClick={handleClick}\n submitValue={recommendation.cta}\n style={{\n backgroundColor: primary\n }}\n className={style.cta}\n />\n </div>\n ) : null;\n\n return (\n <div className={style.default}>\n <div data-name=\"activity-header\" tabIndex={0}>\n <div className={style.mainTitle} tabIndex={0}>\n <span>{mainTitle}</span> {mainSubtitle}\n </div>\n <div className={style.headerProgression} tabIndex={0}>\n <div className={style.wrapperCta} tabIndex={0}>\n {themeSelect}\n {recommendationSection}\n </div>\n <StarsSummary engines={engines} total={total} />\n </div>\n </div>\n <div className={style.wrapperProgression} data-name=\"activityList\">\n {coreProgression}\n {loader}\n </div>\n </div>\n );\n};\n\nProgression.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nProgression.propTypes = {\n mainTitle: PropTypes.string.isRequired,\n mainSubtitle: PropTypes.string.isRequired,\n adaptiveAriaLabel: PropTypes.string,\n total: PropTypes.shape({\n label: PropTypes.string.isRequired,\n stars: PropTypes.number.isRequired\n }).isRequired,\n engines: PropTypes.arrayOf(PropTypes.shape(EngineStars.propTypes)),\n loading: PropTypes.bool.isRequired,\n progressions: PropTypes.arrayOf(\n PropTypes.shape({...ProgressionItem.propTypes, ref: PropTypes.string.isRequired})\n ),\n themeFilter: PropTypes.shape({\n options: Select.propTypes.options.isRequired,\n onChange: Select.propTypes.onChange\n }),\n recommendation: PropTypes.shape({\n cta: PropTypes.string.isRequired,\n title: PropTypes.string.isRequired,\n subtitle: PropTypes.string.isRequired,\n courseTitle: PropTypes.string.isRequired,\n onClick: PropTypes.func\n }),\n 'aria-label': PropTypes.string\n};\n\nexport default Progression;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,YAAY,GAAGC,YAAA,CAAIC,OAAJ,CAAY;EAACC,GAAG,EAAE;AAAN,CAAZ,CAArB;;AAEA,MAAMC,WAAW,GAAG,CAACC,KAAD,EAAQC,aAAR,KAA0B;EAC5C,MAAM;IACJC,SADI;IAEJC,YAFI;IAGJC,cAAc,GAAG,EAHb;IAIJC,YAAY,GAAG,E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AAEkD,kBAAA,CAAUG,KAAV,CAAgB;IAC3BzB,OAAO,EAAEiC,eAAA,CAAOZ,SAAP,CAAiBrB,OAAjB,CAAyBwB,UADP;IAE3B/C,QAAQ,EAAEwD,eAAA,CAAOZ,SAAP,CAAiB5C;EAFA,CAAhB,CAbS;EAiBtBV,cAAc,EAAEuD,kBAAA,CAAUG,KAAV,CAAgB;IAC9Bb,GAAG,EAAEU,kBAAA,CAAUC,MAAV,CAAiBC,UADQ;IAE9BnB,KAAK,EAAEiB,kBAAA,CAAUC,MAAV,CAAiBC,UAFM;IAG9BlB,QAAQ,EAAEgB,kBAAA,CAAUC,MAAV,CAAiBC,UAHG;IAI9Bb,WAAW,EAAEW,kBAAA,CAAUC,MAAV,CAAiBC,UAJA;IAK9BxC,OAAO,EAAEsC,kBAAA,CAAUY;EALW,CAAhB,CAjBM;EAwBtB,cAAcZ,kBAAA,CAAUC;AAxBF,CAAxB;eA2Be7D,W"}
|
|
@@ -241,6 +241,7 @@ declare namespace BrandUpdate {
|
|
|
241
241
|
modified: PropTypes.Requireable<boolean>;
|
|
242
242
|
error: PropTypes.Requireable<boolean>;
|
|
243
243
|
'aria-label': PropTypes.Requireable<string>;
|
|
244
|
+
'aria-labelledby': PropTypes.Requireable<string>;
|
|
244
245
|
}> | PropTypes.InferProps<{
|
|
245
246
|
type: PropTypes.Requireable<string>;
|
|
246
247
|
title: PropTypes.Validator<string>;
|
|
@@ -356,6 +357,7 @@ declare namespace BrandUpdate {
|
|
|
356
357
|
modified: PropTypes.Requireable<boolean>;
|
|
357
358
|
error: PropTypes.Requireable<boolean>;
|
|
358
359
|
'aria-label': PropTypes.Requireable<string>;
|
|
360
|
+
'aria-labelledby': PropTypes.Requireable<string>;
|
|
359
361
|
}> | PropTypes.InferProps<{
|
|
360
362
|
type: PropTypes.Requireable<string>;
|
|
361
363
|
title: PropTypes.Validator<string>;
|
|
@@ -887,6 +889,7 @@ declare namespace BrandUpdate {
|
|
|
887
889
|
modified: PropTypes.Requireable<boolean>;
|
|
888
890
|
error: PropTypes.Requireable<boolean>;
|
|
889
891
|
'aria-label': PropTypes.Requireable<string>;
|
|
892
|
+
'aria-labelledby': PropTypes.Requireable<string>;
|
|
890
893
|
}> | PropTypes.InferProps<{
|
|
891
894
|
type: PropTypes.Requireable<string>;
|
|
892
895
|
title: PropTypes.Validator<string>;
|
|
@@ -1002,6 +1005,7 @@ declare namespace BrandUpdate {
|
|
|
1002
1005
|
modified: PropTypes.Requireable<boolean>;
|
|
1003
1006
|
error: PropTypes.Requireable<boolean>;
|
|
1004
1007
|
'aria-label': PropTypes.Requireable<string>;
|
|
1008
|
+
'aria-labelledby': PropTypes.Requireable<string>;
|
|
1005
1009
|
}> | PropTypes.InferProps<{
|
|
1006
1010
|
type: PropTypes.Requireable<string>;
|
|
1007
1011
|
title: PropTypes.Validator<string>;
|
|
@@ -67,6 +67,7 @@ declare namespace SearchPage {
|
|
|
67
67
|
modified: PropTypes.Requireable<boolean>;
|
|
68
68
|
error: PropTypes.Requireable<boolean>;
|
|
69
69
|
'aria-label': PropTypes.Requireable<string>;
|
|
70
|
+
'aria-labelledby': PropTypes.Requireable<string>;
|
|
70
71
|
}>>;
|
|
71
72
|
onSearch: PropTypes.Requireable<(...args: any[]) => any>;
|
|
72
73
|
onToggleFilters: PropTypes.Requireable<(...args: any[]) => any>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coorpacademy/components",
|
|
3
|
-
"version": "11.9.3-alpha.
|
|
3
|
+
"version": "11.9.3-alpha.26+ff161f4af",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -161,5 +161,5 @@
|
|
|
161
161
|
"last 2 versions",
|
|
162
162
|
"IE 11"
|
|
163
163
|
],
|
|
164
|
-
"gitHead": "
|
|
164
|
+
"gitHead": "ff161f4af90a3fa79b09625477aed54f8528dc06"
|
|
165
165
|
}
|