@draftbit/core 46.2.4-17908.5 → 46.2.4-27c60f.5

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 (44) hide show
  1. package/lib/commonjs/components/Config.js +1 -1
  2. package/lib/commonjs/components/{SVG.js → Svg.js} +6 -7
  3. package/lib/commonjs/index.js +7 -15
  4. package/lib/commonjs/mappings/{SVG.js → Svg.js} +2 -0
  5. package/lib/module/components/Button.js +32 -11
  6. package/lib/module/components/Checkbox/CheckboxGroupRow.js +24 -6
  7. package/lib/module/components/Checkbox/context.js +1 -1
  8. package/lib/module/components/Config.js +1 -1
  9. package/lib/module/components/Picker/PickerComponent.android.js +23 -5
  10. package/lib/module/components/Portal/PortalHost.js +26 -15
  11. package/lib/module/components/ProgressBar.js +23 -7
  12. package/lib/module/components/StepIndicator.js +33 -16
  13. package/lib/module/components/{SVG.js → Svg.js} +6 -7
  14. package/lib/module/components/TextField.js +62 -30
  15. package/lib/module/components/ToggleButton.js +17 -3
  16. package/lib/module/components/Touchable.js +18 -2
  17. package/lib/module/index.js +2 -3
  18. package/lib/module/mappings/Svg.js +16 -0
  19. package/lib/typescript/src/components/Svg.d.ts +8 -0
  20. package/lib/typescript/src/index.d.ts +1 -2
  21. package/lib/typescript/src/mappings/{SVG.d.ts → Svg.d.ts} +2 -0
  22. package/package.json +4 -6
  23. package/src/components/Config.js +1 -1
  24. package/src/components/Config.ts +1 -1
  25. package/src/components/{SVG.js → Svg.js} +5 -6
  26. package/src/components/{SVG.tsx → Svg.tsx} +9 -9
  27. package/src/index.js +1 -2
  28. package/src/index.tsx +1 -2
  29. package/src/mappings/Svg.js +21 -0
  30. package/src/mappings/Svg.ts +26 -0
  31. package/lib/commonjs/components/Youtube.js +0 -73
  32. package/lib/commonjs/mappings/Youtube.js +0 -42
  33. package/lib/module/components/Youtube.js +0 -59
  34. package/lib/module/mappings/SVG.js +0 -14
  35. package/lib/module/mappings/Youtube.js +0 -33
  36. package/lib/typescript/src/components/SVG.d.ts +0 -8
  37. package/lib/typescript/src/components/Youtube.d.ts +0 -44
  38. package/lib/typescript/src/mappings/Youtube.d.ts +0 -36
  39. package/src/components/Youtube.js +0 -38
  40. package/src/components/Youtube.tsx +0 -66
  41. package/src/mappings/SVG.js +0 -14
  42. package/src/mappings/SVG.ts +0 -15
  43. package/src/mappings/Youtube.js +0 -33
  44. package/src/mappings/Youtube.ts +0 -39
@@ -62,7 +62,7 @@ var _default = {
62
62
  width: size.width,
63
63
  height: size.height
64
64
  }, "image-placeholder_1"),
