[{"__symbolic":"module","version":4,"metadata":{"MapResponseToListAndSummaryData":{"__symbolic":"function"},"MapGetItemResponseToListAndSummaryData":{"__symbolic":"function","parameters":["response"],"value":{"list":[{"__symbolic":"select","expression":{"__symbolic":"reference","name":"response"},"member":"body"}],"summary":{"pagination":{"curPage":1,"pageSize":1,"pageCount":1},"totalCount":1}}},"Pagination":{"__symbolic":"interface"},"SummaryData":{"__symbolic":"interface"},"ListAndSummaryData":{"__symbolic":"interface"},"LevelType":{"__symbolic":"interface"},"DataTableConfig":{"__symbolic":"interface"},"CuiDataTableAsyncComponent":{"__symbolic":"class","arity":1,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":102,"character":1},"arguments":[{"selector":"cui-data-table-async","encapsulation":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewEncapsulation","line":108,"character":17},"member":"None"},"template":"<div class=\"row mb-3\" *ngIf=\"config.title || config.additionalData || IsNeedShowPagination()\">\n  <div class=\"col-6\">\n    <p *ngIf=\"config.title\" [class]=\"'h' + (config.titleLevel ? config.titleLevel : 1)\">{{config.title}}</p>\n    <div *ngIf=\"config.additionalData\">\n      <p *ngFor=\"let data of config.additionalData()\">\n        <i>{{data.label}}: </i><i>{{data.value}}</i>\n      </p>\n    </div>\n  </div>\n  <div class=\"col-6\">\n    <div class=\"float-right\">\n      <pagination *ngIf=\"IsNeedShowPagination()\"\n                  [totalItems]=\"summaryData.totalCount\"\n                  [(ngModel)]=\"summaryData.pagination.curPage\"\n                  [itemsPerPage]=\"summaryData.pagination.pageSize\"\n                  [maxSize]=\"10\"\n                  [disabled]=\"isLoadingRows\"\n                  [firstText]=\"'<<'\"\n                  [previousText]=\"'<'\"\n                  [nextText]=\"'>'\"\n                  [lastText]=\"'>>'\"\n                  [boundaryLinks]=\"true\"\n                  (pageChanged)=\"SetPageAndUpdate($event.page)\">\n      </pagination>\n    </div>\n  </div>\n</div>\n<div class=\"row mb-3\" *ngIf=\"config.enableSearch\">\n  <div class=\"col-6\">\n    <input class=\"form-control\" [(ngModel)]=\"searchString\" [placeholder]=\"config.searchHint\" [disabled]=\"isLoadingRows\">\n  </div>\n  <div class=\"col-3\">\n    <button class=\"btn btn-primary\" (click)=\"UpdateDataOnPage()\" [disabled]=\"isLoadingRows\">Поиск</button>\n  </div>\n</div>\n<div [class]=\"this.config.isResponsive ? 'table-responsive' : ''\">\n  <table class=\"table\">\n    <tr>\n      <th *ngFor=\"let property of config.properties; index as i\"\n          [width]=\"property.width\"\n          [class]=\"ResolveTableHeaderColumnClass(property.enableSort, i)\"\n          (click)=\"ResolveTableHeaderColumnClick(property, i)\"\n      >\n        <div class=\"col-12\">\n          {{property.label + ResolveUnitPostfix(property)}}\n        </div>\n      </th>\n      <th class=\"border text-center\" *ngIf=\"IsNeedDrawButtonColumns()\" [attr.colspan]=\"CountButtons()\">\n        <a *ngIf=\"config.isEnableSort\"\n           class=\"btn btn-link icon-close\"\n           (click)=\"ClearSortData()\"\n           title=\"Сбросить настройки сортировки\"\n        >\n        </a>\n      </th>\n    </tr>\n    <ng-template [ngIf]=\"isLoadingRows\" [ngIfElse]=\"loadedRows\">\n      <tr>\n        <td class=\"border\" [attr.colspan]=\"config.properties.length + 1\" style=\"padding: 2% 0 2% 45% !important;\">\n          <div class=\"sk-circle-fade\">\n            <div class=\"sk-circle-fade-dot\"></div>\n            <div class=\"sk-circle-fade-dot\"></div>\n            <div class=\"sk-circle-fade-dot\"></div>\n            <div class=\"sk-circle-fade-dot\"></div>\n            <div class=\"sk-circle-fade-dot\"></div>\n            <div class=\"sk-circle-fade-dot\"></div>\n            <div class=\"sk-circle-fade-dot\"></div>\n            <div class=\"sk-circle-fade-dot\"></div>\n            <div class=\"sk-circle-fade-dot\"></div>\n            <div class=\"sk-circle-fade-dot\"></div>\n            <div class=\"sk-circle-fade-dot\"></div>\n            <div class=\"sk-circle-fade-dot\"></div>\n          </div>\n        </td>\n      </tr>\n    </ng-template>\n\n    <ng-template #loadedRows>\n      <ng-template [ngIf]=\"list.length > 0\" [ngIfElse]=\"emtyRow\">\n        <ng-template ngFor let-item [ngForOf]=\"list\" let-i=\"index\">\n          <tr [ngClass]=\"ResolveClasses(i)\">\n            <td *ngFor=\"let property of config.properties\" [class]=\"(property.is_editable ? 'p-0' : '') + ' border'\">\n              <div *ngIf=\"!property.is_editable\">\n                <cui-data-read-only-cell [property]=\"property\" [model]=\"item\"></cui-data-read-only-cell>\n              </div>\n\n              <div *ngIf=\"property.is_editable\">\n                <cui-data-editable-cell [property]=\"FilterUnitName(property)\"\n                                        [model]=\"item\"\n                                        [value]=\"cuiModelHelper.GetModelValue(item, property.key)\"\n                                        (changedByUser)=\"OnUserChangeFunction(i, property, $event)\"\n                >\n                </cui-data-editable-cell>\n              </div>\n            </td>\n            <ng-template [ngIf]=\"IsAvailableViewExpand()\">\n              <td class=\"button-cell border\">\n                <button\n                        *ngIf=\"IsClosedRow(i)\"\n                        [title]=\"'Подробнее'\"\n                        [class]=\"'btn btn-info icon icon-arrow-down btn-sm'\"\n                        [disabled]=\"isLoadingRows || IsDisabledExpandForRow(item)\"\n                        (click)=\"ExpandRow(i)\"\n                >\n                </button>\n\n                <button\n                        *ngIf=\"IsExpandedRow(i)\"\n                        [title]=\"'Скрыть подробную информацию'\"\n                        [class]=\"'btn btn-info icon icon-arrow-up btn-sm'\"\n                        [disabled]=\"isLoadingRows\"\n                        (click)=\"CloseRow(i)\"\n                >\n                </button>\n              </td>\n            </ng-template>\n\n            <ng-template [ngIf]=\"IsAvailableDelete()\">\n              <td class=\"button-cell border\">\n                <button\n                        [title]=\"'Удалить'\"\n                        [class]=\"'btn btn-danger icon icon-trash btn-sm'\"\n                        [disabled]=\"isLoadingRows\"\n                        (click)=\"DeleteItem(item)\"\n                >\n                </button>\n              </td>\n            </ng-template>\n\n            <ng-template [ngIf]=\"IsAvailableSave() && !IsAvailableAutoSave()\">\n              <td class=\"button-cell border\">\n                <button\n                        [title]=\"'Сохранить'\"\n                        [class]=\"'btn btn-success icon icon-check btn-sm'\"\n                        [disabled]=\"isLoadingRows\"\n                        (click)=\"SaveItem(i)\"\n                >\n                </button>\n              </td>\n            </ng-template>\n\n            <ng-template [ngIf]=\"IsAvailableCopy()\">\n              <td class=\"button-cell border\">\n                <button\n                        [title]=\"'Копировать'\"\n                        [class]=\"'btn btn-warning icon icon-docs btn-sm'\"\n                        [disabled]=\"isLoadingRows\"\n                        (click)=\"CopyItem(i)\"\n                >\n                </button>\n              </td>\n            </ng-template>\n\n            <ng-template ngFor let-button [ngForOf]=\"config.buttons || []\" let-i=\"index\">\n              <td class=\"button-cell border\">\n                <button [title]=\"button.title\"\n                        [class]=\"button.class + ' btn-sm'\"\n                        [disabled]=\"button.isDisabled ? isLoadingRows || button.isDisabled(item) : isLoadingRows\"\n                        (click)=\"button.action(item, list, this)\"\n                >\n                </button>\n              </td>\n            </ng-template>\n          </tr>\n          <tr *ngIf=\"IsNeedDrawExpandBlockForRow(i)\" [class]=\"'border expanded-row'\">\n            <td [attr.colspan]=\"config.properties.length + CountButtons()\" class=\"col-in-expanded-row\">\n              <expanded-row [row]=\"item\" [config]=\"config.expandView\"></expanded-row>\n            </td>\n          </tr>\n        </ng-template>\n      </ng-template>\n      <ng-template #emtyRow>\n        <tr>\n          <td class=\"border\" [attr.colspan]=\"config.properties.length + 1\">Данные отсутствуют</td>\n        </tr>\n      </ng-template>\n    </ng-template>\n  </table>\n</div>\n<div class=\"row mt-3\">\n  <div class=\"col-6\">\n    <div *ngIf=\"config.enableSummaryInfo\">\n      <p><i>Всего элементов: </i><i>{{summaryData.totalCount}}</i></p>\n      <p><i>Показаны с {{\n        (summaryData.pagination.curPage - 1) * summaryData.pagination.pageSize + 1\n        }} по {{\n        (summaryData.pagination.curPage - 1) * summaryData.pagination.pageSize + list.length\n        }}</i></p>\n    </div>\n  </div>\n  <div class=\"col-6\">\n    <div class=\"float-right ml-3\" *ngFor=\"let button of config.underTableButtons\">\n      <button [title]=\"button.title\"\n              [class]=\"button.class\"\n              (click)=\"button.action()\"\n      >\n        {{button.title}}\n      </button>\n    </div>\n\n    <div class=\"float-right ml-3\">\n      <button *ngIf=\"IsAsync() && !config.isDisableRefresh\"\n              [title]=\"'Обновить'\"\n              [class]=\"'btn btn-primary btn-block'\"\n              [disabled]=\"isLoadingRows\"\n              (click)=\"UpdateDataOnPage()\"\n      >\n        Обновить\n      </button>\n    </div>\n\n    <div class=\"float-right ml-3\">\n      <button *ngIf=\"IsAvailableComplexUpdate()\"\n              [title]=\"config.complexUpdateFunctionLabel ? config.complexUpdateFunctionLabel : 'Сохранить все'\"\n              [class]=\"'btn btn-success btn-block'\"\n              [disabled]=\"isLoadingRows\"\n              (click)=\"SaveAllModels()\"\n      >\n        Сохранить все\n      </button>\n    </div>\n\n    <div class=\"float-right ml-3\">\n      <button *ngIf=\"IsAvailableAdd()\"\n              [title]=\"'Добавить'\"\n              [class]=\"'btn btn-success btn-block'\"\n              [disabled]=\"isLoadingRows\"\n              (click)=\"AddItem()\"\n      >\n        Добавить\n      </button>\n    </div>\n  </div>\n</div>\n\n\n\n\n\n\n","styles":["cui-data-table-async table cui-ol-point-control.form-control {\n  border: 1px solid #c2cfd6 !important;\n  box-shadow: none !important; }\n\ncui-data-table-async table cui-ol-point-special-control.form-control {\n  border: 1px solid #c2cfd6 !important;\n  box-shadow: none !important; }\n\ncui-data-table-async table .form-control {\n  border: none !important;\n  box-shadow: none !important; }\n\ncui-data-table-async table tr .form-control.is-invalid {\n  background-color: #fa9c9c !important; }\n\ncui-data-table-async table tr td.button-cell {\n  padding: 0.25rem !important;\n  width: 1%;\n  white-space: nowrap; }\n\ncui-data-table-async table tr td, cui-data-table-async table tr th {\n  padding: 0 0.8rem !important;\n  vertical-align: center !important; }\n\ncui-data-table-async table tr.not-saved-item .form-control {\n  background-color: #74cbea; }\n\ncui-data-table-async table tr.new-item .form-control {\n  background-color: #e1e7ea; }\n\ncui-data-table-async table tr.error-item .form-control {\n  background-color: #fdd6d6; }\n\ncui-data-table-async table th.sorting,\ncui-data-table-async table th.sorting_asc,\ncui-data-table-async table th.sorting_desc {\n  cursor: pointer;\n  position: relative; }\n\ncui-data-table-async table th.sorting:before, cui-data-table-async table th.sorting:after,\ncui-data-table-async table th.sorting_asc:before, cui-data-table-async table th.sorting_asc:after,\ncui-data-table-async table th.sorting_desc:before, cui-data-table-async table th.sorting_desc:after {\n  vertical-align: center;\n  position: absolute;\n  bottom: 40%;\n  display: block;\n  opacity: 0.3; }\n\ncui-data-table-async table th.sorting:before,\ncui-data-table-async table th.sorting_asc:before,\ncui-data-table-async table th.sorting_desc:before {\n  right: 1em;\n  content: \"\\2191\"; }\n\ncui-data-table-async table th.sorting:after,\ncui-data-table-async table th.sorting_asc:after,\ncui-data-table-async table th.sorting_desc:after {\n  right: 0.5em;\n  content: \"\\2193\"; }\n\ncui-data-table-async table th.sorting_asc:before,\ncui-data-table-async table th.sorting_desc:after {\n  opacity: 1; }\n\ncui-data-table-async table table {\n  border-spacing: 0; }\n\ncui-data-table-async table .custom-select {\n  height: inherit !important; }\n\ncui-data-table-async table tr.expanded-row {\n  background-color: rgba(200, 200, 200, 0.2); }\n  cui-data-table-async table tr.expanded-row td.col-in-expanded-row {\n    padding: 0.5rem !important; }\n  cui-data-table-async table tr.expanded-row tr.expanded-row {\n    background-color: rgba(200, 200, 200, 0.3); }\n    cui-data-table-async table tr.expanded-row tr.expanded-row tr.expanded-row {\n      background-color: rgba(200, 200, 200, 0.4); }\n      cui-data-table-async table tr.expanded-row tr.expanded-row tr.expanded-row tr.expanded-row {\n        background-color: rgba(200, 200, 200, 0.5); }\n\n.table .table {\n  background-color: #ffffff; }\n"]}]}],"members":{"config":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":111,"character":3}}]}],"list":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":112,"character":3}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"../../services/cui/cui-form.helper","name":"CuiFormHelper","line":139,"character":37},{"__symbolic":"reference","module":"../../services/cui/cui.helper","name":"CuiModelHelper","line":140,"character":37},{"__symbolic":"reference","module":"@angular/router","name":"Router","line":141,"character":30},{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectorRef","line":142,"character":41}]}],"SetList":[{"__symbolic":"method"}],"ngOnInit":[{"__symbolic":"method"}],"InitAutoUpdateProcess":[{"__symbolic":"method"}],"ngOnChanges":[{"__symbolic":"method"}],"HandleResult":[{"__symbolic":"method"}],"UpdateSummaryData":[{"__symbolic":"method"}],"ReinitializeExpandRows":[{"__symbolic":"method"}],"SetPageAndUpdate":[{"__symbolic":"method"}],"UpdateDataOnPage":[{"__symbolic":"method"}],"SaveAllModels":[{"__symbolic":"method"}],"SaveItem":[{"__symbolic":"method"}],"DeleteItem":[{"__symbolic":"method"}],"AddItem":[{"__symbolic":"method"}],"CopyItem":[{"__symbolic":"method"}],"IsAvailableAdd":[{"__symbolic":"method"}],"IsAvailableSave":[{"__symbolic":"method"}],"IsAvailableAutoSave":[{"__symbolic":"method"}],"IsAvailableDelete":[{"__symbolic":"method"}],"IsAvailableComplexUpdate":[{"__symbolic":"method"}],"IsAvailableViewExpand":[{"__symbolic":"method"}],"IsAvailableCopy":[{"__symbolic":"method"}],"IsAsync":[{"__symbolic":"method"}],"ResolveClasses":[{"__symbolic":"method"}],"MarkAsChanged":[{"__symbolic":"method"}],"OnUserChangeFunction":[{"__symbolic":"method"}],"ResetItemProperties":[{"__symbolic":"method"}],"IsNeedDrawButtonColumns":[{"__symbolic":"method"}],"CountButtons":[{"__symbolic":"method"}],"ResolveUnitPostfix":[{"__symbolic":"method"}],"FilterUnitName":[{"__symbolic":"method"}],"ExpandRow":[{"__symbolic":"method"}],"CloseRow":[{"__symbolic":"method"}],"IsNeedDrawExpandBlockForRow":[{"__symbolic":"method"}],"IsNeedShowPagination":[{"__symbolic":"method"}],"IsClosedRow":[{"__symbolic":"method"}],"IsExpandedRow":[{"__symbolic":"method"}],"IsDisabledExpandForRow":[{"__symbolic":"method"}],"ValidateSummaryData":[{"__symbolic":"method"}],"SortTable":[{"__symbolic":"method"}],"UpdateSortArrayAndResolveSortButtonClass":[{"__symbolic":"method"}],"UpdateSortButtonClasses":[{"__symbolic":"method"}],"ClearSortData":[{"__symbolic":"method"}],"ResolveTableHeaderColumnClass":[{"__symbolic":"method"}],"ResolveTableHeaderColumnClick":[{"__symbolic":"method"}],"RefreshFieldsInItem":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}]}}}}]