@coorpacademy/components 10.5.6 → 10.5.7-alpha.10
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/range/handle.css +18 -2
- package/es/atom/range/handle.js +7 -3
- package/es/atom/range/handle.js.map +1 -1
- package/es/atom/range/style.css +2 -2
- package/es/atom/select/index.js +38 -20
- package/es/atom/select/index.js.map +1 -1
- package/es/atom/select/style.css +129 -40
- package/es/atom/select/test/fixtures/player.js +11 -0
- package/es/atom/select/test/fixtures/player.js.map +1 -0
- package/es/atom/select/test/fixtures.js +2 -0
- package/es/atom/select/test/fixtures.js.map +1 -1
- package/es/atom/select/test/select.js +49 -0
- package/es/atom/select/test/select.js.map +1 -0
- package/es/molecule/course-sections/test/fixtures.js +15 -0
- package/es/molecule/course-sections/test/fixtures.js.map +1 -0
- package/es/molecule/draggable-list/test/fixtures.js +2 -0
- package/es/molecule/draggable-list/test/fixtures.js.map +1 -1
- package/es/molecule/questions/drop-down/index.js +1 -6
- package/es/molecule/questions/drop-down/index.js.map +1 -1
- package/es/molecule/questions/free-text/index.js +35 -15
- package/es/molecule/questions/free-text/index.js.map +1 -1
- package/es/molecule/questions/free-text/style.css +34 -15
- package/es/molecule/questions/free-text/test/fixtures/default.js +1 -1
- package/es/molecule/questions/free-text/test/fixtures/default.js.map +1 -1
- package/es/molecule/questions/free-text/test/fixtures/with-value-on-change.js +9 -0
- package/es/molecule/questions/free-text/test/fixtures/with-value-on-change.js.map +1 -0
- package/es/molecule/questions/free-text/test/fixtures/{with-default-value.js → with-value.js} +2 -2
- package/es/molecule/questions/free-text/test/fixtures/with-value.js.map +1 -0
- package/es/molecule/questions/free-text/test/fixtures.js +4 -2
- package/es/molecule/questions/free-text/test/fixtures.js.map +1 -1
- package/es/molecule/questions/free-text/test/free-text.js +106 -0
- package/es/molecule/questions/free-text/test/free-text.js.map +1 -0
- package/es/molecule/questions/qcm/index.js +37 -25
- package/es/molecule/questions/qcm/index.js.map +1 -1
- package/es/molecule/questions/qcm/style.css +48 -14
- package/es/molecule/questions/qcm/test/fixtures/default.js +8 -0
- package/es/molecule/questions/qcm/test/fixtures/default.js.map +1 -1
- package/es/molecule/questions/qcm/test/qcm.js +103 -0
- package/es/molecule/questions/qcm/test/qcm.js.map +1 -0
- package/es/molecule/questions/qcm-graphic/index.js +35 -17
- package/es/molecule/questions/qcm-graphic/index.js.map +1 -1
- package/es/molecule/questions/qcm-graphic/style.css +64 -13
- package/es/molecule/questions/qcm-graphic/test/qcm-graphic.js +65 -0
- package/es/molecule/questions/qcm-graphic/test/qcm-graphic.js.map +1 -0
- package/es/molecule/questions/question-range/style.css +9 -8
- package/es/molecule/questions/template/index.js +13 -10
- package/es/molecule/questions/template/index.js.map +1 -1
- package/es/molecule/wizard-summary/test/fixtures.js +2 -0
- package/es/molecule/wizard-summary/test/fixtures.js.map +1 -1
- package/es/organism/wizard-contents/test/fixtures.js +2 -0
- package/es/organism/wizard-contents/test/fixtures.js.map +1 -1
- package/es/template/back-office/brand-update/test/fixtures.js +2 -0
- package/es/template/back-office/brand-update/test/fixtures.js.map +1 -1
- package/es/util/get-shadow-box-color-from-primary.js +4 -0
- package/es/util/get-shadow-box-color-from-primary.js.map +1 -0
- package/es/util/test/get-shadow-box-color-from-primary.js +33 -0
- package/es/util/test/get-shadow-box-color-from-primary.js.map +1 -0
- package/es/variables/colors.css +3 -0
- package/lib/atom/range/handle.css +18 -2
- package/lib/atom/range/handle.js +8 -3
- package/lib/atom/range/handle.js.map +1 -1
- package/lib/atom/range/style.css +2 -2
- package/lib/atom/select/index.js +40 -17
- package/lib/atom/select/index.js.map +1 -1
- package/lib/atom/select/style.css +129 -40
- package/lib/atom/select/test/fixtures/player.js +21 -0
- package/lib/atom/select/test/fixtures/player.js.map +1 -0
- package/lib/atom/select/test/fixtures.js +3 -0
- package/lib/atom/select/test/fixtures.js.map +1 -1
- package/lib/atom/select/test/select.js +62 -0
- package/lib/atom/select/test/select.js.map +1 -0
- package/lib/molecule/course-sections/test/fixtures.js +25 -0
- package/lib/molecule/course-sections/test/fixtures.js.map +1 -0
- package/lib/molecule/draggable-list/test/fixtures.js +3 -0
- package/lib/molecule/draggable-list/test/fixtures.js.map +1 -1
- package/lib/molecule/questions/drop-down/index.js +1 -5
- package/lib/molecule/questions/drop-down/index.js.map +1 -1
- package/lib/molecule/questions/free-text/index.js +32 -14
- package/lib/molecule/questions/free-text/index.js.map +1 -1
- package/lib/molecule/questions/free-text/style.css +34 -15
- package/lib/molecule/questions/free-text/test/fixtures/default.js +1 -1
- package/lib/molecule/questions/free-text/test/fixtures/default.js.map +1 -1
- package/lib/molecule/questions/free-text/test/fixtures/with-value-on-change.js +14 -0
- package/lib/molecule/questions/free-text/test/fixtures/with-value-on-change.js.map +1 -0
- package/lib/molecule/questions/free-text/test/fixtures/{with-default-value.js → with-value.js} +2 -2
- package/lib/molecule/questions/free-text/test/fixtures/with-value.js.map +1 -0
- package/lib/molecule/questions/free-text/test/fixtures.js +5 -2
- package/lib/molecule/questions/free-text/test/fixtures.js.map +1 -1
- package/lib/molecule/questions/free-text/test/free-text.js +119 -0
- package/lib/molecule/questions/free-text/test/free-text.js.map +1 -0
- package/lib/molecule/questions/qcm/index.js +44 -23
- package/lib/molecule/questions/qcm/index.js.map +1 -1
- package/lib/molecule/questions/qcm/style.css +48 -14
- package/lib/molecule/questions/qcm/test/fixtures/default.js +8 -0
- package/lib/molecule/questions/qcm/test/fixtures/default.js.map +1 -1
- package/lib/molecule/questions/qcm/test/qcm.js +115 -0
- package/lib/molecule/questions/qcm/test/qcm.js.map +1 -0
- package/lib/molecule/questions/qcm-graphic/index.js +33 -15
- package/lib/molecule/questions/qcm-graphic/index.js.map +1 -1
- package/lib/molecule/questions/qcm-graphic/style.css +64 -13
- package/lib/molecule/questions/qcm-graphic/test/qcm-graphic.js +76 -0
- package/lib/molecule/questions/qcm-graphic/test/qcm-graphic.js.map +1 -0
- package/lib/molecule/questions/question-range/style.css +9 -8
- package/lib/molecule/questions/template/index.js +13 -10
- package/lib/molecule/questions/template/index.js.map +1 -1
- package/lib/molecule/wizard-summary/test/fixtures.js +3 -0
- package/lib/molecule/wizard-summary/test/fixtures.js.map +1 -1
- package/lib/organism/wizard-contents/test/fixtures.js +3 -0
- package/lib/organism/wizard-contents/test/fixtures.js.map +1 -1
- package/lib/template/back-office/brand-update/test/fixtures.js +3 -0
- package/lib/template/back-office/brand-update/test/fixtures.js.map +1 -1
- package/lib/util/get-shadow-box-color-from-primary.js +12 -0
- package/lib/util/get-shadow-box-color-from-primary.js.map +1 -0
- package/lib/util/test/get-shadow-box-color-from-primary.js +40 -0
- package/lib/util/test/get-shadow-box-color-from-primary.js.map +1 -0
- package/lib/variables/colors.css +3 -0
- package/package.json +2 -2
- package/es/molecule/questions/free-text/test/fixtures/with-default-value.js.map +0 -1
- package/es/molecule/search/test/fixtures.js +0 -15
- package/es/molecule/search/test/fixtures.js.map +0 -1
- package/lib/molecule/questions/free-text/test/fixtures/with-default-value.js.map +0 -1
- package/lib/molecule/search/test/fixtures.js +0 -25
- package/lib/molecule/search/test/fixtures.js.map +0 -1
package/lib/atom/range/handle.js
CHANGED
|
@@ -13,6 +13,8 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
13
13
|
|
|
14
14
|
var _provider = _interopRequireDefault(require("../provider"));
|
|
15
15
|
|
|
16
|
+
var _getShadowBoxColorFromPrimary = require("../../util/get-shadow-box-color-from-primary");
|
|
17
|
+
|
|
16
18
|
var _handle = _interopRequireDefault(require("./handle.css"));
|
|
17
19
|
|
|
18
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -63,15 +65,18 @@ class Handle extends _react.default.Component {
|
|
|
63
65
|
skin
|
|
64
66
|
} = this.context;
|
|
65
67
|
const primaryColor = (0, _getOr2.default)('#00B0FF', 'common.primary', skin);
|
|
66
|
-
const
|
|
68
|
+
const backgroundColor = primaryColor;
|
|
67
69
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
70
|
+
className: _handle.default.wrapper
|
|
71
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
68
72
|
style: {
|
|
69
|
-
|
|
73
|
+
backgroundColor,
|
|
74
|
+
boxShadow: `0px 0px 20px ${(0, _getShadowBoxColorFromPrimary.getShadowBoxColorFromPrimary)(primaryColor)}`
|
|
70
75
|
},
|
|
71
76
|
className: _handle.default.default,
|
|
72
77
|
ref: this.setHandle,
|
|
73
78
|
"data-name": 'handle'
|
|
74
|
-
});
|
|
79
|
+
}));
|
|
75
80
|
}
|
|
76
81
|
|
|
77
82
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/atom/range/handle.js"],"names":["Hammer","window","require","undefined","Handle","React","Component","constructor","props","context","setHandle","bind","componentDidMount","onPanStart","onPanEnd","onPan","hammer","handle","on","componentWillUnmount","stop","destroy","el","render","skin","primaryColor","
|
|
1
|
+
{"version":3,"sources":["../../../src/atom/range/handle.js"],"names":["Hammer","window","require","undefined","Handle","React","Component","constructor","props","context","setHandle","bind","componentDidMount","onPanStart","onPanEnd","onPan","hammer","handle","on","componentWillUnmount","stop","destroy","el","render","skin","primaryColor","backgroundColor","style","wrapper","boxShadow","default","Provider","childContextTypes","propTypes","PropTypes","func"],"mappings":";;;;;;;;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEA,MAAMA,MAAM,GACV;AACA,OAAOC,MAAP,KAAkB,WAAlB,GAAgCC,OAAO,CAAC,UAAD,CAAvC;AAAsD;AAA2BC,SAFnF;;AAIA,MAAMC,MAAN,SAAqBC,eAAMC,SAA3B,CAAqC;AAWnCC,EAAAA,WAAW,CAACC,KAAD,EAAQC,OAAR,EAAiB;AAC1B,UAAMD,KAAN,EAAaC,OAAb;AAEA,SAAKC,SAAL,GAAiB,KAAKA,SAAL,CAAeC,IAAf,CAAoB,IAApB,CAAjB;AACD;;AAEDC,EAAAA,iBAAiB,GAAG;AAClB;AACA,QA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Y;AACjBlB,EAAAA,KAAK,EAAEmB,mBAAUC,IADA;AAEjBtB,EAAAA,UAAU,EAAEqB,mBAAUC,IAFL;AAGjBrB,EAAAA,QAAQ,EAAEoB,mBAAUC;AAHH,C;eA8DN/B,M","sourcesContent":["import {noop, getOr} from 'lodash/fp';\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport Provider from '../provider';\nimport {getShadowBoxColorFromPrimary} from '../../util/get-shadow-box-color-from-primary';\nimport style from './handle.css';\n\nconst Hammer =\n // eslint-disable-next-line no-undef\n typeof window !== 'undefined' ? require('hammerjs') : /* istanbul ignore next */ undefined;\n\nclass Handle extends React.Component {\n static propTypes = {\n onPan: PropTypes.func,\n onPanStart: PropTypes.func,\n onPanEnd: PropTypes.func\n };\n\n static contextTypes = {\n skin: Provider.childContextTypes.skin\n };\n\n constructor(props, context) {\n super(props, context);\n\n this.setHandle = this.setHandle.bind(this);\n }\n\n componentDidMount() {\n /* istanbul ignore else */\n if (Hammer) {\n const {onPanStart = noop, onPanEnd = noop, onPan = noop} = this.props;\n\n this.hammer = new Hammer(this.handle);\n this.hammer.on('panstart', onPanStart);\n this.hammer.on('panend', onPanEnd);\n\n this.hammer.on('panleft panright', onPan);\n }\n }\n\n componentWillUnmount() {\n if (this.hammer) {\n this.hammer.stop();\n this.hammer.destroy();\n }\n this.hammer = null;\n }\n\n setHandle(el) {\n this.handle = el;\n }\n\n render() {\n const {skin} = this.context;\n const primaryColor = getOr('#00B0FF', 'common.primary', skin);\n const backgroundColor = primaryColor;\n\n return (\n <div className={style.wrapper}>\n <div\n style={{\n backgroundColor,\n boxShadow: `0px 0px 20px ${getShadowBoxColorFromPrimary(primaryColor)}`\n }}\n className={style.default}\n ref={this.setHandle}\n data-name={'handle'}\n />\n </div>\n );\n }\n}\n\nexport default Handle;\n"],"file":"handle.js"}
|
package/lib/atom/range/style.css
CHANGED
package/lib/atom/select/index.js
CHANGED
|
@@ -3,8 +3,14 @@
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.default = exports.SelectOptionPropTypes = void 0;
|
|
5
5
|
|
|
6
|
+
var _size2 = _interopRequireDefault(require("lodash/fp/size"));
|
|
7
|
+
|
|
8
|
+
var _includes2 = _interopRequireDefault(require("lodash/fp/includes"));
|
|
9
|
+
|
|
6
10
|
var _filter2 = _interopRequireDefault(require("lodash/fp/filter"));
|
|
7
11
|
|
|
12
|
+
var _getOr2 = _interopRequireDefault(require("lodash/fp/getOr"));
|
|
13
|
+
|
|
8
14
|
var _get2 = _interopRequireDefault(require("lodash/fp/get"));
|
|
9
15
|
|
|
10
16
|
var _map2 = _interopRequireDefault(require("lodash/fp/map"));
|
|
@@ -33,6 +39,8 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj;
|
|
|
33
39
|
|
|
34
40
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
35
41
|
|
|
42
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
43
|
+
|
|
36
44
|
const themeStyle = {
|
|
37
45
|
filter: _style.default.filter,
|
|
38
46
|
invalid: _style.default.invalid,
|
|
@@ -41,7 +49,9 @@ const themeStyle = {
|
|
|
41
49
|
question: _style.default.question,
|
|
42
50
|
sort: _style.default.sort,
|
|
43
51
|
thematiques: _style.default.thematiques,
|
|
44
|
-
|
|
52
|
+
player: _style.default.player,
|
|
53
|
+
template: _style.default.template // we keep template in case it is used anywhere else?
|
|
54
|
+
|
|
45
55
|
};
|
|
46
56
|
|
|
47
57
|
const Select = (props, context) => {
|
|
@@ -63,49 +73,61 @@ const Select = (props, context) => {
|
|
|
63
73
|
const {
|
|
64
74
|
skin
|
|
65
75
|
} = context;
|
|
66
|
-
const title = propTitle ? `${propTitle}${required ? '*' : ''}` : null;
|
|
76
|
+
const title = (0, _react.useMemo)(() => propTitle ? `${propTitle}${required ? '*' : ''}` : null, [propTitle, required]);
|
|
67
77
|
const optionList = options && options.map((option, index) => {
|
|
68
78
|
return /*#__PURE__*/_react.default.createElement("option", {
|
|
69
79
|
key: index,
|
|
70
|
-
value: option.value
|
|
80
|
+
value: option.value,
|
|
81
|
+
className: _style.default.selectOption
|
|
71
82
|
}, option.name);
|
|
72
83
|
});
|
|
73
84
|
const titleView = title ? /*#__PURE__*/_react.default.createElement("span", {
|
|
74
85
|
className: _style.default.title
|
|
75
86
|
}, title, " ") : null;
|
|
76
|
-
const selected = multiple ? (0, _map2.default)((0, _get2.default)('value'), (0, _filter2.default)({
|
|
87
|
+
const selected = (0, _react.useMemo)(() => multiple ? (0, _map2.default)((0, _get2.default)('value'), (0, _filter2.default)({
|
|
77
88
|
selected: true
|
|
78
89
|
}, options)) : (0, _get2.default)('value', (0, _find2.default)({
|
|
79
90
|
selected: true
|
|
80
|
-
}, options));
|
|
81
|
-
const selectedLabel = multiple ? (0, _map2.default)((0, _get2.default)('name'), (0, _filter2.default)({
|
|
91
|
+
}, options)), [multiple, options]);
|
|
92
|
+
const selectedLabel = (0, _react.useMemo)(() => multiple ? (0, _map2.default)((0, _get2.default)('name'), (0, _filter2.default)({
|
|
82
93
|
selected: true
|
|
83
94
|
}, options)) : (0, _get2.default)('name', (0, _find2.default)({
|
|
84
95
|
selected: true
|
|
85
|
-
}, options));
|
|
96
|
+
}, options)), [multiple, options]);
|
|
97
|
+
const isSelectedInValidOption = (0, _react.useMemo)(() => theme === 'player' && (0, _getOr2.default)(false, 'name', (0, _find2.default)({
|
|
98
|
+
validOption: false,
|
|
99
|
+
selected: true
|
|
100
|
+
}, options)), [options, theme]);
|
|
86
101
|
const handleChange = (0, _react.useMemo)(() => multiple ? e => {
|
|
87
102
|
onChange((0, _map2.default)((0, _get2.default)('value'), e.target.selectedOptions));
|
|
88
103
|
} : e => {
|
|
89
104
|
onChange(e.target.value);
|
|
90
105
|
}, [onChange, multiple]);
|
|
91
|
-
const black = (0,
|
|
92
|
-
const color = (0,
|
|
93
|
-
const
|
|
94
|
-
color: selected && (theme === 'question' || theme === 'template') ? color : null
|
|
95
|
-
};
|
|
106
|
+
const black = (0, _react.useMemo)(() => (0, _getOr2.default)('#14171A', 'common.black', skin), [skin]);
|
|
107
|
+
const color = (0, _react.useMemo)(() => (0, _getOr2.default)('#00B0FF', 'common.primary', skin), [skin]);
|
|
108
|
+
const shouldUseSkinFontColor = (0, _react.useMemo)(() => !isSelectedInValidOption && selected && (0, _includes2.default)(theme, ['question', 'template', 'player']), [isSelectedInValidOption, selected, theme]);
|
|
96
109
|
const arrowView = !multiple ? /*#__PURE__*/_react.default.createElement(_novaIcons.NovaCompositionNavigationArrowDown, {
|
|
97
110
|
color: selected && (theme === 'question' || theme === 'template') ? color : black,
|
|
98
111
|
className: _style.default.arrow
|
|
99
112
|
}) : null;
|
|
100
|
-
const behaviourClassName = (0, _getClassState.default)(_style.default.default, _style.default.modified, _style.default.error, modified, error);
|
|
101
|
-
const composedClassName = (0, _classnames.default)(theme ? themeStyle[theme] : behaviourClassName, selected ? _style.default.selected : _style.default.unselected, className);
|
|
113
|
+
const behaviourClassName = (0, _react.useMemo)(() => (0, _getClassState.default)(_style.default.default, _style.default.modified, _style.default.error, modified, error), [error, modified]);
|
|
114
|
+
const composedClassName = (0, _react.useMemo)(() => (0, _classnames.default)(theme ? themeStyle[theme] : behaviourClassName, selected ? _style.default.selected : _style.default.unselected, className), [behaviourClassName, className, selected, theme]);
|
|
115
|
+
const labelSize = (0, _react.useMemo)(() => (0, _size2.default)(selectedLabel), [selectedLabel]);
|
|
116
|
+
const isLongLabel = (0, _react.useMemo)(() => labelSize >= 65, [labelSize]);
|
|
102
117
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
103
118
|
className: composedClassName
|
|
104
119
|
}, /*#__PURE__*/_react.default.createElement("label", {
|
|
105
|
-
|
|
120
|
+
"data-name": "select-wrapper",
|
|
121
|
+
style: _extends({}, shouldUseSkinFontColor && {
|
|
122
|
+
color
|
|
123
|
+
}),
|
|
124
|
+
className: _style.default.selectWrapper
|
|
106
125
|
}, titleView, /*#__PURE__*/_react.default.createElement("span", {
|
|
107
|
-
|
|
126
|
+
"data-name": "select-span",
|
|
127
|
+
className: (0, _classnames.default)(_style.default.selectSpan, (0, _includes2.default)(theme, ['player', 'invalid', 'question', 'thematiques', 'template']) ? _style.default.noLabelCommon : null, borderClassName, isLongLabel ? _style.default.longLabel : null)
|
|
108
128
|
}, selectedLabel), arrowView, /*#__PURE__*/_react.default.createElement("select", {
|
|
129
|
+
"data-name": "native-select",
|
|
130
|
+
className: _style.default.selectBox,
|
|
109
131
|
title: selectedLabel,
|
|
110
132
|
name: name,
|
|
111
133
|
onChange: handleChange,
|
|
@@ -120,7 +142,8 @@ const Select = (props, context) => {
|
|
|
120
142
|
const SelectOptionPropTypes = {
|
|
121
143
|
name: _propTypes.default.string.isRequired,
|
|
122
144
|
value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
123
|
-
selected: _propTypes.default.bool
|
|
145
|
+
selected: _propTypes.default.bool,
|
|
146
|
+
validOption: _propTypes.default.bool
|
|
124
147
|
};
|
|
125
148
|
exports.SelectOptionPropTypes = SelectOptionPropTypes;
|
|
126
149
|
Select.contextTypes = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/atom/select/index.js"],"names":["themeStyle","filter","style","invalid","header","mooc","question","sort","thematiques","template","Select","props","context","name","options","className","borderClassName","onChange","multiple","disabled","required","description","theme","modified","error","title","propTitle","skin","optionList","map","option","index","value","titleView","selected","selectedLabel","handleChange","e","target","selectedOptions","black","color","skinColor","arrowView","arrow","behaviourClassName","default","composedClassName","unselected","label","SelectOptionPropTypes","PropTypes","string","isRequired","oneOfType","number","bool","contextTypes","Provider","childContextTypes","propTypes","func","oneOf","arrayOf","shape"],"mappings":";;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AAEA;;AACA;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CAApB,CAF4B;AAGnCrB,EAAAA,QAAQ,EAAEiB,mBAAUK;AAHe,CAA9B;;AAMP9C,MAAM,CAAC+C,YAAP,GAAsB;AACpB9B,EAAAA,IAAI,EAAE+B,kBAASC,iBAAT,CAA2BhC;AADb,CAAtB;AAIAjB,MAAM,CAACkD,SAAP,2CAAmB;AACjBnC,EAAAA,KAAK,EAAE0B,mBAAUC,MADA;AAEjBvC,EAAAA,IAAI,EAAEsC,mBAAUC,MAFC;AAGjBrC,EAAAA,SAAS,EAAEoC,mBAAUC,MAHJ;AAIjBpC,EAAAA,eAAe,EAAEmC,mBAAUC,MAJV;AAKjBjC,EAAAA,QAAQ,EAAEgC,mBAAUK,IALH;AAMjBtC,EAAAA,QAAQ,EAAEiC,mBAAUK,IANH;AAOjBnC,EAAAA,WAAW,EAAE8B,mBAAUC,MAPN;AAQjBhC,EAAAA,QAAQ,EAAE+B,mBAAUK,IARH;AASjBvC,EAAAA,QAAQ,EAAEkC,mBAAUU,IATH;AAUjBvC,EAAAA,KAAK,EAAE6B,mBAAUW,KAAV,CAAgB,oBAAK9D,UAAL,CAAhB,CAVU;AAWjBc,EAAAA,OAAO,EAAEqC,mBAAUY,OAAV,CAAkBZ,mBAAUa,KAAV,CAAgBd,qBAAhB,CAAlB,CAXQ;AAYjB3B,EAAAA,QAAQ,EAAE4B,mBAAUK,IAZH;AAajBhC,EAAAA,KAAK,EAAE2B,mBAAUK;AAbA,CAAnB;eAgBe9C,M","sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {find, keys, map, get, filter} from 'lodash/fp';\nimport {NovaCompositionNavigationArrowDown as ArrowDown} from '@coorpacademy/nova-icons';\nimport Provider 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 template: style.template\n};\n\nconst Select = (props, context) => {\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 } = props;\n\n const {skin} = context;\n\n const title = propTitle ? `${propTitle}${required ? '*' : ''}` : null;\n\n const optionList =\n options &&\n options.map((option, index) => {\n return (\n <option key={index} value={option.value}>\n {option.name}\n </option>\n );\n });\n\n const titleView = title ? <span className={style.title}>{title} </span> : null;\n\n const selected = multiple\n ? map(get('value'), filter({selected: true}, options))\n : get('value', find({selected: true}, options));\n const selectedLabel = multiple\n ? map(get('name'), filter({selected: true}, options))\n : get('name', find({selected: true}, options));\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 = get('common.black', skin);\n const color = get('common.primary', skin);\n const skinColor = {\n color: selected && (theme === 'question' || theme === 'template') ? color : null\n };\n\n const arrowView = !multiple ? (\n <ArrowDown\n color={selected && (theme === 'question' || theme === 'template') ? color : black}\n className={style.arrow}\n />\n ) : null;\n const behaviourClassName = getClassState(\n style.default,\n style.modified,\n style.error,\n modified,\n error\n );\n const composedClassName = classnames(\n theme ? themeStyle[theme] : behaviourClassName,\n selected ? style.selected : style.unselected,\n className\n );\n\n return (\n <div className={composedClassName}>\n <label style={skinColor}>\n {titleView}\n <span className={classnames(style.label, borderClassName)}>{selectedLabel}</span>\n {arrowView}\n <select\n title={selectedLabel}\n name={name}\n onChange={handleChange}\n value={selected}\n multiple={multiple}\n disabled={disabled}\n >\n {optionList}\n </select>\n </label>\n <div className={style.description}>{description}</div>\n </div>\n );\n};\n\nexport const SelectOptionPropTypes = {\n name: PropTypes.string.isRequired,\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n selected: PropTypes.bool\n};\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};\n\nexport default Select;\n"],"file":"index.js"}
|
|
1
|
+
{"version":3,"sources":["../../../src/atom/select/index.js"],"names":["themeStyle","filter","style","invalid","header","mooc","question","sort","thematiques","player","template","Select","props","context","name","options","className","borderClassName","onChange","multiple","disabled","required","description","theme","modified","error","title","propTitle","skin","optionList","map","option","index","value","selectOption","titleView","selected","selectedLabel","isSelectedInValidOption","validOption","handleChange","e","target","selectedOptions","black","color","shouldUseSkinFontColor","arrowView","arrow","behaviourClassName","default","composedClassName","unselected","labelSize","isLongLabel","selectWrapper","selectSpan","noLabelCommon","longLabel","selectBox","SelectOptionPropTypes","PropTypes","string","isRequired","oneOfType","number","bool","contextTypes","Provider","childContextTypes","propTypes","func","oneOf","arrayOf","shape"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,UAAU,GAAG;AACjBC,EAAAA,MAAM,EAAEC,eAAMD,MADG;AAEjBE,EAAAA,OAAO,EAAED,eAAMC,OAFE;AAGjBC,EAAAA,MAAM,EAAEF,eAAME,MAHG;AAIjBC,EAAAA,IAAI,EAAEH,eAAMG,IAJK;AAKjBC,EAAAA,QAAQ,EAAEJ,eAAMI,QALC;AAMjBC,EAAAA,IAAI,EAAEL,eAAMK,IANK;AAOjBC,EAAAA,WAAW,EAAEN,eAAMM,WAPF;AAQjBC,EAAAA,MAAM,EAAEP,eAAMO,MARG;AASjBC,EAAAA,QAAQ,EAAER,eAAMQ,QATC,CASQ;;AATR,CAAnB;;AAYA,MAAMC,MAAM,GAAG,CAACC,KAA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C,MADA;AAEjBhD,EAAAA,IAAI,EAAE+C,mBAAUC,MAFC;AAGjB9C,EAAAA,SAAS,EAAE6C,mBAAUC,MAHJ;AAIjB7C,EAAAA,eAAe,EAAE4C,mBAAUC,MAJV;AAKjB1C,EAAAA,QAAQ,EAAEyC,mBAAUK,IALH;AAMjB/C,EAAAA,QAAQ,EAAE0C,mBAAUK,IANH;AAOjB5C,EAAAA,WAAW,EAAEuC,mBAAUC,MAPN;AAQjBzC,EAAAA,QAAQ,EAAEwC,mBAAUK,IARH;AASjBhD,EAAAA,QAAQ,EAAE2C,mBAAUU,IATH;AAUjBhD,EAAAA,KAAK,EAAEsC,mBAAUW,KAAV,CAAgB,oBAAKxE,UAAL,CAAhB,CAVU;AAWjBe,EAAAA,OAAO,EAAE8C,mBAAUY,OAAV,CAAkBZ,mBAAUa,KAAV,CAAgBd,qBAAhB,CAAlB,CAXQ;AAYjBpC,EAAAA,QAAQ,EAAEqC,mBAAUK,IAZH;AAajBzC,EAAAA,KAAK,EAAEoC,mBAAUK;AAbA,CAAnB;eAgBevD,M","sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {find, keys, map, get, getOr, filter, includes, size} from 'lodash/fp';\nimport {NovaCompositionNavigationArrowDown as ArrowDown} from '@coorpacademy/nova-icons';\nimport Provider 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 // we keep template in case it is used anywhere else?\n};\n\nconst Select = (props, context) => {\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 } = props;\n\n const {skin} = context;\n\n const title = useMemo(() => (propTitle ? `${propTitle}${required ? '*' : ''}` : null), [\n propTitle,\n required\n ]);\n\n const optionList =\n options &&\n options.map((option, index) => {\n return (\n <option key={index} value={option.value} className={style.selectOption}>\n {option.name}\n </option>\n );\n });\n\n const titleView = title ? <span className={style.title}>{title} </span> : null;\n\n const selected = useMemo(\n () =>\n multiple\n ? map(get('value'), filter({selected: true}, options))\n : get('value', find({selected: true}, options)),\n [multiple, options]\n );\n const selectedLabel = useMemo(\n () =>\n multiple\n ? map(get('name'), filter({selected: true}, options))\n : get('name', find({selected: true}, options)),\n [multiple, options]\n );\n\n const isSelectedInValidOption = useMemo(\n () =>\n theme === 'player' &&\n getOr(false, 'name', find({validOption: false, selected: true}, options)),\n [options, theme]\n );\n\n const handleChange = useMemo(\n () =>\n multiple\n ? e => {\n onChange(map(get('value'), e.target.selectedOptions));\n }\n : e => {\n onChange(e.target.value);\n },\n [onChange, multiple]\n );\n\n const black = useMemo(() => getOr('#14171A', 'common.black', skin), [skin]);\n const color = useMemo(() => getOr('#00B0FF', 'common.primary', skin), [skin]);\n const shouldUseSkinFontColor = useMemo(\n () =>\n !isSelectedInValidOption && selected && includes(theme, ['question', 'template', 'player']),\n [isSelectedInValidOption, selected, theme]\n );\n\n const arrowView = !multiple ? (\n <ArrowDown\n color={selected && (theme === 'question' || theme === 'template') ? color : black}\n className={style.arrow}\n />\n ) : null;\n const behaviourClassName = useMemo(\n () => getClassState(style.default, style.modified, style.error, modified, error),\n [error, modified]\n );\n const composedClassName = useMemo(\n () =>\n classnames(\n theme ? themeStyle[theme] : behaviourClassName,\n selected ? style.selected : style.unselected,\n className\n ),\n [behaviourClassName, 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 className={composedClassName}>\n <label\n data-name=\"select-wrapper\"\n style={{\n ...(shouldUseSkinFontColor && {\n color\n })\n }}\n className={style.selectWrapper}\n >\n {titleView}\n <span\n data-name=\"select-span\"\n className={classnames(\n style.selectSpan,\n includes(theme, ['player', 'invalid', 'question', 'thematiques', 'template'])\n ? style.noLabelCommon\n : null,\n borderClassName,\n isLongLabel ? style.longLabel : null\n )}\n >\n {selectedLabel}\n </span>\n {arrowView}\n <select\n data-name=\"native-select\"\n className={style.selectBox}\n title={selectedLabel}\n name={name}\n onChange={handleChange}\n value={selected}\n multiple={multiple}\n disabled={disabled}\n >\n {optionList}\n </select>\n </label>\n <div className={style.description}>{description}</div>\n </div>\n );\n};\n\nexport const SelectOptionPropTypes = {\n name: PropTypes.string.isRequired,\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n selected: PropTypes.bool,\n validOption: PropTypes.bool\n};\n\nSelect.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nSelect.propTypes = {\n title: PropTypes.string,\n name: PropTypes.string,\n className: PropTypes.string,\n borderClassName: PropTypes.string,\n disabled: PropTypes.bool,\n multiple: PropTypes.bool,\n description: PropTypes.string,\n required: PropTypes.bool,\n onChange: PropTypes.func,\n theme: PropTypes.oneOf(keys(themeStyle)),\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes)),\n modified: PropTypes.bool,\n error: PropTypes.bool\n};\n\nexport default Select;\n"],"file":"index.js"}
|
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
@value white from colors;
|
|
11
11
|
@value xtraLightGrey from colors;
|
|
12
12
|
@value transparent from colors;
|
|
13
|
+
@value box_shadow_light_dark from colors;
|
|
14
|
+
@value cm_blue_900 from colors;
|
|
13
15
|
|
|
14
16
|
.default {
|
|
15
17
|
display: flex;
|
|
@@ -23,7 +25,11 @@
|
|
|
23
25
|
composes: default;
|
|
24
26
|
}
|
|
25
27
|
|
|
26
|
-
.
|
|
28
|
+
.selectWrapper {
|
|
29
|
+
position: relative;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.default .selectWrapper {
|
|
27
33
|
display: flex;
|
|
28
34
|
align-items: center;
|
|
29
35
|
height: 50px;
|
|
@@ -41,20 +47,16 @@
|
|
|
41
47
|
width: 180px;
|
|
42
48
|
}
|
|
43
49
|
|
|
44
|
-
.
|
|
50
|
+
.selectSpan {
|
|
45
51
|
display: none;
|
|
46
|
-
position:
|
|
52
|
+
position: relative;
|
|
53
|
+
z-index: 10;
|
|
47
54
|
white-space: nowrap;
|
|
48
|
-
overflow: hidden;
|
|
49
|
-
left: 0;
|
|
50
|
-
right: 0;
|
|
51
|
-
bottom: 0;
|
|
52
55
|
pointer-events: none;
|
|
53
|
-
text-overflow: ellipsis;
|
|
54
56
|
height: 18px;
|
|
55
57
|
}
|
|
56
58
|
|
|
57
|
-
.default
|
|
59
|
+
.default .selectBox {
|
|
58
60
|
font-family: "Gilroy";
|
|
59
61
|
text-transform: none;
|
|
60
62
|
padding: 0 15px;
|
|
@@ -68,6 +70,18 @@
|
|
|
68
70
|
outline: none;
|
|
69
71
|
appearance: none;
|
|
70
72
|
cursor: pointer;
|
|
73
|
+
position: absolute;
|
|
74
|
+
left: 0;
|
|
75
|
+
right: 0;
|
|
76
|
+
bottom: 0;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.selectOption,
|
|
80
|
+
|
|
81
|
+
.no-label .selectWrapper,
|
|
82
|
+
.player .selectWrapper {
|
|
83
|
+
min-width: min-content;
|
|
84
|
+
height: min-content;
|
|
71
85
|
}
|
|
72
86
|
|
|
73
87
|
.modified select {
|
|
@@ -112,6 +126,7 @@
|
|
|
112
126
|
pointer-events: none;
|
|
113
127
|
width: 12px;
|
|
114
128
|
height: 12px;
|
|
129
|
+
z-index: 11;
|
|
115
130
|
}
|
|
116
131
|
|
|
117
132
|
@media mobile {
|
|
@@ -121,7 +136,7 @@
|
|
|
121
136
|
}
|
|
122
137
|
}
|
|
123
138
|
|
|
124
|
-
.default
|
|
139
|
+
.default .selectBox[multiple] {
|
|
125
140
|
padding: 0;
|
|
126
141
|
height: 80px;
|
|
127
142
|
}
|
|
@@ -130,7 +145,7 @@
|
|
|
130
145
|
Filter
|
|
131
146
|
*/
|
|
132
147
|
|
|
133
|
-
.filter
|
|
148
|
+
.filter .selectWrapper {
|
|
134
149
|
display: flex;
|
|
135
150
|
align-items: center;
|
|
136
151
|
position: relative;
|
|
@@ -140,7 +155,7 @@
|
|
|
140
155
|
margin: 0;
|
|
141
156
|
}
|
|
142
157
|
|
|
143
|
-
.filter .
|
|
158
|
+
.filter .selectSpan {
|
|
144
159
|
display: block;
|
|
145
160
|
padding: 15px 30px 15px 15px;
|
|
146
161
|
font-size: 12px;
|
|
@@ -157,7 +172,7 @@
|
|
|
157
172
|
margin-bottom: 10px;
|
|
158
173
|
}
|
|
159
174
|
|
|
160
|
-
.filter
|
|
175
|
+
.filter .selectBox {
|
|
161
176
|
display: block;
|
|
162
177
|
width: 100%;
|
|
163
178
|
height: 50px;
|
|
@@ -186,57 +201,110 @@
|
|
|
186
201
|
position: relative;
|
|
187
202
|
}
|
|
188
203
|
|
|
189
|
-
.no-label
|
|
204
|
+
.no-label .selectWrapper {
|
|
190
205
|
display: flex;
|
|
191
206
|
align-items: center;
|
|
192
|
-
height:
|
|
207
|
+
min-height: 54px;
|
|
193
208
|
position: relative;
|
|
194
209
|
flex-grow: 0;
|
|
195
210
|
}
|
|
196
211
|
|
|
197
|
-
.
|
|
212
|
+
.noLabelCommon {
|
|
198
213
|
display: block;
|
|
199
214
|
padding: 0 30px 0 10px;
|
|
200
215
|
font-size: 14px;
|
|
216
|
+
height: 54px;
|
|
217
|
+
line-height: 52px;
|
|
218
|
+
box-sizing: border-box;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
div.default label.selectWrapper span.longLabel {
|
|
222
|
+
min-width: 230px;
|
|
223
|
+
max-width: 280px;
|
|
224
|
+
white-space: pre-wrap;
|
|
225
|
+
line-height: 22px;
|
|
226
|
+
padding-top: 15px;
|
|
227
|
+
padding-bottom: 15px;
|
|
228
|
+
height: auto;
|
|
229
|
+
border: none;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
div:not(.player) .noLabelCommon.selectSpan {
|
|
201
233
|
border: 1px solid light;
|
|
202
234
|
background: white;
|
|
203
235
|
border-radius: 2px;
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
div.player .noLabelCommon.selectSpan {
|
|
239
|
+
box-shadow: 0px 4px 16px box_shadow_light_dark;
|
|
240
|
+
border-radius: 8px;
|
|
241
|
+
min-width: min-content;
|
|
242
|
+
width: 100%;
|
|
207
243
|
white-space: nowrap;
|
|
208
|
-
text-overflow: ellipsis;
|
|
209
244
|
}
|
|
210
245
|
|
|
211
|
-
.no-label
|
|
246
|
+
.no-label .selectBox {
|
|
212
247
|
font-family: "Gilroy";
|
|
213
248
|
text-transform: none;
|
|
214
249
|
padding: 0 15px;
|
|
215
|
-
height:
|
|
250
|
+
height: 54px;
|
|
216
251
|
border-radius: 2px;
|
|
217
|
-
font-size:
|
|
252
|
+
font-size: 14px;
|
|
218
253
|
color: black;
|
|
219
254
|
font-weight: normal;
|
|
220
255
|
margin-left: 0;
|
|
221
256
|
width: 230px;
|
|
257
|
+
max-width: 280px;
|
|
222
258
|
cursor: pointer;
|
|
223
259
|
background: white;
|
|
224
260
|
border: 2px solid xtraLightGrey;
|
|
225
261
|
}
|
|
226
262
|
|
|
227
263
|
@media mobile {
|
|
228
|
-
.
|
|
229
|
-
|
|
230
|
-
|
|
264
|
+
div.player .selectBox {
|
|
265
|
+
min-width: 0;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
.no-label .selectBox {
|
|
231
269
|
margin-left: 0;
|
|
232
270
|
border-radius: 0;
|
|
271
|
+
position: absolute;
|
|
272
|
+
left: 0;
|
|
273
|
+
right: 0;
|
|
274
|
+
bottom: 0;
|
|
233
275
|
}
|
|
234
276
|
|
|
235
|
-
.no-label
|
|
277
|
+
.no-label .selectWrapper {
|
|
236
278
|
display: block;
|
|
237
279
|
margin-right: 0;
|
|
238
280
|
width: 100%;
|
|
239
|
-
height: 44px;
|
|
281
|
+
min-height: 44px;
|
|
282
|
+
height: min-content;
|
|
283
|
+
min-width: 250px;
|
|
284
|
+
max-width: 280px;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
.player .noLabelCommon {
|
|
288
|
+
height: min-content;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
div.player .noLabelCommon.selectSpan {
|
|
292
|
+
min-width: 250px;
|
|
293
|
+
max-width: 280px;
|
|
294
|
+
white-space: pre-wrap;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
.noLabelCommon.longLabel {
|
|
298
|
+
line-height: 22px;
|
|
299
|
+
height: 100%;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
.player.default .selectBox {
|
|
303
|
+
position: absolute;
|
|
304
|
+
top: 0px;
|
|
305
|
+
left: 0px;
|
|
306
|
+
width: 100%;
|
|
307
|
+
height: 100%;
|
|
240
308
|
}
|
|
241
309
|
}
|
|
242
310
|
|
|
@@ -248,12 +316,16 @@
|
|
|
248
316
|
composes: no-label;
|
|
249
317
|
}
|
|
250
318
|
|
|
251
|
-
.invalid
|
|
319
|
+
.invalid .player {
|
|
320
|
+
color: cm_blue_900;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
.invalid .selectWrapper {
|
|
252
324
|
height: 54px;
|
|
253
325
|
color: black;
|
|
254
326
|
}
|
|
255
327
|
|
|
256
|
-
.invalid .
|
|
328
|
+
.invalid .selectSpan {
|
|
257
329
|
font-size: 15px;
|
|
258
330
|
font-weight: 700;
|
|
259
331
|
border: 2px solid;
|
|
@@ -271,7 +343,7 @@
|
|
|
271
343
|
width: 150px;
|
|
272
344
|
}
|
|
273
345
|
|
|
274
|
-
.mooc
|
|
346
|
+
.mooc .selectWrapper {
|
|
275
347
|
margin: 0;
|
|
276
348
|
height: 35px;
|
|
277
349
|
border: 0;
|
|
@@ -307,11 +379,11 @@
|
|
|
307
379
|
composes: no-label;
|
|
308
380
|
}
|
|
309
381
|
|
|
310
|
-
.question
|
|
382
|
+
.question .selectWrapper {
|
|
311
383
|
height: 54px;
|
|
312
384
|
}
|
|
313
385
|
|
|
314
|
-
.question .
|
|
386
|
+
.question .selectSpan {
|
|
315
387
|
font-size: 15px;
|
|
316
388
|
font-weight: 700;
|
|
317
389
|
border: 2px solid;
|
|
@@ -328,7 +400,7 @@
|
|
|
328
400
|
margin-bottom: 10px;
|
|
329
401
|
}
|
|
330
402
|
|
|
331
|
-
.sort
|
|
403
|
+
.sort .selectWrapper {
|
|
332
404
|
display: flex;
|
|
333
405
|
align-items: center;
|
|
334
406
|
position: relative;
|
|
@@ -338,7 +410,7 @@
|
|
|
338
410
|
margin: 0;
|
|
339
411
|
}
|
|
340
412
|
|
|
341
|
-
.sort .
|
|
413
|
+
.sort .selectSpan {
|
|
342
414
|
display: block;
|
|
343
415
|
padding: 15px 30px 15px 15px;
|
|
344
416
|
font-size: 12px;
|
|
@@ -379,6 +451,14 @@
|
|
|
379
451
|
composes: no-label;
|
|
380
452
|
}
|
|
381
453
|
|
|
454
|
+
/*
|
|
455
|
+
Player
|
|
456
|
+
*/
|
|
457
|
+
|
|
458
|
+
.player {
|
|
459
|
+
composes: no-label;
|
|
460
|
+
}
|
|
461
|
+
|
|
382
462
|
/*
|
|
383
463
|
Header
|
|
384
464
|
*/
|
|
@@ -388,6 +468,15 @@
|
|
|
388
468
|
width: auto;
|
|
389
469
|
}
|
|
390
470
|
|
|
471
|
+
.default .selectWrapper select.selectBox {
|
|
472
|
+
max-width: 280px;
|
|
473
|
+
width: inherit;
|
|
474
|
+
border-radius: 8px;
|
|
475
|
+
padding: 0;
|
|
476
|
+
height: 100%;
|
|
477
|
+
top: 0;
|
|
478
|
+
}
|
|
479
|
+
|
|
391
480
|
.header select {
|
|
392
481
|
background-color: light;
|
|
393
482
|
border: 0;
|
|
@@ -420,7 +509,7 @@
|
|
|
420
509
|
composes: no-label;
|
|
421
510
|
}
|
|
422
511
|
|
|
423
|
-
.template
|
|
512
|
+
.template .selectBox {
|
|
424
513
|
width: auto;
|
|
425
514
|
height: 54px;
|
|
426
515
|
padding: 0 50px 0 0;
|
|
@@ -428,22 +517,22 @@
|
|
|
428
517
|
max-width: 100%;
|
|
429
518
|
}
|
|
430
519
|
|
|
431
|
-
.template .
|
|
520
|
+
.template .selectSpan {
|
|
432
521
|
font-size: 15px;
|
|
433
522
|
font-weight: 700;
|
|
434
523
|
height: 54px;
|
|
435
524
|
line-height: 52px;
|
|
436
525
|
}
|
|
437
526
|
|
|
438
|
-
.selected.template .
|
|
527
|
+
.selected.template .selectSpan {
|
|
439
528
|
border: 1px solid;
|
|
440
529
|
}
|
|
441
530
|
|
|
442
|
-
.unselected.template .
|
|
531
|
+
.unselected.template .selectSpan {
|
|
443
532
|
border: 1px solid color(black lightness(85%));
|
|
444
533
|
}
|
|
445
534
|
|
|
446
|
-
.template
|
|
535
|
+
.template .selectWrapper {
|
|
447
536
|
display: block;
|
|
448
537
|
width: auto;
|
|
449
538
|
margin-right: 0;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.default = void 0;
|
|
5
|
+
|
|
6
|
+
var _defaultsDeep2 = _interopRequireDefault(require("lodash/fp/defaultsDeep"));
|
|
7
|
+
|
|
8
|
+
var _default2 = _interopRequireDefault(require("./default"));
|
|
9
|
+
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
|
|
12
|
+
const {
|
|
13
|
+
props
|
|
14
|
+
} = _default2.default;
|
|
15
|
+
var _default = {
|
|
16
|
+
props: (0, _defaultsDeep2.default)(props, {
|
|
17
|
+
theme: 'player'
|
|
18
|
+
})
|
|
19
|
+
};
|
|
20
|
+
exports.default = _default;
|
|
21
|
+
//# sourceMappingURL=player.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/atom/select/test/fixtures/player.js"],"names":["props","Default","theme"],"mappings":";;;;;;;AACA;;;;AAEA,MAAM;AAACA,EAAAA;AAAD,IAAUC,iBAAhB;eAEe;AACbD,EAAAA,KAAK,EAAE,4BAAaA,KAAb,EAAoB;AACzBE,IAAAA,KAAK,EAAE;AADkB,GAApB;AADM,C","sourcesContent":["import {defaultsDeep} from 'lodash/fp';\nimport Default from './default';\n\nconst {props} = Default;\n\nexport default {\n props: defaultsDeep(props, {\n theme: 'player'\n })\n};\n"],"file":"player.js"}
|
|
@@ -26,6 +26,8 @@ var _multipleSelected = _interopRequireDefault(require("./fixtures/multiple-sele
|
|
|
26
26
|
|
|
27
27
|
var _multiple = _interopRequireDefault(require("./fixtures/multiple"));
|
|
28
28
|
|
|
29
|
+
var _player = _interopRequireDefault(require("./fixtures/player"));
|
|
30
|
+
|
|
29
31
|
var _question = _interopRequireDefault(require("./fixtures/question"));
|
|
30
32
|
|
|
31
33
|
var _requiredWithTitle = _interopRequireDefault(require("./fixtures/required-with-title"));
|
|
@@ -57,6 +59,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
57
59
|
(0, _ava.default)('Atom › AtomSelect › Mooc › should be rendered', _renderComponent.default, _.default, _mooc.default);
|
|
58
60
|
(0, _ava.default)('Atom › AtomSelect › MultipleSelected › should be rendered', _renderComponent.default, _.default, _multipleSelected.default);
|
|
59
61
|
(0, _ava.default)('Atom › AtomSelect › Multiple › should be rendered', _renderComponent.default, _.default, _multiple.default);
|
|
62
|
+
(0, _ava.default)('Atom › AtomSelect › Player › should be rendered', _renderComponent.default, _.default, _player.default);
|
|
60
63
|
(0, _ava.default)('Atom › AtomSelect › Question › should be rendered', _renderComponent.default, _.default, _question.default);
|
|
61
64
|
(0, _ava.default)('Atom › AtomSelect › RequiredWithTitle › should be rendered', _renderComponent.default, _.default, _requiredWithTitle.default);
|
|
62
65
|
(0, _ava.default)('Atom › AtomSelect › Required › should be rendered', _renderComponent.default, _.default, _required.default);
|