65
- placeholderSvgURL: "https://static.draftbit.com/images/placeholder-svg.svg",
65
+ placeholderSvgURL: "https://static.draftbit.com/images/placeholder-image.svg",
66
66
  squareImageUrl: buildImageUrl({
67
67
  width: 100,
68
68
  height: 100
@@ -19,31 +19,30 @@ 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
- const SVG = _ref => {
22
+ const Svg = _ref => {
23
23
  let {
24
- source,
24
+ source = _Config.default.placeholderSvgURL,
25
25
  style
26
26
  } = _ref;
27
- let svgSource = source === null || source === undefined ? _Config.default.placeholderSvgURL : source;
28
27
  return /*#__PURE__*/React.createElement(React.Fragment, null, _reactNative.Platform.OS === "ios" && /*#__PURE__*/React.createElement(_reactNative.View, {
29
28
  style: style
30
29
  }, /*#__PURE__*/React.createElement(_reactNativeSvg.SvgUri, {
31
30
  width: "100%",
32
31
  height: "100%",
33
- uri: svgSource
32
+ uri: source
34
33
  })), _reactNative.Platform.OS === "android" && /*#__PURE__*/React.createElement(_reactNative.View, {
35
34
  style: style
36
35
  }, /*#__PURE__*/React.createElement(_reactNativeSvg.SvgUri, {
37
36
  width: "100%",
38
37
  height: "100%",
39
- uri: svgSource
38
+ uri: source
40
39
  })), _reactNative.Platform.OS === "web" && /*#__PURE__*/React.createElement(_reactNative.Image, {
41
40
  style: style,
42
41
  source: {
43
- uri: svgSource
42
+ uri: source
44
43
  }
45
44
  }));
46
45
  };
47
46
 
48
- var _default = SVG;
47
+ var _default = Svg;
49
48
  exports.default = _default;
@@ -291,12 +291,6 @@ Object.defineProperty(exports, "RowHeadlineImageIcon", {
291
291
  return _RowHeadlineImageIcon.default;
292
292
  }
293
293
  });
294
- Object.defineProperty(exports, "SVG", {
295
- enumerable: true,
296
- get: function () {
297
- return _SVG.default;
298
- }
299
- });
300
294
  Object.defineProperty(exports, "ScreenContainer", {
301
295
  enumerable: true,
302
296
  get: function () {
@@ -345,6 +339,12 @@ Object.defineProperty(exports, "Surface", {
345
339
  return _Surface.default;
346
340
  }
347
341
  });
342
+ Object.defineProperty(exports, "Svg", {
343
+ enumerable: true,
344
+ get: function () {
345
+ return _Svg.default;
346
+ }
347
+ });
348
348
  Object.defineProperty(exports, "Swiper", {
349
349
  enumerable: true,
350
350
  get: function () {
@@ -393,12 +393,6 @@ Object.defineProperty(exports, "Touchable", {
393
393
  return _Touchable.default;
394
394
  }
395
395
  });
396
- Object.defineProperty(exports, "Youtube", {
397
- enumerable: true,
398
- get: function () {
399
- return _Youtube.default;
400
- }
401
- });
402
396
  Object.defineProperty(exports, "injectIcon", {
403
397
  enumerable: true,
404
398
  get: function () {
@@ -454,7 +448,7 @@ var _IconButton = _interopRequireDefault(require("./components/IconButton"));
454
448
 
455
449
  var _Image = _interopRequireDefault(require("./components/Image"));
456
450
 
457
- var _SVG = _interopRequireDefault(require("./components/SVG"));
451
+ var _Svg = _interopRequireDefault(require("./components/Svg"));
458
452
 
459
453
  var _NumberInput = _interopRequireDefault(require("./components/NumberInput"));
460
454
 
@@ -518,8 +512,6 @@ var _Stepper = _interopRequireDefault(require("./components/Stepper"));
518
512
 
519
513
  var _useAuthState = require("./components/useAuthState");
520
514
 
521
- var _Youtube = _interopRequireDefault(require("./components/Youtube"));
522
-
523
515
  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); }
524
516
 
525
517
  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; }
@@ -11,11 +11,13 @@ const SEED_DATA = {
11
11
  name: "SVG",
12
12
  tag: "SVG",
13
13
  description: "An SVG component",
14
+ packageName: "@draftbit/core",
14
15
  category: _types.COMPONENT_TYPES.media,
15
16
  layout: {
16
17
  width: 100,
17
18
  height: 100
18
19
  },
20
+ stylesPanelSections: [_types.StylesPanelSections.Size, _types.StylesPanelSections.Margins, _types.StylesPanelSections.Position, _types.StylesPanelSections.Effects],
19
21
  props: {
20
22
  source: (0, _types.createSvgProp)()
21
23
  }
@@ -1,5 +1,3 @@
1
- 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); }
2
-
3
1
  import * as React from "react";
4
2
  import { Text, Pressable, Platform, StyleSheet, ActivityIndicator } from "react-native";
5
3
  import { withTheme } from "../theming";
@@ -57,7 +55,7 @@ function Base(_ref) {
57
55
  buttonStyles.justifyContent = "flex-end";
58
56
  }
59
57
 
60
- return /*#__PURE__*/React.createElement(Pressable, _extends({
58
+ return /*#__PURE__*/React.createElement(Pressable, {
61
59
  onPress: onPress,
62
60
  disabled: disabled || loading,
63
61
  style: _ref2 => {
@@ -67,8 +65,9 @@ function Base(_ref) {
67
65
  return [styles.base, {
68
66
  opacity: pressed || disabled ? 0.75 : 1
69
67
  }, buttonStyles];
70
- }
71
- }, props), loading ? /*#__PURE__*/React.createElement(ActivityIndicator, {
68
+ },
69
+ ...props
70
+ }, loading ? /*#__PURE__*/React.createElement(ActivityIndicator, {
72
71
  size: "small",
73
72
  color: color,
74
73
  style: styles.loading
@@ -88,13 +87,14 @@ const Solid = _ref3 => {
88
87
  theme,
89
88
  ...props
90
89
  } = _ref3;
91
- return /*#__PURE__*/React.createElement(Base, _extends({
90
+ return /*#__PURE__*/React.createElement(Base, {
92
91
  style: [{
93
92
  color: "#FFF",
94
93
  borderRadius: theme.roundness,
95
94
  backgroundColor: theme.colors.primary
96
- }, style]
97
- }, props));
95
+ }, style],
96
+ ...props
97
+ });
98
98
  };
99
99
 
100
100
  const ButtonSolid = withTheme(Solid);
@@ -106,13 +106,14 @@ const Outline = _ref4 => {
106
106
  theme,
107
107
  ...props
108
108
  } = _ref4;
109
- return /*#__PURE__*/React.createElement(Base, _extends({
109
+ return /*#__PURE__*/React.createElement(Base, {
110
110
  style: [styles.outline, {
111
111
  borderRadius: theme.roundness,
112
112
  borderColor: theme.colors.primary,
113
113
  color: theme.colors.primary
114
- }, style]
115
- }, props));
114
+ }, style],
115
+ ...props
116
+ });
116
117
  };
117
118
 
118
119
  const ButtonOutline = withTheme(Outline);
@@ -159,4 +160,24 @@ const styles = StyleSheet.create({
159
160
  }
160
161
  })
161
162
  }
163
+ });ndColor: "transparent",
164
+ padding: 0,
165
+ minHeight: undefined
166
+ },
167
+ loading: {
168
+ marginRight: 6
169
+ },
170
+ icon: { ...Platform.select({
171
+ web: {
172
+ marginTop: 1,
173
+ marginRight: 4,
174
+ alignSelf: "center"
175
+ },
176
+ default: {
177
+ marginBottom: 2,
178
+ marginRight: 4,
179
+ alignSelf: "center"
180
+ }
181
+ })
182
+ }
162
183
  });
