innotec-materials
Version:
Innotec Materials is an UI framework who's desgined for all products of Innotec GmbH. Innotec Materials is based on Angular 2 an bootstrap.
127 lines • 7.36 kB
JavaScript
"use strict";
var __decorate = (this && this.__decorate) || function (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;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", { value: true });
var core_1 = require("@angular/core");
var forms_1 = require("@angular/forms");
var platform_browser_1 = require("@angular/platform-browser");
var noop = function () { };
var CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR = {
provide: forms_1.NG_VALUE_ACCESSOR,
useExisting: core_1.forwardRef(function () { return Contactchannel; }),
multi: true
};
var Contactchannel = (function () {
function Contactchannel(sanitizer) {
this.sanitizer = sanitizer;
this.toggletime = 8000;
this.reachabletext = 'Reachable';
this.valuechange = new core_1.EventEmitter();
this._value = '';
this._onTouchedCallback = noop;
this._onChangeCallback = noop;
this.reachableclass = 'contactchannel_reachable';
}
Object.defineProperty(Contactchannel.prototype, "value", {
get: function () {
if (!this._value) {
return '';
}
return this._value;
},
set: function (v) {
if (v !== this._value) {
this._value = v;
this._onChangeCallback(v);
}
},
enumerable: true,
configurable: true
});
;
Contactchannel.prototype.onTouched = function () {
this._onTouchedCallback();
};
Contactchannel.prototype.writeValue = function (value) {
this._value = value;
};
Contactchannel.prototype.registerOnChange = function (fn) {
this._onChangeCallback = fn;
};
Contactchannel.prototype.registerOnTouched = function (fn) {
this._onTouchedCallback = fn;
};
Contactchannel.prototype.openReachable = function () {
var _this = this;
if (this.reachableclass === 'contactchannel_reachable open') {
this.keyvaluehidden = false;
return this.reachableclass = 'contactchannel_reachable';
}
this.keyvaluehidden = true;
this.reachableclass = 'contactchannel_reachable open';
setTimeout(function () {
_this.reachableclass = 'contactchannel_reachable';
_this.keyvaluehidden = false;
}, this.toggletime);
};
Contactchannel.prototype.keyvaluechange = function (ev) {
this.valuechange.emit(ev);
};
Contactchannel.prototype.ngOnInit = function () {
var _this = this;
setTimeout(function () {
_this.ahref = _this.sanitizer.bypassSecurityTrustUrl(_this.method + ':' + _this.value.value);
_this.smshref = _this.sanitizer.bypassSecurityTrustUrl('sms:' + _this.value.value);
}, 100);
};
__decorate([
core_1.Input(),
__metadata("design:type", Boolean)
], Contactchannel.prototype, "disabled", void 0);
__decorate([
core_1.Input(),
__metadata("design:type", Object)
], Contactchannel.prototype, "toggletime", void 0);
__decorate([
core_1.Input(),
__metadata("design:type", Object)
], Contactchannel.prototype, "reachabletext", void 0);
__decorate([
core_1.Input(),
__metadata("design:type", String)
], Contactchannel.prototype, "smstext", void 0);
__decorate([
core_1.Input(),
__metadata("design:type", String)
], Contactchannel.prototype, "method", void 0);
__decorate([
core_1.Input(),
__metadata("design:type", String)
], Contactchannel.prototype, "icon", void 0);
__decorate([
core_1.Input(),
__metadata("design:type", String)
], Contactchannel.prototype, "title", void 0);
__decorate([
core_1.Output(),
__metadata("design:type", Object)
], Contactchannel.prototype, "valuechange", void 0);
Contactchannel = __decorate([
core_1.Component({
selector: 'contactchannel',
template: "\n <div class=\"contactchannel_main\"><div class=\"font_item\"><span class=\"contactchannel_item\" *ngIf=\"!method\" [class]=\"icon\"></span><a *ngIf=\"method\" [href]=\"ahref\"><span class=\"contactchannel_item\" [class]=\"icon\"></span></a> </div><div class=\"contactchannel_body\"><key-value class=\"contactchannel_item\" *ngIf=\"!keyvaluehidden\" [key]=\"title\" editicon=\"icon-pen-on-paper-edit\" inputtype=\"text\" [(ngModel)]=\"value.value\" [disabled]=\"value.reachable\" (valuechange)=\"keyvaluechange($event)\"></key-value><div class=\"contactchannel_item blankkey\" *ngIf=\"keyvaluehidden\"> </div><span class=\"icon-more contactchannel_clickable\" (click)=\"openReachable()\"></span></div><div class=\"contactchannel_reachable\" [class]=\"reachableclass\"><div class=\"contactchannel_reachablecont\"><div class=\"contactchannel_reachablecontitem contactchannel_clickable contactchannel_reachableelement\" (click)=\"value.reachable = !value.reachable; keyvaluechange();\">{{ reachabletext }}</div><div class=\"contactchannel_reachablecontitem contactchannel_clickable contactchannel_reachableelement\" (click)=\"value.reachable = !value.reachable; keyvaluechange();\"><span class=\"glyphicon glyphicon-thumbs-up\" *ngIf=\"value.reachable\"></span><span class=\"glyphicon glyphicon-thumbs-down\" *ngIf=\"!value.reachable\"></span></div><div class=\"contactchannel_reachablecontitem contactchannel_reachableelement\" *ngIf=\"value.reachable\"><a *ngIf=\"value.reachable\" [href]=\"ahref\"><span [class]=\"icon\"></span></a></div><div class=\"contactchannel_reachablecontitem\"> </div><div class=\"contactchannel_reachablecontitem contactchannel_clickable contactchannel_reachableelement\" *ngIf=\"smstext\" (click)=\"value.reachableSMS = !value.reachableSMS; keyvaluechange();\">{{ smstext }}</div><div class=\"contactchannel_reachablecontitem contactchannel_clickable contactchannel_reachableelement\" *ngIf=\"smstext\" (click)=\"value.reachableSMS = !value.reachableSMS; keyvaluechange();\"><span class=\"glyphicon glyphicon-thumbs-up\" *ngIf=\"value.reachableSMS\"></span><span class=\"glyphicon glyphicon-thumbs-down\" *ngIf=\"!value.reachableSMS\"></span></div><div class=\"contactchannel_reachablecontitem contactchannel_reachableelement\" *ngIf=\"smstext\"><a *ngIf=\"value.reachableSMS\" [href]=\"smshref\"><div class=\"icon-sms\"></div></a></div></div></div></div>\n ",
providers: [CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR]
}),
__metadata("design:paramtypes", [platform_browser_1.DomSanitizer])
], Contactchannel);
return Contactchannel;
}());
exports.Contactchannel = Contactchannel;
//# sourceMappingURL=contactchannel.component.js.map