@draftbit/core 46.7.7 → 46.7.8-5681f1.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/Checkbox/CheckboxGroupRow.js +5 -23
- package/lib/commonjs/components/Checkbox/context.js +1 -1
- package/lib/commonjs/components/CircularProgress.js +8 -26
- package/lib/commonjs/components/DeckSwiper/DeckSwiper.js +73 -0
- package/lib/commonjs/components/DeckSwiper/DeckSwiperCard.js +35 -0
- package/lib/commonjs/components/DeckSwiper/index.js +20 -0
- package/lib/commonjs/components/DeprecatedCardWrapper.js +15 -1
- package/lib/commonjs/components/Divider.js +1 -14
- package/lib/commonjs/components/Elevation.js +2 -14
- package/lib/commonjs/components/FAB.js +4 -18
- package/lib/commonjs/components/Picker/PickerComponent.ios.js +11 -36
- package/lib/commonjs/components/ProgressBar.js +7 -37
- package/lib/commonjs/components/RadioButton/RadioButtonRow.js +5 -23
- package/lib/commonjs/components/TextField.js +28 -76
- package/lib/commonjs/index.js +13 -0
- package/lib/commonjs/mappings/DeckSwiper.js +52 -0
- package/lib/commonjs/mappings/DeckSwiperCard.js +16 -0
- package/lib/module/components/AvatarEdit.js +15 -4
- package/lib/module/components/Banner.js +25 -4
- package/lib/module/components/Button.js +33 -10
- package/lib/module/components/Checkbox/CheckboxGroup.js +16 -2
- package/lib/module/components/CircularProgress.js +28 -8
- package/lib/module/components/DeckSwiper/DeckSwiper.js +65 -0
- package/lib/module/components/DeckSwiper/DeckSwiperCard.js +27 -0
- package/lib/module/components/DeckSwiper/index.js +2 -0
- package/lib/module/components/DeprecatedCardWrapper.js +18 -1
- package/lib/module/components/Divider.js +18 -1
- package/lib/module/components/FAB.js +22 -4
- package/lib/module/components/FieldSearchBarFull.js +1 -2
- package/lib/module/components/FormRow.js +17 -2
- package/lib/module/components/Image.js +18 -2
- package/lib/module/components/Picker/PickerComponent.web.js +21 -3
- package/lib/module/components/ProgressBar.js +39 -7
- package/lib/module/components/ScreenContainer.js +21 -4
- package/lib/module/components/StarRating.js +24 -4
- package/lib/module/components/Text.js +50 -4
- package/lib/module/index.js +1 -0
- package/lib/module/mappings/DeckSwiper.js +45 -0
- package/lib/module/mappings/DeckSwiperCard.js +9 -0
- package/lib/typescript/src/components/DeckSwiper/DeckSwiper.d.ts +15 -0
- package/lib/typescript/src/components/DeckSwiper/DeckSwiper.d.ts.map +1 -0
- package/lib/typescript/src/components/DeckSwiper/DeckSwiperCard.d.ts +13 -0
- package/lib/typescript/src/components/DeckSwiper/DeckSwiperCard.d.ts.map +1 -0
- package/lib/typescript/src/components/DeckSwiper/index.d.ts +3 -0
- package/lib/typescript/src/components/DeckSwiper/index.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +1 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/mappings/DeckSwiper.d.ts +83 -0
- package/lib/typescript/src/mappings/DeckSwiper.d.ts.map +1 -0
- package/lib/typescript/src/mappings/DeckSwiperCard.d.ts +9 -0
- package/lib/typescript/src/mappings/DeckSwiperCard.d.ts.map +1 -0
- package/package.json +4 -3
- package/src/components/DeckSwiper/DeckSwiper.js +34 -0
- package/src/components/DeckSwiper/DeckSwiper.tsx +93 -0
- package/src/components/DeckSwiper/DeckSwiperCard.js +22 -0
- package/src/components/DeckSwiper/DeckSwiperCard.tsx +42 -0
- package/src/components/DeckSwiper/index.js +2 -0
- package/src/components/DeckSwiper/index.tsx +2 -0
- package/src/index.js +1 -0
- package/src/index.tsx +2 -0
- package/src/mappings/DeckSwiper.js +45 -0
- package/src/mappings/DeckSwiper.ts +54 -0
- package/src/mappings/DeckSwiperCard.js +9 -0
- package/src/mappings/DeckSwiperCard.ts +13 -0
|
@@ -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
|
|
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
|
|
31
|
-
this
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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"
|
package/lib/commonjs/index.js
CHANGED
|
@@ -123,6 +123,18 @@ 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
|
+
});
|
|
126
138
|
Object.defineProperty(exports, "DefaultTheme", {
|
|
127
139
|
enumerable: true,
|
|
128
140
|
get: function () {
|
|
@@ -401,6 +413,7 @@ var _ActionSheet = require("./components/ActionSheet");
|
|
|
401
413
|
var _Swiper = require("./components/Swiper");
|
|
402
414
|
var _Layout = require("./components/Layout");
|
|
403
415
|
var _index = require("./components/RadioButton/index");
|
|
416
|
+
var _DeckSwiper = require("./components/DeckSwiper");
|
|
404
417
|
var _DatePicker = _interopRequireDefault(require("./components/DatePicker/DatePicker"));
|
|
405
418
|
var _Picker = _interopRequireDefault(require("./components/Picker/Picker"));
|
|
406
419
|
var _ProgressBar = _interopRequireDefault(require("./components/ProgressBar"));
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.SEED_DATA = void 0;
|
|
7
|
+
var _types = require("@draftbit/types");
|
|
8
|
+
const SEED_DATA = {
|
|
9
|
+
name: "Deck Swiper",
|
|
10
|
+
tag: "DeckSwiper",
|
|
11
|
+
description: "Deck swiper container",
|
|
12
|
+
category: _types.COMPONENT_TYPES.swiper,
|
|
13
|
+
stylesPanelSections: _types.BLOCK_STYLES_SECTIONS,
|
|
14
|
+
triggers: [_types.Triggers.OnIndexChanged, _types.Triggers.OnEndReached],
|
|
15
|
+
props: {
|
|
16
|
+
onIndexChanged: (0, _types.createActionProp)({
|
|
17
|
+
label: "On index changed",
|
|
18
|
+
description: "Action to execute when swipe to new index"
|
|
19
|
+
}),
|
|
20
|
+
onEndReached: (0, _types.createActionProp)({
|
|
21
|
+
label: "On end reached",
|
|
22
|
+
description: "Action to execute when end of swiping reached"
|
|
23
|
+
}),
|
|
24
|
+
startCardIndex: (0, _types.createStaticNumberProp)({
|
|
25
|
+
label: "Start card index",
|
|
26
|
+
description: "Index of card to start swiping from",
|
|
27
|
+
defaultValue: 0
|
|
28
|
+
}),
|
|
29
|
+
infiniteSwiping: (0, _types.createStaticBoolProp)({
|
|
30
|
+
label: "Infinite swiping",
|
|
31
|
+
description: "Whether to infinitley loop through cards or not"
|
|
32
|
+
}),
|
|
33
|
+
verticalEnabled: (0, _types.createStaticBoolProp)({
|
|
34
|
+
label: "Vertical swipe enabled",
|
|
35
|
+
description: "Whether cards should be swipeable vertically or not",
|
|
36
|
+
defaultValue: true
|
|
37
|
+
}),
|
|
38
|
+
horizontalEnabled: (0, _types.createStaticBoolProp)({
|
|
39
|
+
label: "Horizontal swipe enabled",
|
|
40
|
+
description: "Whether cards should be swipeable horizontally or not",
|
|
41
|
+
defaultValue: true
|
|
42
|
+
}),
|
|
43
|
+
visibleCardCount: (0, _types.createStaticNumberProp)({
|
|
44
|
+
label: "Visible card count",
|
|
45
|
+
description: "Number of cards visible behind (and including) the current card",
|
|
46
|
+
defaultValue: 1,
|
|
47
|
+
min: 1,
|
|
48
|
+
step: 1
|
|
49
|
+
})
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
exports.SEED_DATA = SEED_DATA;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.SEED_DATA = void 0;
|
|
7
|
+
var _types = require("@draftbit/types");
|
|
8
|
+
const SEED_DATA = {
|
|
9
|
+
name: "Deck Swiper Card",
|
|
10
|
+
tag: "DeckSwiperCard",
|
|
11
|
+
description: "Single Deck Swiper Card item to be used in DeckSwiper",
|
|
12
|
+
category: _types.COMPONENT_TYPES.swiper,
|
|
13
|
+
stylesPanelSections: _types.CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
14
|
+
props: {}
|
|
15
|
+
};
|
|
16
|
+
exports.SEED_DATA = SEED_DATA;
|
|
@@ -1,4 +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
1
|
import * as React from "react";
|
|
3
2
|
import { View } from "react-native";
|
|
4
3
|
import Touchable from "./Touchable";
|
|
@@ -23,9 +22,10 @@ const AvatarEdit = _ref => {
|
|
|
23
22
|
width: size,
|
|
24
23
|
height: size
|
|
25
24
|
};
|
|
26
|
-
return /*#__PURE__*/React.createElement(View,
|
|
27
|
-
style: [style, dimensions]
|
|
28
|
-
|
|
25
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
26
|
+
style: [style, dimensions],
|
|
27
|
+
...rest
|
|
28
|
+
}, /*#__PURE__*/React.createElement(Touchable, {
|
|
29
29
|
onPress: onPress
|
|
30
30
|
}, /*#__PURE__*/React.createElement(CircleImage, {
|
|
31
31
|
source: image,
|
|
@@ -46,4 +46,15 @@ const AvatarEdit = _ref => {
|
|
|
46
46
|
size: size * (3 / 16)
|
|
47
47
|
}))));
|
|
48
48
|
};
|
|
49
|
+
export default withTheme(AvatarEdit);yles.editBorderColor,
|
|
50
|
+
backgroundColor: colorStyles.editBackgroundColor,
|
|
51
|
+
borderRadius: size * (3 / 16),
|
|
52
|
+
padding: size * (3 / 32)
|
|
53
|
+
}
|
|
54
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
55
|
+
name: "MaterialIcons/edit",
|
|
56
|
+
color: colorStyles.editIconColor,
|
|
57
|
+
size: size * (3 / 16)
|
|
58
|
+
}))));
|
|
59
|
+
};
|
|
49
60
|
export default withTheme(AvatarEdit);
|
|
@@ -1,4 +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
1
|
import * as React from "react";
|
|
3
2
|
import { Button, Text, View, StyleSheet, Animated } from "react-native";
|
|
4
3
|
import Surface from "./Surface";
|
|
@@ -61,7 +60,6 @@ const Banner = _ref => {
|
|
|
61
60
|
measured: true
|
|
62
61
|
});
|
|
63
62
|
};
|
|
64
|
-
|
|
65
63
|
// The banner animation has 2 parts:
|
|
66
64
|
// 1. Blank spacer element which animates its height to move the content
|
|
67
65
|
// 2. Actual banner which animates its translateY
|
|
@@ -71,9 +69,10 @@ const Banner = _ref => {
|
|
|
71
69
|
// However we can't animated banner's height directly as it'll also resize the content inside
|
|
72
70
|
const height = Animated.multiply(position, layout.height);
|
|
73
71
|
const translateY = Animated.multiply(Animated.add(position, -1), layout.height);
|
|
74
|
-
return /*#__PURE__*/React.createElement(Surface,
|
|
72
|
+
return /*#__PURE__*/React.createElement(Surface, {
|
|
73
|
+
...rest,
|
|
75
74
|
style: [styles.container, shadow(ELEVATION), style]
|
|
76
|
-
}
|
|
75
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
77
76
|
style: [styles.wrapper, contentStyle]
|
|
78
77
|
}, /*#__PURE__*/React.createElement(Animated.View, {
|
|
79
78
|
style: {
|
|
@@ -154,4 +153,26 @@ const styles = StyleSheet.create({
|
|
|
154
153
|
margin: 8
|
|
155
154
|
}
|
|
156
155
|
});
|
|
156
|
+
export default withTheme(Banner);
|
|
157
|
+
},
|
|
158
|
+
content: {
|
|
159
|
+
flexDirection: "row",
|
|
160
|
+
justifyContent: "flex-start",
|
|
161
|
+
marginHorizontal: 8,
|
|
162
|
+
marginTop: 16,
|
|
163
|
+
marginBottom: 0
|
|
164
|
+
},
|
|
165
|
+
icon: {
|
|
166
|
+
margin: 8
|
|
167
|
+
},
|
|
168
|
+
message: {
|
|
169
|
+
flex: 1,
|
|
170
|
+
margin: 8
|
|
171
|
+
},
|
|
172
|
+
actions: {
|
|
173
|
+
flexDirection: "row",
|
|
174
|
+
justifyContent: "flex-end",
|
|
175
|
+
margin: 8
|
|
176
|
+
}
|
|
177
|
+
});
|
|
157
178
|
export default withTheme(Banner);
|
|
@@ -1,4 +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
1
|
import * as React from "react";
|
|
3
2
|
import { Text, Pressable, Platform, StyleSheet, ActivityIndicator } from "react-native";
|
|
4
3
|
import { withTheme } from "../theming";
|
|
@@ -53,7 +52,7 @@ function Base(_ref) {
|
|
|
53
52
|
if (textAlign === "right") {
|
|
54
53
|
buttonStyles.justifyContent = "flex-end";
|
|
55
54
|
}
|
|
56
|
-
return /*#__PURE__*/React.createElement(Pressable,
|
|
55
|
+
return /*#__PURE__*/React.createElement(Pressable, {
|
|
57
56
|
disabled: disabled || loading,
|
|
58
57
|
style: _ref2 => {
|
|
59
58
|
let {
|
|
@@ -62,8 +61,9 @@ function Base(_ref) {
|
|
|
62
61
|
return [styles.base, {
|
|
63
62
|
opacity: pressed ? activeOpacity : disabled ? disabledOpacity : 1
|
|
64
63
|
}, buttonStyles];
|
|
65
|
-
}
|
|
66
|
-
|
|
64
|
+
},
|
|
65
|
+
...props
|
|
66
|
+
}, loading ? /*#__PURE__*/React.createElement(ActivityIndicator, {
|
|
67
67
|
size: "small",
|
|
68
68
|
color: color,
|
|
69
69
|
style: styles.loading
|
|
@@ -82,13 +82,14 @@ const Solid = _ref3 => {
|
|
|
82
82
|
theme,
|
|
83
83
|
...props
|
|
84
84
|
} = _ref3;
|
|
85
|
-
return /*#__PURE__*/React.createElement(Base,
|
|
85
|
+
return /*#__PURE__*/React.createElement(Base, {
|
|
86
86
|
style: [{
|
|
87
87
|
color: "#FFF",
|
|
88
88
|
borderRadius: theme.roundness,
|
|
89
89
|
backgroundColor: theme.colors.primary
|
|
90
|
-
}, style]
|
|
91
|
-
|
|
90
|
+
}, style],
|
|
91
|
+
...props
|
|
92
|
+
});
|
|
92
93
|
};
|
|
93
94
|
const ButtonSolid = withTheme(Solid);
|
|
94
95
|
export { ButtonSolid };
|
|
@@ -100,13 +101,14 @@ const Outline = _ref4 => {
|
|
|
100
101
|
theme,
|
|
101
102
|
...props
|
|
102
103
|
} = _ref4;
|
|
103
|
-
return /*#__PURE__*/React.createElement(Base,
|
|
104
|
+
return /*#__PURE__*/React.createElement(Base, {
|
|
104
105
|
style: [styles.outline, {
|
|
105
106
|
borderRadius: theme.roundness,
|
|
106
107
|
borderColor: theme.colors.primary,
|
|
107
108
|
color: theme.colors.primary
|
|
108
|
-
}, style]
|
|
109
|
-
|
|
109
|
+
}, style],
|
|
110
|
+
...props
|
|
111
|
+
});
|
|
110
112
|
};
|
|
111
113
|
const ButtonOutline = withTheme(Outline);
|
|
112
114
|
export { ButtonOutline };
|
|
@@ -153,4 +155,25 @@ const styles = StyleSheet.create({
|
|
|
153
155
|
}
|
|
154
156
|
})
|
|
155
157
|
}
|
|
158
|
+
});or: "transparent",
|
|
159
|
+
padding: 0,
|
|
160
|
+
minHeight: undefined
|
|
161
|
+
},
|
|
162
|
+
loading: {
|
|
163
|
+
marginRight: 6
|
|
164
|
+
},
|
|
165
|
+
icon: {
|
|
166
|
+
...Platform.select({
|
|
167
|
+
web: {
|
|
168
|
+
marginTop: 1,
|
|
169
|
+
marginRight: 4,
|
|
170
|
+
alignSelf: "center"
|
|
171
|
+
},
|
|
172
|
+
default: {
|
|
173
|
+
marginBottom: 2,
|
|
174
|
+
marginRight: 4,
|
|
175
|
+
alignSelf: "center"
|
|
176
|
+
}
|
|
177
|
+
})
|
|
178
|
+
}
|
|
156
179
|
});
|
|
@@ -1,4 +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
1
|
import * as React from "react";
|
|
3
2
|
import { View } from "react-native";
|
|
4
3
|
import { checkboxGroupContext, Direction } from "./context";
|
|
@@ -23,7 +22,22 @@ const CheckboxGroup = _ref => {
|
|
|
23
22
|
alignItems: "center"
|
|
24
23
|
});
|
|
25
24
|
}
|
|
26
|
-
return /*#__PURE__*/React.createElement(View,
|
|
25
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
26
|
+
style: [{
|
|
27
|
+
minHeight: 40
|
|
28
|
+
}, style],
|
|
29
|
+
...rest
|
|
30
|
+
}, /*#__PURE__*/React.createElement(Provider, {
|
|
31
|
+
value: {
|
|
32
|
+
values,
|
|
33
|
+
onValueChange,
|
|
34
|
+
direction
|
|
35
|
+
}
|
|
36
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
37
|
+
style: _containerStyle
|
|
38
|
+
}, children)));
|
|
39
|
+
};
|
|
40
|
+
export default CheckboxGroup;PURE__*/React.createElement(View, _extends({
|
|
27
41
|
style: [{
|
|
28
42
|
minHeight: 40
|
|
29
43
|
}, style]
|
|
@@ -1,27 +1,24 @@
|
|
|
1
|
-
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; }
|
|
2
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
3
|
-
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); }
|
|
4
1
|
import React from "react";
|
|
5
2
|
import { View } from "react-native";
|
|
6
3
|
import { Svg, Path, G } from "react-native-svg";
|
|
7
4
|
class CircularProgress extends React.Component {
|
|
8
5
|
constructor() {
|
|
9
6
|
super(...arguments);
|
|
10
|
-
|
|
7
|
+
this.polarToCartesian = (centerX, centerY, radius, angleInDegrees) => {
|
|
11
8
|
var angleInRadians = (angleInDegrees - 90) * Math.PI / 180.0;
|
|
12
9
|
return {
|
|
13
10
|
x: centerX + radius * Math.cos(angleInRadians),
|
|
14
11
|
y: centerY + radius * Math.sin(angleInRadians)
|
|
15
12
|
};
|
|
16
|
-
}
|
|
17
|
-
|
|
13
|
+
};
|
|
14
|
+
this.circlePath = (x, y, radius, startAngle, endAngle) => {
|
|
18
15
|
var start = this.polarToCartesian(x, y, radius, endAngle * 0.9999);
|
|
19
16
|
var end = this.polarToCartesian(x, y, radius, startAngle);
|
|
20
17
|
var largeArcFlag = endAngle - startAngle <= 180 ? "0" : "1";
|
|
21
18
|
var d = ["M", start.x, start.y, "A", radius, radius, 0, largeArcFlag, 0, end.x, end.y];
|
|
22
19
|
return d.join(" ");
|
|
23
|
-
}
|
|
24
|
-
|
|
20
|
+
};
|
|
21
|
+
this.clampFill = fill => Math.min(100, Math.max(0, fill));
|
|
25
22
|
}
|
|
26
23
|
render() {
|
|
27
24
|
const {
|
|
@@ -101,4 +98,27 @@ class CircularProgress extends React.Component {
|
|
|
101
98
|
}, children(fill)));
|
|
102
99
|
}
|
|
103
100
|
}
|
|
101
|
+
export default CircularProgress;eElement(G, {
|
|
102
|
+
rotation: rotation,
|
|
103
|
+
originX: (size + padding) / 2,
|
|
104
|
+
originY: (size + padding) / 2
|
|
105
|
+
}, backgroundColor && /*#__PURE__*/React.createElement(Path, {
|
|
106
|
+
d: backgroundPath,
|
|
107
|
+
stroke: backgroundColor,
|
|
108
|
+
strokeWidth: backgroundWidth || width,
|
|
109
|
+
strokeLinecap: lineCap,
|
|
110
|
+
strokeDasharray: strokeDasharrayBackground,
|
|
111
|
+
fill: "transparent"
|
|
112
|
+
}), fill > 0 && /*#__PURE__*/React.createElement(Path, {
|
|
113
|
+
d: circlePathItem,
|
|
114
|
+
stroke: tintColor,
|
|
115
|
+
strokeWidth: width,
|
|
116
|
+
strokeLinecap: lineCap,
|
|
117
|
+
strokeDasharray: strokeDasharrayTint,
|
|
118
|
+
fill: "transparent"
|
|
119
|
+
}), cap)), children && /*#__PURE__*/React.createElement(View, {
|
|
120
|
+
style: localChildrenContainerStyle
|
|
121
|
+
}, children(fill)));
|
|
122
|
+
}
|
|
123
|
+
}
|
|
104
124
|
export default CircularProgress;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { StyleSheet, View } from "react-native";
|
|
3
|
+
import DeckSwiperComponent from "react-native-deck-swiper";
|
|
4
|
+
const DeckSwiper = _ref => {
|
|
5
|
+
let {
|
|
6
|
+
onIndexChanged,
|
|
7
|
+
onEndReached,
|
|
8
|
+
startCardIndex = 0,
|
|
9
|
+
infiniteSwiping = false,
|
|
10
|
+
verticalEnabled = true,
|
|
11
|
+
horizontalEnabled = true,
|
|
12
|
+
visibleCardCount = 1,
|
|
13
|
+
style,
|
|
14
|
+
children
|
|
15
|
+
} = _ref;
|
|
16
|
+
const childrenArray = React.useMemo(() => React.Children.toArray(children), [children]);
|
|
17
|
+
|
|
18
|
+
// an array of indices based on children count
|
|
19
|
+
const cardsFillerData = React.useMemo(() => Array.from(Array(childrenArray.length).keys()), [childrenArray]);
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* By default react-native-deck-swiper positions everything with absolute position
|
|
23
|
+
* To overcome this, it is wrapped in a View to be able to add the component in any layout structure
|
|
24
|
+
*
|
|
25
|
+
* Since all children of that View are absolutley positioned, the View does not have a height and still looks and behaves weird
|
|
26
|
+
* To fix/mitage this without setting a static height, the first card is rendered in invisible state to take up space.
|
|
27
|
+
* This effectivley makes the default height of the container be the height of the first card
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
return /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement(View, {
|
|
31
|
+
style: styles.containerHeightFiller
|
|
32
|
+
}, childrenArray.length && childrenArray[0]), /*#__PURE__*/React.createElement(DeckSwiperComponent, {
|
|
33
|
+
cards: cardsFillerData,
|
|
34
|
+
renderCard: (_, i) => /*#__PURE__*/React.createElement(React.Fragment, null, childrenArray[i]),
|
|
35
|
+
keyExtractor: card => card === null || card === void 0 ? void 0 : card.toString(),
|
|
36
|
+
containerStyle: StyleSheet.flatten([styles.cardsContainer, style]),
|
|
37
|
+
cardStyle: styles.card,
|
|
38
|
+
onSwiped: onIndexChanged,
|
|
39
|
+
onSwipedAll: onEndReached,
|
|
40
|
+
cardIndex: startCardIndex,
|
|
41
|
+
infinite: infiniteSwiping,
|
|
42
|
+
verticalSwipe: verticalEnabled,
|
|
43
|
+
horizontalSwipe: horizontalEnabled,
|
|
44
|
+
showSecondCard: visibleCardCount > 1,
|
|
45
|
+
stackSize: visibleCardCount,
|
|
46
|
+
backgroundColor: "transparent",
|
|
47
|
+
cardVerticalMargin: 0,
|
|
48
|
+
cardHorizontalMargin: 0
|
|
49
|
+
}));
|
|
50
|
+
};
|
|
51
|
+
const styles = StyleSheet.create({
|
|
52
|
+
cardsContainer: {
|
|
53
|
+
width: "100%"
|
|
54
|
+
},
|
|
55
|
+
card: {
|
|
56
|
+
left: 0,
|
|
57
|
+
right: 0,
|
|
58
|
+
width: "auto",
|
|
59
|
+
height: "auto"
|
|
60
|
+
},
|
|
61
|
+
containerHeightFiller: {
|
|
62
|
+
opacity: 0.0
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
export default DeckSwiper;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { View, StyleSheet } from "react-native";
|
|
3
|
+
import { withTheme } from "../../theming";
|
|
4
|
+
const DeckSwiperCard = _ref => {
|
|
5
|
+
let {
|
|
6
|
+
style,
|
|
7
|
+
children,
|
|
8
|
+
theme
|
|
9
|
+
} = _ref;
|
|
10
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
11
|
+
style: [styles.card, {
|
|
12
|
+
backgroundColor: theme.colors.background,
|
|
13
|
+
borderRadius: theme.borderRadius.global,
|
|
14
|
+
borderColor: theme.colors.divider
|
|
15
|
+
}, style]
|
|
16
|
+
}, children);
|
|
17
|
+
};
|
|
18
|
+
const styles = StyleSheet.create({
|
|
19
|
+
card: {
|
|
20
|
+
flex: 1,
|
|
21
|
+
alignItems: "center",
|
|
22
|
+
justifyContent: "center",
|
|
23
|
+
padding: 20,
|
|
24
|
+
borderWidth: 2
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
export default withTheme(DeckSwiperCard);
|
|
@@ -1,4 +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
1
|
import React from "react";
|
|
3
2
|
import { withTheme } from "../theming";
|
|
4
3
|
import Touchable from "./Touchable";
|
|
@@ -13,6 +12,24 @@ const getWidth = numColumns => {
|
|
|
13
12
|
}
|
|
14
13
|
};
|
|
15
14
|
const Card = _ref => {
|
|
15
|
+
let {
|
|
16
|
+
numColumns = 3,
|
|
17
|
+
children,
|
|
18
|
+
onPress,
|
|
19
|
+
style,
|
|
20
|
+
...rest
|
|
21
|
+
} = _ref;
|
|
22
|
+
const width = getWidth(numColumns);
|
|
23
|
+
return /*#__PURE__*/React.createElement(Touchable, {
|
|
24
|
+
disabled: !onPress,
|
|
25
|
+
onPress: onPress,
|
|
26
|
+
style: [style, {
|
|
27
|
+
width
|
|
28
|
+
}],
|
|
29
|
+
...rest
|
|
30
|
+
}, children);
|
|
31
|
+
};
|
|
32
|
+
export default withTheme(Card);ef => {
|
|
16
33
|
let {
|
|
17
34
|
numColumns = 3,
|
|
18
35
|
children,
|