@draftbit/core 43.4.5-d442fc.1 → 43.4.6-28bb0e.2

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.
Files changed (89) hide show
  1. package/lib/commonjs/components/Elevation.js +3 -14
  2. package/lib/commonjs/components/Elevation.js.map +1 -1
  3. package/lib/commonjs/components/FAB.js +19 -5
  4. package/lib/commonjs/components/FAB.js.map +1 -1
  5. package/lib/commonjs/components/FieldSearchBarFull.js.map +1 -1
  6. package/lib/commonjs/components/NumberInput.js +30 -29
  7. package/lib/commonjs/components/NumberInput.js.map +1 -1
  8. package/lib/commonjs/components/RadioButton/RadioButton.js +9 -8
  9. package/lib/commonjs/components/RadioButton/RadioButton.js.map +1 -1
  10. package/lib/commonjs/components/RadioButton/RadioButtonGroup.js +13 -12
  11. package/lib/commonjs/components/RadioButton/RadioButtonGroup.js.map +1 -1
  12. package/lib/commonjs/components/RadioButton/RadioButtonRow.js +9 -6
  13. package/lib/commonjs/components/RadioButton/RadioButtonRow.js.map +1 -1
  14. package/lib/commonjs/index.js +0 -14
  15. package/lib/commonjs/index.js.map +1 -1
  16. package/lib/commonjs/mappings/CheckboxRow.js +1 -1
  17. package/lib/commonjs/mappings/CheckboxRow.js.map +1 -1
  18. package/lib/commonjs/mappings/TextInput.js +7 -2
  19. package/lib/commonjs/mappings/TextInput.js.map +1 -1
  20. package/lib/commonjs/utilities.js +13 -0
  21. package/lib/commonjs/utilities.js.map +1 -1
  22. package/lib/module/components/NumberInput.js +26 -25
  23. package/lib/module/components/NumberInput.js.map +1 -1
  24. package/lib/module/components/RadioButton/RadioButton.js +8 -8
  25. package/lib/module/components/RadioButton/RadioButton.js.map +1 -1
  26. package/lib/module/components/RadioButton/RadioButtonGroup.js +12 -12
  27. package/lib/module/components/RadioButton/RadioButtonGroup.js.map +1 -1
  28. package/lib/module/components/RadioButton/RadioButtonRow.js +10 -7
  29. package/lib/module/components/RadioButton/RadioButtonRow.js.map +1 -1
  30. package/lib/module/index.js +0 -1
  31. package/lib/module/index.js.map +1 -1
  32. package/lib/module/mappings/CheckboxRow.js +1 -1
  33. package/lib/module/mappings/CheckboxRow.js.map +1 -1
  34. package/lib/module/mappings/TextInput.js +8 -3
  35. package/lib/module/mappings/TextInput.js.map +1 -1
  36. package/lib/module/utilities.js +10 -0
  37. package/lib/module/utilities.js.map +1 -1
  38. package/lib/typescript/src/components/NumberInput.d.ts +3 -3
  39. package/lib/typescript/src/components/RadioButton/RadioButton.d.ts +2 -2
  40. package/lib/typescript/src/components/RadioButton/RadioButtonGroup.d.ts +2 -2
  41. package/lib/typescript/src/components/RadioButton/RadioButtonRow.d.ts +1 -1
  42. package/lib/typescript/src/index.d.ts +0 -1
  43. package/lib/typescript/src/mappings/TextInput.d.ts +38 -38
  44. package/lib/typescript/src/utilities.d.ts +1 -0
  45. package/package.json +2 -4
  46. package/src/components/NumberInput.js +27 -21
  47. package/src/components/NumberInput.tsx +41 -29
  48. package/src/components/RadioButton/RadioButton.js +7 -6
  49. package/src/components/RadioButton/RadioButton.tsx +11 -12
  50. package/src/components/RadioButton/RadioButtonGroup.js +10 -10
  51. package/src/components/RadioButton/RadioButtonGroup.tsx +18 -17
  52. package/src/components/RadioButton/RadioButtonRow.js +8 -5
  53. package/src/components/RadioButton/RadioButtonRow.tsx +12 -10
  54. package/src/index.js +0 -1
  55. package/src/index.tsx +0 -1
  56. package/src/mappings/CheckboxRow.js +1 -1
  57. package/src/mappings/CheckboxRow.ts +1 -1
  58. package/src/mappings/TextInput.js +7 -2
  59. package/src/mappings/TextInput.ts +7 -1
  60. package/src/utilities.js +12 -0
  61. package/src/utilities.ts +11 -0
  62. package/lib/commonjs/components/TabView/TabView.js +0 -103
  63. package/lib/commonjs/components/TabView/TabView.js.map +0 -1
  64. package/lib/commonjs/components/TabView/TabViewItem.js +0 -27
  65. package/lib/commonjs/components/TabView/TabViewItem.js.map +0 -1
  66. package/lib/commonjs/components/TabView/index.js +0 -24
  67. package/lib/commonjs/components/TabView/index.js.map +0 -1
  68. package/lib/commonjs/mappings/TabView.js +0 -80
  69. package/lib/commonjs/mappings/TabView.js.map +0 -1
  70. package/lib/module/components/TabView/TabView.js +0 -88
  71. package/lib/module/components/TabView/TabView.js.map +0 -1
  72. package/lib/module/components/TabView/TabViewItem.js +0 -19
  73. package/lib/module/components/TabView/TabViewItem.js.map +0 -1
  74. package/lib/module/components/TabView/index.js +0 -3
  75. package/lib/module/components/TabView/index.js.map +0 -1
  76. package/lib/module/mappings/TabView.js +0 -71
  77. package/lib/module/mappings/TabView.js.map +0 -1
  78. package/lib/typescript/src/components/TabView/TabView.d.ts +0 -19
  79. package/lib/typescript/src/components/TabView/TabViewItem.d.ts +0 -10
  80. package/lib/typescript/src/components/TabView/index.d.ts +0 -2
  81. package/lib/typescript/src/mappings/TabView.d.ts +0 -111
  82. package/src/components/TabView/TabView.js +0 -33
  83. package/src/components/TabView/TabView.tsx +0 -97
  84. package/src/components/TabView/TabViewItem.js +0 -5
  85. package/src/components/TabView/TabViewItem.tsx +0 -21
  86. package/src/components/TabView/index.js +0 -2
  87. package/src/components/TabView/index.ts +0 -2
  88. package/src/mappings/TabView.js +0 -73
  89. package/src/mappings/TabView.ts +0 -80
