/**
 * @fileoverview added by tsickle
 * Generated from: lib/fhir/organization/add/organization-add.component.ts
 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
import { getOrganizationForm } from './../models/organization-form.model';
import { ContactInfoComponent, getContactFormGroup } from '../../../widgets/entry-components/modal/components/contact-info/contact-info.component';
import { TelecomAddComponent, getTelecomFormGroup } from '../../../widgets/entry-components/modal/components/telecom-add/telecom-add.component';
import { ModalService } from '../../../widgets/entry-components/modal/services/modal.service';
import { Component } from '@angular/core';
import { ActionSheetController } from '@ionic/angular';
import { AddressComponent, getAddressFormGroup } from '../../../widgets/entry-components/modal/components/address/address.component';
import { TranslatePipe } from '../../../shared/translate/pipes/translate.pipe';
import { AbstractAddWmodalComponent } from '../../../shared/abstracts/add/abstract-add-wmodal/abstract-add-wmodal.component';
export class OrganizationAddComponent extends AbstractAddWmodalComponent {
    /**
     * @param {?} modalService
     * @param {?} actionSheetController
     * @param {?} translatePipe
     */
    constructor(modalService, actionSheetController, translatePipe) {
        super(modalService, actionSheetController, translatePipe);
        this.modalComponents = {
            address: (/**
             * @return {?}
             */
            () => AddressComponent),
            telecom: (/**
             * @return {?}
             */
            () => TelecomAddComponent),
            contact: (/**
             * @return {?}
             */
            () => ContactInfoComponent)
        };
    }
    /**
     * @return {?}
     */
    pushInto() {
        this.pushIntoFormArray(this.inData, 'address', getAddressFormGroup);
        this.pushIntoFormArray(this.inData, 'telecom', getTelecomFormGroup);
        this.pushIntoFormArray(this.inData, 'contact', getContactFormGroup);
    }
    /**
     * @return {?}
     */
    resetForm() {
        if (this.form) {
            return this.form;
        }
        return getOrganizationForm();
    }
}
OrganizationAddComponent.decorators = [
    { type: Component, args: [{
                selector: 'inc-organization-add',
                template: "<form [formGroup]=\"form\" (ngSubmit)=\"save(form.value)\">\r\n  <ion-grid class=\"ion-padding\">\r\n    <ion-row>\r\n      <ion-col size=\"10\" sizeMd=\"6\">\r\n        <ion-item>\r\n          <ion-label position=\"floating\">\r\n            {{'ORG_NAME' | translate}}\r\n            <span class=\"required\">*</span>\r\n          </ion-label>\r\n          <ion-input type=\"text\" autofocus=\"true\" formControlName=\"name\" clearInput>\r\n          </ion-input>\r\n        </ion-item>\r\n      </ion-col>\r\n      <ion-col size=\"12\" sizeMd=\"6\" formArrayName=\"identifier\">\r\n        <ion-item formGroupName=\"0\">\r\n          <ion-label position=\"floating\">\r\n            {{'ORGANIZATION_ID' | translate}}\r\n          </ion-label>\r\n          <ion-input type=\"text\" formControlName=\"value\" clearInput\r\n            id=\"practitioner-social-security-number\">\r\n          </ion-input>\r\n        </ion-item>\r\n      </ion-col>\r\n    </ion-row> \r\n    <ion-col>\r\n      <ion-button expand=\"block\" fill=\"outline\" (click)=\"addDetails()\" id=\"plus-data-button\">\r\n        <ion-icon slot=\"start\" name=\"add\"></ion-icon>{{'DATA' | translate}}\r\n      </ion-button>\r\n    </ion-col>\r\n    <ion-row *ngIf=\"form.value.address.length > 0\">\r\n      <ion-col>\r\n        <b class=\"ion-text-uppercase\">{{'ADDRESS' | translate}}</b>\r\n        <ion-chip *ngFor=\"let addressElement of form.value.address; let i = index\" outline=\"true\" color=\"dark\"\r\n          id=\"organization-full-address\">\r\n          <ion-label>{{addressElement | address}}</ion-label>\r\n          <ion-icon name=\"close\" (click)=\"deleteFromFormArray('address', i)\"></ion-icon>\r\n        </ion-chip>\r\n      </ion-col>\r\n    </ion-row>\r\n    <ion-row *ngIf=\"form.value.telecom.length > 0\">\r\n      <ion-col>\r\n        <b class=\"ion-text-uppercase\">{{'AVAILABILITY' | translate}} </b>\r\n        <ion-chip *ngFor=\"let tel of form.value.telecom; let i = index\" outline=\"true\" color=\"dark\"\r\n          id=\"organization-telecom\">\r\n          <ion-label color=\"primary\" *ngIf=\"i === 0\"><b>{{tel.value}}</b></ion-label>\r\n          <ion-label *ngIf=\"i !== 0\">{{tel.value}}</ion-label>\r\n          <ion-icon name=\"close\" (click)=\"deleteFromFormArray('telecom', i)\"></ion-icon>\r\n        </ion-chip>\r\n      </ion-col>\r\n    </ion-row>\r\n    <ion-row *ngIf=\"form.value.contact.length > 0\">\r\n      <ion-col>\r\n        <ion-text class=\"ion-text-uppercase\">\r\n          <p> <b>{{'CONTACT_INFO' | translate}}</b> </p>\r\n        </ion-text>\r\n        <ion-list lines=\"none\">\r\n          <ion-item *ngFor=\"let contact of form.value.contact; let i = index\" id=\"organization-contact\">\r\n            <ion-avatar slot=\"start\">\r\n              <div incMonoAvatar [name]=\"contact.name[0].text\"></div>\r\n            </ion-avatar>\r\n            <ion-label>\r\n              <h2>{{contact.name[0].text}}</h2>\r\n              <h3 *ngIf=\"contact.telecom[0].value\">{{contact.telecom[0].value}}</h3>\r\n              <p *ngIf=\"contact.telecom[1].value\">{{contact.telecom[1].value}}</p>\r\n            </ion-label>\r\n            <ion-buttons>\r\n              <ion-button (click)=\"deleteFromFormArray('contact', i)\">\r\n                <ion-icon slot=\"icon-only\" name=\"close\"></ion-icon>\r\n              </ion-button>\r\n            </ion-buttons>\r\n          </ion-item>\r\n        </ion-list>\r\n      </ion-col>\r\n    </ion-row>\r\n    <ion-row class=\"ion-float-right ion-margin-bottom ion-margin-top\">\r\n      <ion-button fill=\"outline\" color=\"primary\" id=\"basic-data-reject-button\" *ngIf=\"inData\" (click)=\"discard()\"\r\n        class=\"ion-margin-end\">\r\n        <ion-icon slot=\"start\" name=\"close\"></ion-icon>{{'REJECT_BUTTON' | translate}}\r\n      </ion-button>\r\n      <ion-button fill=\"outline\" *ngIf=\"!inData\" color=\"primary\" id=\"basic-data-reset-button\" (click)=\"reset()\"\r\n        class=\"ion-margin-end\">\r\n        <ion-icon slot=\"start\" name=\"refresh\"></ion-icon>{{'AGAIN_BUTTON' | translate}}\r\n      </ion-button>\r\n      <ion-button id=\"basic-data-save-button\" type=\"submit\" [disabled]=\"form.invalid\">\r\n        <ion-icon slot=\"start\" name=\"save\"></ion-icon>{{'SAVE_BUTTON' | translate}}\r\n      </ion-button>\r\n    </ion-row>\r\n  </ion-grid>\r\n</form>",
                styles: ["@media (min-width:768px){.radio-hor{display:flex;flex-direction:row}.radio-hor ion-item{width:100%}}"]
            }] }
];
/** @nocollapse */
OrganizationAddComponent.ctorParameters = () => [
    { type: ModalService },
    { type: ActionSheetController },
    { type: TranslatePipe }
];
if (false) {
    /** @type {?} */
    OrganizationAddComponent.prototype.modalComponents;
}
//# sourceMappingURL=data:application/json;base64, 