@po-ui/ng-components 16.5.0 → 16.6.1

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.
Files changed (24) hide show
  1. package/esm2022/lib/components/po-field/po-combo/interfaces/po-combo-literals-default.interface.mjs +9 -5
  2. package/esm2022/lib/components/po-field/po-combo/interfaces/po-combo-literals.interface.mjs +1 -1
  3. package/esm2022/lib/components/po-field/po-combo/po-combo-base.component.mjs +4 -1
  4. package/esm2022/lib/components/po-field/po-combo/po-combo.component.mjs +94 -41
  5. package/esm2022/lib/components/po-field/po-multiselect/po-multiselect.component.mjs +8 -3
  6. package/esm2022/lib/components/po-listbox/po-item-list/po-item-list.component.mjs +4 -4
  7. package/esm2022/lib/components/po-listbox/po-listbox.component.mjs +5 -4
  8. package/fesm2022/po-ui-ng-components.mjs +114 -47
  9. package/fesm2022/po-ui-ng-components.mjs.map +1 -1
  10. package/lib/components/po-field/po-combo/interfaces/po-combo-literals.interface.d.ts +2 -0
  11. package/lib/components/po-field/po-combo/po-combo.component.d.ts +8 -5
  12. package/lib/components/po-field/po-multiselect/po-multiselect.component.d.ts +1 -0
  13. package/package.json +4 -4
  14. package/po-ui-ng-components-16.6.1.tgz +0 -0
  15. package/schematics/ng-add/index.js +1 -1
  16. package/schematics/ng-update/v14/index.js +1 -1
  17. package/schematics/ng-update/v15/index.js +1 -1
  18. package/schematics/ng-update/v16/index.js +1 -1
  19. package/schematics/ng-update/v2/index.js +1 -1
  20. package/schematics/ng-update/v3/index.js +1 -1
  21. package/schematics/ng-update/v4/index.js +1 -1
  22. package/schematics/ng-update/v5/index.js +1 -1
  23. package/schematics/ng-update/v6/index.js +1 -1
  24. package/po-ui-ng-components-16.5.0.tgz +0 -0
@@ -5067,7 +5067,7 @@ function PoItemListComponent_div_3_Template(rf, ctx) { if (rf & 1) {
5067
5067
  i0.ɵɵelementStart(0, "div", 13);
5068
5068
  i0.ɵɵlistener("click", function PoItemListComponent_div_3_Template_div_click_0_listener() { i0.ɵɵrestoreView(_r13); const ctx_r12 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r12.onCheckboxItem()); })("keydown", function PoItemListComponent_div_3_Template_div_keydown_0_listener($event) { i0.ɵɵrestoreView(_r13); const ctx_r14 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r14.onCheckboxItemEmit($event)); })("keyup", function PoItemListComponent_div_3_Template_div_keyup_0_listener($event) { i0.ɵɵrestoreView(_r13); const ctx_r15 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r15.onCheckboxItemEmit($event)); });
5069
5069
  i0.ɵɵelementStart(1, "po-checkbox", 14);
5070
- i0.ɵɵlistener("p-change", function PoItemListComponent_div_3_Template_po_checkbox_p_change_1_listener() { i0.ɵɵrestoreView(_r13); const ctx_r16 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r16.onSelectItem({ label: ctx_r16.label })); });
5070
+ i0.ɵɵlistener("click", function PoItemListComponent_div_3_Template_po_checkbox_click_1_listener() { i0.ɵɵrestoreView(_r13); const ctx_r16 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r16.onCheckboxItem()); })("p-change", function PoItemListComponent_div_3_Template_po_checkbox_p_change_1_listener() { i0.ɵɵrestoreView(_r13); const ctx_r17 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r17.onSelectItem({ label: ctx_r17.label })); });
5071
5071
  i0.ɵɵelementEnd();
5072
5072
  i0.ɵɵtemplate(2, PoItemListComponent_div_3_span_2_Template, 2, 1, "span", 15);
5073
5073
  i0.ɵɵtemplate(3, PoItemListComponent_div_3_ng_template_3_Template, 0, 0, "ng-template", 11);
@@ -5164,7 +5164,7 @@ class PoItemListComponent extends PoItemListBaseComponent {
5164
5164
  } if (rf & 2) {
5165
5165
  let _t;
5166
5166
  i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.itemList = _t.first);
