@coorpacademy/components 11.4.5-alpha.32 → 11.4.5-alpha.34

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.
@@ -51,6 +51,7 @@ declare namespace Select {
51
51
  modified: PropTypes.Requireable<boolean>;
52
52
  error: PropTypes.Requireable<boolean>;
53
53
  'aria-label': PropTypes.Requireable<string>;
54
+ selectId: PropTypes.Requireable<string>;
54
55
  };
55
56
  }
56
57
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/select/index.js"],"names":[],"mappings":";;;;;;;;AA6BA,qEA6JC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/select/index.js"],"names":[],"mappings":";;;;;;;;AA6BA,qEAmKC"}
@@ -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]);
@@ -54,9 +55,11 @@ const Select = (props, legacyContext) => {
54
55
  className: style.selectOption
55
56
  }, option.name);
56
57
  });
57
- const titleView = title ? /*#__PURE__*/React.createElement("span", {
58
+ const titleView = selectId ? /*#__PURE__*/React.createElement("div", {
58
59
  className: style.title
59
- }, title, " ") : null;
60
+ }, title, " ") : /*#__PURE__*/React.createElement("span", {
61
+ className: style.title
62
+ }, title, " ") || null;
60
63
  const selected = useMemo(() => multiple ? map(get('value'), filter({
61
64
  selected: true
62
65
  }, options)) : get('value', find({
@@ -92,28 +95,31 @@ const Select = (props, legacyContext) => {
92
95
  const isLongLabel = useMemo(() => labelSize >= 65, [labelSize]);
93
96
  return /*#__PURE__*/React.createElement("div", {
94
97
  className: classnames(composedClassName, theme === 'coorpmanager' ? style.coorpmanager : null)
95
- }, /*#__PURE__*/React.createElement("label", {
98
+ }, /*#__PURE__*/React.createElement("label", _extends({}, selectId ? {
99
+ htmlFor: selectId
100
+ } : {}, {
96
101
  "data-name": "select-wrapper",
97
102
  style: _extends({}, shouldUseSkinFontColor && {
98
103
  color
99
104
  }),
100
105
  className: style.selectWrapper
101
- }, titleView, /*#__PURE__*/React.createElement("span", {
106
+ }), titleView, /*#__PURE__*/React.createElement("span", {
102
107
  "data-name": "select-span",
103
108
  className: classnames(style.selectSpan, includes(theme, ['player', 'invalid', 'question', 'thematiques', 'template']) ? style.noLabelCommon : null, borderClassName, isLongLabel ? style.longLabel : null),
104
109
  style: _extends({}, shouldUseSkinFontColor && {
105
110
  color
106
111
  })
107
- }, selectedLabel), arrowView, /*#__PURE__*/React.createElement("select", {
112
+ }, selectedLabel), arrowView, /*#__PURE__*/React.createElement("select", _extends({}, selectId ? {
113
+ id: selectId
114
+ } : {}, {
108
115
  "data-name": "native-select",
109
116
  className: style.selectBox,
110
- title: selectedLabel,
111
117
  name: name,
112
118
  onChange: handleChange,
113
119
  value: selected,
114
120
  multiple: multiple,
115
121
  disabled: disabled
116
- }, optionList)), /*#__PURE__*/React.createElement("div", {
122
+ }), optionList)), /*#__PURE__*/React.createElement("div", {
117
123
  className: style.description
118
124
  }, description));
119
125
  };
@@ -141,7 +147,8 @@ Select.propTypes = process.env.NODE_ENV !== "production" ? {
141
147
  options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes)),
142
148
  modified: PropTypes.bool,
143
149
  error: PropTypes.bool,
144
- 'aria-label': PropTypes.string
150
+ 'aria-label': PropTypes.string,
151
+ selectId: PropTypes.string
145
152
  } : {};
146
153
  export default Select;
147
154
  //# 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,G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JV;EAKjB5C,QAAQ,EAAEnC,SAAS,CAACmF,IALH;EAMjBjD,QAAQ,EAAElC,SAAS,CAACmF,IANH;EAOjB9C,WAAW,EAAErC,SAAS,CAAC+E,MAPN;EAQjB3C,QAAQ,EAAEpC,SAAS,CAACmF,IARH;EASjBlD,QAAQ,EAAEjC,SAAS,CAACuF,IATH;EAUjBjD,KAAK,EAAEtC,SAAS,CAACwF,KAAV,CAAgBjF,IAAI,CAACS,UAAD,CAApB,CAVU;EAWjBc,OAAO,EAAE9B,SAAS,CAACyF,OAAV,CAAkBzF,SAAS,CAAC0F,KAAV,CAAgBZ,qBAAhB,CAAlB,CAXQ;EAYjBvC,QAAQ,EAAEvC,SAAS,CAACmF,IAZH;EAajB3C,KAAK,EAAExC,SAAS,CAACmF,IAbA;EAcjB,cAAcnF,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 = selectId ? (\n <div className={style.title}>{title} </div>\n ) : (\n <span className={style.title}>{title} </span> || null\n );\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,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;EAM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F,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAcE;IAEF;;;;;;;;;;;;;;;;;;;;;;MAEE;IAEF,wBASC;IAPC;;;MAGC;IAMH,yBAcC;IAED,uBAYC;IAED,qBAOC;IAED,sBAsFC;CACF"}
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>;
@@ -51,6 +51,7 @@ declare namespace Select {
51
51
  modified: PropTypes.Requireable<boolean>;
52
52
  error: PropTypes.Requireable<boolean>;
53
53
  'aria-label': PropTypes.Requireable<string>;
54
+ selectId: PropTypes.Requireable<string>;
54
55
  };
55
56
  }
56
57
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/select/index.js"],"names":[],"mappings":";;;;;;;;AA6BA,qEA6JC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/select/index.js"],"names":[],"mappings":";;;;;;;;AA6BA,qEAmKC"}
@@ -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]);
@@ -80,9 +81,11 @@ const Select = (props, legacyContext) => {
80
81
  className: _style.default.selectOption
81
82
  }, option.name);
