tnx-shared 5.3.242 → 5.3.244

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('rxjs'), require('rxjs/operators'), require('@angular/common'), require('@angular/common/http'), require('fast-safe-stringify'), require('moment'), require('underscore'), require('uuid'), require('angular-oauth2-oidc'), require('@ngx-translate/core'), require('tn-custom-primeng/api'), require('@angular/router'), require('@aspnet/signalr'), require('file-saver'), require('print-js'), require('@angular/platform-browser'), require('jquery'), require('ngx-device-detector'), require('jwt-decode'), require('tn-custom-primeng/table'), require('@angular/common/locales/vi'), require('@angular/forms'), require('@angular/platform-browser/animations'), require('ngx-img-fallback'), require('ngx-mask'), require('ng2-signalr'), require('tn-custom-primeng/fileupload'), require('tn-custom-primeng/dropdown'), require('tn-custom-primeng/multiselect'), require('tn-custom-primeng/dom'), require('angular-split'), require('ng2-currency-mask'), require('ngx-drag-drop'), require('ngx-extended-pdf-viewer'), require('ngx-perfect-scrollbar'), require('tn-custom-primeng/accordion'), require('tn-custom-primeng/autocomplete'), require('tn-custom-primeng/blockui'), require('tn-custom-primeng/breadcrumb'), require('tn-custom-primeng/button'), require('tn-custom-primeng/calendar'), require('tn-custom-primeng/card'), require('tn-custom-primeng/chart'), require('tn-custom-primeng/checkbox'), require('tn-custom-primeng/chips'), require('tn-custom-primeng/colorpicker'), require('tn-custom-primeng/confirmdialog'), require('tn-custom-primeng/contextmenu'), require('tn-custom-primeng/dataview'), require('tn-custom-primeng/dialog'), require('tn-custom-primeng/fieldset'), require('tn-custom-primeng/focustrap'), require('tn-custom-primeng/inputmask'), require('tn-custom-primeng/inputswitch'), require('tn-custom-primeng/inputtext'), require('tn-custom-primeng/inputtextarea'), require('tn-custom-primeng/menu'), require('tn-custom-primeng/menubar'), require('tn-custom-primeng/overlaypanel'), require('tn-custom-primeng/paginator'), require('tn-custom-primeng/panel'), require('tn-custom-primeng/progressspinner'), require('tn-custom-primeng/radiobutton'), require('tn-custom-primeng/scrollpanel'), require('tn-custom-primeng/selectbutton'), require('tn-custom-primeng/sidebar'), require('tn-custom-primeng/slider'), require('tn-custom-primeng/spinner'), require('tn-custom-primeng/splitbutton'), require('tn-custom-primeng/steps'), require('tn-custom-primeng/tabview'), require('tn-custom-primeng/toast'), require('tn-custom-primeng/tooltip'), require('tn-custom-primeng/tree'), require('tn-custom-primeng/treetable'), require('tn-custom-primeng/tristatecheckbox'), require('@angular/animations'), require('qrcode'), require('nanoid'), require('tn-custom-primeng/dragdrop')) :
3
- typeof define === 'function' && define.amd ? define('tnx-shared', ['exports', '@angular/core', 'rxjs', 'rxjs/operators', '@angular/common', '@angular/common/http', 'fast-safe-stringify', 'moment', 'underscore', 'uuid', 'angular-oauth2-oidc', '@ngx-translate/core', 'tn-custom-primeng/api', '@angular/router', '@aspnet/signalr', 'file-saver', 'print-js', '@angular/platform-browser', 'jquery', 'ngx-device-detector', 'jwt-decode', 'tn-custom-primeng/table', '@angular/common/locales/vi', '@angular/forms', '@angular/platform-browser/animations', 'ngx-img-fallback', 'ngx-mask', 'ng2-signalr', 'tn-custom-primeng/fileupload', 'tn-custom-primeng/dropdown', 'tn-custom-primeng/multiselect', 'tn-custom-primeng/dom', 'angular-split', 'ng2-currency-mask', 'ngx-drag-drop', 'ngx-extended-pdf-viewer', 'ngx-perfect-scrollbar', 'tn-custom-primeng/accordion', 'tn-custom-primeng/autocomplete', 'tn-custom-primeng/blockui', 'tn-custom-primeng/breadcrumb', 'tn-custom-primeng/button', 'tn-custom-primeng/calendar', 'tn-custom-primeng/card', 'tn-custom-primeng/chart', 'tn-custom-primeng/checkbox', 'tn-custom-primeng/chips', 'tn-custom-primeng/colorpicker', 'tn-custom-primeng/confirmdialog', 'tn-custom-primeng/contextmenu', 'tn-custom-primeng/dataview', 'tn-custom-primeng/dialog', 'tn-custom-primeng/fieldset', 'tn-custom-primeng/focustrap', 'tn-custom-primeng/inputmask', 'tn-custom-primeng/inputswitch', 'tn-custom-primeng/inputtext', 'tn-custom-primeng/inputtextarea', 'tn-custom-primeng/menu', 'tn-custom-primeng/menubar', 'tn-custom-primeng/overlaypanel', 'tn-custom-primeng/paginator', 'tn-custom-primeng/panel', 'tn-custom-primeng/progressspinner', 'tn-custom-primeng/radiobutton', 'tn-custom-primeng/scrollpanel', 'tn-custom-primeng/selectbutton', 'tn-custom-primeng/sidebar', 'tn-custom-primeng/slider', 'tn-custom-primeng/spinner', 'tn-custom-primeng/splitbutton', 'tn-custom-primeng/steps', 'tn-custom-primeng/tabview', 'tn-custom-primeng/toast', 'tn-custom-primeng/tooltip', 'tn-custom-primeng/tree', 'tn-custom-primeng/treetable', 'tn-custom-primeng/tristatecheckbox', '@angular/animations', 'qrcode', 'nanoid', 'tn-custom-primeng/dragdrop'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["tnx-shared"] = {}, global.ng.core, global.rxjs, global.rxjs.operators, global.ng.common, global.ng.common.http, global.stringify, global.moment_, global._, global.uuid, global.i4, global.core, global.i1, global.ng.router, global.signalR, global.FileSaver, global.printJS$3, global.ng.platformBrowser, global.jQuery_, global.ngxDeviceDetector, global.JWT_, global.table, global.ng.common.locales.vi, global.ng.forms, global.ng.platformBrowser.animations, global.ngxImgFallback, global.ngxMask, global.i1$2, global.fileupload, global.dropdown, global.multiselect, global.dom, global.angularSplit, global.ng2CurrencyMask, global.ngxDragDrop, global.ngxExtendedPdfViewer, global.ngxPerfectScrollbar, global.accordion, global.autocomplete, global.blockui, global.breadcrumb, global.button, global.calendar, global.card, global.chart, global.checkbox, global.chips, global.colorpicker, global.confirmdialog, global.contextmenu, global.dataview, global.dialog, global.fieldset, global.focustrap, global.inputmask, global.inputswitch, global.inputtext, global.inputtextarea, global.menu, global.menubar, global.overlaypanel, global.paginator, global.panel, global.progressspinner, global.radiobutton, global.scrollpanel, global.selectbutton, global.sidebar, global.slider, global.spinner, global.splitbutton, global.steps, global.tabview, global.toast, global.tooltip, global.tree, global.treetable, global.tristatecheckbox, global.ng.animations, global.qrcode, global.nanoid, global.dragdrop));
5
- })(this, (function (exports, i0, rxjs, operators, i3, i1$1, stringify, moment_, _, uuid, i4, core, i1, i3$1, signalR, FileSaver, printJS$3, platformBrowser, jQuery_, ngxDeviceDetector, JWT_, table, localeVi, forms, animations, ngxImgFallback, ngxMask, i1$2, fileupload, dropdown, multiselect, dom, angularSplit, ng2CurrencyMask, ngxDragDrop, ngxExtendedPdfViewer, ngxPerfectScrollbar, accordion, autocomplete, blockui, breadcrumb, button, calendar, card, chart, checkbox, chips, colorpicker, confirmdialog, contextmenu, dataview, dialog, fieldset, focustrap, inputmask, inputswitch, inputtext, inputtextarea, menu, menubar, overlaypanel, paginator, panel, progressspinner, radiobutton, scrollpanel, selectbutton, sidebar, slider, spinner, splitbutton, steps, tabview, toast, tooltip, tree, treetable, tristatecheckbox, animations$1, qrcode, nanoid, dragdrop) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('rxjs'), require('rxjs/operators'), require('@angular/common'), require('@angular/common/http'), require('fast-safe-stringify'), require('moment'), require('underscore'), require('uuid'), require('angular-oauth2-oidc'), require('@ngx-translate/core'), require('tn-custom-primeng/api'), require('@angular/router'), require('@aspnet/signalr'), require('file-saver'), require('print-js'), require('@angular/platform-browser'), require('jquery'), require('ngx-device-detector'), require('jwt-decode'), require('tn-custom-primeng/table'), require('@angular/common/locales/vi'), require('@angular/forms'), require('@angular/platform-browser/animations'), require('ngx-img-fallback'), require('ngx-mask'), require('ng2-signalr'), require('tn-custom-primeng/fileupload'), require('tn-custom-primeng/dropdown'), require('tn-custom-primeng/multiselect'), require('tn-custom-primeng/dom'), require('angular-split'), require('ng2-currency-mask'), require('ngx-drag-drop'), require('ngx-extended-pdf-viewer'), require('ngx-perfect-scrollbar'), require('tn-custom-primeng/accordion'), require('tn-custom-primeng/blockui'), require('tn-custom-primeng/breadcrumb'), require('tn-custom-primeng/button'), require('tn-custom-primeng/calendar'), require('tn-custom-primeng/card'), require('tn-custom-primeng/chart'), require('tn-custom-primeng/checkbox'), require('tn-custom-primeng/chips'), require('tn-custom-primeng/colorpicker'), require('tn-custom-primeng/confirmdialog'), require('tn-custom-primeng/contextmenu'), require('tn-custom-primeng/dataview'), require('tn-custom-primeng/dialog'), require('tn-custom-primeng/fieldset'), require('tn-custom-primeng/focustrap'), require('tn-custom-primeng/inputmask'), require('tn-custom-primeng/inputswitch'), require('tn-custom-primeng/inputtext'), require('tn-custom-primeng/inputtextarea'), require('tn-custom-primeng/menu'), require('tn-custom-primeng/menubar'), require('tn-custom-primeng/overlaypanel'), require('tn-custom-primeng/paginator'), require('tn-custom-primeng/panel'), require('tn-custom-primeng/progressspinner'), require('tn-custom-primeng/radiobutton'), require('tn-custom-primeng/scrollpanel'), require('tn-custom-primeng/selectbutton'), require('tn-custom-primeng/sidebar'), require('tn-custom-primeng/slider'), require('tn-custom-primeng/spinner'), require('tn-custom-primeng/splitbutton'), require('tn-custom-primeng/steps'), require('tn-custom-primeng/tabview'), require('tn-custom-primeng/toast'), require('tn-custom-primeng/tooltip'), require('tn-custom-primeng/tree'), require('tn-custom-primeng/treetable'), require('tn-custom-primeng/tristatecheckbox'), require('@angular/animations'), require('qrcode'), require('tn-custom-primeng/dragdrop'), require('tn-custom-primeng/ripple'), require('tn-custom-primeng/utils'), require('nanoid')) :
3
+ typeof define === 'function' && define.amd ? define('tnx-shared', ['exports', '@angular/core', 'rxjs', 'rxjs/operators', '@angular/common', '@angular/common/http', 'fast-safe-stringify', 'moment', 'underscore', 'uuid', 'angular-oauth2-oidc', '@ngx-translate/core', 'tn-custom-primeng/api', '@angular/router', '@aspnet/signalr', 'file-saver', 'print-js', '@angular/platform-browser', 'jquery', 'ngx-device-detector', 'jwt-decode', 'tn-custom-primeng/table', '@angular/common/locales/vi', '@angular/forms', '@angular/platform-browser/animations', 'ngx-img-fallback', 'ngx-mask', 'ng2-signalr', 'tn-custom-primeng/fileupload', 'tn-custom-primeng/dropdown', 'tn-custom-primeng/multiselect', 'tn-custom-primeng/dom', 'angular-split', 'ng2-currency-mask', 'ngx-drag-drop', 'ngx-extended-pdf-viewer', 'ngx-perfect-scrollbar', 'tn-custom-primeng/accordion', 'tn-custom-primeng/blockui', 'tn-custom-primeng/breadcrumb', 'tn-custom-primeng/button', 'tn-custom-primeng/calendar', 'tn-custom-primeng/card', 'tn-custom-primeng/chart', 'tn-custom-primeng/checkbox', 'tn-custom-primeng/chips', 'tn-custom-primeng/colorpicker', 'tn-custom-primeng/confirmdialog', 'tn-custom-primeng/contextmenu', 'tn-custom-primeng/dataview', 'tn-custom-primeng/dialog', 'tn-custom-primeng/fieldset', 'tn-custom-primeng/focustrap', 'tn-custom-primeng/inputmask', 'tn-custom-primeng/inputswitch', 'tn-custom-primeng/inputtext', 'tn-custom-primeng/inputtextarea', 'tn-custom-primeng/menu', 'tn-custom-primeng/menubar', 'tn-custom-primeng/overlaypanel', 'tn-custom-primeng/paginator', 'tn-custom-primeng/panel', 'tn-custom-primeng/progressspinner', 'tn-custom-primeng/radiobutton', 'tn-custom-primeng/scrollpanel', 'tn-custom-primeng/selectbutton', 'tn-custom-primeng/sidebar', 'tn-custom-primeng/slider', 'tn-custom-primeng/spinner', 'tn-custom-primeng/splitbutton', 'tn-custom-primeng/steps', 'tn-custom-primeng/tabview', 'tn-custom-primeng/toast', 'tn-custom-primeng/tooltip', 'tn-custom-primeng/tree', 'tn-custom-primeng/treetable', 'tn-custom-primeng/tristatecheckbox', '@angular/animations', 'qrcode', 'tn-custom-primeng/dragdrop', 'tn-custom-primeng/ripple', 'tn-custom-primeng/utils', 'nanoid'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["tnx-shared"] = {}, global.ng.core, global.rxjs, global.rxjs.operators, global.ng.common, global.ng.common.http, global.stringify, global.moment_, global._, global.uuid, global.i4, global.core, global.i1, global.ng.router, global.signalR, global.FileSaver, global.printJS$3, global.ng.platformBrowser, global.jQuery_, global.ngxDeviceDetector, global.JWT_, global.table, global.ng.common.locales.vi, global.ng.forms, global.ng.platformBrowser.animations, global.ngxImgFallback, global.ngxMask, global.i1$2, global.fileupload, global.dropdown, global.multiselect, global.dom, global.angularSplit, global.ng2CurrencyMask, global.ngxDragDrop, global.ngxExtendedPdfViewer, global.ngxPerfectScrollbar, global.accordion, global.blockui, global.breadcrumb, global.button, global.calendar, global.card, global.chart, global.checkbox, global.chips, global.colorpicker, global.confirmdialog, global.contextmenu, global.dataview, global.dialog, global.fieldset, global.focustrap, global.inputmask, global.inputswitch, global.inputtext, global.inputtextarea, global.menu, global.menubar, global.overlaypanel, global.paginator, global.panel, global.progressspinner, global.radiobutton, global.scrollpanel, global.selectbutton, global.sidebar, global.slider, global.spinner, global.splitbutton, global.steps, global.tabview, global.toast, global.tooltip, global.tree, global.treetable, global.tristatecheckbox, global.ng.animations, global.qrcode, global.dragdrop, global.ripple, global.utils, global.nanoid));
5
+ })(this, (function (exports, i0, rxjs, operators, i3, i1$1, stringify, moment_, _, uuid, i4, core, i1, i3$1, signalR, FileSaver, printJS$3, platformBrowser, jQuery_, ngxDeviceDetector, JWT_, table, localeVi, forms, animations, ngxImgFallback, ngxMask, i1$2, fileupload, dropdown, multiselect, dom, angularSplit, ng2CurrencyMask, ngxDragDrop, ngxExtendedPdfViewer, ngxPerfectScrollbar, accordion, blockui, breadcrumb, button, calendar, card, chart, checkbox, chips, colorpicker, confirmdialog, contextmenu, dataview, dialog, fieldset, focustrap, inputmask, inputswitch, inputtext, inputtextarea, menu, menubar, overlaypanel, paginator, panel, progressspinner, radiobutton, scrollpanel, selectbutton, sidebar, slider, spinner, splitbutton, steps, tabview, toast, tooltip, tree, treetable, tristatecheckbox, animations$1, qrcode, dragdrop, ripple, utils, nanoid) { 'use strict';
6
6
 
7
7
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
8
 
@@ -43808,7 +43808,7 @@
43808
43808
  { type: i0.Component, args: [{
43809
43809
  // tslint:disable-next-line: component-selector
43810
43810
  selector: 'autocomplete-picker',
43811
- template: "<div class=\"p-inputgroup autocomplete-picker\" *ngIf=\"control\" [class.has-value]=\"hasValue\"\n [class.multiple]=\"control.multiple\" [class.disabled]=\"control.disabled\">\n <div style=\"width: calc(100% - 28px)\" [pTooltip]=\"tooltip\" tooltipPosition=\"top\">\n <p-autoComplete #autoComplete emptyMessage=\"Kh\u00F4ng c\u00F3 k\u1EBFt qu\u1EA3 n\u00E0o\" [ngClass]=\"'custom-autocomplete'\"\n [disabled]=\"disabled\" [placeholder]=\"control.placeholder\" [appendTo]=\"control.appendTo\"\n [suggestions]=\"results\" field=\"label\" [styleClass]=\"control.validators && control.required ? 'rq' : ''\"\n [multiple]=\"control.multiple\" [minLength]=\"2\" [(ngModel)]=\"selectedValueObject\"\n (onFocus)=\"handleFocus($event)\" (onBlur)=\"handleBlur($event)\" (completeMethod)=\"search($event)\"\n (onKeyUp)=\"handleKeyUp($event)\" (onSelect)=\"handleSelect($event)\" (onUnselect)=\"handleUnSelect($event)\">\n </p-autoComplete>\n </div>\n <span *ngIf=\"!control.multiple && !disabled && hasValue\" class=\"icon-clear\" (click)=\"clearValue()\"><i\n class=\"fas fa-times\"></i></span>\n <button class=\"custom-autocomplete-button\" *ngIf=\"control.usePicker\" [disabled]=\"disabled\" tabindex=\"-1\"\n (click)=\"showPickForm()\" pButton [pTooltip]=\"control.title\" icon=\"fas fa-external-link-alt\"\n type=\"button\"></button>\n</div>\n<tn-dialog #dialog *ngIf=\"showFormPicker\" styleClass=\"entity-picker-box-dialog no-padding\" [useDefaultScrollBar]=\"true\"\n [header]=\"control.title | translate\" [popupSize]=\"popupSize\" (onHide)=\"handleHide($event)\">\n <entity-picker-box #entityPickerBox [currentNode]=\"currentNode\" [control]=\"control\" [parentSetting]=\"setting\" [datasourceFieldFilter]=\"datasourceFieldFilter\"\n [advanceData]=\"advanceData\" [readOnlyValues]=\"readOnlyValues\" [selectedValue]=\"selectedValue\"\n (onContentLeftInit)=\"handleContentLeftInit($event)\" (onContentRightInit)=\"handleContentRightInit($event)\"\n (onChanged)=\"handleChangeEntity($event)\" (onSelect)=\"handleSelectEntity($event)\"\n (onUnSelect)=\"handleUnSelectEntity($event)\" (onDone)=\"handleHide($event)\"\n (onRowSelect)=\"handleRowSelect($event)\">\n </entity-picker-box>\n <ng-template #footer>\n <button type=\" button\" pButton class=\"p-button-text\" (click)=\"onClickSubmitButton($event, entityPickerBox)\"\n [label]=\"'Ho\u00E0n th\u00E0nh' | translate\" icon=\"pi pi-check\"></button>\n </ng-template>\n</tn-dialog>",
43811
+ template: "<div class=\"p-inputgroup autocomplete-picker\" *ngIf=\"control\" [class.has-value]=\"hasValue\"\n [class.multiple]=\"control.multiple\" [class.disabled]=\"control.disabled\">\n <div style=\"width: calc(100% - 28px)\" [pTooltip]=\"tooltip\" tooltipPosition=\"top\">\n <p-autoComplete #autoComplete emptyMessage=\"Kh\u00F4ng c\u00F3 k\u1EBFt qu\u1EA3 n\u00E0o\" [ngClass]=\"'custom-autocomplete'\"\n [disabled]=\"disabled\" [placeholder]=\"control.placeholder\" [appendTo]=\"control.appendTo\" [maxRowItem]=\"2\"\n [suggestions]=\"results\" field=\"label\" [styleClass]=\"control.validators && control.required ? 'rq' : ''\"\n [multiple]=\"control.multiple\" [minLength]=\"2\" [(ngModel)]=\"selectedValueObject\"\n (onFocus)=\"handleFocus($event)\" (onBlur)=\"handleBlur($event)\" (completeMethod)=\"search($event)\"\n (onKeyUp)=\"handleKeyUp($event)\" (onSelect)=\"handleSelect($event)\" (onUnselect)=\"handleUnSelect($event)\">\n </p-autoComplete>\n </div>\n <span *ngIf=\"!control.multiple && !disabled && hasValue\" class=\"icon-clear\" (click)=\"clearValue()\"><i\n class=\"fas fa-times\"></i></span>\n <button class=\"custom-autocomplete-button\" *ngIf=\"control.usePicker\" [disabled]=\"disabled\" tabindex=\"-1\"\n (click)=\"showPickForm()\" pButton [pTooltip]=\"control.title\" icon=\"fas fa-external-link-alt\"\n type=\"button\"></button>\n</div>\n<tn-dialog #dialog *ngIf=\"showFormPicker\" styleClass=\"entity-picker-box-dialog no-padding\" [useDefaultScrollBar]=\"true\"\n [header]=\"control.title | translate\" [popupSize]=\"popupSize\" (onHide)=\"handleHide($event)\">\n <entity-picker-box #entityPickerBox [currentNode]=\"currentNode\" [control]=\"control\" [parentSetting]=\"setting\" [datasourceFieldFilter]=\"datasourceFieldFilter\"\n [advanceData]=\"advanceData\" [readOnlyValues]=\"readOnlyValues\" [selectedValue]=\"selectedValue\"\n (onContentLeftInit)=\"handleContentLeftInit($event)\" (onContentRightInit)=\"handleContentRightInit($event)\"\n (onChanged)=\"handleChangeEntity($event)\" (onSelect)=\"handleSelectEntity($event)\"\n (onUnSelect)=\"handleUnSelectEntity($event)\" (onDone)=\"handleHide($event)\"\n (onRowSelect)=\"handleRowSelect($event)\">\n </entity-picker-box>\n <ng-template #footer>\n <button type=\" button\" pButton class=\"p-button-text\" (click)=\"onClickSubmitButton($event, entityPickerBox)\"\n [label]=\"'Ho\u00E0n th\u00E0nh' | translate\" icon=\"pi pi-check\"></button>\n </ng-template>\n</tn-dialog>",
43812
43812
  providers: [
43813
43813
  {
43814
43814
  provide: forms.NG_VALUE_ACCESSOR,
@@ -45602,7 +45602,7 @@
45602
45602
  EntityPickerDataComponent.decorators = [
45603
45603
  { type: i0.Component, args: [{
45604
45604
  selector: 'app-entity-picker-data',
45605
- template: "<crud-list #crudList [menuButtons]=\"getMenuButtons\" [model]=\"model\" [setting]=\"setting\" [dataSource]=\"model.dataSource\"\n [showScrollHorizontal]=\"true\" (onContentInit)=\"onContentInit.emit($event)\" (onReload)=\"_triggerProcessData($event)\"\n (onAdd)=\"_add($event)\" (onRowSelect)=\"handleRowSelect($event)\" (onEdit)=\"_edit($event)\" (onView)=\"_view($event)\"\n (onDelete)=\"_delete($event)\" (onDeleteMultiple)=\"_deleteMultiple($event)\" (onReloaded)=\"_unmarkLoading()\">\n <ng-template #toolbar let-crudList=\"crudList\" let-selectedItems=\"selectedItems\">\n <button *ngIf=\"!isSingleSelection && model.dataSource.length > 0\" type=\"button\" pButton pRipple\n label=\"L\u1EA5y t\u1EA5t c\u1EA3 ({{model.dataSource.length}})\" icon=\"pi pi-angle-double-right\"\n class=\"p-button-text p-button-success\" (click)=\"pickAll()\"></button>\n <button *ngIf=\"!isSingleSelection && selectedItems.length > 0\" type=\"button\" pButton pRipple\n label=\"L\u1EA5y m\u1EE5c \u0111\u00E3 ch\u1ECDn ({{selectedItems.length}})\" icon=\"pi pi-angle-right\"\n class=\"p-button-text p-button-success\" (click)=\"pickSelected(selectedItems)\"></button>\n <button *ngIf=\"datasourceFieldFilter.length\" type=\"button\" pButton pRipple label=\"T\u00ECm ki\u1EBFm nhi\u1EC1u ng\u01B0\u1EDDi d\u00F9ng\"\n icon=\"pi pi-search\" class=\"p-button-text p-button-primary\" (click)=\"handleAdvansearch()\"></button>\n <button *ngIf=\"datasourceFieldFilter.length && searchData\" type=\"button\" pButton pRipple\n label=\"X\u00F3a danh s\u00E1ch t\u00ECm ki\u1EBFm\" pTooltip=\"X\u00F3a t\u1EA5t c\u1EA3 ng\u01B0\u1EDDi d\u00F9ng \u1EDF Danh s\u00E1ch t\u00ECm ki\u1EBFm\" icon=\"pi pi-times\"\n class=\"p-button-text p-button-primary\" (click)=\"handleSearch(null)\"></button>\n </ng-template>\n <ng-template let-crudList=\"crudList\" #function let-rowData=\"rowData\">\n <button pButton type=\"button\" class=\"link-or-action p-button-success p-button-text p-button-rounded\"\n icon=\"pi pi-check\" pTooltip=\"Ch\u1ECDn m\u1EE5c n\u00E0y\" tooltipPosition=\"top\" [disabled]=\"rowData.disabled\"\n (click)=\"pickEntity(rowData)\"></button>\n </ng-template>\n</crud-list>\n\n\n<tn-dialog *ngIf=\"showFormAdvancedSearch\" #dialog [styleClass]=\"'address-form'\" [header]=\"'T\u00ECm ki\u1EBFm nhi\u1EC1u ng\u01B0\u1EDDi d\u00F9ng'\"\n [popupSize]=\"popupSizeSearchForm\" [maskClass]=\"setting.maskClass\" (onHide)=\"showFormAdvancedSearch = false\">\n <entity-picker-search-form #formBase [parentModel]=\"model\" [parentContext]=\"context\" [parentSetting]=\"setting\"\n [datasourceFieldFilter]=\"datasourceFieldFilter\" [lstDataNotExist]=\"lstDataNotExist\" [model]=\"formModel\"\n (onSearch)=\"handleSearch($event)\" (onCancel)=\"showFormAdvancedSearch = false;\">\n </entity-picker-search-form>\n</tn-dialog>",
45605
+ template: "<crud-list #crudList [menuButtons]=\"getMenuButtons\" [model]=\"model\" [setting]=\"setting\" [dataSource]=\"model.dataSource\"\n [showScrollHorizontal]=\"true\" (onContentInit)=\"onContentInit.emit($event)\" (onReload)=\"_triggerProcessData($event)\"\n (onAdd)=\"_add($event)\" (onRowSelect)=\"handleRowSelect($event)\" (onEdit)=\"_edit($event)\" (onView)=\"_view($event)\"\n (onDelete)=\"_delete($event)\" (onDeleteMultiple)=\"_deleteMultiple($event)\" (onReloaded)=\"_unmarkLoading()\">\n <ng-template #toolbar let-crudList=\"crudList\" let-selectedItems=\"selectedItems\">\n <button *ngIf=\"!model.dataSource.length && setting.hiddenAdvanceSearch\" pButton\n style=\"visibility: hidden\"></button>\n <button *ngIf=\"!isSingleSelection && model.dataSource.length > 0\" type=\"button\" pButton pRipple\n label=\"L\u1EA5y t\u1EA5t c\u1EA3 ({{model.dataSource.length}})\" icon=\"pi pi-angle-double-right\"\n class=\"p-button-text p-button-success\" [disabled]=\"model.loading\" (click)=\"pickAll()\"></button>\n <button *ngIf=\"!isSingleSelection && selectedItems.length > 0\" type=\"button\" pButton pRipple\n label=\"L\u1EA5y m\u1EE5c \u0111\u00E3 ch\u1ECDn ({{selectedItems.length}})\" icon=\"pi pi-angle-right\"\n class=\"p-button-text p-button-success\" [disabled]=\"model.loading\" (click)=\"pickSelected(selectedItems)\"></button>\n <button *ngIf=\"datasourceFieldFilter.length\" type=\"button\" pButton pRipple label=\"T\u00ECm ki\u1EBFm nhi\u1EC1u ng\u01B0\u1EDDi d\u00F9ng\"\n icon=\"pi pi-search\" class=\"p-button-text p-button-primary\" [disabled]=\"model.loading\" (click)=\"handleAdvansearch()\"></button>\n <button *ngIf=\"datasourceFieldFilter.length && searchData\" type=\"button\" pButton pRipple\n label=\"X\u00F3a danh s\u00E1ch t\u00ECm ki\u1EBFm\" pTooltip=\"X\u00F3a t\u1EA5t c\u1EA3 ng\u01B0\u1EDDi d\u00F9ng \u1EDF Danh s\u00E1ch t\u00ECm ki\u1EBFm\" icon=\"pi pi-times\"\n class=\"p-button-text p-button-primary\" [disabled]=\"model.loading\" (click)=\"handleSearch(null)\"></button>\n </ng-template>\n <ng-template let-crudList=\"crudList\" #function let-rowData=\"rowData\">\n <button pButton type=\"button\" class=\"link-or-action p-button-success p-button-text p-button-rounded\"\n icon=\"pi pi-check\" pTooltip=\"Ch\u1ECDn m\u1EE5c n\u00E0y\" tooltipPosition=\"top\" [disabled]=\"rowData.disabled\"\n (click)=\"pickEntity(rowData)\"></button>\n </ng-template>\n</crud-list>\n\n\n<tn-dialog *ngIf=\"showFormAdvancedSearch\" #dialog [styleClass]=\"'address-form'\" [header]=\"'T\u00ECm ki\u1EBFm nhi\u1EC1u ng\u01B0\u1EDDi d\u00F9ng'\"\n [popupSize]=\"popupSizeSearchForm\" [maskClass]=\"setting.maskClass\" (onHide)=\"showFormAdvancedSearch = false\">\n <entity-picker-search-form #formBase [parentModel]=\"model\" [parentContext]=\"context\" [parentSetting]=\"setting\"\n [datasourceFieldFilter]=\"datasourceFieldFilter\" [lstDataNotExist]=\"lstDataNotExist\" [model]=\"formModel\"\n (onSearch)=\"handleSearch($event)\" (onCancel)=\"showFormAdvancedSearch = false;\">\n </entity-picker-search-form>\n</tn-dialog>",
45606
45606
  providers: [ComponentContextService],
45607
45607
  styles: ["::ng-deep app-entity-picker-data .custom-card{padding:.5em!important}"]
45608
45608
  },] }
@@ -45743,6 +45743,7 @@
45743
45743
  this._value = this._selectedValue.map(function (item) { return item[_this.control.valueField]; });
45744
45744
  if (this._value.length == 0) {
45745
45745
  this.itemCanDeletes = [];
45746
+ this.model.selectedItems = [];
45746
45747
  }
45747
45748
  }
45748
45749
  else {
@@ -45752,6 +45753,7 @@
45752
45753
  else {
45753
45754
  this._value = null;
45754
45755
  this.itemCanDeletes = [];
45756
+ this.model.selectedItems = [];
45755
45757
  }
45756
45758
  };
45757
45759
  EntityPickerSelectedComponent.prototype.modifyGridInfo = function (gridInfo) {
@@ -45848,7 +45850,7 @@
45848
45850
  { type: i0.Component, args: [{
45849
45851
  // tslint:disable-next-line: component-selector
45850
45852
  selector: 'app-entity-picker-selected',
45851
- template: "<crud-list #crudList [model]=\"model\" [setting]=\"setting\" [dataSource]=\"model.dataSource\" [showScrollHorizontal]=\"true\"\n (onContentInit)=\"onContentInit.emit($event)\" (onReload)=\"_triggerProcessData($event)\" (onAdd)=\"_add($event)\"\n (onEdit)=\"_edit($event)\" (onView)=\"_view($event)\" (onDelete)=\"_delete($event)\"\n (onDeleteMultiple)=\"_deleteMultiple($event)\" (onReloaded)=\"_unmarkLoading()\">\n\n <ng-template #toolbar let-crudList=\"crudList\" let-selectedItems=\"selectedItems\">\n <button *ngIf=\"!model.dataSource.length && setting.hiddenAdvanceSearch\" pButton\n style=\"visibility: hidden\"></button>\n <button *ngIf=\"itemCanDeletes.length\" type=\"button\" pButton pRipple\n label=\"B\u1ECF t\u1EA5t c\u1EA3 ({{itemCanDeletes.length}})\" icon=\"pi pi-angle-double-left\"\n class=\"p-button-text p-button-danger\" (click)=\"unPickAll()\"></button>\n <button *ngIf=\"selectedItems.length > 0\" type=\"button\" pButton pRipple\n label=\"B\u1ECF m\u1EE5c \u0111\u00E3 ch\u1ECDn ({{selectedItems.length}})\" icon=\"pi pi-angle-left\"\n class=\"p-button-text p-button-danger\" (click)=\"unPickSelected(selectedItems)\"></button>\n </ng-template>\n\n <ng-template let-crudList=\"crudList\" #function let-rowData=\"rowData\">\n <button *ngIf=\"!rowData.hiddenDelete\" pButton type=\"button\"\n class=\"link-or-action p-button-danger p-button-text p-button-rounded\" icon=\"pi pi-times\"\n pTooltip=\"B\u1ECF ch\u1ECDn m\u1EE5c n\u00E0y\" tooltipPosition=\"top\" (click)=\"unPickEntity(rowData)\"></button>\n </ng-template>\n\n</crud-list>",
45853
+ template: "<crud-list #crudList [model]=\"model\" [setting]=\"setting\" [dataSource]=\"model.dataSource\" [showScrollHorizontal]=\"true\"\n (onContentInit)=\"onContentInit.emit($event)\" (onReload)=\"_triggerProcessData($event)\" (onAdd)=\"_add($event)\"\n (onEdit)=\"_edit($event)\" (onView)=\"_view($event)\" (onDelete)=\"_delete($event)\"\n (onDeleteMultiple)=\"_deleteMultiple($event)\" (onReloaded)=\"_unmarkLoading()\">\n\n <ng-template #toolbar let-crudList=\"crudList\" let-selectedItems=\"selectedItems\">\n <button *ngIf=\"!model.dataSource.length && setting.hiddenAdvanceSearch\" pButton\n style=\"visibility: hidden\"></button>\n <button *ngIf=\"itemCanDeletes.length\" type=\"button\" pButton pRipple\n label=\"B\u1ECF t\u1EA5t c\u1EA3 ({{itemCanDeletes.length}})\" icon=\"pi pi-angle-double-left\"\n class=\"p-button-text p-button-danger\" [disabled]=\"model.loading\" (click)=\"unPickAll()\"></button>\n <button *ngIf=\"selectedItems.length > 0\" type=\"button\" pButton pRipple\n label=\"B\u1ECF m\u1EE5c \u0111\u00E3 ch\u1ECDn ({{selectedItems.length}})\" icon=\"pi pi-angle-left\"\n class=\"p-button-text p-button-danger\" [disabled]=\"model.loading\" (click)=\"unPickSelected(selectedItems)\"></button>\n </ng-template>\n\n <ng-template let-crudList=\"crudList\" #function let-rowData=\"rowData\">\n <button *ngIf=\"!rowData.hiddenDelete\" pButton type=\"button\"\n class=\"link-or-action p-button-danger p-button-text p-button-rounded\" icon=\"pi pi-times\"\n pTooltip=\"B\u1ECF ch\u1ECDn m\u1EE5c n\u00E0y\" tooltipPosition=\"top\" (click)=\"unPickEntity(rowData)\"></button>\n </ng-template>\n\n</crud-list>",
45852
45854
  providers: [ComponentContextService],
45853
45855
  styles: ["::ng-deep app-entity-picker-selected .custom-card{padding:.5em .5em 0!important}"]
45854
45856
  },] }
@@ -49863,6 +49865,1030 @@
49863
49865
  onInit: [{ type: i0.Output }]
49864
49866
  };
49865
49867
 
49868
+ var AUTOCOMPLETE_VALUE_ACCESSOR = {
49869
+ provide: forms.NG_VALUE_ACCESSOR,
49870
+ useExisting: i0.forwardRef(function () { return AutoComplete; }),
49871
+ multi: true
49872
+ };
49873
+ var AutoComplete = /** @class */ (function () {
49874
+ function AutoComplete(el, renderer, cd, differs) {
49875
+ this.el = el;
49876
+ this.renderer = renderer;
49877
+ this.cd = cd;
49878
+ this.differs = differs;
49879
+ this.minLength = 1;
49880
+ this.delay = 300;
49881
+ this.type = 'text';
49882
+ this.autoZIndex = true;
49883
+ this.baseZIndex = 0;
49884
+ this.dropdownIcon = "pi pi-chevron-down";
49885
+ this.unique = true;
49886
+ this.completeOnFocus = false;
49887
+ this.completeMethod = new i0.EventEmitter();
49888
+ this.onSelect = new i0.EventEmitter();
49889
+ this.onUnselect = new i0.EventEmitter();
49890
+ this.onFocus = new i0.EventEmitter();
49891
+ this.onBlur = new i0.EventEmitter();
49892
+ this.onDropdownClick = new i0.EventEmitter();
49893
+ this.onClear = new i0.EventEmitter();
49894
+ this.onKeyUp = new i0.EventEmitter();
49895
+ this.onShow = new i0.EventEmitter();
49896
+ this.onHide = new i0.EventEmitter();
49897
+ this.scrollHeight = '200px';
49898
+ this.dropdownMode = 'blank';
49899
+ this.showTransitionOptions = '.12s cubic-bezier(0, 0, 0.2, 1)';
49900
+ this.hideTransitionOptions = '.1s linear';
49901
+ this.autocomplete = 'off';
49902
+ this.onModelChange = function () { };
49903
+ this.onModelTouched = function () { };
49904
+ this.showCountItem = false;
49905
+ this.overlayVisible = false;
49906
+ this.focus = false;
49907
+ this.inputFieldValue = null;
49908
+ this.differ = differs.find([]).create(null);
49909
+ this.listId = utils.UniqueComponentId() + '_list';
49910
+ }
49911
+ Object.defineProperty(AutoComplete.prototype, "maxRowItem", {
49912
+ set: function (value) {
49913
+ var rowHeight = 27;
49914
+ var padding = 7;
49915
+ this._maxHeighContainerItem = Math.round(value * 30.5) + 7;
49916
+ this._maxHeighContainerItemStr = this._maxHeighContainerItem.toString() + 'px';
49917
+ },
49918
+ enumerable: false,
49919
+ configurable: true
49920
+ });
49921
+ Object.defineProperty(AutoComplete.prototype, "suggestions", {
49922
+ get: function () {
49923
+ return this._suggestions;
49924
+ },
49925
+ set: function (val) {
49926
+ this._suggestions = val;
49927
+ this.handleSuggestionsChange();
49928
+ },
49929
+ enumerable: false,
49930
+ configurable: true
49931
+ });
49932
+ AutoComplete.prototype.ngAfterViewChecked = function () {
49933
+ var _this = this;
49934
+ //Use timeouts as since Angular 4.2, AfterViewChecked is broken and not called after panel is updated
49935
+ if (this.suggestionsUpdated && this.overlay && this.overlay.offsetParent) {
49936
+ setTimeout(function () {
49937
+ if (_this.overlay) {
49938
+ _this.alignOverlay();
49939
+ }
49940
+ }, 1);
49941
+ this.suggestionsUpdated = false;
49942
+ }
49943
+ if (this.highlightOptionChanged) {
49944
+ setTimeout(function () {
49945
+ if (_this.overlay) {
49946
+ var listItem = dom.DomHandler.findSingle(_this.overlay, 'li.p-highlight');
49947
+ if (listItem) {
49948
+ dom.DomHandler.scrollInView(_this.overlay, listItem);
49949
+ }
49950
+ }
49951
+ }, 1);
49952
+ this.highlightOptionChanged = false;
49953
+ }
49954
+ if (this.multiContainerEL) {
49955
+ var lastItemSelected = dom.DomHandler.findSingle(this.multiContainerEL.nativeElement, 'li:first-child');
49956
+ this.multiContainerEL.nativeElement.scrollTop = 10000;
49957
+ var rectParent = this.multiContainerEL.nativeElement.getBoundingClientRect();
49958
+ var rectLastItem = lastItemSelected.getBoundingClientRect();
49959
+ if (rectLastItem.y < rectParent.y) {
49960
+ this.showCountItem = true;
49961
+ }
49962
+ else {
49963
+ this.showCountItem = false;
49964
+ }
49965
+ }
49966
+ var countItem = dom.DomHandler.findSingle(this.multiContainerEL.nativeElement, '.p-autocomplete-countItem');
49967
+ if (this.showCountItem && !countItem) {
49968
+ this.focusInput();
49969
+ }
49970
+ };
49971
+ AutoComplete.prototype.handleSuggestionsChange = function () {
49972
+ if (this._suggestions != null && this.loading) {
49973
+ this.highlightOption = null;
49974
+ if (this._suggestions.length) {
49975
+ this.noResults = false;
49976
+ this.show();
49977
+ this.suggestionsUpdated = true;
49978
+ if (this.autoHighlight) {
49979
+ this.highlightOption = this._suggestions[0];
49980
+ }
49981
+ }
49982
+ else {
49983
+ this.noResults = true;
49984
+ if (this.emptyMessage) {
49985
+ this.show();
49986
+ this.suggestionsUpdated = true;
49987
+ }
49988
+ else {
49989
+ this.hide();
49990
+ }
49991
+ }
49992
+ this.loading = false;
49993
+ }
49994
+ };
49995
+ AutoComplete.prototype.ngAfterContentInit = function () {
49996
+ var _this = this;
49997
+ this.templates.forEach(function (item) {
49998
+ switch (item.getType()) {
49999
+ case 'item':
50000
+ _this.itemTemplate = item.template;
50001
+ break;
50002
+ case 'selectedItem':
50003
+ _this.selectedItemTemplate = item.template;
50004
+ break;
50005
+ default:
50006
+ _this.itemTemplate = item.template;
50007
+ break;
50008
+ }
50009
+ });
50010
+ };
50011
+ AutoComplete.prototype.writeValue = function (value) {
50012
+ this.value = value;
50013
+ this.filled = this.value && this.value != '';
50014
+ this.updateInputField();
50015
+ this.cd.markForCheck();
50016
+ };
50017
+ AutoComplete.prototype.registerOnChange = function (fn) {
50018
+ this.onModelChange = fn;
50019
+ };
50020
+ AutoComplete.prototype.registerOnTouched = function (fn) {
50021
+ this.onModelTouched = fn;
50022
+ };
50023
+ AutoComplete.prototype.setDisabledState = function (val) {
50024
+ this.disabled = val;
50025
+ this.cd.markForCheck();
50026
+ };
50027
+ AutoComplete.prototype.onInput = function (event) {
50028
+ var _this = this;
50029
+ // When an input element with a placeholder is clicked, the onInput event is invoked in IE.
50030
+ if (!this.inputKeyDown && dom.DomHandler.isIE()) {
50031
+ return;
50032
+ }
50033
+ if (this.timeout) {
50034
+ clearTimeout(this.timeout);
50035
+ }
50036
+ var value = event.target.value;
50037
+ if (!this.multiple && !this.forceSelection) {
50038
+ this.onModelChange(value);
50039
+ }
50040
+ if (value.length === 0 && !this.multiple) {
50041
+ this.hide();
50042
+ this.onClear.emit(event);
50043
+ this.onModelChange(value);
50044
+ }
50045
+ if (value.length >= this.minLength) {
50046
+ this.timeout = setTimeout(function () {
50047
+ _this.search(event, value);
50048
+ }, this.delay);
50049
+ }
50050
+ else {
50051
+ this.suggestions = null;
50052
+ this.hide();
50053
+ }
50054
+ this.updateFilledState();
50055
+ this.inputKeyDown = false;
50056
+ };
50057
+ AutoComplete.prototype.onInputClick = function (event) {
50058
+ if (this.documentClickListener) {
50059
+ this.inputClick = true;
50060
+ }
50061
+ };
50062
+ AutoComplete.prototype.search = function (event, query) {
50063
+ //allow empty string but not undefined or null
50064
+ if (query === undefined || query === null) {
50065
+ return;
50066
+ }
50067
+ this.loading = true;
50068
+ this.completeMethod.emit({
50069
+ originalEvent: event,
50070
+ query: query
50071
+ });
50072
+ };
50073
+ AutoComplete.prototype.selectItem = function (option, focus) {
50074
+ if (focus === void 0) { focus = true; }
50075
+ if (this.forceSelectionUpdateModelTimeout) {
50076
+ clearTimeout(this.forceSelectionUpdateModelTimeout);
50077
+ this.forceSelectionUpdateModelTimeout = null;
50078
+ }
50079
+ if (this.multiple) {
50080
+ this.multiInputEL.nativeElement.value = '';
50081
+ this.value = this.value || [];
50082
+ if (!this.isSelected(option) || !this.unique) {
50083
+ this.value = __spreadArray(__spreadArray([], __read(this.value)), [option]);
50084
+ this.onModelChange(this.value);
50085
+ }
50086
+ }
50087
+ else {
50088
+ this.inputEL.nativeElement.value = this.field ? utils.ObjectUtils.resolveFieldData(option, this.field) || '' : option;
50089
+ this.value = option;
50090
+ this.onModelChange(this.value);
50091
+ }
50092
+ this.onSelect.emit(option);
50093
+ this.updateFilledState();
50094
+ if (focus) {
50095
+ this.itemClicked = true;
50096
+ this.focusInput();
50097
+ }
50098
+ };
50099
+ AutoComplete.prototype.show = function () {
50100
+ if (this.multiInputEL || this.inputEL) {
50101
+ var hasFocus = this.multiple ?
50102
+ this.multiInputEL.nativeElement.ownerDocument.activeElement == this.multiInputEL.nativeElement :
50103
+ this.inputEL.nativeElement.ownerDocument.activeElement == this.inputEL.nativeElement;
50104
+ if (!this.overlayVisible && hasFocus) {
50105
+ this.overlayVisible = true;
50106
+ }
50107
+ }
50108
+ };
50109
+ AutoComplete.prototype.onOverlayAnimationStart = function (event) {
50110
+ switch (event.toState) {
50111
+ case 'visible':
50112
+ this.overlay = event.element;
50113
+ this.appendOverlay();
50114
+ if (this.autoZIndex) {
50115
+ this.overlay.style.zIndex = String(this.baseZIndex + (++dom.DomHandler.zindex));
50116
+ }
50117
+ this.alignOverlay();
50118
+ this.bindDocumentClickListener();
50119
+ this.bindDocumentResizeListener();
50120
+ this.bindScrollListener();
50121
+ this.onShow.emit(event);
50122
+ break;
50123
+ case 'void':
50124
+ this.onOverlayHide();
50125
+ break;
50126
+ }
50127
+ };
50128
+ AutoComplete.prototype.onOverlayAnimationDone = function (event) {
50129
+ if (event.toState === 'void') {
50130
+ this._suggestions = null;
50131
+ }
50132
+ };
50133
+ AutoComplete.prototype.appendOverlay = function () {
50134
+ if (this.appendTo) {
50135
+ if (this.appendTo === 'body')
50136
+ document.body.appendChild(this.overlay);
50137
+ else
50138
+ dom.DomHandler.appendChild(this.overlay, this.appendTo);
50139
+ if (!this.overlay.style.minWidth) {
50140
+ this.overlay.style.minWidth = dom.DomHandler.getWidth(this.el.nativeElement.children[0]) + 'px';
50141
+ }
50142
+ }
50143
+ };
50144
+ AutoComplete.prototype.resolveFieldData = function (value) {
50145
+ return this.field ? utils.ObjectUtils.resolveFieldData(value, this.field) : value;
50146
+ };
50147
+ AutoComplete.prototype.restoreOverlayAppend = function () {
50148
+ if (this.overlay && this.appendTo) {
50149
+ this.el.nativeElement.appendChild(this.overlay);
50150
+ }
50151
+ };
50152
+ AutoComplete.prototype.alignOverlay = function () {
50153
+ if (this.appendTo)
50154
+ dom.DomHandler.absolutePosition(this.overlay, (this.multiple ? this.multiContainerEL.nativeElement : this.inputEL.nativeElement));
50155
+ else
50156
+ dom.DomHandler.relativePosition(this.overlay, (this.multiple ? this.multiContainerEL.nativeElement : this.inputEL.nativeElement));
50157
+ };
50158
+ AutoComplete.prototype.hide = function () {
50159
+ this.overlayVisible = false;
50160
+ this.cd.markForCheck();
50161
+ };
50162
+ AutoComplete.prototype.handleDropdownClick = function (event) {
50163
+ if (!this.overlayVisible) {
50164
+ this.focusInput();
50165
+ var queryValue = this.multiple ? this.multiInputEL.nativeElement.value : this.inputEL.nativeElement.value;
50166
+ if (this.dropdownMode === 'blank')
50167
+ this.search(event, '');
50168
+ else if (this.dropdownMode === 'current')
50169
+ this.search(event, queryValue);
50170
+ this.onDropdownClick.emit({
50171
+ originalEvent: event,
50172
+ query: queryValue
50173
+ });
50174
+ }
50175
+ else {
50176
+ this.hide();
50177
+ }
50178
+ };
50179
+ AutoComplete.prototype.focusInput = function () {
50180
+ if (this.multiple)
50181
+ this.multiInputEL.nativeElement.focus();
50182
+ else
50183
+ this.inputEL.nativeElement.focus();
50184
+ };
50185
+ AutoComplete.prototype.removeItem = function (item) {
50186
+ var itemIndex = dom.DomHandler.index(item);
50187
+ var removedValue = this.value[itemIndex];
50188
+ this.value = this.value.filter(function (val, i) { return i != itemIndex; });
50189
+ this.onModelChange(this.value);
50190
+ this.updateFilledState();
50191
+ this.onUnselect.emit(removedValue);
50192
+ };
50193
+ AutoComplete.prototype.onKeydown = function (event) {
50194
+ if (this.overlayVisible) {
50195
+ var highlightItemIndex = this.findOptionIndex(this.highlightOption);
50196
+ switch (event.which) {
50197
+ //down
50198
+ case 40:
50199
+ if (highlightItemIndex != -1) {
50200
+ var nextItemIndex = highlightItemIndex + 1;
50201
+ if (nextItemIndex != (this.suggestions.length)) {
50202
+ this.highlightOption = this.suggestions[nextItemIndex];
50203
+ this.highlightOptionChanged = true;
50204
+ }
50205
+ }
50206
+ else {
50207
+ this.highlightOption = this.suggestions[0];
50208
+ }
50209
+ event.preventDefault();
50210
+ break;
50211
+ //up
50212
+ case 38:
50213
+ if (highlightItemIndex > 0) {
50214
+ var prevItemIndex = highlightItemIndex - 1;
50215
+ this.highlightOption = this.suggestions[prevItemIndex];
50216
+ this.highlightOptionChanged = true;
50217
+ }
50218
+ event.preventDefault();
50219
+ break;
50220
+ //enter
50221
+ case 13:
50222
+ if (this.highlightOption) {
50223
+ this.selectItem(this.highlightOption);
50224
+ this.hide();
50225
+ }
50226
+ event.preventDefault();
50227
+ break;
50228
+ //escape
50229
+ case 27:
50230
+ this.hide();
50231
+ event.preventDefault();
50232
+ break;
50233
+ //tab
50234
+ case 9:
50235
+ if (this.highlightOption) {
50236
+ this.selectItem(this.highlightOption);
50237
+ }
50238
+ this.hide();
50239
+ break;
50240
+ }
50241
+ }
50242
+ else {
50243
+ if (event.which === 40 && this.suggestions) {
50244
+ this.search(event, event.target.value);
50245
+ }
50246
+ }
50247
+ if (this.multiple) {
50248
+ switch (event.which) {
50249
+ //backspace
50250
+ case 8:
50251
+ if (this.value && this.value.length && !this.multiInputEL.nativeElement.value) {
50252
+ this.value = __spreadArray([], __read(this.value));
50253
+ var removedValue = this.value.pop();
50254
+ this.onModelChange(this.value);
50255
+ this.updateFilledState();
50256
+ this.onUnselect.emit(removedValue);
50257
+ }
50258
+ break;
50259
+ }
50260
+ }
50261
+ this.inputKeyDown = true;
50262
+ };
50263
+ AutoComplete.prototype.onKeyup = function (event) {
50264
+ this.onKeyUp.emit(event);
50265
+ };
50266
+ AutoComplete.prototype.onInputFocus = function (event) {
50267
+ if (!this.itemClicked && this.completeOnFocus) {
50268
+ var queryValue = this.multiple ? this.multiInputEL.nativeElement.value : this.inputEL.nativeElement.value;
50269
+ this.search(event, queryValue);
50270
+ }
50271
+ this.focus = true;
50272
+ this.onFocus.emit(event);
50273
+ this.itemClicked = false;
50274
+ };
50275
+ AutoComplete.prototype.onInputBlur = function (event) {
50276
+ this.focus = false;
50277
+ this.onModelTouched();
50278
+ this.onBlur.emit(event);
50279
+ };
50280
+ AutoComplete.prototype.onInputChange = function (event) {
50281
+ var e_1, _a;
50282
+ var _this = this;
50283
+ if (this.forceSelection) {
50284
+ var valid = false;
50285
+ var inputValue = event.target.value.trim();
50286
+ if (this.suggestions) {
50287
+ var _loop_1 = function (suggestion) {
50288
+ var itemValue = this_1.field ? utils.ObjectUtils.resolveFieldData(suggestion, this_1.field) : suggestion;
50289
+ if (itemValue && inputValue === itemValue.trim()) {
50290
+ valid = true;
50291
+ this_1.forceSelectionUpdateModelTimeout = setTimeout(function () {
50292
+ _this.selectItem(suggestion, false);
50293
+ }, 250);
50294
+ return "break";
50295
+ }
50296
+ };
50297
+ var this_1 = this;
50298
+ try {
50299
+ for (var _b = __values(this.suggestions), _c = _b.next(); !_c.done; _c = _b.next()) {
50300
+ var suggestion = _c.value;
50301
+ var state_1 = _loop_1(suggestion);
50302
+ if (state_1 === "break")
50303
+ break;
50304
+ }
50305
+ }
50306
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
50307
+ finally {
50308
+ try {
50309
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
50310
+ }
50311
+ finally { if (e_1) throw e_1.error; }
50312
+ }
50313
+ }
50314
+ if (!valid) {
50315
+ if (this.multiple) {
50316
+ this.multiInputEL.nativeElement.value = '';
50317
+ }
50318
+ else {
50319
+ this.value = null;
50320
+ this.inputEL.nativeElement.value = '';
50321
+ }
50322
+ this.onClear.emit(event);
50323
+ this.onModelChange(this.value);
50324
+ }
50325
+ }
50326
+ };
50327
+ AutoComplete.prototype.onInputPaste = function (event) {
50328
+ this.onKeydown(event);
50329
+ };
50330
+ AutoComplete.prototype.isSelected = function (val) {
50331
+ var selected = false;
50332
+ if (this.value && this.value.length) {
50333
+ for (var i = 0; i < this.value.length; i++) {
50334
+ if (utils.ObjectUtils.equals(this.value[i], val, this.dataKey)) {
50335
+ selected = true;
50336
+ break;
50337
+ }
50338
+ }
50339
+ }
50340
+ return selected;
50341
+ };
50342
+ AutoComplete.prototype.findOptionIndex = function (option) {
50343
+ var index = -1;
50344
+ if (this.suggestions) {
50345
+ for (var i = 0; i < this.suggestions.length; i++) {
50346
+ if (utils.ObjectUtils.equals(option, this.suggestions[i])) {
50347
+ index = i;
50348
+ break;
50349
+ }
50350
+ }
50351
+ }
50352
+ return index;
50353
+ };
50354
+ AutoComplete.prototype.updateFilledState = function () {
50355
+ if (this.multiple)
50356
+ this.filled = (this.value && this.value.length) || (this.multiInputEL && this.multiInputEL.nativeElement && this.multiInputEL.nativeElement.value != '');
50357
+ else
50358
+ this.filled = (this.inputFieldValue && this.inputFieldValue != '') || (this.inputEL && this.inputEL.nativeElement && this.inputEL.nativeElement.value != '');
50359
+ ;
50360
+ };
50361
+ AutoComplete.prototype.updateInputField = function () {
50362
+ var formattedValue = this.value ? (this.field ? utils.ObjectUtils.resolveFieldData(this.value, this.field) || '' : this.value) : '';
50363
+ this.inputFieldValue = formattedValue;
50364
+ if (this.inputEL && this.inputEL.nativeElement) {
50365
+ this.inputEL.nativeElement.value = formattedValue;
50366
+ }
50367
+ this.updateFilledState();
50368
+ };
50369
+ AutoComplete.prototype.bindDocumentClickListener = function () {
50370
+ var _this = this;
50371
+ if (!this.documentClickListener) {
50372
+ var documentTarget = this.el ? this.el.nativeElement.ownerDocument : 'document';
50373
+ this.documentClickListener = this.renderer.listen(documentTarget, 'click', function (event) {
50374
+ if (event.which === 3) {
50375
+ return;
50376
+ }
50377
+ if (!_this.inputClick && !_this.isDropdownClick(event)) {
50378
+ _this.hide();
50379
+ }
50380
+ _this.inputClick = false;
50381
+ _this.cd.markForCheck();
50382
+ });
50383
+ }
50384
+ };
50385
+ AutoComplete.prototype.isDropdownClick = function (event) {
50386
+ if (this.dropdown) {
50387
+ var target = event.target;
50388
+ return (target === this.dropdownButton.nativeElement || target.parentNode === this.dropdownButton.nativeElement);
50389
+ }
50390
+ else {
50391
+ return false;
50392
+ }
50393
+ };
50394
+ AutoComplete.prototype.unbindDocumentClickListener = function () {
50395
+ if (this.documentClickListener) {
50396
+ this.documentClickListener();
50397
+ this.documentClickListener = null;
50398
+ }
50399
+ };
50400
+ AutoComplete.prototype.bindDocumentResizeListener = function () {
50401
+ this.documentResizeListener = this.onWindowResize.bind(this);
50402
+ window.addEventListener('resize', this.documentResizeListener);
50403
+ };
50404
+ AutoComplete.prototype.unbindDocumentResizeListener = function () {
50405
+ if (this.documentResizeListener) {
50406
+ window.removeEventListener('resize', this.documentResizeListener);
50407
+ this.documentResizeListener = null;
50408
+ }
50409
+ };
50410
+ AutoComplete.prototype.onWindowResize = function () {
50411
+ this.hide();
50412
+ };
50413
+ AutoComplete.prototype.bindScrollListener = function () {
50414
+ var _this = this;
50415
+ if (!this.scrollHandler) {
50416
+ this.scrollHandler = new dom.ConnectedOverlayScrollHandler(this.containerEL.nativeElement, function () {
50417
+ if (_this.overlayVisible) {
50418
+ _this.hide();
50419
+ }
50420
+ });
50421
+ }
50422
+ this.scrollHandler.bindScrollListener();
50423
+ };
50424
+ AutoComplete.prototype.unbindScrollListener = function () {
50425
+ if (this.scrollHandler) {
50426
+ this.scrollHandler.unbindScrollListener();
50427
+ }
50428
+ };
50429
+ AutoComplete.prototype.onOverlayHide = function () {
50430
+ this.unbindDocumentClickListener();
50431
+ this.unbindDocumentResizeListener();
50432
+ this.unbindScrollListener();
50433
+ this.overlay = null;
50434
+ this.onHide.emit();
50435
+ };
50436
+ AutoComplete.prototype.ngOnDestroy = function () {
50437
+ if (this.forceSelectionUpdateModelTimeout) {
50438
+ clearTimeout(this.forceSelectionUpdateModelTimeout);
50439
+ this.forceSelectionUpdateModelTimeout = null;
50440
+ }
50441
+ if (this.scrollHandler) {
50442
+ this.scrollHandler.destroy();
50443
+ this.scrollHandler = null;
50444
+ }
50445
+ this.restoreOverlayAppend();
50446
+ this.onOverlayHide();
50447
+ };
50448
+ AutoComplete.prototype.showMore = function () {
50449
+ this._maxHeighContainerItemStrOld = this._maxHeighContainerItemStr;
50450
+ this._maxHeighContainerItemStr = '10000px';
50451
+ this.showCountItem = false;
50452
+ };
50453
+ AutoComplete.prototype.showLess = function () {
50454
+ this._maxHeighContainerItemStr = this._maxHeighContainerItemStrOld;
50455
+ this._maxHeighContainerItemStrOld = null;
50456
+ this.showCountItem = true;
50457
+ };
50458
+ return AutoComplete;
50459
+ }());
50460
+ AutoComplete.decorators = [
50461
+ { type: i0.Component, args: [{
50462
+ selector: 'p-autoComplete',
50463
+ template: "\n <span #container [ngClass]=\"{'p-autocomplete p-component':true,'p-autocomplete-dd':dropdown,'p-autocomplete-multiple':multiple}\" [ngStyle]=\"style\" [class]=\"styleClass\">\n <input *ngIf=\"!multiple\" #in [attr.type]=\"type\" [attr.id]=\"inputId\" [ngStyle]=\"inputStyle\" [class]=\"inputStyleClass\" [autocomplete]=\"autocomplete\" [attr.required]=\"required\" [attr.name]=\"name\"\n class=\"p-autocomplete-input p-inputtext p-component\" [ngClass]=\"{'p-autocomplete-dd-input':dropdown,'p-disabled': disabled}\" [value]=\"inputFieldValue\" aria-autocomplete=\"list\" [attr.aria-controls]=\"listId\" role=\"searchbox\" [attr.aria-expanded]=\"overlayVisible\" aria-haspopup=\"true\" [attr.aria-activedescendant]=\"'p-highlighted-option'\"\n (click)=\"onInputClick($event)\" (input)=\"onInput($event)\" (keydown)=\"onKeydown($event)\" (keyup)=\"onKeyup($event)\" [attr.autofocus]=\"autofocus\" (focus)=\"onInputFocus($event)\" (blur)=\"onInputBlur($event)\" (change)=\"onInputChange($event)\" (paste)=\"onInputPaste($event)\"\n [attr.placeholder]=\"placeholder\" [attr.size]=\"size\" [attr.maxlength]=\"maxlength\" [attr.tabindex]=\"tabindex\" [readonly]=\"readonly\" [disabled]=\"disabled\" [attr.aria-label]=\"ariaLabel\" [attr.aria-labelledby]=\"ariaLabelledBy\" [attr.aria-required]=\"required\"\n ><ul *ngIf=\"multiple\" #multiContainer class=\"p-autocomplete-multiple-container p-component p-inputtext\" [ngClass]=\"{'p-disabled':disabled,'p-focus':focus}\" (click)=\"multiIn.focus()\" [style.max-height]=\"_maxHeighContainerItemStr\">\n <li #token *ngFor=\"let val of value\" class=\"p-autocomplete-token\" [class.disabled]=\"val._disabled\">\n <ng-container *ngTemplateOutlet=\"selectedItemTemplate; context: {$implicit: val}\"></ng-container>\n <span *ngIf=\"!selectedItemTemplate\" class=\"p-autocomplete-token-label\">{{resolveFieldData(val)}}</span>\n <span *ngIf=\"!disabled && !val._disabled\" class=\"p-autocomplete-token-icon pi pi-times-circle\" (click)=\"removeItem(token)\"></span>\n </li>\n <li class=\"p-autocomplete-token p-autocomplete-countItem\" *ngIf=\"showCountItem && value \" (click)=\"showMore()\">C\u00F3 {{value.length}} b\u1EA3n ghi ...</li>\n <!-- <ng-container *ngIf=\"value?.length > 10\">\n <li class=\"p-autocomplete-token p-autocomplete-countItem\" (click)=\"showMore()\">\n C\u00F3 {{value.length}} b\u1EA3n ghi ...\n </li>\n </ng-container> -->\n <li class=\"p-autocomplete-token p-autocomplete-countItem\" *ngIf=\"_maxHeighContainerItemStrOld != null\" (click)=\"showLess()\"><span><i class=\"fas fa-arrow-up\"></i></span><span>Thu l\u1EA1i</span></li>\n <li class=\"p-autocomplete-input-token\">\n <input #multiIn [attr.type]=\"type\" [attr.id]=\"inputId\" [disabled]=\"disabled\" [attr.placeholder]=\"(value&&value.length ? null : placeholder)\" [attr.tabindex]=\"tabindex\" [attr.maxlength]=\"maxlength\" (input)=\"onInput($event)\" (click)=\"onInputClick($event)\"\n (keydown)=\"onKeydown($event)\" [readonly]=\"readonly\" (keyup)=\"onKeyup($event)\" [attr.autofocus]=\"autofocus\" (focus)=\"onInputFocus($event)\" (blur)=\"onInputBlur($event)\" (change)=\"onInputChange($event)\" (paste)=\"onInputPaste($event)\" [autocomplete]=\"autocomplete\"\n [ngStyle]=\"inputStyle\" [class]=\"inputStyleClass\" [attr.aria-label]=\"ariaLabel\" [attr.aria-labelledby]=\"ariaLabelledBy\" [attr.aria-required]=\"required\"\n aria-autocomplete=\"list\" [attr.aria-controls]=\"listId\" role=\"searchbox\" [attr.aria-expanded]=\"overlayVisible\" aria-haspopup=\"true\" [attr.aria-activedescendant]=\"'p-highlighted-option'\">\n </li>\n </ul>\n <i *ngIf=\"loading\" class=\"p-autocomplete-loader pi pi-spinner pi-spin\"></i><button #ddBtn type=\"button\" pButton [icon]=\"dropdownIcon\" class=\"p-autocomplete-dropdown\" [disabled]=\"disabled\" pRipple\n (click)=\"handleDropdownClick($event)\" *ngIf=\"dropdown\" [attr.tabindex]=\"tabindex\"></button>\n <div #panel *ngIf=\"overlayVisible\" [ngClass]=\"['p-autocomplete-panel p-component']\" [style.max-height]=\"scrollHeight\" [ngStyle]=\"panelStyle\" [class]=\"panelStyleClass\"\n [@overlayAnimation]=\"{value: 'visible', params: {showTransitionParams: showTransitionOptions, hideTransitionParams: hideTransitionOptions}}\" (@overlayAnimation.start)=\"onOverlayAnimationStart($event)\" (@overlayAnimation.done)=\"onOverlayAnimationDone($event)\" >\n <ul role=\"listbox\" [attr.id]=\"listId\" class=\"p-autocomplete-items\">\n <li role=\"option\" *ngFor=\"let option of suggestions; let idx = index\" class=\"p-autocomplete-item\" pRipple [ngClass]=\"{'p-highlight': (option === highlightOption)}\" [id]=\"highlightOption == option ? 'p-highlighted-option':''\" (click)=\"selectItem(option)\">\n <span *ngIf=\"!itemTemplate\">{{resolveFieldData(option)}}</span>\n <ng-container *ngTemplateOutlet=\"itemTemplate; context: {$implicit: option, index: idx}\"></ng-container>\n </li>\n <li *ngIf=\"noResults && emptyMessage\" class=\"p-autocomplete-emptymessage p-autocomplete-item\">{{emptyMessage}}</li>\n </ul>\n </div>\n </span>\n ",
50464
+ animations: [
50465
+ animations$1.trigger('overlayAnimation', [
50466
+ animations$1.transition(':enter', [
50467
+ animations$1.style({ opacity: 0, transform: 'scaleY(0.8)' }),
50468
+ animations$1.animate('{{showTransitionParams}}')
50469
+ ]),
50470
+ animations$1.transition(':leave', [
50471
+ animations$1.animate('{{hideTransitionParams}}', animations$1.style({ opacity: 0 }))
50472
+ ])
50473
+ ])
50474
+ ],
50475
+ host: {
50476
+ '[class.p-inputwrapper-filled]': 'filled',
50477
+ '[class.p-inputwrapper-focus]': 'focus && !disabled'
50478
+ },
50479
+ providers: [AUTOCOMPLETE_VALUE_ACCESSOR],
50480
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
50481
+ encapsulation: i0.ViewEncapsulation.None,
50482
+ styles: [".p-autocomplete{display:inline-flex;position:relative}.p-autocomplete-loader{position:absolute;top:50%;margin-top:-.5rem}.p-autocomplete-dd .p-autocomplete-input{flex:1 1 auto;width:1%}.p-autocomplete-dd .p-autocomplete-input,.p-autocomplete-dd .p-autocomplete-multiple-container{border-top-right-radius:0;border-bottom-right-radius:0}.p-autocomplete-dd .p-autocomplete-dropdown{border-top-left-radius:0;border-bottom-left-radius:0}.p-autocomplete .p-autocomplete-panel{min-width:100%}.p-autocomplete-panel{position:absolute;overflow:auto}.p-autocomplete-items{margin:0;padding:0;list-style-type:none}.p-autocomplete-item{cursor:pointer;white-space:nowrap;position:relative;overflow:hidden}.p-autocomplete-multiple-container{margin:0;padding:0;list-style-type:none;cursor:text;overflow:hidden;display:flex;align-items:center;flex-wrap:wrap}.p-autocomplete-token{cursor:default;display:inline-flex;align-items:center;flex:0 0 auto;padding:.125em .5em;margin-right:.125em;border:0;font-size:.9em}.p-autocomplete-token-icon{cursor:pointer}.p-autocomplete-input-token{display:inline-block;vertical-align:middle;list-style-type:none;margin:0 0 0 .125em;padding:.25em .25em .25em 0}.p-autocomplete-input-token input{border:0;width:10em;outline:medium none;background-color:transparent;margin:0;padding:0;box-shadow:none;border-radius:0}.p-fluid .p-autocomplete{display:flex}.p-fluid .p-autocomplete-dd .p-autocomplete-input{width:1%}.p-autocomplete-countItem{background-color:#e1e1e1!important;box-sizing:border-box;display:inline-flex;align-items:center;cursor:pointer}"]
50483
+ },] }
50484
+ ];
50485
+ AutoComplete.ctorParameters = function () { return [
50486
+ { type: i0.ElementRef },
50487
+ { type: i0.Renderer2 },
50488
+ { type: i0.ChangeDetectorRef },
50489
+ { type: i0.IterableDiffers }
50490
+ ]; };
50491
+ AutoComplete.propDecorators = {
50492
+ minLength: [{ type: i0.Input }],
50493
+ delay: [{ type: i0.Input }],
50494
+ style: [{ type: i0.Input }],
50495
+ panelStyle: [{ type: i0.Input }],
50496
+ styleClass: [{ type: i0.Input }],
50497
+ panelStyleClass: [{ type: i0.Input }],
50498
+ inputStyle: [{ type: i0.Input }],
50499
+ inputId: [{ type: i0.Input }],
50500
+ inputStyleClass: [{ type: i0.Input }],
50501
+ placeholder: [{ type: i0.Input }],
50502
+ readonly: [{ type: i0.Input }],
50503
+ disabled: [{ type: i0.Input }],
50504
+ maxlength: [{ type: i0.Input }],
50505
+ name: [{ type: i0.Input }],
50506
+ required: [{ type: i0.Input }],
50507
+ size: [{ type: i0.Input }],
50508
+ appendTo: [{ type: i0.Input }],
50509
+ autoHighlight: [{ type: i0.Input }],
50510
+ forceSelection: [{ type: i0.Input }],
50511
+ type: [{ type: i0.Input }],
50512
+ autoZIndex: [{ type: i0.Input }],
50513
+ baseZIndex: [{ type: i0.Input }],
50514
+ ariaLabel: [{ type: i0.Input }],
50515
+ ariaLabelledBy: [{ type: i0.Input }],
50516
+ dropdownIcon: [{ type: i0.Input }],
50517
+ unique: [{ type: i0.Input }],
50518
+ completeOnFocus: [{ type: i0.Input }],
50519
+ completeMethod: [{ type: i0.Output }],
50520
+ onSelect: [{ type: i0.Output }],
50521
+ onUnselect: [{ type: i0.Output }],
50522
+ onFocus: [{ type: i0.Output }],
50523
+ onBlur: [{ type: i0.Output }],
50524
+ onDropdownClick: [{ type: i0.Output }],
50525
+ onClear: [{ type: i0.Output }],
50526
+ onKeyUp: [{ type: i0.Output }],
50527
+ onShow: [{ type: i0.Output }],
50528
+ onHide: [{ type: i0.Output }],
50529
+ field: [{ type: i0.Input }],
50530
+ scrollHeight: [{ type: i0.Input }],
50531
+ dropdown: [{ type: i0.Input }],
50532
+ dropdownMode: [{ type: i0.Input }],
50533
+ multiple: [{ type: i0.Input }],
50534
+ tabindex: [{ type: i0.Input }],
50535
+ dataKey: [{ type: i0.Input }],
50536
+ emptyMessage: [{ type: i0.Input }],
50537
+ showTransitionOptions: [{ type: i0.Input }],
50538
+ hideTransitionOptions: [{ type: i0.Input }],
50539
+ autofocus: [{ type: i0.Input }],
50540
+ autocomplete: [{ type: i0.Input }],
50541
+ maxRowItem: [{ type: i0.Input }],
50542
+ containerEL: [{ type: i0.ViewChild, args: ['container',] }],
50543
+ inputEL: [{ type: i0.ViewChild, args: ['in',] }],
50544
+ multiInputEL: [{ type: i0.ViewChild, args: ['multiIn',] }],
50545
+ multiContainerEL: [{ type: i0.ViewChild, args: ['multiContainer',] }],
50546
+ dropdownButton: [{ type: i0.ViewChild, args: ['ddBtn',] }],
50547
+ templates: [{ type: i0.ContentChildren, args: [i1.PrimeTemplate,] }],
50548
+ suggestions: [{ type: i0.Input }]
50549
+ };
50550
+ var AutoCompleteModule = /** @class */ (function () {
50551
+ function AutoCompleteModule() {
50552
+ }
50553
+ return AutoCompleteModule;
50554
+ }());
50555
+ AutoCompleteModule.decorators = [
50556
+ { type: i0.NgModule, args: [{
50557
+ imports: [i3.CommonModule, inputtext.InputTextModule, button.ButtonModule, i1.SharedModule, ripple.RippleModule],
50558
+ exports: [AutoComplete, i1.SharedModule],
50559
+ declarations: [AutoComplete]
50560
+ },] }
50561
+ ];
50562
+
50563
+ /* eslint-disable prefer-const */
50564
+ var HtmlPreviewComponent = /** @class */ (function () {
50565
+ function HtmlPreviewComponent(gs, _commonService) {
50566
+ this.gs = gs;
50567
+ this._commonService = _commonService;
50568
+ this.control = new HtmlPreviewControlSchema();
50569
+ this.onChanged = new i0.EventEmitter();
50570
+ this.content = '';
50571
+ this.id = '';
50572
+ this.id = this._commonService.guid();
50573
+ }
50574
+ // ngOnChanges(changes: SimpleChanges) {
50575
+ // if (changes['content']) {
50576
+ // this.renderMath();
50577
+ // }
50578
+ // }
50579
+ HtmlPreviewComponent.prototype.writeValue = function (obj) {
50580
+ if (obj) {
50581
+ this.content = obj;
50582
+ }
50583
+ else {
50584
+ this.content = '';
50585
+ }
50586
+ this.renderMath();
50587
+ };
50588
+ HtmlPreviewComponent.prototype.registerOnChange = function (fn) {
50589
+ this.onChange = fn;
50590
+ };
50591
+ HtmlPreviewComponent.prototype.registerOnTouched = function (fn) {
50592
+ this.onTouched = fn;
50593
+ };
50594
+ HtmlPreviewComponent.prototype.renderMath = function () {
50595
+ var _this = this;
50596
+ this.mathJaxObject = this.gs.nativeGlobal()['MathJax'];
50597
+ if (!this.mathJaxObject && !this.mathContent) {
50598
+ return;
50599
+ }
50600
+ setTimeout(function () {
50601
+ var _a, _b;
50602
+ var $this = _this;
50603
+ var autoScrollBottom = !!((_a = $this.control) === null || _a === void 0 ? void 0 : _a.autoScrollBottom);
50604
+ var output = $this.mathContent.nativeElement;
50605
+ var content = ((_b = $this.content) === null || _b === void 0 ? void 0 : _b.trim()) || '';
50606
+ if (!$this.control.isHtml) {
50607
+ content = content.replace(/\n/g, '<br>');
50608
+ }
50609
+ output.innerHTML = content;
50610
+ if ($this.mathJaxObject.texReset) {
50611
+ $this.mathJaxObject.texReset();
50612
+ }
50613
+ if ($this.mathJaxObject.typesetClear) {
50614
+ $this.mathJaxObject.typesetClear();
50615
+ }
50616
+ if ($this.mathJaxObject.typesetPromise) {
50617
+ $this.mathJaxObject.typesetPromise([output]).catch(function (err) {
50618
+ output.innerHTML = '';
50619
+ output.appendChild(document.createTextNode(err.message));
50620
+ console.error(err);
50621
+ }).then(function () {
50622
+ var _a, _b, _c;
50623
+ // Do something after typeset
50624
+ if (autoScrollBottom) {
50625
+ var box = document.querySelector("#math-preview-box-" + $this.id);
50626
+ var elem = box.getElementsByClassName('ps--active-y')[0];
50627
+ if (elem) {
50628
+ elem.scrollTop = elem.scrollHeight;
50629
+ }
50630
+ }
50631
+ var value = (_c = (_b = (_a = document.getElementById("mathPreview-" + $this.id)) === null || _a === void 0 ? void 0 : _a.innerHTML) === null || _b === void 0 ? void 0 : _b.trim()) !== null && _c !== void 0 ? _c : '';
50632
+ $this.onChange(value);
50633
+ $this.onChanged.emit(value);
50634
+ });
50635
+ }
50636
+ return $this.mathJaxObject.startup.defaultPageReady ? $this.mathJaxObject.startup.defaultPageReady() : $this.mathJaxObject.startup.defaultPageReady;
50637
+ });
50638
+ };
50639
+ HtmlPreviewComponent.prototype.loadMathConfig = function () {
50640
+ var _this = this;
50641
+ var _a, _b, _c;
50642
+ var wd = this.gs.nativeGlobal();
50643
+ wd.MathJax = {
50644
+ 'loader': { load: ['input/asciimath', 'output/chtml', 'ui/menu', 'output/svg', '[mml]/mml3'] },
50645
+ 'tex': {
50646
+ inlineMath: [['$', '$'], ['\\(', '\\)']],
50647
+ processEscapes: true
50648
+ },
50649
+ 'startup': {
50650
+ pageReady: function () { return _this.renderMath(); }
50651
+ },
50652
+ 'svg': {
50653
+ scale: 1,
50654
+ minScale: .5
50655
+ },
50656
+ 'options': {
50657
+ enableMenu: !!((_a = this.control) === null || _a === void 0 ? void 0 : _a.useMathJaxMenu),
50658
+ menuOptions: {
50659
+ settings: {
50660
+ texHints: true,
50661
+ semantics: false,
50662
+ zoom: 'Double-Click',
50663
+ zscale: '200%',
50664
+ renderer: ((_b = this.control) === null || _b === void 0 ? void 0 : _b.mathJaxType) ? this.control.mathJaxType : 'CHTML',
50665
+ scale: 1,
50666
+ inTabOrder: true,
50667
+ assistiveMml: true,
50668
+ collapsible: false,
50669
+ explorer: false, // true if the expression explorer should be active
50670
+ },
50671
+ annotationTypes: {
50672
+ TeX: ['TeX', 'LaTeX', 'application/x-tex'],
50673
+ StarMath: ['StarMath 5.0'],
50674
+ Maple: ['Maple'],
50675
+ ContentMathML: ['MathML-Content', 'application/mathml-content+xml'],
50676
+ OpenMath: ['OpenMath']
50677
+ }
50678
+ }
50679
+ }
50680
+ };
50681
+ var script = document.createElement('script');
50682
+ if (((_c = this.control) === null || _c === void 0 ? void 0 : _c.mathJaxType) == 'SVG') {
50683
+ script.src = 'assets/vendor/mathjax/tex-mml-svg.js';
50684
+ }
50685
+ else {
50686
+ script.src = 'assets/vendor/mathjax/tex-mml-chtml.js';
50687
+ }
50688
+ script.setAttribute('id', 'MathJax-script');
50689
+ document.head.appendChild(script);
50690
+ };
50691
+ HtmlPreviewComponent.prototype.ngOnInit = function () {
50692
+ this.loadMathConfig();
50693
+ };
50694
+ return HtmlPreviewComponent;
50695
+ }());
50696
+ HtmlPreviewComponent.decorators = [
50697
+ { type: i0.Component, args: [{
50698
+ selector: 'html-preview',
50699
+ template: "<div class=\"preview-box\" id=\"math-preview-box-{{id}}\" [ngStyle]=\"{'height': control.height + 'px'}\">\n <tn-custom-scrollbar [showScrollHorizontal]=\"true\">\n <div #mathContent id=\"mathPreview-{{id}}\"></div>\n </tn-custom-scrollbar>\n</div>",
50700
+ providers: [
50701
+ ComponentContextService,
50702
+ {
50703
+ provide: forms.NG_VALUE_ACCESSOR,
50704
+ useExisting: i0.forwardRef(function () { return HtmlPreviewComponent; }),
50705
+ multi: true
50706
+ },
50707
+ ],
50708
+ styles: ["::ng-deep html-preview .preview-box{border:1px solid #ced4da;padding:10px}"]
50709
+ },] }
50710
+ ];
50711
+ HtmlPreviewComponent.ctorParameters = function () { return [
50712
+ { type: GlobalService },
50713
+ { type: CommonService }
50714
+ ]; };
50715
+ HtmlPreviewComponent.propDecorators = {
50716
+ mathContent: [{ type: i0.ViewChild, args: ['mathContent',] }],
50717
+ control: [{ type: i0.Input }],
50718
+ onChanged: [{ type: i0.Output }]
50719
+ };
50720
+
50721
+ var SettingAuthorizeButtonComponent = /** @class */ (function (_super) {
50722
+ __extends(SettingAuthorizeButtonComponent, _super);
50723
+ function SettingAuthorizeButtonComponent(_injector, _basePermissionService, _moduleConfigService) {
50724
+ var _this = _super.call(this, _injector) || this;
50725
+ _this._injector = _injector;
50726
+ _this._basePermissionService = _basePermissionService;
50727
+ _this._moduleConfigService = _moduleConfigService;
50728
+ _this.authorizeButtonKey = '';
50729
+ _this.dataSource = [];
50730
+ _this.appCode = '';
50731
+ return _this;
50732
+ }
50733
+ SettingAuthorizeButtonComponent.prototype.ngOnInit = function () {
50734
+ this.appCode = this._moduleConfigService.getConfig().appCode;
50735
+ this.setting.baseService = this._basePermissionService;
50736
+ this.customGetData = true;
50737
+ this.setting.hiddenAdvanceSearch = true;
50738
+ this.setting.hiddenHeader = true;
50739
+ this.setting.heightType = exports.HeightType.dynamic;
50740
+ this.setting.hiddenOrderColumn = true;
50741
+ this.setting.hiddenFilterRow = true;
50742
+ this.setting.hiddenSettingWorkflow = true;
50743
+ this.setting.hiddenAuthorizeButton = true;
50744
+ this.setting.hiddenSettingPermission = true;
50745
+ this.setting.fixHeightTypeInDialog = false;
50746
+ this.setting.hiddenCheckbox = false;
50747
+ this.setting.showEditLink = false;
50748
+ this.setting.modelSchemas = [
50749
+ new ModelSchema({
50750
+ field: 'permissionCode',
50751
+ name: 'Mã',
50752
+ }),
50753
+ new ModelSchema({
50754
+ field: 'rawText',
50755
+ name: 'Tên',
50756
+ }),
50757
+ new ModelSchema({
50758
+ field: 'isAuthorize',
50759
+ name: 'Đã tạo quyền',
50760
+ }),
50761
+ new ModelSchema({
50762
+ field: 'ma1',
50763
+ name: 'Mã',
50764
+ }),
50765
+ ];
50766
+ this.setting.cols = [
50767
+ new ColumnSchemaBase({ field: 'permissionCode', sort: false, showEditLink: false }),
50768
+ new ColumnSchemaBase({ field: 'rawText', width: '300px', sort: false }),
50769
+ new ColumnSchemaBase({ field: 'isAuthorize', dataType: exports.DataType.boolean, width: '100px', sort: false }),
50770
+ ];
50771
+ _super.prototype.ngOnInit.call(this);
50772
+ };
50773
+ SettingAuthorizeButtonComponent.prototype.getDataCustom = function (gridInfo) {
50774
+ this.model.dataSource = this.dataSource;
50775
+ this.afterGetData();
50776
+ };
50777
+ SettingAuthorizeButtonComponent.prototype.addBasePermission = function (rowData) {
50778
+ return __awaiter(this, void 0, void 0, function () {
50779
+ var insertRes;
50780
+ return __generator(this, function (_b) {
50781
+ switch (_b.label) {
50782
+ case 0: return [4 /*yield*/, this._basePermissionService.post(rowData)];
50783
+ case 1:
50784
+ insertRes = _b.sent();
50785
+ if (insertRes.success) {
50786
+ this._notifierService.showSuccess('Thêm quyền thành công');
50787
+ this.updateDataSource(insertRes.data);
50788
+ return [2 /*return*/];
50789
+ }
50790
+ this._notifierService.showWarning('Có lỗi trong quá trình xử lý, vui lòng thử lại');
50791
+ return [2 /*return*/];
50792
+ }
50793
+ });
50794
+ });
50795
+ };
50796
+ SettingAuthorizeButtonComponent.prototype.deleteBasePermission = function (rowData) {
50797
+ return __awaiter(this, void 0, void 0, function () {
50798
+ var _this = this;
50799
+ return __generator(this, function (_b) {
50800
+ this._notifierService.showConfirm('Xác nhận xóa quyền').then(function (res) { return __awaiter(_this, void 0, void 0, function () {
50801
+ var deleteRes;
50802
+ return __generator(this, function (_b) {
50803
+ switch (_b.label) {
50804
+ case 0:
50805
+ if (!res)
50806
+ return [2 /*return*/];
50807
+ return [4 /*yield*/, this._basePermissionService.delete(rowData.id)];
50808
+ case 1:
50809
+ deleteRes = _b.sent();
50810
+ if (deleteRes.success) {
50811
+ this._notifierService.showSuccess('Xóa quyền thành công');
50812
+ this.updateDataSource(rowData.id, true);
50813
+ return [2 /*return*/];
50814
+ }
50815
+ this._notifierService.showWarning(deleteRes.message);
50816
+ return [2 /*return*/];
50817
+ }
50818
+ });
50819
+ }); });
50820
+ return [2 /*return*/];
50821
+ });
50822
+ });
50823
+ };
50824
+ SettingAuthorizeButtonComponent.prototype.updateDataSource = function (id, isDeleted) {
50825
+ if (isDeleted === void 0) { isDeleted = false; }
50826
+ var currentRow = this.model.dataSource.find(function (p) { return p.id == id; });
50827
+ if (!currentRow)
50828
+ return;
50829
+ if (isDeleted) {
50830
+ currentRow.id = this._commonService.guid();
50831
+ }
50832
+ currentRow.isAuthorize = !isDeleted;
50833
+ this.afterGetData();
50834
+ };
50835
+ SettingAuthorizeButtonComponent.prototype.afterGetData = function () {
50836
+ return __awaiter(this, void 0, void 0, function () {
50837
+ var _this = this;
50838
+ return __generator(this, function (_b) {
50839
+ this._unmarkLoading();
50840
+ if (!this.model.dataSource.length)
50841
+ return [2 /*return*/];
50842
+ this.model.dataSource.forEach(function (item) {
50843
+ item.name = item.rawText;
50844
+ item.code = item.permissionCode;
50845
+ item.moduleCode = _this.appCode;
50846
+ });
50847
+ return [2 /*return*/];
50848
+ });
50849
+ });
50850
+ };
50851
+ SettingAuthorizeButtonComponent.prototype.ngOnDestroy = function () {
50852
+ var _this = this;
50853
+ var _a;
50854
+ var buttonSetting = JSON.parse(sessionStorage.getItem(ComCtxConstants.LOCALSTORAGE_KEY.BUTTON_AUTHORIZE) || '{}');
50855
+ buttonSetting[_a = this.authorizeButtonKey] || (buttonSetting[_a] = []);
50856
+ this.model.dataSource.forEach(function (rowData) {
50857
+ var _a;
50858
+ var buttonItem = (_a = buttonSetting[_this.authorizeButtonKey]) === null || _a === void 0 ? void 0 : _a.find(function (p) { return p.code == rowData.code; });
50859
+ if (rowData.isAuthorize && !buttonItem) {
50860
+ buttonSetting[_this.authorizeButtonKey].push({
50861
+ id: rowData.id,
50862
+ code: rowData.code,
50863
+ });
50864
+ }
50865
+ else if (!rowData.isAuthorize && buttonItem) {
50866
+ var index = buttonSetting[_this.authorizeButtonKey].indexOf(buttonItem);
50867
+ buttonSetting[_this.authorizeButtonKey].splice(index, 1);
50868
+ }
50869
+ });
50870
+ sessionStorage.setItem(ComCtxConstants.LOCALSTORAGE_KEY.BUTTON_AUTHORIZE, JSON.stringify(buttonSetting));
50871
+ };
50872
+ return SettingAuthorizeButtonComponent;
50873
+ }(DataListBase));
50874
+ SettingAuthorizeButtonComponent.decorators = [
50875
+ { type: i0.Component, args: [{
50876
+ selector: 'settings-authorize-button',
50877
+ template: "<crud-list #crudList [menuButtons]=\"getMenuButtons\" [model]=\"model\" [setting]=\"setting\" [dataSource]=\"model.dataSource\"\n [hiddenAdd]=\"true\" [hiddenDelete]=\"true\" [hiddenCopyLink]=\"true\" (onReload)=\"_triggerProcessData($event)\"\n (onAdd)=\"_add($event)\" (onEdit)=\"_edit($event)\" (onView)=\"_view($event)\" (onDelete)=\"_delete($event)\"\n (onDeleteMultiple)=\"_deleteMultiple($event)\" (onReloaded)=\"_handleReloaded($event)\" (onCopyLink)=\"_copyLink($event)\"\n (onCopyLinkMultiple)=\"_copyLinkMultiple()\">\n <ng-template #function let-rowData=\"rowData\">\n <button *ngIf=\"!rowData.isAuthorize\" class=\"p-button-rounded p-button-text p-button-info link-or-action\"\n type=\"button\" pButton icon=\"pi pi-plus\" pTooltip=\"Th\u00EAm m\u1EDBi\" (click)=\"addBasePermission(rowData)\"></button>\n <button *ngIf=\"rowData.isAuthorize\"\n class=\"p-button-rounded p-button-text p-button-danger p-button-info link-or-action\" type=\"button\" pButton\n icon=\"pi pi-trash\" pTooltip=\"X\u00F3a\" (click)=\"deleteBasePermission(rowData)\"></button>\n </ng-template>\n</crud-list>",
50878
+ providers: [ComponentContextService],
50879
+ styles: [""]
50880
+ },] }
50881
+ ];
50882
+ SettingAuthorizeButtonComponent.ctorParameters = function () { return [
50883
+ { type: i0.Injector },
50884
+ { type: BasePermissionService },
50885
+ { type: ModuleConfigService }
50886
+ ]; };
50887
+ SettingAuthorizeButtonComponent.propDecorators = {
50888
+ authorizeButtonKey: [{ type: i0.Input }],
50889
+ dataSource: [{ type: i0.Input }]
50890
+ };
50891
+
49866
50892
  var SettingsRowComponent = /** @class */ (function (_super) {
49867
50893
  __extends(SettingsRowComponent, _super);
49868
50894
  function SettingsRowComponent(_injector, _domService, _userService) {
@@ -50197,177 +51223,6 @@
50197
51223
  parentSetting: [{ type: i0.Input }]
50198
51224
  };
50199
51225
 
50200
- var SettingAuthorizeButtonComponent = /** @class */ (function (_super) {
50201
- __extends(SettingAuthorizeButtonComponent, _super);
50202
- function SettingAuthorizeButtonComponent(_injector, _basePermissionService, _moduleConfigService) {
50203
- var _this = _super.call(this, _injector) || this;
50204
- _this._injector = _injector;
50205
- _this._basePermissionService = _basePermissionService;
50206
- _this._moduleConfigService = _moduleConfigService;
50207
- _this.authorizeButtonKey = '';
50208
- _this.dataSource = [];
50209
- _this.appCode = '';
50210
- return _this;
50211
- }
50212
- SettingAuthorizeButtonComponent.prototype.ngOnInit = function () {
50213
- this.appCode = this._moduleConfigService.getConfig().appCode;
50214
- this.setting.baseService = this._basePermissionService;
50215
- this.customGetData = true;
50216
- this.setting.hiddenAdvanceSearch = true;
50217
- this.setting.hiddenHeader = true;
50218
- this.setting.heightType = exports.HeightType.dynamic;
50219
- this.setting.hiddenOrderColumn = true;
50220
- this.setting.hiddenFilterRow = true;
50221
- this.setting.hiddenSettingWorkflow = true;
50222
- this.setting.hiddenAuthorizeButton = true;
50223
- this.setting.hiddenSettingPermission = true;
50224
- this.setting.fixHeightTypeInDialog = false;
50225
- this.setting.hiddenCheckbox = false;
50226
- this.setting.showEditLink = false;
50227
- this.setting.modelSchemas = [
50228
- new ModelSchema({
50229
- field: 'permissionCode',
50230
- name: 'Mã',
50231
- }),
50232
- new ModelSchema({
50233
- field: 'rawText',
50234
- name: 'Tên',
50235
- }),
50236
- new ModelSchema({
50237
- field: 'isAuthorize',
50238
- name: 'Đã tạo quyền',
50239
- }),
50240
- new ModelSchema({
50241
- field: 'ma1',
50242
- name: 'Mã',
50243
- }),
50244
- ];
50245
- this.setting.cols = [
50246
- new ColumnSchemaBase({ field: 'permissionCode', sort: false, showEditLink: false }),
50247
- new ColumnSchemaBase({ field: 'rawText', width: '300px', sort: false }),
50248
- new ColumnSchemaBase({ field: 'isAuthorize', dataType: exports.DataType.boolean, width: '100px', sort: false }),
50249
- ];
50250
- _super.prototype.ngOnInit.call(this);
50251
- };
50252
- SettingAuthorizeButtonComponent.prototype.getDataCustom = function (gridInfo) {
50253
- this.model.dataSource = this.dataSource;
50254
- this.afterGetData();
50255
- };
50256
- SettingAuthorizeButtonComponent.prototype.addBasePermission = function (rowData) {
50257
- return __awaiter(this, void 0, void 0, function () {
50258
- var insertRes;
50259
- return __generator(this, function (_b) {
50260
- switch (_b.label) {
50261
- case 0: return [4 /*yield*/, this._basePermissionService.post(rowData)];
50262
- case 1:
50263
- insertRes = _b.sent();
50264
- if (insertRes.success) {
50265
- this._notifierService.showSuccess('Thêm quyền thành công');
50266
- this.updateDataSource(insertRes.data);
50267
- return [2 /*return*/];
50268
- }
50269
- this._notifierService.showWarning('Có lỗi trong quá trình xử lý, vui lòng thử lại');
50270
- return [2 /*return*/];
50271
- }
50272
- });
50273
- });
50274
- };
50275
- SettingAuthorizeButtonComponent.prototype.deleteBasePermission = function (rowData) {
50276
- return __awaiter(this, void 0, void 0, function () {
50277
- var _this = this;
50278
- return __generator(this, function (_b) {
50279
- this._notifierService.showConfirm('Xác nhận xóa quyền').then(function (res) { return __awaiter(_this, void 0, void 0, function () {
50280
- var deleteRes;
50281
- return __generator(this, function (_b) {
50282
- switch (_b.label) {
50283
- case 0:
50284
- if (!res)
50285
- return [2 /*return*/];
50286
- return [4 /*yield*/, this._basePermissionService.delete(rowData.id)];
50287
- case 1:
50288
- deleteRes = _b.sent();
50289
- if (deleteRes.success) {
50290
- this._notifierService.showSuccess('Xóa quyền thành công');
50291
- this.updateDataSource(rowData.id, true);
50292
- return [2 /*return*/];
50293
- }
50294
- this._notifierService.showWarning(deleteRes.message);
50295
- return [2 /*return*/];
50296
- }
50297
- });
50298
- }); });
50299
- return [2 /*return*/];
50300
- });
50301
- });
50302
- };
50303
- SettingAuthorizeButtonComponent.prototype.updateDataSource = function (id, isDeleted) {
50304
- if (isDeleted === void 0) { isDeleted = false; }
50305
- var currentRow = this.model.dataSource.find(function (p) { return p.id == id; });
50306
- if (!currentRow)
50307
- return;
50308
- if (isDeleted) {
50309
- currentRow.id = this._commonService.guid();
50310
- }
50311
- currentRow.isAuthorize = !isDeleted;
50312
- this.afterGetData();
50313
- };
50314
- SettingAuthorizeButtonComponent.prototype.afterGetData = function () {
50315
- return __awaiter(this, void 0, void 0, function () {
50316
- var _this = this;
50317
- return __generator(this, function (_b) {
50318
- this._unmarkLoading();
50319
- if (!this.model.dataSource.length)
50320
- return [2 /*return*/];
50321
- this.model.dataSource.forEach(function (item) {
50322
- item.name = item.rawText;
50323
- item.code = item.permissionCode;
50324
- item.moduleCode = _this.appCode;
50325
- });
50326
- return [2 /*return*/];
50327
- });
50328
- });
50329
- };
50330
- SettingAuthorizeButtonComponent.prototype.ngOnDestroy = function () {
50331
- var _this = this;
50332
- var _a;
50333
- var buttonSetting = JSON.parse(sessionStorage.getItem(ComCtxConstants.LOCALSTORAGE_KEY.BUTTON_AUTHORIZE) || '{}');
50334
- buttonSetting[_a = this.authorizeButtonKey] || (buttonSetting[_a] = []);
50335
- this.model.dataSource.forEach(function (rowData) {
50336
- var _a;
50337
- var buttonItem = (_a = buttonSetting[_this.authorizeButtonKey]) === null || _a === void 0 ? void 0 : _a.find(function (p) { return p.code == rowData.code; });
50338
- if (rowData.isAuthorize && !buttonItem) {
50339
- buttonSetting[_this.authorizeButtonKey].push({
50340
- id: rowData.id,
50341
- code: rowData.code,
50342
- });
50343
- }
50344
- else if (!rowData.isAuthorize && buttonItem) {
50345
- var index = buttonSetting[_this.authorizeButtonKey].indexOf(buttonItem);
50346
- buttonSetting[_this.authorizeButtonKey].splice(index, 1);
50347
- }
50348
- });
50349
- sessionStorage.setItem(ComCtxConstants.LOCALSTORAGE_KEY.BUTTON_AUTHORIZE, JSON.stringify(buttonSetting));
50350
- };
50351
- return SettingAuthorizeButtonComponent;
50352
- }(DataListBase));
50353
- SettingAuthorizeButtonComponent.decorators = [
50354
- { type: i0.Component, args: [{
50355
- selector: 'settings-authorize-button',
50356
- template: "<crud-list #crudList [menuButtons]=\"getMenuButtons\" [model]=\"model\" [setting]=\"setting\" [dataSource]=\"model.dataSource\"\n [hiddenAdd]=\"true\" [hiddenDelete]=\"true\" [hiddenCopyLink]=\"true\" (onReload)=\"_triggerProcessData($event)\"\n (onAdd)=\"_add($event)\" (onEdit)=\"_edit($event)\" (onView)=\"_view($event)\" (onDelete)=\"_delete($event)\"\n (onDeleteMultiple)=\"_deleteMultiple($event)\" (onReloaded)=\"_handleReloaded($event)\" (onCopyLink)=\"_copyLink($event)\"\n (onCopyLinkMultiple)=\"_copyLinkMultiple()\">\n <ng-template #function let-rowData=\"rowData\">\n <button *ngIf=\"!rowData.isAuthorize\" class=\"p-button-rounded p-button-text p-button-info link-or-action\"\n type=\"button\" pButton icon=\"pi pi-plus\" pTooltip=\"Th\u00EAm m\u1EDBi\" (click)=\"addBasePermission(rowData)\"></button>\n <button *ngIf=\"rowData.isAuthorize\"\n class=\"p-button-rounded p-button-text p-button-danger p-button-info link-or-action\" type=\"button\" pButton\n icon=\"pi pi-trash\" pTooltip=\"X\u00F3a\" (click)=\"deleteBasePermission(rowData)\"></button>\n </ng-template>\n</crud-list>",
50357
- providers: [ComponentContextService],
50358
- styles: [""]
50359
- },] }
50360
- ];
50361
- SettingAuthorizeButtonComponent.ctorParameters = function () { return [
50362
- { type: i0.Injector },
50363
- { type: BasePermissionService },
50364
- { type: ModuleConfigService }
50365
- ]; };
50366
- SettingAuthorizeButtonComponent.propDecorators = {
50367
- authorizeButtonKey: [{ type: i0.Input }],
50368
- dataSource: [{ type: i0.Input }]
50369
- };
50370
-
50371
51226
  var SettingsComponent = /** @class */ (function (_super) {
50372
51227
  __extends(SettingsComponent, _super);
50373
51228
  function SettingsComponent(_injector, _domService, _userService) {
@@ -54348,164 +55203,6 @@
54348
55203
  },] }
54349
55204
  ];
54350
55205
 
54351
- /* eslint-disable prefer-const */
54352
- var HtmlPreviewComponent = /** @class */ (function () {
54353
- function HtmlPreviewComponent(gs, _commonService) {
54354
- this.gs = gs;
54355
- this._commonService = _commonService;
54356
- this.control = new HtmlPreviewControlSchema();
54357
- this.onChanged = new i0.EventEmitter();
54358
- this.content = '';
54359
- this.id = '';
54360
- this.id = this._commonService.guid();
54361
- }
54362
- // ngOnChanges(changes: SimpleChanges) {
54363
- // if (changes['content']) {
54364
- // this.renderMath();
54365
- // }
54366
- // }
54367
- HtmlPreviewComponent.prototype.writeValue = function (obj) {
54368
- if (obj) {
54369
- this.content = obj;
54370
- }
54371
- else {
54372
- this.content = '';
54373
- }
54374
- this.renderMath();
54375
- };
54376
- HtmlPreviewComponent.prototype.registerOnChange = function (fn) {
54377
- this.onChange = fn;
54378
- };
54379
- HtmlPreviewComponent.prototype.registerOnTouched = function (fn) {
54380
- this.onTouched = fn;
54381
- };
54382
- HtmlPreviewComponent.prototype.renderMath = function () {
54383
- var _this = this;
54384
- this.mathJaxObject = this.gs.nativeGlobal()['MathJax'];
54385
- if (!this.mathJaxObject && !this.mathContent) {
54386
- return;
54387
- }
54388
- setTimeout(function () {
54389
- var _a, _b;
54390
- var $this = _this;
54391
- var autoScrollBottom = !!((_a = $this.control) === null || _a === void 0 ? void 0 : _a.autoScrollBottom);
54392
- var output = $this.mathContent.nativeElement;
54393
- var content = ((_b = $this.content) === null || _b === void 0 ? void 0 : _b.trim()) || '';
54394
- if (!$this.control.isHtml) {
54395
- content = content.replace(/\n/g, '<br>');
54396
- }
54397
- output.innerHTML = content;
54398
- if ($this.mathJaxObject.texReset) {
54399
- $this.mathJaxObject.texReset();
54400
- }
54401
- if ($this.mathJaxObject.typesetClear) {
54402
- $this.mathJaxObject.typesetClear();
54403
- }
54404
- if ($this.mathJaxObject.typesetPromise) {
54405
- $this.mathJaxObject.typesetPromise([output]).catch(function (err) {
54406
- output.innerHTML = '';
54407
- output.appendChild(document.createTextNode(err.message));
54408
- console.error(err);
54409
- }).then(function () {
54410
- var _a, _b, _c;
54411
- // Do something after typeset
54412
- if (autoScrollBottom) {
54413
- var box = document.querySelector("#math-preview-box-" + $this.id);
54414
- var elem = box.getElementsByClassName('ps--active-y')[0];
54415
- if (elem) {
54416
- elem.scrollTop = elem.scrollHeight;
54417
- }
54418
- }
54419
- var value = (_c = (_b = (_a = document.getElementById("mathPreview-" + $this.id)) === null || _a === void 0 ? void 0 : _a.innerHTML) === null || _b === void 0 ? void 0 : _b.trim()) !== null && _c !== void 0 ? _c : '';
54420
- $this.onChange(value);
54421
- $this.onChanged.emit(value);
54422
- });
54423
- }
54424
- return $this.mathJaxObject.startup.defaultPageReady ? $this.mathJaxObject.startup.defaultPageReady() : $this.mathJaxObject.startup.defaultPageReady;
54425
- });
54426
- };
54427
- HtmlPreviewComponent.prototype.loadMathConfig = function () {
54428
- var _this = this;
54429
- var _a, _b, _c;
54430
- var wd = this.gs.nativeGlobal();
54431
- wd.MathJax = {
54432
- 'loader': { load: ['input/asciimath', 'output/chtml', 'ui/menu', 'output/svg', '[mml]/mml3'] },
54433
- 'tex': {
54434
- inlineMath: [['$', '$'], ['\\(', '\\)']],
54435
- processEscapes: true
54436
- },
54437
- 'startup': {
54438
- pageReady: function () { return _this.renderMath(); }
54439
- },
54440
- 'svg': {
54441
- scale: 1,
54442
- minScale: .5
54443
- },
54444
- 'options': {
54445
- enableMenu: !!((_a = this.control) === null || _a === void 0 ? void 0 : _a.useMathJaxMenu),
54446
- menuOptions: {
54447
- settings: {
54448
- texHints: true,
54449
- semantics: false,
54450
- zoom: 'Double-Click',
54451
- zscale: '200%',
54452
- renderer: ((_b = this.control) === null || _b === void 0 ? void 0 : _b.mathJaxType) ? this.control.mathJaxType : 'CHTML',
54453
- scale: 1,
54454
- inTabOrder: true,
54455
- assistiveMml: true,
54456
- collapsible: false,
54457
- explorer: false, // true if the expression explorer should be active
54458
- },
54459
- annotationTypes: {
54460
- TeX: ['TeX', 'LaTeX', 'application/x-tex'],
54461
- StarMath: ['StarMath 5.0'],
54462
- Maple: ['Maple'],
54463
- ContentMathML: ['MathML-Content', 'application/mathml-content+xml'],
54464
- OpenMath: ['OpenMath']
54465
- }
54466
- }
54467
- }
54468
- };
54469
- var script = document.createElement('script');
54470
- if (((_c = this.control) === null || _c === void 0 ? void 0 : _c.mathJaxType) == 'SVG') {
54471
- script.src = 'assets/vendor/mathjax/tex-mml-svg.js';
54472
- }
54473
- else {
54474
- script.src = 'assets/vendor/mathjax/tex-mml-chtml.js';
54475
- }
54476
- script.setAttribute('id', 'MathJax-script');
54477
- document.head.appendChild(script);
54478
- };
54479
- HtmlPreviewComponent.prototype.ngOnInit = function () {
54480
- this.loadMathConfig();
54481
- };
54482
- return HtmlPreviewComponent;
54483
- }());
54484
- HtmlPreviewComponent.decorators = [
54485
- { type: i0.Component, args: [{
54486
- selector: 'html-preview',
54487
- template: "<div class=\"preview-box\" id=\"math-preview-box-{{id}}\" [ngStyle]=\"{'height': control.height + 'px'}\">\n <tn-custom-scrollbar [showScrollHorizontal]=\"true\">\n <div #mathContent id=\"mathPreview-{{id}}\"></div>\n </tn-custom-scrollbar>\n</div>",
54488
- providers: [
54489
- ComponentContextService,
54490
- {
54491
- provide: forms.NG_VALUE_ACCESSOR,
54492
- useExisting: i0.forwardRef(function () { return HtmlPreviewComponent; }),
54493
- multi: true
54494
- },
54495
- ],
54496
- styles: ["::ng-deep html-preview .preview-box{border:1px solid #ced4da;padding:10px}"]
54497
- },] }
54498
- ];
54499
- HtmlPreviewComponent.ctorParameters = function () { return [
54500
- { type: GlobalService },
54501
- { type: CommonService }
54502
- ]; };
54503
- HtmlPreviewComponent.propDecorators = {
54504
- mathContent: [{ type: i0.ViewChild, args: ['mathContent',] }],
54505
- control: [{ type: i0.Input }],
54506
- onChanged: [{ type: i0.Output }]
54507
- };
54508
-
54509
55206
  function coreDeclaration() {
54510
55207
  return [
54511
55208
  AddressComponent,
@@ -54665,7 +55362,6 @@
54665
55362
  core.TranslateModule,
54666
55363
  tree.TreeModule,
54667
55364
  scrollpanel.ScrollPanelModule,
54668
- autocomplete.AutoCompleteModule,
54669
55365
  paginator.PaginatorModule,
54670
55366
  blockui.BlockUIModule,
54671
55367
  menu.MenuModule,
@@ -54697,6 +55393,7 @@
54697
55393
  steps.StepsModule,
54698
55394
  progressspinner.ProgressSpinnerModule,
54699
55395
  ngxDragDrop.DndModule,
55396
+ AutoCompleteModule,
54700
55397
  dragdrop.DragDropModule
54701
55398
  ];
54702
55399
  }
@@ -55323,6 +56020,9 @@
55323
56020
  exports["ɵdy"] = SettingsWorkflowNo1Component;
55324
56021
  exports["ɵdz"] = HtmlPreviewComponent;
55325
56022
  exports["ɵe"] = ListBase;
56023
+ exports["ɵea"] = AUTOCOMPLETE_VALUE_ACCESSOR;
56024
+ exports["ɵeb"] = AutoComplete;
56025
+ exports["ɵec"] = AutoCompleteModule;
55326
56026
  exports["ɵf"] = ListComponentBase;
55327
56027
  exports["ɵg"] = TreeTableComponent;
55328
56028
  exports["ɵh"] = NotFoundComponent;