@@ -1,5 +1,3 @@
1
- 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); }
2
-
3
1
  import * as React from "react";
4
2
  import { StyleSheet, View, Platform } from "react-native";
5
3
  import Checkbox from "./Checkbox";
@@ -8,7 +6,7 @@ import { useCheckboxGroupContext } from "./context";
8
6
  import { Direction as GroupDirection } from "./context";
9
7
  import Touchable from "../Touchable";
10
8
  import { extractStyles } from "../../utilities";
11
- export let Direction;
9
+ export var Direction;
12
10
 
13
11
  (function (Direction) {
14
12
  Direction["Row"] = "row";
@@ -71,13 +69,14 @@ const CheckboxGroupRow = _ref => {
71
69
  textStyles,
72
70
  viewStyles
73
71
  } = extractStyles(style);
74
- return /*#__PURE__*/React.createElement(Touchable, _extends({
72
+ return /*#__PURE__*/React.createElement(Touchable, {
75
73
  onPress: handlePress,
76
74
  style: [styles.mainParent, {
77
75
  flexDirection: direction
78
76
  }, viewStyles],
79
- disabled: disabled
80
- }, rest), /*#__PURE__*/React.createElement(View, {
77
+ disabled: disabled,
78
+ ...rest
79
+ }, /*#__PURE__*/React.createElement(View, {
81
80
  style: [styles.label, {
82
81
  alignItems: direction === Direction.Row ? "flex-start" : "flex-end"
83
82
  }, labelContainerStyle]
@@ -116,4 +115,23 @@ const styles = StyleSheet.create({
116
115
  flex: 3
117
116
  }
118
117
  });
118
+ export default CheckboxGroupRow;create({
119
+ mainParent: {
120
+ alignItems: "center",
121
+ justifyContent: "space-around",
122
+ paddingStart: 20,
123
+ minHeight: 50,
124
+ paddingEnd: 20,
125
+ display: "flex",
126
+ ...Platform.select({
127
+ web: {
128
+ cursor: "pointer",
129
+ userSelect: "none"
130
+ }
131
+ })
132
+ },
133
+ label: {
134
+ flex: 3
135
+ }
136
+ });
119
137
  export default CheckboxGroupRow;
@@ -1,5 +1,5 @@
1
1
  import { createContext, useContext } from "react";
2
- export let Direction;
2
+ export var Direction;
3
3
 
4
4
  (function (Direction) {
5
5
  Direction["Horizontal"] = "horizontal";
@@ -54,7 +54,7 @@ export default {
54
54
  width: size.width,
55
55
  height: size.height
56
56
  }, "image-placeholder_1"),
57
- placeholderSvgURL: "https://static.draftbit.com/images/placeholder-svg.svg",
57
+ placeholderSvgURL: "https://static.draftbit.com/images/placeholder-image.svg",
58
58
  squareImageUrl: buildImageUrl({
59
59
  width: 100,
60
60
  height: 100
@@ -1,5 +1,3 @@
1
- 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); }
2
-
3
1
  import * as React from "react";
4
2
  import { View, StyleSheet } from "react-native";
5
3
  import omit from "lodash.omit";
@@ -10,8 +8,6 @@ import TextField from "../TextField";
10
8
  import Touchable from "../Touchable";
11
9
 
12
10
  const Picker = _ref => {
13
- var _options$find$label, _options$find;
14
-
15
11
  let {
16
12
  style,
17
13
  options,
@@ -21,6 +17,9 @@ const Picker = _ref => {
21
17
  onValueChange: onValueChangeOverride = () => {},
22
18
  ...props
23
19
  } = _ref;
20
+
21
+ var _a, _b;
22
+
24
23
  const {
25
24
  viewStyles: {
26
25
  borderRadius,
@@ -67,7 +66,7 @@ const Picker = _ref => {
67
66
  };
68
67
 
69
68
  const stylesWithoutMargin = style && omit(StyleSheet.flatten(style), ["margin", "marginTop", "marginRight", "marginBottom", "marginLeft"]);
70
- const selectedLabel = selectedValue && ((_options$find$label = (_options$find = options.find(o => o.value === selectedValue)) === null || _options$find === void 0 ? void 0 : _options$find.label) !== null && _options$find$label !== void 0 ? _options$find$label : selectedValue);
69
+ const selectedLabel = selectedValue && ((_b = (_a = options.find(o => o.value === selectedValue)) === null || _a === void 0 ? void 0 : _a.label) !== null && _b !== void 0 ? _b : selectedValue);
71
70
  return /*#__PURE__*/React.createElement(Touchable, {
72
71
  disabled: disabled,
73
72
  onPress: toggleFocus,
@@ -89,6 +88,25 @@ const Picker = _ref => {
89
88
  label: o.label,
90
89
  value: o.value,
91
90
  key: o.value
91
+ }))), /*#__PURE__*/React.createElement(View, {
92
+ pointerEvents: "none"
93
+ }, /*#__PURE__*/React.createElement(TextField, { ...props,
94
+ value: selectedLabel,
95
+ placeholder: placeholder,
96
+ // @ts-ignore
97
+ ref: textField,
98
+ disabled: disabled,
99
+ // @ts-expect-error
100
+ style: stylesWithoutMargin
101
+ }))));
102
+ };
103
+
104
+ const styles = StyleSheet.create({
105
+ container: {
106
+ alignSelf: "stretch"
107
+ }
108
+ });
109
+ export default withTheme(Picker); key: o.value
92
110
  }))), /*#__PURE__*/React.createElement(View, {
93
111
  pointerEvents: "none"
94
112
  }, /*#__PURE__*/React.createElement(TextField, _extends({}, props, {
@@ -1,5 +1,3 @@
1
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
-
3
1
  import * as React from "react";
4
2
  import { View, StyleSheet } from "react-native";
5
3
  import PortalManager from "./PortalManager";
@@ -33,11 +31,11 @@ export default class PortalHost extends React.Component {
33
31
  constructor() {
34
32
  super(...arguments);
35
33
 
36
- _defineProperty(this, "setManager", manager => {
34
+ this.setManager = manager => {
37
35
  this.manager = manager;
38
- });
36
+ };
39
37
 
40
- _defineProperty(this, "mount", children => {
38
+ this.mount = children => {
41
39
  const key = this.nextKey++;
42
40
 
43
41
  if (this.manager) {
@@ -51,9 +49,9 @@ export default class PortalHost extends React.Component {
51
49
  }
52
50
 
53
51
  return key;
54
- });
52
+ };
55
53
 
56
- _defineProperty(this, "update", (key, children) => {
54
+ this.update = (key, children) => {
57
55
  if (this.manager) {
58
56
  this.manager.update(key, children);
59
57
  } else {
@@ -71,9 +69,9 @@ export default class PortalHost extends React.Component {
71
69
  this.queue.push(op);
72
70
  }
73
71
  }
74
- });
72
+ };
75
73
 
76
- _defineProperty(this, "unmount", key => {
74
+ this.unmount = key => {
77
75
  if (this.manager) {
78
76
  this.manager.unmount(key);
79
77
  } else {
@@ -82,13 +80,10 @@ export default class PortalHost extends React.Component {
82
80
  key
83
81
  });
84
82
  }
85
- });
86
-
87
- _defineProperty(this, "nextKey", 0);
88
-
89
- _defineProperty(this, "queue", []);
83
+ };
90
84
 
91
- _defineProperty(this, "manager", void 0);
85
+ this.nextKey = 0;
86
+ this.queue = [];
92
87
  }
93
88
 
94
89
  componentDidMount() {
@@ -132,6 +127,22 @@ export default class PortalHost extends React.Component {
132
127
  }));
133
128
  }
134
129
 
130
+ }
131
+ PortalHost.displayName = "Portal.Host";
132
+ const styles = StyleSheet.create({
133
+ container: {
134
+ flex: 1
135
+ }
136
+ }); }
137
+ }, /*#__PURE__*/React.createElement(View, {
138
+ style: styles.container,
139
+ collapsable: false,
140
+ pointerEvents: "box-none"
141
+ }, this.props.children), /*#__PURE__*/React.createElement(PortalManager, {
142
+ ref: this.setManager
143
+ }));
144
+ }
145
+
135
146
  }
136
147
 
137
148
  _defineProperty(PortalHost, "displayName", "Portal.Host");
@@ -1,7 +1,3 @@
1
- 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); }
2
-
3
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
4
-
5
1
  import React, { Component } from "react";
