@draftbit/core 46.7.6-0a91fd.2 → 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/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/index.js +13 -0
- package/lib/commonjs/mappings/DeckSwiper.js +52 -0
- package/lib/commonjs/mappings/DeckSwiperCard.js +16 -0
- package/lib/commonjs/mappings/FieldSearchBarFull.js +1 -3
- 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 +5 -4
- 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
|
@@ -0,0 +1,73 @@
|
|
|
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
|
+
* Since all children of that View are absolutley positioned, the View does not have a height and still looks and behaves weird
|
|
33
|
+
* To fix/mitage this without setting a static height, the first card is rendered in invisible state to take up space.
|
|
34
|
+
* This effectivley makes the default height of the container be the height of the first card
|
|
35
|
+
*/
|
|
36
|
+
|
|
37
|
+
return /*#__PURE__*/_react.default.createElement(_reactNative.View, null, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
38
|
+
style: styles.containerHeightFiller
|
|
39
|
+
}, childrenArray.length && childrenArray[0]), /*#__PURE__*/_react.default.createElement(_reactNativeDeckSwiper.default, {
|
|
40
|
+
cards: cardsFillerData,
|
|
41
|
+
renderCard: (_, i) => /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, childrenArray[i]),
|
|
42
|
+
keyExtractor: card => card === null || card === void 0 ? void 0 : card.toString(),
|
|
43
|
+
containerStyle: _reactNative.StyleSheet.flatten([styles.cardsContainer, style]),
|
|
44
|
+
cardStyle: styles.card,
|
|
45
|
+
onSwiped: onIndexChanged,
|
|
46
|
+
onSwipedAll: onEndReached,
|
|
47
|
+
cardIndex: startCardIndex,
|
|
48
|
+
infinite: infiniteSwiping,
|
|
49
|
+
verticalSwipe: verticalEnabled,
|
|
50
|
+
horizontalSwipe: horizontalEnabled,
|
|
51
|
+
showSecondCard: visibleCardCount > 1,
|
|
52
|
+
stackSize: visibleCardCount,
|
|
53
|
+
backgroundColor: "transparent",
|
|
54
|
+
cardVerticalMargin: 0,
|
|
55
|
+
cardHorizontalMargin: 0
|
|
56
|
+
}));
|
|
57
|
+
};
|
|
58
|
+
const styles = _reactNative.StyleSheet.create({
|
|
59
|
+
cardsContainer: {
|
|
60
|
+
width: "100%"
|
|
61
|
+
},
|
|
62
|
+
card: {
|
|
63
|
+
left: 0,
|
|
64
|
+
right: 0,
|
|
65
|
+
width: "auto",
|
|
66
|
+
height: "auto"
|
|
67
|
+
},
|
|
68
|
+
containerHeightFiller: {
|
|
69
|
+
opacity: 0.0
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
var _default = DeckSwiper;
|
|
73
|
+
exports.default = _default;
|
|
@@ -0,0 +1,35 @@
|
|
|
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 _theming = require("../../theming");
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
const DeckSwiperCard = _ref => {
|
|
12
|
+
let {
|
|
13
|
+
style,
|
|
14
|
+
children,
|
|
15
|
+
theme
|
|
16
|
+
} = _ref;
|
|
17
|
+
return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
18
|
+
style: [styles.card, {
|
|
19
|
+
backgroundColor: theme.colors.background,
|
|
20
|
+
borderRadius: theme.borderRadius.global,
|
|
21
|
+
borderColor: theme.colors.divider
|
|
22
|
+
}, style]
|
|
23
|
+
}, children);
|
|
24
|
+
};
|
|
25
|
+
const styles = _reactNative.StyleSheet.create({
|
|
26
|
+
card: {
|
|
27
|
+
flex: 1,
|
|
28
|
+
alignItems: "center",
|
|
29
|
+
justifyContent: "center",
|
|
30
|
+
padding: 20,
|
|
31
|
+
borderWidth: 2
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
var _default = (0, _theming.withTheme)(DeckSwiperCard);
|
|
35
|
+
exports.default = _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "DeckSwiper", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _DeckSwiper.default;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "DeckSwiperCard", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _DeckSwiperCard.default;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
var _DeckSwiper = _interopRequireDefault(require("./DeckSwiper"));
|
|
19
|
+
var _DeckSwiperCard = _interopRequireDefault(require("./DeckSwiperCard"));
|
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -8,7 +8,6 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
8
8
|
var _theming = require("../theming");
|
|
9
9
|
var _Touchable = _interopRequireDefault(require("./Touchable"));
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
-
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); }
|
|
12
11
|
const getWidth = numColumns => {
|
|
13
12
|
switch (numColumns) {
|
|
14
13
|
case 1:
|
|
@@ -28,6 +27,21 @@ const Card = _ref => {
|
|
|
28
27
|
...rest
|
|
29
28
|
} = _ref;
|
|
30
29
|
const width = getWidth(numColumns);
|
|
30
|
+
return /*#__PURE__*/_react.default.createElement(_Touchable.default, {
|
|
31
|
+
disabled: !onPress,
|
|
32
|
+
onPress: onPress,
|
|
33
|
+
style: [style, {
|
|
34
|
+
width
|
|
35
|
+
}],
|
|
36
|
+
...rest
|
|
37
|
+
}, children);
|
|
38
|
+
};
|
|
39
|
+
var _default = (0, _theming.withTheme)(Card);
|
|
40
|
+
exports.default = _default;s,
|
|
41
|
+
style,
|
|
42
|
+
...rest
|
|
43
|
+
} = _ref;
|
|
44
|
+
const width = getWidth(numColumns);
|
|
31
45
|
return /*#__PURE__*/_react.default.createElement(_Touchable.default, _extends({
|
|
32
46
|
disabled: !onPress,
|
|
33
47
|
onPress: onPress,
|
|
@@ -9,6 +9,7 @@ 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); }
|
|
12
13
|
const Divider = _ref => {
|
|
13
14
|
let {
|
|
14
15
|
style,
|
|
@@ -18,20 +19,6 @@ const Divider = _ref => {
|
|
|
18
19
|
},
|
|
19
20
|
...rest
|
|
20
21
|
} = _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;
|
|
35
22
|
return /*#__PURE__*/React.createElement(_reactNative.View, _extends({
|
|
36
23
|
style: [{
|
|
37
24
|
backgroundColor: color || colors.divider,
|
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;
|
|
@@ -14,6 +14,7 @@ const SEED_DATA = [{
|
|
|
14
14
|
preview_image_url: "{CLOUDINARY_URL}/Field_SearchBar_Full.png",
|
|
15
15
|
supports_list_render: false,
|
|
16
16
|
triggers: [_types.Triggers.OnChange],
|
|
17
|
+
// TODO Triggers.OnSubmit for multiple triggers
|
|
17
18
|
props: {
|
|
18
19
|
icon: {
|
|
19
20
|
group: _types.GROUPS.basic,
|
|
@@ -52,7 +53,4 @@ const SEED_DATA = [{
|
|
|
52
53
|
},
|
|
53
54
|
layout: {}
|
|
54
55
|
}];
|
|
55
|
-
exports.SEED_DATA = SEED_DATA;},
|
|
56
|
-
layout: {}
|
|
57
|
-
}];
|
|
58
56
|
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);
|