import { Component } from '@angular/core';
import { AbstractFieldReadComponent } from '../base-field/abstract-field-read.component';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "../markdown/markdown.component";
import * as i3 from "rpx-xui-translation";
import * as i4 from "../fixed-list/fixed-list.pipe";
function ReadDynamicMultiSelectListFieldComponent_div_0_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div");
    i0.ɵɵelement(1, "ccd-markdown", 1);
    i0.ɵɵpipe(2, "ccdFixedList");
    i0.ɵɵpipe(3, "rpxTranslate");
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const value_r1 = ctx.$implicit;
    const ctx_r1 = i0.ɵɵnextContext();
    i0.ɵɵadvance();
    i0.ɵɵproperty("content", i0.ɵɵpipeBind1(3, 4, i0.ɵɵpipeBind2(2, 1, value_r1.code, ctx_r1.caseField.list_items)));
} }
export class ReadDynamicMultiSelectListFieldComponent extends AbstractFieldReadComponent {
    ngOnInit() {
        /**
         *
         * Reassigning list_items from formatted_list when list_items is empty
         */
        if (!this.caseField.list_items && this.caseField.formatted_value && this.caseField.formatted_value.list_items) {
            this.caseField.list_items = this.caseField.formatted_value.list_items;
        }
        if (!this.caseField.value && this.caseField.formatted_value && this.caseField.formatted_value.value) {
            this.caseField.value = this.caseField.formatted_value.value;
        }
        super.ngOnInit();
    }
    static ɵfac = /*@__PURE__*/ (() => { let ɵReadDynamicMultiSelectListFieldComponent_BaseFactory; return function ReadDynamicMultiSelectListFieldComponent_Factory(__ngFactoryType__) { return (ɵReadDynamicMultiSelectListFieldComponent_BaseFactory || (ɵReadDynamicMultiSelectListFieldComponent_BaseFactory = i0.ɵɵgetInheritedFactory(ReadDynamicMultiSelectListFieldComponent)))(__ngFactoryType__ || ReadDynamicMultiSelectListFieldComponent); }; })();
    static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ReadDynamicMultiSelectListFieldComponent, selectors: [["ccd-read-dynamic-multi-select-list-field"]], features: [i0.ɵɵInheritDefinitionFeature], decls: 1, vars: 1, consts: [[4, "ngFor", "ngForOf"], [3, "content"]], template: function ReadDynamicMultiSelectListFieldComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵtemplate(0, ReadDynamicMultiSelectListFieldComponent_div_0_Template, 4, 6, "div", 0);
        } if (rf & 2) {
            i0.ɵɵproperty("ngForOf", ctx.caseField.value);
        } }, dependencies: [i1.NgForOf, i2.MarkdownComponent, i3.RpxTranslatePipe, i4.FixedListPipe], styles: [".multi-select-list-field-table[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]{padding:5px 0}.multi-select-list-field-table[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%]:last-child > td[_ngcontent-%COMP%]{border-bottom:none}.multi-select-list-field-table[_ngcontent-%COMP%]   td.collection-actions[_ngcontent-%COMP%]{width:1px;white-space:nowrap}"] });
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ReadDynamicMultiSelectListFieldComponent, [{
        type: Component,
        args: [{ selector: 'ccd-read-dynamic-multi-select-list-field', template: "<div *ngFor=\"let value of caseField.value\">\n  <ccd-markdown [content]=\"value.code | ccdFixedList:caseField.list_items | rpxTranslate\"></ccd-markdown>\n</div>\n", styles: [".multi-select-list-field-table tr>td{padding:5px 0}.multi-select-list-field-table tr:last-child>td{border-bottom:none}.multi-select-list-field-table td.collection-actions{width:1px;white-space:nowrap}\n"] }]
    }], null, null); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ReadDynamicMultiSelectListFieldComponent, { className: "ReadDynamicMultiSelectListFieldComponent", filePath: "lib/shared/components/palette/dynamic-multi-select-list/read-dynamic-multi-select-list-field.component.ts", lineNumber: 9 }); })();
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVhZC1keW5hbWljLW11bHRpLXNlbGVjdC1saXN0LWZpZWxkLmNvbXBvbmVudC5qcyIsIn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