@coorpacademy/components 11.4.5-alpha.39.37 → 11.4.5-alpha.40
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 +8 -2
- package/es/atom/select/index.d.ts.map +1 -1
- package/es/atom/select/index.js +19 -13
- package/es/atom/select/index.js.map +1 -1
- package/es/molecule/brand-form-group/index.d.ts +8 -4
- package/es/molecule/filters/index.d.ts +4 -2
- package/es/molecule/filters/index.d.ts.map +1 -1
- package/es/molecule/setup-slide/index.d.ts +4 -2
- package/es/molecule/setup-slider/index.d.ts +4 -2
- package/es/organism/brand-form/index.d.ts +8 -4
- package/es/organism/wizard-contents/index.d.ts +8 -4
- package/es/template/back-office/brand-update/index.d.ts +16 -8
- package/es/template/common/search-page/index.d.ts +4 -2
- package/lib/atom/select/index.d.ts +8 -2
- package/lib/atom/select/index.d.ts.map +1 -1
- package/lib/atom/select/index.js +21 -14
- package/lib/atom/select/index.js.map +1 -1
- package/lib/molecule/brand-form-group/index.d.ts +8 -4
- package/lib/molecule/filters/index.d.ts +4 -2
- package/lib/molecule/filters/index.d.ts.map +1 -1
- package/lib/molecule/setup-slide/index.d.ts +4 -2
- package/lib/molecule/setup-slider/index.d.ts +4 -2
- package/lib/organism/brand-form/index.d.ts +8 -4
- package/lib/organism/wizard-contents/index.d.ts +8 -4
- package/lib/template/back-office/brand-update/index.d.ts +16 -8
- package/lib/template/common/search-page/index.d.ts +4 -2
- package/package.json +2 -2
|
@@ -4,6 +4,10 @@ export namespace SelectOptionPropTypes {
|
|
|
4
4
|
const selected: PropTypes.Requireable<boolean>;
|
|
5
5
|
const validOption: PropTypes.Requireable<boolean>;
|
|
6
6
|
}
|
|
7
|
+
export namespace CreateBattleLabelParameters {
|
|
8
|
+
const htmlFor: PropTypes.Requireable<string>;
|
|
9
|
+
const className: PropTypes.Requireable<string>;
|
|
10
|
+
}
|
|
7
11
|
export default Select;
|
|
8
12
|
import PropTypes from "prop-types";
|
|
9
13
|
declare function Select(props: any, legacyContext: any): JSX.Element;
|
|
@@ -51,8 +55,10 @@ declare namespace Select {
|
|
|
51
55
|
modified: PropTypes.Requireable<boolean>;
|
|
52
56
|
error: PropTypes.Requireable<boolean>;
|
|
53
57
|
'aria-label': PropTypes.Requireable<string>;
|
|
54
|
-
|
|
55
|
-
|
|
58
|
+
createBattleLabelParameters: PropTypes.Requireable<PropTypes.InferProps<{
|
|
59
|
+
htmlFor: PropTypes.Requireable<string>;
|
|
60
|
+
className: PropTypes.Requireable<string>;
|
|
61
|
+
}>>;
|
|
56
62
|
};
|
|
57
63
|
}
|
|
58
64
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/select/index.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/select/index.js"],"names":[],"mappings":";;;;;;;;;;;;AA6BA,qEAuKC"}
|
package/es/atom/select/index.js
CHANGED
|
@@ -44,9 +44,12 @@ const Select = (props, legacyContext) => {
|
|
|
44
44
|
error = false,
|
|
45
45
|
title: propTitle,
|
|
46
46
|
'aria-label': ariaLabel,
|
|
47
|
-
|
|
48
|
-
titleClassName
|
|
47
|
+
createBattleLabelParameters
|
|
49
48
|
} = props;
|
|
49
|
+
const {
|
|
50
|
+
htmlFor: battleLabelHtmlFor,
|
|
51
|
+
className: battleLabelClassName
|
|
52
|
+
} = createBattleLabelParameters;
|
|
50
53
|
const skin = GetSkinFromContext(legacyContext);
|
|
51
54
|
const title = useMemo(() => propTitle ? `${propTitle}${required ? '*' : ''}` : null, [propTitle, required]);
|
|
52
55
|
const optionList = options && options.map((option, index) => {
|
|
@@ -58,9 +61,9 @@ const Select = (props, legacyContext) => {
|
|
|
58
61
|
});
|
|
59
62
|
let titleView = null;
|
|
60
63
|
|
|
61
|
-
if (
|
|
64
|
+
if (battleLabelClassName && title) {
|
|
62
65
|
titleView = /*#__PURE__*/React.createElement("div", {
|
|
63
|
-
className:
|
|
66
|
+
className: battleLabelClassName
|
|
64
67
|
}, title, " ");
|
|
65
68
|
} else if (title) {
|
|
66
69
|
titleView = /*#__PURE__*/React.createElement("span", {
|
|
@@ -101,7 +104,9 @@ const Select = (props, legacyContext) => {
|
|
|
101
104
|
const composedClassName = useMemo(() => classnames(theme && theme !== 'coorpmanager' ? themeStyle[theme] : behaviorClassName, selected ? style.selected : style.unselected, className), [behaviorClassName, className, selected, theme]);
|
|
102
105
|
const labelSize = useMemo(() => size(selectedLabel), [selectedLabel]);
|
|
103
106
|
const isLongLabel = useMemo(() => labelSize >= 65, [labelSize]);
|
|
104
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
107
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", battleLabelHtmlFor ? {
|
|
108
|
+
htmlFor: battleLabelHtmlFor
|
|
109
|
+
} : {}, titleView), /*#__PURE__*/React.createElement("div", {
|
|
105
110
|
className: classnames(composedClassName, theme === 'coorpmanager' ? style.coorpmanager : null)
|
|
106
111
|
}, /*#__PURE__*/React.createElement("div", {
|
|
107
112
|
"data-name": "select-wrapper",
|
|
@@ -109,16 +114,14 @@ const Select = (props, legacyContext) => {
|
|
|
109
114
|
color
|
|
110
115
|
}),
|
|
111
116
|
className: style.selectWrapper
|
|
112
|
-
}, /*#__PURE__*/React.createElement("
|
|
113
|
-
htmlFor: selectId
|
|
114
|
-
} : {}, titleView), /*#__PURE__*/React.createElement("span", {
|
|
117
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
115
118
|
"data-name": "select-span",
|
|
116
119
|
className: classnames(style.selectSpan, includes(theme, ['player', 'invalid', 'question', 'thematiques', 'template']) ? style.noLabelCommon : null, borderClassName, isLongLabel ? style.longLabel : null),
|
|
117
120
|
style: _extends({}, shouldUseSkinFontColor && {
|
|
118
121
|
color
|
|
119
122
|
})
|
|
120
|
-
}, selectedLabel), arrowView, /*#__PURE__*/React.createElement("select", _extends({},
|
|
121
|
-
id:
|
|
123
|
+
}, selectedLabel), arrowView, /*#__PURE__*/React.createElement("select", _extends({}, battleLabelHtmlFor ? {
|
|
124
|
+
id: battleLabelHtmlFor
|
|
122
125
|
} : {}, {
|
|
123
126
|
"data-name": "native-select",
|
|
124
127
|
className: style.selectBox,
|
|
@@ -129,7 +132,7 @@ const Select = (props, legacyContext) => {
|
|
|
129
132
|
disabled: disabled
|
|
130
133
|
}), optionList)), /*#__PURE__*/React.createElement("div", {
|
|
131
134
|
className: style.description
|
|
132
|
-
}, description));
|
|
135
|
+
}, description)));
|
|
133
136
|
};
|
|
134
137
|
|
|
135
138
|
export const SelectOptionPropTypes = {
|
|
@@ -138,6 +141,10 @@ export const SelectOptionPropTypes = {
|
|
|
138
141
|
selected: PropTypes.bool,
|
|
139
142
|
validOption: PropTypes.bool
|
|
140
143
|
};
|
|
144
|
+
export const CreateBattleLabelParameters = {
|
|
145
|
+
htmlFor: PropTypes.string,
|
|
146
|
+
className: PropTypes.string
|
|
147
|
+
};
|
|
141
148
|
Select.contextTypes = {
|
|
142
149
|
skin: Provider.childContextTypes.skin
|
|
143
150
|
};
|
|
@@ -156,8 +163,7 @@ Select.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
156
163
|
modified: PropTypes.bool,
|
|
157
164
|
error: PropTypes.bool,
|
|
158
165
|
'aria-label': PropTypes.string,
|
|
159
|
-
|
|
160
|
-
titleClassName: PropTypes.string
|
|
166
|
+
createBattleLabelParameters: PropTypes.shape(CreateBattleLabelParameters)
|
|
161
167
|
} : {};
|
|
162
168
|
export default Select;
|
|
163
169
|
//# 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","selectId","titleClassName","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","htmlFor","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 titleClassName\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 let titleView = null;\n if (selectId) {\n titleView = <div className={titleClassName}>{title} </div>;\n } else if (title) {\n titleView = <span className={style.title}>{title} </span>;\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 <div\n data-name=\"select-wrapper\"\n style={{\n ...(shouldUseSkinFontColor && {\n color\n })\n }}\n className={style.selectWrapper}\n >\n <label {...(selectId ? {htmlFor: selectId} : {})}>{titleView}</label>\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 </div>\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 titleClassName: 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,OA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ACsF,MAA7B,CAApB,CAF4B;EAGnCjC,QAAQ,EAAErD,SAAS,CAACuF,IAHe;EAInC/B,WAAW,EAAExD,SAAS,CAACuF;AAJY,CAA9B;AAOP7D,MAAM,CAAC8D,YAAP,GAAsB;EACpB1C,IAAI,EAAElC,QAAQ,CAAC6E,iBAAT,CAA2B3C;AADb,CAAtB;AAIApB,MAAM,CAACgE,SAAP,2CAAmB;EACjBjD,KAAK,EAAEzC,SAAS,CAACmF,MADA;EAEjBtD,IAAI,EAAE7B,SAAS,CAACmF,MAFC;EAGjBpD,SAAS,EAAE/B,SAAS,CAACmF,MAHJ;EAIjBnD,eAAe,EAAEhC,SAAS,CAACmF,MAJV;EAKjBhD,QAAQ,EAAEnC,SAAS,CAACuF,IALH;EAMjBrD,QAAQ,EAAElC,SAAS,CAACuF,IANH;EAOjBlD,WAAW,EAAErC,SAAS,CAACmF,MAPN;EAQjB/C,QAAQ,EAAEpC,SAAS,CAACuF,IARH;EASjBtD,QAAQ,EAAEjC,SAAS,CAAC2F,IATH;EAUjBrD,KAAK,EAAEtC,SAAS,CAAC4F,KAAV,CAAgBrF,IAAI,CAACS,UAAD,CAApB,CAVU;EAWjBc,OAAO,EAAE9B,SAAS,CAAC6F,OAAV,CAAkB7F,SAAS,CAAC8F,KAAV,CAAgBZ,qBAAhB,CAAlB,CAXQ;EAYjB3C,QAAQ,EAAEvC,SAAS,CAACuF,IAZH;EAajB/C,KAAK,EAAExC,SAAS,CAACuF,IAbA;EAcjB,cAAcvF,SAAS,CAACmF,MAdP;EAejBvC,QAAQ,EAAE5C,SAAS,CAACmF,MAfH;EAgBjBtC,cAAc,EAAE7C,SAAS,CAACmF;AAhBT,CAAnB;AAmBA,eAAezD,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","createBattleLabelParameters","htmlFor","battleLabelHtmlFor","battleLabelClassName","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","id","selectBox","SelectOptionPropTypes","string","isRequired","oneOfType","number","bool","CreateBattleLabelParameters","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 createBattleLabelParameters\n } = props;\n\n const {htmlFor: battleLabelHtmlFor, className: battleLabelClassName} =\n createBattleLabelParameters;\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 let titleView = null;\n if (battleLabelClassName && title) {\n titleView = <div className={battleLabelClassName}>{title} </div>;\n } else if (title) {\n titleView = <span className={style.title}>{title} </span>;\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 <label {...(battleLabelHtmlFor ? {htmlFor: battleLabelHtmlFor} : {})}>{titleView}</label>\n <div\n className={classnames(\n composedClassName,\n theme === 'coorpmanager' ? style.coorpmanager : null\n )}\n >\n <div\n data-name=\"select-wrapper\"\n style={{\n ...(shouldUseSkinFontColor && {\n color\n })\n }}\n className={style.selectWrapper}\n >\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 {...(battleLabelHtmlFor ? {id: battleLabelHtmlFor} : {})}\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 </div>\n <div className={style.description}>{description}</div>\n </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\nexport const CreateBattleLabelParameters = {\n htmlFor: PropTypes.string,\n className: PropTypes.string\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 createBattleLabelParameters: PropTypes.shape(Create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,SAAS,CAACgG,KAAV,CAAgBb,qBAAhB,CAAlB,CAXQ;EAYjB5C,QAAQ,EAAEvC,SAAS,CAACwF,IAZH;EAajBhD,KAAK,EAAExC,SAAS,CAACwF,IAbA;EAcjB,cAAcxF,SAAS,CAACoF,MAdP;EAejBxC,2BAA2B,EAAE5C,SAAS,CAACgG,KAAV,CAAgBP,2BAAhB;AAfZ,CAAnB;AAkBA,eAAe/D,MAAf"}
|
|
@@ -99,8 +99,10 @@ declare namespace BrandFormGroup {
|
|
|
99
99
|
modified: PropTypes.Requireable<boolean>;
|
|
100
100
|
error: PropTypes.Requireable<boolean>;
|
|
101
101
|
'aria-label': PropTypes.Requireable<string>;
|
|
102
|
-
|
|
103
|
-
|
|
102
|
+
createBattleLabelParameters: PropTypes.Requireable<PropTypes.InferProps<{
|
|
103
|
+
htmlFor: PropTypes.Requireable<string>;
|
|
104
|
+
className: PropTypes.Requireable<string>;
|
|
105
|
+
}>>;
|
|
104
106
|
}> | PropTypes.InferProps<{
|
|
105
107
|
type: PropTypes.Requireable<string>;
|
|
106
108
|
title: PropTypes.Validator<string>;
|
|
@@ -205,8 +207,10 @@ declare namespace BrandFormGroup {
|
|
|
205
207
|
modified: PropTypes.Requireable<boolean>;
|
|
206
208
|
error: PropTypes.Requireable<boolean>;
|
|
207
209
|
'aria-label': PropTypes.Requireable<string>;
|
|
208
|
-
|
|
209
|
-
|
|
210
|
+
createBattleLabelParameters: PropTypes.Requireable<PropTypes.InferProps<{
|
|
211
|
+
htmlFor: PropTypes.Requireable<string>;
|
|
212
|
+
className: PropTypes.Requireable<string>;
|
|
213
|
+
}>>;
|
|
210
214
|
}> | PropTypes.InferProps<{
|
|
211
215
|
type: PropTypes.Requireable<string>;
|
|
212
216
|
title: PropTypes.Validator<string>;
|
|
@@ -31,8 +31,10 @@ 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
|
-
|
|
35
|
-
|
|
34
|
+
createBattleLabelParameters: PropTypes.Requireable<PropTypes.InferProps<{
|
|
35
|
+
htmlFor: PropTypes.Requireable<string>;
|
|
36
|
+
className: PropTypes.Requireable<string>;
|
|
37
|
+
}>>;
|
|
36
38
|
}>>;
|
|
37
39
|
onSearch: PropTypes.Requireable<(...args: any[]) => any>;
|
|
38
40
|
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,8 +57,10 @@ declare namespace SetupSlide {
|
|
|
57
57
|
modified: PropTypes.Requireable<boolean>;
|
|
58
58
|
error: PropTypes.Requireable<boolean>;
|
|
59
59
|
'aria-label': PropTypes.Requireable<string>;
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
createBattleLabelParameters: PropTypes.Requireable<PropTypes.InferProps<{
|
|
61
|
+
htmlFor: PropTypes.Requireable<string>;
|
|
62
|
+
className: PropTypes.Requireable<string>;
|
|
63
|
+
}>>;
|
|
62
64
|
}> | PropTypes.InferProps<{
|
|
63
65
|
type: PropTypes.Requireable<string>;
|
|
64
66
|
title: PropTypes.Validator<string>;
|
|
@@ -70,8 +70,10 @@ declare namespace SetupSlider {
|
|
|
70
70
|
modified: PropTypes.Requireable<boolean>;
|
|
71
71
|
error: PropTypes.Requireable<boolean>;
|
|
72
72
|
'aria-label': PropTypes.Requireable<string>;
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
createBattleLabelParameters: PropTypes.Requireable<PropTypes.InferProps<{
|
|
74
|
+
htmlFor: PropTypes.Requireable<string>;
|
|
75
|
+
className: PropTypes.Requireable<string>;
|
|
76
|
+
}>>;
|
|
75
77
|
}> | PropTypes.InferProps<{
|
|
76
78
|
type: PropTypes.Requireable<string>;
|
|
77
79
|
title: PropTypes.Validator<string>;
|
|
@@ -129,8 +129,10 @@ declare namespace BrandForm {
|
|
|
129
129
|
modified: PropTypes.Requireable<boolean>;
|
|
130
130
|
error: PropTypes.Requireable<boolean>;
|
|
131
131
|
'aria-label': PropTypes.Requireable<string>;
|
|
132
|
-
|
|
133
|
-
|
|
132
|
+
createBattleLabelParameters: PropTypes.Requireable<PropTypes.InferProps<{
|
|
133
|
+
htmlFor: PropTypes.Requireable<string>;
|
|
134
|
+
className: PropTypes.Requireable<string>;
|
|
135
|
+
}>>;
|
|
134
136
|
}> | PropTypes.InferProps<{
|
|
135
137
|
type: PropTypes.Requireable<string>;
|
|
136
138
|
title: PropTypes.Validator<string>;
|
|
@@ -235,8 +237,10 @@ declare namespace BrandForm {
|
|
|
235
237
|
modified: PropTypes.Requireable<boolean>;
|
|
236
238
|
error: PropTypes.Requireable<boolean>;
|
|
237
239
|
'aria-label': PropTypes.Requireable<string>;
|
|
238
|
-
|
|
239
|
-
|
|
240
|
+
createBattleLabelParameters: PropTypes.Requireable<PropTypes.InferProps<{
|
|
241
|
+
htmlFor: PropTypes.Requireable<string>;
|
|
242
|
+
className: PropTypes.Requireable<string>;
|
|
243
|
+
}>>;
|
|
240
244
|
}> | PropTypes.InferProps<{
|
|
241
245
|
type: PropTypes.Requireable<string>;
|
|
242
246
|
title: PropTypes.Validator<string>;
|
|
@@ -146,8 +146,10 @@ declare namespace WizardContents {
|
|
|
146
146
|
modified: PropTypes.Requireable<boolean>;
|
|
147
147
|
error: PropTypes.Requireable<boolean>;
|
|
148
148
|
'aria-label': PropTypes.Requireable<string>;
|
|
149
|
-
|
|
150
|
-
|
|
149
|
+
createBattleLabelParameters: PropTypes.Requireable<PropTypes.InferProps<{
|
|
150
|
+
htmlFor: PropTypes.Requireable<string>;
|
|
151
|
+
className: PropTypes.Requireable<string>;
|
|
152
|
+
}>>;
|
|
151
153
|
}> | PropTypes.InferProps<{
|
|
152
154
|
type: PropTypes.Requireable<string>;
|
|
153
155
|
title: PropTypes.Validator<string>;
|
|
@@ -252,8 +254,10 @@ declare namespace WizardContents {
|
|
|
252
254
|
modified: PropTypes.Requireable<boolean>;
|
|
253
255
|
error: PropTypes.Requireable<boolean>;
|
|
254
256
|
'aria-label': PropTypes.Requireable<string>;
|
|
255
|
-
|
|
256
|
-
|
|
257
|
+
createBattleLabelParameters: PropTypes.Requireable<PropTypes.InferProps<{
|
|
258
|
+
htmlFor: PropTypes.Requireable<string>;
|
|
259
|
+
className: PropTypes.Requireable<string>;
|
|
260
|
+
}>>;
|
|
257
261
|
}> | PropTypes.InferProps<{
|
|
258
262
|
type: PropTypes.Requireable<string>;
|
|
259
263
|
title: PropTypes.Validator<string>;
|
|
@@ -231,8 +231,10 @@ declare namespace BrandUpdate {
|
|
|
231
231
|
modified: PropTypes.Requireable<boolean>;
|
|
232
232
|
error: PropTypes.Requireable<boolean>;
|
|
233
233
|
'aria-label': PropTypes.Requireable<string>;
|
|
234
|
-
|
|
235
|
-
|
|
234
|
+
createBattleLabelParameters: PropTypes.Requireable<PropTypes.InferProps<{
|
|
235
|
+
htmlFor: PropTypes.Requireable<string>;
|
|
236
|
+
className: PropTypes.Requireable<string>;
|
|
237
|
+
}>>;
|
|
236
238
|
}> | PropTypes.InferProps<{
|
|
237
239
|
type: PropTypes.Requireable<string>;
|
|
238
240
|
title: PropTypes.Validator<string>;
|
|
@@ -337,8 +339,10 @@ declare namespace BrandUpdate {
|
|
|
337
339
|
modified: PropTypes.Requireable<boolean>;
|
|
338
340
|
error: PropTypes.Requireable<boolean>;
|
|
339
341
|
'aria-label': PropTypes.Requireable<string>;
|
|
340
|
-
|
|
341
|
-
|
|
342
|
+
createBattleLabelParameters: PropTypes.Requireable<PropTypes.InferProps<{
|
|
343
|
+
htmlFor: PropTypes.Requireable<string>;
|
|
344
|
+
className: PropTypes.Requireable<string>;
|
|
345
|
+
}>>;
|
|
342
346
|
}> | PropTypes.InferProps<{
|
|
343
347
|
type: PropTypes.Requireable<string>;
|
|
344
348
|
title: PropTypes.Validator<string>;
|
|
@@ -858,8 +862,10 @@ declare namespace BrandUpdate {
|
|
|
858
862
|
modified: PropTypes.Requireable<boolean>;
|
|
859
863
|
error: PropTypes.Requireable<boolean>;
|
|
860
864
|
'aria-label': PropTypes.Requireable<string>;
|
|
861
|
-
|
|
862
|
-
|
|
865
|
+
createBattleLabelParameters: PropTypes.Requireable<PropTypes.InferProps<{
|
|
866
|
+
htmlFor: PropTypes.Requireable<string>;
|
|
867
|
+
className: PropTypes.Requireable<string>;
|
|
868
|
+
}>>;
|
|
863
869
|
}> | PropTypes.InferProps<{
|
|
864
870
|
type: PropTypes.Requireable<string>;
|
|
865
871
|
title: PropTypes.Validator<string>;
|
|
@@ -964,8 +970,10 @@ declare namespace BrandUpdate {
|
|
|
964
970
|
modified: PropTypes.Requireable<boolean>;
|
|
965
971
|
error: PropTypes.Requireable<boolean>;
|
|
966
972
|
'aria-label': PropTypes.Requireable<string>;
|
|
967
|
-
|
|
968
|
-
|
|
973
|
+
createBattleLabelParameters: PropTypes.Requireable<PropTypes.InferProps<{
|
|
974
|
+
htmlFor: PropTypes.Requireable<string>;
|
|
975
|
+
className: PropTypes.Requireable<string>;
|
|
976
|
+
}>>;
|
|
969
977
|
}> | PropTypes.InferProps<{
|
|
970
978
|
type: PropTypes.Requireable<string>;
|
|
971
979
|
title: PropTypes.Validator<string>;
|
|
@@ -58,8 +58,10 @@ declare namespace SearchPage {
|
|
|
58
58
|
modified: PropTypes.Requireable<boolean>;
|
|
59
59
|
error: PropTypes.Requireable<boolean>;
|
|
60
60
|
'aria-label': PropTypes.Requireable<string>;
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
createBattleLabelParameters: PropTypes.Requireable<PropTypes.InferProps<{
|
|
62
|
+
htmlFor: PropTypes.Requireable<string>;
|
|
63
|
+
className: PropTypes.Requireable<string>;
|
|
64
|
+
}>>;
|
|
63
65
|
}>>;
|
|
64
66
|
onSearch: PropTypes.Requireable<(...args: any[]) => any>;
|
|
65
67
|
onToggleFilters: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -4,6 +4,10 @@ export namespace SelectOptionPropTypes {
|
|
|
4
4
|
const selected: PropTypes.Requireable<boolean>;
|
|
5
5
|
const validOption: PropTypes.Requireable<boolean>;
|
|
6
6
|
}
|
|
7
|
+
export namespace CreateBattleLabelParameters {
|
|
8
|
+
const htmlFor: PropTypes.Requireable<string>;
|
|
9
|
+
const className: PropTypes.Requireable<string>;
|
|
10
|
+
}
|
|
7
11
|
export default Select;
|
|
8
12
|
import PropTypes from "prop-types";
|
|
9
13
|
declare function Select(props: any, legacyContext: any): JSX.Element;
|
|
@@ -51,8 +55,10 @@ declare namespace Select {
|
|
|
51
55
|
modified: PropTypes.Requireable<boolean>;
|
|
52
56
|
error: PropTypes.Requireable<boolean>;
|
|
53
57
|
'aria-label': PropTypes.Requireable<string>;
|
|
54
|
-
|
|
55
|
-
|
|
58
|
+
createBattleLabelParameters: PropTypes.Requireable<PropTypes.InferProps<{
|
|
59
|
+
htmlFor: PropTypes.Requireable<string>;
|
|
60
|
+
className: PropTypes.Requireable<string>;
|
|
61
|
+
}>>;
|
|
56
62
|
};
|
|
57
63
|
}
|
|
58
64
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/select/index.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/select/index.js"],"names":[],"mappings":";;;;;;;;;;;;AA6BA,qEAuKC"}
|
package/lib/atom/select/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports.default = exports.SelectOptionPropTypes = void 0;
|
|
4
|
+
exports.default = exports.SelectOptionPropTypes = exports.CreateBattleLabelParameters = void 0;
|
|
5
5
|
|
|
6
6
|
var _react = _interopRequireWildcard(require("react"));
|
|
7
7
|
|
|
@@ -70,9 +70,12 @@ const Select = (props, legacyContext) => {
|
|
|
70
70
|
error = false,
|
|
71
71
|
title: propTitle,
|
|
72
72
|
'aria-label': ariaLabel,
|
|
73
|
-
|
|
74
|
-
titleClassName
|
|
73
|
+
createBattleLabelParameters
|
|
75
74
|
} = props;
|
|
75
|
+
const {
|
|
76
|
+
htmlFor: battleLabelHtmlFor,
|
|
77
|
+
className: battleLabelClassName
|
|
78
|
+
} = createBattleLabelParameters;
|
|
76
79
|
const skin = (0, _provider.GetSkinFromContext)(legacyContext);
|
|
77
80
|
const title = (0, _react.useMemo)(() => propTitle ? `${propTitle}${required ? '*' : ''}` : null, [propTitle, required]);
|
|
78
81
|
const optionList = options && options.map((option, index) => {
|
|
@@ -84,9 +87,9 @@ const Select = (props, legacyContext) => {
|
|
|
84
87
|
});
|
|
85
88
|
let titleView = null;
|
|
86
89
|
|
|
87
|
-
if (
|
|
90
|
+
if (battleLabelClassName && title) {
|
|
88
91
|
titleView = /*#__PURE__*/_react.default.createElement("div", {
|
|
89
|
-
className:
|
|
92
|
+
className: battleLabelClassName
|
|
90
93
|
}, title, " ");
|
|
91
94
|
} else if (title) {
|
|
92
95
|
titleView = /*#__PURE__*/_react.default.createElement("span", {
|
|
@@ -127,7 +130,9 @@ const Select = (props, legacyContext) => {
|
|
|
127
130
|
const composedClassName = (0, _react.useMemo)(() => (0, _classnames.default)(theme && theme !== 'coorpmanager' ? themeStyle[theme] : behaviorClassName, selected ? _style.default.selected : _style.default.unselected, className), [behaviorClassName, className, selected, theme]);
|
|
128
131
|
const labelSize = (0, _react.useMemo)(() => (0, _size.default)(selectedLabel), [selectedLabel]);
|
|
129
132
|
const isLongLabel = (0, _react.useMemo)(() => labelSize >= 65, [labelSize]);
|
|
130
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
133
|
+
return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("label", battleLabelHtmlFor ? {
|
|
134
|
+
htmlFor: battleLabelHtmlFor
|
|
135
|
+
} : {}, titleView), /*#__PURE__*/_react.default.createElement("div", {
|
|
131
136
|
className: (0, _classnames.default)(composedClassName, theme === 'coorpmanager' ? _style.default.coorpmanager : null)
|
|
132
137
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
133
138
|
"data-name": "select-wrapper",
|
|
@@ -135,16 +140,14 @@ const Select = (props, legacyContext) => {
|
|
|
135
140
|
color
|
|
136
141
|
}),
|
|
137
142
|
className: _style.default.selectWrapper
|
|
138
|
-
}, /*#__PURE__*/_react.default.createElement("
|
|
139
|
-
htmlFor: selectId
|
|
140
|
-
} : {}, titleView), /*#__PURE__*/_react.default.createElement("span", {
|
|
143
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
141
144
|
"data-name": "select-span",
|
|
142
145
|
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),
|
|
143
146
|
style: _extends({}, shouldUseSkinFontColor && {
|
|
144
147
|
color
|
|
145
148
|
})
|
|
146
|
-
}, selectedLabel), arrowView, /*#__PURE__*/_react.default.createElement("select", _extends({},
|
|
147
|
-
id:
|
|
149
|
+
}, selectedLabel), arrowView, /*#__PURE__*/_react.default.createElement("select", _extends({}, battleLabelHtmlFor ? {
|
|
150
|
+
id: battleLabelHtmlFor
|
|
148
151
|
} : {}, {
|
|
149
152
|
"data-name": "native-select",
|
|
150
153
|
className: _style.default.selectBox,
|
|
@@ -155,7 +158,7 @@ const Select = (props, legacyContext) => {
|
|
|
155
158
|
disabled: disabled
|
|
156
159
|
}), optionList)), /*#__PURE__*/_react.default.createElement("div", {
|
|
157
160
|
className: _style.default.description
|
|
158
|
-
}, description));
|
|
161
|
+
}, description)));
|
|
159
162
|
};
|
|
160
163
|
|
|
161
164
|
const SelectOptionPropTypes = {
|
|
@@ -165,6 +168,11 @@ const SelectOptionPropTypes = {
|
|
|
165
168
|
validOption: _propTypes.default.bool
|
|
166
169
|
};
|
|
167
170
|
exports.SelectOptionPropTypes = SelectOptionPropTypes;
|
|
171
|
+
const CreateBattleLabelParameters = {
|
|
172
|
+
htmlFor: _propTypes.default.string,
|
|
173
|
+
className: _propTypes.default.string
|
|
174
|
+
};
|
|
175
|
+
exports.CreateBattleLabelParameters = CreateBattleLabelParameters;
|
|
168
176
|
Select.contextTypes = {
|
|
169
177
|
skin: _provider.default.childContextTypes.skin
|
|
170
178
|
};
|
|
@@ -183,8 +191,7 @@ Select.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
183
191
|
modified: _propTypes.default.bool,
|
|
184
192
|
error: _propTypes.default.bool,
|
|
185
193
|
'aria-label': _propTypes.default.string,
|
|
186
|
-
|
|
187
|
-
titleClassName: _propTypes.default.string
|
|
194
|
+
createBattleLabelParameters: _propTypes.default.shape(CreateBattleLabelParameters)
|
|
188
195
|
} : {};
|
|
189
196
|
var _default = Select;
|
|
190
197
|
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","selectId","titleClassName","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","htmlFor","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 titleClassName\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 let titleView = null;\n if (selectId) {\n titleView = <div className={titleClassName}>{title} </div>;\n } else if (title) {\n titleView = <span className={style.title}>{title} </span>;\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 <div\n data-name=\"select-wrapper\"\n style={{\n ...(shouldUseSkinFontColor && {\n color\n })\n }}\n className={style.selectWrapper}\n >\n <label {...(selectId ? {htmlFor: selectId} : {})}>{titleView}</label>\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 </div>\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 titleClassName: 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,c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,MAHJ;EAIjB9D,eAAe,EAAE6D,kBAAA,CAAUC,MAJV;EAKjB3D,QAAQ,EAAE0D,kBAAA,CAAUK,IALH;EAMjBhE,QAAQ,EAAE2D,kBAAA,CAAUK,IANH;EAOjB7D,WAAW,EAAEwD,kBAAA,CAAUC,MAPN;EAQjB1D,QAAQ,EAAEyD,kBAAA,CAAUK,IARH;EASjBjE,QAAQ,EAAE4D,kBAAA,CAAUU,IATH;EAUjBjE,KAAK,EAAEuD,kBAAA,CAAUW,KAAV,CAAgB,IAAAC,aAAA,EAAK3F,UAAL,CAAhB,CAVU;EAWjBgB,OAAO,EAAE+D,kBAAA,CAAUa,OAAV,CAAkBb,kBAAA,CAAUc,KAAV,CAAgBf,qBAAhB,CAAlB,CAXQ;EAYjBrD,QAAQ,EAAEsD,kBAAA,CAAUK,IAZH;EAajB1D,KAAK,EAAEqD,kBAAA,CAAUK,IAbA;EAcjB,cAAcL,kBAAA,CAAUC,MAdP;EAejBlD,QAAQ,EAAEiD,kBAAA,CAAUC,MAfH;EAgBjBjD,cAAc,EAAEgD,kBAAA,CAAUC;AAhBT,CAAnB;eAmBepE,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","createBattleLabelParameters","htmlFor","battleLabelHtmlFor","battleLabelClassName","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","id","selectBox","SelectOptionPropTypes","PropTypes","string","isRequired","oneOfType","number","bool","CreateBattleLabelParameters","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 createBattleLabelParameters\n } = props;\n\n const {htmlFor: battleLabelHtmlFor, className: battleLabelClassName} =\n createBattleLabelParameters;\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 let titleView = null;\n if (battleLabelClassName && title) {\n titleView = <div className={battleLabelClassName}>{title} </div>;\n } else if (title) {\n titleView = <span className={style.title}>{title} </span>;\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 <label {...(battleLabelHtmlFor ? {htmlFor: battleLabelHtmlFor} : {})}>{titleView}</label>\n <div\n className={classnames(\n composedClassName,\n theme === 'coorpmanager' ? style.coorpmanager : null\n )}\n >\n <div\n data-name=\"select-wrapper\"\n style={{\n ...(shouldUseSkinFontColor && {\n color\n })\n }}\n className={style.selectWrapper}\n >\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 {...(battleLabelHtmlFor ? {id: battleLabelHtmlFor} : {})}\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 </div>\n <div className={style.description}>{description}</div>\n </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\nexport const CreateBattleLabelParameters = {\n htmlFor: PropTypes.string,\n className: PropTypes.string\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 createBattleLabelParameters: PropTypes.shape(CreateBattleLabelParameters)\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,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P,GAAsB;EACpBrD,IAAI,EAAEsD,iBAAA,CAASC,iBAAT,CAA2BvD;AADb,CAAtB;AAIAtB,MAAM,CAAC8E,SAAP,2CAAmB;EACjB/D,KAAK,EAAEqD,kBAAA,CAAUC,MADA;EAEjBlE,IAAI,EAAEiE,kBAAA,CAAUC,MAFC;EAGjBhE,SAAS,EAAE+D,kBAAA,CAAUC,MAHJ;EAIjB/D,eAAe,EAAE8D,kBAAA,CAAUC,MAJV;EAKjB5D,QAAQ,EAAE2D,kBAAA,CAAUK,IALH;EAMjBjE,QAAQ,EAAE4D,kBAAA,CAAUK,IANH;EAOjB9D,WAAW,EAAEyD,kBAAA,CAAUC,MAPN;EAQjB3D,QAAQ,EAAE0D,kBAAA,CAAUK,IARH;EASjBlE,QAAQ,EAAE6D,kBAAA,CAAUW,IATH;EAUjBnE,KAAK,EAAEwD,kBAAA,CAAUY,KAAV,CAAgB,IAAAC,aAAA,EAAK7F,UAAL,CAAhB,CAVU;EAWjBgB,OAAO,EAAEgE,kBAAA,CAAUc,OAAV,CAAkBd,kBAAA,CAAUe,KAAV,CAAgBhB,qBAAhB,CAAlB,CAXQ;EAYjBtD,QAAQ,EAAEuD,kBAAA,CAAUK,IAZH;EAajB3D,KAAK,EAAEsD,kBAAA,CAAUK,IAbA;EAcjB,cAAcL,kBAAA,CAAUC,MAdP;EAejBnD,2BAA2B,EAAEkD,kBAAA,CAAUe,KAAV,CAAgBT,2BAAhB;AAfZ,CAAnB;eAkBe1E,M"}
|
|
@@ -99,8 +99,10 @@ declare namespace BrandFormGroup {
|
|
|
99
99
|
modified: PropTypes.Requireable<boolean>;
|
|
100
100
|
error: PropTypes.Requireable<boolean>;
|
|
101
101
|
'aria-label': PropTypes.Requireable<string>;
|
|
102
|
-
|
|
103
|
-
|
|
102
|
+
createBattleLabelParameters: PropTypes.Requireable<PropTypes.InferProps<{
|
|
103
|
+
htmlFor: PropTypes.Requireable<string>;
|
|
104
|
+
className: PropTypes.Requireable<string>;
|
|
105
|
+
}>>;
|
|
104
106
|
}> | PropTypes.InferProps<{
|
|
105
107
|
type: PropTypes.Requireable<string>;
|
|
106
108
|
title: PropTypes.Validator<string>;
|
|
@@ -205,8 +207,10 @@ declare namespace BrandFormGroup {
|
|
|
205
207
|
modified: PropTypes.Requireable<boolean>;
|
|
206
208
|
error: PropTypes.Requireable<boolean>;
|
|
207
209
|
'aria-label': PropTypes.Requireable<string>;
|
|
208
|
-
|
|
209
|
-
|
|
210
|
+
createBattleLabelParameters: PropTypes.Requireable<PropTypes.InferProps<{
|
|
211
|
+
htmlFor: PropTypes.Requireable<string>;
|
|
212
|
+
className: PropTypes.Requireable<string>;
|
|
213
|
+
}>>;
|
|
210
214
|
}> | PropTypes.InferProps<{
|
|
211
215
|
type: PropTypes.Requireable<string>;
|
|
212
216
|
title: PropTypes.Validator<string>;
|
|
@@ -31,8 +31,10 @@ 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
|
-
|
|
35
|
-
|
|
34
|
+
createBattleLabelParameters: PropTypes.Requireable<PropTypes.InferProps<{
|
|
35
|
+
htmlFor: PropTypes.Requireable<string>;
|
|
36
|
+
className: PropTypes.Requireable<string>;
|
|
37
|
+
}>>;
|
|
36
38
|
}>>;
|
|
37
39
|
onSearch: PropTypes.Requireable<(...args: any[]) => any>;
|
|
38
40
|
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,8 +57,10 @@ declare namespace SetupSlide {
|
|
|
57
57
|
modified: PropTypes.Requireable<boolean>;
|
|
58
58
|
error: PropTypes.Requireable<boolean>;
|
|
59
59
|
'aria-label': PropTypes.Requireable<string>;
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
createBattleLabelParameters: PropTypes.Requireable<PropTypes.InferProps<{
|
|
61
|
+
htmlFor: PropTypes.Requireable<string>;
|
|
62
|
+
className: PropTypes.Requireable<string>;
|
|
63
|
+
}>>;
|
|
62
64
|
}> | PropTypes.InferProps<{
|
|
63
65
|
type: PropTypes.Requireable<string>;
|
|
64
66
|
title: PropTypes.Validator<string>;
|
|
@@ -70,8 +70,10 @@ declare namespace SetupSlider {
|
|
|
70
70
|
modified: PropTypes.Requireable<boolean>;
|
|
71
71
|
error: PropTypes.Requireable<boolean>;
|
|
72
72
|
'aria-label': PropTypes.Requireable<string>;
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
createBattleLabelParameters: PropTypes.Requireable<PropTypes.InferProps<{
|
|
74
|
+
htmlFor: PropTypes.Requireable<string>;
|
|
75
|
+
className: PropTypes.Requireable<string>;
|
|
76
|
+
}>>;
|
|
75
77
|
}> | PropTypes.InferProps<{
|
|
76
78
|
type: PropTypes.Requireable<string>;
|
|
77
79
|
title: PropTypes.Validator<string>;
|
|
@@ -129,8 +129,10 @@ declare namespace BrandForm {
|
|
|
129
129
|
modified: PropTypes.Requireable<boolean>;
|
|
130
130
|
error: PropTypes.Requireable<boolean>;
|
|
131
131
|
'aria-label': PropTypes.Requireable<string>;
|
|
132
|
-
|
|
133
|
-
|
|
132
|
+
createBattleLabelParameters: PropTypes.Requireable<PropTypes.InferProps<{
|
|
133
|
+
htmlFor: PropTypes.Requireable<string>;
|
|
134
|
+
className: PropTypes.Requireable<string>;
|
|
135
|
+
}>>;
|
|
134
136
|
}> | PropTypes.InferProps<{
|
|
135
137
|
type: PropTypes.Requireable<string>;
|
|
136
138
|
title: PropTypes.Validator<string>;
|
|
@@ -235,8 +237,10 @@ declare namespace BrandForm {
|
|
|
235
237
|
modified: PropTypes.Requireable<boolean>;
|
|
236
238
|
error: PropTypes.Requireable<boolean>;
|
|
237
239
|
'aria-label': PropTypes.Requireable<string>;
|
|
238
|
-
|
|
239
|
-
|
|
240
|
+
createBattleLabelParameters: PropTypes.Requireable<PropTypes.InferProps<{
|
|
241
|
+
htmlFor: PropTypes.Requireable<string>;
|
|
242
|
+
className: PropTypes.Requireable<string>;
|
|
243
|
+
}>>;
|
|
240
244
|
}> | PropTypes.InferProps<{
|
|
241
245
|
type: PropTypes.Requireable<string>;
|
|
242
246
|
title: PropTypes.Validator<string>;
|
|
@@ -146,8 +146,10 @@ declare namespace WizardContents {
|
|
|
146
146
|
modified: PropTypes.Requireable<boolean>;
|
|
147
147
|
error: PropTypes.Requireable<boolean>;
|
|
148
148
|
'aria-label': PropTypes.Requireable<string>;
|
|
149
|
-
|
|
150
|
-
|
|
149
|
+
createBattleLabelParameters: PropTypes.Requireable<PropTypes.InferProps<{
|
|
150
|
+
htmlFor: PropTypes.Requireable<string>;
|
|
151
|
+
className: PropTypes.Requireable<string>;
|
|
152
|
+
}>>;
|
|
151
153
|
}> | PropTypes.InferProps<{
|
|
152
154
|
type: PropTypes.Requireable<string>;
|
|
153
155
|
title: PropTypes.Validator<string>;
|
|
@@ -252,8 +254,10 @@ declare namespace WizardContents {
|
|
|
252
254
|
modified: PropTypes.Requireable<boolean>;
|
|
253
255
|
error: PropTypes.Requireable<boolean>;
|
|
254
256
|
'aria-label': PropTypes.Requireable<string>;
|
|
255
|
-
|
|
256
|
-
|
|
257
|
+
createBattleLabelParameters: PropTypes.Requireable<PropTypes.InferProps<{
|
|
258
|
+
htmlFor: PropTypes.Requireable<string>;
|
|
259
|
+
className: PropTypes.Requireable<string>;
|
|
260
|
+
}>>;
|
|
257
261
|
}> | PropTypes.InferProps<{
|
|
258
262
|
type: PropTypes.Requireable<string>;
|
|
259
263
|
title: PropTypes.Validator<string>;
|
|
@@ -231,8 +231,10 @@ declare namespace BrandUpdate {
|
|
|
231
231
|
modified: PropTypes.Requireable<boolean>;
|
|
232
232
|
error: PropTypes.Requireable<boolean>;
|
|
233
233
|
'aria-label': PropTypes.Requireable<string>;
|
|
234
|
-
|
|
235
|
-
|
|
234
|
+
createBattleLabelParameters: PropTypes.Requireable<PropTypes.InferProps<{
|
|
235
|
+
htmlFor: PropTypes.Requireable<string>;
|
|
236
|
+
className: PropTypes.Requireable<string>;
|
|
237
|
+
}>>;
|
|
236
238
|
}> | PropTypes.InferProps<{
|
|
237
239
|
type: PropTypes.Requireable<string>;
|
|
238
240
|
title: PropTypes.Validator<string>;
|
|
@@ -337,8 +339,10 @@ declare namespace BrandUpdate {
|
|
|
337
339
|
modified: PropTypes.Requireable<boolean>;
|
|
338
340
|
error: PropTypes.Requireable<boolean>;
|
|
339
341
|
'aria-label': PropTypes.Requireable<string>;
|
|
340
|
-
|
|
341
|
-
|
|
342
|
+
createBattleLabelParameters: PropTypes.Requireable<PropTypes.InferProps<{
|
|
343
|
+
htmlFor: PropTypes.Requireable<string>;
|
|
344
|
+
className: PropTypes.Requireable<string>;
|
|
345
|
+
}>>;
|
|
342
346
|
}> | PropTypes.InferProps<{
|
|
343
347
|
type: PropTypes.Requireable<string>;
|
|
344
348
|
title: PropTypes.Validator<string>;
|
|
@@ -858,8 +862,10 @@ declare namespace BrandUpdate {
|
|
|
858
862
|
modified: PropTypes.Requireable<boolean>;
|
|
859
863
|
error: PropTypes.Requireable<boolean>;
|
|
860
864
|
'aria-label': PropTypes.Requireable<string>;
|
|
861
|
-
|
|
862
|
-
|
|
865
|
+
createBattleLabelParameters: PropTypes.Requireable<PropTypes.InferProps<{
|
|
866
|
+
htmlFor: PropTypes.Requireable<string>;
|
|
867
|
+
className: PropTypes.Requireable<string>;
|
|
868
|
+
}>>;
|
|
863
869
|
}> | PropTypes.InferProps<{
|
|
864
870
|
type: PropTypes.Requireable<string>;
|
|
865
871
|
title: PropTypes.Validator<string>;
|
|
@@ -964,8 +970,10 @@ declare namespace BrandUpdate {
|
|
|
964
970
|
modified: PropTypes.Requireable<boolean>;
|
|
965
971
|
error: PropTypes.Requireable<boolean>;
|
|
966
972
|
'aria-label': PropTypes.Requireable<string>;
|
|
967
|
-
|
|
968
|
-
|
|
973
|
+
createBattleLabelParameters: PropTypes.Requireable<PropTypes.InferProps<{
|
|
974
|
+
htmlFor: PropTypes.Requireable<string>;
|
|
975
|
+
className: PropTypes.Requireable<string>;
|
|
976
|
+
}>>;
|
|
969
977
|
}> | PropTypes.InferProps<{
|
|
970
978
|
type: PropTypes.Requireable<string>;
|
|
971
979
|
title: PropTypes.Validator<string>;
|
|
@@ -58,8 +58,10 @@ declare namespace SearchPage {
|
|
|
58
58
|
modified: PropTypes.Requireable<boolean>;
|
|
59
59
|
error: PropTypes.Requireable<boolean>;
|
|
60
60
|
'aria-label': PropTypes.Requireable<string>;
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
createBattleLabelParameters: PropTypes.Requireable<PropTypes.InferProps<{
|
|
62
|
+
htmlFor: PropTypes.Requireable<string>;
|
|
63
|
+
className: PropTypes.Requireable<string>;
|
|
64
|
+
}>>;
|
|
63
65
|
}>>;
|
|
64
66
|
onSearch: PropTypes.Requireable<(...args: any[]) => any>;
|
|
65
67
|
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.40+ba7bdfd28",
|
|
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": "ba7bdfd283b23cfec190558288d86adf437f1d71"
|
|
164
164
|
}
|