ngx-text-editor-angular
Version:
WYSIWYG Editor for Angular 2+
1,381 lines (1,328 loc) • 218 kB
JavaScript
(window["webpackJsonp"] = window["webpackJsonp"] || []).push([["pages-home-home-module"],{
/***/ "./node_modules/ngx-bootstrap/component-loader/fesm5/ngx-bootstrap-component-loader.js":
/*!*********************************************************************************************!*\
!*** ./node_modules/ngx-bootstrap/component-loader/fesm5/ngx-bootstrap-component-loader.js ***!
\*********************************************************************************************/
/*! exports provided: BsComponentRef, ComponentLoader, ComponentLoaderFactory, ContentRef */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BsComponentRef", function() { return BsComponentRef; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ComponentLoader", function() { return ComponentLoader; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ComponentLoaderFactory", function() { return ComponentLoaderFactory; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ContentRef", function() { return ContentRef; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var ngx_bootstrap_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ngx-bootstrap/utils */ "./node_modules/ngx-bootstrap/utils/fesm5/ngx-bootstrap-utils.js");
/* harmony import */ var ngx_bootstrap_positioning__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ngx-bootstrap/positioning */ "./node_modules/ngx-bootstrap/positioning/fesm5/ngx-bootstrap-positioning.js");
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @template T
*/
var /**
* @template T
*/
BsComponentRef = /** @class */ (function () {
function BsComponentRef() {
}
return BsComponentRef;
}());
if (false) {}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @copyright Valor Software
* @copyright Angular ng-bootstrap team
*/
var ContentRef = /** @class */ (function () {
function ContentRef(
/* tslint:disable-next-line: no-any */
nodes, viewRef,
/* tslint:disable-next-line: no-any */
componentRef) {
this.nodes = nodes;
this.viewRef = viewRef;
this.componentRef = componentRef;
}
return ContentRef;
}());
if (false) {}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @template T
*/
var /**
* @template T
*/
ComponentLoader = /** @class */ (function () {
/**
* Do not use this directly, it should be instanced via
* `ComponentLoadFactory.attach`
* @internal
*/
// tslint:disable-next-line
function ComponentLoader(_viewContainerRef, _renderer, _elementRef, _injector, _componentFactoryResolver, _ngZone, _applicationRef, _posService) {
this._viewContainerRef = _viewContainerRef;
this._renderer = _renderer;
this._elementRef = _elementRef;
this._injector = _injector;
this._componentFactoryResolver = _componentFactoryResolver;
this._ngZone = _ngZone;
this._applicationRef = _applicationRef;
this._posService = _posService;
this.onBeforeShow = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/* tslint:disable-next-line: no-any*/
this.onShown = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
/* tslint:disable-next-line: no-any*/
this.onBeforeHide = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
this.onHidden = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
this._providers = [];
this._isHiding = false;
/**
* A selector used if container element was not found
*/
this.containerDefaultSelector = 'body';
this._listenOpts = {};
this._globalListener = Function.prototype;
}
Object.defineProperty(ComponentLoader.prototype, "isShown", {
get: /**
* @return {?}
*/
function () {
if (this._isHiding) {
return false;
}
return !!this._componentRef;
},
enumerable: true,
configurable: true
});
/**
* @param {?} compType
* @return {?}
*/
ComponentLoader.prototype.attach = /**
* @param {?} compType
* @return {?}
*/
function (compType) {
this._componentFactory = this._componentFactoryResolver
.resolveComponentFactory(compType);
return this;
};
// todo: add behaviour: to target element, `body`, custom element
// todo: add behaviour: to target element, `body`, custom element
/**
* @param {?=} container
* @return {?}
*/
ComponentLoader.prototype.to =
// todo: add behaviour: to target element, `body`, custom element
/**
* @param {?=} container
* @return {?}
*/
function (container) {
this.container = container || this.container;
return this;
};
/**
* @param {?=} opts
* @return {?}
*/
ComponentLoader.prototype.position = /**
* @param {?=} opts
* @return {?}
*/
function (opts) {
this.attachment = opts.attachment || this.attachment;
/* tslint:disable-next-line: no-unnecessary-type-assertion */
this._elementRef = ((/** @type {?} */ (opts.target))) || this._elementRef;
return this;
};
/**
* @param {?} provider
* @return {?}
*/
ComponentLoader.prototype.provide = /**
* @param {?} provider
* @return {?}
*/
function (provider) {
this._providers.push(provider);
return this;
};
// todo: appendChild to element or document.querySelector(this.container)
// todo: appendChild to element or document.querySelector(this.container)
/**
* @param {?=} opts
* @return {?}
*/
ComponentLoader.prototype.show =
// todo: appendChild to element or document.querySelector(this.container)
/**
* @param {?=} opts
* @return {?}
*/
function (opts) {
if (opts === void 0) { opts = {}; }
this._subscribePositioning();
this._innerComponent = null;
if (!this._componentRef) {
this.onBeforeShow.emit();
this._contentRef = this._getContentRef(opts.content, opts.context, opts.initialState);
/** @type {?} */
var injector = _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injector"].create({
providers: this._providers,
parent: this._injector
});
this._componentRef = this._componentFactory.create(injector, this._contentRef.nodes);
this._applicationRef.attachView(this._componentRef.hostView);
// this._componentRef = this._viewContainerRef
// .createComponent(this._componentFactory, 0, injector, this._contentRef.nodes);
this.instance = this._componentRef.instance;
Object.assign(this._componentRef.instance, opts);
if (this.container instanceof _angular_core__WEBPACK_IMPORTED_MODULE_0__["ElementRef"]) {
this.container.nativeElement.appendChild(this._componentRef.location.nativeElement);
}
if (typeof this.container === 'string' && typeof document !== 'undefined') {
/** @type {?} */
var selectedElement = document.querySelector(this.container) ||
document.querySelector(this.containerDefaultSelector);
selectedElement.appendChild(this._componentRef.location.nativeElement);
}
if (!this.container &&
this._elementRef &&
this._elementRef.nativeElement.parentElement) {
this._elementRef.nativeElement.parentElement.appendChild(this._componentRef.location.nativeElement);
}
// we need to manually invoke change detection since events registered
// via
// Renderer::listen() are not picked up by change detection with the
// OnPush strategy
if (this._contentRef.componentRef) {
this._innerComponent = this._contentRef.componentRef.instance;
this._contentRef.componentRef.changeDetectorRef.markForCheck();
this._contentRef.componentRef.changeDetectorRef.detectChanges();
}
this._componentRef.changeDetectorRef.markForCheck();
this._componentRef.changeDetectorRef.detectChanges();
this.onShown.emit(this._componentRef.instance);
}
this._registerOutsideClick();
return this._componentRef;
};
/**
* @return {?}
*/
ComponentLoader.prototype.hide = /**
* @return {?}
*/
function () {
if (!this._componentRef) {
return this;
}
this._posService.deletePositionElement(this._componentRef.location);
this.onBeforeHide.emit(this._componentRef.instance);
/** @type {?} */
var componentEl = this._componentRef.location.nativeElement;
componentEl.parentNode.removeChild(componentEl);
if (this._contentRef.componentRef) {
this._contentRef.componentRef.destroy();
}
this._componentRef.destroy();
if (this._viewContainerRef && this._contentRef.viewRef) {
this._viewContainerRef.remove(this._viewContainerRef.indexOf(this._contentRef.viewRef));
}
if (this._contentRef.viewRef) {
this._contentRef.viewRef.destroy();
}
this._contentRef = null;
this._componentRef = null;
this._removeGlobalListener();
this.onHidden.emit();
return this;
};
/**
* @return {?}
*/
ComponentLoader.prototype.toggle = /**
* @return {?}
*/
function () {
if (this.isShown) {
this.hide();
return;
}
this.show();
};
/**
* @return {?}
*/
ComponentLoader.prototype.dispose = /**
* @return {?}
*/
function () {
if (this.isShown) {
this.hide();
}
this._unsubscribePositioning();
if (this._unregisterListenersFn) {
this._unregisterListenersFn();
}
};
/**
* @param {?} listenOpts
* @return {?}
*/
ComponentLoader.prototype.listen = /**
* @param {?} listenOpts
* @return {?}
*/
function (listenOpts) {
var _this = this;
this.triggers = listenOpts.triggers || this.triggers;
this._listenOpts.outsideClick = listenOpts.outsideClick;
this._listenOpts.outsideEsc = listenOpts.outsideEsc;
listenOpts.target = listenOpts.target || this._elementRef.nativeElement;
/** @type {?} */
var hide = (this._listenOpts.hide = (/**
* @return {?}
*/
function () {
return listenOpts.hide ? listenOpts.hide() : void _this.hide();
}));
/** @type {?} */
var show = (this._listenOpts.show = (/**
* @param {?} registerHide
* @return {?}
*/
function (registerHide) {
listenOpts.show ? listenOpts.show(registerHide) : _this.show(registerHide);
registerHide();
}));
/** @type {?} */
var toggle = (/**
* @param {?} registerHide
* @return {?}
*/
function (registerHide) {
_this.isShown ? hide() : show(registerHide);
});
this._unregisterListenersFn = Object(ngx_bootstrap_utils__WEBPACK_IMPORTED_MODULE_1__["listenToTriggersV2"])(this._renderer, {
target: listenOpts.target,
triggers: listenOpts.triggers,
show: show,
hide: hide,
toggle: toggle
});
return this;
};
/**
* @return {?}
*/
ComponentLoader.prototype._removeGlobalListener = /**
* @return {?}
*/
function () {
if (this._globalListener) {
this._globalListener();
this._globalListener = null;
}
};
/**
* @param {?} vRef
* @param {?} template
* @return {?}
*/
ComponentLoader.prototype.attachInline = /**
* @param {?} vRef
* @param {?} template
* @return {?}
*/
function (vRef,
/* tslint:disable-next-line: no-any*/
template) {
this._inlineViewRef = vRef.createEmbeddedView(template);
return this;
};
/**
* @return {?}
*/
ComponentLoader.prototype._registerOutsideClick = /**
* @return {?}
*/
function () {
var _this = this;
if (!this._componentRef || !this._componentRef.location) {
return;
}
// why: should run after first event bubble
if (this._listenOpts.outsideClick) {
/** @type {?} */
var target_1 = this._componentRef.location.nativeElement;
setTimeout((/**
* @return {?}
*/
function () {
_this._globalListener = Object(ngx_bootstrap_utils__WEBPACK_IMPORTED_MODULE_1__["registerOutsideClick"])(_this._renderer, {
targets: [target_1, _this._elementRef.nativeElement],
outsideClick: _this._listenOpts.outsideClick,
hide: (/**
* @return {?}
*/
function () { return _this._listenOpts.hide(); })
});
}));
}
if (this._listenOpts.outsideEsc) {
/** @type {?} */
var target = this._componentRef.location.nativeElement;
this._globalListener = Object(ngx_bootstrap_utils__WEBPACK_IMPORTED_MODULE_1__["registerEscClick"])(this._renderer, {
targets: [target, this._elementRef.nativeElement],
outsideEsc: this._listenOpts.outsideEsc,
hide: (/**
* @return {?}
*/
function () { return _this._listenOpts.hide(); })
});
}
};
/**
* @return {?}
*/
ComponentLoader.prototype.getInnerComponent = /**
* @return {?}
*/
function () {
return this._innerComponent;
};
/**
* @private
* @return {?}
*/
ComponentLoader.prototype._subscribePositioning = /**
* @private
* @return {?}
*/
function () {
var _this = this;
if (this._zoneSubscription || !this.attachment) {
return;
}
this.onShown.subscribe((/**
* @return {?}
*/
function () {
_this._posService.position({
element: _this._componentRef.location,
target: _this._elementRef,
attachment: _this.attachment,
appendToBody: _this.container === 'body'
});
}));
this._zoneSubscription = this._ngZone.onStable.subscribe((/**
* @return {?}
*/
function () {
if (!_this._componentRef) {
return;
}
_this._posService.calcPosition();
}));
};
/**
* @private
* @return {?}
*/
ComponentLoader.prototype._unsubscribePositioning = /**
* @private
* @return {?}
*/
function () {
if (!this._zoneSubscription) {
return;
}
this._zoneSubscription.unsubscribe();
this._zoneSubscription = null;
};
/**
* @private
* @param {?} content
* @param {?=} context
* @param {?=} initialState
* @return {?}
*/
ComponentLoader.prototype._getContentRef = /**
* @private
* @param {?} content
* @param {?=} context
* @param {?=} initialState
* @return {?}
*/
function (
/* tslint:disable-next-line: no-any*/
content,
/* tslint:disable-next-line: no-any*/
context,
/* tslint:disable-next-line: no-any*/
initialState) {
if (!content) {
return new ContentRef([]);
}
if (content instanceof _angular_core__WEBPACK_IMPORTED_MODULE_0__["TemplateRef"]) {
if (this._viewContainerRef) {
/** @type {?} */
var _viewRef = this._viewContainerRef
.createEmbeddedView(content, context);
_viewRef.markForCheck();
return new ContentRef([_viewRef.rootNodes], _viewRef);
}
/** @type {?} */
var viewRef = content.createEmbeddedView({});
this._applicationRef.attachView(viewRef);
return new ContentRef([viewRef.rootNodes], viewRef);
}
if (typeof content === 'function') {
/** @type {?} */
var contentCmptFactory = this._componentFactoryResolver.resolveComponentFactory(content);
/** @type {?} */
var modalContentInjector = _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injector"].create({
providers: this._providers,
parent: this._injector
});
/** @type {?} */
var componentRef = contentCmptFactory.create(modalContentInjector);
Object.assign(componentRef.instance, initialState);
this._applicationRef.attachView(componentRef.hostView);
return new ContentRef([[componentRef.location.nativeElement]], componentRef.hostView, componentRef);
}
return new ContentRef([[this._renderer.createText("" + content)]]);
};
return ComponentLoader;
}());
if (false) {}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var ComponentLoaderFactory = /** @class */ (function () {
function ComponentLoaderFactory(_componentFactoryResolver, _ngZone, _injector, _posService, _applicationRef) {
this._componentFactoryResolver = _componentFactoryResolver;
this._ngZone = _ngZone;
this._injector = _injector;
this._posService = _posService;
this._applicationRef = _applicationRef;
}
/**
*
* @param _elementRef
* @param _viewContainerRef
* @param _renderer
*/
/**
*
* @template T
* @param {?} _elementRef
* @param {?} _viewContainerRef
* @param {?} _renderer
* @return {?}
*/
ComponentLoaderFactory.prototype.createLoader = /**
*
* @template T
* @param {?} _elementRef
* @param {?} _viewContainerRef
* @param {?} _renderer
* @return {?}
*/
function (_elementRef, _viewContainerRef, _renderer) {
return new ComponentLoader(_viewContainerRef, _renderer, _elementRef, this._injector, this._componentFactoryResolver, this._ngZone, this._applicationRef, this._posService);
};
ComponentLoaderFactory.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"] }
];
/** @nocollapse */
ComponentLoaderFactory.ctorParameters = function () { return [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ComponentFactoryResolver"] },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["NgZone"] },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injector"] },
{ type: ngx_bootstrap_positioning__WEBPACK_IMPORTED_MODULE_2__["PositioningService"] },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ApplicationRef"] }
]; };
return ComponentLoaderFactory;
}());
if (false) {}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
//# sourceMappingURL=ngx-bootstrap-component-loader.js.map
/***/ }),
/***/ "./node_modules/ngx-bootstrap/popover/fesm5/ngx-bootstrap-popover.js":
/*!***************************************************************************!*\
!*** ./node_modules/ngx-bootstrap/popover/fesm5/ngx-bootstrap-popover.js ***!
\***************************************************************************/
/*! exports provided: PopoverConfig, PopoverContainerComponent, PopoverDirective, PopoverModule */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PopoverConfig", function() { return PopoverConfig; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PopoverContainerComponent", function() { return PopoverContainerComponent; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PopoverDirective", function() { return PopoverDirective; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PopoverModule", function() { return PopoverModule; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var ngx_bootstrap_component_loader__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ngx-bootstrap/component-loader */ "./node_modules/ngx-bootstrap/component-loader/fesm5/ngx-bootstrap-component-loader.js");
/* harmony import */ var ngx_bootstrap_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ngx-bootstrap/utils */ "./node_modules/ngx-bootstrap/utils/fesm5/ngx-bootstrap-utils.js");
/* harmony import */ var ngx_bootstrap_positioning__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ngx-bootstrap/positioning */ "./node_modules/ngx-bootstrap/positioning/fesm5/ngx-bootstrap-positioning.js");
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! rxjs */ "./node_modules/rxjs/_esm5/index.js");
/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/common */ "./node_modules/@angular/common/fesm5/common.js");
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* Configuration service for the Popover directive.
* You can inject this service, typically in your root component, and customize
* the values of its properties in order to provide default values for all the
* popovers used in the application.
*/
var PopoverConfig = /** @class */ (function () {
function PopoverConfig() {
/**
* sets disable adaptive position
*/
this.adaptivePosition = true;
/**
* Placement of a popover. Accepts: "top", "bottom", "left", "right", "auto"
*/
this.placement = 'top';
/**
* Specifies events that should trigger. Supports a space separated list of
* event names.
*/
this.triggers = 'click';
this.outsideClick = false;
/**
* delay before showing the tooltip
*/
this.delay = 0;
}
PopoverConfig.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"] }
];
return PopoverConfig;
}());
if (false) {}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var PopoverContainerComponent = /** @class */ (function () {
function PopoverContainerComponent(config) {
Object.assign(this, config);
}
Object.defineProperty(PopoverContainerComponent.prototype, "isBs3", {
get: /**
* @return {?}
*/
function () {
return Object(ngx_bootstrap_utils__WEBPACK_IMPORTED_MODULE_2__["isBs3"])();
},
enumerable: true,
configurable: true
});
PopoverContainerComponent.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"], args: [{
selector: 'popover-container',
changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ChangeDetectionStrategy"].OnPush,
// tslint:disable-next-line
host: {
'[class]': '"popover in popover-" + placement + " " + "bs-popover-" + placement + " " + placement + " " + containerClass',
'[class.show]': '!isBs3',
'[class.bs3]': 'isBs3',
role: 'tooltip',
style: 'display:block;'
},
template: "<div class=\"popover-arrow arrow\"></div>\n<h3 class=\"popover-title popover-header\" *ngIf=\"title\">{{ title }}</h3>\n<div class=\"popover-content popover-body\">\n <ng-content></ng-content>\n</div>\n",
styles: ["\n :host.bs3.popover-top {\n margin-bottom: 10px;\n }\n :host.bs3.popover.top>.arrow {\n margin-left: -2px;\n }\n :host.bs3.popover.top {\n margin-bottom: 10px;\n }\n :host.popover.bottom>.arrow {\n margin-left: -4px;\n }\n :host.bs3.bs-popover-left {\n margin-right: .5rem;\n }\n :host.bs3.bs-popover-right .arrow, :host.bs3.bs-popover-left .arrow{\n margin: .3rem 0;\n }\n "]
}] }
];
/** @nocollapse */
PopoverContainerComponent.ctorParameters = function () { return [
{ type: PopoverConfig }
]; };
PopoverContainerComponent.propDecorators = {
placement: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] }],
title: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] }]
};
return PopoverContainerComponent;
}());
if (false) {}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* A lightweight, extensible directive for fancy popover creation.
*/
var PopoverDirective = /** @class */ (function () {
function PopoverDirective(_config, _elementRef, _renderer, _viewContainerRef, cis, _positionService) {
this._elementRef = _elementRef;
this._renderer = _renderer;
this._positionService = _positionService;
/**
* Close popover on outside click
*/
this.outsideClick = false;
/**
* Css class for popover container
*/
this.containerClass = '';
this._isInited = false;
this._popover = cis
.createLoader(_elementRef, _viewContainerRef, _renderer)
.provide({ provide: PopoverConfig, useValue: _config });
Object.assign(this, _config);
this.onShown = this._popover.onShown;
this.onHidden = this._popover.onHidden;
// fix: no focus on button on Mac OS #1795
if (typeof window !== 'undefined') {
_elementRef.nativeElement.addEventListener('click', (/**
* @return {?}
*/
function () {
try {
_elementRef.nativeElement.focus();
}
catch (err) {
return;
}
}));
}
}
Object.defineProperty(PopoverDirective.prototype, "isOpen", {
/**
* Returns whether or not the popover is currently being shown
*/
get: /**
* Returns whether or not the popover is currently being shown
* @return {?}
*/
function () {
return this._popover.isShown;
},
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
if (value) {
this.show();
}
else {
this.hide();
}
},
enumerable: true,
configurable: true
});
/**
* Opens an element’s popover. This is considered a “manual” triggering of
* the popover.
*/
/**
* Opens an element’s popover. This is considered a “manual” triggering of
* the popover.
* @return {?}
*/
PopoverDirective.prototype.show = /**
* Opens an element’s popover. This is considered a “manual” triggering of
* the popover.
* @return {?}
*/
function () {
var _this = this;
if (this._popover.isShown || !this.popover || this._delayTimeoutId) {
return;
}
this._positionService.setOptions({
modifiers: {
flip: {
enabled: this.adaptivePosition
},
preventOverflow: {
enabled: this.adaptivePosition
}
}
});
/** @type {?} */
var showPopover = (/**
* @return {?}
*/
function () {
if (_this._delayTimeoutId) {
_this._delayTimeoutId = undefined;
}
_this._popover
.attach(PopoverContainerComponent)
.to(_this.container)
.position({ attachment: _this.placement })
.show({
content: _this.popover,
context: _this.popoverContext,
placement: _this.placement,
title: _this.popoverTitle,
containerClass: _this.containerClass
});
if (!_this.adaptivePosition) {
_this._positionService.calcPosition();
_this._positionService.deletePositionElement(_this._popover._componentRef.location);
}
_this.isOpen = true;
});
/** @type {?} */
var cancelDelayedTooltipShowing = (/**
* @return {?}
*/
function () {
if (_this._popoverCancelShowFn) {
_this._popoverCancelShowFn();
}
});
if (this.delay) {
/** @type {?} */
var _timer_1 = Object(rxjs__WEBPACK_IMPORTED_MODULE_4__["timer"])(this.delay).subscribe((/**
* @return {?}
*/
function () {
showPopover();
cancelDelayedTooltipShowing();
}));
if (this.triggers) {
Object(ngx_bootstrap_utils__WEBPACK_IMPORTED_MODULE_2__["parseTriggers"])(this.triggers)
.forEach((/**
* @param {?} trigger
* @return {?}
*/
function (trigger) {
_this._popoverCancelShowFn = _this._renderer.listen(_this._elementRef.nativeElement, trigger.close, (/**
* @return {?}
*/
function () {
_timer_1.unsubscribe();
cancelDelayedTooltipShowing();
}));
}));
}
}
else {
showPopover();
}
};
/**
* Closes an element’s popover. This is considered a “manual” triggering of
* the popover.
*/
/**
* Closes an element’s popover. This is considered a “manual” triggering of
* the popover.
* @return {?}
*/
PopoverDirective.prototype.hide = /**
* Closes an element’s popover. This is considered a “manual” triggering of
* the popover.
* @return {?}
*/
function () {
if (this._delayTimeoutId) {
clearTimeout(this._delayTimeoutId);
this._delayTimeoutId = undefined;
}
if (this.isOpen) {
this._popover.hide();
this.isOpen = false;
}
};
/**
* Toggles an element’s popover. This is considered a “manual” triggering of
* the popover.
*/
/**
* Toggles an element’s popover. This is considered a “manual” triggering of
* the popover.
* @return {?}
*/
PopoverDirective.prototype.toggle = /**
* Toggles an element’s popover. This is considered a “manual” triggering of
* the popover.
* @return {?}
*/
function () {
if (this.isOpen) {
return this.hide();
}
this.show();
};
/**
* @return {?}
*/
PopoverDirective.prototype.ngOnInit = /**
* @return {?}
*/
function () {
var _this = this;
// fix: seems there are an issue with `routerLinkActive`
// which result in duplicated call ngOnInit without call to ngOnDestroy
// read more: https://github.com/valor-software/ngx-bootstrap/issues/1885
if (this._isInited) {
return;
}
this._isInited = true;
this._popover.listen({
triggers: this.triggers,
outsideClick: this.outsideClick,
show: (/**
* @return {?}
*/
function () { return _this.show(); })
});
};
/**
* @return {?}
*/
PopoverDirective.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
this._popover.dispose();
};
PopoverDirective.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], args: [{ selector: '[popover]', exportAs: 'bs-popover' },] }
];
/** @nocollapse */
PopoverDirective.ctorParameters = function () { return [
{ type: PopoverConfig },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ElementRef"] },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Renderer2"] },
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewContainerRef"] },
{ type: ngx_bootstrap_component_loader__WEBPACK_IMPORTED_MODULE_1__["ComponentLoaderFactory"] },
{ type: ngx_bootstrap_positioning__WEBPACK_IMPORTED_MODULE_3__["PositioningService"] }
]; };
PopoverDirective.propDecorators = {
adaptivePosition: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] }],
popover: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] }],
popoverContext: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] }],
popoverTitle: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] }],
placement: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] }],
outsideClick: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] }],
triggers: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] }],
container: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] }],
containerClass: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] }],
isOpen: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] }],
delay: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] }],
onShown: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] }],
onHidden: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] }]
};
return PopoverDirective;
}());
if (false) {}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var PopoverModule = /** @class */ (function () {
function PopoverModule() {
}
/**
* @return {?}
*/
PopoverModule.forRoot = /**
* @return {?}
*/
function () {
return {
ngModule: PopoverModule,
providers: [PopoverConfig, ngx_bootstrap_component_loader__WEBPACK_IMPORTED_MODULE_1__["ComponentLoaderFactory"], ngx_bootstrap_positioning__WEBPACK_IMPORTED_MODULE_3__["PositioningService"]]
};
};
PopoverModule.decorators = [
{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["NgModule"], args: [{
imports: [_angular_common__WEBPACK_IMPORTED_MODULE_5__["CommonModule"]],
declarations: [PopoverDirective, PopoverContainerComponent],
exports: [PopoverDirective],
entryComponents: [PopoverContainerComponent]
},] }
];
return PopoverModule;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
//# sourceMappingURL=ngx-bootstrap-popover.js.map
/***/ }),
/***/ "./node_modules/ngx-bootstrap/positioning/fesm5/ngx-bootstrap-positioning.js":
/*!***********************************************************************************!*\
!*** ./node_modules/ngx-bootstrap/positioning/fesm5/ngx-bootstrap-positioning.js ***!
\***********************************************************************************/
/*! exports provided: Positioning, PositioningService, positionElements */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Positioning", function() { return Positioning; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PositioningService", function() { return PositioningService; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "positionElements", function() { return positionElements; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/common */ "./node_modules/@angular/common/fesm5/common.js");
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! rxjs */ "./node_modules/rxjs/_esm5/index.js");
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* Get CSS computed property of the given element
* @param {?} element
* @param {?=} property
* @return {?}
*/
function getStyleComputedProperty(element, property) {
if (element.nodeType !== 1) {
return [];
}
// NOTE: 1 DOM access here
/** @type {?} */
var window = element.ownerDocument.defaultView;
/** @type {?} */
var css = window.getComputedStyle(element, null);
return property ? css[(/** @type {?} */ (property))] : css;
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* Returns the parentNode or the host of the element
* @param {?} element
* @return {?}
*/
function getParentNode(element) {
if (element.nodeName === 'HTML') {
return element;
}
return element.parentNode || element.host;
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @param {?} element
* @return {?}
*/
function getScrollParent(element) {
// Return body, `getScroll` will take care to get the correct `scrollTop` from it
if (!element) {
return document.body;
}
switch (element.nodeName) {
case 'HTML':
case 'BODY':
return element.ownerDocument.body;
case '#document':
return element.body;
default:
}
// Firefox want us to check `-x` and `-y` variations as well
var _a = getStyleComputedProperty(element), overflow = _a.overflow, overflowX = _a.overflowX, overflowY = _a.overflowY;
if (/(auto|scroll|overlay)/.test(String(overflow) + String(overflowY) + String(overflowX))) {
return element;
}
return getScrollParent(getParentNode(element));
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined';
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
var isIE11 = isBrowser && !!(((/** @type {?} */ (window))).MSInputMethodContext && ((/** @type {?} */ (document))).documentMode);
/** @type {?} */
var isIE10 = isBrowser && !!(((/** @type {?} */ (window))).MSInputMethodContext && /MSIE 10/.test(((/** @type {?} */ (navigator))).userAgent));
/**
* @param {?=} version
* @return {?}
*/
function isIE(version) {
if (version === 11) {
return isIE11;
}
if (version === 10) {
return isIE10;
}
return isIE11 || isIE10;
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @param {?} element
* @return {?}
*/
function getOffsetParent(element) {
if (!element) {
return document.documentElement;
}
/** @type {?} */
var noOffsetParent = isIE(10) ? document.body : null;
// NOTE: 1 DOM access here
/** @type {?} */
var offsetParent = element.offsetParent || null;
// Skip hidden elements which don't have an offsetParent
/** @type {?} */
var sibling;
while (offsetParent === noOffsetParent
&& element.nextElementSibling
&& sibling !== element.nextElementSibling) {
sibling = element.nextElementSibling;
offsetParent = sibling.offsetParent;
}
/** @type {?} */
var nodeName = offsetParent && offsetParent.nodeName;
if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') {
return sibling ? sibling.ownerDocument.documentElement : document.documentElement;
}
// .offsetParent will return the closest TH, TD or TABLE in case
if (['TH', 'TD', 'TABLE'].indexOf(offsetParent.nodeName) !== -1 &&
getStyleComputedProperty(offsetParent, 'position') === 'static') {
return getOffsetParent(offsetParent);
}
return offsetParent;
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @param {?} element
* @return {?}
*/
function isOffsetContainer(element) {
var nodeName = element.nodeName;
if (nodeName === 'BODY') {
return false;
}
return (nodeName === 'HTML' || getOffsetParent(element.firstElementChild) === element);
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* Finds the root node (document, shadowDOM root) of the given element
* @param {?} node
* @return {?}
*/
function getRoot(node) {
if (node.parentNode !== null) {
return getRoot(node.parentNode);
}
return node;
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @param {?} element1
* @param {?} element2
* @return {?}
*/
function findCommonOffsetParent(element1, element2) {
// This check is needed to avoid errors in case one of the elements isn't defined for any reason
if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) {
return document.documentElement;
}
// Here we make sure to give as "start" the element that comes first in the DOM
/* tslint:disable-next-line: no-bitwise */
/** @type {?} */
var order = element1.compareDocumentPosition(element2) & Node.DOCUMENT_POSITION_FOLLOWING;
/** @type {?} */
var start = order ? element1 : element2;
/** @type {?} */
var end = order ? element2 : element1;
// Get common ancestor container
/** @type {?} */
var range = document.createRange();
range.setStart(start, 0);
range.setEnd(end, 0);
var commonAncestorContainer = range.commonAncestorContainer;
// Both nodes are inside #document
if ((element1 !== commonAncestorContainer &&
element2 !== commonAncestorContainer) ||
start.contains(end)) {
if (isOffsetContainer(commonAncestorContainer)) {
return commonAncestorContainer;
}
return getOffsetParent(commonAncestorContainer);
}
// one of the nodes is inside shadowDOM, find which one
/** @type {?} */
var element1root = getRoot(element1);
if (element1root.host) {
return findCommonOffsetParent(element1root.host, element2);
}
else {
return findCommonOffsetParent(element1, getRoot(element2).host);
}
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* Helper to detect borders of a given element
*/
/**
* @param {?} styles
* @param {?} axis
* @return {?}
*/
function getBordersSize(styles, axis) {
/** @type {?} */
var sideA = axis === 'x' ? 'Left' : 'Top';
/** @type {?} */
var sideB = sideA === 'Left' ? 'Right' : 'Bottom';
return (parseFloat(styles[(/** @type {?} */ ("border" + sideA + "Width"))]) +
parseFloat(styles[(/** @type {?} */ ("border" + sideB + "Width"))]));
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @param {?} axis
* @param {?} body
* @param {?} html
* @param {?} computedStyle
* @return {?}
*/
function getSize(axis, body, html, computedStyle) {
return Math.max(((/** @type {?} */ (body)))["offset" + axis], ((/** @type {?} */ (body)))["scroll" + axis], ((/** @type {?} */ (html)))["client" + axis], ((/** @type {?} */ (html)))["offset" + axis], ((/** @type {?} */ (html)))["scroll" + axis], isIE(10)
? (parseInt(((/** @type {?} */ (html)))["offset" + axis], 10) +
parseInt(computedStyle[(/** @type {?} */ ("margin" + (axis === 'Height' ? 'Top' : 'Left')))], 10) +
parseInt(computedStyle[(/** @type {?} */ ("margin" + (axis === 'Height' ? 'Bottom' : 'Right')))], 10))
: 0);
}
/**
* @param {?} document
* @return {?}
*/
function getWindowSizes(document) {
/** @type {?} */
var body = document.body;
/** @type {?} */
var html = document.documentElement;
/** @type {?} */
var computedStyle = isIE(10) && getComputedStyle(html);
return {
height: getSize('Height', body, html, computedStyle),
width: getSize('Width', body, html, computedStyle)
};
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* Gets the scroll value of the given element in the given side (top and left)
* @param {?} element
* @param {?=} side
* @return {?}
*/
function getScroll(element, side) {
if (side === void 0) { side = 'top'; }
/** @type {?} */
var upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft';
/** @type {?} */
var nodeName = element.nodeName;
if (nodeName === 'BODY' || nodeName === 'HTML') {
/** @type {?} */
var html = element.ownerDocument.documentElement;
/** @type {?} */
var scrollingElement = element.ownerDocument.scrollingElement || html;
return scrollingElement[upperSide];
}
return element[upperSide];
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @param {?} offsets
* @return {?}
*/
function getClientRect(offsets) {
return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, offsets, { right: offsets.left + offsets.width, bottom: offsets.top + offsets.height });
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @param {?} element
* @return {?}
*/
function getBoundingClientRect(element) {
/** @type {?} */
var rect = {};
// IE10 10 FIX: Please, don't ask, the element isn't
// considered in DOM in some circumstances...
// This isn't reproducible in IE10 compatibility mode of IE11
try {
if (isIE(10)) {
rect = element.getBoundingClientRect();
/** @type {?} */
var scrollTop = getScroll(element, 'top');
/** @type {?} */
var scrollLeft = getScroll(element, 'left');
rect.top += scrollTop;
rect.left += scrollLeft;
rect.bottom += scrollTop;
rect.right += scrollLeft;
}
else {
rect = element.getBoundingClientRect();
}
}
catch (e) {
return undefined;
}
/** @type {?} */
var result = {
left: rect.left,
top