@coorpacademy/components 11.38.7 → 11.38.8-alpha.1
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/chip/index.d.ts.map +1 -1
- package/es/atom/chip/index.js +3 -0
- package/es/atom/chip/index.js.map +1 -1
- package/es/atom/input-text/index.d.ts +1 -0
- package/es/atom/input-text/index.d.ts.map +1 -1
- package/es/atom/input-text/index.js +4 -1
- package/es/atom/input-text/index.js.map +1 -1
- package/es/atom/input-text/style.css +13 -1
- package/es/atom/input-text-with-title/index.d.ts +1 -0
- package/es/atom/input-textarea/index.d.ts +1 -0
- package/es/atom/input-textarea/index.d.ts.map +1 -1
- package/es/atom/input-textarea/index.js +8 -2
- package/es/atom/input-textarea/index.js.map +1 -1
- package/es/atom/input-textarea/style.css +20 -0
- package/es/atom/select/index.d.ts.map +1 -1
- package/es/atom/select/index.js +23 -11
- package/es/atom/select/index.js.map +1 -1
- package/es/atom/select/style.css +28 -0
- package/es/atom/status-item/index.d.ts.map +1 -1
- package/es/atom/status-item/index.js +15 -15
- package/es/atom/status-item/index.js.map +1 -1
- package/es/molecule/bullet-point-menu-button/index.d.ts.map +1 -1
- package/es/molecule/bullet-point-menu-button/index.js +42 -2
- package/es/molecule/bullet-point-menu-button/index.js.map +1 -1
- package/es/molecule/course-sections/index.d.ts +1 -0
- package/es/molecule/drag-and-drop/index.d.ts +1 -0
- package/es/molecule/drag-and-drop/upload-report.d.ts +1 -0
- package/es/molecule/skill-picker-modal/index.js +1 -1
- package/es/molecule/skill-picker-modal/index.js.map +1 -1
- package/es/molecule/title-and-checkbox-wrapper/index.d.ts +1 -0
- package/es/molecule/translation-modal/index.d.ts +4 -0
- package/es/molecule/translation-modal/index.js +1 -1
- package/es/molecule/translation-modal/index.js.map +1 -1
- package/es/organism/content-translation/index.d.ts +2 -0
- package/es/organism/icon-editor/index.d.ts +1 -0
- package/es/organism/icon-editor/index.d.ts.map +1 -1
- package/es/organism/icon-editor/types.d.ts +1 -0
- package/es/organism/icon-editor/types.d.ts.map +1 -1
- package/es/organism/rewards-form/index.d.ts +1 -0
- package/es/organism/select-opponents/index.d.ts +1 -0
- package/es/organism/select-opponents/index.d.ts.map +1 -1
- package/es/organism/select-opponents/types.d.ts +1 -0
- package/es/organism/select-opponents/types.d.ts.map +1 -1
- package/es/organism/skill-edition/index.d.ts +22 -0
- package/es/organism/skill-edition/index.d.ts.map +1 -1
- package/es/organism/skill-edition/index.js +65 -36
- package/es/organism/skill-edition/index.js.map +1 -1
- package/es/organism/skill-edition/types.d.ts +26 -1
- package/es/organism/skill-edition/types.d.ts.map +1 -1
- package/es/organism/skill-edition/types.js +24 -5
- package/es/organism/skill-edition/types.js.map +1 -1
- package/es/organism/title-and-input/index.d.ts +4 -0
- package/es/organism/title-and-input/index.d.ts.map +1 -1
- package/es/organism/title-and-input/types.d.ts +4 -0
- package/es/organism/title-and-input/types.d.ts.map +1 -1
- package/es/organism/wizard-contents/index.d.ts +4 -0
- package/es/template/back-office/brand-update/index.d.ts +22 -0
- package/es/template/back-office/brand-update/index.d.ts.map +1 -1
- package/es/template/back-office/brand-update/index.js +10 -4
- package/es/template/back-office/brand-update/index.js.map +1 -1
- package/es/template/back-office/brand-update/style.css +5 -0
- package/es/util/render-with-context.d.ts.map +1 -1
- package/es/util/render-with-context.js +3 -2
- package/es/util/render-with-context.js.map +1 -1
- package/lib/atom/chip/index.d.ts.map +1 -1
- package/lib/atom/chip/index.js +3 -0
- package/lib/atom/chip/index.js.map +1 -1
- package/lib/atom/input-text/index.d.ts +1 -0
- package/lib/atom/input-text/index.d.ts.map +1 -1
- package/lib/atom/input-text/index.js +4 -1
- package/lib/atom/input-text/index.js.map +1 -1
- package/lib/atom/input-text/style.css +13 -1
- package/lib/atom/input-text-with-title/index.d.ts +1 -0
- package/lib/atom/input-textarea/index.d.ts +1 -0
- package/lib/atom/input-textarea/index.d.ts.map +1 -1
- package/lib/atom/input-textarea/index.js +8 -2
- package/lib/atom/input-textarea/index.js.map +1 -1
- package/lib/atom/input-textarea/style.css +20 -0
- package/lib/atom/select/index.d.ts.map +1 -1
- package/lib/atom/select/index.js +23 -11
- package/lib/atom/select/index.js.map +1 -1
- package/lib/atom/select/style.css +28 -0
- package/lib/atom/status-item/index.d.ts.map +1 -1
- package/lib/atom/status-item/index.js +15 -17
- package/lib/atom/status-item/index.js.map +1 -1
- package/lib/molecule/bullet-point-menu-button/index.d.ts.map +1 -1
- package/lib/molecule/bullet-point-menu-button/index.js +41 -2
- package/lib/molecule/bullet-point-menu-button/index.js.map +1 -1
- package/lib/molecule/course-sections/index.d.ts +1 -0
- package/lib/molecule/drag-and-drop/index.d.ts +1 -0
- package/lib/molecule/drag-and-drop/upload-report.d.ts +1 -0
- package/lib/molecule/skill-picker-modal/index.js +1 -1
- package/lib/molecule/skill-picker-modal/index.js.map +1 -1
- package/lib/molecule/title-and-checkbox-wrapper/index.d.ts +1 -0
- package/lib/molecule/translation-modal/index.d.ts +4 -0
- package/lib/molecule/translation-modal/index.js +1 -1
- package/lib/molecule/translation-modal/index.js.map +1 -1
- package/lib/organism/content-translation/index.d.ts +2 -0
- package/lib/organism/icon-editor/index.d.ts +1 -0
- package/lib/organism/icon-editor/index.d.ts.map +1 -1
- package/lib/organism/icon-editor/types.d.ts +1 -0
- package/lib/organism/icon-editor/types.d.ts.map +1 -1
- package/lib/organism/rewards-form/index.d.ts +1 -0
- package/lib/organism/select-opponents/index.d.ts +1 -0
- package/lib/organism/select-opponents/index.d.ts.map +1 -1
- package/lib/organism/select-opponents/types.d.ts +1 -0
- package/lib/organism/select-opponents/types.d.ts.map +1 -1
- package/lib/organism/skill-edition/index.d.ts +22 -0
- package/lib/organism/skill-edition/index.d.ts.map +1 -1
- package/lib/organism/skill-edition/index.js +65 -36
- package/lib/organism/skill-edition/index.js.map +1 -1
- package/lib/organism/skill-edition/types.d.ts +26 -1
- package/lib/organism/skill-edition/types.d.ts.map +1 -1
- package/lib/organism/skill-edition/types.js +24 -5
- package/lib/organism/skill-edition/types.js.map +1 -1
- package/lib/organism/title-and-input/index.d.ts +4 -0
- package/lib/organism/title-and-input/index.d.ts.map +1 -1
- package/lib/organism/title-and-input/types.d.ts +4 -0
- package/lib/organism/title-and-input/types.d.ts.map +1 -1
- package/lib/organism/wizard-contents/index.d.ts +4 -0
- package/lib/template/back-office/brand-update/index.d.ts +22 -0
- package/lib/template/back-office/brand-update/index.d.ts.map +1 -1
- package/lib/template/back-office/brand-update/index.js +10 -4
- package/lib/template/back-office/brand-update/index.js.map +1 -1
- package/lib/template/back-office/brand-update/style.css +5 -0
- package/lib/util/render-with-context.d.ts.map +1 -1
- package/lib/util/render-with-context.js +3 -2
- package/lib/util/render-with-context.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/chip/index.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/chip/index.js"],"names":[],"mappings":"AAmBO,qGAG0E;;AAGjF,6DAiEC"}
|
package/es/atom/chip/index.js
CHANGED
|
@@ -4,9 +4,12 @@ import classnames from 'classnames';
|
|
|
4
4
|
import get from 'lodash/fp/get';
|
|
5
5
|
import { convert } from 'css-color-function';
|
|
6
6
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
7
|
+
import { fas } from '@fortawesome/pro-solid-svg-icons';
|
|
8
|
+
import { library } from '@fortawesome/fontawesome-svg-core';
|
|
7
9
|
import Provider from '../provider';
|
|
8
10
|
import { COLORS } from '../../variables/colors';
|
|
9
11
|
import style from './style.css';
|
|
12
|
+
library.add(fas);
|
|
10
13
|
const LUMINOSITY_DELTA = 0.08;
|
|
11
14
|
const {
|
|
12
15
|
cm_primary_blue: DEFAULT_BACKGROUND_COLOR
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useMemo","useState","useCallback","PropTypes","classnames","get","convert","FontAwesomeIcon","Provider","COLORS","style","LUMINOSITY_DELTA","cm_primary_blue","DEFAULT_BACKGROUND_COLOR","ICON_SIZE","calculateHoveredSelectedBgColor","selectedBgColor","luminosityDelta","Chip","props","context","text","subText","selected","customIcon","onClick","leftIcon","backgroundColor","skin","skinColor","hoveredSelectedBgColor","isHovered","setIsHovered","handleClick","handleMouseEnter","handleMouseLeave","hoverStyle","defaultIcon","color","white","cm_grey_400","createElement","className","container","unselected","onMouseEnter","onMouseLeave","left","icon","fontSize","title","contextTypes","childContextTypes","propTypes","process","env","NODE_ENV","string","bool","func"],"sources":["../../../src/atom/chip/index.js"],"sourcesContent":["import React, {useMemo, useState, useCallback} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\n\nimport get from 'lodash/fp/get';\nimport {convert} from 'css-color-function';\nimport {FontAwesomeIcon} from '@fortawesome/react-fontawesome';\nimport Provider from '../provider';\nimport {COLORS} from '../../variables/colors';\nimport style from './style.css';\n\nconst LUMINOSITY_DELTA = 0.08;\nconst {cm_primary_blue: DEFAULT_BACKGROUND_COLOR} = COLORS;\nconst ICON_SIZE = '12px';\n\nexport const calculateHoveredSelectedBgColor = (\n selectedBgColor,\n luminosityDelta = LUMINOSITY_DELTA\n) => convert(`hsl(from ${selectedBgColor} h s calc(l*(1 - ${luminosityDelta})))`);\n// note: luminosity decrease is relative to the selected color\n\nconst Chip = (props, context) => {\n const {\n text,\n subText,\n selected = false,\n customIcon,\n onClick,\n leftIcon,\n backgroundColor = DEFAULT_BACKGROUND_COLOR\n } = props;\n const {skin} = context;\n const skinColor = get('common.primary', skin);\n const selectedBgColor = backgroundColor === 'skin' && skinColor ? skinColor : backgroundColor;\n const hoveredSelectedBgColor = calculateHoveredSelectedBgColor(selectedBgColor);\n\n const [isHovered, setIsHovered] = useState(false);\n\n const handleClick = useMemo(() => onClick, [onClick]);\n\n const handleMouseEnter = useCallback(() => {\n setIsHovered(true);\n }, []);\n\n const handleMouseLeave = useCallback(() => {\n setIsHovered(false);\n }, []);\n\n const hoverStyle = isHovered ? {backgroundColor: hoveredSelectedBgColor} : {};\n\n const defaultIcon = selected ? 'fa-check' : 'fa-plus';\n const color = selected ? COLORS.white : COLORS.cm_grey_400;\n\n return (\n <div\n className={classnames(style.container, !selected && style.unselected)}\n style={{\n ...(selected && selectedBgColor ? {backgroundColor: selectedBgColor} : {}),\n ...(selected && hoverStyle)\n }}\n onClick={handleClick}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n aria-label={text}\n data-name={`chip-${text}`}\n >\n <div className={style.left}>\n {leftIcon ? <FontAwesomeIcon style={{color}} icon={leftIcon} fontSize={ICON_SIZE} /> : null}\n <div title={text}>\n <span className={style.text} style={{color}}>\n {text}\n </span>\n {subText ? (\n <span className={style.subText} style={{color}}>\n {subText}\n </span>\n ) : null}\n </div>\n </div>\n <FontAwesomeIcon\n style={{color}}\n icon={customIcon ? `fa-${customIcon}` : defaultIcon}\n fontSize={ICON_SIZE}\n />\n </div>\n );\n};\n\nChip.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nChip.propTypes = {\n text: PropTypes.string,\n subText: PropTypes.string,\n selected: PropTypes.bool,\n customIcon: PropTypes.string,\n backgroundColor: PropTypes.string,\n onClick: PropTypes.func,\n leftIcon: PropTypes.string\n};\n\nexport default Chip;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAGC,OAAO,EAAEC,QAAQ,EAAEC,WAAW,QAAO,OAAO;AAC3D,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AAEnC,OAAOC,GAAG,MAAM,eAAe;AAC/B,SAAQC,OAAO,QAAO,oBAAoB;AAC1C,SAAQC,eAAe,QAAO,gCAAgC;AAC9D,OAAOC,QAAQ,MAAM,aAAa;AAClC,SAAQC,MAAM,QAAO,wBAAwB;AAC7C,OAAOC,KAAK,MAAM,aAAa;AAE/
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useMemo","useState","useCallback","PropTypes","classnames","get","convert","FontAwesomeIcon","fas","library","Provider","COLORS","style","add","LUMINOSITY_DELTA","cm_primary_blue","DEFAULT_BACKGROUND_COLOR","ICON_SIZE","calculateHoveredSelectedBgColor","selectedBgColor","luminosityDelta","Chip","props","context","text","subText","selected","customIcon","onClick","leftIcon","backgroundColor","skin","skinColor","hoveredSelectedBgColor","isHovered","setIsHovered","handleClick","handleMouseEnter","handleMouseLeave","hoverStyle","defaultIcon","color","white","cm_grey_400","createElement","className","container","unselected","onMouseEnter","onMouseLeave","left","icon","fontSize","title","contextTypes","childContextTypes","propTypes","process","env","NODE_ENV","string","bool","func"],"sources":["../../../src/atom/chip/index.js"],"sourcesContent":["import React, {useMemo, useState, useCallback} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\n\nimport get from 'lodash/fp/get';\nimport {convert} from 'css-color-function';\nimport {FontAwesomeIcon} from '@fortawesome/react-fontawesome';\nimport {fas} from '@fortawesome/pro-solid-svg-icons';\nimport {library} from '@fortawesome/fontawesome-svg-core';\nimport Provider from '../provider';\nimport {COLORS} from '../../variables/colors';\nimport style from './style.css';\n\nlibrary.add(fas);\n\nconst LUMINOSITY_DELTA = 0.08;\nconst {cm_primary_blue: DEFAULT_BACKGROUND_COLOR} = COLORS;\nconst ICON_SIZE = '12px';\n\nexport const calculateHoveredSelectedBgColor = (\n selectedBgColor,\n luminosityDelta = LUMINOSITY_DELTA\n) => convert(`hsl(from ${selectedBgColor} h s calc(l*(1 - ${luminosityDelta})))`);\n// note: luminosity decrease is relative to the selected color\n\nconst Chip = (props, context) => {\n const {\n text,\n subText,\n selected = false,\n customIcon,\n onClick,\n leftIcon,\n backgroundColor = DEFAULT_BACKGROUND_COLOR\n } = props;\n const {skin} = context;\n const skinColor = get('common.primary', skin);\n const selectedBgColor = backgroundColor === 'skin' && skinColor ? skinColor : backgroundColor;\n const hoveredSelectedBgColor = calculateHoveredSelectedBgColor(selectedBgColor);\n\n const [isHovered, setIsHovered] = useState(false);\n\n const handleClick = useMemo(() => onClick, [onClick]);\n\n const handleMouseEnter = useCallback(() => {\n setIsHovered(true);\n }, []);\n\n const handleMouseLeave = useCallback(() => {\n setIsHovered(false);\n }, []);\n\n const hoverStyle = isHovered ? {backgroundColor: hoveredSelectedBgColor} : {};\n\n const defaultIcon = selected ? 'fa-check' : 'fa-plus';\n const color = selected ? COLORS.white : COLORS.cm_grey_400;\n\n return (\n <div\n className={classnames(style.container, !selected && style.unselected)}\n style={{\n ...(selected && selectedBgColor ? {backgroundColor: selectedBgColor} : {}),\n ...(selected && hoverStyle)\n }}\n onClick={handleClick}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n aria-label={text}\n data-name={`chip-${text}`}\n >\n <div className={style.left}>\n {leftIcon ? <FontAwesomeIcon style={{color}} icon={leftIcon} fontSize={ICON_SIZE} /> : null}\n <div title={text}>\n <span className={style.text} style={{color}}>\n {text}\n </span>\n {subText ? (\n <span className={style.subText} style={{color}}>\n {subText}\n </span>\n ) : null}\n </div>\n </div>\n <FontAwesomeIcon\n style={{color}}\n icon={customIcon ? `fa-${customIcon}` : defaultIcon}\n fontSize={ICON_SIZE}\n />\n </div>\n );\n};\n\nChip.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nChip.propTypes = {\n text: PropTypes.string,\n subText: PropTypes.string,\n selected: PropTypes.bool,\n customIcon: PropTypes.string,\n backgroundColor: PropTypes.string,\n onClick: PropTypes.func,\n leftIcon: PropTypes.string\n};\n\nexport default Chip;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAGC,OAAO,EAAEC,QAAQ,EAAEC,WAAW,QAAO,OAAO;AAC3D,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AAEnC,OAAOC,GAAG,MAAM,eAAe;AAC/B,SAAQC,OAAO,QAAO,oBAAoB;AAC1C,SAAQC,eAAe,QAAO,gCAAgC;AAC9D,SAAQC,GAAG,QAAO,kCAAkC;A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C,KAAK,CAACa,OAAQ;IAACb,KAAK,EAAE;MAAC6B;IAAK;EAAE,GAC5ChB,OACG,CAAC,GACL,IACD,CACF,CAAC,eACN1B,KAAA,CAAA6C,aAAA,CAACrC,eAAe;IACdK,KAAK,EAAE;MAAC6B;IAAK,CAAE;IACfU,IAAI,EAAExB,UAAU,GAAG,MAAMA,UAAU,EAAE,GAAGa,WAAY;IACpDY,QAAQ,EAAEnC;EAAU,CACrB,CACE,CAAC;AAEV,CAAC;AAEDI,IAAI,CAACiC,YAAY,GAAG;EAClBvB,IAAI,EAAErB,QAAQ,CAAC6C,iBAAiB,CAACxB;AACnC,CAAC;AAEDV,IAAI,CAACmC,SAAS,GAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAG;EACfnC,IAAI,EAAErB,SAAS,CAACyD,MAAM;EACtBnC,OAAO,EAAEtB,SAAS,CAACyD,MAAM;EACzBlC,QAAQ,EAAEvB,SAAS,CAAC0D,IAAI;EACxBlC,UAAU,EAAExB,SAAS,CAACyD,MAAM;EAC5B9B,eAAe,EAAE3B,SAAS,CAACyD,MAAM;EACjChC,OAAO,EAAEzB,SAAS,CAAC2D,IAAI;EACvBjC,QAAQ,EAAE1B,SAAS,CAACyD;AACtB,CAAC;AAED,eAAevC,IAAI","ignoreList":[]}
|
|
@@ -8,6 +8,7 @@ declare namespace InputText {
|
|
|
8
8
|
defaultValue: PropTypes.Requireable<string>;
|
|
9
9
|
theme: PropTypes.Requireable<string>;
|
|
10
10
|
disabled: PropTypes.Requireable<boolean>;
|
|
11
|
+
readOnly: PropTypes.Requireable<boolean>;
|
|
11
12
|
value: PropTypes.Requireable<string>;
|
|
12
13
|
hint: PropTypes.Requireable<string>;
|
|
13
14
|
error: PropTypes.Requireable<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/input-text/index.js"],"names":[],"mappings":";AAkBA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/input-text/index.js"],"names":[],"mappings":";AAkBA,oDA+FC"}
|
|
@@ -28,6 +28,7 @@ const InputText = props => {
|
|
|
28
28
|
theme = 'default',
|
|
29
29
|
description,
|
|
30
30
|
disabled,
|
|
31
|
+
readOnly = false,
|
|
31
32
|
modified = false,
|
|
32
33
|
title: propsTitle,
|
|
33
34
|
'data-name': dataName = 'input-text',
|
|
@@ -63,7 +64,7 @@ const InputText = props => {
|
|
|
63
64
|
className: style.leftIcon
|
|
64
65
|
}) : null;
|
|
65
66
|
return /*#__PURE__*/React.createElement("div", {
|
|
66
|
-
className: classnames(mainClass, className, disabled && style.disabled, _isNil(propsTitle) && style.isNoTitle)
|
|
67
|
+
className: classnames(mainClass, className, disabled && style.disabled, readOnly && style.readOnly, _isNil(propsTitle) && style.isNoTitle)
|
|
67
68
|
}, /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("span", {
|
|
68
69
|
className: classnames(style.title, _isEmpty(value) && style.noValue)
|
|
69
70
|
}, propsTitle, toolTipView), /*#__PURE__*/React.createElement("input", {
|
|
@@ -77,6 +78,7 @@ const InputText = props => {
|
|
|
77
78
|
value: value,
|
|
78
79
|
onInput: handleChange,
|
|
79
80
|
disabled: disabled,
|
|
81
|
+
readOnly: readOnly,
|
|
80
82
|
onChange: _noop,
|
|
81
83
|
"data-name": dataName,
|
|
82
84
|
"aria-label": ariaLabel
|
|
@@ -94,6 +96,7 @@ InputText.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
94
96
|
defaultValue: PropTypes.string,
|
|
95
97
|
theme: PropTypes.oneOf(_keys(themeStyle)),
|
|
96
98
|
disabled: PropTypes.bool,
|
|
99
|
+
readOnly: PropTypes.bool,
|
|
97
100
|
value: PropTypes.string,
|
|
98
101
|
hint: PropTypes.string,
|
|
99
102
|
error: PropTypes.string,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useMemo","PropTypes","NovaSolidStatusCheckCircle2","CheckIcon","NovaSolidStatusClose","ErrorIcon","NovaCompositionCoorpacademyInformationIcon","InfoIcon","classnames","getClassState","style","themeStyle","setup","coorpmanager","cockpit","default","defaultStyle","InputText","props","autoFocus","placeholder","value","type","hint","defaultValue","onChange","_noop","error","valid","theme","description","disabled","modified","title","propsTitle","dataName","ariaLabel","inputColor","isCMTheme","handleChange","e","target","mainClass","className","descriptionView","createElement","toolTipView","infoIconWrapper","infoIcon","descriptionLabel","hintView","dangerouslySetInnerHTML","__html","errorIconView","leftIcon","validIconView","_isNil","isNoTitle","_isEmpty","noValue","name","input","autoComplete","onInput","preview","backgroundColor","propTypes","process","env","NODE_ENV","bool","string","oneOf","_keys","func"],"sources":["../../../src/atom/input-text/index.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport {noop, isNil, keys, isEmpty} from 'lodash/fp';\nimport {\n NovaSolidStatusCheckCircle2 as CheckIcon,\n NovaSolidStatusClose as ErrorIcon,\n NovaCompositionCoorpacademyInformationIcon as InfoIcon\n} from '@coorpacademy/nova-icons';\nimport classnames from 'classnames';\nimport getClassState from '../../util/get-class-state';\nimport style from './style.css';\n\nconst themeStyle = {\n setup: style.setup,\n coorpmanager: style.coorpmanager,\n cockpit: style.cockpit,\n default: style.defaultStyle\n};\nconst InputText = props => {\n const {\n autoFocus = false,\n placeholder = '',\n value,\n type = 'text',\n hint,\n defaultValue,\n onChange = noop,\n error,\n valid,\n theme = 'default',\n description,\n disabled,\n modified = false,\n title: propsTitle,\n 'data-name': dataName = 'input-text',\n 'aria-label': ariaLabel = 'Input Text',\n inputColor = false\n } = props;\n\n const isCMTheme = theme === 'coorpmanager';\n const handleChange = useMemo(() => e => onChange(e.target.value), [onChange]);\n const mainClass = themeStyle[theme];\n const className = getClassState(style.defaultStyle, style.modified, style.error, modified, error);\n const descriptionView =\n description && theme !== 'coorpmanager' ? (\n <div className={style.description}>{description}</div>\n ) : null;\n const toolTipView =\n description && theme === 'coorpmanager' ? (\n <div className={style.infoIconWrapper}>\n <InfoIcon className={style.infoIcon} />\n <div className={style.descriptionLabel}>{description}</div>\n </div>\n ) : null;\n const hintView =\n theme === 'coorpmanager' ? (\n <div\n className={style.hint}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: error || hint}}\n />\n ) : null;\n const errorIconView = isCMTheme && error ? <ErrorIcon className={style.leftIcon} /> : null;\n const validIconView = isCMTheme && valid ? <CheckIcon className={style.leftIcon} /> : null;\n\n return (\n <div\n className={classnames(\n mainClass,\n className,\n disabled && style.disabled,\n isNil(propsTitle) && style.isNoTitle\n )}\n >\n <label>\n <span className={classnames(style.title, isEmpty(value) && style.noValue)}>\n {propsTitle}\n {toolTipView}\n </span>\n\n <input\n autoFocus={autoFocus}\n type={type}\n name={propsTitle}\n className={style.input}\n placeholder={placeholder}\n defaultValue={defaultValue}\n autoComplete={'off'}\n value={value}\n onInput={handleChange}\n disabled={disabled}\n onChange={noop}\n data-name={dataName}\n aria-label={ariaLabel}\n />\n {inputColor && !error && value ? (\n <span\n className={style.preview}\n style={{\n backgroundColor: value\n }}\n />\n ) : null}\n {errorIconView}\n {validIconView}\n {hintView}\n </label>\n {descriptionView}\n </div>\n );\n};\n\nInputText.propTypes = {\n autoFocus: PropTypes.bool,\n title: PropTypes.string,\n placeholder: PropTypes.string,\n defaultValue: PropTypes.string,\n theme: PropTypes.oneOf(keys(themeStyle)),\n disabled: PropTypes.bool,\n value: PropTypes.string,\n hint: PropTypes.string,\n error: PropTypes.string,\n onChange: PropTypes.func,\n description: PropTypes.string,\n modified: PropTypes.bool,\n type: PropTypes.string,\n valid: PropTypes.bool,\n 'aria-label': PropTypes.string,\n 'data-name': PropTypes.string,\n inputColor: PropTypes.bool\n};\nexport default InputText;\n"],"mappings":";;;;AAAA,OAAOA,KAAK,IAAGC,OAAO,QAAO,OAAO;AACpC,OAAOC,SAAS,MAAM,YAAY;AAElC,SACEC,2BAA2B,IAAIC,SAAS,EACxCC,oBAAoB,IAAIC,SAAS,EACjCC,0CAA0C,IAAIC,QAAQ,QACjD,0BAA0B;AACjC,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,aAAa,MAAM,4BAA4B;AACtD,OAAOC,KAAK,MAAM,aAAa;AAE/B,MAAMC,UAAU,GAAG;EACjBC,KAAK,EAAEF,KAAK,CAACE,KAAK;EAClBC,YAAY,EAAEH,KAAK,CAACG,YAAY;EAChCC,OAAO,EAAEJ,KAAK,CAACI,OAAO;EACtBC,OAAO,EAAEL,KAAK,CAACM;AACjB,CAAC;AACD,MAAMC,SAAS,GAAGC,KAAK,IAAI;EACzB,MAAM;IACJC,SAAS,GAAG,KAAK;IACjBC,WAAW,GAAG,EAAE;IAChBC,KAAK;IACLC,IAAI,GAAG,MAAM;IACbC,IAAI;IACJC,YAAY;IACZC,QAAQ,GAAAC,KAAO;IACfC,KAAK;IACLC,KAAK;IACLC,KAAK,GAAG,SAAS;IACjBC,WAAW;IACXC,QAAQ;IACRC,QAAQ,GAAG,KAAK;IAChBC,KAAK,EAAEC,UAAU;IACjB,WAAW,EAAEC,QAAQ,GAAG,YAAY;IACpC,YAAY,EAAEC,SAAS,GAAG,YAAY;IACtCC,UAAU,GAAG;EACf,CAAC,
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useMemo","PropTypes","NovaSolidStatusCheckCircle2","CheckIcon","NovaSolidStatusClose","ErrorIcon","NovaCompositionCoorpacademyInformationIcon","InfoIcon","classnames","getClassState","style","themeStyle","setup","coorpmanager","cockpit","default","defaultStyle","InputText","props","autoFocus","placeholder","value","type","hint","defaultValue","onChange","_noop","error","valid","theme","description","disabled","readOnly","modified","title","propsTitle","dataName","ariaLabel","inputColor","isCMTheme","handleChange","e","target","mainClass","className","descriptionView","createElement","toolTipView","infoIconWrapper","infoIcon","descriptionLabel","hintView","dangerouslySetInnerHTML","__html","errorIconView","leftIcon","validIconView","_isNil","isNoTitle","_isEmpty","noValue","name","input","autoComplete","onInput","preview","backgroundColor","propTypes","process","env","NODE_ENV","bool","string","oneOf","_keys","func"],"sources":["../../../src/atom/input-text/index.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport {noop, isNil, keys, isEmpty} from 'lodash/fp';\nimport {\n NovaSolidStatusCheckCircle2 as CheckIcon,\n NovaSolidStatusClose as ErrorIcon,\n NovaCompositionCoorpacademyInformationIcon as InfoIcon\n} from '@coorpacademy/nova-icons';\nimport classnames from 'classnames';\nimport getClassState from '../../util/get-class-state';\nimport style from './style.css';\n\nconst themeStyle = {\n setup: style.setup,\n coorpmanager: style.coorpmanager,\n cockpit: style.cockpit,\n default: style.defaultStyle\n};\nconst InputText = props => {\n const {\n autoFocus = false,\n placeholder = '',\n value,\n type = 'text',\n hint,\n defaultValue,\n onChange = noop,\n error,\n valid,\n theme = 'default',\n description,\n disabled,\n readOnly = false,\n modified = false,\n title: propsTitle,\n 'data-name': dataName = 'input-text',\n 'aria-label': ariaLabel = 'Input Text',\n inputColor = false\n } = props;\n\n const isCMTheme = theme === 'coorpmanager';\n const handleChange = useMemo(() => e => onChange(e.target.value), [onChange]);\n const mainClass = themeStyle[theme];\n const className = getClassState(style.defaultStyle, style.modified, style.error, modified, error);\n const descriptionView =\n description && theme !== 'coorpmanager' ? (\n <div className={style.description}>{description}</div>\n ) : null;\n const toolTipView =\n description && theme === 'coorpmanager' ? (\n <div className={style.infoIconWrapper}>\n <InfoIcon className={style.infoIcon} />\n <div className={style.descriptionLabel}>{description}</div>\n </div>\n ) : null;\n const hintView =\n theme === 'coorpmanager' ? (\n <div\n className={style.hint}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: error || hint}}\n />\n ) : null;\n const errorIconView = isCMTheme && error ? <ErrorIcon className={style.leftIcon} /> : null;\n const validIconView = isCMTheme && valid ? <CheckIcon className={style.leftIcon} /> : null;\n\n return (\n <div\n className={classnames(\n mainClass,\n className,\n disabled && style.disabled,\n readOnly && style.readOnly,\n isNil(propsTitle) && style.isNoTitle\n )}\n >\n <label>\n <span className={classnames(style.title, isEmpty(value) && style.noValue)}>\n {propsTitle}\n {toolTipView}\n </span>\n\n <input\n autoFocus={autoFocus}\n type={type}\n name={propsTitle}\n className={style.input}\n placeholder={placeholder}\n defaultValue={defaultValue}\n autoComplete={'off'}\n value={value}\n onInput={handleChange}\n disabled={disabled}\n readOnly={readOnly}\n onChange={noop}\n data-name={dataName}\n aria-label={ariaLabel}\n />\n {inputColor && !error && value ? (\n <span\n className={style.preview}\n style={{\n backgroundColor: value\n }}\n />\n ) : null}\n {errorIconView}\n {validIconView}\n {hintView}\n </label>\n {descriptionView}\n </div>\n );\n};\n\nInputText.propTypes = {\n autoFocus: PropTypes.bool,\n title: PropTypes.string,\n placeholder: PropTypes.string,\n defaultValue: PropTypes.string,\n theme: PropTypes.oneOf(keys(themeStyle)),\n disabled: PropTypes.bool,\n readOnly: PropTypes.bool,\n value: PropTypes.string,\n hint: PropTypes.string,\n error: PropTypes.string,\n onChange: PropTypes.func,\n description: PropTypes.string,\n modified: PropTypes.bool,\n type: PropTypes.string,\n valid: PropTypes.bool,\n 'aria-label': PropTypes.string,\n 'data-name': PropTypes.string,\n inputColor: PropTypes.bool\n};\nexport default InputText;\n"],"mappings":";;;;AAAA,OAAOA,KAAK,IAAGC,OAAO,QAAO,OAAO;AACpC,OAAOC,SAAS,MAAM,YAAY;AAElC,SACEC,2BAA2B,IAAIC,SAAS,EACxCC,oBAAoB,IAAIC,SAAS,EACjCC,0CAA0C,IAAIC,QAAQ,QACjD,0BAA0B;AACjC,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,aAAa,MAAM,4BAA4B;AACtD,OAAOC,KAAK,MAAM,aAAa;AAE/B,MAAMC,UAAU,GAAG;EACjBC,KAAK,EAAEF,KAAK,CAACE,KAAK;EAClBC,YAAY,EAAEH,KAAK,CAACG,YAAY;EAChCC,OAAO,EAAEJ,KAAK,CAACI,OAAO;EACtBC,OAAO,EAAEL,KAAK,CAACM;AAC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ErB,SAAS,CAACuE,MAAM;EACtB5C,KAAK,EAAE3B,SAAS,CAACsE,IAAI;EACrB,YAAY,EAAEtE,SAAS,CAACuE,MAAM;EAC9B,WAAW,EAAEvE,SAAS,CAACuE,MAAM;EAC7BlC,UAAU,EAAErC,SAAS,CAACsE;AACxB,CAAC;AACD,eAAetD,SAAS","ignoreList":[]}
|
|
@@ -410,4 +410,16 @@
|
|
|
410
410
|
position: absolute;
|
|
411
411
|
top: 23%;
|
|
412
412
|
box-shadow: 0 0 1px grey;
|
|
413
|
-
}
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
.readOnly input {
|
|
416
|
+
caret-color: transparent;
|
|
417
|
+
cursor: default;
|
|
418
|
+
user-select: none;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
.readOnly.coorpmanager input {
|
|
422
|
+
caret-color: transparent;
|
|
423
|
+
cursor: default;
|
|
424
|
+
user-select: none;
|
|
425
|
+
}
|
|
@@ -10,6 +10,7 @@ declare namespace InputTextWithTitle {
|
|
|
10
10
|
placeholder: PropTypes.Requireable<string>;
|
|
11
11
|
defaultValue: PropTypes.Requireable<string>;
|
|
12
12
|
disabled: PropTypes.Requireable<boolean>;
|
|
13
|
+
readOnly: PropTypes.Requireable<boolean>;
|
|
13
14
|
value: PropTypes.Requireable<string>;
|
|
14
15
|
hint: PropTypes.Requireable<string>;
|
|
15
16
|
error: PropTypes.Requireable<string>;
|
|
@@ -7,6 +7,7 @@ declare namespace InputTextarea {
|
|
|
7
7
|
const name: PropTypes.Requireable<string>;
|
|
8
8
|
const theme: PropTypes.Requireable<string>;
|
|
9
9
|
const disabled: PropTypes.Requireable<boolean>;
|
|
10
|
+
const readonly: PropTypes.Requireable<boolean>;
|
|
10
11
|
const value: PropTypes.Requireable<string>;
|
|
11
12
|
const hint: PropTypes.Requireable<string>;
|
|
12
13
|
const error: PropTypes.Requireable<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/input-textarea/index.js"],"names":[],"mappings":";AAkBA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/input-textarea/index.js"],"names":[],"mappings":";AAkBA,wDA0EC"}
|
|
@@ -26,6 +26,7 @@ const InputTextarea = props => {
|
|
|
26
26
|
valid,
|
|
27
27
|
description,
|
|
28
28
|
disabled,
|
|
29
|
+
readonly,
|
|
29
30
|
modified = false
|
|
30
31
|
} = props;
|
|
31
32
|
const mainClass = themeStyle[theme];
|
|
@@ -56,7 +57,7 @@ const InputTextarea = props => {
|
|
|
56
57
|
className: style.leftIcon
|
|
57
58
|
}) : null;
|
|
58
59
|
return /*#__PURE__*/React.createElement("div", {
|
|
59
|
-
className: classnames(mainClass, className, disabled && style.disabled)
|
|
60
|
+
className: classnames(mainClass, className, disabled && style.disabled, readonly && style.readonly)
|
|
60
61
|
}, /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("span", {
|
|
61
62
|
className: classnames(style.title, _isEmpty(value) && style.noValue)
|
|
62
63
|
}, propsTitle, toolTipView), /*#__PURE__*/React.createElement("textarea", {
|
|
@@ -65,7 +66,11 @@ const InputTextarea = props => {
|
|
|
65
66
|
placeholder: placeholder,
|
|
66
67
|
onChange: handleChange,
|
|
67
68
|
disabled: disabled,
|
|
68
|
-
|
|
69
|
+
readOnly: readonly,
|
|
70
|
+
"data-testid": name,
|
|
71
|
+
style: readonly ? {
|
|
72
|
+
caretColor: 'transparent'
|
|
73
|
+
} : undefined
|
|
69
74
|
}), errorIconView, validIconView, hintView), descriptionView);
|
|
70
75
|
};
|
|
71
76
|
InputTextarea.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
@@ -74,6 +79,7 @@ InputTextarea.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
74
79
|
name: PropTypes.string,
|
|
75
80
|
theme: PropTypes.oneOf(_keys(themeStyle)),
|
|
76
81
|
disabled: PropTypes.bool,
|
|
82
|
+
readonly: PropTypes.bool,
|
|
77
83
|
value: PropTypes.string,
|
|
78
84
|
hint: PropTypes.string,
|
|
79
85
|
error: PropTypes.string,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useMemo","PropTypes","classnames","NovaSolidStatusCheckCircle2","CheckIcon","NovaSolidStatusClose","ErrorIcon","NovaCompositionCoorpacademyInformationIcon","InfoIcon","getClassState","style","themeStyle","setup","coorpmanager","cockpit","default","defaultStyle","InputTextarea","props","title","propsTitle","name","placeholder","value","hint","theme","onChange","_noop","error","valid","description","disabled","modified","mainClass","className","handleChange","e","target","descriptionView","createElement","toolTipView","infoIconWrapper","infoIcon","descriptionLabel","hintView","dangerouslySetInnerHTML","__html","errorIconView","leftIcon","validIconView","_isEmpty","noValue","propTypes","process","env","NODE_ENV","string","oneOf","_keys","bool","func"],"sources":["../../../src/atom/input-textarea/index.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport {noop, keys, isEmpty} from 'lodash/fp';\nimport classnames from 'classnames';\nimport {\n NovaSolidStatusCheckCircle2 as CheckIcon,\n NovaSolidStatusClose as ErrorIcon,\n NovaCompositionCoorpacademyInformationIcon as InfoIcon\n} from '@coorpacademy/nova-icons';\nimport getClassState from '../../util/get-class-state';\nimport style from './style.css';\n\nconst themeStyle = {\n setup: style.setup,\n coorpmanager: style.coorpmanager,\n cockpit: style.cockpit,\n default: style.defaultStyle\n};\nconst InputTextarea = props => {\n const {\n title: propsTitle,\n name,\n placeholder,\n value,\n hint,\n theme = 'default',\n onChange = noop,\n error,\n valid,\n description,\n disabled,\n modified = false\n } = props;\n\n const mainClass = themeStyle[theme];\n const className = getClassState(style.defaultStyle, style.modified, style.error, modified, error);\n const handleChange = useMemo(() => e => onChange(e.target.value), [onChange]);\n\n const descriptionView =\n description && theme !== 'coorpmanager' ? (\n <div className={style.description}>{description}</div>\n ) : null;\n const toolTipView =\n description && theme === 'coorpmanager' ? (\n <div className={style.infoIconWrapper}>\n <InfoIcon className={style.infoIcon} />\n <div className={style.descriptionLabel}>{description}</div>\n </div>\n ) : null;\n const hintView =\n theme === 'coorpmanager' ? (\n <div\n className={style.hint}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: error || hint}}\n />\n ) : null;\n const errorIconView = error ? <ErrorIcon className={style.leftIcon} /> : null;\n const validIconView = valid ? <CheckIcon className={style.leftIcon} /> : null;\n\n return (\n <div
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useMemo","PropTypes","classnames","NovaSolidStatusCheckCircle2","CheckIcon","NovaSolidStatusClose","ErrorIcon","NovaCompositionCoorpacademyInformationIcon","InfoIcon","getClassState","style","themeStyle","setup","coorpmanager","cockpit","default","defaultStyle","InputTextarea","props","title","propsTitle","name","placeholder","value","hint","theme","onChange","_noop","error","valid","description","disabled","readonly","modified","mainClass","className","handleChange","e","target","descriptionView","createElement","toolTipView","infoIconWrapper","infoIcon","descriptionLabel","hintView","dangerouslySetInnerHTML","__html","errorIconView","leftIcon","validIconView","_isEmpty","noValue","readOnly","caretColor","undefined","propTypes","process","env","NODE_ENV","string","oneOf","_keys","bool","func"],"sources":["../../../src/atom/input-textarea/index.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport {noop, keys, isEmpty} from 'lodash/fp';\nimport classnames from 'classnames';\nimport {\n NovaSolidStatusCheckCircle2 as CheckIcon,\n NovaSolidStatusClose as ErrorIcon,\n NovaCompositionCoorpacademyInformationIcon as InfoIcon\n} from '@coorpacademy/nova-icons';\nimport getClassState from '../../util/get-class-state';\nimport style from './style.css';\n\nconst themeStyle = {\n setup: style.setup,\n coorpmanager: style.coorpmanager,\n cockpit: style.cockpit,\n default: style.defaultStyle\n};\nconst InputTextarea = props => {\n const {\n title: propsTitle,\n name,\n placeholder,\n value,\n hint,\n theme = 'default',\n onChange = noop,\n error,\n valid,\n description,\n disabled,\n readonly,\n modified = false\n } = props;\n\n const mainClass = themeStyle[theme];\n const className = getClassState(style.defaultStyle, style.modified, style.error, modified, error);\n const handleChange = useMemo(() => e => onChange(e.target.value), [onChange]);\n\n const descriptionView =\n description && theme !== 'coorpmanager' ? (\n <div className={style.description}>{description}</div>\n ) : null;\n const toolTipView =\n description && theme === 'coorpmanager' ? (\n <div className={style.infoIconWrapper}>\n <InfoIcon className={style.infoIcon} />\n <div className={style.descriptionLabel}>{description}</div>\n </div>\n ) : null;\n const hintView =\n theme === 'coorpmanager' ? (\n <div\n className={style.hint}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: error || hint}}\n />\n ) : null;\n const errorIconView = error ? <ErrorIcon className={style.leftIcon} /> : null;\n const validIconView = valid ? <CheckIcon className={style.leftIcon} /> : null;\n\n return (\n <div\n className={classnames(\n mainClass,\n className,\n disabled && style.disabled,\n readonly && style.readonly\n )}\n >\n <label>\n <span className={classnames(style.title, isEmpty(value) && style.noValue)}>\n {propsTitle}\n {toolTipView}\n </span>\n <textarea\n name={name}\n value={value}\n placeholder={placeholder}\n onChange={handleChange}\n disabled={disabled}\n readOnly={readonly}\n data-testid={name}\n style={readonly ? {caretColor: 'transparent'} : undefined}\n />\n {errorIconView}\n {validIconView}\n {hintView}\n </label>\n {descriptionView}\n </div>\n );\n};\n\nInputTextarea.propTypes = {\n placeholder: PropTypes.string,\n title: PropTypes.string,\n name: PropTypes.string,\n theme: PropTypes.oneOf(keys(themeStyle)),\n disabled: PropTypes.bool,\n readonly: PropTypes.bool,\n value: PropTypes.string,\n hint: PropTypes.string,\n error: PropTypes.string,\n onChange: PropTypes.func,\n description: PropTypes.string,\n modified: PropTypes.bool,\n valid: PropTypes.bool\n};\nexport default InputTextarea;\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAAGC,OAAO,QAAO,OAAO;AACpC,OAAOC,SAAS,MAAM,YAAY;AAElC,OAAOC,UAAU,MAAM,YAAY;AACnC,SACEC,2BAA2B,IAAIC,SAAS,EACxCC,oBAAoB,IAAIC,SAAS,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QAAS;IACnBsB,QAAQ,EAAErB,QAAS;IACnB,eAAaX,IAAK;IAClBX,KAAK,EAAEsB,QAAQ,GAAG;MAACsB,UAAU,EAAE;IAAa,CAAC,GAAGC;EAAU,CAC3D,CAAC,EACDP,aAAa,EACbE,aAAa,EACbL,QACI,CAAC,EACPN,eACE,CAAC;AAEV,CAAC;AAEDtB,aAAa,CAACuC,SAAS,GAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAG;EACxBrC,WAAW,EAAErB,SAAS,CAAC2D,MAAM;EAC7BzC,KAAK,EAAElB,SAAS,CAAC2D,MAAM;EACvBvC,IAAI,EAAEpB,SAAS,CAAC2D,MAAM;EACtBnC,KAAK,EAAExB,SAAS,CAAC4D,KAAK,CAACC,KAAA,CAAKnD,UAAU,CAAC,CAAC;EACxCoB,QAAQ,EAAE9B,SAAS,CAAC8D,IAAI;EACxB/B,QAAQ,EAAE/B,SAAS,CAAC8D,IAAI;EACxBxC,KAAK,EAAEtB,SAAS,CAAC2D,MAAM;EACvBpC,IAAI,EAAEvB,SAAS,CAAC2D,MAAM;EACtBhC,KAAK,EAAE3B,SAAS,CAAC2D,MAAM;EACvBlC,QAAQ,EAAEzB,SAAS,CAAC+D,IAAI;EACxBlC,WAAW,EAAE7B,SAAS,CAAC2D,MAAM;EAC7B3B,QAAQ,EAAEhC,SAAS,CAAC8D,IAAI;EACxBlC,KAAK,EAAE5B,SAAS,CAAC8D;AACnB,CAAC;AACD,eAAe9C,aAAa","ignoreList":[]}
|
|
@@ -25,6 +25,10 @@
|
|
|
25
25
|
composes: defaultStyle;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
.readonly {
|
|
29
|
+
composes: defaultStyle;
|
|
30
|
+
}
|
|
31
|
+
|
|
28
32
|
.defaultStyle label {
|
|
29
33
|
display: flex;
|
|
30
34
|
align-items: center;
|
|
@@ -56,6 +60,14 @@
|
|
|
56
60
|
resize: none;
|
|
57
61
|
}
|
|
58
62
|
|
|
63
|
+
.readonly textarea {
|
|
64
|
+
user-select: none;
|
|
65
|
+
-webkit-user-select: none;
|
|
66
|
+
-moz-user-select: none;
|
|
67
|
+
-ms-user-select: none;
|
|
68
|
+
cursor: default;
|
|
69
|
+
}
|
|
70
|
+
|
|
59
71
|
.error textarea {
|
|
60
72
|
border-color: negative;
|
|
61
73
|
}
|
|
@@ -353,6 +365,14 @@
|
|
|
353
365
|
opacity: 0.5;
|
|
354
366
|
}
|
|
355
367
|
|
|
368
|
+
.coorpmanager.readonly textarea {
|
|
369
|
+
user-select: none;
|
|
370
|
+
-webkit-user-select: none;
|
|
371
|
+
-moz-user-select: none;
|
|
372
|
+
-ms-user-select: none;
|
|
373
|
+
cursor: default;
|
|
374
|
+
}
|
|
375
|
+
|
|
356
376
|
.coorpmanager .infoIconWrapper {
|
|
357
377
|
overflow: visible;
|
|
358
378
|
height: 12px;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/select/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAwDA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/select/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAwDA,qEA+MC"}
|
package/es/atom/select/index.js
CHANGED
|
@@ -73,8 +73,16 @@ const Select = (props, legacyContext) => {
|
|
|
73
73
|
const skin = GetSkinFromContext(legacyContext);
|
|
74
74
|
const title = useMemo(() => propTitle ? `${propTitle}${required ? '*' : ''}` : null, [propTitle, required]);
|
|
75
75
|
const [isArrowUp, setIsArrowUp] = useState(false);
|
|
76
|
-
const handleSelectOnFocus = useCallback(() =>
|
|
77
|
-
|
|
76
|
+
const handleSelectOnFocus = useCallback(() => {
|
|
77
|
+
if (!disabled) {
|
|
78
|
+
setIsArrowUp(true);
|
|
79
|
+
}
|
|
80
|
+
}, [disabled]);
|
|
81
|
+
const handleSelectOnBlur = useCallback(() => {
|
|
82
|
+
if (!disabled) {
|
|
83
|
+
setIsArrowUp(false);
|
|
84
|
+
}
|
|
85
|
+
}, [disabled]);
|
|
78
86
|
const selectOption = (option, index) => {
|
|
79
87
|
return /*#__PURE__*/React.createElement("option", {
|
|
80
88
|
key: index,
|
|
@@ -106,19 +114,23 @@ const Select = (props, legacyContext) => {
|
|
|
106
114
|
selected: true
|
|
107
115
|
}, options)), [options, theme]);
|
|
108
116
|
const handleChange = useMemo(() => multiple ? e => {
|
|
109
|
-
|
|
110
|
-
|
|
117
|
+
if (!disabled && onChange) {
|
|
118
|
+
setIsArrowUp(false);
|
|
119
|
+
onChange(map(get('value'), e.target.selectedOptions));
|
|
120
|
+
}
|
|
111
121
|
} : e => {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
122
|
+
if (!disabled && onChange) {
|
|
123
|
+
setIsArrowUp(false);
|
|
124
|
+
onChange(e.target.value);
|
|
125
|
+
}
|
|
126
|
+
}, [onChange, multiple, disabled]);
|
|
115
127
|
const black = useMemo(() => getOr('#14171A', 'common.black', skin), [skin]);
|
|
116
128
|
const color = useMemo(() => getOr('#00B0FF', 'common.primary', skin), [skin]);
|
|
117
129
|
const isThemeOneOfQuestionTemplateOrPlayer = useMemo(() => includes(theme, ['question', 'template', 'player']), [theme]);
|
|
118
130
|
const shouldUseSkinFontColor = useMemo(() => !isSelectedInValidOption && selected && isThemeOneOfQuestionTemplateOrPlayer, [isSelectedInValidOption, selected, isThemeOneOfQuestionTemplateOrPlayer]);
|
|
119
131
|
const arrowColor = selected ? color : undefined;
|
|
120
132
|
const behaviorClassName = useMemo(() => getClassState(style.defaultStyle, style.modified, style.error, modified, error), [error, modified]);
|
|
121
|
-
const composedClassName = useMemo(() => classnames(theme && theme !== 'coorpmanager' ? themeStyle[theme] : behaviorClassName, selected ? style.selected : style.unselected, className), [behaviorClassName, className, selected, theme]);
|
|
133
|
+
const composedClassName = useMemo(() => classnames(theme && theme !== 'coorpmanager' ? themeStyle[theme] : behaviorClassName, selected ? style.selected : style.unselected, disabled ? style.disabled : null, className), [behaviorClassName, className, selected, theme, disabled]);
|
|
122
134
|
const labelSize = useMemo(() => size(selectedLabel), [selectedLabel]);
|
|
123
135
|
const isLongLabel = useMemo(() => labelSize >= 65, [labelSize]);
|
|
124
136
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -162,13 +174,13 @@ const Select = (props, legacyContext) => {
|
|
|
162
174
|
value: selected,
|
|
163
175
|
multiple: multiple,
|
|
164
176
|
disabled: disabled,
|
|
165
|
-
onClick: handleSelectOnFocus,
|
|
166
|
-
onBlur: handleSelectOnBlur
|
|
177
|
+
onClick: disabled ? undefined : handleSelectOnFocus,
|
|
178
|
+
onBlur: disabled ? undefined : handleSelectOnBlur
|
|
167
179
|
// onBlur does not handle completely an out of bounds click
|
|
168
180
|
// ex: select is Opened and a click is done outside, cancelling the select
|
|
169
181
|
// that doesn't count as a Blur, so an onMouseLeave is needed
|
|
170
182
|
,
|
|
171
|
-
onMouseLeave: handleSelectOnBlur,
|
|
183
|
+
onMouseLeave: disabled ? undefined : handleSelectOnBlur,
|
|
172
184
|
"data-testid": "native-select"
|
|
173
185
|
}), optionList)), /*#__PURE__*/React.createElement("div", {
|
|
174
186
|
className: style.description
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useCallback","useMemo","useState","PropTypes","classnames","concat","filter","find","flatMapDeep","get","getOr","includes","isEmpty","keys","map","size","NovaCompositionNavigationArrowDown","ArrowDown","NovaCompositionNavigationArrowTop","ArrowUp","Provider","GetSkinFromContext","getClassState","style","themeStyle","invalid","header","mooc","question","sort","thematiques","player","template","skillDetail","coorpmanager","ArrowView","shouldRender","isArrowUp","ariaLabel","arrowClass","arrowColor","props","color","className","createElement","_extends","Select","legacyContext","name","options","optgroups","borderClassName","onChange","multiple","disabled","required","description","theme","modified","error","title","propTitle","ariaLabelledBy","skin","setIsArrowUp","handleSelectOnFocus","handleSelectOnBlur","selectOption","option","index","key","value","optionList","optgroup","label","i","titleView","selected","selectedLabel","isSelectedInValidOption","validOption","handleChange","e","target","selectedOptions","black","isThemeOneOfQuestionTemplateOrPlayer","shouldUseSkinFontColor","undefined","behaviorClassName","defaultStyle","composedClassName","unselected","labelSize","isLongLabel","selectWrapper","selectSpan","noLabelCommon","longLabel","selectedArrow","arrow","selectBox","onClick","onBlur","onMouseLeave","SelectOptionPropTypes","string","isRequired","oneOfType","number","bool","SelectOptionGroupPropTypes","arrayOf","shape","contextTypes","childContextTypes","propTypes","process","env","NODE_ENV","func","oneOf"],"sources":["../../../src/atom/select/index.js"],"sourcesContent":["import React, {useCallback, useMemo, useState} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport concat from 'lodash/fp/concat';\nimport filter from 'lodash/fp/filter';\nimport find from 'lodash/fp/find';\nimport flatMapDeep from 'lodash/fp/flatMapDeep';\nimport get from 'lodash/fp/get';\nimport getOr from 'lodash/fp/getOr';\nimport includes from 'lodash/fp/includes';\nimport isEmpty from 'lodash/fp/isEmpty';\nimport keys from 'lodash/fp/keys';\nimport map from 'lodash/fp/map';\nimport size from 'lodash/fp/size';\nimport {\n NovaCompositionNavigationArrowDown as ArrowDown,\n NovaCompositionNavigationArrowTop as ArrowUp\n} 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 skillDetail: style.skillDetail,\n coorpmanager: null\n};\n\nconst ArrowView = ({shouldRender, isArrowUp, ariaLabel, arrowClass, arrowColor}) => {\n const props = useMemo(\n () => ({\n ...(arrowColor &\n {\n color: arrowColor\n }),\n className: arrowClass\n }),\n [arrowClass, arrowColor]\n );\n if (shouldRender) {\n return isArrowUp ? (\n <ArrowUp {...props} data-testid=\"select-arrow-up-icon\" />\n ) : (\n <ArrowDown {...props} data-testid=\"select-arrow-down-icon\" />\n );\n } else return null;\n};\n\nconst Select = (props, legacyContext) => {\n const {\n name,\n options = [],\n optgroups = [],\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 'aria-labelledby': ariaLabelledBy\n } = props;\n\n const skin = GetSkinFromContext(legacyContext);\n const title = useMemo(\n () => (propTitle ? `${propTitle}${required ? '*' : ''}` : null),\n [propTitle, required]\n );\n\n const [isArrowUp, setIsArrowUp] = useState(false);\n\n const handleSelectOnFocus = useCallback(() => setIsArrowUp(true), []);\n const handleSelectOnBlur = useCallback(() => setIsArrowUp(false), []);\n\n const selectOption = (option, index) => {\n return (\n <option key={index} value={option.value} className={style.selectOption}>\n {option.name}\n </option>\n );\n };\n\n const optionList = !isEmpty(options)\n ? options.map((option, index) => selectOption(option, index))\n : optgroups.map((optgroup, index) => {\n return (\n <optgroup key={index} label={optgroup.label}>\n {optgroup.options && optgroup.options.map((option, i) => selectOption(option, i))}\n </optgroup>\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}, concat(options, flatMapDeep('options', optgroups)))),\n [multiple, options, optgroups]\n );\n const selectedLabel = useMemo(\n () =>\n multiple\n ? map(get('name'), filter({selected: true}, options))\n : get('name', find({selected: true}, concat(options, flatMapDeep('options', optgroups)))),\n [multiple, options, optgroups]\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 setIsArrowUp(false);\n onChange(map(get('value'), e.target.selectedOptions));\n }\n : e => {\n setIsArrowUp(false);\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 isThemeOneOfQuestionTemplateOrPlayer = useMemo(\n () => includes(theme, ['question', 'template', 'player']),\n [theme]\n );\n const shouldUseSkinFontColor = useMemo(\n () => !isSelectedInValidOption && selected && isThemeOneOfQuestionTemplateOrPlayer,\n [isSelectedInValidOption, selected, isThemeOneOfQuestionTemplateOrPlayer]\n );\n const arrowColor = selected ? color : undefined;\n\n const behaviorClassName = useMemo(\n () => getClassState(style.defaultStyle, 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-testid=\"select-wrapper\"\n data-name=\"select-wrapper\"\n title={title}\n style={{\n ...(shouldUseSkinFontColor && {\n color\n })\n }}\n className={style.selectWrapper}\n >\n {titleView}\n <span\n data-testid=\"select-span\"\n data-name=\"select-span\"\n className={classnames(\n style.selectSpan,\n includes(theme, [\n 'player',\n 'invalid',\n 'question',\n 'thematiques',\n 'template',\n 'skillDetail'\n ])\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 shouldRender={!multiple}\n isArrowUp={isArrowUp}\n ariaLabel={ariaLabel}\n arrowClass={shouldUseSkinFontColor ? style.selectedArrow : style.arrow}\n arrowColor={isThemeOneOfQuestionTemplateOrPlayer ? arrowColor : black}\n />\n <select\n {...(ariaLabelledBy ? {'aria-labelledby': ariaLabelledBy} : {})}\n {...(ariaLabel && !ariaLabelledBy ? {'aria-label': ariaLabel} : {})}\n {...(ariaLabel ? {title: ariaLabel} : {})}\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 onClick={handleSelectOnFocus}\n onBlur={handleSelectOnBlur}\n // onBlur does not handle completely an out of bounds click\n // ex: select is Opened and a click is done outside, cancelling the select\n // that doesn't count as a Blur, so an onMouseLeave is needed\n onMouseLeave={handleSelectOnBlur}\n data-testid=\"native-select\"\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\nexport const SelectOptionGroupPropTypes = {\n label: PropTypes.string.isRequired,\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes))\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 optgroups: PropTypes.arrayOf(PropTypes.shape(SelectOptionGroupPropTypes)),\n modified: PropTypes.bool,\n error: PropTypes.bool,\n 'aria-label': PropTypes.string,\n 'aria-labelledby': PropTypes.string\n};\n\nexport default Select;\n"],"mappings":";AAAA,OAAOA,KAAK,IAAGC,WAAW,EAAEC,OAAO,EAAEC,QAAQ,QAAO,OAAO;AAC3D,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,MAAM,MAAM,kBAAkB;AACrC,OAAOC,M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AAM,CAACsE,SAAS,GAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAG;EACjB3D,KAAK,EAAEzD,SAAS,CAACuG,MAAM;EACvB1D,IAAI,EAAE7C,SAAS,CAACuG,MAAM;EACtB/D,SAAS,EAAExC,SAAS,CAACuG,MAAM;EAC3BvD,eAAe,EAAEhD,SAAS,CAACuG,MAAM;EACjCpD,QAAQ,EAAEnD,SAAS,CAAC2G,IAAI;EACxBzD,QAAQ,EAAElD,SAAS,CAAC2G,IAAI;EACxBtD,WAAW,EAAErD,SAAS,CAACuG,MAAM;EAC7BnD,QAAQ,EAAEpD,SAAS,CAAC2G,IAAI;EACxB1D,QAAQ,EAAEjD,SAAS,CAACqH,IAAI;EACxB/D,KAAK,EAAEtD,SAAS,CAACsH,KAAK,CAAC5G,IAAI,CAACW,UAAU,CAAC,CAAC;EACxCyB,OAAO,EAAE9C,SAAS,CAAC6G,OAAO,CAAC7G,SAAS,CAAC8G,KAAK,CAACR,qBAAqB,CAAC,CAAC;EAClEvD,SAAS,EAAE/C,SAAS,CAAC6G,OAAO,CAAC7G,SAAS,CAAC8G,KAAK,CAACF,0BAA0B,CAAC,CAAC;EACzErD,QAAQ,EAAEvD,SAAS,CAAC2G,IAAI;EACxBnD,KAAK,EAAExD,SAAS,CAAC2G,IAAI;EACrB,YAAY,EAAE3G,SAAS,CAACuG,MAAM;EAC9B,iBAAiB,EAAEvG,SAAS,CAACuG;AAC/B,CAAC;AAED,eAAe5D,MAAM","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useCallback","useMemo","useState","PropTypes","classnames","concat","filter","find","flatMapDeep","get","getOr","includes","isEmpty","keys","map","size","NovaCompositionNavigationArrowDown","ArrowDown","NovaCompositionNavigationArrowTop","ArrowUp","Provider","GetSkinFromContext","getClassState","style","themeStyle","invalid","header","mooc","question","sort","thematiques","player","template","skillDetail","coorpmanager","ArrowView","shouldRender","isArrowUp","ariaLabel","arrowClass","arrowColor","props","color","className","createElement","_extends","Select","legacyContext","name","options","optgroups","borderClassName","onChange","multiple","disabled","required","description","theme","modified","error","title","propTitle","ariaLabelledBy","skin","setIsArrowUp","handleSelectOnFocus","handleSelectOnBlur","selectOption","option","index","key","value","optionList","optgroup","label","i","titleView","selected","selectedLabel","isSelectedInValidOption","validOption","handleChange","e","target","selectedOptions","black","isThemeOneOfQuestionTemplateOrPlayer","shouldUseSkinFontColor","undefined","behaviorClassName","defaultStyle","composedClassName","unselected","labelSize","isLongLabel","selectWrapper","selectSpan","noLabelCommon","longLabel","selectedArrow","arrow","selectBox","onClick","onBlur","onMouseLeave","SelectOptionPropTypes","string","isRequired","oneOfType","number","bool","SelectOptionGroupPropTypes","arrayOf","shape","contextTypes","childContextTypes","propTypes","process","env","NODE_ENV","func","oneOf"],"sources":["../../../src/atom/select/index.js"],"sourcesContent":["import React, {useCallback, useMemo, useState} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport concat from 'lodash/fp/concat';\nimport filter from 'lodash/fp/filter';\nimport find from 'lodash/fp/find';\nimport flatMapDeep from 'lodash/fp/flatMapDeep';\nimport get from 'lodash/fp/get';\nimport getOr from 'lodash/fp/getOr';\nimport includes from 'lodash/fp/includes';\nimport isEmpty from 'lodash/fp/isEmpty';\nimport keys from 'lodash/fp/keys';\nimport map from 'lodash/fp/map';\nimport size from 'lodash/fp/size';\nimport {\n NovaCompositionNavigationArrowDown as ArrowDown,\n NovaCompositionNavigationArrowTop as ArrowUp\n} 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 skillDetail: style.skillDetail,\n coorpmanager: null\n};\n\nconst ArrowView = ({shouldRender, isArrowUp, ariaLabel, arrowClass, arrowColor}) => {\n const props = useMemo(\n () => ({\n ...(arrowColor &\n {\n color: arrowColor\n }),\n className: arrowClass\n }),\n [arrowClass, arrowColor]\n );\n if (shouldRender) {\n return isArrowUp ? (\n <ArrowUp {...props} data-testid=\"select-arrow-up-icon\" />\n ) : (\n <ArrowDown {...props} data-testid=\"select-arrow-down-icon\" />\n );\n } else return null;\n};\n\nconst Select = (props, legacyContext) => {\n const {\n name,\n options = [],\n optgroups = [],\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 'aria-labelledby': ariaLabelledBy\n } = props;\n\n const skin = GetSkinFromContext(legacyContext);\n const title = useMemo(\n () => (propTitle ? `${propTitle}${required ? '*' : ''}` : null),\n [propTitle, required]\n );\n\n const [isArrowUp, setIsArrowUp] = useState(false);\n\n const handleSelectOnFocus = useCallback(() => {\n if (!disabled) {\n setIsArrowUp(true);\n }\n }, [disabled]);\n const handleSelectOnBlur = useCallback(() => {\n if (!disabled) {\n setIsArrowUp(false);\n }\n }, [disabled]);\n\n const selectOption = (option, index) => {\n return (\n <option key={index} value={option.value} className={style.selectOption}>\n {option.name}\n </option>\n );\n };\n\n const optionList = !isEmpty(options)\n ? options.map((option, index) => selectOption(option, index))\n : optgroups.map((optgroup, index) => {\n return (\n <optgroup key={index} label={optgroup.label}>\n {optgroup.options && optgroup.options.map((option, i) => selectOption(option, i))}\n </optgroup>\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}, concat(options, flatMapDeep('options', optgroups)))),\n [multiple, options, optgroups]\n );\n const selectedLabel = useMemo(\n () =>\n multiple\n ? map(get('name'), filter({selected: true}, options))\n : get('name', find({selected: true}, concat(options, flatMapDeep('options', optgroups)))),\n [multiple, options, optgroups]\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 if (!disabled && onChange) {\n setIsArrowUp(false);\n onChange(map(get('value'), e.target.selectedOptions));\n }\n }\n : e => {\n if (!disabled && onChange) {\n setIsArrowUp(false);\n onChange(e.target.value);\n }\n },\n [onChange, multiple, disabled]\n );\n\n const black = useMemo(() => getOr('#14171A', 'common.black', skin), [skin]);\n const color = useMemo(() => getOr('#00B0FF', 'common.primary', skin), [skin]);\n const isThemeOneOfQuestionTemplateOrPlayer = useMemo(\n () => includes(theme, ['question', 'template', 'player']),\n [theme]\n );\n const shouldUseSkinFontColor = useMemo(\n () => !isSelectedInValidOption && selected && isThemeOneOfQuestionTemplateOrPlayer,\n [isSelectedInValidOption, selected, isThemeOneOfQuestionTemplateOrPlayer]\n );\n const arrowColor = selected ? color : undefined;\n\n const behaviorClassName = useMemo(\n () => getClassState(style.defaultStyle, 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 disabled ? style.disabled : null,\n className\n ),\n [behaviorClassName, className, selected, theme, disabled]\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-testid=\"select-wrapper\"\n data-name=\"select-wrapper\"\n title={title}\n style={{\n ...(shouldUseSkinFontColor && {\n color\n })\n }}\n className={style.selectWrapper}\n >\n {titleView}\n <span\n data-testid=\"select-span\"\n data-name=\"select-span\"\n className={classnames(\n style.selectSpan,\n includes(theme, [\n 'player',\n 'invalid',\n 'question',\n 'thematiques',\n 'template',\n 'skillDetail'\n ])\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 shouldRender={!multiple}\n isArrowUp={isArrowUp}\n ariaLabel={ariaLabel}\n arrowClass={shouldUseSkinFontColor ? style.selectedArrow : style.arrow}\n arrowColor={isThemeOneOfQuestionTemplateOrPlayer ? arrowColor : black}\n />\n <select\n {...(ariaLabelledBy ? {'aria-labelledby': ariaLabelledBy} : {})}\n {...(ariaLabel && !ariaLabelledBy ? {'aria-label': ariaLabel} : {})}\n {...(ariaLabel ? {title: ariaLabel} : {})}\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 onClick={disabled ? undefined : handleSelectOnFocus}\n onBlur={disabled ? undefined : handleSelectOnBlur}\n // onBlur does not handle completely an out of bounds click\n // ex: select is Opened and a click is done outside, cancelling the select\n // that doesn't count as a Blur, so an onMouseLeave is needed\n onMouseLeave={disabled ? undefined : handleSelectOnBlur}\n data-testid=\"native-select\"\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\nexport const SelectOptionGroupPropTypes = {\n label: PropTypes.string.isRequired,\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes))\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 optgroups: PropTypes.arrayOf(PropTypes.shape(SelectOptionGroupPropTypes)),\n modified: PropTypes.bool,\n error: PropTypes.bool,\n 'aria-label': PropTypes.string,\n 'aria-labelledby': PropTypes.string\n};\n\nexport default Select;\n"],"mappings":";AAAA,OAAOA,KAAK,IAAGC,WAAW,EAAEC,OAAO,EAAEC,QAAQ,QAAO,OAAO;AAC3D,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,MAAM,MAAM,kBAAkB;AACrC,OAAOC,MAAM,MAAM,kBAAkB;AACrC,OAAOC,IAAI,MAAM,gBAAgB;AACjC,OAAOC,WAAW,MAAM,uBAAuB;AAC/C,OAAOC,GAAG,MAAM,eAAe;AAC/B,OAAOC,KAAK,MAAM,iBAAiB;AACnC,OAAOC,QAAQ,MAAM,oBAAoB;AACzC,OAAOC,OAAO,MAAM,mBAAmB;AACvC,OAAOC,IAAI,MAAM,gBAAgB;AACjC,OAAOC,GAAG,MAAM,eAAe;AAC/B,OAAOC,IAAI,MAAM,gBAAgB;AACjC,SACEC,kCAAkC,IAAIC,SAAS,EAC/CC,iCAAiC,IAAIC,OAAO,QACvC,0BAA0B;AACjC,OAAOC,QAAQ,IAAGC,kBAAkB,QAAO,aAAa;AACxD,OAAOC,aAAa,MAAM,4BAA4B;AACtD,OAAOC,KAAK,MAAM,aAAa;AAE/B,MAAMC,UAAU,GAAG;EACjBlB,MAAM,EAAEiB,KAAK,CAACjB,MAAM;EACpBmB,OAAO,EAAEF,KAAK,CAACE,OAAO;EACtBC,MAAM,EAAEH,KAAK,CAACG,MAAM;EACpBC,IAAI,EAAEJ,KAAK,CAACI,IAAI;EAChBC,QAAQ,EAAEL,KAAK,CAACK,QAAQ;EACxBC,IAAI,EAAEN,KAAK,CAACM,IAAI;EAChBC,WAAW,EAAEP,KAAK,CAACO,WAAW;EAC9BC,MAAM,EAAER,KAAK,CAACQ,MAAM;EACpBC,QAAQ,EAAET,KAAK,CAACS,QAAQ;EACxBC,WAAW,EAA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AC5G,IAAI,CAACW,UAAU,CAAC,CAAC;EACxCyB,OAAO,EAAE9C,SAAS,CAAC6G,OAAO,CAAC7G,SAAS,CAAC8G,KAAK,CAACR,qBAAqB,CAAC,CAAC;EAClEvD,SAAS,EAAE/C,SAAS,CAAC6G,OAAO,CAAC7G,SAAS,CAAC8G,KAAK,CAACF,0BAA0B,CAAC,CAAC;EACzErD,QAAQ,EAAEvD,SAAS,CAAC2G,IAAI;EACxBnD,KAAK,EAAExD,SAAS,CAAC2G,IAAI;EACrB,YAAY,EAAE3G,SAAS,CAACuG,MAAM;EAC9B,iBAAiB,EAAEvG,SAAS,CAACuG;AAC/B,CAAC;AAED,eAAe5D,MAAM","ignoreList":[]}
|
package/es/atom/select/style.css
CHANGED
|
@@ -665,3 +665,31 @@ div.player:hover span.selectSpan {
|
|
|
665
665
|
.skillDetail.no-label .selectBox {
|
|
666
666
|
max-width: 100%;
|
|
667
667
|
}
|
|
668
|
+
|
|
669
|
+
/*
|
|
670
|
+
Disabled state
|
|
671
|
+
*/
|
|
672
|
+
|
|
673
|
+
.disabled {
|
|
674
|
+
opacity: 0.6;
|
|
675
|
+
cursor: not-allowed;
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
.disabled .selectWrapper {
|
|
679
|
+
cursor: not-allowed;
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
.disabled .selectBox {
|
|
683
|
+
cursor: not-allowed !important;
|
|
684
|
+
background-color: xtraLightGrey;
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
.disabled .arrow,
|
|
688
|
+
.disabled .selectedArrow {
|
|
689
|
+
cursor: not-allowed;
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
.disabled:hover .arrow,
|
|
693
|
+
.disabled:hover .selectedArrow {
|
|
694
|
+
color: inherit;
|
|
695
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/status-item/index.tsx"],"names":[],"mappings":";AASA,OAAkB,EAAC,eAAe,EAAC,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/status-item/index.tsx"],"names":[],"mappings":";AASA,OAAkB,EAAC,eAAe,EAAC,MAAM,SAAS,CAAC;AAoFnD,QAAA,MAAM,UAAU;YAAW,eAAe;;;;;;;CAsBzC,CAAC;AAMF,eAAe,UAAU,CAAC"}
|