react-crud-mobile 1.0.869 → 1.0.871

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.
@@ -41,6 +41,7 @@ declare const UI: {
41
41
  Entity: (props: ListInputType) => import("react").JSX.Element;
42
42
  Element: (props: ListInputType) => import("react").JSX.Element;
43
43
  Quantity: (props: ListInputType) => import("react").JSX.Element;
44
+ Slider: (props: InputType) => import("react").JSX.Element;
44
45
  SafeView: typeof SafeView;
45
46
  };
46
47
  export default UI;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import { ChildType } from 'react-crud-utils';
3
+ export default function UISlider(props: ChildType): import("react").JSX.Element;
@@ -11,6 +11,7 @@ var reactNative = require('react-native');
11
11
  var jsxRuntime = require('react/jsx-runtime');
12
12
  var Ionicons = _interopDefault(require('@expo/vector-icons/Ionicons'));
13
13
  var vectorIcons = require('@expo/vector-icons');
14
+ var Slider = _interopDefault(require('@react-native-community/slider'));
14
15
  var Toast = require('react-native-toast-message');
15
16
  var Toast__default = _interopDefault(Toast);
16
17
  var reactNativeSafeAreaContext = require('react-native-safe-area-context');
@@ -636,6 +637,32 @@ function UISwitch(props) {
636
637
  });
637
638
  }
638
639
 
640
+ function UISlider(props) {
641
+ var scope = props.scope;
642
+ var initial = scope.getValue();
643
+ var _useState = React.useState(initial),
644
+ value = _useState[0],
645
+ setValue = _useState[1];
646
+ var onChange = function onChange(v) {
647
+ scope.changeValue(v);
648
+ setValue(v);
649
+ };
650
+ var step = scope.getPart('step', 1);
651
+ var min = scope.getPart('min', 0);
652
+ var max = scope.getPart('min', 100);
653
+ return /*#__PURE__*/jsxRuntime.jsx(Slider, {
654
+ minimumValue: min,
655
+ maximumValue: max,
656
+ step: step,
657
+ minimumTrackTintColor: "#1EB1FC",
658
+ maximumTrackTintColor: "#d3d3d3",
659
+ thumbTintColor: "#1EB1FC",
660
+ value: value,
661
+ style: scope.getStyle('element'),
662
+ onValueChange: onChange // Alterna o estado
663
+ });
664
+ }
665
+
639
666
  function UIOption(props) {
640
667
  var handlePress = function handlePress() {
641
668
  reactNative.Linking.openURL('https://reactnative.dev/');
@@ -1741,6 +1768,8 @@ function UIElement(props) {
1741
1768
  checked: isChecked()
1742
1769
  }, defaultsInput, {
1743
1770
  onChange: onCheck
1771
+ })), scope.is('slider') && /*#__PURE__*/jsxRuntime.jsx(UISlider, _extends({}, defaultsInput, {
1772
+ onChange: onCheck
1744
1773
  })), scope.is('type', 'select') && /*#__PURE__*/jsxRuntime.jsx(UISelect, _extends({}, defaultsInput, defaultsUI, {
1745
1774
  value: scope.getSelectedValue()
1746
1775
  })), scope.is('type', 'toggle') && /*#__PURE__*/jsxRuntime.jsx(UIToggle, _extends({}, defaultsInput, defaultsUI, {
@@ -2261,6 +2290,11 @@ var UI = {
2261
2290
  type: "quantity"
2262
2291
  }));
2263
2292
  },
2293
+ Slider: function Slider(props) {
2294
+ return /*#__PURE__*/jsxRuntime.jsx(UIElement, _extends({}, props, {
2295
+ type: "slider"
2296
+ }));
2297
+ },
2264
2298
  SafeView: SafeView
2265
2299
  };
2266
2300