@draftbit/core 43.4.5-312b1d.1 → 43.4.5-4e19aa.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/lib/commonjs/components/Elevation.js +14 -3
- package/lib/commonjs/components/Elevation.js.map +1 -1
- package/lib/commonjs/components/FieldSearchBarFull.js.map +1 -1
- package/lib/commonjs/components/RadioButton/RadioButton.js +6 -9
- package/lib/commonjs/components/RadioButton/RadioButton.js.map +1 -1
- package/lib/commonjs/components/RadioButton/RadioButtonGroup.js +8 -18
- package/lib/commonjs/components/RadioButton/RadioButtonGroup.js.map +1 -1
- package/lib/commonjs/components/RadioButton/RadioButtonRow.js +9 -14
- package/lib/commonjs/components/RadioButton/RadioButtonRow.js.map +1 -1
- package/lib/commonjs/components/Table/index.js +56 -0
- package/lib/commonjs/components/Table/index.js.map +1 -0
- package/lib/commonjs/components/Table/table.js +36 -0
- package/lib/commonjs/components/Table/table.js.map +1 -0
- package/lib/commonjs/components/Table/tableCell.js +44 -0
- package/lib/commonjs/components/Table/tableCell.js.map +1 -0
- package/lib/commonjs/components/Table/tableHeader.js +42 -0
- package/lib/commonjs/components/Table/tableHeader.js.map +1 -0
- package/lib/commonjs/components/Table/tablePaginator.js +18 -0
- package/lib/commonjs/components/Table/tablePaginator.js.map +1 -0
- package/lib/commonjs/components/Table/tableRow.js +48 -0
- package/lib/commonjs/components/Table/tableRow.js.map +1 -0
- package/lib/commonjs/components/Table/tableTitle.js +61 -0
- package/lib/commonjs/components/Table/tableTitle.js.map +1 -0
- package/lib/commonjs/index.js +38 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/mappings/Table.js +99 -0
- package/lib/commonjs/mappings/Table.js.map +1 -0
- package/lib/commonjs/utilities.js +7 -16
- package/lib/commonjs/utilities.js.map +1 -1
- package/lib/module/components/DatePicker/DatePickerComponentType.js.map +1 -1
- package/lib/module/components/RadioButton/RadioButton.js +6 -8
- package/lib/module/components/RadioButton/RadioButton.js.map +1 -1
- package/lib/module/components/RadioButton/RadioButtonGroup.js +8 -17
- package/lib/module/components/RadioButton/RadioButtonGroup.js.map +1 -1
- package/lib/module/components/RadioButton/RadioButtonRow.js +10 -15
- package/lib/module/components/RadioButton/RadioButtonRow.js.map +1 -1
- package/lib/module/components/ResizeMode.js +2 -2
- package/lib/module/components/ResizeMode.js.map +1 -1
- package/lib/module/components/Table/index.js +7 -0
- package/lib/module/components/Table/index.js.map +1 -0
- package/lib/module/components/Table/table.js +24 -0
- package/lib/module/components/Table/table.js.map +1 -0
- package/lib/module/components/Table/tableCell.js +32 -0
- package/lib/module/components/Table/tableCell.js.map +1 -0
- package/lib/module/components/Table/tableHeader.js +28 -0
- package/lib/module/components/Table/tableHeader.js.map +1 -0
- package/lib/module/components/Table/tablePaginator.js +7 -0
- package/lib/module/components/Table/tablePaginator.js.map +1 -0
- package/lib/module/components/Table/tableRow.js +34 -0
- package/lib/module/components/Table/tableRow.js.map +1 -0
- package/lib/module/components/Table/tableTitle.js +48 -0
- package/lib/module/components/Table/tableTitle.js.map +1 -0
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/mappings/BlurView.js.map +1 -1
- package/lib/module/mappings/Table.js +90 -0
- package/lib/module/mappings/Table.js.map +1 -0
- package/lib/module/utilities.js +4 -14
- package/lib/module/utilities.js.map +1 -1
- package/lib/typescript/src/components/RadioButton/RadioButton.d.ts +2 -2
- package/lib/typescript/src/components/RadioButton/RadioButtonGroup.d.ts +1 -1
- package/lib/typescript/src/components/RadioButton/RadioButtonRow.d.ts +1 -1
- package/lib/typescript/src/components/Table/index.d.ts +6 -0
- package/lib/typescript/src/components/Table/table.d.ts +8 -0
- package/lib/typescript/src/components/Table/tableCell.d.ts +10 -0
- package/lib/typescript/src/components/Table/tableHeader.d.ts +12 -0
- package/lib/typescript/src/components/Table/tablePaginator.d.ts +3 -0
- package/lib/typescript/src/components/Table/tableRow.d.ts +12 -0
- package/lib/typescript/src/components/Table/tableTitle.d.ts +12 -0
- package/lib/typescript/src/index.d.ts +1 -0
- package/lib/typescript/src/utilities.d.ts +4 -4
- package/package.json +2 -2
- package/src/components/RadioButton/RadioButton.js +5 -9
- package/src/components/RadioButton/RadioButton.tsx +10 -13
- package/src/components/RadioButton/RadioButtonGroup.js +8 -14
- package/src/components/RadioButton/RadioButtonGroup.tsx +12 -21
- package/src/components/RadioButton/RadioButtonRow.js +9 -15
- package/src/components/RadioButton/RadioButtonRow.tsx +13 -19
- package/src/components/Table/index.js +6 -0
- package/src/components/Table/index.tsx +6 -0
- package/src/components/Table/table.js +10 -0
- package/src/components/Table/table.tsx +22 -0
- package/src/components/Table/tableCell.js +17 -0
- package/src/components/Table/tableCell.tsx +37 -0
- package/src/components/Table/tableHeader.js +11 -0
- package/src/components/Table/tableHeader.tsx +28 -0
- package/src/components/Table/tablePaginator.js +5 -0
- package/src/components/Table/tablePaginator.tsx +10 -0
- package/src/components/Table/tableRow.js +16 -0
- package/src/components/Table/tableRow.tsx +31 -0
- package/src/components/Table/tableTitle.js +28 -0
- package/src/components/Table/tableTitle.tsx +59 -0
- package/src/index.js +1 -0
- package/src/index.tsx +9 -0
- package/src/mappings/Table.js +102 -0
- package/src/utilities.js +6 -16
- package/src/utilities.ts +6 -14
|
@@ -19,8 +19,6 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
19
19
|
|
|
20
20
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
21
21
|
|
|
22
|
-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
23
|
-
|
|
24
22
|
/* directly copied from https://github.com/callstack/react-native-paper/blob/main/src/components/Surface.tsx#L62 */
|
|
25
23
|
const Elevation = _ref => {
|
|
26
24
|
let {
|
|
@@ -37,11 +35,24 @@ const Elevation = _ref => {
|
|
|
37
35
|
colors
|
|
38
36
|
} = theme;
|
|
39
37
|
const borderRadius = radius;
|
|
40
|
-
return /*#__PURE__*/React.createElement(_reactNative.Animated.View,
|
|
38
|
+
return /*#__PURE__*/React.createElement(_reactNative.Animated.View, { ...rest,
|
|
41
39
|
style: [{
|
|
42
40
|
borderRadius,
|
|
43
41
|
backgroundColor: colors.surface
|
|
44
42
|
}, elevation ? (0, _shadow.default)(elevation) : null, style]
|
|
43
|
+
}, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
44
|
+
style: {
|
|
45
|
+
overflow: "hidden",
|
|
46
|
+
borderRadius
|
|
47
|
+
}
|
|
48
|
+
}, children));
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
var _default = (0, _theming.withTheme)(Elevation);
|
|
52
|
+
|
|
53
|
+
exports.default = _default;
|
|
54
|
+
//# sourceMappingURL=Elevation.js.mape
|
|
55
|
+
}, elevation ? (0, _shadow.default)(elevation) : null, style]
|
|
45
56
|
}), /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
46
57
|
style: {
|
|
47
58
|
overflow: "hidden",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["Elevation.
|
|
1
|
+
{"version":3,"sources":["Elevation.js"],"names":["Elevation","style","theme","children","rest","elevation","borderRadius","radius","StyleSheet","flatten","colors","React","createElement","Animated","View","backgroundColor","surface","overflow"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;;;;;;;AACA;AACA,MAAMA,SAAS,GAAG,QAAyC;AAAA,MAAxC;AAAEC,IAAAA,KAAF;AAASC,IAAAA,KAAT;AAAgBC,IAAAA,QAAhB;AAA0B,OAAGC;AAA7B,GAAwC;AACvD,QAAM;AAAEC,IAAAA,SAAS,GAAG,CAAd;AAAiBC,IAAAA,YAAY,EAAEC;AAA/B,MAA0CC,wBAAWC,OAAX,CAAmBR,KAAnB,KAA6B,EAA7E;AACA,QAAM;AAAES,IAAAA;AAAF,MAAaR,KAAnB;AACA,QAAMI,YAAY,GAAGC,MAArB;AACA,sBAAQI,KAAK,CAACC,aAAN,CAAoBC,sBAASC,IAA7B,EAAmC,EAAE,GAAGV,IAAL;AAAWH,IAAAA,KAAK,EAAE,CACrD;AACIK,MAAAA,YADJ;AAEIS,MAAAA,eAAe,EAAEL,MAAM,CAACM;AAF5B,KADqD,EAKrDX,SAAS,GAAG,qBAAOA,SAAP,CAAH,GAAuB,IALqB,EAMrDJ,KANqD;AAAlB,GAAnC,eAQJU,KAAK,CAACC,aAAN,CAAoBE,iBAApB,EAA0B;AAAEb,IAAAA,KAAK,EAAE;AAAEgB,MAAAA,QAAQ,EAAE,QAAZ;AAAsBX,MAAAA;AAAtB;AAAT,GAA1B,EAA2EH,QAA3E,CARI,CAAR;AASH,CAbD;;eAce,wBAAUH,SAAV,C","sourcesContent":["import * as React from \"react\";\nimport { Animated, StyleSheet, View, } from \"react-native\";\nimport shadow from \"../styles/shadow\";\nimport { withTheme } from \"../theming\";\n/* directly copied from https://github.com/callstack/react-native-paper/blob/main/src/components/Surface.tsx#L62 */\nconst Elevation = ({ style, theme, children, ...rest }) => {\n const { elevation = 4, borderRadius: radius } = StyleSheet.flatten(style) || {};\n const { colors } = theme;\n const borderRadius = radius;\n return (React.createElement(Animated.View, { ...rest, style: [\n {\n borderRadius,\n backgroundColor: colors.surface,\n },\n elevation ? shadow(elevation) : null,\n style,\n ] },\n React.createElement(View, { style: { overflow: \"hidden\", borderRadius } }, children)));\n};\nexport default withTheme(Elevation);\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["FieldSearchBarFull.
|
|
1
|
+
{"version":3,"sources":["FieldSearchBarFull.tsx"],"names":["FieldSearchBarFull","showIcon","Icon","icon","placeholder","style","theme","colors","typography","onChange","changeOverride","onSubmit","submitOverride","value","defaultValue","focused","setIsFocused","React","useState","onBlur","internalValue","setInternalValue","useEffect","useCallback","text","onFocus","e","lineHeight","typeStyles","body2","handleChangeText","newValue","styles","container","Config","fieldSearchBarFullIconSize","primary","light","marginLeft","flex","color","medium","StyleSheet","create","flexDirection","alignItems"],"mappings":";;;;;;;AAAA;;AACA;;AASA;;AAGA;;;;;;;;AAcA,MAAMA,kBAAmC,GAAG,QAWtC;AAAA,MAXuC;AAC3CC,IAAAA,QAD2C;AAE3CC,IAAAA,IAF2C;AAG3CC,IAAAA,IAAI,GAAG,QAHoC;AAI3CC,IAAAA,WAAW,GAAG,EAJ6B;AAK3CC,IAAAA,KAL2C;AAM3CC,IAAAA,KAAK,EAAE;AAAEC,MAAAA,MAAF;AAAUC,MAAAA;AAAV,KANoC;AAO3CC,IAAAA,QAAQ,EAAEC,cAPiC;AAQ3CC,IAAAA,QAAQ,EAAEC,cARiC;AAS3CC,IAAAA,KAT2C;AAU3CC,IAAAA;AAV2C,GAWvC;AACJ,QAAM,CAACC,OAAD,EAAUC,YAAV,IAA0BC,KAAK,CAACC,QAAN,CAAe,KAAf,CAAhC;;AAEA,QAAMC,MAAM,GAAG,MAAM;AACnBH,IAAAA,YAAY,CAAC,KAAD,CAAZ;AACD,GAFD;;AAIA,QAAM,CAACI,aAAD,EAAgBC,gBAAhB,IAAoCJ,KAAK,CAACC,QAAN,CACxCL,KAAK,IAAIC,YAD+B,CAA1C;AAIAG,EAAAA,KAAK,CAACK,SAAN,CAAgB,MAAM;A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KAAK,EAAE;AAAEC,MAAAA,UAAU,EAAErC,QAAQ,GAAG,EAAH,GAAQ,CAA9B;AAAiCsC,MAAAA,IAAI,EAAE;AAAvC;AAAb,kBACE,oBAAC,sBAAD;AACE,IAAA,eAAe,EAAC,eADlB;AAEE,IAAA,WAAW,EAAEnC,WAFf;AAGE,IAAA,KAAK,EAAEgB,aAHT;AAIE,IAAA,MAAM,EAAED,MAJV;AAKE,IAAA,OAAO,EAAEM,OALX;AAME,IAAA,YAAY,EAAEK,gBANhB;AAOE,IAAA,eAAe,EAAEnB,QAPnB;AAQE,IAAA,oBAAoB,EAAEJ,MAAM,CAAC8B,KAR/B;AASE,IAAA,KAAK,EAAE,CACL;AACEG,MAAAA,KAAK,EAAEjC,MAAM,CAACkC;AADhB,KADK,EAILb,UAJK;AATT,IADF,CARF,CADF;AA6BD,CAzFD;;AA2FA,MAAMI,MAAM,GAAGU,wBAAWC,MAAX,CAAkB;AAC/BV,EAAAA,SAAS,EAAE;AACTW,IAAAA,aAAa,EAAE,KADN;AAETC,IAAAA,UAAU,EAAE;AAFH;AADoB,CAAlB,CAAf;;eAOe,wBAAU7C,kBAAV,C","sourcesContent":["import * as React from \"react\";\nimport {\n View,\n TextInput,\n StyleSheet,\n StyleProp,\n ViewStyle,\n NativeSyntheticEvent,\n TextInputSubmitEditingEventData,\n} from \"react-native\";\nimport { withTheme } from \"../theming\";\nimport type { Theme } from \"../styles/DefaultTheme\";\nimport type { IconSlot } from \"../interfaces/Icon\";\nimport Config from \"./Config\";\n\ntype Props = {\n showIcon: boolean;\n icon?: string;\n placeholder?: string;\n style?: StyleProp<ViewStyle>;\n theme: Theme;\n onChange?: (text: string) => void;\n onSubmit?: (e: NativeSyntheticEvent<TextInputSubmitEditingEventData>) => void;\n value?: string;\n defaultValue?: string;\n} & IconSlot;\n\nconst FieldSearchBarFull: React.FC<Props> = ({\n showIcon,\n Icon,\n icon = \"search\",\n placeholder = \"\",\n style,\n theme: { colors, typography },\n onChange: changeOverride,\n onSubmit: submitOverride,\n value,\n defaultValue,\n}) => {\n const [focused, setIsFocused] = React.useState(false);\n\n const onBlur = () => {\n setIsFocused(false);\n };\n\n const [internalValue, setInternalValue] = React.useState<string | undefined>(\n value || defaultValue\n );\n\n React.useEffect(() => {\n if (value != null) {\n setInternalValue(value);\n }\n }, [value]);\n\n React.useEffect(() => {\n if (defaultValue != null) {\n setInternalValue(defaultValue);\n }\n }, [defaultValue]);\n\n const onChange = React.useCallback(\n (text: string) => {\n changeOverride && changeOverride(text);\n },\n [changeOverride]\n );\n\n const onFocus = () => {\n setIsFocused(true);\n };\n\n const onSubmit = (\n e: NativeSyntheticEvent<TextInputSubmitEditingEventData>\n ) => {\n submitOverride && submitOverride(e);\n };\n\n const { lineHeight, ...typeStyles } = typography.body2; // eslint-disable-line @typescript-eslint/no-unused-vars\n\n const handleChangeText = (newValue: string) => {\n setInternalValue(newValue);\n if (onChange) {\n onChange(newValue);\n }\n };\n\n return (\n <View style={[styles.container, style]}>\n {showIcon && (\n <Icon\n name={icon}\n size={Config.fieldSearchBarFullIconSize}\n color={focused ? colors.primary : colors.light}\n />\n )}\n <View style={{ marginLeft: showIcon ? 12 : 0, flex: 1 }}>\n <TextInput\n clearButtonMode=\"while-editing\"\n placeholder={placeholder}\n value={internalValue}\n onBlur={onBlur}\n onFocus={onFocus}\n onChangeText={handleChangeText}\n onSubmitEditing={onSubmit}\n placeholderTextColor={colors.light}\n style={[\n {\n color: colors.medium,\n },\n typeStyles,\n ]}\n />\n </View>\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n container: {\n flexDirection: \"row\",\n alignItems: \"center\",\n },\n});\n\nexport default withTheme(FieldSearchBarFull);\n"]}
|
|
@@ -11,8 +11,6 @@ var _Config = _interopRequireDefault(require("../Config"));
|
|
|
11
11
|
|
|
12
12
|
var _IconButton = _interopRequireDefault(require("../IconButton"));
|
|
13
13
|
|
|
14
|
-
var _utilities = require("../../utilities");
|
|
15
|
-
|
|
16
14
|
var _context = require("./context");
|
|
17
15
|
|
|
18
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -31,7 +29,7 @@ const RadioButton = _ref => {
|
|
|
31
29
|
value,
|
|
32
30
|
selected,
|
|
33
31
|
unselectedColor,
|
|
34
|
-
onPress,
|
|
32
|
+
onPress = () => {},
|
|
35
33
|
size = _Config.default.radioButtonSize,
|
|
36
34
|
selectedIcon = "MaterialIcons/radio-button-checked",
|
|
37
35
|
unselectedIcon = "MaterialIcons/radio-button-unchecked",
|
|
@@ -42,17 +40,16 @@ const RadioButton = _ref => {
|
|
|
42
40
|
value: contextValue,
|
|
43
41
|
onValueChange
|
|
44
42
|
} = (0, _context.useRadioButtonGroupContext)();
|
|
45
|
-
const realValue = (0, _utilities.getValueForRadioButton)(value);
|
|
46
|
-
const realContextValue = (0, _utilities.getValueForRadioButton)(contextValue);
|
|
47
|
-
const isSelected = selected !== null && selected !== void 0 ? selected : realContextValue && realValue && realContextValue === realValue;
|
|
48
43
|
|
|
49
44
|
const handlePress = () => {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
45
|
+
onPress && onPress();
|
|
46
|
+
|
|
47
|
+
if (onValueChange && value) {
|
|
48
|
+
onValueChange(value);
|
|
53
49
|
}
|
|
54
50
|
};
|
|
55
51
|
|
|
52
|
+
const isSelected = selected || contextValue != null && contextValue === value;
|
|
56
53
|
return /*#__PURE__*/React.createElement(_IconButton.default, _extends({
|
|
57
54
|
Icon: Icon,
|
|
58
55
|
icon: isSelected ? selectedIcon : unselectedIcon,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["RadioButton.tsx"],"names":["RadioButton","Icon","disabled","color","value","selected","unselectedColor","onPress","size","Config","radioButtonSize","selectedIcon","unselectedIcon","style","rest","contextValue","onValueChange","
|
|
1
|
+
{"version":3,"sources":["RadioButton.tsx"],"names":["RadioButton","Icon","disabled","color","value","selected","unselectedColor","onPress","size","Config","radioButtonSize","selectedIcon","unselectedIcon","style","rest","contextValue","onValueChange","handlePress","isSelected"],"mappings":";;;;;;;AAAA;;AAGA;;AACA;;AACA;;;;;;;;;;AAiBA,MAAMA,WAAuC,GAAG,QAa1C;AAAA,MAb2C;AAC/CC,IAAAA,IAD+C;AAE/CC,IAAAA,QAAQ,GAAG,KAFoC;AAG/CC,IAAAA,KAH+C;AAI/CC,IAAAA,KAJ+C;AAK/CC,IAAAA,QAL+C;AAM/CC,IAAAA,eAN+C;AAO/CC,IAAAA,OAAO,GAAG,MAAM,CAAE,CAP6B;AAQ/CC,IAAAA,IAAI,GAAGC,gBAAOC,eARiC;AAS/CC,IAAAA,YAAY,GAAG,oCATgC;AAU/CC,IAAAA,cAAc,GAAG,sCAV8B;AAW/CC,IAAAA,KAX+C;AAY/C,OAAGC;AAZ4C,GAa3C;AACJ,QAAM;AAAEV,IAAAA,KAAK,EAAEW,YAAT;AAAuBC,IAAAA;AAAvB,MAAyC,0CAA/C;;AAEA,QAAMC,WAAW,GAAG,MAAM;AACxBV,IAAAA,OAAO,IAAIA,OAAO,EAAlB;;AAEA,QAAIS,aAAa,IAAIZ,KAArB,EAA4B;AAC1BY,MAAAA,aAAa,CAACZ,KAAD,CAAb;AACD;AACF,GAND;;AAQA,QAAMc,UAAU,GACdb,QAAQ,IAAKU,YAAY,IAAI,IAAhB,IAAwBA,YAAY,KAAKX,KADxD;AAGA,sBACE,oBAAC,mBAAD;AACE,IAAA,IAAI,EAAEH,IADR;AAEE,IAAA,IAAI,EAAEiB,UAAU,GAAGP,YAAH,GAAkBC,cAFpC;AAGE,IAAA,KAAK,EAAEM,UAAU,GAAGf,KAAH,GAAWG,eAH9B;AAIE,IAAA,QAAQ,EAAEJ,QAJZ;AAKE,IAAA,OAAO,EAAEe,WALX;AAME,IAAA,IAAI,EAAET,IANR;AAOE,IAAA,KAAK,EAAEK;AAPT,KAQMC,IARN,EADF;AAYD,CAvCD;;eAyCed,W","sourcesContent":["import * as React from \"react\";\nimport { StyleProp, ViewStyle } from \"react-native\";\n\nimport Config from \"../Config\";\nimport IconButton from \"../IconButton\";\nimport { useRadioButtonGroupContext } from \"./context\";\n\nimport type { IconSlot } from \"../../interfaces/Icon\";\n\nexport type RadioButtonProps = {\n selected?: boolean;\n disabled?: boolean;\n color?: string;\n value?: string;\n unselectedColor?: string;\n onPress?: () => void;\n style?: StyleProp<ViewStyle>;\n size?: number;\n selectedIcon?: string;\n unselectedIcon?: string;\n} & IconSlot;\n\nconst RadioButton: React.FC<RadioButtonProps> = ({\n Icon,\n disabled = false,\n color,\n value,\n selected,\n unselectedColor,\n onPress = () => {},\n size = Config.radioButtonSize,\n selectedIcon = \"MaterialIcons/radio-button-checked\",\n unselectedIcon = \"MaterialIcons/radio-button-unchecked\",\n style,\n ...rest\n}) => {\n const { value: contextValue, onValueChange } = useRadioButtonGroupContext();\n\n const handlePress = () => {\n onPress && onPress();\n\n if (onValueChange && value) {\n onValueChange(value);\n }\n };\n\n const isSelected =\n selected || (contextValue != null && contextValue === value);\n\n return (\n <IconButton\n Icon={Icon}\n icon={isSelected ? selectedIcon : unselectedIcon}\n color={isSelected ? color : unselectedColor}\n disabled={disabled}\n onPress={handlePress}\n size={size}\n style={style}\n {...rest}\n />\n );\n};\n\nexport default RadioButton;\n"]}
|
|
@@ -9,8 +9,6 @@ var React = _interopRequireWildcard(require("react"));
|
|
|
9
9
|
|
|
10
10
|
var _reactNative = require("react-native");
|
|
11
11
|
|
|
12
|
-
var _utilities = require("../../utilities");
|
|
13
|
-
|
|
14
12
|
var _context = require("./context");
|
|
15
13
|
|
|
16
14
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -27,35 +25,27 @@ const RadioButtonGroup = _ref => {
|
|
|
27
25
|
let {
|
|
28
26
|
direction = _context.Direction.Vertical,
|
|
29
27
|
value,
|
|
30
|
-
onValueChange,
|
|
28
|
+
onValueChange = () => {},
|
|
31
29
|
defaultValue,
|
|
32
30
|
style,
|
|
33
31
|
children,
|
|
34
32
|
...rest
|
|
35
33
|
} = _ref;
|
|
36
|
-
const [internalValue, setInternalValue] = React.useState();
|
|
34
|
+
const [internalValue, setInternalValue] = React.useState(value || defaultValue);
|
|
37
35
|
React.useEffect(() => {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
if (realValue) {
|
|
41
|
-
setInternalValue(realValue);
|
|
36
|
+
if (value != null) {
|
|
37
|
+
setInternalValue(value);
|
|
42
38
|
}
|
|
43
39
|
}, [value]);
|
|
44
40
|
React.useEffect(() => {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
if (realDefaultValue) {
|
|
48
|
-
setInternalValue(realDefaultValue);
|
|
41
|
+
if (defaultValue != null) {
|
|
42
|
+
setInternalValue(defaultValue);
|
|
49
43
|
}
|
|
50
44
|
}, [defaultValue]);
|
|
51
45
|
|
|
52
46
|
const handleValueChange = newValue => {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
if (realNewValue) {
|
|
56
|
-
setInternalValue(realNewValue);
|
|
57
|
-
onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange(realNewValue);
|
|
58
|
-
}
|
|
47
|
+
setInternalValue(newValue);
|
|
48
|
+
onValueChange(newValue);
|
|
59
49
|
};
|
|
60
50
|
|
|
61
51
|
const _containerStyle = [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["RadioButtonGroup.tsx"],"names":["Provider","radioButtonGroupContext","RadioButtonGroup","direction","Direction","Vertical","value","onValueChange","defaultValue","style","children","rest","internalValue","setInternalValue","React","useState","useEffect","
|
|
1
|
+
{"version":3,"sources":["RadioButtonGroup.tsx"],"names":["Provider","radioButtonGroupContext","RadioButtonGroup","direction","Direction","Vertical","value","onValueChange","defaultValue","style","children","rest","internalValue","setInternalValue","React","useState","useEffect","handleValueChange","newValue","_containerStyle","flexDirection","Horizontal","push","alignItems","minHeight"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;;;;;;;AAWA,MAAM;AAAEA,EAAAA;AAAF,IAAeC,gCAArB;;AAEA,MAAMC,gBAAiD,GAAG,QAQpD;AAAA,MARqD;AACzDC,IAAAA,SAAS,GAAGC,mBAAUC,QADmC;AAEzDC,IAAAA,KAFyD;AAGzDC,IAAAA,aAAa,GAAG,MAAM,CAAE,CAHiC;AAIzDC,IAAAA,YAJyD;AAKzDC,IAAAA,KALyD;AAMzDC,IAAAA,QANyD;AAOzD,OAAGC;AAPsD,GAQrD;AACJ,QAAM,CAACC,aAAD,EAAgBC,gBAAhB,IAAoCC,KAAK,CAACC,QAAN,CACxCT,KAAK,IAAIE,YAD+B,CAA1C;AAIAM,EAAAA,KAAK,CAACE,SAAN,CAAgB,MAAM;AACpB,QAAIV,KAAK,IAAI,IAAb,EAAmB;AACjBO,MAAAA,gBAAgB,CAACP,KAAD,CAAhB;AACD;AACF,GAJD,EAIG,CAACA,KAAD,CAJH;AAMAQ,EAAAA,KAAK,CAACE,SAAN,CAAgB,MAAM;AACpB,QAAIR,YAAY,IAAI,IAApB,EAA0B;AACxBK,MAAAA,gBAAgB,CAACL,YAAD,CAAhB;AACD;AACF,GAJD,EAIG,CAACA,YAAD,CAJH;;AAMA,QAAMS,iBAAiB,GAAIC,QAAD,IAAsB;AAC9CL,IAAAA,gBAAgB,CAACK,QAAD,CAAhB;AACAX,IAAAA,aAAa,CAACW,QAAD,CAAb;AACD,GAHD;;AAKA,QAAMC,eAAqC,GAAG,CAC5C;AACEC,IAAAA,aAAa,EAAEjB,SAAS,KAAKC,mBAAUiB,UAAxB,GAAqC,KAArC,GAA6C;AAD9D,GAD4C,CAA9C;;AAMA,MAAIlB,SAAS,KAAKC,mBAAUC,QAA5B,EAAsC;AACpCc,IAAAA,eAAe,CAACG,IAAhB,CAAqB;AACnBC,MAAAA,UAAU,EAAE;AADO,KAArB;AAGD;;AAED,sBACE,oBAAC,iBAAD;AAAM,IAAA,KAAK,EAAE,CAAC;AAAEC,MAAAA,SAAS,EAAE;AAAb,KAAD,EAAoBf,KAApB;AAAb,KAA6CE,IAA7C,gBACE,oBAAC,QAAD;AACE,IAAA,KAAK,EAAE;AACLL,MAAAA,KAAK,EAAEM,aAAa,IAAI,EADnB;AAELL,MAAAA,aAAa,EAAEU,iBAFV;AAGLd,MAAAA;AAHK;AADT,kBAOE,oBAAC,iBAAD;AAAM,IAAA,KAAK,EAAEgB;AAAb,KAA+BT,QAA/B,CAPF,CADF,CADF;AAaD,CAvDD;;eAyDeR,gB","sourcesContent":["import * as React from \"react\";\nimport { View, StyleProp, ViewStyle } from \"react-native\";\nimport type { Theme } from \"../../styles/DefaultTheme\";\nimport { radioButtonGroupContext, Direction } from \"./context\";\nexport interface RadioButtonGroupProps {\n direction?: Direction;\n style?: StyleProp<ViewStyle>;\n value?: string;\n onValueChange?: (value: string) => void;\n defaultValue?: string;\n theme: Theme;\n children: React.ReactNode;\n}\n\nconst { Provider } = radioButtonGroupContext;\n\nconst RadioButtonGroup: React.FC<RadioButtonGroupProps> = ({\n direction = Direction.Vertical,\n value,\n onValueChange = () => {},\n defaultValue,\n style,\n children,\n ...rest\n}) => {\n const [internalValue, setInternalValue] = React.useState<string | undefined>(\n value || defaultValue\n );\n\n React.useEffect(() => {\n if (value != null) {\n setInternalValue(value);\n }\n }, [value]);\n\n React.useEffect(() => {\n if (defaultValue != null) {\n setInternalValue(defaultValue);\n }\n }, [defaultValue]);\n\n const handleValueChange = (newValue: string) => {\n setInternalValue(newValue);\n onValueChange(newValue);\n };\n\n const _containerStyle: StyleProp<ViewStyle> = [\n {\n flexDirection: direction === Direction.Horizontal ? \"row\" : \"column\",\n },\n ];\n\n if (direction !== Direction.Vertical) {\n _containerStyle.push({\n alignItems: \"center\",\n });\n }\n\n return (\n <View style={[{ minHeight: 40 }, style]} {...rest}>\n <Provider\n value={{\n value: internalValue || \"\",\n onValueChange: handleValueChange,\n direction,\n }}\n >\n <View style={_containerStyle}>{children}</View>\n </Provider>\n </View>\n );\n};\n\nexport default RadioButtonGroup;\n"]}
|
|
@@ -45,13 +45,13 @@ const getRadioButtonAlignment = (parentDirection, direction) => {
|
|
|
45
45
|
}
|
|
46
46
|
};
|
|
47
47
|
|
|
48
|
-
const renderLabel = (
|
|
49
|
-
if (typeof
|
|
48
|
+
const renderLabel = (value, labelStyle, textStyle) => {
|
|
49
|
+
if (typeof value === "string") {
|
|
50
50
|
return /*#__PURE__*/React.createElement(_Text.default, {
|
|
51
51
|
style: [labelStyle, textStyle]
|
|
52
|
-
},
|
|
52
|
+
}, value);
|
|
53
53
|
} else {
|
|
54
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null,
|
|
54
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, value);
|
|
55
55
|
}
|
|
56
56
|
};
|
|
57
57
|
|
|
@@ -62,7 +62,7 @@ const RadioButtonRow = _ref => {
|
|
|
62
62
|
value,
|
|
63
63
|
color,
|
|
64
64
|
unselectedColor,
|
|
65
|
-
onPress,
|
|
65
|
+
onPress = () => {},
|
|
66
66
|
labelContainerStyle,
|
|
67
67
|
labelStyle,
|
|
68
68
|
radioButtonStyle,
|
|
@@ -77,15 +77,10 @@ const RadioButtonRow = _ref => {
|
|
|
77
77
|
onValueChange,
|
|
78
78
|
direction: parentDirection
|
|
79
79
|
} = (0, _context.useRadioButtonGroupContext)();
|
|
80
|
-
const realValue = (0, _utilities.getValueForRadioButton)(value);
|
|
81
|
-
const realContextValue = (0, _utilities.getValueForRadioButton)(contextValue);
|
|
82
|
-
const isSelected = selected !== null && selected !== void 0 ? selected : realContextValue && realValue && realContextValue === realValue;
|
|
83
80
|
|
|
84
81
|
const handlePress = () => {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange(realValue);
|
|
88
|
-
}
|
|
82
|
+
onPress(value);
|
|
83
|
+
onValueChange && onValueChange(value);
|
|
89
84
|
};
|
|
90
85
|
|
|
91
86
|
const {
|
|
@@ -109,10 +104,10 @@ const RadioButtonRow = _ref => {
|
|
|
109
104
|
}
|
|
110
105
|
}, /*#__PURE__*/React.createElement(_RadioButton.default, {
|
|
111
106
|
Icon: Icon,
|
|
112
|
-
selected:
|
|
113
|
-
value: realValue,
|
|
107
|
+
selected: selected || contextValue != null && contextValue === value,
|
|
114
108
|
color: color,
|
|
115
109
|
unselectedColor: unselectedColor,
|
|
110
|
+
onPress: handlePress,
|
|
116
111
|
style: radioButtonStyle
|
|
117
112
|
})));
|
|
118
113
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["RadioButtonRow.tsx"],"names":["Direction","getRadioButtonAlignment","parentDirection","direction","GroupDirection","Horizontal","Row","RowReverse","renderLabel","
|
|
1
|
+
{"version":3,"sources":["RadioButtonRow.tsx"],"names":["Direction","getRadioButtonAlignment","parentDirection","direction","GroupDirection","Horizontal","Row","RowReverse","renderLabel","value","labelStyle","textStyle","RadioButtonRow","Icon","label","color","unselectedColor","onPress","labelContainerStyle","radioButtonStyle","selected","disabled","style","rest","contextValue","onValueChange","handlePress","textStyles","viewStyles","styles","mainParent","flexDirection","alignItems","flex","StyleSheet","create","justifyContent","paddingStart","minHeight","paddingEnd","Platform","select","web","cursor","userSelect"],"mappings":";;;;;;;AAAA;;AACA;;AAQA;;AACA;;AACA;;AAGA;;AACA;;;;;;;;;;IAEYA,S;;;WAAAA,S;AAAAA,EAAAA,S;AAAAA,EAAAA,S;GAAAA,S,yBAAAA,S;;AAiBZ,MAAMC,uBAAuB,GAAG,CAC9BC,eAD8B,EAE9BC,SAF8B,KAG3B;AACH,MAAID,eAAe,KAAKE,mBAAeC,UAAvC,EAAmD;AACjD,WAAOF,SAAS,KAAKH,SAAS,CAACM,GAAxB,GAA8B,YAA9B,GAA6C,UAApD;AACD,GAFD,MAEO,IAAIH,SAAS,KAAKH,SAAS,CAACO,UAA5B,EAAwC;AA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B,IAAAA,IAAI,EAAE;AADD;AAfwB,CAAlB,CAAf;;eAoBerB,c","sourcesContent":["import * as React from \"react\";\nimport {\n StyleProp,\n ViewStyle,\n StyleSheet,\n TextStyle,\n View,\n Platform,\n} from \"react-native\";\nimport RadioButton, { RadioButtonProps } from \"./RadioButton\";\nimport Text from \"../Text\";\nimport { useRadioButtonGroupContext } from \"./context\";\nimport type { IconSlot } from \"../../interfaces/Icon\";\nimport { Direction as GroupDirection } from \"./context\";\nimport Touchable from \"../Touchable\";\nimport { extractStyles } from \"../../utilities\";\n\nexport enum Direction {\n Row = \"row\",\n RowReverse = \"row-reverse\",\n}\n\nexport interface RadioButtonRowProps extends Omit<RadioButtonProps, \"onPress\"> {\n label: string | React.ReactNode;\n value: string; // A string that this radio button row represents when selected\n color?: string;\n unselectedColor?: string;\n labelContainerStyle: StyleProp<ViewStyle>;\n radioButtonStyle?: StyleProp<ViewStyle>;\n labelStyle?: StyleProp<TextStyle>;\n onPress?: (value: string) => void;\n direction?: Direction;\n}\n\nconst getRadioButtonAlignment = (\n parentDirection: GroupDirection | undefined,\n direction: Direction\n) => {\n if (parentDirection === GroupDirection.Horizontal) {\n return direction === Direction.Row ? \"flex-start\" : \"flex-end\";\n } else if (direction === Direction.RowReverse) {\n return \"flex-start\";\n } else {\n return \"flex-end\";\n }\n};\n\nconst renderLabel = (\n value: string | React.ReactNode,\n labelStyle: StyleProp<TextStyle>,\n textStyle: StyleProp<TextStyle>\n) => {\n if (typeof value === \"string\") {\n return <Text style={[labelStyle, textStyle]}>{value}</Text>;\n } else {\n return <>{value}</>;\n }\n};\n\nconst RadioButtonRow: React.FC<RadioButtonRowProps & IconSlot> = ({\n Icon,\n label,\n value,\n color,\n unselectedColor,\n onPress = () => {},\n labelContainerStyle,\n labelStyle,\n radioButtonStyle,\n direction = Direction.Row,\n selected,\n disabled,\n style,\n ...rest\n}) => {\n const {\n value: contextValue,\n onValueChange,\n direction: parentDirection,\n } = useRadioButtonGroupContext();\n\n const handlePress = () => {\n onPress(value);\n onValueChange && onValueChange(value);\n };\n\n const { textStyles, viewStyles } = extractStyles(style);\n\n return (\n <Touchable\n onPress={handlePress}\n style={[styles.mainParent, { flexDirection: direction }, viewStyles]}\n disabled={disabled}\n {...rest}\n >\n <View\n style={[\n styles.label,\n {\n alignItems: direction === Direction.Row ? \"flex-start\" : \"flex-end\",\n },\n labelContainerStyle,\n ]}\n >\n {renderLabel(label, labelStyle, textStyles)}\n </View>\n <View\n style={{\n flex: 1,\n alignItems: getRadioButtonAlignment(parentDirection, direction),\n }}\n >\n <RadioButton\n Icon={Icon}\n selected={\n selected || (contextValue != null && contextValue === value)\n }\n color={color}\n unselectedColor={unselectedColor}\n onPress={handlePress}\n style={radioButtonStyle}\n />\n </View>\n </Touchable>\n );\n};\n\nconst styles = StyleSheet.create({\n mainParent: {\n alignItems: \"center\",\n justifyContent: \"space-around\",\n paddingStart: 20,\n minHeight: 50,\n paddingEnd: 20,\n flex: 1,\n ...Platform.select({\n web: {\n cursor: \"pointer\",\n userSelect: \"none\",\n },\n }),\n },\n label: {\n flex: 3,\n },\n});\n\nexport default RadioButtonRow;\n"]}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "Table", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _table.default;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "TableCell", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _tableCell.default;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "TableHeader", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _tableHeader.default;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "TablePaginator", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _tablePaginator.default;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(exports, "TableRow", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () {
|
|
33
|
+
return _tableRow.default;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
Object.defineProperty(exports, "TableTitle", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function () {
|
|
39
|
+
return _tableTitle.default;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
var _table = _interopRequireDefault(require("./table"));
|
|
44
|
+
|
|
45
|
+
var _tableHeader = _interopRequireDefault(require("./tableHeader"));
|
|
46
|
+
|
|
47
|
+
var _tablePaginator = _interopRequireDefault(require("./tablePaginator"));
|
|
48
|
+
|
|
49
|
+
var _tableRow = _interopRequireDefault(require("./tableRow"));
|
|
50
|
+
|
|
51
|
+
var _tableCell = _interopRequireDefault(require("./tableCell"));
|
|
52
|
+
|
|
53
|
+
var _tableTitle = _interopRequireDefault(require("./tableTitle"));
|
|
54
|
+
|
|
55
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
56
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA","sourcesContent":["export { default as Table } from \"./table\";\nexport { default as TableHeader } from \"./tableHeader\";\nexport { default as TablePaginator } from \"./tablePaginator\";\nexport { default as TableRow } from \"./tableRow\";\nexport { default as TableCell } from \"./tableCell\";\nexport { default as TableTitle } from \"./tableTitle\";\n"]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _reactNative = require("react-native");
|
|
11
|
+
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
|
|
14
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
15
|
+
|
|
16
|
+
const Table = _ref => {
|
|
17
|
+
let {
|
|
18
|
+
children,
|
|
19
|
+
style,
|
|
20
|
+
...rest
|
|
21
|
+
} = _ref;
|
|
22
|
+
return /*#__PURE__*/_react.default.createElement(_reactNative.View, _extends({}, rest, {
|
|
23
|
+
style: [styles.wrapper, style]
|
|
24
|
+
}), children);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const styles = _reactNative.StyleSheet.create({
|
|
28
|
+
wrapper: {
|
|
29
|
+
display: "flex",
|
|
30
|
+
flexDirection: "column"
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
var _default = Table;
|
|
35
|
+
exports.default = _default;
|
|
36
|
+
//# sourceMappingURL=table.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["table.tsx"],"names":["Table","children","style","rest","styles","wrapper","StyleSheet","create","display","flexDirection"],"mappings":";;;;;;;AAAA;;AACA;;;;;;AAOA,MAAMA,KAAK,GAAG;AAAA,MAAC;AAAEC,IAAAA,QAAF;AAAYC,IAAAA,KAAZ;AAAmB,OAAGC;AAAtB,GAAD;AAAA,sBACZ,6BAAC,iBAAD,eAAUA,IAAV;AAAgB,IAAA,KAAK,EAAE,CAACC,MAAM,CAACC,OAAR,EAAiBH,KAAjB;AAAvB,MACGD,QADH,CADY;AAAA,CAAd;;AAMA,MAAMG,MAAM,GAAGE,wBAAWC,MAAX,CAAkB;AAC/BF,EAAAA,OAAO,EAAE;AACPG,IAAAA,OAAO,EAAE,MADF;AAEPC,IAAAA,aAAa,EAAE;AAFR;AADsB,CAAlB,CAAf;;eAOeT,K","sourcesContent":["import React from \"react\";\nimport { View, StyleProp, ViewStyle, StyleSheet } from \"react-native\";\n\nexport interface TableProps {\n children: React.ReactNode;\n style?: StyleProp<ViewStyle>;\n}\n\nconst Table = ({ children, style, ...rest }: TableProps) => (\n <View {...rest} style={[styles.wrapper, style]}>\n {children}\n </View>\n);\n\nconst styles = StyleSheet.create({\n wrapper: {\n display: \"flex\",\n flexDirection: \"column\",\n },\n});\n\nexport default Table;\n"]}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _reactNative = require("react-native");
|
|
11
|
+
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
|
|
14
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
15
|
+
|
|
16
|
+
const TableCell = _ref => {
|
|
17
|
+
let {
|
|
18
|
+
children,
|
|
19
|
+
style,
|
|
20
|
+
numeric,
|
|
21
|
+
value,
|
|
22
|
+
...rest
|
|
23
|
+
} = _ref;
|
|
24
|
+
return /*#__PURE__*/_react.default.createElement(_reactNative.View, _extends({}, rest, {
|
|
25
|
+
style: [styles.wrapper, numeric && styles.right, style]
|
|
26
|
+
}), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
27
|
+
numberOfLines: 1
|
|
28
|
+
}, children, value));
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const styles = _reactNative.StyleSheet.create({
|
|
32
|
+
wrapper: {
|
|
33
|
+
flex: 1,
|
|
34
|
+
display: "flex",
|
|
35
|
+
flexDirection: "row"
|
|
36
|
+
},
|
|
37
|
+
right: {
|
|
38
|
+
justifyContent: "flex-end"
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
var _default = TableCell;
|
|
43
|
+
exports.default = _default;
|
|
44
|
+
//# sourceMappingURL=tableCell.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["tableCell.tsx"],"names":["TableCell","children","style","numeric","value","rest","styles","wrapper","right","StyleSheet","create","flex","display","flexDirection","justifyContent"],"mappings":";;;;;;;AAAA;;AACA;;;;;;AASA,MAAMA,SAAS,GAAG;AAAA,MAAC;AACjBC,IAAAA,QADiB;AAEjBC,IAAAA,KAFiB;AAGjBC,IAAAA,OAHiB;AAIjBC,IAAAA,KAJiB;AAKjB,OAAGC;AALc,GAAD;AAAA,sBAOhB,6BAAC,iBAAD,eAAUA,IAAV;AAAgB,IAAA,KAAK,EAAE,CAACC,MAAM,CAACC,OAAR,EAAiBJ,OAAO,IAAIG,MAAM,CAACE,KAAnC,EAA0CN,KAA1C;AAAvB,mBACE,6BAAC,iBAAD;AAAM,IAAA,aAAa,EAAE;AAArB,KACGD,QADH,EAEGG,KAFH,CADF,CAPgB;AAAA,CAAlB;;AAeA,MAAME,MAAM,GAAGG,wBAAWC,MAAX,CAAkB;AAC/BH,EAAAA,OAAO,EAAE;AACPI,IAAAA,IAAI,EAAE,CADC;AAEPC,IAAAA,OAAO,EAAE,MAFF;AAGPC,IAAAA,aAAa,EAAE;AAHR,GADsB;AAM/BL,EAAAA,KAAK,EAAE;AACLM,IAAAA,cAAc,EAAE;AADX;AANwB,CAAlB,CAAf;;eAWed,S","sourcesContent":["import React from \"react\";\nimport { View, Text, StyleProp, ViewStyle, StyleSheet } from \"react-native\";\n\nexport interface TableCellProps {\n children: React.ReactNode;\n numeric?: boolean;\n style?: StyleProp<ViewStyle>;\n value: string;\n}\n\nconst TableCell = ({\n children,\n style,\n numeric,\n value,\n ...rest\n}: TableCellProps) => (\n <View {...rest} style={[styles.wrapper, numeric && styles.right, style]}>\n <Text numberOfLines={1}>\n {children}\n {value}\n </Text>\n </View>\n);\n\nconst styles = StyleSheet.create({\n wrapper: {\n flex: 1,\n display: \"flex\",\n flexDirection: \"row\",\n },\n right: {\n justifyContent: \"flex-end\",\n },\n});\n\nexport default TableCell;\n"]}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _reactNative = require("react-native");
|
|
11
|
+
|
|
12
|
+
var _theming = require("../../theming");
|
|
13
|
+
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
+
|
|
16
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
17
|
+
|
|
18
|
+
const TableHeader = _ref => {
|
|
19
|
+
let {
|
|
20
|
+
children,
|
|
21
|
+
style,
|
|
22
|
+
theme,
|
|
23
|
+
...rest
|
|
24
|
+
} = _ref;
|
|
25
|
+
return /*#__PURE__*/_react.default.createElement(_reactNative.View, _extends({}, rest, {
|
|
26
|
+
style: [styles.wrapper, {
|
|
27
|
+
borderBottomColor: theme.colors.medium
|
|
28
|
+
}, style]
|
|
29
|
+
}), children);
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const styles = _reactNative.StyleSheet.create({
|
|
33
|
+
wrapper: {
|
|
34
|
+
display: "flex",
|
|
35
|
+
flexDirection: "row"
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
var _default = (0, _theming.withTheme)(TableHeader);
|
|
40
|
+
|
|
41
|
+
exports.default = _default;
|
|
42
|
+
//# sourceMappingURL=tableHeader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["tableHeader.tsx"],"names":["TableHeader","children","style","theme","rest","styles","wrapper","borderBottomColor","colors","medium","StyleSheet","create","display","flexDirection"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;;;;;AAQA,MAAMA,WAAW,GAAG;AAAA,MAAC;AAAEC,IAAAA,QAAF;AAAYC,IAAAA,KAAZ;AAAmBC,IAAAA,KAAnB;AAA0B,OAAGC;AAA7B,GAAD;AAAA,sBAClB,6BAAC,iBAAD,eACMA,IADN;AAEE,IAAA,KAAK,EAAE,CAACC,MAAM,CAACC,OAAR,EAAiB;AAAEC,MAAAA,iBAAiB,EAAEJ,KAAK,CAACK,MAAN,CAAaC;AAAlC,KAAjB,EAA6DP,KAA7D;AAFT,MAIGD,QAJH,CADkB;AAAA,CAApB;;AASA,MAAMI,MAAM,GAAGK,wBAAWC,MAAX,CAAkB;AAC/BL,EAAAA,OAAO,EAAE;AACPM,IAAAA,OAAO,EAAE,MADF;AAEPC,IAAAA,aAAa,EAAE;AAFR;AADsB,CAAlB,CAAf;;eAOe,wBAAUb,WAAV,C","sourcesContent":["import React from \"react\";\nimport { View, StyleProp, ViewStyle, StyleSheet } from \"react-native\";\nimport { Theme } from \"../../styles/DefaultTheme\";\nimport { withTheme } from \"../../theming\";\n\nexport interface TableHeaderProps {\n children: React.ReactNode;\n style?: StyleProp<ViewStyle>;\n theme: Theme;\n}\n\nconst TableHeader = ({ children, style, theme, ...rest }: TableHeaderProps) => (\n <View\n {...rest}\n style={[styles.wrapper, { borderBottomColor: theme.colors.medium }, style]}\n >\n {children}\n </View>\n);\n\nconst styles = StyleSheet.create({\n wrapper: {\n display: \"flex\",\n flexDirection: \"row\",\n },\n});\n\nexport default withTheme(TableHeader);\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _reactNative = require("react-native");
|
|
11
|
+
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
|
|
14
|
+
const TablePaginator = () => /*#__PURE__*/_react.default.createElement(_reactNative.View, null, /*#__PURE__*/_react.default.createElement(_reactNative.Text, null, "Table Paginator"));
|
|
15
|
+
|
|
16
|
+
var _default = TablePaginator;
|
|
17
|
+
exports.default = _default;
|
|
18
|
+
//# sourceMappingURL=tablePaginator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["tablePaginator.tsx"],"names":["TablePaginator"],"mappings":";;;;;;;AAAA;;AACA;;;;AAEA,MAAMA,cAAc,GAAG,mBACrB,6BAAC,iBAAD,qBACE,6BAAC,iBAAD,0BADF,CADF;;eAMeA,c","sourcesContent":["import React from \"react\";\nimport { View, Text } from \"react-native\";\n\nconst TablePaginator = () => (\n <View>\n <Text>Table Paginator</Text>\n </View>\n);\n\nexport default TablePaginator;\n"]}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _reactNative = require("react-native");
|
|
11
|
+
|
|
12
|
+
var _theming = require("../../theming");
|
|
13
|
+
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
+
|
|
16
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
17
|
+
|
|
18
|
+
const TableRow = _ref => {
|
|
19
|
+
let {
|
|
20
|
+
children,
|
|
21
|
+
style,
|
|
22
|
+
theme,
|
|
23
|
+
...rest
|
|
24
|
+
} = _ref;
|
|
25
|
+
return /*#__PURE__*/_react.default.createElement(_reactNative.View, _extends({}, rest, {
|
|
26
|
+
style: [styles.container, {
|
|
27
|
+
borderBottomColor: theme.colors.light
|
|
28
|
+
}, style]
|
|
29
|
+
}), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
30
|
+
style: styles.content
|
|
31
|
+
}, children));
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const styles = _reactNative.StyleSheet.create({
|
|
35
|
+
container: {
|
|
36
|
+
display: "flex",
|
|
37
|
+
flexDirection: "row"
|
|
38
|
+
},
|
|
39
|
+
content: {
|
|
40
|
+
flex: 1,
|
|
41
|
+
flexDirection: "row"
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
var _default = (0, _theming.withTheme)(TableRow);
|
|
46
|
+
|
|
47
|
+
exports.default = _default;
|
|
48
|
+
//# sourceMappingURL=tableRow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["tableRow.tsx"],"names":["TableRow","children","style","theme","rest","styles","container","borderBottomColor","colors","light","content","StyleSheet","create","display","flexDirection","flex"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;;;;;AAOA,MAAMA,QAAQ,GAAG;AAAA,MAAC;AAAEC,IAAAA,QAAF;AAAYC,IAAAA,KAAZ;AAAmBC,IAAAA,KAAnB;AAA0B,OAAGC;AAA7B,GAAD;AAAA,sBACf,6BAAC,iBAAD,eACMA,IADN;AAEE,IAAA,KAAK,EAAE,CAACC,MAAM,CAACC,SAAR,EAAmB;AAAEC,MAAAA,iBAAiB,EAAEJ,KAAK,CAACK,MAAN,CAAaC;AAAlC,KAAnB,EAA8DP,KAA9D;AAFT,mBAIE,6BAAC,iBAAD;AAAM,IAAA,KAAK,EAAEG,MAAM,CAACK;AAApB,KAA8BT,QAA9B,CAJF,CADe;AAAA,CAAjB;;AASA,MAAMI,MAAM,GAAGM,wBAAWC,MAAX,CAAkB;AAC/BN,EAAAA,SAAS,EAAE;AACTO,IAAAA,OAAO,EAAE,MADA;AAETC,IAAAA,aAAa,EAAE;AAFN,GADoB;AAK/BJ,EAAAA,OAAO,EAAE;AACPK,IAAAA,IAAI,EAAE,CADC;AAEPD,IAAAA,aAAa,EAAE;AAFR;AALsB,CAAlB,CAAf;;eAWe,wBAAUd,QAAV,C","sourcesContent":["import React from \"react\";\nimport { View, StyleProp, ViewStyle, StyleSheet } from \"react-native\";\nimport { Theme } from \"../../styles/DefaultTheme\";\nimport { withTheme } from \"../../theming\";\nexport interface TableRowProps {\n children: React.ReactNode;\n style?: StyleProp<ViewStyle>;\n theme: Theme;\n}\n\nconst TableRow = ({ children, style, theme, ...rest }: TableRowProps) => (\n <View\n {...rest}\n style={[styles.container, { borderBottomColor: theme.colors.light }, style]}\n >\n <View style={styles.content}>{children}</View>\n </View>\n);\n\nconst styles = StyleSheet.create({\n container: {\n display: \"flex\",\n flexDirection: \"row\",\n },\n content: {\n flex: 1,\n flexDirection: \"row\",\n },\n});\n\nexport default withTheme(TableRow);\n"]}
|