"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 });
const core_1 = require("@angular/core");
const core_2 = require("@jsonforms/core");
const store_1 = require("@angular-redux/store");
const JsonFormsIonicLayout_1 = require("../../layouts/JsonFormsIonicLayout");
let LabelRenderer = class LabelRenderer extends JsonFormsIonicLayout_1.JsonFormsIonicLayout {
    constructor(ngRedux) {
        super(ngRedux);
    }
    ngOnInit() {
        // TODO: this is using connectLayoutToJsonForms
        const state$ = this.connectLayoutToJsonForms(this.ngRedux, this.getOwnProps());
        this.subscription = state$.subscribe(state => {
            this.label = state.uischema.label;
        });
    }
    ngOnDestroy() {
        this.subscription.unsubscribe();
    }
};
LabelRenderer = __decorate([
    core_1.Component({
        selector: 'label',
        template: `
      <div>
          {{label}}
      </div>
  `
    }),
    __metadata("design:paramtypes", [store_1.NgRedux])
], LabelRenderer);
exports.LabelRenderer = LabelRenderer;
exports.labelTester = core_2.rankWith(4, core_2.uiTypeIs('Label'));
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibGFiZWwuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9zcmMvb3RoZXIvbGFiZWwvbGFiZWwudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7QUFBQSx3Q0FBMEM7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