tnx-shared 5.3.242 → 5.3.243

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,
@@ -49863,6 +49863,1030 @@
49863
49863
  onInit: [{ type: i0.Output }]
49864
49864
  };
49865
49865
 
49866
+ var AUTOCOMPLETE_VALUE_ACCESSOR = {
49867
+ provide: forms.NG_VALUE_ACCESSOR,
49868
+ useExisting: i0.forwardRef(function () { return AutoComplete; }),
49869
+ multi: true
49870
+ };
49871
+ var AutoComplete = /** @class */ (function () {
49872
+ function AutoComplete(el, renderer, cd, differs) {
49873
+ this.el = el;
49874
+ this.renderer = renderer;
49875
+ this.cd = cd;
49876
+ this.differs = differs;
49877
+ this.minLength = 1;
49878
+ this.delay = 300;
49879
+ this.type = 'text';
49880
+ this.autoZIndex = true;
49881
+ this.baseZIndex = 0;
49882
+ this.dropdownIcon = "pi pi-chevron-down";
49883
+ this.unique = true;
49884
+ this.completeOnFocus = false;
49885
+ this.completeMethod = new i0.EventEmitter();
49886
+ this.onSelect = new i0.EventEmitter();
49887
+ this.onUnselect = new i0.EventEmitter();
49888
+ this.onFocus = new i0.EventEmitter();
49889
+ this.onBlur = new i0.EventEmitter();
49890
+ this.onDropdownClick = new i0.EventEmitter();
49891
+ this.onClear = new i0.EventEmitter();
49892
+ this.onKeyUp = new i0.EventEmitter();
49893
+ this.onShow = new i0.EventEmitter();
49894
+ this.onHide = new i0.EventEmitter();
49895
+ this.scrollHeight = '200px';
49896
+ this.dropdownMode = 'blank';
49897
+ this.showTransitionOptions = '.12s cubic-bezier(0, 0, 0.2, 1)';
49898
+ this.hideTransitionOptions = '.1s linear';
49899
+ this.autocomplete = 'off';
49900
+ this.onModelChange = function () { };
49901
+ this.onModelTouched = function () { };
49902
+ this.showCountItem = false;
49903
+ this.overlayVisible = false;
49904
+ this.focus = false;
49905
+ this.inputFieldValue = null;
49906
+ this.differ = differs.find([]).create(null);
49907
+ this.listId = utils.UniqueComponentId() + '_list';
49908
+ }
49909
+ Object.defineProperty(AutoComplete.prototype, "maxRowItem", {
49910
+ set: function (value) {
49911
+ var rowHeight = 27;
49912
+ var padding = 7;
49913
+ this._maxHeighContainerItem = Math.round(value * 30.5) + 7;
49914
+ this._maxHeighContainerItemStr = this._maxHeighContainerItem.toString() + 'px';
49915
+ },
49916
+ enumerable: false,
49917
+ configurable: true
49918
+ });
49919
+ Object.defineProperty(AutoComplete.prototype, "suggestions", {
49920
+ get: function () {
49921
+ return this._suggestions;
49922
+ },
49923
+ set: function (val) {
49924
+ this._suggestions = val;
49925
+ this.handleSuggestionsChange();
49926
+ },
49927
+ enumerable: false,
49928
+ configurable: true
49929
+ });
49930
+ AutoComplete.prototype.ngAfterViewChecked = function () {
49931
+ var _this = this;
49932
+ //Use timeouts as since Angular 4.2, AfterViewChecked is broken and not called after panel is updated
49933
+ if (this.suggestionsUpdated && this.overlay && this.overlay.offsetParent) {
49934
+ setTimeout(function () {
49935
+ if (_this.overlay) {
49936
+ _this.alignOverlay();
49937
+ }
49938
+ }, 1);
49939
+ this.suggestionsUpdated = false;
49940
+ }
49941
+ if (this.highlightOptionChanged) {
49942
+ setTimeout(function () {
49943
+ if (_this.overlay) {
49944
+ var listItem = dom.DomHandler.findSingle(_this.overlay, 'li.p-highlight');
49945
+ if (listItem) {
49946
+ dom.DomHandler.scrollInView(_this.overlay, listItem);
49947
+ }
49948
+ }
49949
+ }, 1);
49950
+ this.highlightOptionChanged = false;
49951
+ }
49952
+ if (this.multiContainerEL) {
49953
+ var lastItemSelected = dom.DomHandler.findSingle(this.multiContainerEL.nativeElement, 'li:first-child');
49954
+ this.multiContainerEL.nativeElement.scrollTop = 10000;
49955
+ var rectParent = this.multiContainerEL.nativeElement.getBoundingClientRect();
49956
+ var rectLastItem = lastItemSelected.getBoundingClientRect();
49957
+ if (rectLastItem.y < rectParent.y) {
49958
+ this.showCountItem = true;
49959
+ }
49960
+ else {
49961
+ this.showCountItem = false;
49962
+ }
49963
+ }
49964
+ var countItem = dom.DomHandler.findSingle(this.multiContainerEL.nativeElement, '.p-autocomplete-countItem');
49965
+ if (this.showCountItem && !countItem) {
49966
+ this.focusInput();
49967
+ }
49968
+ };
49969
+ AutoComplete.prototype.handleSuggestionsChange = function () {
49970
+ if (this._suggestions != null && this.loading) {
49971
+ this.highlightOption = null;
49972
+ if (this._suggestions.length) {
49973
+ this.noResults = false;
49974
+ this.show();
49975
+ this.suggestionsUpdated = true;
49976
+ if (this.autoHighlight) {
49977
+ this.highlightOption = this._suggestions[0];
49978
+ }
49979
+ }
49980
+ else {
49981
+ this.noResults = true;
49982
+ if (this.emptyMessage) {
49983
+ this.show();
49984
+ this.suggestionsUpdated = true;
49985
+ }
49986
+ else {
49987
+ this.hide();
49988
+ }
49989
+ }
49990
+ this.loading = false;
49991
+ }
49992
+ };
49993
+ AutoComplete.prototype.ngAfterContentInit = function () {
49994
+ var _this = this;
49995
+ this.templates.forEach(function (item) {
49996
+ switch (item.getType()) {
49997
+ case 'item':
49998
+ _this.itemTemplate = item.template;
49999
+ break;
50000
+ case 'selectedItem':
50001
+ _this.selectedItemTemplate = item.template;
50002
+ break;
50003
+ default:
50004
+ _this.itemTemplate = item.template;
50005
+ break;
50006
+ }
50007
+ });
50008
+ };
50009
+ AutoComplete.prototype.writeValue = function (value) {
50010
+ this.value = value;
50011
+ this.filled = this.value && this.value != '';
50012
+ this.updateInputField();
50013
+ this.cd.markForCheck();
50014
+ };
50015
+ AutoComplete.prototype.registerOnChange = function (fn) {
50016
+ this.onModelChange = fn;
50017
+ };
50018
+ AutoComplete.prototype.registerOnTouched = function (fn) {
50019
+ this.onModelTouched = fn;
50020
+ };
50021
+ AutoComplete.prototype.setDisabledState = function (val) {
50022
+ this.disabled = val;
50023
+ this.cd.markForCheck();
50024
+ };
50025
+ AutoComplete.prototype.onInput = function (event) {
50026
+ var _this = this;
50027
+ // When an input element with a placeholder is clicked, the onInput event is invoked in IE.
50028
+ if (!this.inputKeyDown && dom.DomHandler.isIE()) {
50029
+ return;
50030
+ }
50031
+ if (this.timeout) {
50032
+ clearTimeout(this.timeout);
50033
+ }
50034
+ var value = event.target.value;
50035
+ if (!this.multiple && !this.forceSelection) {
50036
+ this.onModelChange(value);
50037
+ }
50038
+ if (value.length === 0 && !this.multiple) {
50039
+ this.hide();
50040
+ this.onClear.emit(event);
50041
+ this.onModelChange(value);
50042
+ }
50043
+ if (value.length >= this.minLength) {
50044
+ this.timeout = setTimeout(function () {
50045
+ _this.search(event, value);
50046
+ }, this.delay);
50047
+ }
50048
+ else {
50049
+ this.suggestions = null;
50050
+ this.hide();
50051
+ }
50052
+ this.updateFilledState();
50053
+ this.inputKeyDown = false;
50054
+ };
50055
+ AutoComplete.prototype.onInputClick = function (event) {
50056
+ if (this.documentClickListener) {
50057
+ this.inputClick = true;
50058
+ }
50059
+ };
50060
+ AutoComplete.prototype.search = function (event, query) {
50061
+ //allow empty string but not undefined or null
50062
+ if (query === undefined || query === null) {
50063
+ return;
50064
+ }
50065
+ this.loading = true;
50066
+ this.completeMethod.emit({
50067
+ originalEvent: event,
50068
+ query: query
50069
+ });
50070
+ };
50071
+ AutoComplete.prototype.selectItem = function (option, focus) {
50072
+ if (focus === void 0) { focus = true; }
50073
+ if (this.forceSelectionUpdateModelTimeout) {
50074
+ clearTimeout(this.forceSelectionUpdateModelTimeout);
50075
+ this.forceSelectionUpdateModelTimeout = null;
50076
+ }
50077
+ if (this.multiple) {
50078
+ this.multiInputEL.nativeElement.value = '';
50079
+ this.value = this.value || [];
50080
+ if (!this.isSelected(option) || !this.unique) {
50081
+ this.value = __spreadArray(__spreadArray([], __read(this.value)), [option]);
50082
+ this.onModelChange(this.value);
50083
+ }
50084
+ }
50085
+ else {
50086
+ this.inputEL.nativeElement.value = this.field ? utils.ObjectUtils.resolveFieldData(option, this.field) || '' : option;
50087
+ this.value = option;
50088
+ this.onModelChange(this.value);
50089
+ }
50090
+ this.onSelect.emit(option);
50091
+ this.updateFilledState();
50092
+ if (focus) {
50093
+ this.itemClicked = true;
50094
+ this.focusInput();
50095
+ }
50096
+ };
50097
+ AutoComplete.prototype.show = function () {
50098
+ if (this.multiInputEL || this.inputEL) {
50099
+ var hasFocus = this.multiple ?
50100
+ this.multiInputEL.nativeElement.ownerDocument.activeElement == this.multiInputEL.nativeElement :
50101
+ this.inputEL.nativeElement.ownerDocument.activeElement == this.inputEL.nativeElement;
50102
+ if (!this.overlayVisible && hasFocus) {
50103
+ this.overlayVisible = true;
50104
+ }
50105
+ }
50106
+ };
50107
+ AutoComplete.prototype.onOverlayAnimationStart = function (event) {
50108
+ switch (event.toState) {
50109
+ case 'visible':
50110
+ this.overlay = event.element;
50111
+ this.appendOverlay();
50112
+ if (this.autoZIndex) {
50113
+ this.overlay.style.zIndex = String(this.baseZIndex + (++dom.DomHandler.zindex));
50114
+ }
50115
+ this.alignOverlay();
50116
+ this.bindDocumentClickListener();
50117
+ this.bindDocumentResizeListener();
50118
+ this.bindScrollListener();
50119
+ this.onShow.emit(event);
50120
+ break;
50121
+ case 'void':
50122
+ this.onOverlayHide();
50123
+ break;
50124
+ }
50125
+ };
50126
+ AutoComplete.prototype.onOverlayAnimationDone = function (event) {
50127
+ if (event.toState === 'void') {
50128
+ this._suggestions = null;
50129
+ }
50130
+ };
50131
+ AutoComplete.prototype.appendOverlay = function () {
50132
+ if (this.appendTo) {
50133
+ if (this.appendTo === 'body')
50134
+ document.body.appendChild(this.overlay);
50135
+ else
50136
+ dom.DomHandler.appendChild(this.overlay, this.appendTo);
50137
+ if (!this.overlay.style.minWidth) {
50138
+ this.overlay.style.minWidth = dom.DomHandler.getWidth(this.el.nativeElement.children[0]) + 'px';
50139
+ }
50140
+ }
50141
+ };
50142
+ AutoComplete.prototype.resolveFieldData = function (value) {
50143
+ return this.field ? utils.ObjectUtils.resolveFieldData(value, this.field) : value;
50144
+ };
50145
+ AutoComplete.prototype.restoreOverlayAppend = function () {
50146
+ if (this.overlay && this.appendTo) {
50147
+ this.el.nativeElement.appendChild(this.overlay);
50148
+ }
50149
+ };
50150
+ AutoComplete.prototype.alignOverlay = function () {
50151
+ if (this.appendTo)
50152
+ dom.DomHandler.absolutePosition(this.overlay, (this.multiple ? this.multiContainerEL.nativeElement : this.inputEL.nativeElement));
50153
+ else
50154
+ dom.DomHandler.relativePosition(this.overlay, (this.multiple ? this.multiContainerEL.nativeElement : this.inputEL.nativeElement));
50155
+ };
50156
+ AutoComplete.prototype.hide = function () {
50157
+ this.overlayVisible = false;
50158
+ this.cd.markForCheck();
50159
+ };
50160
+ AutoComplete.prototype.handleDropdownClick = function (event) {
50161
+ if (!this.overlayVisible) {
50162
+ this.focusInput();
50163
+ var queryValue = this.multiple ? this.multiInputEL.nativeElement.value : this.inputEL.nativeElement.value;
50164
+ if (this.dropdownMode === 'blank')
50165
+ this.search(event, '');
50166
+ else if (this.dropdownMode === 'current')
50167
+ this.search(event, queryValue);
50168
+ this.onDropdownClick.emit({
50169
+ originalEvent: event,
50170
+ query: queryValue
50171
+ });
50172
+ }
50173
+ else {
50174
+ this.hide();
50175
+ }
50176
+ };
50177
+ AutoComplete.prototype.focusInput = function () {
50178
+ if (this.multiple)
50179
+ this.multiInputEL.nativeElement.focus();
50180
+ else
50181
+ this.inputEL.nativeElement.focus();
50182
+ };
50183
+ AutoComplete.prototype.removeItem = function (item) {
50184
+ var itemIndex = dom.DomHandler.index(item);
50185
+ var removedValue = this.value[itemIndex];
50186
+ this.value = this.value.filter(function (val, i) { return i != itemIndex; });
50187
+ this.onModelChange(this.value);
50188
+ this.updateFilledState();
50189
+ this.onUnselect.emit(removedValue);
50190
+ };
50191
+ AutoComplete.prototype.onKeydown = function (event) {
50192
+ if (this.overlayVisible) {
50193
+ var highlightItemIndex = this.findOptionIndex(this.highlightOption);
50194
+ switch (event.which) {
50195
+ //down
50196
+ case 40:
50197
+ if (highlightItemIndex != -1) {
50198
+ var nextItemIndex = highlightItemIndex + 1;
50199
+ if (nextItemIndex != (this.suggestions.length)) {
50200
+ this.highlightOption = this.suggestions[nextItemIndex];
50201
+ this.highlightOptionChanged = true;
50202
+ }
50203
+ }
50204
+ else {
50205
+ this.highlightOption = this.suggestions[0];
50206
+ }
50207
+ event.preventDefault();
50208
+ break;
50209
+ //up
50210
+ case 38:
50211
+ if (highlightItemIndex > 0) {
50212
+ var prevItemIndex = highlightItemIndex - 1;
50213
+ this.highlightOption = this.suggestions[prevItemIndex];
50214
+ this.highlightOptionChanged = true;
50215
+ }
50216
+ event.preventDefault();
50217
+ break;
50218
+ //enter
50219
+ case 13:
50220
+ if (this.highlightOption) {
50221
+ this.selectItem(this.highlightOption);
50222
+ this.hide();
50223
+ }
50224
+ event.preventDefault();
50225
+ break;
50226
+ //escape
50227
+ case 27:
50228
+ this.hide();
50229
+ event.preventDefault();
50230
+ break;
50231
+ //tab
50232
+ case 9:
50233
+ if (this.highlightOption) {
50234
+ this.selectItem(this.highlightOption);
50235
+ }
50236
+ this.hide();
50237
+ break;
50238
+ }
50239
+ }
50240
+ else {
50241
+ if (event.which === 40 && this.suggestions) {
50242
+ this.search(event, event.target.value);
50243
+ }
50244
+ }
50245
+ if (this.multiple) {
50246
+ switch (event.which) {
50247
+ //backspace
50248
+ case 8:
50249
+ if (this.value && this.value.length && !this.multiInputEL.nativeElement.value) {
50250
+ this.value = __spreadArray([], __read(this.value));
50251
+ var removedValue = this.value.pop();
50252
+ this.onModelChange(this.value);
50253
+ this.updateFilledState();
50254
+ this.onUnselect.emit(removedValue);
50255
+ }
50256
+ break;
50257
+ }
50258
+ }
50259
+ this.inputKeyDown = true;
50260
+ };
50261
+ AutoComplete.prototype.onKeyup = function (event) {
50262
+ this.onKeyUp.emit(event);
50263
+ };
50264
+ AutoComplete.prototype.onInputFocus = function (event) {
50265
+ if (!this.itemClicked && this.completeOnFocus) {
50266
+ var queryValue = this.multiple ? this.multiInputEL.nativeElement.value : this.inputEL.nativeElement.value;
50267
+ this.search(event, queryValue);
50268
+ }
50269
+ this.focus = true;
50270
+ this.onFocus.emit(event);
50271
+ this.itemClicked = false;
50272
+ };
50273
+ AutoComplete.prototype.onInputBlur = function (event) {
50274
+ this.focus = false;
50275
+ this.onModelTouched();
50276
+ this.onBlur.emit(event);
50277
+ };
50278
+ AutoComplete.prototype.onInputChange = function (event) {
50279
+ var e_1, _a;
50280
+ var _this = this;
50281
+ if (this.forceSelection) {
50282
+ var valid = false;
50283
+ var inputValue = event.target.value.trim();
50284
+ if (this.suggestions) {
50285
+ var _loop_1 = function (suggestion) {
50286
+ var itemValue = this_1.field ? utils.ObjectUtils.resolveFieldData(suggestion, this_1.field) : suggestion;
50287
+ if (itemValue && inputValue === itemValue.trim()) {
50288
+ valid = true;
50289
+ this_1.forceSelectionUpdateModelTimeout = setTimeout(function () {
50290
+ _this.selectItem(suggestion, false);
50291
+ }, 250);
50292
+ return "break";
50293
+ }
50294
+ };
50295
+ var this_1 = this;
50296
+ try {
50297
+ for (var _b = __values(this.suggestions), _c = _b.next(); !_c.done; _c = _b.next()) {
50298
+ var suggestion = _c.value;
50299
+ var state_1 = _loop_1(suggestion);
50300
+ if (state_1 === "break")
50301
+ break;
50302
+ }
50303
+ }
50304
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
50305
+ finally {
50306
+ try {
50307
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
50308
+ }
50309
+ finally { if (e_1) throw e_1.error; }
50310
+ }
50311
+ }
50312
+ if (!valid) {
50313
+ if (this.multiple) {
50314
+ this.multiInputEL.nativeElement.value = '';
50315
+ }
50316
+ else {
50317
+ this.value = null;
50318
+ this.inputEL.nativeElement.value = '';
50319
+ }
50320
+ this.onClear.emit(event);
50321
+ this.onModelChange(this.value);
50322
+ }
50323
+ }
50324
+ };
50325
+ AutoComplete.prototype.onInputPaste = function (event) {
50326
+ this.onKeydown(event);
50327
+ };
50328
+ AutoComplete.prototype.isSelected = function (val) {
50329
+ var selected = false;
50330
+ if (this.value && this.value.length) {
50331
+ for (var i = 0; i < this.value.length; i++) {
50332
+ if (utils.ObjectUtils.equals(this.value[i], val, this.dataKey)) {
50333
+ selected = true;
50334
+ break;
50335
+ }
50336
+ }
50337
+ }
50338
+ return selected;
50339
+ };
50340
+ AutoComplete.prototype.findOptionIndex = function (option) {
50341
+ var index = -1;
50342
+ if (this.suggestions) {
50343
+ for (var i = 0; i < this.suggestions.length; i++) {
50344
+ if (utils.ObjectUtils.equals(option, this.suggestions[i])) {
50345
+ index = i;
50346
+ break;
50347
+ }
50348
+ }
50349
+ }
50350
+ return index;
50351
+ };
50352
+ AutoComplete.prototype.updateFilledState = function () {
50353
+ if (this.multiple)
50354
+ this.filled = (this.value && this.value.length) || (this.multiInputEL && this.multiInputEL.nativeElement && this.multiInputEL.nativeElement.value != '');
50355
+ else
50356
+ this.filled = (this.inputFieldValue && this.inputFieldValue != '') || (this.inputEL && this.inputEL.nativeElement && this.inputEL.nativeElement.value != '');
50357
+ ;
50358
+ };
50359
+ AutoComplete.prototype.updateInputField = function () {
50360
+ var formattedValue = this.value ? (this.field ? utils.ObjectUtils.resolveFieldData(this.value, this.field) || '' : this.value) : '';
50361
+ this.inputFieldValue = formattedValue;
50362
+ if (this.inputEL && this.inputEL.nativeElement) {
50363
+ this.inputEL.nativeElement.value = formattedValue;
50364
+ }
50365
+ this.updateFilledState();
50366
+ };
50367
+ AutoComplete.prototype.bindDocumentClickListener = function () {
50368
+ var _this = this;
50369
+ if (!this.documentClickListener) {
50370
+ var documentTarget = this.el ? this.el.nativeElement.ownerDocument : 'document';
50371
+ this.documentClickListener = this.renderer.listen(documentTarget, 'click', function (event) {
50372
+ if (event.which === 3) {
50373
+ return;
50374
+ }
50375
+ if (!_this.inputClick && !_this.isDropdownClick(event)) {
50376
+ _this.hide();
50377
+ }
50378
+ _this.inputClick = false;
50379
+ _this.cd.markForCheck();
50380
+ });
50381
+ }
50382
+ };
50383
+ AutoComplete.prototype.isDropdownClick = function (event) {
50384
+ if (this.dropdown) {
50385
+ var target = event.target;
50386
+ return (target === this.dropdownButton.nativeElement || target.parentNode === this.dropdownButton.nativeElement);
50387
+ }
50388
+ else {
50389
+ return false;
50390
+ }
50391
+ };
50392
+ AutoComplete.prototype.unbindDocumentClickListener = function () {
50393
+ if (this.documentClickListener) {
50394
+ this.documentClickListener();
50395
+ this.documentClickListener = null;
50396
+ }
50397
+ };
50398
+ AutoComplete.prototype.bindDocumentResizeListener = function () {
50399
+ this.documentResizeListener = this.onWindowResize.bind(this);
50400
+ window.addEventListener('resize', this.documentResizeListener);
50401
+ };
50402
+ AutoComplete.prototype.unbindDocumentResizeListener = function () {
50403
+ if (this.documentResizeListener) {
50404
+ window.removeEventListener('resize', this.documentResizeListener);
50405
+ this.documentResizeListener = null;
50406
+ }
50407
+ };
50408
+ AutoComplete.prototype.onWindowResize = function () {
50409
+ this.hide();
50410
+ };
50411
+ AutoComplete.prototype.bindScrollListener = function () {
50412
+ var _this = this;
50413
+ if (!this.scrollHandler) {
50414
+ this.scrollHandler = new dom.ConnectedOverlayScrollHandler(this.containerEL.nativeElement, function () {
50415
+ if (_this.overlayVisible) {
50416
+ _this.hide();
50417
+ }
50418
+ });
50419
+ }
50420
+ this.scrollHandler.bindScrollListener();
50421
+ };
50422
+ AutoComplete.prototype.unbindScrollListener = function () {
50423
+ if (this.scrollHandler) {
50424
+ this.scrollHandler.unbindScrollListener();
50425
+ }
50426
+ };
50427
+ AutoComplete.prototype.onOverlayHide = function () {
50428
+ this.unbindDocumentClickListener();
50429
+ this.unbindDocumentResizeListener();
50430
+ this.unbindScrollListener();
50431
+ this.overlay = null;
50432
+ this.onHide.emit();
50433
+ };
50434
+ AutoComplete.prototype.ngOnDestroy = function () {
50435
+ if (this.forceSelectionUpdateModelTimeout) {
50436
+ clearTimeout(this.forceSelectionUpdateModelTimeout);
50437
+ this.forceSelectionUpdateModelTimeout = null;
50438
+ }
50439
+ if (this.scrollHandler) {
50440
+ this.scrollHandler.destroy();
50441
+ this.scrollHandler = null;
50442
+ }
50443
+ this.restoreOverlayAppend();
50444
+ this.onOverlayHide();
50445
+ };
50446
+ AutoComplete.prototype.showMore = function () {
50447
+ this._maxHeighContainerItemStrOld = this._maxHeighContainerItemStr;
50448
+ this._maxHeighContainerItemStr = '10000px';
50449
+ this.showCountItem = false;
50450
+ };
50451
+ AutoComplete.prototype.showLess = function () {
50452
+ this._maxHeighContainerItemStr = this._maxHeighContainerItemStrOld;
50453
+ this._maxHeighContainerItemStrOld = null;
50454
+ this.showCountItem = true;
50455
+ };
50456
+ return AutoComplete;
50457
+ }());
50458
+ AutoComplete.decorators = [
50459
+ { type: i0.Component, args: [{
50460
+ selector: 'p-autoComplete',
50461
+ 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 ",
50462
+ animations: [
50463
+ animations$1.trigger('overlayAnimation', [
50464
+ animations$1.transition(':enter', [
50465
+ animations$1.style({ opacity: 0, transform: 'scaleY(0.8)' }),
50466
+ animations$1.animate('{{showTransitionParams}}')
50467
+ ]),
50468
+ animations$1.transition(':leave', [
50469
+ animations$1.animate('{{hideTransitionParams}}', animations$1.style({ opacity: 0 }))
50470
+ ])
50471
+ ])
50472
+ ],
50473
+ host: {
50474
+ '[class.p-inputwrapper-filled]': 'filled',
50475
+ '[class.p-inputwrapper-focus]': 'focus && !disabled'
50476
+ },
50477
+ providers: [AUTOCOMPLETE_VALUE_ACCESSOR],
50478
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
50479
+ encapsulation: i0.ViewEncapsulation.None,
50480
+ 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}"]
50481
+ },] }
50482
+ ];
50483
+ AutoComplete.ctorParameters = function () { return [
50484
+ { type: i0.ElementRef },
50485
+ { type: i0.Renderer2 },
50486
+ { type: i0.ChangeDetectorRef },
50487
+ { type: i0.IterableDiffers }
50488
+ ]; };
50489
+ AutoComplete.propDecorators = {
50490
+ minLength: [{ type: i0.Input }],
50491
+ delay: [{ type: i0.Input }],
50492
+ style: [{ type: i0.Input }],
50493
+ panelStyle: [{ type: i0.Input }],
50494
+ styleClass: [{ type: i0.Input }],
50495
+ panelStyleClass: [{ type: i0.Input }],
50496
+ inputStyle: [{ type: i0.Input }],
50497
+ inputId: [{ type: i0.Input }],
50498
+ inputStyleClass: [{ type: i0.Input }],
50499
+ placeholder: [{ type: i0.Input }],
50500
+ readonly: [{ type: i0.Input }],
50501
+ disabled: [{ type: i0.Input }],
50502
+ maxlength: [{ type: i0.Input }],
50503
+ name: [{ type: i0.Input }],
50504
+ required: [{ type: i0.Input }],
50505
+ size: [{ type: i0.Input }],
50506
+ appendTo: [{ type: i0.Input }],
50507
+ autoHighlight: [{ type: i0.Input }],
50508
+ forceSelection: [{ type: i0.Input }],
50509
+ type: [{ type: i0.Input }],
50510
+ autoZIndex: [{ type: i0.Input }],
50511
+ baseZIndex: [{ type: i0.Input }],
50512
+ ariaLabel: [{ type: i0.Input }],
50513
+ ariaLabelledBy: [{ type: i0.Input }],
50514
+ dropdownIcon: [{ type: i0.Input }],
50515
+ unique: [{ type: i0.Input }],
50516
+ completeOnFocus: [{ type: i0.Input }],
50517
+ completeMethod: [{ type: i0.Output }],
50518
+ onSelect: [{ type: i0.Output }],
50519
+ onUnselect: [{ type: i0.Output }],
50520
+ onFocus: [{ type: i0.Output }],
50521
+ onBlur: [{ type: i0.Output }],
50522
+ onDropdownClick: [{ type: i0.Output }],
50523
+ onClear: [{ type: i0.Output }],
50524
+ onKeyUp: [{ type: i0.Output }],
50525
+ onShow: [{ type: i0.Output }],
50526
+ onHide: [{ type: i0.Output }],
50527
+ field: [{ type: i0.Input }],
50528
+ scrollHeight: [{ type: i0.Input }],
50529
+ dropdown: [{ type: i0.Input }],
50530
+ dropdownMode: [{ type: i0.Input }],
50531
+ multiple: [{ type: i0.Input }],
50532
+ tabindex: [{ type: i0.Input }],
50533
+ dataKey: [{ type: i0.Input }],
50534
+ emptyMessage: [{ type: i0.Input }],
50535
+ showTransitionOptions: [{ type: i0.Input }],
50536
+ hideTransitionOptions: [{ type: i0.Input }],
50537
+ autofocus: [{ type: i0.Input }],
50538
+ autocomplete: [{ type: i0.Input }],
50539
+ maxRowItem: [{ type: i0.Input }],
50540
+ containerEL: [{ type: i0.ViewChild, args: ['container',] }],
50541
+ inputEL: [{ type: i0.ViewChild, args: ['in',] }],
50542
+ multiInputEL: [{ type: i0.ViewChild, args: ['multiIn',] }],
50543
+ multiContainerEL: [{ type: i0.ViewChild, args: ['multiContainer',] }],
50544
+ dropdownButton: [{ type: i0.ViewChild, args: ['ddBtn',] }],
50545
+ templates: [{ type: i0.ContentChildren, args: [i1.PrimeTemplate,] }],
50546
+ suggestions: [{ type: i0.Input }]
50547
+ };
50548
+ var AutoCompleteModule = /** @class */ (function () {
50549
+ function AutoCompleteModule() {
50550
+ }
50551
+ return AutoCompleteModule;
50552
+ }());
50553
+ AutoCompleteModule.decorators = [
50554
+ { type: i0.NgModule, args: [{
50555
+ imports: [i3.CommonModule, inputtext.InputTextModule, button.ButtonModule, i1.SharedModule, ripple.RippleModule],
50556
+ exports: [AutoComplete, i1.SharedModule],
50557
+ declarations: [AutoComplete]
50558
+ },] }
50559
+ ];
50560
+
50561
+ /* eslint-disable prefer-const */
50562
+ var HtmlPreviewComponent = /** @class */ (function () {
50563
+ function HtmlPreviewComponent(gs, _commonService) {
50564
+ this.gs = gs;
50565
+ this._commonService = _commonService;
50566
+ this.control = new HtmlPreviewControlSchema();
50567
+ this.onChanged = new i0.EventEmitter();
50568
+ this.content = '';
50569
+ this.id = '';
50570
+ this.id = this._commonService.guid();
50571
+ }
50572
+ // ngOnChanges(changes: SimpleChanges) {
50573
+ // if (changes['content']) {
50574
+ // this.renderMath();
50575
+ // }
50576
+ // }
50577
+ HtmlPreviewComponent.prototype.writeValue = function (obj) {
50578
+ if (obj) {
50579
+ this.content = obj;
50580
+ }
50581
+ else {
50582
+ this.content = '';
50583
+ }
50584
+ this.renderMath();
50585
+ };
50586
+ HtmlPreviewComponent.prototype.registerOnChange = function (fn) {
50587
+ this.onChange = fn;
50588
+ };
50589
+ HtmlPreviewComponent.prototype.registerOnTouched = function (fn) {
50590
+ this.onTouched = fn;
50591
+ };
50592
+ HtmlPreviewComponent.prototype.renderMath = function () {
50593
+ var _this = this;
50594
+ this.mathJaxObject = this.gs.nativeGlobal()['MathJax'];
50595
+ if (!this.mathJaxObject && !this.mathContent) {
50596
+ return;
50597
+ }
50598
+ setTimeout(function () {
50599
+ var _a, _b;
50600
+ var $this = _this;
50601
+ var autoScrollBottom = !!((_a = $this.control) === null || _a === void 0 ? void 0 : _a.autoScrollBottom);
50602
+ var output = $this.mathContent.nativeElement;
50603
+ var content = ((_b = $this.content) === null || _b === void 0 ? void 0 : _b.trim()) || '';
50604
+ if (!$this.control.isHtml) {
50605
+ content = content.replace(/\n/g, '<br>');
50606
+ }
50607
+ output.innerHTML = content;
50608
+ if ($this.mathJaxObject.texReset) {
50609
+ $this.mathJaxObject.texReset();
50610
+ }
50611
+ if ($this.mathJaxObject.typesetClear) {
50612
+ $this.mathJaxObject.typesetClear();
50613
+ }
50614
+ if ($this.mathJaxObject.typesetPromise) {
50615
+ $this.mathJaxObject.typesetPromise([output]).catch(function (err) {
50616
+ output.innerHTML = '';
50617
+ output.appendChild(document.createTextNode(err.message));
50618
+ console.error(err);
50619
+ }).then(function () {
50620
+ var _a, _b, _c;
50621
+ // Do something after typeset
50622
+ if (autoScrollBottom) {
50623
+ var box = document.querySelector("#math-preview-box-" + $this.id);
50624
+ var elem = box.getElementsByClassName('ps--active-y')[0];
50625
+ if (elem) {
50626
+ elem.scrollTop = elem.scrollHeight;
50627
+ }
50628
+ }
50629
+ 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 : '';
50630
+ $this.onChange(value);
50631
+ $this.onChanged.emit(value);
50632
+ });
50633
+ }
50634
+ return $this.mathJaxObject.startup.defaultPageReady ? $this.mathJaxObject.startup.defaultPageReady() : $this.mathJaxObject.startup.defaultPageReady;
50635
+ });
50636
+ };
50637
+ HtmlPreviewComponent.prototype.loadMathConfig = function () {
50638
+ var _this = this;
50639
+ var _a, _b, _c;
50640
+ var wd = this.gs.nativeGlobal();
50641
+ wd.MathJax = {
50642
+ 'loader': { load: ['input/asciimath', 'output/chtml', 'ui/menu', 'output/svg', '[mml]/mml3'] },
50643
+ 'tex': {
50644
+ inlineMath: [['$', '$'], ['\\(', '\\)']],
50645
+ processEscapes: true
50646
+ },
50647
+ 'startup': {
50648
+ pageReady: function () { return _this.renderMath(); }
50649
+ },
50650
+ 'svg': {
50651
+ scale: 1,
50652
+ minScale: .5
50653
+ },
50654
+ 'options': {
50655
+ enableMenu: !!((_a = this.control) === null || _a === void 0 ? void 0 : _a.useMathJaxMenu),
50656
+ menuOptions: {
50657
+ settings: {
50658
+ texHints: true,
50659
+ semantics: false,
50660
+ zoom: 'Double-Click',
50661
+ zscale: '200%',
50662
+ renderer: ((_b = this.control) === null || _b === void 0 ? void 0 : _b.mathJaxType) ? this.control.mathJaxType : 'CHTML',
50663
+ scale: 1,
50664
+ inTabOrder: true,
50665
+ assistiveMml: true,
50666
+ collapsible: false,
50667
+ explorer: false, // true if the expression explorer should be active
50668
+ },
50669
+ annotationTypes: {
50670
+ TeX: ['TeX', 'LaTeX', 'application/x-tex'],
50671
+ StarMath: ['StarMath 5.0'],
50672
+ Maple: ['Maple'],
50673
+ ContentMathML: ['MathML-Content', 'application/mathml-content+xml'],
50674
+ OpenMath: ['OpenMath']
50675
+ }
50676
+ }
50677
+ }
50678
+ };
50679
+ var script = document.createElement('script');
50680
+ if (((_c = this.control) === null || _c === void 0 ? void 0 : _c.mathJaxType) == 'SVG') {
50681
+ script.src = 'assets/vendor/mathjax/tex-mml-svg.js';
50682
+ }
50683
+ else {
50684
+ script.src = 'assets/vendor/mathjax/tex-mml-chtml.js';
50685
+ }
50686
+ script.setAttribute('id', 'MathJax-script');
50687
+ document.head.appendChild(script);
50688
+ };
50689
+ HtmlPreviewComponent.prototype.ngOnInit = function () {
50690
+ this.loadMathConfig();
50691
+ };
50692
+ return HtmlPreviewComponent;
50693
+ }());
50694
+ HtmlPreviewComponent.decorators = [
50695
+ { type: i0.Component, args: [{
50696
+ selector: 'html-preview',
50697
+ 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>",
50698
+ providers: [
50699
+ ComponentContextService,
50700
+ {
50701
+ provide: forms.NG_VALUE_ACCESSOR,
50702
+ useExisting: i0.forwardRef(function () { return HtmlPreviewComponent; }),
50703
+ multi: true
50704
+ },
50705
+ ],
50706
+ styles: ["::ng-deep html-preview .preview-box{border:1px solid #ced4da;padding:10px}"]
50707
+ },] }
50708
+ ];
50709
+ HtmlPreviewComponent.ctorParameters = function () { return [
50710
+ { type: GlobalService },
50711
+ { type: CommonService }
50712
+ ]; };
50713
+ HtmlPreviewComponent.propDecorators = {
50714
+ mathContent: [{ type: i0.ViewChild, args: ['mathContent',] }],
50715
+ control: [{ type: i0.Input }],
50716
+ onChanged: [{ type: i0.Output }]
50717
+ };
50718
+
50719
+ var SettingAuthorizeButtonComponent = /** @class */ (function (_super) {
50720
+ __extends(SettingAuthorizeButtonComponent, _super);
50721
+ function SettingAuthorizeButtonComponent(_injector, _basePermissionService, _moduleConfigService) {
50722
+ var _this = _super.call(this, _injector) || this;
50723
+ _this._injector = _injector;
50724
+ _this._basePermissionService = _basePermissionService;
50725
+ _this._moduleConfigService = _moduleConfigService;
50726
+ _this.authorizeButtonKey = '';
50727
+ _this.dataSource = [];
50728
+ _this.appCode = '';
50729
+ return _this;
50730
+ }
50731
+ SettingAuthorizeButtonComponent.prototype.ngOnInit = function () {
50732
+ this.appCode = this._moduleConfigService.getConfig().appCode;
50733
+ this.setting.baseService = this._basePermissionService;
50734
+ this.customGetData = true;
50735
+ this.setting.hiddenAdvanceSearch = true;
50736
+ this.setting.hiddenHeader = true;
50737
+ this.setting.heightType = exports.HeightType.dynamic;
50738
+ this.setting.hiddenOrderColumn = true;
50739
+ this.setting.hiddenFilterRow = true;
50740
+ this.setting.hiddenSettingWorkflow = true;
50741
+ this.setting.hiddenAuthorizeButton = true;
50742
+ this.setting.hiddenSettingPermission = true;
50743
+ this.setting.fixHeightTypeInDialog = false;
50744
+ this.setting.hiddenCheckbox = false;
50745
+ this.setting.showEditLink = false;
50746
+ this.setting.modelSchemas = [
50747
+ new ModelSchema({
50748
+ field: 'permissionCode',
50749
+ name: 'Mã',
50750
+ }),
50751
+ new ModelSchema({
50752
+ field: 'rawText',
50753
+ name: 'Tên',
50754
+ }),
50755
+ new ModelSchema({
50756
+ field: 'isAuthorize',
50757
+ name: 'Đã tạo quyền',
50758
+ }),
50759
+ new ModelSchema({
50760
+ field: 'ma1',
50761
+ name: 'Mã',
50762
+ }),
50763
+ ];
50764
+ this.setting.cols = [
50765
+ new ColumnSchemaBase({ field: 'permissionCode', sort: false, showEditLink: false }),
50766
+ new ColumnSchemaBase({ field: 'rawText', width: '300px', sort: false }),
50767
+ new ColumnSchemaBase({ field: 'isAuthorize', dataType: exports.DataType.boolean, width: '100px', sort: false }),
50768
+ ];
50769
+ _super.prototype.ngOnInit.call(this);
50770
+ };
50771
+ SettingAuthorizeButtonComponent.prototype.getDataCustom = function (gridInfo) {
50772
+ this.model.dataSource = this.dataSource;
50773
+ this.afterGetData();
50774
+ };
50775
+ SettingAuthorizeButtonComponent.prototype.addBasePermission = function (rowData) {
50776
+ return __awaiter(this, void 0, void 0, function () {
50777
+ var insertRes;
50778
+ return __generator(this, function (_b) {
50779
+ switch (_b.label) {
50780
+ case 0: return [4 /*yield*/, this._basePermissionService.post(rowData)];
50781
+ case 1:
50782
+ insertRes = _b.sent();
50783
+ if (insertRes.success) {
50784
+ this._notifierService.showSuccess('Thêm quyền thành công');
50785
+ this.updateDataSource(insertRes.data);
50786
+ return [2 /*return*/];
50787
+ }
50788
+ this._notifierService.showWarning('Có lỗi trong quá trình xử lý, vui lòng thử lại');
50789
+ return [2 /*return*/];
50790
+ }
50791
+ });
50792
+ });
50793
+ };
50794
+ SettingAuthorizeButtonComponent.prototype.deleteBasePermission = function (rowData) {
50795
+ return __awaiter(this, void 0, void 0, function () {
50796
+ var _this = this;
50797
+ return __generator(this, function (_b) {
50798
+ this._notifierService.showConfirm('Xác nhận xóa quyền').then(function (res) { return __awaiter(_this, void 0, void 0, function () {
50799
+ var deleteRes;
50800
+ return __generator(this, function (_b) {
50801
+ switch (_b.label) {
50802
+ case 0:
50803
+ if (!res)
50804
+ return [2 /*return*/];
50805
+ return [4 /*yield*/, this._basePermissionService.delete(rowData.id)];
50806
+ case 1:
50807
+ deleteRes = _b.sent();
50808
+ if (deleteRes.success) {
50809
+ this._notifierService.showSuccess('Xóa quyền thành công');
50810
+ this.updateDataSource(rowData.id, true);
50811
+ return [2 /*return*/];
50812
+ }
50813
+ this._notifierService.showWarning(deleteRes.message);
50814
+ return [2 /*return*/];
50815
+ }
50816
+ });
50817
+ }); });
50818
+ return [2 /*return*/];
50819
+ });
50820
+ });
50821
+ };
50822
+ SettingAuthorizeButtonComponent.prototype.updateDataSource = function (id, isDeleted) {
50823
+ if (isDeleted === void 0) { isDeleted = false; }
50824
+ var currentRow = this.model.dataSource.find(function (p) { return p.id == id; });
50825
+ if (!currentRow)
50826
+ return;
50827
+ if (isDeleted) {
50828
+ currentRow.id = this._commonService.guid();
50829
+ }
50830
+ currentRow.isAuthorize = !isDeleted;
50831
+ this.afterGetData();
50832
+ };
50833
+ SettingAuthorizeButtonComponent.prototype.afterGetData = function () {
50834
+ return __awaiter(this, void 0, void 0, function () {
50835
+ var _this = this;
50836
+ return __generator(this, function (_b) {
50837
+ this._unmarkLoading();
50838
+ if (!this.model.dataSource.length)
50839
+ return [2 /*return*/];
50840
+ this.model.dataSource.forEach(function (item) {
50841
+ item.name = item.rawText;
50842
+ item.code = item.permissionCode;
50843
+ item.moduleCode = _this.appCode;
50844
+ });
50845
+ return [2 /*return*/];
50846
+ });
50847
+ });
50848
+ };
50849
+ SettingAuthorizeButtonComponent.prototype.ngOnDestroy = function () {
50850
+ var _this = this;
50851
+ var _a;
50852
+ var buttonSetting = JSON.parse(sessionStorage.getItem(ComCtxConstants.LOCALSTORAGE_KEY.BUTTON_AUTHORIZE) || '{}');
50853
+ buttonSetting[_a = this.authorizeButtonKey] || (buttonSetting[_a] = []);
50854
+ this.model.dataSource.forEach(function (rowData) {
50855
+ var _a;
50856
+ var buttonItem = (_a = buttonSetting[_this.authorizeButtonKey]) === null || _a === void 0 ? void 0 : _a.find(function (p) { return p.code == rowData.code; });
50857
+ if (rowData.isAuthorize && !buttonItem) {
50858
+ buttonSetting[_this.authorizeButtonKey].push({
50859
+ id: rowData.id,
50860
+ code: rowData.code,
50861
+ });
50862
+ }
50863
+ else if (!rowData.isAuthorize && buttonItem) {
50864
+ var index = buttonSetting[_this.authorizeButtonKey].indexOf(buttonItem);
50865
+ buttonSetting[_this.authorizeButtonKey].splice(index, 1);
50866
+ }
50867
+ });
50868
+ sessionStorage.setItem(ComCtxConstants.LOCALSTORAGE_KEY.BUTTON_AUTHORIZE, JSON.stringify(buttonSetting));
50869
+ };
50870
+ return SettingAuthorizeButtonComponent;
50871
+ }(DataListBase));
50872
+ SettingAuthorizeButtonComponent.decorators = [
50873
+ { type: i0.Component, args: [{
50874
+ selector: 'settings-authorize-button',
50875
+ 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>",
50876
+ providers: [ComponentContextService],
50877
+ styles: [""]
50878
+ },] }
50879
+ ];
50880
+ SettingAuthorizeButtonComponent.ctorParameters = function () { return [
50881
+ { type: i0.Injector },
50882
+ { type: BasePermissionService },
50883
+ { type: ModuleConfigService }
50884
+ ]; };
50885
+ SettingAuthorizeButtonComponent.propDecorators = {
50886
+ authorizeButtonKey: [{ type: i0.Input }],
50887
+ dataSource: [{ type: i0.Input }]
50888
+ };
50889
+
49866
50890
  var SettingsRowComponent = /** @class */ (function (_super) {
49867
50891
  __extends(SettingsRowComponent, _super);
49868
50892
  function SettingsRowComponent(_injector, _domService, _userService) {
@@ -50197,177 +51221,6 @@
50197
51221
  parentSetting: [{ type: i0.Input }]
50198
51222
  };
50199
51223
 
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
51224
  var SettingsComponent = /** @class */ (function (_super) {
50372
51225
  __extends(SettingsComponent, _super);
50373
51226
  function SettingsComponent(_injector, _domService, _userService) {
@@ -54348,164 +55201,6 @@
54348
55201
  },] }
54349
55202
  ];
54350
55203
 
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
55204
  function coreDeclaration() {
54510
55205
  return [
54511
55206
  AddressComponent,
@@ -54665,7 +55360,6 @@
54665
55360
  core.TranslateModule,
54666
55361
  tree.TreeModule,
54667
55362
  scrollpanel.ScrollPanelModule,
54668
- autocomplete.AutoCompleteModule,
54669
55363
  paginator.PaginatorModule,
54670
55364
  blockui.BlockUIModule,
54671
55365
  menu.MenuModule,
@@ -54697,6 +55391,7 @@
54697
55391
  steps.StepsModule,
54698
55392
  progressspinner.ProgressSpinnerModule,
54699
55393
  ngxDragDrop.DndModule,
55394
+ AutoCompleteModule,
54700
55395
  dragdrop.DragDropModule
54701
55396
  ];
54702
55397
  }
@@ -55323,6 +56018,9 @@
55323
56018
  exports["ɵdy"] = SettingsWorkflowNo1Component;
55324
56019
  exports["ɵdz"] = HtmlPreviewComponent;
55325
56020
  exports["ɵe"] = ListBase;
56021
+ exports["ɵea"] = AUTOCOMPLETE_VALUE_ACCESSOR;
56022
+ exports["ɵeb"] = AutoComplete;
56023
+ exports["ɵec"] = AutoCompleteModule;
55326
56024
  exports["ɵf"] = ListComponentBase;
55327
56025
  exports["ɵg"] = TreeTableComponent;
55328
56026
  exports["ɵh"] = NotFoundComponent;