@@ -3,6 +3,7 @@ import { StyleProp, ViewStyle } from "react-native";
3
3
 
4
4
  import Config from "../Config";
5
5
  import IconButton from "../IconButton";
6
+ import { getValueForRadioButton } from "../../utilities";
6
7
  import { useRadioButtonGroupContext } from "./context";
7
8
 
8
9
  import type { IconSlot } from "../../interfaces/Icon";
@@ -11,9 +12,9 @@ export type RadioButtonProps = {
11
12
  selected?: boolean;
12
13
  disabled?: boolean;
13
14
  color?: string;
14
- value?: string;
15
+ value?: string | number;
15
16
  unselectedColor?: string;
16
- onPress?: () => void;
17
+ onPress?: (value?: string) => void;
17
18
  style?: StyleProp<ViewStyle>;
18
19
  size?: number;
19
20
  selectedIcon?: string;
@@ -24,10 +25,10 @@ const RadioButton: React.FC<RadioButtonProps> = ({
24
25
  Icon,
25
26
  disabled = false,
26
27
  color,
27
- value,
28
+ value = "",
28
29
  selected,
29
30
  unselectedColor,
30
- onPress = () => {},
31
+ onPress,
31
32
  size = Config.radioButtonSize,
32
33
  selectedIcon = "MaterialIcons/radio-button-checked",
33
34
  unselectedIcon = "MaterialIcons/radio-button-unchecked",
@@ -36,17 +37,15 @@ const RadioButton: React.FC<RadioButtonProps> = ({
36
37
  }) => {
37
38
  const { value: contextValue, onValueChange } = useRadioButtonGroupContext();
38
39
 
39
- const handlePress = () => {
40
- onPress && onPress();
40
+ const realValue = getValueForRadioButton(value);
41
+ const realContextValue = getValueForRadioButton(contextValue);
42
+ const isSelected = selected ?? realContextValue === realValue;
41
43
 
42
- if (onValueChange && value) {
43
- onValueChange(value);
44
- }
44
+ const handlePress = () => {
45
+ onPress?.(realValue);
46
+ onValueChange?.(realValue);
45
47
  };
46
48
 
47
- const isSelected =
48
- selected || (contextValue != null && contextValue === value);
49
-
50
49
  return (
51
50
  <IconButton
52
51
  Icon={Icon}
@@ -1,22 +1,22 @@
1
1
  import * as React from "react";
2
2
  import { View } from "react-native";
3
+ import { getValueForRadioButton } from "../../utilities";
3
4
  import { radioButtonGroupContext, Direction } from "./context";
4
5
  const { Provider } = radioButtonGroupContext;
5
- const RadioButtonGroup = ({ direction = Direction.Vertical, value, onValueChange = () => { }, defaultValue, style, children, ...rest }) => {
6
- const [internalValue, setInternalValue] = React.useState(value || defaultValue);
6
+ const RadioButtonGroup = ({ direction = Direction.Vertical, value = "", onValueChange, defaultValue = "", style, children, ...rest }) => {
7
+ const [internalValue, setInternalValue] = React.useState("");
7
8
  React.useEffect(() => {
8
- if (value != null) {
9
- setInternalValue(value);
10
- }
9
+ const realValue = getValueForRadioButton(value);
10
+ setInternalValue(realValue);
11
11
  }, [value]);
12
12
  React.useEffect(() => {
13
- if (defaultValue != null) {
14
- setInternalValue(defaultValue);
15
- }
13
+ const realDefaultValue = getValueForRadioButton(defaultValue);
14
+ setInternalValue(realDefaultValue);
16
15
  }, [defaultValue]);
17
16
  const handleValueChange = (newValue) => {
18
- setInternalValue(newValue);
19
- onValueChange(newValue);
17
+ const realNewValue = getValueForRadioButton(newValue);
18
+ setInternalValue(realNewValue);
19
+ onValueChange?.(realNewValue);
20
20
  };
21
21
  const _containerStyle = [
22
22
  {
@@ -1,13 +1,14 @@
1
1
  import * as React from "react";
2
2
  import { View, StyleProp, ViewStyle } from "react-native";
3
3
  import type { Theme } from "../../styles/DefaultTheme";
4
+ import { getValueForRadioButton } from "../../utilities";
4
5
  import { radioButtonGroupContext, Direction } from "./context";
5
6
  export interface RadioButtonGroupProps {
6
7
  direction?: Direction;
7
8
  style?: StyleProp<ViewStyle>;
8
- value?: string;
9
+ value: string;
9
10
  onValueChange?: (value: string) => void;
10
- defaultValue?: string;
11
+ defaultValue?: string | number;
11
12
  theme: Theme;
12
13
  children: React.ReactNode;
13
14
  }
@@ -16,32 +17,32 @@ const { Provider } = radioButtonGroupContext;
16
17
 
17
18
  const RadioButtonGroup: React.FC<RadioButtonGroupProps> = ({
18
19
  direction = Direction.Vertical,
19
- value,
20
- onValueChange = () => {},
21
- defaultValue,
20
+ value = "",
21
+ onValueChange,
22
+ defaultValue = "",
22
23
  style,
23
24
  children,
24
25
  ...rest
25
26
  }) => {
26
- const [internalValue, setInternalValue] = React.useState<string | undefined>(
27
- value || defaultValue
28
- );
27
+ const [internalValue, setInternalValue] = React.useState<string>("");
29
28
 
30
29
  React.useEffect(() => {
31
- if (value != null) {
32
- setInternalValue(value);
33
- }
30
+ const realValue = getValueForRadioButton(value);
31
+
32
+ setInternalValue(realValue);
34
33
  }, [value]);
35
34
 
36
35
  React.useEffect(() => {
37
- if (defaultValue != null) {
38
- setInternalValue(defaultValue);
39
- }
36
+ const realDefaultValue = getValueForRadioButton(defaultValue);
37
+
38
+ setInternalValue(realDefaultValue);
40
39
  }, [defaultValue]);
41
40
 
42
- const handleValueChange = (newValue: string) => {
43
- setInternalValue(newValue);
44
- onValueChange(newValue);
41
+ const handleValueChange = (newValue: string | number) => {
42
+ const realNewValue = getValueForRadioButton(newValue);
43
+
44
+ setInternalValue(realNewValue);
45
+ onValueChange?.(realNewValue);
45
46
  };
46
47
 
47
48
  const _containerStyle: StyleProp<ViewStyle> = [
@@ -5,7 +5,7 @@ import Text from "../Text";
5
5
  import { useRadioButtonGroupContext } from "./context";
6
6
  import { Direction as GroupDirection } from "./context";
7
7
  import Touchable from "../Touchable";
8
- import { extractStyles } from "../../utilities";
8
+ import { extractStyles, getValueForRadioButton } from "../../utilities";
9
9
  export var Direction;
10
10
  (function (Direction) {
11
11
  Direction["Row"] = "row";
@@ -30,11 +30,14 @@ const renderLabel = (value, labelStyle, textStyle) => {
30
30
  return React.createElement(React.Fragment, null, value);
31
31
  }
32
32
  };
33
- const RadioButtonRow = ({ Icon, label, value, color, unselectedColor, onPress = () => { }, labelContainerStyle, labelStyle, radioButtonStyle, direction = Direction.Row, selected, disabled, style, ...rest }) => {
33
+ const RadioButtonRow = ({ Icon, label, value = "", color, unselectedColor, onPress, labelContainerStyle, labelStyle, radioButtonStyle, direction = Direction.Row, selected, disabled, style, ...rest }) => {
34
34
  const { value: contextValue, onValueChange, direction: parentDirection, } = useRadioButtonGroupContext();
35
+ const realValue = getValueForRadioButton(value);
36
+ const realContextValue = getValueForRadioButton(contextValue);
37
+ const isSelected = selected ?? realContextValue === realValue;
35
38
  const handlePress = () => {
36
- onPress(value);
37
- onValueChange && onValueChange(value);
39
+ onPress?.(realValue);
40
+ onValueChange?.(realValue);
38
41
  };
39
42
  const { textStyles, viewStyles } = extractStyles(style);
40
43
  return (React.createElement(Touchable, { onPress: handlePress, style: [styles.mainParent, { flexDirection: direction }, viewStyles], disabled: disabled, ...rest },
@@ -49,7 +52,7 @@ const RadioButtonRow = ({ Icon, label, value, color, unselectedColor, onPress =
49
52
  flex: 1,
50
53
  alignItems: getRadioButtonAlignment(parentDirection, direction),
51
54
  } },
52
- React.createElement(RadioButton, { Icon: Icon, selected: selected || (contextValue != null && contextValue === value), color: color, unselectedColor: unselectedColor, onPress: handlePress, style: radioButtonStyle }))));
55
+ React.createElement(RadioButton, { Icon: Icon, selected: isSelected, value: realValue, color: color, unselectedColor: unselectedColor, style: radioButtonStyle }))));
53
56
  };
54
57
  const styles = StyleSheet.create({
55
58
  mainParent: {
@@ -13,7 +13,7 @@ import { useRadioButtonGroupContext } from "./context";
13
13
  import type { IconSlot } from "../../interfaces/Icon";
14
14
  import { Direction as GroupDirection } from "./context";
15
15
  import Touchable from "../Touchable";
16
- import { extractStyles } from "../../utilities";
16
+ import { extractStyles, getValueForRadioButton } from "../../utilities";
17
17
 
18
18
  export enum Direction {
19
19
  Row = "row",
@@ -22,7 +22,7 @@ export enum Direction {
22
22
 
23
23
  export interface RadioButtonRowProps extends Omit<RadioButtonProps, "onPress"> {
24
24
  label: string | React.ReactNode;
25
- value: string; // A string that this radio button row represents when selected
25
+ value: string | number; // A string (or number that will be parsed String(number)) that this radio button row represents when selected
26
26
  color?: string;
27
27
  unselectedColor?: string;
28
28
  labelContainerStyle: StyleProp<ViewStyle>;
@@ -60,10 +60,10 @@ const renderLabel = (
60
60
  const RadioButtonRow: React.FC<RadioButtonRowProps & IconSlot> = ({
61
61
  Icon,
62
62
  label,
63
- value,
63
+ value = "",
64
64
  color,
65
65
  unselectedColor,
66
- onPress = () => {},
66
+ onPress,
67
67
  labelContainerStyle,
68
68
  labelStyle,
69
69
  radioButtonStyle,
@@ -79,9 +79,13 @@ const RadioButtonRow: React.FC<RadioButtonRowProps & IconSlot> = ({
79
79
  direction: parentDirection,
80
80
  } = useRadioButtonGroupContext();
81
81
 
82
+ const realValue = getValueForRadioButton(value);
83
+ const realContextValue = getValueForRadioButton(contextValue);
84
+ const isSelected = selected ?? realContextValue === realValue;
85
+
82
86
  const handlePress = () => {
83
- onPress(value);
84
- onValueChange && onValueChange(value);
87
+ onPress?.(realValue);
88
+ onValueChange?.(realValue);
85
89
  };
86
90
 
87
91
  const { textStyles, viewStyles } = extractStyles(style);
@@ -112,12 +116,10 @@ const RadioButtonRow: React.FC<RadioButtonRowProps & IconSlot> = ({
112
116
  >
113
117
  <RadioButton
114
118
  Icon={Icon}
115
- selected={
116
- selected || (contextValue != null && contextValue === value)
117
- }
119
+ selected={isSelected}
120
+ value={realValue}
118
121
  color={color}
119
122
  unselectedColor={unselectedColor}
120
- onPress={handlePress}
121
123
  style={radioButtonStyle}
122
124
  />
123
125
  </View>
package/src/index.js CHANGED
@@ -27,7 +27,6 @@ export { default as Touchable } from "./components/Touchable";
27
27
  export { AccordionGroup, AccordionItem } from "./components/Accordion";
28
28
  export { ActionSheet, ActionSheetItem, ActionSheetCancel, } from "./components/ActionSheet";
29
29
  export { Swiper, SwiperItem } from "./components/Swiper";
30
- export { TabView, TabViewItem } from "./components/TabView";
31
30
  export { Center, Circle, Square, Row, Stack, Spacer, } from "./components/Layout";
32
31
  export { RadioButton, RadioButtonGroup, RadioButtonRow, RadioButtonFieldGroup, } from "./components/RadioButton/index";
33
32
  /* Deprecated: Fix or Delete! */
package/src/index.tsx CHANGED
@@ -32,7 +32,6 @@ export {
32
32
  ActionSheetCancel,
33
33
  } from "./components/ActionSheet";
34
34
  export { Swiper, SwiperItem } from "./components/Swiper";
35
- export { TabView, TabViewItem } from "./components/TabView";
36
35
 
37
36
  export {
38
37
  Center,
@@ -22,7 +22,7 @@ export const SEED_DATA = {
22
22
  }),
23
23
  direction: createRowDirectionProp(),
24
24
  fieldName: createFieldNameProp({
25
- defaultValue: "checkboxValue",
25
+ defaultValue: "checkboxRowValue",
26
26
  valuePropName: "value",
27
27
  handlerPropName: "onPress",
28
28
  }),
@@ -31,7 +31,7 @@ export const SEED_DATA = {
31
31
  }),
32
32
  direction: createRowDirectionProp(),
33
33
  fieldName: createFieldNameProp({
34
- defaultValue: "checkboxValue",
34
+ defaultValue: "checkboxRowValue",
35
35
  valuePropName: "value",
36
36
  handlerPropName: "onPress",
37
37
  }),
@@ -1,4 +1,4 @@
1
- import { GROUPS, COMPONENT_TYPES, FORM_TYPES, PROP_TYPES, FIELD_NAME, TEXT_INPUT_PROPS, NUMBER_INPUT_PROPS, Triggers, } from "@draftbit/types";
1
+ import { GROUPS, COMPONENT_TYPES, FORM_TYPES, PROP_TYPES, FIELD_NAME, TEXT_INPUT_PROPS, NUMBER_INPUT_PROPS, Triggers, createFieldNameProp, } from "@draftbit/types";
2
2
  export const SEED_DATA_PROPS = {
3
3
  style: {
4
4
  group: GROUPS.basic,
@@ -196,8 +196,13 @@ export const SEED_DATA = [
196
196
  },
197
197
  triggers: [Triggers.OnChangeText],
198
198
  props: {
199
- ...NUMBER_INPUT_PROPS,
200
199
  ...SEED_DATA_PROPS,
200
+ ...NUMBER_INPUT_PROPS,
201
+ fieldName: createFieldNameProp({
202
+ defaultValue: "numberInputValue",
203
+ valuePropName: "value",
204
+ handlerPropName: "onChangeText",
205
+ }),
201
206
  },
202
207
  },
203
208
  ];
@@ -7,6 +7,7 @@ import {
7
7
  TEXT_INPUT_PROPS,
8
8
  NUMBER_INPUT_PROPS,
9
9
  Triggers,
10
+ createFieldNameProp,
10
11
  } from "@draftbit/types";
11
12
 
12
13
  export const SEED_DATA_PROPS = {
@@ -219,8 +220,13 @@ export const SEED_DATA = [
219
220
  },
220
221
  triggers: [Triggers.OnChangeText],
221
222
  props: {
222
- ...NUMBER_INPUT_PROPS,
223
223
  ...SEED_DATA_PROPS,
224
+ ...NUMBER_INPUT_PROPS,
225
+ fieldName: createFieldNameProp({
226
+ defaultValue: "numberInputValue",
227
+ valuePropName: "value",
228
+ handlerPropName: "onChangeText",
229
+ }),
224
230
  },
225
231
  },
226
232
  ];
package/src/utilities.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { StyleSheet } from "react-native";
2
+ import { isString, isNumber } from "lodash";
2
3
  export function extractStyles(style) {
3
4
  const { color, fontFamily, fontWeight, fontSize, lineHeight, letterSpacing, textTransform, textAlign, textDecorationLine, textDecorationColor, textDecorationStyle, ...viewStyles } = StyleSheet.flatten(style || {});
4
5
  const textStyles = {
@@ -40,3 +41,14 @@ export function applyStyles(baseStyles, stylesToApply) {
40
41
  }
41
42
  return flattenedStyles;
42
43
  }
44
+ export function getValueForRadioButton(value) {
45
+ if (isString(value)) {
46
+ return value;
47
+ }
48
+ else if (isNumber(value)) {
49
+ return String(value);
50
+ }
51
+ else {
52
+ throw new Error(`Invalid value: ${value}`);
53
+ }
54
+ }
package/src/utilities.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { StyleSheet, StyleProp, TextStyle } from "react-native";
2
+ import { isString, isNumber } from "lodash";
2
3
 
3
4
  export function extractStyles(style: StyleProp<any>) {
4
5
  const {
@@ -63,3 +64,13 @@ export function applyStyles(
63
64
 
64
65
  return flattenedStyles;
65
66
  }
67
+
68
+ export function getValueForRadioButton(value: string | number) {
69
+ if (isString(value)) {
70
+ return value;
71
+ } else if (isNumber(value)) {
72
+ return String(value);
73
+ } else {
74
+ throw new Error(`Invalid value: ${value}`);
75
+ }
76
+ }
@@ -1,103 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- var React = _interopRequireWildcard(require("react"));
9
-
10
- var _reactNativeTabView = require("react-native-tab-view");
11
-
12
- var _TabViewItem = _interopRequireDefault(require("./TabViewItem"));
13
-
14
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
-
16
- 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); }
17
-
18
- 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; }
19
-
20
- 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); }
21
-
22
- const TabViewComponent = _ref => {
23
- let {
24
- Icon,
25
- tabBarPosition,
26
- keyboardDismissMode,
27
- swipeEnabled,
28
- scrollEnabled,
29
- activeColor,
30
- inactiveColor,
31
- pressColor,
32
- indicatorColor,
33
- style,
34
- children
35
- } = _ref;
36
- const [index, setIndex] = React.useState(0);
37
- const [routes, setRoutes] = React.useState([]);
38
- const [tabScenes, setTabScenes] = React.useState({});
39
- React.useEffect(() => {
40
- const newRoutes = [];
41
- const scenes = {};
42
- React.Children.toArray(children).filter(child => child.type === _TabViewItem.default).forEach(child => {
43
- var _child$props;
44
-
45
- if (child !== null && child !== void 0 && (_child$props = child.props) !== null && _child$props !== void 0 && _child$props.id) {
46
- var _child$props2, _child$props3;
47
-
48
- newRoutes.push({
49
- key: child === null || child === void 0 ? void 0 : (_child$props2 = child.props) === null || _child$props2 === void 0 ? void 0 : _child$props2.id,
50
- ...(child === null || child === void 0 ? void 0 : child.props)
51
- });
52
-
53
- scenes[child === null || child === void 0 ? void 0 : (_child$props3 = child.props) === null || _child$props3 === void 0 ? void 0 : _child$props3.id] = () => child;
54
- }
55
- });
56
- setRoutes(newRoutes);
57
- setTabScenes(scenes);
58
- }, [children]);
59
-
60
- const indexChangeHandler = i => setIndex(i);
61
-
62
- const renderTabBar = props => {
63
- console.log(props);
64
- return /*#__PURE__*/React.createElement(_reactNativeTabView.TabBar, _extends({}, props, {
65
- activeColor: activeColor,
66
- inactiveColor: inactiveColor,
67
- pressColor: pressColor,
68
- scrollEnabled: scrollEnabled,
69
- indicatorStyle: {
70
- backgroundColor: indicatorColor
71
- },
72
- renderIcon: _ref2 => {
73
- let {
74
- route,
75
- color
76
- } = _ref2;
77
- return route !== null && route !== void 0 && route.icon ? /*#__PURE__*/React.createElement(Icon, {
78
- name: route.icon,
79
- color: color,
80
- size: 36
81
- }) : null;
82
- },
83
- style: style
84
- }));
85
- };
86
-
87
- return /*#__PURE__*/React.createElement(_reactNativeTabView.TabView, {
88
- navigationState: {
89
- index,
90
- routes
91
- },
92
- renderScene: (0, _reactNativeTabView.SceneMap)(tabScenes),
93
- renderTabBar: renderTabBar,
94
- onIndexChange: indexChangeHandler,
95
- tabBarPosition: tabBarPosition,
96
- keyboardDismissMode: keyboardDismissMode,
97
- swipeEnabled: swipeEnabled
98
- });
99
- };
100
-
101
- var _default = TabViewComponent;
102
- exports.default = _default;
103
- //# sourceMappingURL=TabView.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["TabView.tsx"],"names":["TabViewComponent","Icon","tabBarPosition","keyboardDismissMode","swipeEnabled","scrollEnabled","activeColor","inactiveColor","pressColor","indicatorColor","style","children","index","setIndex","React","useState","routes","setRoutes","tabScenes","setTabScenes","useEffect","newRoutes","scenes","Children","toArray","filter","child","type","TabViewItem","forEach","props","id","push","key","indexChangeHandler","i","renderTabBar","console","log","backgroundColor","route","color","icon"],"mappings":"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","sourcesContent":["import * as React from \"react\";\nimport { StyleProp, TextStyle, ViewStyle } from \"react-native\";\nimport { TabView, TabBar, SceneMap } from \"react-native-tab-view\";\n\n// import { withTheme } from \"../../theming\";\nimport TabViewItem from \"./TabViewItem\";\nimport type { IconSlot } from \"../../interfaces/Icon\";\n\ntype TabBarPosition = \"top\" | \"bottom\";\ntype KeyboardDismissMode = \"none\" | \"auto\" | \"on-drag\";\n\ntype TabViewProps = {\n tabBarPosition?: TabBarPosition;\n keyboardDismissMode?: KeyboardDismissMode;\n swipeEnabled?: boolean;\n scrollEnabled?: boolean;\n activeColor?: string;\n inactiveColor?: string;\n pressColor?: string;\n indicatorColor?: string;\n style?: StyleProp<TextStyle | ViewStyle>;\n children: React.ReactNode;\n} & IconSlot;\n\nconst TabViewComponent = ({\n Icon,\n tabBarPosition,\n keyboardDismissMode,\n swipeEnabled,\n scrollEnabled,\n activeColor,\n inactiveColor,\n pressColor,\n indicatorColor,\n style,\n children,\n}: TabViewProps) => {\n const [index, setIndex] = React.useState(0);\n const [routes, setRoutes] = React.useState([]);\n const [tabScenes, setTabScenes] = React.useState({});\n\n React.useEffect(() => {\n const newRoutes: any = [];\n const scenes: any = {};\n\n React.Children.toArray(children)\n .filter((child: any) => child.type === TabViewItem)\n .forEach((child: any) => {\n if (child?.props?.id) {\n newRoutes.push({\n key: child?.props?.id,\n ...child?.props,\n });\n scenes[child?.props?.id] = () => child;\n }\n });\n\n setRoutes(newRoutes);\n setTabScenes(scenes);\n }, [children]);\n\n const indexChangeHandler = (i: any) => setIndex(i);\n\n const renderTabBar = (props: any) => {\n console.log(props);\n return (\n <TabBar\n {...props}\n activeColor={activeColor}\n inactiveColor={inactiveColor}\n pressColor={pressColor}\n scrollEnabled={scrollEnabled}\n indicatorStyle={{ backgroundColor: indicatorColor }}\n renderIcon={({ route, color }) =>\n route?.icon ? (\n <Icon name={route.icon} color={color} size={36} />\n ) : null\n }\n style={style}\n />\n );\n };\n\n return (\n <TabView\n navigationState={{ index, routes }}\n renderScene={SceneMap(tabScenes)}\n renderTabBar={renderTabBar}\n onIndexChange={indexChangeHandler}\n tabBarPosition={tabBarPosition}\n keyboardDismissMode={keyboardDismissMode}\n swipeEnabled={swipeEnabled}\n />\n );\n};\n\nexport default TabViewComponent;\n"]}
@@ -1,27 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- const TabViewItem = _ref => {
9
- let {
10
- title,
11
- id,
12
- icon,
13
- children,
14
- accessibilityLabel
15
- } = _ref;
16
- console.log({
17
- title,
18
- id,
19
- icon,
20
- accessibilityLabel
21
- });
22
- return children;
23
- };
24
-
25
- var _default = TabViewItem;
26
- exports.default = _default;
27
- //# sourceMappingURL=TabViewItem.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["TabViewItem.tsx"],"names":["TabViewItem","title","id","icon","children","accessibilityLabel","console","log"],"mappings":";;;;;;;AASA,MAAMA,WAAW,GAAG,QAMI;AAAA,MANH;AACnBC,IAAAA,KADmB;AAEnBC,IAAAA,EAFmB;AAGnBC,IAAAA,IAHmB;AAInBC,IAAAA,QAJmB;AAKnBC,IAAAA;AALmB,GAMG;AACtBC,EAAAA,OAAO,CAACC,GAAR,CAAY;AAAEN,IAAAA,KAAF;AAASC,IAAAA,EAAT;AAAaC,IAAAA,IAAb;AAAmBE,IAAAA;AAAnB,GAAZ;AACA,SAAOD,QAAP;AACD,CATD;;eAWeJ,W","sourcesContent":["import React from \"react\";\ninterface TabViewItemProps {\n title: string;\n id: string;\n icon: string;\n accessibilityLabel: string;\n children: React.ReactNode;\n}\n\nconst TabViewItem = ({\n title,\n id,\n icon,\n children,\n accessibilityLabel,\n}: TabViewItemProps) => {\n console.log({ title, id, icon, accessibilityLabel });\n return children;\n};\n\nexport default TabViewItem;\n"]}
@@ -1,24 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "TabView", {
7
- enumerable: true,
8
- get: function () {
9
- return _TabView.default;
10
- }
11
- });
12
- Object.defineProperty(exports, "TabViewItem", {
13
- enumerable: true,
14
- get: function () {
15
- return _TabViewItem.default;
16
- }
17
- });
18
-
19
- var _TabView = _interopRequireDefault(require("./TabView"));
20
-
21
- var _TabViewItem = _interopRequireDefault(require("./TabViewItem"));
22
-
23
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
24
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;AACA","sourcesContent":["export { default as TabView } from \"./TabView\";\nexport { default as TabViewItem } from \"./TabViewItem\";\n"]}
@@ -1,80 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.SEED_DATA = void 0;
7
-
8
- var _types = require("@draftbit/types");
9
-
10
- const SEED_DATA = [{
11
- name: "TabView",
12
- tag: "TabView",
13
- category: _types.COMPONENT_TYPES.container,
14
- layout: {},
15
- props: {
16
- tabBarPosition: (0, _types.createTextEnumProp)({
17
- label: "Tab Bar Position",
18
- description: "Tab Bar Position",
19
- options: ["top", "bottom"],
20
- defaultValue: "top"
21
- }),
22
- keyboardDismissMode: (0, _types.createTextEnumProp)({
23
- label: "Keyboard Dismiss Mode",
24
- description: "Keyboard Dismiss Mode",
25
- options: ["auto", "on-drag", "none"],
26
- defaultValue: "auto"
27
- }),
28
- swipeEnabled: (0, _types.createBoolProp)({
29
- label: "Swipe Enabled",
30
- description: "Swipe Enabled",
31
- defaultValue: true
32
- }),
33
- scrollEnabled: (0, _types.createBoolProp)({
34
- label: "Scroll Enabled",
35
- description: "Scroll Enabled",
36
- defaultValue: true
37
- }),
38
- activeColor: (0, _types.createColorProp)({
39
- label: "Active Color",
40
- description: "Active Color",
41
- defaultValue: "primary"
42
- }),
43
- inactiveColor: (0, _types.createColorProp)({
44
- label: "Inactive Color",
45
- description: "Inactive Color",
46
- defaultValue: null
47
- }),
48
- pressColor: (0, _types.createColorProp)({
49
- label: "Press Color",
50
- description: "Press Color",
51
- defaultValue: null
52
- }),
53
- indicatorColor: (0, _types.createColorProp)({
54
- label: "Indicator Color",
55
- description: "Indicator Color",
56
- defaultValue: null
57
- })
58
- }
59
- }, {
60
- name: "TabViewItem",
61
- tag: "TabViewItem",
62
- category: _types.COMPONENT_TYPES.container,
63
- layout: {},
64
- props: {
65
- title: (0, _types.createTextProp)({
66
- label: "Title",
67
- description: "Tab Title"
68
- }),
69
- id: (0, _types.createTextProp)({
70
- label: "Id",
71
- description: "Tab Id"
72
- }),
73
- accessibilityLabel: (0, _types.createTextProp)({
74
- label: "Accessibility Label",
75
- description: "Accessibility Label"
76
- })
77
- }
78
- }];
79
- exports.SEED_DATA = SEED_DATA;
80
- //# sourceMappingURL=TabView.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["TabView.ts"],"names":["SEED_DATA","name","tag","category","COMPONENT_TYPES","container","layout","props","tabBarPosition","label","description","options","defaultValue","keyboardDismissMode","swipeEnabled","scrollEnabled","activeColor","inactiveColor","pressColor","indicatorColor","title","id","accessibilityLabel"],"mappings":";;;;;;;AAAA;;AAQO,MAAMA,SAAS,GAAG,CACvB;AACEC,EAAAA,IAAI,EAAE,SADR;AAEEC,EAAAA,GAAG,EAAE,SAFP;AAGEC,EAAAA,QAAQ,EAAEC,uBAAgBC,SAH5B;AAIEC,EAAAA,MAAM,EAAE,EAJV;AAKEC,EAAAA,KAAK,EAAE;AACLC,IAAAA,cAAc,EAAE,+BAAmB;AACjCC,MAAAA,KAAK,EAAE,kBAD0B;AAEjCC,MAAAA,WAAW,EAAE,kBAFoB;AAGjCC,MAAAA,OAAO,EAAE,CAAC,KAAD,EAAQ,QAAR,CAHwB;AAIjCC,MAAAA,YAAY,EAAE;AAJmB,KAAnB,CADX;AAOLC,IAAAA,mBAAmB,EAAE,+BAAmB;AACtCJ,MAAAA,KAAK,EAAE,uBAD+B;AAEtCC,MAAAA,WAAW,EAAE,uBAFyB;AAGtCC,MAAAA,OAAO,EAAE,CAAC,MAAD,EAAS,SAAT,EAAoB,MAApB,CAH6B;AAItCC,MAAAA,YAAY,EAAE;AAJwB,KAAnB,CAPhB;AAaLE,IAAAA,YAAY,EAAE,2BAAe;AAC3BL,MAAAA,KAAK,EAAE,eADoB;AAE3BC,MAAAA,WAAW,EAAE,eAFc;AAG3BE,MAAAA,YAAY,EAAE;AAHa,KAAf,CAbT;AAkBLG,IAAAA,aAAa,EAAE,2BAAe;AAC5BN,MAAAA,KAAK,EAAE,gBADqB;AAE5BC,MAAAA,WAAW,EAAE,gBAFe;AAG5BE,MAAAA,YAAY,EAAE;AAHc,KAAf,CAlBV;AAuBLI,IAAAA,WAAW,EAAE,4BAAgB;AAC3BP,MAAAA,KAAK,EAAE,cADoB;AAE3BC,MAAAA,WAAW,EAAE,cAFc;AAG3BE,MAAAA,YAAY,EAAE;AAHa,KAAhB,CAvBR;AA4BLK,IAAAA,aAAa,EAAE,4BAAgB;AAC7BR,MAAAA,KAAK,EAAE,gBADsB;AAE7BC,MAAAA,WAAW,EAAE,gBAFgB;AAG7BE,MAAAA,YAAY,EAAE;AAHe,KAAhB,CA5BV;AAiCLM,IAAAA,UAAU,EAAE,4BAAgB;AAC1BT,MAAAA,KAAK,EAAE,aADmB;AAE1BC,MAAAA,WAAW,EAAE,aAFa;AAG1BE,MAAAA,YAAY,EAAE;AAHY,KAAhB,CAjCP;AAsCLO,IAAAA,cAAc,EAAE,4BAAgB;AAC9BV,MAAAA,KAAK,EAAE,iBADuB;AAE9BC,MAAAA,WAAW,EAAE,iBAFiB;AAG9BE,MAAAA,YAAY,EAAE;AAHgB,KAAhB;AAtCX;AALT,CADuB,EAmDvB;AACEX,EAAAA,IAAI,EAAE,aADR;AAEEC,EAAAA,GAAG,EAAE,aAFP;AAGEC,EAAAA,QAAQ,EAAEC,uBAAgBC,SAH5B;AAIEC,EAAAA,MAAM,EAAE,EAJV;AAKEC,EAAAA,KAAK,EAAE;AACLa,IAAAA,KAAK,EAAE,2BAAe;AACpBX,MAAAA,KAAK,EAAE,OADa;AAEpBC,MAAAA,WAAW,EAAE;AAFO,KAAf,CADF;AAKLW,IAAAA,EAAE,EAAE,2BAAe;AACjBZ,MAAAA,KAAK,EAAE,IADU;AAEjBC,MAAAA,WAAW,EAAE;AAFI,KAAf,CALC;AASLY,IAAAA,kBAAkB,EAAE,2BAAe;AACjCb,MAAAA,KAAK,EAAE,qBAD0B;AAEjCC,MAAAA,WAAW,EAAE;AAFoB,KAAf;AATf;AALT,CAnDuB,CAAlB","sourcesContent":["import {\n COMPONENT_TYPES,\n createTextProp,\n createTextEnumProp,\n createBoolProp,\n createColorProp,\n} from \"@draftbit/types\";\n\nexport const SEED_DATA = [\n {\n name: \"TabView\",\n tag: \"TabView\",\n category: COMPONENT_TYPES.container,\n layout: {},\n props: {\n tabBarPosition: createTextEnumProp({\n label: \"Tab Bar Position\",\n description: \"Tab Bar Position\",\n options: [\"top\", \"bottom\"],\n defaultValue: \"top\",\n }),\n keyboardDismissMode: createTextEnumProp({\n label: \"Keyboard Dismiss Mode\",\n description: \"Keyboard Dismiss Mode\",\n options: [\"auto\", \"on-drag\", \"none\"],\n defaultValue: \"auto\",\n }),\n swipeEnabled: createBoolProp({\n label: \"Swipe Enabled\",\n description: \"Swipe Enabled\",\n defaultValue: true,\n }),\n scrollEnabled: createBoolProp({\n label: \"Scroll Enabled\",\n description: \"Scroll Enabled\",\n defaultValue: true,\n }),\n activeColor: createColorProp({\n label: \"Active Color\",\n description: \"Active Color\",\n defaultValue: \"primary\",\n }),\n inactiveColor: createColorProp({\n label: \"Inactive Color\",\n description: \"Inactive Color\",\n defaultValue: null,\n }),\n pressColor: createColorProp({\n label: \"Press Color\",\n description: \"Press Color\",\n defaultValue: null,\n }),\n indicatorColor: createColorProp({\n label: \"Indicator Color\",\n description: \"Indicator Color\",\n defaultValue: null,\n }),\n },\n },\n {\n name: \"TabViewItem\",\n tag: \"TabViewItem\",\n category: COMPONENT_TYPES.container,\n layout: {},\n props: {\n title: createTextProp({\n label: \"Title\",\n description: \"Tab Title\",\n }),\n id: createTextProp({\n label: \"Id\",\n description: \"Tab Id\",\n }),\n accessibilityLabel: createTextProp({\n label: \"Accessibility Label\",\n description: \"Accessibility Label\",\n }),\n },\n },\n];\n"]}