@coorpacademy/components 11.7.3-alpha.7 → 11.7.4-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/README.md +3 -3
- package/es/atom/input-search/index.d.ts.map +1 -1
- package/es/atom/input-search/index.js +0 -1
- package/es/atom/input-search/index.js.map +1 -1
- package/es/atom/input-switch/index.d.ts +0 -1
- package/es/atom/input-switch/index.d.ts.map +1 -1
- package/es/atom/input-switch/index.js +2 -5
- package/es/atom/input-switch/index.js.map +1 -1
- package/es/atom/loader/index.native.d.ts +10 -0
- package/es/atom/loader/index.native.d.ts.map +1 -0
- package/es/atom/loader/index.native.js +192 -0
- package/es/atom/loader/index.native.js.map +1 -0
- package/es/atom/select/index.d.ts +18 -1
- package/es/atom/select/index.d.ts.map +1 -1
- package/es/atom/select/index.js +29 -17
- package/es/atom/select/index.js.map +1 -1
- package/es/molecule/answer/index.d.ts.map +1 -1
- package/es/molecule/answer/index.js +19 -6
- package/es/molecule/answer/index.js.map +1 -1
- package/es/molecule/brand-form-group/index.d.ts +18 -5
- package/es/molecule/cm-popin/types.d.ts +0 -1
- package/es/molecule/cm-popin/types.d.ts.map +1 -1
- package/es/molecule/draggable-list/index.d.ts +0 -1
- package/es/molecule/filters/filters-wrapper.d.ts +1 -0
- package/es/molecule/filters/filters-wrapper.d.ts.map +1 -1
- package/es/molecule/filters/filters-wrapper.js +10 -9
- package/es/molecule/filters/filters-wrapper.js.map +1 -1
- package/es/molecule/filters/index.d.ts +10 -2
- package/es/molecule/filters/index.d.ts.map +1 -1
- package/es/molecule/filters/index.js +5 -9
- package/es/molecule/filters/index.js.map +1 -1
- package/es/molecule/questions/drop-down/index.d.ts +1 -0
- package/es/molecule/questions/drop-down/index.d.ts.map +1 -1
- package/es/molecule/questions/drop-down/index.js +9 -5
- package/es/molecule/questions/drop-down/index.js.map +1 -1
- package/es/molecule/questions/qcm/index.d.ts +1 -0
- package/es/molecule/questions/qcm/index.d.ts.map +1 -1
- package/es/molecule/questions/qcm/index.js +9 -5
- package/es/molecule/questions/qcm/index.js.map +1 -1
- package/es/molecule/questions/qcm-drag/index.d.ts +3 -1
- package/es/molecule/questions/qcm-drag/index.d.ts.map +1 -1
- package/es/molecule/questions/qcm-drag/index.js +9 -5
- package/es/molecule/questions/qcm-drag/index.js.map +1 -1
- package/es/molecule/questions/qcm-graphic/index.d.ts +1 -0
- package/es/molecule/questions/qcm-graphic/index.d.ts.map +1 -1
- package/es/molecule/questions/qcm-graphic/index.js +9 -5
- package/es/molecule/questions/qcm-graphic/index.js.map +1 -1
- package/es/molecule/questions/question-range/index.d.ts +1 -0
- package/es/molecule/questions/question-range/index.d.ts.map +1 -1
- package/es/molecule/questions/question-range/index.js +10 -6
- package/es/molecule/questions/question-range/index.js.map +1 -1
- package/es/molecule/questions/template/index.d.ts +6 -2
- package/es/molecule/questions/template/index.d.ts.map +1 -1
- package/es/molecule/questions/template/index.js +9 -5
- package/es/molecule/questions/template/index.js.map +1 -1
- package/es/molecule/setup-section/index.d.ts +0 -1
- package/es/molecule/setup-section/index.d.ts.map +1 -1
- package/es/molecule/setup-sections/index.d.ts +0 -1
- package/es/molecule/setup-slide/index.d.ts +9 -2
- package/es/molecule/setup-slider/index.d.ts +9 -2
- package/es/organism/brand-form/index.d.ts +18 -5
- package/es/organism/mooc-header/index.d.ts +5 -0
- package/es/organism/mooc-header/index.d.ts.map +1 -1
- package/es/organism/mooc-header/index.js +62 -12
- package/es/organism/mooc-header/index.js.map +1 -1
- package/es/organism/mooc-header/style.css +46 -0
- package/es/organism/user-preferences/index.d.ts +1 -1
- package/es/organism/user-preferences/index.d.ts.map +1 -1
- package/es/organism/user-preferences/index.js +9 -5
- package/es/organism/user-preferences/index.js.map +1 -1
- package/es/organism/wizard-contents/index.d.ts +18 -5
- package/es/template/activity/index.d.ts +11 -12
- package/es/template/activity/index.d.ts.map +1 -1
- package/es/template/activity/index.js +3 -6
- package/es/template/activity/index.js.map +1 -1
- package/es/template/app-player/loading/index.d.ts +0 -1
- package/es/template/app-player/player/index.d.ts +0 -2
- package/es/template/app-player/player/slides/index.d.ts +0 -1
- package/es/template/app-player/player/slides/index.d.ts.map +1 -1
- package/es/template/app-player/popin-correction/index.d.ts +0 -1
- package/es/template/app-player/popin-correction/index.d.ts.map +1 -1
- package/es/template/app-player/popin-end/index.d.ts +0 -1
- package/es/template/app-review/index.d.ts +0 -1
- package/es/template/app-review/index.d.ts.map +1 -1
- package/es/template/app-review/player/prop-types.d.ts +0 -1
- package/es/template/app-review/player/prop-types.d.ts.map +1 -1
- package/es/template/app-review/prop-types.d.ts +0 -1
- package/es/template/app-review/prop-types.d.ts.map +1 -1
- package/es/template/back-office/brand-update/index.d.ts +36 -11
- package/es/template/common/dashboard/index.d.ts +0 -1
- package/es/template/common/search-page/index.d.ts +11 -3
- package/es/template/common/search-page/index.js +3 -3
- package/es/template/common/search-page/index.js.map +1 -1
- package/es/template/teams-dashboard/index.d.ts +1 -0
- package/lib/atom/input-search/index.d.ts.map +1 -1
- package/lib/atom/input-search/index.js +0 -1
- package/lib/atom/input-search/index.js.map +1 -1
- package/lib/atom/input-switch/index.d.ts +0 -1
- package/lib/atom/input-switch/index.d.ts.map +1 -1
- package/lib/atom/input-switch/index.js +2 -5
- package/lib/atom/input-switch/index.js.map +1 -1
- package/lib/atom/loader/index.native.d.ts +10 -0
- package/lib/atom/loader/index.native.d.ts.map +1 -0
- package/lib/atom/loader/index.native.js +205 -0
- package/lib/atom/loader/index.native.js.map +1 -0
- package/lib/atom/select/index.d.ts +18 -1
- package/lib/atom/select/index.d.ts.map +1 -1
- package/lib/atom/select/index.js +34 -18
- package/lib/atom/select/index.js.map +1 -1
- package/lib/molecule/answer/index.d.ts.map +1 -1
- package/lib/molecule/answer/index.js +20 -6
- package/lib/molecule/answer/index.js.map +1 -1
- package/lib/molecule/brand-form-group/index.d.ts +18 -5
- package/lib/molecule/cm-popin/types.d.ts +0 -1
- package/lib/molecule/cm-popin/types.d.ts.map +1 -1
- package/lib/molecule/draggable-list/index.d.ts +0 -1
- package/lib/molecule/filters/filters-wrapper.d.ts +1 -0
- package/lib/molecule/filters/filters-wrapper.d.ts.map +1 -1
- package/lib/molecule/filters/filters-wrapper.js +10 -9
- package/lib/molecule/filters/filters-wrapper.js.map +1 -1
- package/lib/molecule/filters/index.d.ts +10 -2
- package/lib/molecule/filters/index.d.ts.map +1 -1
- package/lib/molecule/filters/index.js +5 -8
- package/lib/molecule/filters/index.js.map +1 -1
- package/lib/molecule/questions/drop-down/index.d.ts +1 -0
- package/lib/molecule/questions/drop-down/index.d.ts.map +1 -1
- package/lib/molecule/questions/drop-down/index.js +9 -5
- package/lib/molecule/questions/drop-down/index.js.map +1 -1
- package/lib/molecule/questions/qcm/index.d.ts +1 -0
- package/lib/molecule/questions/qcm/index.d.ts.map +1 -1
- package/lib/molecule/questions/qcm/index.js +9 -5
- package/lib/molecule/questions/qcm/index.js.map +1 -1
- package/lib/molecule/questions/qcm-drag/index.d.ts +3 -1
- package/lib/molecule/questions/qcm-drag/index.d.ts.map +1 -1
- package/lib/molecule/questions/qcm-drag/index.js +9 -5
- package/lib/molecule/questions/qcm-drag/index.js.map +1 -1
- package/lib/molecule/questions/qcm-graphic/index.d.ts +1 -0
- package/lib/molecule/questions/qcm-graphic/index.d.ts.map +1 -1
- package/lib/molecule/questions/qcm-graphic/index.js +9 -5
- package/lib/molecule/questions/qcm-graphic/index.js.map +1 -1
- package/lib/molecule/questions/question-range/index.d.ts +1 -0
- package/lib/molecule/questions/question-range/index.d.ts.map +1 -1
- package/lib/molecule/questions/question-range/index.js +10 -6
- package/lib/molecule/questions/question-range/index.js.map +1 -1
- package/lib/molecule/questions/template/index.d.ts +6 -2
- package/lib/molecule/questions/template/index.d.ts.map +1 -1
- package/lib/molecule/questions/template/index.js +9 -5
- package/lib/molecule/questions/template/index.js.map +1 -1
- package/lib/molecule/setup-section/index.d.ts +0 -1
- package/lib/molecule/setup-section/index.d.ts.map +1 -1
- package/lib/molecule/setup-sections/index.d.ts +0 -1
- package/lib/molecule/setup-slide/index.d.ts +9 -2
- package/lib/molecule/setup-slider/index.d.ts +9 -2
- package/lib/organism/brand-form/index.d.ts +18 -5
- package/lib/organism/mooc-header/index.d.ts +5 -0
- package/lib/organism/mooc-header/index.d.ts.map +1 -1
- package/lib/organism/mooc-header/index.js +61 -11
- package/lib/organism/mooc-header/index.js.map +1 -1
- package/lib/organism/mooc-header/style.css +46 -0
- package/lib/organism/user-preferences/index.d.ts +1 -1
- package/lib/organism/user-preferences/index.d.ts.map +1 -1
- package/lib/organism/user-preferences/index.js +9 -5
- package/lib/organism/user-preferences/index.js.map +1 -1
- package/lib/organism/wizard-contents/index.d.ts +18 -5
- package/lib/template/activity/index.d.ts +11 -12
- package/lib/template/activity/index.d.ts.map +1 -1
- package/lib/template/activity/index.js +3 -6
- package/lib/template/activity/index.js.map +1 -1
- package/lib/template/app-player/loading/index.d.ts +0 -1
- package/lib/template/app-player/player/index.d.ts +0 -2
- package/lib/template/app-player/player/slides/index.d.ts +0 -1
- package/lib/template/app-player/player/slides/index.d.ts.map +1 -1
- package/lib/template/app-player/popin-correction/index.d.ts +0 -1
- package/lib/template/app-player/popin-correction/index.d.ts.map +1 -1
- package/lib/template/app-player/popin-end/index.d.ts +0 -1
- package/lib/template/app-review/index.d.ts +0 -1
- package/lib/template/app-review/index.d.ts.map +1 -1
- package/lib/template/app-review/player/prop-types.d.ts +0 -1
- package/lib/template/app-review/player/prop-types.d.ts.map +1 -1
- package/lib/template/app-review/prop-types.d.ts +0 -1
- package/lib/template/app-review/prop-types.d.ts.map +1 -1
- package/lib/template/back-office/brand-update/index.d.ts +36 -11
- package/lib/template/common/dashboard/index.d.ts +0 -1
- package/lib/template/common/search-page/index.d.ts +11 -3
- package/lib/template/common/search-page/index.js +3 -3
- package/lib/template/common/search-page/index.js.map +1 -1
- package/lib/template/teams-dashboard/index.d.ts +1 -0
- package/locales/cs/global.json +1 -0
- package/locales/de/global.json +1 -0
- package/locales/en/global.json +1 -0
- package/locales/es/global.json +1 -0
- package/locales/et/global.json +1 -0
- package/locales/fr/global.json +1 -0
- package/locales/hr/global.json +1 -0
- package/locales/hu/global.json +1 -0
- package/locales/it/global.json +1 -0
- package/locales/ja/global.json +1 -0
- package/locales/ko/global.json +1 -0
- package/locales/nl/global.json +1 -0
- package/locales/pl/global.json +1 -0
- package/locales/pt/global.json +1 -0
- package/locales/ro/global.json +1 -0
- package/locales/ru/global.json +1 -0
- package/locales/sk/global.json +1 -0
- package/locales/tl/global.json +1 -0
- package/locales/tr/global.json +1 -0
- package/locales/uk/global.json +1 -0
- package/locales/vi/global.json +1 -0
- package/locales/zh/global.json +1 -0
- package/locales/zh_TW/global.json +1 -0
- package/package.json +4 -4
|
@@ -11,7 +11,8 @@ import style from './style.css';
|
|
|
11
11
|
|
|
12
12
|
const QCM = (props, legacyContext) => {
|
|
13
13
|
const {
|
|
14
|
-
answers
|
|
14
|
+
answers,
|
|
15
|
+
groupAriaLabel
|
|
15
16
|
} = props;
|
|
16
17
|
const longestAnswer = maxBy(({
|
|
17
18
|
title
|
|
@@ -54,10 +55,12 @@ const QCM = (props, legacyContext) => {
|
|
|
54
55
|
}
|
|
55
56
|
}));
|
|
56
57
|
}), [answers, longestAnswer, primarySkinColor]);
|
|
57
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
58
|
+
return /*#__PURE__*/React.createElement("form", null, /*#__PURE__*/React.createElement("div", {
|
|
58
59
|
"data-name": "qcm",
|
|
59
|
-
className: style.wrapper
|
|
60
|
-
|
|
60
|
+
className: style.wrapper,
|
|
61
|
+
role: "group",
|
|
62
|
+
"aria-label": groupAriaLabel
|
|
63
|
+
}, answersViews));
|
|
61
64
|
};
|
|
62
65
|
|
|
63
66
|
QCM.contextTypes = {
|
|
@@ -69,7 +72,8 @@ QCM.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
69
72
|
selected: PropTypes.bool,
|
|
70
73
|
onClick: PropTypes.func,
|
|
71
74
|
'aria-label': PropTypes.string
|
|
72
|
-
}))
|
|
75
|
+
})),
|
|
76
|
+
groupAriaLabel: PropTypes.string
|
|
73
77
|
} : {};
|
|
74
78
|
export default QCM;
|
|
75
79
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useMemo","classnames","PropTypes","getOr","maxBy","Provider","GetSkinFromContext","getShadowBoxColorFromPrimary","style","QCM","props","legacyContext","answers","longestAnswer","title","length","skin","primarySkinColor","answersViews","map","answer","key","onClick","selected","ariaLabel","longAnswerClass","selectedAnswerClass","selectedAnswer","unselectedAnswer","innerHTML","boxShadow","backgroundColor","background","answerText","__html","wrapper","contextTypes","childContextTypes","propTypes","arrayOf","shape","string","bool","func"],"sources":["../../../../src/molecule/questions/qcm/index.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport classnames from 'classnames';\nimport PropTypes from 'prop-types';\nimport getOr from 'lodash/fp/getOr';\nimport maxBy from 'lodash/fp/maxBy';\nimport Provider, {GetSkinFromContext} from '../../../atom/provider';\nimport {getShadowBoxColorFromPrimary} from '../../../util/get-shadow-box-color-from-primary';\nimport style from './style.css';\n\nconst QCM = (props, legacyContext) => {\n const {answers} = props;\n const longestAnswer = maxBy(({title}) => title.length, answers);\n const skin = GetSkinFromContext(legacyContext);\n const primarySkinColor = getOr('#00B0FF', 'common.primary', skin);\n\n const answersViews = useMemo(\n () =>\n answers.map((answer, key) => {\n const {onClick, title, selected, 'aria-label': ariaLabel} = answer;\n const longAnswerClass = longestAnswer.title === title ? style.longestAnswer : style.answer;\n const selectedAnswerClass = selected ? style.selectedAnswer : style.unselectedAnswer;\n\n return (\n <div\n data-name=\"answer\"\n aria-label={ariaLabel || title}\n className={classnames(longAnswerClass, style.innerHTML, selectedAnswerClass)}\n onClick={onClick}\n style={{\n ...(selected && {\n boxShadow: `0 4px 16px ${getShadowBoxColorFromPrimary(primarySkinColor)}`\n })\n }}\n data-selected={selected}\n key={key}\n >\n <div\n data-name=\"answer-background\"\n style={{backgroundColor: selected ? primarySkinColor : '#F4F4F5' /* cm_grey_75 */}}\n className={style.background}\n />\n <span\n data-name=\"answer-label\"\n className={style.answerText}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: title}}\n />\n </div>\n );\n }),\n [answers, longestAnswer, primarySkinColor]\n );\n\n return (\n <div data-name=\"qcm\" className={style.wrapper}>\n
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useMemo","classnames","PropTypes","getOr","maxBy","Provider","GetSkinFromContext","getShadowBoxColorFromPrimary","style","QCM","props","legacyContext","answers","groupAriaLabel","longestAnswer","title","length","skin","primarySkinColor","answersViews","map","answer","key","onClick","selected","ariaLabel","longAnswerClass","selectedAnswerClass","selectedAnswer","unselectedAnswer","innerHTML","boxShadow","backgroundColor","background","answerText","__html","wrapper","contextTypes","childContextTypes","propTypes","arrayOf","shape","string","bool","func"],"sources":["../../../../src/molecule/questions/qcm/index.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport classnames from 'classnames';\nimport PropTypes from 'prop-types';\nimport getOr from 'lodash/fp/getOr';\nimport maxBy from 'lodash/fp/maxBy';\nimport Provider, {GetSkinFromContext} from '../../../atom/provider';\nimport {getShadowBoxColorFromPrimary} from '../../../util/get-shadow-box-color-from-primary';\nimport style from './style.css';\n\nconst QCM = (props, legacyContext) => {\n const {answers, groupAriaLabel} = props;\n const longestAnswer = maxBy(({title}) => title.length, answers);\n const skin = GetSkinFromContext(legacyContext);\n const primarySkinColor = getOr('#00B0FF', 'common.primary', skin);\n\n const answersViews = useMemo(\n () =>\n answers.map((answer, key) => {\n const {onClick, title, selected, 'aria-label': ariaLabel} = answer;\n const longAnswerClass = longestAnswer.title === title ? style.longestAnswer : style.answer;\n const selectedAnswerClass = selected ? style.selectedAnswer : style.unselectedAnswer;\n\n return (\n <div\n data-name=\"answer\"\n aria-label={ariaLabel || title}\n className={classnames(longAnswerClass, style.innerHTML, selectedAnswerClass)}\n onClick={onClick}\n style={{\n ...(selected && {\n boxShadow: `0 4px 16px ${getShadowBoxColorFromPrimary(primarySkinColor)}`\n })\n }}\n data-selected={selected}\n key={key}\n >\n <div\n data-name=\"answer-background\"\n style={{backgroundColor: selected ? primarySkinColor : '#F4F4F5' /* cm_grey_75 */}}\n className={style.background}\n />\n <span\n data-name=\"answer-label\"\n className={style.answerText}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: title}}\n />\n </div>\n );\n }),\n [answers, longestAnswer, primarySkinColor]\n );\n\n return (\n <form>\n <div data-name=\"qcm\" className={style.wrapper} role=\"group\" aria-label={groupAriaLabel}>\n {answersViews}\n </div>\n </form>\n );\n};\n\nQCM.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nQCM.propTypes = {\n answers: PropTypes.arrayOf(\n PropTypes.shape({\n title: PropTypes.string,\n selected: PropTypes.bool,\n onClick: PropTypes.func,\n 'aria-label': PropTypes.string\n })\n ),\n groupAriaLabel: PropTypes.string\n};\n\nexport default QCM;\n"],"mappings":";;AAAA,OAAOA,KAAP,IAAeC,OAAf,QAA6B,OAA7B;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,KAAP,MAAkB,iBAAlB;AACA,OAAOC,KAAP,MAAkB,iBAAlB;AACA,OAAOC,QAAP,IAAkBC,kBAAlB,QAA2C,wBAA3C;AACA,SAAQC,4BAAR,QAA2C,iDAA3C;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,GAAG,GAAG,CAACC,KAAD,EAAQC,aAAR,KAA0B;EACpC,MAAM;IAACC,OAAD;IAAUC;EAAV,IAA4BH,KAAlC;EACA,MAAMI,aAAa,GAAGV,KAAK,CAAC,CAAC;IAACW;EAAD,CAAD,KAAaA,KAAK,CAACC,MAApB,EAA4BJ,OAA5B,CAA3B;EACA,MAAMK,IAAI,GAAGX,kBAAkB,CAACK,aAAD,CAA/B;EACA,MAA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KAAf;IAAqB,SAAS,EAAEV,KAAK,CAAC4B,OAAtC;IAA+C,IAAI,EAAC,OAApD;IAA4D,cAAYvB;EAAxE,GACGM,YADH,CADF,CADF;AAOD,CAnDD;;AAqDAV,GAAG,CAAC4B,YAAJ,GAAmB;EACjBpB,IAAI,EAAEZ,QAAQ,CAACiC,iBAAT,CAA2BrB;AADhB,CAAnB;AAIAR,GAAG,CAAC8B,SAAJ,2CAAgB;EACd3B,OAAO,EAAEV,SAAS,CAACsC,OAAV,CACPtC,SAAS,CAACuC,KAAV,CAAgB;IACd1B,KAAK,EAAEb,SAAS,CAACwC,MADH;IAEdlB,QAAQ,EAAEtB,SAAS,CAACyC,IAFN;IAGdpB,OAAO,EAAErB,SAAS,CAAC0C,IAHL;IAId,cAAc1C,SAAS,CAACwC;EAJV,CAAhB,CADO,CADK;EASd7B,cAAc,EAAEX,SAAS,CAACwC;AATZ,CAAhB;AAYA,eAAejC,GAAf"}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
export default QcmDrag;
|
|
2
|
-
declare function QcmDrag({ answers, help }: {
|
|
2
|
+
declare function QcmDrag({ answers, help, groupAriaLabel }: {
|
|
3
3
|
answers: any;
|
|
4
4
|
help: any;
|
|
5
|
+
groupAriaLabel: any;
|
|
5
6
|
}, legacyContext: any): JSX.Element;
|
|
6
7
|
declare namespace QcmDrag {
|
|
7
8
|
namespace propTypes {
|
|
8
9
|
export { AnswersPropTypes as answers };
|
|
9
10
|
import help = help;
|
|
10
11
|
export { help };
|
|
12
|
+
export const groupAriaLabel: PropTypes.Requireable<string>;
|
|
11
13
|
}
|
|
12
14
|
namespace contextTypes {
|
|
13
15
|
const skin: PropTypes.Requireable<PropTypes.InferProps<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/molecule/questions/qcm-drag/index.js"],"names":[],"mappings":";AAkGA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/molecule/questions/qcm-drag/index.js"],"names":[],"mappings":";AAkGA;;;;oCAcC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAxGD;;;;;;0BAQE;AA8BF;;;;gBA4CC;;;;;;;;;;;AAxED;;gBAA6E"}
|
|
@@ -116,14 +116,17 @@ SelectedAnswerSections.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
116
116
|
|
|
117
117
|
const QcmDrag = ({
|
|
118
118
|
answers,
|
|
119
|
-
help
|
|
119
|
+
help,
|
|
120
|
+
groupAriaLabel
|
|
120
121
|
}, legacyContext) => {
|
|
121
122
|
const skin = GetSkinFromContext(legacyContext);
|
|
122
123
|
|
|
123
124
|
const primarySkinColor = _getOr('#00B0FF', 'common.primary', skin);
|
|
124
125
|
|
|
125
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
126
|
-
className: style.wrapper
|
|
126
|
+
return /*#__PURE__*/React.createElement("form", null, /*#__PURE__*/React.createElement("div", {
|
|
127
|
+
className: style.wrapper,
|
|
128
|
+
role: "group",
|
|
129
|
+
"aria-label": groupAriaLabel
|
|
127
130
|
}, /*#__PURE__*/React.createElement(SelectedAnswerSections, {
|
|
128
131
|
answers: answers,
|
|
129
132
|
help: help,
|
|
@@ -133,12 +136,13 @@ const QcmDrag = ({
|
|
|
133
136
|
className: style.answers
|
|
134
137
|
}, /*#__PURE__*/React.createElement(Choices, {
|
|
135
138
|
answers: answers
|
|
136
|
-
})));
|
|
139
|
+
}))));
|
|
137
140
|
};
|
|
138
141
|
|
|
139
142
|
QcmDrag.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
140
143
|
answers: AnswersPropTypes,
|
|
141
|
-
help: SelectedAnswerSections.propTypes.help
|
|
144
|
+
help: SelectedAnswerSections.propTypes.help,
|
|
145
|
+
groupAriaLabel: PropTypes.string
|
|
142
146
|
} : {};
|
|
143
147
|
QcmDrag.contextTypes = {
|
|
144
148
|
skin: Provider.childContextTypes.skin
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","PropTypes","classnames","Provider","GetSkinFromContext","getShadowBoxColorFromPrimary","style","AnswersPropTypes","arrayOf","shape","onClick","func","order","number","selected","bool","title","string","help","EmptyView","emptySpan","propTypes","Choices","answers","answersViews","map","answer","key","invisibleAnswer","unselected","innerHTML","__html","choices","SelectedAnswerSections","backgroundColor","selectedAnswers","selectedAnswersViews","boxShadow","background","content","selectedAnswerText","length","emptyAnswers","QcmDrag","legacyContext","skin","primarySkinColor","wrapper","contextTypes","childContextTypes"],"sources":["../../../../src/molecule/questions/qcm-drag/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {pipe, filter, orderBy, getOr} from 'lodash/fp';\nimport classnames from 'classnames';\nimport Provider, {GetSkinFromContext} from '../../../atom/provider';\nimport {getShadowBoxColorFromPrimary} from '../../../util/get-shadow-box-color-from-primary';\nimport style from './style.css';\n\nconst AnswersPropTypes = PropTypes.arrayOf(\n PropTypes.shape({\n onClick: PropTypes.func,\n order: PropTypes.number,\n selected: PropTypes.bool,\n title: PropTypes.string,\n help: PropTypes.string\n })\n);\n\nconst EmptyView = ({help}) => <span className={style.emptySpan}>{help}</span>;\n\nEmptyView.propTypes = {\n help: PropTypes.string\n};\n\nconst Choices = ({answers}) => {\n const answersViews = answers.map((answer, key) => {\n const {onClick, title, selected} = answer;\n return (\n <div\n className={classnames(selected ? style.invisibleAnswer : style.unselected, style.innerHTML)}\n data-name=\"answer\"\n onClick={onClick}\n key={key}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: title}}\n />\n );\n });\n\n return <div className={style.choices}>{answersViews}</div>;\n};\n\nChoices.propTypes = {\n answers: AnswersPropTypes\n};\n\nconst SelectedAnswerSections = ({answers, help, backgroundColor}) => {\n const selectedAnswers = pipe(filter('selected'), orderBy('order', 'asc'))(answers);\n const selectedAnswersViews = selectedAnswers.map((answer, key) => {\n const {onClick, title} = answer;\n return (\n <div\n data-selected=\"true\"\n onClick={onClick}\n key={key}\n data-name=\"selectedAnswer\"\n className={style.selected}\n style={{\n boxShadow: `0px 4px 16px ${getShadowBoxColorFromPrimary(backgroundColor)}`\n }}\n >\n <div\n data-name=\"answerBackground\"\n style={{\n backgroundColor\n }}\n className={style.background}\n />\n <div className={style.content}>\n <span\n data-name=\"answerContent\"\n className={classnames(style.selectedAnswerText, style.innerHTML)}\n title={title}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: title}}\n />\n </div>\n </div>\n );\n });\n\n if (selectedAnswersViews.length > 0) {\n return <div className={style.selectedAnswers}>{selectedAnswersViews}</div>;\n } else {\n return (\n <div className={style.emptyAnswers}>\n <EmptyView help={help} />\n </div>\n );\n }\n};\n\nSelectedAnswerSections.propTypes = {\n answers: AnswersPropTypes,\n help: EmptyView.propTypes.help,\n backgroundColor: PropTypes.string\n};\n\nconst QcmDrag = ({answers, help}, legacyContext) => {\n const skin = GetSkinFromContext(legacyContext);\n const primarySkinColor = getOr('#00B0FF', 'common.primary', skin);\n\n return (\n <div className={style.wrapper}>\n
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PropTypes","classnames","Provider","GetSkinFromContext","getShadowBoxColorFromPrimary","style","AnswersPropTypes","arrayOf","shape","onClick","func","order","number","selected","bool","title","string","help","EmptyView","emptySpan","propTypes","Choices","answers","answersViews","map","answer","key","invisibleAnswer","unselected","innerHTML","__html","choices","SelectedAnswerSections","backgroundColor","selectedAnswers","selectedAnswersViews","boxShadow","background","content","selectedAnswerText","length","emptyAnswers","QcmDrag","groupAriaLabel","legacyContext","skin","primarySkinColor","wrapper","contextTypes","childContextTypes"],"sources":["../../../../src/molecule/questions/qcm-drag/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {pipe, filter, orderBy, getOr} from 'lodash/fp';\nimport classnames from 'classnames';\nimport Provider, {GetSkinFromContext} from '../../../atom/provider';\nimport {getShadowBoxColorFromPrimary} from '../../../util/get-shadow-box-color-from-primary';\nimport style from './style.css';\n\nconst AnswersPropTypes = PropTypes.arrayOf(\n PropTypes.shape({\n onClick: PropTypes.func,\n order: PropTypes.number,\n selected: PropTypes.bool,\n title: PropTypes.string,\n help: PropTypes.string\n })\n);\n\nconst EmptyView = ({help}) => <span className={style.emptySpan}>{help}</span>;\n\nEmptyView.propTypes = {\n help: PropTypes.string\n};\n\nconst Choices = ({answers}) => {\n const answersViews = answers.map((answer, key) => {\n const {onClick, title, selected} = answer;\n return (\n <div\n className={classnames(selected ? style.invisibleAnswer : style.unselected, style.innerHTML)}\n data-name=\"answer\"\n onClick={onClick}\n key={key}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: title}}\n />\n );\n });\n\n return <div className={style.choices}>{answersViews}</div>;\n};\n\nChoices.propTypes = {\n answers: AnswersPropTypes\n};\n\nconst SelectedAnswerSections = ({answers, help, backgroundColor}) => {\n const selectedAnswers = pipe(filter('selected'), orderBy('order', 'asc'))(answers);\n const selectedAnswersViews = selectedAnswers.map((answer, key) => {\n const {onClick, title} = answer;\n return (\n <div\n data-selected=\"true\"\n onClick={onClick}\n key={key}\n data-name=\"selectedAnswer\"\n className={style.selected}\n style={{\n boxShadow: `0px 4px 16px ${getShadowBoxColorFromPrimary(backgroundColor)}`\n }}\n >\n <div\n data-name=\"answerBackground\"\n style={{\n backgroundColor\n }}\n className={style.background}\n />\n <div className={style.content}>\n <span\n data-name=\"answerContent\"\n className={classnames(style.selectedAnswerText, style.innerHTML)}\n title={title}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: title}}\n />\n </div>\n </div>\n );\n });\n\n if (selectedAnswersViews.length > 0) {\n return <div className={style.selectedAnswers}>{selectedAnswersViews}</div>;\n } else {\n return (\n <div className={style.emptyAnswers}>\n <EmptyView help={help} />\n </div>\n );\n }\n};\n\nSelectedAnswerSections.propTypes = {\n answers: AnswersPropTypes,\n help: EmptyView.propTypes.help,\n backgroundColor: PropTypes.string\n};\n\nconst QcmDrag = ({answers, help, groupAriaLabel}, legacyContext) => {\n const skin = GetSkinFromContext(legacyContext);\n const primarySkinColor = getOr('#00B0FF', 'common.primary', skin);\n\n return (\n <form>\n <div className={style.wrapper} role=\"group\" aria-label={groupAriaLabel}>\n <SelectedAnswerSections answers={answers} help={help} backgroundColor={primarySkinColor} />\n <div data-name=\"qcm-drag-answers\" className={style.answers}>\n <Choices answers={answers} />\n </div>\n </div>\n </form>\n );\n};\n\nQcmDrag.propTypes = {\n answers: AnswersPropTypes,\n help: SelectedAnswerSections.propTypes.help,\n groupAriaLabel: PropTypes.string\n};\n\nQcmDrag.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nexport default QcmDrag;\n"],"mappings":";;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,QAAP,IAAkBC,kBAAlB,QAA2C,wBAA3C;AACA,SAAQC,4BAAR,QAA2C,iDAA3C;AACA,OAAOC,KAAP,MAAkB,aAAlB;AAEA,MAAMC,gBAAN,2CAAyBN,SAAS,CAACO,OAAV,CACvBP,SAAS,CAACQ,KAAV,CAAgB;EACdC,OAAO,EAAET,SAAS,CAACU,IADL;EAEdC,KAAK,EAAEX,SAAS,CAACY,MAFH;EAGdC,QAAQ,EAAEb,SAAS,CAACc,IAHN;EAIdC,KAAK,EAAEf,SAAS,CAACgB,MAJH;EAKdC,IAAI,EAAEjB,SAAS,CAACgB;AALF,CAAhB,CADuB,CAAzB;;AAUA,MAAME,SAAS,GAAG,CAAC;EAACD;AAAD,CAAD,kBAAY;EAAM,SAAS,EAAEZ,KAAK,CAACc;AAAvB,GAAmCF,IAAnC,CAA9B;;AAEAC,SAAS,CAACE,SAAV,2CAAsB;EACpBH,IAAI,EAAEjB,SAAS,CAACgB;AADI,CAAtB;;AAIA,MAAMK,OAAO,GAAG,CAAC;EAACC;AAAD,CAAD,KAAe;EAC7B,MAAMC,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AAvE,EADF,eAEE;IAAK,aAAU,kBAAf;IAAkC,SAAS,EAAEzC,KAAK,CAACiB;EAAnD,gBACE,oBAAC,OAAD;IAAS,OAAO,EAAEA;EAAlB,EADF,CAFF,CADF,CADF;AAUD,CAdD;;AAgBAoB,OAAO,CAACtB,SAAR,2CAAoB;EAClBE,OAAO,EAAEhB,gBADS;EAElBW,IAAI,EAAEe,sBAAsB,CAACZ,SAAvB,CAAiCH,IAFrB;EAGlB0B,cAAc,EAAE3C,SAAS,CAACgB;AAHR,CAApB;AAMA0B,OAAO,CAACM,YAAR,GAAuB;EACrBH,IAAI,EAAE3C,QAAQ,CAAC+C,iBAAT,CAA2BJ;AADZ,CAAvB;AAIA,eAAeH,OAAf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/molecule/questions/qcm-graphic/index.js"],"names":[],"mappings":";AAQA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/molecule/questions/qcm-graphic/index.js"],"names":[],"mappings":";AAQA,uEA8DC"}
|
|
@@ -11,7 +11,8 @@ import style from './style.css';
|
|
|
11
11
|
|
|
12
12
|
const QCMImage = (props, legacyContext) => {
|
|
13
13
|
const {
|
|
14
|
-
answers
|
|
14
|
+
answers,
|
|
15
|
+
groupAriaLabel
|
|
15
16
|
} = props;
|
|
16
17
|
const skin = GetSkinFromContext(legacyContext);
|
|
17
18
|
|
|
@@ -62,10 +63,12 @@ const QCMImage = (props, legacyContext) => {
|
|
|
62
63
|
}
|
|
63
64
|
}))));
|
|
64
65
|
});
|
|
65
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
66
|
+
return /*#__PURE__*/React.createElement("form", null, /*#__PURE__*/React.createElement("div", {
|
|
66
67
|
"data-name": "qcm-graphic-wrapper",
|
|
67
|
-
className: style.wrapper
|
|
68
|
-
|
|
68
|
+
className: style.wrapper,
|
|
69
|
+
role: "group",
|
|
70
|
+
"aria-label": groupAriaLabel
|
|
71
|
+
}, answersViews));
|
|
69
72
|
};
|
|
70
73
|
|
|
71
74
|
QCMImage.contextTypes = {
|
|
@@ -78,7 +81,8 @@ QCMImage.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
78
81
|
onClick: PropTypes.func,
|
|
79
82
|
image: PropTypes.string,
|
|
80
83
|
ariaLabel: PropTypes.string
|
|
81
|
-
}))
|
|
84
|
+
})),
|
|
85
|
+
groupAriaLabel: PropTypes.string
|
|
82
86
|
} : {};
|
|
83
87
|
export default QCMImage;
|
|
84
88
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","PropTypes","classnames","Provider","GetSkinFromContext","getShadowBoxColorFromPrimary","style","QCMImage","props","legacyContext","answers","skin","primarySkinColor","answersViews","map","answer","key","onClick","title","selected","image","ariaLabel","boxShadow","backgroundColor","background","content","imageWrapper","backgroundImage","titleWrapper","innerHTML","__html","wrapper","contextTypes","childContextTypes","propTypes","arrayOf","shape","string","bool","func"],"sources":["../../../../src/molecule/questions/qcm-graphic/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {getOr} from 'lodash/fp';\nimport classnames from 'classnames';\nimport Provider, {GetSkinFromContext} from '../../../atom/provider';\nimport {getShadowBoxColorFromPrimary} from '../../../util/get-shadow-box-color-from-primary';\nimport style from './style.css';\n\nconst QCMImage = (props, legacyContext) => {\n const {answers} = props;\n const skin = GetSkinFromContext(legacyContext);\n const primarySkinColor = getOr('#00B0FF', 'common.primary', skin);\n\n const answersViews = answers.map((answer, key) => {\n const {onClick, title, selected, image, ariaLabel} = answer;\n\n return (\n <div\n onClick={onClick}\n data-selected={selected}\n data-name=\"answerGraphic\"\n style={{\n ...(selected && {\n boxShadow: `0 4px 16px ${getShadowBoxColorFromPrimary(primarySkinColor)}`\n })\n }}\n className={selected ? style.selected : style.answer}\n key={key}\n >\n <div\n data-name=\"answerBackground\"\n style={{\n backgroundColor: selected ? primarySkinColor : '#F4F4F5'\n }}\n className={style.background}\n />\n <div data-name=\"answerContent\" className={style.content}>\n <div\n className={style.imageWrapper}\n data-name=\"answerImage\"\n aria-label={ariaLabel || title}\n style={{\n backgroundImage: `url(${image})`\n }}\n />\n <div data-name=\"answerText\" className={style.titleWrapper}>\n <div\n title={title}\n className={classnames(style.title, style.innerHTML)}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: title}}\n />\n </div>\n </div>\n </div>\n );\n });\n\n return (\n <div
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PropTypes","classnames","Provider","GetSkinFromContext","getShadowBoxColorFromPrimary","style","QCMImage","props","legacyContext","answers","groupAriaLabel","skin","primarySkinColor","answersViews","map","answer","key","onClick","title","selected","image","ariaLabel","boxShadow","backgroundColor","background","content","imageWrapper","backgroundImage","titleWrapper","innerHTML","__html","wrapper","contextTypes","childContextTypes","propTypes","arrayOf","shape","string","bool","func"],"sources":["../../../../src/molecule/questions/qcm-graphic/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {getOr} from 'lodash/fp';\nimport classnames from 'classnames';\nimport Provider, {GetSkinFromContext} from '../../../atom/provider';\nimport {getShadowBoxColorFromPrimary} from '../../../util/get-shadow-box-color-from-primary';\nimport style from './style.css';\n\nconst QCMImage = (props, legacyContext) => {\n const {answers, groupAriaLabel} = props;\n const skin = GetSkinFromContext(legacyContext);\n const primarySkinColor = getOr('#00B0FF', 'common.primary', skin);\n\n const answersViews = answers.map((answer, key) => {\n const {onClick, title, selected, image, ariaLabel} = answer;\n\n return (\n <div\n onClick={onClick}\n data-selected={selected}\n data-name=\"answerGraphic\"\n style={{\n ...(selected && {\n boxShadow: `0 4px 16px ${getShadowBoxColorFromPrimary(primarySkinColor)}`\n })\n }}\n className={selected ? style.selected : style.answer}\n key={key}\n >\n <div\n data-name=\"answerBackground\"\n style={{\n backgroundColor: selected ? primarySkinColor : '#F4F4F5'\n }}\n className={style.background}\n />\n <div data-name=\"answerContent\" className={style.content}>\n <div\n className={style.imageWrapper}\n data-name=\"answerImage\"\n aria-label={ariaLabel || title}\n style={{\n backgroundImage: `url(${image})`\n }}\n />\n <div data-name=\"answerText\" className={style.titleWrapper}>\n <div\n title={title}\n className={classnames(style.title, style.innerHTML)}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: title}}\n />\n </div>\n </div>\n </div>\n );\n });\n\n return (\n <form>\n <div\n data-name=\"qcm-graphic-wrapper\"\n className={style.wrapper}\n role=\"group\"\n aria-label={groupAriaLabel}\n >\n {answersViews}\n </div>\n </form>\n );\n};\n\nQCMImage.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nQCMImage.propTypes = {\n answers: PropTypes.arrayOf(\n PropTypes.shape({\n title: PropTypes.string,\n selected: PropTypes.bool,\n onClick: PropTypes.func,\n image: PropTypes.string,\n ariaLabel: PropTypes.string\n })\n ),\n groupAriaLabel: PropTypes.string\n};\n\nexport default QCMImage;\n"],"mappings":";;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,QAAP,IAAkBC,kBAAlB,QAA2C,wBAA3C;AACA,SAAQC,4BAAR,QAA2C,iDAA3C;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,QAAQ,GAAG,CAACC,KAAD,EAAQC,aAAR,KAA0B;EACzC,MAAM;IAACC,OAAD;IAAUC;EAAV,IAA4BH,KAAlC;EACA,MAAMI,IAAI,GAAGR,kBAAkB,CAACK,aAAD,CAA/B;;EACA,MAAMI,gBAAgB,GAAG,OAAM,SAAN,EAAiB,gBAAjB,EAAmCD,IAAnC,CAAzB;;EAEA,MAAME,YAAY,GAAGJ,OAAO,CAACK,GAAR,CAAY,CAACC,MAAD,EAASC,GAAT,KAAiB;IAChD,MAAM;MAACC,OAAD;MAAUC,KAAV;MAAi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,CAAC+B,iBAAT,CAA2BtB;AADX,CAAxB;AAIAL,QAAQ,CAAC4B,SAAT,2CAAqB;EACnBzB,OAAO,EAAET,SAAS,CAACmC,OAAV,CACPnC,SAAS,CAACoC,KAAV,CAAgB;IACdlB,KAAK,EAAElB,SAAS,CAACqC,MADH;IAEdlB,QAAQ,EAAEnB,SAAS,CAACsC,IAFN;IAGdrB,OAAO,EAAEjB,SAAS,CAACuC,IAHL;IAIdnB,KAAK,EAAEpB,SAAS,CAACqC,MAJH;IAKdhB,SAAS,EAAErB,SAAS,CAACqC;EALP,CAAhB,CADO,CADU;EAUnB3B,cAAc,EAAEV,SAAS,CAACqC;AAVP,CAArB;AAaA,eAAe/B,QAAf"}
|
|
@@ -28,6 +28,7 @@ declare namespace QuestionRange {
|
|
|
28
28
|
title: PropTypes.Requireable<string>;
|
|
29
29
|
minLabel: PropTypes.Requireable<string>;
|
|
30
30
|
maxLabel: PropTypes.Requireable<string>;
|
|
31
|
+
groupAriaLabel: PropTypes.Requireable<string>;
|
|
31
32
|
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
32
33
|
onChangeEnd: PropTypes.Requireable<(...args: any[]) => any>;
|
|
33
34
|
multi: PropTypes.Requireable<boolean>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/molecule/questions/question-range/index.js"],"names":[],"mappings":";AAQA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/molecule/questions/question-range/index.js"],"names":[],"mappings":";AAQA,4EAmCC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _getOr from "lodash/fp/getOr";
|
|
2
|
-
const _excluded = ["title", "minLabel", "maxLabel"];
|
|
2
|
+
const _excluded = ["title", "minLabel", "maxLabel", "groupAriaLabel"];
|
|
3
3
|
|
|
4
4
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
5
5
|
|
|
@@ -16,7 +16,8 @@ const QuestionRange = (props, legacyContext) => {
|
|
|
16
16
|
const {
|
|
17
17
|
title,
|
|
18
18
|
minLabel,
|
|
19
|
-
maxLabel
|
|
19
|
+
maxLabel,
|
|
20
|
+
groupAriaLabel
|
|
20
21
|
} = props,
|
|
21
22
|
rangeProps = _objectWithoutPropertiesLoose(props, _excluded);
|
|
22
23
|
|
|
@@ -27,8 +28,10 @@ const QuestionRange = (props, legacyContext) => {
|
|
|
27
28
|
const titleStyle = {
|
|
28
29
|
color: defaultColor
|
|
29
30
|
};
|
|
30
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
31
|
-
className: style.wrapper
|
|
31
|
+
return /*#__PURE__*/React.createElement("form", null, /*#__PURE__*/React.createElement("div", {
|
|
32
|
+
className: style.wrapper,
|
|
33
|
+
role: "group",
|
|
34
|
+
"aria-label": groupAriaLabel
|
|
32
35
|
}, /*#__PURE__*/React.createElement("span", {
|
|
33
36
|
style: titleStyle,
|
|
34
37
|
className: classnames(style.title, style.innerHTML) // eslint-disable-next-line react/no-danger
|
|
@@ -50,7 +53,7 @@ const QuestionRange = (props, legacyContext) => {
|
|
|
50
53
|
dangerouslySetInnerHTML: {
|
|
51
54
|
__html: maxLabel
|
|
52
55
|
}
|
|
53
|
-
})));
|
|
56
|
+
}))));
|
|
54
57
|
};
|
|
55
58
|
|
|
56
59
|
QuestionRange.contextTypes = {
|
|
@@ -59,7 +62,8 @@ QuestionRange.contextTypes = {
|
|
|
59
62
|
QuestionRange.propTypes = process.env.NODE_ENV !== "production" ? _extends({}, Range.propTypes, {
|
|
60
63
|
title: PropTypes.string,
|
|
61
64
|
minLabel: PropTypes.string,
|
|
62
|
-
maxLabel: PropTypes.string
|
|
65
|
+
maxLabel: PropTypes.string,
|
|
66
|
+
groupAriaLabel: PropTypes.string
|
|
63
67
|
}) : {};
|
|
64
68
|
export default QuestionRange;
|
|
65
69
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","PropTypes","classnames","Provider","GetSkinFromContext","Range","style","QuestionRange","props","legacyContext","title","minLabel","maxLabel","rangeProps","skin","defaultColor","titleStyle","color","wrapper","innerHTML","__html","labelWrapper","label","contextTypes","childContextTypes","propTypes","string"],"sources":["../../../../src/molecule/questions/question-range/index.js"],"sourcesContent":["import React from 'react';\nimport {getOr} from 'lodash/fp';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport Provider, {GetSkinFromContext} from '../../../atom/provider';\nimport Range from '../../../atom/range';\nimport style from './style.css';\n\nconst QuestionRange = (props, legacyContext) => {\n const {title, minLabel, maxLabel, ...rangeProps} = props;\n\n const skin = GetSkinFromContext(legacyContext);\n const defaultColor = getOr('#00B0FF', 'common.primary', skin);\n\n const titleStyle = {\n color: defaultColor\n };\n\n return (\n <div className={style.wrapper}>\n
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PropTypes","classnames","Provider","GetSkinFromContext","Range","style","QuestionRange","props","legacyContext","title","minLabel","maxLabel","groupAriaLabel","rangeProps","skin","defaultColor","titleStyle","color","wrapper","innerHTML","__html","labelWrapper","label","contextTypes","childContextTypes","propTypes","string"],"sources":["../../../../src/molecule/questions/question-range/index.js"],"sourcesContent":["import React from 'react';\nimport {getOr} from 'lodash/fp';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport Provider, {GetSkinFromContext} from '../../../atom/provider';\nimport Range from '../../../atom/range';\nimport style from './style.css';\n\nconst QuestionRange = (props, legacyContext) => {\n const {title, minLabel, maxLabel, groupAriaLabel, ...rangeProps} = props;\n\n const skin = GetSkinFromContext(legacyContext);\n const defaultColor = getOr('#00B0FF', 'common.primary', skin);\n\n const titleStyle = {\n color: defaultColor\n };\n\n return (\n <form>\n <div className={style.wrapper} role=\"group\" aria-label={groupAriaLabel}>\n <span\n style={titleStyle}\n className={classnames(style.title, style.innerHTML)}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: title}}\n />\n <Range {...rangeProps} />\n <div className={style.labelWrapper}>\n <span\n className={classnames(style.label, style.innerHTML)}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: minLabel}}\n />\n <span\n className={classnames(style.label, style.innerHTML)}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: maxLabel}}\n />\n </div>\n </div>\n </form>\n );\n};\n\nQuestionRange.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nQuestionRange.propTypes = {\n ...Range.propTypes,\n title: PropTypes.string,\n minLabel: PropTypes.string,\n maxLabel: PropTypes.string,\n groupAriaLabel: PropTypes.string\n};\n\nexport default QuestionRange;\n"],"mappings":";;;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAEA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,QAAP,IAAkBC,kBAAlB,QAA2C,wBAA3C;AACA,OAAOC,KAAP,MAAkB,qBAAlB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,aAAa,GAAG,CAACC,KAAD,EAAQC,aAAR,KAA0B;EAC9C,MAAM;IAACC,KAAD;IAAQC,QAAR;IAAkBC,QAAlB;IAA4BC;EAA5B,IAA6DL,KAAnE;EAAA,MAAqDM,UAArD,iCAAmEN,KAAnE;;EAEA,MAAMO,IAAI,GAAGX,kBAAkB,CAACK,aAAD,CAA/B;;EACA,MAAMO,YAAY,GAAG,OAAM,SAAN,EAAiB,gBAAjB,EAAmCD,IAAnC,CAArB;;EAEA,MAAME,UAAU,GAAG;IACjBC,KAAK,EAAEF;EADU,CAAnB;EAIA,oBACE,+CACE;IAAK,SAAS,EAAEV,KAAK,CAACa,OAAtB;IAA+B,IAAI,EAAC,OAApC;IAA4C,cAAYN;EAAxD,gBACE;IACE,KAAK,EAAEI,UADT;IAEE,SAAS,EAAEf,UAAU,CAACI,KAAK,CAACI,KAAP,EAAcJ,KAAK,CAACc,SAApB,CAFvB,CAGE;IAHF;IAIE,uBAAuB,EAAE;MAACC,MAAM,EAAEX;IAAT;EAJ3B,EADF,eAOE,oBAAC,KAAD,EAAWI,UAAX,CAPF,eAQE;IAAK,SAAS,EAAER,KAAK,CAACgB;EAAtB,gBACE;IACE,SAAS,EAAEpB,UAAU,CAACI,KAAK,CAACiB,KAAP,EAAcjB,KAAK,CAACc,SAApB,CADvB,CAEE;IAFF;IAGE,uBAAuB,EAAE;MAACC,MAAM,EAAEV;IAAT;EAH3B,EADF,eAME;IACE,SAAS,EAAET,UAAU,CAACI,KAAK,CAACiB,KAAP,EAAcjB,KAAK,CAACc,SAApB,CADvB,CAEE;IAFF;IAGE,uBAAuB,EAAE;MAACC,MAAM,EAAET;IAAT;EAH3B,EANF,CARF,CADF,CADF;AAyBD,CAnCD;;AAqCAL,aAAa,CAACiB,YAAd,GAA6B;EAC3BT,IAAI,EAAEZ,QAAQ,CAACsB,iBAAT,CAA2BV;AADN,CAA7B;AAIAR,aAAa,CAACmB,SAAd,wDACKrB,KAAK,CAACqB,SADX;EAEEhB,KAAK,EAAET,SAAS,CAAC0B,MAFnB;EAGEhB,QAAQ,EAAEV,SAAS,CAAC0B,MAHtB;EAIEf,QAAQ,EAAEX,SAAS,CAAC0B,MAJtB;EAKEd,cAAc,EAAEZ,SAAS,CAAC0B;AAL5B;AAQA,eAAepB,aAAf"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export default Template;
|
|
2
|
-
declare function Template({ template, answers }: {
|
|
2
|
+
declare function Template({ template, answers, groupAriaLabel }: {
|
|
3
3
|
template: any;
|
|
4
4
|
answers: any;
|
|
5
|
+
groupAriaLabel: any;
|
|
5
6
|
}): JSX.Element;
|
|
6
7
|
declare namespace Template {
|
|
7
8
|
namespace propTypes {
|
|
@@ -16,6 +17,7 @@ declare namespace Template {
|
|
|
16
17
|
}> | null | undefined)[]>;
|
|
17
18
|
theme: PropTypes.Requireable<string>;
|
|
18
19
|
'aria-label': PropTypes.Requireable<string>;
|
|
20
|
+
groupAriaLabel: PropTypes.Requireable<string>;
|
|
19
21
|
}, never>> & Partial<PropTypes.InferPropsInner<Pick<{
|
|
20
22
|
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
21
23
|
options: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
@@ -26,7 +28,9 @@ declare namespace Template {
|
|
|
26
28
|
}> | null | undefined)[]>;
|
|
27
29
|
theme: PropTypes.Requireable<string>;
|
|
28
30
|
'aria-label': PropTypes.Requireable<string>;
|
|
29
|
-
|
|
31
|
+
groupAriaLabel: PropTypes.Requireable<string>;
|
|
32
|
+
}, "aria-label" | "onChange" | "theme" | "options" | "groupAriaLabel">>>) | null | undefined)[]>;
|
|
33
|
+
const groupAriaLabel: PropTypes.Requireable<string>;
|
|
30
34
|
}
|
|
31
35
|
}
|
|
32
36
|
import PropTypes from "prop-types";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/molecule/questions/template/index.js"],"names":[],"mappings":";AAQA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/molecule/questions/template/index.js"],"names":[],"mappings":";AAQA;;;;gBA6CC"}
|
|
@@ -15,7 +15,8 @@ import style from './style.css';
|
|
|
15
15
|
|
|
16
16
|
const Template = ({
|
|
17
17
|
template,
|
|
18
|
-
answers
|
|
18
|
+
answers,
|
|
19
|
+
groupAriaLabel
|
|
19
20
|
}) => {
|
|
20
21
|
const totalTemplate = parseTemplateString(template);
|
|
21
22
|
|
|
@@ -59,10 +60,12 @@ const Template = ({
|
|
|
59
60
|
}
|
|
60
61
|
}, totalTemplate);
|
|
61
62
|
|
|
62
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
63
|
+
return /*#__PURE__*/React.createElement("form", null, /*#__PURE__*/React.createElement("div", {
|
|
63
64
|
"data-name": "template-wrapper",
|
|
64
|
-
className: style.wrapper
|
|
65
|
-
|
|
65
|
+
className: style.wrapper,
|
|
66
|
+
role: "group",
|
|
67
|
+
"aria-label": groupAriaLabel
|
|
68
|
+
}, templateCompose));
|
|
66
69
|
};
|
|
67
70
|
|
|
68
71
|
const TextPropTypes = process.env.NODE_ENV !== "production" ? _extends({}, DropDown.propTypes, {
|
|
@@ -70,7 +73,8 @@ const TextPropTypes = process.env.NODE_ENV !== "production" ? _extends({}, DropD
|
|
|
70
73
|
}) : {};
|
|
71
74
|
Template.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
72
75
|
template: PropTypes.string,
|
|
73
|
-
answers: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.shape(DropDown.propTypes), PropTypes.shape(TextPropTypes)]))
|
|
76
|
+
answers: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.shape(DropDown.propTypes), PropTypes.shape(TextPropTypes)])),
|
|
77
|
+
groupAriaLabel: PropTypes.string
|
|
74
78
|
} : {};
|
|
75
79
|
export default Template;
|
|
76
80
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","PropTypes","parseTemplateString","DropDown","FreeText","style","Template","template","answers","totalTemplate","templateCompose","convert","cap","part","key","type","textPart","__html","value","field","name","fieldType","fieldProps","fieldView","text","answerType","wrapper","TextPropTypes","propTypes","string","arrayOf","oneOfType","shape"],"sources":["../../../../src/molecule/questions/template/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {map, find} from 'lodash/fp';\nimport parseTemplateString from '../../../util/parse-template-string';\nimport DropDown from '../drop-down';\nimport FreeText from '../free-text';\nimport style from './style.css';\n\nconst Template = ({template, answers}) => {\n const totalTemplate = parseTemplateString(template);\n const templateCompose = map.convert({cap: false})((part, key) => {\n const type = part.type;\n if (type === 'string') {\n return (\n <span\n key={key}\n className={style.textPart}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: part.value}}\n />\n );\n }\n if (type === 'answerField') {\n const field = find({name: part.value}, answers);\n if (!field) return null;\n const {type: fieldType, ...fieldProps} = field;\n const fieldView =\n fieldType === 'text' ? (\n <FreeText {...fieldProps} className={style.text} />\n ) : (\n <DropDown {...fieldProps} theme=\"player\" />\n );\n\n return (\n <div className={style.answerType} key={part.value}>\n {fieldView}\n </div>\n );\n }\n }, totalTemplate);\n\n return (\n <div
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PropTypes","parseTemplateString","DropDown","FreeText","style","Template","template","answers","groupAriaLabel","totalTemplate","templateCompose","convert","cap","part","key","type","textPart","__html","value","field","name","fieldType","fieldProps","fieldView","text","answerType","wrapper","TextPropTypes","propTypes","string","arrayOf","oneOfType","shape"],"sources":["../../../../src/molecule/questions/template/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {map, find} from 'lodash/fp';\nimport parseTemplateString from '../../../util/parse-template-string';\nimport DropDown from '../drop-down';\nimport FreeText from '../free-text';\nimport style from './style.css';\n\nconst Template = ({template, answers, groupAriaLabel}) => {\n const totalTemplate = parseTemplateString(template);\n const templateCompose = map.convert({cap: false})((part, key) => {\n const type = part.type;\n if (type === 'string') {\n return (\n <span\n key={key}\n className={style.textPart}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: part.value}}\n />\n );\n }\n if (type === 'answerField') {\n const field = find({name: part.value}, answers);\n if (!field) return null;\n const {type: fieldType, ...fieldProps} = field;\n const fieldView =\n fieldType === 'text' ? (\n <FreeText {...fieldProps} className={style.text} />\n ) : (\n <DropDown {...fieldProps} theme=\"player\" />\n );\n\n return (\n <div className={style.answerType} key={part.value}>\n {fieldView}\n </div>\n );\n }\n }, totalTemplate);\n\n return (\n <form>\n <div\n data-name=\"template-wrapper\"\n className={style.wrapper}\n role=\"group\"\n aria-label={groupAriaLabel}\n >\n {templateCompose}\n </div>\n </form>\n );\n};\n\nconst TextPropTypes = {\n ...DropDown.propTypes,\n type: PropTypes.string\n};\n\nTemplate.propTypes = {\n template: PropTypes.string,\n answers: PropTypes.arrayOf(\n PropTypes.oneOfType([PropTypes.shape(DropDown.propTypes), PropTypes.shape(TextPropTypes)])\n ),\n groupAriaLabel: PropTypes.string\n};\n\nexport default Template;\n"],"mappings":";;;;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,OAAOC,mBAAP,MAAgC,qCAAhC;AACA,OAAOC,QAAP,MAAqB,cAArB;AACA,OAAOC,QAAP,MAAqB,cAArB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,QAAQ,GAAG,CAAC;EAACC,QAAD;EAAWC,OAAX;EAAoBC;AAApB,CAAD,KAAyC;EACxD,MAAMC,aAAa,GAAGR,mBAAmB,CAACK,QAAD,CAAzC;;EACA,MAAMI,eAAe,GAAG,KAAIC,OAAJ,CAAY;IAACC,GAAG,EAAE;EAAN,CAAZ,EAA0B,CAACC,IAAD,EAAOC,GAAP,KAAe;IAC/D,MAAMC,IAAI,GAAGF,IAAI,CAACE,IAAlB;;IACA,IAAIA,IAAI,KAAK,QAAb,EAAuB;MACrB,oBACE;QACE,GAAG,EAAED,GADP;QAEE,SAAS,EAAEV,KAAK,CAACY,QAFnB,CAGE;QAHF;QAIE,uBAAuB,EAAE;UAACC,MAAM,EAAEJ,IAAI,CAACK;QAAd;MAJ3B,EADF;IAQD;;IACD,IAAIH,IAAI,KAAK,aAAb,EAA4B;MAC1B,MAAMI,KAAK,GAAG,MAAK;QAACC,IAAI,EAAEP,IAAI,CAACK;MAAZ,CAAL,EAAyBX,OAAzB,CAAd;;MACA,IAAI,CAACY,KAAL,EAAY,OAAO,IAAP;;MACZ,MAAM;QAACJ,IAAI,EAAEM;MAAP,IAAmCF,KAAzC;MAAA,MAA2BG,UAA3B,iCAAyCH,KAAzC;;MACA,MAAMI,SAAS,GACbF,SAAS,KAAK,MAAd,gBACE,oBAAC,QAAD,eAAcC,UAAd;QAA0B,SAAS,EAAElB,KAAK,CAACoB;MAA3C,GADF,gBAGE,oBAAC,QAAD,eAAcF,UAAd;QAA0B,KAAK,EAAC;MAAhC,GAJJ;MAOA,oBACE;QAAK,SAAS,EAAElB,KAAK,CAACqB,UAAtB;QAAkC,GAAG,EAAEZ,IAAI,CAACK;MAA5C,GACGK,SADH,CADF;IAKD;EACF,CA7BuB,EA6BrBd,aA7BqB,CAAxB;;EA+BA,oBACE,+CACE;IACE,aAAU,kBADZ;IAEE,SAAS,EAAEL,KAAK,CAACsB,OAFnB;IAGE,IAAI,EAAC,OAHP;IAIE,cAAYlB;EAJd,GAMGE,eANH,CADF,CADF;AAYD,CA7CD;;AA+CA,MAAMiB,aAAN,wDACKzB,QAAQ,CAAC0B,SADd;EAEEb,IAAI,EAAEf,SAAS,CAAC6B;AAFlB;AAKAxB,QAAQ,CAACuB,SAAT,2CAAqB;EACnBtB,QAAQ,EAAEN,SAAS,CAAC6B,MADD;EAEnBtB,OAAO,EAAEP,SAAS,CAAC8B,OAAV,CACP9B,SAAS,CAAC+B,SAAV,CAAoB,CAAC/B,SAAS,CAACgC,KAAV,CAAgB9B,QAAQ,CAAC0B,SAAzB,CAAD,EAAsC5B,SAAS,CAACgC,KAAV,CAAgBL,aAAhB,CAAtC,CAApB,CADO,CAFU;EAKnBnB,cAAc,EAAER,SAAS,CAAC6B;AALP,CAArB;AAQA,eAAexB,QAAf"}
|
|
@@ -37,7 +37,6 @@ declare namespace SetupSection {
|
|
|
37
37
|
disabled: PropTypes.Requireable<boolean>;
|
|
38
38
|
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
39
39
|
description: PropTypes.Requireable<string>;
|
|
40
|
-
'aria-labelledby': PropTypes.Requireable<string>;
|
|
41
40
|
modified: PropTypes.Requireable<boolean>;
|
|
42
41
|
titlePosition: PropTypes.Requireable<string>;
|
|
43
42
|
theme: PropTypes.Requireable<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/setup-section/index.js"],"names":[],"mappings":";AAsCA,qEAeC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/setup-section/index.js"],"names":[],"mappings":";AAsCA,qEAeC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA7CD,mFAiBC"}
|
|
@@ -18,7 +18,6 @@ declare namespace SetupSections {
|
|
|
18
18
|
disabled: PropTypes.Requireable<boolean>;
|
|
19
19
|
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
20
20
|
description: PropTypes.Requireable<string>;
|
|
21
|
-
'aria-labelledby': PropTypes.Requireable<string>;
|
|
22
21
|
modified: PropTypes.Requireable<boolean>;
|
|
23
22
|
titlePosition: PropTypes.Requireable<string>;
|
|
24
23
|
theme: PropTypes.Requireable<string>;
|
|
@@ -30,7 +30,6 @@ declare namespace SetupSlide {
|
|
|
30
30
|
disabled: PropTypes.Requireable<boolean>;
|
|
31
31
|
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
32
32
|
description: PropTypes.Requireable<string>;
|
|
33
|
-
'aria-labelledby': PropTypes.Requireable<string>;
|
|
34
33
|
modified: PropTypes.Requireable<boolean>;
|
|
35
34
|
titlePosition: PropTypes.Requireable<string>;
|
|
36
35
|
theme: PropTypes.Requireable<string>;
|
|
@@ -55,10 +54,18 @@ declare namespace SetupSlide {
|
|
|
55
54
|
selected: PropTypes.Requireable<boolean>;
|
|
56
55
|
validOption: PropTypes.Requireable<boolean>;
|
|
57
56
|
}> | null | undefined)[]>;
|
|
57
|
+
optgroups: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
58
|
+
label: PropTypes.Validator<string>;
|
|
59
|
+
options: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
60
|
+
name: PropTypes.Validator<string>;
|
|
61
|
+
value: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
62
|
+
selected: PropTypes.Requireable<boolean>;
|
|
63
|
+
validOption: PropTypes.Requireable<boolean>;
|
|
64
|
+
}> | null | undefined)[]>;
|
|
65
|
+
}> | null | undefined)[]>;
|
|
58
66
|
modified: PropTypes.Requireable<boolean>;
|
|
59
67
|
error: PropTypes.Requireable<boolean>;
|
|
60
68
|
'aria-label': PropTypes.Requireable<string>;
|
|
61
|
-
'aria-labelledby': PropTypes.Requireable<string>;
|
|
62
69
|
}> | PropTypes.InferProps<{
|
|
63
70
|
type: PropTypes.Requireable<string>;
|
|
64
71
|
title: PropTypes.Validator<string>;
|
|
@@ -43,7 +43,6 @@ declare namespace SetupSlider {
|
|
|
43
43
|
disabled: PropTypes.Requireable<boolean>;
|
|
44
44
|
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
45
45
|
description: PropTypes.Requireable<string>;
|
|
46
|
-
'aria-labelledby': PropTypes.Requireable<string>;
|
|
47
46
|
modified: PropTypes.Requireable<boolean>;
|
|
48
47
|
titlePosition: PropTypes.Requireable<string>;
|
|
49
48
|
theme: PropTypes.Requireable<string>;
|
|
@@ -68,10 +67,18 @@ declare namespace SetupSlider {
|
|
|
68
67
|
selected: PropTypes.Requireable<boolean>;
|
|
69
68
|
validOption: PropTypes.Requireable<boolean>;
|
|
70
69
|
}> | null | undefined)[]>;
|
|
70
|
+
optgroups: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
71
|
+
label: PropTypes.Validator<string>;
|
|
72
|
+
options: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
73
|
+
name: PropTypes.Validator<string>;
|
|
74
|
+
value: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
75
|
+
selected: PropTypes.Requireable<boolean>;
|
|
76
|
+
validOption: PropTypes.Requireable<boolean>;
|
|
77
|
+
}> | null | undefined)[]>;
|
|
78
|
+
}> | null | undefined)[]>;
|
|
71
79
|
modified: PropTypes.Requireable<boolean>;
|
|
72
80
|
error: PropTypes.Requireable<boolean>;
|
|
73
81
|
'aria-label': PropTypes.Requireable<string>;
|
|
74
|
-
'aria-labelledby': PropTypes.Requireable<string>;
|
|
75
82
|
}> | PropTypes.InferProps<{
|
|
76
83
|
type: PropTypes.Requireable<string>;
|
|
77
84
|
title: PropTypes.Validator<string>;
|
|
@@ -85,7 +85,6 @@ declare namespace BrandForm {
|
|
|
85
85
|
disabled: PropTypes.Requireable<boolean>;
|
|
86
86
|
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
87
87
|
description: PropTypes.Requireable<string>;
|
|
88
|
-
'aria-labelledby': PropTypes.Requireable<string>;
|
|
89
88
|
modified: PropTypes.Requireable<boolean>;
|
|
90
89
|
titlePosition: PropTypes.Requireable<string>;
|
|
91
90
|
theme: PropTypes.Requireable<string>;
|
|
@@ -127,10 +126,18 @@ declare namespace BrandForm {
|
|
|
127
126
|
selected: PropTypes.Requireable<boolean>;
|
|
128
127
|
validOption: PropTypes.Requireable<boolean>;
|
|
129
128
|
}> | null | undefined)[]>;
|
|
129
|
+
optgroups: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
130
|
+
label: PropTypes.Validator<string>;
|
|
131
|
+
options: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
132
|
+
name: PropTypes.Validator<string>;
|
|
133
|
+
value: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
134
|
+
selected: PropTypes.Requireable<boolean>;
|
|
135
|
+
validOption: PropTypes.Requireable<boolean>;
|
|
136
|
+
}> | null | undefined)[]>;
|
|
137
|
+
}> | null | undefined)[]>;
|
|
130
138
|
modified: PropTypes.Requireable<boolean>;
|
|
131
139
|
error: PropTypes.Requireable<boolean>;
|
|
132
140
|
'aria-label': PropTypes.Requireable<string>;
|
|
133
|
-
'aria-labelledby': PropTypes.Requireable<string>;
|
|
134
141
|
}> | PropTypes.InferProps<{
|
|
135
142
|
type: PropTypes.Requireable<string>;
|
|
136
143
|
title: PropTypes.Validator<string>;
|
|
@@ -208,7 +215,6 @@ declare namespace BrandForm {
|
|
|
208
215
|
disabled: PropTypes.Requireable<boolean>;
|
|
209
216
|
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
210
217
|
description: PropTypes.Requireable<string>;
|
|
211
|
-
'aria-labelledby': PropTypes.Requireable<string>;
|
|
212
218
|
modified: PropTypes.Requireable<boolean>;
|
|
213
219
|
titlePosition: PropTypes.Requireable<string>;
|
|
214
220
|
theme: PropTypes.Requireable<string>;
|
|
@@ -233,10 +239,18 @@ declare namespace BrandForm {
|
|
|
233
239
|
selected: PropTypes.Requireable<boolean>;
|
|
234
240
|
validOption: PropTypes.Requireable<boolean>;
|
|
235
241
|
}> | null | undefined)[]>;
|
|
242
|
+
optgroups: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
243
|
+
label: PropTypes.Validator<string>;
|
|
244
|
+
options: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
245
|
+
name: PropTypes.Validator<string>;
|
|
246
|
+
value: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
247
|
+
selected: PropTypes.Requireable<boolean>;
|
|
248
|
+
validOption: PropTypes.Requireable<boolean>;
|
|
249
|
+
}> | null | undefined)[]>;
|
|
250
|
+
}> | null | undefined)[]>;
|
|
236
251
|
modified: PropTypes.Requireable<boolean>;
|
|
237
252
|
error: PropTypes.Requireable<boolean>;
|
|
238
253
|
'aria-label': PropTypes.Requireable<string>;
|
|
239
|
-
'aria-labelledby': PropTypes.Requireable<string>;
|
|
240
254
|
}> | PropTypes.InferProps<{
|
|
241
255
|
type: PropTypes.Requireable<string>;
|
|
242
256
|
title: PropTypes.Validator<string>;
|
|
@@ -339,7 +353,6 @@ declare namespace BrandForm {
|
|
|
339
353
|
disabled: PropTypes.Requireable<boolean>;
|
|
340
354
|
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
341
355
|
description: PropTypes.Requireable<string>;
|
|
342
|
-
'aria-labelledby': PropTypes.Requireable<string>;
|
|
343
356
|
modified: PropTypes.Requireable<boolean>;
|
|
344
357
|
titlePosition: PropTypes.Requireable<string>;
|
|
345
358
|
theme: PropTypes.Requireable<string>;
|
|
@@ -7,6 +7,7 @@ declare class MoocHeader extends React.Component<any, any, any> {
|
|
|
7
7
|
href: PropTypes.Requireable<string>;
|
|
8
8
|
'aria-label': PropTypes.Requireable<string>;
|
|
9
9
|
'button-aria-label': PropTypes.Requireable<string>;
|
|
10
|
+
toolTipText: PropTypes.Requireable<string>;
|
|
10
11
|
}>>;
|
|
11
12
|
search: PropTypes.Requireable<PropTypes.InferProps<{
|
|
12
13
|
value: PropTypes.Requireable<string>;
|
|
@@ -136,6 +137,7 @@ declare class MoocHeader extends React.Component<any, any, any> {
|
|
|
136
137
|
isSettingsOpen: boolean;
|
|
137
138
|
isMenuOpen: boolean;
|
|
138
139
|
isFocus: boolean;
|
|
140
|
+
isToolTipOpen: boolean;
|
|
139
141
|
};
|
|
140
142
|
handleSettingsToggle(): void;
|
|
141
143
|
handleMenuToggle(): void;
|
|
@@ -148,6 +150,9 @@ declare class MoocHeader extends React.Component<any, any, any> {
|
|
|
148
150
|
handleOnBlur(): void;
|
|
149
151
|
handleOnMenuOpen(): void;
|
|
150
152
|
handleOnMenuClose(): void;
|
|
153
|
+
handleOnMouseOver(): void;
|
|
154
|
+
handleOnMouseLeave(): void;
|
|
155
|
+
handleKeyPress(event: any): void;
|
|
151
156
|
componentDidUpdate(prevProps: any, prevState: any, prevContext: any): void;
|
|
152
157
|
menuSettings: any;
|
|
153
158
|
render(): JSX.Element | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/mooc-header/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/mooc-header/index.js"],"names":[],"mappings":";AAyBA;IACE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA4FE;IAEF;;;;;;;;;;;;;;;;;;;;;;;MAGE;IAEF,wBAuBC;IArBC;;;;;MAKC;IAgDH,6BAIC;IAED,yBAGC;IAxBD,qCAQC;IAED,wBAGC;IAjBD,+BAEC;IA4BD,2BAKC;IAED,0BAKC;IAED,sBAIC;IAED,qBAIC;IAED,yBAQC;IAED,0BAQC;IAED,0BAIC;IAED,2BAIC;IAED,iCAUC;IA7GD,2EASC;IAGC,kBAAsB;IAmGxB,6BAwZC;CACF"}
|