@draftbit/core 46.10.2-e28eea.2 → 46.10.2-eb07a0.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/BottomSheet/BottomSheetComponent.js +111 -127
- package/lib/commonjs/components/Checkbox/CheckboxRow.js +23 -6
- package/lib/commonjs/components/Checkbox/context.js +1 -1
- package/lib/commonjs/constants.js +1 -1
- package/lib/commonjs/index.js +0 -21
- package/lib/commonjs/mappings/FieldSearchBarFull.js +1 -3
- package/lib/commonjs/mappings/NativeBase/Layout.js +98 -0
- package/lib/commonjs/utilities.js +1 -2
- package/lib/module/components/Text.js +50 -4
- package/lib/module/index.js +0 -3
- package/lib/module/mappings/NativeBase/Layout.js +91 -0
- package/lib/typescript/src/index.d.ts +0 -3
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/mappings/NativeBase/Layout.d.ts +97 -0
- package/lib/typescript/src/mappings/NativeBase/Layout.d.ts.map +1 -0
- package/package.json +3 -3
- package/src/index.js +0 -3
- package/src/index.tsx +0 -3
- package/src/mappings/NativeBase/Layout.js +102 -0
- package/src/mappings/NativeBase/Layout.ts +117 -0
- package/lib/commonjs/components/Row.js +0 -73
- package/lib/commonjs/components/RowBodyIcon.js +0 -45
- package/lib/commonjs/components/RowHeadlineImageCaption.js +0 -45
- package/lib/commonjs/components/RowHeadlineImageIcon.js +0 -51
- package/lib/module/components/Row.js +0 -63
- package/lib/module/components/RowBodyIcon.js +0 -35
- package/lib/module/components/RowHeadlineImageCaption.js +0 -35
- package/lib/module/components/RowHeadlineImageIcon.js +0 -41
- package/lib/typescript/src/components/Row.d.ts +0 -21
- package/lib/typescript/src/components/Row.d.ts.map +0 -1
- package/lib/typescript/src/components/RowBodyIcon.d.ts +0 -16
- package/lib/typescript/src/components/RowBodyIcon.d.ts.map +0 -1
- package/lib/typescript/src/components/RowHeadlineImageCaption.d.ts +0 -16
- package/lib/typescript/src/components/RowHeadlineImageCaption.d.ts.map +0 -1
- package/lib/typescript/src/components/RowHeadlineImageIcon.d.ts +0 -18
- package/lib/typescript/src/components/RowHeadlineImageIcon.d.ts.map +0 -1
- package/src/components/Row.js +0 -48
- package/src/components/Row.tsx +0 -108
- package/src/components/RowBodyIcon.js +0 -8
- package/src/components/RowBodyIcon.tsx +0 -47
- package/src/components/RowHeadlineImageCaption.js +0 -12
- package/src/components/RowHeadlineImageCaption.tsx +0 -49
- package/src/components/RowHeadlineImageIcon.js +0 -14
- package/src/components/RowHeadlineImageIcon.tsx +0 -61
|
@@ -10,19 +10,10 @@ var _reactNativeReanimated = _interopRequireWildcard(require("react-native-reani
|
|
|
10
10
|
var _reactNativeGestureHandler = require("react-native-gesture-handler");
|
|
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
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
*/
|
|
18
|
-
/**
|
|
19
|
-
* Copyright (c) 2020 Raul Gomez Acuna
|
|
20
|
-
*
|
|
21
|
-
* This source code is licensed under the MIT license found in the
|
|
22
|
-
* LICENSE file in the root directory of this source tree.
|
|
23
|
-
*
|
|
24
|
-
*/
|
|
25
|
-
|
|
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); }
|
|
26
17
|
const {
|
|
27
18
|
//@ts-ignore
|
|
28
19
|
interpolate: interpolateDeprecated,
|
|
@@ -82,42 +73,85 @@ const imperativeScrollOptions = {
|
|
|
82
73
|
}
|
|
83
74
|
};
|
|
84
75
|
class ScrollBottomSheet extends _react.Component {
|
|
76
|
+
/**
|
|
77
|
+
* Gesture Handler references
|
|
78
|
+
*/
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* ScrollView prop
|
|
82
|
+
*/
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Pan gesture handler events for drawer handle and content
|
|
86
|
+
*/
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Main Animated Value that drives the top position of the UI drawer at any point in time
|
|
90
|
+
*/
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Animated value that keeps track of the position: 0 => closed, 1 => opened
|
|
94
|
+
*/
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Flag to indicate imperative snapping
|
|
98
|
+
*/
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Manual snapping amount
|
|
102
|
+
*/
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Keeps track of the current index
|
|
106
|
+
*/
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Deceleration rate of the scroll component. This is used only on Android to
|
|
110
|
+
* compensate the unexpected glide it gets sometimes.
|
|
111
|
+
*/
|
|
112
|
+
|
|
85
113
|
constructor(props) {
|
|
86
|
-
var _this;
|
|
87
|
-
var _a;
|
|
114
|
+
var _props$animationConfi, _this;
|
|
88
115
|
super(props);
|
|
89
116
|
_this = this;
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
this
|
|
94
|
-
this
|
|
95
|
-
this
|
|
96
|
-
this
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
this
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
this
|
|
105
|
-
this
|
|
106
|
-
this
|
|
107
|
-
this
|
|
108
|
-
this
|
|
109
|
-
this
|
|
110
|
-
this
|
|
111
|
-
this
|
|
112
|
-
this
|
|
113
|
-
this
|
|
114
|
-
this
|
|
115
|
-
this
|
|
116
|
-
this
|
|
117
|
-
this
|
|
118
|
-
this
|
|
119
|
-
this
|
|
120
|
-
this
|
|
117
|
+
_defineProperty(this, "masterDrawer", /*#__PURE__*/_react.default.createRef());
|
|
118
|
+
_defineProperty(this, "drawerHandleRef", /*#__PURE__*/_react.default.createRef());
|
|
119
|
+
_defineProperty(this, "drawerContentRef", /*#__PURE__*/_react.default.createRef());
|
|
120
|
+
_defineProperty(this, "scrollComponentRef", /*#__PURE__*/_react.default.createRef());
|
|
121
|
+
_defineProperty(this, "onScrollBeginDrag", void 0);
|
|
122
|
+
_defineProperty(this, "onHandleGestureEvent", void 0);
|
|
123
|
+
_defineProperty(this, "onDrawerGestureEvent", void 0);
|
|
124
|
+
_defineProperty(this, "translateY", void 0);
|
|
125
|
+
_defineProperty(this, "position", void 0);
|
|
126
|
+
_defineProperty(this, "isManuallySetValue", new _reactNativeReanimated.Value(0));
|
|
127
|
+
_defineProperty(this, "manualYOffset", new _reactNativeReanimated.Value(0));
|
|
128
|
+
_defineProperty(this, "nextSnapIndex", void 0);
|
|
129
|
+
_defineProperty(this, "decelerationRate", void 0);
|
|
130
|
+
_defineProperty(this, "prevSnapIndex", -1);
|
|
131
|
+
_defineProperty(this, "dragY", new _reactNativeReanimated.Value(0));
|
|
132
|
+
_defineProperty(this, "prevDragY", new _reactNativeReanimated.Value(0));
|
|
133
|
+
_defineProperty(this, "tempDestSnapPoint", new _reactNativeReanimated.Value(0));
|
|
134
|
+
_defineProperty(this, "isAndroid", new _reactNativeReanimated.Value(Number(_reactNative.Platform.OS === "android")));
|
|
135
|
+
_defineProperty(this, "animationClock", new _reactNativeReanimated.Clock());
|
|
136
|
+
_defineProperty(this, "animationPosition", new _reactNativeReanimated.Value(0));
|
|
137
|
+
_defineProperty(this, "animationFinished", new _reactNativeReanimated.Value(0));
|
|
138
|
+
_defineProperty(this, "animationFrameTime", new _reactNativeReanimated.Value(0));
|
|
139
|
+
_defineProperty(this, "velocityY", new _reactNativeReanimated.Value(0));
|
|
140
|
+
_defineProperty(this, "lastStartScrollY", new _reactNativeReanimated.Value(0));
|
|
141
|
+
_defineProperty(this, "prevTranslateYOffset", void 0);
|
|
142
|
+
_defineProperty(this, "translationY", void 0);
|
|
143
|
+
_defineProperty(this, "destSnapPoint", new _reactNativeReanimated.Value(0));
|
|
144
|
+
_defineProperty(this, "lastSnap", void 0);
|
|
145
|
+
_defineProperty(this, "dragWithHandle", new _reactNativeReanimated.Value(0));
|
|
146
|
+
_defineProperty(this, "scrollUpAndPullDown", new _reactNativeReanimated.Value(0));
|
|
147
|
+
_defineProperty(this, "didGestureFinish", void 0);
|
|
148
|
+
_defineProperty(this, "didScrollUpAndPullDown", void 0);
|
|
149
|
+
_defineProperty(this, "setTranslationY", void 0);
|
|
150
|
+
_defineProperty(this, "extraOffset", void 0);
|
|
151
|
+
_defineProperty(this, "calculateNextSnapPoint", void 0);
|
|
152
|
+
_defineProperty(this, "scrollComponent", void 0);
|
|
153
|
+
_defineProperty(this, "convertPercentageToDp", str => Number(str.split("%")[0]) * (windowHeight - this.props.topInset) / 100);
|
|
154
|
+
_defineProperty(this, "getNormalisedSnapPoints", () => {
|
|
121
155
|
return this.props.snapPoints.map(p => {
|
|
122
156
|
if (typeof p === "string") {
|
|
123
157
|
return this.convertPercentageToDp(p);
|
|
@@ -126,8 +160,8 @@ class ScrollBottomSheet extends _react.Component {
|
|
|
126
160
|
}
|
|
127
161
|
throw new Error("Invalid type for value ".concat(p, ": ").concat(typeof p, ". It should be either a percentage string or a number"));
|
|
128
162
|
});
|
|
129
|
-
};
|
|
130
|
-
this
|
|
163
|
+
});
|
|
164
|
+
_defineProperty(this, "getScrollComponent", () => {
|
|
131
165
|
switch (this.props.componentType) {
|
|
132
166
|
case "FlatList":
|
|
133
167
|
return _reactNative.FlatList;
|
|
@@ -138,32 +172,33 @@ class ScrollBottomSheet extends _react.Component {
|
|
|
138
172
|
default:
|
|
139
173
|
throw new Error("Component type not supported: it should be one of `FlatList`, `ScrollView` or `SectionList`");
|
|
140
174
|
}
|
|
141
|
-
};
|
|
142
|
-
this
|
|
175
|
+
});
|
|
176
|
+
_defineProperty(this, "snapTo", index => {
|
|
143
177
|
const snapPoints = this.getNormalisedSnapPoints();
|
|
144
178
|
this.isManuallySetValue.setValue(1);
|
|
145
179
|
this.manualYOffset.setValue(snapPoints[index]);
|
|
146
180
|
this.nextSnapIndex.setValue(index);
|
|
147
|
-
};
|
|
181
|
+
});
|
|
148
182
|
const {
|
|
149
183
|
initialSnapIndex,
|
|
150
184
|
animationType
|
|
151
185
|
} = props;
|
|
152
186
|
const animationDriver = animationType === "timing" ? 0 : 1;
|
|
153
|
-
const animationDuration = props.animationType === "timing" && ((
|
|
187
|
+
const animationDuration = props.animationType === "timing" && ((_props$animationConfi = props.animationConfig) === null || _props$animationConfi === void 0 ? void 0 : _props$animationConfi.duration) || DEFAULT_ANIMATION_DURATION;
|
|
154
188
|
const ScrollComponent = this.getScrollComponent();
|
|
155
189
|
// @ts-ignore
|
|
156
190
|
this.scrollComponent = _reactNativeReanimated.default.createAnimatedComponent(ScrollComponent);
|
|
157
|
-
const
|
|
158
|
-
const openPosition =
|
|
159
|
-
const closedPosition = this.props.enableOverScroll ? windowHeight :
|
|
160
|
-
const initialSnap =
|
|
191
|
+
const _snapPoints = this.getNormalisedSnapPoints();
|
|
192
|
+
const openPosition = _snapPoints[0];
|
|
193
|
+
const closedPosition = this.props.enableOverScroll ? windowHeight : _snapPoints[_snapPoints.length - 1];
|
|
194
|
+
const initialSnap = _snapPoints[initialSnapIndex];
|
|
161
195
|
this.nextSnapIndex = new _reactNativeReanimated.Value(initialSnapIndex);
|
|
162
196
|
const initialDecelerationRate = _reactNative.Platform.select({
|
|
163
197
|
android: props.initialSnapIndex === 0 ? ANDROID_NORMAL_DECELERATION_RATE : 0,
|
|
164
198
|
ios: IOS_NORMAL_DECELERATION_RATE
|
|
165
199
|
});
|
|
166
200
|
this.decelerationRate = new _reactNativeReanimated.Value(initialDecelerationRate);
|
|
201
|
+
|
|
167
202
|
//@ts-ignore
|
|
168
203
|
const handleGestureState = new _reactNativeReanimated.Value(-1);
|
|
169
204
|
//@ts-ignore
|
|
@@ -202,27 +237,29 @@ class ScrollBottomSheet extends _react.Component {
|
|
|
202
237
|
const didHandleGestureBegin = (0, _reactNativeReanimated.eq)(handleGestureState, _reactNativeGestureHandler.State.ACTIVE);
|
|
203
238
|
const isAnimationInterrupted = (0, _reactNativeReanimated.and)((0, _reactNativeReanimated.or)((0, _reactNativeReanimated.eq)(handleGestureState, _reactNativeGestureHandler.State.BEGAN), (0, _reactNativeReanimated.eq)(drawerGestureState, _reactNativeGestureHandler.State.BEGAN), (0, _reactNativeReanimated.and)((0, _reactNativeReanimated.eq)(this.isAndroid, 0), (0, _reactNativeReanimated.eq)(animationDriver, 1), (0, _reactNativeReanimated.or)((0, _reactNativeReanimated.eq)(drawerGestureState, _reactNativeGestureHandler.State.ACTIVE), (0, _reactNativeReanimated.eq)(handleGestureState, _reactNativeGestureHandler.State.ACTIVE)))), (0, _reactNativeReanimated.clockRunning)(this.animationClock));
|
|
204
239
|
this.didGestureFinish = (0, _reactNativeReanimated.or)((0, _reactNativeReanimated.and)((0, _reactNativeReanimated.eq)(handleOldGestureState, _reactNativeGestureHandler.State.ACTIVE), (0, _reactNativeReanimated.eq)(handleGestureState, _reactNativeGestureHandler.State.END)), (0, _reactNativeReanimated.and)((0, _reactNativeReanimated.eq)(drawerOldGestureState, _reactNativeGestureHandler.State.ACTIVE), (0, _reactNativeReanimated.eq)(drawerGestureState, _reactNativeGestureHandler.State.END)));
|
|
240
|
+
|
|
205
241
|
// Function that determines if the last snap point is in the range {snapPoints}
|
|
206
242
|
// In the case of interruptions in the middle of an animation, we'll get
|
|
207
243
|
// lastSnap values outside the range
|
|
208
244
|
const isLastSnapPointInRange = function () {
|
|
209
245
|
let i = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
210
|
-
return i ===
|
|
246
|
+
return i === _snapPoints.length ? lastSnapInRange : (0, _reactNativeReanimated.cond)((0, _reactNativeReanimated.eq)(_this.lastSnap, _snapPoints[i]), [(0, _reactNativeReanimated.set)(lastSnapInRange, 1)], isLastSnapPointInRange(i + 1));
|
|
211
247
|
};
|
|
212
|
-
const scrollY = [(0, _reactNativeReanimated.set)(lastSnapInRange, 0), isLastSnapPointInRange(), (0, _reactNativeReanimated.cond)((0, _reactNativeReanimated.or)(didHandleGestureBegin, (0, _reactNativeReanimated.and)(this.isManuallySetValue, (0, _reactNativeReanimated.not)((0, _reactNativeReanimated.eq)(this.manualYOffset,
|
|
248
|
+
const scrollY = [(0, _reactNativeReanimated.set)(lastSnapInRange, 0), isLastSnapPointInRange(), (0, _reactNativeReanimated.cond)((0, _reactNativeReanimated.or)(didHandleGestureBegin, (0, _reactNativeReanimated.and)(this.isManuallySetValue, (0, _reactNativeReanimated.not)((0, _reactNativeReanimated.eq)(this.manualYOffset, _snapPoints[0])))), [(0, _reactNativeReanimated.set)(this.dragWithHandle, 1), 0]), (0, _reactNativeReanimated.cond)(
|
|
213
249
|
// This is to account for a continuous scroll on the drawer from a snap point
|
|
214
250
|
// Different than top, bringing the drawer to the top position, so that if we
|
|
215
251
|
// change scroll direction without releasing the gesture, it doesn't pull down the drawer again
|
|
216
|
-
(0, _reactNativeReanimated.and)((0, _reactNativeReanimated.eq)(this.dragWithHandle, 1), (0, _reactNativeReanimated.greaterThan)(
|
|
252
|
+
(0, _reactNativeReanimated.and)((0, _reactNativeReanimated.eq)(this.dragWithHandle, 1), (0, _reactNativeReanimated.greaterThan)(_snapPoints[0], (0, _reactNativeReanimated.add)(this.lastSnap, this.dragY)), (0, _reactNativeReanimated.and)((0, _reactNativeReanimated.not)((0, _reactNativeReanimated.eq)(this.lastSnap, _snapPoints[0])), lastSnapInRange)), [(0, _reactNativeReanimated.set)(this.lastSnap, _snapPoints[0]), (0, _reactNativeReanimated.set)(this.dragWithHandle, 0), this.lastStartScrollY], (0, _reactNativeReanimated.cond)((0, _reactNativeReanimated.eq)(this.dragWithHandle, 1), 0, this.lastStartScrollY))];
|
|
217
253
|
this.didScrollUpAndPullDown = (0, _reactNativeReanimated.cond)((0, _reactNativeReanimated.and)((0, _reactNativeReanimated.greaterOrEq)(this.dragY, this.lastStartScrollY), (0, _reactNativeReanimated.greaterThan)(this.lastStartScrollY, 0)), (0, _reactNativeReanimated.set)(this.scrollUpAndPullDown, 1));
|
|
218
254
|
this.setTranslationY = (0, _reactNativeReanimated.cond)((0, _reactNativeReanimated.and)((0, _reactNativeReanimated.not)(this.dragWithHandle), (0, _reactNativeReanimated.not)((0, _reactNativeReanimated.greaterOrEq)(this.dragY, this.lastStartScrollY))), (0, _reactNativeReanimated.set)(this.translationY, (0, _reactNativeReanimated.sub)(this.dragY, this.lastStartScrollY)), (0, _reactNativeReanimated.set)(this.translationY, this.dragY));
|
|
219
255
|
this.extraOffset = (0, _reactNativeReanimated.cond)((0, _reactNativeReanimated.eq)(this.scrollUpAndPullDown, 1), this.lastStartScrollY, 0);
|
|
220
256
|
const endOffsetY = (0, _reactNativeReanimated.add)(this.lastSnap, this.translationY, (0, _reactNativeReanimated.multiply)(1 - props.friction, this.velocityY));
|
|
221
257
|
this.calculateNextSnapPoint = function () {
|
|
222
258
|
let i = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
223
|
-
return i ===
|
|
259
|
+
return i === _snapPoints.length ? _this.tempDestSnapPoint : (0, _reactNativeReanimated.cond)((0, _reactNativeReanimated.greaterThan)((0, _reactNativeReanimated.abs)((0, _reactNativeReanimated.sub)(_this.tempDestSnapPoint, endOffsetY)), (0, _reactNativeReanimated.abs)((0, _reactNativeReanimated.sub)((0, _reactNativeReanimated.add)(_snapPoints[i], _this.extraOffset), endOffsetY))), [(0, _reactNativeReanimated.set)(_this.tempDestSnapPoint, (0, _reactNativeReanimated.add)(_snapPoints[i], _this.extraOffset)), (0, _reactNativeReanimated.set)(_this.nextSnapIndex, i), _this.calculateNextSnapPoint(i + 1)], _this.calculateNextSnapPoint(i + 1));
|
|
224
260
|
};
|
|
225
261
|
const runAnimation = _ref => {
|
|
262
|
+
var _props$animationConfi2;
|
|
226
263
|
let {
|
|
227
264
|
clock,
|
|
228
265
|
from,
|
|
@@ -232,7 +269,6 @@ class ScrollBottomSheet extends _react.Component {
|
|
|
232
269
|
velocity,
|
|
233
270
|
frameTime
|
|
234
271
|
} = _ref;
|
|
235
|
-
var _a;
|
|
236
272
|
const state = {
|
|
237
273
|
finished,
|
|
238
274
|
velocity: new _reactNativeReanimated.Value(0),
|
|
@@ -242,7 +278,7 @@ class ScrollBottomSheet extends _react.Component {
|
|
|
242
278
|
};
|
|
243
279
|
const timingConfig = {
|
|
244
280
|
duration: animationDuration,
|
|
245
|
-
easing: props.animationType === "timing" && ((
|
|
281
|
+
easing: props.animationType === "timing" && ((_props$animationConfi2 = props.animationConfig) === null || _props$animationConfi2 === void 0 ? void 0 : _props$animationConfi2.easing) || DEFAULT_EASING,
|
|
246
282
|
toValue: new _reactNativeReanimated.Value(0)
|
|
247
283
|
};
|
|
248
284
|
const springConfig = {
|
|
@@ -258,14 +294,14 @@ class ScrollBottomSheet extends _react.Component {
|
|
|
258
294
|
//@ts-ignore
|
|
259
295
|
(0, _reactNativeReanimated.timing)(clock, state, timingConfig), (0, _reactNativeReanimated.spring)(clock, state, springConfig)), (0, _reactNativeReanimated.cond)(state.finished, [(0, _reactNativeReanimated.call)([this.nextSnapIndex], _ref2 => {
|
|
260
296
|
let [value] = _ref2;
|
|
261
|
-
var _a, _b;
|
|
262
297
|
if (value !== this.prevSnapIndex) {
|
|
263
|
-
|
|
298
|
+
var _this$props$onSettle, _this$props;
|
|
299
|
+
(_this$props$onSettle = (_this$props = this.props).onSettle) === null || _this$props$onSettle === void 0 ? void 0 : _this$props$onSettle.call(_this$props, value);
|
|
264
300
|
}
|
|
265
301
|
this.prevSnapIndex = value;
|
|
266
302
|
}),
|
|
267
303
|
// Resetting appropriate values
|
|
268
|
-
(0, _reactNativeReanimated.set)(drawerOldGestureState, _reactNativeGestureHandler.State.END), (0, _reactNativeReanimated.set)(handleOldGestureState, _reactNativeGestureHandler.State.END), (0, _reactNativeReanimated.set)(this.prevTranslateYOffset, state.position), (0, _reactNativeReanimated.cond)((0, _reactNativeReanimated.eq)(this.scrollUpAndPullDown, 1), [(0, _reactNativeReanimated.set)(this.prevTranslateYOffset, (0, _reactNativeReanimated.sub)(this.prevTranslateYOffset, this.lastStartScrollY)), (0, _reactNativeReanimated.set)(this.lastStartScrollY, 0), (0, _reactNativeReanimated.set)(this.scrollUpAndPullDown, 0)]), (0, _reactNativeReanimated.cond)((0, _reactNativeReanimated.eq)(this.destSnapPoint,
|
|
304
|
+
(0, _reactNativeReanimated.set)(drawerOldGestureState, _reactNativeGestureHandler.State.END), (0, _reactNativeReanimated.set)(handleOldGestureState, _reactNativeGestureHandler.State.END), (0, _reactNativeReanimated.set)(this.prevTranslateYOffset, state.position), (0, _reactNativeReanimated.cond)((0, _reactNativeReanimated.eq)(this.scrollUpAndPullDown, 1), [(0, _reactNativeReanimated.set)(this.prevTranslateYOffset, (0, _reactNativeReanimated.sub)(this.prevTranslateYOffset, this.lastStartScrollY)), (0, _reactNativeReanimated.set)(this.lastStartScrollY, 0), (0, _reactNativeReanimated.set)(this.scrollUpAndPullDown, 0)]), (0, _reactNativeReanimated.cond)((0, _reactNativeReanimated.eq)(this.destSnapPoint, _snapPoints[0]), [(0, _reactNativeReanimated.set)(this.dragWithHandle, 0)]), (0, _reactNativeReanimated.set)(this.isManuallySetValue, 0), (0, _reactNativeReanimated.set)(this.manualYOffset, 0), (0, _reactNativeReanimated.stopClock)(clock), this.prevTranslateYOffset],
|
|
269
305
|
// We made the block return the updated position,
|
|
270
306
|
state.position)];
|
|
271
307
|
};
|
|
@@ -294,7 +330,7 @@ class ScrollBottomSheet extends _react.Component {
|
|
|
294
330
|
extrapolate: _reactNativeReanimated.Extrapolate.CLAMP
|
|
295
331
|
});
|
|
296
332
|
this.position = interpolate(this.translateY, {
|
|
297
|
-
inputRange: [openPosition,
|
|
333
|
+
inputRange: [openPosition, _snapPoints[_snapPoints.length - 1]],
|
|
298
334
|
outputRange: [1, 0],
|
|
299
335
|
extrapolate: _reactNativeReanimated.Extrapolate.CLAMP
|
|
300
336
|
});
|
|
@@ -335,25 +371,26 @@ class ScrollBottomSheet extends _react.Component {
|
|
|
335
371
|
ref: this.scrollComponentRef,
|
|
336
372
|
waitFor: this.masterDrawer,
|
|
337
373
|
simultaneousHandlers: this.drawerContentRef
|
|
338
|
-
}, /*#__PURE__*/_react.default.createElement(AnimatedScrollableComponent, {
|
|
374
|
+
}, /*#__PURE__*/_react.default.createElement(AnimatedScrollableComponent, _extends({
|
|
339
375
|
overScrollMode: "never",
|
|
340
|
-
bounces: false
|
|
341
|
-
|
|
342
|
-
ref: this.props.innerRef
|
|
376
|
+
bounces: false
|
|
377
|
+
}, rest, {
|
|
378
|
+
ref: this.props.innerRef
|
|
343
379
|
// @ts-ignore
|
|
380
|
+
,
|
|
344
381
|
decelerationRate: this.decelerationRate,
|
|
345
382
|
onScrollBeginDrag: this.onScrollBeginDrag,
|
|
346
383
|
scrollEventThrottle: 1,
|
|
347
384
|
contentContainerStyle: [rest.contentContainerStyle, {
|
|
348
385
|
paddingBottom: this.getNormalisedSnapPoints()[0]
|
|
349
386
|
}]
|
|
350
|
-
})))), this.props.animatedPosition && /*#__PURE__*/_react.default.createElement(_reactNativeReanimated.default.Code, {
|
|
387
|
+
}))))), this.props.animatedPosition && /*#__PURE__*/_react.default.createElement(_reactNativeReanimated.default.Code, {
|
|
351
388
|
exec: (0, _reactNativeReanimated.onChange)(this.position, (0, _reactNativeReanimated.set)(this.props.animatedPosition, this.position))
|
|
352
389
|
}), /*#__PURE__*/_react.default.createElement(_reactNativeReanimated.default.Code, {
|
|
353
390
|
exec: (0, _reactNativeReanimated.onChange)(this.dragY, (0, _reactNativeReanimated.cond)((0, _reactNativeReanimated.not)((0, _reactNativeReanimated.eq)(this.dragY, 0)), (0, _reactNativeReanimated.set)(this.prevDragY, this.dragY)))
|
|
354
391
|
}), /*#__PURE__*/_react.default.createElement(_reactNativeReanimated.default.Code, {
|
|
355
392
|
exec: (0, _reactNativeReanimated.onChange)(this.didGestureFinish, (0, _reactNativeReanimated.cond)(this.didGestureFinish, [this.didScrollUpAndPullDown, this.setTranslationY, (0, _reactNativeReanimated.set)(this.tempDestSnapPoint, (0, _reactNativeReanimated.add)(normalisedSnapPoints[0], this.extraOffset)), (0, _reactNativeReanimated.set)(this.nextSnapIndex, 0), (0, _reactNativeReanimated.set)(this.destSnapPoint, this.calculateNextSnapPoint()), (0, _reactNativeReanimated.cond)((0, _reactNativeReanimated.and)((0, _reactNativeReanimated.greaterThan)(this.dragY, this.lastStartScrollY), this.isAndroid, (0, _reactNativeReanimated.not)(this.dragWithHandle)), (0, _reactNativeReanimated.call)([], () => {
|
|
356
|
-
var
|
|
393
|
+
var _this$props2, _this$props2$data;
|
|
357
394
|
// This prevents the scroll glide from happening on Android when pulling down with inertia.
|
|
358
395
|
// It's not perfect, but does the job for now
|
|
359
396
|
const {
|
|
@@ -362,67 +399,14 @@ class ScrollBottomSheet extends _react.Component {
|
|
|
362
399
|
} = imperativeScrollOptions[this.props.componentType];
|
|
363
400
|
// @ts-ignore
|
|
364
401
|
const node = this.props.innerRef.current;
|
|
365
|
-
if (node && node[method] && (this.props.componentType === "FlatList" && (((
|
|
402
|
+
if (node && node[method] && (this.props.componentType === "FlatList" && (((_this$props2 = this.props) === null || _this$props2 === void 0 ? void 0 : (_this$props2$data = _this$props2.data) === null || _this$props2$data === void 0 ? void 0 : _this$props2$data.length) || 0) > 0 || this.props.componentType === "SectionList" && this.props.sections.length > 0 || this.props.componentType === "ScrollView")) {
|
|
366
403
|
node[method](args);
|
|
367
404
|
}
|
|
368
405
|
})), (0, _reactNativeReanimated.set)(this.dragY, 0), (0, _reactNativeReanimated.set)(this.velocityY, 0), (0, _reactNativeReanimated.set)(this.lastSnap, (0, _reactNativeReanimated.sub)(this.destSnapPoint, (0, _reactNativeReanimated.cond)((0, _reactNativeReanimated.eq)(this.scrollUpAndPullDown, 1), this.lastStartScrollY, 0))), (0, _reactNativeReanimated.call)([this.lastSnap], _ref3 => {
|
|
406
|
+
var _this$masterDrawer, _this$masterDrawer$cu;
|
|
369
407
|
let [value] = _ref3;
|
|
370
|
-
var _a, _b;
|
|
371
|
-
// This is the TapGHandler trick
|
|
372
|
-
// @ts-ignore
|
|
373
|
-
(_b = (_a = this.masterDrawer) === null || _a === void 0 ? void 0 : _a.current) === null || _b === void 0 ? void 0 : _b.setNativeProps({
|
|
374
|
-
maxDeltaY: value - this.getNormalisedSnapPoints()[0]
|
|
375
|
-
});
|
|
376
|
-
}), (0, _reactNativeReanimated.set)(this.decelerationRate, (0, _reactNativeReanimated.cond)((0, _reactNativeReanimated.eq)(this.isAndroid, 1), (0, _reactNativeReanimated.cond)((0, _reactNativeReanimated.eq)(this.lastSnap, normalisedSnapPoints[0]), ANDROID_NORMAL_DECELERATION_RATE, 0), IOS_NORMAL_DECELERATION_RATE))]))
|
|
377
|
-
}), /*#__PURE__*/_react.default.createElement(_reactNativeReanimated.default.Code, {
|
|
378
|
-
exec: (0, _reactNativeReanimated.onChange)(this.isManuallySetValue, [(0, _reactNativeReanimated.cond)(this.isManuallySetValue, [(0, _reactNativeReanimated.set)(this.destSnapPoint, this.manualYOffset), (0, _reactNativeReanimated.set)(this.animationFinished, 0), (0, _reactNativeReanimated.set)(this.lastSnap, this.manualYOffset), (0, _reactNativeReanimated.call)([this.lastSnap], _ref4 => {
|
|
379
|
-
let [value] = _ref4;
|
|
380
|
-
var _a, _b;
|
|
381
408
|
// This is the TapGHandler trick
|
|
382
409
|
// @ts-ignore
|
|
383
|
-
(_b = (_a = this.masterDrawer) === null || _a === void 0 ? void 0 : _a.current) === null || _b === void 0 ? void 0 : _b.setNativeProps({
|
|
384
|
-
maxDeltaY: value - this.getNormalisedSnapPoints()[0]
|
|
385
|
-
});
|
|
386
|
-
})], [(0, _reactNativeReanimated.set)(this.nextSnapIndex, 0)])])
|
|
387
|
-
}));
|
|
388
|
-
// On Android, having an intermediary view with pointerEvents="box-none", breaks the
|
|
389
|
-
// waitFor logic
|
|
390
|
-
if (_reactNative.Platform.OS === "android") {
|
|
391
|
-
return /*#__PURE__*/_react.default.createElement(_reactNativeGestureHandler.TapGestureHandler, {
|
|
392
|
-
maxDurationMs: 100000,
|
|
393
|
-
ref: this.masterDrawer,
|
|
394
|
-
maxDeltaY: initialSnap - this.getNormalisedSnapPoints()[0],
|
|
395
|
-
shouldCancelWhenOutside: false
|
|
396
|
-
}, Content);
|
|
397
|
-
}
|
|
398
|
-
// On iOS, We need to wrap the content on a view with PointerEvents box-none
|
|
399
|
-
// So that we can start scrolling automatically when reaching the top without
|
|
400
|
-
// Stopping the gesture
|
|
401
|
-
return /*#__PURE__*/_react.default.createElement(_reactNativeGestureHandler.TapGestureHandler, {
|
|
402
|
-
maxDurationMs: 100000,
|
|
403
|
-
ref: this.masterDrawer,
|
|
404
|
-
maxDeltaY: initialSnap - this.getNormalisedSnapPoints()[0]
|
|
405
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
406
|
-
style: _reactNative.StyleSheet.absoluteFillObject,
|
|
407
|
-
pointerEvents: "box-none"
|
|
408
|
-
}, Content));
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
exports.ScrollBottomSheet = ScrollBottomSheet;
|
|
412
|
-
ScrollBottomSheet.defaultProps = {
|
|
413
|
-
topInset: 0,
|
|
414
|
-
friction: 0.95,
|
|
415
|
-
animationType: "timing",
|
|
416
|
-
innerRef: /*#__PURE__*/_react.default.createRef(),
|
|
417
|
-
enableOverScroll: false
|
|
418
|
-
};
|
|
419
|
-
var _default = ScrollBottomSheet;
|
|
420
|
-
exports.default = _default;
|
|
421
|
-
const styles = _reactNative.StyleSheet.create({
|
|
422
|
-
container: {
|
|
423
|
-
flex: 1
|
|
424
|
-
}
|
|
425
|
-
}); @ts-ignore
|
|
426
410
|
(_this$masterDrawer = this.masterDrawer) === null || _this$masterDrawer === void 0 ? void 0 : (_this$masterDrawer$cu = _this$masterDrawer.current) === null || _this$masterDrawer$cu === void 0 ? void 0 : _this$masterDrawer$cu.setNativeProps({
|
|
427
411
|
maxDeltaY: value - this.getNormalisedSnapPoints()[0]
|
|
428
412
|
});
|
|
@@ -14,8 +14,7 @@ var _Checkbox = _interopRequireDefault(require("./Checkbox"));
|
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
15
|
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); }
|
|
16
16
|
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; }
|
|
17
|
-
|
|
18
|
-
let Direction;
|
|
17
|
+
var Direction;
|
|
19
18
|
exports.Direction = Direction;
|
|
20
19
|
(function (Direction) {
|
|
21
20
|
Direction["Row"] = "row";
|
|
@@ -58,7 +57,6 @@ const CheckboxRow = _ref => {
|
|
|
58
57
|
setInternalValue(status);
|
|
59
58
|
}
|
|
60
59
|
}, [status]);
|
|
61
|
-
|
|
62
60
|
// This special logic is to handle weird APIs like Airtable that return
|
|
63
61
|
// true or undefined for a boolean
|
|
64
62
|
const previousDefaultValue = (0, _hooks.usePrevious)(defaultValue);
|
|
@@ -82,13 +80,14 @@ const CheckboxRow = _ref => {
|
|
|
82
80
|
textStyles,
|
|
83
81
|
viewStyles
|
|
84
82
|
} = (0, _utilities.extractStyles)(style);
|
|
85
|
-
return /*#__PURE__*/React.createElement(_reactNative.Pressable,
|
|
83
|
+
return /*#__PURE__*/React.createElement(_reactNative.Pressable, {
|
|
86
84
|
onPress: handlePress,
|
|
87
85
|
style: [viewStyles, styles.mainParent, {
|
|
88
86
|
flexDirection: direction
|
|
89
87
|
}],
|
|
90
|
-
disabled: disabled
|
|
91
|
-
|
|
88
|
+
disabled: disabled,
|
|
89
|
+
...rest
|
|
90
|
+
}, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
92
91
|
style: [styles.label, {
|
|
93
92
|
alignItems: direction === Direction.Row ? "flex-start" : "flex-end"
|
|
94
93
|
}, labelContainerStyle]
|
|
@@ -125,4 +124,22 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
125
124
|
}
|
|
126
125
|
});
|
|
127
126
|
var _default = CheckboxRow;
|
|
127
|
+
exports.default = _default;ems: "center",
|
|
128
|
+
justifyContent: "space-around",
|
|
129
|
+
paddingStart: 20,
|
|
130
|
+
minHeight: 50,
|
|
131
|
+
paddingEnd: 20,
|
|
132
|
+
display: "flex",
|
|
133
|
+
..._reactNative.Platform.select({
|
|
134
|
+
web: {
|
|
135
|
+
cursor: "pointer",
|
|
136
|
+
userSelect: "none"
|
|
137
|
+
}
|
|
138
|
+
})
|
|
139
|
+
},
|
|
140
|
+
label: {
|
|
141
|
+
flex: 3
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
var _default = CheckboxRow;
|
|
128
145
|
exports.default = _default;
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.checkboxGroupContext = exports.Direction = void 0;
|
|
7
7
|
exports.useCheckboxGroupContext = useCheckboxGroupContext;
|
|
8
8
|
var _react = require("react");
|
|
9
|
-
|
|
9
|
+
var Direction;
|
|
10
10
|
exports.Direction = Direction;
|
|
11
11
|
(function (Direction) {
|
|
12
12
|
Direction["Horizontal"] = "horizontal";
|
|
@@ -12,4 +12,4 @@ const APPROX_STATUSBAR_HEIGHT = _reactNative.Platform.select({
|
|
|
12
12
|
android: DEFAULT_STATUSBAR_HEIGHT_EXPO,
|
|
13
13
|
ios: _reactNative.Platform.Version < 11 ? DEFAULT_STATUSBAR_HEIGHT_EXPO : 0
|
|
14
14
|
});
|
|
15
|
-
exports.APPROX_STATUSBAR_HEIGHT = APPROX_STATUSBAR_HEIGHT;
|
|
15
|
+
exports.APPROX_STATUSBAR_HEIGHT = APPROX_STATUSBAR_HEIGHT;
|
package/lib/commonjs/index.js
CHANGED
|
@@ -255,24 +255,6 @@ Object.defineProperty(exports, "Row", {
|
|
|
255
255
|
return _Layout.Row;
|
|
256
256
|
}
|
|
257
257
|
});
|
|
258
|
-
Object.defineProperty(exports, "RowBodyIcon", {
|
|
259
|
-
enumerable: true,
|
|
260
|
-
get: function () {
|
|
261
|
-
return _RowBodyIcon.default;
|
|
262
|
-
}
|
|
263
|
-
});
|
|
264
|
-
Object.defineProperty(exports, "RowHeadlineImageCaption", {
|
|
265
|
-
enumerable: true,
|
|
266
|
-
get: function () {
|
|
267
|
-
return _RowHeadlineImageCaption.default;
|
|
268
|
-
}
|
|
269
|
-
});
|
|
270
|
-
Object.defineProperty(exports, "RowHeadlineImageIcon", {
|
|
271
|
-
enumerable: true,
|
|
272
|
-
get: function () {
|
|
273
|
-
return _RowHeadlineImageIcon.default;
|
|
274
|
-
}
|
|
275
|
-
});
|
|
276
258
|
Object.defineProperty(exports, "SVG", {
|
|
277
259
|
enumerable: true,
|
|
278
260
|
get: function () {
|
|
@@ -459,9 +441,6 @@ var _DatePicker = _interopRequireDefault(require("./components/DatePicker/DatePi
|
|
|
459
441
|
var _Picker = _interopRequireDefault(require("./components/Picker/Picker"));
|
|
460
442
|
var _ProgressBar = _interopRequireDefault(require("./components/ProgressBar"));
|
|
461
443
|
var _ProgressCircle = _interopRequireDefault(require("./components/ProgressCircle"));
|
|
462
|
-
var _RowBodyIcon = _interopRequireDefault(require("./components/RowBodyIcon"));
|
|
463
|
-
var _RowHeadlineImageCaption = _interopRequireDefault(require("./components/RowHeadlineImageCaption"));
|
|
464
|
-
var _RowHeadlineImageIcon = _interopRequireDefault(require("./components/RowHeadlineImageIcon"));
|
|
465
444
|
var _Slider = _interopRequireDefault(require("./components/Slider"));
|
|
466
445
|
var _Stepper = _interopRequireDefault(require("./components/Stepper"));
|
|
467
446
|
var _useAuthState = require("./components/useAuthState");
|
|
@@ -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;
|
|
@@ -0,0 +1,98 @@
|
|
|
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 SHARED_SEED_DATA = {
|
|
9
|
+
category: _types.COMPONENT_TYPES.layout,
|
|
10
|
+
packageName: "native-base",
|
|
11
|
+
stylesPanelSections: _types.CONTAINER_COMPONENT_STYLES_SECTIONS
|
|
12
|
+
};
|
|
13
|
+
const SEED_DATA = [{
|
|
14
|
+
name: "Aspect Ratio",
|
|
15
|
+
tag: "AspectRatio",
|
|
16
|
+
description: "Controls the size of the undefined dimension of a node or child component using an aspect ration",
|
|
17
|
+
...SHARED_SEED_DATA,
|
|
18
|
+
props: {
|
|
19
|
+
ratio: (0, _types.createTextProp)({
|
|
20
|
+
label: "Ratio",
|
|
21
|
+
description: "The aspect ratio of the container",
|
|
22
|
+
defaultValue: "4/3",
|
|
23
|
+
group: _types.GROUPS.basic
|
|
24
|
+
})
|
|
25
|
+
}
|
|
26
|
+
}, {
|
|
27
|
+
name: "Box",
|
|
28
|
+
tag: "Box",
|
|
29
|
+
description: "This is a generic component for low level layout needs. It is similar to a div in HTML",
|
|
30
|
+
...SHARED_SEED_DATA
|
|
31
|
+
}, {
|
|
32
|
+
name: "Center",
|
|
33
|
+
tag: "Center",
|
|
34
|
+
description: "Center aligns its contents to the center within itself",
|
|
35
|
+
...SHARED_SEED_DATA
|
|
36
|
+
}, {
|
|
37
|
+
name: "Circle",
|
|
38
|
+
tag: "Circle",
|
|
39
|
+
description: "Center aligns its contents to the center within itself with a round border radius",
|
|
40
|
+
...SHARED_SEED_DATA
|
|
41
|
+
}, {
|
|
42
|
+
name: "Container",
|
|
43
|
+
tag: "Container",
|
|
44
|
+
description: "The Container restricts a content's width according to current breakpoint, while keeping the size fluid",
|
|
45
|
+
...SHARED_SEED_DATA
|
|
46
|
+
}, {
|
|
47
|
+
name: "Column",
|
|
48
|
+
tag: "Column",
|
|
49
|
+
description: "Column aligns items vertically",
|
|
50
|
+
...SHARED_SEED_DATA
|
|
51
|
+
}, {
|
|
52
|
+
name: "Row",
|
|
53
|
+
tag: "Row",
|
|
54
|
+
description: "Column aligns items horizontally",
|
|
55
|
+
...SHARED_SEED_DATA
|
|
56
|
+
}, {
|
|
57
|
+
name: "Spacer",
|
|
58
|
+
tag: "Spacer",
|
|
59
|
+
description: "An adjustable, empty space that can be used to tune the spacing between child elements within Flex",
|
|
60
|
+
...SHARED_SEED_DATA
|
|
61
|
+
}, {
|
|
62
|
+
name: "Stack",
|
|
63
|
+
tag: "Stack",
|
|
64
|
+
description: "Stack aligns items vertically or horizontally based on the direction prop",
|
|
65
|
+
...SHARED_SEED_DATA,
|
|
66
|
+
props: {
|
|
67
|
+
direction: (0, _types.createTextEnumProp)({
|
|
68
|
+
label: "Direction",
|
|
69
|
+
description: "The direction of the Stack",
|
|
70
|
+
options: ["row", "column"],
|
|
71
|
+
defaultValue: "column"
|
|
72
|
+
}),
|
|
73
|
+
reversed: (0, _types.createBoolProp)({
|
|
74
|
+
label: "Reversed",
|
|
75
|
+
description: "Determines whether to reverse the direction of items"
|
|
76
|
+
}),
|
|
77
|
+
isDisabled: (0, _types.createBoolProp)({
|
|
78
|
+
label: "Disabled",
|
|
79
|
+
description: "If true, the Stack will be disabled"
|
|
80
|
+
}),
|
|
81
|
+
isInvalid: (0, _types.createBoolProp)({
|
|
82
|
+
label: "Invalid",
|
|
83
|
+
description: "If true, the Stack will be invalid"
|
|
84
|
+
})
|
|
85
|
+
}
|
|
86
|
+
}, {
|
|
87
|
+
name: "ZStack",
|
|
88
|
+
tag: "ZStack",
|
|
89
|
+
description: "ZStack aligns items to the z-axis",
|
|
90
|
+
...SHARED_SEED_DATA,
|
|
91
|
+
props: {
|
|
92
|
+
reversed: (0, _types.createBoolProp)({
|
|
93
|
+
label: "Reversed",
|
|
94
|
+
description: "Determines whether to reverse the direction of items"
|
|
95
|
+
})
|
|
96
|
+
}
|
|
97
|
+
}];
|
|
98
|
+
exports.SEED_DATA = SEED_DATA;
|
|
@@ -57,7 +57,6 @@ function extractBorderAndMarginStyles(style, additionalBorderStyles, additionalM
|
|
|
57
57
|
marginStyles
|
|
58
58
|
};
|
|
59
59
|
}
|
|
60
|
-
|
|
61
60
|
/**
|
|
62
61
|
* Merges a style object on top of another style object. In React Native,
|
|
63
62
|
* keys with undefined values in a style object will still override styles
|
|
@@ -90,4 +89,4 @@ function getValueForRadioButton(value) {
|
|
|
90
89
|
} else {
|
|
91
90
|
throw new Error("Invalid value: ".concat(value));
|
|
92
91
|
}
|
|
93
|
-
}
|
|
92
|
+
}}
|