@draftbit/core 46.7.9-900f3a.2 → 46.7.9-cbe269.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.
- package/lib/commonjs/components/Accordion/AccordionItem.js +23 -4
- package/lib/commonjs/components/Divider.js +14 -1
- package/lib/commonjs/components/Elevation.js +14 -2
- package/lib/commonjs/components/Picker/Picker.js +3 -2
- package/lib/commonjs/components/TextField.js +76 -28
- package/lib/commonjs/constants.js +1 -1
- package/lib/commonjs/index.js +0 -13
- package/lib/commonjs/mappings/StarRating.js +2 -6
- package/lib/commonjs/styles/overlay.js +3 -1
- package/lib/module/components/Picker/Picker.js +3 -2
- package/lib/module/index.js +0 -1
- package/lib/typescript/src/components/Picker/Picker.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +0 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/package.json +3 -4
- package/src/components/Picker/Picker.js +2 -1
- package/src/components/Picker/Picker.tsx +5 -2
- package/src/index.js +0 -1
- package/src/index.tsx +0 -2
- package/lib/commonjs/components/DeckSwiper/DeckSwiper.js +0 -74
- package/lib/commonjs/components/DeckSwiper/DeckSwiperCard.js +0 -37
- package/lib/commonjs/components/DeckSwiper/index.js +0 -20
- package/lib/commonjs/mappings/DeckSwiper.js +0 -52
- package/lib/commonjs/mappings/DeckSwiperCard.js +0 -16
- package/lib/module/components/DeckSwiper/DeckSwiper.js +0 -66
- package/lib/module/components/DeckSwiper/DeckSwiperCard.js +0 -28
- package/lib/module/components/DeckSwiper/index.js +0 -2
- package/lib/module/mappings/DeckSwiper.js +0 -45
- package/lib/module/mappings/DeckSwiperCard.js +0 -9
- package/lib/typescript/src/components/DeckSwiper/DeckSwiper.d.ts +0 -15
- package/lib/typescript/src/components/DeckSwiper/DeckSwiper.d.ts.map +0 -1
- package/lib/typescript/src/components/DeckSwiper/DeckSwiperCard.d.ts +0 -13
- package/lib/typescript/src/components/DeckSwiper/DeckSwiperCard.d.ts.map +0 -1
- package/lib/typescript/src/components/DeckSwiper/index.d.ts +0 -3
- package/lib/typescript/src/components/DeckSwiper/index.d.ts.map +0 -1
- package/lib/typescript/src/mappings/DeckSwiper.d.ts +0 -83
- package/lib/typescript/src/mappings/DeckSwiper.d.ts.map +0 -1
- package/lib/typescript/src/mappings/DeckSwiperCard.d.ts +0 -9
- package/lib/typescript/src/mappings/DeckSwiperCard.d.ts.map +0 -1
- package/src/components/DeckSwiper/DeckSwiper.js +0 -35
- package/src/components/DeckSwiper/DeckSwiper.tsx +0 -94
- package/src/components/DeckSwiper/DeckSwiperCard.js +0 -25
- package/src/components/DeckSwiper/DeckSwiperCard.tsx +0 -42
- package/src/components/DeckSwiper/index.js +0 -2
- package/src/components/DeckSwiper/index.tsx +0 -2
- package/src/mappings/DeckSwiper.js +0 -45
- package/src/mappings/DeckSwiper.ts +0 -54
- package/src/mappings/DeckSwiperCard.js +0 -9
- package/src/mappings/DeckSwiperCard.ts +0 -13
|
@@ -12,7 +12,6 @@ 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); }
|
|
16
15
|
const AccordionItem = _ref => {
|
|
17
16
|
let {
|
|
18
17
|
Icon,
|
|
@@ -27,9 +26,10 @@ const AccordionItem = _ref => {
|
|
|
27
26
|
textStyles,
|
|
28
27
|
viewStyles
|
|
29
28
|
} = (0, _utilities.extractStyles)(style);
|
|
30
|
-
return /*#__PURE__*/React.createElement(_reactNative.Pressable,
|
|
31
|
-
style: [styles.container, viewStyles]
|
|
32
|
-
|
|
29
|
+
return /*#__PURE__*/React.createElement(_reactNative.Pressable, {
|
|
30
|
+
style: [styles.container, viewStyles],
|
|
31
|
+
...rest
|
|
32
|
+
}, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
33
33
|
style: styles.row
|
|
34
34
|
}, icon ? /*#__PURE__*/React.createElement(Icon, {
|
|
35
35
|
name: icon,
|
|
@@ -61,4 +61,23 @@ 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);
|
|
64
83
|
exports.default = _default;
|
|
@@ -9,7 +9,6 @@ var _reactNative = require("react-native");
|
|
|
9
9
|
var _theming = require("../theming");
|
|
10
10
|
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); }
|
|
11
11
|
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; }
|
|
12
|
-
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); }
|
|
13
12
|
const Divider = _ref => {
|
|
14
13
|
let {
|
|
15
14
|
style,
|
|
@@ -19,6 +18,20 @@ const Divider = _ref => {
|
|
|
19
18
|
},
|
|
20
19
|
...rest
|
|
21
20
|
} = _ref;
|
|
21
|
+
return /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
22
|
+
style: [{
|
|
23
|
+
backgroundColor: color || colors.divider,
|
|
24
|
+
height: _reactNative.StyleSheet.hairlineWidth
|
|
25
|
+
}, style],
|
|
26
|
+
...rest
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
var _default = (0, _theming.withTheme)(Divider);
|
|
30
|
+
exports.default = _default;eme: {
|
|
31
|
+
colors
|
|
32
|
+
},
|
|
33
|
+
...rest
|
|
34
|
+
} = _ref;
|
|
22
35
|
return /*#__PURE__*/React.createElement(_reactNative.View, _extends({
|
|
23
36
|
style: [{
|
|
24
37
|
backgroundColor: color || colors.divider,
|
|
@@ -11,7 +11,6 @@ var _theming = require("../theming");
|
|
|
11
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
12
|
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); }
|
|
13
13
|
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; }
|
|
14
|
-
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
14
|
/* directly copied from https://github.com/callstack/react-native-paper/blob/main/src/components/Surface.tsx#L62 */
|
|
16
15
|
const Elevation = _ref => {
|
|
17
16
|
let {
|
|
@@ -28,11 +27,24 @@ const Elevation = _ref => {
|
|
|
28
27
|
colors
|
|
29
28
|
} = theme;
|
|
30
29
|
const borderRadius = radius;
|
|
31
|
-
return /*#__PURE__*/React.createElement(_reactNative.Animated.View,
|
|
30
|
+
return /*#__PURE__*/React.createElement(_reactNative.Animated.View, {
|
|
31
|
+
...rest,
|
|
32
32
|
style: [{
|
|
33
33
|
borderRadius,
|
|
34
34
|
backgroundColor: colors.surface
|
|
35
35
|
}, elevation ? (0, _shadow.default)(elevation) : null, style]
|
|
36
|
+
}, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
37
|
+
style: {
|
|
38
|
+
overflow: "hidden",
|
|
39
|
+
borderRadius
|
|
40
|
+
}
|
|
41
|
+
}, children));
|
|
42
|
+
};
|
|
43
|
+
var _default = (0, _theming.withTheme)(Elevation);
|
|
44
|
+
exports.default = _default;
|
|
45
|
+
borderRadius,
|
|
46
|
+
backgroundColor: colors.surface
|
|
47
|
+
}, elevation ? (0, _shadow.default)(elevation) : null, style]
|
|
36
48
|
}), /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
37
49
|
style: {
|
|
38
50
|
overflow: "hidden",
|
|
@@ -42,6 +42,7 @@ 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";
|
|
45
46
|
const unstyledColor = "rgba(165, 173, 183, 1)";
|
|
46
47
|
const disabledColor = "rgb(240, 240, 240)";
|
|
47
48
|
const errorColor = "rgba(255, 69, 100, 1)";
|
|
@@ -233,8 +234,8 @@ const Picker = _ref => {
|
|
|
233
234
|
label: option.label,
|
|
234
235
|
value: option.value,
|
|
235
236
|
key: option.value
|
|
236
|
-
})))))) : null, !isIos && pickerVisible ? /*#__PURE__*/React.createElement(_picker.Picker, {
|
|
237
|
-
enabled:
|
|
237
|
+
})))))) : null, !isIos && (pickerVisible || isWeb) ? /*#__PURE__*/React.createElement(_picker.Picker, {
|
|
238
|
+
enabled: !disabled,
|
|
238
239
|
selectedValue: internalValue,
|
|
239
240
|
onValueChange: handleValueChange,
|
|
240
241
|
style: styles.nonIosPicker,
|
|
@@ -10,10 +10,6 @@ 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); }
|
|
17
13
|
const AnimatedText = _reactNative.Animated.createAnimatedComponent(_reactNative.Text);
|
|
18
14
|
const FOCUS_ANIMATION_DURATION = 150;
|
|
19
15
|
const BLUR_ANIMATION_DURATION = 180;
|
|
@@ -21,7 +17,7 @@ const ICON_SIZE = 24;
|
|
|
21
17
|
class TextField extends React.Component {
|
|
22
18
|
constructor() {
|
|
23
19
|
super(...arguments);
|
|
24
|
-
|
|
20
|
+
this.state = {
|
|
25
21
|
nativeProps: {},
|
|
26
22
|
labeled: new _reactNative.Animated.Value(this.props.value || this.props.error ? 0 : 1),
|
|
27
23
|
focused: false,
|
|
@@ -30,47 +26,46 @@ class TextField extends React.Component {
|
|
|
30
26
|
measured: false,
|
|
31
27
|
width: 0
|
|
32
28
|
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
|
|
29
|
+
};
|
|
30
|
+
this._timer = setTimeout(() => {}, 0);
|
|
31
|
+
this._showPlaceholder = () => {
|
|
36
32
|
clearTimeout(this._timer);
|
|
37
|
-
|
|
38
33
|
// Set the placeholder in a delay to offset the label animation
|
|
39
34
|
// If we show it immediately, they'll overlap and look ugly
|
|
40
35
|
this._timer = setTimeout(() => this.setState({
|
|
41
36
|
placeholder: this.props.placeholder
|
|
42
37
|
}), 50);
|
|
43
|
-
}
|
|
44
|
-
|
|
38
|
+
};
|
|
39
|
+
this._hidePlaceholder = () => this.setState({
|
|
45
40
|
placeholder: ""
|
|
46
|
-
})
|
|
47
|
-
|
|
41
|
+
});
|
|
42
|
+
this._restoreLabel = () => _reactNative.Animated.timing(this.state.labeled, {
|
|
48
43
|
toValue: 1,
|
|
49
44
|
duration: FOCUS_ANIMATION_DURATION,
|
|
50
45
|
useNativeDriver: true
|
|
51
|
-
}).start()
|
|
52
|
-
|
|
46
|
+
}).start();
|
|
47
|
+
this._minmizeLabel = () => _reactNative.Animated.timing(this.state.labeled, {
|
|
53
48
|
toValue: 0,
|
|
54
49
|
duration: BLUR_ANIMATION_DURATION,
|
|
55
50
|
useNativeDriver: true
|
|
56
|
-
}).start()
|
|
57
|
-
|
|
51
|
+
}).start();
|
|
52
|
+
this._handleFocus = () => {
|
|
58
53
|
if (this.props.disabled) {
|
|
59
54
|
return;
|
|
60
55
|
}
|
|
61
56
|
this.setState({
|
|
62
57
|
focused: true
|
|
63
58
|
});
|
|
64
|
-
}
|
|
65
|
-
|
|
59
|
+
};
|
|
60
|
+
this._handleBlur = () => {
|
|
66
61
|
if (this.props.disabled) {
|
|
67
62
|
return;
|
|
68
63
|
}
|
|
69
64
|
this.setState({
|
|
70
65
|
focused: false
|
|
71
66
|
});
|
|
72
|
-
}
|
|
73
|
-
|
|
67
|
+
};
|
|
68
|
+
this._handleChangeText = value => {
|
|
74
69
|
if (this.props.disabled) {
|
|
75
70
|
return;
|
|
76
71
|
}
|
|
@@ -85,8 +80,8 @@ class TextField extends React.Component {
|
|
|
85
80
|
});
|
|
86
81
|
this.props.onChangeText && this.props.onChangeText(value.nativeEvent.text);
|
|
87
82
|
}
|
|
88
|
-
}
|
|
89
|
-
|
|
83
|
+
};
|
|
84
|
+
this._root = undefined;
|
|
90
85
|
}
|
|
91
86
|
static getDerivedStateFromProps(nextProps, prevState) {
|
|
92
87
|
return {
|
|
@@ -173,7 +168,9 @@ class TextField extends React.Component {
|
|
|
173
168
|
roundness,
|
|
174
169
|
disabledOpacity
|
|
175
170
|
},
|
|
176
|
-
render = props => /*#__PURE__*/React.createElement(_reactNative.TextInput,
|
|
171
|
+
render = props => /*#__PURE__*/React.createElement(_reactNative.TextInput, {
|
|
172
|
+
...props
|
|
173
|
+
}),
|
|
177
174
|
...rest
|
|
178
175
|
} = this.props;
|
|
179
176
|
const MINIMIZED_LABEL_Y_OFFSET = -(typography.caption.lineHeight + 4);
|
|
@@ -313,9 +310,10 @@ class TextField extends React.Component {
|
|
|
313
310
|
} = _reactNative.StyleSheet.flatten(style || {});
|
|
314
311
|
return /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
315
312
|
style: [styles.container, styleProp]
|
|
316
|
-
}, leftIconName && leftIconMode === "outset" ? /*#__PURE__*/React.createElement(Icon,
|
|
313
|
+
}, leftIconName && leftIconMode === "outset" ? /*#__PURE__*/React.createElement(Icon, {
|
|
314
|
+
...leftIconProps,
|
|
317
315
|
style: leftIconStyle
|
|
318
|
-
})
|
|
316
|
+
}) : null, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
319
317
|
style: (0, _utilities.applyStyles)([containerStyle], {
|
|
320
318
|
height: style === null || style === void 0 ? void 0 : style.height,
|
|
321
319
|
backgroundColor: bgColor,
|
|
@@ -383,9 +381,10 @@ class TextField extends React.Component {
|
|
|
383
381
|
style: {
|
|
384
382
|
justifyContent: type === "solid" ? "center" : undefined
|
|
385
383
|
}
|
|
386
|
-
}, /*#__PURE__*/React.createElement(Icon,
|
|
384
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
385
|
+
...leftIconProps,
|
|
387
386
|
style: leftIconStyle
|
|
388
|
-
}))
|
|
387
|
+
})) : null, render({
|
|
389
388
|
ref: c => {
|
|
390
389
|
this._root = c;
|
|
391
390
|
},
|
|
@@ -423,6 +422,55 @@ class TextField extends React.Component {
|
|
|
423
422
|
}
|
|
424
423
|
var _default = (0, _theming.withTheme)(TextField);
|
|
425
424
|
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;
|
|
426
474
|
const styles = _reactNative.StyleSheet.create({
|
|
427
475
|
container: {
|
|
428
476
|
alignSelf: "stretch"
|
|
@@ -12,4 +12,4 @@ const APPROX_STATUSBAR_HEIGHT = _reactNative.Platform.select({
|
|
|
12
12
|
android: DEFAULT_STATUSBAR_HEIGHT_EXPO,
|
|
13
13
|
ios: _reactNative.Platform.Version < 11 ? DEFAULT_STATUSBAR_HEIGHT_EXPO : 0
|
|
14
14
|
});
|
|
15
|
-
exports.APPROX_STATUSBAR_HEIGHT = APPROX_STATUSBAR_HEIGHT;
|
|
15
|
+
exports.APPROX_STATUSBAR_HEIGHT = APPROX_STATUSBAR_HEIGHT;
|
package/lib/commonjs/index.js
CHANGED
|
@@ -123,18 +123,6 @@ Object.defineProperty(exports, "DatePicker", {
|
|
|
123
123
|
return _DatePicker.default;
|
|
124
124
|
}
|
|
125
125
|
});
|
|
126
|
-
Object.defineProperty(exports, "DeckSwiper", {
|
|
127
|
-
enumerable: true,
|
|
128
|
-
get: function () {
|
|
129
|
-
return _DeckSwiper.DeckSwiper;
|
|
130
|
-
}
|
|
131
|
-
});
|
|
132
|
-
Object.defineProperty(exports, "DeckSwiperCard", {
|
|
133
|
-
enumerable: true,
|
|
134
|
-
get: function () {
|
|
135
|
-
return _DeckSwiper.DeckSwiperCard;
|
|
136
|
-
}
|
|
137
|
-
});
|
|
138
126
|
Object.defineProperty(exports, "DefaultTheme", {
|
|
139
127
|
enumerable: true,
|
|
140
128
|
get: function () {
|
|
@@ -413,7 +401,6 @@ var _ActionSheet = require("./components/ActionSheet");
|
|
|
413
401
|
var _Swiper = require("./components/Swiper");
|
|
414
402
|
var _Layout = require("./components/Layout");
|
|
415
403
|
var _index = require("./components/RadioButton/index");
|
|
416
|
-
var _DeckSwiper = require("./components/DeckSwiper");
|
|
417
404
|
var _DatePicker = _interopRequireDefault(require("./components/DatePicker/DatePicker"));
|
|
418
405
|
var _Picker = _interopRequireDefault(require("./components/Picker/Picker"));
|
|
419
406
|
var _ProgressBar = _interopRequireDefault(require("./components/ProgressBar"));
|
|
@@ -23,7 +23,9 @@ const SEED_DATA = {
|
|
|
23
23
|
}),
|
|
24
24
|
fieldName: (0, _types.createFieldNameProp)({
|
|
25
25
|
defaultValue: "ratingValue",
|
|
26
|
+
// this is the name of the variable declared on the screen in Draftbit
|
|
26
27
|
handlerPropName: "onPress",
|
|
28
|
+
// the change handler prop in this component
|
|
27
29
|
valuePropName: "rating" // the value prop in this component
|
|
28
30
|
}),
|
|
29
31
|
|
|
@@ -48,10 +50,4 @@ const SEED_DATA = {
|
|
|
48
50
|
})
|
|
49
51
|
}
|
|
50
52
|
};
|
|
51
|
-
exports.SEED_DATA = SEED_DATA;pes.createColorProp)({
|
|
52
|
-
label: "Inactive Color",
|
|
53
|
-
defaultValue: "divider"
|
|
54
|
-
})
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
53
|
exports.SEED_DATA = SEED_DATA;
|
|
@@ -15,6 +15,7 @@ function overlay(elevation) {
|
|
|
15
15
|
let surfaceColor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _DarkTheme.default.colors.surface;
|
|
16
16
|
if (isAnimatedValue(elevation)) {
|
|
17
17
|
const inputRange = [0, 1, 2, 3, 8, 24];
|
|
18
|
+
|
|
18
19
|
// @ts-expect-error: TS doesn't seem to refine the type correctly
|
|
19
20
|
return elevation.interpolate({
|
|
20
21
|
inputRange,
|
|
@@ -23,6 +24,7 @@ function overlay(elevation) {
|
|
|
23
24
|
})
|
|
24
25
|
});
|
|
25
26
|
}
|
|
27
|
+
|
|
26
28
|
// @ts-expect-error: TS doesn't seem to refine the type correctly
|
|
27
29
|
return calculateColor(surfaceColor, elevation);
|
|
28
30
|
}
|
|
@@ -63,4 +65,4 @@ const elevationOverlayTransparency = {
|
|
|
63
65
|
22: 15.72,
|
|
64
66
|
23: 15.84,
|
|
65
67
|
24: 16
|
|
66
|
-
};
|
|
68
|
+
};
|
|
@@ -33,6 +33,7 @@ const {
|
|
|
33
33
|
height: deviceHeight
|
|
34
34
|
} = Dimensions.get("screen");
|
|
35
35
|
const isIos = Platform.OS === "ios";
|
|
36
|
+
const isWeb = Platform.OS === "web";
|
|
36
37
|
const unstyledColor = "rgba(165, 173, 183, 1)";
|
|
37
38
|
const disabledColor = "rgb(240, 240, 240)";
|
|
38
39
|
const errorColor = "rgba(255, 69, 100, 1)";
|
|
@@ -224,8 +225,8 @@ const Picker = _ref => {
|
|
|
224
225
|
label: option.label,
|
|
225
226
|
value: option.value,
|
|
226
227
|
key: option.value
|
|
227
|
-
})))))) : null, !isIos && pickerVisible ? /*#__PURE__*/React.createElement(NativePicker, {
|
|
228
|
-
enabled:
|
|
228
|
+
})))))) : null, !isIos && (pickerVisible || isWeb) ? /*#__PURE__*/React.createElement(NativePicker, {
|
|
229
|
+
enabled: !disabled,
|
|
229
230
|
selectedValue: internalValue,
|
|
230
231
|
onValueChange: handleValueChange,
|
|
231
232
|
style: styles.nonIosPicker,
|
package/lib/module/index.js
CHANGED
|
@@ -31,7 +31,6 @@ export { ActionSheet, ActionSheetItem, ActionSheetCancel } from "./components/Ac
|
|
|
31
31
|
export { Swiper, SwiperItem } from "./components/Swiper";
|
|
32
32
|
export { Center, Circle, Square, Row, Stack, Spacer } from "./components/Layout";
|
|
33
33
|
export { RadioButton, RadioButtonGroup, RadioButtonRow, RadioButtonFieldGroup } from "./components/RadioButton/index";
|
|
34
|
-
export { DeckSwiper, DeckSwiperCard } from "./components/DeckSwiper";
|
|
35
34
|
|
|
36
35
|
/* Deprecated: Fix or Delete! */
|
|
37
36
|
export { default as DatePicker } from "./components/DatePicker/DatePicker";
|
|
@@ -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;IAC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ED,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"}
|
|
@@ -31,7 +31,6 @@ export { ActionSheet, ActionSheetItem, ActionSheetCancel, } from "./components/A
|
|
|
31
31
|
export { Swiper, SwiperItem } from "./components/Swiper";
|
|
32
32
|
export { Center, Circle, Square, Row, Stack, Spacer, } from "./components/Layout";
|
|
33
33
|
export { RadioButton, RadioButtonGroup, RadioButtonRow, RadioButtonFieldGroup, } from "./components/RadioButton/index";
|
|
34
|
-
export { DeckSwiper, DeckSwiperCard } from "./components/DeckSwiper";
|
|
35
34
|
export { default as DatePicker } from "./components/DatePicker/DatePicker";
|
|
36
35
|
export { default as Picker } from "./components/Picker/Picker";
|
|
37
36
|
export { default as ProgressBar } from "./components/ProgressBar";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAEhE,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAC7E,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,OAAO,IAAI,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAChF,OAAO,EAAE,OAAO,IA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AClE,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAC1F,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACpF,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@draftbit/core",
|
|
3
|
-
"version": "46.7.9-
|
|
3
|
+
"version": "46.7.9-cbe269.2+cbe2692",
|
|
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-
|
|
44
|
+
"@draftbit/types": "^46.7.9-cbe269.2+cbe2692",
|
|
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",
|
|
@@ -53,7 +53,6 @@
|
|
|
53
53
|
"lodash.isnumber": "^3.0.3",
|
|
54
54
|
"lodash.omit": "^4.5.0",
|
|
55
55
|
"lodash.tonumber": "^4.0.3",
|
|
56
|
-
"react-native-deck-swiper": "^2.0.12",
|
|
57
56
|
"react-native-modal-datetime-picker": "^13.0.0",
|
|
58
57
|
"react-native-svg": "12.3.0",
|
|
59
58
|
"react-native-typography": "^1.4.1",
|
|
@@ -92,5 +91,5 @@
|
|
|
92
91
|
]
|
|
93
92
|
]
|
|
94
93
|
},
|
|
95
|
-
"gitHead": "
|
|
94
|
+
"gitHead": "cbe26928f69ff97f3ed73bc6ff855163d6738524"
|
|
96
95
|
}
|
|
@@ -32,6 +32,7 @@ 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";
|
|
35
36
|
const unstyledColor = "rgba(165, 173, 183, 1)";
|
|
36
37
|
const disabledColor = "rgb(240, 240, 240)";
|
|
37
38
|
const errorColor = "rgba(255, 69, 100, 1)";
|
|
@@ -186,7 +187,7 @@ const Picker = ({ error, options = [], onValueChange, defaultValue, Icon, style,
|
|
|
186
187
|
React.createElement(View, { style: styles.iosPickerContent },
|
|
187
188
|
React.createElement(Button, { Icon: Icon, type: "text", onPress: togglePickerVisible, style: styles.iosButton }, "Close"),
|
|
188
189
|
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,
|
|
189
|
-
!isIos && pickerVisible ? (React.createElement(NativePicker, { enabled:
|
|
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));
|
|
190
191
|
};
|
|
191
192
|
const styles = StyleSheet.create({
|
|
192
193
|
marginsContainer: {
|
|
@@ -84,6 +84,8 @@ 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
|
+
|
|
87
89
|
const unstyledColor = "rgba(165, 173, 183, 1)";
|
|
88
90
|
const disabledColor = "rgb(240, 240, 240)";
|
|
89
91
|
const errorColor = "rgba(255, 69, 100, 1)";
|
|
@@ -374,9 +376,10 @@ const Picker: React.FC<PickerProps> = ({
|
|
|
374
376
|
) : null}
|
|
375
377
|
|
|
376
378
|
{/* nonIosPicker */}
|
|
377
|
-
{
|
|
379
|
+
{/* Web version is collapsed by default, always show to allow direct expand */}
|
|
380
|
+
{!isIos && (pickerVisible || isWeb) ? (
|
|
378
381
|
<NativePicker
|
|
379
|
-
enabled={
|
|
382
|
+
enabled={!disabled}
|
|
380
383
|
selectedValue={internalValue}
|
|
381
384
|
onValueChange={handleValueChange}
|
|
382
385
|
style={styles.nonIosPicker}
|
package/src/index.js
CHANGED
|
@@ -31,7 +31,6 @@ export { ActionSheet, ActionSheetItem, ActionSheetCancel, } from "./components/A
|
|
|
31
31
|
export { Swiper, SwiperItem } from "./components/Swiper";
|
|
32
32
|
export { Center, Circle, Square, Row, Stack, Spacer, } from "./components/Layout";
|
|
33
33
|
export { RadioButton, RadioButtonGroup, RadioButtonRow, RadioButtonFieldGroup, } from "./components/RadioButton/index";
|
|
34
|
-
export { DeckSwiper, DeckSwiperCard } from "./components/DeckSwiper";
|
|
35
34
|
/* Deprecated: Fix or Delete! */
|
|
36
35
|
export { default as DatePicker } from "./components/DatePicker/DatePicker";
|
|
37
36
|
export { default as Picker } from "./components/Picker/Picker";
|
package/src/index.tsx
CHANGED
|
@@ -51,8 +51,6 @@ export {
|
|
|
51
51
|
RadioButtonFieldGroup,
|
|
52
52
|
} from "./components/RadioButton/index";
|
|
53
53
|
|
|
54
|
-
export { DeckSwiper, DeckSwiperCard } from "./components/DeckSwiper";
|
|
55
|
-
|
|
56
54
|
/* Deprecated: Fix or Delete! */
|
|
57
55
|
export { default as DatePicker } from "./components/DatePicker/DatePicker";
|
|
58
56
|
export { default as Picker } from "./components/Picker/Picker";
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _reactNative = require("react-native");
|
|
9
|
-
var _reactNativeDeckSwiper = _interopRequireDefault(require("react-native-deck-swiper"));
|
|
10
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
-
const DeckSwiper = _ref => {
|
|
12
|
-
let {
|
|
13
|
-
onIndexChanged,
|
|
14
|
-
onEndReached,
|
|
15
|
-
startCardIndex = 0,
|
|
16
|
-
infiniteSwiping = false,
|
|
17
|
-
verticalEnabled = true,
|
|
18
|
-
horizontalEnabled = true,
|
|
19
|
-
visibleCardCount = 1,
|
|
20
|
-
style,
|
|
21
|
-
children
|
|
22
|
-
} = _ref;
|
|
23
|
-
const childrenArray = _react.default.useMemo(() => _react.default.Children.toArray(children), [children]);
|
|
24
|
-
|
|
25
|
-
// an array of indices based on children count
|
|
26
|
-
const cardsFillerData = _react.default.useMemo(() => Array.from(Array(childrenArray.length).keys()), [childrenArray]);
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* By default react-native-deck-swiper positions everything with absolute position.
|
|
30
|
-
* To overcome this, it is wrapped in a View to be able to add the component in any layout structure.
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
* Since all children of that View are absolutley positioned, the View does not have a height and still looks and behaves weird.
|
|
34
|
-
* To fix/mitage this without setting a static height, the first card is rendered in invisible state to take up space.
|
|
35
|
-
* This effectivley makes the default height of the container be the height of the first card.
|
|
36
|
-
*/
|
|
37
|
-
|
|
38
|
-
return /*#__PURE__*/_react.default.createElement(_reactNative.View, null, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
39
|
-
style: styles.containerHeightFiller
|
|
40
|
-
}, childrenArray.length && childrenArray[0]), /*#__PURE__*/_react.default.createElement(_reactNativeDeckSwiper.default, {
|
|
41
|
-
cards: cardsFillerData,
|
|
42
|
-
renderCard: (_, i) => /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, childrenArray[i]),
|
|
43
|
-
keyExtractor: card => card === null || card === void 0 ? void 0 : card.toString(),
|
|
44
|
-
containerStyle: _reactNative.StyleSheet.flatten([styles.cardsContainer, style]),
|
|
45
|
-
cardStyle: styles.card,
|
|
46
|
-
onSwiped: onIndexChanged,
|
|
47
|
-
onSwipedAll: onEndReached,
|
|
48
|
-
cardIndex: startCardIndex,
|
|
49
|
-
infinite: infiniteSwiping,
|
|
50
|
-
verticalSwipe: verticalEnabled,
|
|
51
|
-
horizontalSwipe: horizontalEnabled,
|
|
52
|
-
showSecondCard: visibleCardCount > 1,
|
|
53
|
-
stackSize: visibleCardCount,
|
|
54
|
-
backgroundColor: "transparent",
|
|
55
|
-
cardVerticalMargin: 0,
|
|
56
|
-
cardHorizontalMargin: 0
|
|
57
|
-
}));
|
|
58
|
-
};
|
|
59
|
-
const styles = _reactNative.StyleSheet.create({
|
|
60
|
-
cardsContainer: {
|
|
61
|
-
width: "100%"
|
|
62
|
-
},
|
|
63
|
-
card: {
|
|
64
|
-
left: 0,
|
|
65
|
-
right: 0,
|
|
66
|
-
width: "auto",
|
|
67
|
-
height: "auto"
|
|
68
|
-
},
|
|
69
|
-
containerHeightFiller: {
|
|
70
|
-
opacity: 0.0
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
var _default = DeckSwiper;
|
|
74
|
-
exports.default = _default;
|