@draftbit/core 46.7.9-cbe269.2 → 46.7.9-f9c613.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.
@@ -12,6 +12,7 @@ var _theming = require("../../theming");
12
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
13
  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); }
14
14
  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; }
15
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : 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 AccordionItem = _ref => {
16
17
  let {
17
18
  Icon,
@@ -26,10 +27,9 @@ const AccordionItem = _ref => {
26
27
  textStyles,
27
28
  viewStyles
28
29
  } = (0, _utilities.extractStyles)(style);
29
- return /*#__PURE__*/React.createElement(_reactNative.Pressable, {
30
- style: [styles.container, viewStyles],
31
- ...rest
32
- }, /*#__PURE__*/React.createElement(_reactNative.View, {
30
+ return /*#__PURE__*/React.createElement(_reactNative.Pressable, _extends({
31
+ style: [styles.container, viewStyles]
32
+ }, rest), /*#__PURE__*/React.createElement(_reactNative.View, {
33
33
  style: styles.row
34
34
  }, icon ? /*#__PURE__*/React.createElement(Icon, {
35
35
  name: icon,
@@ -61,23 +61,4 @@ const styles = _reactNative.StyleSheet.create({
61
61
  }
62
62
  });
63
63
  var _default = (0, _theming.withTheme)(AccordionItem);
64
- exports.default = _default;.StyleSheet.create({
65
- container: {
66
- padding: 8
67
- },
68
- row: {
69
- flexDirection: "row",
70
- alignItems: "center",
71
- paddingLeft: 8
72
- },
73
- item: {
74
- marginVertical: 6,
75
- paddingLeft: 8
76
- },
77
- content: {
78
- flex: 1,
79
- justifyContent: "center"
80
- }
81
- });
82
- var _default = (0, _theming.withTheme)(AccordionItem);
83
64
  exports.default = _default;
@@ -32,17 +32,8 @@ const NumberInput = _ref => {
32
32
  return valueToFormat.toString();
33
33
  }
34
34
  }
35
- return "0";
35
+ return "";
36
36
  };
37
-
38
- // set currentStringNumberValue as defaultValue prop if there is a differnce on first render only
39
- (0, _react.useEffect)(() => {
40
- const defaultStringNumberValue = formatValueToStringNumber(defaultValue);
41
- if (currentStringNumberValue !== defaultStringNumberValue) {
42
- setCurrentStringNumberValue(defaultStringNumberValue);
43
- }
44
- // eslint-disable-next-line react-hooks/exhaustive-deps
45
- }, []);
46
37
  const handleChangeText = newValue => {
47
38
  const newStringNumberValue = formatValueToStringNumber(newValue);
48
39
  const number = parseFloat(newStringNumberValue);
@@ -58,6 +49,15 @@ const NumberInput = _ref => {
58
49
  }
59
50
  // eslint-disable-next-line react-hooks/exhaustive-deps
60
51
  }, [value]);
52
+
53
+ // set currentStringNumberValue as defaultValue prop if there is a differnce on first render only
54
+ (0, _react.useEffect)(() => {
55
+ const defaultStringNumberValue = formatValueToStringNumber(defaultValue);
56
+ if (currentStringNumberValue !== defaultStringNumberValue) {
57
+ setCurrentStringNumberValue(defaultStringNumberValue);
58
+ }
59
+ // eslint-disable-next-line react-hooks/exhaustive-deps
60
+ }, []);
61
61
  return /*#__PURE__*/_react.default.createElement(_reactNative.TextInput, _extends({
62
62
  keyboardType: "numeric",
63
63
  value: currentStringNumberValue,
@@ -42,7 +42,6 @@ const {
42
42
  height: deviceHeight
43
43
  } = _reactNative.Dimensions.get("screen");
44
44
  const isIos = _reactNative.Platform.OS === "ios";
45
- const isWeb = _reactNative.Platform.OS === "web";
46
45
  const unstyledColor = "rgba(165, 173, 183, 1)";
47
46
  const disabledColor = "rgb(240, 240, 240)";
48
47
  const errorColor = "rgba(255, 69, 100, 1)";
@@ -234,8 +233,8 @@ const Picker = _ref => {
234
233
  label: option.label,
235
234
  value: option.value,
236
235
  key: option.value
237
- })))))) : null, !isIos && (pickerVisible || isWeb) ? /*#__PURE__*/React.createElement(_picker.Picker, {
238
- enabled: !disabled,
236
+ })))))) : null, !isIos && pickerVisible ? /*#__PURE__*/React.createElement(_picker.Picker, {
237
+ enabled: pickerVisible,
239
238
  selectedValue: internalValue,
240
239
  onValueChange: handleValueChange,
241
240
  style: styles.nonIosPicker,
@@ -10,6 +10,10 @@ var _theming = require("../theming");
10
10
  var _utilities = require("../utilities");
11
11
  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); }
