"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 angular_1 = require("@jsonforms/angular");
class JsonFormsIonicLayout extends angular_1.JsonFormsBaseRenderer {
    constructor(ngRedux) {
        super();
        this.ngRedux = ngRedux;
        this.connectLayoutToJsonForms = (store, ownProps) => {
            return store.select().map(state => {
                return core_2.mapStateToLayoutProps(state, ownProps);
            });
        };
    }
    ngOnInit() {
        const ownProps = Object.assign({}, this.getOwnProps(), { path: this.path });
        const state$ = this.connectLayoutToJsonForms(this.ngRedux, ownProps);
        this.subscription = state$.subscribe(state => {
            this.elements = state.uischema.elements;
        });
    }
    ngOnDestroy() {
        this.subscription.unsubscribe();
    }
}
__decorate([
    core_1.Input(),
    __metadata("design:type", String)
], JsonFormsIonicLayout.prototype, "path", void 0);
exports.JsonFormsIonicLayout = JsonFormsIonicLayout;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiSnNvbkZvcm1zSW9uaWNMYXlvdXQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zcmMvbGF5b3V0cy9Kc29uRm9ybXNJb25pY0xheW91dC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7OztBQUFBLHdDQUEwRDtBQ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