5167
- } }, features: [i0.ɵɵInheritDefinitionFeature], decls: 4, vars: 3, consts: [[3, "ngSwitch", "keydown"], ["class", "po-item-list po-item-list__action", 3, "po-item-list__separator", "po-item-list__disabled", "po-item-list__selected", "po-item-list__danger", 4, "ngSwitchDefault"], ["class", "po-item-list po-item-list__option", 3, "po-item-list__separator", "po-item-list__selected", "click", 4, "ngSwitchCase"], ["class", "po-item-list po-item-list__check", 3, "po-item-list__separator", "po-item-list__selected", "po-item-list__disabled", "click", "keydown", "keyup", 4, "ngSwitchCase"], [1, "po-item-list", "po-item-list__action"], ["itemList", ""], ["class", "po-popup-icon-item po-icon", 3, "p-icon", 4, "ngIf"], [1, "po-item-list-label"], [1, "po-popup-icon-item", "po-icon", 3, "p-icon"], [1, "po-item-list", "po-item-list__option", 3, "click"], ["class", "po-item-list-label", 3, "innerHTML", 4, "ngIf"], [3, "ngTemplateOutlet", "ngTemplateOutletContext"], [1, "po-item-list-label", 3, "innerHTML"], [1, "po-item-list", "po-item-list__check", 3, "click", "keydown", "keyup"], [3, "p-disabled-tabindex", "p-checkboxValue", "p-disabled", "p-change"], ["class", "po-item-list__label", 4, "ngIf"], [1, "po-item-list__label"]], template: function PoItemListComponent_Template(rf, ctx) { if (rf & 1) {
5167
+ } }, features: [i0.ɵɵInheritDefinitionFeature], decls: 4, vars: 3, consts: [[3, "ngSwitch", "keydown"], ["class", "po-item-list po-item-list__action", 3, "po-item-list__separator", "po-item-list__disabled", "po-item-list__selected", "po-item-list__danger", 4, "ngSwitchDefault"], ["class", "po-item-list po-item-list__option", 3, "po-item-list__separator", "po-item-list__selected", "click", 4, "ngSwitchCase"], ["class", "po-item-list po-item-list__check", 3, "po-item-list__separator", "po-item-list__selected", "po-item-list__disabled", "click", "keydown", "keyup", 4, "ngSwitchCase"], [1, "po-item-list", "po-item-list__action"], ["itemList", ""], ["class", "po-popup-icon-item po-icon", 3, "p-icon", 4, "ngIf"], [1, "po-item-list-label"], [1, "po-popup-icon-item", "po-icon", 3, "p-icon"], [1, "po-item-list", "po-item-list__option", 3, "click"], ["class", "po-item-list-label", 3, "innerHTML", 4, "ngIf"], [3, "ngTemplateOutlet", "ngTemplateOutletContext"], [1, "po-item-list-label", 3, "innerHTML"], [1, "po-item-list", "po-item-list__check", 3, "click", "keydown", "keyup"], [3, "p-disabled-tabindex", "p-checkboxValue", "p-disabled", "click", "p-change"], ["class", "po-item-list__label", 4, "ngIf"], [1, "po-item-list__label"]], template: function PoItemListComponent_Template(rf, ctx) { if (rf & 1) {
5168
5168
  i0.ɵɵelementContainerStart(0, 0);
5169
5169
  i0.ɵɵlistener("keydown", function PoItemListComponent_Template_ng_container_keydown_0_listener($event) { return ctx.onCheckboxItemEmit($event); });
5170
5170
  i0.ɵɵtemplate(1, PoItemListComponent_div_1_Template, 5, 12, "div", 1);
@@ -5181,7 +5181,7 @@ class PoItemListComponent extends PoItemListBaseComponent {
5181
5181
  }
5182
5182
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(PoItemListComponent, [{
5183
5183
  type: Component,
5184
- args: [{ selector: 'po-item-list', template: "<ng-container [ngSwitch]=\"type\" (keydown)=\"onCheckboxItemEmit($event)\">\n <div\n *ngSwitchDefault\n #itemList\n [class.po-item-list__separator]=\"separator\"\n [class.po-item-list__disabled]=\"disabled || !visible\"\n [class.po-item-list__selected]=\"selected && !disabled\"\n [attr.aria-disabled]=\"disabled || !visible\"\n [attr.aria-label]=\"label\"\n [class.po-item-list__danger]=\"danger\"\n class=\"po-item-list po-item-list__action\"\n >\n <po-icon *ngIf=\"icon\" class=\"po-popup-icon-item po-icon\" [p-icon]=\"icon\"></po-icon>\n <span class=\"po-item-list-label\">{{ label }}</span>\n </div>\n\n <div\n *ngSwitchCase=\"'option'\"\n #itemList\n class=\"po-item-list po-item-list__option\"\n [class.po-item-list__separator]=\"separator\"\n [class.po-item-list__selected]=\"selected && !disabled\"\n [attr.aria-disabled]=\"disabled\"\n [attr.aria-label]=\"label\"\n (click)=\"onComboItem(item, $event)\"\n >\n <span *ngIf=\"!template\" class=\"po-item-list-label\" [innerHTML]=\"getLabelFormatted(label)\"></span>\n\n <ng-template [ngTemplateOutlet]=\"template?.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: templateContext }\">\n </ng-template>\n </div>\n\n <div\n *ngSwitchCase=\"'check'\"\n class=\"po-item-list po-item-list__check\"\n [class.po-item-list__separator]=\"separator\"\n [class.po-item-list__selected]=\"selected && !disabled\"\n [class.po-item-list__disabled]=\"disabled\"\n [attr.aria-disabled]=\"disabled\"\n [attr.aria-label]=\"label\"\n (click)=\"onCheckboxItem()\"\n (keydown)=\"onCheckboxItemEmit($event)\"\n (keyup)=\"onCheckboxItemEmit($event)\"\n >\n <po-checkbox\n [p-disabled-tabindex]=\"true\"\n [p-checkboxValue]=\"checkboxValue === null ? 'mixed' : checkboxValue\"\n [p-disabled]=\"disabled\"\n (p-change)=\"onSelectItem({label})\"\n ></po-checkbox>\n\n <span class=\"po-item-list__label\" *ngIf=\"!template\">{{ label }}</span>\n\n <ng-template [ngTemplateOutlet]=\"template?.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: templateContext }\">\n </ng-template>\n </div>\n</ng-container>\n" }]
5184
+ args: [{ selector: 'po-item-list', template: "<ng-container [ngSwitch]=\"type\" (keydown)=\"onCheckboxItemEmit($event)\">\n <div\n *ngSwitchDefault\n #itemList\n [class.po-item-list__separator]=\"separator\"\n [class.po-item-list__disabled]=\"disabled || !visible\"\n [class.po-item-list__selected]=\"selected && !disabled\"\n [attr.aria-disabled]=\"disabled || !visible\"\n [attr.aria-label]=\"label\"\n [class.po-item-list__danger]=\"danger\"\n class=\"po-item-list po-item-list__action\"\n >\n <po-icon *ngIf=\"icon\" class=\"po-popup-icon-item po-icon\" [p-icon]=\"icon\"></po-icon>\n <span class=\"po-item-list-label\">{{ label }}</span>\n </div>\n\n <div\n *ngSwitchCase=\"'option'\"\n #itemList\n class=\"po-item-list po-item-list__option\"\n [class.po-item-list__separator]=\"separator\"\n [class.po-item-list__selected]=\"selected && !disabled\"\n [attr.aria-disabled]=\"disabled\"\n [attr.aria-label]=\"label\"\n (click)=\"onComboItem(item, $event)\"\n >\n <span *ngIf=\"!template\" class=\"po-item-list-label\" [innerHTML]=\"getLabelFormatted(label)\"></span>\n\n <ng-template [ngTemplateOutlet]=\"template?.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: templateContext }\">\n </ng-template>\n </div>\n\n <div\n *ngSwitchCase=\"'check'\"\n class=\"po-item-list po-item-list__check\"\n [class.po-item-list__separator]=\"separator\"\n [class.po-item-list__selected]=\"selected && !disabled\"\n [class.po-item-list__disabled]=\"disabled\"\n [attr.aria-disabled]=\"disabled\"\n [attr.aria-label]=\"label\"\n (click)=\"onCheckboxItem()\"\n (keydown)=\"onCheckboxItemEmit($event)\"\n (keyup)=\"onCheckboxItemEmit($event)\"\n >\n <po-checkbox\n [p-disabled-tabindex]=\"true\"\n [p-checkboxValue]=\"checkboxValue === null ? 'mixed' : checkboxValue\"\n [p-disabled]=\"disabled\"\n (click)=\"onCheckboxItem()\"\n (p-change)=\"onSelectItem({label})\"\n ></po-checkbox>\n\n <span class=\"po-item-list__label\" *ngIf=\"!template\">{{ label }}</span>\n\n <ng-template [ngTemplateOutlet]=\"template?.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: templateContext }\">\n </ng-template>\n </div>\n</ng-container>\n" }]
5185
5185
  }], function () { return [{ type: i1$1.DomSanitizer }]; }, { itemList: [{
5186
5186
  type: ViewChild,
5187
5187
  args: ['itemList', { static: true }]
@@ -5334,6 +5334,7 @@ function PoListBoxComponent_ng_container_4_li_4_Template(rf, ctx) { if (rf & 1)
5334
5334
  } if (rf & 2) {
5335
5335
  const item_r19 = ctx.$implicit;
5336
5336
  const ctx_r15 = i0.ɵɵnextContext(2);
5337
+ i0.ɵɵclassProp("po-listbox-item", ctx_r15.visible);
5337
5338
  i0.ɵɵproperty("cdkOption", item_r19[ctx_r15.fieldLabel])("cdkOptionDisabled", ctx_r15.returnBooleanValue(item_r19, "disabled") || ctx_r15.returnBooleanValue(item_r19, "visible") === false || item_r19.options);
5338
5339
  i0.ɵɵattribute("aria-selected", ctx_r15.isSelectedItem(item_r19) || item_r19.selected);
5339
5340
  i0.ɵɵadvance(1);
@@ -5345,7 +5346,7 @@ function PoListBoxComponent_ng_container_4_Template(rf, ctx) { if (rf & 1) {
5345
5346
  i0.ɵɵelementContainerStart(0);
5346
5347
  i0.ɵɵelementStart(1, "ul", 10, 11);
5347
5348
  i0.ɵɵtemplate(3, PoListBoxComponent_ng_container_4_li_3_Template, 2, 4, "li", 12);
5348
- i0.ɵɵtemplate(4, PoListBoxComponent_ng_container_4_li_4_Template, 3, 5, "li", 13);
5349
+ i0.ɵɵtemplate(4, PoListBoxComponent_ng_container_4_li_4_Template, 3, 7, "li", 13);
5349
5350
  i0.ɵɵelementEnd();
5350
5351
  i0.ɵɵelementContainerEnd();
5351
5352
  } if (rf & 2) {
@@ -5560,7 +5561,7 @@ class PoListBoxComponent extends PoListBoxBaseComponent {
5560
5561
  i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.listbox = _t.first);
5561
5562
  i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.listboxItemList = _t.first);
5562
5563
  i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.searchElement = _t.first);
5563
- } }, features: [i0.ɵɵInheritDefinitionFeature, i0.ɵɵNgOnChangesFeature], ngContentSelectors: _c4$5, decls: 12, vars: 8, consts: [[1, "po-listbox", 3, "hidden"], ["listbox", ""], [3, "p-literals", "p-field-value", "p-placeholder", "p-change", 4, "ngIf"], [4, "ngIf", "ngIfElse"], ["class", "po-text-center", 4, "ngIf"], ["scrollLoadingTemplate", ""], ["defaultLoadingTemplate", ""], ["noDataTemplate", ""], [3, "p-literals", "p-field-value", "p-placeholder", "p-change"], ["searchElement", ""], ["cdkListbox", "", 1, "po-listbox-list", 3, "cdkListboxMultiple"], ["listboxItemList", ""], ["cdkOption", "selectAll", 3, "click", "keydown", 4, "ngIf"], ["class", "po-listbox-item", 3, "cdkOption", "cdkOptionDisabled", "click", "keydown", 4, "ngFor", "ngForOf"], ["cdkOption", "selectAll", 3, "click", "keydown"], ["p-type", "check", "p-value", "selectAll", 3, "p-selected", "p-label", "p-checkbox-value"], [1, "po-listbox-item", 3, "cdkOption", "cdkOptionDisabled", "click", "keydown"], ["class", "po-combo-item-title", 4, "ngIf"], [3, "p-disabled", "p-visible", "p-checkbox-value", "p-label", "p-value", "p-selected", "p-separator", "p-danger", "p-icon", "p-type", "p-item", "p-field-value", "p-field-label", "p-template", "p-template-context", "p-search-value", "p-filter-mode", "p-filtering", "p-should-mark-letter", "p-compare-cache", "p-combo-service", "p-selectcheckbox-item", "p-selectcombo-item", "p-select-item", 4, "ngIf"], [1, "po-combo-item-title"], [3, "p-disabled", "p-visible", "p-checkbox-value", "p-label", "p-value", "p-selected", "p-separator", "p-danger", "p-icon", "p-type", "p-item", "p-field-value", "p-field-label", "p-template", "p-template-context", "p-search-value", "p-filter-mode", "p-filtering", "p-should-mark-letter", "p-compare-cache", "p-combo-service", "p-selectcheckbox-item", "p-selectcombo-item", "p-select-item"], [1, "po-text-center"], [4, "ngIf", "ngIfThen", "ngIfElse"], [1, "po-listbox-container-loading-scroll"], [1, "po-listbox-container-loading-default"], ["class", "po-listbox-container-no-data po-text-center", 4, "ngIf"], [1, "po-listbox-container-no-data", "po-text-center"]], template: function PoListBoxComponent_Template(rf, ctx) { if (rf & 1) {
5564
+ } }, features: [i0.ɵɵInheritDefinitionFeature, i0.ɵɵNgOnChangesFeature], ngContentSelectors: _c4$5, decls: 12, vars: 8, consts: [[1, "po-listbox", 3, "hidden"], ["listbox", ""], [3, "p-literals", "p-field-value", "p-placeholder", "p-change", 4, "ngIf"], [4, "ngIf", "ngIfElse"], ["class", "po-text-center", 4, "ngIf"], ["scrollLoadingTemplate", ""], ["defaultLoadingTemplate", ""], ["noDataTemplate", ""], [3, "p-literals", "p-field-value", "p-placeholder", "p-change"], ["searchElement", ""], ["cdkListbox", "", 1, "po-listbox-list", 3, "cdkListboxMultiple"], ["listboxItemList", ""], ["cdkOption", "selectAll", 3, "click", "keydown", 4, "ngIf"], [3, "po-listbox-item", "cdkOption", "cdkOptionDisabled", "click", "keydown", 4, "ngFor", "ngForOf"], ["cdkOption", "selectAll", 3, "click", "keydown"], ["p-type", "check", "p-value", "selectAll", 3, "p-selected", "p-label", "p-checkbox-value"], [3, "cdkOption", "cdkOptionDisabled", "click", "keydown"], ["class", "po-combo-item-title", 4, "ngIf"], [3, "p-disabled", "p-visible", "p-checkbox-value", "p-label", "p-value", "p-selected", "p-separator", "p-danger", "p-icon", "p-type", "p-item", "p-field-value", "p-field-label", "p-template", "p-template-context", "p-search-value", "p-filter-mode", "p-filtering", "p-should-mark-letter", "p-compare-cache", "p-combo-service", "p-selectcheckbox-item", "p-selectcombo-item", "p-select-item", 4, "ngIf"], [1, "po-combo-item-title"], [3, "p-disabled", "p-visible", "p-checkbox-value", "p-label", "p-value", "p-selected", "p-separator", "p-danger", "p-icon", "p-type", "p-item", "p-field-value", "p-field-label", "p-template", "p-template-context", "p-search-value", "p-filter-mode", "p-filtering", "p-should-mark-letter", "p-compare-cache", "p-combo-service", "p-selectcheckbox-item", "p-selectcombo-item", "p-select-item"], [1, "po-text-center"], [4, "ngIf", "ngIfThen", "ngIfElse"], [1, "po-listbox-container-loading-scroll"], [1, "po-listbox-container-loading-default"], ["class", "po-listbox-container-no-data po-text-center", 4, "ngIf"], [1, "po-listbox-container-no-data", "po-text-center"]], template: function PoListBoxComponent_Template(rf, ctx) { if (rf & 1) {
5564
5565
  i0.ɵɵprojectionDef(_c3$c);
5565
5566
  i0.ɵɵelementStart(0, "div", 0, 1);
5566
5567
  i0.ɵɵprojection(2);
@@ -5586,7 +5587,7 @@ class PoListBoxComponent extends PoListBoxBaseComponent {
5586
5587
  }
5587
5588
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(PoListBoxComponent, [{
5588
5589
  type: Component,
5589
- args: [{ selector: 'po-listbox', template: "<div\n #listbox\n class=\"po-listbox\"\n [class.po-listbox-check]=\"type === 'check' || type === 'option'\"\n [attr.data-type]=\"type\"\n [hidden]=\"visible\"\n>\n <ng-content select=\"[p-popup-header-template]\"></ng-content>\n\n <po-search-list\n #searchElement\n *ngIf=\"!hideSearch && type === 'check'\"\n (p-change)=\"callChangeSearch($event)\"\n [p-literals]=\"literalSearch\"\n [p-field-value]=\"fieldValueSearch\"\n [p-placeholder]=\"placeholderSearch\"\n ></po-search-list>\n\n <ng-container *ngIf=\"checkTemplate(); else noDataTemplate\">\n <ul #listboxItemList cdkListbox [cdkListboxMultiple]=\"type === 'check'\" class=\"po-listbox-list\">\n <li\n cdkOption=\"selectAll\"\n *ngIf=\"type === 'check' && items.length && !searchElement?.inputValue && !hideSelectAll\"\n [attr.aria-checked]=\"checkboxAllValue === null ? 'mixed' : checkboxAllValue\"\n (click)=\"changeAll.emit()\"\n (keydown)=\"changeAllEmit($event)\"\n >\n <po-item-list\n [p-selected]=\"checkboxAllValue\"\n p-type=\"check\"\n [p-label]=\"literals.selectAll\"\n p-value=\"selectAll\"\n [p-checkbox-value]=\"checkboxAllValue\"\n >\n </po-item-list>\n </li>\n <li\n class=\"po-listbox-item\"\n *ngFor=\"let item of items\"\n [cdkOption]=\"item[fieldLabel]\"\n [cdkOptionDisabled]=\"\n returnBooleanValue(item, 'disabled') || returnBooleanValue(item, 'visible') === false || item.options\n \"\n [attr.aria-selected]=\"isSelectedItem(item) || item.selected\"\n (click)=\"onSelectItem(item)\"\n (keydown)=\"onKeyDown(item, $event)\"\n >\n <label *ngIf=\"item.options\" class=\"po-combo-item-title\">\n {{ item.label }}\n </label>\n <po-item-list\n *ngIf=\"returnBooleanValue(item, 'visible') !== false && !item.options\"\n [p-disabled]=\"returnBooleanValue(item, 'disabled')\"\n [p-visible]=\"returnBooleanValue(item, 'visible')\"\n [p-checkbox-value]=\"isSelectedItem(item)\"\n [attr.data-item-list]=\"item | json\"\n [p-label]=\"item[fieldLabel]\"\n [p-value]=\"item[fieldValue]\"\n [p-selected]=\"isSelectedItem(item) || item.selected\"\n [p-separator]=\"item.separator\"\n [p-danger]=\"item.danger || item.type === 'danger'\"\n [p-icon]=\"item.icon\"\n [p-type]=\"type\"\n [p-item]=\"item\"\n [p-field-value]=\"fieldValue\"\n [p-field-label]=\"fieldLabel\"\n [p-template]=\"template\"\n [p-template-context]=\"item\"\n (p-selectcheckbox-item)=\"checkboxClicked($event)\"\n (p-selectcombo-item)=\"optionClicked($event)\"\n (p-select-item)=\"onSelectCheckBoxItem(item)\"\n [p-search-value]=\"searchValue\"\n [p-filter-mode]=\"filterMode\"\n [p-filtering]=\"isFiltering\"\n [p-should-mark-letter]=\"shouldMarkLetters\"\n [p-compare-cache]=\"compareCache\"\n [p-combo-service]=\"comboService\"\n ></po-item-list>\n </li>\n </ul>\n </ng-container>\n\n <div *ngIf=\"isServerSearching && type !== 'action'\" class=\"po-text-center\">\n <ng-container *ngIf=\"infiniteLoading; then scrollLoadingTemplate; else defaultLoadingTemplate\"></ng-container>\n </div>\n\n <ng-template #scrollLoadingTemplate>\n <po-loading-overlay class=\"po-listbox-container-loading-scroll\"></po-loading-overlay>\n </ng-template>\n\n <ng-template #defaultLoadingTemplate>\n <po-loading class=\"po-listbox-container-loading-default\"></po-loading>\n </ng-template>\n\n <ng-template #noDataTemplate>\n <div\n *ngIf=\"!items.length && !isServerSearching && type !== 'action'\"\n class=\"po-listbox-container-no-data po-text-center\"\n >\n <span> {{ literals.noItems }}</span>\n </div>\n </ng-template>\n</div>\n" }]
5590
+ args: [{ selector: 'po-listbox', template: "<div\n #listbox\n class=\"po-listbox\"\n [class.po-listbox-check]=\"type === 'check' || type === 'option'\"\n [attr.data-type]=\"type\"\n [hidden]=\"visible\"\n>\n <ng-content select=\"[p-popup-header-template]\"></ng-content>\n\n <po-search-list\n #searchElement\n *ngIf=\"!hideSearch && type === 'check'\"\n (p-change)=\"callChangeSearch($event)\"\n [p-literals]=\"literalSearch\"\n [p-field-value]=\"fieldValueSearch\"\n [p-placeholder]=\"placeholderSearch\"\n ></po-search-list>\n\n <ng-container *ngIf=\"checkTemplate(); else noDataTemplate\">\n <ul #listboxItemList cdkListbox [cdkListboxMultiple]=\"type === 'check'\" class=\"po-listbox-list\">\n <li\n cdkOption=\"selectAll\"\n *ngIf=\"type === 'check' && items.length && !searchElement?.inputValue && !hideSelectAll\"\n [attr.aria-checked]=\"checkboxAllValue === null ? 'mixed' : checkboxAllValue\"\n (click)=\"changeAll.emit()\"\n (keydown)=\"changeAllEmit($event)\"\n >\n <po-item-list\n [p-selected]=\"checkboxAllValue\"\n p-type=\"check\"\n [p-label]=\"literals.selectAll\"\n p-value=\"selectAll\"\n [p-checkbox-value]=\"checkboxAllValue\"\n >\n </po-item-list>\n </li>\n <li\n [class.po-listbox-item]=\"visible\"\n *ngFor=\"let item of items\"\n [cdkOption]=\"item[fieldLabel]\"\n [cdkOptionDisabled]=\"\n returnBooleanValue(item, 'disabled') || returnBooleanValue(item, 'visible') === false || item.options\n \"\n [attr.aria-selected]=\"isSelectedItem(item) || item.selected\"\n (click)=\"onSelectItem(item)\"\n (keydown)=\"onKeyDown(item, $event)\"\n >\n <label *ngIf=\"item.options\" class=\"po-combo-item-title\">\n {{ item.label }}\n </label>\n <po-item-list\n *ngIf=\"returnBooleanValue(item, 'visible') !== false && !item.options\"\n [p-disabled]=\"returnBooleanValue(item, 'disabled')\"\n [p-visible]=\"returnBooleanValue(item, 'visible')\"\n [p-checkbox-value]=\"isSelectedItem(item)\"\n [attr.data-item-list]=\"item | json\"\n [p-label]=\"item[fieldLabel]\"\n [p-value]=\"item[fieldValue]\"\n [p-selected]=\"isSelectedItem(item) || item.selected\"\n [p-separator]=\"item.separator\"\n [p-danger]=\"item.danger || item.type === 'danger'\"\n [p-icon]=\"item.icon\"\n [p-type]=\"type\"\n [p-item]=\"item\"\n [p-field-value]=\"fieldValue\"\n [p-field-label]=\"fieldLabel\"\n [p-template]=\"template\"\n [p-template-context]=\"item\"\n (p-selectcheckbox-item)=\"checkboxClicked($event)\"\n (p-selectcombo-item)=\"optionClicked($event)\"\n (p-select-item)=\"onSelectCheckBoxItem(item)\"\n [p-search-value]=\"searchValue\"\n [p-filter-mode]=\"filterMode\"\n [p-filtering]=\"isFiltering\"\n [p-should-mark-letter]=\"shouldMarkLetters\"\n [p-compare-cache]=\"compareCache\"\n [p-combo-service]=\"comboService\"\n ></po-item-list>\n </li>\n </ul>\n </ng-container>\n\n <div *ngIf=\"isServerSearching && type !== 'action'\" class=\"po-text-center\">\n <ng-container *ngIf=\"infiniteLoading; then scrollLoadingTemplate; else defaultLoadingTemplate\"></ng-container>\n </div>\n\n <ng-template #scrollLoadingTemplate>\n <po-loading-overlay class=\"po-listbox-container-loading-scroll\"></po-loading-overlay>\n </ng-template>\n\n <ng-template #defaultLoadingTemplate>\n <po-loading class=\"po-listbox-container-loading-default\"></po-loading>\n </ng-template>\n\n <ng-template #noDataTemplate>\n <div\n *ngIf=\"!items.length && !isServerSearching && type !== 'action'\"\n class=\"po-listbox-container-no-data po-text-center\"\n >\n <span> {{ literals.noItems }}</span>\n </div>\n </ng-template>\n</div>\n" }]
5590
5591
  }], function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: PoLanguageService }, { type: i2.Router }, { type: i0.ChangeDetectorRef }]; }, { listbox: [{
5591
5592
  type: ViewChild,
5592
5593
  args: ['listbox', { static: true }]
@@ -24133,19 +24134,23 @@ class PoComboOptionTemplateDirective {
24133
24134
  const poComboLiteralsDefault = {
24134
24135
  en: {
24135
24136
  noData: 'No data found',
24136
- chooseOption: 'Choose an option'
24137
+ chooseOption: 'Choose an option',
24138
+ clear: 'Clear'
24137
24139
  },
24138
24140
  es: {
24139
24141
  noData: 'Datos no encontrados',
24140
- chooseOption: 'Elija una opción'
24142
+ chooseOption: 'Elija una opción',
24143
+ clear: 'limpia'
24141
24144
  },
24142
24145
  pt: {
24143
24146
  noData: 'Nenhum dado encontrado',
24144
- chooseOption: 'Escolha uma opção'
24147
+ chooseOption: 'Escolha uma opção',
24148
+ clear: 'Apagar'
24145
24149
  },
24146
24150
  ru: {
24147
24151
  noData: 'Данные не найдены',
24148
- chooseOption: 'Выберите опцию'
24152
+ chooseOption: 'Выберите опцию',
24153
+ clear: 'чистый'
24149
24154
  }
24150
24155
  };
24151
24156
 
@@ -24910,6 +24915,9 @@ class PoComboBaseComponent {
24910
24915
  this.updateComboList();
24911
24916
  this.initInputObservable();
24912
24917
  this.updateHasNext();
24918
+ if (this.service || this.filterService) {
24919
+ this.keyupSubscribe.unsubscribe();
24920
+ }
24913
24921
  }
24914
24922
  configAfterSetFilterService(service) {
24915
24923
  if (service) {
@@ -25259,14 +25267,17 @@ function PoComboComponent_div_3_Template(rf, ctx) { if (rf & 1) {
25259
25267
  i0.ɵɵclassProp("po-field-icon-disabled", ctx_r1.disabled);
25260
25268
  i0.ɵɵproperty("p-icon", ctx_r1.icon);
25261
25269
  } }
25262
- function PoComboComponent_po_clean_7_Template(rf, ctx) { if (rf & 1) {
25270
+ function PoComboComponent_div_7_Template(rf, ctx) { if (rf & 1) {
25263
25271
  const _r13 = i0.ɵɵgetCurrentView();
25264
- i0.ɵɵelementStart(0, "po-clean", 17);
25265
- i0.ɵɵlistener("p-change-event", function PoComboComponent_po_clean_7_Template_po_clean_p_change_event_0_listener($event) { i0.ɵɵrestoreView(_r13); const ctx_r12 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r12.clear($event)); });
25272
+ i0.ɵɵelementStart(0, "div", 17);
25273
+ i0.ɵɵlistener("click", function PoComboComponent_div_7_Template_div_click_0_listener($event) { i0.ɵɵrestoreView(_r13); const ctx_r12 = i0.ɵɵnextContext(); ctx_r12.clear(null); return i0.ɵɵresetView($event.preventDefault()); })("keydown.enter", function PoComboComponent_div_7_Template_div_keydown_enter_0_listener($event) { i0.ɵɵrestoreView(_r13); const ctx_r14 = i0.ɵɵnextContext(); ctx_r14.clearAndFocus(); return i0.ɵɵresetView($event.preventDefault()); });
25274
+ i0.ɵɵelement(1, "span", 18);
25266
25275
  i0.ɵɵelementEnd();
25267
25276
  } if (rf & 2) {
25268
25277
  const ctx_r3 = i0.ɵɵnextContext();
25269
- i0.ɵɵproperty("p-element-ref", ctx_r3.inputEl);
25278
+ i0.ɵɵattribute("aria-label", ctx_r3.literals.clean);
25279
+ i0.ɵɵadvance(1);
25280
+ i0.ɵɵclassProp("po-border-focused", !ctx_r3.disabled && ctx_r3.comboOpen);
25270
25281
  } }
25271
25282
  function PoComboComponent_ng_container_10_Template(rf, ctx) { if (rf & 1) {
25272
25283
  i0.ɵɵelementContainer(0);
@@ -25275,7 +25286,7 @@ function PoComboComponent_ng_template_11_ng_container_0_Template(rf, ctx) { if (
25275
25286
  i0.ɵɵelementContainer(0);
25276
25287
  } }
25277
25288
  function PoComboComponent_ng_template_11_Template(rf, ctx) { if (rf & 1) {
25278
- i0.ɵɵtemplate(0, PoComboComponent_ng_template_11_ng_container_0_Template, 1, 0, "ng-container", 18);
25289
+ i0.ɵɵtemplate(0, PoComboComponent_ng_template_11_ng_container_0_Template, 1, 0, "ng-container", 19);
25279
25290
  } if (rf & 2) {
25280
25291
  i0.ɵɵnextContext();
25281
25292
  const _r10 = i0.ɵɵreference(17);
@@ -25285,23 +25296,23 @@ function PoComboComponent_ng_template_13_ng_template_0_ng_container_0_Template(r
25285
25296
  i0.ɵɵelementContainer(0);
25286
25297
  } }
25287
25298
  function PoComboComponent_ng_template_13_ng_template_0_Template(rf, ctx) { if (rf & 1) {
25288
- i0.ɵɵtemplate(0, PoComboComponent_ng_template_13_ng_template_0_ng_container_0_Template, 1, 0, "ng-container", 18);
25299
+ i0.ɵɵtemplate(0, PoComboComponent_ng_template_13_ng_template_0_ng_container_0_Template, 1, 0, "ng-container", 19);
25289
25300
  } if (rf & 2) {
25290
25301
  i0.ɵɵnextContext(2);
25291
25302
  const _r10 = i0.ɵɵreference(17);
25292
25303
  i0.ɵɵproperty("ngTemplateOutlet", _r10);
25293
25304
  } }
25294
25305
  function PoComboComponent_ng_template_13_Template(rf, ctx) { if (rf & 1) {
25295
- i0.ɵɵtemplate(0, PoComboComponent_ng_template_13_ng_template_0_Template, 1, 1, "ng-template", 19);
25306
+ i0.ɵɵtemplate(0, PoComboComponent_ng_template_13_ng_template_0_Template, 1, 1, "ng-template", 20);
25296
25307
  } if (rf & 2) {
25297
25308
  i0.ɵɵnextContext();
25298
25309
  const _r0 = i0.ɵɵreference(2);
25299
25310
  i0.ɵɵproperty("cdkConnectedOverlayOrigin", _r0)("cdkConnectedOverlayOpen", true);
25300
25311
  } }
25301
25312
  function PoComboComponent_ng_template_16_Template(rf, ctx) { if (rf & 1) {
25302
- const _r21 = i0.ɵɵgetCurrentView();
25303
- i0.ɵɵelementStart(0, "div", 20, 21)(2, "po-listbox", 22, 23);
25304
- i0.ɵɵlistener("p-selectcombo-item", function PoComboComponent_ng_template_16_Template_po_listbox_p_selectcombo_item_2_listener($event) { i0.ɵɵrestoreView(_r21); const ctx_r20 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r20.onOptionClick($event, $event.event)); })("p-update-infinite-scroll", function PoComboComponent_ng_template_16_Template_po_listbox_p_update_infinite_scroll_2_listener() { i0.ɵɵrestoreView(_r21); const ctx_r22 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r22.showMoreInfiniteScroll()); })("p-close", function PoComboComponent_ng_template_16_Template_po_listbox_p_close_2_listener() { i0.ɵɵrestoreView(_r21); const ctx_r23 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r23.onCloseCombo()); });
25313
+ const _r22 = i0.ɵɵgetCurrentView();
25314
+ i0.ɵɵelementStart(0, "div", 21, 22)(2, "po-listbox", 23, 24);
25315
+ i0.ɵɵlistener("p-selectcombo-item", function PoComboComponent_ng_template_16_Template_po_listbox_p_selectcombo_item_2_listener($event) { i0.ɵɵrestoreView(_r22); const ctx_r21 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r21.onOptionClick($event, $event.event)); })("p-update-infinite-scroll", function PoComboComponent_ng_template_16_Template_po_listbox_p_update_infinite_scroll_2_listener() { i0.ɵɵrestoreView(_r22); const ctx_r23 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r23.showMoreInfiniteScroll()); })("p-close", function PoComboComponent_ng_template_16_Template_po_listbox_p_close_2_listener() { i0.ɵɵrestoreView(_r22); const ctx_r24 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r24.onCloseCombo()); });
25305
25316
  i0.ɵɵelementEnd()();
25306
25317
  } if (rf & 2) {
25307
25318
  const ctx_r11 = i0.ɵɵnextContext();
@@ -25384,6 +25395,7 @@ class PoComboComponent extends PoComboBaseComponent {
25384
25395
  shouldMarkLetters = true;
25385
25396
  infiniteLoading = false;
25386
25397
  _isServerSearching = false;
25398
+ lastKey;
25387
25399
  clickoutListener;
25388
25400
  eventResizeListener;
25389
25401
  filterSubscription;
@@ -25467,6 +25479,10 @@ class PoComboComponent extends PoComboBaseComponent {
25467
25479
  onKeyDown(event) {
25468
25480
  const key = event.keyCode;
25469
25481
  const inputValue = event.target.value;
25482
+ if (event.shiftKey && key === PoKeyCodeEnum.tab) {
25483
+ this.controlComboVisibility(false);
25484
+ return;
25485
+ }
25470
25486
  // busca um registro quando acionar o tab
25471
25487
  if (this.service && key === PoKeyCodeEnum.tab && inputValue && !this.disabledTabFilter) {
25472
25488
  this.controlComboVisibility(false);
@@ -25474,8 +25490,8 @@ class PoComboComponent extends PoComboBaseComponent {
25474
25490
  }
25475
25491
  if (key === PoKeyCodeEnum.arrowDown) {
25476
25492
  event.preventDefault();
25477
- if (!this.service) {
25478
- this.poListbox?.setFocus();
25493
+ if (this.visibleOptions.length) {
25494
+ this.focusItem();
25479
25495
  }
25480
25496
  this.controlComboVisibility(true);
25481
25497
  this.isFiltering = this.changeOnEnter ? this.isFiltering : false;
@@ -25495,11 +25511,28 @@ class PoComboComponent extends PoComboBaseComponent {
25495
25511
  if (key === PoKeyCodeEnum.enter) {
25496
25512
  this.controlComboVisibility(true);
25497
25513
  }
25514
+ if (key === PoKeyCodeEnum.esc) {
25515
+ if (key === this.lastKey) {
25516
+ this.lastKey = '';
25517
+ if (this.selectedValue) {
25518
+ this.clearAndFocus();
25519
+ }
25520
+ return;
25521
+ }
25522
+ else {
25523
+ this.onCloseCombo();
25524
+ }
25525
+ }
25526
+ this.lastKey = event.keyCode;
25498
25527
  }
25499
25528
  onKeyUp(event) {
25500
25529
  const key = event.keyCode || event.which;
25501
25530
  const inputValue = event.target.value;
25502
- const isValidKey = key !== PoKeyCodeEnum.arrowUp && key !== PoKeyCodeEnum.arrowDown && key !== PoKeyCodeEnum.enter;
25531
+ const isValidKey = key !== PoKeyCodeEnum.arrowUp &&
25532
+ key !== PoKeyCodeEnum.arrowDown &&
25533
+ key !== PoKeyCodeEnum.enter &&
25534
+ key !== PoKeyCodeEnum.esc &&
25535
+ key !== PoKeyCodeEnum.tab;
25503
25536
  if (isValidKey) {
25504
25537
  if (inputValue) {
25505
25538
  if (!this.service && this.previousSearchValue !== inputValue) {
@@ -25542,24 +25575,29 @@ class PoComboComponent extends PoComboBaseComponent {
25542
25575
  });
25543
25576
  }
25544
25577
  }
25545
- controlApplyFilter(value) {
25578
+ controlApplyFilter(value, isArrowDown) {
25546
25579
  if ((!this.isProcessingValueByTab && (!this.selectedOption || value !== this.selectedOption[this.dynamicLabel])) ||
25547
25580
  !this.cache) {
25548
25581
  this.defaultService.hasNext = true;
25549
25582
  this.page = this.setPage();
25550
25583
  this.options = [];
25551
- this.applyFilter(value, true);
25584
+ this.applyFilter(value, true, isArrowDown);
25552
25585
  }
25553
25586
  this.isProcessingValueByTab = false;
25554
25587
  }
25555
- applyFilter(value, reset = false) {
25588
+ applyFilter(value, reset = false, isArrowDown) {
25556
25589
  if (this.defaultService.hasNext) {
25557
25590
  this.controlComboVisibility(false, reset);
25558
25591
  this.isServerSearching = true;
25559
25592
  const param = this.infiniteScroll
25560
25593
  ? { property: this.fieldLabel, value, page: this.page, pageSize: this.pageSize }
25561
25594
  : { property: this.fieldLabel, value };
25562
- this.filterSubscription = this.service.getFilteredData(param, this.filterParams).subscribe(items => this.setOptionsByApplyFilter(value, items, reset), error => this.onErrorFilteredData());
25595
+ this.filterSubscription = this.service.getFilteredData(param, this.filterParams).subscribe(items => {
25596
+ this.setOptionsByApplyFilter(value, items, reset);
25597
+ if (isArrowDown) {
25598
+ this.focusItem();
25599
+ }
25600
+ }, error => this.onErrorFilteredData());
25563
25601
  }
25564
25602
  }
25565
25603
  setOptionsByApplyFilter(value, items, reset = false) {
@@ -25593,14 +25631,14 @@ class PoComboComponent extends PoComboBaseComponent {
25593
25631
  this.isProcessingValueByTab = false;
25594
25632
  }, this.debounceTime);
25595
25633
  }
25596
- toggleComboVisibility() {
25634
+ toggleComboVisibility(isButton) {
25597
25635
  if (this.disabled) {
25598
25636
  return;
25599
25637
  }
25600
25638
  if (this.service && !this.disabledInitFilter) {
25601
25639
  this.applyFilterInFirstClick();
25602
25640
  }
25603
- this.controlComboVisibility(!this.comboOpen);
25641
+ this.controlComboVisibility(!this.comboOpen, false, isButton);
25604
25642
  }
25605
25643
  applyFilterInFirstClick() {
25606
25644
  if (this.isFirstFilter && !this.selectedValue) {
@@ -25609,8 +25647,8 @@ class PoComboComponent extends PoComboBaseComponent {
25609
25647
  this.applyFilter('', scrollingControl);
25610
25648
  }
25611
25649
  }
25612
- controlComboVisibility(toOpen, reset = false) {
25613
- toOpen ? this.open(reset) : this.close(reset);
25650
+ controlComboVisibility(toOpen, reset = false, isButton) {
25651
+ toOpen ? this.open(reset, isButton) : this.close(reset);
25614
25652
  }
25615
25653
  onCloseCombo() {
25616
25654
  this.controlComboVisibility(false);
@@ -25629,6 +25667,7 @@ class PoComboComponent extends PoComboBaseComponent {
25629
25667
  this.updateComboList([...this.cacheStaticOptions]);
25630
25668
  }
25631
25669
  this.previousSearchValue = this.selectedView[this.dynamicLabel];
25670
+ this.inputEl.nativeElement.focus();
25632
25671
  }
25633
25672
  calculateScrollTop(selectedItem, index) {
25634
25673
  if (!selectedItem.length || index <= 1) {
@@ -25676,9 +25715,12 @@ class PoComboComponent extends PoComboBaseComponent {
25676
25715
  keyCode !== 40 && // seta
25677
25716
  keyCode !== 93); // windows menu
25678
25717
  }
25679
- searchOnEnter(value) {
25680
- if (this.service && !this.selectedView && value.length >= this.filterMinlength) {
25681
- this.controlApplyFilter(value);
25718
+ searchOnEnterOrArrow(event, value) {
25719
+ if ((event.key === 'ArrowDown' || event.key === 'Enter') &&
25720
+ this.service &&
25721
+ !this.selectedView &&
25722
+ value.length >= this.filterMinlength) {
25723
+ this.controlApplyFilter(value, event.key === 'ArrowDown');
25682
25724
  }
25683
25725
  }
25684
25726
  showMoreInfiniteScroll() {
@@ -25688,6 +25730,10 @@ class PoComboComponent extends PoComboBaseComponent {
25688
25730
  this.page++;
25689
25731
  this.applyFilter('', true);
25690
25732
  }
25733
+ clearAndFocus() {
25734
+ this.clear(null);
25735
+ this.inputEl.nativeElement.focus();
25736
+ }
25691
25737
  adjustContainerPosition() {
25692
25738
  this.controlPosition.adjustPosition(poComboContainerPositionDefault);
25693
25739
  }
@@ -25706,6 +25752,7 @@ class PoComboComponent extends PoComboBaseComponent {
25706
25752
  this.comboIcon = 'po-icon-arrow-down';
25707
25753
  this.removeListeners();
25708
25754
  this.isFiltering = false;
25755
+ this.renderer.removeClass(this.inputEl.nativeElement, 'po-combo-input-focus');
25709
25756
  }
25710
25757
  initializeListeners() {
25711
25758
  this.removeListeners();
@@ -25729,7 +25776,7 @@ class PoComboComponent extends PoComboBaseComponent {
25729
25776
  this.updateComboList([]);
25730
25777
  this.controlComboVisibility(true);
25731
25778
  }
25732
- open(reset) {
25779
+ open(reset, isButton) {
25733
25780
  this.comboOpen = true;
25734
25781
  if (!reset && this.infiniteScroll) {
25735
25782
  if (!this.getInputValue()) {
@@ -25740,7 +25787,9 @@ class PoComboComponent extends PoComboBaseComponent {
25740
25787
  this.changeDetector.detectChanges();
25741
25788
  this.comboIcon = 'po-icon-arrow-up';
25742
25789
  this.initializeListeners();
25743
- this.inputEl.nativeElement.focus();
25790
+ isButton
25791
+ ? this.renderer.addClass(this.inputEl.nativeElement, 'po-combo-input-focus')
25792
+ : this.inputEl.nativeElement.focus();
25744
25793
  this.setContainerPosition();
25745
25794
  }
25746
25795
  removeListeners() {
@@ -25768,6 +25817,20 @@ class PoComboComponent extends PoComboBaseComponent {
25768
25817
  setScrollingControl() {
25769
25818
  return this.infiniteScroll ? true : false;
25770
25819
  }
25820
+ focusItem() {
25821
+ this.poListbox?.listboxItemList?.nativeElement.focus();
25822
+ setTimeout(() => {
25823
+ let item;
25824
+ if (this.selectedValue) {
25825
+ item = document.querySelector('.po-listbox-item[aria-selected="true"]');
25826
+ }
25827
+ else {
25828
+ item = document.querySelectorAll('.po-listbox-item')[0];
25829
+ }
25830
+ this.poListbox?.listboxItemList?.nativeElement.focus();
25831
+ item?.focus();
25832
+ });
25833
+ }
25771
25834
  static ɵfac = function PoComboComponent_Factory(t) { return new (t || PoComboComponent)(i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵdirectiveInject(i0.IterableDiffers), i0.ɵɵdirectiveInject(PoComboFilterService), i0.ɵɵdirectiveInject(i0.Renderer2), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(PoControlPositionService), i0.ɵɵdirectiveInject(PoLanguageService)); };
25772
25835
  static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: PoComboComponent, selectors: [["po-combo"]], contentQueries: function PoComboComponent_ContentQueries(rf, ctx, dirIndex) { if (rf & 1) {
25773
25836
  i0.ɵɵcontentQuery(dirIndex, PoComboOptionTemplateDirective, 7);
@@ -25800,16 +25863,16 @@ class PoComboComponent extends PoComboBaseComponent {
25800
25863
  useExisting: forwardRef(() => PoComboComponent),
25801
25864
  multi: true
25802
25865
  }
25803
- ]), i0.ɵɵInheritDefinitionFeature, i0.ɵɵNgOnChangesFeature], decls: 18, vars: 28, consts: [[3, "p-disabled", "p-id", "p-label", "p-optional", "p-required", "p-show-required"], ["cdkOverlayOrigin", "", 1, "po-field-container-content"], ["trigger", "cdkOverlayOrigin"], ["class", "po-field-icon-container-left", 4, "ngIf"], ["autocomplete", "off", "type", "text", 1, "po-input", "po-combo-input", 3, "ngClass", "disabled", "id", "placeholder", "required", "click", "keyup", "blur", "keyup.enter", "keydown"], ["inp", ""], [1, "po-field-icon-container-right"], ["class", "po-icon-input", 3, "p-element-ref", "p-change-event", 4, "ngIf"], [3, "click"], ["iconArrow", ""], [4, "ngIf", "ngIfThen", "ngIfElse"], ["dropdownDefault", ""], ["dropdownCDK", ""], [3, "p-help", "p-disabled"], ["dropdownListbox", ""], [1, "po-field-icon-container-left"], [1, "po-field-icon", "po-icon-input", 3, "p-icon"], [1, "po-icon-input", 3, "p-element-ref", "p-change-event"], [4, "ngTemplateOutlet"], ["cdkConnectedOverlay", "", 3, "cdkConnectedOverlayOrigin", "cdkConnectedOverlayOpen"], [1, "po-combo-container", 3, "hidden"], ["containerElement", ""], ["p-type", "option", 3, "p-items", "p-field-value", "p-field-label", "p-template", "p-search-value", "p-infinite-loading", "p-infinite-scroll", "p-filtering", "p-cache", "p-filter-mode", "p-visible", "p-is-searching", "p-should-mark-letter", "p-compare-cache", "p-combo-service", "p-infinite-scroll-distance", "p-selectcombo-item", "p-update-infinite-scroll", "p-close"], ["poListbox", "", "contentElement", ""]], template: function PoComboComponent_Template(rf, ctx) { if (rf & 1) {
25866
+ ]), i0.ɵɵInheritDefinitionFeature, i0.ɵɵNgOnChangesFeature], decls: 18, vars: 33, consts: [[3, "p-disabled", "p-id", "p-label", "p-optional", "p-required", "p-show-required"], ["cdkOverlayOrigin", "", 1, "po-field-container-content", "po-combo-container-content"], ["trigger", "cdkOverlayOrigin"], ["class", "po-field-icon-container-left", 4, "ngIf"], ["autocomplete", "off", "type", "text", 1, "po-combo-input", 3, "ngClass", "disabled", "id", "placeholder", "required", "click", "keyup", "blur", "keydown"], ["inp", ""], [1, "po-field-icon-container-right"], ["tabindex", "0", "role", "button", "class", "po-combo-clean", 3, "click", "keydown.enter", 4, "ngIf"], [1, "po-icon", "po-field-icon", "po-icon-input", 3, "click"], ["iconArrow", ""], [4, "ngIf", "ngIfThen", "ngIfElse"], ["dropdownDefault", ""], ["dropdownCDK", ""], [3, "p-help", "p-disabled"], ["dropdownListbox", ""], [1, "po-field-icon-container-left"], [1, "po-field-icon", "po-icon-input", 3, "p-icon"], ["tabindex", "0", "role", "button", 1, "po-combo-clean", 3, "click", "keydown.enter"], [1, "po-icon", "po-field-icon", "po-icon-clear-content"], [4, "ngTemplateOutlet"], ["cdkConnectedOverlay", "", 3, "cdkConnectedOverlayOrigin", "cdkConnectedOverlayOpen"], [1, "po-combo-container", 3, "hidden"], ["containerElement", ""], ["p-type", "option", 3, "p-items", "p-field-value", "p-field-label", "p-template", "p-search-value", "p-infinite-loading", "p-infinite-scroll", "p-filtering", "p-cache", "p-filter-mode", "p-visible", "p-is-searching", "p-should-mark-letter", "p-compare-cache", "p-combo-service", "p-infinite-scroll-distance", "p-selectcombo-item", "p-update-infinite-scroll", "p-close"], ["poListbox", "", "contentElement", ""]], template: function PoComboComponent_Template(rf, ctx) { if (rf & 1) {
25804
25867
  i0.ɵɵelementStart(0, "po-field-container", 0)(1, "div", 1, 2);
25805
25868
  i0.ɵɵtemplate(3, PoComboComponent_div_3_Template, 2, 3, "div", 3);
25806
25869
  i0.ɵɵelementStart(4, "input", 4, 5);
25807
- i0.ɵɵlistener("click", function PoComboComponent_Template_input_click_4_listener() { return ctx.toggleComboVisibility(); })("keyup", function PoComboComponent_Template_input_keyup_4_listener($event) { return ctx.onKeyUp($event); })("blur", function PoComboComponent_Template_input_blur_4_listener() { return ctx.onBlur(); })("keyup.enter", function PoComboComponent_Template_input_keyup_enter_4_listener($event) { return ctx.searchOnEnter($event.target.value); })("keydown", function PoComboComponent_Template_input_keydown_4_listener($event) { return ctx.onKeyDown($event); });
25870
+ i0.ɵɵlistener("click", function PoComboComponent_Template_input_click_4_listener() { return ctx.toggleComboVisibility(); })("keyup", function PoComboComponent_Template_input_keyup_4_listener($event) { return ctx.onKeyUp($event); })("blur", function PoComboComponent_Template_input_blur_4_listener() { return ctx.onBlur(); })("keyup", function PoComboComponent_Template_input_keyup_4_listener($event) { return ctx.searchOnEnterOrArrow($event, $event.target.value); })("keydown", function PoComboComponent_Template_input_keydown_4_listener($event) { return ctx.onKeyDown($event); });
25808
25871
  i0.ɵɵelementEnd();
25809
25872
  i0.ɵɵelementStart(6, "div", 6);
25810
- i0.ɵɵtemplate(7, PoComboComponent_po_clean_7_Template, 1, 1, "po-clean", 7);
25873
+ i0.ɵɵtemplate(7, PoComboComponent_div_7_Template, 2, 3, "div", 7);
25811
25874
  i0.ɵɵelementStart(8, "span", 8, 9);
25812
- i0.ɵɵlistener("click", function PoComboComponent_Template_span_click_8_listener() { return ctx.toggleComboVisibility(); });
25875
+ i0.ɵɵlistener("click", function PoComboComponent_Template_span_click_8_listener() { return ctx.toggleComboVisibility(true); });
25813
25876
  i0.ɵɵelementEnd()()();
25814
25877
  i0.ɵɵtemplate(10, PoComboComponent_ng_container_10_Template, 1, 0, "ng-container", 10);
25815
25878
  i0.ɵɵtemplate(11, PoComboComponent_ng_template_11_Template, 1, 1, "ng-template", null, 11, i0.ɵɵtemplateRefExtractor);
@@ -25829,15 +25892,14 @@ class PoComboComponent extends PoComboBaseComponent {
25829
25892
  i0.ɵɵproperty("ngClass", ctx.clean && _r2.value ? "po-input-double-icon-right" : "po-input-icon-right")("disabled", ctx.disabled)("id", ctx.id)("placeholder", ctx.disabled ? "" : ctx.placeholder)("required", ctx.required);
25830
25893
  i0.ɵɵattribute("name", ctx.name);
25831
25894
  i0.ɵɵadvance(3);
25832
- i0.ɵɵproperty("ngIf", ctx.clean && !ctx.disabled);
25895
+ i0.ɵɵproperty("ngIf", ctx.clean && !ctx.disabled && _r2.value);
25833
25896
  i0.ɵɵadvance(1);
25834
- i0.ɵɵclassMapInterpolate1("po-icon po-field-icon ", ctx.comboIcon, " po-icon-input");
25835
- i0.ɵɵclassProp("po-field-icon-disabled", ctx.disabled)("po-field-icon", !ctx.disabled);
25897
+ i0.ɵɵclassProp("po-field-icon-disabled", ctx.disabled)("po-icon-arrow-up", ctx.comboOpen)("po-icon-arrow-down", !ctx.comboOpen)("po-field-icon", !ctx.disabled)("po-combo-default-border", !ctx.disabled && _r2.value)("po-combo-background-arrow-up", !ctx.disabled && ctx.comboOpen);
25836
25898
  i0.ɵɵadvance(2);
25837
25899
  i0.ɵɵproperty("ngIf", ctx.appendBox)("ngIfThen", _r8)("ngIfElse", _r6);
25838
25900
  i0.ɵɵadvance(5);
25839
25901
  i0.ɵɵproperty("p-help", ctx.help)("p-disabled", ctx.disabled);
25840
- } }, dependencies: [i1.NgClass, i1.NgIf, i1.NgTemplateOutlet, i5.CdkConnectedOverlay, i5.CdkOverlayOrigin, PoCleanComponent, PoFieldContainerBottomComponent, PoFieldContainerComponent, PoIconComponent, PoListBoxComponent], encapsulation: 2, changeDetection: 0 });
25902
+ } }, dependencies: [i1.NgClass, i1.NgIf, i1.NgTemplateOutlet, i5.CdkConnectedOverlay, i5.CdkOverlayOrigin, PoFieldContainerBottomComponent, PoFieldContainerComponent, PoIconComponent, PoListBoxComponent], encapsulation: 2, changeDetection: 0 });
25841
25903
  }
25842
25904
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(PoComboComponent, [{
25843
25905
  type: Component,
@@ -25854,7 +25916,7 @@ class PoComboComponent extends PoComboBaseComponent {
25854
25916
  useExisting: forwardRef(() => PoComboComponent),
25855
25917
  multi: true
25856
25918
  }
25857
- ], template: "<po-field-container\n [p-disabled]=\"disabled\"\n [p-id]=\"id\"\n [p-label]=\"label\"\n [p-optional]=\"optional\"\n [p-required]=\"required\"\n [p-show-required]=\"showRequired\"\n>\n <div cdkOverlayOrigin #trigger=\"cdkOverlayOrigin\" class=\"po-field-container-content\">\n <div *ngIf=\"icon\" class=\"po-field-icon-container-left\">\n <po-icon class=\"po-field-icon po-icon-input\" [class.po-field-icon-disabled]=\"disabled\" [p-icon]=\"icon\"></po-icon>\n </div>\n\n <input\n #inp\n class=\"po-input po-combo-input\"\n [ngClass]=\"clean && inp.value ? 'po-input-double-icon-right' : 'po-input-icon-right'\"\n [class.po-input-icon-left]=\"icon\"\n autocomplete=\"off\"\n type=\"text\"\n [attr.name]=\"name\"\n [disabled]=\"disabled\"\n [id]=\"id\"\n [placeholder]=\"disabled ? '' : placeholder\"\n [required]=\"required\"\n (click)=\"toggleComboVisibility()\"\n (keyup)=\"onKeyUp($event)\"\n (blur)=\"onBlur()\"\n (keyup.enter)=\"searchOnEnter($event.target.value)\"\n (keydown)=\"onKeyDown($event)\"\n />\n\n <div class=\"po-field-icon-container-right\">\n <po-clean\n class=\"po-icon-input\"\n *ngIf=\"clean && !disabled\"\n (p-change-event)=\"clear($event)\"\n [p-element-ref]=\"inputEl\"\n >\n </po-clean>\n <span\n #iconArrow\n class=\"po-icon po-field-icon {{ comboIcon }} po-icon-input\"\n [class.po-field-icon-disabled]=\"disabled\"\n [class.po-field-icon]=\"!disabled\"\n (click)=\"toggleComboVisibility()\"\n >\n </span>\n </div>\n </div>\n\n <ng-container *ngIf=\"appendBox; then dropdownCDK; else dropdownDefault\"> </ng-container>\n\n <ng-template #dropdownDefault>\n <ng-container *ngTemplateOutlet=\"dropdownListbox\"> </ng-container>\n </ng-template>\n\n <ng-template #dropdownCDK>\n <ng-template cdkConnectedOverlay [cdkConnectedOverlayOrigin]=\"trigger\" [cdkConnectedOverlayOpen]=\"true\">\n <ng-container *ngTemplateOutlet=\"dropdownListbox\"></ng-container>\n </ng-template>\n </ng-template>\n\n <po-field-container-bottom [p-help]=\"help\" [p-disabled]=\"disabled\"></po-field-container-bottom>\n</po-field-container>\n\n<ng-template #dropdownListbox>\n <div #containerElement class=\"po-combo-container\" [hidden]=\"!comboOpen && !isServerSearching\">\n <po-listbox\n #poListbox\n #contentElement\n p-type=\"option\"\n [p-items]=\"visibleOptions\"\n [p-field-value]=\"dynamicValue\"\n [p-field-label]=\"dynamicLabel\"\n [p-template]=\"comboOptionTemplate\"\n [p-search-value]=\"getInputValue()\"\n [p-infinite-loading]=\"infiniteLoading\"\n [p-infinite-scroll]=\"infiniteScroll\"\n [p-filtering]=\"isFiltering\"\n [p-cache]=\"cache\"\n (p-selectcombo-item)=\"onOptionClick($event, $event.event)\"\n [p-filter-mode]=\"filterMode\"\n [p-visible]=\"comboOpen\"\n [p-is-searching]=\"isServerSearching\"\n [p-should-mark-letter]=\"shouldMarkLetters\"\n [p-compare-cache]=\"compareObjects(cacheOptions, visibleOptions)\"\n [p-combo-service]=\"service\"\n [p-infinite-scroll-distance]=\"infiniteScrollDistance\"\n (p-update-infinite-scroll)=\"showMoreInfiniteScroll()\"\n (p-close)=\"onCloseCombo()\"\n ></po-listbox>\n </div>\n</ng-template>\n" }]
25919
+ ], template: "<po-field-container\n [p-disabled]=\"disabled\"\n [p-id]=\"id\"\n [p-label]=\"label\"\n [p-optional]=\"optional\"\n [p-required]=\"required\"\n [p-show-required]=\"showRequired\"\n>\n <div cdkOverlayOrigin #trigger=\"cdkOverlayOrigin\" class=\"po-field-container-content po-combo-container-content\">\n <div *ngIf=\"icon\" class=\"po-field-icon-container-left\">\n <po-icon class=\"po-field-icon po-icon-input\" [class.po-field-icon-disabled]=\"disabled\" [p-icon]=\"icon\"></po-icon>\n </div>\n\n <input\n #inp\n class=\"po-combo-input\"\n [ngClass]=\"clean && inp.value ? 'po-input-double-icon-right' : 'po-input-icon-right'\"\n [class.po-input-icon-left]=\"icon\"\n autocomplete=\"off\"\n type=\"text\"\n [attr.name]=\"name\"\n [disabled]=\"disabled\"\n [id]=\"id\"\n [placeholder]=\"disabled ? '' : placeholder\"\n [required]=\"required\"\n (click)=\"toggleComboVisibility()\"\n (keyup)=\"onKeyUp($event)\"\n (blur)=\"onBlur()\"\n (keyup)=\"searchOnEnterOrArrow($event, $event.target.value)\"\n (keydown)=\"onKeyDown($event)\"\n />\n\n <div class=\"po-field-icon-container-right\">\n <div\n tabindex=\"0\"\n role=\"button\"\n [attr.aria-label]=\"literals.clean\"\n *ngIf=\"clean && !disabled && inp.value\"\n class=\"po-combo-clean\"\n (click)=\"clear(null); $event.preventDefault()\"\n (keydown.enter)=\"clearAndFocus(); $event.preventDefault()\"\n >\n <span\n [class.po-border-focused]=\"!disabled && comboOpen\"\n class=\"po-icon po-field-icon po-icon-clear-content\"\n ></span>\n </div>\n <span\n #iconArrow\n class=\"po-icon po-field-icon po-icon-input\"\n [class.po-field-icon-disabled]=\"disabled\"\n [class.po-icon-arrow-up]=\"comboOpen\"\n [class.po-icon-arrow-down]=\"!comboOpen\"\n [class.po-field-icon]=\"!disabled\"\n [class.po-combo-default-border]=\"!disabled && inp.value\"\n [class.po-combo-background-arrow-up]=\"!disabled && comboOpen\"\n (click)=\"toggleComboVisibility(true)\"\n >\n </span>\n </div>\n </div>\n\n <ng-container *ngIf=\"appendBox; then dropdownCDK; else dropdownDefault\"> </ng-container>\n\n <ng-template #dropdownDefault>\n <ng-container *ngTemplateOutlet=\"dropdownListbox\"> </ng-container>\n </ng-template>\n\n <ng-template #dropdownCDK>\n <ng-template cdkConnectedOverlay [cdkConnectedOverlayOrigin]=\"trigger\" [cdkConnectedOverlayOpen]=\"true\">\n <ng-container *ngTemplateOutlet=\"dropdownListbox\"></ng-container>\n </ng-template>\n </ng-template>\n\n <po-field-container-bottom [p-help]=\"help\" [p-disabled]=\"disabled\"></po-field-container-bottom>\n</po-field-container>\n\n<ng-template #dropdownListbox>\n <div #containerElement class=\"po-combo-container\" [hidden]=\"!comboOpen && !isServerSearching\">\n <po-listbox\n #poListbox\n #contentElement\n p-type=\"option\"\n [p-items]=\"visibleOptions\"\n [p-field-value]=\"dynamicValue\"\n [p-field-label]=\"dynamicLabel\"\n [p-template]=\"comboOptionTemplate\"\n [p-search-value]=\"getInputValue()\"\n [p-infinite-loading]=\"infiniteLoading\"\n [p-infinite-scroll]=\"infiniteScroll\"\n [p-filtering]=\"isFiltering\"\n [p-cache]=\"cache\"\n (p-selectcombo-item)=\"onOptionClick($event, $event.event)\"\n [p-filter-mode]=\"filterMode\"\n [p-visible]=\"comboOpen\"\n [p-is-searching]=\"isServerSearching\"\n [p-should-mark-letter]=\"shouldMarkLetters\"\n [p-compare-cache]=\"compareObjects(cacheOptions, visibleOptions)\"\n [p-combo-service]=\"service\"\n [p-infinite-scroll-distance]=\"infiniteScrollDistance\"\n (p-update-infinite-scroll)=\"showMoreInfiniteScroll()\"\n (p-close)=\"onCloseCombo()\"\n ></po-listbox>\n </div>\n</ng-template>\n" }]
25858
25920
  }], function () { return [{ type: i0.ElementRef }, { type: i0.IterableDiffers }, { type: PoComboFilterService }, { type: i0.Renderer2 }, { type: i0.ChangeDetectorRef }, { type: PoControlPositionService }, { type: PoLanguageService }]; }, { comboOptionTemplate: [{
25859
25921
  type: ContentChild,
25860
25922
  args: [PoComboOptionTemplateDirective, { static: true }]
@@ -32216,6 +32278,7 @@ class PoMultiselectComponent extends PoMultiselectBaseComponent {
32216
32278
  initCalculateItems = true;
32217
32279
  isCalculateVisibleItems = true;
32218
32280
  cacheOptions;
32281
+ focusOnTag = false;
32219
32282
  constructor(renderer, changeDetector, el, controlPosition, defaultService, languageService) {
32220
32283
  super(languageService);
32221
32284
  this.renderer = renderer;
@@ -32367,8 +32430,11 @@ class PoMultiselectComponent extends PoMultiselectBaseComponent {
32367
32430
  this.onModelTouched?.();
32368
32431
  }
32369
32432
  onKeyDown(event) {
32370
- if ((event.keyCode === PoKeyCodeEnum.tab && this.visibleTags.length > 1) ||
32371
- (event.keyCode === PoKeyCodeEnum.tab && this.visibleTags.length < 1)) {
32433
+ if (event.shiftKey && event.keyCode === PoKeyCodeEnum.tab && !this.focusOnTag) {
32434
+ this.controlDropdownVisibility(false);
32435
+ }
32436
+ this.focusOnTag = false;
32437
+ if (event.keyCode === PoKeyCodeEnum.tab) {
32372
32438
  return;
32373
32439
  }
32374
32440
  if (event.keyCode === PoKeyCodeEnum.esc) {
@@ -32571,6 +32637,7 @@ class PoMultiselectComponent extends PoMultiselectBaseComponent {
32571
32637
  const KEY_SPACE = 'Space';
32572
32638
  const KEY_ARROW_LEFT = 'ArrowLeft';
32573
32639
  const KEY_ARROW_RIGHT = 'ArrowRight';
32640
+ this.focusOnTag = true;
32574
32641
  if (event.code === KEY_SPACE) {
32575
32642
  event.preventDefault();
32576
32643
  event.stopPropagation();