12
12
  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; }
13
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
14
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
15
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
16
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
13
17
  const AnimatedText = _reactNative.Animated.createAnimatedComponent(_reactNative.Text);
14
18
  const FOCUS_ANIMATION_DURATION = 150;
15
19
  const BLUR_ANIMATION_DURATION = 180;
@@ -17,7 +21,7 @@ const ICON_SIZE = 24;
17
21
  class TextField extends React.Component {
18
22
  constructor() {
19
23
  super(...arguments);
20
- this.state = {
24
+ _defineProperty(this, "state", {
21
25
  nativeProps: {},
22
26
  labeled: new _reactNative.Animated.Value(this.props.value || this.props.error ? 0 : 1),
23
27
  focused: false,
@@ -26,46 +30,47 @@ class TextField extends React.Component {
26
30
  measured: false,
27
31
  width: 0
28
32
  }
29
- };
30
- this._timer = setTimeout(() => {}, 0);
31
- this._showPlaceholder = () => {
33
+ });
34
+ _defineProperty(this, "_timer", setTimeout(() => {}, 0));
35
+ _defineProperty(this, "_showPlaceholder", () => {
32
36
  clearTimeout(this._timer);
37
+
33
38
  // Set the placeholder in a delay to offset the label animation
34
39
  // If we show it immediately, they'll overlap and look ugly
35
40
  this._timer = setTimeout(() => this.setState({
36
41
  placeholder: this.props.placeholder
37
42
  }), 50);
38
- };
39
- this._hidePlaceholder = () => this.setState({
40
- placeholder: ""
41
43
  });
42
- this._restoreLabel = () => _reactNative.Animated.timing(this.state.labeled, {
44
+ _defineProperty(this, "_hidePlaceholder", () => this.setState({
45
+ placeholder: ""
46
+ }));
47
+ _defineProperty(this, "_restoreLabel", () => _reactNative.Animated.timing(this.state.labeled, {
43
48
  toValue: 1,
44
49
  duration: FOCUS_ANIMATION_DURATION,
45
50
  useNativeDriver: true
46
- }).start();
47
- this._minmizeLabel = () => _reactNative.Animated.timing(this.state.labeled, {
51
+ }).start());
52
+ _defineProperty(this, "_minmizeLabel", () => _reactNative.Animated.timing(this.state.labeled, {
48
53
  toValue: 0,
49
54
  duration: BLUR_ANIMATION_DURATION,
50
55
  useNativeDriver: true
51
- }).start();
52
- this._handleFocus = () => {
56
+ }).start());
57
+ _defineProperty(this, "_handleFocus", () => {
53
58
  if (this.props.disabled) {
54
59
  return;
55
60
  }
56
61
  this.setState({
57
62
  focused: true
58
63
  });
59
- };
60
- this._handleBlur = () => {
64
+ });
65
+ _defineProperty(this, "_handleBlur", () => {
61
66
  if (this.props.disabled) {
62
67
  return;
63
68
  }
64
69
  this.setState({
65
70
  focused: false
66
71
  });
67
- };
68
- this._handleChangeText = value => {
72
+ });
73
+ _defineProperty(this, "_handleChangeText", value => {
69
74
  if (this.props.disabled) {
70
75
  return;
71
76
  }
@@ -80,8 +85,8 @@ class TextField extends React.Component {
80
85
  });
81
86
  this.props.onChangeText && this.props.onChangeText(value.nativeEvent.text);
82
87
  }
83
- };
84
- this._root = undefined;
88
+ });
89
+ _defineProperty(this, "_root", undefined);
85
90
  }
86
91
  static getDerivedStateFromProps(nextProps, prevState) {
87
92
  return {
@@ -168,9 +173,7 @@ class TextField extends React.Component {
168
173
  roundness,
169
174
  disabledOpacity
170
175
  },
171
- render = props => /*#__PURE__*/React.createElement(_reactNative.TextInput, {
172
- ...props
173
- }),
176
+ render = props => /*#__PURE__*/React.createElement(_reactNative.TextInput, props),
174
177
  ...rest
175
178
  } = this.props;
176
179
  const MINIMIZED_LABEL_Y_OFFSET = -(typography.caption.lineHeight + 4);
@@ -310,10 +313,9 @@ class TextField extends React.Component {
310
313
  } = _reactNative.StyleSheet.flatten(style || {});
311
314
  return /*#__PURE__*/React.createElement(_reactNative.View, {
312
315
  style: [styles.container, styleProp]
313
- }, leftIconName && leftIconMode === "outset" ? /*#__PURE__*/React.createElement(Icon, {
314
- ...leftIconProps,
316
+ }, leftIconName && leftIconMode === "outset" ? /*#__PURE__*/React.createElement(Icon, _extends({}, leftIconProps, {
315
317
  style: leftIconStyle
316
- }) : null, /*#__PURE__*/React.createElement(_reactNative.View, {
318
+ })) : null, /*#__PURE__*/React.createElement(_reactNative.View, {
317
319
  style: (0, _utilities.applyStyles)([containerStyle], {
318
320
  height: style === null || style === void 0 ? void 0 : style.height,
319
321
  backgroundColor: bgColor,
@@ -381,10 +383,9 @@ class TextField extends React.Component {
381
383
  style: {
382
384
  justifyContent: type === "solid" ? "center" : undefined
383
385
  }
384
- }, /*#__PURE__*/React.createElement(Icon, {
385
- ...leftIconProps,
386
+ }, /*#__PURE__*/React.createElement(Icon, _extends({}, leftIconProps, {
386
387
  style: leftIconStyle
387
- })) : null, render({
388
+ }))) : null, render({
388
389
  ref: c => {
389
390
  this._root = c;
390
391
  },
@@ -422,55 +423,6 @@ class TextField extends React.Component {
422
423
  }
423
424
  var _default = (0, _theming.withTheme)(TextField);
424
425
  exports.default = _default;
425
- const styles = _reactNative.StyleSheet.create({
426
- container: {
427
- alignSelf: "stretch"
428
- },
429
- placeholder: {
430
- position: "absolute",
431
- left: 0
432
- },
433
- underline: {
434
- position: "absolute",
435
- left: 0,
436
- right: 0,
437
- bottom: 0,
438
- height: 2
439
- },
440
- input: {
441
- flexGrow: 1,
442
- justifyContent: "center",
443
- textAlignVertical: "center",
444
- margin: 0,
445
- textAlign: _reactNative.I18nManager.isRTL ? "right" : "left"
446
- }
447
- });_handleFocus,
448
- onBlur: this._handleBlur,
449
- underlineColorAndroid: "transparent",
450
- style: inputStyles,
451
- ...rest,
452
- ...this.state.nativeProps,
453
- value: this.state.value
454
- })), rightIconName ? /*#__PURE__*/React.createElement(Icon, {
455
- name: rightIconName,
456
- size: ICON_SIZE,
457
- color: colors.light,
458
- style: {
459
- position: "absolute",
460
- right: 16,
461
- marginTop: type === "solid" ? MINIMIZED_LABEL_FONT_SIZE + 4 : 16
462
- }
463
- }) : null, assistiveText ? /*#__PURE__*/React.createElement(_reactNative.Text, {
464
- style: [{
465
- color: error ? colors.error : colors.light,
466
- marginTop: 8,
467
- marginLeft: assistiveTextLeftMargin
468
- }]
469
- }, assistiveText) : null);
470
- }
471
- }
472
- var _default = (0, _theming.withTheme)(TextField);
473
- exports.default = _default;
474
426
  const styles = _reactNative.StyleSheet.create({
475
427
  container: {
476
428
  alignSelf: "stretch"
@@ -24,17 +24,8 @@ const NumberInput = _ref => {
24
24
  return valueToFormat.toString();
25
25
  }
26
26
  }
27
- return "0";
27
+ return "";
28
28
  };
29
-
30
- // set currentStringNumberValue as defaultValue prop if there is a differnce on first render only
31
- useEffect(() => {
32
- const defaultStringNumberValue = formatValueToStringNumber(defaultValue);
33
- if (currentStringNumberValue !== defaultStringNumberValue) {
34
- setCurrentStringNumberValue(defaultStringNumberValue);
35
- }
36
- // eslint-disable-next-line react-hooks/exhaustive-deps
37
- }, []);
38
29
  const handleChangeText = newValue => {
39
30
  const newStringNumberValue = formatValueToStringNumber(newValue);
40
31
  const number = parseFloat(newStringNumberValue);
@@ -50,6 +41,15 @@ const NumberInput = _ref => {
50
41
  }
51
42
  // eslint-disable-next-line react-hooks/exhaustive-deps
52
43
  }, [value]);
44
+
45
+ // set currentStringNumberValue as defaultValue prop if there is a differnce on first render only
46
+ useEffect(() => {
47
+ const defaultStringNumberValue = formatValueToStringNumber(defaultValue);
48
+ if (currentStringNumberValue !== defaultStringNumberValue) {
49
+ setCurrentStringNumberValue(defaultStringNumberValue);
50
+ }
51
+ // eslint-disable-next-line react-hooks/exhaustive-deps
52
+ }, []);
53
53
  return /*#__PURE__*/React.createElement(TextInput, _extends({
54
54
  keyboardType: "numeric",
55
55
  value: currentStringNumberValue,
@@ -33,7 +33,6 @@ const {
33
33
  height: deviceHeight
34
34
  } = Dimensions.get("screen");
35
35
  const isIos = Platform.OS === "ios";
36
- const isWeb = Platform.OS === "web";
37
36
  const unstyledColor = "rgba(165, 173, 183, 1)";
38
37
  const disabledColor = "rgb(240, 240, 240)";
39
38
  const errorColor = "rgba(255, 69, 100, 1)";
@@ -225,8 +224,8 @@ const Picker = _ref => {
225
224
  label: option.label,
226
225
  value: option.value,
227
226
  key: option.value
228
- })))))) : null, !isIos && (pickerVisible || isWeb) ? /*#__PURE__*/React.createElement(NativePicker, {
229
- enabled: !disabled,
227
+ })))))) : null, !isIos && pickerVisible ? /*#__PURE__*/React.createElement(NativePicker, {
228
+ enabled: pickerVisible,
230
229
  selectedValue: internalValue,
231
230
  onValueChange: handleValueChange,
232
231
  style: styles.nonIosPicker,
@@ -1 +1 @@
1
- {"version":3,"file":"Picker.d.ts","sourceRoot":"","sources":["../../../../../src/components/Picker/Picker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAKL,SAAS,EACT,SAAS,EAEV,MAAM,cAAc,CAAC;AAStB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAQtD,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED,oBAAY,WAAW,GAAG;IACxB,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,GAAG;QAAE,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACnD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,YAAY,EAAE,GAAG,MAAM,EAAE,CAAC;IACnC,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACtD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;IAClC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,IAAI,CAAC,EAAE,OAAO,GAAG,WAAW,CAAC;IAC7B,KAAK,EAAE,KAAK,CAAC;IACb,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;CACxB,CAAC;;;;AAoaF,wBAAiC"}
1
+ {"version":3,"file":"Picker.d.ts","sourceRoot":"","sources":["../../../../../src/components/Picker/Picker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAKL,SAAS,EACT,SAAS,EAEV,MAAM,cAAc,CAAC;AAStB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAQtD,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED,oBAAY,WAAW,GAAG;IACxB,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,GAAG;QAAE,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACnD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,YAAY,EAAE,GAAG,MAAM,EAAE,CAAC;IACnC,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACtD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;IAClC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,IAAI,CAAC,EAAE,OAAO,GAAG,WAAW,CAAC;IAC7B,KAAK,EAAE,KAAK,CAAC;IACb,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;CACxB,CAAC;;;;AAiaF,wBAAiC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@draftbit/core",
3
- "version": "46.7.9-cbe269.2+cbe2692",
3
+ "version": "46.7.9-f9c613.2+f9c6133",
4
4
  "description": "Core (non-native) Components",
5
5
  "main": "lib/commonjs/index.js",
6
6
  "module": "lib/module/index.js",
@@ -41,7 +41,7 @@
41
41
  "dependencies": {
42
42
  "@date-io/date-fns": "^1.3.13",
43
43
  "@draftbit/react-theme-provider": "^2.1.1",
44
- "@draftbit/types": "^46.7.9-cbe269.2+cbe2692",
44
+ "@draftbit/types": "^46.7.9-f9c613.2+f9c6133",
45
45
  "@material-ui/core": "^4.11.0",
46
46
  "@material-ui/pickers": "^3.2.10",
47
47
  "@react-native-community/slider": "4.2.3",
@@ -91,5 +91,5 @@
91
91
  ]
92
92
  ]
93
93
  },
94
- "gitHead": "cbe26928f69ff97f3ed73bc6ff855163d6738524"
94
+ "gitHead": "f9c6133d12da77e3d113f20b0178faaf1980b978"
95
95
  }
@@ -20,16 +20,8 @@ const NumberInput = ({ onChangeText, value, defaultValue, ...props }) => {
20
20
  return valueToFormat.toString();
21
21
  }
22
22
  }
23
- return "0";
23
+ return "";
24
24
  };
