@coorpacademy/components 11.7.3-alpha.7 → 11.7.4-alpha.39
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/README.md +3 -3
- package/es/atom/input-search/index.d.ts.map +1 -1
- package/es/atom/input-search/index.js +0 -1
- package/es/atom/input-search/index.js.map +1 -1
- package/es/atom/input-switch/index.d.ts +0 -1
- package/es/atom/input-switch/index.d.ts.map +1 -1
- package/es/atom/input-switch/index.js +2 -5
- package/es/atom/input-switch/index.js.map +1 -1
- package/es/atom/loader/index.native.d.ts +10 -0
- package/es/atom/loader/index.native.d.ts.map +1 -0
- package/es/atom/loader/index.native.js +192 -0
- package/es/atom/loader/index.native.js.map +1 -0
- package/es/atom/select/index.d.ts +18 -1
- package/es/atom/select/index.d.ts.map +1 -1
- package/es/atom/select/index.js +29 -17
- package/es/atom/select/index.js.map +1 -1
- package/es/molecule/answer/index.d.ts.map +1 -1
- package/es/molecule/answer/index.js +19 -6
- package/es/molecule/answer/index.js.map +1 -1
- package/es/molecule/brand-form-group/index.d.ts +18 -5
- package/es/molecule/cm-popin/types.d.ts +0 -1
- package/es/molecule/cm-popin/types.d.ts.map +1 -1
- package/es/molecule/draggable-list/index.d.ts +0 -1
- package/es/molecule/filters/filters-wrapper.d.ts +1 -0
- package/es/molecule/filters/filters-wrapper.d.ts.map +1 -1
- package/es/molecule/filters/filters-wrapper.js +10 -9
- package/es/molecule/filters/filters-wrapper.js.map +1 -1
- package/es/molecule/filters/index.d.ts +10 -2
- package/es/molecule/filters/index.d.ts.map +1 -1
- package/es/molecule/filters/index.js +5 -9
- package/es/molecule/filters/index.js.map +1 -1
- package/es/molecule/questions/drop-down/index.d.ts +1 -0
- package/es/molecule/questions/drop-down/index.d.ts.map +1 -1
- package/es/molecule/questions/drop-down/index.js +9 -5
- package/es/molecule/questions/drop-down/index.js.map +1 -1
- package/es/molecule/questions/qcm/index.d.ts +1 -0
- package/es/molecule/questions/qcm/index.d.ts.map +1 -1
- package/es/molecule/questions/qcm/index.js +9 -5
- package/es/molecule/questions/qcm/index.js.map +1 -1
- package/es/molecule/questions/qcm-drag/index.d.ts +3 -1
- package/es/molecule/questions/qcm-drag/index.d.ts.map +1 -1
- package/es/molecule/questions/qcm-drag/index.js +9 -5
- package/es/molecule/questions/qcm-drag/index.js.map +1 -1
- package/es/molecule/questions/qcm-graphic/index.d.ts +1 -0
- package/es/molecule/questions/qcm-graphic/index.d.ts.map +1 -1
- package/es/molecule/questions/qcm-graphic/index.js +9 -5
- package/es/molecule/questions/qcm-graphic/index.js.map +1 -1
- package/es/molecule/questions/question-range/index.d.ts +1 -0
- package/es/molecule/questions/question-range/index.d.ts.map +1 -1
- package/es/molecule/questions/question-range/index.js +10 -6
- package/es/molecule/questions/question-range/index.js.map +1 -1
- package/es/molecule/questions/template/index.d.ts +6 -2
- package/es/molecule/questions/template/index.d.ts.map +1 -1
- package/es/molecule/questions/template/index.js +9 -5
- package/es/molecule/questions/template/index.js.map +1 -1
- package/es/molecule/setup-section/index.d.ts +0 -1
- package/es/molecule/setup-section/index.d.ts.map +1 -1
- package/es/molecule/setup-sections/index.d.ts +0 -1
- package/es/molecule/setup-slide/index.d.ts +9 -2
- package/es/molecule/setup-slider/index.d.ts +9 -2
- package/es/organism/brand-form/index.d.ts +18 -5
- package/es/organism/mooc-header/index.d.ts +5 -0
- package/es/organism/mooc-header/index.d.ts.map +1 -1
- package/es/organism/mooc-header/index.js +62 -12
- package/es/organism/mooc-header/index.js.map +1 -1
- package/es/organism/mooc-header/style.css +46 -0
- package/es/organism/user-preferences/index.d.ts +1 -1
- package/es/organism/user-preferences/index.d.ts.map +1 -1
- package/es/organism/user-preferences/index.js +9 -5
- package/es/organism/user-preferences/index.js.map +1 -1
- package/es/organism/wizard-contents/index.d.ts +18 -5
- package/es/template/activity/index.d.ts +11 -12
- package/es/template/activity/index.d.ts.map +1 -1
- package/es/template/activity/index.js +3 -6
- package/es/template/activity/index.js.map +1 -1
- package/es/template/app-player/loading/index.d.ts +0 -1
- package/es/template/app-player/player/index.d.ts +0 -2
- package/es/template/app-player/player/slides/index.d.ts +0 -1
- package/es/template/app-player/player/slides/index.d.ts.map +1 -1
- package/es/template/app-player/popin-correction/index.d.ts +0 -1
- package/es/template/app-player/popin-correction/index.d.ts.map +1 -1
- package/es/template/app-player/popin-end/index.d.ts +0 -1
- package/es/template/app-review/index.d.ts +0 -1
- package/es/template/app-review/index.d.ts.map +1 -1
- package/es/template/app-review/player/prop-types.d.ts +0 -1
- package/es/template/app-review/player/prop-types.d.ts.map +1 -1
- package/es/template/app-review/prop-types.d.ts +0 -1
- package/es/template/app-review/prop-types.d.ts.map +1 -1
- package/es/template/back-office/brand-update/index.d.ts +36 -11
- package/es/template/common/dashboard/index.d.ts +0 -1
- package/es/template/common/search-page/index.d.ts +11 -3
- package/es/template/common/search-page/index.js +3 -3
- package/es/template/common/search-page/index.js.map +1 -1
- package/es/template/teams-dashboard/index.d.ts +1 -0
- package/lib/atom/input-search/index.d.ts.map +1 -1
- package/lib/atom/input-search/index.js +0 -1
- package/lib/atom/input-search/index.js.map +1 -1
- package/lib/atom/input-switch/index.d.ts +0 -1
- package/lib/atom/input-switch/index.d.ts.map +1 -1
- package/lib/atom/input-switch/index.js +2 -5
- package/lib/atom/input-switch/index.js.map +1 -1
- package/lib/atom/loader/index.native.d.ts +10 -0
- package/lib/atom/loader/index.native.d.ts.map +1 -0
- package/lib/atom/loader/index.native.js +205 -0
- package/lib/atom/loader/index.native.js.map +1 -0
- package/lib/atom/select/index.d.ts +18 -1
- package/lib/atom/select/index.d.ts.map +1 -1
- package/lib/atom/select/index.js +34 -18
- package/lib/atom/select/index.js.map +1 -1
- package/lib/molecule/answer/index.d.ts.map +1 -1
- package/lib/molecule/answer/index.js +20 -6
- package/lib/molecule/answer/index.js.map +1 -1
- package/lib/molecule/brand-form-group/index.d.ts +18 -5
- package/lib/molecule/cm-popin/types.d.ts +0 -1
- package/lib/molecule/cm-popin/types.d.ts.map +1 -1
- package/lib/molecule/draggable-list/index.d.ts +0 -1
- package/lib/molecule/filters/filters-wrapper.d.ts +1 -0
- package/lib/molecule/filters/filters-wrapper.d.ts.map +1 -1
- package/lib/molecule/filters/filters-wrapper.js +10 -9
- package/lib/molecule/filters/filters-wrapper.js.map +1 -1
- package/lib/molecule/filters/index.d.ts +10 -2
- package/lib/molecule/filters/index.d.ts.map +1 -1
- package/lib/molecule/filters/index.js +5 -8
- package/lib/molecule/filters/index.js.map +1 -1
- package/lib/molecule/questions/drop-down/index.d.ts +1 -0
- package/lib/molecule/questions/drop-down/index.d.ts.map +1 -1
- package/lib/molecule/questions/drop-down/index.js +9 -5
- package/lib/molecule/questions/drop-down/index.js.map +1 -1
- package/lib/molecule/questions/qcm/index.d.ts +1 -0
- package/lib/molecule/questions/qcm/index.d.ts.map +1 -1
- package/lib/molecule/questions/qcm/index.js +9 -5
- package/lib/molecule/questions/qcm/index.js.map +1 -1
- package/lib/molecule/questions/qcm-drag/index.d.ts +3 -1
- package/lib/molecule/questions/qcm-drag/index.d.ts.map +1 -1
- package/lib/molecule/questions/qcm-drag/index.js +9 -5
- package/lib/molecule/questions/qcm-drag/index.js.map +1 -1
- package/lib/molecule/questions/qcm-graphic/index.d.ts +1 -0
- package/lib/molecule/questions/qcm-graphic/index.d.ts.map +1 -1
- package/lib/molecule/questions/qcm-graphic/index.js +9 -5
- package/lib/molecule/questions/qcm-graphic/index.js.map +1 -1
- package/lib/molecule/questions/question-range/index.d.ts +1 -0
- package/lib/molecule/questions/question-range/index.d.ts.map +1 -1
- package/lib/molecule/questions/question-range/index.js +10 -6
- package/lib/molecule/questions/question-range/index.js.map +1 -1
- package/lib/molecule/questions/template/index.d.ts +6 -2
- package/lib/molecule/questions/template/index.d.ts.map +1 -1
- package/lib/molecule/questions/template/index.js +9 -5
- package/lib/molecule/questions/template/index.js.map +1 -1
- package/lib/molecule/setup-section/index.d.ts +0 -1
- package/lib/molecule/setup-section/index.d.ts.map +1 -1
- package/lib/molecule/setup-sections/index.d.ts +0 -1
- package/lib/molecule/setup-slide/index.d.ts +9 -2
- package/lib/molecule/setup-slider/index.d.ts +9 -2
- package/lib/organism/brand-form/index.d.ts +18 -5
- package/lib/organism/mooc-header/index.d.ts +5 -0
- package/lib/organism/mooc-header/index.d.ts.map +1 -1
- package/lib/organism/mooc-header/index.js +61 -11
- package/lib/organism/mooc-header/index.js.map +1 -1
- package/lib/organism/mooc-header/style.css +46 -0
- package/lib/organism/user-preferences/index.d.ts +1 -1
- package/lib/organism/user-preferences/index.d.ts.map +1 -1
- package/lib/organism/user-preferences/index.js +9 -5
- package/lib/organism/user-preferences/index.js.map +1 -1
- package/lib/organism/wizard-contents/index.d.ts +18 -5
- package/lib/template/activity/index.d.ts +11 -12
- package/lib/template/activity/index.d.ts.map +1 -1
- package/lib/template/activity/index.js +3 -6
- package/lib/template/activity/index.js.map +1 -1
- package/lib/template/app-player/loading/index.d.ts +0 -1
- package/lib/template/app-player/player/index.d.ts +0 -2
- package/lib/template/app-player/player/slides/index.d.ts +0 -1
- package/lib/template/app-player/player/slides/index.d.ts.map +1 -1
- package/lib/template/app-player/popin-correction/index.d.ts +0 -1
- package/lib/template/app-player/popin-correction/index.d.ts.map +1 -1
- package/lib/template/app-player/popin-end/index.d.ts +0 -1
- package/lib/template/app-review/index.d.ts +0 -1
- package/lib/template/app-review/index.d.ts.map +1 -1
- package/lib/template/app-review/player/prop-types.d.ts +0 -1
- package/lib/template/app-review/player/prop-types.d.ts.map +1 -1
- package/lib/template/app-review/prop-types.d.ts +0 -1
- package/lib/template/app-review/prop-types.d.ts.map +1 -1
- package/lib/template/back-office/brand-update/index.d.ts +36 -11
- package/lib/template/common/dashboard/index.d.ts +0 -1
- package/lib/template/common/search-page/index.d.ts +11 -3
- package/lib/template/common/search-page/index.js +3 -3
- package/lib/template/common/search-page/index.js.map +1 -1
- package/lib/template/teams-dashboard/index.d.ts +1 -0
- package/locales/cs/global.json +1 -0
- package/locales/de/global.json +1 -0
- package/locales/en/global.json +1 -0
- package/locales/es/global.json +1 -0
- package/locales/et/global.json +1 -0
- package/locales/fr/global.json +1 -0
- package/locales/hr/global.json +1 -0
- package/locales/hu/global.json +1 -0
- package/locales/it/global.json +1 -0
- package/locales/ja/global.json +1 -0
- package/locales/ko/global.json +1 -0
- package/locales/nl/global.json +1 -0
- package/locales/pl/global.json +1 -0
- package/locales/pt/global.json +1 -0
- package/locales/ro/global.json +1 -0
- package/locales/ru/global.json +1 -0
- package/locales/sk/global.json +1 -0
- package/locales/tl/global.json +1 -0
- package/locales/tr/global.json +1 -0
- package/locales/uk/global.json +1 -0
- package/locales/vi/global.json +1 -0
- package/locales/zh/global.json +1 -0
- package/locales/zh_TW/global.json +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.default = void 0;
|
|
5
|
+
|
|
6
|
+
var _reactNativeAnimation = require("@coorpacademy/react-native-animation");
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
|
|
10
|
+
var _reactNative = require("react-native");
|
|
11
|
+
|
|
12
|
+
var _templateContext = require("../../template/app-review/template-context");
|
|
13
|
+
|
|
14
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
15
|
+
|
|
16
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
|
+
|
|
18
|
+
const createStyleSheet = theme => _reactNative.StyleSheet.create({
|
|
19
|
+
container: {
|
|
20
|
+
alignItems: 'center',
|
|
21
|
+
justifyContent: 'center'
|
|
22
|
+
},
|
|
23
|
+
dot: {
|
|
24
|
+
position: 'absolute'
|
|
25
|
+
},
|
|
26
|
+
blue: {
|
|
27
|
+
backgroundColor: theme.colors.cta
|
|
28
|
+
},
|
|
29
|
+
red: {
|
|
30
|
+
backgroundColor: theme.colors.negative
|
|
31
|
+
},
|
|
32
|
+
green: {
|
|
33
|
+
backgroundColor: theme.colors.positive
|
|
34
|
+
},
|
|
35
|
+
yellow: {
|
|
36
|
+
backgroundColor: theme.colors.battle
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
const CYCLE_DURATION = 3000;
|
|
41
|
+
const MIN_TIME = 1000;
|
|
42
|
+
|
|
43
|
+
const Loader = props => {
|
|
44
|
+
const templateContext = (0, _templateContext.useTemplateContext)();
|
|
45
|
+
const {
|
|
46
|
+
theme
|
|
47
|
+
} = templateContext;
|
|
48
|
+
const [styleSheet, setStylesheet] = (0, _react.useState)(null);
|
|
49
|
+
const [visible, setVisible] = (0, _react.useState)(true);
|
|
50
|
+
const [minTimeIsSpent, setMinTimeSpent] = (0, _react.useState)(false);
|
|
51
|
+
const rotation = (0, _react.useRef)(new _reactNative.Animated.Value(0)).current;
|
|
52
|
+
const scale = (0, _react.useRef)(new _reactNative.Animated.Value(0)).current;
|
|
53
|
+
const hideAnimation = (0, _reactNativeAnimation.useAnimateProp)({
|
|
54
|
+
property: 'opacity',
|
|
55
|
+
fromValue: 1,
|
|
56
|
+
toValue: 0
|
|
57
|
+
});
|
|
58
|
+
const {
|
|
59
|
+
height = 60,
|
|
60
|
+
color,
|
|
61
|
+
readyToHide
|
|
62
|
+
} = props;
|
|
63
|
+
(0, _react.useEffect)(() => {
|
|
64
|
+
const _stylesheet = createStyleSheet(theme);
|
|
65
|
+
|
|
66
|
+
setStylesheet(_stylesheet);
|
|
67
|
+
}, [theme]);
|
|
68
|
+
(0, _react.useEffect)(() => {
|
|
69
|
+
if (readyToHide && minTimeIsSpent) {
|
|
70
|
+
setVisible(false);
|
|
71
|
+
}
|
|
72
|
+
}, [readyToHide, minTimeIsSpent]);
|
|
73
|
+
(0, _react.useEffect)(() => {
|
|
74
|
+
if (!visible) {
|
|
75
|
+
hideAnimation.start();
|
|
76
|
+
}
|
|
77
|
+
}, [visible, hideAnimation]);
|
|
78
|
+
(0, _react.useEffect)(() => {
|
|
79
|
+
setTimeout(() => {
|
|
80
|
+
setMinTimeSpent(true);
|
|
81
|
+
}, MIN_TIME);
|
|
82
|
+
|
|
83
|
+
const _animation = _reactNative.Animated.parallel([_reactNative.Animated.loop(_reactNative.Animated.sequence([_reactNative.Animated.timing(scale, {
|
|
84
|
+
toValue: 0,
|
|
85
|
+
duration: 0,
|
|
86
|
+
useNativeDriver: false
|
|
87
|
+
}), _reactNative.Animated.timing(scale, {
|
|
88
|
+
toValue: 1,
|
|
89
|
+
duration: CYCLE_DURATION,
|
|
90
|
+
useNativeDriver: false,
|
|
91
|
+
easing: _reactNative.Easing.inOut(_reactNative.Easing.sin)
|
|
92
|
+
}), _reactNative.Animated.timing(scale, {
|
|
93
|
+
toValue: 2,
|
|
94
|
+
duration: CYCLE_DURATION,
|
|
95
|
+
useNativeDriver: false,
|
|
96
|
+
easing: _reactNative.Easing.inOut(_reactNative.Easing.sin)
|
|
97
|
+
}), _reactNative.Animated.timing(scale, {
|
|
98
|
+
toValue: 3,
|
|
99
|
+
duration: CYCLE_DURATION,
|
|
100
|
+
useNativeDriver: false,
|
|
101
|
+
easing: _reactNative.Easing.inOut(_reactNative.Easing.sin)
|
|
102
|
+
})])), _reactNative.Animated.loop(_reactNative.Animated.sequence([_reactNative.Animated.timing(rotation, {
|
|
103
|
+
toValue: 0,
|
|
104
|
+
duration: 0,
|
|
105
|
+
useNativeDriver: false
|
|
106
|
+
}), _reactNative.Animated.timing(rotation, {
|
|
107
|
+
toValue: 1,
|
|
108
|
+
duration: CYCLE_DURATION,
|
|
109
|
+
useNativeDriver: false,
|
|
110
|
+
easing: _reactNative.Easing.inOut(_reactNative.Easing.sin)
|
|
111
|
+
})]))]);
|
|
112
|
+
|
|
113
|
+
_animation.start();
|
|
114
|
+
|
|
115
|
+
return () => {
|
|
116
|
+
_animation.stop();
|
|
117
|
+
}; // eslint bad warning --> effect only onmount
|
|
118
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
119
|
+
}, []);
|
|
120
|
+
|
|
121
|
+
if (!styleSheet) {
|
|
122
|
+
return null;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
const interpolatedScale = scale.interpolate({
|
|
126
|
+
inputRange: [0, 0.45, 1, 1.32, 1.5, 2, 2.3, 2.64, 3],
|
|
127
|
+
outputRange: [0.5, 0.2, 0.5, 0.5, 0.8, 0.5, 0.5, 0.3, 0.5]
|
|
128
|
+
});
|
|
129
|
+
const interpolatedRotation = rotation.interpolate({
|
|
130
|
+
inputRange: [0, 1],
|
|
131
|
+
outputRange: ['0deg', '360deg']
|
|
132
|
+
});
|
|
133
|
+
const dotWidth = rotation.interpolate({
|
|
134
|
+
inputRange: [0, 0.5, 1],
|
|
135
|
+
outputRange: [height / 2, height / 6, height / 2]
|
|
136
|
+
});
|
|
137
|
+
const dotTranslate = rotation.interpolate({
|
|
138
|
+
inputRange: [0, 0.5, 1],
|
|
139
|
+
outputRange: [-25 * (height / 60), -35 * (height / 60), -25 * (height / 60)]
|
|
140
|
+
});
|
|
141
|
+
const dotStyle = {
|
|
142
|
+
width: dotWidth,
|
|
143
|
+
height: height / 6,
|
|
144
|
+
borderRadius: height / 12
|
|
145
|
+
};
|
|
146
|
+
return /*#__PURE__*/_react.default.createElement(_reactNative.Animated.View, {
|
|
147
|
+
style: hideAnimation.animatedStyle
|
|
148
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.Animated.View, {
|
|
149
|
+
style: [styleSheet.container, {
|
|
150
|
+
height,
|
|
151
|
+
width: height,
|
|
152
|
+
transform: [{
|
|
153
|
+
scaleX: interpolatedScale
|
|
154
|
+
}, {
|
|
155
|
+
scaleY: interpolatedScale
|
|
156
|
+
}, {
|
|
157
|
+
rotateZ: interpolatedRotation
|
|
158
|
+
}]
|
|
159
|
+
}]
|
|
160
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.Animated.View, {
|
|
161
|
+
style: [styleSheet.dot, color ? {
|
|
162
|
+
backgroundColor: color
|
|
163
|
+
} : styleSheet.red, dotStyle, {
|
|
164
|
+
transform: [{
|
|
165
|
+
rotateZ: '45deg'
|
|
166
|
+
}, {
|
|
167
|
+
translateX: dotTranslate
|
|
168
|
+
}]
|
|
169
|
+
}]
|
|
170
|
+
}), /*#__PURE__*/_react.default.createElement(_reactNative.Animated.View, {
|
|
171
|
+
style: [styleSheet.dot, color ? {
|
|
172
|
+
backgroundColor: color
|
|
173
|
+
} : styleSheet.green, dotStyle, {
|
|
174
|
+
transform: [{
|
|
175
|
+
rotateZ: '135deg'
|
|
176
|
+
}, {
|
|
177
|
+
translateX: dotTranslate
|
|
178
|
+
}]
|
|
179
|
+
}]
|
|
180
|
+
}), /*#__PURE__*/_react.default.createElement(_reactNative.Animated.View, {
|
|
181
|
+
style: [styleSheet.dot, color ? {
|
|
182
|
+
backgroundColor: color
|
|
183
|
+
} : styleSheet.yellow, dotStyle, {
|
|
184
|
+
transform: [{
|
|
185
|
+
rotateZ: '225deg'
|
|
186
|
+
}, {
|
|
187
|
+
translateX: dotTranslate
|
|
188
|
+
}]
|
|
189
|
+
}]
|
|
190
|
+
}), /*#__PURE__*/_react.default.createElement(_reactNative.Animated.View, {
|
|
191
|
+
style: [styleSheet.dot, color ? {
|
|
192
|
+
backgroundColor: color
|
|
193
|
+
} : styleSheet.blue, dotStyle, {
|
|
194
|
+
transform: [{
|
|
195
|
+
rotateZ: '315deg'
|
|
196
|
+
}, {
|
|
197
|
+
translateX: dotTranslate
|
|
198
|
+
}]
|
|
199
|
+
}]
|
|
200
|
+
})));
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
var _default = Loader;
|
|
204
|
+
exports.default = _default;
|
|
205
|
+
//# sourceMappingURL=index.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.native.js","names":["createStyleSheet","theme","StyleSheet","create","container","alignItems","justifyContent","dot","position","blue","backgroundColor","colors","cta","red","negative","green","positive","yellow","battle","CYCLE_DURATION","MIN_TIME","Loader","props","templateContext","useTemplateContext","styleSheet","setStylesheet","useState","visible","setVisible","minTimeIsSpent","setMinTimeSpent","rotation","useRef","Animated","Value","current","scale","hideAnimation","useAnimateProp","property","fromValue","toValue","height","color","readyToHide","useEffect","_stylesheet","start","setTimeout","_animation","parallel","loop","sequence","timing","duration","useNativeDriver","easing","Easing","inOut","sin","stop","interpolatedScale","interpolate","inputRange","outputRange","interpolatedRotation","dotWidth","dotTranslate","dotStyle","width","borderRadius","animatedStyle","transform","scaleX","scaleY","rotateZ","translateX"],"sources":["../../../src/atom/loader/index.native.tsx"],"sourcesContent":["import {useAnimateProp} from '@coorpacademy/react-native-animation';\nimport React, {useEffect, useRef, useState} from 'react';\nimport {Animated, StyleSheet, Easing, ViewStyle, ColorValue} from 'react-native';\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport {Theme} from '../../variables/theme.native';\n\ntype StyleSheetType = {\n container: ViewStyle;\n dot: ViewStyle;\n blue: ViewStyle;\n red: ViewStyle;\n green: ViewStyle;\n yellow: ViewStyle;\n};\n\nconst createStyleSheet = (theme: Theme): StyleSheetType =>\n StyleSheet.create({\n container: {\n alignItems: 'center',\n justifyContent: 'center'\n },\n dot: {\n position: 'absolute'\n },\n blue: {\n backgroundColor: theme.colors.cta\n },\n red: {\n backgroundColor: theme.colors.negative\n },\n green: {\n backgroundColor: theme.colors.positive\n },\n yellow: {\n backgroundColor: theme.colors.battle\n }\n });\n\nexport type Props = {\n color?: ColorValue;\n height?: number;\n readyToHide: boolean;\n};\n\nconst CYCLE_DURATION = 3000;\nconst MIN_TIME = 1000;\n\nconst Loader = (props: Props) => {\n const templateContext = useTemplateContext();\n const {theme} = templateContext;\n\n const [styleSheet, setStylesheet] = useState<StyleSheetType | null>(null);\n const [visible, setVisible] = useState<boolean>(true);\n const [minTimeIsSpent, setMinTimeSpent] = useState<boolean>(false);\n\n const rotation = useRef<Animated.Value>(new Animated.Value(0)).current;\n const scale = useRef<Animated.Value>(new Animated.Value(0)).current;\n\n const hideAnimation = useAnimateProp({\n property: 'opacity',\n fromValue: 1,\n toValue: 0\n });\n\n const {height = 60, color, readyToHide} = props;\n\n useEffect(() => {\n const _stylesheet = createStyleSheet(theme);\n setStylesheet(_stylesheet);\n }, [theme]);\n\n useEffect(() => {\n if (readyToHide && minTimeIsSpent) {\n setVisible(false);\n }\n }, [readyToHide, minTimeIsSpent]);\n\n useEffect(() => {\n if (!visible) {\n hideAnimation.start();\n }\n }, [visible, hideAnimation]);\n\n useEffect(() => {\n setTimeout(() => {\n setMinTimeSpent(true);\n }, MIN_TIME);\n\n const _animation = Animated.parallel([\n Animated.loop(\n Animated.sequence([\n Animated.timing(scale, {toValue: 0, duration: 0, useNativeDriver: false}),\n Animated.timing(scale, {\n toValue: 1,\n duration: CYCLE_DURATION,\n useNativeDriver: false,\n easing: Easing.inOut(Easing.sin)\n }),\n Animated.timing(scale, {\n toValue: 2,\n duration: CYCLE_DURATION,\n useNativeDriver: false,\n easing: Easing.inOut(Easing.sin)\n }),\n Animated.timing(scale, {\n toValue: 3,\n duration: CYCLE_DURATION,\n useNativeDriver: false,\n easing: Easing.inOut(Easing.sin)\n })\n ])\n ),\n Animated.loop(\n Animated.sequence([\n Animated.timing(rotation, {toValue: 0, duration: 0, useNativeDriver: false}),\n Animated.timing(rotation, {\n toValue: 1,\n duration: CYCLE_DURATION,\n useNativeDriver: false,\n easing: Easing.inOut(Easing.sin)\n })\n ])\n )\n ]);\n\n _animation.start();\n\n return () => {\n _animation.stop();\n };\n // eslint bad warning --> effect only onmount\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n if (!styleSheet) {\n return null;\n }\n\n const interpolatedScale = scale.interpolate({\n inputRange: [0, 0.45, 1, 1.32, 1.5, 2, 2.3, 2.64, 3],\n outputRange: [0.5, 0.2, 0.5, 0.5, 0.8, 0.5, 0.5, 0.3, 0.5]\n });\n\n const interpolatedRotation = rotation.interpolate({\n inputRange: [0, 1],\n outputRange: ['0deg', '360deg']\n });\n const dotWidth = rotation.interpolate({\n inputRange: [0, 0.5, 1],\n outputRange: [height / 2, height / 6, height / 2]\n });\n const dotTranslate = rotation.interpolate({\n inputRange: [0, 0.5, 1],\n outputRange: [-25 * (height / 60), -35 * (height / 60), -25 * (height / 60)]\n });\n const dotStyle = {\n width: dotWidth,\n height: height / 6,\n borderRadius: height / 12\n };\n\n return (\n <Animated.View style={hideAnimation.animatedStyle}>\n <Animated.View\n style={[\n styleSheet.container,\n {\n height,\n width: height,\n transform: [\n {scaleX: interpolatedScale},\n {scaleY: interpolatedScale},\n {rotateZ: interpolatedRotation}\n ]\n }\n ]}\n >\n <Animated.View\n style={[\n styleSheet.dot,\n color ? {backgroundColor: color} : styleSheet.red,\n dotStyle,\n {transform: [{rotateZ: '45deg'}, {translateX: dotTranslate}]}\n ]}\n />\n <Animated.View\n style={[\n styleSheet.dot,\n color ? {backgroundColor: color} : styleSheet.green,\n dotStyle,\n {transform: [{rotateZ: '135deg'}, {translateX: dotTranslate}]}\n ]}\n />\n <Animated.View\n style={[\n styleSheet.dot,\n color ? {backgroundColor: color} : styleSheet.yellow,\n dotStyle,\n {transform: [{rotateZ: '225deg'}, {translateX: dotTranslate}]}\n ]}\n />\n <Animated.View\n style={[\n styleSheet.dot,\n color ? {backgroundColor: color} : styleSheet.blue,\n dotStyle,\n {transform: [{rotateZ: '315deg'}, {translateX: dotTranslate}]}\n ]}\n />\n </Animated.View>\n </Animated.View>\n );\n};\n\nexport default Loader;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;;;;;AAYA,MAAMA,gBAAgB,GAAIC,KAAD,IACvBC,uBAAA,CAAWC,MAAX,CAAkB;EAChBC,SAAS,EAAE;IACTC,UAAU,EAAE,QADH;IAETC,cAAc,EAAE;EAFP,CADK;EAKhBC,GAAG,EAAE;IACHC,QAAQ,EAAE;EADP,CALW;EAQhBC,IAAI,EAAE;IACJC,eAAe,EAAET,KAAK,CAACU,MAAN,CAAaC;EAD1B,CARU;EAWhBC,GAAG,EAAE;IACHH,eAAe,EAAET,KAAK,CAACU,MAAN,CAAaG;EAD3B,CAXW;EAchBC,KAAK,EAAE;IACLL,eAAe,EAAET,KAAK,CAACU,MAAN,CAAaK;EADzB,CAdS;EAiBhBC,MAAM,EAAE;IACNP,eAAe,EAAET,KAAK,CAACU,MAAN,CAAaO;EADxB;AAjBQ,CAAlB,CADF;;AA6BA,MAAMC,cAAc,GAAG,IAAvB;AACA,MAAMC,QAAQ,GAAG,IAAjB;;AAEA,MAAMC,MAAM,GAAIC,KAAD,IAAkB;EAC/B,MAAMC,eAAe,GAAG,IAAAC,mCAAA,GAAxB;EACA,MAAM;IAACvB;EAAD,IAAUsB,eAAhB;EAEA,MAAM,CAACE,UAAD,EAAaC,aAAb,IAA8B,IAAAC,eAAA,EAAgC,IAAhC,CAApC;EACA,MAAM,CAACC,OAAD,EAAUC,UAAV,IAAwB,IAAAF,eAAA,EAAkB,IAAlB,CAA9B;EACA,MAAM,CAACG,cAAD,EAAiBC,eAAjB,IAAoC,IAAAJ,eAAA,EAAkB,KAAlB,CAA1C;EAEA,MAAMK,QAAQ,GAAG,IAAAC,aAAA,EAAuB,IAAIC,qBAAA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L;MAACI,SAAS,EAAE,CAAC;QAACG,OAAO,EAAE;MAAV,CAAD,EAAsB;QAACC,UAAU,EAAET;MAAb,CAAtB;IAAZ,CAJK;EADT,EA9BF,eAsCE,6BAAC,qBAAD,CAAU,IAAV;IACE,KAAK,EAAE,CACL3C,UAAU,CAAClB,GADN,EAELqC,KAAK,GAAG;MAAClC,eAAe,EAAEkC;IAAlB,CAAH,GAA8BnB,UAAU,CAAChB,IAFzC,EAGL4D,QAHK,EAIL;MAACI,SAAS,EAAE,CAAC;QAACG,OAAO,EAAE;MAAV,CAAD,EAAsB;QAACC,UAAU,EAAET;MAAb,CAAtB;IAAZ,CAJK;EADT,EAtCF,CADF,CADF;AAmDD,CArKD;;eAuKe/C,M"}
|
|
@@ -4,6 +4,15 @@ export namespace SelectOptionPropTypes {
|
|
|
4
4
|
const selected: PropTypes.Requireable<boolean>;
|
|
5
5
|
const validOption: PropTypes.Requireable<boolean>;
|
|
6
6
|
}
|
|
7
|
+
export namespace SelectOptionGroupPropTypes {
|
|
8
|
+
const label: PropTypes.Validator<string>;
|
|
9
|
+
const options: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
10
|
+
name: PropTypes.Validator<string>;
|
|
11
|
+
value: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
12
|
+
selected: PropTypes.Requireable<boolean>;
|
|
13
|
+
validOption: PropTypes.Requireable<boolean>;
|
|
14
|
+
}> | null | undefined)[]>;
|
|
15
|
+
}
|
|
7
16
|
export default Select;
|
|
8
17
|
import PropTypes from "prop-types";
|
|
9
18
|
declare function Select(props: any, legacyContext: any): JSX.Element;
|
|
@@ -48,10 +57,18 @@ declare namespace Select {
|
|
|
48
57
|
selected: PropTypes.Requireable<boolean>;
|
|
49
58
|
validOption: PropTypes.Requireable<boolean>;
|
|
50
59
|
}> | null | undefined)[]>;
|
|
60
|
+
optgroups: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
61
|
+
label: PropTypes.Validator<string>;
|
|
62
|
+
options: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
63
|
+
name: PropTypes.Validator<string>;
|
|
64
|
+
value: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
65
|
+
selected: PropTypes.Requireable<boolean>;
|
|
66
|
+
validOption: PropTypes.Requireable<boolean>;
|
|
67
|
+
}> | null | undefined)[]>;
|
|
68
|
+
}> | null | undefined)[]>;
|
|
51
69
|
modified: PropTypes.Requireable<boolean>;
|
|
52
70
|
error: PropTypes.Requireable<boolean>;
|
|
53
71
|
'aria-label': PropTypes.Requireable<string>;
|
|
54
|
-
'aria-labelledby': PropTypes.Requireable<string>;
|
|
55
72
|
};
|
|
56
73
|
}
|
|
57
74
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/select/index.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/select/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AA2DA,qEAqLC"}
|
package/lib/atom/select/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports.default = exports.SelectOptionPropTypes = void 0;
|
|
4
|
+
exports.default = exports.SelectOptionPropTypes = exports.SelectOptionGroupPropTypes = void 0;
|
|
5
5
|
|
|
6
6
|
var _react = _interopRequireWildcard(require("react"));
|
|
7
7
|
|
|
@@ -9,16 +9,22 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
9
9
|
|
|
10
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
11
|
|
|
12
|
+
var _concat = _interopRequireDefault(require("lodash/fp/concat"));
|
|
13
|
+
|
|
12
14
|
var _filter = _interopRequireDefault(require("lodash/fp/filter"));
|
|
13
15
|
|
|
14
16
|
var _find = _interopRequireDefault(require("lodash/fp/find"));
|
|
15
17
|
|
|
18
|
+
var _flatMapDeep = _interopRequireDefault(require("lodash/fp/flatMapDeep"));
|
|
19
|
+
|
|
16
20
|
var _get = _interopRequireDefault(require("lodash/fp/get"));
|
|
17
21
|
|
|
18
22
|
var _getOr = _interopRequireDefault(require("lodash/fp/getOr"));
|
|
19
23
|
|
|
20
24
|
var _includes = _interopRequireDefault(require("lodash/fp/includes"));
|
|
21
25
|
|
|
26
|
+
var _isEmpty = _interopRequireDefault(require("lodash/fp/isEmpty"));
|
|
27
|
+
|
|
22
28
|
var _keys = _interopRequireDefault(require("lodash/fp/keys"));
|
|
23
29
|
|
|
24
30
|
var _map = _interopRequireDefault(require("lodash/fp/map"));
|
|
@@ -61,7 +67,9 @@ const ArrowView = ({
|
|
|
61
67
|
arrowClass,
|
|
62
68
|
arrowColor
|
|
63
69
|
}) => {
|
|
64
|
-
const props = (0, _react.useMemo)(() => _extends({},
|
|
70
|
+
const props = (0, _react.useMemo)(() => _extends({}, ariaLabel & {
|
|
71
|
+
'aria-label': ariaLabel
|
|
72
|
+
}, arrowColor & {
|
|
65
73
|
color: arrowColor
|
|
66
74
|
}, {
|
|
67
75
|
className: arrowClass
|
|
@@ -80,6 +88,7 @@ const Select = (props, legacyContext) => {
|
|
|
80
88
|
const {
|
|
81
89
|
name,
|
|
82
90
|
options = [],
|
|
91
|
+
optgroups = [],
|
|
83
92
|
className,
|
|
84
93
|
borderClassName,
|
|
85
94
|
onChange,
|
|
@@ -91,20 +100,27 @@ const Select = (props, legacyContext) => {
|
|
|
91
100
|
modified = false,
|
|
92
101
|
error = false,
|
|
93
102
|
title: propTitle,
|
|
94
|
-
'aria-label': ariaLabel
|
|
95
|
-
'aria-labelledby': ariaLabelledBy
|
|
103
|
+
'aria-label': ariaLabel
|
|
96
104
|
} = props;
|
|
97
105
|
const skin = (0, _provider.GetSkinFromContext)(legacyContext);
|
|
98
106
|
const title = (0, _react.useMemo)(() => propTitle ? `${propTitle}${required ? '*' : ''}` : null, [propTitle, required]);
|
|
99
107
|
const [isArrowUp, setIsArrowUp] = (0, _react.useState)(false);
|
|
100
108
|
const handleSelectOnFocus = (0, _react.useCallback)(() => setIsArrowUp(true), []);
|
|
101
109
|
const handleSelectOnBlur = (0, _react.useCallback)(() => setIsArrowUp(false), []);
|
|
102
|
-
|
|
110
|
+
|
|
111
|
+
const selectOption = (option, index) => {
|
|
103
112
|
return /*#__PURE__*/_react.default.createElement("option", {
|
|
104
113
|
key: index,
|
|
105
114
|
value: option.value,
|
|
106
115
|
className: _style.default.selectOption
|
|
107
116
|
}, option.name);
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
const optionList = !(0, _isEmpty.default)(options) ? options.map((option, index) => selectOption(option, index)) : optgroups.map((optgroup, index) => {
|
|
120
|
+
return /*#__PURE__*/_react.default.createElement("optgroup", {
|
|
121
|
+
key: index,
|
|
122
|
+
label: optgroup.label
|
|
123
|
+
}, optgroup.options && optgroup.options.map((option, i) => selectOption(option, i)));
|
|
108
124
|
});
|
|
109
125
|
const titleView = title ? /*#__PURE__*/_react.default.createElement("span", {
|
|
110
126
|
className: _style.default.title
|
|
@@ -113,12 +129,12 @@ const Select = (props, legacyContext) => {
|
|
|
113
129
|
selected: true
|
|
114
130
|
}, options)) : (0, _get.default)('value', (0, _find.default)({
|
|
115
131
|
selected: true
|
|
116
|
-
}, options)), [multiple, options]);
|
|
132
|
+
}, (0, _concat.default)(options, (0, _flatMapDeep.default)('options', optgroups)))), [multiple, options, optgroups]);
|
|
117
133
|
const selectedLabel = (0, _react.useMemo)(() => multiple ? (0, _map.default)((0, _get.default)('name'), (0, _filter.default)({
|
|
118
134
|
selected: true
|
|
119
|
-
}, options)) : (0, _get.default)('
|
|
135
|
+
}, options)) : (0, _get.default)('value', (0, _find.default)({
|
|
120
136
|
selected: true
|
|
121
|
-
}, options)), [multiple, options]);
|
|
137
|
+
}, (0, _concat.default)(options, (0, _flatMapDeep.default)('options', optgroups)))), [multiple, options, optgroups]);
|
|
122
138
|
const isSelectedInValidOption = (0, _react.useMemo)(() => theme === 'player' && (0, _getOr.default)(false, 'name', (0, _find.default)({
|
|
123
139
|
validOption: false,
|
|
124
140
|
selected: true
|
|
@@ -159,15 +175,10 @@ const Select = (props, legacyContext) => {
|
|
|
159
175
|
ariaLabel: ariaLabel,
|
|
160
176
|
arrowClass: shouldUseSkinFontColor ? _style.default.selectedArrow : _style.default.arrow,
|
|
161
177
|
arrowColor: isThemeOneOfQuestionTemplateOrPlayer ? arrowColor : black
|
|
162
|
-
}), /*#__PURE__*/_react.default.createElement("select",
|
|
163
|
-
'aria-labelledby': ariaLabelledBy
|
|
164
|
-
} : {}, ariaLabel && !ariaLabelledBy ? {
|
|
165
|
-
'aria-label': ariaLabel
|
|
166
|
-
} : {}, ariaLabel ? {
|
|
167
|
-
title: ariaLabel
|
|
168
|
-
} : {}, {
|
|
178
|
+
}), /*#__PURE__*/_react.default.createElement("select", {
|
|
169
179
|
"data-name": "native-select",
|
|
170
180
|
className: _style.default.selectBox,
|
|
181
|
+
title: selectedLabel,
|
|
171
182
|
name: name,
|
|
172
183
|
onChange: handleChange,
|
|
173
184
|
value: selected,
|
|
@@ -180,7 +191,7 @@ const Select = (props, legacyContext) => {
|
|
|
180
191
|
,
|
|
181
192
|
onMouseLeave: handleSelectOnBlur,
|
|
182
193
|
"data-testid": "native-select"
|
|
183
|
-
}
|
|
194
|
+
}, optionList)), /*#__PURE__*/_react.default.createElement("div", {
|
|
184
195
|
className: _style.default.description
|
|
185
196
|
}, description));
|
|
186
197
|
};
|
|
@@ -192,6 +203,11 @@ const SelectOptionPropTypes = {
|
|
|
192
203
|
validOption: _propTypes.default.bool
|
|
193
204
|
};
|
|
194
205
|
exports.SelectOptionPropTypes = SelectOptionPropTypes;
|
|
206
|
+
const SelectOptionGroupPropTypes = {
|
|
207
|
+
label: _propTypes.default.string.isRequired,
|
|
208
|
+
options: _propTypes.default.arrayOf(_propTypes.default.shape(SelectOptionPropTypes))
|
|
209
|
+
};
|
|
210
|
+
exports.SelectOptionGroupPropTypes = SelectOptionGroupPropTypes;
|
|
195
211
|
Select.contextTypes = {
|
|
196
212
|
skin: _provider.default.childContextTypes.skin
|
|
197
213
|
};
|
|
@@ -207,10 +223,10 @@ Select.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
207
223
|
onChange: _propTypes.default.func,
|
|
208
224
|
theme: _propTypes.default.oneOf((0, _keys.default)(themeStyle)),
|
|
209
225
|
options: _propTypes.default.arrayOf(_propTypes.default.shape(SelectOptionPropTypes)),
|
|
226
|
+
optgroups: _propTypes.default.arrayOf(_propTypes.default.shape(SelectOptionGroupPropTypes)),
|
|
210
227
|
modified: _propTypes.default.bool,
|
|
211
228
|
error: _propTypes.default.bool,
|
|
212
|
-
'aria-label': _propTypes.default.string
|
|
213
|
-
'aria-labelledby': _propTypes.default.string
|
|
229
|
+
'aria-label': _propTypes.default.string
|
|
214
230
|
} : {};
|
|
215
231
|
var _default = Select;
|
|
216
232
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["themeStyle","filter","style","invalid","header","mooc","question","sort","thematiques","player","template","coorpmanager","ArrowView","shouldRender","isArrowUp","ariaLabel","arrowClass","arrowColor","props","useMemo","color","className","Select","legacyContext","name","options","borderClassName","onChange","multiple","disabled","required","description","theme","modified","error","title","propTitle","ariaLabelledBy","skin","GetSkinFromContext","setIsArrowUp","useState","handleSelectOnFocus","useCallback","handleSelectOnBlur","optionList","map","option","index","value","selectOption","titleView","selected","get","find","selectedLabel","isSelectedInValidOption","getOr","validOption","handleChange","e","target","selectedOptions","black","isThemeOneOfQuestionTemplateOrPlayer","includes","shouldUseSkinFontColor","undefined","behaviorClassName","getClassState","default","composedClassName","classnames","unselected","labelSize","size","isLongLabel","selectWrapper","selectSpan","noLabelCommon","longLabel","selectedArrow","arrow","selectBox","SelectOptionPropTypes","PropTypes","string","isRequired","oneOfType","number","bool","contextTypes","Provider","childContextTypes","propTypes","func","oneOf","keys","arrayOf","shape"],"sources":["../../../src/atom/select/index.js"],"sourcesContent":["import React, {useCallback, useMemo, useState} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport filter from 'lodash/fp/filter';\nimport find from 'lodash/fp/find';\nimport get from 'lodash/fp/get';\nimport getOr from 'lodash/fp/getOr';\nimport includes from 'lodash/fp/includes';\nimport keys from 'lodash/fp/keys';\nimport map from 'lodash/fp/map';\nimport size from 'lodash/fp/size';\nimport {\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 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 [ariaLabel, 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 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 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 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.default, style.modified, style.error, modified, error),\n [error, modified]\n );\n const composedClassName = useMemo(\n () =>\n classnames(\n theme && theme !== 'coorpmanager' ? themeStyle[theme] : behaviorClassName,\n selected ? style.selected : style.unselected,\n className\n ),\n [behaviorClassName, className, selected, theme]\n );\n\n const labelSize = useMemo(() => size(selectedLabel), [selectedLabel]);\n\n const isLongLabel = useMemo(() => labelSize >= 65, [labelSize]);\n\n return (\n <div\n className={classnames(\n composedClassName,\n theme === 'coorpmanager' ? style.coorpmanager : null\n )}\n >\n <label\n data-name=\"select-wrapper\"\n style={{\n ...(shouldUseSkinFontColor && {\n color\n })\n }}\n className={style.selectWrapper}\n >\n {titleView}\n <span\n data-name=\"select-span\"\n className={classnames(\n style.selectSpan,\n includes(theme, ['player', 'invalid', 'question', 'thematiques', 'template'])\n ? style.noLabelCommon\n : null,\n borderClassName,\n isLongLabel ? style.longLabel : null\n )}\n style={{\n ...(shouldUseSkinFontColor && {\n color\n })\n }}\n >\n {selectedLabel}\n </span>\n <ArrowView\n 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\nSelect.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nSelect.propTypes = {\n title: PropTypes.string,\n name: PropTypes.string,\n className: PropTypes.string,\n borderClassName: PropTypes.string,\n disabled: PropTypes.bool,\n multiple: PropTypes.bool,\n description: PropTypes.string,\n required: PropTypes.bool,\n onChange: PropTypes.func,\n theme: PropTypes.oneOf(keys(themeStyle)),\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes)),\n modified: PropTypes.bool,\n error: PropTypes.bool,\n 'aria-label': PropTypes.string,\n 'aria-labelledby': PropTypes.string\n};\n\nexport default Select;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAIA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,UAAU,GAAG;EACjBC,MAAM,EAAEC,cAAA,CAAMD,MADG;EAEjBE,OAAO,EAAED,cAAA,CAAMC,OAFE;EAGjBC,MAAM,EAAEF,cAAA,CAAME,MAHG;EAIjBC,IAAI,EAAEH,cAAA,CAAMG,IAJK;EAKjBC,QAAQ,EAAEJ,cAAA,CAAMI,QALC;EAMjBC,IAAI,EAAEL,cAAA,CAAMK,IANK;EAOjBC,WAAW,EAAEN,cAAA,CAAMM,WAPF;EAQjBC,MAAM,EAAEP,cAAA,CAAMO,MARG;EASjBC,QAAQ,EAAER,cAAA,CAAMQ,QATC;EAUjBC,YAAY,EAAE;AAVG,CAAnB;;AAaA,MAAMC,SAAS,GAAG,CAAC;EAACC,YAAD;EAAeC,SAAf;EAA0BC,SAA1B;EAAqCC,UAArC;EAAiDC;AAAjD,CAAD,KAAkE;EAClF,MAAMC,KAAK,GAAG,IAAAC,cAAA,EACZ,mBACMF,UAAU,GACZ;IACEG,KAAK,EAAEH;EADT,CAFJ;IAKEI,SAAS,EAAEL;EALb,EADY,EAQZ,CAACD,SAAD,EAAYC,UAAZ,EAAwBC,UAAxB,CARY,CAAd;;EAUA,IAAIJ,YAAJ,EAAkB;IAChB,OAAOC,SAAS,gBACd,6BAAC,4CAAD,eAAaI,KAAb;MAAoB,eAAY;IAAhC,GADc,gBAGd,6BAAC,6CAAD,eAAeA,KAAf;MAAsB,eAAY;IAAlC,GAHF;EAKD,CAND,MAMO,OAAO,IAAP;AACR,CAlBD;;AAoB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BrD,IAAI,EAAEsD,iBAAA,CAASC,iBAAT,CAA2BvD;AADb,CAAtB;AAIAhB,MAAM,CAACwE,SAAP,2CAAmB;EACjB3D,KAAK,EAAEkD,kBAAA,CAAUC,MADA;EAEjB9D,IAAI,EAAE6D,kBAAA,CAAUC,MAFC;EAGjBjE,SAAS,EAAEgE,kBAAA,CAAUC,MAHJ;EAIjB5D,eAAe,EAAE2D,kBAAA,CAAUC,MAJV;EAKjBzD,QAAQ,EAAEwD,kBAAA,CAAUK,IALH;EAMjB9D,QAAQ,EAAEyD,kBAAA,CAAUK,IANH;EAOjB3D,WAAW,EAAEsD,kBAAA,CAAUC,MAPN;EAQjBxD,QAAQ,EAAEuD,kBAAA,CAAUK,IARH;EASjB/D,QAAQ,EAAE0D,kBAAA,CAAUU,IATH;EAUjB/D,KAAK,EAAEqD,kBAAA,CAAUW,KAAV,CAAgB,IAAAC,aAAA,EAAKjG,UAAL,CAAhB,CAVU;EAWjByB,OAAO,EAAE4D,kBAAA,CAAUa,OAAV,CAAkBb,kBAAA,CAAUc,KAAV,CAAgBf,qBAAhB,CAAlB,CAXQ;EAYjBnD,QAAQ,EAAEoD,kBAAA,CAAUK,IAZH;EAajBxD,KAAK,EAAEmD,kBAAA,CAAUK,IAbA;EAcjB,cAAcL,kBAAA,CAAUC,MAdP;EAejB,mBAAmBD,kBAAA,CAAUC;AAfZ,CAAnB;eAkBehE,M"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["themeStyle","filter","style","invalid","header","mooc","question","sort","thematiques","player","template","coorpmanager","ArrowView","shouldRender","isArrowUp","ariaLabel","arrowClass","arrowColor","props","useMemo","color","className","Select","legacyContext","name","options","optgroups","borderClassName","onChange","multiple","disabled","required","description","theme","modified","error","title","propTitle","skin","GetSkinFromContext","setIsArrowUp","useState","handleSelectOnFocus","useCallback","handleSelectOnBlur","selectOption","option","index","value","optionList","isEmpty","map","optgroup","label","i","titleView","selected","get","find","concat","flatMapDeep","selectedLabel","isSelectedInValidOption","getOr","validOption","handleChange","e","target","selectedOptions","black","isThemeOneOfQuestionTemplateOrPlayer","includes","shouldUseSkinFontColor","undefined","behaviorClassName","getClassState","default","composedClassName","classnames","unselected","labelSize","size","isLongLabel","selectWrapper","selectSpan","noLabelCommon","longLabel","selectedArrow","arrow","selectBox","SelectOptionPropTypes","PropTypes","string","isRequired","oneOfType","number","bool","SelectOptionGroupPropTypes","arrayOf","shape","contextTypes","Provider","childContextTypes","propTypes","func","oneOf","keys"],"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 coorpmanager: null\n};\n\nconst ArrowView = ({shouldRender, isArrowUp, ariaLabel, arrowClass, arrowColor}) => {\n const props = useMemo(\n () => ({\n ...(ariaLabel &\n {\n 'aria-label': ariaLabel\n }),\n ...(arrowColor &\n {\n color: arrowColor\n }),\n className: arrowClass\n }),\n [ariaLabel, 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 } = 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('value', 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.default, style.modified, style.error, modified, error),\n [error, modified]\n );\n const composedClassName = useMemo(\n () =>\n classnames(\n theme && theme !== 'coorpmanager' ? themeStyle[theme] : behaviorClassName,\n selected ? style.selected : style.unselected,\n className\n ),\n [behaviorClassName, className, selected, theme]\n );\n\n const labelSize = useMemo(() => size(selectedLabel), [selectedLabel]);\n\n const isLongLabel = useMemo(() => labelSize >= 65, [labelSize]);\n\n return (\n <div\n className={classnames(\n composedClassName,\n theme === 'coorpmanager' ? style.coorpmanager : null\n )}\n >\n <label\n data-name=\"select-wrapper\"\n style={{\n ...(shouldUseSkinFontColor && {\n color\n })\n }}\n className={style.selectWrapper}\n >\n {titleView}\n <span\n data-name=\"select-span\"\n className={classnames(\n style.selectSpan,\n includes(theme, ['player', 'invalid', 'question', 'thematiques', 'template'])\n ? style.noLabelCommon\n : null,\n borderClassName,\n isLongLabel ? style.longLabel : null\n )}\n style={{\n ...(shouldUseSkinFontColor && {\n color\n })\n }}\n >\n {selectedLabel}\n </span>\n <ArrowView\n shouldRender={!multiple}\n isArrowUp={isArrowUp}\n ariaLabel={ariaLabel}\n arrowClass={shouldUseSkinFontColor ? style.selectedArrow : style.arrow}\n arrowColor={isThemeOneOfQuestionTemplateOrPlayer ? arrowColor : black}\n />\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 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};\n\nexport default Select;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAIA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,UAAU,GAAG;EACjBC,MAAM,EAAEC,cAAA,CAAMD,MADG;EAEjBE,OAAO,EAAED,cAAA,CAAMC,OAFE;EAGjBC,MAAM,EAAEF,cAAA,CAAME,MAHG;EAIjBC,IAAI,EAAEH,cAAA,CAAMG,IAJK;EAKjBC,QAAQ,EAAEJ,cAAA,CAAMI,QALC;EAMjBC,IAAI,EAAEL,cAAA,CAAMK,IANK;EAOjBC,WAAW,EAAEN,cAAA,CAAMM,WAPF;EAQjB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BP,kBAAA,CAAUQ,KAAV,CAAgBT,qBAAhB,CAAlB;AAF+B,CAAnC;;AAKPpE,MAAM,CAAC8E,YAAP,GAAsB;EACpB9D,IAAI,EAAE+D,iBAAA,CAASC,iBAAT,CAA2BhE;AADb,CAAtB;AAIAhB,MAAM,CAACiF,SAAP,2CAAmB;EACjBnE,KAAK,EAAEuD,kBAAA,CAAUC,MADA;EAEjBpE,IAAI,EAAEmE,kBAAA,CAAUC,MAFC;EAGjBvE,SAAS,EAAEsE,kBAAA,CAAUC,MAHJ;EAIjBjE,eAAe,EAAEgE,kBAAA,CAAUC,MAJV;EAKjB9D,QAAQ,EAAE6D,kBAAA,CAAUK,IALH;EAMjBnE,QAAQ,EAAE8D,kBAAA,CAAUK,IANH;EAOjBhE,WAAW,EAAE2D,kBAAA,CAAUC,MAPN;EAQjB7D,QAAQ,EAAE4D,kBAAA,CAAUK,IARH;EASjBpE,QAAQ,EAAE+D,kBAAA,CAAUa,IATH;EAUjBvE,KAAK,EAAE0D,kBAAA,CAAUc,KAAV,CAAgB,IAAAC,aAAA,EAAK1G,UAAL,CAAhB,CAVU;EAWjByB,OAAO,EAAEkE,kBAAA,CAAUO,OAAV,CAAkBP,kBAAA,CAAUQ,KAAV,CAAgBT,qBAAhB,CAAlB,CAXQ;EAYjBhE,SAAS,EAAEiE,kBAAA,CAAUO,OAAV,CAAkBP,kBAAA,CAAUQ,KAAV,CAAgBF,0BAAhB,CAAlB,CAZM;EAajB/D,QAAQ,EAAEyD,kBAAA,CAAUK,IAbH;EAcjB7D,KAAK,EAAEwD,kBAAA,CAAUK,IAdA;EAejB,cAAcL,kBAAA,CAAUC;AAfP,CAAnB;eAkBetE,M"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/answer/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/answer/index.js"],"names":[],"mappings":";AAwEA,iDASC"}
|
|
@@ -25,6 +25,8 @@ var _template = _interopRequireDefault(require("../questions/template"));
|
|
|
25
25
|
|
|
26
26
|
var _audio = _interopRequireDefault(require("../audio"));
|
|
27
27
|
|
|
28
|
+
var _provider = require("../../atom/provider");
|
|
29
|
+
|
|
28
30
|
var _style = _interopRequireDefault(require("./style.css"));
|
|
29
31
|
|
|
30
32
|
var _propTypes = _interopRequireWildcard(require("./prop-types"));
|
|
@@ -90,30 +92,42 @@ const Switch = ({
|
|
|
90
92
|
const {
|
|
91
93
|
type
|
|
92
94
|
} = model;
|
|
95
|
+
const translate = (0, _provider.GetTranslateFromContext)();
|
|
93
96
|
|
|
94
97
|
switch (type) {
|
|
95
98
|
case 'qcmDrag':
|
|
96
99
|
return /*#__PURE__*/_react.default.createElement(_qcmDrag.default, _extends({}, model, {
|
|
97
|
-
help: help
|
|
100
|
+
help: help,
|
|
101
|
+
groupAriaLabel: translate('answer_the_question')
|
|
98
102
|
}));
|
|
99
103
|
|
|
100
104
|
case 'qcm':
|
|
101
|
-
return /*#__PURE__*/_react.default.createElement(_qcm.default, model
|
|
105
|
+
return /*#__PURE__*/_react.default.createElement(_qcm.default, _extends({}, model, {
|
|
106
|
+
groupAriaLabel: translate('answer_the_question')
|
|
107
|
+
}));
|
|
102
108
|
|
|
103
109
|
case 'qcmGraphic':
|
|
104
|
-
return /*#__PURE__*/_react.default.createElement(_qcmGraphic.default, model
|
|
110
|
+
return /*#__PURE__*/_react.default.createElement(_qcmGraphic.default, _extends({}, model, {
|
|
111
|
+
groupAriaLabel: translate('answer_the_question')
|
|
112
|
+
}));
|
|
105
113
|
|
|
106
114
|
case 'freeText':
|
|
107
115
|
return /*#__PURE__*/_react.default.createElement(_freeText.default, model);
|
|
108
116
|
|
|
109
117
|
case 'dropDown':
|
|
110
|
-
return /*#__PURE__*/_react.default.createElement(_dropDown.default, model
|
|
118
|
+
return /*#__PURE__*/_react.default.createElement(_dropDown.default, _extends({}, model, {
|
|
119
|
+
groupAriaLabel: translate('answer_the_question')
|
|
120
|
+
}));
|
|
111
121
|
|
|
112
122
|
case 'slider':
|
|
113
|
-
return /*#__PURE__*/_react.default.createElement(_questionRange.default, model
|
|
123
|
+
return /*#__PURE__*/_react.default.createElement(_questionRange.default, _extends({}, model, {
|
|
124
|
+
groupAriaLabel: translate('answer_the_question')
|
|
125
|
+
}));
|
|
114
126
|
|
|
115
127
|
case 'template':
|
|
116
|
-
return /*#__PURE__*/_react.default.createElement(_template.default, model
|
|
128
|
+
return /*#__PURE__*/_react.default.createElement(_template.default, _extends({}, model, {
|
|
129
|
+
groupAriaLabel: translate('answer_the_question')
|
|
130
|
+
}));
|
|
117
131
|
}
|
|
118
132
|
};
|
|
119
133
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["MediaView","media","videoId","type","childProps","TYPE_IMAGE","style","backgroundImage","url","TYPE_VIDEO","video","TYPE_AUDIO","audio","propTypes","MediaViewPropTypes","Switch","model","help","Answer","props","wrapper"],"sources":["../../../src/molecule/answer/index.js"],"sourcesContent":["import React from 'react';\nimport {omit} from 'lodash/fp';\nimport VideoPlayer from '../video-player';\nimport DropDown from '../questions/drop-down';\nimport FreeText from '../questions/free-text';\nimport QcmDrag from '../questions/qcm-drag';\nimport Qcm from '../questions/qcm';\nimport QcmGraphic from '../questions/qcm-graphic';\nimport QuestionRange from '../questions/question-range';\nimport Template from '../questions/template';\nimport Audio from '../audio';\nimport style from './style.css';\nimport propTypes, {MediaViewPropTypes, TYPE_AUDIO, TYPE_IMAGE, TYPE_VIDEO} from './prop-types';\n\nconst MediaView = ({media}) => {\n const {videoId, type, ...childProps} = media;\n switch (type) {\n case TYPE_IMAGE:\n return (\n <div\n className={style.media}\n style={{\n backgroundImage: `url(${media.url})`\n }}\n />\n );\n case TYPE_VIDEO:\n return (\n <div className={style.video}>\n <VideoPlayer {...omit('id', childProps)} id={videoId} height=\"100%\" width=\"100%\" />\n </div>\n );\n case TYPE_AUDIO:\n return (\n <div className={style.audio}>\n <Audio {...omit('id', childProps)} height=\"100%\" width=\"100%\" />\n </div>\n );\n default:\n return null;\n }\n};\n\nMediaView.propTypes = MediaViewPropTypes;\n\nconst Switch = ({model, help}) => {\n const {type} = model;\n
|
|
1
|
+
{"version":3,"file":"index.js","names":["MediaView","media","videoId","type","childProps","TYPE_IMAGE","style","backgroundImage","url","TYPE_VIDEO","video","TYPE_AUDIO","audio","propTypes","MediaViewPropTypes","Switch","model","help","translate","GetTranslateFromContext","Answer","props","wrapper"],"sources":["../../../src/molecule/answer/index.js"],"sourcesContent":["import React from 'react';\nimport {omit} from 'lodash/fp';\nimport VideoPlayer from '../video-player';\nimport DropDown from '../questions/drop-down';\nimport FreeText from '../questions/free-text';\nimport QcmDrag from '../questions/qcm-drag';\nimport Qcm from '../questions/qcm';\nimport QcmGraphic from '../questions/qcm-graphic';\nimport QuestionRange from '../questions/question-range';\nimport Template from '../questions/template';\nimport Audio from '../audio';\nimport {GetTranslateFromContext} from '../../atom/provider';\nimport style from './style.css';\nimport propTypes, {MediaViewPropTypes, TYPE_AUDIO, TYPE_IMAGE, TYPE_VIDEO} from './prop-types';\n\nconst MediaView = ({media}) => {\n const {videoId, type, ...childProps} = media;\n switch (type) {\n case TYPE_IMAGE:\n return (\n <div\n className={style.media}\n style={{\n backgroundImage: `url(${media.url})`\n }}\n />\n );\n case TYPE_VIDEO:\n return (\n <div className={style.video}>\n <VideoPlayer {...omit('id', childProps)} id={videoId} height=\"100%\" width=\"100%\" />\n </div>\n );\n case TYPE_AUDIO:\n return (\n <div className={style.audio}>\n <Audio {...omit('id', childProps)} height=\"100%\" width=\"100%\" />\n </div>\n );\n default:\n return null;\n }\n};\n\nMediaView.propTypes = MediaViewPropTypes;\n\nconst Switch = ({model, help}) => {\n const {type} = model;\n const translate = GetTranslateFromContext();\n switch (type) {\n case 'qcmDrag':\n return <QcmDrag {...model} help={help} groupAriaLabel={translate('answer_the_question')} />;\n case 'qcm':\n return <Qcm {...model} groupAriaLabel={translate('answer_the_question')} />;\n case 'qcmGraphic':\n return <QcmGraphic {...model} groupAriaLabel={translate('answer_the_question')} />;\n case 'freeText':\n return <FreeText {...model} />;\n case 'dropDown':\n return <DropDown {...model} groupAriaLabel={translate('answer_the_question')} />;\n case 'slider':\n return <QuestionRange {...model} groupAriaLabel={translate('answer_the_question')} />;\n case 'template':\n return <Template {...model} groupAriaLabel={translate('answer_the_question')} />;\n }\n};\n\nSwitch.propTypes = {\n model: propTypes.model,\n help: propTypes.help\n};\n\nconst Answer = props => {\n const {model, media, help} = props;\n\n return (\n <div data-name=\"answer\" className={style.wrapper}>\n {media ? <MediaView media={media} /> : null}\n <Switch model={model} help={help} />\n </div>\n );\n};\n\nAnswer.propTypes = propTypes;\n\nexport default Answer;\n"],"mappings":";;;;;;;AAAA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;AAEA,MAAMA,SAAS,GAAG,CAAC;EAACC;AAAD,CAAD,KAAa;EAC7B,MAAM;IAACC,OAAD;IAAUC;EAAV,IAAiCF,KAAvC;EAAA,MAAyBG,UAAzB,iCAAuCH,KAAvC;;EACA,QAAQE,IAAR;IACE,KAAKE,qBAAL;MACE,oBACE;QACE,SAAS,EAAEC,cAAA,CAAML,KADnB;QAEE,KAAK,EAAE;UACLM,eAAe,EAAG,OAAMN,KAAK,CAACO,GAAI;QAD7B;MAFT,EADF;;IAQF,KAAKC,qBAAL;MACE,oBACE;QAAK,SAAS,EAAEH,cAAA,CAAMI;MAAtB,gBACE,6BAAC,oBAAD,eAAiB,oBAAK,IAAL,EAAWN,UAAX,CAAjB;QAAyC,EAAE,EAAEF,OAA7C;QAAsD,MAAM,EAAC,MAA7D;QAAoE,KAAK,EAAC;MAA1E,GADF,CADF;;IAKF,KAAKS,qBAAL;MACE,oBACE;QAAK,SAAS,EAAEL,cAAA,CAAMM;MAAtB,gBACE,6BAAC,cAAD,eAAW,oBAA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