@coorpacademy/components 11.2.4-alpha.2 → 11.2.5-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/atom/choice/index.native.d.ts.map +1 -1
- package/es/atom/choice/index.native.js +3 -2
- package/es/atom/choice/index.native.js.map +1 -1
- package/es/atom/select/index.d.ts +1 -1
- package/es/atom/select/index.js +3 -3
- package/es/atom/select/index.js.map +1 -1
- package/es/molecule/brand-form-group/index.d.ts +2 -2
- package/es/molecule/filters/index.d.ts +1 -1
- package/es/molecule/setup-slide/index.d.ts +1 -1
- package/es/molecule/setup-slider/index.d.ts +1 -1
- package/es/organism/brand-form/index.d.ts +2 -2
- package/es/organism/mooc-header/index.js +3 -3
- package/es/organism/mooc-header/index.js.map +1 -1
- package/es/organism/review-slide/index.native.d.ts.map +1 -1
- package/es/organism/review-slide/index.native.js +16 -10
- package/es/organism/review-slide/index.native.js.map +1 -1
- package/es/organism/review-stacked-slides/index.native.d.ts.map +1 -1
- package/es/organism/review-stacked-slides/index.native.js +3 -2
- package/es/organism/review-stacked-slides/index.native.js.map +1 -1
- package/es/organism/wizard-contents/index.d.ts +2 -2
- package/es/template/back-office/brand-update/index.d.ts +4 -4
- package/es/template/common/search-page/index.d.ts +1 -1
- package/lib/atom/choice/index.native.d.ts.map +1 -1
- package/lib/atom/choice/index.native.js +3 -2
- package/lib/atom/choice/index.native.js.map +1 -1
- package/lib/atom/select/index.d.ts +1 -1
- package/lib/atom/select/index.js +3 -3
- package/lib/atom/select/index.js.map +1 -1
- package/lib/molecule/brand-form-group/index.d.ts +2 -2
- package/lib/molecule/filters/index.d.ts +1 -1
- package/lib/molecule/setup-slide/index.d.ts +1 -1
- package/lib/molecule/setup-slider/index.d.ts +1 -1
- package/lib/organism/brand-form/index.d.ts +2 -2
- package/lib/organism/mooc-header/index.js +3 -3
- package/lib/organism/mooc-header/index.js.map +1 -1
- package/lib/organism/review-slide/index.native.d.ts.map +1 -1
- package/lib/organism/review-slide/index.native.js +15 -9
- package/lib/organism/review-slide/index.native.js.map +1 -1
- package/lib/organism/review-stacked-slides/index.native.d.ts.map +1 -1
- package/lib/organism/review-stacked-slides/index.native.js +2 -1
- package/lib/organism/review-stacked-slides/index.native.js.map +1 -1
- package/lib/organism/wizard-contents/index.d.ts +2 -2
- package/lib/template/back-office/brand-update/index.d.ts +4 -4
- package/lib/template/common/search-page/index.d.ts +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":["React","useEffect","useState","Animated","Easing","StyleSheet","useWindowDimensions","View","get","getOr","useTranslateY","Text","Answer","ReviewCorrectionPopin","useTemplateContext","Button","styles","create","correctionPopinWrapper","position","bottom","width","CorrectionPopin","correctionPopinProps","slideIndex","showCorrectionPopin","animateCorrectionPopin","translateUp","fromValue","toValue","duration","easing","bezier","start","klf","undefined","information","label","message","next","onClick","_correctionPopinProps","type","resultLabel","style","animatedStyle","createQuestionStyle","theme","questionHeading","justifyContent","questionOrigin","fontSize","lineHeight","color","colors","text","primary","marginBottom","spacing","tiny","marginTop","small","textAlign","questionText","fontWeight","questionHelp","gray","medium","choicesContainer","flex","Question","props","answerUI","setStyle","questionStyle","createSlideStyle","num","screenWidth","slideWidth","slide","left","backgroundColor","height","alignItems","padding","shadowColor","shadowOffset","shadowOpacity","shadowRadius","elevation","borderRadius","Slide","validateButton","slideStyle","loading","parentContentTitle","handleValidatePress","disabled"],"sources":["../../../src/organism/review-slide/index.native.tsx"],"sourcesContent":["import React, {useEffect, useState} from 'react';\nimport {\n Animated,\n Easing,\n StyleSheet,\n TextStyle,\n useWindowDimensions,\n View,\n ViewStyle\n} from 'react-native';\nimport get from 'lodash/fp/get';\nimport getOr from 'lodash/fp/getOr';\nimport {useTranslateY} from '@coorpacademy/react-native-animation';\nimport Text from '../../atom/text/index.native';\nimport Answer from '../../molecule/answer/index.native';\nimport ReviewCorrectionPopin from '../../molecule/review-correction-popin/index.native';\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport {Theme} from '../../variables/theme.native';\nimport Button from '../../atom/button/index.native';\nimport {PopinProps, ReviewSlideProps, SlideProps} from './prop-types';\n\nconst styles = StyleSheet.create({\n correctionPopinWrapper: {\n position: 'absolute',\n bottom: 16,\n width: '105%'\n }\n});\n\nconst CorrectionPopin = ({\n correctionPopinProps,\n slideIndex,\n showCorrectionPopin,\n animateCorrectionPopin\n}: PopinProps) => {\n const translateUp = useTranslateY({\n fromValue: 1000,\n toValue: 0,\n duration: 800,\n easing: Easing.bezier(0.37, 0, 0.63, 1)\n });\n\n useEffect(() => translateUp.start(), []);\n\n if (!showCorrectionPopin) return null;\n\n const klf = getOr(undefined, 'klf', correctionPopinProps);\n const information = getOr({label: '', message: ''}, 'information', correctionPopinProps);\n const next = get('next', correctionPopinProps);\n const onClick = get(['next', 'onClick'], correctionPopinProps);\n\n const _correctionPopinProps = {\n next: {\n onClick,\n label: next && next.label,\n 'data-name': `next-question-button-${slideIndex}`,\n 'aria-label': next && next['aria-label']\n },\n klf,\n information,\n type: correctionPopinProps.type,\n resultLabel: correctionPopinProps.resultLabel\n };\n\n const style = animateCorrectionPopin\n ? [styles.correctionPopinWrapper, translateUp.animatedStyle]\n : styles.correctionPopinWrapper;\n\n return (\n <Animated.View style={style}>\n <ReviewCorrectionPopin {..._correctionPopinProps} />\n </Animated.View>\n );\n};\n\ntype StyleSheetType = {\n questionHeading: ViewStyle;\n questionOrigin: ViewStyle;\n questionText: TextStyle;\n questionHelp: ViewStyle;\n choicesContainer: ViewStyle;\n};\n\nconst createQuestionStyle = (theme: Theme): StyleSheetType =>\n StyleSheet.create({\n questionHeading: {\n justifyContent: 'space-between'\n },\n questionOrigin: {\n fontSize: 12,\n lineHeight: 16,\n color: theme.colors.text.primary,\n marginBottom: theme.spacing.tiny,\n marginTop: theme.spacing.small,\n textAlign: 'center'\n },\n questionText: {\n fontSize: 16,\n lineHeight: 22,\n fontWeight: '700',\n color: theme.colors.text.primary,\n textAlign: 'center'\n },\n questionHelp: {\n fontSize: 12,\n lineHeight: 16,\n color: theme.colors.gray.medium,\n marginBottom: 0,\n marginTop: theme.spacing.small,\n textAlign: 'center'\n },\n choicesContainer: {\n flex: 1,\n width: '100%',\n justifyContent: 'center'\n }\n });\n\ntype QuestionProps = {\n answerUI: SlideProps['answerUI'];\n questionText: SlideProps['questionText'];\n questionOrigin: SlideProps['parentContentTitle'];\n};\n\nconst Question = (props: QuestionProps) => {\n const {answerUI, questionText, questionOrigin} = props;\n const {theme} = useTemplateContext();\n const [style, setStyle] = useState<StyleSheetType>();\n\n useEffect(() => {\n const questionStyle = createQuestionStyle(theme);\n setStyle(questionStyle);\n }, [theme]);\n\n if (!answerUI || !questionText || !style) return null;\n\n return (\n <>\n <View style={style.questionHeading}>\n <Text style={style.questionOrigin}>{questionOrigin}</Text>\n <Text style={style.questionText}>{questionText}</Text>\n <Text style={style.questionHelp}>{get('help', answerUI)}</Text>\n </View>\n <View style={style.choicesContainer}>\n <Answer {...answerUI} />\n </View>\n </>\n );\n};\n\ntype SlideStyle = {\n slide: ViewStyle;\n};\n\nconst createSlideStyle = (num: number, screenWidth: number): SlideStyle => {\n const slideWidth = screenWidth - 40 - num * 8;\n\n return StyleSheet.create({\n slide: {\n position: 'absolute',\n left: 20 + num * 4,\n bottom: 34 + num * 5,\n backgroundColor: '#fff', // theme.colors.white\n height: '90%',\n width: slideWidth,\n justifyContent: 'space-between',\n alignItems: 'center',\n padding: 25,\n shadowColor: '#000',\n shadowOffset: {width: 0, height: -1},\n shadowOpacity: 0.05,\n shadowRadius: 16,\n elevation: 10 - num * 1,\n borderRadius: 16\n }\n });\n};\n\nconst Slide = (props: ReviewSlideProps) => {\n const {animatedStyle, slide, correctionPopinProps, validateButton, num, slideIndex = '0'} = props;\n\n const {width} = useWindowDimensions();\n const slideStyle = createSlideStyle(num, width);\n\n const {\n loading,\n parentContentTitle,\n questionText,\n answerUI,\n showCorrectionPopin,\n animateCorrectionPopin\n } = slide;\n\n if (loading) {\n return <View style={slideStyle.slide} />;\n }\n\n const {onClick: handleValidatePress} = validateButton;\n\n return (\n <Animated.View style={[slideStyle.slide, animatedStyle]}>\n <Question\n questionOrigin={parentContentTitle}\n questionText={questionText}\n answerUI={answerUI}\n key=\"question-container\"\n />\n <Button\n disabled={validateButton.disabled}\n submitValue={validateButton.label}\n onPress={handleValidatePress}\n testID={`slide-validate-button-${slideIndex}`}\n />\n {correctionPopinProps ? (\n <CorrectionPopin\n correctionPopinProps={correctionPopinProps}\n slideIndex={slideIndex}\n showCorrectionPopin={showCorrectionPopin}\n animateCorrectionPopin={animateCorrectionPopin}\n key=\"correction-popin\"\n />\n ) : null}\n </Animated.View>\n );\n};\n\nexport default Slide;\n"],"mappings":"AAAA,OAAOA,KAAP,IAAeC,SAAf,EAA0BC,QAA1B,QAAyC,OAAzC;AACA,SACEC,QADF,EAEEC,MAFF,EAGEC,UAHF,EAKEC,mBALF,EAMEC,IANF,QAQO,cARP;AASA,OAAOC,GAAP,MAAgB,eAAhB;AACA,OAAOC,KAAP,MAAkB,iBAAlB;AACA,SAAQC,aAAR,QAA4B,sCAA5B;AACA,OAAOC,IAAP,MAAiB,8BAAjB;AACA,OAAOC,MAAP,MAAmB,oCAAnB;AACA,OAAOC,qBAAP,MAAkC,qDAAlC;AACA,SAAQC,kBAAR,QAAiC,4CAAjC;AAEA,OAAOC,MAAP,MAAmB,gCAAnB;AAGA,MAAMC,MAAM,GAAGX,UAAU,CAACY,MAAX,CAAkB;EAC/BC,sBAAsB,EAAE;IACtBC,QAAQ,EAAE,UADY;IAEtBC,MAAM,EAAE,EAFc;IAGtBC,KAAK,EAAE;EAHe;AADO,CAAlB,CAAf;;AAQA,MAAMC,eAAe,GAAG,CAAC;EACvBC,oBADuB;EAEvBC,UAFuB;EAGvBC,mBAHuB;EAIvBC;AAJuB,CAAD,KAKN;EAChB,MAAMC,WAAW,GAAGjB,aAAa,CAAC;IAChCkB,SAAS,EAAE,IADqB;I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;IAEE,UAAU,EAAEC,UAFd;IAGE,mBAAmB,EAAEC,mBAHvB;IAIE,sBAAsB,EAAEC,sBAJ1B;IAKE,GAAG,EAAC;EALN,EADmB,GAQjB,IArBN,CADF;AAyBD,CA9CD;;AAgDA,eAAeiE,KAAf"}
|
|
1
|
+
{"version":3,"file":"index.native.js","names":["React","useEffect","useState","Animated","Easing","ScrollView","StyleSheet","useWindowDimensions","View","get","getOr","useTranslateY","Text","Answer","ReviewCorrectionPopin","useTemplateContext","Button","styles","create","correctionPopinWrapper","position","bottom","width","CorrectionPopin","correctionPopinProps","slideIndex","showCorrectionPopin","animateCorrectionPopin","translateUp","fromValue","toValue","duration","easing","bezier","start","klf","undefined","information","label","message","next","onClick","_correctionPopinProps","type","resultLabel","style","animatedStyle","createQuestionStyle","theme","questionHeading","justifyContent","questionOrigin","fontSize","lineHeight","color","colors","text","primary","marginBottom","spacing","tiny","marginTop","small","textAlign","questionText","fontWeight","questionHelp","gray","medium","choicesScrollView","marginVertical","choicesScrollContent","padding","Question","props","answerUI","setStyle","questionStyle","createSlideStyle","num","screenWidth","slideWidth","slide","left","backgroundColor","height","alignItems","shadowColor","shadowOffset","shadowOpacity","shadowRadius","elevation","borderRadius","Slide","validateButton","slideStyle","loading","parentContentTitle","handleValidatePress","disabled"],"sources":["../../../src/organism/review-slide/index.native.tsx"],"sourcesContent":["import React, {useEffect, useState} from 'react';\nimport {\n Animated,\n Easing,\n ScrollView,\n StyleSheet,\n TextStyle,\n useWindowDimensions,\n View,\n ViewStyle\n} from 'react-native';\nimport get from 'lodash/fp/get';\nimport getOr from 'lodash/fp/getOr';\nimport {useTranslateY} from '@coorpacademy/react-native-animation';\nimport Text from '../../atom/text/index.native';\nimport Answer from '../../molecule/answer/index.native';\nimport ReviewCorrectionPopin from '../../molecule/review-correction-popin/index.native';\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport {Theme} from '../../variables/theme.native';\nimport Button from '../../atom/button/index.native';\nimport {PopinProps, ReviewSlideProps, SlideProps} from './prop-types';\n\nconst styles = StyleSheet.create({\n correctionPopinWrapper: {\n position: 'absolute',\n bottom: 16,\n width: '105%'\n }\n});\n\nconst CorrectionPopin = ({\n correctionPopinProps,\n slideIndex,\n showCorrectionPopin,\n animateCorrectionPopin\n}: PopinProps) => {\n const translateUp = useTranslateY({\n fromValue: 500,\n toValue: 0,\n duration: 500,\n easing: Easing.bezier(0.34, 1.36, 0.64, 1)\n });\n\n useEffect(() => translateUp.start(), []);\n\n if (!showCorrectionPopin) return null;\n\n const klf = getOr(undefined, 'klf', correctionPopinProps);\n const information = getOr({label: '', message: ''}, 'information', correctionPopinProps);\n const next = get('next', correctionPopinProps);\n const onClick = get(['next', 'onClick'], correctionPopinProps);\n\n const _correctionPopinProps = {\n next: {\n onClick,\n label: next && next.label,\n 'data-name': `next-question-button-${slideIndex}`,\n 'aria-label': next && next['aria-label']\n },\n klf,\n information,\n type: correctionPopinProps.type,\n resultLabel: correctionPopinProps.resultLabel\n };\n\n const style = animateCorrectionPopin\n ? [styles.correctionPopinWrapper, translateUp.animatedStyle]\n : styles.correctionPopinWrapper;\n\n return (\n <Animated.View style={style}>\n <ReviewCorrectionPopin {..._correctionPopinProps} />\n </Animated.View>\n );\n};\n\ntype StyleSheetType = {\n questionHeading: ViewStyle;\n questionOrigin: ViewStyle;\n questionText: TextStyle;\n questionHelp: ViewStyle;\n choicesScrollView: ViewStyle;\n choicesScrollContent: ViewStyle;\n};\n\nconst createQuestionStyle = (theme: Theme): StyleSheetType =>\n StyleSheet.create({\n questionHeading: {\n justifyContent: 'space-between'\n },\n questionOrigin: {\n fontSize: 12,\n lineHeight: 16,\n color: theme.colors.text.primary,\n marginBottom: theme.spacing.tiny,\n marginTop: theme.spacing.small,\n textAlign: 'center'\n },\n questionText: {\n fontSize: 16,\n lineHeight: 22,\n fontWeight: '700',\n color: theme.colors.text.primary,\n textAlign: 'center'\n },\n questionHelp: {\n fontSize: 12,\n lineHeight: 16,\n color: theme.colors.gray.medium,\n marginBottom: 0,\n marginTop: theme.spacing.small,\n textAlign: 'center'\n },\n choicesScrollView: {\n marginVertical: 20,\n width: '100%'\n },\n choicesScrollContent: {\n padding: 10\n }\n });\n\ntype QuestionProps = {\n answerUI: SlideProps['answerUI'];\n questionText: SlideProps['questionText'];\n questionOrigin: SlideProps['parentContentTitle'];\n};\n\nconst Question = (props: QuestionProps) => {\n const {answerUI, questionText, questionOrigin} = props;\n const {theme} = useTemplateContext();\n const [style, setStyle] = useState<StyleSheetType>();\n\n useEffect(() => {\n const questionStyle = createQuestionStyle(theme);\n setStyle(questionStyle);\n }, [theme]);\n\n if (!answerUI || !questionText || !style) return null;\n\n return (\n <>\n <View style={style.questionHeading}>\n <Text style={style.questionOrigin}>{questionOrigin}</Text>\n <Text style={style.questionText}>{questionText}</Text>\n <Text style={style.questionHelp}>{get('help', answerUI)}</Text>\n </View>\n <ScrollView\n style={style.choicesScrollView}\n contentContainerStyle={style.choicesScrollContent}\n centerContent\n showsHorizontalScrollIndicator={false}\n showsVerticalScrollIndicator={false}\n >\n <Answer {...answerUI} />\n </ScrollView>\n </>\n );\n};\n\ntype SlideStyle = {\n slide: ViewStyle;\n};\n\nconst createSlideStyle = (num: number, screenWidth: number): SlideStyle => {\n const slideWidth = screenWidth - 40 - num * 8;\n\n return StyleSheet.create({\n slide: {\n position: 'absolute',\n left: 20 + num * 4,\n bottom: 34 + num * 5,\n backgroundColor: '#fff', // theme.colors.white\n height: '90%',\n width: slideWidth,\n justifyContent: 'space-between',\n alignItems: 'center',\n padding: 25,\n shadowColor: '#000',\n shadowOffset: {width: 0, height: -1},\n shadowOpacity: 0.05,\n shadowRadius: 16,\n elevation: 10 - num * 1,\n borderRadius: 16\n }\n });\n};\n\nconst Slide = (props: ReviewSlideProps) => {\n const {animatedStyle, slide, correctionPopinProps, validateButton, num, slideIndex = '0'} = props;\n\n const {width} = useWindowDimensions();\n const slideStyle = createSlideStyle(num, width);\n\n const {\n loading,\n parentContentTitle,\n questionText,\n answerUI,\n showCorrectionPopin,\n animateCorrectionPopin\n } = slide;\n\n if (loading) {\n return <View style={slideStyle.slide} />;\n }\n\n const {onClick: handleValidatePress} = validateButton;\n\n return (\n <Animated.View style={[slideStyle.slide, animatedStyle]}>\n <Question\n questionOrigin={parentContentTitle}\n questionText={questionText}\n answerUI={answerUI}\n key=\"question-container\"\n />\n <Button\n disabled={validateButton.disabled}\n submitValue={validateButton.label}\n onPress={handleValidatePress}\n testID={`slide-validate-button-${slideIndex}`}\n />\n {correctionPopinProps ? (\n <CorrectionPopin\n correctionPopinProps={correctionPopinProps}\n slideIndex={slideIndex}\n showCorrectionPopin={showCorrectionPopin}\n animateCorrectionPopin={animateCorrectionPopin}\n key=\"correction-popin\"\n />\n ) : null}\n </Animated.View>\n );\n};\n\nexport default Slide;\n"],"mappings":"AAAA,OAAOA,KAAP,IAAeC,SAAf,EAA0BC,QAA1B,QAAyC,OAAzC;AACA,SACEC,QADF,EAEEC,MAFF,EAGEC,UAHF,EAIEC,UAJF,EAMEC,mBANF,EAOEC,IAPF,QASO,cATP;AAUA,OAAOC,GAAP,MAAgB,eAAhB;AACA,OAAOC,KAAP,MAAkB,iBAAlB;AACA,SAAQC,aAAR,QAA4B,sCAA5B;AACA,OAAOC,IAAP,MAAiB,8BAAjB;AACA,OAAOC,MAAP,MAAmB,oCAAnB;AACA,OAAOC,qBAAP,MAAkC,qDAAlC;AACA,SAAQC,kBAAR,QAAiC,4CAAjC;AAEA,OAAOC,MAAP,MAAmB,gCAAnB;AAGA,MAAMC,MAAM,GAAGX,UAAU,CAACY,MAAX,CAAkB;EAC/BC,sBAAsB,EAAE;IACtBC,QAAQ,EAAE,UADY;IAEtBC,MAAM,EAAE,EAFc;IAGtBC,KAAK,EAAE;EAHe;AADO,CAAlB,CAAf;;AAQA,MAAMC,eAAe,GAAG,CAAC;EACvBC,oBADuB;EAEvBC,UAFuB;EAGvBC,mBAHuB;EAIvBC;AAJuB,CAAD,KAKN;EAChB,MAAMC,WAAW,GAA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CAACK,QAD3B;IAEE,WAAW,EAAEL,cAAc,CAACxD,KAF9B;IAGE,OAAO,EAAE4D,mBAHX;IAIE,MAAM,EAAG,yBAAwBzE,UAAW;EAJ9C,EAPF,EAaGD,oBAAoB,gBACnB,oBAAC,eAAD;IACE,oBAAoB,EAAEA,oBADxB;IAEE,UAAU,EAAEC,UAFd;IAGE,mBAAmB,EAAEC,mBAHvB;IAIE,sBAAsB,EAAEC,sBAJ1B;IAKE,GAAG,EAAC;EALN,EADmB,GAQjB,IArBN,CADF;AAyBD,CA9CD;;AAgDA,eAAekE,KAAf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/organism/review-stacked-slides/index.native.tsx"],"names":[],"mappings":";AAMA,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,cAAc,CAAC;AAEnD,eAAO,MAAM,kBAAkB,IAAI,CAAC;AAyBpC,QAAA,MAAM,aAAa,UAAW,gBAAgB,
|
|
1
|
+
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/organism/review-stacked-slides/index.native.tsx"],"names":[],"mappings":";AAMA,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,cAAc,CAAC;AAEnD,eAAO,MAAM,kBAAkB,IAAI,CAAC;AAyBpC,QAAA,MAAM,aAAa,UAAW,gBAAgB,gBA2G7C,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
|
-
import { Animated, StyleSheet, useWindowDimensions } from 'react-native';
|
|
2
|
+
import { Animated, Easing, StyleSheet, useWindowDimensions } from 'react-native';
|
|
3
3
|
import keys from 'lodash/fp/keys';
|
|
4
4
|
import { useTranslateY } from '@coorpacademy/react-native-animation';
|
|
5
5
|
import Slide from '../review-slide/index.native';
|
|
@@ -51,7 +51,8 @@ const StackedSlides = props => {
|
|
|
51
51
|
const translateDown = useTranslateY({
|
|
52
52
|
fromValue: 0,
|
|
53
53
|
toValue: windowHeight - 100,
|
|
54
|
-
duration:
|
|
54
|
+
duration: 500,
|
|
55
|
+
easing: Easing.cubic
|
|
55
56
|
});
|
|
56
57
|
useEffect(() => {
|
|
57
58
|
if (endReview) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":["React","useEffect","useState","Animated","StyleSheet","useWindowDimensions","keys","useTranslateY","Slide","TOTAL_SLIDES_STACK","style","create","slides","flex","height","width","FakeSlide","position","validateButton","loading","StackedSlides","props","windowHeight","endReview","correctionPopinProps","unstacked","setUnstacked","restacked","setRestacked","hideSlides","fromValue","toValue","duration","translateDown","start","restackingSlide","find","k","animationType","unstackingSlide","remainingKeys","filter","orderedKeys","sort","k1","k2","animatedSlide","includes","toString","unstacking","restacking","stackedSlides","map","slideIndex","index","slide","num","length","push","animatedStyle"],"sources":["../../../src/organism/review-stacked-slides/index.native.tsx"],"sourcesContent":["import React, {useEffect, useState} from 'react';\nimport {Animated, StyleSheet, useWindowDimensions} from 'react-native';\nimport keys from 'lodash/fp/keys';\nimport {useTranslateY} from '@coorpacademy/react-native-animation';\nimport Slide from '../review-slide/index.native';\nimport type {ReviewSlideProps} from '../review-slide/prop-types';\nimport type {ReviewStackProps} from './prop-types';\n\nexport const TOTAL_SLIDES_STACK = 5;\n\nconst style = StyleSheet.create({\n slides: {\n flex: 1,\n height: '100%',\n width: '100%'\n }\n});\n\ntype FakeSlideProps = {position: number; validateButton: ReviewSlideProps['validateButton']};\nconst FakeSlide = ({position, validateButton}: FakeSlideProps) => (\n <Slide\n num={position}\n slide={{loading: true, position}}\n slideIndex={`${position}`}\n validateButton={validateButton}\n />\n);\n\n/*\n - slides are ordered to be played from left to right: [0,1,2,3]\n - slides are piled on the view, so we need to reverse the order:\n -> it's like our eye is looking from the right [3,2,1,0] <-- oO\n*/\nconst StackedSlides = (props: ReviewStackProps) => {\n const {height: windowHeight} = useWindowDimensions();\n const {endReview, slides, validateButton, correctionPopinProps} = props;\n const [unstacked, setUnstacked] = useState<string[]>([]);\n const [restacked, setRestacked] = useState<string | null>();\n\n const hideSlides = useTranslateY({\n fromValue: 0,\n toValue: windowHeight,\n duration: 800\n });\n\n const translateDown = useTranslateY({\n fromValue: 0,\n toValue: windowHeight - 100,\n duration:
|
|
1
|
+
{"version":3,"file":"index.native.js","names":["React","useEffect","useState","Animated","Easing","StyleSheet","useWindowDimensions","keys","useTranslateY","Slide","TOTAL_SLIDES_STACK","style","create","slides","flex","height","width","FakeSlide","position","validateButton","loading","StackedSlides","props","windowHeight","endReview","correctionPopinProps","unstacked","setUnstacked","restacked","setRestacked","hideSlides","fromValue","toValue","duration","translateDown","easing","cubic","start","restackingSlide","find","k","animationType","unstackingSlide","remainingKeys","filter","orderedKeys","sort","k1","k2","animatedSlide","includes","toString","unstacking","restacking","stackedSlides","map","slideIndex","index","slide","num","length","push","animatedStyle"],"sources":["../../../src/organism/review-stacked-slides/index.native.tsx"],"sourcesContent":["import React, {useEffect, useState} from 'react';\nimport {Animated, Easing, StyleSheet, useWindowDimensions} from 'react-native';\nimport keys from 'lodash/fp/keys';\nimport {useTranslateY} from '@coorpacademy/react-native-animation';\nimport Slide from '../review-slide/index.native';\nimport type {ReviewSlideProps} from '../review-slide/prop-types';\nimport type {ReviewStackProps} from './prop-types';\n\nexport const TOTAL_SLIDES_STACK = 5;\n\nconst style = StyleSheet.create({\n slides: {\n flex: 1,\n height: '100%',\n width: '100%'\n }\n});\n\ntype FakeSlideProps = {position: number; validateButton: ReviewSlideProps['validateButton']};\nconst FakeSlide = ({position, validateButton}: FakeSlideProps) => (\n <Slide\n num={position}\n slide={{loading: true, position}}\n slideIndex={`${position}`}\n validateButton={validateButton}\n />\n);\n\n/*\n - slides are ordered to be played from left to right: [0,1,2,3]\n - slides are piled on the view, so we need to reverse the order:\n -> it's like our eye is looking from the right [3,2,1,0] <-- oO\n*/\nconst StackedSlides = (props: ReviewStackProps) => {\n const {height: windowHeight} = useWindowDimensions();\n const {endReview, slides, validateButton, correctionPopinProps} = props;\n const [unstacked, setUnstacked] = useState<string[]>([]);\n const [restacked, setRestacked] = useState<string | null>();\n\n const hideSlides = useTranslateY({\n fromValue: 0,\n toValue: windowHeight,\n duration: 800\n });\n\n const translateDown = useTranslateY({\n fromValue: 0,\n toValue: windowHeight - 100,\n duration: 500,\n easing: Easing.cubic\n });\n\n useEffect(() => {\n if (endReview) {\n hideSlides.start();\n }\n }, [endReview, hideSlides]);\n\n const restackingSlide = keys(slides).find(k => slides[k].animationType === 'restack');\n const unstackingSlide = keys(slides).find(k => slides[k].animationType === 'unstack');\n\n const remainingKeys = keys(slides).filter(\n k => slides[k].position >= 0 && !slides[k].animationType\n );\n\n const orderedKeys = remainingKeys.sort((k1, k2) =>\n slides[k2].position > slides[k1].position ? 1 : -1\n );\n\n const animatedSlide = restackingSlide || unstackingSlide;\n\n useEffect(() => {\n if (restacked && orderedKeys.includes(restacked)) {\n setRestacked(null);\n }\n // this effect is required only when the list orderedKeys changes\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [orderedKeys.toString()]);\n\n useEffect(() => {\n const unstacking = unstackingSlide && !unstacked.includes(unstackingSlide);\n\n if (unstacking) {\n translateDown.start(() => {\n setUnstacked([...unstacked, unstackingSlide]);\n });\n }\n }, [unstackingSlide, unstacked, setUnstacked, translateDown]);\n\n useEffect(() => {\n const restacking = restackingSlide && restacked !== restackingSlide;\n\n if (restacking) {\n translateDown.start(() => {\n setRestacked(restackingSlide);\n });\n }\n }, [restackingSlide, restacked, setRestacked, translateDown]);\n\n const stackedSlides = orderedKeys.map((slideIndex, index) => {\n const slide = slides[slideIndex];\n\n return (\n <Slide\n {...{\n num: orderedKeys.length - index,\n slideIndex,\n slide,\n validateButton,\n correctionPopinProps\n }}\n key={slideIndex}\n />\n );\n });\n\n if (animatedSlide) {\n stackedSlides.push(\n <Slide\n {...{\n num: 0,\n slideIndex: animatedSlide,\n slide: slides[animatedSlide],\n validateButton,\n correctionPopinProps\n }}\n animatedStyle={[translateDown.animatedStyle]}\n key={animatedSlide}\n />\n );\n }\n\n return (\n <Animated.View style={[style.slides, hideSlides.animatedStyle]}>\n {restacked ? (\n <FakeSlide position={orderedKeys.length + 1} validateButton={validateButton} />\n ) : null}\n {stackedSlides}\n </Animated.View>\n );\n};\n\nexport default StackedSlides;\n"],"mappings":"AAAA,OAAOA,KAAP,IAAeC,SAAf,EAA0BC,QAA1B,QAAyC,OAAzC;AACA,SAAQC,QAAR,EAAkBC,MAAlB,EAA0BC,UAA1B,EAAsCC,mBAAtC,QAAgE,cAAhE;AACA,OAAOC,IAAP,MAAiB,gBAAjB;AACA,SAAQC,aAAR,QAA4B,sCAA5B;AACA,OAAOC,KAAP,MAAkB,8BAAlB;AAIA,OAAO,MAAMC,kBAAkB,GAAG,CAA3B;AAEP,MAAMC,KAAK,GAAGN,UAAU,CAACO,MAAX,CAAkB;EAC9BC,MAAM,EAAE;IACNC,IAAI,EAAE,CADA;IAENC,MAAM,EAAE,MAFF;IAGNC,KAAK,EAAE;EAHD;AADsB,CAAlB,CAAd;;AASA,MAAMC,SAAS,GAAG,CAAC;EAACC,QAAD;EAAWC;AAAX,CAAD,kBAChB,oBAAC,KAAD;EACE,GAAG,EAAED,QADP;EAEE,KAAK,EAAE;IAACE,OAAO,EAAE,IAAV;IAAgBF;EAAhB,CAFT;EAGE,UAAU,EAAG,GAAEA,QAAS,EAH1B;EAIE,cAAc,EAAEC;AAJlB,EADF;AASA;AACA;AACA;AACA;AACA;;;AACA,MAAME,aAAa,GAAIC,KAAD,IAA6B;EACjD,MAAM;IAACP,MAAM,EAAEQ;EAAT,IAAyBjB,mBAAmB,EAAlD;EACA,MAAM;IAACkB,SAAD;IAAYX,MAAZ;IAAoBM,cAApB;IAAoCM;EAApC,IAA4DH,KAAlE;EACA,MAAM,CAACI,SAAD,EAAYC,YAAZ,IAA4BzB,QAAQ,CAAW,EAAX,CAA1C;EACA,MAAM,CAAC0B,SAAD,EA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iBA,IAAIP,aAAJ,EAAmB;IACjBK,aAAa,CAACO,IAAd,eACE,oBAAC,KAAD;MAEIF,GAAG,EAAE,CAFT;MAGIH,UAAU,EAAEP,aAHhB;MAIIS,KAAK,EAAE7C,MAAM,CAACoC,aAAD,CAJjB;MAKI9B,cALJ;MAMIM,oBANJ;MAQE,aAAa,EAAE,CAACS,aAAa,CAAC4B,aAAf,CARjB;MASE,GAAG,EAAEb;IATP,EADF;EAaD;;EAED,oBACE,oBAAC,QAAD,CAAU,IAAV;IAAe,KAAK,EAAE,CAACtC,KAAK,CAACE,MAAP,EAAeiB,UAAU,CAACgC,aAA1B;EAAtB,GACGlC,SAAS,gBACR,oBAAC,SAAD;IAAW,QAAQ,EAAEiB,WAAW,CAACe,MAAZ,GAAqB,CAA1C;IAA6C,cAAc,EAAEzC;EAA7D,EADQ,GAEN,IAHN,EAIGmC,aAJH,CADF;AAQD,CA3GD;;AA6GA,eAAejC,aAAf"}
|
|
@@ -128,7 +128,7 @@ declare namespace WizardContents {
|
|
|
128
128
|
type: PropTypes.Requireable<string>;
|
|
129
129
|
size: PropTypes.Requireable<string>;
|
|
130
130
|
title: PropTypes.Requireable<string>;
|
|
131
|
-
|
|
131
|
+
moreAriaLabel: PropTypes.Requireable<string>;
|
|
132
132
|
name: PropTypes.Requireable<string>;
|
|
133
133
|
className: PropTypes.Requireable<string>;
|
|
134
134
|
borderClassName: PropTypes.Requireable<string>;
|
|
@@ -232,7 +232,7 @@ declare namespace WizardContents {
|
|
|
232
232
|
}> | PropTypes.InferProps<{
|
|
233
233
|
type: PropTypes.Requireable<string>;
|
|
234
234
|
title: PropTypes.Requireable<string>;
|
|
235
|
-
|
|
235
|
+
moreAriaLabel: PropTypes.Requireable<string>;
|
|
236
236
|
name: PropTypes.Requireable<string>;
|
|
237
237
|
className: PropTypes.Requireable<string>;
|
|
238
238
|
borderClassName: PropTypes.Requireable<string>;
|
|
@@ -213,7 +213,7 @@ declare namespace BrandUpdate {
|
|
|
213
213
|
type: PropTypes.Requireable<string>;
|
|
214
214
|
size: PropTypes.Requireable<string>;
|
|
215
215
|
title: PropTypes.Requireable<string>;
|
|
216
|
-
|
|
216
|
+
moreAriaLabel: PropTypes.Requireable<string>;
|
|
217
217
|
name: PropTypes.Requireable<string>;
|
|
218
218
|
className: PropTypes.Requireable<string>;
|
|
219
219
|
borderClassName: PropTypes.Requireable<string>;
|
|
@@ -317,7 +317,7 @@ declare namespace BrandUpdate {
|
|
|
317
317
|
}> | PropTypes.InferProps<{
|
|
318
318
|
type: PropTypes.Requireable<string>;
|
|
319
319
|
title: PropTypes.Requireable<string>;
|
|
320
|
-
|
|
320
|
+
moreAriaLabel: PropTypes.Requireable<string>;
|
|
321
321
|
name: PropTypes.Requireable<string>;
|
|
322
322
|
className: PropTypes.Requireable<string>;
|
|
323
323
|
borderClassName: PropTypes.Requireable<string>;
|
|
@@ -836,7 +836,7 @@ declare namespace BrandUpdate {
|
|
|
836
836
|
type: PropTypes.Requireable<string>;
|
|
837
837
|
size: PropTypes.Requireable<string>;
|
|
838
838
|
title: PropTypes.Requireable<string>;
|
|
839
|
-
|
|
839
|
+
moreAriaLabel: PropTypes.Requireable<string>;
|
|
840
840
|
name: PropTypes.Requireable<string>;
|
|
841
841
|
className: PropTypes.Requireable<string>;
|
|
842
842
|
borderClassName: PropTypes.Requireable<string>;
|
|
@@ -940,7 +940,7 @@ declare namespace BrandUpdate {
|
|
|
940
940
|
}> | PropTypes.InferProps<{
|
|
941
941
|
type: PropTypes.Requireable<string>;
|
|
942
942
|
title: PropTypes.Requireable<string>;
|
|
943
|
-
|
|
943
|
+
moreAriaLabel: PropTypes.Requireable<string>;
|
|
944
944
|
name: PropTypes.Requireable<string>;
|
|
945
945
|
className: PropTypes.Requireable<string>;
|
|
946
946
|
borderClassName: PropTypes.Requireable<string>;
|
|
@@ -40,7 +40,7 @@ declare namespace SearchPage {
|
|
|
40
40
|
}> | null | undefined)[]>;
|
|
41
41
|
sorting: PropTypes.Requireable<PropTypes.InferProps<{
|
|
42
42
|
title: PropTypes.Requireable<string>;
|
|
43
|
-
|
|
43
|
+
moreAriaLabel: PropTypes.Requireable<string>;
|
|
44
44
|
name: PropTypes.Requireable<string>;
|
|
45
45
|
className: PropTypes.Requireable<string>;
|
|
46
46
|
borderClassName: PropTypes.Requireable<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/atom/choice/index.native.tsx"],"names":[],"mappings":";AACA,OAAO,EAAmB,SAAS,EAAY,MAAM,cAAc,CAAC;AAIpE,OAAO,KAAK,EAAC,KAAK,EAAE,YAAY,EAAC,MAAM,gCAAgC,CAAC;AAMxE,oBAAY,KAAK,GAAG;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,YAAY,EAAE,YAAY,CAAC;CAC5B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/atom/choice/index.native.tsx"],"names":[],"mappings":";AACA,OAAO,EAAmB,SAAS,EAAY,MAAM,cAAc,CAAC;AAIpE,OAAO,KAAK,EAAC,KAAK,EAAE,YAAY,EAAC,MAAM,gCAAgC,CAAC;AAMxE,oBAAY,KAAK,GAAG;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,YAAY,EAAE,YAAY,CAAC;CAC5B,CAAC;AAqEF,QAAA,MAAM,MAAM,8GAUT,KAAK,uBAqFP,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -33,7 +33,7 @@ const createStyleSheet = (theme, squeezed) => _reactNative.StyleSheet.create({
|
|
|
33
33
|
height: 4
|
|
34
34
|
},
|
|
35
35
|
shadowOpacity: 0.12,
|
|
36
|
-
shadowRadius:
|
|
36
|
+
shadowRadius: 8,
|
|
37
37
|
elevation: 8,
|
|
38
38
|
backgroundColor: '#0000'
|
|
39
39
|
},
|
|
@@ -41,7 +41,8 @@ const createStyleSheet = (theme, squeezed) => _reactNative.StyleSheet.create({
|
|
|
41
41
|
backgroundColor: theme.colors.white,
|
|
42
42
|
borderRadius: theme.radius.regular,
|
|
43
43
|
flexDirection: 'row',
|
|
44
|
-
alignItems: 'stretch'
|
|
44
|
+
alignItems: 'stretch',
|
|
45
|
+
minHeight: 60
|
|
45
46
|
},
|
|
46
47
|
textContainer: {
|
|
47
48
|
paddingHorizontal: 24,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":["createStyleSheet","theme","squeezed","StyleSheet","create","boxShadow","shadowColor","shadowOffset","width","height","shadowOpacity","shadowRadius","elevation","backgroundColor","container","colors","white","borderRadius","radius","regular","flexDirection","alignItems","textContainer","paddingHorizontal","paddingVertical","justifyContent","flex","squeezedTextContainer","padding","spacing","small","paddingLeft","undefined","paddingRight","text","fontSize","medium","fontWeight","bold","color","black","textAlign","textSelected","unselectedImageContainer","borderRightColor","border","imageContainer","overflow","borderTopLeftRadius","borderBottomLeftRadius","image","Choice","children","isSelected","isDisabled","onPress","media","testID","prefixTestID","style","questionType","templateContext","useTemplateContext","brandTheme","styleSheet","setStylesheet","useState","useEffect","_stylesheet","selectedSuffix","mediaType","type","toLowerCase","url","src","length","getCleanUri","source","uri","mediaSuffix","textStyle","textWrapperStyle","push","selectionStyle","primary","borderColor","borderTopRightRadius","borderBottomRightRadius"],"sources":["../../../src/atom/choice/index.native.tsx"],"sourcesContent":["import React, {useEffect, useState} from 'react';\nimport {View, StyleSheet, ViewStyle, TextStyle} from 'react-native';\n\nimport Html from '../html/index.native';\nimport ImageBackground from '../image-background/index.native';\nimport type {Media, QuestionType} from '../../molecule/questions/types';\nimport getCleanUri from '../../util/get-clean-uri';\nimport Touchable from '../../hoc/touchable/index.native';\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport {Theme} from '../../variables/theme.native';\n\nexport type Props = {\n isSelected?: boolean;\n onPress: () => void;\n children?: string;\n isDisabled?: boolean;\n testID?: string;\n media?: Media;\n squeezed?: boolean;\n style?: ViewStyle;\n questionType: QuestionType;\n};\n\ntype StyleSheetType = {\n boxShadow: ViewStyle;\n container: ViewStyle;\n text: TextStyle;\n textSelected: TextStyle;\n textContainer: ViewStyle;\n squeezedTextContainer: ViewStyle;\n unselectedImageContainer: ViewStyle;\n imageContainer: ViewStyle;\n image: ViewStyle;\n};\n\nconst createStyleSheet = (theme: Theme, squeezed: boolean): StyleSheetType =>\n StyleSheet.create({\n boxShadow: {\n shadowColor: '#000',\n shadowOffset: {width: 0, height: 4},\n shadowOpacity: 0.12,\n shadowRadius: 16,\n elevation: 8,\n backgroundColor: '#0000'\n },\n container: {\n backgroundColor: theme.colors.white,\n borderRadius: theme.radius.regular,\n flexDirection: 'row',\n alignItems: 'stretch'\n },\n textContainer: {\n paddingHorizontal: 24,\n paddingVertical: 12,\n justifyContent: 'center',\n alignItems: 'center',\n flex: 1\n },\n squeezedTextContainer: {\n padding: theme.spacing.small,\n paddingLeft: undefined,\n paddingVertical: undefined,\n paddingRight: undefined,\n flex: 0\n },\n text: {\n fontSize: squeezed ? theme.fontSize.medium : theme.fontSize.regular,\n fontWeight: theme.fontWeight.bold,\n color: theme.colors.black,\n textAlign: 'center'\n },\n textSelected: {\n color: theme.colors.white\n },\n unselectedImageContainer: {\n borderRightColor: theme.colors.border\n },\n imageContainer: {\n height: '100%',\n width: '25%',\n overflow: 'hidden',\n borderTopLeftRadius: theme.radius.regular,\n borderBottomLeftRadius: theme.radius.regular\n },\n image: {\n flex: 1\n }\n });\n\nconst Choice = ({\n children,\n isSelected = false,\n squeezed = false,\n isDisabled,\n onPress,\n media,\n testID: prefixTestID,\n style,\n questionType\n}: Props) => {\n const templateContext = useTemplateContext();\n const {theme, brandTheme} = templateContext;\n\n const [styleSheet, setStylesheet] = useState<StyleSheetType | null>(null);\n\n useEffect(() => {\n const _stylesheet = createStyleSheet(theme, squeezed);\n setStylesheet(_stylesheet);\n }, [theme, squeezed]);\n\n if (!styleSheet) {\n return null;\n }\n\n const selectedSuffix = prefixTestID && isSelected ? '-selected' : '';\n const mediaType = media && media.type && media.type === 'img' && media.type.toLowerCase();\n const url =\n media &&\n media.type === 'img' &&\n media.src &&\n media.src.length > 0 &&\n getCleanUri(media.src[0].url);\n\n const source = {uri: url ? getCleanUri(url) : undefined};\n const mediaSuffix = prefixTestID && mediaType ? `-${mediaType}` : '';\n\n const textStyle: TextStyle[] = [styleSheet.text];\n const textWrapperStyle: ViewStyle[] = [styleSheet.textContainer];\n\n if (squeezed) {\n textWrapperStyle.push(styleSheet.squeezedTextContainer);\n }\n\n if (isSelected) {\n textStyle.push(styleSheet.textSelected);\n\n // eslint-disable-next-line @coorpacademy/coorpacademy/no-overwriting-spread\n const selectionStyle = brandTheme && {\n backgroundColor: brandTheme.colors?.primary,\n borderColor: brandTheme.colors?.primary,\n ...(url\n ? {\n borderTopRightRadius: theme.radius.regular,\n borderBottomRightRadius: theme.radius.regular\n }\n : {\n borderRadius: theme.radius.regular\n })\n };\n\n if (selectionStyle) {\n textWrapperStyle.push(selectionStyle);\n }\n }\n\n return (\n <Touchable\n onPress={!isDisabled ? onPress : undefined}\n style={style}\n analyticsID=\"question-choice\"\n analyticsParams={{questionType}}\n >\n <View\n style={[styleSheet.boxShadow, styleSheet.container]}\n testID={prefixTestID && `${prefixTestID}${selectedSuffix}`}\n >\n {url ? (\n <View style={styleSheet.imageContainer}>\n <ImageBackground\n testID={prefixTestID && `${prefixTestID}${mediaSuffix}`}\n source={source}\n style={styleSheet.image}\n />\n </View>\n ) : null}\n\n {children ? (\n <View style={textWrapperStyle}>\n <Html style={textStyle}>{children}</Html>\n </View>\n ) : null}\n </View>\n </Touchable>\n );\n};\n\nexport default Choice;\n"],"mappings":";;;;;AAAA;;AACA;;AAEA;;AACA;;AAEA;;AACA;;AACA;;;;;;;;;;AA2BA,MAAMA,gBAAgB,GAAG,CAACC,KAAD,EAAeC,QAAf,KACvBC,uBAAA,CAAWC,MAAX,CAAkB;EAChBC,SAAS,EAAE;IACTC,WAAW,EAAE,MADJ;IAETC,YAAY,EAAE;MAACC,KAAK,EAAE,CAAR;MAAWC,MAAM,EAAE;IAAnB,CAFL;IAGTC,aAAa,EAAE,IAHN;IAITC,YAAY,EAAE,EAJL;IAKTC,SAAS,EAAE,CALF;IAMTC,eAAe,EAAE;EANR,CADK;EAShBC,SAAS,EAAE;IACTD,eAAe,EAAEZ,KAAK,CAACc,MAAN,CAAaC,KADrB;IAETC,YAAY,EAAEhB,KAAK,CAACiB,MAAN,CAAaC,OAFlB;IAGTC,aAAa,EAAE,KAHN;IAITC,UAAU,EAAE;EAJH,CATK;EAehBC,aAAa,EAAE;IACbC,iBAAiB,EAAE,EADN;IAEbC,eAAe,EAAE,EAFJ;IAGbC,cAAc,EAAE,QAHH;IAIbJ,UAAU,EAAE,QAJC;IAKbK,IAAI,EAAE;EALO,CAfC;EAsBhBC,qBAAqB,EAAE;IACrBC,OAAO,EAAE3B,KAAK,CAAC4B,OAAN,CAAcC,KADF;IAErBC,WAAW,EAAEC,SAFQ;IAGrBR,eAAe,EAAEQ,SAHI;IAIrBC,YAAY,EAAED,SAJO;IAKrBN,IAAI,EAAE;EALe,CAtBP;EA6BhBQ,IAAI,EAAE;IACJC,QAAQ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AAErF,KAAK,CAACiB,MAAN,CAAaC,OADrC;MAEEoE,uBAAuB,EAAEtF,KAAK,CAACiB,MAAN,CAAaC;IAFxC,CADG,GAKH;MACEF,YAAY,EAAEhB,KAAK,CAACiB,MAAN,CAAaC;IAD7B,CAR2B,CAAjC;;IAaA,IAAIgE,cAAJ,EAAoB;MAClBF,gBAAgB,CAACC,IAAjB,CAAsBC,cAAtB;IACD;EACF;;EAED,oBACE,6BAAC,eAAD;IACE,OAAO,EAAE,CAAC7B,UAAD,GAAcC,OAAd,GAAwBvB,SADnC;IAEE,KAAK,EAAE2B,KAFT;IAGE,WAAW,EAAC,iBAHd;IAIE,eAAe,EAAE;MAACC;IAAD;EAJnB,gBAME,6BAAC,iBAAD;IACE,KAAK,EAAE,CAACI,UAAU,CAAC3D,SAAZ,EAAuB2D,UAAU,CAAClD,SAAlC,CADT;IAEE,MAAM,EAAE4C,YAAY,IAAK,GAAEA,YAAa,GAAEW,cAAe;EAF3D,GAIGI,GAAG,gBACF,6BAAC,iBAAD;IAAM,KAAK,EAAET,UAAU,CAAClB;EAAxB,gBACE,6BAAC,eAAD;IACE,MAAM,EAAEY,YAAY,IAAK,GAAEA,YAAa,GAAEqB,WAAY,EADxD;IAEE,MAAM,EAAEF,MAFV;IAGE,KAAK,EAAEb,UAAU,CAACd;EAHpB,EADF,CADE,GAQA,IAZN,EAcGE,QAAQ,gBACP,6BAAC,iBAAD;IAAM,KAAK,EAAE6B;EAAb,gBACE,6BAAC,cAAD;IAAM,KAAK,EAAED;EAAb,GAAyB5B,QAAzB,CADF,CADO,GAIL,IAlBN,CANF,CADF;AA6BD,CA/FD;;eAiGeD,M"}
|
|
1
|
+
{"version":3,"file":"index.native.js","names":["createStyleSheet","theme","squeezed","StyleSheet","create","boxShadow","shadowColor","shadowOffset","width","height","shadowOpacity","shadowRadius","elevation","backgroundColor","container","colors","white","borderRadius","radius","regular","flexDirection","alignItems","minHeight","textContainer","paddingHorizontal","paddingVertical","justifyContent","flex","squeezedTextContainer","padding","spacing","small","paddingLeft","undefined","paddingRight","text","fontSize","medium","fontWeight","bold","color","black","textAlign","textSelected","unselectedImageContainer","borderRightColor","border","imageContainer","overflow","borderTopLeftRadius","borderBottomLeftRadius","image","Choice","children","isSelected","isDisabled","onPress","media","testID","prefixTestID","style","questionType","templateContext","useTemplateContext","brandTheme","styleSheet","setStylesheet","useState","useEffect","_stylesheet","selectedSuffix","mediaType","type","toLowerCase","url","src","length","getCleanUri","source","uri","mediaSuffix","textStyle","textWrapperStyle","push","selectionStyle","primary","borderColor","borderTopRightRadius","borderBottomRightRadius"],"sources":["../../../src/atom/choice/index.native.tsx"],"sourcesContent":["import React, {useEffect, useState} from 'react';\nimport {View, StyleSheet, ViewStyle, TextStyle} from 'react-native';\n\nimport Html from '../html/index.native';\nimport ImageBackground from '../image-background/index.native';\nimport type {Media, QuestionType} from '../../molecule/questions/types';\nimport getCleanUri from '../../util/get-clean-uri';\nimport Touchable from '../../hoc/touchable/index.native';\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport {Theme} from '../../variables/theme.native';\n\nexport type Props = {\n isSelected?: boolean;\n onPress: () => void;\n children?: string;\n isDisabled?: boolean;\n testID?: string;\n media?: Media;\n squeezed?: boolean;\n style?: ViewStyle;\n questionType: QuestionType;\n};\n\ntype StyleSheetType = {\n boxShadow: ViewStyle;\n container: ViewStyle;\n text: TextStyle;\n textSelected: TextStyle;\n textContainer: ViewStyle;\n squeezedTextContainer: ViewStyle;\n unselectedImageContainer: ViewStyle;\n imageContainer: ViewStyle;\n image: ViewStyle;\n};\n\nconst createStyleSheet = (theme: Theme, squeezed: boolean): StyleSheetType =>\n StyleSheet.create({\n boxShadow: {\n shadowColor: '#000',\n shadowOffset: {width: 0, height: 4},\n shadowOpacity: 0.12,\n shadowRadius: 8,\n elevation: 8,\n backgroundColor: '#0000'\n },\n container: {\n backgroundColor: theme.colors.white,\n borderRadius: theme.radius.regular,\n flexDirection: 'row',\n alignItems: 'stretch',\n minHeight: 60\n },\n textContainer: {\n paddingHorizontal: 24,\n paddingVertical: 12,\n justifyContent: 'center',\n alignItems: 'center',\n flex: 1\n },\n squeezedTextContainer: {\n padding: theme.spacing.small,\n paddingLeft: undefined,\n paddingVertical: undefined,\n paddingRight: undefined,\n flex: 0\n },\n text: {\n fontSize: squeezed ? theme.fontSize.medium : theme.fontSize.regular,\n fontWeight: theme.fontWeight.bold,\n color: theme.colors.black,\n textAlign: 'center'\n },\n textSelected: {\n color: theme.colors.white\n },\n unselectedImageContainer: {\n borderRightColor: theme.colors.border\n },\n imageContainer: {\n height: '100%',\n width: '25%',\n overflow: 'hidden',\n borderTopLeftRadius: theme.radius.regular,\n borderBottomLeftRadius: theme.radius.regular\n },\n image: {\n flex: 1\n }\n });\n\nconst Choice = ({\n children,\n isSelected = false,\n squeezed = false,\n isDisabled,\n onPress,\n media,\n testID: prefixTestID,\n style,\n questionType\n}: Props) => {\n const templateContext = useTemplateContext();\n const {theme, brandTheme} = templateContext;\n\n const [styleSheet, setStylesheet] = useState<StyleSheetType | null>(null);\n\n useEffect(() => {\n const _stylesheet = createStyleSheet(theme, squeezed);\n setStylesheet(_stylesheet);\n }, [theme, squeezed]);\n\n if (!styleSheet) {\n return null;\n }\n\n const selectedSuffix = prefixTestID && isSelected ? '-selected' : '';\n const mediaType = media && media.type && media.type === 'img' && media.type.toLowerCase();\n const url =\n media &&\n media.type === 'img' &&\n media.src &&\n media.src.length > 0 &&\n getCleanUri(media.src[0].url);\n\n const source = {uri: url ? getCleanUri(url) : undefined};\n const mediaSuffix = prefixTestID && mediaType ? `-${mediaType}` : '';\n\n const textStyle: TextStyle[] = [styleSheet.text];\n const textWrapperStyle: ViewStyle[] = [styleSheet.textContainer];\n\n if (squeezed) {\n textWrapperStyle.push(styleSheet.squeezedTextContainer);\n }\n\n if (isSelected) {\n textStyle.push(styleSheet.textSelected);\n\n // eslint-disable-next-line @coorpacademy/coorpacademy/no-overwriting-spread\n const selectionStyle = brandTheme && {\n backgroundColor: brandTheme.colors?.primary,\n borderColor: brandTheme.colors?.primary,\n ...(url\n ? {\n borderTopRightRadius: theme.radius.regular,\n borderBottomRightRadius: theme.radius.regular\n }\n : {\n borderRadius: theme.radius.regular\n })\n };\n\n if (selectionStyle) {\n textWrapperStyle.push(selectionStyle);\n }\n }\n\n return (\n <Touchable\n onPress={!isDisabled ? onPress : undefined}\n style={style}\n analyticsID=\"question-choice\"\n analyticsParams={{questionType}}\n >\n <View\n style={[styleSheet.boxShadow, styleSheet.container]}\n testID={prefixTestID && `${prefixTestID}${selectedSuffix}`}\n >\n {url ? (\n <View style={styleSheet.imageContainer}>\n <ImageBackground\n testID={prefixTestID && `${prefixTestID}${mediaSuffix}`}\n source={source}\n style={styleSheet.image}\n />\n </View>\n ) : null}\n\n {children ? (\n <View style={textWrapperStyle}>\n <Html style={textStyle}>{children}</Html>\n </View>\n ) : null}\n </View>\n </Touchable>\n );\n};\n\nexport default Choice;\n"],"mappings":";;;;;AAAA;;AACA;;AAEA;;AACA;;AAEA;;AACA;;AACA;;;;;;;;;;AA2BA,MAAMA,gBAAgB,GAAG,CAACC,KAAD,EAAeC,QAAf,KACvBC,uBAAA,CAAWC,MAAX,CAAkB;EAChBC,SAAS,EAAE;IACTC,WAAW,EAAE,MADJ;IAETC,YAAY,EAAE;MAACC,KAAK,EAAE,CAAR;MAAWC,MAAM,EAAE;IAAnB,CAFL;IAGTC,aAAa,EAAE,IAHN;IAITC,YAAY,EAAE,CAJL;IAKTC,SAAS,EAAE,CALF;IAMTC,eAAe,EAAE;EANR,CADK;EAShBC,SAAS,EAAE;IACTD,eAAe,EAAEZ,KAAK,CAACc,MAAN,CAAaC,KADrB;IAETC,YAAY,EAAEhB,KAAK,CAACiB,MAAN,CAAaC,OAFlB;IAGTC,aAAa,EAAE,KAHN;IAITC,UAAU,EAAE,SAJH;IAKTC,SAAS,EAAE;EALF,CATK;EAgBhBC,aAAa,EAAE;IACbC,iBAAiB,EAAE,EADN;IAEbC,eAAe,EAAE,EAF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AD;IAAM,KAAK,EAAED;EAAb,GAAyB5B,QAAzB,CADF,CADO,GAIL,IAlBN,CANF,CADF;AA6BD,CA/FD;;eAiGeD,M"}
|
|
@@ -33,7 +33,7 @@ declare namespace Select {
|
|
|
33
33
|
}
|
|
34
34
|
namespace propTypes {
|
|
35
35
|
export const title: PropTypes.Requireable<string>;
|
|
36
|
-
export const
|
|
36
|
+
export const moreAriaLabel: PropTypes.Requireable<string>;
|
|
37
37
|
const name_1: PropTypes.Requireable<string>;
|
|
38
38
|
export { name_1 as name };
|
|
39
39
|
export const className: PropTypes.Requireable<string>;
|
package/lib/atom/select/index.js
CHANGED
|
@@ -69,7 +69,7 @@ const Select = (props, legacyContext) => {
|
|
|
69
69
|
modified = false,
|
|
70
70
|
error = false,
|
|
71
71
|
title: propTitle,
|
|
72
|
-
|
|
72
|
+
moreAriaLabel
|
|
73
73
|
} = props;
|
|
74
74
|
const skin = (0, _provider.GetSkinFromContext)(legacyContext);
|
|
75
75
|
const title = (0, _react.useMemo)(() => propTitle ? `${propTitle}${required ? '*' : ''}` : null, [propTitle, required]);
|
|
@@ -109,7 +109,7 @@ const Select = (props, legacyContext) => {
|
|
|
109
109
|
const arrowView = !multiple ? /*#__PURE__*/_react.default.createElement(_novaIcons.NovaCompositionNavigationArrowDown, {
|
|
110
110
|
color: (0, _includes.default)(theme, ['question', 'template', 'player']) ? arrowColor : black,
|
|
111
111
|
className: shouldUseSkinFontColor ? _style.default.selectedArrow : _style.default.arrow,
|
|
112
|
-
"aria-label":
|
|
112
|
+
"aria-label": moreAriaLabel
|
|
113
113
|
}) : null;
|
|
114
114
|
const behaviourClassName = (0, _react.useMemo)(() => (0, _getClassState.default)(_style.default.default, _style.default.modified, _style.default.error, modified, error), [error, modified]);
|
|
115
115
|
const composedClassName = (0, _react.useMemo)(() => (0, _classnames.default)(theme && theme !== 'coorpmanager' ? themeStyle[theme] : behaviourClassName, selected ? _style.default.selected : _style.default.unselected, className), [behaviourClassName, className, selected, theme]);
|
|
@@ -155,7 +155,7 @@ Select.contextTypes = {
|
|
|
155
155
|
};
|
|
156
156
|
Select.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
157
157
|
title: _propTypes.default.string,
|
|
158
|
-
|
|
158
|
+
moreAriaLabel: _propTypes.default.string,
|
|
159
159
|
name: _propTypes.default.string,
|
|
160
160
|
className: _propTypes.default.string,
|
|
161
161
|
borderClassName: _propTypes.default.string,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["themeStyle","filter","style","invalid","header","mooc","question","sort","thematiques","player","template","coorpmanager","Select","props","legacyContext","name","options","className","borderClassName","onChange","multiple","disabled","required","description","theme","modified","error","title","propTitle","moreLabel","skin","GetSkinFromContext","useMemo","optionList","map","option","index","value","selectOption","titleView","selected","get","find","selectedLabel","isSelectedInValidOption","getOr","validOption","handleChange","e","target","selectedOptions","black","color","shouldUseSkinFontColor","includes","arrowColor","undefined","arrowView","selectedArrow","arrow","behaviourClassName","getClassState","default","composedClassName","classnames","unselected","labelSize","size","isLongLabel","selectWrapper","selectSpan","noLabelCommon","longLabel","selectBox","SelectOptionPropTypes","PropTypes","string","isRequired","oneOfType","number","bool","contextTypes","Provider","childContextTypes","propTypes","func","oneOf","keys","arrayOf","shape"],"sources":["../../../src/atom/select/index.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport filter from 'lodash/fp/filter';\nimport find from 'lodash/fp/find';\nimport get from 'lodash/fp/get';\nimport getOr from 'lodash/fp/getOr';\nimport includes from 'lodash/fp/includes';\nimport keys from 'lodash/fp/keys';\nimport map from 'lodash/fp/map';\nimport size from 'lodash/fp/size';\nimport {NovaCompositionNavigationArrowDown as ArrowDown} from '@coorpacademy/nova-icons';\nimport Provider, {GetSkinFromContext} from '../provider';\nimport getClassState from '../../util/get-class-state';\nimport style from './style.css';\n\nconst themeStyle = {\n filter: style.filter,\n invalid: style.invalid,\n header: style.header,\n mooc: style.mooc,\n question: style.question,\n sort: style.sort,\n thematiques: style.thematiques,\n player: style.player,\n template: style.template,\n coorpmanager: null\n};\n\nconst Select = (props, legacyContext) => {\n const {\n name,\n options = [],\n className,\n borderClassName,\n onChange,\n multiple = false,\n disabled,\n required,\n description,\n theme,\n modified = false,\n error = false,\n title: propTitle,\n moreLabel\n } = props;\n\n const skin = GetSkinFromContext(legacyContext);\n const title = useMemo(\n () => (propTitle ? `${propTitle}${required ? '*' : ''}` : null),\n [propTitle, required]\n );\n\n const optionList =\n options &&\n options.map((option, index) => {\n return (\n <option key={index} value={option.value} className={style.selectOption}>\n {option.name}\n </option>\n );\n });\n\n const titleView = title ? <span className={style.title}>{title} </span> : null;\n\n const selected = useMemo(\n () =>\n multiple\n ? map(get('value'), filter({selected: true}, options))\n : get('value', find({selected: true}, options)),\n [multiple, options]\n );\n const selectedLabel = useMemo(\n () =>\n multiple\n ? map(get('name'), filter({selected: true}, options))\n : get('name', find({selected: true}, options)),\n [multiple, options]\n );\n\n const isSelectedInValidOption = useMemo(\n () =>\n theme === 'player' &&\n getOr(false, 'name', find({validOption: false, selected: true}, options)),\n [options, theme]\n );\n\n const handleChange = useMemo(\n () =>\n multiple\n ? e => {\n onChange(map(get('value'), e.target.selectedOptions));\n }\n : e => {\n onChange(e.target.value);\n },\n [onChange, multiple]\n );\n\n const black = useMemo(() => getOr('#14171A', 'common.black', skin), [skin]);\n const color = useMemo(() => getOr('#00B0FF', 'common.primary', skin), [skin]);\n const shouldUseSkinFontColor = useMemo(\n () =>\n !isSelectedInValidOption && selected && includes(theme, ['question', 'template', 'player']),\n [isSelectedInValidOption, selected, theme]\n );\n const arrowColor = selected ? color : undefined;\n\n const arrowView = !multiple ? (\n <ArrowDown\n color={includes(theme, ['question', 'template', 'player']) ? arrowColor : black}\n className={shouldUseSkinFontColor ? style.selectedArrow : style.arrow}\n aria-label={moreLabel}\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 && theme !== 'coorpmanager' ? 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\n className={classnames(\n composedClassName,\n theme === 'coorpmanager' ? style.coorpmanager : null\n )}\n >\n <label\n data-name=\"select-wrapper\"\n style={{\n ...(shouldUseSkinFontColor && {\n color\n })\n }}\n className={style.selectWrapper}\n >\n {titleView}\n <span\n data-name=\"select-span\"\n className={classnames(\n style.selectSpan,\n includes(theme, ['player', 'invalid', 'question', 'thematiques', 'template'])\n ? style.noLabelCommon\n : null,\n borderClassName,\n isLongLabel ? style.longLabel : null\n )}\n style={{\n ...(shouldUseSkinFontColor && {\n color\n })\n }}\n >\n {selectedLabel}\n </span>\n {arrowView}\n <select\n data-name=\"native-select\"\n className={style.selectBox}\n title={selectedLabel}\n name={name}\n onChange={handleChange}\n value={selected}\n multiple={multiple}\n disabled={disabled}\n >\n {optionList}\n </select>\n </label>\n <div className={style.description}>{description}</div>\n </div>\n );\n};\n\nexport const SelectOptionPropTypes = {\n name: PropTypes.string.isRequired,\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n selected: PropTypes.bool,\n validOption: PropTypes.bool\n};\n\nSelect.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nSelect.propTypes = {\n title: PropTypes.string,\n moreLabel: 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"],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,MAFJ;EAGjB7D,IAAI,EAAE4D,kBAAA,CAAUC,MAHC;EAIjB3D,SAAS,EAAE0D,kBAAA,CAAUC,MAJJ;EAKjB1D,eAAe,EAAEyD,kBAAA,CAAUC,MALV;EAMjBvD,QAAQ,EAAEsD,kBAAA,CAAUK,IANH;EAOjB5D,QAAQ,EAAEuD,kBAAA,CAAUK,IAPH;EAQjBzD,WAAW,EAAEoD,kBAAA,CAAUC,MARN;EASjBtD,QAAQ,EAAEqD,kBAAA,CAAUK,IATH;EAUjB7D,QAAQ,EAAEwD,kBAAA,CAAUU,IAVH;EAWjB7D,KAAK,EAAEmD,kBAAA,CAAUW,KAAV,CAAgB,IAAAC,aAAA,EAAKvF,UAAL,CAAhB,CAXU;EAYjBgB,OAAO,EAAE2D,kBAAA,CAAUa,OAAV,CAAkBb,kBAAA,CAAUc,KAAV,CAAgBf,qBAAhB,CAAlB,CAZQ;EAajBjD,QAAQ,EAAEkD,kBAAA,CAAUK,IAbH;EAcjBtD,KAAK,EAAEiD,kBAAA,CAAUK;AAdA,CAAnB;eAiBepE,M"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["themeStyle","filter","style","invalid","header","mooc","question","sort","thematiques","player","template","coorpmanager","Select","props","legacyContext","name","options","className","borderClassName","onChange","multiple","disabled","required","description","theme","modified","error","title","propTitle","moreAriaLabel","skin","GetSkinFromContext","useMemo","optionList","map","option","index","value","selectOption","titleView","selected","get","find","selectedLabel","isSelectedInValidOption","getOr","validOption","handleChange","e","target","selectedOptions","black","color","shouldUseSkinFontColor","includes","arrowColor","undefined","arrowView","selectedArrow","arrow","behaviourClassName","getClassState","default","composedClassName","classnames","unselected","labelSize","size","isLongLabel","selectWrapper","selectSpan","noLabelCommon","longLabel","selectBox","SelectOptionPropTypes","PropTypes","string","isRequired","oneOfType","number","bool","contextTypes","Provider","childContextTypes","propTypes","func","oneOf","keys","arrayOf","shape"],"sources":["../../../src/atom/select/index.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport filter from 'lodash/fp/filter';\nimport find from 'lodash/fp/find';\nimport get from 'lodash/fp/get';\nimport getOr from 'lodash/fp/getOr';\nimport includes from 'lodash/fp/includes';\nimport keys from 'lodash/fp/keys';\nimport map from 'lodash/fp/map';\nimport size from 'lodash/fp/size';\nimport {NovaCompositionNavigationArrowDown as ArrowDown} from '@coorpacademy/nova-icons';\nimport Provider, {GetSkinFromContext} from '../provider';\nimport getClassState from '../../util/get-class-state';\nimport style from './style.css';\n\nconst themeStyle = {\n filter: style.filter,\n invalid: style.invalid,\n header: style.header,\n mooc: style.mooc,\n question: style.question,\n sort: style.sort,\n thematiques: style.thematiques,\n player: style.player,\n template: style.template,\n coorpmanager: null\n};\n\nconst Select = (props, legacyContext) => {\n const {\n name,\n options = [],\n className,\n borderClassName,\n onChange,\n multiple = false,\n disabled,\n required,\n description,\n theme,\n modified = false,\n error = false,\n title: propTitle,\n moreAriaLabel\n } = props;\n\n const skin = GetSkinFromContext(legacyContext);\n const title = useMemo(\n () => (propTitle ? `${propTitle}${required ? '*' : ''}` : null),\n [propTitle, required]\n );\n\n const optionList =\n options &&\n options.map((option, index) => {\n return (\n <option key={index} value={option.value} className={style.selectOption}>\n {option.name}\n </option>\n );\n });\n\n const titleView = title ? <span className={style.title}>{title} </span> : null;\n\n const selected = useMemo(\n () =>\n multiple\n ? map(get('value'), filter({selected: true}, options))\n : get('value', find({selected: true}, options)),\n [multiple, options]\n );\n const selectedLabel = useMemo(\n () =>\n multiple\n ? map(get('name'), filter({selected: true}, options))\n : get('name', find({selected: true}, options)),\n [multiple, options]\n );\n\n const isSelectedInValidOption = useMemo(\n () =>\n theme === 'player' &&\n getOr(false, 'name', find({validOption: false, selected: true}, options)),\n [options, theme]\n );\n\n const handleChange = useMemo(\n () =>\n multiple\n ? e => {\n onChange(map(get('value'), e.target.selectedOptions));\n }\n : e => {\n onChange(e.target.value);\n },\n [onChange, multiple]\n );\n\n const black = useMemo(() => getOr('#14171A', 'common.black', skin), [skin]);\n const color = useMemo(() => getOr('#00B0FF', 'common.primary', skin), [skin]);\n const shouldUseSkinFontColor = useMemo(\n () =>\n !isSelectedInValidOption && selected && includes(theme, ['question', 'template', 'player']),\n [isSelectedInValidOption, selected, theme]\n );\n const arrowColor = selected ? color : undefined;\n\n const arrowView = !multiple ? (\n <ArrowDown\n color={includes(theme, ['question', 'template', 'player']) ? arrowColor : black}\n className={shouldUseSkinFontColor ? style.selectedArrow : style.arrow}\n aria-label={moreAriaLabel}\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 && theme !== 'coorpmanager' ? 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\n className={classnames(\n composedClassName,\n theme === 'coorpmanager' ? style.coorpmanager : null\n )}\n >\n <label\n data-name=\"select-wrapper\"\n style={{\n ...(shouldUseSkinFontColor && {\n color\n })\n }}\n className={style.selectWrapper}\n >\n {titleView}\n <span\n data-name=\"select-span\"\n className={classnames(\n style.selectSpan,\n includes(theme, ['player', 'invalid', 'question', 'thematiques', 'template'])\n ? style.noLabelCommon\n : null,\n borderClassName,\n isLongLabel ? style.longLabel : null\n )}\n style={{\n ...(shouldUseSkinFontColor && {\n color\n })\n }}\n >\n {selectedLabel}\n </span>\n {arrowView}\n <select\n data-name=\"native-select\"\n className={style.selectBox}\n title={selectedLabel}\n name={name}\n onChange={handleChange}\n value={selected}\n multiple={multiple}\n disabled={disabled}\n >\n {optionList}\n </select>\n </label>\n <div className={style.description}>{description}</div>\n </div>\n );\n};\n\nexport const SelectOptionPropTypes = {\n name: PropTypes.string.isRequired,\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n selected: PropTypes.bool,\n validOption: PropTypes.bool\n};\n\nSelect.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nSelect.propTypes = {\n title: PropTypes.string,\n moreAriaLabel: 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"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,UAAU,GAAG;EACjBC,MAAM,EAAEC,cAAA,CAAMD,MADG;EAEjBE,OAAO,EAAED,cAAA,CAAMC,OAFE;EAGjBC,MAAM,EAAEF,cAAA,CAAME,MAHG;EAIjBC,IAAI,EAAEH,cAAA,CAAMG,IAJK;EAKjBC,QAAQ,EAAEJ,cAAA,CAAMI,QALC;EAMjBC,IAAI,EAAEL,cAAA,CAAMK,IANK;EAOjBC,WAAW,EAAEN,cAAA,CAAMM,WAPF;EAQjBC,MAAM,EAAEP,cAAA,CAAMO,MARG;EASjBC,QAAQ,EAAER,cAAA,CAAMQ,QATC;EAUjBC,YAAY,EAAE;AAVG,CAAnB;;AAaA,MAAMC,MAAM,GAAG,CAACC,KAAD,EAAQC,aAAR,KAA0B;EACvC,MAAM;IACJC,IADI;IAEJC,OAAO,GAAG,EAFN;IAGJC,SAHI;IAIJC,eAJI;IAKJC,QALI;IAMJC,QAAQ,GAAG,KANP;IAOJC,QAPI;IAQJC,QARI;IASJC,WATI;IAUJC,KAVI;IAWJC,QAAQ,GAAG,KAXP;IAYJC,KAAK,GAAG,KAZJ;IAaJC,KAAK,EAAEC,SA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84
|
+
moreAriaLabel: PropTypes.Requireable<string>;
|
|
85
85
|
name: PropTypes.Requireable<string>;
|
|
86
86
|
className: PropTypes.Requireable<string>;
|
|
87
87
|
borderClassName: PropTypes.Requireable<string>;
|
|
@@ -185,7 +185,7 @@ declare namespace BrandFormGroup {
|
|
|
185
185
|
}> | PropTypes.InferProps<{
|
|
186
186
|
type: PropTypes.Requireable<string>;
|
|
187
187
|
title: PropTypes.Requireable<string>;
|
|
188
|
-
|
|
188
|
+
moreAriaLabel: PropTypes.Requireable<string>;
|
|
189
189
|
name: PropTypes.Requireable<string>;
|
|
190
190
|
className: PropTypes.Requireable<string>;
|
|
191
191
|
borderClassName: PropTypes.Requireable<string>;
|
|
@@ -13,7 +13,7 @@ declare class Filters extends React.Component<any, any, any> {
|
|
|
13
13
|
}> | null | undefined)[]>;
|
|
14
14
|
sorting: PropTypes.Requireable<PropTypes.InferProps<{
|
|
15
15
|
title: PropTypes.Requireable<string>;
|
|
16
|
-
|
|
16
|
+
moreAriaLabel: PropTypes.Requireable<string>;
|
|
17
17
|
name: PropTypes.Requireable<string>;
|
|
18
18
|
className: PropTypes.Requireable<string>;
|
|
19
19
|
borderClassName: PropTypes.Requireable<string>;
|
|
@@ -39,7 +39,7 @@ declare namespace SetupSlide {
|
|
|
39
39
|
}> | PropTypes.InferProps<{
|
|
40
40
|
type: PropTypes.Requireable<string>;
|
|
41
41
|
title: PropTypes.Requireable<string>;
|
|
42
|
-
|
|
42
|
+
moreAriaLabel: PropTypes.Requireable<string>;
|
|
43
43
|
name: PropTypes.Requireable<string>;
|
|
44
44
|
className: PropTypes.Requireable<string>;
|
|
45
45
|
borderClassName: PropTypes.Requireable<string>;
|
|
@@ -52,7 +52,7 @@ declare namespace SetupSlider {
|
|
|
52
52
|
}> | PropTypes.InferProps<{
|
|
53
53
|
type: PropTypes.Requireable<string>;
|
|
54
54
|
title: PropTypes.Requireable<string>;
|
|
55
|
-
|
|
55
|
+
moreAriaLabel: PropTypes.Requireable<string>;
|
|
56
56
|
name: PropTypes.Requireable<string>;
|
|
57
57
|
className: PropTypes.Requireable<string>;
|
|
58
58
|
borderClassName: PropTypes.Requireable<string>;
|
|
@@ -111,7 +111,7 @@ declare namespace BrandForm {
|
|
|
111
111
|
type: PropTypes.Requireable<string>;
|
|
112
112
|
size: PropTypes.Requireable<string>;
|
|
113
113
|
title: PropTypes.Requireable<string>;
|
|
114
|
-
|
|
114
|
+
moreAriaLabel: PropTypes.Requireable<string>;
|
|
115
115
|
name: PropTypes.Requireable<string>;
|
|
116
116
|
className: PropTypes.Requireable<string>;
|
|
117
117
|
borderClassName: PropTypes.Requireable<string>;
|
|
@@ -215,7 +215,7 @@ declare namespace BrandForm {
|
|
|
215
215
|
}> | PropTypes.InferProps<{
|
|
216
216
|
type: PropTypes.Requireable<string>;
|
|
217
217
|
title: PropTypes.Requireable<string>;
|
|
218
|
-
|
|
218
|
+
moreAriaLabel: PropTypes.Requireable<string>;
|
|
219
219
|
name: PropTypes.Requireable<string>;
|
|
220
220
|
className: PropTypes.Requireable<string>;
|
|
221
221
|
borderClassName: PropTypes.Requireable<string>;
|
|
@@ -207,7 +207,7 @@ class MoocHeader extends _react.default.Component {
|
|
|
207
207
|
let settingsView = null;
|
|
208
208
|
let notificationsView = null;
|
|
209
209
|
let searchFormView = null;
|
|
210
|
-
const
|
|
210
|
+
const moreAriaLabel = translate('More');
|
|
211
211
|
const closeLabel = translate('Close');
|
|
212
212
|
const primaryColor = (0, _get2.default)('common.primary', skin);
|
|
213
213
|
const mediumColor = (0, _get2.default)('common.medium', skin);
|
|
@@ -280,10 +280,10 @@ class MoocHeader extends _react.default.Component {
|
|
|
280
280
|
className: _style.default.currentOption,
|
|
281
281
|
"aria-haspopup": "true",
|
|
282
282
|
"data-name": "item-more"
|
|
283
|
-
},
|
|
283
|
+
}, moreAriaLabel, /*#__PURE__*/_react.default.createElement(_novaIcons.NovaCompositionNavigationArrowDown, {
|
|
284
284
|
color: mediumColor,
|
|
285
285
|
className: _style.default.caret,
|
|
286
|
-
"aria-label":
|
|
286
|
+
"aria-label": moreAriaLabel
|
|
287
287
|
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
288
288
|
className: _style.default.optionsGroup
|
|
289
289
|
}, optionsView)));
|