6
2
  import { Animated, Easing, View, I18nManager } from "react-native";
7
3
  const INDETERMINATE_WIDTH_FACTOR = 0.3;
@@ -10,7 +6,7 @@ export default class ProgressBar extends Component {
10
6
  constructor(props) {
11
7
  super(props);
12
8
 
13
- _defineProperty(this, "handleLayout", event => {
9
+ this.handleLayout = event => {
14
10
  const {
15
11
  width = 150,
16
12
  onLayout
@@ -25,7 +21,7 @@ export default class ProgressBar extends Component {
25
21
  if (onLayout) {
26
22
  onLayout(event);
27
23
  }
28
- });
24
+ };
29
25
 
30
26
  const {
31
27
  progress: progressP = 0,
@@ -79,7 +75,6 @@ export default class ProgressBar extends Component {
79
75
  Animated[animationType](this.state.progress, { ...animationConfig,
80
76
  toValue: progress,
81
77
  velocity: 0,
82
- //adjust this value if animation fails - velocity is required
83
78
  useNativeDriver
84
79
  }).start();
85
80
  } else {
@@ -150,6 +145,27 @@ export default class ProgressBar extends Component {
150
145
  })
151
146
  }]
152
147
  };
148
+ return /*#__PURE__*/React.createElement(View, {
149
+ style: [containerStyle, style],
150
+ onLayout: this.handleLayout,
151
+ ...restProps
152
+ }, /*#__PURE__*/React.createElement(Animated.View, {
153
+ style: progressStyle
154
+ }), children);
155
+ }
156
+
157
+ }te.progress.interpolate({
158
+ inputRange: [0, 1],
159
+ outputRange: [innerWidth / (I18nManager.isRTL ? 2 : -2), 0]
160
+ })
161
+ }, {
162
+ // Interpolation a temp workaround for https://github.com/facebook/react-native/issues/6278
163
+ scaleX: this.state.progress.interpolate({
164
+ inputRange: [0, 1],
165
+ outputRange: [0.0001, 1]
166
+ })
167
+ }]
168
+ };
153
169
  return /*#__PURE__*/React.createElement(View, _extends({
154
170
  style: [containerStyle, style],
155
171
  onLayout: this.handleLayout
@@ -1,5 +1,3 @@
1
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
-
3
1
  // @ts-nocheck
4
2
  import React, { Component } from "react";
5
3
  import { View, Text, StyleSheet, Animated, TouchableWithoutFeedback } from "react-native";
@@ -12,7 +10,7 @@ export default class StepIndicator extends Component {
12
10
  constructor(props) {
13
11
  super(props);
14
12
 
15
- _defineProperty(this, "renderProgressBarBackground", () => {
13
+ this.renderProgressBarBackground = () => {
16
14
  const {
17
15
  stepCount,
18
16
  direction
@@ -57,9 +55,9 @@ export default class StepIndicator extends Component {
57
55
  },
58
56
  style: progressBarBackgroundStyle
59
57
  });
60
- });
58
+ };
61
59
 
62
- _defineProperty(this, "renderProgressBar", () => {
60
+ this.renderProgressBar = () => {
63
61
  const {
64
62
  stepCount,
65
63
  direction
@@ -91,9 +89,9 @@ export default class StepIndicator extends Component {
91
89
  return /*#__PURE__*/React.createElement(Animated.View, {
92
90
  style: progressBarStyle
93
91
  });
94
- });
92
+ };
95
93
 
96
- _defineProperty(this, "renderStepIndicator", () => {
94
+ this.renderStepIndicator = () => {
97
95
  let steps = [];
98
96
  const {
99
97
  stepCount,
@@ -126,9 +124,9 @@ export default class StepIndicator extends Component {
126
124
  height: this.state.customStyles.currentStepIndicatorSize
127
125
  }]
128
126
  }, steps);
129
- });
127
+ };
130
128
 
131
- _defineProperty(this, "renderStepLabels", () => {
129
+ this.renderStepLabels = () => {
132
130
  const {
133
131
  labels,
134
132
  direction,
@@ -170,9 +168,9 @@ export default class StepIndicator extends Component {
170
168
  alignItems: this.state.customStyles.labelAlign
171
169
  }]
172
170
  }, labelViews);
173
- });
171
+ };
174
172
 
175
- _defineProperty(this, "renderStep", position => {
173
+ this.renderStep = position => {
176
174
  const {
177
175
  renderStepIndicator
178
176
  } = this.props;
@@ -244,9 +242,9 @@ export default class StepIndicator extends Component {
244
242
  }) : /*#__PURE__*/React.createElement(Text, {
245
243
  style: indicatorLabelStyle
246
244
  }, "".concat(position + 1)));
247
- });
245
+ };
248
246
 
