@coorpacademy/components 11.4.5-alpha.36 → 11.4.5-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/atom/provider/index.d.ts +1 -0
- package/es/atom/provider/index.d.ts.map +1 -1
- package/es/atom/provider/index.js +11 -1
- package/es/atom/provider/index.js.map +1 -1
- package/es/atom/provider/web-context.d.ts +1 -1
- package/es/atom/provider/web-context.d.ts.map +1 -1
- package/es/atom/provider/web-context.js +2 -1
- package/es/atom/provider/web-context.js.map +1 -1
- package/es/atom/review-header-step-item/index.d.ts.map +1 -1
- package/es/atom/review-header-step-item/index.js +24 -6
- package/es/atom/review-header-step-item/index.js.map +1 -1
- package/es/globals.d.js.map +1 -1
- package/es/molecule/add-to-my-list/index.js +1 -3
- package/es/molecule/add-to-my-list/index.js.map +1 -1
- 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/card/notification.js +1 -3
- package/es/molecule/card/notification.js.map +1 -1
- 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 +0 -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/forum/forum-post/index.d.ts.map +1 -1
- package/es/molecule/forum/forum-post/index.js +1 -2
- package/es/molecule/forum/forum-post/index.js.map +1 -1
- package/es/molecule/questions/drop-down/index.d.ts +0 -1
- package/es/molecule/questions/drop-down/index.js +3 -7
- 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.js +3 -7
- 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 +3 -7
- 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 +3 -7
- 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.js +4 -8
- 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 +3 -7
- package/es/molecule/questions/template/index.js.map +1 -1
- package/es/molecule/share/index.d.ts.map +1 -1
- package/es/molecule/share/index.js +1 -5
- package/es/molecule/share/index.js.map +1 -1
- package/es/organism/user-preferences/index.d.ts +0 -1
- package/es/organism/user-preferences/index.js +3 -7
- package/es/organism/user-preferences/index.js.map +1 -1
- package/es/template/app-review/template-context.d.ts +1 -1
- package/es/template/app-review/template-context.d.ts.map +1 -1
- package/es/template/app-review/template-context.js +2 -1
- package/es/template/app-review/template-context.js.map +1 -1
- package/es/template/common/search-page/index.d.ts +0 -2
- package/es/template/common/search-page/index.d.ts.map +1 -1
- package/es/template/common/search-page/index.js +4 -8
- package/es/template/common/search-page/index.js.map +1 -1
- package/lib/atom/provider/index.d.ts +1 -0
- package/lib/atom/provider/index.d.ts.map +1 -1
- package/lib/atom/provider/index.js +10 -1
- package/lib/atom/provider/index.js.map +1 -1
- package/lib/atom/provider/web-context.d.ts +1 -1
- package/lib/atom/provider/web-context.d.ts.map +1 -1
- package/lib/atom/provider/web-context.js +3 -1
- package/lib/atom/provider/web-context.js.map +1 -1
- package/lib/atom/review-header-step-item/index.d.ts.map +1 -1
- package/lib/atom/review-header-step-item/index.js +25 -6
- package/lib/atom/review-header-step-item/index.js.map +1 -1
- package/lib/globals.d.js.map +1 -1
- package/lib/molecule/add-to-my-list/index.js +1 -3
- package/lib/molecule/add-to-my-list/index.js.map +1 -1
- 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/card/notification.js +1 -3
- package/lib/molecule/card/notification.js.map +1 -1
- 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 +0 -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/forum/forum-post/index.d.ts.map +1 -1
- package/lib/molecule/forum/forum-post/index.js +1 -2
- package/lib/molecule/forum/forum-post/index.js.map +1 -1
- package/lib/molecule/questions/drop-down/index.d.ts +0 -1
- package/lib/molecule/questions/drop-down/index.js +3 -7
- 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.js +3 -7
- 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 +3 -7
- 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 +3 -7
- 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.js +4 -8
- 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 +3 -7
- package/lib/molecule/questions/template/index.js.map +1 -1
- package/lib/molecule/share/index.d.ts.map +1 -1
- package/lib/molecule/share/index.js +1 -5
- package/lib/molecule/share/index.js.map +1 -1
- package/lib/organism/user-preferences/index.d.ts +0 -1
- package/lib/organism/user-preferences/index.js +3 -7
- package/lib/organism/user-preferences/index.js.map +1 -1
- package/lib/template/app-review/template-context.d.ts +1 -1
- package/lib/template/app-review/template-context.d.ts.map +1 -1
- package/lib/template/app-review/template-context.js +3 -1
- package/lib/template/app-review/template-context.js.map +1 -1
- package/lib/template/common/search-page/index.d.ts +0 -2
- package/lib/template/common/search-page/index.d.ts.map +1 -1
- package/lib/template/common/search-page/index.js +4 -8
- package/lib/template/common/search-page/index.js.map +1 -1
- package/locales/en/global.json +5 -3
- package/locales/fr/global.json +1 -6
- package/locales/ru/global.json +1 -6
- package/package.json +2 -2
|
@@ -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
|
|
|
@@ -75,9 +74,7 @@ const Template = ({
|
|
|
75
74
|
|
|
76
75
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
77
76
|
"data-name": "template-wrapper",
|
|
78
|
-
className: _style.default.wrapper
|
|
79
|
-
role: "group",
|
|
80
|
-
"aria-label": groupAriaLabel
|
|
77
|
+
className: _style.default.wrapper
|
|
81
78
|
}, templateCompose);
|
|
82
79
|
};
|
|
83
80
|
|
|
@@ -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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/share/index.js"],"names":[],"mappings":"AAkDO;;gBAcN;;;;;;AAEM;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/share/index.js"],"names":[],"mappings":"AAkDO;;gBAcN;;;;;;AAEM;;;uBAgBN;;;;;;;;;;AAED;;;;gBA8BC"}
|
|
@@ -95,11 +95,7 @@ const ShareFeedback = ({
|
|
|
95
95
|
className: _style.default.checkIcon,
|
|
96
96
|
width: 13,
|
|
97
97
|
height: 13
|
|
98
|
-
}),
|
|
99
|
-
role: "status"
|
|
100
|
-
}, successWording) : /*#__PURE__*/_react.default.createElement("p", {
|
|
101
|
-
role: "alert"
|
|
102
|
-
}, errorWording));
|
|
98
|
+
}), /*#__PURE__*/_react.default.createElement("p", null, status === SHARE_STATUS.SUCCESS ? successWording : errorWording));
|
|
103
99
|
};
|
|
104
100
|
|
|
105
101
|
exports.ShareFeedback = ShareFeedback;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["SHARE_STATUS","IDLE","ERROR","SUCCESS","copyTextViaExecCommand","text","textarea","document","createElement","style","border","padding","visibility","position","setAttribute","value","body","appendChild","status","select","setSelectionRange","length","execCommand","error","removeChild","StatusContext","React","createContext","ShareStatusProvider","children","setStatus","useState","useEffect","timeoutId","DURATION","setTimeout","clearTimeout","useMemo","ShareFeedback","successWording","errorWording","useContext","classnames","styles","feedback","errorFeedback","checkIcon","Share","wording","onClick","useCallback","browserSupportsClipboardWriteText","navigator","clipboard","writeText","copyStatus","container","cta","wrapper","shareIcon","propTypes","PropTypes","node","string"],"sources":["../../../src/molecule/share/index.js"],"sourcesContent":["import React, {useState, useMemo, useCallback, useContext, useEffect} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {\n NovaCompositionCoorpacademyCheck as CheckIcon,\n NovaCompositionCoorpacademyShare as ShareIcon,\n NovaCompositionCoorpacademyAttention as AttentionIcon\n} from '@coorpacademy/nova-icons';\nimport Link from '../../atom/link';\nimport styles from './style.css';\n\nconst SHARE_STATUS = {\n IDLE: 'IDLE',\n ERROR: 'ERROR',\n SUCCESS: 'SUCCESS'\n};\n\nconst copyTextViaExecCommand = text => {\n const textarea = document.createElement('textarea');\n\n textarea.style.border = '0';\n textarea.style.padding = '0';\n textarea.style.visibility = 'hidden';\n textarea.style.position = 'absolute';\n textarea.setAttribute('readonly', '');\n textarea.value = text;\n\n // Element.append is not supported on IE11 :/\n // eslint-disable-next-line unicorn/prefer-node-append\n document.body.appendChild(textarea);\n let status = SHARE_STATUS.IDLE;\n\n try {\n textarea.select();\n textarea.setSelectionRange(0, textarea.value.length);\n document.execCommand('copy');\n status = SHARE_STATUS.SUCCESS;\n } catch (error) {\n status = SHARE_STATUS.ERROR;\n }\n\n // Element.remove is not supported on IE11 :/\n // eslint-disable-next-line unicorn/prefer-node-remove\n document.body.removeChild(textarea);\n\n return status;\n};\n\nconst StatusContext = React.createContext(SHARE_STATUS.IDLE);\n\nexport const ShareStatusProvider = ({children}) => {\n const [status, setStatus] = useState(SHARE_STATUS.IDLE);\n useEffect(() => {\n let timeoutId;\n const DURATION = 3000;\n if (status !== SHARE_STATUS.IDLE) {\n timeoutId = setTimeout(() => setStatus(SHARE_STATUS.IDLE), DURATION);\n }\n return () => clearTimeout(timeoutId);\n }, [status]);\n\n const value = useMemo(() => [status, setStatus], [status]);\n\n return <StatusContext.Provider value={value}>{children}</StatusContext.Provider>;\n};\n\nexport const ShareFeedback = ({successWording, errorWording}) => {\n const [status] = useContext(StatusContext);\n if (status === SHARE_STATUS.IDLE) return null;\n\n return (\n <div\n className={classnames(styles.feedback, status === SHARE_STATUS.ERROR && styles.errorFeedback)}\n >\n {status === SHARE_STATUS.SUCCESS ? (\n <CheckIcon className={styles.checkIcon} width={13} height={13} />\n ) : (\n <AttentionIcon className={styles.checkIcon} width={13} height={13} />\n )}\n {status === SHARE_STATUS.SUCCESS ?
|
|
1
|
+
{"version":3,"file":"index.js","names":["SHARE_STATUS","IDLE","ERROR","SUCCESS","copyTextViaExecCommand","text","textarea","document","createElement","style","border","padding","visibility","position","setAttribute","value","body","appendChild","status","select","setSelectionRange","length","execCommand","error","removeChild","StatusContext","React","createContext","ShareStatusProvider","children","setStatus","useState","useEffect","timeoutId","DURATION","setTimeout","clearTimeout","useMemo","ShareFeedback","successWording","errorWording","useContext","classnames","styles","feedback","errorFeedback","checkIcon","Share","wording","onClick","useCallback","browserSupportsClipboardWriteText","navigator","clipboard","writeText","copyStatus","container","cta","wrapper","shareIcon","propTypes","PropTypes","node","string"],"sources":["../../../src/molecule/share/index.js"],"sourcesContent":["import React, {useState, useMemo, useCallback, useContext, useEffect} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {\n NovaCompositionCoorpacademyCheck as CheckIcon,\n NovaCompositionCoorpacademyShare as ShareIcon,\n NovaCompositionCoorpacademyAttention as AttentionIcon\n} from '@coorpacademy/nova-icons';\nimport Link from '../../atom/link';\nimport styles from './style.css';\n\nconst SHARE_STATUS = {\n IDLE: 'IDLE',\n ERROR: 'ERROR',\n SUCCESS: 'SUCCESS'\n};\n\nconst copyTextViaExecCommand = text => {\n const textarea = document.createElement('textarea');\n\n textarea.style.border = '0';\n textarea.style.padding = '0';\n textarea.style.visibility = 'hidden';\n textarea.style.position = 'absolute';\n textarea.setAttribute('readonly', '');\n textarea.value = text;\n\n // Element.append is not supported on IE11 :/\n // eslint-disable-next-line unicorn/prefer-node-append\n document.body.appendChild(textarea);\n let status = SHARE_STATUS.IDLE;\n\n try {\n textarea.select();\n textarea.setSelectionRange(0, textarea.value.length);\n document.execCommand('copy');\n status = SHARE_STATUS.SUCCESS;\n } catch (error) {\n status = SHARE_STATUS.ERROR;\n }\n\n // Element.remove is not supported on IE11 :/\n // eslint-disable-next-line unicorn/prefer-node-remove\n document.body.removeChild(textarea);\n\n return status;\n};\n\nconst StatusContext = React.createContext(SHARE_STATUS.IDLE);\n\nexport const ShareStatusProvider = ({children}) => {\n const [status, setStatus] = useState(SHARE_STATUS.IDLE);\n useEffect(() => {\n let timeoutId;\n const DURATION = 3000;\n if (status !== SHARE_STATUS.IDLE) {\n timeoutId = setTimeout(() => setStatus(SHARE_STATUS.IDLE), DURATION);\n }\n return () => clearTimeout(timeoutId);\n }, [status]);\n\n const value = useMemo(() => [status, setStatus], [status]);\n\n return <StatusContext.Provider value={value}>{children}</StatusContext.Provider>;\n};\n\nexport const ShareFeedback = ({successWording, errorWording}) => {\n const [status] = useContext(StatusContext);\n if (status === SHARE_STATUS.IDLE) return null;\n\n return (\n <div\n className={classnames(styles.feedback, status === SHARE_STATUS.ERROR && styles.errorFeedback)}\n >\n {status === SHARE_STATUS.SUCCESS ? (\n <CheckIcon className={styles.checkIcon} width={13} height={13} />\n ) : (\n <AttentionIcon className={styles.checkIcon} width={13} height={13} />\n )}\n <p>{status === SHARE_STATUS.SUCCESS ? successWording : errorWording}</p>\n </div>\n );\n};\n\nconst Share = ({style, text, wording}) => {\n const [, setStatus] = useContext(StatusContext);\n const onClick = useCallback(async () => {\n const browserSupportsClipboardWriteText =\n 'clipboard' in navigator && 'writeText' in navigator.clipboard;\n if (browserSupportsClipboardWriteText) {\n try {\n await navigator.clipboard.writeText(text);\n setStatus(SHARE_STATUS.SUCCESS);\n } catch (error) {\n setStatus(SHARE_STATUS.ERROR);\n }\n return;\n } else {\n const copyStatus = copyTextViaExecCommand(text);\n setStatus(copyStatus);\n }\n return;\n }, [setStatus, text]);\n\n return (\n <div className={(styles.container, style)}>\n <Link onClick={onClick} className={styles.cta} data-name={'share-button'}>\n <div className={styles.wrapper}>\n <ShareIcon className={styles.shareIcon} width={18} height={18} />\n <p>{wording}</p>\n </div>\n </Link>\n </div>\n );\n};\n\nShareStatusProvider.propTypes = {\n children: PropTypes.node\n};\n\nShareFeedback.propTypes = {\n successWording: PropTypes.string,\n errorWording: PropTypes.string\n};\n\nShare.propTypes = {\n style: PropTypes.string,\n text: PropTypes.string,\n wording: PropTypes.string\n};\n\nexport default Share;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AAKA;;AACA;;;;;;;;AAEA,MAAMA,YAAY,GAAG;EACnBC,IAAI,EAAE,MADa;EAEnBC,KAAK,EAAE,OAFY;EAGnBC,OAAO,EAAE;AAHU,CAArB;;AAMA,MAAMC,sBAAsB,GAAGC,IAAI,IAAI;EACrC,MAAMC,QAAQ,GAAGC,QAAQ,CAACC,aAAT,CAAuB,UAAvB,CAAjB;EAEAF,QAAQ,CAACG,KAAT,CAAeC,MAAf,GAAwB,GAAxB;EACAJ,QAAQ,CAACG,KAAT,CAAeE,OAAf,GAAyB,GAAzB;EACAL,QAAQ,CAACG,KAAT,CAAeG,UAAf,GAA4B,QAA5B;EACAN,QAAQ,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@@ -19,7 +19,6 @@ declare namespace UserPreferences {
|
|
|
19
19
|
requiredSelection: PropTypes.Requireable<boolean>;
|
|
20
20
|
}> | null | undefined)[]>;
|
|
21
21
|
const moreInfoAriaLabel: PropTypes.Requireable<string>;
|
|
22
|
-
const groupAriaLabel: PropTypes.Requireable<string>;
|
|
23
22
|
}
|
|
24
23
|
}
|
|
25
24
|
import PropTypes from "prop-types";
|
|
@@ -59,13 +59,10 @@ Settings.propTypes = process.env.NODE_ENV !== "production" ? _extends({}, _input
|
|
|
59
59
|
const UserPreferences = props => {
|
|
60
60
|
const {
|
|
61
61
|
preferences = [],
|
|
62
|
-
moreInfoAriaLabel
|
|
63
|
-
groupAriaLabel
|
|
62
|
+
moreInfoAriaLabel
|
|
64
63
|
} = props;
|
|
65
64
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
66
|
-
className: _style.default.preferences
|
|
67
|
-
role: "group",
|
|
68
|
-
"aria-label": groupAriaLabel
|
|
65
|
+
className: _style.default.preferences
|
|
69
66
|
}, (0, _map2.default)(settings => /*#__PURE__*/_react.default.createElement(Settings, _extends({}, settings, {
|
|
70
67
|
key: settings.label,
|
|
71
68
|
moreInfoAriaLabel: moreInfoAriaLabel
|
|
@@ -74,8 +71,7 @@ const UserPreferences = props => {
|
|
|
74
71
|
|
|
75
72
|
UserPreferences.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
76
73
|
preferences: _propTypes.default.arrayOf(_propTypes.default.shape(Settings.propTypes)),
|
|
77
|
-
moreInfoAriaLabel: _propTypes.default.string
|
|
78
|
-
groupAriaLabel: _propTypes.default.string
|
|
74
|
+
moreInfoAriaLabel: _propTypes.default.string
|
|
79
75
|
} : {};
|
|
80
76
|
var _default = UserPreferences;
|
|
81
77
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["Settings","props","label","description","moreInfoAriaLabel","settings","style","infoIconWrapper","infoIcon","showToolTip","descriptionLabel","propTypes","InputSwitch","PropTypes","string","isRequired","UserPreferences","preferences","
|
|
1
|
+
{"version":3,"file":"index.js","names":["Settings","props","label","description","moreInfoAriaLabel","settings","style","infoIconWrapper","infoIcon","showToolTip","descriptionLabel","propTypes","InputSwitch","PropTypes","string","isRequired","UserPreferences","preferences","arrayOf","shape"],"sources":["../../../src/organism/user-preferences/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {map, isEmpty} from 'lodash/fp';\nimport {NovaCompositionCoorpacademyInformationIcon as InfoIcon} from '@coorpacademy/nova-icons';\nimport InputSwitch from '../../atom/input-switch';\nimport style from './style.css';\n\nconst Settings = props => {\n const {label, description, moreInfoAriaLabel, ...settings} = props;\n return (\n <div className={style.settings}>\n <InputSwitch {...settings} />\n <span className={style.label}>{label}</span>\n {isEmpty(description) ? null : (\n <div className={style.infoIconWrapper}>\n <InfoIcon\n height={16}\n width={16}\n className={style.infoIcon}\n aria-label={moreInfoAriaLabel}\n />\n <div className={style.showToolTip}>\n <div className={style.descriptionLabel}>{description}</div>\n </div>\n </div>\n )}\n </div>\n );\n};\n\nSettings.propTypes = {\n ...InputSwitch.propTypes,\n label: PropTypes.string.isRequired,\n description: PropTypes.string\n};\n\nconst UserPreferences = props => {\n const {preferences = [], moreInfoAriaLabel} = props;\n\n return (\n <div className={style.preferences}>\n {map(\n settings => (\n <Settings {...settings} key={settings.label} moreInfoAriaLabel={moreInfoAriaLabel} />\n ),\n preferences\n )}\n </div>\n );\n};\n\nUserPreferences.propTypes = {\n preferences: PropTypes.arrayOf(PropTypes.shape(Settings.propTypes)),\n moreInfoAriaLabel: PropTypes.string\n};\n\nexport default UserPreferences;\n"],"mappings":";;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,QAAQ,GAAGC,KAAK,IAAI;EACxB,MAAM;IAACC,KAAD;IAAQC,WAAR;IAAqBC;EAArB,IAAuDH,KAA7D;EAAA,MAAiDI,QAAjD,iCAA6DJ,KAA7D;;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type TemplateContextValues = {
|
|
|
22
22
|
handleBlur?: HandleBlur;
|
|
23
23
|
handleFocus?: HandleFocus;
|
|
24
24
|
};
|
|
25
|
-
translate: (
|
|
25
|
+
translate: (key: string, data?: Record<string, string>) => string;
|
|
26
26
|
};
|
|
27
27
|
declare type Props = {
|
|
28
28
|
values: TemplateContextValues;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template-context.d.ts","sourceRoot":"","sources":["../../../src/template/app-review/template-context.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAgB,SAAS,EAAa,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"template-context.d.ts","sourceRoot":"","sources":["../../../src/template/app-review/template-context.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAgB,SAAS,EAAa,MAAM,OAAO,CAAC;AAElE,OAAO,EAAC,SAAS,EAAC,MAAM,2BAA2B,CAAC;AACpD,OAAO,EAAC,KAAK,EAAoB,MAAM,8BAA8B,CAAC;AACtE,OAAqB,EAAC,KAAK,EAAC,MAAM,8BAA8B,CAAC;AACjE,OAAkC,EAAC,YAAY,EAAC,MAAM,6CAA6C,CAAC;AACpG,OAAO,EAAC,SAAS,EAAC,MAAM,2BAA2B,CAAC;AAEpD,oBAAY,UAAU,GAAG,MAAM,IAAI,CAAC;AACpC,oBAAY,WAAW,GAAG,CAAC,EAAE,EAAE,MAAM,KAAK,MAAM,IAAI,CAAC;AACrD,oBAAY,eAAe,GAAG,MAAM,GAAG,IAAI,CAAC;AAE5C,oBAAY,qBAAqB,GAAG;IAClC,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,UAAU,EAAE,KAAK,CAAC;IAClB,KAAK,EAAE,KAAK,CAAC;IACb,YAAY,EAAE,YAAY,CAAC;IAC3B,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,OAAO,EAAE;QACP,YAAY,EAAE,MAAM,CAAC;QACrB,eAAe,EAAE,MAAM,CAAC;KACzB,CAAC;IACF,KAAK,EAAE;QACL,eAAe,CAAC,EAAE,eAAe,CAAC;QAClC,UAAU,CAAC,EAAE,UAAU,CAAC;QACxB,WAAW,CAAC,EAAE,WAAW,CAAC;KAC3B,CAAC;IACF,SAAS,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,MAAM,CAAC;CACnE,CAAC;AAEF,aAAK,KAAK,GAAG;IAAC,MAAM,EAAE,qBAAqB,CAAC;IAAC,QAAQ,EAAE,SAAS,CAAA;CAAC,CAAC;AAclE,QAAA,MAAM,kBAAkB,QAAO,qBAU9B,CAAC;AAEF,QAAA,MAAM,eAAe,yBAAwB,KAAK,gBAEjD,CAAC;AAEF,OAAO,EAAC,eAAe,EAAE,kBAAkB,EAAC,CAAC"}
|
|
@@ -5,6 +5,8 @@ exports.useTemplateContext = exports.TemplateContext = void 0;
|
|
|
5
5
|
|
|
6
6
|
var _react = _interopRequireWildcard(require("react"));
|
|
7
7
|
|
|
8
|
+
var _translate = require("@coorpacademy/translate");
|
|
9
|
+
|
|
8
10
|
var _brand = require("../../variables/brand.native");
|
|
9
11
|
|
|
10
12
|
var _theme = _interopRequireDefault(require("../../variables/theme.native"));
|
|
@@ -26,7 +28,7 @@ const Context = /*#__PURE__*/(0, _react.createContext)({
|
|
|
26
28
|
statusBarHeight: 42
|
|
27
29
|
},
|
|
28
30
|
store: {},
|
|
29
|
-
translate:
|
|
31
|
+
translate: _translate.mockTranslate
|
|
30
32
|
});
|
|
31
33
|
|
|
32
34
|
const useTemplateContext = () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template-context.js","names":["Context","createContext","theme","defaultTheme","brandTheme","defaultBrandTheme","translations","defaultMobileTranslations","display","headerHeight","statusBarHeight","store","translate","
|
|
1
|
+
{"version":3,"file":"template-context.js","names":["Context","createContext","theme","defaultTheme","brandTheme","defaultBrandTheme","translations","defaultMobileTranslations","display","headerHeight","statusBarHeight","store","translate","mockTranslate","useTemplateContext","context","useContext","Error","TemplateContext","values","children"],"sources":["../../../src/template/app-review/template-context.tsx"],"sourcesContent":["import React, {createContext, ReactNode, useContext} from 'react';\nimport {mockTranslate} from '@coorpacademy/translate';\nimport {Analytics} from '../../variables/analytics';\nimport {Brand, defaultBrandTheme} from '../../variables/brand.native';\nimport defaultTheme, {Theme} from '../../variables/theme.native';\nimport defaultMobileTranslations, {Translations} from '../../variables/default-mobile-translations';\nimport {Vibration} from '../../variables/vibration';\n\nexport type HandleBlur = () => void;\nexport type HandleFocus = (id: string) => () => void;\nexport type FocusedSelectId = string | null;\n\nexport type TemplateContextValues = {\n analytics?: Analytics;\n brandTheme: Brand;\n theme: Theme;\n translations: Translations;\n vibration?: Vibration;\n display: {\n headerHeight: number;\n statusBarHeight: number;\n };\n store: {\n focusedSelectId?: FocusedSelectId;\n handleBlur?: HandleBlur;\n handleFocus?: HandleFocus;\n };\n translate: (key: string, data?: Record<string, string>) => string;\n};\n\ntype Props = {values: TemplateContextValues; children: ReactNode};\n\nconst Context = createContext({\n theme: defaultTheme,\n brandTheme: defaultBrandTheme,\n translations: defaultMobileTranslations,\n display: {\n headerHeight: 67,\n statusBarHeight: 42\n },\n store: {},\n translate: mockTranslate\n});\n\nconst useTemplateContext = (): TemplateContextValues => {\n const context = useContext(Context);\n\n if (!context) {\n throw new Error(\n `❌ [TemplateContext] useTemplateContext must be used within a provider <TemplateContext>`\n );\n }\n\n return context;\n};\n\nconst TemplateContext = ({values, children}: Props) => {\n return <Context.Provider value={values}>{children}</Context.Provider>;\n};\n\nexport {TemplateContext, useTemplateContext};\n"],"mappings":";;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;;;;;;;AA2BA,MAAMA,OAAO,gBAAG,IAAAC,oBAAA,EAAc;EAC5BC,KAAK,EAAEC,cADqB;EAE5BC,UAAU,EAAEC,wBAFgB;EAG5BC,YAAY,EAAEC,kCAHc;EAI5BC,OAAO,EAAE;IACPC,YAAY,EAAE,EADP;IAEPC,eAAe,EAAE;EAFV,CAJmB;EAQ5BC,KAAK,EAAE,EARqB;EAS5BC,SAAS,EAAEC;AATiB,CAAd,CAAhB;;AAYA,MAAMC,kBAAkB,GAAG,MAA6B;EACtD,MAAMC,OAAO,GAAG,IAAAC,iBAAA,EAAWhB,OAAX,CAAhB;;EAEA,IAAI,CAACe,OAAL,EAAc;IACZ,MAAM,IAAIE,KAAJ,CACH,yFADG,CAAN;EAGD;;EAED,OAAOF,OAAP;AACD,CAVD;;;;AAYA,MAAMG,eAAe,GAAG,CAAC;EAACC,MAAD;EAASC;AAAT,CAAD,KAA+B;EACrD,oBAAO,6BAAC,OAAD,CAAS,QAAT;IAAkB,KAAK,EAAED;EAAzB,GAAkCC,QAAlC,CAAP;AACD,CAFD"}
|
|
@@ -64,7 +64,6 @@ declare namespace SearchPage {
|
|
|
64
64
|
onToggleSorts: PropTypes.Requireable<(...args: any[]) => any>;
|
|
65
65
|
moreSortAriaLabel: PropTypes.Requireable<string>;
|
|
66
66
|
moreFilterAriaLabel: PropTypes.Requireable<string>;
|
|
67
|
-
filterGroupAriaLabel: PropTypes.Requireable<string>;
|
|
68
67
|
}>>;
|
|
69
68
|
const cards: PropTypes.Requireable<PropTypes.InferProps<{
|
|
70
69
|
list: PropTypes.Requireable<(PropTypes.InferProps<any> | null | undefined)[]>;
|
|
@@ -101,7 +100,6 @@ declare namespace SearchPage {
|
|
|
101
100
|
}>>;
|
|
102
101
|
const moreSortAriaLabel: PropTypes.Requireable<string>;
|
|
103
102
|
const moreFilterAriaLabel: PropTypes.Requireable<string>;
|
|
104
|
-
const filterGroupAriaLabel: PropTypes.Requireable<string>;
|
|
105
103
|
}
|
|
106
104
|
}
|
|
107
105
|
import PropTypes from "prop-types";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/template/common/search-page/index.js"],"names":[],"mappings":";AAUA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/template/common/search-page/index.js"],"names":[],"mappings":";AAUA,mEAgDC"}
|
|
@@ -36,8 +36,7 @@ const SearchPage = (props, context) => {
|
|
|
36
36
|
clearFilters,
|
|
37
37
|
recommendations,
|
|
38
38
|
moreSortAriaLabel,
|
|
39
|
-
moreFilterAriaLabel
|
|
40
|
-
filterGroupAriaLabel
|
|
39
|
+
moreFilterAriaLabel
|
|
41
40
|
} = props;
|
|
42
41
|
const {
|
|
43
42
|
skin
|
|
@@ -58,14 +57,12 @@ const SearchPage = (props, context) => {
|
|
|
58
57
|
}))), recommendationsView) : /*#__PURE__*/_react.default.createElement(_cardsGrid.default, cards);
|
|
59
58
|
return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_filters.default, _extends({}, searchFilters, {
|
|
60
59
|
moreSortAriaLabel: moreSortAriaLabel,
|
|
61
|
-
moreFilterAriaLabel: moreFilterAriaLabel
|
|
62
|
-
filterGroupAriaLabel: filterGroupAriaLabel
|
|
60
|
+
moreFilterAriaLabel: moreFilterAriaLabel
|
|
63
61
|
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
64
62
|
"data-name": "searchResult",
|
|
65
63
|
className: _style.default.cardsWrapper
|
|
66
64
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
67
|
-
className: _style.default.title
|
|
68
|
-
role: "status"
|
|
65
|
+
className: _style.default.title
|
|
69
66
|
}, title), cardsView));
|
|
70
67
|
};
|
|
71
68
|
|
|
@@ -80,8 +77,7 @@ SearchPage.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
80
77
|
clearFilters: _propTypes.default.shape(_button.default.propTypes),
|
|
81
78
|
recommendations: _propTypes.default.shape(_cardsList.default.propTypes),
|
|
82
79
|
moreSortAriaLabel: _propTypes.default.string,
|
|
83
|
-
moreFilterAriaLabel: _propTypes.default.string
|
|
84
|
-
filterGroupAriaLabel: _propTypes.default.string
|
|
80
|
+
moreFilterAriaLabel: _propTypes.default.string
|
|
85
81
|
} : {};
|
|
86
82
|
var _default = SearchPage;
|
|
87
83
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["SearchPage","props","context","title","searchFilters","cards","noresultsfound","clearFilters","recommendations","moreSortAriaLabel","moreFilterAriaLabel","
|
|
1
|
+
{"version":3,"file":"index.js","names":["SearchPage","props","context","title","searchFilters","cards","noresultsfound","clearFilters","recommendations","moreSortAriaLabel","moreFilterAriaLabel","skin","defaultColor","recommendationsView","cardsView","list","style","noresults","noresultstxt","clear","background","cardsWrapper","contextTypes","Provider","childContextTypes","propTypes","PropTypes","string","shape","Filters","CardsGrid","Button","CardsList"],"sources":["../../../../src/template/common/search-page/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {getOr, isEmpty} from 'lodash/fp';\nimport Provider from '../../../atom/provider';\nimport Button from '../../../atom/button';\nimport Filters from '../../../molecule/filters';\nimport CardsGrid from '../../../organism/cards-grid';\nimport CardsList from '../../../molecule/dashboard/cards-list';\nimport style from './style.css';\n\nconst SearchPage = (props, context) => {\n const {\n title,\n searchFilters,\n cards,\n noresultsfound,\n clearFilters,\n recommendations,\n moreSortAriaLabel,\n moreFilterAriaLabel\n } = props;\n\n const {skin} = context;\n const defaultColor = getOr('#00B0FF', 'common.primary', skin);\n\n const recommendationsView = isEmpty(recommendations) ? null : <CardsList {...recommendations} />;\n\n const cardsView = isEmpty(cards.list) ? (\n <div>\n <div className={style.noresults}>\n <div className={style.noresultstxt}>{noresultsfound}</div>\n <Button\n {...clearFilters}\n data-name=\"searchPageClear\"\n className={style.clear}\n style={{background: defaultColor}}\n type=\"link\"\n />\n </div>\n {recommendationsView}\n </div>\n ) : (\n <CardsGrid {...cards} />\n );\n\n return (\n <div>\n <Filters\n {...searchFilters}\n moreSortAriaLabel={moreSortAriaLabel}\n moreFilterAriaLabel={moreFilterAriaLabel}\n />\n <div data-name=\"searchResult\" className={style.cardsWrapper}>\n <div className={style.title}>{title}</div>\n {cardsView}\n </div>\n </div>\n );\n};\n\nSearchPage.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nSearchPage.propTypes = {\n noresultsfound: PropTypes.string,\n title: PropTypes.string,\n searchFilters: PropTypes.shape(Filters.propTypes),\n cards: PropTypes.shape(CardsGrid.propTypes),\n clearFilters: PropTypes.shape(Button.propTypes),\n recommendations: PropTypes.shape(CardsList.propTypes),\n moreSortAriaLabel: PropTypes.string,\n moreFilterAriaLabel: PropTypes.string\n};\n\nexport default SearchPage;\n"],"mappings":";;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEA,MAAMA,UAAU,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EACrC,MAAM;IACJC,KADI;IAEJC,aAFI;IAGJC,KAHI;IAIJC,cAJI;IAKJC,YALI;IAMJC,eANI;IAOJC,iBAPI;IAQJC;EARI,IASFT,KATJ;EAWA,MAAM;IAACU;EAAD,IAAST,OAAf;EACA,MAAMU,YAAY,GAAG,qBAAM,SAAN,EAAiB,gBAAjB,EAAmCD,IAAnC,CAArB;EAEA,MAAME,mBAAmB,GAAG,uBAAQL,eAAR,IAA2B,IAA3B,gBAAkC,6BAAC,kBAAD,EAAeA,eAAf,CAA9D;EAEA,MAAMM,SAAS,GAAG,uBAAQT,KAAK,CAACU,IAAd,iBAChB,uDACE;IAAK,SAAS,EAAEC,cAAA,CAAMC;EAAtB,gBACE;IAAK,SAAS,EAAED,cAAA,CAAME;EAAtB,GAAqCZ,cAArC,CADF,eAEE,6BAAC,eAAD,eACMC,YADN;IAEE,aAAU,iBAFZ;IAGE,SAAS,EAAES,cAAA,CAAMG,KAHnB;IAIE,KAAK,EAAE;MAACC,UAAU,EAAER;IAAb,CAJT;IAKE,IAAI,EAAC;EALP,GAFF,CADF,EAWGC,mBAXH,CADgB,gBAehB,6BAAC,kBAAD,EAAeR,KAAf,CAfF;EAkBA,oBACE,uDACE,6BAAC,gBAAD,eACMD,aADN;IAEE,iBAAiB,EAAEK,iBAFrB;IAGE,mBAAmB,EAAEC;EAHvB,GADF,eAME;IAAK,aAAU,cAAf;IAA8B,SAAS,EAAEM,cAAA,CAAMK;EAA/C,gBACE;IAAK,SAAS,EAAEL,cAAA,CAAMb;EAAtB,GAA8BA,KAA9B,CADF,EAEGW,SAFH,CANF,CADF;AAaD,CAhDD;;AAkDAd,UAAU,CAACsB,YAAX,GAA0B;EACxBX,IAAI,EAAEY,iBAAA,CAASC,iBAAT,CAA2Bb;AADT,CAA1B;AAIAX,UAAU,CAACyB,SAAX,2CAAuB;EACrBnB,cAAc,EAAEoB,kBAAA,CAAUC,MADL;EAErBxB,KAAK,EAAEuB,kBAAA,CAAUC,MAFI;EAGrBvB,aAAa,EAAEsB,kBAAA,CAAUE,KAAV,CAAgBC,gBAAA,CAAQJ,SAAxB,CAHM;EAIrBpB,KAAK,EAAEqB,kBAAA,CAAUE,KAAV,CAAgBE,kBAAA,CAAUL,SAA1B,CAJc;EAKrBlB,YAAY,EAAEmB,kBAAA,CAAUE,KAAV,CAAgBG,eAAA,CAAON,SAAvB,CALO;EAMrBjB,eAAe,EAAEkB,kBAAA,CAAUE,KAAV,CAAgBI,kBAAA,CAAUP,SAA1B,CANI;EAOrBhB,iBAAiB,EAAEiB,kBAAA,CAAUC,MAPR;EAQrBjB,mBAAmB,EAAEgB,kBAAA,CAAUC;AARV,CAAvB;eAWe3B,U"}
|
package/locales/en/global.json
CHANGED
|
@@ -21,7 +21,6 @@
|
|
|
21
21
|
"Delete": "Delete",
|
|
22
22
|
"Draft": "Draft",
|
|
23
23
|
"drop_down_icon": "Dropdown to open the list of available answers",
|
|
24
|
-
"answer_the_question": "Answer the question",
|
|
25
24
|
"Edit": "Edit",
|
|
26
25
|
"external_content_article": "DOCUMENTS",
|
|
27
26
|
"external_content_scorm": "ANIMATED RESOURCES",
|
|
@@ -80,7 +79,10 @@
|
|
|
80
79
|
"mandatory_fields": "*Mandatory fields",
|
|
81
80
|
"something_went_wrong": "Oh Snap! Something went wrong.",
|
|
82
81
|
"review_header_step_item": {
|
|
83
|
-
"aria_label": "Question
|
|
84
|
-
"
|
|
82
|
+
"aria_label": "Question {{headerStepValue}}",
|
|
83
|
+
"current_question": "Question {{headerStepValue}} is the current question",
|
|
84
|
+
"correct_question": "Question {{headerStepValue}} is correct",
|
|
85
|
+
"incorrect_question": "Question {{headerStepValue}} is incorrect",
|
|
86
|
+
"not_answered_question": "Question {{headerStepValue}} is not answered yet"
|
|
85
87
|
}
|
|
86
88
|
}
|
package/locales/fr/global.json
CHANGED
|
@@ -20,7 +20,6 @@
|
|
|
20
20
|
"Create a new cohort": "Créer une nouvelle cohorte",
|
|
21
21
|
"Delete": "Supprimer",
|
|
22
22
|
"Draft": "Brouillon",
|
|
23
|
-
"drop_down_icon": "Liste déroulante pour ouvrir la liste des réponses disponibles",
|
|
24
23
|
"Edit": "Modifier",
|
|
25
24
|
"external_content_article": "DOCUMENTS",
|
|
26
25
|
"external_content_scorm": "RESSOURCES ANIMÉES",
|
|
@@ -77,9 +76,5 @@
|
|
|
77
76
|
"zuora_discount_code_submit": "Appliquer",
|
|
78
77
|
"zuora_discount_code": "Code promo",
|
|
79
78
|
"mandatory_fields": "* Champs obligatoires",
|
|
80
|
-
"something_went_wrong": "Oh Snap! Quelque chose a mal tourné."
|
|
81
|
-
"review_header_step_item": {
|
|
82
|
-
"aria_label": "Question ${headerStepValue}",
|
|
83
|
-
"aria_description": "La question ${headerStepValue} est ${questionIconStatus}"
|
|
84
|
-
}
|
|
79
|
+
"something_went_wrong": "Oh Snap! Quelque chose a mal tourné."
|
|
85
80
|
}
|
package/locales/ru/global.json
CHANGED
|
@@ -20,7 +20,6 @@
|
|
|
20
20
|
"Create a new cohort": "Создать новый сегмент",
|
|
21
21
|
"Delete": "Удалить",
|
|
22
22
|
"Draft": "Черновой вариант",
|
|
23
|
-
"drop_down_icon": "Открыть, чтобы открыть список доступных ответов",
|
|
24
23
|
"Edit": "Редактировать",
|
|
25
24
|
"external_content_article": "ДОКУМЕНТЫ",
|
|
26
25
|
"external_content_scorm": "АНИМИРОВАННЫЕ РЕСУРСЫ",
|
|
@@ -77,9 +76,5 @@
|
|
|
77
76
|
"zuora_discount_code_submit": "Применить",
|
|
78
77
|
"zuora_discount_code": "Промо-код",
|
|
79
78
|
"mandatory_fields": "*Обязательные поля",
|
|
80
|
-
"something_went_wrong": "Oh Snap! Something went wrong."
|
|
81
|
-
"review_header_step_item": {
|
|
82
|
-
"aria_label": "Вопрос ${headerStepValue}",
|
|
83
|
-
"aria_description": "Вопрос ${headerStepValue} - это ${questionIconStatus}"
|
|
84
|
-
}
|
|
79
|
+
"something_went_wrong": "Oh Snap! Something went wrong."
|
|
85
80
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coorpacademy/components",
|
|
3
|
-
"version": "11.4.5-alpha.
|
|
3
|
+
"version": "11.4.5-alpha.5+5234282a2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -160,5 +160,5 @@
|
|
|
160
160
|
"last 2 versions",
|
|
161
161
|
"IE 11"
|
|
162
162
|
],
|
|
163
|
-
"gitHead": "
|
|
163
|
+
"gitHead": "5234282a2dd5b5ed796f40dfc97c9aab4e4f18ff"
|
|
164
164
|
}
|