tnx-shared 5.1.203 → 5.1.204

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.
@@ -34003,6 +34003,7 @@
34003
34003
  _this.hideTransitionOptions = '195ms ease-in';
34004
34004
  _this.showTransitionOptions = '225ms ease-out';
34005
34005
  _this.virtualScroll = true;
34006
+ _this.autofocusSelectedItem = true;
34006
34007
  _this.valueSearchServer = '';
34007
34008
  _this.keyUp = new rxjs.Subject();
34008
34009
  _this._hasLoadedDatasource = false;
@@ -34257,10 +34258,12 @@
34257
34258
  this._getData();
34258
34259
  };
34259
34260
  DropdownComponent.prototype.combineDataSource = function (dataSource, page) {
34261
+ this.autofocusSelectedItem = true;
34260
34262
  if (!dataSource)
34261
34263
  dataSource = [];
34262
34264
  if (this.control.isServerLoad) {
34263
34265
  if (page > 1) {
34266
+ this.autofocusSelectedItem = false;
34264
34267
  if (this.dropdown)
34265
34268
  this.dropdown.selectedOptionUpdated = false;
34266
34269
  // Append thêm datasource
@@ -34878,7 +34881,7 @@
34878
34881
  DropdownComponent.decorators = [
34879
34882
  { type: i0.Component, args: [{
34880
34883
  selector: 'dropdown',
34881
- template: "<div #el class=\"tn-dropdown\" [pTooltip]=\"tooltip\" tooltipPosition=\"top\" tooltipStyleClass=\"wrap\">\r\n <p-dropdown *ngIf=\"!control.multiple\" [options]=\"dataSourceInternal\" [placeholder]=\"control.placeholder\"\r\n [filter]=\"control.filter\" [panelStyleClass]=\"getPanelClass()\" [appendTo]=\"control.appendTo\"\r\n [styleClass]=\"'tn-dropdown'\" [emptyFilterMessage]=\"'Kh\u00F4ng t\u00ECm th\u1EA5y k\u1EBFt qu\u1EA3' | translate\"\r\n [disabled]=\"control.disabled ? true : null\" [autoZIndex]=\"true\" [showClear]=\"control.showClear\"\r\n [showTransitionOptions]=\"showTransitionOptions\" [autoDisplayFirst]=\"control.autoDisplayFirst\"\r\n [virtualScroll]=\"virtualScroll\" itemSize=\"30\" [maxItemDisplay]=\"control.maxItemDisplay\"\r\n [autofocusSelectedItem]=\"false\" [hideTransitionOptions]=\"hideTransitionOptions\"\r\n [modifyOptionsWhenFilter]=\"modifyOptionWhenFilter\" [delayFilter]=\"delayFilter\" [(ngModel)]=\"_value\"\r\n (onFocus)=\"handleFocus($event)\" (onBlur)=\"handleBlur($event)\" (onChange)=\"onChangeSelected($event)\"\r\n (onClick)=\"onDropdownClickHandler($event)\" (onShow)=\"onShowHandler($event)\" (onHide)=\"onHideHandler($event)\">\r\n <ng-template *ngIf=\"control.templateSelectedItem\" let-item pTemplate=\"selectedItem\">\r\n <ng-container\r\n *ngTemplateOutlet=\"control.templateSelectedItem; context: {$implicit: item, selectedValue: _value}\">\r\n </ng-container>\r\n </ng-template>\r\n <ng-template *ngIf=\"control.templateItem\" let-item pTemplate=\"item\">\r\n <ng-container *ngTemplateOutlet=\"control.templateItem; context: {$implicit: item}\"></ng-container>\r\n </ng-template>\r\n </p-dropdown>\r\n <p-multiSelect *ngIf=\"control.multiple\" [options]=\"dataSourceInternal\" [filter]=\"control.filter\"\r\n [defaultLabel]=\"control.placeholder\" [placeholder]=\"control.placeholder\" [panelStyleClass]=\"getPanelClass()\"\r\n [appendTo]=\"control.appendTo\" [styleClass]=\"'tn-dropdown'\"\r\n [emptyFilterMessage]=\"'Kh\u00F4ng t\u00ECm th\u1EA5y k\u1EBFt qu\u1EA3' | translate\" [disabled]=\"control.disabled ? true : null\"\r\n [autoZIndex]=\"true\" [showTransitionOptions]=\"showTransitionOptions\"\r\n [hideTransitionOptions]=\"hideTransitionOptions\" [maxItemDisplay]=\"control.maxItemDisplay\"\r\n [selectedItemsLabel]=\"control.selectedItemsLabel\" [maxSelectedLabels]=\"control.maxSelectedLabels\"\r\n [modifyOptionsWhenFilter]=\"modifyOptionWhenFilterMultiple\" [delayFilter]=\"delayFilter\" [(ngModel)]=\"_value\"\r\n (onChange)=\"onChangeSelected($event)\" (onClick)=\"onDropdownClickHandler($event)\"\r\n (onPanelShow)=\"onPanelShowHandler($event)\" (onPanelHide)=\"onHideHandler($event)\">\r\n <ng-template pTemplate=\"selectedItems\" let-value>\r\n <ng-container *ngIf=\"!value || value.length == 0\">{{control.placeholder}}</ng-container>\r\n <ng-container *ngIf=\"value && value.length > 0\">\r\n <span *ngFor=\"let selectedItem of value\" [class]=\"_itemSelectedStyleClass\">\r\n {{selectedItem[control.displayField]}}<span class=\"remove-item\"\r\n (click)=\"removeItem($event, selectedItem)\"><i class=\"fas fa-times\"></i></span>\r\n </span>\r\n </ng-container>\r\n </ng-template>\r\n </p-multiSelect>\r\n <input #inputMask class=\"input-mask hide p-inputtext\" type=\"text\" [disabled]=\"loading\"\r\n [(ngModel)]=\"valueSearchServer\" (keyup)=\"keyUp.next($event)\" />\r\n <button *ngIf=\"control.quickAdd && control.cols\" type=\"button\" pButton icon=\"pi pi-plus\"\r\n class=\"p-button-text p-button-rounded button-quick-add\" pTooltip=\"Th\u00EAm nhanh\" tooltipPosition=\"top\"\r\n (click)=\"showFormQuickAdd()\"></button>\r\n</div>\r\n<tn-dialog *ngIf=\"showQuickAddForm\" #dialog [styleClass]=\"'address-form'\"\r\n [header]=\"'Th\u00EAm m\u1EDBi ' + control.label | translate\" [popupSize]=\"control.popupSize\"\r\n (onHide)=\"showQuickAddForm = false\">\r\n <quick-add-form #formBase [parentModel]=\"model\" [parentContext]=\"context\" [model]=\"formModel\" [control]=\"control\"\r\n [baseService]=\"control.baseService\" (onSaved)=\"handleSaved()\" (onCancel)=\"handleCancel()\">\r\n </quick-add-form>\r\n</tn-dialog>",
34884
+ template: "<div #el class=\"tn-dropdown\" [pTooltip]=\"tooltip\" tooltipPosition=\"top\" tooltipStyleClass=\"wrap\">\r\n <p-dropdown *ngIf=\"!control.multiple\" [options]=\"dataSourceInternal\" [placeholder]=\"control.placeholder\"\r\n [filter]=\"control.filter\" [panelStyleClass]=\"getPanelClass()\" [appendTo]=\"control.appendTo\"\r\n [styleClass]=\"'tn-dropdown'\" [emptyFilterMessage]=\"'Kh\u00F4ng t\u00ECm th\u1EA5y k\u1EBFt qu\u1EA3' | translate\"\r\n [disabled]=\"control.disabled ? true : null\" [autoZIndex]=\"true\" [showClear]=\"control.showClear\"\r\n [showTransitionOptions]=\"showTransitionOptions\" [autoDisplayFirst]=\"control.autoDisplayFirst\"\r\n [virtualScroll]=\"virtualScroll\" itemSize=\"30\" [maxItemDisplay]=\"control.maxItemDisplay\"\r\n [autofocusSelectedItem]=\"autofocusSelectedItem\" [hideTransitionOptions]=\"hideTransitionOptions\"\r\n [modifyOptionsWhenFilter]=\"modifyOptionWhenFilter\" [delayFilter]=\"delayFilter\" [(ngModel)]=\"_value\"\r\n (onFocus)=\"handleFocus($event)\" (onBlur)=\"handleBlur($event)\" (onChange)=\"onChangeSelected($event)\"\r\n (onClick)=\"onDropdownClickHandler($event)\" (onShow)=\"onShowHandler($event)\" (onHide)=\"onHideHandler($event)\">\r\n <ng-template *ngIf=\"control.templateSelectedItem\" let-item pTemplate=\"selectedItem\">\r\n <ng-container\r\n *ngTemplateOutlet=\"control.templateSelectedItem; context: {$implicit: item, selectedValue: _value}\">\r\n </ng-container>\r\n </ng-template>\r\n <ng-template *ngIf=\"control.templateItem\" let-item pTemplate=\"item\">\r\n <ng-container *ngTemplateOutlet=\"control.templateItem; context: {$implicit: item}\"></ng-container>\r\n </ng-template>\r\n </p-dropdown>\r\n <p-multiSelect *ngIf=\"control.multiple\" [options]=\"dataSourceInternal\" [filter]=\"control.filter\"\r\n [defaultLabel]=\"control.placeholder\" [placeholder]=\"control.placeholder\" [panelStyleClass]=\"getPanelClass()\"\r\n [appendTo]=\"control.appendTo\" [styleClass]=\"'tn-dropdown'\"\r\n [emptyFilterMessage]=\"'Kh\u00F4ng t\u00ECm th\u1EA5y k\u1EBFt qu\u1EA3' | translate\" [disabled]=\"control.disabled ? true : null\"\r\n [autoZIndex]=\"true\" [showTransitionOptions]=\"showTransitionOptions\"\r\n [hideTransitionOptions]=\"hideTransitionOptions\" [maxItemDisplay]=\"control.maxItemDisplay\"\r\n [selectedItemsLabel]=\"control.selectedItemsLabel\" [maxSelectedLabels]=\"control.maxSelectedLabels\"\r\n [modifyOptionsWhenFilter]=\"modifyOptionWhenFilterMultiple\" [delayFilter]=\"delayFilter\" [(ngModel)]=\"_value\"\r\n (onChange)=\"onChangeSelected($event)\" (onClick)=\"onDropdownClickHandler($event)\"\r\n (onPanelShow)=\"onPanelShowHandler($event)\" (onPanelHide)=\"onHideHandler($event)\">\r\n <ng-template pTemplate=\"selectedItems\" let-value>\r\n <ng-container *ngIf=\"!value || value.length == 0\">{{control.placeholder}}</ng-container>\r\n <ng-container *ngIf=\"value && value.length > 0\">\r\n <span *ngFor=\"let selectedItem of value\" [class]=\"_itemSelectedStyleClass\">\r\n {{selectedItem[control.displayField]}}<span class=\"remove-item\"\r\n (click)=\"removeItem($event, selectedItem)\"><i class=\"fas fa-times\"></i></span>\r\n </span>\r\n </ng-container>\r\n </ng-template>\r\n </p-multiSelect>\r\n <input #inputMask class=\"input-mask hide p-inputtext\" type=\"text\" [disabled]=\"loading\"\r\n [(ngModel)]=\"valueSearchServer\" (keyup)=\"keyUp.next($event)\" />\r\n <button *ngIf=\"control.quickAdd && control.cols\" type=\"button\" pButton icon=\"pi pi-plus\"\r\n class=\"p-button-text p-button-rounded button-quick-add\" pTooltip=\"Th\u00EAm nhanh\" tooltipPosition=\"top\"\r\n (click)=\"showFormQuickAdd()\"></button>\r\n</div>\r\n<tn-dialog *ngIf=\"showQuickAddForm\" #dialog [styleClass]=\"'address-form'\"\r\n [header]=\"'Th\u00EAm m\u1EDBi ' + control.label | translate\" [popupSize]=\"control.popupSize\"\r\n (onHide)=\"showQuickAddForm = false\">\r\n <quick-add-form #formBase [parentModel]=\"model\" [parentContext]=\"context\" [model]=\"formModel\" [control]=\"control\"\r\n [baseService]=\"control.baseService\" (onSaved)=\"handleSaved()\" (onCancel)=\"handleCancel()\">\r\n </quick-add-form>\r\n</tn-dialog>",
34882
34885
  providers: [ComponentContextService],
34883
34886
  styles: [".tn-dropdown{display:flex}.tn-dropdown p-dropdown,.tn-dropdown p-multiSelect{flex:1 1;width:100%}.tn-dropdown>.button-quick-add{flex:0 0 auto}.input-mask{background:transparent;border:1px solid transparent;border-radius:3px;box-sizing:border-box;outline:none;padding-left:12px;position:absolute;width:100%;z-index:1}.input-mask.hide{display:none}.input-mask:focus{border-color:#2196f3;box-shadow:0 0 0 .2rem #a6d5fa}.custom-select-item{align-items:center;background:#d2eefb;border:1px solid #a9d8ff;border-radius:3px;display:inline-flex;margin:0 0 0 3px;padding:3px 5px}.custom-select-item>span{color:#555;font-size:12px;margin-left:3px}.custom-select-item>span i{font-size:10px}.custom-select-item.min{margin-left:2px;padding:1px 5px}.custom-select-item:first-child{margin-left:0}::ng-deep .tn-dropdown.ui-state-disabled .custom-select-item{background:#e1e1e1;border-color:#d4d4d4}::ng-deep .tn-dropdown.ui-state-disabled .custom-select-item>span{display:none}::ng-deep .ui-multiselect-filter-container .input-mask{box-sizing:border-box;height:22px;left:1px;padding:.2em;text-indent:1.5em;top:1px;width:calc(100% - 2px)}::ng-deep .ui-multiselect-filter-container .input-mask:focus{left:1px;width:calc(100% - 2px)}"]
34884
34887
  },] }