82
83
  });
83
- const titleView = title ? /*#__PURE__*/_react.default.createElement("span", {
84
+ const titleView = selectId ? /*#__PURE__*/_react.default.createElement("div", {
84
85
  className: _style.default.title
85
- }, title, " ") : null;
86
+ }, title, " ") : /*#__PURE__*/_react.default.createElement("span", {
87
+ className: _style.default.title
88
+ }, title, " ") || null;
86
89
  const selected = (0, _react.useMemo)(() => multiple ? (0, _map.default)((0, _get.default)('value'), (0, _filter.default)({
87
90
  selected: true
88
91
  }, options)) : (0, _get.default)('value', (0, _find.default)({
@@ -118,28 +121,31 @@ const Select = (props, legacyContext) => {
118
121
  const isLongLabel = (0, _react.useMemo)(() => labelSize >= 65, [labelSize]);
119
122
  return /*#__PURE__*/_react.default.createElement("div", {
120
123
  className: (0, _classnames.default)(composedClassName, theme === 'coorpmanager' ? _style.default.coorpmanager : null)
121
- }, /*#__PURE__*/_react.default.createElement("label", {
124
+ }, /*#__PURE__*/_react.default.createElement("label", _extends({}, selectId ? {
125
+ htmlFor: selectId
126
+ } : {}, {
122
127
  "data-name": "select-wrapper",
123
128
  style: _extends({}, shouldUseSkinFontColor && {
124
129
  color
125
130
  }),
126
131
  className: _style.default.selectWrapper
127
- }, titleView, /*#__PURE__*/_react.default.createElement("span", {
132
+ }), titleView, /*#__PURE__*/_react.default.createElement("span", {
128
133
  "data-name": "select-span",
129
134
  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
135
  style: _extends({}, shouldUseSkinFontColor && {
131
136
  color
132
137
  })
133
- }, selectedLabel), arrowView, /*#__PURE__*/_react.default.createElement("select", {
138
+ }, selectedLabel), arrowView, /*#__PURE__*/_react.default.createElement("select", _extends({}, selectId ? {
139
+ id: selectId
140
+ } : {}, {
134
141
  "data-name": "native-select",
135
142
  className: _style.default.selectBox,
136
- title: selectedLabel,
137
143
  name: name,
138
144
  onChange: handleChange,
139
145
  value: selected,
140
146
  multiple: multiple,
141
147
  disabled: disabled
142
- }, optionList)), /*#__PURE__*/_react.default.createElement("div", {
148
+ }), optionList)), /*#__PURE__*/_react.default.createElement("div", {
143
149
  className: _style.default.description
144
150
  }, description));
145
151
  };
@@ -168,7 +174,8 @@ Select.propTypes = process.env.NODE_ENV !== "production" ? {
168
174
  options: _propTypes.default.arrayOf(_propTypes.default.shape(SelectOptionPropTypes)),
169
175
  modified: _propTypes.default.bool,
170
176
  error: _propTypes.default.bool,
171
- 'aria-label': _propTypes.default.string
177
+ 'aria-label': _propTypes.default.string,
178
+ selectId: _propTypes.default.string
172
179
  } : {};
173
180
  var _default = Select;
174
181
  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;;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,GAAG,KAXP;IAYJC,KAAK,GAAG,KAZJ;IAaJC,KAAK,EAAEC,SAbH;IAcJ,cAAcC;EAdV,IAeFhB,KAfJ;EAiBA,MAAMiB,IAAI,GAAG,IAAAC,4BAAA,EAAmBjB,aAAnB,CAAb;EACA,MAAMa,KAAK,GAAG,IAAAK,cAAA,EACZ,MAAOJ,SAAS,GAAI,GAAEA,SAAU,GAAEN,QAAQ,GAAG,GAAH,GAAS,EAAG,EAAtC,GAA0C,IAD9C,EAEZ,CAACM,SAA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I,EAAEoD,iBAAA,CAASC,iBAAT,CAA2BrD;AADb,CAAtB;AAIAlB,MAAM,CAACwE,SAAP,2CAAmB;EACjBzD,KAAK,EAAEgD,kBAAA,CAAUC,MADA;EAEjB7D,IAAI,EAAE4D,kBAAA,CAAUC,MAFC;EAGjB3D,SAAS,EAAE0D,kBAAA,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 = selectId ? (\n <div className={style.title}>{title} </div>\n ) : (\n <span className={style.title}>{title} </span> || null\n );\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;;AAa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IATH;EAUjBhE,KAAK,EAAEsD,kBAAA,CAAUW,KAAV,CAAgB,IAAAC,aAAA,EAAK1F,UAAL,CAAhB,CAVU;EAWjBgB,OAAO,EAAE8D,kBAAA,CAAUa,OAAV,CAAkBb,kBAAA,CAAUc,KAAV,CAAgBf,qBAAhB,CAAlB,CAXQ;EAYjBpD,QAAQ,EAAEqD,kBAAA,CAAUK,IAZH;EAajBzD,KAAK,EAAEoD,kBAAA,CAAUK,IAbA;EAcjB,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAcE;IAEF;;;;;;;;;;;;;;;;;;;;;;MAEE;IAEF,wBASC;IAPC;;;MAGC;IAMH,yBAcC;IAED,uBAYC;IAED,qBAOC;IAED,sBAsFC;CACF"}
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.32+74f8b9519",
3
+ "version": "11.4.5-alpha.34+573c938aa",
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": "74f8b9519020a7e3e081882a7ea1297da7e37361"
163
+ "gitHead": "573c938aa157b1dce43796312aac3121cc7ed952"
164
164
  }
@@ -1 +0,0 @@
1
- {"ignore_dirs":[]}