@nativescript-community/ui-drawer 0.1.19 → 0.1.21

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/README.md CHANGED
@@ -55,6 +55,8 @@
55
55
  * [Examples:](#examples-2)
56
56
  * [Usage in Vue](#usage-in-vue)
57
57
  * [Examples:](#examples-3)
58
+ * [Usage in Vue3](#usage-in-vue3)
59
+ * [Examples:](#examples-4)
58
60
  * [Demos and Development](#demos-and-development)
59
61
  * [Repo Setup](#repo-setup)
60
62
  * [Build](#build)
@@ -221,6 +223,26 @@ Vue.use(DrawerPlugin);
221
223
  - An example of drawers on all sides: left, right, top, bottom.
222
224
 
223
225
 
226
+ [](#usage-in-vue3)
227
+
228
+ ## Usage in Vue3
229
+
230
+ Register the plugin in your `app.js`.
231
+
232
+ ```typescript
233
+ import DrawerPlugin from '@nativescript-community/ui-drawer/vue3'
234
+
235
+ app.use(DrawerPlugin);
236
+ ```
237
+
238
+ ### Examples:
239
+
240
+ - [Basic Drawer](demo-snippets/vue3/BasicDrawer.vue)
241
+ - A basic sliding drawer.
242
+ - [All Sides](demo-snippets/vue3/AllSides.vue)
243
+ - An example of drawers on all sides: left, right, top, bottom.
244
+
245
+
224
246
  [](#demos-and-development)
225
247
 
226
248
  ## Demos and Development
@@ -317,4 +339,4 @@ One easy solution is t modify `~/.gitconfig` and add
317
339
 
318
340
  ## Questions
319
341
 
320
- If you have any questions/issues/comments please feel free to create an issue or start a conversation in the [NativeScript Community Discord](https://nativescript.org/discord).
342
+ If you have any questions/issues/comments please feel free to create an issue or start a conversation in the [NativeScript Community Discord](https://nativescript.org/discord).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nativescript-community/ui-drawer",
3
- "version": "0.1.19",
3
+ "version": "0.1.21",
4
4
  "description": "Easily add a side drawer (side menu) to your projects.",
5
5
  "main": "./index",
6
6
  "sideEffects": false,
@@ -54,5 +54,5 @@
54
54
  "dependencies": {
55
55
  "@nativescript-community/gesturehandler": "^2.0.8"
56
56
  },
57
- "gitHead": "5f59c2df55ea1a8a728bd5c4d5f254adf88f3736"
57
+ "gitHead": "dafbf3db2e1cf20cf500575ff34b1d700430c2f2"
58
58
  }
@@ -1 +0,0 @@
1
- export * from './module';
@@ -1,84 +0,0 @@
1
- import { ElementRef, EmbeddedViewRef, TemplateRef, ViewContainerRef } from '@angular/core';
2
- import { Drawer } from '@nativescript-community/ui-drawer';
3
- import * as i0 from "@angular/core";
4
- export interface ItemEventArgs {
5
- object: any;
6
- view: EmbeddedViewRef<any>;
7
- returnValue?: boolean;
8
- }
9
- /**
10
- * This is the SideDrawer component. It separates your mobile app's screen
11
- * into a main part and a menu part whereby the menu part is shown upon a swipe
12
- * gesture using a transition effect.
13
- */
14
- export declare class DrawerComponent {
15
- elementRef: ElementRef;
16
- private viewContainer;
17
- drawer: Drawer;
18
- mainTemplate: TemplateRef<ElementRef>;
19
- drawerTemplate: TemplateRef<ElementRef>;
20
- private _gestureEnabled;
21
- constructor(elementRef: ElementRef, viewContainer: ViewContainerRef);
22
- get nativeElement(): Drawer;
23
- set gestureEnabled(value: boolean);
24
- private updateGestureEnabled;
25
- static ɵfac: i0.ɵɵFactoryDeclaration<DrawerComponent, never>;
26
- static ɵcmp: i0.ɵɵComponentDeclaration<DrawerComponent, "Drawer", never, {}, {}, never, ["*"], false, never>;
27
- }
28
- /**
29
- * Directive identifying the left drawer
30
- */
31
- export declare class LeftDrawerDirective {
32
- private _elementRef;
33
- constructor(_elementRef: ElementRef);
34
- static ɵfac: i0.ɵɵFactoryDeclaration<LeftDrawerDirective, never>;
35
- static ɵdir: i0.ɵɵDirectiveDeclaration<LeftDrawerDirective, "[leftDrawer]", never, {}, {}, never, never, false, never>;
36
- }
37
- /**
38
- * Directive identifying the right drawer
39
- */
40
- export declare class RightDrawerDirective {
41
- private _elementRef;
42
- constructor(_elementRef: ElementRef);
43
- static ɵfac: i0.ɵɵFactoryDeclaration<RightDrawerDirective, never>;
44
- static ɵdir: i0.ɵɵDirectiveDeclaration<RightDrawerDirective, "[rightDrawer]", never, {}, {}, never, never, false, never>;
45
- }
46
- /**
47
- * Directive identifying the right drawer
48
- */
49
- export declare class TopDrawerDirective {
50
- private _elementRef;
51
- constructor(_elementRef: ElementRef);
52
- static ɵfac: i0.ɵɵFactoryDeclaration<TopDrawerDirective, never>;
53
- static ɵdir: i0.ɵɵDirectiveDeclaration<TopDrawerDirective, "[topDrawer]", never, {}, {}, never, never, false, never>;
54
- }
55
- /**
56
- * Directive identifying the right drawer
57
- */
58
- export declare class BottomDrawerDirective {
59
- private _elementRef;
60
- constructor(_elementRef: ElementRef);
61
- static ɵfac: i0.ɵɵFactoryDeclaration<BottomDrawerDirective, never>;
62
- static ɵdir: i0.ɵɵDirectiveDeclaration<BottomDrawerDirective, "[bottomDrawer]", never, {}, {}, never, never, false, never>;
63
- }
64
- /**
65
- * Directive identifying the main content.
66
- */
67
- export declare class MainContentDirective {
68
- private _elementRef;
69
- constructor(_elementRef: ElementRef);
70
- static ɵfac: i0.ɵɵFactoryDeclaration<MainContentDirective, never>;
71
- static ɵdir: i0.ɵɵDirectiveDeclaration<MainContentDirective, "[mainContent]", never, {}, {}, never, never, false, never>;
72
- }
73
- /**
74
- * Directives identifying the Drawer.
75
- */
76
- export declare const SIDEDRAWER_DIRECTIVES: (typeof LeftDrawerDirective | typeof RightDrawerDirective | typeof TopDrawerDirective | typeof BottomDrawerDirective | typeof MainContentDirective)[];
77
- /**
78
- * NgModule containing all of the RadSideDrawer directives.
79
- */
80
- export declare class DrawerModule {
81
- static ɵfac: i0.ɵɵFactoryDeclaration<DrawerModule, never>;
82
- static ɵmod: i0.ɵɵNgModuleDeclaration<DrawerModule, [typeof DrawerComponent, typeof LeftDrawerDirective, typeof RightDrawerDirective, typeof TopDrawerDirective, typeof BottomDrawerDirective, typeof MainContentDirective], never, [typeof DrawerComponent, typeof LeftDrawerDirective, typeof RightDrawerDirective, typeof TopDrawerDirective, typeof BottomDrawerDirective, typeof MainContentDirective]>;
83
- static ɵinj: i0.ɵɵInjectorDeclaration<DrawerModule>;
84
- }
package/index.d.ts DELETED
@@ -1,183 +0,0 @@
1
- import { GestureState, GestureStateEventData, GestureTouchEventData, PanGestureHandler } from '@nativescript-community/gesturehandler';
2
- import { AnimationDefinition, Color, EventData, GridLayout, Property, View } from '@nativescript/core';
3
- export declare const PAN_GESTURE_TAG = 12431;
4
- export declare type Side = 'left' | 'right';
5
- export declare type VerticalSide = 'bottom' | 'top';
6
- export declare type Mode = 'under' | 'slide';
7
- export interface DrawerEventData extends EventData {
8
- side: Side;
9
- duration?: number;
10
- }
11
- export declare const leftDrawerContentProperty: Property<Drawer, View>;
12
- export declare const rightDrawerContentProperty: Property<Drawer, View>;
13
- export declare const topDrawerContentProperty: Property<Drawer, View>;
14
- export declare const bottomDrawerContentProperty: Property<Drawer, View>;
15
- export declare const gestureEnabledProperty: Property<Drawer, boolean>;
16
- export declare const backdropColorProperty: Property<Drawer, Color>;
17
- export declare const leftDrawerModeProperty: Property<Drawer, Mode>;
18
- export declare const rightDrawerModeProperty: Property<Drawer, Mode>;
19
- export declare const topDrawerModeProperty: Property<Drawer, Mode>;
20
- export declare const bottomDrawerModeProperty: Property<Drawer, Mode>;
21
- export declare const translationFunctionProperty: Property<Drawer, TranslationFunctionType>;
22
- export declare const animationFunctionProperty: Property<Drawer, AnimationFunctionType>;
23
- export declare const backDropEnabledProperty: Property<Drawer, boolean>;
24
- export declare const startingSideProperty: Property<Drawer, Side | VerticalSide | "none">;
25
- export declare const gestureHandlerOptionsProperty: Property<import("@nativescript/core").ViewBase, unknown>;
26
- export interface TrData {
27
- [k: string]: AnimationDefinition;
28
- leftDrawer?: AnimationDefinition;
29
- rightDrawer?: AnimationDefinition;
30
- bottomDrawer?: AnimationDefinition;
31
- topDrawer?: AnimationDefinition;
32
- backDrop?: AnimationDefinition;
33
- mainContent?: AnimationDefinition;
34
- }
35
- export declare type TranslationFunctionType = (side: Side | VerticalSide, width: number, value: number, delta: number, progress: number, drawer: Drawer) => TrData;
36
- export declare type AnimationFunctionType = (side: Side | VerticalSide, duration: number, trData: TrData, animationParams: AnimationDefinition[], drawer: Drawer) => Promise<void>;
37
- export declare class Drawer extends GridLayout {
38
- leftDrawer?: View;
39
- rightDrawer?: View;
40
- bottomDrawer?: View;
41
- topDrawer?: View;
42
- mainContent: View;
43
- backDrop: View;
44
- leftDrawerMode: any;
45
- rightDrawerMode: any;
46
- bottomDrawerMode: any;
47
- topDrawerMode: any;
48
- gestureTag: number;
49
- gestureMinDist: number;
50
- gestureHandlerOptions: any;
51
- waitFor: any[];
52
- simultaneousHandlers: any[];
53
- shouldStartSheetDragging?: (side: Side | VerticalSide) => boolean;
54
- shouldPan?: (side: Side | VerticalSide) => boolean;
55
- leftSwipeDistance: number;
56
- rightSwipeDistance: number;
57
- bottomSwipeDistance: number;
58
- topSwipeDistance: number;
59
- backdropColor: Color;
60
- leftOpenedDrawerAllowDraging: boolean;
61
- rightOpenedDrawerAllowDraging: boolean;
62
- bottomOpenedDrawerAllowDraging: boolean;
63
- topOpenedDrawerAllowDraging: boolean;
64
- leftClosedDrawerAllowDraging: boolean;
65
- rightClosedDrawerAllowDraging: boolean;
66
- bottomClosedDrawerAllowDraging: boolean;
67
- topClosedDrawerAllowDraging: boolean;
68
- panGestureHandler: PanGestureHandler;
69
- gestureEnabled: boolean;
70
- backdropTapGestureEnabled: boolean;
71
- startingSide: Side | VerticalSide;
72
- openAnimationDuration: number;
73
- closeAnimationDuration: number;
74
- private mIsPanning;
75
- private mIsAnimating;
76
- private mPrevDeltaX;
77
- private mPrevDeltaY;
78
- private mViewWidth;
79
- private mViewHeight;
80
- private mTranslationX;
81
- private mTranslationY;
82
- private mShowingSide;
83
- private mModes;
84
- translationFunction?: TranslationFunctionType;
85
- animationFunction?: AnimationFunctionType;
86
- backDropEnabled: boolean;
87
- constructor();
88
- _onBackDropEnabledValueChanged(): void;
89
- getActualSide(side: Side | VerticalSide): Side | VerticalSide;
90
- updateStartingSide(side: any): void;
91
- onBackdropTap(): void;
92
- initGestures(): void;
93
- initNativeView(): void;
94
- disposeNativeView(): void;
95
- shouldStartSheetDraggingInternal(side: Side | VerticalSide): any;
96
- shouldStartGesture(data: any): any;
97
- getDrawerToOpen(extraData: any): "left" | "right" | "bottom" | "top";
98
- onGestureState(args: GestureStateEventData): void;
99
- isSideVisible(side: Side | VerticalSide): number;
100
- onGestureTouch(args: GestureTouchEventData): void;
101
- _onMainContentChanged(oldValue: View, newValue: View): void;
102
- leftLayoutChanged(event: EventData): void;
103
- rightLayoutChanged(event: EventData): void;
104
- topLayoutChanged(event: EventData): void;
105
- bottomLayoutChanged(event: EventData): void;
106
- addChild(child: any): void;
107
- _onDrawerContentChanged(side: Side | VerticalSide, oldValue: View, newValue: View): void;
108
- onSideModeChanged(side: Side | VerticalSide, mode: Mode, oldMode?: Mode): void;
109
- computeTranslationData(side: any, value: any): TrData | {
110
- [x: string]: {
111
- translateX: number;
112
- opacity?: undefined;
113
- } | {
114
- translateX: number;
115
- opacity: number;
116
- };
117
- mainContent: {
118
- translateX: number;
119
- translateY?: undefined;
120
- };
121
- backDrop: {
122
- translateX: number;
123
- opacity: number;
124
- translateY?: undefined;
125
- };
126
- } | {
127
- [x: string]: {
128
- translateX?: undefined;
129
- opacity?: undefined;
130
- } | {
131
- translateX: any;
132
- opacity?: undefined;
133
- } | {
134
- opacity: number;
135
- translateX?: undefined;
136
- };
137
- mainContent: {
138
- translateX?: undefined;
139
- translateY?: undefined;
140
- };
141
- backDrop: {
142
- opacity: number;
143
- translateX?: undefined;
144
- translateY?: undefined;
145
- };
146
- } | {
147
- [x: string]: {
148
- translateY: any;
149
- opacity?: undefined;
150
- } | {
151
- translateY: number;
152
- opacity: number;
153
- };
154
- mainContent: {
155
- translateY: number;
156
- translateX?: undefined;
157
- };
158
- backDrop: {
159
- translateY: number;
160
- opacity: number;
161
- translateX?: undefined;
162
- };
163
- };
164
- onLayoutChange(side: Side | VerticalSide, event: EventData): void;
165
- forceEnsureSize(side: Side | VerticalSide): void;
166
- onTapGestureState(args: GestureStateEventData): void;
167
- updateIsPanning(state: GestureState): void;
168
- mViewByIdCache: {};
169
- applyTrData(trData: {
170
- [k: string]: any;
171
- }, side: Side | VerticalSide): void;
172
- constrainX(side: any, x: any): any;
173
- constrainY(side: any, y: any): any;
174
- animateToPosition(side: Side | VerticalSide, position: any, duration?: number): Promise<void>;
175
- isSideOpened(): boolean;
176
- isOpened(side?: Side | VerticalSide): boolean;
177
- getDefaultSide(): "left" | "right" | "bottom" | "top";
178
- toggle(side?: Side | VerticalSide): Promise<void>;
179
- open(side?: Side | VerticalSide, duration?: number): Promise<void>;
180
- close(side?: Side | VerticalSide, duration?: number): Promise<void>;
181
- }
182
- export declare const mainContentProperty: Property<Drawer, View>;
183
- export declare function install(): void;