@coorpacademy/components 11.4.5-alpha.32 → 11.4.5-alpha.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/atom/select/index.d.ts +1 -0
- package/es/atom/select/index.d.ts.map +1 -1
- package/es/atom/select/index.js +12 -7
- package/es/atom/select/index.js.map +1 -1
- package/es/molecule/brand-form-group/index.d.ts +2 -0
- package/es/molecule/filters/index.d.ts +1 -0
- package/es/molecule/filters/index.d.ts.map +1 -1
- package/es/molecule/setup-slide/index.d.ts +1 -0
- package/es/molecule/setup-slider/index.d.ts +1 -0
- package/es/organism/brand-form/index.d.ts +2 -0
- package/es/organism/wizard-contents/index.d.ts +2 -0
- package/es/template/back-office/brand-update/index.d.ts +4 -0
- package/es/template/common/search-page/index.d.ts +1 -0
- package/lib/atom/select/index.d.ts +1 -0
- package/lib/atom/select/index.d.ts.map +1 -1
- package/lib/atom/select/index.js +12 -7
- package/lib/atom/select/index.js.map +1 -1
- package/lib/molecule/brand-form-group/index.d.ts +2 -0
- package/lib/molecule/filters/index.d.ts +1 -0
- package/lib/molecule/filters/index.d.ts.map +1 -1
- package/lib/molecule/setup-slide/index.d.ts +1 -0
- package/lib/molecule/setup-slider/index.d.ts +1 -0
- package/lib/organism/brand-form/index.d.ts +2 -0
- package/lib/organism/wizard-contents/index.d.ts +2 -0
- package/lib/template/back-office/brand-update/index.d.ts +4 -0
- package/lib/template/common/search-page/index.d.ts +1 -0
- package/package.json +2 -2
- package/locales/.mtslconfig.json +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/select/index.js"],"names":[],"mappings":";;;;;;;;AA6BA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/select/index.js"],"names":[],"mappings":";;;;;;;;AA6BA,qEA+JC"}
|
package/es/atom/select/index.js
CHANGED
|
@@ -43,7 +43,8 @@ const Select = (props, legacyContext) => {
|
|
|
43
43
|
modified = false,
|
|
44
44
|
error = false,
|
|
45
45
|
title: propTitle,
|
|
46
|
-
'aria-label': ariaLabel
|
|
46
|
+
'aria-label': ariaLabel,
|
|
47
|
+
selectId
|
|
47
48
|
} = props;
|
|
48
49
|
const skin = GetSkinFromContext(legacyContext);
|
|
49
50
|
const title = useMemo(() => propTitle ? `${propTitle}${required ? '*' : ''}` : null, [propTitle, required]);
|
|
@@ -92,28 +93,31 @@ const Select = (props, legacyContext) => {
|
|
|
92
93
|
const isLongLabel = useMemo(() => labelSize >= 65, [labelSize]);
|
|
93
94
|
return /*#__PURE__*/React.createElement("div", {
|
|
94
95
|
className: classnames(composedClassName, theme === 'coorpmanager' ? style.coorpmanager : null)
|
|
95
|
-
}, /*#__PURE__*/React.createElement("label", {
|
|
96
|
+
}, /*#__PURE__*/React.createElement("label", _extends({}, selectId ? {
|
|
97
|
+
htmlFor: selectId
|
|
98
|
+
} : {}, {
|
|
96
99
|
"data-name": "select-wrapper",
|
|
97
100
|
style: _extends({}, shouldUseSkinFontColor && {
|
|
98
101
|
color
|
|
99
102
|
}),
|
|
100
103
|
className: style.selectWrapper
|
|
101
|
-
}, titleView, /*#__PURE__*/React.createElement("span", {
|
|
104
|
+
}), titleView, /*#__PURE__*/React.createElement("span", {
|
|
102
105
|
"data-name": "select-span",
|
|
103
106
|
className: classnames(style.selectSpan, includes(theme, ['player', 'invalid', 'question', 'thematiques', 'template']) ? style.noLabelCommon : null, borderClassName, isLongLabel ? style.longLabel : null),
|
|
104
107
|
style: _extends({}, shouldUseSkinFontColor && {
|
|
105
108
|
color
|
|
106
109
|
})
|
|
107
|
-
}, selectedLabel), arrowView, /*#__PURE__*/React.createElement("select", {
|
|
110
|
+
}, selectedLabel), arrowView, /*#__PURE__*/React.createElement("select", _extends({}, selectId ? {
|
|
111
|
+
id: selectId
|
|
112
|
+
} : {}, {
|
|
108
113
|
"data-name": "native-select",
|
|
109
114
|
className: style.selectBox,
|
|
110
|
-
title: selectedLabel,
|
|
111
115
|
name: name,
|
|
112
116
|
onChange: handleChange,
|
|
113
117
|
value: selected,
|
|
114
118
|
multiple: multiple,
|
|
115
119
|
disabled: disabled
|
|
116
|
-
}, optionList)), /*#__PURE__*/React.createElement("div", {
|
|
120
|
+
}), optionList)), /*#__PURE__*/React.createElement("div", {
|
|
117
121
|
className: style.description
|
|
118
122
|
}, description));
|
|
119
123
|
};
|
|
@@ -141,7 +145,8 @@ Select.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
141
145
|
options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes)),
|
|
142
146
|
modified: PropTypes.bool,
|
|
143
147
|
error: PropTypes.bool,
|
|
144
|
-
'aria-label': PropTypes.string
|
|
148
|
+
'aria-label': PropTypes.string,
|
|
149
|
+
selectId: PropTypes.string
|
|
145
150
|
} : {};
|
|
146
151
|
export default Select;
|
|
147
152
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useMemo","PropTypes","classnames","filter","find","get","getOr","includes","keys","map","size","NovaCompositionNavigationArrowDown","ArrowDown","Provider","GetSkinFromContext","getClassState","style","themeStyle","invalid","header","mooc","question","sort","thematiques","player","template","coorpmanager","Select","props","legacyContext","name","options","className","borderClassName","onChange","multiple","disabled","required","description","theme","modified","error","title","propTitle","ariaLabel","skin","optionList","option","index","value","selectOption","titleView","selected","selectedLabel","isSelectedInValidOption","validOption","handleChange","e","target","selectedOptions","black","color","shouldUseSkinFontColor","arrowColor","undefined","arrowView","selectedArrow","arrow","behaviorClassName","default","composedClassName","unselected","labelSize","isLongLabel","selectWrapper","selectSpan","noLabelCommon","longLabel","selectBox","SelectOptionPropTypes","string","isRequired","oneOfType","number","bool","contextTypes","childContextTypes","propTypes","func","oneOf","arrayOf","shape"],"sources":["../../../src/atom/select/index.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport filter from 'lodash/fp/filter';\nimport find from 'lodash/fp/find';\nimport get from 'lodash/fp/get';\nimport getOr from 'lodash/fp/getOr';\nimport includes from 'lodash/fp/includes';\nimport keys from 'lodash/fp/keys';\nimport map from 'lodash/fp/map';\nimport size from 'lodash/fp/size';\nimport {NovaCompositionNavigationArrowDown as ArrowDown} from '@coorpacademy/nova-icons';\nimport Provider, {GetSkinFromContext} from '../provider';\nimport getClassState from '../../util/get-class-state';\nimport style from './style.css';\n\nconst themeStyle = {\n filter: style.filter,\n invalid: style.invalid,\n header: style.header,\n mooc: style.mooc,\n question: style.question,\n sort: style.sort,\n thematiques: style.thematiques,\n player: style.player,\n template: style.template,\n coorpmanager: null\n};\n\nconst Select = (props, legacyContext) => {\n const {\n name,\n options = [],\n className,\n borderClassName,\n onChange,\n multiple = false,\n disabled,\n required,\n description,\n theme,\n modified = false,\n error = false,\n title: propTitle,\n 'aria-label': ariaLabel\n } = props;\n\n const skin = GetSkinFromContext(legacyContext);\n const title = useMemo(\n () => (propTitle ? `${propTitle}${required ? '*' : ''}` : null),\n [propTitle, required]\n );\n\n const optionList =\n options &&\n options.map((option, index) => {\n return (\n <option key={index} value={option.value} className={style.selectOption}>\n {option.name}\n </option>\n );\n });\n\n const titleView = title ? <span className={style.title}>{title} </span> : null;\n\n const selected = useMemo(\n () =>\n multiple\n ? map(get('value'), filter({selected: true}, options))\n : get('value', find({selected: true}, options)),\n [multiple, options]\n );\n const selectedLabel = useMemo(\n () =>\n multiple\n ? map(get('name'), filter({selected: true}, options))\n : get('name', find({selected: true}, options)),\n [multiple, options]\n );\n\n const isSelectedInValidOption = useMemo(\n () =>\n theme === 'player' &&\n getOr(false, 'name', find({validOption: false, selected: true}, options)),\n [options, theme]\n );\n\n const handleChange = useMemo(\n () =>\n multiple\n ? e => {\n onChange(map(get('value'), e.target.selectedOptions));\n }\n : e => {\n onChange(e.target.value);\n },\n [onChange, multiple]\n );\n\n const black = useMemo(() => getOr('#14171A', 'common.black', skin), [skin]);\n const color = useMemo(() => getOr('#00B0FF', 'common.primary', skin), [skin]);\n const shouldUseSkinFontColor = useMemo(\n () =>\n !isSelectedInValidOption && selected && includes(theme, ['question', 'template', 'player']),\n [isSelectedInValidOption, selected, theme]\n );\n const arrowColor = selected ? color : undefined;\n\n const arrowView = !multiple ? (\n <ArrowDown\n color={includes(theme, ['question', 'template', 'player']) ? arrowColor : black}\n className={shouldUseSkinFontColor ? style.selectedArrow : style.arrow}\n aria-label={ariaLabel}\n data-testid=\"select-arrow-down-icon\"\n />\n ) : null;\n const behaviorClassName = useMemo(\n () => getClassState(style.default, style.modified, style.error, modified, error),\n [error, modified]\n );\n const composedClassName = useMemo(\n () =>\n classnames(\n theme && theme !== 'coorpmanager' ? themeStyle[theme] : behaviorClassName,\n selected ? style.selected : style.unselected,\n className\n ),\n [behaviorClassName, className, selected, theme]\n );\n\n const labelSize = useMemo(() => size(selectedLabel), [selectedLabel]);\n\n const isLongLabel = useMemo(() => labelSize >= 65, [labelSize]);\n\n return (\n <div\n className={classnames(\n composedClassName,\n theme === 'coorpmanager' ? style.coorpmanager : null\n )}\n >\n <label\n data-name=\"select-wrapper\"\n style={{\n ...(shouldUseSkinFontColor && {\n color\n })\n }}\n className={style.selectWrapper}\n >\n {titleView}\n <span\n data-name=\"select-span\"\n className={classnames(\n style.selectSpan,\n includes(theme, ['player', 'invalid', 'question', 'thematiques', 'template'])\n ? style.noLabelCommon\n : null,\n borderClassName,\n isLongLabel ? style.longLabel : null\n )}\n style={{\n ...(shouldUseSkinFontColor && {\n color\n })\n }}\n >\n {selectedLabel}\n </span>\n {arrowView}\n <select\n data-name=\"native-select\"\n className={style.selectBox}\n title={selectedLabel}\n name={name}\n onChange={handleChange}\n value={selected}\n multiple={multiple}\n disabled={disabled}\n >\n {optionList}\n </select>\n </label>\n <div className={style.description}>{description}</div>\n </div>\n );\n};\n\nexport const SelectOptionPropTypes = {\n name: PropTypes.string.isRequired,\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n selected: PropTypes.bool,\n validOption: PropTypes.bool\n};\n\nSelect.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nSelect.propTypes = {\n title: PropTypes.string,\n name: PropTypes.string,\n className: PropTypes.string,\n borderClassName: PropTypes.string,\n disabled: PropTypes.bool,\n multiple: PropTypes.bool,\n description: PropTypes.string,\n required: PropTypes.bool,\n onChange: PropTypes.func,\n theme: PropTypes.oneOf(keys(themeStyle)),\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes)),\n modified: PropTypes.bool,\n error: PropTypes.bool,\n 'aria-label': PropTypes.string\n};\n\nexport default Select;\n"],"mappings":";;AAAA,OAAOA,KAAP,IAAeC,OAAf,QAA6B,OAA7B;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,MAAP,MAAmB,kBAAnB;AACA,OAAOC,IAAP,MAAiB,gBAAjB;AACA,OAAOC,GAAP,MAAgB,eAAhB;AACA,OAAOC,KAAP,MAAkB,iBAAlB;AACA,OAAOC,QAAP,MAAqB,oBAArB;AACA,OAAOC,IAAP,MAAiB,gBAAjB;AACA,OAAOC,GAAP,MAAgB,eAAhB;AACA,OAAOC,IAAP,MAAiB,gBAAjB;AACA,SAAQC,kCAAkC,IAAIC,SAA9C,QAA8D,0BAA9D;AACA,OAAOC,QAAP,IAAkBC,kBAAlB,QAA2C,aAA3C;AACA,OAAOC,aAAP,MAA0B,4BAA1B;AACA,OAAOC,KAAP,MAAkB,aAAlB;AAEA,MAAMC,UAAU,GAAG;EACjBd,MAAM,EAAEa,KAAK,CAACb,MADG;EAEjBe,OAAO,EAAEF,KAAK,CAACE,OAFE;EAGjBC,MAAM,EAAEH,KAAK,CAACG,MAHG;EAIjBC,IAAI,EAAEJ,KAAK,CAACI,IAJK;EAKjBC,QAAQ,EAAEL,KAAK,CAACK,QALC;EAMjBC,IAAI,EAAEN,KAAK,CAACM,IANK;EAOjBC,WAAW,EAAE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AAcnF,SAAS,CAAC+E;AAdP,CAAnB;AAiBA,eAAerD,MAAf"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useMemo","PropTypes","classnames","filter","find","get","getOr","includes","keys","map","size","NovaCompositionNavigationArrowDown","ArrowDown","Provider","GetSkinFromContext","getClassState","style","themeStyle","invalid","header","mooc","question","sort","thematiques","player","template","coorpmanager","Select","props","legacyContext","name","options","className","borderClassName","onChange","multiple","disabled","required","description","theme","modified","error","title","propTitle","ariaLabel","selectId","skin","optionList","option","index","value","selectOption","titleView","selected","selectedLabel","isSelectedInValidOption","validOption","handleChange","e","target","selectedOptions","black","color","shouldUseSkinFontColor","arrowColor","undefined","arrowView","selectedArrow","arrow","behaviorClassName","default","composedClassName","unselected","labelSize","isLongLabel","htmlFor","selectWrapper","selectSpan","noLabelCommon","longLabel","id","selectBox","SelectOptionPropTypes","string","isRequired","oneOfType","number","bool","contextTypes","childContextTypes","propTypes","func","oneOf","arrayOf","shape"],"sources":["../../../src/atom/select/index.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport filter from 'lodash/fp/filter';\nimport find from 'lodash/fp/find';\nimport get from 'lodash/fp/get';\nimport getOr from 'lodash/fp/getOr';\nimport includes from 'lodash/fp/includes';\nimport keys from 'lodash/fp/keys';\nimport map from 'lodash/fp/map';\nimport size from 'lodash/fp/size';\nimport {NovaCompositionNavigationArrowDown as ArrowDown} from '@coorpacademy/nova-icons';\nimport Provider, {GetSkinFromContext} from '../provider';\nimport getClassState from '../../util/get-class-state';\nimport style from './style.css';\n\nconst themeStyle = {\n filter: style.filter,\n invalid: style.invalid,\n header: style.header,\n mooc: style.mooc,\n question: style.question,\n sort: style.sort,\n thematiques: style.thematiques,\n player: style.player,\n template: style.template,\n coorpmanager: null\n};\n\nconst Select = (props, legacyContext) => {\n const {\n name,\n options = [],\n className,\n borderClassName,\n onChange,\n multiple = false,\n disabled,\n required,\n description,\n theme,\n modified = false,\n error = false,\n title: propTitle,\n 'aria-label': ariaLabel,\n selectId\n } = props;\n\n const skin = GetSkinFromContext(legacyContext);\n const title = useMemo(\n () => (propTitle ? `${propTitle}${required ? '*' : ''}` : null),\n [propTitle, required]\n );\n\n const optionList =\n options &&\n options.map((option, index) => {\n return (\n <option key={index} value={option.value} className={style.selectOption}>\n {option.name}\n </option>\n );\n });\n\n const titleView = title ? <span className={style.title}>{title} </span> : null;\n\n const selected = useMemo(\n () =>\n multiple\n ? map(get('value'), filter({selected: true}, options))\n : get('value', find({selected: true}, options)),\n [multiple, options]\n );\n const selectedLabel = useMemo(\n () =>\n multiple\n ? map(get('name'), filter({selected: true}, options))\n : get('name', find({selected: true}, options)),\n [multiple, options]\n );\n\n const isSelectedInValidOption = useMemo(\n () =>\n theme === 'player' &&\n getOr(false, 'name', find({validOption: false, selected: true}, options)),\n [options, theme]\n );\n\n const handleChange = useMemo(\n () =>\n multiple\n ? e => {\n onChange(map(get('value'), e.target.selectedOptions));\n }\n : e => {\n onChange(e.target.value);\n },\n [onChange, multiple]\n );\n\n const black = useMemo(() => getOr('#14171A', 'common.black', skin), [skin]);\n const color = useMemo(() => getOr('#00B0FF', 'common.primary', skin), [skin]);\n const shouldUseSkinFontColor = useMemo(\n () =>\n !isSelectedInValidOption && selected && includes(theme, ['question', 'template', 'player']),\n [isSelectedInValidOption, selected, theme]\n );\n const arrowColor = selected ? color : undefined;\n\n const arrowView = !multiple ? (\n <ArrowDown\n color={includes(theme, ['question', 'template', 'player']) ? arrowColor : black}\n className={shouldUseSkinFontColor ? style.selectedArrow : style.arrow}\n aria-label={ariaLabel}\n data-testid=\"select-arrow-down-icon\"\n />\n ) : null;\n const behaviorClassName = useMemo(\n () => getClassState(style.default, style.modified, style.error, modified, error),\n [error, modified]\n );\n const composedClassName = useMemo(\n () =>\n classnames(\n theme && theme !== 'coorpmanager' ? themeStyle[theme] : behaviorClassName,\n selected ? style.selected : style.unselected,\n className\n ),\n [behaviorClassName, className, selected, theme]\n );\n\n const labelSize = useMemo(() => size(selectedLabel), [selectedLabel]);\n\n const isLongLabel = useMemo(() => labelSize >= 65, [labelSize]);\n\n return (\n <div\n className={classnames(\n composedClassName,\n theme === 'coorpmanager' ? style.coorpmanager : null\n )}\n >\n <label\n {...(selectId ? {htmlFor: selectId} : {})}\n data-name=\"select-wrapper\"\n style={{\n ...(shouldUseSkinFontColor && {\n color\n })\n }}\n className={style.selectWrapper}\n >\n {titleView}\n <span\n data-name=\"select-span\"\n className={classnames(\n style.selectSpan,\n includes(theme, ['player', 'invalid', 'question', 'thematiques', 'template'])\n ? style.noLabelCommon\n : null,\n borderClassName,\n isLongLabel ? style.longLabel : null\n )}\n style={{\n ...(shouldUseSkinFontColor && {\n color\n })\n }}\n >\n {selectedLabel}\n </span>\n {arrowView}\n <select\n {...(selectId ? {id: selectId} : {})}\n data-name=\"native-select\"\n className={style.selectBox}\n name={name}\n onChange={handleChange}\n value={selected}\n multiple={multiple}\n disabled={disabled}\n >\n {optionList}\n </select>\n </label>\n <div className={style.description}>{description}</div>\n </div>\n );\n};\n\nexport const SelectOptionPropTypes = {\n name: PropTypes.string.isRequired,\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n selected: PropTypes.bool,\n validOption: PropTypes.bool\n};\n\nSelect.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nSelect.propTypes = {\n title: PropTypes.string,\n name: PropTypes.string,\n className: PropTypes.string,\n borderClassName: PropTypes.string,\n disabled: PropTypes.bool,\n multiple: PropTypes.bool,\n description: PropTypes.string,\n required: PropTypes.bool,\n onChange: PropTypes.func,\n theme: PropTypes.oneOf(keys(themeStyle)),\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes)),\n modified: PropTypes.bool,\n error: PropTypes.bool,\n 'aria-label': PropTypes.string,\n selectId: PropTypes.string\n};\n\nexport default Select;\n"],"mappings":";;AAAA,OAAOA,KAAP,IAAeC,OAAf,QAA6B,OAA7B;AACA,OAAOC,SAAP,M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AEpD,SAAS,CAACsF,IAHe;EAInC/B,WAAW,EAAEvD,SAAS,CAACsF;AAJY,CAA9B;AAOP5D,MAAM,CAAC6D,YAAP,GAAsB;EACpB1C,IAAI,EAAEjC,QAAQ,CAAC4E,iBAAT,CAA2B3C;AADb,CAAtB;AAIAnB,MAAM,CAAC+D,SAAP,2CAAmB;EACjBhD,KAAK,EAAEzC,SAAS,CAACkF,MADA;EAEjBrD,IAAI,EAAE7B,SAAS,CAACkF,MAFC;EAGjBnD,SAAS,EAAE/B,SAAS,CAACkF,MAHJ;EAIjBlD,eAAe,EAAEhC,SAAS,CAACkF,MAJV;EAKjB/C,QAAQ,EAAEnC,SAAS,CAACsF,IALH;EAMjBpD,QAAQ,EAAElC,SAAS,CAACsF,IANH;EAOjBjD,WAAW,EAAErC,SAAS,CAACkF,MAPN;EAQjB9C,QAAQ,EAAEpC,SAAS,CAACsF,IARH;EASjBrD,QAAQ,EAAEjC,SAAS,CAAC0F,IATH;EAUjBpD,KAAK,EAAEtC,SAAS,CAAC2F,KAAV,CAAgBpF,IAAI,CAACS,UAAD,CAApB,CAVU;EAWjBc,OAAO,EAAE9B,SAAS,CAAC4F,OAAV,CAAkB5F,SAAS,CAAC6F,KAAV,CAAgBZ,qBAAhB,CAAlB,CAXQ;EAYjB1C,QAAQ,EAAEvC,SAAS,CAACsF,IAZH;EAajB9C,KAAK,EAAExC,SAAS,CAACsF,IAbA;EAcjB,cAActF,SAAS,CAACkF,MAdP;EAejBtC,QAAQ,EAAE5C,SAAS,CAACkF;AAfH,CAAnB;AAkBA,eAAexD,MAAf"}
|
|
@@ -99,6 +99,7 @@ declare namespace BrandFormGroup {
|
|
|
99
99
|
modified: PropTypes.Requireable<boolean>;
|
|
100
100
|
error: PropTypes.Requireable<boolean>;
|
|
101
101
|
'aria-label': PropTypes.Requireable<string>;
|
|
102
|
+
selectId: PropTypes.Requireable<string>;
|
|
102
103
|
}> | PropTypes.InferProps<{
|
|
103
104
|
type: PropTypes.Requireable<string>;
|
|
104
105
|
title: PropTypes.Validator<string>;
|
|
@@ -203,6 +204,7 @@ declare namespace BrandFormGroup {
|
|
|
203
204
|
modified: PropTypes.Requireable<boolean>;
|
|
204
205
|
error: PropTypes.Requireable<boolean>;
|
|
205
206
|
'aria-label': PropTypes.Requireable<string>;
|
|
207
|
+
selectId: PropTypes.Requireable<string>;
|
|
206
208
|
}> | PropTypes.InferProps<{
|
|
207
209
|
type: PropTypes.Requireable<string>;
|
|
208
210
|
title: PropTypes.Validator<string>;
|
|
@@ -31,6 +31,7 @@ declare class Filters extends React.Component<any, any, any> {
|
|
|
31
31
|
modified: PropTypes.Requireable<boolean>;
|
|
32
32
|
error: PropTypes.Requireable<boolean>;
|
|
33
33
|
'aria-label': PropTypes.Requireable<string>;
|
|
34
|
+
selectId: PropTypes.Requireable<string>;
|
|
34
35
|
}>>;
|
|
35
36
|
onSearch: PropTypes.Requireable<(...args: any[]) => any>;
|
|
36
37
|
onToggleFilters: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/filters/index.js"],"names":[],"mappings":";AASA;IACE
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/filters/index.js"],"names":[],"mappings":";AASA;IACE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAcE;IAEF;;;;;;;;;;;;;;;;;;;;;;MAEE;IAEF,wBASC;IAPC;;;MAGC;IAMH,yBAcC;IAED,uBAYC;IAED,qBAOC;IAED,sBAsFC;CACF"}
|
|
@@ -57,6 +57,7 @@ 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>;
|
|
60
61
|
}> | PropTypes.InferProps<{
|
|
61
62
|
type: PropTypes.Requireable<string>;
|
|
62
63
|
title: PropTypes.Validator<string>;
|
|
@@ -70,6 +70,7 @@ declare namespace SetupSlider {
|
|
|
70
70
|
modified: PropTypes.Requireable<boolean>;
|
|
71
71
|
error: PropTypes.Requireable<boolean>;
|
|
72
72
|
'aria-label': PropTypes.Requireable<string>;
|
|
73
|
+
selectId: PropTypes.Requireable<string>;
|
|
73
74
|
}> | PropTypes.InferProps<{
|
|
74
75
|
type: PropTypes.Requireable<string>;
|
|
75
76
|
title: PropTypes.Validator<string>;
|
|
@@ -129,6 +129,7 @@ declare namespace BrandForm {
|
|
|
129
129
|
modified: PropTypes.Requireable<boolean>;
|
|
130
130
|
error: PropTypes.Requireable<boolean>;
|
|
131
131
|
'aria-label': PropTypes.Requireable<string>;
|
|
132
|
+
selectId: PropTypes.Requireable<string>;
|
|
132
133
|
}> | PropTypes.InferProps<{
|
|
133
134
|
type: PropTypes.Requireable<string>;
|
|
134
135
|
title: PropTypes.Validator<string>;
|
|
@@ -233,6 +234,7 @@ declare namespace BrandForm {
|
|
|
233
234
|
modified: PropTypes.Requireable<boolean>;
|
|
234
235
|
error: PropTypes.Requireable<boolean>;
|
|
235
236
|
'aria-label': PropTypes.Requireable<string>;
|
|
237
|
+
selectId: PropTypes.Requireable<string>;
|
|
236
238
|
}> | PropTypes.InferProps<{
|
|
237
239
|
type: PropTypes.Requireable<string>;
|
|
238
240
|
title: PropTypes.Validator<string>;
|
|
@@ -146,6 +146,7 @@ declare namespace WizardContents {
|
|
|
146
146
|
modified: PropTypes.Requireable<boolean>;
|
|
147
147
|
error: PropTypes.Requireable<boolean>;
|
|
148
148
|
'aria-label': PropTypes.Requireable<string>;
|
|
149
|
+
selectId: PropTypes.Requireable<string>;
|
|
149
150
|
}> | PropTypes.InferProps<{
|
|
150
151
|
type: PropTypes.Requireable<string>;
|
|
151
152
|
title: PropTypes.Validator<string>;
|
|
@@ -250,6 +251,7 @@ declare namespace WizardContents {
|
|
|
250
251
|
modified: PropTypes.Requireable<boolean>;
|
|
251
252
|
error: PropTypes.Requireable<boolean>;
|
|
252
253
|
'aria-label': PropTypes.Requireable<string>;
|
|
254
|
+
selectId: PropTypes.Requireable<string>;
|
|
253
255
|
}> | PropTypes.InferProps<{
|
|
254
256
|
type: PropTypes.Requireable<string>;
|
|
255
257
|
title: PropTypes.Validator<string>;
|
|
@@ -231,6 +231,7 @@ declare namespace BrandUpdate {
|
|
|
231
231
|
modified: PropTypes.Requireable<boolean>;
|
|
232
232
|
error: PropTypes.Requireable<boolean>;
|
|
233
233
|
'aria-label': PropTypes.Requireable<string>;
|
|
234
|
+
selectId: PropTypes.Requireable<string>;
|
|
234
235
|
}> | PropTypes.InferProps<{
|
|
235
236
|
type: PropTypes.Requireable<string>;
|
|
236
237
|
title: PropTypes.Validator<string>;
|
|
@@ -335,6 +336,7 @@ declare namespace BrandUpdate {
|
|
|
335
336
|
modified: PropTypes.Requireable<boolean>;
|
|
336
337
|
error: PropTypes.Requireable<boolean>;
|
|
337
338
|
'aria-label': PropTypes.Requireable<string>;
|
|
339
|
+
selectId: PropTypes.Requireable<string>;
|
|
338
340
|
}> | PropTypes.InferProps<{
|
|
339
341
|
type: PropTypes.Requireable<string>;
|
|
340
342
|
title: PropTypes.Validator<string>;
|
|
@@ -854,6 +856,7 @@ declare namespace BrandUpdate {
|
|
|
854
856
|
modified: PropTypes.Requireable<boolean>;
|
|
855
857
|
error: PropTypes.Requireable<boolean>;
|
|
856
858
|
'aria-label': PropTypes.Requireable<string>;
|
|
859
|
+
selectId: PropTypes.Requireable<string>;
|
|
857
860
|
}> | PropTypes.InferProps<{
|
|
858
861
|
type: PropTypes.Requireable<string>;
|
|
859
862
|
title: PropTypes.Validator<string>;
|
|
@@ -958,6 +961,7 @@ declare namespace BrandUpdate {
|
|
|
958
961
|
modified: PropTypes.Requireable<boolean>;
|
|
959
962
|
error: PropTypes.Requireable<boolean>;
|
|
960
963
|
'aria-label': PropTypes.Requireable<string>;
|
|
964
|
+
selectId: PropTypes.Requireable<string>;
|
|
961
965
|
}> | PropTypes.InferProps<{
|
|
962
966
|
type: PropTypes.Requireable<string>;
|
|
963
967
|
title: PropTypes.Validator<string>;
|
|
@@ -58,6 +58,7 @@ declare namespace SearchPage {
|
|
|
58
58
|
modified: PropTypes.Requireable<boolean>;
|
|
59
59
|
error: PropTypes.Requireable<boolean>;
|
|
60
60
|
'aria-label': PropTypes.Requireable<string>;
|
|
61
|
+
selectId: PropTypes.Requireable<string>;
|
|
61
62
|
}>>;
|
|
62
63
|
onSearch: PropTypes.Requireable<(...args: any[]) => any>;
|
|
63
64
|
onToggleFilters: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/select/index.js"],"names":[],"mappings":";;;;;;;;AA6BA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/select/index.js"],"names":[],"mappings":";;;;;;;;AA6BA,qEA+JC"}
|
package/lib/atom/select/index.js
CHANGED
|
@@ -69,7 +69,8 @@ const Select = (props, legacyContext) => {
|
|
|
69
69
|
modified = false,
|
|
70
70
|
error = false,
|
|
71
71
|
title: propTitle,
|
|
72
|
-
'aria-label': ariaLabel
|
|
72
|
+
'aria-label': ariaLabel,
|
|
73
|
+
selectId
|
|
73
74
|
} = props;
|
|
74
75
|
const skin = (0, _provider.GetSkinFromContext)(legacyContext);
|
|
75
76
|
const title = (0, _react.useMemo)(() => propTitle ? `${propTitle}${required ? '*' : ''}` : null, [propTitle, required]);
|
|
@@ -118,28 +119,31 @@ const Select = (props, legacyContext) => {
|
|
|
118
119
|
const isLongLabel = (0, _react.useMemo)(() => labelSize >= 65, [labelSize]);
|
|
119
120
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
120
121
|
className: (0, _classnames.default)(composedClassName, theme === 'coorpmanager' ? _style.default.coorpmanager : null)
|
|
121
|
-
}, /*#__PURE__*/_react.default.createElement("label", {
|
|
122
|
+
}, /*#__PURE__*/_react.default.createElement("label", _extends({}, selectId ? {
|
|
123
|
+
htmlFor: selectId
|
|
124
|
+
} : {}, {
|
|
122
125
|
"data-name": "select-wrapper",
|
|
123
126
|
style: _extends({}, shouldUseSkinFontColor && {
|
|
124
127
|
color
|
|
125
128
|
}),
|
|
126
129
|
className: _style.default.selectWrapper
|
|
127
|
-
}, titleView, /*#__PURE__*/_react.default.createElement("span", {
|
|
130
|
+
}), titleView, /*#__PURE__*/_react.default.createElement("span", {
|
|
128
131
|
"data-name": "select-span",
|
|
129
132
|
className: (0, _classnames.default)(_style.default.selectSpan, (0, _includes.default)(theme, ['player', 'invalid', 'question', 'thematiques', 'template']) ? _style.default.noLabelCommon : null, borderClassName, isLongLabel ? _style.default.longLabel : null),
|
|
130
133
|
style: _extends({}, shouldUseSkinFontColor && {
|
|
131
134
|
color
|
|
132
135
|
})
|
|
133
|
-
}, selectedLabel), arrowView, /*#__PURE__*/_react.default.createElement("select", {
|
|
136
|
+
}, selectedLabel), arrowView, /*#__PURE__*/_react.default.createElement("select", _extends({}, selectId ? {
|
|
137
|
+
id: selectId
|
|
138
|
+
} : {}, {
|
|
134
139
|
"data-name": "native-select",
|
|
135
140
|
className: _style.default.selectBox,
|
|
136
|
-
title: selectedLabel,
|
|
137
141
|
name: name,
|
|
138
142
|
onChange: handleChange,
|
|
139
143
|
value: selected,
|
|
140
144
|
multiple: multiple,
|
|
141
145
|
disabled: disabled
|
|
142
|
-
}, optionList)), /*#__PURE__*/_react.default.createElement("div", {
|
|
146
|
+
}), optionList)), /*#__PURE__*/_react.default.createElement("div", {
|
|
143
147
|
className: _style.default.description
|
|
144
148
|
}, description));
|
|
145
149
|
};
|
|
@@ -168,7 +172,8 @@ Select.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
168
172
|
options: _propTypes.default.arrayOf(_propTypes.default.shape(SelectOptionPropTypes)),
|
|
169
173
|
modified: _propTypes.default.bool,
|
|
170
174
|
error: _propTypes.default.bool,
|
|
171
|
-
'aria-label': _propTypes.default.string
|
|
175
|
+
'aria-label': _propTypes.default.string,
|
|
176
|
+
selectId: _propTypes.default.string
|
|
172
177
|
} : {};
|
|
173
178
|
var _default = Select;
|
|
174
179
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["themeStyle","filter","style","invalid","header","mooc","question","sort","thematiques","player","template","coorpmanager","Select","props","legacyContext","name","options","className","borderClassName","onChange","multiple","disabled","required","description","theme","modified","error","title","propTitle","ariaLabel","skin","GetSkinFromContext","useMemo","optionList","map","option","index","value","selectOption","titleView","selected","get","find","selectedLabel","isSelectedInValidOption","getOr","validOption","handleChange","e","target","selectedOptions","black","color","shouldUseSkinFontColor","includes","arrowColor","undefined","arrowView","selectedArrow","arrow","behaviorClassName","getClassState","default","composedClassName","classnames","unselected","labelSize","size","isLongLabel","selectWrapper","selectSpan","noLabelCommon","longLabel","selectBox","SelectOptionPropTypes","PropTypes","string","isRequired","oneOfType","number","bool","contextTypes","Provider","childContextTypes","propTypes","func","oneOf","keys","arrayOf","shape"],"sources":["../../../src/atom/select/index.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport filter from 'lodash/fp/filter';\nimport find from 'lodash/fp/find';\nimport get from 'lodash/fp/get';\nimport getOr from 'lodash/fp/getOr';\nimport includes from 'lodash/fp/includes';\nimport keys from 'lodash/fp/keys';\nimport map from 'lodash/fp/map';\nimport size from 'lodash/fp/size';\nimport {NovaCompositionNavigationArrowDown as ArrowDown} from '@coorpacademy/nova-icons';\nimport Provider, {GetSkinFromContext} from '../provider';\nimport getClassState from '../../util/get-class-state';\nimport style from './style.css';\n\nconst themeStyle = {\n filter: style.filter,\n invalid: style.invalid,\n header: style.header,\n mooc: style.mooc,\n question: style.question,\n sort: style.sort,\n thematiques: style.thematiques,\n player: style.player,\n template: style.template,\n coorpmanager: null\n};\n\nconst Select = (props, legacyContext) => {\n const {\n name,\n options = [],\n className,\n borderClassName,\n onChange,\n multiple = false,\n disabled,\n required,\n description,\n theme,\n modified = false,\n error = false,\n title: propTitle,\n 'aria-label': ariaLabel\n } = props;\n\n const skin = GetSkinFromContext(legacyContext);\n const title = useMemo(\n () => (propTitle ? `${propTitle}${required ? '*' : ''}` : null),\n [propTitle, required]\n );\n\n const optionList =\n options &&\n options.map((option, index) => {\n return (\n <option key={index} value={option.value} className={style.selectOption}>\n {option.name}\n </option>\n );\n });\n\n const titleView = title ? <span className={style.title}>{title} </span> : null;\n\n const selected = useMemo(\n () =>\n multiple\n ? map(get('value'), filter({selected: true}, options))\n : get('value', find({selected: true}, options)),\n [multiple, options]\n );\n const selectedLabel = useMemo(\n () =>\n multiple\n ? map(get('name'), filter({selected: true}, options))\n : get('name', find({selected: true}, options)),\n [multiple, options]\n );\n\n const isSelectedInValidOption = useMemo(\n () =>\n theme === 'player' &&\n getOr(false, 'name', find({validOption: false, selected: true}, options)),\n [options, theme]\n );\n\n const handleChange = useMemo(\n () =>\n multiple\n ? e => {\n onChange(map(get('value'), e.target.selectedOptions));\n }\n : e => {\n onChange(e.target.value);\n },\n [onChange, multiple]\n );\n\n const black = useMemo(() => getOr('#14171A', 'common.black', skin), [skin]);\n const color = useMemo(() => getOr('#00B0FF', 'common.primary', skin), [skin]);\n const shouldUseSkinFontColor = useMemo(\n () =>\n !isSelectedInValidOption && selected && includes(theme, ['question', 'template', 'player']),\n [isSelectedInValidOption, selected, theme]\n );\n const arrowColor = selected ? color : undefined;\n\n const arrowView = !multiple ? (\n <ArrowDown\n color={includes(theme, ['question', 'template', 'player']) ? arrowColor : black}\n className={shouldUseSkinFontColor ? style.selectedArrow : style.arrow}\n aria-label={ariaLabel}\n data-testid=\"select-arrow-down-icon\"\n />\n ) : null;\n const behaviorClassName = useMemo(\n () => getClassState(style.default, style.modified, style.error, modified, error),\n [error, modified]\n );\n const composedClassName = useMemo(\n () =>\n classnames(\n theme && theme !== 'coorpmanager' ? themeStyle[theme] : behaviorClassName,\n selected ? style.selected : style.unselected,\n className\n ),\n [behaviorClassName, className, selected, theme]\n );\n\n const labelSize = useMemo(() => size(selectedLabel), [selectedLabel]);\n\n const isLongLabel = useMemo(() => labelSize >= 65, [labelSize]);\n\n return (\n <div\n className={classnames(\n composedClassName,\n theme === 'coorpmanager' ? style.coorpmanager : null\n )}\n >\n <label\n data-name=\"select-wrapper\"\n style={{\n ...(shouldUseSkinFontColor && {\n color\n })\n }}\n className={style.selectWrapper}\n >\n {titleView}\n <span\n data-name=\"select-span\"\n className={classnames(\n style.selectSpan,\n includes(theme, ['player', 'invalid', 'question', 'thematiques', 'template'])\n ? style.noLabelCommon\n : null,\n borderClassName,\n isLongLabel ? style.longLabel : null\n )}\n style={{\n ...(shouldUseSkinFontColor && {\n color\n })\n }}\n >\n {selectedLabel}\n </span>\n {arrowView}\n <select\n data-name=\"native-select\"\n className={style.selectBox}\n title={selectedLabel}\n name={name}\n onChange={handleChange}\n value={selected}\n multiple={multiple}\n disabled={disabled}\n >\n {optionList}\n </select>\n </label>\n <div className={style.description}>{description}</div>\n </div>\n );\n};\n\nexport const SelectOptionPropTypes = {\n name: PropTypes.string.isRequired,\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n selected: PropTypes.bool,\n validOption: PropTypes.bool\n};\n\nSelect.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nSelect.propTypes = {\n title: PropTypes.string,\n name: PropTypes.string,\n className: PropTypes.string,\n borderClassName: PropTypes.string,\n disabled: PropTypes.bool,\n multiple: PropTypes.bool,\n description: PropTypes.string,\n required: PropTypes.bool,\n onChange: PropTypes.func,\n theme: PropTypes.oneOf(keys(themeStyle)),\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes)),\n modified: PropTypes.bool,\n error: PropTypes.bool,\n 'aria-label': PropTypes.string\n};\n\nexport default Select;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAC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AAA,CAAUC,MAHJ;EAIjB1D,eAAe,EAAEyD,kBAAA,CAAUC,MAJV;EAKjBvD,QAAQ,EAAEsD,kBAAA,CAAUK,IALH;EAMjB5D,QAAQ,EAAEuD,kBAAA,CAAUK,IANH;EAOjBzD,WAAW,EAAEoD,kBAAA,CAAUC,MAPN;EAQjBtD,QAAQ,EAAEqD,kBAAA,CAAUK,IARH;EASjB7D,QAAQ,EAAEwD,kBAAA,CAAUU,IATH;EAUjB7D,KAAK,EAAEmD,kBAAA,CAAUW,KAAV,CAAgB,IAAAC,aAAA,EAAKvF,UAAL,CAAhB,CAVU;EAWjBgB,OAAO,EAAE2D,kBAAA,CAAUa,OAAV,CAAkBb,kBAAA,CAAUc,KAAV,CAAgBf,qBAAhB,CAAlB,CAXQ;EAYjBjD,QAAQ,EAAEkD,kBAAA,CAAUK,IAZH;EAajBtD,KAAK,EAAEiD,kBAAA,CAAUK,IAbA;EAcjB,cAAcL,kBAAA,CAAUC;AAdP,CAAnB;eAiBehE,M"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["themeStyle","filter","style","invalid","header","mooc","question","sort","thematiques","player","template","coorpmanager","Select","props","legacyContext","name","options","className","borderClassName","onChange","multiple","disabled","required","description","theme","modified","error","title","propTitle","ariaLabel","selectId","skin","GetSkinFromContext","useMemo","optionList","map","option","index","value","selectOption","titleView","selected","get","find","selectedLabel","isSelectedInValidOption","getOr","validOption","handleChange","e","target","selectedOptions","black","color","shouldUseSkinFontColor","includes","arrowColor","undefined","arrowView","selectedArrow","arrow","behaviorClassName","getClassState","default","composedClassName","classnames","unselected","labelSize","size","isLongLabel","htmlFor","selectWrapper","selectSpan","noLabelCommon","longLabel","id","selectBox","SelectOptionPropTypes","PropTypes","string","isRequired","oneOfType","number","bool","contextTypes","Provider","childContextTypes","propTypes","func","oneOf","keys","arrayOf","shape"],"sources":["../../../src/atom/select/index.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport filter from 'lodash/fp/filter';\nimport find from 'lodash/fp/find';\nimport get from 'lodash/fp/get';\nimport getOr from 'lodash/fp/getOr';\nimport includes from 'lodash/fp/includes';\nimport keys from 'lodash/fp/keys';\nimport map from 'lodash/fp/map';\nimport size from 'lodash/fp/size';\nimport {NovaCompositionNavigationArrowDown as ArrowDown} from '@coorpacademy/nova-icons';\nimport Provider, {GetSkinFromContext} from '../provider';\nimport getClassState from '../../util/get-class-state';\nimport style from './style.css';\n\nconst themeStyle = {\n filter: style.filter,\n invalid: style.invalid,\n header: style.header,\n mooc: style.mooc,\n question: style.question,\n sort: style.sort,\n thematiques: style.thematiques,\n player: style.player,\n template: style.template,\n coorpmanager: null\n};\n\nconst Select = (props, legacyContext) => {\n const {\n name,\n options = [],\n className,\n borderClassName,\n onChange,\n multiple = false,\n disabled,\n required,\n description,\n theme,\n modified = false,\n error = false,\n title: propTitle,\n 'aria-label': ariaLabel,\n selectId\n } = props;\n\n const skin = GetSkinFromContext(legacyContext);\n const title = useMemo(\n () => (propTitle ? `${propTitle}${required ? '*' : ''}` : null),\n [propTitle, required]\n );\n\n const optionList =\n options &&\n options.map((option, index) => {\n return (\n <option key={index} value={option.value} className={style.selectOption}>\n {option.name}\n </option>\n );\n });\n\n const titleView = title ? <span className={style.title}>{title} </span> : null;\n\n const selected = useMemo(\n () =>\n multiple\n ? map(get('value'), filter({selected: true}, options))\n : get('value', find({selected: true}, options)),\n [multiple, options]\n );\n const selectedLabel = useMemo(\n () =>\n multiple\n ? map(get('name'), filter({selected: true}, options))\n : get('name', find({selected: true}, options)),\n [multiple, options]\n );\n\n const isSelectedInValidOption = useMemo(\n () =>\n theme === 'player' &&\n getOr(false, 'name', find({validOption: false, selected: true}, options)),\n [options, theme]\n );\n\n const handleChange = useMemo(\n () =>\n multiple\n ? e => {\n onChange(map(get('value'), e.target.selectedOptions));\n }\n : e => {\n onChange(e.target.value);\n },\n [onChange, multiple]\n );\n\n const black = useMemo(() => getOr('#14171A', 'common.black', skin), [skin]);\n const color = useMemo(() => getOr('#00B0FF', 'common.primary', skin), [skin]);\n const shouldUseSkinFontColor = useMemo(\n () =>\n !isSelectedInValidOption && selected && includes(theme, ['question', 'template', 'player']),\n [isSelectedInValidOption, selected, theme]\n );\n const arrowColor = selected ? color : undefined;\n\n const arrowView = !multiple ? (\n <ArrowDown\n color={includes(theme, ['question', 'template', 'player']) ? arrowColor : black}\n className={shouldUseSkinFontColor ? style.selectedArrow : style.arrow}\n aria-label={ariaLabel}\n data-testid=\"select-arrow-down-icon\"\n />\n ) : null;\n const behaviorClassName = useMemo(\n () => getClassState(style.default, style.modified, style.error, modified, error),\n [error, modified]\n );\n const composedClassName = useMemo(\n () =>\n classnames(\n theme && theme !== 'coorpmanager' ? themeStyle[theme] : behaviorClassName,\n selected ? style.selected : style.unselected,\n className\n ),\n [behaviorClassName, className, selected, theme]\n );\n\n const labelSize = useMemo(() => size(selectedLabel), [selectedLabel]);\n\n const isLongLabel = useMemo(() => labelSize >= 65, [labelSize]);\n\n return (\n <div\n className={classnames(\n composedClassName,\n theme === 'coorpmanager' ? style.coorpmanager : null\n )}\n >\n <label\n {...(selectId ? {htmlFor: selectId} : {})}\n data-name=\"select-wrapper\"\n style={{\n ...(shouldUseSkinFontColor && {\n color\n })\n }}\n className={style.selectWrapper}\n >\n {titleView}\n <span\n data-name=\"select-span\"\n className={classnames(\n style.selectSpan,\n includes(theme, ['player', 'invalid', 'question', 'thematiques', 'template'])\n ? style.noLabelCommon\n : null,\n borderClassName,\n isLongLabel ? style.longLabel : null\n )}\n style={{\n ...(shouldUseSkinFontColor && {\n color\n })\n }}\n >\n {selectedLabel}\n </span>\n {arrowView}\n <select\n {...(selectId ? {id: selectId} : {})}\n data-name=\"native-select\"\n className={style.selectBox}\n name={name}\n onChange={handleChange}\n value={selected}\n multiple={multiple}\n disabled={disabled}\n >\n {optionList}\n </select>\n </label>\n <div className={style.description}>{description}</div>\n </div>\n );\n};\n\nexport const SelectOptionPropTypes = {\n name: PropTypes.string.isRequired,\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n selected: PropTypes.bool,\n validOption: PropTypes.bool\n};\n\nSelect.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nSelect.propTypes = {\n title: PropTypes.string,\n name: PropTypes.string,\n className: PropTypes.string,\n borderClassName: PropTypes.string,\n disabled: PropTypes.bool,\n multiple: PropTypes.bool,\n description: PropTypes.string,\n required: PropTypes.bool,\n onChange: PropTypes.func,\n theme: PropTypes.oneOf(keys(themeStyle)),\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes)),\n modified: PropTypes.bool,\n error: PropTypes.bool,\n 'aria-label': PropTypes.string,\n selectId: PropTypes.string\n};\n\nexport default Select;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,UAAU,GAAG;EACjBC,MAAM,EAAEC,cAAA,CAAMD,MADG;EAEjBE,OAAO,EAAED,cAAA,CAAMC,OAFE;EAGjBC,MAAM,EAAEF,cAAA,CAAME,MAHG;EAIjBC,IAAI,EAAEH,cAAA,CAAMG,IAJK;EAKjBC,QAAQ,EAAEJ,cAAA,CAAMI,QALC;EAMjBC,IAAI,EAAEL,cAAA,CAAMK,IANK;EAOjBC,WAAW,EAAEN,cAAA,CAAMM,WAPF;EAQjBC,MAAM,EAAEP,cAAA,CAAMO,MARG;EASjBC,QAAQ,EAAER,cAAA,CAAMQ,QATC;EAUjBC,YAAY,EAAE;AAVG,CAAnB;;AAaA,MAAMC,MAAM,GAAG,CAACC,KAAD,EAAQC,aAAR,KAA0B;EACvC,MAAM;IACJC,IADI;IAEJC,OAAO,GAAG,EAFN;IAGJC,SAHI;IAIJC,eAJI;IAKJC,QALI;IAMJC,QAAQ,GAAG,KANP;IAOJC,QAPI;IAQJC,QARI;IASJC,WATI;IAUJC,KAVI;IAWJC,QAAQ,G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,cAAcL,kBAAA,CAAUC,MAdP;EAejBjD,QAAQ,EAAEgD,kBAAA,CAAUC;AAfH,CAAnB;eAkBenE,M"}
|
|
@@ -99,6 +99,7 @@ declare namespace BrandFormGroup {
|
|
|
99
99
|
modified: PropTypes.Requireable<boolean>;
|
|
100
100
|
error: PropTypes.Requireable<boolean>;
|
|
101
101
|
'aria-label': PropTypes.Requireable<string>;
|
|
102
|
+
selectId: PropTypes.Requireable<string>;
|
|
102
103
|
}> | PropTypes.InferProps<{
|
|
103
104
|
type: PropTypes.Requireable<string>;
|
|
104
105
|
title: PropTypes.Validator<string>;
|
|
@@ -203,6 +204,7 @@ declare namespace BrandFormGroup {
|
|
|
203
204
|
modified: PropTypes.Requireable<boolean>;
|
|
204
205
|
error: PropTypes.Requireable<boolean>;
|
|
205
206
|
'aria-label': PropTypes.Requireable<string>;
|
|
207
|
+
selectId: PropTypes.Requireable<string>;
|
|
206
208
|
}> | PropTypes.InferProps<{
|
|
207
209
|
type: PropTypes.Requireable<string>;
|
|
208
210
|
title: PropTypes.Validator<string>;
|
|
@@ -31,6 +31,7 @@ declare class Filters extends React.Component<any, any, any> {
|
|
|
31
31
|
modified: PropTypes.Requireable<boolean>;
|
|
32
32
|
error: PropTypes.Requireable<boolean>;
|
|
33
33
|
'aria-label': PropTypes.Requireable<string>;
|
|
34
|
+
selectId: PropTypes.Requireable<string>;
|
|
34
35
|
}>>;
|
|
35
36
|
onSearch: PropTypes.Requireable<(...args: any[]) => any>;
|
|
36
37
|
onToggleFilters: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/filters/index.js"],"names":[],"mappings":";AASA;IACE
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/filters/index.js"],"names":[],"mappings":";AASA;IACE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAcE;IAEF;;;;;;;;;;;;;;;;;;;;;;MAEE;IAEF,wBASC;IAPC;;;MAGC;IAMH,yBAcC;IAED,uBAYC;IAED,qBAOC;IAED,sBAsFC;CACF"}
|
|
@@ -57,6 +57,7 @@ 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>;
|
|
60
61
|
}> | PropTypes.InferProps<{
|
|
61
62
|
type: PropTypes.Requireable<string>;
|
|
62
63
|
title: PropTypes.Validator<string>;
|
|
@@ -70,6 +70,7 @@ declare namespace SetupSlider {
|
|
|
70
70
|
modified: PropTypes.Requireable<boolean>;
|
|
71
71
|
error: PropTypes.Requireable<boolean>;
|
|
72
72
|
'aria-label': PropTypes.Requireable<string>;
|
|
73
|
+
selectId: PropTypes.Requireable<string>;
|
|
73
74
|
}> | PropTypes.InferProps<{
|
|
74
75
|
type: PropTypes.Requireable<string>;
|
|
75
76
|
title: PropTypes.Validator<string>;
|
|
@@ -129,6 +129,7 @@ declare namespace BrandForm {
|
|
|
129
129
|
modified: PropTypes.Requireable<boolean>;
|
|
130
130
|
error: PropTypes.Requireable<boolean>;
|
|
131
131
|
'aria-label': PropTypes.Requireable<string>;
|
|
132
|
+
selectId: PropTypes.Requireable<string>;
|
|
132
133
|
}> | PropTypes.InferProps<{
|
|
133
134
|
type: PropTypes.Requireable<string>;
|
|
134
135
|
title: PropTypes.Validator<string>;
|
|
@@ -233,6 +234,7 @@ declare namespace BrandForm {
|
|
|
233
234
|
modified: PropTypes.Requireable<boolean>;
|
|
234
235
|
error: PropTypes.Requireable<boolean>;
|
|
235
236
|
'aria-label': PropTypes.Requireable<string>;
|
|
237
|
+
selectId: PropTypes.Requireable<string>;
|
|
236
238
|
}> | PropTypes.InferProps<{
|
|
237
239
|
type: PropTypes.Requireable<string>;
|
|
238
240
|
title: PropTypes.Validator<string>;
|
|
@@ -146,6 +146,7 @@ declare namespace WizardContents {
|
|
|
146
146
|
modified: PropTypes.Requireable<boolean>;
|
|
147
147
|
error: PropTypes.Requireable<boolean>;
|
|
148
148
|
'aria-label': PropTypes.Requireable<string>;
|
|
149
|
+
selectId: PropTypes.Requireable<string>;
|
|
149
150
|
}> | PropTypes.InferProps<{
|
|
150
151
|
type: PropTypes.Requireable<string>;
|
|
151
152
|
title: PropTypes.Validator<string>;
|
|
@@ -250,6 +251,7 @@ declare namespace WizardContents {
|
|
|
250
251
|
modified: PropTypes.Requireable<boolean>;
|
|
251
252
|
error: PropTypes.Requireable<boolean>;
|
|
252
253
|
'aria-label': PropTypes.Requireable<string>;
|
|
254
|
+
selectId: PropTypes.Requireable<string>;
|
|
253
255
|
}> | PropTypes.InferProps<{
|
|
254
256
|
type: PropTypes.Requireable<string>;
|
|
255
257
|
title: PropTypes.Validator<string>;
|
|
@@ -231,6 +231,7 @@ declare namespace BrandUpdate {
|
|
|
231
231
|
modified: PropTypes.Requireable<boolean>;
|
|
232
232
|
error: PropTypes.Requireable<boolean>;
|
|
233
233
|
'aria-label': PropTypes.Requireable<string>;
|
|
234
|
+
selectId: PropTypes.Requireable<string>;
|
|
234
235
|
}> | PropTypes.InferProps<{
|
|
235
236
|
type: PropTypes.Requireable<string>;
|
|
236
237
|
title: PropTypes.Validator<string>;
|
|
@@ -335,6 +336,7 @@ declare namespace BrandUpdate {
|
|
|
335
336
|
modified: PropTypes.Requireable<boolean>;
|
|
336
337
|
error: PropTypes.Requireable<boolean>;
|
|
337
338
|
'aria-label': PropTypes.Requireable<string>;
|
|
339
|
+
selectId: PropTypes.Requireable<string>;
|
|
338
340
|
}> | PropTypes.InferProps<{
|
|
339
341
|
type: PropTypes.Requireable<string>;
|
|
340
342
|
title: PropTypes.Validator<string>;
|
|
@@ -854,6 +856,7 @@ declare namespace BrandUpdate {
|
|
|
854
856
|
modified: PropTypes.Requireable<boolean>;
|
|
855
857
|
error: PropTypes.Requireable<boolean>;
|
|
856
858
|
'aria-label': PropTypes.Requireable<string>;
|
|
859
|
+
selectId: PropTypes.Requireable<string>;
|
|
857
860
|
}> | PropTypes.InferProps<{
|
|
858
861
|
type: PropTypes.Requireable<string>;
|
|
859
862
|
title: PropTypes.Validator<string>;
|
|
@@ -958,6 +961,7 @@ declare namespace BrandUpdate {
|
|
|
958
961
|
modified: PropTypes.Requireable<boolean>;
|
|
959
962
|
error: PropTypes.Requireable<boolean>;
|
|
960
963
|
'aria-label': PropTypes.Requireable<string>;
|
|
964
|
+
selectId: PropTypes.Requireable<string>;
|
|
961
965
|
}> | PropTypes.InferProps<{
|
|
962
966
|
type: PropTypes.Requireable<string>;
|
|
963
967
|
title: PropTypes.Validator<string>;
|
|
@@ -58,6 +58,7 @@ declare namespace SearchPage {
|
|
|
58
58
|
modified: PropTypes.Requireable<boolean>;
|
|
59
59
|
error: PropTypes.Requireable<boolean>;
|
|
60
60
|
'aria-label': PropTypes.Requireable<string>;
|
|
61
|
+
selectId: PropTypes.Requireable<string>;
|
|
61
62
|
}>>;
|
|
62
63
|
onSearch: PropTypes.Requireable<(...args: any[]) => any>;
|
|
63
64
|
onToggleFilters: PropTypes.Requireable<(...args: any[]) => any>;
|
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.33+bb14450df",
|
|
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": "bb14450df76582ad7e8703194b7942aa4a61d3d0"
|
|
164
164
|
}
|
package/locales/.mtslconfig.json
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"ignore_dirs":[]}
|