@fivethree/core
Version:
Fivethree Core Components
1,038 lines (1,004 loc) • 391 kB
JavaScript
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/animations'), require('@angular/common'), require('@ionic/angular'), require('@angular/router'), require('rxjs'), require('@angular/platform-browser'), require('rxjs/operators'), require('@angular/forms'), require('@fivethree/ngx-rxjs-animations')) :
typeof define === 'function' && define.amd ? define('@fivethree/core', ['exports', '@angular/core', '@angular/animations', '@angular/common', '@ionic/angular', '@angular/router', 'rxjs', '@angular/platform-browser', 'rxjs/operators', '@angular/forms', '@fivethree/ngx-rxjs-animations'], factory) :
(global = global || self, factory((global.fivethree = global.fivethree || {}, global.fivethree.core = {}), global.ng.core, global.ng.animations, global.ng.common, global['ionic-angular'], global.ng.router, global.rxjs, global.ng.platformBrowser, global.rxjs.operators, global.ng.forms, global['ngx-rxjs-animations']));
}(this, (function (exports, core, animations, common, angular, router, rxjs, platformBrowser, operators, forms, ngxRxjsAnimations) { 'use strict';
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
/* global Reflect, Promise */
var extendStatics = function(d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
function __extends(d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
}
var __assign = function() {
__assign = Object.assign || function __assign(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
function __rest(s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
t[p[i]] = s[p[i]];
}
return t;
}
function __decorate(decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
}
function __param(paramIndex, decorator) {
return function (target, key) { decorator(target, key, paramIndex); }
}
function __metadata(metadataKey, metadataValue) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
}
function __awaiter(thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
}
function __generator(thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
}
function __exportStar(m, exports) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
function __values(o) {
var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
if (m) return m.call(o);
return {
next: function () {
if (o && i >= o.length) o = void 0;
return { value: o && o[i++], done: !o };
}
};
}
function __read(o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o), r, ar = [], e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
}
catch (error) { e = { error: error }; }
finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
}
finally { if (e) throw e.error; }
}
return ar;
}
function __spread() {
for (var ar = [], i = 0; i < arguments.length; i++)
ar = ar.concat(__read(arguments[i]));
return ar;
}
function __spreadArrays() {
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
for (var r = Array(s), k = 0, i = 0; i < il; i++)
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
r[k] = a[j];
return r;
};
function __await(v) {
return this instanceof __await ? (this.v = v, this) : new __await(v);
}
function __asyncGenerator(thisArg, _arguments, generator) {
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
var g = generator.apply(thisArg, _arguments || []), i, q = [];
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
function fulfill(value) { resume("next", value); }
function reject(value) { resume("throw", value); }
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
}
function __asyncDelegator(o) {
var i, p;
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
}
function __asyncValues(o) {
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
var m = o[Symbol.asyncIterator], i;
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
}
function __makeTemplateObject(cooked, raw) {
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
return cooked;
};
function __importStar(mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result.default = mod;
return result;
}
function __importDefault(mod) {
return (mod && mod.__esModule) ? mod : { default: mod };
}
/**
* @fileoverview added by tsickle
* Generated from: lib/icon/icon.component.ts
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var FivIcon = /** @class */ (function () {
function FivIcon() {
this._badge = 0;
this.state = 'normal';
this.off = false;
this.animationDisabled = false;
this.transitionDone = new core.EventEmitter();
this.indicatorState = 'scale';
this.badgeState = 'scale';
}
Object.defineProperty(FivIcon.prototype, "name", {
get: /**
* @return {?}
*/
function () {
return this._name;
},
set: /**
* @param {?} name
* @return {?}
*/
function (name) {
if (this._name) {
this.transform(name);
}
else {
this._name = name;
}
},
enumerable: true,
configurable: true
});
Object.defineProperty(FivIcon.prototype, "badge", {
get: /**
* @return {?}
*/
function () {
return this._badge;
},
set: /**
* @param {?} value
* @return {?}
*/
function (value) {
this.transformIndicator(value);
},
enumerable: true,
configurable: true
});
Object.defineProperty(FivIcon.prototype, "dot", {
get: /**
* @return {?}
*/
function () {
return this._dot;
},
set: /**
* @param {?} dot
* @return {?}
*/
function (dot) {
this._dot = dot;
if (dot) {
this.indicatorState = 'normal';
}
},
enumerable: true,
configurable: true
});
/**
* @return {?}
*/
FivIcon.prototype.ngOnInit = /**
* @return {?}
*/
function () { };
/**
* @param {?} name
* @return {?}
*/
FivIcon.prototype.transform = /**
* @param {?} name
* @return {?}
*/
function (name) {
this.temp = name;
this.state = 'rotate';
};
/**
* @param {?} value
* @return {?}
*/
FivIcon.prototype.transformIndicator = /**
* @param {?} value
* @return {?}
*/
function (value) {
if (this.dot) {
this._badge = value;
return;
}
if (value === 0) {
this._badge = value;
this.badgeState = 'scale';
}
else {
if (this.badgeState === 'scale') {
this.badgeState = 'normal';
this._badge = value;
}
else {
this.tempValue = value;
this.badgeState = 'scale';
}
}
};
/**
* @param {?} event
* @return {?}
*/
FivIcon.prototype.rotateAnimDone = /**
* @param {?} event
* @return {?}
*/
function (event) {
if (event.fromState === 'normal' && event.toState === 'rotate') {
this._name = this.temp;
this.state = 'normal';
}
if (event.fromState === 'rotate' && event.toState === 'normal') {
this.transitionDone.emit(this._name);
}
};
/**
* @param {?} event
* @return {?}
*/
FivIcon.prototype.incrementDone = /**
* @param {?} event
* @return {?}
*/
function (event) {
if (event.fromState === 'normal' && event.toState === 'scale') {
if (this.tempValue > 0) {
this.badgeState = 'normal';
this._badge = this.tempValue;
}
else {
this._badge = this.tempValue;
}
}
};
FivIcon.decorators = [
{ type: core.Component, args: [{
selector: 'fiv-icon',
template: "<ion-icon [slot]=\"slot\" class=\"icon\" [@rotateAnim]=\"state\" (@rotateAnim.done)=\"rotateAnimDone($event)\" [name]=\"_name\"\n [color]=\"color\"></ion-icon>\n<span [@scaleAnim]=\"indicatorState\" *ngIf=\"dot\" class=\"indicator-dot\"></span>\n<span class=\"off-background\" *ngIf=\"off\"></span>\n<span class=\"off\" *ngIf=\"off\"></span>\n<span *ngIf=\"smallIcon && badge == 0 && !dot\" class=\"indicator-small-icon\">\n <ion-icon [color]=\"color\" slot=\"icon-only\" [name]=\"smallIcon\"></ion-icon>\n</span>\n<span *ngIf=\"badge > 0 && !dot\" [@scaleAnim]=\"badgeState\" (@scaleAnim.done)=\"incrementDone($event)\"\n class=\"indicator-badge\">\n <span *ngIf=\"badge <= 9\">{{badge}}</span>\n <span *ngIf=\"badge > 9\">9+</span>\n</span>",
changeDetection: core.ChangeDetectionStrategy.OnPush,
animations: [
animations.trigger('rotateAnim', [
animations.transition('normal => rotate', [animations.animate('125ms ease-out')]),
animations.transition('rotate => normal', [animations.animate('125ms ease-in')]),
animations.state('rotate', animations.style({ opacity: '0', transform: 'scale(0) rotateZ(45deg)' })),
animations.state('normal', animations.style({ opacity: '1', transform: 'scale(1) rotateZ(0deg)' }))
]),
animations.trigger('scaleAnim', [
animations.transition('void => normal', [
animations.style({ opacity: '0', transform: 'scale(0)' }),
animations.animate('125ms ease-out', animations.style({ opacity: '1', transform: 'scale(1)' }))
]),
animations.transition('normal => scale', [animations.animate('125ms ease-out')]),
animations.transition('scale => normal', [animations.animate('125ms ease-in')]),
animations.state('scale', animations.style({ opacity: '0', transform: 'scale(0)' })),
animations.state('normal', animations.style({ opacity: '1', transform: 'scale(1)' }))
])
],
styles: [":host{--fiv-padding-end:0;--fiv-padding-start:0;--fiv-position-top:-2px;--fiv-position-right:-6px;--fiv-icon-height:28px;--fiv-icon-width:28px;--fiv-small-icon-height:18px;--fiv-small-icon-width:18px;--fiv-small-icon-font-size:0.8em;--fiv-badge-height:18px;--fiv-badge-width:18px;--fiv-badge-font-size:0.6em;--fiv-dot-height:18px;--fiv-dot-width:18px;position:relative;display:inline-block}.icon{margin:0;font-size:1.8em;color:var(--fiv-icon-color,var(--ion-color-dark));padding-right:var(--fiv-padding-end);padding-left:var(--fiv-padding-start);height:var(--fiv-icon-height);width:var(--fiv-icon-width)}.indicator-badge{position:absolute;top:var(--fiv-position-top);right:var(--fiv-position-right);height:var(--fiv-badge-height);width:var(--fiv-badge-width);background-color:var(--fiv-badge-background-color,var(--ion-color-primary));color:var(--fiv-badge-color,var(--ion-color-light));border-radius:14px;z-index:13}.indicator-badge *{position:absolute;transform:translateX(-50%) translateY(-50%);left:50%;top:50%;font-size:var(--fiv-badge-font-size)}.indicator-dot{position:absolute;top:var(--fiv-position-top);right:var(--fiv-position-right);height:var(--fiv-dot-height);width:var(--fiv-dot-width);background-color:var(--fiv-dot-background-color,var(--ion-color-primary));border-radius:100%;z-index:11}.indicator-small-icon{position:absolute;top:var(--fiv-position-top);right:var(--fiv-position-right);height:var(--fiv-small-icon-height);width:var(--fiv-small-icon-width);background-color:var(--fiv-small-icon-background-color,var(--ion-color-primary));color:var(--fiv-small-icon-color,var(--ion-color-light));border-radius:14px;z-index:13}.indicator-small-icon *{position:absolute;transform:translateX(-50%) translateY(-50%);left:50%;top:50%;font-size:var(--fiv-small-icon-font-size)}.off{width:120%;height:2px;background:var(--fiv-off-color,var(--fiv-icon-color,var(--ion-color-dark)));position:absolute;left:0;transform:rotateZ(45deg) translateY(10px) translateX(6px)}.off-background{width:120%;height:2px;background:#000;position:absolute;background-color:var(--fiv-off-background-color,var(--ion-color-light));left:2px;transform:rotateZ(45deg) translateY(10px) translateX(6px)}"]
}] }
];
/** @nocollapse */
FivIcon.ctorParameters = function () { return []; };
FivIcon.propDecorators = {
color: [{ type: core.Input }],
slot: [{ type: core.Input }],
smallIcon: [{ type: core.Input }],
off: [{ type: core.Input }],
animationDisabled: [{ type: core.Input }, { type: core.HostBinding, args: ['@.disabled',] }],
transitionDone: [{ type: core.Output }],
name: [{ type: core.Input }],
badge: [{ type: core.Input }],
dot: [{ type: core.Input }]
};
return FivIcon;
}());
if (false) {
/** @type {?} */
FivIcon.prototype._name;
/** @type {?} */
FivIcon.prototype._badge;
/** @type {?} */
FivIcon.prototype._dot;
/** @type {?} */
FivIcon.prototype.tempValue;
/** @type {?} */
FivIcon.prototype.state;
/** @type {?} */
FivIcon.prototype.temp;
/** @type {?} */
FivIcon.prototype.color;
/** @type {?} */
FivIcon.prototype.slot;
/** @type {?} */
FivIcon.prototype.smallIcon;
/** @type {?} */
FivIcon.prototype.off;
/** @type {?} */
FivIcon.prototype.animationDisabled;
/** @type {?} */
FivIcon.prototype.transitionDone;
/** @type {?} */
FivIcon.prototype.indicatorState;
/** @type {?} */
FivIcon.prototype.badgeState;
}
/**
* @fileoverview added by tsickle
* Generated from: lib/icon/icon.module.ts
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var FivIconModule = /** @class */ (function () {
function FivIconModule() {
}
FivIconModule.decorators = [
{ type: core.NgModule, args: [{
declarations: [FivIcon],
imports: [common.CommonModule, angular.IonicModule],
exports: [FivIcon]
},] }
];
return FivIconModule;
}());
/**
* @fileoverview added by tsickle
* Generated from: lib/app-bar/app-bar-fab.directive.ts
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var FivAppBarFabDirective = /** @class */ (function () {
function FivAppBarFabDirective() {
}
FivAppBarFabDirective.decorators = [
{ type: core.Directive, args: [{
selector: '[fivAppBarFab]',
exportAs: 'fivAppBarFab'
},] }
];
FivAppBarFabDirective.propDecorators = {
fivAppBarFab: [{ type: core.Input }]
};
return FivAppBarFabDirective;
}());
if (false) {
/** @type {?} */
FivAppBarFabDirective.prototype.fivAppBarFab;
}
/**
* @fileoverview added by tsickle
* Generated from: lib/app-bar/app-bar.component.ts
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var FivAppBar = /** @class */ (function () {
function FivAppBar() {
this.cutoutVisible = true;
}
FivAppBar.decorators = [
{ type: core.Component, args: [{
selector: 'fiv-app-bar',
template: "<div class=\"appbar\"\n [ngClass]=\"{'cutout': cutoutVisible, 'left': fivFab.fivAppBarFab === 'left', 'right': fivFab.fivAppBarFab === 'right'}\">\n <div class=\"appbar-rect left\">\n <div class=\"tabs\">\n <ng-content select=\"[left]\"></ng-content>\n </div>\n </div>\n <ng-content select=\"fiv-fab\"></ng-content>\n <svg viewBox=\"0 0 100 50\" width=\"100\" height=\"50\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M100 0v50H0V0c.543 27.153 22.72 49 50 49S99.457 27.153 99.99 0h.01z\" fill=\"red\" fill-rule=\"evenodd\"/></svg>\n <div class=\"rect-filler\"></div>\n <div class=\"appbar-rect right\">\n <div class=\"tabs\">\n <ng-content select=\"[right]\"></ng-content>\n </div>\n </div>\n</div>",
styles: [":host{display:block;position:relative;--fiv-radius:72px;--fiv-appbar-fab-size:56px;--fiv-appbar-height:56px;width:100%;--fiv-border-radius:6px;--fiv-appbar-background-color:var(--ion-color-light);--fiv-side-width:12px;--fiv-fab-icon-color:var(--ion-color-light)}svg{height:calc(var(--fiv-radius)/ 2);width:var(--fiv-radius);left:calc(50% - (var(--fiv-radius)/ 2));position:absolute;bottom:calc(env(safe-area-inset-bottom) + var(--fiv-appbar-height) - var(--fiv-radius)/ 2 - var(--fiv-border-radius))}svg path{fill:var(--fiv-appbar-background-color)}.appbar{width:100%;position:absolute;bottom:0;left:0;height:calc(var(--fiv-appbar-height) + env(safe-area-inset-bottom));background:rgba(0,0,0,0);z-index:5000}.appbar .appbar-rect{overflow:hidden;position:absolute;width:calc(50% - (var(--fiv-radius)/ 2));height:calc(var(--fiv-appbar-height) + env(safe-area-inset-bottom));bottom:0;box-shadow:3px -4px 5px 0 rgba(0,0,0,.1)}.appbar .appbar-rect.left{left:0;background:var(--fiv-appbar-background-color);border-top-right-radius:var(--fiv-border-radius)}.appbar .appbar-rect.right{right:0;background:var(--fiv-appbar-background-color);border-top-left-radius:var(--fiv-border-radius)}.appbar ::ng-deep fiv-fab{position:absolute;left:calc(50% - .5 * var(--fiv-fab-size));top:calc(-.5 * var(--fiv-appbar-fab-size) + var(--fiv-border-radius));display:block;--fiv-fab-size:var(--fiv-appbar-fab-size);z-index:14}.appbar ::ng-deep fiv-fab fiv-icon{--fiv-icon-color:var(--fiv-fab-icon-color)}.appbar .rect-filler{width:var(--fiv-radius);height:calc(env(safe-area-inset-bottom) + var(--fiv-appbar-height) - var(--fiv-radius)/ 2 - var(--fiv-border-radius));position:absolute;overflow:hidden;bottom:0;left:calc(50% - (var(--fiv-radius)/ 2));background:var(--fiv-appbar-background-color)}.appbar:not(.cutout) .appbar-rect.left{border-top-right-radius:0}.appbar:not(.cutout) .appbar-rect.right{border-top-left-radius:0}.appbar.left .appbar-rect.left{width:var(--fiv-side-width)}.appbar.left .appbar-rect.right{width:calc(100% - var(--fiv-radius) - var(--fiv-side-width))}.appbar.left .rect-filler,.appbar.left svg{left:var(--fiv-side-width)}.appbar.left ::ng-deep fiv-fab{transform:translateX(0);left:calc(var(--fiv-side-width) + var(--fiv-radius)/ 2 - var(--fiv-appbar-fab-size)/ 2);position:absolute}.appbar.right .appbar-rect.left{width:calc(100% - var(--fiv-radius) - var(--fiv-side-width))}.appbar.right .appbar-rect.right{width:var(--fiv-side-width)}.appbar.right .rect-filler,.appbar.right svg{left:calc(100% - var(--fiv-radius) - var(--fiv-side-width))}.appbar.right ::ng-deep fiv-fab{transform:translateX(0);left:calc(100% - var(--fiv-side-width) - var(--fiv-radius)/ 2 - var(--fiv-appbar-fab-size)/ 2)}.tabs{display:flex;width:100%;height:100%;position:relative}"]
}] }
];
/** @nocollapse */
FivAppBar.ctorParameters = function () { return []; };
FivAppBar.propDecorators = {
titleMode: [{ type: core.Input }],
fivFab: [{ type: core.ContentChild, args: [FivAppBarFabDirective, { static: false },] }]
};
return FivAppBar;
}());
if (false) {
/** @type {?} */
FivAppBar.prototype.cutoutVisible;
/** @type {?} */
FivAppBar.prototype.titleMode;
/** @type {?} */
FivAppBar.prototype.fivFab;
}
/**
* @fileoverview added by tsickle
* Generated from: lib/app-bar/app-bar-tab/app-bar-tab.component.ts
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var FivAppBarTab = /** @class */ (function () {
function FivAppBarTab(appBar, ionTabs, router, el) {
this.appBar = appBar;
this.ionTabs = ionTabs;
this.router = router;
this.el = el;
this.type = 'unbounded';
}
Object.defineProperty(FivAppBarTab.prototype, "active", {
get: /**
* @return {?}
*/
function () {
return this.router.url.endsWith(this.href);
},
enumerable: true,
configurable: true
});
Object.defineProperty(FivAppBarTab.prototype, "classes", {
get: /**
* @return {?}
*/
function () {
return "label-" + this.appBar.titleMode;
},
enumerable: true,
configurable: true
});
/**
* @return {?}
*/
FivAppBarTab.prototype.ngOnInit = /**
* @return {?}
*/
function () { };
/**
* @return {?}
*/
FivAppBarTab.prototype.onClick = /**
* @return {?}
*/
function () {
this.ionTabs.select(this.tab);
};
FivAppBarTab.decorators = [
{ type: core.Component, args: [{
selector: 'fiv-app-bar-tab',
template: "<ng-template>\n <ng-content></ng-content>\n</ng-template>\n\n<div (click)=\"onClick()\" class=\"tab ion-activatable\" [ngClass]=\"{'active': active}\">\n <ng-content select=\"fiv-icon\"></ng-content>\n <ng-content *ngIf=\"appBar.titleMode === 'show' || (active && appBar.titleMode === 'active-only')\" select=\"ion-label\">\n </ng-content>\n <ion-ripple-effect [type]=\"type\"></ion-ripple-effect>\n</div>",
styles: [":host{width:50%;height:100%;display:inline-block;position:relative}:host .tab{width:100%;height:100%;display:flex;position:relative;flex-direction:column;align-items:center;justify-content:center;overflow:visible}:host .tab.active{--fiv-icon-color:var(--fiv-icon-activ-color, var(--ion-color-primary))}:host .tab.active ::ng-deep ion-label{color:var(--ion-color-primary)}:host(.label-hide) ::ng-deep ion-label{display:none}:host(.label-active-only) .tab:not(.active) ::ng-deep ion-label{display:none}"]
}] }
];
/** @nocollapse */
FivAppBarTab.ctorParameters = function () { return [
{ type: FivAppBar, decorators: [{ type: core.Host }] },
{ type: angular.IonTabs, decorators: [{ type: core.Host }] },
{ type: router.Router },
{ type: core.ElementRef }
]; };
FivAppBarTab.propDecorators = {
tab: [{ type: core.Input }],
href: [{ type: core.Input }],
type: [{ type: core.Input }],
classes: [{ type: core.HostBinding, args: ['class',] }]
};
return FivAppBarTab;
}());
if (false) {
/** @type {?} */
FivAppBarTab.prototype.tab;
/** @type {?} */
FivAppBarTab.prototype.href;
/** @type {?} */
FivAppBarTab.prototype.type;
/** @type {?} */
FivAppBarTab.prototype.appBar;
/** @type {?} */
FivAppBarTab.prototype.ionTabs;
/** @type {?} */
FivAppBarTab.prototype.router;
/** @type {?} */
FivAppBarTab.prototype.el;
}
/**
* @fileoverview added by tsickle
* Generated from: lib/loading-progress-bar/loading.service.ts
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var FivLoadingService = /** @class */ (function () {
function FivLoadingService() {
this.loading = false;
this.isComplete = false;
this.loadChange = new rxjs.BehaviorSubject(this.loading);
this.completeChange = new rxjs.BehaviorSubject(this.isComplete);
}
/**
* @return {?}
*/
FivLoadingService.prototype.load = /**
* @return {?}
*/
function () {
this.loading = true;
this.loadChange.next(this.loading);
};
/**
* @return {?}
*/
FivLoadingService.prototype.unload = /**
* @return {?}
*/
function () {
this.loading = false;
this.loadChange.next(this.loading);
this.isComplete = false;
};
/**
* @return {?}
*/
FivLoadingService.prototype.toggleSpinner = /**
* @return {?}
*/
function () {
this.loading = !this.loading;
};
/**
* @return {?}
*/
FivLoadingService.prototype.complete = /**
* @return {?}
*/
function () {
this.isComplete = true;
this.completeChange.next(this.isComplete);
};
FivLoadingService.decorators = [
{ type: core.Injectable, args: [{
providedIn: 'root'
},] }
];
/** @nocollapse */
FivLoadingService.ctorParameters = function () { return []; };
/** @nocollapse */ FivLoadingService.ngInjectableDef = core.ɵɵdefineInjectable({ factory: function FivLoadingService_Factory() { return new FivLoadingService(); }, token: FivLoadingService, providedIn: "root" });
return FivLoadingService;
}());
if (false) {
/** @type {?} */
FivLoadingService.prototype.loading;
/** @type {?} */
FivLoadingService.prototype.isComplete;
/** @type {?} */
FivLoadingService.prototype.loadChange;
/** @type {?} */
FivLoadingService.prototype.completeChange;
}
/**
* @fileoverview added by tsickle
* Generated from: lib/loading-progress-bar/loading-progress-bar.component.ts
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var FivLoadingProgressBar = /** @class */ (function () {
function FivLoadingProgressBar(loadingService, builder) {
this.loadingService = loadingService;
this.builder = builder;
this.loading = false;
this.global = false;
this.isComplete = false;
this.progress = 0;
this.verticalAlign = 'top';
this.fivComplete = new core.EventEmitter();
this.fivDoneShrinking = new core.EventEmitter();
this.fivRefresh = new core.EventEmitter();
this.animating = false;
}
/**
* @return {?}
*/
FivLoadingProgressBar.prototype.ngOnInit = /**
* @return {?}
*/
function () {
var _this = this;
if (this.global) {
this.loadingService.completeChange.subscribe((/**
* @param {?} isComplete
* @return {?}
*/
function (isComplete) {
if (isComplete) {
_this.complete(null);
}
}));
}
};
/**
* @return {?}
*/
FivLoadingProgressBar.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
if (this.global) {
this.loadingService.completeChange.unsubscribe();
}
};
/**
* @return {?}
*/
FivLoadingProgressBar.prototype.toggleSpinner = /**
* @return {?}
*/
function () {
this.loading = !this.loading;
};
/**
* @return {?}
*/
FivLoadingProgressBar.prototype.load = /**
* @return {?}
*/
function () {
this.loading = true;
this.fivRefresh.emit(this);
};
/**
* @return {?}
*/
FivLoadingProgressBar.prototype.unload = /**
* @return {?}
*/
function () {
this.loading = false;
if (this.isComplete) {
this.isComplete = false;
}
};
/**
* @param {?=} param
* @return {?}
*/
FivLoadingProgressBar.prototype.complete = /**
* @param {?=} param
* @return {?}
*/
function (param) {
this.param = param;
this.isComplete = true;
this.fillIn(850);
};
/**
* @param {?} isComplete
* @return {?}
*/
FivLoadingProgressBar.prototype.fillAnimationComplete = /**
* @param {?} isComplete
* @return {?}
*/
function (isComplete) {
if (isComplete) {
this.fivComplete.emit(this.param);
this.isComplete = false;
this.param = null;
if (this.global) {
this.loadingService.unload();
}
else {
this.unload();
}
}
};
/**
* @param {?} progress
* @return {?}
*/
FivLoadingProgressBar.prototype.setProgress = /**
* @param {?} progress
* @return {?}
*/
function (progress) {
if (progress < 0) {
this.progress = 0;
return;
}
if (progress > 100) {
this.progress = 100;
return;
}
this.progress = progress;
};
/**
* @param {?} ms
* @return {?}
*/
FivLoadingProgressBar.prototype.fillIn = /**
* @param {?} ms
* @return {?}
*/
function (ms) {
var _this = this;
// first define a reusable animation
this.progress = 0;
/** @type {?} */
var myAnimation = this.builder.build([
animations.style({ width: this.progress + "%" }),
animations.animate(ms, animations.style({ width: '100%' }))
]);
// use the returned factory object to create a player
/** @type {?} */
var player = myAnimation.create(this.linear.nativeElement);
/** @type {?} */
var t = rxjs.timer(0, ms / 100).subscribe((/**
* @return {?}
*/
function () {
if (_this.progress <= 0) {
return t.unsubscribe();
}
_this.progress++;
}));
player.play();
player.onDone((/**
* @return {?}
*/
function () {
if (_this.animating) {
_this.fillAnimationComplete(true);
_this.stopProgressAnimation();
}
}));
this.stopProgressAnimation();
this.animating = true;
this._progressPlayer = player;
};
/**
* @param {?} ms
* @return {?}
*/
FivLoadingProgressBar.prototype.shrinkIn = /**
* @param {?} ms
* @return {?}
*/
function (ms) {
var _this = this;
// first define a reusable animation
this.progress = 100;
/** @type {?} */
var myAnimation = this.builder.build([
animations.style({ width: this.progress + "%" }),
animations.animate(ms, animations.style({ width: 0 }))
]);
// use the returned factory object to create a player
/** @type {?} */
var player = myAnimation.create(this.linear.nativeElement);
/** @type {?} */
var t = rxjs.timer(0, ms / 100).subscribe((/**
* @return {?}
*/
function () {
if (_this.progress <= 0) {
return t.unsubscribe();
}
_this.progress--;
}));
player.play();
player.onDone((/**
* @return {?}
*/
function () {
if (_this.animating) {
_this.fivDoneShrinking.emit(true);
_this.stopProgressAnimation();
}
}));
this.stopProgressAnimation();
this.animating = true;
this._progressPlayer = player;
};
/**
* @return {?}
*/
FivLoadingProgressBar.prototype.stopProgressAnimation = /**
* @return {?}
*/
function () {
if (this._progressPlayer) {
this._progressPlayer.destroy();
this._progressPlayer = null;
this.animating = false;
}
};
FivLoadingProgressBar.decorators = [
{ type: core.Component, args: [{
selector: 'fiv-loading-progress-bar',
template: "<div [@progressAnim] *ngIf=\"(!global && loading) || (global && loadingService.loading)\" class=\"slider\" [ngClass]=\"{'top':verticalAlign == 'top','bottom': verticalAlign == 'bottom'}\" >\n <div class=\"line\"></div>\n <div *ngIf=\"!isComplete\" class=\"subline inc\"></div>\n <!-- <div *ngIf=\"isComplete\" [@fillAnim] (@fillAnim.done)=\"fillAnimationComplete(isComplete)\" class=\"subline fill\"></div> -->\n <div *ngIf=\"!isComplete\" class=\"subline dec\"></div>\n</div>\n<div #linear [@progressAnimLinear] class=\"progress\" [ngClass]=\"{'top':verticalAlign == 'top','bottom': verticalAlign == 'bottom'}\" ></div>\n",
animations: [
animations.trigger('progressAnim', [
animations.transition('void => *', [
animations.style({ height: '0px' }),
animations.animate('250ms ease-out')
]),
animations.transition('* => void', [
animations.animate('299ms ease-in', animations.style({ height: '0px' }))
])
]),
animations.trigger('progressAnimLinear', [
animations.transition('void => *', [
animations.style({ height: '0px' }),
animations.animate('65ms ease-out')
]),
animations.transition('* => void', [
animations.animate('299ms ease-in', animations.style({ height: '0px' }))
])
]),
animations.trigger('fillAnim', [
animations.transition('void => *', [
animations.style({
width: '0px'
}),
animations.animate('850ms ease-out', animations.style({ width: '100%' }))
])
])
],
styles: [":host{--background-progress-bar:var(--ion-color-primary);--background-progress:var(--ion-color-primary-shade);--color-spin-0:var(--background-progress);--color-spin-25:var(--background-progress);--color-spin-50:var(--background-progress);--color-spin-75:var(--background-progress);--color-spin-100:var(--background-progress)}.slider{position:absolute;width:100%;height:5px;overflow-x:hidden;z-index:5000}.progress{position:absolute;height:5px;width:0;overflow-x:hidden;z-index:5000;background:var(--background-progress-bar);transition:240ms}.line{position:absolute;opacity:.4;width:240%;height:5px;-webkit-animation:5.6s ease-in-out infinite colorspin;animation:5.6s ease-in-out infinite colorspin}.subline{position:absolute;height:5px;background:inherit}.inc{-webkit-animation:1.6s infinite increase,5.6s ease-in-out infinite colorspin;animation:1.6s infinite increase,5.6s ease-in-out infinite colorspin}.dec{-webkit-animation:1.6s .4s infinite decrease,5.6s ease-in-out infinite colorspin;animation:1.6s .4s infinite decrease,5.6s ease-in-out infinite colorspin}.fill{left:0;width:100%;-webkit-animation:5.6s ease-in-out infinite colorspin;animation:5.6s ease-in-out infinite colorspin}@-webkit-keyframes increase{from{left:-5%;width:5%}to{left:130%;width:100%}}@keyframes increase{from{left:-5%;width:5%}to{left:130%;width:100%}}@-webkit-keyframes decrease{from{left:-80%;width:80%}to{left:110%;width:10%}}@keyframes decrease{from{left:-80%;width:80%}to{left:110%;width:10%}}@-webkit-keyframes colorspin{0%{background-color:var(--color-spin-0)}25%{background-color:var(--color-spin-25)}50%{background-color:var(--color-spin-50)}75%{background-color:var(--color-spin-75)}100%{background-color:var(--color-spin-100)}}@keyframes colorspin{0%{background-color:var(--color-spin-0)}25%{background-color:var(--color-spin-25)}50%{background-color:var(--color-spin-50)}75%{background-color:var(--color-spin-75)}100%{background-color:var(--color-spin-100)}}.top{top:0;left:0}.bottom{bottom:0;left:0}"]
}] }
];
/** @nocollapse */
FivLoadingProgressBar.ctorParameters = function () { return [
{ type: FivLoadingService },
{ type: animations.AnimationBuilder }
]; };
FivLoadingProgressBar.propDecorators = {
loading: [{ type: core.Input }],
global: [{ type: core.Input }],
isComplete: [{ type: core.Input }],
verticalAlign: [{ type: core.Input }],
fivComplete: [{ type: core.Output }],
fivDoneShrinking: [{ type: core.Output }],
fivRefresh: [{ type: core.Output }],
bar: [{ type: core.ViewChild, args: ['bar', { static: false },] }],
linear: [{ type: core.ViewChild, args: ['linear', { static: false },] }]
};
return FivLoadingProgressBar;
}());
if (false) {
/** @type {?} */
FivLoadingProgressBar.prototype.loading;
/** @type {?} */
FivLoadingProgressBar.prototype.global;
/** @type {?} */
FivLoadingProgressBar.prototype.isComplete;
/** @type {?} */
FivLoadingProgressBar.prototype.progress;
/** @type {?} */
FivLoadingProgressBar.prototype.verticalAlign;
/** @type {?} */
FivLoadingProgressBar.prototype.fivComplete;
/** @type {?} */
FivLoadingProgressBar.prototype.fivDoneShrinking;
/** @type {?} */
FivLoadingProgressBar.prototype.fivRefresh;
/** @type {?} */
FivLoadingProgressBar.prototype.bar;
/** @type {?} */
FivLoadingProgressBar.prototype.linear;
/** @type {?} */
FivLoadingProgressBar.prototype.param;
/** @type {?} */
FivLoadingProgressBar.prototype._progressPlayer;
/**
* @type {?}
* @private
*/
FivLoadingProgressBar.prototype.animating;
/** @type {?} */
FivLoadingProgressBar.prototype.loadingService;
/**
* @type {?}
* @private
*/
FivLoadingProgressBar.prototype.builder;
}
/**
* @fileoverview added by tsickle
* Generated from: lib/loading-progress-bar/loading-progress-bar.module.ts
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var FivLoadingProgressBarModule = /** @class */ (function () {
function FivLoadingProgressBarModule() {
}
FivLoadingProgressBarModule.decorators = [
{ type: core.NgModule, args: [{
declarations: [FivLoadingProgressBar],
imports: [common.CommonModule],
exports: [FivLoadingProgressBar],
providers: [FivLoadingService]
},] }
];
return FivLoadingProgressBarModule;
}());
/**
* @fileoverview added by tsickle
* Generated from: lib/center/center.directive.ts
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var FivCenter = /** @class */ (function () {
function FivCenter(sanitizer) {
this.sanitizer = sanitizer;
this.vertical = true;
this.horizontal = true;
}
Object.defineProperty(FivCenter.prototype, "myStyle", {
get: /**
* @return {?}
*/
function () {
// tslint:disable-next-line:max-line-length
/** @type {?} */
var style = "position: absolute; " + (this.vertical && this.horizontal
? 'top: 50%; left: 50%; transform: translateY(-50%) translateX(-50%);'
: this.vertical
? 'top: 50%; transform: translateY(-50%);'
: 'left: 50%; transform: translateX(-50%);');