25
- // set currentStringNumberValue as defaultValue prop if there is a differnce on first render only
26
- useEffect(() => {
27
- const defaultStringNumberValue = formatValueToStringNumber(defaultValue);
28
- if (currentStringNumberValue !== defaultStringNumberValue) {
29
- setCurrentStringNumberValue(defaultStringNumberValue);
30
- }
31
- // eslint-disable-next-line react-hooks/exhaustive-deps
32
- }, []);
33
25
  const handleChangeText = (newValue) => {
34
26
  const newStringNumberValue = formatValueToStringNumber(newValue);
35
27
  const number = parseFloat(newStringNumberValue);
@@ -44,6 +36,14 @@ const NumberInput = ({ onChangeText, value, defaultValue, ...props }) => {
44
36
  }
45
37
  // eslint-disable-next-line react-hooks/exhaustive-deps
46
38
  }, [value]);
39
+ // set currentStringNumberValue as defaultValue prop if there is a differnce on first render only
40
+ useEffect(() => {
41
+ const defaultStringNumberValue = formatValueToStringNumber(defaultValue);
42
+ if (currentStringNumberValue !== defaultStringNumberValue) {
43
+ setCurrentStringNumberValue(defaultStringNumberValue);
44
+ }
45
+ // eslint-disable-next-line react-hooks/exhaustive-deps
46
+ }, []);
47
47
  return (React.createElement(TextInput, { keyboardType: "numeric", value: currentStringNumberValue, onChangeText: handleChangeText, ...props }));
