@coorpacademy/components 11.4.5-alpha.37 → 11.4.5-alpha.37.36
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/review-presentation/index.d.ts.map +1 -1
- package/es/atom/review-presentation/index.js +75 -18
- package/es/atom/review-presentation/index.js.map +1 -1
- package/es/atom/review-presentation/prop-types.d.ts +4 -0
- package/es/atom/review-presentation/prop-types.d.ts.map +1 -1
- package/es/atom/review-presentation/prop-types.js +2 -1
- package/es/atom/review-presentation/prop-types.js.map +1 -1
- package/es/atom/review-presentation/style.css +5 -14
- package/es/atom/select/index.d.ts +2 -0
- package/es/atom/select/index.d.ts.map +1 -1
- package/es/atom/select/index.js +26 -10
- package/es/atom/select/index.js.map +1 -1
- package/es/atom/select/style.css +6 -6
- package/es/atom/select/test.html +44 -0
- package/es/molecule/answer/index.d.ts.map +1 -1
- package/es/molecule/answer/index.js +6 -16
- package/es/molecule/answer/index.js.map +1 -1
- package/es/molecule/brand-form-group/index.d.ts +4 -0
- package/es/molecule/filters/filters-wrapper.d.ts +0 -1
- package/es/molecule/filters/filters-wrapper.d.ts.map +1 -1
- package/es/molecule/filters/filters-wrapper.js +5 -9
- package/es/molecule/filters/filters-wrapper.js.map +1 -1
- package/es/molecule/filters/index.d.ts +2 -1
- package/es/molecule/filters/index.d.ts.map +1 -1
- package/es/molecule/filters/index.js +3 -6
- package/es/molecule/filters/index.js.map +1 -1
- package/es/molecule/questions/drop-down/index.d.ts +0 -1
- package/es/molecule/questions/drop-down/index.d.ts.map +1 -1
- package/es/molecule/questions/drop-down/index.js +5 -9
- package/es/molecule/questions/drop-down/index.js.map +1 -1
- package/es/molecule/questions/qcm/index.d.ts +0 -1
- package/es/molecule/questions/qcm/index.d.ts.map +1 -1
- package/es/molecule/questions/qcm/index.js +5 -9
- package/es/molecule/questions/qcm/index.js.map +1 -1
- package/es/molecule/questions/qcm-drag/index.d.ts +1 -3
- package/es/molecule/questions/qcm-drag/index.d.ts.map +1 -1
- package/es/molecule/questions/qcm-drag/index.js +5 -9
- package/es/molecule/questions/qcm-drag/index.js.map +1 -1
- package/es/molecule/questions/qcm-graphic/index.d.ts +0 -1
- package/es/molecule/questions/qcm-graphic/index.d.ts.map +1 -1
- package/es/molecule/questions/qcm-graphic/index.js +5 -9
- package/es/molecule/questions/qcm-graphic/index.js.map +1 -1
- package/es/molecule/questions/question-range/index.d.ts +0 -1
- package/es/molecule/questions/question-range/index.d.ts.map +1 -1
- package/es/molecule/questions/question-range/index.js +6 -10
- package/es/molecule/questions/question-range/index.js.map +1 -1
- package/es/molecule/questions/template/index.d.ts +2 -6
- package/es/molecule/questions/template/index.d.ts.map +1 -1
- package/es/molecule/questions/template/index.js +5 -9
- package/es/molecule/questions/template/index.js.map +1 -1
- package/es/molecule/setup-slide/index.d.ts +2 -0
- package/es/molecule/setup-slider/index.d.ts +2 -0
- package/es/organism/brand-form/index.d.ts +4 -0
- package/es/organism/user-preferences/index.d.ts +0 -1
- package/es/organism/user-preferences/index.d.ts.map +1 -1
- package/es/organism/user-preferences/index.js +5 -9
- package/es/organism/user-preferences/index.js.map +1 -1
- package/es/organism/wizard-contents/index.d.ts +4 -0
- package/es/template/back-office/brand-update/index.d.ts +8 -0
- package/es/template/back-office/brand-update/style.css +2 -2
- package/es/template/common/search-page/index.d.ts +2 -2
- package/es/template/common/search-page/index.d.ts.map +1 -1
- package/es/template/common/search-page/index.js +3 -6
- package/es/template/common/search-page/index.js.map +1 -1
- package/es/template/review-dashboard-skills/index.d.ts +4 -0
- package/lib/atom/review-presentation/index.d.ts.map +1 -1
- package/lib/atom/review-presentation/index.js +79 -18
- package/lib/atom/review-presentation/index.js.map +1 -1
- package/lib/atom/review-presentation/prop-types.d.ts +4 -0
- package/lib/atom/review-presentation/prop-types.d.ts.map +1 -1
- package/lib/atom/review-presentation/prop-types.js +2 -1
- package/lib/atom/review-presentation/prop-types.js.map +1 -1
- package/lib/atom/review-presentation/style.css +5 -14
- package/lib/atom/select/index.d.ts +2 -0
- package/lib/atom/select/index.d.ts.map +1 -1
- package/lib/atom/select/index.js +26 -10
- package/lib/atom/select/index.js.map +1 -1
- package/lib/atom/select/style.css +6 -6
- package/lib/atom/select/test.html +44 -0
- package/lib/molecule/answer/index.d.ts.map +1 -1
- package/lib/molecule/answer/index.js +6 -16
- package/lib/molecule/answer/index.js.map +1 -1
- package/lib/molecule/brand-form-group/index.d.ts +4 -0
- package/lib/molecule/filters/filters-wrapper.d.ts +0 -1
- package/lib/molecule/filters/filters-wrapper.d.ts.map +1 -1
- package/lib/molecule/filters/filters-wrapper.js +5 -9
- package/lib/molecule/filters/filters-wrapper.js.map +1 -1
- package/lib/molecule/filters/index.d.ts +2 -1
- package/lib/molecule/filters/index.d.ts.map +1 -1
- package/lib/molecule/filters/index.js +3 -6
- package/lib/molecule/filters/index.js.map +1 -1
- package/lib/molecule/questions/drop-down/index.d.ts +0 -1
- package/lib/molecule/questions/drop-down/index.d.ts.map +1 -1
- package/lib/molecule/questions/drop-down/index.js +5 -9
- package/lib/molecule/questions/drop-down/index.js.map +1 -1
- package/lib/molecule/questions/qcm/index.d.ts +0 -1
- package/lib/molecule/questions/qcm/index.d.ts.map +1 -1
- package/lib/molecule/questions/qcm/index.js +5 -9
- package/lib/molecule/questions/qcm/index.js.map +1 -1
- package/lib/molecule/questions/qcm-drag/index.d.ts +1 -3
- package/lib/molecule/questions/qcm-drag/index.d.ts.map +1 -1
- package/lib/molecule/questions/qcm-drag/index.js +5 -9
- package/lib/molecule/questions/qcm-drag/index.js.map +1 -1
- package/lib/molecule/questions/qcm-graphic/index.d.ts +0 -1
- package/lib/molecule/questions/qcm-graphic/index.d.ts.map +1 -1
- package/lib/molecule/questions/qcm-graphic/index.js +5 -9
- package/lib/molecule/questions/qcm-graphic/index.js.map +1 -1
- package/lib/molecule/questions/question-range/index.d.ts +0 -1
- package/lib/molecule/questions/question-range/index.d.ts.map +1 -1
- package/lib/molecule/questions/question-range/index.js +6 -10
- package/lib/molecule/questions/question-range/index.js.map +1 -1
- package/lib/molecule/questions/template/index.d.ts +2 -6
- package/lib/molecule/questions/template/index.d.ts.map +1 -1
- package/lib/molecule/questions/template/index.js +5 -9
- package/lib/molecule/questions/template/index.js.map +1 -1
- package/lib/molecule/setup-slide/index.d.ts +2 -0
- package/lib/molecule/setup-slider/index.d.ts +2 -0
- package/lib/organism/brand-form/index.d.ts +4 -0
- package/lib/organism/user-preferences/index.d.ts +0 -1
- package/lib/organism/user-preferences/index.d.ts.map +1 -1
- package/lib/organism/user-preferences/index.js +5 -9
- package/lib/organism/user-preferences/index.js.map +1 -1
- package/lib/organism/wizard-contents/index.d.ts +4 -0
- package/lib/template/back-office/brand-update/index.d.ts +8 -0
- package/lib/template/back-office/brand-update/style.css +2 -2
- package/lib/template/common/search-page/index.d.ts +2 -2
- package/lib/template/common/search-page/index.d.ts.map +1 -1
- package/lib/template/common/search-page/index.js +3 -6
- package/lib/template/common/search-page/index.js.map +1 -1
- package/lib/template/review-dashboard-skills/index.d.ts +4 -0
- package/locales/en/global.json +0 -1
- package/package.json +2 -2
|
@@ -86,8 +86,7 @@ class Filters extends _react.default.Component {
|
|
|
86
86
|
sortTabLabel,
|
|
87
87
|
filters,
|
|
88
88
|
moreFilterAriaLabel,
|
|
89
|
-
moreSortAriaLabel
|
|
90
|
-
filterGroupAriaLabel
|
|
89
|
+
moreSortAriaLabel
|
|
91
90
|
} = this.props;
|
|
92
91
|
const {
|
|
93
92
|
filter,
|
|
@@ -140,8 +139,7 @@ class Filters extends _react.default.Component {
|
|
|
140
139
|
className: filtersActive ? _style.default.activeWrapperFilters : _style.default.wrapperFilters
|
|
141
140
|
}, /*#__PURE__*/_react.default.createElement(_filtersWrapper.default, {
|
|
142
141
|
className: _style.default.wrapper,
|
|
143
|
-
filters: filters
|
|
144
|
-
filterGroupAriaLabel: filterGroupAriaLabel
|
|
142
|
+
filters: filters
|
|
145
143
|
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
146
144
|
"data-name": "cta",
|
|
147
145
|
className: _style.default.CTAfilter,
|
|
@@ -180,8 +178,7 @@ Filters.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
180
178
|
onToggleFilters: _propTypes.default.func,
|
|
181
179
|
onToggleSorts: _propTypes.default.func,
|
|
182
180
|
moreSortAriaLabel: _propTypes.default.string,
|
|
183
|
-
moreFilterAriaLabel: _propTypes.default.string
|
|
184
|
-
filterGroupAriaLabel: _propTypes.default.string
|
|
181
|
+
moreFilterAriaLabel: _propTypes.default.string
|
|
185
182
|
} : {};
|
|
186
183
|
var _default = Filters;
|
|
187
184
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["Filters","React","Component","constructor","props","state","filter","openFilters","sorted","openSorts","handleOpenFilter","bind","handleOpenSort","handleSearch","onToggleFilters","newValue","setState","onToggleSorts","onSearch","render","sorting","filterCTALabel","filterTabLabel","sortCTALabel","sortTabLabel","filters","moreFilterAriaLabel","moreSortAriaLabel","
|
|
1
|
+
{"version":3,"file":"index.js","names":["Filters","React","Component","constructor","props","state","filter","openFilters","sorted","openSorts","handleOpenFilter","bind","handleOpenSort","handleSearch","onToggleFilters","newValue","setState","onToggleSorts","onSearch","render","sorting","filterCTALabel","filterTabLabel","sortCTALabel","sortTabLabel","filters","moreFilterAriaLabel","moreSortAriaLabel","skin","context","defaultColor","darkColor","filtersActive","sortingActive","sortView","undefined","style","select","search","activeDefault","default","title","arrow","activeWrapperSortBy","wrapperSortBy","activeWrapperFilters","wrapperFilters","wrapper","CTAfilter","backgroundColor","activeSorting","contextTypes","Provider","childContextTypes","propTypes","PropTypes","string","bool","FiltersWrapper","shape","Select","func"],"sources":["../../../src/molecule/filters/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {get} from 'lodash/fp';\nimport {NovaCompositionNavigationArrowDown as ArrowDown} from '@coorpacademy/nova-icons';\nimport Select from '../../atom/select';\nimport Provider from '../../atom/provider';\nimport style from './style.css';\nimport FiltersWrapper from './filters-wrapper';\n\nclass Filters extends React.Component {\n static propTypes = {\n filterCTALabel: PropTypes.string,\n filterTabLabel: PropTypes.string,\n sortCTALabel: PropTypes.string,\n sortTabLabel: PropTypes.string,\n openFilters: PropTypes.bool,\n openSorts: PropTypes.bool,\n filters: FiltersWrapper.propTypes.filters,\n sorting: PropTypes.shape(Select.propTypes),\n onSearch: PropTypes.func,\n onToggleFilters: PropTypes.func,\n onToggleSorts: PropTypes.func,\n moreSortAriaLabel: PropTypes.string,\n moreFilterAriaLabel: PropTypes.string\n };\n\n static contextTypes = {\n skin: Provider.childContextTypes.skin\n };\n\n constructor(props) {\n super(props);\n this.state = {\n filter: !!props.openFilters,\n sorted: !!props.openSorts\n };\n this.handleOpenFilter = this.handleOpenFilter.bind(this);\n this.handleOpenSort = this.handleOpenSort.bind(this);\n this.handleSearch = this.handleSearch.bind(this);\n }\n\n handleOpenFilter() {\n const {filter} = this.state;\n const {onToggleFilters} = this.props;\n\n const newValue = !filter;\n\n this.setState({\n filter: newValue,\n sorted: false\n });\n\n if (onToggleFilters) {\n onToggleFilters(newValue);\n }\n }\n\n handleOpenSort() {\n const {sorted} = this.state;\n const {onToggleSorts} = this.props;\n\n const newValue = !sorted;\n\n this.setState({\n sorted: newValue,\n filter: false\n });\n\n if (onToggleSorts) onToggleSorts(newValue);\n }\n\n handleSearch() {\n const {onSearch} = this.props;\n this.setState({\n sorted: false,\n filter: false\n });\n if (onSearch) onSearch();\n }\n\n render() {\n const {\n sorting,\n filterCTALabel,\n filterTabLabel,\n sortCTALabel,\n sortTabLabel,\n filters,\n moreFilterAriaLabel,\n moreSortAriaLabel\n } = this.props;\n const {filter, sorted} = this.state;\n const {skin} = this.context;\n\n const defaultColor = get('common.primary', skin);\n const darkColor = get('common.dark', skin);\n const filtersActive = filter === true;\n const sortingActive = sorted === true;\n\n const sortView =\n sorting !== undefined ? (\n <div data-name=\"choice\" className={style.select}>\n <Select {...sorting} />\n </div>\n ) : null;\n\n return (\n <div data-name=\"search\" className={style.search}>\n <div\n data-name=\"filter\"\n data-open={filtersActive}\n className={filtersActive ? style.activeDefault : style.default}\n >\n <div className={style.title} data-name=\"filterButton\" onClick={this.handleOpenFilter}>\n {filterTabLabel}\n <div className={style.arrow}>\n <ArrowDown color={darkColor} height={14} aria-label={moreFilterAriaLabel} />\n </div>\n </div>\n </div>\n <div\n data-name=\"sortBy\"\n data-open={sortingActive}\n className={sortingActive ? style.activeWrapperSortBy : style.wrapperSortBy}\n >\n <div className={style.title} data-name=\"sortButton\" onClick={this.handleOpenSort}>\n {sortTabLabel}\n <div className={style.arrow}>\n <ArrowDown color={darkColor} height={14} aria-label={moreSortAriaLabel} />\n </div>\n </div>\n </div>\n <div\n data-name=\"filterWrapper\"\n className={filtersActive ? style.activeWrapperFilters : style.wrapperFilters}\n >\n <FiltersWrapper className={style.wrapper} filters={filters} />\n <div\n data-name=\"cta\"\n className={style.CTAfilter}\n style={{\n backgroundColor: defaultColor\n }}\n onClick={this.handleSearch}\n >\n {filterCTALabel}\n </div>\n </div>\n <div\n data-name=\"sortWrapper\"\n className={sortingActive ? style.activeSorting : style.sorting}\n >\n {sortView}\n <div\n data-name=\"cta\"\n className={style.CTAfilter}\n style={{\n backgroundColor: defaultColor\n }}\n onClick={this.handleSearch}\n >\n {sortCTALabel}\n </div>\n </div>\n </div>\n );\n }\n}\n\nexport default Filters;\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,MAAMA,OAAN,SAAsBC,cAAA,CAAMC,SAA5B,CAAsC;EAqBpCC,WAAW,CAACC,KAAD,EAAQ;IACjB,MAAMA,KAAN;IACA,KAAKC,KAAL,GAAa;MACXC,MAAM,EAAE,CAAC,CAACF,KAAK,CAACG,WADL;MAEXC,MAAM,EAAE,CAAC,CAACJ,KAAK,CAACK;IAFL,CAAb;IAIA,KAAKC,gBAAL,GAAwB,KAAKA,gBAAL,CAAsBC,IAA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UM,IATH;EAUjB/C,eAAe,EAAEyC,kBAAA,CAAUM,IAVV;EAWjB5C,aAAa,EAAEsC,kBAAA,CAAUM,IAXR;EAYjBlC,iBAAiB,EAAE4B,kBAAA,CAAUC,MAZZ;EAajB9B,mBAAmB,EAAE6B,kBAAA,CAAUC;AAbd,C;eA+JNxD,O"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/molecule/questions/drop-down/index.js"],"names":[],"mappings":";AAMA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/molecule/questions/drop-down/index.js"],"names":[],"mappings":";AAMA,mDAcC"}
|
|
@@ -24,30 +24,26 @@ const DropDown = props => {
|
|
|
24
24
|
options,
|
|
25
25
|
onChange,
|
|
26
26
|
theme: propsTheme,
|
|
27
|
-
'aria-label': ariaLabel
|
|
28
|
-
groupAriaLabel
|
|
27
|
+
'aria-label': ariaLabel
|
|
29
28
|
} = props;
|
|
30
29
|
const currentSelection = (0, _find2.default)('selected', options);
|
|
31
30
|
const defaultTheme = !currentSelection || currentSelection.validOption === false ? 'invalid' : 'question';
|
|
32
31
|
const theme = propsTheme || defaultTheme;
|
|
33
|
-
return /*#__PURE__*/_react.default.createElement("
|
|
34
|
-
className: _style.default.wrapper
|
|
35
|
-
role: "group",
|
|
36
|
-
"aria-label": groupAriaLabel
|
|
32
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
33
|
+
className: _style.default.wrapper
|
|
37
34
|
}, /*#__PURE__*/_react.default.createElement(_select.default, {
|
|
38
35
|
"aria-label": ariaLabel,
|
|
39
36
|
theme: theme,
|
|
40
37
|
options: options,
|
|
41
38
|
onChange: onChange
|
|
42
|
-
}))
|
|
39
|
+
}));
|
|
43
40
|
};
|
|
44
41
|
|
|
45
42
|
DropDown.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
46
43
|
onChange: _select.default.propTypes.onChange,
|
|
47
44
|
options: _propTypes.default.arrayOf(_propTypes.default.shape(_select.SelectOptionPropTypes)),
|
|
48
45
|
theme: _select.default.propTypes.theme,
|
|
49
|
-
'aria-label': _propTypes.default.string
|
|
50
|
-
groupAriaLabel: _propTypes.default.string
|
|
46
|
+
'aria-label': _propTypes.default.string
|
|
51
47
|
} : {};
|
|
52
48
|
var _default = DropDown;
|
|
53
49
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["DropDown","props","options","onChange","theme","propsTheme","ariaLabel","
|
|
1
|
+
{"version":3,"file":"index.js","names":["DropDown","props","options","onChange","theme","propsTheme","ariaLabel","currentSelection","defaultTheme","validOption","style","wrapper","propTypes","Select","PropTypes","arrayOf","shape","SelectOptionPropTypes","string"],"sources":["../../../../src/molecule/questions/drop-down/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {find} from 'lodash/fp';\nimport Select, {SelectOptionPropTypes} from '../../../atom/select';\nimport style from './style.css';\n\nconst DropDown = props => {\n const {options, onChange, theme: propsTheme, 'aria-label': ariaLabel} = props;\n\n const currentSelection = find('selected', options);\n const defaultTheme =\n !currentSelection || currentSelection.validOption === false ? 'invalid' : 'question';\n\n const theme = propsTheme || defaultTheme;\n\n return (\n <div className={style.wrapper}>\n <Select aria-label={ariaLabel} theme={theme} options={options} onChange={onChange} />\n </div>\n );\n};\n\nDropDown.propTypes = {\n onChange: Select.propTypes.onChange,\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes)),\n theme: Select.propTypes.theme,\n 'aria-label': PropTypes.string\n};\n\nexport default DropDown;\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;;;;;;;AAEA,MAAMA,QAAQ,GAAGC,KAAK,IAAI;EACxB,MAAM;IAACC,OAAD;IAAUC,QAAV;IAAoBC,KAAK,EAAEC,UAA3B;IAAuC,cAAcC;EAArD,IAAkEL,KAAxE;EAEA,MAAMM,gBAAgB,GAAG,oBAAK,UAAL,EAAiBL,OAAjB,CAAzB;EACA,MAAMM,YAAY,GAChB,CAACD,gBAAD,IAAqBA,gBAAgB,CAACE,WAAjB,KAAiC,KAAtD,GAA8D,SAA9D,GAA0E,UAD5E;EAGA,MAAML,KAAK,GAAGC,UAAU,IAAIG,YAA5B;EAEA,oBACE;IAAK,SAAS,EAAEE,cAAA,CAAMC;EAAtB,gBACE,6BAAC,eAAD;IAAQ,cAAYL,SAApB;IAA+B,KAAK,EAAEF,KAAtC;IAA6C,OAAO,EAAEF,OAAtD;IAA+D,QAAQ,EAAEC;EAAzE,EADF,CADF;AAKD,CAdD;;AAgBAH,QAAQ,CAACY,SAAT,2CAAqB;EACnBT,QAAQ,EAAEU,eAAA,CAAOD,SAAP,CAAiBT,QADR;EAEnBD,OAAO,EAAEY,kBAAA,CAAUC,OAAV,CAAkBD,kBAAA,CAAUE,KAAV,CAAgBC,6BAAhB,CAAlB,CAFU;EAGnBb,KAAK,EAAES,eAAA,CAAOD,SAAP,CAAiBR,KAHL;EAInB,cAAcU,kBAAA,CAAUI;AAJL,CAArB;eAOelB,Q"}
|
|
@@ -31,7 +31,6 @@ declare namespace QCM {
|
|
|
31
31
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
32
32
|
'aria-label': PropTypes.Requireable<string>;
|
|
33
33
|
}> | null | undefined)[]>;
|
|
34
|
-
const groupAriaLabel: PropTypes.Requireable<string>;
|
|
35
34
|
}
|
|
36
35
|
}
|
|
37
36
|
import PropTypes from "prop-types";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/molecule/questions/qcm/index.js"],"names":[],"mappings":";AASA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/molecule/questions/qcm/index.js"],"names":[],"mappings":";AASA,kEAiDC"}
|
|
@@ -29,8 +29,7 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
|
29
29
|
|
|
30
30
|
const QCM = (props, legacyContext) => {
|
|
31
31
|
const {
|
|
32
|
-
answers
|
|
33
|
-
groupAriaLabel
|
|
32
|
+
answers
|
|
34
33
|
} = props;
|
|
35
34
|
const longestAnswer = (0, _maxBy.default)(({
|
|
36
35
|
title
|
|
@@ -73,12 +72,10 @@ const QCM = (props, legacyContext) => {
|
|
|
73
72
|
}
|
|
74
73
|
}));
|
|
75
74
|
}), [answers, longestAnswer, primarySkinColor]);
|
|
76
|
-
return /*#__PURE__*/_react.default.createElement("
|
|
75
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
77
76
|
"data-name": "qcm",
|
|
78
|
-
className: _style.default.wrapper
|
|
79
|
-
|
|
80
|
-
"aria-label": groupAriaLabel
|
|
81
|
-
}, answersViews));
|
|
77
|
+
className: _style.default.wrapper
|
|
78
|
+
}, answersViews);
|
|
82
79
|
};
|
|
83
80
|
|
|
84
81
|
QCM.contextTypes = {
|
|
@@ -90,8 +87,7 @@ QCM.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
90
87
|
selected: _propTypes.default.bool,
|
|
91
88
|
onClick: _propTypes.default.func,
|
|
92
89
|
'aria-label': _propTypes.default.string
|
|
93
|
-
}))
|
|
94
|
-
groupAriaLabel: _propTypes.default.string
|
|
90
|
+
}))
|
|
95
91
|
} : {};
|
|
96
92
|
var _default = QCM;
|
|
97
93
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["QCM","props","legacyContext","answers","
|
|
1
|
+
{"version":3,"file":"index.js","names":["QCM","props","legacyContext","answers","longestAnswer","maxBy","title","length","skin","GetSkinFromContext","primarySkinColor","getOr","answersViews","useMemo","map","answer","key","onClick","selected","ariaLabel","longAnswerClass","style","selectedAnswerClass","selectedAnswer","unselectedAnswer","classnames","innerHTML","boxShadow","getShadowBoxColorFromPrimary","backgroundColor","background","answerText","__html","wrapper","contextTypes","Provider","childContextTypes","propTypes","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 {answersViews}\n </div>\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};\n\nexport default QCM;\n"],"mappings":";;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,eAAe,EAAEX,QAAQ,GAAGR,gBAAH,GAAsB;QAAU;;MAA1D,CAFT;MAGE,SAAS,EAAEW,cAAA,CAAMS;IAHnB,EAbF,eAkBE;MACE,aAAU,cADZ;MAEE,SAAS,EAAET,cAAA,CAAMU,UAFnB,CAGE;MAHF;MAIE,uBAAuB,EAAE;QAACC,MAAM,EAAE1B;MAAT;IAJ3B,EAlBF,CADF;EA2BD,CAhCD,CAFiB,EAmCnB,CAACH,OAAD,EAAUC,aAAV,EAAyBM,gBAAzB,CAnCmB,CAArB;EAsCA,oBACE;IAAK,aAAU,KAAf;IAAqB,SAAS,EAAEW,cAAA,CAAMY;EAAtC,GACGrB,YADH,CADF;AAKD,CAjDD;;AAmDAZ,GAAG,CAACkC,YAAJ,GAAmB;EACjB1B,IAAI,EAAE2B,iBAAA,CAASC,iBAAT,CAA2B5B;AADhB,CAAnB;AAIAR,GAAG,CAACqC,SAAJ,2CAAgB;EACdlC,OAAO,EAAEmC,kBAAA,CAAUC,OAAV,CACPD,kBAAA,CAAUE,KAAV,CAAgB;IACdlC,KAAK,EAAEgC,kBAAA,CAAUG,MADH;IAEdvB,QAAQ,EAAEoB,kBAAA,CAAUI,IAFN;IAGdzB,OAAO,EAAEqB,kBAAA,CAAUK,IAHL;IAId,cAAcL,kBAAA,CAAUG;EAJV,CAAhB,CADO;AADK,CAAhB;eAWezC,G"}
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
export default QcmDrag;
|
|
2
|
-
declare function QcmDrag({ answers, help
|
|
2
|
+
declare function QcmDrag({ answers, help }: {
|
|
3
3
|
answers: any;
|
|
4
4
|
help: any;
|
|
5
|
-
groupAriaLabel: any;
|
|
6
5
|
}, legacyContext: any): JSX.Element;
|
|
7
6
|
declare namespace QcmDrag {
|
|
8
7
|
namespace propTypes {
|
|
9
8
|
export { AnswersPropTypes as answers };
|
|
10
9
|
import help = help;
|
|
11
10
|
export { help };
|
|
12
|
-
export const groupAriaLabel: PropTypes.Requireable<string>;
|
|
13
11
|
}
|
|
14
12
|
namespace contextTypes {
|
|
15
13
|
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;;;oCAYC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAtGD;;;;;;0BAQE;AA8BF;;;;gBA4CC;;;;;;;;;;;AAxED;;gBAA6E"}
|
|
@@ -136,15 +136,12 @@ SelectedAnswerSections.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
136
136
|
|
|
137
137
|
const QcmDrag = ({
|
|
138
138
|
answers,
|
|
139
|
-
help
|
|
140
|
-
groupAriaLabel
|
|
139
|
+
help
|
|
141
140
|
}, legacyContext) => {
|
|
142
141
|
const skin = (0, _provider.GetSkinFromContext)(legacyContext);
|
|
143
142
|
const primarySkinColor = (0, _getOr2.default)('#00B0FF', 'common.primary', skin);
|
|
144
|
-
return /*#__PURE__*/_react.default.createElement("
|
|
145
|
-
className: _style.default.wrapper
|
|
146
|
-
role: "group",
|
|
147
|
-
"aria-label": groupAriaLabel
|
|
143
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
144
|
+
className: _style.default.wrapper
|
|
148
145
|
}, /*#__PURE__*/_react.default.createElement(SelectedAnswerSections, {
|
|
149
146
|
answers: answers,
|
|
150
147
|
help: help,
|
|
@@ -154,13 +151,12 @@ const QcmDrag = ({
|
|
|
154
151
|
className: _style.default.answers
|
|
155
152
|
}, /*#__PURE__*/_react.default.createElement(Choices, {
|
|
156
153
|
answers: answers
|
|
157
|
-
})))
|
|
154
|
+
})));
|
|
158
155
|
};
|
|
159
156
|
|
|
160
157
|
QcmDrag.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
161
158
|
answers: AnswersPropTypes,
|
|
162
|
-
help: SelectedAnswerSections.propTypes.help
|
|
163
|
-
groupAriaLabel: _propTypes.default.string
|
|
159
|
+
help: SelectedAnswerSections.propTypes.help
|
|
164
160
|
} : {};
|
|
165
161
|
QcmDrag.contextTypes = {
|
|
166
162
|
skin: _provider.default.childContextTypes.skin
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["AnswersPropTypes","PropTypes","arrayOf","shape","onClick","func","order","number","selected","bool","title","string","help","EmptyView","style","emptySpan","propTypes","Choices","answers","answersViews","map","answer","key","classnames","invisibleAnswer","unselected","innerHTML","__html","choices","SelectedAnswerSections","backgroundColor","selectedAnswers","selectedAnswersViews","boxShadow","getShadowBoxColorFromPrimary","background","content","selectedAnswerText","length","emptyAnswers","QcmDrag","
|
|
1
|
+
{"version":3,"file":"index.js","names":["AnswersPropTypes","PropTypes","arrayOf","shape","onClick","func","order","number","selected","bool","title","string","help","EmptyView","style","emptySpan","propTypes","Choices","answers","answersViews","map","answer","key","classnames","invisibleAnswer","unselected","innerHTML","__html","choices","SelectedAnswerSections","backgroundColor","selectedAnswers","selectedAnswersViews","boxShadow","getShadowBoxColorFromPrimary","background","content","selectedAnswerText","length","emptyAnswers","QcmDrag","legacyContext","skin","GetSkinFromContext","primarySkinColor","wrapper","contextTypes","Provider","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 <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 );\n};\n\nQcmDrag.propTypes = {\n answers: AnswersPropTypes,\n help: SelectedAnswerSections.propTypes.help\n};\n\nQcmDrag.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nexport default QcmDrag;\n"],"mappings":";;;;;;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;;;;;;;AAEA,MAAMA,gBAAN,2CAAyBC,kBAAA,CAAUC,OAAV,CACvBD,kBAAA,CAAUE,KAAV,CAAgB;EACdC,OAAO,EAAEH,kBAAA,CAAUI,IADL;EAEdC,KAAK,EAAEL,kBAAA,CAAUM,MAFH;EAGdC,QAAQ,EAAEP,kBAAA,CAAUQ,IAHN;EAIdC,KAAK,EAAET,kBAAA,CAAUU,MAJH;EAKdC,IAAI,EAAEX,kBAAA,CAAUU;AALF,CAAhB,CADuB,CAAzB;;AAUA,MAAME,SAAS,GAAG,CAAC;EAACD;AAAD,CAAD,kBAAY;EAAM,SAAS,EAAEE,cAAA,CAAMC;AAAvB,GAAmCH,IAAnC,CAA9B;;AAEAC,SAAS,CAACG,SAAV,2CAAsB;EACpBJ,IAAI,EAAEX,kBAAA,CAAUU;AADI,CAAtB;;AAIA,MAAMM,OAAO,GAAG,CAAC;EAACC;AAAD,CAAD,KAAe;EAC7B,MAAMC,YAAY,GAAGD,OAAO,CAACE,GAAR,CAAY,CAACC,MAAD,EAASC,GAAT,KAAiB;IAChD,MAAM;MAAClB,OAAD;MAAUM,KAAV;MAAiBF;IAAjB,IAA6Ba,MAAnC;IACA,oBACE;MACE,SAAS,EAAE,IAAAE,mBAAA,EAAWf,QAAQ,GAAGM,cAAA,CAAMU,eAAT,GAA2BV,cAAA,CAAMW,UAApD,EAAgEX,cAAA,CAAMY,SAAtE,CADb;MAEE,aAAU,QAFZ;MAGE,OAAO,EAAEtB,OAHX;MAIE,GAAG,EAAEkB,GAJP,CAKE;MALF;MAME,uBAAuB,EA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
|
-
{"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,uEAuDC"}
|
|
@@ -27,8 +27,7 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
|
27
27
|
|
|
28
28
|
const QCMImage = (props, legacyContext) => {
|
|
29
29
|
const {
|
|
30
|
-
answers
|
|
31
|
-
groupAriaLabel
|
|
30
|
+
answers
|
|
32
31
|
} = props;
|
|
33
32
|
const skin = (0, _provider.GetSkinFromContext)(legacyContext);
|
|
34
33
|
const primarySkinColor = (0, _getOr2.default)('#00B0FF', 'common.primary', skin);
|
|
@@ -77,12 +76,10 @@ const QCMImage = (props, legacyContext) => {
|
|
|
77
76
|
}
|
|
78
77
|
}))));
|
|
79
78
|
});
|
|
80
|
-
return /*#__PURE__*/_react.default.createElement("
|
|
79
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
81
80
|
"data-name": "qcm-graphic-wrapper",
|
|
82
|
-
className: _style.default.wrapper
|
|
83
|
-
|
|
84
|
-
"aria-label": groupAriaLabel
|
|
85
|
-
}, answersViews));
|
|
81
|
+
className: _style.default.wrapper
|
|
82
|
+
}, answersViews);
|
|
86
83
|
};
|
|
87
84
|
|
|
88
85
|
QCMImage.contextTypes = {
|
|
@@ -95,8 +92,7 @@ QCMImage.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
95
92
|
onClick: _propTypes.default.func,
|
|
96
93
|
image: _propTypes.default.string,
|
|
97
94
|
ariaLabel: _propTypes.default.string
|
|
98
|
-
}))
|
|
99
|
-
groupAriaLabel: _propTypes.default.string
|
|
95
|
+
}))
|
|
100
96
|
} : {};
|
|
101
97
|
var _default = QCMImage;
|
|
102
98
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["QCMImage","props","legacyContext","answers","
|
|
1
|
+
{"version":3,"file":"index.js","names":["QCMImage","props","legacyContext","answers","skin","GetSkinFromContext","primarySkinColor","answersViews","map","answer","key","onClick","title","selected","image","ariaLabel","boxShadow","getShadowBoxColorFromPrimary","style","backgroundColor","background","content","imageWrapper","backgroundImage","titleWrapper","classnames","innerHTML","__html","wrapper","contextTypes","Provider","childContextTypes","propTypes","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 data-name=\"qcm-graphic-wrapper\" className={style.wrapper}>\n {answersViews}\n </div>\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};\n\nexport default QCMImage;\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,QAAQ,GAAG,CAACC,KAAD,EAAQC,aAAR,KAA0B;EACzC,MAAM;IAACC;EAAD,IAAYF,KAAlB;EACA,MAAMG,IAAI,GAAG,IAAAC,4BAAA,EAAmBH,aAAnB,CAAb;EACA,MAAMI,gBAAgB,GAAG,qBAAM,SAAN,EAAiB,gBAAjB,EAAmCF,IAAnC,CAAzB;EAEA,MAAMG,YAAY,GAAGJ,OAAO,CAACK,GAAR,CAAY,CAACC,MAAD,EAASC,GAAT,KAAiB;IAChD,MAAM;MAACC,OAAD;MAAUC,KAAV;MAAiBC,QAAjB;MAA2BC,KAA3B;MAAkCC;IAAlC,IAA+CN,MAArD;IAEA,oBACE;MACE,OAAO,EAAEE,OADX;MAEE,iBAAeE,QAFjB;MAGE,aAAU,eAHZ;MAIE,KAAK,eACCA,QAAQ,IAAI;QACdG,SAAS,EAAG,cAAa,IAAAC,0DAAA,EAA6BX,gBAA7B,CAA+C;MAD1D,CADb,CAJP;MASE,SAAS,EAAEO,QAAQ,GAAGK,cAAA,CAAML,QAAT,GAAoBK,cAAA,CAAMT,MAT/C;MAUE,GAAG,EAAEC;IAVP,gBAYE;MACE,aAAU,kBADZ;MAEE,KAAK,EAAE;QACLS,eAAe,EAAEN,QAAQ,GAAGP,gBAAH,GAAsB;MAD1C,CAFT;MAKE,SAAS,EAAEY,cAAA,CAAME;IALnB,EAZF,eAmBE;MAAK,aAAU,eAAf;MAA+B,SAAS,EAAEF,cAAA,CAAMG;IAAhD,gBACE;MACE,SAAS,EAAEH,cAAA,CAAMI,YADnB;MAEE,aAAU,aAFZ;MAGE,cAAYP,SAAS,IAAIH,KAH3B;MAIE,KAAK,EAAE;QACLW,eAAe,EAAG,OAAMT,KAAM;MADzB;IAJT,EADF,eASE;MAAK,aAAU,YAAf;MAA4B,SAAS,EAAEI,cAAA,CAAMM;IAA7C,gBACE;MACE,KAAK,EAAEZ,KADT;MAEE,SAAS,EAAE,IAAAa,mBAAA,EAAWP,cAAA,CAAMN,KAAjB,EAAwBM,cAAA,CAAMQ,SAA9B,CAFb,CAGE;MAHF;MAIE,uBAAuB,EAAE;QAACC,MAAM,EAAEf;MAAT;IAJ3B,EADF,CATF,CAnBF,CADF;EAwCD,CA3CoB,CAArB;EA6CA,oBACE;IAAK,aAAU,qBAAf;IAAqC,SAAS,EAAEM,cAAA,CAAMU;EAAtD,GACGrB,YADH,CADF;AAKD,CAvDD;;AAyDAP,QAAQ,CAAC6B,YAAT,GAAwB;EACtBzB,IAAI,EAAE0B,iBAAA,CAASC,iBAAT,CAA2B3B;AADX,CAAxB;AAIAJ,QAAQ,CAACgC,SAAT,2CAAqB;EACnB7B,OAAO,EAAE8B,kBAAA,CAAUC,OAAV,CACPD,kBAAA,CAAUE,KAAV,CAAgB;IACdvB,KAAK,EAAEqB,kBAAA,CAAUG,MADH;IAEdvB,QAAQ,EAAEoB,kBAAA,CAAUI,IAFN;IAGd1B,OAAO,EAAEsB,kBAAA,CAAUK,IAHL;IAIdxB,KAAK,EAAEmB,kBAAA,CAAUG,MAJH;IAKdrB,SAAS,EAAEkB,kBAAA,CAAUG;EALP,CAAhB,CADO;AADU,CAArB;eAYepC,Q"}
|
|
@@ -28,7 +28,6 @@ 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>;
|
|
32
31
|
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
33
32
|
onChangeEnd: PropTypes.Requireable<(...args: any[]) => any>;
|
|
34
33
|
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,4EAiCC"}
|
|
@@ -17,7 +17,7 @@ var _range = _interopRequireDefault(require("../../../atom/range"));
|
|
|
17
17
|
|
|
18
18
|
var _style = _interopRequireDefault(require("./style.css"));
|
|
19
19
|
|
|
20
|
-
const _excluded = ["title", "minLabel", "maxLabel"
|
|
20
|
+
const _excluded = ["title", "minLabel", "maxLabel"];
|
|
21
21
|
|
|
22
22
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
23
23
|
|
|
@@ -33,8 +33,7 @@ const QuestionRange = (props, legacyContext) => {
|
|
|
33
33
|
const {
|
|
34
34
|
title,
|
|
35
35
|
minLabel,
|
|
36
|
-
maxLabel
|
|
37
|
-
groupAriaLabel
|
|
36
|
+
maxLabel
|
|
38
37
|
} = props,
|
|
39
38
|
rangeProps = _objectWithoutPropertiesLoose(props, _excluded);
|
|
40
39
|
|
|
@@ -43,10 +42,8 @@ const QuestionRange = (props, legacyContext) => {
|
|
|
43
42
|
const titleStyle = {
|
|
44
43
|
color: defaultColor
|
|
45
44
|
};
|
|
46
|
-
return /*#__PURE__*/_react.default.createElement("
|
|
47
|
-
className: _style.default.wrapper
|
|
48
|
-
role: "group",
|
|
49
|
-
"aria-label": groupAriaLabel
|
|
45
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
46
|
+
className: _style.default.wrapper
|
|
50
47
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
51
48
|
style: titleStyle,
|
|
52
49
|
className: (0, _classnames.default)(_style.default.title, _style.default.innerHTML) // eslint-disable-next-line react/no-danger
|
|
@@ -68,7 +65,7 @@ const QuestionRange = (props, legacyContext) => {
|
|
|
68
65
|
dangerouslySetInnerHTML: {
|
|
69
66
|
__html: maxLabel
|
|
70
67
|
}
|
|
71
|
-
})))
|
|
68
|
+
})));
|
|
72
69
|
};
|
|
73
70
|
|
|
74
71
|
QuestionRange.contextTypes = {
|
|
@@ -77,8 +74,7 @@ QuestionRange.contextTypes = {
|
|
|
77
74
|
QuestionRange.propTypes = process.env.NODE_ENV !== "production" ? _extends({}, _range.default.propTypes, {
|
|
78
75
|
title: _propTypes.default.string,
|
|
79
76
|
minLabel: _propTypes.default.string,
|
|
80
|
-
maxLabel: _propTypes.default.string
|
|
81
|
-
groupAriaLabel: _propTypes.default.string
|
|
77
|
+
maxLabel: _propTypes.default.string
|
|
82
78
|
}) : {};
|
|
83
79
|
var _default = QuestionRange;
|
|
84
80
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["QuestionRange","props","legacyContext","title","minLabel","maxLabel","
|
|
1
|
+
{"version":3,"file":"index.js","names":["QuestionRange","props","legacyContext","title","minLabel","maxLabel","rangeProps","skin","GetSkinFromContext","defaultColor","titleStyle","color","style","wrapper","classnames","innerHTML","__html","labelWrapper","label","contextTypes","Provider","childContextTypes","propTypes","Range","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 <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 );\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};\n\nexport default QuestionRange;\n"],"mappings":";;;;;;;AAAA;;AAEA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;AAEA,MAAMA,aAAa,GAAG,CAACC,KAAD,EAAQC,aAAR,KAA0B;EAC9C,MAAM;IAACC,KAAD;IAAQC,QAAR;IAAkBC;EAAlB,IAA6CJ,KAAnD;EAAA,MAAqCK,UAArC,iCAAmDL,KAAnD;;EAEA,MAAMM,IAAI,GAAG,IAAAC,4BAAA,EAAmBN,aAAnB,CAAb;EACA,MAAMO,YAAY,GAAG,qBAAM,SAAN,EAAiB,gBAAjB,EAAmCF,IAAnC,CAArB;EAEA,MAAMG,UAAU,GAAG;IACjBC,KAAK,EAAEF;EADU,CAAnB;EAIA,oBACE;IAAK,SAAS,EAAEG,cAAA,CAAMC;EAAtB,gBACE;IACE,KAAK,EAAEH,UADT;IAEE,SAAS,EAAE,IAAAI,mBAAA,EAAWF,cAAA,CAAMT,KAAjB,EAAwBS,cAAA,CAAMG,SAA9B,CAFb,CAGE;IAHF;IAIE,uBAAuB,EAAE;MAACC,MAAM,EAAEb;IAAT;EAJ3B,EADF,eAOE,6BAAC,cAAD,EAAWG,UAAX,CAPF,eAQE;IAAK,SAAS,EAAEM,cAAA,CAAMK;EAAtB,gBACE;IACE,SAAS,EAAE,IAAAH,mBAAA,EAAWF,cAAA,CAAMM,KAAjB,EAAwBN,cAAA,CAAMG,SAA9B,CADb,CAEE;IAFF;IAGE,uBAAuB,EAAE;MAACC,MAAM,EAAEZ;IAAT;EAH3B,EADF,eAME;IACE,SAAS,EAAE,IAAAU,mBAAA,EAAWF,cAAA,CAAMM,KAAjB,EAAwBN,cAAA,CAAMG,SAA9B,CADb,CAEE;IAFF;IAGE,uBAAuB,EAAE;MAACC,MAAM,EAAEX;IAAT;EAH3B,EANF,CARF,CADF;AAuBD,CAjCD;;AAmCAL,aAAa,CAACmB,YAAd,GAA6B;EAC3BZ,IAAI,EAAEa,iBAAA,CAASC,iBAAT,CAA2Bd;AADN,CAA7B;AAIAP,aAAa,CAACsB,SAAd,wDACKC,cAAA,CAAMD,SADX;EAEEnB,KAAK,EAAEqB,kBAAA,CAAUC,MAFnB;EAGErB,QAAQ,EAAEoB,kBAAA,CAAUC,MAHtB;EAIEpB,QAAQ,EAAEmB,kBAAA,CAAUC;AAJtB;eAOezB,a"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
export default Template;
|
|
2
|
-
declare function Template({ template, answers
|
|
2
|
+
declare function Template({ template, answers }: {
|
|
3
3
|
template: any;
|
|
4
4
|
answers: any;
|
|
5
|
-
groupAriaLabel: any;
|
|
6
5
|
}): JSX.Element;
|
|
7
6
|
declare namespace Template {
|
|
8
7
|
namespace propTypes {
|
|
@@ -17,7 +16,6 @@ declare namespace Template {
|
|
|
17
16
|
}> | null | undefined)[]>;
|
|
18
17
|
theme: PropTypes.Requireable<string>;
|
|
19
18
|
'aria-label': PropTypes.Requireable<string>;
|
|
20
|
-
groupAriaLabel: PropTypes.Requireable<string>;
|
|
21
19
|
}, never>> & Partial<PropTypes.InferPropsInner<Pick<{
|
|
22
20
|
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
23
21
|
options: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
@@ -28,9 +26,7 @@ declare namespace Template {
|
|
|
28
26
|
}> | null | undefined)[]>;
|
|
29
27
|
theme: PropTypes.Requireable<string>;
|
|
30
28
|
'aria-label': PropTypes.Requireable<string>;
|
|
31
|
-
|
|
32
|
-
}, "aria-label" | "onChange" | "theme" | "options" | "groupAriaLabel">>>) | null | undefined)[]>;
|
|
33
|
-
const groupAriaLabel: PropTypes.Requireable<string>;
|
|
29
|
+
}, "aria-label" | "onChange" | "theme" | "options">>>) | null | undefined)[]>;
|
|
34
30
|
}
|
|
35
31
|
}
|
|
36
32
|
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;;;gBAsCC"}
|
|
@@ -29,8 +29,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
29
29
|
|
|
30
30
|
const Template = ({
|
|
31
31
|
template,
|
|
32
|
-
answers
|
|
33
|
-
groupAriaLabel
|
|
32
|
+
answers
|
|
34
33
|
}) => {
|
|
35
34
|
const totalTemplate = (0, _parseTemplateString.default)(template);
|
|
36
35
|
|
|
@@ -73,12 +72,10 @@ const Template = ({
|
|
|
73
72
|
}
|
|
74
73
|
}, totalTemplate);
|
|
75
74
|
|
|
76
|
-
return /*#__PURE__*/_react.default.createElement("
|
|
75
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
77
76
|
"data-name": "template-wrapper",
|
|
78
|
-
className: _style.default.wrapper
|
|
79
|
-
|
|
80
|
-
"aria-label": groupAriaLabel
|
|
81
|
-
}, templateCompose));
|
|
77
|
+
className: _style.default.wrapper
|
|
78
|
+
}, templateCompose);
|
|
82
79
|
};
|
|
83
80
|
|
|
84
81
|
const TextPropTypes = process.env.NODE_ENV !== "production" ? _extends({}, _dropDown.default.propTypes, {
|
|
@@ -86,8 +83,7 @@ const TextPropTypes = process.env.NODE_ENV !== "production" ? _extends({}, _drop
|
|
|
86
83
|
}) : {};
|
|
87
84
|
Template.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
88
85
|
template: _propTypes.default.string,
|
|
89
|
-
answers: _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.shape(_dropDown.default.propTypes), _propTypes.default.shape(TextPropTypes)]))
|
|
90
|
-
groupAriaLabel: _propTypes.default.string
|
|
86
|
+
answers: _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.shape(_dropDown.default.propTypes), _propTypes.default.shape(TextPropTypes)]))
|
|
91
87
|
} : {};
|
|
92
88
|
var _default = Template;
|
|
93
89
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["Template","template","answers","
|
|
1
|
+
{"version":3,"file":"index.js","names":["Template","template","answers","totalTemplate","parseTemplateString","templateCompose","convert","cap","part","key","type","style","textPart","__html","value","field","name","fieldType","fieldProps","fieldView","text","answerType","wrapper","TextPropTypes","DropDown","propTypes","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 data-name=\"template-wrapper\" className={style.wrapper}>\n {templateCompose}\n </div>\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};\n\nexport default Template;\n"],"mappings":";;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,QAAQ,GAAG,CAAC;EAACC,QAAD;EAAWC;AAAX,CAAD,KAAyB;EACxC,MAAMC,aAAa,GAAG,IAAAC,4BAAA,EAAoBH,QAApB,CAAtB;;EACA,MAAMI,eAAe,GAAG,cAAIC,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,EAAEE,cAAA,CAAMC,QAFnB,CAGE;QAHF;QAIE,uBAAuB,EAAE;UAACC,MAAM,EAAEL,IAAI,CAACM;QAAd;MAJ3B,EADF;IAQD;;IACD,IAAIJ,IAAI,KAAK,aAAb,EAA4B;MAC1B,MAAMK,KAAK,GAAG,oBAAK;QAACC,IAAI,EAAER,IAAI,CAACM;MAAZ,CAAL,EAAyBZ,OAAzB,CAAd;MACA,IAAI,CAACa,KAAL,EAAY,OAAO,IAAP;;MACZ,MAAM;QAACL,IAAI,EAAEO;MAAP,IAAmCF,KAAzC;MAAA,MAA2BG,UAA3B,iCAAyCH,KAAzC;;MACA,MAAMI,SAAS,GACbF,SAAS,KAAK,MAAd,gBACE,6BAAC,iBAAD,eAAcC,UAAd;QAA0B,SAAS,EAAEP,cAAA,CAAMS;MAA3C,GADF,gBAGE,6BAAC,iBAAD,eAAcF,UAAd;QAA0B,KAAK,EAAC;MAAhC,GAJJ;MAOA,oBACE;QAAK,SAAS,EAAEP,cAAA,CAAMU,UAAtB;QAAkC,GAAG,EAAEb,IAAI,CAACM;MAA5C,GACGK,SADH,CADF;IAKD;EACF,CA7BuB,EA6BrBhB,aA7BqB,CAAxB;;EA+BA,oBACE;IAAK,aAAU,kBAAf;IAAkC,SAAS,EAAEQ,cAAA,CAAMW;EAAnD,GACGjB,eADH,CADF;AAKD,CAtCD;;AAwCA,MAAMkB,aAAN,wDACKC,iBAAA,CAASC,SADd;EAEEf,IAAI,EAAEgB,kBAAA,CAAUC;AAFlB;AAKA3B,QAAQ,CAACyB,SAAT,2CAAqB;EACnBxB,QAAQ,EAAEyB,kBAAA,CAAUC,MADD;EAEnBzB,OAAO,EAAEwB,kBAAA,CAAUE,OAAV,CACPF,kBAAA,CAAUG,SAAV,CAAoB,CAACH,kBAAA,CAAUI,KAAV,CAAgBN,iBAAA,CAASC,SAAzB,CAAD,EAAsCC,kBAAA,CAAUI,KAAV,CAAgBP,aAAhB,CAAtC,CAApB,CADO;AAFU,CAArB;eAOevB,Q"}
|
|
@@ -57,6 +57,8 @@ declare namespace SetupSlide {
|
|
|
57
57
|
modified: PropTypes.Requireable<boolean>;
|
|
58
58
|
error: PropTypes.Requireable<boolean>;
|
|
59
59
|
'aria-label': PropTypes.Requireable<string>;
|
|
60
|
+
selectId: PropTypes.Requireable<string>;
|
|
61
|
+
titleClassName: PropTypes.Requireable<string>;
|
|
60
62
|
}> | PropTypes.InferProps<{
|
|
61
63
|
type: PropTypes.Requireable<string>;
|
|
62
64
|
title: PropTypes.Validator<string>;
|