@draftbit/core 46.4.4-d73221.2 → 46.4.4-d93fe1.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/Container.js +17 -5
- package/lib/commonjs/components/ProgressBar.js +23 -7
- package/lib/commonjs/components/TabView/TabView.js +102 -0
- package/lib/commonjs/components/TabView/TabViewItem.js +26 -0
- package/lib/commonjs/components/TabView/index.js +23 -0
- package/lib/commonjs/index.js +14 -0
- package/lib/commonjs/mappings/TabView.js +79 -0
- package/lib/module/components/Banner.js +4 -24
- package/lib/module/components/DatePicker/DatePicker.js +8 -7
- package/lib/module/components/Elevation.js +4 -15
- package/lib/module/components/Image.js +3 -18
- package/lib/module/components/StepIndicator.js +16 -33
- package/lib/module/components/TabView/TabView.js +87 -0
- package/lib/module/components/TabView/TabViewItem.js +18 -0
- package/lib/module/components/TabView/index.js +2 -0
- package/lib/module/components/ToggleButton.js +17 -3
- package/lib/module/index.js +1 -0
- package/lib/module/mappings/TabView.js +70 -0
- package/lib/typescript/src/components/TabView/TabView.d.ts +19 -0
- package/lib/typescript/src/components/TabView/TabViewItem.d.ts +10 -0
- package/lib/typescript/src/components/TabView/index.d.ts +2 -0
- package/lib/typescript/src/index.d.ts +1 -0
- package/lib/typescript/src/mappings/TabView.d.ts +111 -0
- package/package.json +6 -4
- package/src/components/TabView/TabView.js +34 -0
- package/src/components/TabView/TabView.tsx +97 -0
- package/src/components/TabView/TabViewItem.js +5 -0
- package/src/components/TabView/TabViewItem.tsx +21 -0
- package/src/components/TabView/index.js +2 -0
- package/src/components/TabView/index.tsx +2 -0
- package/src/index.js +1 -0
- package/src/index.tsx +1 -0
- package/src/mappings/TabView.js +73 -0
- package/src/mappings/TabView.ts +80 -0
|
@@ -19,8 +19,6 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
19
19
|
|
|
20
20
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
21
21
|
|
|
22
|
-
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); }
|
|
23
|
-
|
|
24
22
|
const Container = _ref => {
|
|
25
23
|
let {
|
|
26
24
|
useThemeGutterPadding,
|
|
@@ -82,9 +80,10 @@ const Container = _ref => {
|
|
|
82
80
|
};
|
|
83
81
|
const Wrap = elevation ? _Elevation.default : _reactNative.View;
|
|
84
82
|
if (elevation) containerStyle.elevation = elevation;
|
|
85
|
-
return /*#__PURE__*/React.createElement(Wrap,
|
|
86
|
-
style: [containerStyle, style]
|
|
87
|
-
|
|
83
|
+
return /*#__PURE__*/React.createElement(Wrap, {
|
|
84
|
+
style: [containerStyle, style],
|
|
85
|
+
...rest
|
|
86
|
+
}, backgroundImage ? /*#__PURE__*/React.createElement(_reactNative.ImageBackground, {
|
|
88
87
|
source: typeof backgroundImage === "string" ? {
|
|
89
88
|
uri: backgroundImage
|
|
90
89
|
} : backgroundImage,
|
|
@@ -101,4 +100,17 @@ const Container = _ref => {
|
|
|
101
100
|
|
|
102
101
|
var _default = (0, _theming.withTheme)(Container);
|
|
103
102
|
|
|
103
|
+
exports.default = _default;izeMode: backgroundImageResizeMode,
|
|
104
|
+
style: {
|
|
105
|
+
flex: 1
|
|
106
|
+
}
|
|
107
|
+
}, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
108
|
+
style: innerStyle
|
|
109
|
+
}, children)) : /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
110
|
+
style: innerStyle
|
|
111
|
+
}, children));
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
var _default = (0, _theming.withTheme)(Container);
|
|
115
|
+
|
|
104
116
|
exports.default = _default;
|
|
@@ -13,10 +13,6 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
13
13
|
|
|
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
15
|
|
|
16
|
-
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); }
|
|
17
|
-
|
|
18
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
19
|
-
|
|
20
16
|
const INDETERMINATE_WIDTH_FACTOR = 0.3;
|
|
21
17
|
const BAR_WIDTH_ZERO_POSITION = INDETERMINATE_WIDTH_FACTOR / (1 + INDETERMINATE_WIDTH_FACTOR);
|
|
22
18
|
|
|
@@ -24,7 +20,7 @@ class ProgressBar extends _react.Component {
|
|
|
24
20
|
constructor(props) {
|
|
25
21
|
super(props);
|
|
26
22
|
|
|
27
|
-
|
|
23
|
+
this.handleLayout = event => {
|
|
28
24
|
const {
|
|
29
25
|
width = 150,
|
|
30
26
|
onLayout
|
|
@@ -39,7 +35,7 @@ class ProgressBar extends _react.Component {
|
|
|
39
35
|
if (onLayout) {
|
|
40
36
|
onLayout(event);
|
|
41
37
|
}
|
|
42
|
-
}
|
|
38
|
+
};
|
|
43
39
|
|
|
44
40
|
const {
|
|
45
41
|
progress: progressP = 0,
|
|
@@ -93,7 +89,6 @@ class ProgressBar extends _react.Component {
|
|
|
93
89
|
_reactNative.Animated[animationType](this.state.progress, { ...animationConfig,
|
|
94
90
|
toValue: progress,
|
|
95
91
|
velocity: 0,
|
|
96
|
-
//adjust this value if animation fails - velocity is required
|
|
97
92
|
useNativeDriver
|
|
98
93
|
}).start();
|
|
99
94
|
} else {
|
|
@@ -165,6 +160,27 @@ class ProgressBar extends _react.Component {
|
|
|
165
160
|
})
|
|
166
161
|
}]
|
|
167
162
|
};
|
|
163
|
+
return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
164
|
+
style: [containerStyle, style],
|
|
165
|
+
onLayout: this.handleLayout,
|
|
166
|
+
...restProps
|
|
167
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.Animated.View, {
|
|
168
|
+
style: progressStyle
|
|
169
|
+
}), children);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
exports.default = ProgressBar;h / (_reactNative.I18nManager.isRTL ? 2 : -2), 0]
|
|
175
|
+
})
|
|
176
|
+
}, {
|
|
177
|
+
// Interpolation a temp workaround for https://github.com/facebook/react-native/issues/6278
|
|
178
|
+
scaleX: this.state.progress.interpolate({
|
|
179
|
+
inputRange: [0, 1],
|
|
180
|
+
outputRange: [0.0001, 1]
|
|
181
|
+
})
|
|
182
|
+
}]
|
|
183
|
+
};
|
|
168
184
|
return /*#__PURE__*/_react.default.createElement(_reactNative.View, _extends({
|
|
169
185
|
style: [containerStyle, style],
|
|
170
186
|
onLayout: this.handleLayout
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var React = _interopRequireWildcard(require("react"));
|
|
9
|
+
|
|
10
|
+
var _reactNativeTabView = require("react-native-tab-view");
|
|
11
|
+
|
|
12
|
+
var _TabViewItem = _interopRequireDefault(require("./TabViewItem"));
|
|
13
|
+
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
+
|
|
16
|
+
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); }
|
|
17
|
+
|
|
18
|
+
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; }
|
|
19
|
+
|
|
20
|
+
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); }
|
|
21
|
+
|
|
22
|
+
const TabViewComponent = _ref => {
|
|
23
|
+
let {
|
|
24
|
+
Icon,
|
|
25
|
+
tabBarPosition,
|
|
26
|
+
keyboardDismissMode,
|
|
27
|
+
swipeEnabled,
|
|
28
|
+
scrollEnabled,
|
|
29
|
+
activeColor,
|
|
30
|
+
inactiveColor,
|
|
31
|
+
pressColor,
|
|
32
|
+
indicatorColor,
|
|
33
|
+
style,
|
|
34
|
+
children
|
|
35
|
+
} = _ref;
|
|
36
|
+
const [index, setIndex] = React.useState(0);
|
|
37
|
+
const [routes, setRoutes] = React.useState([]);
|
|
38
|
+
const [tabScenes, setTabScenes] = React.useState({});
|
|
39
|
+
React.useEffect(() => {
|
|
40
|
+
const newRoutes = [];
|
|
41
|
+
const scenes = {};
|
|
42
|
+
React.Children.toArray(children).filter(child => child.type === _TabViewItem.default).forEach(child => {
|
|
43
|
+
var _child$props;
|
|
44
|
+
|
|
45
|
+
if (child !== null && child !== void 0 && (_child$props = child.props) !== null && _child$props !== void 0 && _child$props.id) {
|
|
46
|
+
var _child$props2, _child$props3;
|
|
47
|
+
|
|
48
|
+
newRoutes.push({
|
|
49
|
+
key: child === null || child === void 0 ? void 0 : (_child$props2 = child.props) === null || _child$props2 === void 0 ? void 0 : _child$props2.id,
|
|
50
|
+
...(child === null || child === void 0 ? void 0 : child.props)
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
scenes[child === null || child === void 0 ? void 0 : (_child$props3 = child.props) === null || _child$props3 === void 0 ? void 0 : _child$props3.id] = () => child;
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
setRoutes(newRoutes);
|
|
57
|
+
setTabScenes(scenes);
|
|
58
|
+
}, [children]);
|
|
59
|
+
|
|
60
|
+
const indexChangeHandler = i => setIndex(i);
|
|
61
|
+
|
|
62
|
+
const renderTabBar = props => {
|
|
63
|
+
console.log(props);
|
|
64
|
+
return /*#__PURE__*/React.createElement(_reactNativeTabView.TabBar, _extends({}, props, {
|
|
65
|
+
activeColor: activeColor,
|
|
66
|
+
inactiveColor: inactiveColor,
|
|
67
|
+
pressColor: pressColor,
|
|
68
|
+
scrollEnabled: scrollEnabled,
|
|
69
|
+
indicatorStyle: {
|
|
70
|
+
backgroundColor: indicatorColor
|
|
71
|
+
},
|
|
72
|
+
renderIcon: _ref2 => {
|
|
73
|
+
let {
|
|
74
|
+
route,
|
|
75
|
+
color
|
|
76
|
+
} = _ref2;
|
|
77
|
+
return route !== null && route !== void 0 && route.icon ? /*#__PURE__*/React.createElement(Icon, {
|
|
78
|
+
name: route.icon,
|
|
79
|
+
color: color,
|
|
80
|
+
size: 36
|
|
81
|
+
}) : null;
|
|
82
|
+
},
|
|
83
|
+
style: style
|
|
84
|
+
}));
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
return /*#__PURE__*/React.createElement(_reactNativeTabView.TabView, {
|
|
88
|
+
navigationState: {
|
|
89
|
+
index,
|
|
90
|
+
routes
|
|
91
|
+
},
|
|
92
|
+
renderScene: (0, _reactNativeTabView.SceneMap)(tabScenes),
|
|
93
|
+
renderTabBar: renderTabBar,
|
|
94
|
+
onIndexChange: indexChangeHandler,
|
|
95
|
+
tabBarPosition: tabBarPosition,
|
|
96
|
+
keyboardDismissMode: keyboardDismissMode,
|
|
97
|
+
swipeEnabled: swipeEnabled
|
|
98
|
+
});
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
var _default = TabViewComponent;
|
|
102
|
+
exports.default = _default;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
const TabViewItem = _ref => {
|
|
9
|
+
let {
|
|
10
|
+
title,
|
|
11
|
+
id,
|
|
12
|
+
icon,
|
|
13
|
+
children,
|
|
14
|
+
accessibilityLabel
|
|
15
|
+
} = _ref;
|
|
16
|
+
console.log({
|
|
17
|
+
title,
|
|
18
|
+
id,
|
|
19
|
+
icon,
|
|
20
|
+
accessibilityLabel
|
|
21
|
+
});
|
|
22
|
+
return children;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
var _default = TabViewItem;
|
|
26
|
+
exports.default = _default;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "TabView", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _TabView.default;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "TabViewItem", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _TabViewItem.default;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
var _TabView = _interopRequireDefault(require("./TabView"));
|
|
20
|
+
|
|
21
|
+
var _TabViewItem = _interopRequireDefault(require("./TabViewItem"));
|
|
22
|
+
|
|
23
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
package/lib/commonjs/index.js
CHANGED
|
@@ -369,6 +369,18 @@ Object.defineProperty(exports, "SwitchRow", {
|
|
|
369
369
|
return _Switch.SwitchRow;
|
|
370
370
|
}
|
|
371
371
|
});
|
|
372
|
+
Object.defineProperty(exports, "TabView", {
|
|
373
|
+
enumerable: true,
|
|
374
|
+
get: function () {
|
|
375
|
+
return _TabView.TabView;
|
|
376
|
+
}
|
|
377
|
+
});
|
|
378
|
+
Object.defineProperty(exports, "TabViewItem", {
|
|
379
|
+
enumerable: true,
|
|
380
|
+
get: function () {
|
|
381
|
+
return _TabView.TabViewItem;
|
|
382
|
+
}
|
|
383
|
+
});
|
|
372
384
|
Object.defineProperty(exports, "TextField", {
|
|
373
385
|
enumerable: true,
|
|
374
386
|
get: function () {
|
|
@@ -472,6 +484,8 @@ var _ActionSheet = require("./components/ActionSheet");
|
|
|
472
484
|
|
|
473
485
|
var _Swiper = require("./components/Swiper");
|
|
474
486
|
|
|
487
|
+
var _TabView = require("./components/TabView");
|
|
488
|
+
|
|
475
489
|
var _Layout = require("./components/Layout");
|
|
476
490
|
|
|
477
491
|
var _index = require("./components/RadioButton/index");
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.SEED_DATA = void 0;
|
|
7
|
+
|
|
8
|
+
var _types = require("@draftbit/types");
|
|
9
|
+
|
|
10
|
+
const SEED_DATA = [{
|
|
11
|
+
name: "Tab View",
|
|
12
|
+
tag: "TabView",
|
|
13
|
+
category: _types.COMPONENT_TYPES.container,
|
|
14
|
+
layout: {},
|
|
15
|
+
props: {
|
|
16
|
+
tabBarPosition: (0, _types.createTextEnumProp)({
|
|
17
|
+
label: "Tab Bar Position",
|
|
18
|
+
description: "Tab Bar Position",
|
|
19
|
+
options: ["top", "bottom"],
|
|
20
|
+
defaultValue: "top"
|
|
21
|
+
}),
|
|
22
|
+
keyboardDismissMode: (0, _types.createTextEnumProp)({
|
|
23
|
+
label: "Keyboard Dismiss Mode",
|
|
24
|
+
description: "Keyboard Dismiss Mode",
|
|
25
|
+
options: ["auto", "on-drag", "none"],
|
|
26
|
+
defaultValue: "auto"
|
|
27
|
+
}),
|
|
28
|
+
swipeEnabled: (0, _types.createBoolProp)({
|
|
29
|
+
label: "Swipe Enabled",
|
|
30
|
+
description: "Swipe Enabled",
|
|
31
|
+
defaultValue: true
|
|
32
|
+
}),
|
|
33
|
+
scrollEnabled: (0, _types.createBoolProp)({
|
|
34
|
+
label: "Scroll Enabled",
|
|
35
|
+
description: "Scroll Enabled",
|
|
36
|
+
defaultValue: true
|
|
37
|
+
}),
|
|
38
|
+
activeColor: (0, _types.createColorProp)({
|
|
39
|
+
label: "Active Color",
|
|
40
|
+
description: "Active Color",
|
|
41
|
+
defaultValue: "primary"
|
|
42
|
+
}),
|
|
43
|
+
inactiveColor: (0, _types.createColorProp)({
|
|
44
|
+
label: "Inactive Color",
|
|
45
|
+
description: "Inactive Color",
|
|
46
|
+
defaultValue: null
|
|
47
|
+
}),
|
|
48
|
+
pressColor: (0, _types.createColorProp)({
|
|
49
|
+
label: "Press Color",
|
|
50
|
+
description: "Press Color",
|
|
51
|
+
defaultValue: null
|
|
52
|
+
}),
|
|
53
|
+
indicatorColor: (0, _types.createColorProp)({
|
|
54
|
+
label: "Indicator Color",
|
|
55
|
+
description: "Indicator Color",
|
|
56
|
+
defaultValue: null
|
|
57
|
+
})
|
|
58
|
+
}
|
|
59
|
+
}, {
|
|
60
|
+
name: "Tab View Item",
|
|
61
|
+
tag: "TabViewItem",
|
|
62
|
+
category: _types.COMPONENT_TYPES.container,
|
|
63
|
+
layout: {},
|
|
64
|
+
props: {
|
|
65
|
+
title: (0, _types.createTextProp)({
|
|
66
|
+
label: "Title",
|
|
67
|
+
description: "Tab Title"
|
|
68
|
+
}),
|
|
69
|
+
id: (0, _types.createTextProp)({
|
|
70
|
+
label: "Id",
|
|
71
|
+
description: "Tab Id"
|
|
72
|
+
}),
|
|
73
|
+
accessibilityLabel: (0, _types.createTextProp)({
|
|
74
|
+
label: "Accessibility Label",
|
|
75
|
+
description: "Accessibility Label"
|
|
76
|
+
})
|
|
77
|
+
}
|
|
78
|
+
}];
|
|
79
|
+
exports.SEED_DATA = SEED_DATA;
|
|
@@ -1,3 +1,5 @@
|
|
|
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
3
|
import * as React from "react";
|
|
2
4
|
import { Button, Text, View, StyleSheet, Animated } from "react-native";
|
|
3
5
|
import Surface from "./Surface";
|
|
@@ -72,9 +74,9 @@ const Banner = _ref => {
|
|
|
72
74
|
|
|
73
75
|
const height = Animated.multiply(position, layout.height);
|
|
74
76
|
const translateY = Animated.multiply(Animated.add(position, -1), layout.height);
|
|
75
|
-
return /*#__PURE__*/React.createElement(Surface, {
|
|
77
|
+
return /*#__PURE__*/React.createElement(Surface, _extends({}, rest, {
|
|
76
78
|
style: [styles.container, shadow(ELEVATION), style]
|
|
77
|
-
}, /*#__PURE__*/React.createElement(View, {
|
|
79
|
+
}), /*#__PURE__*/React.createElement(View, {
|
|
78
80
|
style: [styles.wrapper, contentStyle]
|
|
79
81
|
}, /*#__PURE__*/React.createElement(Animated.View, {
|
|
80
82
|
style: {
|
|
@@ -153,26 +155,4 @@ const styles = StyleSheet.create({
|
|
|
153
155
|
margin: 8
|
|
154
156
|
}
|
|
155
157
|
});
|
|
156
|
-
export default withTheme(Banner);00%"
|
|
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
|
-
});
|
|
178
158
|
export default withTheme(Banner);
|
|
@@ -1,3 +1,5 @@
|
|
|
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
3
|
import * as React from "react";
|
|
2
4
|
import { View, Animated, Text, StyleSheet, I18nManager, TextInput as NativeTextInput } from "react-native";
|
|
3
5
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
@@ -260,9 +262,9 @@ const DatePicker = _ref => {
|
|
|
260
262
|
pointerEvents: "none"
|
|
261
263
|
}, /*#__PURE__*/React.createElement(View, {
|
|
262
264
|
style: [styles.container, style]
|
|
263
|
-
}, leftIconName && leftIconMode === "outset" ? /*#__PURE__*/React.createElement(Icon, {
|
|
265
|
+
}, leftIconName && leftIconMode === "outset" ? /*#__PURE__*/React.createElement(Icon, _extends({}, leftIconProps, {
|
|
264
266
|
style: leftIconStyle
|
|
265
|
-
}) : null, /*#__PURE__*/React.createElement(View, {
|
|
267
|
+
})) : null, /*#__PURE__*/React.createElement(View, {
|
|
266
268
|
style: [containerStyle, style ? {
|
|
267
269
|
height: style.height
|
|
268
270
|
} : {}]
|
|
@@ -310,11 +312,11 @@ const DatePicker = _ref => {
|
|
|
310
312
|
opacity: hasActiveOutline ? labeled : 1
|
|
311
313
|
}],
|
|
312
314
|
numberOfLines: 1
|
|
313
|
-
}, label)) : null, leftIconName && leftIconMode === "inset" ? /*#__PURE__*/React.createElement(Icon, {
|
|
315
|
+
}, label)) : null, leftIconName && leftIconMode === "inset" ? /*#__PURE__*/React.createElement(Icon, _extends({}, leftIconProps, {
|
|
314
316
|
style: { ...leftIconStyle,
|
|
315
317
|
marginLeft: type === "solid" ? 16 : 0
|
|
316
318
|
}
|
|
317
|
-
}) : null, /*#__PURE__*/React.createElement(NativeTextInput, {
|
|
319
|
+
})) : null, /*#__PURE__*/React.createElement(NativeTextInput, _extends({
|
|
318
320
|
value: formatDate(),
|
|
319
321
|
placeholder: label ? placeholder1 : placeholder,
|
|
320
322
|
editable: !disabled,
|
|
@@ -323,9 +325,8 @@ const DatePicker = _ref => {
|
|
|
323
325
|
onFocus: _handleFocus,
|
|
324
326
|
onBlur: _handleBlur,
|
|
325
327
|
underlineColorAndroid: "transparent",
|
|
326
|
-
style: inputStyles
|
|
327
|
-
|
|
328
|
-
})), rightIconName ? /*#__PURE__*/React.createElement(Icon, {
|
|
328
|
+
style: inputStyles
|
|
329
|
+
}, props))), rightIconName ? /*#__PURE__*/React.createElement(Icon, {
|
|
329
330
|
name: rightIconName,
|
|
330
331
|
size: ICON_SIZE,
|
|
331
332
|
color: colors.light,
|
|
@@ -1,9 +1,11 @@
|
|
|
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
3
|
import * as React from "react";
|
|
2
4
|
import { Animated, StyleSheet, View } from "react-native";
|
|
3
5
|
import shadow from "../styles/shadow";
|
|
4
6
|
import { withTheme } from "../theming";
|
|
5
|
-
/* directly copied from https://github.com/callstack/react-native-paper/blob/main/src/components/Surface.tsx#L62 */
|
|
6
7
|
|
|
8
|
+
/* directly copied from https://github.com/callstack/react-native-paper/blob/main/src/components/Surface.tsx#L62 */
|
|
7
9
|
const Elevation = _ref => {
|
|
8
10
|
let {
|
|
9
11
|
style,
|
|
@@ -19,20 +21,7 @@ const Elevation = _ref => {
|
|
|
19
21
|
colors
|
|
20
22
|
} = theme;
|
|
21
23
|
const borderRadius = radius;
|
|
22
|
-
return /*#__PURE__*/React.createElement(Animated.View, {
|
|
23
|
-
style: [{
|
|
24
|
-
borderRadius,
|
|
25
|
-
backgroundColor: colors.surface
|
|
26
|
-
}, elevation ? shadow(elevation) : null, style]
|
|
27
|
-
}, /*#__PURE__*/React.createElement(View, {
|
|
28
|
-
style: {
|
|
29
|
-
overflow: "hidden",
|
|
30
|
-
borderRadius
|
|
31
|
-
}
|
|
32
|
-
}, children));
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
export default withTheme(Elevation);__*/React.createElement(Animated.View, _extends({}, rest, {
|
|
24
|
+
return /*#__PURE__*/React.createElement(Animated.View, _extends({}, rest, {
|
|
36
25
|
style: [{
|
|
37
26
|
borderRadius,
|
|
38
27
|
backgroundColor: colors.surface
|
|
@@ -1,3 +1,5 @@
|
|
|
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
3
|
/* README: Internal Image component used for stuff like Card. DO NOT EXPORT! */
|
|
2
4
|
import React from "react";
|
|
3
5
|
import { Image as NativeImage, StyleSheet } from "react-native";
|
|
@@ -62,24 +64,7 @@ const Image = _ref2 => {
|
|
|
62
64
|
height,
|
|
63
65
|
aspectRatio
|
|
64
66
|
}]
|
|
65
|
-
}, /*#__PURE__*/React.createElement(NativeImage, {
|
|
66
|
-
source: imageSource,
|
|
67
|
-
resizeMode: resizeMode,
|
|
68
|
-
style: [style, {
|
|
69
|
-
height: "100%",
|
|
70
|
-
width: "100%"
|
|
71
|
-
}]
|
|
72
|
-
}));
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
return /*#__PURE__*/React.createElement(NativeImage, { ...props,
|
|
76
|
-
source: source,
|
|
77
|
-
resizeMode: resizeMode,
|
|
78
|
-
style: style
|
|
79
|
-
});
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
export default Image;ent(NativeImage, _extends({}, props, {
|
|
67
|
+
}, /*#__PURE__*/React.createElement(NativeImage, _extends({}, props, {
|
|
83
68
|
source: imageSource,
|
|
84
69
|
resizeMode: resizeMode,
|
|
85
70
|
style: [style, {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
+
|
|
1
3
|
// @ts-nocheck
|
|
2
4
|
import React, { Component } from "react";
|
|
3
5
|
import { View, Text, StyleSheet, Animated, TouchableWithoutFeedback } from "react-native";
|
|
@@ -10,7 +12,7 @@ export default class StepIndicator extends Component {
|
|
|
10
12
|
constructor(props) {
|
|
11
13
|
super(props);
|
|
12
14
|
|
|
13
|
-
this
|
|
15
|
+
_defineProperty(this, "renderProgressBarBackground", () => {
|
|
14
16
|
const {
|
|
15
17
|
stepCount,
|
|
16
18
|
direction
|
|
@@ -55,9 +57,9 @@ export default class StepIndicator extends Component {
|
|
|
55
57
|
},
|
|
56
58
|
style: progressBarBackgroundStyle
|
|
57
59
|
});
|
|
58
|
-
};
|
|
60
|
+
});
|
|
59
61
|
|
|
60
|
-
this
|
|
62
|
+
_defineProperty(this, "renderProgressBar", () => {
|
|
61
63
|
const {
|
|
62
64
|
stepCount,
|
|
63
65
|
direction
|
|
@@ -89,9 +91,9 @@ export default class StepIndicator extends Component {
|
|
|
89
91
|
return /*#__PURE__*/React.createElement(Animated.View, {
|
|
90
92
|
style: progressBarStyle
|
|
91
93
|
});
|
|
92
|
-
};
|
|
94
|
+
});
|
|
93
95
|
|
|
94
|
-
this
|
|
96
|
+
_defineProperty(this, "renderStepIndicator", () => {
|
|
95
97
|
let steps = [];
|
|
96
98
|
const {
|
|
97
99
|
stepCount,
|
|
@@ -124,9 +126,9 @@ export default class StepIndicator extends Component {
|
|
|
124
126
|
height: this.state.customStyles.currentStepIndicatorSize
|
|
125
127
|
}]
|
|
126
128
|
}, steps);
|
|
127
|
-
};
|
|
129
|
+
});
|
|
128
130
|
|
|
129
|
-
this
|
|
131
|
+
_defineProperty(this, "renderStepLabels", () => {
|
|
130
132
|
const {
|
|
131
133
|
labels,
|
|
132
134
|
direction,
|
|
@@ -168,9 +170,9 @@ export default class StepIndicator extends Component {
|
|
|
168
170
|
alignItems: this.state.customStyles.labelAlign
|
|
169
171
|
}]
|
|
170
172
|
}, labelViews);
|
|
171
|
-
};
|
|
173
|
+
});
|
|
172
174
|
|
|
173
|
-
this
|
|
175
|
+
_defineProperty(this, "renderStep", position => {
|
|
174
176
|
const {
|
|
175
177
|
renderStepIndicator
|
|
176
178
|
} = this.props;
|
|
@@ -242,9 +244,9 @@ export default class StepIndicator extends Component {
|
|
|
242
244
|
}) : /*#__PURE__*/React.createElement(Text, {
|
|
243
245
|
style: indicatorLabelStyle
|
|
244
246
|
}, "".concat(position + 1)));
|
|
245
|
-
};
|
|
247
|
+
});
|
|
246
248
|
|
|
247
|
-
this
|
|
249
|
+
_defineProperty(this, "getStepStatus", stepPosition => {
|
|
248
250
|
const {
|
|
249
251
|
currentPosition
|
|
250
252
|
} = this.props;
|
|
@@ -256,9 +258,9 @@ export default class StepIndicator extends Component {
|
|
|
256
258
|
} else {
|
|
257
259
|
return STEP_STATUS.UNFINISHED;
|
|
258
260
|
}
|
|
259
|
-
};
|
|
261
|
+
});
|
|
260
262
|
|
|
261
|
-
this
|
|
263
|
+
_defineProperty(this, "onCurrentPositionChanged", position => {
|
|
262
264
|
let {
|
|
263
265
|
stepCount
|
|
264
266
|
} = this.props;
|
|
@@ -280,7 +282,7 @@ export default class StepIndicator extends Component {
|
|
|
280
282
|
toValue: this.state.customStyles.currentStepIndicatorSize / 2,
|
|
281
283
|
duration: 100
|
|
282
284
|
})])]).start();
|
|
283
|
-
};
|
|
285
|
+
});
|
|
284
286
|
|
|
285
287
|
const defaultStyles = {
|
|
286
288
|
stepIndicatorSize: 30,
|
|
@@ -391,25 +393,6 @@ const styles = StyleSheet.create({
|
|
|
391
393
|
justifyContent: "center"
|
|
392
394
|
}
|
|
393
395
|
});
|
|
394
|
-
StepIndicator.defaultProps = {
|
|
395
|
-
currentPosition: 0,
|
|
396
|
-
stepCount: 5,
|
|
397
|
-
customStyles: {},
|
|
398
|
-
direction: "horizontal"
|
|
399
|
-
};s: "center",
|
|
400
|
-
justifyContent: "center"
|
|
401
|
-
},
|
|
402
|
-
stepLabel: {
|
|
403
|
-
fontSize: 12,
|
|
404
|
-
textAlign: "center",
|
|
405
|
-
fontWeight: "500"
|
|
406
|
-
},
|
|
407
|
-
stepLabelItem: {
|
|
408
|
-
flex: 1,
|
|
409
|
-
alignItems: "center",
|
|
410
|
-
justifyContent: "center"
|
|
411
|
-
}
|
|
412
|
-
});
|
|
413
396
|
StepIndicator.defaultProps = {
|
|
414
397
|
currentPosition: 0,
|
|
415
398
|
stepCount: 5,
|