@nativescript-community/ui-persistent-bottomsheet
Version:
NativeScript plugin that allows you to easily add a persistent bottomsheet to your projects.
149 lines (146 loc) • 5.82 kB
JavaScript
import * as i0 from '@angular/core';
import { ElementRef, ViewContainerRef, Component, Inject, Input, Directive, NgModule } from '@angular/core';
import { registerElement } from '@nativescript/angular';
import { PersistentBottomSheet } from '@nativescript-community/ui-persistent-bottomsheet';
const _c0 = ["*"];
const BOTTOMSHEET = 'bottomSheet';
class BottomSheetComponent {
constructor(elementRef, viewContainer) {
this.elementRef = elementRef;
this.viewContainer = viewContainer;
this.pbs = this.elementRef.nativeElement;
}
get nativeElement() {
return this.pbs;
}
get gestureEnabled() {
return this._gestureEnabled;
}
set gestureEnabled(value) {
this._gestureEnabled = value;
this.pbs.gestureEnabled = this._gestureEnabled;
}
get stepIndex() {
return this._stepIndex;
}
set stepIndex(value) {
if (!isNaN(value)) {
this._stepIndex = value;
this.pbs.stepIndex = this._stepIndex;
}
}
get backdropColor() {
return this.pbs.backdropColor;
}
set backdropColor(value) {
this.pbs.backdropColor = value;
}
get scrollViewId() {
return this.pbs.scrollViewId;
}
set scrollViewId(value) {
this.pbs.scrollViewId = value;
}
get panGestureOptions() {
return this.pbs.panGestureOptions;
}
set panGestureOptions(value) {
this.pbs.panGestureOptions = value;
}
}
BottomSheetComponent.ɵfac = function BottomSheetComponent_Factory(t) { return new (t || BottomSheetComponent)(i0.ɵɵdirectiveInject(ElementRef), i0.ɵɵdirectiveInject(ViewContainerRef)); };
BottomSheetComponent.ɵcmp = i0.ɵɵdefineComponent({ type: BottomSheetComponent, selectors: [["BottomSheet"]], inputs: { gestureEnabled: "gestureEnabled", stepIndex: "stepIndex", backdropColor: "backdropColor", scrollViewId: "scrollViewId", panGestureOptions: "panGestureOptions" }, ngContentSelectors: _c0, decls: 1, vars: 0, template: function BottomSheetComponent_Template(rf, ctx) {
if (rf & 1) {
i0.ɵɵprojectionDef();
i0.ɵɵprojection(0);
}
}, encapsulation: 2 });
(function () {
(typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(BottomSheetComponent, [{
type: Component,
args: [{
selector: 'BottomSheet',
template: '<ng-content></ng-content>'
}]
}], function () {
return [{ type: i0.ElementRef, decorators: [{
type: Inject,
args: [ElementRef]
}] }, { type: i0.ViewContainerRef, decorators: [{
type: Inject,
args: [ViewContainerRef]
}] }];
}, { gestureEnabled: [{
type: Input
}], stepIndex: [{
type: Input
}], backdropColor: [{
type: Input
}], scrollViewId: [{
type: Input
}], panGestureOptions: [{
type: Input
}] });
})();
class BottomSheetDirective {
constructor(_elementRef) {
this._elementRef = _elementRef;
this._elementRef.nativeElement.id = BOTTOMSHEET;
}
}
BottomSheetDirective.ɵfac = function BottomSheetDirective_Factory(t) { return new (t || BottomSheetDirective)(i0.ɵɵdirectiveInject(ElementRef)); };
BottomSheetDirective.ɵdir = i0.ɵɵdefineDirective({ type: BottomSheetDirective, selectors: [["", "bottomSheet", ""]] });
(function () {
(typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(BottomSheetDirective, [{
type: Directive,
args: [{
selector: '[bottomSheet]'
}]
}], function () {
return [{ type: i0.ElementRef, decorators: [{
type: Inject,
args: [ElementRef]
}] }];
}, null);
})();
const sbsMeta = {
insertChild: (parent, child) => {
const pbs = parent;
const childView = child;
if (childView.id === BOTTOMSHEET) {
pbs.bottomSheet = childView;
}
else {
pbs.addChild(childView);
}
},
removeChild: (parent, child) => {
const pbs = parent;
const childView = child;
if (childView.id === BOTTOMSHEET) {
pbs.bottomSheet = null;
}
else {
pbs.removeChild(childView);
}
}
};
const PERSISTENTBOTTOMSHEET_DIRECTIVES = [BottomSheetDirective];
registerElement('BottomSheet', () => PersistentBottomSheet, sbsMeta);
class BottomSheetModule {
}
BottomSheetModule.ɵfac = function BottomSheetModule_Factory(t) { return new (t || BottomSheetModule)(); };
BottomSheetModule.ɵmod = i0.ɵɵdefineNgModule({ type: BottomSheetModule });
BottomSheetModule.ɵinj = i0.ɵɵdefineInjector({});
(function () {
(typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(BottomSheetModule, [{
type: NgModule,
args: [{
declarations: [BottomSheetComponent, PERSISTENTBOTTOMSHEET_DIRECTIVES],
exports: [BottomSheetComponent, PERSISTENTBOTTOMSHEET_DIRECTIVES]
}]
}], null, null);
})();
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(BottomSheetModule, { declarations: [BottomSheetComponent, BottomSheetDirective], exports: [BottomSheetComponent, BottomSheetDirective] }); })();
export { BottomSheetComponent, BottomSheetDirective, BottomSheetModule, PERSISTENTBOTTOMSHEET_DIRECTIVES };
//# sourceMappingURL=nativescript-community-ui-persistent-bottomsheet-angular.mjs.map