249
- _defineProperty(this, "getStepStatus", stepPosition => {
247
+ this.getStepStatus = stepPosition => {
250
248
  const {
251
249
  currentPosition
252
250
  } = this.props;
@@ -258,9 +256,9 @@ export default class StepIndicator extends Component {
258
256
  } else {
259
257
  return STEP_STATUS.UNFINISHED;
260
258
  }
261
- });
259
+ };
262
260
 
263
- _defineProperty(this, "onCurrentPositionChanged", position => {
261
+ this.onCurrentPositionChanged = position => {
264
262
  let {
265
263
  stepCount
266
264
  } = this.props;
@@ -282,7 +280,7 @@ export default class StepIndicator extends Component {
282
280
  toValue: this.state.customStyles.currentStepIndicatorSize / 2,
283
281
  duration: 100
284
282
  })])]).start();
285
- });
283
+ };
286
284
 
287
285
  const defaultStyles = {
288
286
  stepIndicatorSize: 30,
@@ -393,6 +391,25 @@ const styles = StyleSheet.create({
393
391
  justifyContent: "center"
394
392
  }
395
393
  });
394
+ StepIndicator.defaultProps = {
395
+ currentPosition: 0,
396
+ stepCount: 5,
397
+ customStyles: {},
398
+ direction: "horizontal"
399
+ };s: "center",
400
+ justifyContent: "center"
401
+ },
402
+ stepLabel: {
403
+ fontSize: 12,
404
+ textAlign: "center",
405
+ fontWeight: "500"
406
+ },
407
+ stepLabelItem: {
408
+ flex: 1,
409
+ alignItems: "center",
410
+ justifyContent: "center"
411
+ }
412
+ });
396
413
  StepIndicator.defaultProps = {
397
414
  currentPosition: 0,
398
415
  stepCount: 5,
@@ -3,30 +3,29 @@ import { View, Platform, Image } from "react-native";
3
3
  import { SvgUri } from "react-native-svg";
4
4
  import Config from "./Config";
5
5
 
6
- const SVG = _ref => {
6
+ const Svg = _ref => {
7
7
  let {
8
- source,
8
+ source = Config.placeholderSvgURL,
9
9
  style
10
10
  } = _ref;
11
- let svgSource = source === null || source === undefined ? Config.placeholderSvgURL : source;
12
11
  return /*#__PURE__*/React.createElement(React.Fragment, null, Platform.OS === "ios" && /*#__PURE__*/React.createElement(View, {
13
12
  style: style
14
13
  }, /*#__PURE__*/React.createElement(SvgUri, {
15
14
  width: "100%",
16
15
  height: "100%",
17
- uri: svgSource
16
+ uri: source
18
17
  })), Platform.OS === "android" && /*#__PURE__*/React.createElement(View, {
19
18
  style: style
20
19
  }, /*#__PURE__*/React.createElement(SvgUri, {
21
20
  width: "100%",
22
21
  height: "100%",
23
- uri: svgSource
22
+ uri: source
24
23
  })), Platform.OS === "web" && /*#__PURE__*/React.createElement(Image, {
25
24
  style: style,
26
25
  source: {
27
- uri: svgSource
26
+ uri: source
28
27
  }
29
28
  }));
30
29
  };
31
30
 
32
- export default SVG;
31
+ export default Svg;