{"version":3,"file":"nativescript-ui-sidedrawer-angular.mjs","sources":["../../../../../packages/ui-sidedrawer/angular/index.ts","../../../../../packages/ui-sidedrawer/angular/nativescript-ui-sidedrawer-angular.ts"],"sourcesContent":["import { Component, Input, ElementRef, Inject, TemplateRef, EmbeddedViewRef, ViewContainerRef, Directive, EventEmitter, Output, NgModule } from '@angular/core';\nimport { NgView, ViewClassMeta, registerElement } from '@nativescript/angular';\nimport { RadSideDrawer } from 'nativescript-ui-sidedrawer';\n\nconst TKDRAWERCONTENT: string = 'TKDrawerContent';\nconst TKMAINCONTENT: string = 'TKMainContent';\n\nexport interface ItemEventArgs {\n\tobject: any;\n\tview: EmbeddedViewRef<any>;\n\treturnValue?: boolean;\n}\n\n/**\n * This is the SideDrawer component. It separates your mobile app's screen\n * into a main part and a menu part whereby the menu part is shown upon a swipe\n * gesture using a transition effect.\n */\n@Component({\n\tselector: 'RadSideDrawer',\n\ttemplate: '<ng-content></ng-content>'\n})\nexport class RadSideDrawerComponent {\n\tpublic sideDrawer: RadSideDrawer;\n\tpublic mainTemplate: TemplateRef<ElementRef>;\n\tpublic drawerTemplate: TemplateRef<ElementRef>;\n\n\tprivate _drawerContentSize: number;\n\tprivate _gesturesEnabled: boolean;\n\tprivate _drawerTransition: string;\n\tprivate _drawerLocation: string;\n\n\t@Output() public drawerOpening: EventEmitter<any> = new EventEmitter();\n\t@Output() public drawerOpen: EventEmitter<any> = new EventEmitter();\n\t@Output() public drawerClosing: EventEmitter<any> = new EventEmitter();\n\t@Output() public drawerClosed: EventEmitter<any> = new EventEmitter();\n\n\t/**\n\t * [Deprecated: Please use the 'drawerTransition' property instead].\n\t */\n\t@Input()\n\tset transition(transition: any) {\n\t\tthis.sideDrawer.drawerTransition = transition;\n\t}\n\n\tconstructor(@Inject(ElementRef) public elementRef: ElementRef, @Inject(ViewContainerRef) private viewContainer: ViewContainerRef) {\n\t\tthis.sideDrawer = this.elementRef.nativeElement;\n\t}\n\n\tpublic get nativeElement(): RadSideDrawer {\n\t\treturn this.sideDrawer;\n\t}\n\n\t/**\n\t * Defines either the width or the height\n\t * of the menu pane depending on the location of the SideDrawer.\n\t * Top or Bottom - height, Right or Left - width.\n\t */\n\tset drawerContentSize(value: number) {\n\t\tthis._drawerContentSize = value;\n\t\tthis.updateContentSize();\n\t}\n\n\tset gesturesEnabled(value: boolean) {\n\t\tthis._gesturesEnabled = value;\n\t\tthis.updateGesturesEnabled();\n\t}\n\n\tset drawerTransition(value: string) {\n\t\tthis._drawerTransition = value;\n\t\tthis.updateDrawerTransition();\n\t}\n\n\tset drawerLocation(value: string) {\n\t\tthis._drawerLocation = value;\n\t\tthis.updateDrawerLocation();\n\t}\n\n\tprivate updateDrawerLocation() {\n\t\tthis.sideDrawer.drawerLocation = <any>this._drawerLocation;\n\t}\n\n\tprivate updateDrawerTransition() {\n\t\tthis.sideDrawer.drawerTransition = <any>this._drawerTransition;\n\t}\n\n\tprivate updateGesturesEnabled() {\n\t\tthis.sideDrawer.gesturesEnabled = this._gesturesEnabled;\n\t}\n\n\tprivate updateContentSize() {\n\t\tthis.sideDrawer.drawerContentSize = this._drawerContentSize;\n\t}\n}\n\n/**\n * Directive identifying the drawer content.\n */\n@Directive({\n\tselector: '[tkDrawerContent]'\n})\nexport class TKDrawerContentDirective {\n\tconstructor(@Inject(ElementRef) private _elementRef: ElementRef) {\n\t\tthis._elementRef.nativeElement.id = TKDRAWERCONTENT;\n\t}\n}\n\n/**\n * Directive identifying the main content.\n */\n@Directive({\n\tselector: '[tkMainContent]'\n})\nexport class TKMainContentDirective {\n\tconstructor(@Inject(ElementRef) private _elementRef: ElementRef) {\n\t\tthis._elementRef.nativeElement.id = TKMAINCONTENT;\n\t}\n}\n\nlet sideDrawerMeta: ViewClassMeta = {\n\tinsertChild: (parent: NgView, child: NgView) => {\n\t\tconst drawer = <RadSideDrawer>(<any>parent);\n\t\tconst childView = <any>child;\n\n\t\tif (childView.id === TKMAINCONTENT) {\n\t\t\tdrawer.mainContent = childView;\n\t\t}\n\n\t\tif (childView.id === TKDRAWERCONTENT) {\n\t\t\tdrawer.drawerContent = childView;\n\t\t}\n\t},\n\tremoveChild: (parent: NgView, child: NgView) => {\n\t\tconst drawer = <RadSideDrawer>(<any>parent);\n\t\tconst childView = <any>child;\n\n\t\tif (childView.id === TKMAINCONTENT) {\n\t\t\tdrawer.mainContent = null;\n\t\t}\n\n\t\tif (childView.id === TKDRAWERCONTENT) {\n\t\t\tdrawer.drawerContent = null;\n\t\t}\n\t}\n};\n\n/**\n * Directives identifying the RadSideDrawer.\n */\nexport const SIDEDRAWER_DIRECTIVES = [RadSideDrawerComponent, TKDrawerContentDirective, TKMainContentDirective];\n\nregisterElement('RadSideDrawer', () => RadSideDrawer, sideDrawerMeta);\n\n/**\n * NgModule containing all of the RadSideDrawer directives.\n */\n@NgModule({\n\tdeclarations: [SIDEDRAWER_DIRECTIVES],\n\texports: [SIDEDRAWER_DIRECTIVES]\n})\nexport class NativeScriptUISideDrawerModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAIA,MAAM,eAAe,GAAW,iBAAiB,CAAC;AAClD,MAAM,aAAa,GAAW,eAAe,CAAC;AAQ9C;;;;AAIG;MAKU,sBAAsB,CAAA;IAuBlC,WAAuC,CAAA,UAAsB,EAAoC,aAA+B,EAAA;QAAzF,IAAU,CAAA,UAAA,GAAV,UAAU,CAAY;QAAoC,IAAa,CAAA,aAAA,GAAb,aAAa,CAAkB;AAb/G,QAAA,IAAA,CAAA,aAAa,GAAsB,IAAI,YAAY,EAAE,CAAC;AACtD,QAAA,IAAA,CAAA,UAAU,GAAsB,IAAI,YAAY,EAAE,CAAC;AACnD,QAAA,IAAA,CAAA,aAAa,GAAsB,IAAI,YAAY,EAAE,CAAC;AACtD,QAAA,IAAA,CAAA,YAAY,GAAsB,IAAI,YAAY,EAAE,CAAC;QAWrE,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa,C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