@nativescript-community/ui-drawer 0.1.21 → 0.1.23
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/angular/index.d.ts +1 -0
- package/angular/module.d.ts +84 -0
- package/index.d.ts +183 -0
- package/index.js +941 -0
- package/index.js.map +1 -0
- package/package.json +2 -2
- package/react/index.d.ts +20 -0
- package/react/index.js +9 -0
- package/react/index.js.map +1 -0
- package/svelte/index.d.ts +11 -0
- package/svelte/index.js +26 -0
- package/svelte/index.js.map +1 -0
- package/vue/component.d.ts +11 -0
- package/vue/component.js +26 -0
- package/vue/component.js.map +1 -0
- package/vue/index.d.ts +4 -0
- package/vue/index.js +10 -0
- package/vue/index.js.map +1 -0
- package/vue3/component.d.ts +3 -0
- package/vue3/component.js +20 -0
- package/vue3/component.js.map +1 -0
- package/vue3/index.d.ts +4 -0
- package/vue3/index.js +38 -0
- package/vue3/index.js.map +1 -0
package/index.js
ADDED
@@ -0,0 +1,941 @@
|
|
1
|
+
import { GestureHandlerStateEvent, GestureHandlerTouchEvent, GestureState, HandlerType, Manager, PanGestureHandler, install as installGestures } from '@nativescript-community/gesturehandler';
|
2
|
+
import { Animation, Application, CSSType, Color, CoreTypes, GridLayout, Property, Utils, View, booleanConverter } from '@nativescript/core';
|
3
|
+
installGestures(false);
|
4
|
+
const OPEN_DURATION = 200;
|
5
|
+
const CLOSE_DURATION = 200;
|
6
|
+
export const PAN_GESTURE_TAG = 12431;
|
7
|
+
const DEFAULT_TRIGGER_WIDTH = 20;
|
8
|
+
const DEFAULT_TRIGGER_HEIGHT = 20;
|
9
|
+
function transformAnimationValues(values) {
|
10
|
+
values.translate = { x: values.translateX || 0, y: values.translateY || 0 };
|
11
|
+
values.scale = { x: values.scaleX || 1, y: values.scaleY || 1 };
|
12
|
+
delete values.translateX;
|
13
|
+
delete values.translateY;
|
14
|
+
delete values.scaleX;
|
15
|
+
delete values.scaleY;
|
16
|
+
return values;
|
17
|
+
}
|
18
|
+
export const leftDrawerContentProperty = new Property({
|
19
|
+
name: 'leftDrawer',
|
20
|
+
defaultValue: undefined,
|
21
|
+
valueChanged: (target, oldValue, newValue) => target._onDrawerContentChanged('left', oldValue, newValue)
|
22
|
+
});
|
23
|
+
export const rightDrawerContentProperty = new Property({
|
24
|
+
name: 'rightDrawer',
|
25
|
+
defaultValue: undefined,
|
26
|
+
valueChanged: (target, oldValue, newValue) => target._onDrawerContentChanged('right', oldValue, newValue)
|
27
|
+
});
|
28
|
+
export const topDrawerContentProperty = new Property({
|
29
|
+
name: 'topDrawer',
|
30
|
+
defaultValue: undefined,
|
31
|
+
valueChanged: (target, oldValue, newValue) => target._onDrawerContentChanged('top', oldValue, newValue)
|
32
|
+
});
|
33
|
+
export const bottomDrawerContentProperty = new Property({
|
34
|
+
name: 'bottomDrawer',
|
35
|
+
defaultValue: undefined,
|
36
|
+
valueChanged: (target, oldValue, newValue) => target._onDrawerContentChanged('bottom', oldValue, newValue)
|
37
|
+
});
|
38
|
+
export const gestureEnabledProperty = new Property({
|
39
|
+
name: 'gestureEnabled',
|
40
|
+
defaultValue: true,
|
41
|
+
valueConverter: booleanConverter
|
42
|
+
});
|
43
|
+
export const backdropColorProperty = new Property({
|
44
|
+
name: 'backdropColor',
|
45
|
+
valueConverter: (c) => (c ? new Color(c) : null)
|
46
|
+
});
|
47
|
+
export const leftDrawerModeProperty = new Property({
|
48
|
+
name: 'leftDrawerMode'
|
49
|
+
});
|
50
|
+
export const rightDrawerModeProperty = new Property({
|
51
|
+
name: 'rightDrawerMode'
|
52
|
+
});
|
53
|
+
export const topDrawerModeProperty = new Property({
|
54
|
+
name: 'topDrawerMode'
|
55
|
+
});
|
56
|
+
export const bottomDrawerModeProperty = new Property({
|
57
|
+
name: 'bottomDrawerMode'
|
58
|
+
});
|
59
|
+
export const translationFunctionProperty = new Property({
|
60
|
+
name: 'translationFunction'
|
61
|
+
});
|
62
|
+
export const animationFunctionProperty = new Property({
|
63
|
+
name: 'animationFunction'
|
64
|
+
});
|
65
|
+
export const backDropEnabledProperty = new Property({
|
66
|
+
defaultValue: true,
|
67
|
+
valueConverter: booleanConverter,
|
68
|
+
name: 'backDropEnabled'
|
69
|
+
});
|
70
|
+
export const startingSideProperty = new Property({
|
71
|
+
name: 'startingSide',
|
72
|
+
defaultValue: null
|
73
|
+
});
|
74
|
+
export const gestureHandlerOptionsProperty = new Property({
|
75
|
+
name: 'gestureHandlerOptions'
|
76
|
+
});
|
77
|
+
const SIDES = ['left', 'right', 'top', 'bottom'];
|
78
|
+
let Drawer = class Drawer extends GridLayout {
|
79
|
+
constructor() {
|
80
|
+
super();
|
81
|
+
this.gestureTag = PAN_GESTURE_TAG;
|
82
|
+
this.gestureMinDist = 10;
|
83
|
+
this.waitFor = [];
|
84
|
+
this.simultaneousHandlers = [];
|
85
|
+
this.leftSwipeDistance = 40;
|
86
|
+
this.rightSwipeDistance = 40;
|
87
|
+
this.bottomSwipeDistance = 40;
|
88
|
+
this.topSwipeDistance = 40;
|
89
|
+
this.backdropColor = new Color('rgba(0, 0, 0, 0.7)');
|
90
|
+
this.leftOpenedDrawerAllowDraging = true;
|
91
|
+
this.rightOpenedDrawerAllowDraging = true;
|
92
|
+
this.bottomOpenedDrawerAllowDraging = true;
|
93
|
+
this.topOpenedDrawerAllowDraging = true;
|
94
|
+
this.leftClosedDrawerAllowDraging = true;
|
95
|
+
this.rightClosedDrawerAllowDraging = true;
|
96
|
+
this.bottomClosedDrawerAllowDraging = true;
|
97
|
+
this.topClosedDrawerAllowDraging = true;
|
98
|
+
this.gestureEnabled = true;
|
99
|
+
this.backdropTapGestureEnabled = true;
|
100
|
+
this.openAnimationDuration = OPEN_DURATION;
|
101
|
+
this.closeAnimationDuration = CLOSE_DURATION;
|
102
|
+
this.mIsPanning = false;
|
103
|
+
this.mIsAnimating = false;
|
104
|
+
this.mPrevDeltaX = 0;
|
105
|
+
this.mPrevDeltaY = 0;
|
106
|
+
this.mViewWidth = { left: undefined, right: undefined };
|
107
|
+
this.mViewHeight = { bottom: undefined, top: undefined };
|
108
|
+
this.mTranslationX = { left: 0, right: 0 };
|
109
|
+
this.mTranslationY = { bottom: 0, top: 0 };
|
110
|
+
this.mShowingSide = null;
|
111
|
+
// private mNeedToSetSide: Side | VerticalSide;
|
112
|
+
this.mModes = {};
|
113
|
+
this.backDropEnabled = true;
|
114
|
+
this.mViewByIdCache = {};
|
115
|
+
this.isPassThroughParentEnabled = true;
|
116
|
+
}
|
117
|
+
_onBackDropEnabledValueChanged() {
|
118
|
+
if (this.backDropEnabled && !this.backDrop) {
|
119
|
+
this.backDrop = new GridLayout();
|
120
|
+
this.backDrop.backgroundColor = this.backdropColor;
|
121
|
+
this.backDrop.opacity = 0;
|
122
|
+
this.backDrop.visibility = 'hidden';
|
123
|
+
this.insertChild(this.backDrop, 0);
|
124
|
+
}
|
125
|
+
else if (!this.backDropEnabled && this.backDrop) {
|
126
|
+
this.removeChild(this.backDrop);
|
127
|
+
this.backDrop = null;
|
128
|
+
}
|
129
|
+
}
|
130
|
+
[backDropEnabledProperty.setNative](value) {
|
131
|
+
this._onBackDropEnabledValueChanged();
|
132
|
+
}
|
133
|
+
getActualSide(side) {
|
134
|
+
return SIDES.indexOf(side) >= 0 ? side : null;
|
135
|
+
}
|
136
|
+
updateStartingSide(side) {
|
137
|
+
startingSideProperty.nativeValueChange(this, side);
|
138
|
+
}
|
139
|
+
[startingSideProperty.setNative](value) {
|
140
|
+
value = this.getActualSide(value);
|
141
|
+
if (value === this.mShowingSide) {
|
142
|
+
return;
|
143
|
+
}
|
144
|
+
if (value && !this.mViewWidth[value] && !this.mViewHeight[value]) {
|
145
|
+
this.mShowingSide = value;
|
146
|
+
const drawer = this[value + 'Drawer'];
|
147
|
+
if (drawer) {
|
148
|
+
drawer.visibility = this.mShowingSide === value ? 'visible' : 'hidden';
|
149
|
+
}
|
150
|
+
}
|
151
|
+
else if (value) {
|
152
|
+
this.open(value, 0);
|
153
|
+
}
|
154
|
+
else {
|
155
|
+
this.close(value, 0);
|
156
|
+
}
|
157
|
+
}
|
158
|
+
onBackdropTap() {
|
159
|
+
this.close();
|
160
|
+
}
|
161
|
+
initGestures() {
|
162
|
+
const manager = Manager.getInstance();
|
163
|
+
const gestureHandler = manager.createGestureHandler(HandlerType.PAN, this.gestureTag, {
|
164
|
+
shouldStartGesture: this.shouldStartGesture.bind(this),
|
165
|
+
simultaneousHandlers: this.simultaneousHandlers,
|
166
|
+
waitFor: this.waitFor,
|
167
|
+
minDist: this.gestureMinDist,
|
168
|
+
...(this.gestureHandlerOptions || {})
|
169
|
+
});
|
170
|
+
gestureHandler.on(GestureHandlerTouchEvent, this.onGestureTouch, this);
|
171
|
+
gestureHandler.on(GestureHandlerStateEvent, this.onGestureState, this);
|
172
|
+
gestureHandler.attachToView(this);
|
173
|
+
this.panGestureHandler = gestureHandler;
|
174
|
+
}
|
175
|
+
initNativeView() {
|
176
|
+
if (this.backDropEnabled && !this.backDrop) {
|
177
|
+
this[backDropEnabledProperty.setNative](this.backDropEnabled);
|
178
|
+
}
|
179
|
+
super.initNativeView();
|
180
|
+
if (this.backDrop && this.backdropTapGestureEnabled) {
|
181
|
+
this.backDrop.on('tap', this.onBackdropTap, this);
|
182
|
+
}
|
183
|
+
if (this.gestureEnabled) {
|
184
|
+
this.initGestures();
|
185
|
+
}
|
186
|
+
}
|
187
|
+
disposeNativeView() {
|
188
|
+
super.disposeNativeView();
|
189
|
+
if (this.backDrop) {
|
190
|
+
this.backDrop.off('tap', this.onBackdropTap, this);
|
191
|
+
}
|
192
|
+
if (this.panGestureHandler) {
|
193
|
+
this.panGestureHandler.off(GestureHandlerTouchEvent, this.onGestureTouch, this);
|
194
|
+
this.panGestureHandler.off(GestureHandlerStateEvent, this.onGestureState, this);
|
195
|
+
this.panGestureHandler.detachFromView();
|
196
|
+
this.panGestureHandler = null;
|
197
|
+
}
|
198
|
+
}
|
199
|
+
shouldStartSheetDraggingInternal(side) {
|
200
|
+
let result = this[side + 'OpenedDrawerAllowDraging'];
|
201
|
+
if (result && this.shouldStartSheetDragging) {
|
202
|
+
result = this.shouldStartSheetDragging(side);
|
203
|
+
}
|
204
|
+
return result;
|
205
|
+
}
|
206
|
+
shouldStartGesture(data) {
|
207
|
+
// const landscape = Application.orientation() === 'landscape';
|
208
|
+
const width = Utils.layout.toDeviceIndependentPixels(this.getMeasuredWidth());
|
209
|
+
const height = Utils.layout.toDeviceIndependentPixels(this.getMeasuredHeight());
|
210
|
+
const side = this.mShowingSide;
|
211
|
+
if (side) {
|
212
|
+
if (side === 'left' || side === 'right') {
|
213
|
+
const viewWidth = this.mViewWidth[side];
|
214
|
+
if ((side === 'left' && data.x <= viewWidth) || (side === 'right' && data.x >= width - viewWidth)) {
|
215
|
+
return this.shouldStartSheetDraggingInternal(side);
|
216
|
+
}
|
217
|
+
}
|
218
|
+
else {
|
219
|
+
const viewHeight = this.mViewHeight[side];
|
220
|
+
if ((side === 'top' && data.y <= viewHeight) || (side === 'bottom' && data.y >= height - viewHeight)) {
|
221
|
+
return this.shouldStartSheetDraggingInternal(side);
|
222
|
+
}
|
223
|
+
}
|
224
|
+
// for now without backDrop we force allow gesture
|
225
|
+
return !this.backDrop || this.backDrop.opacity !== 0;
|
226
|
+
}
|
227
|
+
else {
|
228
|
+
let needToSetSide;
|
229
|
+
if (this.leftDrawer && (!this.leftSwipeDistance || data.x <= this.leftSwipeDistance)) {
|
230
|
+
needToSetSide = 'left';
|
231
|
+
}
|
232
|
+
else if (this.rightDrawer && (!this.rightSwipeDistance || data.x >= width - this.rightSwipeDistance)) {
|
233
|
+
needToSetSide = 'right';
|
234
|
+
}
|
235
|
+
else if (this.bottomDrawer && (!this.bottomSwipeDistance || data.y >= height - this.bottomSwipeDistance)) {
|
236
|
+
needToSetSide = 'bottom';
|
237
|
+
}
|
238
|
+
else if (this.topDrawer && (!this.topSwipeDistance || data.y <= this.topSwipeDistance)) {
|
239
|
+
needToSetSide = 'top';
|
240
|
+
}
|
241
|
+
if (needToSetSide && this[needToSetSide + 'ClosedDrawerAllowDraging']) {
|
242
|
+
// this.mNeedToSetSide = needToSetSide;
|
243
|
+
return true;
|
244
|
+
}
|
245
|
+
}
|
246
|
+
return false;
|
247
|
+
}
|
248
|
+
getDrawerToOpen(extraData) {
|
249
|
+
if (extraData.translationX < 0 && this.rightDrawer) {
|
250
|
+
return 'right';
|
251
|
+
}
|
252
|
+
else if (extraData.translationX > 0 && this.leftDrawer) {
|
253
|
+
return 'left';
|
254
|
+
}
|
255
|
+
else if (extraData.translationY < 0 && this.bottomDrawer) {
|
256
|
+
return 'bottom';
|
257
|
+
}
|
258
|
+
else if (extraData.translationY > 0 && this.topDrawer) {
|
259
|
+
return 'top';
|
260
|
+
}
|
261
|
+
return null;
|
262
|
+
}
|
263
|
+
onGestureState(args) {
|
264
|
+
const { state, prevState, extraData, view } = args.data;
|
265
|
+
if (state === GestureState.ACTIVE) {
|
266
|
+
if (!this.mShowingSide) {
|
267
|
+
const shouldShowSide = this.getDrawerToOpen(extraData);
|
268
|
+
if (shouldShowSide && shouldShowSide !== this.mShowingSide) {
|
269
|
+
this[shouldShowSide + 'Drawer'].visibility = 'visible';
|
270
|
+
this.mShowingSide = shouldShowSide;
|
271
|
+
this.notify({ eventName: 'start', side: this.mShowingSide });
|
272
|
+
}
|
273
|
+
// if (this.mNeedToSetSide === 'left') {
|
274
|
+
// this.leftDrawer.visibility = 'visible';
|
275
|
+
// } else if (this.mNeedToSetSide === 'right') {
|
276
|
+
// this.rightDrawer.visibility = 'visible';
|
277
|
+
// } else if (this.mNeedToSetSide === 'bottom') {
|
278
|
+
// this.bottomDrawer.visibility = 'visible';
|
279
|
+
// } else if (this.mNeedToSetSide === 'top') {
|
280
|
+
// this.topDrawer.visibility = 'visible';
|
281
|
+
// }
|
282
|
+
}
|
283
|
+
}
|
284
|
+
this.updateIsPanning(state);
|
285
|
+
if (prevState === GestureState.ACTIVE) {
|
286
|
+
const side = this.mShowingSide;
|
287
|
+
// const side = this.mShowingSide || this.mNeedToSetSide;
|
288
|
+
// this.mNeedToSetSide = null;
|
289
|
+
if (!side || (this.shouldPan && !this.shouldPan(side))) {
|
290
|
+
return;
|
291
|
+
}
|
292
|
+
const { velocityX, velocityY, translationX, translationY } = extraData;
|
293
|
+
const dragToss = 0.05;
|
294
|
+
let destSnapPoint = 0;
|
295
|
+
if (side === 'left' || side === 'right') {
|
296
|
+
const viewWidth = this.mViewWidth[side];
|
297
|
+
const viewX = this.mTranslationX[side] - viewWidth;
|
298
|
+
const x = translationX - this.mPrevDeltaX;
|
299
|
+
this.mPrevDeltaX = 0;
|
300
|
+
const totalDelta = x + dragToss * velocityX;
|
301
|
+
if (side === 'left') {
|
302
|
+
if (totalDelta < -DEFAULT_TRIGGER_WIDTH) {
|
303
|
+
destSnapPoint = 0;
|
304
|
+
}
|
305
|
+
else if (totalDelta > DEFAULT_TRIGGER_WIDTH) {
|
306
|
+
destSnapPoint = viewWidth;
|
307
|
+
}
|
308
|
+
else {
|
309
|
+
const endOffsetX = viewX + totalDelta;
|
310
|
+
const progress = Math.abs(endOffsetX / viewWidth);
|
311
|
+
destSnapPoint = progress > 0.5 ? viewWidth : 0;
|
312
|
+
}
|
313
|
+
}
|
314
|
+
else if (side === 'right') {
|
315
|
+
if (-totalDelta < -DEFAULT_TRIGGER_WIDTH) {
|
316
|
+
destSnapPoint = 0;
|
317
|
+
}
|
318
|
+
else if (-totalDelta > DEFAULT_TRIGGER_WIDTH) {
|
319
|
+
destSnapPoint = viewWidth;
|
320
|
+
}
|
321
|
+
else {
|
322
|
+
const endOffsetX = viewX + totalDelta;
|
323
|
+
const progress = Math.abs(endOffsetX / viewWidth);
|
324
|
+
destSnapPoint = progress > 0.5 ? viewWidth : 0;
|
325
|
+
}
|
326
|
+
}
|
327
|
+
}
|
328
|
+
else {
|
329
|
+
const viewHeight = this.mViewHeight[side];
|
330
|
+
const viewY = this.mTranslationY[side] - viewHeight;
|
331
|
+
const y = translationY - this.mPrevDeltaY;
|
332
|
+
this.mPrevDeltaY = 0;
|
333
|
+
const totalDelta = y + dragToss * velocityY;
|
334
|
+
if (side === 'top') {
|
335
|
+
if (totalDelta < -DEFAULT_TRIGGER_HEIGHT) {
|
336
|
+
destSnapPoint = 0;
|
337
|
+
}
|
338
|
+
else if (totalDelta > DEFAULT_TRIGGER_HEIGHT) {
|
339
|
+
destSnapPoint = viewHeight;
|
340
|
+
}
|
341
|
+
else {
|
342
|
+
const endOffsetY = viewY + totalDelta;
|
343
|
+
const progress = Math.abs(endOffsetY / viewHeight);
|
344
|
+
destSnapPoint = progress > 0.5 ? viewHeight : 0;
|
345
|
+
}
|
346
|
+
}
|
347
|
+
else if (side === 'bottom') {
|
348
|
+
if (-totalDelta < -DEFAULT_TRIGGER_HEIGHT) {
|
349
|
+
destSnapPoint = 0;
|
350
|
+
}
|
351
|
+
else if (-totalDelta > DEFAULT_TRIGGER_HEIGHT) {
|
352
|
+
destSnapPoint = viewHeight;
|
353
|
+
}
|
354
|
+
else {
|
355
|
+
const endOffsetY = viewY + totalDelta;
|
356
|
+
const progress = Math.abs(endOffsetY / viewHeight);
|
357
|
+
destSnapPoint = progress > 0.5 ? viewHeight : 0;
|
358
|
+
}
|
359
|
+
}
|
360
|
+
}
|
361
|
+
this.animateToPosition(side, destSnapPoint);
|
362
|
+
}
|
363
|
+
}
|
364
|
+
isSideVisible(side) {
|
365
|
+
if (side === 'left' || side === 'right') {
|
366
|
+
return this.mViewWidth[side] - this.mTranslationX[side];
|
367
|
+
}
|
368
|
+
else {
|
369
|
+
return this.mViewHeight[side] - this.mTranslationY[side];
|
370
|
+
}
|
371
|
+
}
|
372
|
+
onGestureTouch(args) {
|
373
|
+
const data = args.data;
|
374
|
+
const { state, extraData, view } = args.data;
|
375
|
+
// const side = this.mShowingSide || this.mNeedToSetSide;
|
376
|
+
if (data.state !== GestureState.ACTIVE || this.mIsAnimating) {
|
377
|
+
return;
|
378
|
+
}
|
379
|
+
const shouldShowSide = this.getDrawerToOpen(extraData);
|
380
|
+
if (shouldShowSide && (!this.mShowingSide || (shouldShowSide !== this.mShowingSide && !this.isSideVisible(this.mShowingSide)))) {
|
381
|
+
if (this.mShowingSide) {
|
382
|
+
this[this.mShowingSide + 'Drawer'].visibility = 'hidden';
|
383
|
+
this.notify({ eventName: 'end', side: this.mShowingSide });
|
384
|
+
}
|
385
|
+
this[shouldShowSide + 'Drawer'].visibility = 'visible';
|
386
|
+
this.mShowingSide = shouldShowSide;
|
387
|
+
this.notify({ eventName: 'start', side: this.mShowingSide });
|
388
|
+
}
|
389
|
+
const side = this.mShowingSide;
|
390
|
+
if (!side || this.mIsAnimating) {
|
391
|
+
return;
|
392
|
+
}
|
393
|
+
if (side === 'left' || side === 'right') {
|
394
|
+
const deltaX = extraData.translationX;
|
395
|
+
if (this.mIsAnimating || !this.mIsPanning || deltaX === 0 || (this.shouldPan && !this.shouldPan(side))) {
|
396
|
+
this.mPrevDeltaX = deltaX;
|
397
|
+
return;
|
398
|
+
}
|
399
|
+
// if (this.mNeedToSetSide) {
|
400
|
+
// this.mShowingSide = this.mNeedToSetSide;
|
401
|
+
// this.mNeedToSetSide = null;
|
402
|
+
// }
|
403
|
+
const width = this.mViewWidth[side];
|
404
|
+
const viewX = this.mTranslationX[side] - width;
|
405
|
+
let x = deltaX - this.mPrevDeltaX;
|
406
|
+
if (side === 'left') {
|
407
|
+
x = -x;
|
408
|
+
}
|
409
|
+
const trX = this.constrainX(side, viewX + x);
|
410
|
+
this.mTranslationX[side] = width + trX;
|
411
|
+
const trData = this.computeTranslationData(side, width + trX);
|
412
|
+
if (this.backDrop) {
|
413
|
+
this.backDrop.visibility = trData.backDrop && trData.backDrop.opacity > 0 ? 'visible' : 'hidden';
|
414
|
+
}
|
415
|
+
this.applyTrData(trData, side);
|
416
|
+
this.updateIsPanning(state);
|
417
|
+
this.mPrevDeltaX = deltaX;
|
418
|
+
}
|
419
|
+
else {
|
420
|
+
const deltaY = extraData.translationY;
|
421
|
+
if (this.mIsAnimating || !this.mIsPanning || deltaY === 0 || (this.shouldPan && !this.shouldPan(side))) {
|
422
|
+
this.mPrevDeltaY = deltaY;
|
423
|
+
return;
|
424
|
+
}
|
425
|
+
// if (this.mNeedToSetSide) {
|
426
|
+
// this.mShowingSide = this.mNeedToSetSide;
|
427
|
+
// this.mNeedToSetSide = null;
|
428
|
+
// }
|
429
|
+
const height = this.mViewHeight[side];
|
430
|
+
const viewY = this.mTranslationY[side] - height;
|
431
|
+
let y = deltaY - this.mPrevDeltaY;
|
432
|
+
if (side === 'top') {
|
433
|
+
y = -y;
|
434
|
+
}
|
435
|
+
const trY = this.constrainY(side, viewY + y);
|
436
|
+
this.mTranslationY[side] = height + trY;
|
437
|
+
const trData = this.computeTranslationData(side, height + trY);
|
438
|
+
if (this.backDrop) {
|
439
|
+
this.backDrop.visibility = trData.backDrop && trData.backDrop.opacity > 0 ? 'visible' : 'hidden';
|
440
|
+
}
|
441
|
+
this.applyTrData(trData, side);
|
442
|
+
this.updateIsPanning(state);
|
443
|
+
this.mPrevDeltaY = deltaY;
|
444
|
+
}
|
445
|
+
}
|
446
|
+
[gestureEnabledProperty.setNative](value) {
|
447
|
+
if (this.panGestureHandler) {
|
448
|
+
this.panGestureHandler.enabled = value;
|
449
|
+
}
|
450
|
+
else if (value && !this.panGestureHandler) {
|
451
|
+
this.initGestures();
|
452
|
+
}
|
453
|
+
}
|
454
|
+
[backdropColorProperty.setNative](value) {
|
455
|
+
if (this.backDrop) {
|
456
|
+
this.backDrop.backgroundColor = value;
|
457
|
+
}
|
458
|
+
}
|
459
|
+
[leftDrawerModeProperty.setNative](value) {
|
460
|
+
this.onSideModeChanged('left', value);
|
461
|
+
}
|
462
|
+
[rightDrawerModeProperty.setNative](value) {
|
463
|
+
this.onSideModeChanged('right', value);
|
464
|
+
}
|
465
|
+
[topDrawerModeProperty.setNative](value) {
|
466
|
+
this.onSideModeChanged('top', value);
|
467
|
+
}
|
468
|
+
[bottomDrawerModeProperty.setNative](value) {
|
469
|
+
this.onSideModeChanged('bottom', value);
|
470
|
+
}
|
471
|
+
[gestureHandlerOptionsProperty.setNative](value) {
|
472
|
+
if (this.panGestureHandler) {
|
473
|
+
Object.assign(this.panGestureHandler, value || {});
|
474
|
+
}
|
475
|
+
}
|
476
|
+
_onMainContentChanged(oldValue, newValue) {
|
477
|
+
this._onBackDropEnabledValueChanged();
|
478
|
+
if (oldValue) {
|
479
|
+
this.removeChild(oldValue);
|
480
|
+
}
|
481
|
+
if (newValue) {
|
482
|
+
const indexBack = this.backDrop ? this.getChildIndex(this.backDrop) : 0;
|
483
|
+
const index = this.getChildIndex(newValue);
|
484
|
+
if (index !== indexBack - 1 && newValue.parent === this) {
|
485
|
+
this.removeChild(newValue);
|
486
|
+
this.insertChild(newValue, indexBack);
|
487
|
+
}
|
488
|
+
else {
|
489
|
+
this.insertChild(newValue, indexBack);
|
490
|
+
}
|
491
|
+
}
|
492
|
+
}
|
493
|
+
leftLayoutChanged(event) {
|
494
|
+
return this.onLayoutChange('left', event);
|
495
|
+
}
|
496
|
+
rightLayoutChanged(event) {
|
497
|
+
return this.onLayoutChange('right', event);
|
498
|
+
}
|
499
|
+
topLayoutChanged(event) {
|
500
|
+
return this.onLayoutChange('top', event);
|
501
|
+
}
|
502
|
+
bottomLayoutChanged(event) {
|
503
|
+
return this.onLayoutChange('bottom', event);
|
504
|
+
}
|
505
|
+
addChild(child) {
|
506
|
+
// for now we ignore this
|
507
|
+
// to make sure we add the view in the property change
|
508
|
+
// this is to make sure the view does not get "visible" too quickly
|
509
|
+
// before we apply the translation
|
510
|
+
// super.addChild(child);
|
511
|
+
}
|
512
|
+
_onDrawerContentChanged(side, oldValue, newValue) {
|
513
|
+
if (oldValue === newValue) {
|
514
|
+
return;
|
515
|
+
}
|
516
|
+
this._onBackDropEnabledValueChanged();
|
517
|
+
if (oldValue) {
|
518
|
+
oldValue.off('layoutChanged', this[side + 'LayoutChanged'], this);
|
519
|
+
this.removeChild(oldValue);
|
520
|
+
}
|
521
|
+
if (newValue) {
|
522
|
+
// newValue.columns = "auto"
|
523
|
+
if (side === 'left' || side === 'right') {
|
524
|
+
newValue.horizontalAlignment = side;
|
525
|
+
}
|
526
|
+
else {
|
527
|
+
newValue.verticalAlignment = side;
|
528
|
+
}
|
529
|
+
newValue.on('layoutChanged', this[side + 'LayoutChanged'], this);
|
530
|
+
this.onSideModeChanged(side, this.mModes[side]);
|
531
|
+
}
|
532
|
+
}
|
533
|
+
onSideModeChanged(side, mode, oldMode = this.mModes[side]) {
|
534
|
+
if ((oldMode && oldMode === mode) || (oldMode && oldMode !== 'under' && mode !== 'under')) {
|
535
|
+
return;
|
536
|
+
}
|
537
|
+
const drawer = this[side + 'Drawer'];
|
538
|
+
if (!drawer) {
|
539
|
+
return;
|
540
|
+
}
|
541
|
+
const indexBack = this.backDrop ? this.getChildIndex(this.backDrop) : 0;
|
542
|
+
const index = this.getChildIndex(drawer);
|
543
|
+
drawer.visibility = this.mShowingSide === side ? 'visible' : 'hidden';
|
544
|
+
if (mode === 'under') {
|
545
|
+
if (index > indexBack - 1 && drawer.parent === this) {
|
546
|
+
drawer.reusable = true;
|
547
|
+
this.removeChild(drawer);
|
548
|
+
this.insertChild(drawer, Math.max(indexBack - 1, 0));
|
549
|
+
}
|
550
|
+
else if (drawer.parent !== this) {
|
551
|
+
// initial addition
|
552
|
+
// this.backDrop.visibility = trData.backDrop && trData.backDrop.opacity > 0 ? 'visible' : 'hidden';
|
553
|
+
this.insertChild(drawer, 0);
|
554
|
+
}
|
555
|
+
}
|
556
|
+
else {
|
557
|
+
if (index <= indexBack && drawer.parent === this) {
|
558
|
+
drawer.reusable = true;
|
559
|
+
this.removeChild(drawer);
|
560
|
+
this.insertChild(drawer, indexBack + 1);
|
561
|
+
}
|
562
|
+
else if (drawer.parent !== this) {
|
563
|
+
// initial addition
|
564
|
+
this.insertChild(drawer, indexBack + 1);
|
565
|
+
}
|
566
|
+
}
|
567
|
+
}
|
568
|
+
computeTranslationData(side, value) {
|
569
|
+
if (side === 'left' || side === 'right') {
|
570
|
+
const width = this.mViewWidth[side];
|
571
|
+
const delta = Math.max(width - value, 0);
|
572
|
+
const progress = delta / width;
|
573
|
+
if (this.translationFunction) {
|
574
|
+
return this.translationFunction(side, width, value, delta, progress, this);
|
575
|
+
}
|
576
|
+
if (this.mModes[side] === 'under') {
|
577
|
+
return {
|
578
|
+
mainContent: {
|
579
|
+
translateX: side === 'right' ? -delta : delta
|
580
|
+
},
|
581
|
+
[side + 'Drawer']: {
|
582
|
+
translateX: 0
|
583
|
+
},
|
584
|
+
backDrop: {
|
585
|
+
translateX: side === 'right' ? -delta : delta,
|
586
|
+
opacity: progress
|
587
|
+
}
|
588
|
+
};
|
589
|
+
}
|
590
|
+
else {
|
591
|
+
return {
|
592
|
+
mainContent: {
|
593
|
+
// translateX: 0
|
594
|
+
},
|
595
|
+
[side + 'Drawer']: {
|
596
|
+
translateX: side === 'left' ? -value : value
|
597
|
+
},
|
598
|
+
backDrop: {
|
599
|
+
// translateX: 0,
|
600
|
+
opacity: progress
|
601
|
+
}
|
602
|
+
};
|
603
|
+
}
|
604
|
+
}
|
605
|
+
else {
|
606
|
+
const height = this.mViewHeight[side];
|
607
|
+
const delta = Math.max(height - value, 0);
|
608
|
+
const progress = delta / height;
|
609
|
+
if (this.translationFunction) {
|
610
|
+
return this.translationFunction(side, height, value, delta, progress, this);
|
611
|
+
}
|
612
|
+
if (this.mModes[side] === 'under') {
|
613
|
+
return {
|
614
|
+
mainContent: {
|
615
|
+
translateY: side === 'bottom' ? -delta : delta
|
616
|
+
},
|
617
|
+
[side + 'Drawer']: {
|
618
|
+
translateY: 0
|
619
|
+
},
|
620
|
+
backDrop: {
|
621
|
+
translateY: side === 'bottom' ? -delta : delta,
|
622
|
+
opacity: progress
|
623
|
+
}
|
624
|
+
};
|
625
|
+
}
|
626
|
+
else {
|
627
|
+
return {
|
628
|
+
mainContent: {
|
629
|
+
translateY: 0
|
630
|
+
},
|
631
|
+
[side + 'Drawer']: {
|
632
|
+
translateY: side === 'top' ? -value : value
|
633
|
+
},
|
634
|
+
backDrop: {
|
635
|
+
translateY: 0,
|
636
|
+
opacity: progress
|
637
|
+
}
|
638
|
+
};
|
639
|
+
}
|
640
|
+
}
|
641
|
+
}
|
642
|
+
onLayoutChange(side, event) {
|
643
|
+
const contentView = event.object;
|
644
|
+
let data;
|
645
|
+
let safeAreaOffset = 0;
|
646
|
+
let changed = false;
|
647
|
+
const viewWidth = Utils.layout.toDeviceIndependentPixels(contentView.getMeasuredWidth());
|
648
|
+
const viewHeight = Utils.layout.toDeviceIndependentPixels(contentView.getMeasuredHeight());
|
649
|
+
if (side === 'left' || side === 'right') {
|
650
|
+
if (__IOS__ && !this.iosIgnoreSafeArea) {
|
651
|
+
const deviceOrientation = UIDevice.currentDevice.orientation;
|
652
|
+
if (deviceOrientation === 3 /* UIDeviceOrientation.LandscapeLeft */) {
|
653
|
+
safeAreaOffset = Application.ios.window.safeAreaInsets.left;
|
654
|
+
}
|
655
|
+
else if (deviceOrientation === 4 /* UIDeviceOrientation.LandscapeRight */) {
|
656
|
+
safeAreaOffset = Application.ios.window.safeAreaInsets.right;
|
657
|
+
}
|
658
|
+
}
|
659
|
+
const width = Math.ceil(Utils.layout.toDeviceIndependentPixels(contentView.getMeasuredWidth()) + safeAreaOffset);
|
660
|
+
const firstSet = this.mViewWidth[side] === undefined;
|
661
|
+
changed = width !== this.mViewWidth[side];
|
662
|
+
this.mViewWidth[side] = width;
|
663
|
+
if (firstSet) {
|
664
|
+
const offset = this.mShowingSide === side ? 0 : width;
|
665
|
+
data = this.computeTranslationData(side, offset);
|
666
|
+
const shown = this.mViewWidth[side] - offset;
|
667
|
+
this.mTranslationX[side] = width - shown;
|
668
|
+
}
|
669
|
+
else {
|
670
|
+
this.mTranslationX[side] = this.mTranslationX[side] === 0 ? 0 : width;
|
671
|
+
}
|
672
|
+
}
|
673
|
+
else {
|
674
|
+
safeAreaOffset = __IOS__ && !this.iosIgnoreSafeArea && Application.ios.window.safeAreaInsets ? Application.ios.window.safeAreaInsets.bottom : 0;
|
675
|
+
const height = Math.ceil(viewHeight + safeAreaOffset);
|
676
|
+
const firstSet = this.mViewHeight[side] === undefined;
|
677
|
+
changed = height !== this.mViewHeight[side];
|
678
|
+
this.mViewHeight[side] = height;
|
679
|
+
if (firstSet) {
|
680
|
+
const offset = this.mShowingSide === side ? 0 : height;
|
681
|
+
data = this.computeTranslationData(side, offset);
|
682
|
+
const shown = this.mViewHeight[side] - offset;
|
683
|
+
this.mTranslationY[side] = height - shown;
|
684
|
+
}
|
685
|
+
else {
|
686
|
+
this.mTranslationY[side] = this.mTranslationY[side] === 0 ? 0 : height;
|
687
|
+
}
|
688
|
+
}
|
689
|
+
if (changed && data) {
|
690
|
+
// delay applyTrData or it will create a layout issue on iOS
|
691
|
+
setTimeout(() => {
|
692
|
+
this.applyTrData(data, side);
|
693
|
+
if (this.backDrop) {
|
694
|
+
this.backDrop.visibility = data.backDrop && data.backDrop.opacity > 0 ? 'visible' : 'hidden';
|
695
|
+
}
|
696
|
+
}, 0);
|
697
|
+
}
|
698
|
+
}
|
699
|
+
forceEnsureSize(side) {
|
700
|
+
const contentView = this[side + 'Drawer'];
|
701
|
+
let data;
|
702
|
+
let safeAreaOffset = 0;
|
703
|
+
if (side === 'left' || side === 'right') {
|
704
|
+
if (__IOS__ && !this.iosIgnoreSafeArea) {
|
705
|
+
const deviceOrientation = UIDevice.currentDevice.orientation;
|
706
|
+
if (deviceOrientation === 3) {
|
707
|
+
safeAreaOffset = Application.ios.window.safeAreaInsets.left;
|
708
|
+
}
|
709
|
+
else if (deviceOrientation === 4) {
|
710
|
+
safeAreaOffset = Application.ios.window.safeAreaInsets.right;
|
711
|
+
}
|
712
|
+
}
|
713
|
+
const width = Math.ceil(Utils.layout.toDeviceIndependentPixels(contentView.getMeasuredWidth()) + safeAreaOffset);
|
714
|
+
this.mViewWidth[side] = width;
|
715
|
+
}
|
716
|
+
else {
|
717
|
+
safeAreaOffset = __IOS__ && !this.iosIgnoreSafeArea && Application.ios.window.safeAreaInsets ? Application.ios.window.safeAreaInsets.bottom : 0;
|
718
|
+
const height = Math.ceil(Utils.layout.toDeviceIndependentPixels(contentView.getMeasuredHeight()) + safeAreaOffset);
|
719
|
+
this.mViewHeight[side] = height;
|
720
|
+
}
|
721
|
+
}
|
722
|
+
onTapGestureState(args) {
|
723
|
+
const { state } = args.data;
|
724
|
+
if (state === GestureState.BEGAN) {
|
725
|
+
this.close();
|
726
|
+
}
|
727
|
+
}
|
728
|
+
updateIsPanning(state) {
|
729
|
+
this.mIsPanning = state === GestureState.ACTIVE || state === GestureState.BEGAN;
|
730
|
+
}
|
731
|
+
applyTrData(trData, side) {
|
732
|
+
const cache = this.mViewByIdCache;
|
733
|
+
Object.keys(trData).forEach((k) => {
|
734
|
+
let target = this[k] || cache[k];
|
735
|
+
if (!target) {
|
736
|
+
target = this.getViewById(k);
|
737
|
+
if (target) {
|
738
|
+
cache[k] = target;
|
739
|
+
}
|
740
|
+
}
|
741
|
+
if (target) {
|
742
|
+
Object.assign(target, trData[k]);
|
743
|
+
}
|
744
|
+
});
|
745
|
+
}
|
746
|
+
constrainX(side, x) {
|
747
|
+
const width = this.mViewWidth[side];
|
748
|
+
if (x > 0) {
|
749
|
+
return 0;
|
750
|
+
}
|
751
|
+
else if (x < -width) {
|
752
|
+
return -width;
|
753
|
+
}
|
754
|
+
return x;
|
755
|
+
}
|
756
|
+
constrainY(side, y) {
|
757
|
+
const height = this.mViewHeight[side];
|
758
|
+
if (y > 0) {
|
759
|
+
return 0;
|
760
|
+
}
|
761
|
+
else if (y < -height) {
|
762
|
+
return -height;
|
763
|
+
}
|
764
|
+
return y;
|
765
|
+
}
|
766
|
+
async animateToPosition(side, position, duration = this.openAnimationDuration) {
|
767
|
+
if (this.mShowingSide && side !== this.mShowingSide) {
|
768
|
+
this.animateToPosition(this.mShowingSide, 0, duration);
|
769
|
+
}
|
770
|
+
const shouldSendEvent = side !== this.mShowingSide || (this.mShowingSide === side && position === 0);
|
771
|
+
let trData;
|
772
|
+
if (side === 'left' || side === 'right') {
|
773
|
+
const width = this.mViewWidth[side];
|
774
|
+
trData = this.computeTranslationData(side, width - position);
|
775
|
+
this.mTranslationX[side] = width - position;
|
776
|
+
}
|
777
|
+
else {
|
778
|
+
const height = this.mViewHeight[side];
|
779
|
+
trData = this.computeTranslationData(side, height - position);
|
780
|
+
this.mTranslationY[side] = height - position;
|
781
|
+
}
|
782
|
+
if (position !== 0) {
|
783
|
+
this.mShowingSide = side;
|
784
|
+
const drawer = this[side + 'Drawer'];
|
785
|
+
if (drawer) {
|
786
|
+
drawer.visibility = 'visible';
|
787
|
+
}
|
788
|
+
if (this.backDrop && trData.backDrop && trData.backDrop.opacity > 0 && this.backDrop.visibility !== 'visible') {
|
789
|
+
this.backDrop.opacity = 0;
|
790
|
+
this.backDrop.visibility = 'visible';
|
791
|
+
}
|
792
|
+
}
|
793
|
+
else {
|
794
|
+
this.mShowingSide = null;
|
795
|
+
}
|
796
|
+
// TODO: custom animation curve + apply curve on gesture
|
797
|
+
const params = Object.keys(trData)
|
798
|
+
.map((k) => this[k] &&
|
799
|
+
Object.assign({
|
800
|
+
target: this[k],
|
801
|
+
curve: CoreTypes.AnimationCurve.easeInOut,
|
802
|
+
duration
|
803
|
+
}, duration ? transformAnimationValues(trData[k]) : trData[k]))
|
804
|
+
.filter((a) => !!a);
|
805
|
+
try {
|
806
|
+
if (duration) {
|
807
|
+
if (this.animationFunction) {
|
808
|
+
await this.animationFunction(side, duration, trData, params, this);
|
809
|
+
}
|
810
|
+
await new Animation(params).play();
|
811
|
+
}
|
812
|
+
}
|
813
|
+
catch (err) {
|
814
|
+
console.error('animateToPosition', this, err, err.stack);
|
815
|
+
throw err;
|
816
|
+
}
|
817
|
+
finally {
|
818
|
+
// apply tr data to prevent hickups on iOS
|
819
|
+
// and handle animation cancelled errors
|
820
|
+
if ((position !== 0 && this.mShowingSide === side) || (position === 0 && !this.mShowingSide)) {
|
821
|
+
this.applyTrData(trData, side);
|
822
|
+
if (position !== 0) {
|
823
|
+
// if (trData.backDrop) {
|
824
|
+
// this.backDrop.opacity = 1;
|
825
|
+
// }
|
826
|
+
}
|
827
|
+
else {
|
828
|
+
const drawer = this[side + 'Drawer'];
|
829
|
+
if (drawer) {
|
830
|
+
drawer.visibility = 'hidden';
|
831
|
+
}
|
832
|
+
if (this.backDrop && trData.backDrop) {
|
833
|
+
this.backDrop.visibility = 'hidden';
|
834
|
+
}
|
835
|
+
}
|
836
|
+
}
|
837
|
+
if (shouldSendEvent) {
|
838
|
+
if (position === 0) {
|
839
|
+
this.notify({ eventName: 'close', side, duration });
|
840
|
+
}
|
841
|
+
else {
|
842
|
+
this.notify({ eventName: 'open', side, duration });
|
843
|
+
}
|
844
|
+
}
|
845
|
+
}
|
846
|
+
}
|
847
|
+
isSideOpened() {
|
848
|
+
return !!this.mShowingSide;
|
849
|
+
}
|
850
|
+
isOpened(side) {
|
851
|
+
if (side) {
|
852
|
+
return this.mShowingSide === side;
|
853
|
+
}
|
854
|
+
return !!this.mShowingSide;
|
855
|
+
}
|
856
|
+
getDefaultSide() {
|
857
|
+
if (this.leftDrawer) {
|
858
|
+
return 'left';
|
859
|
+
}
|
860
|
+
else if (this.rightDrawer) {
|
861
|
+
return 'right';
|
862
|
+
}
|
863
|
+
else if (this.bottomDrawer) {
|
864
|
+
return 'bottom';
|
865
|
+
}
|
866
|
+
else if (this.topDrawer) {
|
867
|
+
return 'top';
|
868
|
+
}
|
869
|
+
return null;
|
870
|
+
}
|
871
|
+
async toggle(side) {
|
872
|
+
side = this.getActualSide(side) || this.getDefaultSide();
|
873
|
+
if (!side) {
|
874
|
+
return;
|
875
|
+
}
|
876
|
+
if (this.isOpened(side)) {
|
877
|
+
this.close(side);
|
878
|
+
}
|
879
|
+
else {
|
880
|
+
this.open(side);
|
881
|
+
}
|
882
|
+
}
|
883
|
+
async open(side, duration = this.openAnimationDuration) {
|
884
|
+
side = this.getActualSide(side) || this.getDefaultSide();
|
885
|
+
if (!side) {
|
886
|
+
return;
|
887
|
+
}
|
888
|
+
if (this.mShowingSide && this.mShowingSide !== side) {
|
889
|
+
this.close();
|
890
|
+
}
|
891
|
+
if (!this.isOpened(side)) {
|
892
|
+
this.forceEnsureSize(side);
|
893
|
+
}
|
894
|
+
if (side === 'left' || side === 'right') {
|
895
|
+
this.animateToPosition(side, this.mViewWidth[side], duration);
|
896
|
+
}
|
897
|
+
else {
|
898
|
+
this.animateToPosition(side, this.mViewHeight[side], duration);
|
899
|
+
}
|
900
|
+
}
|
901
|
+
async close(side, duration = this.closeAnimationDuration) {
|
902
|
+
side = this.getActualSide(side) || this.mShowingSide;
|
903
|
+
if (!side) {
|
904
|
+
return;
|
905
|
+
}
|
906
|
+
// this.mShowingSide = null;
|
907
|
+
return this.animateToPosition(side, 0, duration);
|
908
|
+
}
|
909
|
+
};
|
910
|
+
Drawer = __decorate([
|
911
|
+
CSSType('Drawer')
|
912
|
+
], Drawer);
|
913
|
+
export { Drawer };
|
914
|
+
export const mainContentProperty = new Property({
|
915
|
+
name: 'mainContent',
|
916
|
+
defaultValue: undefined,
|
917
|
+
valueChanged: (target, oldValue, newValue) => {
|
918
|
+
target._onMainContentChanged(oldValue, newValue);
|
919
|
+
}
|
920
|
+
});
|
921
|
+
mainContentProperty.register(Drawer);
|
922
|
+
backdropColorProperty.register(Drawer);
|
923
|
+
leftDrawerContentProperty.register(Drawer);
|
924
|
+
rightDrawerContentProperty.register(Drawer);
|
925
|
+
topDrawerContentProperty.register(Drawer);
|
926
|
+
bottomDrawerContentProperty.register(Drawer);
|
927
|
+
gestureEnabledProperty.register(Drawer);
|
928
|
+
leftDrawerModeProperty.register(Drawer);
|
929
|
+
rightDrawerModeProperty.register(Drawer);
|
930
|
+
bottomDrawerModeProperty.register(Drawer);
|
931
|
+
topDrawerModeProperty.register(Drawer);
|
932
|
+
translationFunctionProperty.register(Drawer);
|
933
|
+
animationFunctionProperty.register(Drawer);
|
934
|
+
backDropEnabledProperty.register(Drawer);
|
935
|
+
startingSideProperty.register(Drawer);
|
936
|
+
gestureHandlerOptionsProperty.register(Drawer);
|
937
|
+
export function install() {
|
938
|
+
console.log('installing drawer gestures');
|
939
|
+
installGestures();
|
940
|
+
}
|
941
|
+
//# sourceMappingURL=index.js.map
|