repoweaver
Version:
A GitHub App that skillfully weaves multiple templates together to create and update repositories with intelligent merge strategies
1 lines • 13.2 kB
JSON
{"ast":null,"code":"import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/objectWithoutPropertiesLoose\";\nconst _excluded = [\"numeric\", \"children\", \"onPress\", \"sortDirection\", \"textStyle\", \"style\", \"theme\", \"numberOfLines\", \"maxFontSizeMultiplier\"];\nfunction _extends() {\n return _extends = Object.assign ? Object.assign.bind() : function (n) {\n for (var e = 1; e < arguments.length; e++) {\n var t = arguments[e];\n for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);\n }\n return n;\n }, _extends.apply(null, arguments);\n}\nimport * as React from 'react';\nimport Animated from \"react-native-web/dist/exports/Animated\";\nimport I18nManager from \"react-native-web/dist/exports/I18nManager\";\nimport PixelRatio from \"react-native-web/dist/exports/PixelRatio\";\nimport Pressable from \"react-native-web/dist/exports/Pressable\";\nimport StyleSheet from \"react-native-web/dist/exports/StyleSheet\";\nimport color from 'color';\nimport { useInternalTheme } from \"../../core/theming\";\nimport MaterialCommunityIcon from \"../MaterialCommunityIcon\";\nimport Text from \"../Typography/Text\";\nconst DataTableTitle = _ref => {\n let {\n numeric,\n children,\n onPress,\n sortDirection,\n textStyle,\n style,\n theme: themeOverrides,\n numberOfLines = 1,\n maxFontSizeMultiplier\n } = _ref,\n rest = _objectWithoutPropertiesLoose(_ref, _excluded);\n var _theme$colors;\n const theme = useInternalTheme(themeOverrides);\n const {\n current: spinAnim\n } = React.useRef(new Animated.Value(sortDirection === 'ascending' ? 0 : 1));\n React.useEffect(() => {\n Animated.timing(spinAnim, {\n toValue: sortDirection === 'ascending' ? 0 : 1,\n duration: 150,\n useNativeDriver: true\n }).start();\n }, [sortDirection, spinAnim]);\n const textColor = theme.isV3 ? theme.colors.onSurface : theme === null || theme === void 0 || (_theme$colors = theme.colors) === null || _theme$colors === void 0 ? void 0 : _theme$colors.text;\n const alphaTextColor = color(textColor).alpha(0.6).rgb().string();\n const spin = spinAnim.interpolate({\n inputRange: [0, 1],\n outputRange: ['0deg', '180deg']\n });\n const icon = sortDirection ? React.createElement(Animated.View, {\n style: [styles.icon, {\n transform: [{\n rotate: spin\n }]\n }]\n }, React.createElement(MaterialCommunityIcon, {\n name: \"arrow-up\",\n size: 16,\n color: textColor,\n direction: I18nManager.getConstants().isRTL ? 'rtl' : 'ltr'\n })) : null;\n return React.createElement(Pressable, _extends({\n disabled: !onPress,\n onPress: onPress\n }, rest, {\n style: [styles.container, numeric && styles.right, style]\n }), icon, React.createElement(Text, {\n style: [styles.cell, {\n maxHeight: 24 * PixelRatio.getFontScale() * numberOfLines\n }, numberOfLines > 1 ? numeric ? I18nManager.getConstants().isRTL ? styles.leftText : styles.rightText : styles.centerText : {}, sortDirection ? styles.sorted : {\n color: alphaTextColor\n }, textStyle],\n numberOfLines: numberOfLines,\n maxFontSizeMultiplier: maxFontSizeMultiplier\n }, children));\n};\nDataTableTitle.displayName = 'DataTable.Title';\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n flexDirection: 'row',\n alignContent: 'center',\n paddingVertical: 12\n },\n rightText: {\n textAlign: 'right'\n },\n leftText: {\n textAlign: 'left'\n },\n centerText: {\n textAlign: 'center'\n },\n right: {\n justifyContent: 'flex-end'\n },\n cell: {\n lineHeight: 24,\n fontSize: 12,\n fontWeight: '500',\n alignItems: 'center'\n },\n sorted: {\n marginLeft: 8\n },\n icon: {\n height: 24,\n justifyContent: 'center'\n }\n});\nexport default DataTableTitle;\nexport { DataTableTitle };","map":{"version":3,"names":["React","Animated","I18nManager","PixelRatio","Pressable","StyleSheet","color","useInternalTheme","MaterialCommunityIcon","Text","DataTableTitle","_ref","numeric","children","onPress","sortDirection","textStyle","style","theme","themeOverrides","numberOfLines","maxFontSizeMultiplier","rest","_objectWithoutPropertiesLoose","_excluded","_theme$colors","current","spinAnim","useRef","Value","useEffect","timing","toValue","duration","useNativeDriver","start","textColor","isV3","colors","onSurface","text","alphaTextColor","alpha","rgb","string","spin","interpolate","inputRange","outputRange","icon","createElement","View","styles","transform","rotate","name","size","direction","getConstants","isRTL","_extends","disabled","container","right","cell","maxHeight","getFontScale","leftText","rightText","centerText","sorted","displayName","create","flex","flexDirection","alignContent","paddingVertical","textAlign","justifyContent","lineHeight","fontSize","fontWeight","alignItems","marginLeft","height"],"sources":["/Users/pmouli/Documents/GitHub.nosync/boots-strapper/mobile/node_modules/react-native-paper/src/components/DataTable/DataTableTitle.tsx"],"sourcesContent":["import * as React from 'react';\nimport {\n Animated,\n GestureResponderEvent,\n I18nManager,\n PixelRatio,\n Pressable,\n StyleProp,\n StyleSheet,\n TextStyle,\n ViewStyle,\n} from 'react-native';\n\nimport color from 'color';\n\nimport { useInternalTheme } from '../../core/theming';\nimport type { ThemeProp } from '../../types';\nimport MaterialCommunityIcon from '../MaterialCommunityIcon';\nimport Text from '../Typography/Text';\n\nexport type Props = React.ComponentPropsWithRef<typeof Pressable> & {\n /**\n * Text content of the `DataTableTitle`.\n */\n children: React.ReactNode;\n /**\n * Align the text to the right. Generally monetary or number fields are aligned to right.\n */\n numeric?: boolean;\n /**\n * Direction of sorting. An arrow indicating the direction is displayed when this is given.\n */\n sortDirection?: 'ascending' | 'descending';\n /**\n * The number of lines to show.\n */\n numberOfLines?: number;\n /**\n * Function to execute on press.\n */\n onPress?: (e: GestureResponderEvent) => void;\n style?: StyleProp<ViewStyle>;\n /**\n * Text content style of the `DataTableTitle`.\n */\n textStyle?: StyleProp<TextStyle>;\n /**\n * Specifies the largest possible scale a text font can reach.\n */\n maxFontSizeMultiplier?: number;\n /**\n * @optional\n */\n theme?: ThemeProp;\n};\n\n/**\n * A component to display title in table header.\n *\n * ## Usage\n * ```js\n * import * as React from 'react';\n * import { DataTable } from 'react-native-paper';\n *\n * const MyComponent = () => (\n * <DataTable>\n * <DataTable.Header>\n * <DataTable.Title\n * sortDirection='descending'\n * >\n * Dessert\n * </DataTable.Title>\n * <DataTable.Title numeric>Calories</DataTable.Title>\n * <DataTable.Title numeric>Fat (g)</DataTable.Title>\n * </DataTable.Header>\n * </DataTable>\n * );\n *\n * export default MyComponent;\n * ```\n */\n\nconst DataTableTitle = ({\n numeric,\n children,\n onPress,\n sortDirection,\n textStyle,\n style,\n theme: themeOverrides,\n numberOfLines = 1,\n maxFontSizeMultiplier,\n ...rest\n}: Props) => {\n const theme = useInternalTheme(themeOverrides);\n const { current: spinAnim } = React.useRef<Animated.Value>(\n new Animated.Value(sortDirection === 'ascending' ? 0 : 1)\n );\n\n React.useEffect(() => {\n Animated.timing(spinAnim, {\n toValue: sortDirection === 'ascending' ? 0 : 1,\n duration: 150,\n useNativeDriver: true,\n }).start();\n }, [sortDirection, spinAnim]);\n\n const textColor = theme.isV3 ? theme.colors.onSurface : theme?.colors?.text;\n\n const alphaTextColor = color(textColor).alpha(0.6).rgb().string();\n\n const spin = spinAnim.interpolate({\n inputRange: [0, 1],\n outputRange: ['0deg', '180deg'],\n });\n\n const icon = sortDirection ? (\n <Animated.View style={[styles.icon, { transform: [{ rotate: spin }] }]}>\n <MaterialCommunityIcon\n name=\"arrow-up\"\n size={16}\n color={textColor}\n direction={I18nManager.getConstants().isRTL ? 'rtl' : 'ltr'}\n />\n </Animated.View>\n ) : null;\n\n return (\n <Pressable\n disabled={!onPress}\n onPress={onPress}\n {...rest}\n style={[styles.container, numeric && styles.right, style]}\n >\n {icon}\n\n <Text\n style={[\n styles.cell,\n // height must scale with numberOfLines\n { maxHeight: 24 * PixelRatio.getFontScale() * numberOfLines },\n // if numberOfLines causes wrap, center is lost. Align directly, sensitive to numeric and RTL\n numberOfLines > 1\n ? numeric\n ? I18nManager.getConstants().isRTL\n ? styles.leftText\n : styles.rightText\n : styles.centerText\n : {},\n sortDirection ? styles.sorted : { color: alphaTextColor },\n textStyle,\n ]}\n numberOfLines={numberOfLines}\n maxFontSizeMultiplier={maxFontSizeMultiplier}\n >\n {children}\n </Text>\n </Pressable>\n );\n};\n\nDataTableTitle.displayName = 'DataTable.Title';\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n flexDirection: 'row',\n alignContent: 'center',\n paddingVertical: 12,\n },\n\n rightText: {\n textAlign: 'right',\n },\n\n leftText: {\n textAlign: 'left',\n },\n\n centerText: {\n textAlign: 'center',\n },\n\n right: {\n justifyContent: 'flex-end',\n },\n\n cell: {\n lineHeight: 24,\n fontSize: 12,\n fontWeight: '500',\n alignItems: 'center',\n },\n\n sorted: {\n marginLeft: 8,\n },\n\n icon: {\n height: 24,\n justifyContent: 'center',\n },\n});\n\nexport default DataTableTitle;\n\n// @component-docs ignore-next-line\nexport { DataTableTitle };\n"],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAAA,OAAAC,QAAA;AAAA,OAAAC,WAAA;AAAA,OAAAC,UAAA;AAAA,OAAAC,SAAA;AAAA,OAAAC,UAAA;AAa9B,OAAOC,KAAK,MAAM,OAAO;AAEzB,SAASC,gBAAgB;AAEzB,OAAOC,qBAAqB;AAC5B,OAAOC,IAAI;AAgEX,MAAMC,cAAc,GAAGC,IAAA,IAWV;EAAA,IAXW;MACtBC,OAAO;MACPC,QAAQ;MACRC,OAAO;MACPC,aAAa;MACbC,SAAS;MACTC,KAAK;MACLC,KAAK,EAAEC,cAAc;MACrBC,aAAa,GAAG,CAAC;MACjBC;IAEK,CAAC,GAAAV,IAAA;IADHW,IAAA,GAAAC,6BAAA,CAAAZ,IAAA,EAAAa,SAAA;EACQ,IAAAC,aAAA;EACX,MAAMP,KAAK,GAAGX,gBAAgB,CAACY,cAAc,CAAC;EAC9C,MAAM;IAAEO,OAAO,EAAEC;EAAS,CAAC,GAAG3B,KAAK,CAAC4B,MAAM,CACxC,IAAI3B,QAAQ,CAAC4B,KAAK,CAACd,aAAa,KAAK,WAAW,GAAG,CAAC,GAAG,CAAC,CAC1D,CAAC;EAEDf,KAAK,CAAC8B,SAAS,CAAC,MAAM;IACpB7B,QAAQ,CAAC8B,MAAM,CAACJ,QAAQ,EAAE;MACxBK,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