@fountain-ui/lab 2.0.0-beta.1 → 2.0.0-beta.5
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/build/commonjs/DateTimePicker/DateTimePicker.js +2 -2
- package/build/commonjs/DateTimePicker/DateTimePicker.js.map +1 -1
- package/build/module/DateTimePicker/DateTimePicker.js +2 -2
- package/build/module/DateTimePicker/DateTimePicker.js.map +1 -1
- package/package.json +5 -6
- package/src/DateTimePicker/DateTimePicker.tsx +2 -2
|
@@ -100,8 +100,8 @@ function DateTimePicker(props) {
|
|
|
100
100
|
onPress: () => setYearPickerVisible(true)
|
|
101
101
|
}),
|
|
102
102
|
theme: {
|
|
103
|
-
backgroundColor: theme.palette.
|
|
104
|
-
calendarBackground: theme.palette.
|
|
103
|
+
backgroundColor: theme.palette.paper.default,
|
|
104
|
+
calendarBackground: theme.palette.paper.default,
|
|
105
105
|
dayTextColor: theme.palette.text.primary,
|
|
106
106
|
textDisabledColor: theme.palette.text.hint
|
|
107
107
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["DateTimePicker.tsx"],"names":["useDateTimePicker","React","useContext","DateTimePickerContext","DateTimePicker","props","currentMonth","Date","locale","markedDate","markedDateProp","maxDate","minDate","onDayPress","onYearPress","onYearPressProp","theme","yearPickerVisible","setYearPickerVisible","useState","locales","LeftArrow","RightArrow","date","LocaleConfig","defaultLocale","direction","selected","disableTouchEvent","selectedColor","palette","primary","main","selectedTextColor","contrastTextColor","toDate","backgroundColor","
|
|
1
|
+
{"version":3,"sources":["DateTimePicker.tsx"],"names":["useDateTimePicker","React","useContext","DateTimePickerContext","DateTimePicker","props","currentMonth","Date","locale","markedDate","markedDateProp","maxDate","minDate","onDayPress","onYearPress","onYearPressProp","theme","yearPickerVisible","setYearPickerVisible","useState","locales","LeftArrow","RightArrow","date","LocaleConfig","defaultLocale","direction","selected","disableTouchEvent","selectedColor","palette","primary","main","selectedTextColor","contrastTextColor","toDate","backgroundColor","paper","default","calendarBackground","dayTextColor","text","textDisabledColor","hint"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AAEA;;;;AAPA;AASA,MAAMA,iBAAiB,GAAG,MAAM;AAC5B,SAAOC,eAAMC,UAAN,CAAiBC,6CAAjB,CAAP;AACH,CAFD;;AAIe,SAASC,cAAT,CAAwBC,KAAxB,EAAoD;AAC/D,QAAM;AACFC,IAAAA,YAAY,GAAG,IAAIC,IAAJ,EADb;AAEFC,IAAAA,MAFE;AAGFC,IAAAA,UAAU,EAAEC,cAHV;AAIFC,IAAAA,OAJE;AAKFC,IAAAA,OALE;AAMFC,IAAAA,UANE;AAOFC,IAAAA,WAAW,EAAEC;AAPX,MAQFV,KARJ;AAUA,QAAMW,KAAK,GAAG,uBAAd;;AAEA,QAAM,CAACC,iBAAD,EAAoBC,oBAApB,IAA4CjB,eAAMkB,QAAN,CAAe,KAAf,CAAlD;;AACA,QAAM;AAAEC,IAAAA;AAAF,MAAcpB,iBAAiB,EAArC,CAd+D,CAgB/D;;AACA,QAAMqB,SAAS,gBAAG,6BAAC,gBAAD;AAAY,IAAA,QAAQ,EAAE,GAAtB;AAA2B,IAAA,KAAK,EAAE;AAAlC,IAAlB;;AACA,QAAMC,UAAU,gBAAG,6BAAC,gBAAD;AAAY,IAAA,QAAQ,EAAE,GAAtB;AAA2B,IAAA,KAAK,EAAE;AAAlC,IAAnB;;AAEA,QAAMR,WAAW,GAAIS,IAAD,IAAgB;AAChCL,IAAAA,oBAAoB,CAAC,KAAD,CAApB;AACAH,IAAAA,eAAe,IAAIA,eAAe,CAACQ,IAAD,CAAlC;AACH,GAHD;;AAKA,MAAIf,MAAJ,EAAY;AACRgB,uCAAaJ,OAAb,GAAuBA,OAAvB;AACAI,uCAAaC,aAAb,GAA6BjB,MAA7B;AACH;;AAED,QAAMC,UAAU,GAAGC,cAAc,GAAG,qBAAOA,cAAP,EAAuB,YAAvB,CAAH,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AACc,OAAN,CAAcW,IAAd,CAAmBV,OAH9B;AAIHW,MAAAA,iBAAiB,EAAE1B,KAAK,CAACc,OAAN,CAAcW,IAAd,CAAmBE;AAJnC;AAvBX,IADJ;AAgCH;;AAAA","sourcesContent":["import React from 'react';\nimport { format } from 'date-fns';\n//@ts-ignore\nimport { Calendar, LocaleConfig } from 'react-native-calendars';\nimport { Button, Typography } from '@fountain-ui/core';\nimport { useTheme } from '@fountain-ui/styles';\nimport YearPicker from './YearPicker';\nimport { DateTimePickerContext } from './DateTimePickerProvider';\nimport type DateTimePickerProps from './DateTimePickerProps';\nimport { formatDate } from './utils';\n\nconst useDateTimePicker = () => {\n return React.useContext(DateTimePickerContext);\n};\n\nexport default function DateTimePicker(props: DateTimePickerProps) {\n const {\n currentMonth = new Date(),\n locale,\n markedDate: markedDateProp,\n maxDate,\n minDate,\n onDayPress,\n onYearPress: onYearPressProp,\n } = props;\n\n const theme = useTheme();\n\n const [yearPickerVisible, setYearPickerVisible] = React.useState(false);\n const { locales } = useDateTimePicker();\n\n //TODO: Need to update arrow components\n const LeftArrow = <Typography children={'<'} color={'textPrimary'}/>;\n const RightArrow = <Typography children={'>'} color={'textPrimary'}/>;\n\n const onYearPress = (date: Date) => {\n setYearPickerVisible(false);\n onYearPressProp && onYearPressProp(date);\n };\n\n if (locale) {\n LocaleConfig.locales = locales;\n LocaleConfig.defaultLocale = locale;\n }\n\n const markedDate = markedDateProp ? format(markedDateProp, 'yyyy-MM-dd') : '';\n\n if (yearPickerVisible) {\n return (\n <YearPicker\n date={currentMonth}\n locale={locale}\n maxDate={maxDate}\n minDate={minDate}\n onYearPress={onYearPress}\n />\n );\n }\n\n return (\n <Calendar\n current={currentMonth}\n onDayPress={onDayPress}\n maxDate={maxDate}\n minDate={minDate}\n renderArrow={(direction: string) => direction === 'left' ? LeftArrow : RightArrow}\n markedDates={{\n [markedDate]: {\n selected: true,\n disableTouchEvent: true,\n selectedColor: theme.palette.primary.main,\n selectedTextColor: theme.palette.primary.contrastTextColor,\n },\n }}\n // @ts-ignore\n renderHeader={(date) => (\n <Button\n children={formatDate(date.toDate(), locale)}\n variant={'text'}\n size={'small'}\n onPress={() => setYearPickerVisible(true)}\n />\n )}\n theme={{\n backgroundColor: theme.palette.paper.default,\n calendarBackground: theme.palette.paper.default,\n dayTextColor: theme.palette.text.primary,\n textDisabledColor: theme.palette.text.hint,\n }}\n />\n );\n};\n"]}
|
|
@@ -81,8 +81,8 @@ export default function DateTimePicker(props) {
|
|
|
81
81
|
onPress: () => setYearPickerVisible(true)
|
|
82
82
|
}),
|
|
83
83
|
theme: {
|
|
84
|
-
backgroundColor: theme.palette.
|
|
85
|
-
calendarBackground: theme.palette.
|
|
84
|
+
backgroundColor: theme.palette.paper.default,
|
|
85
|
+
calendarBackground: theme.palette.paper.default,
|
|
86
86
|
dayTextColor: theme.palette.text.primary,
|
|
87
87
|
textDisabledColor: theme.palette.text.hint
|
|
88
88
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["DateTimePicker.tsx"],"names":["React","format","Calendar","LocaleConfig","Button","Typography","useTheme","YearPicker","DateTimePickerContext","formatDate","useDateTimePicker","useContext","DateTimePicker","props","currentMonth","Date","locale","markedDate","markedDateProp","maxDate","minDate","onDayPress","onYearPress","onYearPressProp","theme","yearPickerVisible","setYearPickerVisible","useState","locales","LeftArrow","RightArrow","date","defaultLocale","direction","selected","disableTouchEvent","selectedColor","palette","primary","main","selectedTextColor","contrastTextColor","toDate","backgroundColor","
|
|
1
|
+
{"version":3,"sources":["DateTimePicker.tsx"],"names":["React","format","Calendar","LocaleConfig","Button","Typography","useTheme","YearPicker","DateTimePickerContext","formatDate","useDateTimePicker","useContext","DateTimePicker","props","currentMonth","Date","locale","markedDate","markedDateProp","maxDate","minDate","onDayPress","onYearPress","onYearPressProp","theme","yearPickerVisible","setYearPickerVisible","useState","locales","LeftArrow","RightArrow","date","defaultLocale","direction","selected","disableTouchEvent","selectedColor","palette","primary","main","selectedTextColor","contrastTextColor","toDate","backgroundColor","paper","default","calendarBackground","dayTextColor","text","textDisabledColor","hint"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,MAAT,QAAuB,UAAvB,C,CACA;;AACA,SAASC,QAAT,EAAmBC,YAAnB,QAAuC,wBAAvC;AACA,SAASC,MAAT,EAAiBC,UAAjB,QAAmC,mBAAnC;AACA,SAASC,QAAT,QAAyB,qBAAzB;AACA,OAAOC,UAAP,MAAuB,cAAvB;AACA,SAASC,qBAAT,QAAsC,0BAAtC;AAEA,SAASC,UAAT,QAA2B,SAA3B;;AAEA,MAAMC,iBAAiB,GAAG,MAAM;AAC5B,SAAOV,KAAK,CAACW,UAAN,CAAiBH,qBAAjB,CAAP;AACH,CAFD;;AAIA,eAAe,SAASI,cAAT,CAAwBC,KAAxB,EAAoD;AAC/D,QAAM;AACFC,IAAAA,YAAY,GAAG,IAAIC,IAAJ,EADb;AAEFC,IAAAA,MAFE;AAGFC,IAAAA,UAAU,EAAEC,cAHV;AAIFC,IAAAA,OAJE;AAKFC,IAAAA,OALE;AAMFC,IAAAA,UANE;AAOFC,IAAAA,WAAW,EAAEC;AAPX,MAQFV,KARJ;AAUA,QAAMW,KAAK,GAAGlB,QAAQ,EAAtB;AAEA,QAAM,CAACmB,iBAAD,EAAoBC,oBAApB,IAA4C1B,KAAK,CAAC2B,QAAN,CAAe,KAAf,CAAlD;AACA,QAAM;AAAEC,IAAAA;AAAF,MAAclB,iBAAiB,EAArC,CAd+D,CAgB/D;;AACA,QAAMmB,SAAS,gBAAG,oBAAC,UAAD;AAAY,IAAA,QAAQ,EAAE,GAAtB;AAA2B,IAAA,KAAK,EAAE;AAAlC,IAAlB;AACA,QAAMC,UAAU,gBAAG,oBAAC,UAAD;AAAY,IAAA,QAAQ,EAAE,GAAtB;AAA2B,IAAA,KAAK,EAAE;AAAlC,IAAnB;;AAEA,QAAMR,WAAW,GAAIS,IAAD,IAAgB;AAChCL,IAAAA,oBAAoB,C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AAA,IAAI,EAAE,OAHV;AAII,MAAA,OAAO,EAAE,MAAMU,oBAAoB,CAAC,IAAD;AAJvC,MAhBR;AAuBI,IAAA,KAAK,EAAE;AACHiB,MAAAA,eAAe,EAAEnB,KAAK,CAACa,OAAN,CAAcO,KAAd,CAAoBC,OADlC;AAEHC,MAAAA,kBAAkB,EAAEtB,KAAK,CAACa,OAAN,CAAcO,KAAd,CAAoBC,OAFrC;AAGHE,MAAAA,YAAY,EAAEvB,KAAK,CAACa,OAAN,CAAcW,IAAd,CAAmBV,OAH9B;AAIHW,MAAAA,iBAAiB,EAAEzB,KAAK,CAACa,OAAN,CAAcW,IAAd,CAAmBE;AAJnC;AAvBX,IADJ;AAgCH;AAAA","sourcesContent":["import React from 'react';\nimport { format } from 'date-fns';\n//@ts-ignore\nimport { Calendar, LocaleConfig } from 'react-native-calendars';\nimport { Button, Typography } from '@fountain-ui/core';\nimport { useTheme } from '@fountain-ui/styles';\nimport YearPicker from './YearPicker';\nimport { DateTimePickerContext } from './DateTimePickerProvider';\nimport type DateTimePickerProps from './DateTimePickerProps';\nimport { formatDate } from './utils';\n\nconst useDateTimePicker = () => {\n return React.useContext(DateTimePickerContext);\n};\n\nexport default function DateTimePicker(props: DateTimePickerProps) {\n const {\n currentMonth = new Date(),\n locale,\n markedDate: markedDateProp,\n maxDate,\n minDate,\n onDayPress,\n onYearPress: onYearPressProp,\n } = props;\n\n const theme = useTheme();\n\n const [yearPickerVisible, setYearPickerVisible] = React.useState(false);\n const { locales } = useDateTimePicker();\n\n //TODO: Need to update arrow components\n const LeftArrow = <Typography children={'<'} color={'textPrimary'}/>;\n const RightArrow = <Typography children={'>'} color={'textPrimary'}/>;\n\n const onYearPress = (date: Date) => {\n setYearPickerVisible(false);\n onYearPressProp && onYearPressProp(date);\n };\n\n if (locale) {\n LocaleConfig.locales = locales;\n LocaleConfig.defaultLocale = locale;\n }\n\n const markedDate = markedDateProp ? format(markedDateProp, 'yyyy-MM-dd') : '';\n\n if (yearPickerVisible) {\n return (\n <YearPicker\n date={currentMonth}\n locale={locale}\n maxDate={maxDate}\n minDate={minDate}\n onYearPress={onYearPress}\n />\n );\n }\n\n return (\n <Calendar\n current={currentMonth}\n onDayPress={onDayPress}\n maxDate={maxDate}\n minDate={minDate}\n renderArrow={(direction: string) => direction === 'left' ? LeftArrow : RightArrow}\n markedDates={{\n [markedDate]: {\n selected: true,\n disableTouchEvent: true,\n selectedColor: theme.palette.primary.main,\n selectedTextColor: theme.palette.primary.contrastTextColor,\n },\n }}\n // @ts-ignore\n renderHeader={(date) => (\n <Button\n children={formatDate(date.toDate(), locale)}\n variant={'text'}\n size={'small'}\n onPress={() => setYearPickerVisible(true)}\n />\n )}\n theme={{\n backgroundColor: theme.palette.paper.default,\n calendarBackground: theme.palette.paper.default,\n dayTextColor: theme.palette.text.primary,\n textDisabledColor: theme.palette.text.hint,\n }}\n />\n );\n};\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fountain-ui/lab",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.5",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "Fountain-UI Team",
|
|
6
6
|
"description": "Incubator for Fountain-UI React components.",
|
|
@@ -17,12 +17,12 @@
|
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@emotion/react": "^11.4.1",
|
|
19
19
|
"@emotion/styled": "^11.0.0",
|
|
20
|
-
"@fountain-ui/icons": "^2.0.0-beta.
|
|
21
|
-
"@fountain-ui/utils": "^2.0.0-beta.
|
|
20
|
+
"@fountain-ui/icons": "^2.0.0-beta.5",
|
|
21
|
+
"@fountain-ui/utils": "^2.0.0-beta.3",
|
|
22
22
|
"react-native-calendars": "1.1267.0"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
|
-
"@fountain-ui/core": "^2.0.0-beta.
|
|
25
|
+
"@fountain-ui/core": "^2.0.0-beta.3",
|
|
26
26
|
"@gorhom/bottom-sheet": "^4.1.3",
|
|
27
27
|
"@react-native-community/viewpager": "> 4.2.x",
|
|
28
28
|
"date-fns": "^2.0.0",
|
|
@@ -53,7 +53,6 @@
|
|
|
53
53
|
}
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@fountain-ui/core": "^2.0.0-beta.1",
|
|
57
56
|
"@gorhom/bottom-sheet": "4.1.3",
|
|
58
57
|
"@react-native-community/viewpager": "^4.2.2",
|
|
59
58
|
"@types/react-native-snap-carousel": "^3.8.4",
|
|
@@ -85,5 +84,5 @@
|
|
|
85
84
|
"publishConfig": {
|
|
86
85
|
"access": "public"
|
|
87
86
|
},
|
|
88
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "5ff7454430142fbdfc2f57a71ad1de83768dd0ec"
|
|
89
88
|
}
|
|
@@ -82,8 +82,8 @@ export default function DateTimePicker(props: DateTimePickerProps) {
|
|
|
82
82
|
/>
|
|
83
83
|
)}
|
|
84
84
|
theme={{
|
|
85
|
-
backgroundColor: theme.palette.
|
|
86
|
-
calendarBackground: theme.palette.
|
|
85
|
+
backgroundColor: theme.palette.paper.default,
|
|
86
|
+
calendarBackground: theme.palette.paper.default,
|
|
87
87
|
dayTextColor: theme.palette.text.primary,
|
|
88
88
|
textDisabledColor: theme.palette.text.hint,
|
|
89
89
|
}}
|