48
48
  };
49
49
  export default NumberInput;
@@ -31,19 +31,9 @@ const NumberInput: FC<Props> = ({
31
31
  }
32
32
  }
33
33
 
34
- return "0";
34
+ return "";
35
35
  };
36
36
 
37
- // set currentStringNumberValue as defaultValue prop if there is a differnce on first render only
38
- useEffect(() => {
39
- const defaultStringNumberValue = formatValueToStringNumber(defaultValue);
40
-
41
- if (currentStringNumberValue !== defaultStringNumberValue) {
42
- setCurrentStringNumberValue(defaultStringNumberValue);
43
- }
44
- // eslint-disable-next-line react-hooks/exhaustive-deps
45
- }, []);
46
-
47
37
  const handleChangeText = (newValue: string) => {
48
38
  const newStringNumberValue = formatValueToStringNumber(newValue);
49
39
  const number = parseFloat(newStringNumberValue);
@@ -62,6 +52,16 @@ const NumberInput: FC<Props> = ({
62
52
  // eslint-disable-next-line react-hooks/exhaustive-deps
63
53
  }, [value]);
64
54
 
55
+ // set currentStringNumberValue as defaultValue prop if there is a differnce on first render only
56
+ useEffect(() => {
57
+ const defaultStringNumberValue = formatValueToStringNumber(defaultValue);
58
+
59
+ if (currentStringNumberValue !== defaultStringNumberValue) {
60
+ setCurrentStringNumberValue(defaultStringNumberValue);
61
+ }
62
+ // eslint-disable-next-line react-hooks/exhaustive-deps
63
+ }, []);
64
+
65
65
  return (
66
66
  <TextInput
67
67
  keyboardType="numeric"
@@ -32,7 +32,6 @@ function normalizeOptions(options) {
32
32
  }
33
33
  const { width: deviceWidth, height: deviceHeight } = Dimensions.get("screen");
34
34
  const isIos = Platform.OS === "ios";
35
- const isWeb = Platform.OS === "web";
36
35
  const unstyledColor = "rgba(165, 173, 183, 1)";
37
36
  const disabledColor = "rgb(240, 240, 240)";
38
37
  const errorColor = "rgba(255, 69, 100, 1)";
@@ -187,7 +186,7 @@ const Picker = ({ error, options = [], onValueChange, defaultValue, Icon, style,
187
186
  React.createElement(View, { style: styles.iosPickerContent },
188
187
  React.createElement(Button, { Icon: Icon, type: "text", onPress: togglePickerVisible, style: styles.iosButton }, "Close"),
189
188
  React.createElement(NativePicker, { style: styles.iosNativePicker, selectedValue: internalValue, onValueChange: handleValueChange }, pickerOptions.map((option) => (React.createElement(NativePicker.Item, { label: option.label, value: option.value, key: option.value })))))))) : null,
190
- !isIos && (pickerVisible || isWeb) ? (React.createElement(NativePicker, { enabled: !disabled, selectedValue: internalValue, onValueChange: handleValueChange, style: styles.nonIosPicker, ref: androidPickerRef, onBlur: () => setPickerVisible(false) }, pickerOptions.map((option) => (React.createElement(NativePicker.Item, { label: option.label, value: option.value, key: option.value }))))) : null));
189
+ !isIos && pickerVisible ? (React.createElement(NativePicker, { enabled: pickerVisible, selectedValue: internalValue, onValueChange: handleValueChange, style: styles.nonIosPicker, ref: androidPickerRef, onBlur: () => setPickerVisible(false) }, pickerOptions.map((option) => (React.createElement(NativePicker.Item, { label: option.label, value: option.value, key: option.value }))))) : null));
191
190
  };
192
191
  const styles = StyleSheet.create({
193
192
  marginsContainer: {
@@ -84,8 +84,6 @@ function normalizeOptions(options: PickerProps["options"]): PickerOption[] {
84
84
 
85
85
  const { width: deviceWidth, height: deviceHeight } = Dimensions.get("screen");
86
86
  const isIos = Platform.OS === "ios";
87
- const isWeb = Platform.OS === "web";
88
-
89
87
  const unstyledColor = "rgba(165, 173, 183, 1)";
90
88
  const disabledColor = "rgb(240, 240, 240)";
91
89
  const errorColor = "rgba(255, 69, 100, 1)";
@@ -376,10 +374,9 @@ const Picker: React.FC<PickerProps> = ({
376
374
  ) : null}
377
375
 
378
376
  {/* nonIosPicker */}
379
- {/* Web version is collapsed by default, always show to allow direct expand */}
380
- {!isIos && (pickerVisible || isWeb) ? (
377
+ {!isIos && pickerVisible ? (
381
378
  <NativePicker
382
- enabled={!disabled}
379
+ enabled={pickerVisible}
383
380
  selectedValue={internalValue}
384
381
  onValueChange={handleValueChange}
385
382
  style={styles.nonIosPicker}